Friday, December 2, 2011

Synchronizing Your Computers Painlessly

I have been a long time user of Dropbox, and I am very fond of it. If you are not familiar with it, Dropbox is a FREE service that allows you to share a directory on multiple computers and it also functions as a cloud backup service for that directory and as a revision control system for it too.

You signup for DropBox and install their client on your computers and mobile devices. Then you choose a directory to share and voila', from that moment on any file that you copy to that directory will be synchronized across all your computers and devices completely transparently and without using much resources on your machines at all. DropBox will keep a copy in the cloud, and will also keep many revisions so you can always go back to something that you deleted or changed by mistake.

I use it all the time for my photography when I am on the go for multiple days. I bring a few memory cards just enough for a day of shooting. At the end of the day I drop the photos into my Dropbox directory on my laptop and I clean my memory cards and keep on shooting. When I get home after several days the photos are not only on my laptop, but also on all the other computers I have, and a copy is safe on the DropBox servers too.

I also use DropBox for sharing configurations across my machines and keep them all in sync.

I use mostly Mac OS these days; at work I have MacBook Pro, and at home an iMac. I work in terminal all the time, and quite often I make adjustments to my ~/.profile to add paths, change my prompt, set configurations, etc. I also have a set of scripts that I wrote that I use all the time.

I like consistency, and I hate making the same changes on many machines to keep the same configuration between work and home.

To solve this problem, I added this line on my .profile file on all my Macs:
source ~/Dropbox/lorenzo/shell_settings
Then I put all the settings that I like to share in the ~/Dropbox/lorenzo/shell_settings file, which for me looks something like this:
alias dir="ls -l"
PS1="[\u@\h:\w]\$ "
export PATH=$PATH:~/Dropbox/bin/tools
And voila', on all my machines I now have "dir" do what I expect, my prompt look pretty and a handy shared directory where I keep my scripts across my machines. The scripts are on Dropbox too, and in this case I not only get the benefits of having the same version everywhere, but it also functions as source control for any modification I make over time.

Dropbox is available on Windows, Mac, Unix and mobile devices and.... it is FREE for 2Gb. I pay for 50Gb which is only a well worth $99/year. You have got to try it, it will change the way you deal with multiple computers and it will make thumb drives feel like prehistoric technology.