handy utility: watchpaths

Imagine you are working on a set of files on your computer, and each time you change one of those files, you want to run a program to process the files again. This comes up all over the place, whether it’s software development, statistics, image processing, or lots of other domains. Recently, I was editing some source code, and each time I changed a file, I wanted to run a series of tests to make sure everything still worked. I made this process automatic with the help of a really handy utility called watchpaths.

Installing watchpaths

First, download watchpaths and place it somewhere in your path. I use ~/bin, so try something like this:

cd ~/bin

wget http://watchpaths.googlecode.com/svn/trunk/bin/watchpaths

chmod 755 ~/bin/watchpaths

Using watchpaths

Let’s say I want to monitor a folder containing images, and each time a new image is added I want to sync the folder to a remote computer. Using watchpaths, that will look like:

watchpaths "rsync -a ~/my_pictures user@example.com:public_html" ~/my_pictures

To convert that command into English, it would sound like this:

“Watch the my_pictures folder for any changes (new files, deleted files, updated files, etc) and each time a change happens in that folder, synchronize the contents of that folder with my web server.”

More Information

The project page is http://code.google.com/p/watchpaths/, and if there is any interest, I am happy to incorporate feedback.

The Free Beer Speech House: discussing the meaning of the word “free”

Freedom, glorious freedom.

Once upon a time, I took a class based on  a single question: “what is freedom?”  We meandered through US history, identifying several distinct stages in the evolution of the definition of “freedom.”  I was horrified to learn, during a discussion, that so many of my classmates wanted what I will call “freedom from information.” Ah yes – Professor Sandage had a way of bringing the ugliest truths to the surface, for all to witness.

On the one hand, I can understand this desire for freedom from information: telemarketing, advertising, spam, the scrolling headlines at the bottom of a newscast…  well, any unsolicited attempt at selling things you don’t care about.  On the other hand, I think we need more information instead of less, and we need effective tools to filter and manage that information so we only see what we care about.

The term “freedom” is muddied by historical contexts, but also through the process of etymological erosion.  With that said, I want to take a moment to discuss the expression, “free as in speech, not beer.”

Read the rest of this entry »