Category > Other

Time Machine Forensics

01 July 2010 » In Other, PHP » 2 Comments

About a year ago, I finally wisened up to the obvious: 1) losing data sucks, and 2) doing daily (or frequent) backups manually are a pain in the ass, especially for portables. 2) is why most people forgo backups in the first place, resulting in 1). I needed something that I could set up once and pretty much forget about. Thankfully, there was just the thing: Time Capsule  —  a single device that encapsulates both Airport Extreme base station and a huge hard drive, and can be used for automatic, transparent, wireless backups from any of your Mac devices via the Time Machine.
I purchased the 1 TB version, configured it, and have been using it ever since. It has already saved my butt a couple of times, when I accidentally deleted (rm -rf) a directory and had that familiar sinking feeling, but then remembered that the Time Machine was there ready to lend a hand.
However, I noticed recently that the hourly backups were taking longer and growing in size, sometimes up to 1GB or more. It didn’t seem like there was that much data changing on an hourly basis, so I set out to investigate. A quick look around revealed that the Time Machine itself will not reveal the backup details, but someone wrote a script called timedog that displays the files that the Time Machine backed up during its most recent run (or any of your choosing). The output of the script is something like this (abbreviated):

# cd /Volumes/Backup\ of\ foo/Backups.backupdb/foo
# timedog -d 5 -l
==> Comparing TM backup 2010-06-29-160846 to 2010-06-29-101853
     399B->     399B    [1] /Mac HD/Library/Application Support/CrashReporter/
[..skip..]
   52.6KB->   53.0KB        /Mac HD/Users/andrei/.dbshell
     863B->     866B        /Mac HD/Users/andrei/.lesshst
   11.0KB->   15.1KB        /Mac HD/Users/andrei/.viminfo
   10.4KB->   30.7KB        /Mac HD/Users/andrei/.zsh_hist
    6.7MB->    6.7MB        /Mac HD/Users/andrei/.dropbox/dropbox.db
    3.9MB->    3.9MB        /Mac HD/Users/andrei/.dropbox/migrate.db
   25.2MB->   50.3MB   [10] /Mac HD/Users/andrei/.dropbox/cache/
   21.0KB->   21.0KB    [1] /Mac HD/Users/andrei/Desktop/
  120.0MB->  120.4MB    [1] /Mac HD/Users/andrei/Documents/Linkinus 2 Logs/
  142.8MB->  146.2MB  [156] /Mac HD/Users/andrei/Library/Application Support/
[..skip..]
  608.0MB->  608.0MB    [5] /Mac HD/private/var/data/mongodb/
[..skip..]
==> Total Backup: 967 changed files/directories, 1.88GB

Looking at this, a couple of offenders are immediately obvious. Linkinus (an IRC client) keeps all the conversation logs in one single file, and since I’m frequently on IRC, that file grows and gets backed up every hour. The data files for MongoDB that I use for development are also fairly large and change often. Finally, there is something in Library/Application Support, but it wasn’t shown because of the depth limit I set. After increasing the depth to 7, I discovered that it was the Google Chrome cache and history.
Conversation logs and Chrome stuff are not important enough for me to back up hourly, and MongoDB data I can copy periodically to an off-site server. By excluding these 3 items from the backup process via Time Machine Preferences I was able to reduce the size of the hourlies to 50 MB or less.
This brings up an important point though: while Time Machine is great for doing automated backups over your local network, you should have a separate copy of the data off-site, for redundancy. How and when to do the off-site backups varies according to everyone’s needs, but I would suggest something like CrashPlan, which does unlimited online backups for about $5/month. Once again, it’s automatic and hands-off, which is how you want it.
Tools I found useful while investigating this Time Machine issue:

Fixing FeedBurner Fiasco, Conclusion

06 March 2009 » In Other, PHP, Rants » 4 Comments

In the previous post I mentioned that I was going to migrate to Google account on FeedBurner using a trick to avoid spamming the subscribers with old posts. The trick seemed to work fine, so here’s the explanation. I use WordPress (2.6), but this can be generalized to other systems. In wp-includes/feed-rss2.php, find the beginning of the post loop – the while( have_posts() ) line – and add another one after it to exclude the posts dated earlier than the migration date from the feed. It should look something like this:

 <?php while( have_posts()) : the_post();
 if (get_post_time() < strtotime('2009-03-01')) continue;

