February 2007 Archives
February 04, 2007 3:06 AM
esosync - An rsync script for dreamhost
This is a generalized wrapper script around rsync that I use to keep my website synchronized to a local directory on my workstation. rsync is a powerful tool. Instead of using an ftp script that just blindly overwrites any files you tell it to, rsync actually uses a differential algorithm to only transfer the bytes that have changed. On top of that, you can compress those bytes before the sync, resulting in an even quicker transfer.
I have instructed esosync to call rsync with a number of useful options. Here's a snippet from the script:
'--verbose', # increase verbosity
'--progress', # show progress during transfer
'--stats', # prints extra statistics
'--compress', # compress file data during the transfer
'--rsh=/usr/bin/ssh', # use ssh as an alternative remote shell (secure)
'--recursive', # copy directories recursively
'--times', # transfer modification times
'--perms', # keep file permissions synchronized
'--links', # if symlinks are encountered, recreate on web host
'--delete', # delete extraneous files from the receiving side
It is a lot more useful if you have set ssh up to use a public key for login authorization to dreamhost. Then you can use this script within other scripts or a cron job. I happen to use it as nanoblogger's publish command:
BLOG_PUBLISH_CMD="esosync"
Download the script: esosync.perl
You will just have to edit a few variables near the header.
February 04, 2007 12:25 AM
Video Game Database
Last term one of my courses at the local university was about
database management systems. From UML diagrams to foreign key
constraints to Boyce-Codd
normal form, it covered all of the more important topics.
Towards the end of the term we were asked to design our own
database and implement a client to it in a language of our choice.
Ahh, a chance to code. The course became interesting all of a
sudden. 
I designed a database for a sort of gamerankings-esque style of
handling video game reviews. With it, you can add reviews from a
number of different publications and find the average (meta) score
for the game. There's a few other twists involved too. You can add
publishing companies along with development houses for the games
and tons of other data. Then you can filter through the database on
pretty much any key. If you want a list of the Mature rated games
for the Super Dreamcast 360 console developed by Luser Studios, you
can get one quickly. 
Try out the video game database demo.
I decided to use PHP for the client since I haven't really used
the language all that much. It also plays nice with MySQL, the DBMS
I chose, so that was a factor in the decision as well. You might
recognize the style sheet used. 