Sunday, July 18, 2010

Calibre E-book Library on Ubuntu Lucid with Amazon Kindle

Amazon just had a big sale on 2nd-gen Kindle E-readers, so I picked one up. I am completely happy with the reader and I love the screen, but I am not so happy with the relatively small number of file formats the Kindle supports. I have picked up quite a few ebooks over the years, mostly in Epub and .lit formats, but with sprinklings of a number of other formats, as well, none of which are natively recognized by the Kindle.

Luckily, there's a wonderful piece of software available, known as Calibre, which is capable of converting the vast majority of the myriad ebook formats into the digitally signed .mobi format that the Kindle loves so much.

In addition to the conversion capability, Calibre is essentially an ebook library management tool similar to what is available for music files, such as iTunes, winamp, etc., with support for metadata, covers and so forth. It also has syncing support for a variety of e-readers, including the Kindle, the iPad, Sony's E-Reader and more, though some require additional software support.

As far as I know, Calibre is the only software of its kind and it is, thankfully, free, open-source and multiplatform. You can download it here, or from Ubuntu's official repositories. If you get it from the repositories, though, be aware that it does not come it's own copy of, which will cause it to choke on compressed archives, such as .cbr comic book archives and any otherwise compatible ebook files contained within .rar archives, usually with an error something like this:
OSError: cannot open shared object file: No such file or directory
This error will occur even if you the unrar and unrar-nonfree packages installed, and I am not aware of any packages that will provide However, you can download a precompiled (32-bit) version here.

To install it, decompress the .tar.gz archive by right-clicking on it and selecting 'Extract Here.' This will decompress the archive into a directory that is misleadingly named (the real library binary is inside *that* directory). So, open a terminal, navigate to the newly decompressed directory and type:
sudo cp /usr/lib/
After that, you should be ready to run by either choosing it from the 'Office' section of the Ubuntu menu or by typing calibre into a terminal.

