InfiniteTTT 0.6 Released

InfiniteTTT 0.6 was released today. The main change in the new version is that the game is now multithreaded.

InfiniteTTT is a variation of Tic-Tac-Toe that is played on an infinite board.

The new version has a new multithreaded AI engine, and several minor fixes and improvements. The changes improve the user experience and make the game more responsive. The new release contains binaries for Windows, a source package, and a Gentoo ebuild. Packages for other Linux distributions will follow soon (help would be appreciated).

To download the new version, visit InfiniteTTT’s download page.

radio.py Station List Patch

Some of the stations in radio.py-0.5 changed their URLs or streams. The patch updates the stream URLs of three stations: Galgalatz, Galatz, and Radius.

To apply the patch and update radio.py, open a terminal and cd to the directory where you installed it. Type the following commands in the terminal (if you installed it as root, you’ll need to run the commands as root too).

$ wget "http://www.guyrutenberg.com/wp-content/uploads/2008/11/radio.py.patch"
$ patch radio.py < radio.py.patch
$ rm radio.py.patch

tarsum – Calculate Checksums for Files inside a Tar Archive

Update: I’ve released tarsum-0.2, a new version of tarsum.

Some time ago, I got a hard disk back from data recovery. One of the annoying issues I encountered with the recovered data was corrupted files. Some files looked like they were recovered successfully, but their content was corrupted. The ones that were configuration files were usually easy to detect, as they raised errors in programs that tried to use them. But when such an error occurs in some general text file (or inside the data of an SQL dump), the file may seem perfectly fine unless closely inspected.

I have a habit of storing old backups on CDs (they are initially made to online storage). I do it in order to reduce backup costs. But the recovered/corrupted data issue raised some concerns about my ability to recover using these disks. Assuming that I have a disk failure, and I couldn’t recover from my online backups for some reason, how can I check the integrity of my CD backups?

Only storing and comparing a hash signature for the whole archive is almost useless. It allows you to validate whether all the files are probably fine, but it can’t tell apart one corrupted file in the archive from a completely corrupted archive. My idea was to calculate a checksum (hash) for each file in the data and store the signature in a way that would allow me to see which individual files are corrupted.

This is where tarsum comes to the rescue. As its name implies, it calculates a checksum for each file in the archive. You can download tarsum from here.

Using tarsum is pretty straightforward.

tarsum backup.tar > backup.tar.md5

Calculates the MD5 checksums of the files. You can specify other hashes as well, by passing a tool that calculates them (it must work like md5sum).

tarsum --checksum=sha256sum backup.tar > backup.tar.sha256

To verify the integrity of the files inside the archive, we use the diff command:

tarsum backup.tar | diff backup.tar.md5 -

where backup.tar.md5 is the original signature file we created. This is possible because the signatures are sorted alphabetically by the file name inside the archive, so the order of the files is always the same.

Note that if you use an updated version of GNU tar, tarsum can also operate directly on compressed archives (e.g. tar.bz2, tar.gz).

radio.py-0.5 – An Easy Interface for Listening to Radio under Linux

This new release of radio.py brings more predefined stations and the much wanted recording feature. radio.py is a Python wrapper for mplayer, designed to provide an easy-to-use interface for listening to radio from the command line. And indeed, using radio.py is very easy; just pass the station name.

radio.py Classic FM

To read more about radio.py and the existing features, go to radio.py – a Wrapper Script for Listening to Radio in Linux.

New stations in this release include Ram FM, Classic FM, Radio Caroline, and updates to all the radioIO stations. So overall, this version of radio.py comes with 81 predefined stations. To see the full list of recognized stations, run radio.py --list. If your favorite station is still missing, you can add it via configuration files, as described here. If you send a comment with the names of the stations and their websites, I’ll add them to the next release.

The other important new feature is the ability to record radio streams to mp3 directly from radio.py. This is done using the --record command-line switch. For example, the following

radio.py CNN --record cnn.mp3

will record the radio stream of CNN to a file called cnn.mp3. To stop recording, just press ‘q’. This option can also be used with --sleep and --wake-up to time your recordings. For example, if you want to record a show that starts in 30 minutes and is 60 minutes long, you should do

radio.py BBC1 --record bbc1.mp3 --wake-up 30 --sleep 60

You can download the new version from here. Installation is pretty straightforward: just untar the archive and put radio.py somewhere in your path (e.g. /usr/local/bin/), and the package is installed.

As always, if you want new stations added to the next release, send a comment with the station details (at least the name and website).

UPDATE 14/12/2008: I’ve changed the download link to point to radio.py‘s SourceForge project page.

spass 1.1 – Secure Password Generator

This is a new version of my /dev/random-based secure password generator – spass. The new version doesn’t have any new features; it’s mainly a bug-fix release. The package now uses autotools, which means it has the standard configure script and makefile. I also fixed some typos in the help message. Overall, the new version doesn’t offer anything new compared to the old one, except for easier installation.
Continue reading spass 1.1 – Secure Password Generator

mctext 0.2 – A Markov Chain Text Generator

This is the second release of my Markov Chain text generator – mctext. This text generator takes existing sample text and generates new text using Markov Chains.

The main new thing in this version is that it allows users to specify via the command line how many words should be considered when generating the next one. The bigger the step number, the closer the generated text is to the original one. The value used in mctext-0.1 was 2, and this is also the default in this one. The number of steps can be set using the --steps command line switch.
Continue reading mctext 0.2 – A Markov Chain Text Generator

A Greasemonkey Fix to the Top Menu in Sheilta (Open University)

Following comments in Fixing the Home Link in the Telem System (Open U), I’ve decided to fix the top bar links in the Sheilta system too.

The links in the top bar are JavaScript links that open in a new window when clicked. My Greasemonkey script turns them into regular links that you can open in a new tab.

Continue reading A Greasemonkey Fix to the Top Menu in Sheilta (Open University)

Scanning Documents Written in Blue Ink – biscan

After writing the post on converting PNMs to DjVu, I’ve run into some trouble scanning documents written in blue ink. The problem: XSane didn’t allow me to set the threshold for converting the scanned image to line-art (B&W). So, I tried scanning the document in grayscale and in color and converting it afterward to bitonal using ImageMagick. This ended up with two results. When I used the -monochrome command-line switch, the conversion looked good, but it used halftones (dithering). When I tried to convert it to DjVu, it resulted in a document size twice as large as normal B&W would. The other thing that I tried was using the -threshold switch. The DjVu-compressed document size was much better now, but the document was awful-looking; either it was too dark, or some of the text disappeared. After giving it some thought, I knew I could find a better solution.
Continue reading Scanning Documents Written in Blue Ink – biscan

Convert PNMs to DjVu

I’ve decided to scan some notebooks. After researching a bit, I’ve decided to use DjVu instead of PDF, which I normally use. I’ve chosen to use DjVu because it offered great quality with a very good compression rate (~26KB per page) in lineart (black and white).

While XSane can natively save a multipage project into PDF, it can’t do so for DjVu. So the solution is to use the PNMs generated by XSane and convert them using the command line tools offered by DjVuLibre to bundle them together into a DjVu file. As you can guess, doing this manually is pretty hard work. To make this task easier, I’ve written a small bash script to automate the process.
Continue reading Convert PNMs to DjVu