Designing a Better a CSS RTL Convertor

About a year and a half ago I’ve released cssrtl.py, a script that translates CSS code to RTL. The script was designed to be fully autonomous, however translating CSS code is a complex task, as not all the information needed to make the translation is available in the CSS files. While cssrtl.py did a very good job on some tasks it lacks on several issues:

  1. When a design update is released, one cannot use previous translation work.
  2. When things don’t go smooth, it’s hard to find out why.
  3. Complex CSS can’t be translated automatically, as it requires understanding of the structure of the corresponding html files and how the CSS will be used by future code.

Continue reading Designing a Better a CSS RTL Convertor

Hash Puppy – A Qt Checksum Calculator

I’ve decided to give Qt a try after long time of wxWidgets programming. When I learn to a new language or how to use a new library I always like to build some small projects to get my hands dirty with. This time I’ve built small checksum calculator – Hash Puppy (in fact, first I had the name then I’ve decided I must use it for some new project).

hashpuppy
Continue reading Hash Puppy – A Qt Checksum Calculator

tarsum-0.2 – A read only version of tarsum

When I first scratched the itch of calculating checksums for every file in a tar archive, this was my original intention. When I decided I want the script in bash for simplicity, I forfeited the idea and settled for extracting the files and then going over all the files to calculate their checksum value.

So when Jon Flowers asked in the comments of the original tarsum post about the possibility of getting the checksums of files in the tar file without extracting all the archive, I’ve decided to re-tackle the problem.

Continue reading tarsum-0.2 – A read only version of tarsum

Italian Radio Stations List for Radio.py

Fabio, an Italian user of radio.py, wrote to me the other day with couple of suggestions and a huge radio.py configuration file with 150 Italian radio stations.

According to Fabio, the list contains 40 of the most popular Italian radio stations, along with radio station from where he used to live in north Italy.

In his post, Fabio also describes a useful tip he uses. He used the radio.py configuration file to number his favorite stations, thus allowing him even easier way to listen to them. E.g.

radio.py 1
radio.py 3

Previously, Henrikan compiled a .radiopy file containing some 58 Swedish radio stations.

If your a radio.py reader and you’ve compiles a .radiopy file you would like to share, send a link along with short description and I’ll gladly publish it.

InfiniteTTT 0.6 Released

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

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

The new version has new multi-threaded AI engine, and several minor fixes and improvements. The changes improved the user experience and made the game more responsive. The new release contains binaries for Windows, source package and a Gentoo ebuild. Packages for other Linux distributions will follow soon (help will 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 the URLs or their 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 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 Checksum for Files inside Tar Archive

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

Some time ago, I got back 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, where usually easy to detect, as it raised errors in programs that tried to use them. But when such error occurs in some general text file, (or inside the data of an SQL dump), the file may seem correctly fine unless closely inspected.

I have an 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 this disks. Assuming that I have a disk failure, and I couldn’t recover from my online backups for reason, how can I check the integrity of my CD backups?

Only storing and comparing 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 completed corrupted archive. My idea was to calculate 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 it’s name applies it calculate checksum for each file in the archive. You can download tarsum from here.

Using tarsum is pretty straight forward.

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 it (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 it 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 update to all the radioIO stations. So overall this version of radio.py comes with 81 predefined stations. To see the full list of recognized station run radio.py --list. If your favorite station is still missing you can add via configuration files, ans described in here. If you will send a comment with the name of the stations and its website, I’ll add it 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 --radio 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 also be used with the --sleep and --wake-up to time your recordings. For example if you want to record a show that start 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 straight forward, just untar the archive and put the radio.py some where 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 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 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 a new text using Markov Chains.

The main new thing in the version in that it allows the 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