Once you get it up and running, the preferences are extensive. You can choose how it interprets metadata from filenames (I still can't get this configured properly for some reason; it always either pulls the names in wrong or swaps the names and the titles), how converted books are formatted and an array of other options.

You can set up an email address (or use an existing email server) to send books wirelessly to supported ereaders, but be careful if you own a Kindle because Amazon charges for anything that gets emailed to your device (15 cents per MB at the time of this writing). This in mind, I'll be sticking with USB transfers.

My personal favorite feature of Calibre is the Web interface, which makes your library available to you anywhere in the world via Web browser. To set it up, you just turn on the included Web server via Preferences > Content Server and set up a username and password to use for login. If you have a dynamic IP address (as is the case with most cable internet), you'll also need to get a static IP address from one of the many providers, such as, and port-forward port 8080 through your router. This server feature works well with the minimize-to-the-notification-area feature, which makes it less obtrusive while running in the background.

Furthermore, for people with an iPad, the free ereader app Stanza can connect to your Calibre Web library to sync, which is very cool.

What with the conversion, organization and available-anywhere-there's-internet server, Calibre is a pretty awesome piece of software. However, I do have some complaints:

No native .doc support
. It would have been really nice if Calibre could at least convert .doc files to other formats, presumably via an external library (similar to the rar support) or an API. Maybe the author could work out something like this. As it is, it just coughs up errors if you try to convert them and opens OpenOffice.Org if you try to view them.

Crashy as hell. Any time I try to do anything with a batch job, Calibre freezes and crashes. This is a serious annoyance, but I think it'll be fine once I get everything set up. I expect that, once I get everything tagged and converted to .mobi, I won't have to use any of the really destabilizing features--specifically, the batch stuff--with any regularity.

Wednesday, July 7, 2010

What's New In the Filthy Pants PPA

I originally created my Personal Package Archive (PPA) to distribute my SVN builds of HandBrake, which has worked out really well. However, I have since added a number of programs, the functions of which may be a bit esoteric to some, so I thought I would take some time to explain what each program does (in alphabetical order):


An anonymous, encrypted BitTorrent client built using free and Open Source code. It uses an advanced, planned mix network to protect users' identities, though it will not magically make your illegal torrents safe.

The client routes packets through a number of intermediary nodes before they reach their final destination. The intermediary nodes cannot confirm what information their neighbors are sharing or whether they are the source of the information or simply a relay point. Additionally, all communication with both peers and trackers via Anomos is end-to-end encrypted.

Here's a screenshot:


In the simplest terms, BSNES is an emulator for the Super Nintendo Entertainment System (SNES). However, it was written primarily by a determined individual known as byuu whose goal was to create the cleanest, most accurate SNES emulator in the world, using entirely from-scratch code (i.e., without reusing code from existing emulators, such as SNES9X).

BSNES is so accurate, in fact, that it has reached nearly 100% compatibility with commercially produced games--even the ones with crazy, specialized chips, like Star Ocean--without the use of buggy, game-specific speed hacks.

Unfortunately, great accuracy comes at the price of insanely high hardware requirements: to get full 60 fps, users will need a high-clocked Core2Duo or AMD Phenom/Athlon II cpu.

BSNES supports a number of attractive video filters, including HQ2X and SuperSAI, as well as OpenGL-based pixel shader filters with compatible graphics cards and drivers.

I include 3 separate packages for bsnes in my PPA: the standard Phoenix/GTK-based GUI (bsnes-gtk), the older, now-deprecated Qt GUI (bsnes) and an optimized build of the Qt GUI (bsnes-sse2).

Here's a screenshot:


Another piece of software from BSNES author byuu, Curse is a barebones, no-frills hex-editor. It must be invoked from the command line (e.g., curse [file to edit]) but will then open a window displaying the hexadecimal data. Like BSNES, Curse's code is written with a focus on cleanliness and efficiency. It's missing some features that would be handy, but it's still one of the only programs of its kind on Linux that doesn't require Mono....

Here's a screenshot:


Dolphin-Emu (not to be confused with Dolphin the file manager) began its life years ago as a Nintendo GameCube emulator. When Nintendo decided to keep the Wii's architecture relatively unchanged from that of the GameCube (the proverbial "two GameCubes duct-taped together"), the emulator was adapted to work with Wiimotes via bluetooth and Dolphin-Emu became the first game console emulator to play commercial games at full speed during the life cycle of the console.

In addition to full-speed emulation of many commercial games, Dolphin-Emu offers support for high-definition upscaling of graphics, along with high-resolution textures and support for shader-based filters.

Here's a screenshot of it playing Ikaruga:


A highly useful video transcoding tool designed originally to rip DVDs but later updated to support transcoding of nearly any file that can be decoded by FFmpeg/libavcodec.

The program is geared mostly toward the use of the open-source x264 codec, but it also supports FFmpeg's mpeg4 and Ogg/Theora codecs. It also supports AC3 and DTS passthru, as well as support for soft subtitles and some support for vobsubs.

My packages are updated whenever major features are added or codecs are updated.

Here's a screenshot:


This was an attempt by a fellow named gonza to update HandBrake's extremely deprecated QT4 GUI code to something functional. Unfortunately, he didn't stick with it long enough to satisfy the other HB devs and his code was never included in the official SVN repository.

This package is here in case anyone wants to use it, though it is sorely outdated.


This is a library used to interface with Wiimotes via bluetooth. It is required by Dolphin-Emu and is supposed to be built automatically as part of its build process. Unfortunately, this did not work on the Launchpad build farm, so I just bundled it separately and included it as a dependency for Dolphin-Emu.


This is a build of the highly accurate, cross-platform NES emulator, NEStopia. This emulator is cycle-accurate and supports some nice filters, including blargg's awesome NTSC filter, which is also available in bsnes.

Here's a screenshot:

Nvidia-Cg-Toolkit (no longer available)

This is a set of proprietary libraries and tools created by Nvidia. They are used in several modern emulators, including Dolphin-Emu and PCSX2. Since the source code is not available for these tools, the package contains the binaries for both i386 and AMD64 architectures, and the appropriate ones for your system will be copied into the appropriate directories.


This is a Debian fork of the popular PCSX Sony Playstation emulator. It is highly compatible with commercial games and uses plugins to add features and functionality. This is a more recent version than the one included in the Ubuntu Universe repository.


Another fork of PCSX, this variation has a bit more active development.

Here's a screenshot:

rtmpdump (no longer available)

This is a toolkit for RTMP streams, with all forms of RTMP supported, including rtmp, rtmpt, rtmpe, rtmpte and rtmps. In addition to rtmpdump, this package includes the server programs rtmpsrv and rtmpsuck. These tools can be used to listen in on rtmp server handshakes and give access to unencrypted streams. This allows users to download encrypted and obfuscated streams, such as those used to stream television shows from network websites (e.g.,


This tool automatically removes headers from ROM images and is a must-have for use with bsnes' Phoenix/GTK GUI, which does not support libsnesreader and all of the fancy file formats that entails (.smc and all of the other myriad SNES file extensions, as well as compressed archives). This version presents a fancy, polished GUI that facilitates large-scale, batch purification.

Here's a screenshot:


Yet another piece of software from BSNES author byuu, Upset is a lightweight UPS patcher for use by ROM-hackers. As with his other software, Upset's code is focused on portability and cleanliness.


An actively-developed variant of the popular Gameboy Advance emulator, VisualBoy Advance. It has a nice GUI and performs a bit better than the standard VBA package.

Here's a screenshot:

VLC (no longer available)

This media player is based on FFmpeg/libavcodec and will play almost any video file you throw at it, without the need for external codecs. While there is already a package included in the official Ubuntu repositories, this updated version includes support for Google's WebM format.

Analytics Tracking Footer