Using DropBox for automatic Perl library synchronization

Working efficiently across multiple machines just got a whole lot simpler.

Working on multiple machines with varied architectures can be a pain. It’s never obvious where the most recent version of something is. Merging changes is tedious and error-prone. Building software over and over is a waste of time.

I’ve heard of some gluttons that check in their entire home into GitHub. This glutton has done the same in SVN in the way-way-past. Although source code management systems can be shoe-horned to watch almost anything, they make the problem of synchronization worse. Have you ever frantically checked-in/out on several machines before leaving for the airport to make sure your laptop is up-to-date?

Rsync gets equally confusing when source and destination are constantly changing. And don’t even consider using the --delete flag unless you’re prepared for heartache.

DropBox solves all off these problems with aplomb. It’s in essence a network disk but with a stored local copy, and a thin synchronization layer. The service comes with 2GB of free storage. If you haven’t tried it yet, here’s an invitation. Following this link when you register will net you an extra 250MB.

Here’s how I’m using it to manage Perl versions and libraries. Nothing earth-shattering here. Since DropBox is in essence just a directory, this isn’t any different from installing your own local Perl.

Directory structure

I like to keep multiple versions of Perl around as well as distinct library collections for different architectures. See below for details.

# A local directory for all things Perl
cd ~/Dropbox/perl

todd> ls -1
5.8.8-darwin  # Perl 5.8.8 and core libraries built for darwin
5.10.1-darwin  # Perl 5.10.1 and core libraries built for darwin
lib/darwin-5.10.1 # site_perl for Perl 5.10.1/darwin 
lib/x86-64-5.8.8  # site_perl for Perl 5.8.8/x86-64

If you are already happy with your current Perl, skip to Installing Modules.

Download and unpack

todd> cd ~/src
todd> curl -O
todd> tar xzf perl-5.10.1.tar.gz 


todd> cd perl-5.10.1
todd> Configure -des -Dinc_version_list=none \

Flags: -des means “Accept the defaults for your architecture”, -Dinc_version_list=none prevents Perl from accidentally including other library paths, -D/Users/todd/Dropbox/perl/5.10.1 sets the installation path.

Make and install

todd> make
todd> make test
todd> make install

Configure environment to use the new Perl

todd> export PATH=/Users/todd/Dropbox/perl/5.10.1/bin:${PATH}
todd> perl -v

This is perl, v5.10.1 (*) built for darwin-2level
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2009, Larry Wall

Installing modules

You can install modules directly into this local tree by :

todd> perl -MCPAN -e shell
cpan> install Module::Install

Alternatively, you can maintain libraries in a distinct path. This is useful if a) you want to test different sets of modules in isolation; b) you are already happy with your installed Perl version, or c) you don’t have sufficient privileges to install modules in to the default site_perl path. Although you can set this up during Configure, it’s easiest to use local::lib:

todd> perl -MCPAN -e 'CPAN::install(local::lib)'
todd> cd ~/DropBox/perl/lib/darwin-5.10.1
todd> perl -Mlocal::lib=./
todd> eval $(perl -Mlocal::lib=--self-contained,./)
todd> perl -MCPAN -e shell
cpan> install GO::Nuts

This will install the library GO::Nuts into the independent local library path.

And the best part is that GO::Nuts will instantly be available to your other environments! No more trying to remember what modules you installed during your last dev session. Just make sure the correct Perl (and/or Perl library directory) is in your path and go to it!

Email Etiquette: Top or Bottom Posting

I get email. Lots. Absurd amounts. It’s 5:03 AM, and this is my situation from yesterday and last night:

One thing that seriously slows me down are chronic bottom posters.

For those not familiar with the issue, there are two prevalent quoting styles when replying to email. Top posting, or placing your reply at the top of possibly a long thread of messages, or bottom posting, sticking it at the bottom.

Bottom posting

 On Jan 20, 2009, at 6:46 PM, So-and-So wrote:
 > Dear Webmaster,
 > Your website is broken. Please fix it.
 > Sincerely,
 > So-and-so

 Dear So-and-so,
 Thank you for letting us know of the problem.  It is now resolved.
 The Web Team

Top posting

 Dear So-and-so,
 Thank you for letting us know of the problem.  It is now resolved.
 The Web Team

 On Jan 20, 2009, at 6:46 PM, So-and-So wrote:
 > Dear Webmaster,
 > Your website is broken. Please fix it.
 > Sincerely,
 > So-and-so

For long threaded discussions, bottom posting makes it much easier to read the thread IF YOU ARE BEHIND ON YOUR EMAIL. Judicious editing and quoting of past replies makes it even cleaner. Interspersing replies works for only short threads. After one or two replies it becomes entirely too messy. Don’t even try.

But when you get hundreds of emails a day, bottom posting is a drag.

Don’t make your recipient scroll to the bottom of every long thread with every single reply. Assume they are reading the thread and probably don’t want to re-read it. Stick your answer right up at the top. Yes. It’s expedient without sacrificing legibility or too much formality.

Hopefully you’ve “replied to” and included the original message(s). If the recipient has a brain lapse or is chronically behind on email they can scroll through the earlier messages. No biggie.

Web-based time tracking solutions

I’ve used pretty much every time tracking, billing, and invoicing tool available for the Mac.

But hey, enough with the desktop apps already. I’m an on-the-go guy and need a mobile, web-based solution. With rounded corners, too, please.

Here are two options that I’ve discovered.

Goofy name, but feature rich. Gratis and paid plans available, restricted by the number of projects you can maintain at once and the types of reports that are available. Looks helluva lot like 37 Signal’s project management tool Basecamp. Intuitive interface with appropriate (albeit sometimes flakey) ajax. Generates simple and generic invoices. Export to PDF and CSV available with paid plans, which start at a reasonable 5 bucks a month.

They’ve got the name sans final “e”. That’s a good start. Again, both free and paid plans. I found the free plans to be nearly useless since reports don’t calculate a sum for billable hours unless you upgrade to a paid plan. And at 19 smackers a month, it ain’t cheap. Still, looks promising.

Know of other good (free) web-based time-tracking tools?