Synchronizing directories with Perl and SSH

For a while now I have been using ICQ both at home and at work. Instead of having two different copies of data or running ICQ remotely, I was simply copying all data files over between these two locations. rsync with scp were doing the job just fine. The problem emerged when I started to use ICQ on more than two machines (two machines in the office and one at home). I had to always figure out where is the latest copy of my data and distribute it from there to all the other locations. After doing it manually for just a couple of time bored me to death and I decided to write a script.

I started off with a very specific script that was only meant to copy my ICQ back and forth, but quickly realized that it can be generalized to copy any set of directories. So, here it is – sync_dirs.pl.

This script accepts and requires only one parameter – directory to synchronize. You can define a few shortcuts for frequently used directories inside the script. Locations are also defined inside the script. Since this piece of code uses Net::SSH and Net::SCP, the current limitation is that you must have ssh configured to authorize with keys, not passwords. The good news, is that you need only one location to be able to access all the others. The most recent copy of data will be copied over to this central location and from there distributed to all the other machines.

Generating ultimate movie wishlist with Perl and IMDB

One of the things that will go into history with the year 2005 is the number of bad movies produced by Hollywood. IMDB says:

Hollywood is mired in its biggest box-office slump in over 20 years.

With all those bad movies around, finding something worth the time and effort becomes increasing difficult. Luckily, there are these two things that can make our lives easier – IMDB and Perl.

Combining the two all sorts of interesting things can be achieved. Particularly, an ultimate movie wishlist can be generated.

If you are here just for the script, than here is the movie_wishlist.pl. If you want just the result, than here is wishlist.html. Otherwise read on for the explanations on how it works and how you can make it better.

Continue reading Generating ultimate movie wishlist with Perl and IMDB

New color scheme for Vim

I’ve been using dante color scheme for Vim for as long as I can remember. It’s a nice one and suits me perfectly. Sometime though I feel that need for a change and than I have to go through a rather painful process of getting something new. This time I decided to change my Vim color scheme. This process is particularly painful because:

  • there are a lot of color schemes available for Vim
  • screenshots are rarely available
  • most color schemes are designed for graphical mode (gvim), while I use console only

Anyway, I went through a number of color schemes today and decided that I like Impact. Not only it is designed for console, but it also defaults for black background, which is exactly what I use.

I tried it with both Perl files and email messages and I am satisfied with my choice. Now for some useful stuff…

Update: I came across a great page that is generated by a perl script once in a while. The goal of the page is to provide an easy way of finding a colorscheme appropriate for your tastes without the hassle of installing numerour colorschemes on your computer.

Progress with the Gallery2

I am satisfied with the process of my migration to Gallery2. Most of the things work already. Here is a brief round-up:

  • All images and albums are imported, sorted, and thumbnailed.
  • Few albums are tagged for easier searching.
  • Old style of URLs is configured and working. All old links should be fine now.
  • I have familiarized myself with Gallery2 internals a bit. Maybe even more than I intended to.

Continue reading Progress with the Gallery2