Falling Leaves: the Ardes blog

Archives filed under "OS X"

When 1 Does Not Equal 1

Ray Drainville

Something is amiss. From The currency widget in Mac OS X:

It looks like Apple’s using Yahoo for their currency widget data instead of… who was it again? In any event, this has been going on for a couple of days. I hope it’s fixed soon!

OS X Developer Tip: Slim Time Machine Backups

Ray Drainville

If you’re using Mac OS X and you’re a developer and you’re too busy working to think about backing up your work, then Time Machine is fantastic & a lifesaver. Time Machine will automatically back up your work on an hourly basis. Coupled with a Time Capsule—which provides both the storage for those backups and your wireless connection—backing up is seamless, which is as it should be: if it isn’t seamless, you’re not going to back up nearly as often as you should.

However, Time Machine is not without its faults. I found it frustrating to set up initially, as I was setting up individual accounts (with passwords) & the setup for this is not clearly laid out. Worse, however, is that you can’t set up default rules—like ignore any directory named logs (those developing in Rails will know the files in logs can get huge), although you can set directories (or files) to be ignored manually.

Worst is the lack of any idea of what Time Machine is backing up. When you’re a developer, this can be very frustrating, as periodically you’ll find that you’re suddenly backing up gigabytes of data without knowing why. This is bad: when Time Machine runs out of space, it removes the oldest backups, so you can’t go “back in time” as far as you may need to. For instance, my last backup is 4 October when it should be something back in June, when I first bought the Time Capsule. Something was eating up space.

You could adopt a Zen attitude to this: let it do its thing, accept this state of affairs & doubtless you’ll be happier—until your Time Capsule is filled, that is. Or, you could be obsessive-compulsive & make yourself miserable trying to figure out wtf is going on. TimeDog helps you see something of what’s been backed up, but I found it unhelpful as it wasn’t letting me know about the latest backups—in my case at least, it only appears to give you information about the initial backup. Well, that’s not helpful.

Last night, however, the right chain of events occurred that provided the solution—for web developers, at least. I was performing a MySQL sync for one of my clients—in this instance, I also sync the database locally so I can check my work against the client’s actual data. Time Machine started up just after I started syncing locally. At first it was backing up about 2.5MB. Suddenly, however, it was backing up over 2GB worth of files. Strange, I thought—I had excluded the db folder on the Rails project, so the synced YML files shouldn’t be backing up.

And then it hit me: Time Machine was backing up the actual updated MySQL databases. Obvious, really, when you think about it. For Mac developers, your MySQL databases will be in one of two places:

  • If you’re using the default OS X setup, /var/db/mysql;
  • If you’re using MacPorts, /opt/local/var/db/mysql.

All you have to do to remove these from backups is to go to Time Machine preferences, click “Options…” & exclude the above directories.

You may want to prune more selectively, however: for me, the db sync only really affects one particular client. You can go into the mysql directory & merely prune out the database that’s filling up your Time Machine. Please note that this database won’t be backed up, however—you may want to back it up manually at specific intervals.

Mac OS X 10.4.11 Safari Crash

Ray Drainville

If you’re running the newly-released Mac OS X 10.4.11 update & are having lots of crashes in Safari, then the likely culprit is going to be items in your ~/Library/InputManagers/ path. Some popular Input Managers include:

SafariTidy was the culprit for me. The developer, Kasper Nauwelaerts, has upgraded this to 0.2.4. I’ve not yet been able to successfully install the update, however—Safari just isn’t recognising its existence.

Input Managers act as a patch to the applications for which they’re intended, and as such are unsupported—even actively discouraged—by Apple, because they can patch applications in dangerous ways. Those of us who rely upon such items—as I am to Safari Tidy, so I can validate my work on-the-fly—are in something of a quandary. As Daring Fireball’s John Gruber implied regarding input managers and unsupported software, this situation isn’t going to get better but worse as time passes.

Because the use of the InputManager system is so bad, I’m left wondering what’s the best recourse. Tidy is really useful & there are extensions for Firefox, but none are to my mind as elegant as SafariTidy. I’m left hoping that Kasper will port his plugin to a different architecture…

Update: I just got some tips from Kasper & some very good news:

…You should put [SafariTidy] in the SIMBL plugins folder, which usually resides in ~/Library/Application Support/SIMBL/Plugins/.
Please remove all traces in any InputManagers folder you put the bundle, as this plugin isn’t technically an InputManager (anymore).

Three cheers for Kasper! I’ll be donating to him right now.

Update 2 (03/03/09): for those using the new Safari 4 beta, you’ll want to upgrade to the latest SafariTidy.