I enjoy hacks that simplify my life and let me focus on the stuff that really matters. I'm a long-time reader of Lifehacker and even bought Gina's book so that I'd be able to read it while sitting on airplanes (like I am now). For the past 4-6 weeks I've been on a mission to automate as many routine IT-related tasks as possible. This includes making sure that I have a stable and secure IT infrastructure at home that I can remotely manage while traveling. Maybe some of you are interested in the journey I've taken so far, so here goes.
The Environment
This is what my home IT environment looks like:
Document / Photo / Music Backups
Documents and photos are, to me, the most critical information to protect. I've got a decent, though not bullet-proof solution in place here. This is what I do now:
What could be improved: I feel like I should be rotating the backups more frequently and leveraging some offsite storage. I need to find a backup buddy that I can exchange with. Any takers out there?
FolderShare
This is an amazing tool, and I hope Microsoft doesn't do anything to reduce its usefulness. I use this for replicating a number of key document sets to 3-4 of the machines in my environment. FolderShare is what allows me to work offline and trust that proper synchronization will happen when I reconnect. It has some gotchas and sometimes negative side effects (watchout for cascading deletes!), but I've learned to love this tool and it is part of my normal desktop environment. It is also great for remote file access.
Auto Defrag
This was an easy hack to setup, so why not automate this? If I don't work on a PC frequently, I'm very unlikely to remember to initiate a defrag. I schedule these to run on all of my Windows boxes on Sunday nights.
Content Filtering / Family-Safe Browsing
Our boys are getting older and much more savvy about using the internet. While we supervise this activity as much as possible, I wanted to put in place some automated tools to provide content filtering and tracking of web access. I went with BSafe Online and so far I'm happy with it. It takes a while to tune it so that certain important sites (like Wikipedia) aren't blocked, but that's fine with me. There are some nice side effects like ad blocking, and I get weekly email reports of site access so that I can monitor what's going on in my household.
Auto Hotkey Scripts
AutoHotkey - what a fantastic little tool. I haven't defined a huge number of keyboard macros, but I still find this to be a useful timesaver and it fits really well with my FolderShare distribution model. I have a folder called Briefcase that I replicate to all of my desktops. I compile my AutoHotkey scripts into an executable and have it launch from the Briefcase on startup - this helps ensure that I always have the same set of scripts available on all of my (Windows) machines. I mostly use the scripts for email signatures - handy as I have many different personas I take on when answering email.
Note: the rest of these hacks are implemented in the Unix world of BASH shell scripting, MySQL, Apache2, etc.
Why Run a Home Linux Server?
Oh, let me count the ways:
What Do I Run There?
What could be improved: I'd like to use a more robust certificate exchange with my remote SSH access to the Linux server. Right now I rely on password strength, and that doesn't give me a lot of comfort.
MySQL Backups
Given the critical nature of the data I'm storing in MySQL, I need to ensure that I have frequent, trustworthy backups. For a long time I took care of this manually using mysqldump and a simple email to my GMail account. To automate this process, I cobbled together a few tools that are working quite nicely together:
SVN Backups
I keep source code and other key files in Subversion, so that needs to be backed up as well. This is much less likely to change frequently, so on a weekly basis I run a schedule BASH script that I wrote that does a hot copy of the repository, tar/gzips it, then emails it to my GMail account.
What could be improved: I need to start putting configuration files into Subversion. As I learned when having to completely rebuild by Linux box last Sunday after a catastrophic drive failure, a lot of time is spent getting Apache, MySQL, Subversion, etc. configured properly. I also need to automate the deployment of said configuration - maybe Capistrano could help me out?
Email Backups
I run fetchmail every hour to pull my GMail downto a traditional mbox on the Linux box. This allows me to use any of a number of tools to read my mail, but this is mostly just for backup purposes.
Todo Script
This is probably the simplest but one of the most useful hacks I wrote:
#!/bin/bashecho "Adding action: "$1 /home/chris/scripts/sendEmail -f brookscl@gmail.com -t brookscl+Action@gmail.com -u $1 -m "Todo: "$1 -s smtp.gmail.com -xu brookscl@gmail.com -xp xxxxxx -o tls=yes
When I do my weekly GTD review, I may generate anywhere from 25-30 tasks. This used to mean sitting in GMail and composing emails (tasks) to myself. Even with the keyboard shortcuts it was annoyingly tedious. With this script I can open an SSH session to my Linux box and type away:
$ todo "Write a blog post on automation"Adding action: Write a blog post on automation$ todo "Change the oil in the RAV"Adding action: Change the oil in the RAV
$ todo "Write a blog post on automation"
Adding action: Write a blog post on automation
$ todo "Change the oil in the RAV"
Adding action: Change the oil in the RAV
My Windows box was jealous so I wrote the equivalent batch file, using the very handy blat tool for command line emails:
@echo offblat -p brookscl -to brookscl+Action@gmail.com -subject %1 -body %1 > NUL
Future Projects
Page rendered at Friday, May 16, 2008 4:55:34 PM (Pacific Daylight Time, UTC-07:00)
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.