December 2006 Archives

Ruby's a Gem


I didn't have a backup when my server went down. I have the latest build of iClan, Stylunk, and Clieunk on my laptop, but alas there was no backup of my MySQL database and thus no backup of my blog.

What's a technophile to do?

Well, it turns out my most recent post was long enough ago that it was all in the Google cache, so finding the text of everything was easy enough. But of course, that's just the rendered pages... it would be much nicer to somehow transform those into Movable Type's crappt-ass import format.

This looks like a job for Perl!

Except I hate Perl!

So maybe it's a job for Ruby!

Long story short, I wrote up a relatively short (56 line) Ruby script that opened all the files I saved from the Google cache, parsed out the post title, body, time and data, and printed it out in a form appropriate for importing into Movable Type.

Doing it in a C language would've taken significantly longer; I played with getting the regular expression right by bringing up the interactive Ruby console, I didn't need to worry about creating a project and setting up compiler targets and what-not... I just wrote code and it did things. Ruby is probably the most Mac-like language I've ever used; things just work.

Spinning Disks?


It's amazing to me that my computer still has moving parts.

It's annoying to me to discover that my server actually has two fewer moving parts than expected, those parts being (i) the fan in the power supply and (ii) the read head on the hard drive.

The first I could probably deal with if I wanted to; the second is thoroughly beyond my powers to combat at this point in my life.

Oh well. Life goes on.

I've managed to recover the contents of my blog, sans comments. Strange though it sounds, I've been writing in this blasted thing since January 2003 (which actually means I'm coming up on 4 years of being an enormous nerd) and I'd like to keep it around. I suppose it's like having a child; no matter how glaringly defective your offspring might be, getting rid of them is never really on the table.

The latest development builds of iClan, Stylunk, and Clieunk are all safe and sound, but since my Subversion repository was stored on the dearly departed drive all my history has just been unwritten. That may or may not be a bad thing -- some of the code in early versions of Stylunk may actually be carcinogenic with prolonged exposure.

Oh well. Life goes on.