The end result of this is that your feed will contain only the items published after the specified date. This may be a bit strange for new subscribers, so I made a new blog post so as not to keep my feed completely empty, but for existing ones it should be transparent.
In general, I want to say that Google has completely mishandled this transition after their acquisition of FeedBurner. Chris Shiflett already explained what problems he saw with it, but I found one more: they broke the Awareness API. I noticed this because my feed statistics were all 0. Turns out that the old API URL (http://api.feedburner.com/) was gone, and you had to use the new one (http://feedburner.google.com/api). Breaking the legacy API URLs is a major violation of the contract you make with the users when you publish the API. At the very least, Google should have silently redirected the requests to the new API instead of doing the most egregious thing possible and simply removing the old URL. Shame on you, Google.

Fixing FeedBurner Fiasco

05 March 2009 » In Other, PHP » 3 Comments

If you use FeedBurner, you probably know that they were acquired by Google recently. They are also forcing you to migrate your account to Google on the next login. This presents a couple of issues detailed by Chris Shiflett in his post.
I’m going to attempt to avoid spamming my subscribers with a ton of recent posts by making sure that the feed contains only the posts dated after the migration. Chris and I are pretty sure that it will work, but I guess the only way is to push the button and see. If this works, I’ll post a quick explanation of how to hack WordPress to modify your feed this way.

New Designs at OmniTI

17 December 2008 » In Other, PHP » 1 Comment

I was excited to find out yesterday that my good friend Jon Tan has joined some more of my good friends at OmniTI as their new Creative Director. I met Jon at OSCON in Portland this year and he’s a fantastic fellow — great designer with an eye for typography, tech guru, fine cocktail connoiseur and a very funny man indeed. He’ll fit right into the awesome motley crew at OmniTI. Congrats, Jon!

This is not the pr0n you're looking for

08 August 2007 » In Other » No Comments

Sometime in the past couple of weeks, there apparently has been an attack on my domain, most likely via DNS cache poisoning. The end result was that a large number of visitors to the site saw some infelicitous pr0n content, instead of the usual blog. Rest assured, it was not an attempt on my part to make some extra cash by displaying someone else’s fleshy bits to drooling eager masses. No, there are easier ways of getting beer money. I am not sure whether this was a deliberate attack or whether my domain was simply unfortunate enough to get on someone’s list, but I sincerely apologize to those of you who were exposed — pun intended — to that content.
I have taken steps to fix the DNS issues and make sure that this kind of thing would be very hard to repeat. Unfortunately, during this time the search engines, such as Yahoo! and Google, have indexed the pr0n content under as though belonging to my domain and it might take a few days for it to clear out. Meanwhile, I hope you will return and check out some cool new things that should be coming shortly.

7777

18 July 2007 » In Other » 1 Comment

Accidentally looked at the title bar of Mail.app after hitting Send today and noticed that I’ve sent 7777 messages since January 1, 2004. Lucky sevens!

Logo-tastic designer wanted

29 January 2007 » In Other » No Comments

I am in the process of setting up a photoblog, and I’d love to have a small logo (and perhaps a favicon) to stick on it. Given that my skills with graphic design are limited to — and I’m being generous here — picking out a font that looks nice but is unlikely to induce violent frothing rage from everyone who’s been exposed to entirely too many pages written exclusively in Comics Sans… I thought I’d ask the faithful readers who’ve hopefully extracted a smidge of useful information (or just a chuckle) from some of my postings. Can one of you designer demigods help me out with this?
Please contact me directly via About page.

Linkblog Redux part Deux

20 November 2006 » In Other » No Comments

Thanks to Evan, the RSS autodiscovery on my linkblog is now fixed. Consider this another opportunity to subscribe. 🙂

Linkblog Redux

19 November 2006 » In Other » 1 Comment

Hey, you. Not, not you. You, the one reading this blog. Did you know that I now also have a linkblog that has the best links that I come across that day? You should read it. And subscribe to it too. And then read it again. It’ll be funny, thought-provoking, and educational. And it’ll help you lose weight. Oh, and get the girl or boy you’re after. Seriously, 4 out of every 5 bloggers agree. So, go ahead, click on it. You know you want to. See you there.

Linkblog Launched

11 October 2006 » In Other » No Comments

Throughout the day I usually come across a number of links that I want to share with people. I usually archive them on MyWeb, but I thought that it wouldn’t hurt to have them on my site as well. So, following Jeremy Zawodny’s example, I am launching a linkblog. The RSS feed of the links is available as well.