Guy Rutenberg

Keeping track of what I do

Archive for the ‘Projects’ Category

Improved FTP Backup for WordPress

with 3 comments

This script backups both the database and files of a WordPress blog into a remote FTP server (while keeping a local copy). It’s an update of my WordPress Backup to FTP script. The main changes are auto-detecting database settings and better support for caching plugins (specifically WP-Cache). The new version makes it easier to backup multiple WordPress blogs to the same FTP server.
Read the rest of this entry »

Written by Guy

February 28th, 2010 at 8:38 am

Posted in Bash, Projects, Wordpress

Tagged with , ,

An Early Release of the New cssrtl.py-2.0

without comments

It has been three years since I’ve released the original version of cssrtl.py (and two since it’s re-release). The old version did a nice job, but experience gained during that time led me to write from scratch a new version. I’ve detailed more than a month ago, the basic principles and ideas that guided me to design a better tool to help adapting CSS files from left-to-right to right-to-left.

The guidelines weren’t just empty words, they were written while working on the Hebrew adaptation to the Fusion theme and in the same time writing a new proof-of-concept version of cssrtl.py. The original intent was to release a more mature version of that code when it will be completed. However, due to the apparent shortage of time in the present and foreseeable future, I can’t see myself complete the project any time soon. So following the “release early” mantra, I’ve decided to release the code as-is. As I said, the code is in working state, but not polished, so it may be of benefit but may contain bugs. If you find any bugs or have any suggestions, I would be glad to hear.
Read the rest of this entry »

Written by Guy

September 20th, 2009 at 1:00 pm

Posted in Projects, Python

Tagged with , , ,

Simple AI Engine for the Oware Game

without comments

Sometime ago I worked with a friend on building an Oware game. I was supposed to build the AI engine, and he was supposed to build the user interface to it. Unfortunately, while AI engine interface I designed and a simple alpha-beta pruning engine was implemented, the project was never completed.

Screenshot of game session

Screenshot of game session

Read the rest of this entry »

Written by Guy

August 19th, 2009 at 1:54 pm

Posted in C/C++, Projects

Tagged with ,

Designing a Better a CSS RTL Convertor

with one comment

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.

Read the rest of this entry »

Written by Guy

August 5th, 2009 at 12:41 pm

Posted in Projects

Tagged with ,

Hash Puppy – A Qt Checksum Calculator

with 2 comments

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
Read the rest of this entry »

Written by Guy

May 29th, 2009 at 1:56 pm

Posted in Projects

Tagged with ,

tarsum-0.2 – A read only version of tarsum

with 3 comments

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.

Read the rest of this entry »

Written by Guy

April 29th, 2009 at 9:58 am

Posted in Projects, Python

Tagged with ,

Italian Radio Stations List for Radio.py

without comments

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.

Written by Guy

March 25th, 2009 at 12:21 pm

Posted in radio.py

Tagged with

InfiniteTTT 0.6 Released

without comments

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.

Written by Guy

November 22nd, 2008 at 11:55 am

Posted in Projects

Tagged with ,

radio.py Station List Patch

without comments

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

Written by Guy

November 12th, 2008 at 9:13 am

Posted in radio.py

Tagged with

tarsum – Calculate Checksum for Files inside Tar Archive

with 6 comments

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).

Written by Guy

October 24th, 2008 at 11:02 pm

Posted in Bash, Projects

Tagged with ,