hacking

Monitoring subversion with monit

In spite of the Orwellian title, this is about monitoring the Subversion revision control system using Monit on a Linux server. I recently set up Monit to monitor services running a server. It's pretty neat - you can tell it what services to listen to, how to decide if they are responsive, and what to do in the event that they're not. I found a bunch of simple config scripts for most of the services I wanted to monitor on their wiki, but couldn't find a cut-and-paste solution for monitoring Subversion, so I wrote my own.

Simplifying backups of SD cards

For our media work with Adapting to Scarcity, we use SD cards to store much of the video and audio footage that we get. As part of our normal workflow, we make a disk image copy of the SD card before erasing it to get more footage. I wrote a really basic shell script to facilitate the process - read on to check it out.

PHP and json_decode() madness: json_decode() incorrectly handling large ints

title=This had me up the walls for a while. For the new Adapting to Scarcity website, I wrote some custom scripts to generate an RSS feed of our Flickr photos and photosets to facilitate automagically populating the website with our latest from Flickr. I've been passing some information in a JSON string, but was getting incorrect results after processing it. Turns out some versions of PHP 5 have a weird issue with the json_decode string improperly handling largest integers. Solution? Stop using integers and turn them into strings.

Automate adding/deleting files from Subversion

title= Serious nerd alert - but if you use Drupal and/or Subversion, you'll likely find this interesting. Lately I've been dealing with a Drupal module called 'dbscripts 'that helps me track changes made in a database with Subversion (SVN). Besides a few moments requiring banging my head against the wall, it's a pretty slick module - before this, keeping track of database changes and making it easy to roll back to a previous version was not something easy to do. But one thing that's been tricky to manage with the module is remembering to add/delete the files it generates/deletes in my Subversion repository. This has had nasty consequences of forgetting to check-in a newly added database table or causing conflicts by regenerating a supposedly deleted database table during a database restore... Shell scripts to the rescue!

Linux to the Rescue! Again! -or- Using GNUpod Fix a Corrupt iTunesDB File

aral sea drying up While trying to get some songs off of a 160GB iPod Classic (to a different computer from the one the iPod is registered with), I somehow managed to corrupt the iTunesDB file. This is a most important file, as it tells the iPod what songs are on it. Normally you can just plug the iPod into the computer it's registered with - when it synchs with iTunes, the iTunesDB file will be restored. In my case, that computer is 1500 miles away. After unsuccessfully trying a bunch of stuff on an OS X machine, I turned to Linux and GNUpod to save the day. Read on to see how it's done.

one handed hacking

Two weeks ago, I was mountain biking in Redwood Regional Park, up in the Oakland hills. I was doing the standard 8 mile loop - a ridge trail along the western side of a canyon with a steep descent to the canyon floor, followed by a steep ascent to a trail along the eastern ridge. Almost all the way down to the canyon floor, I saw a nice clear line - let off the brakes and went for it fast. I can't totally recall what happened - I think there was some sort of lip or ledge I couldn't see from above. Going over it, I think I threw my weight forward in surprise. When my front wheel hit the ground, I flipped over the handle bars. One of those "oh. shit." moments. I landed on my left shoulder. Fortunately, some poison-oak broke my fall.

up and running with the android developer phone adp1

droidzA week or so ago, I was in a mountain bike accident and broke my Motorola Razr phone (as well as my collar bone, but that's another story). It turned out to be a great excuse to finally get an Android phone.

Being a curious developer with grand plans for world travel, I purchased the ADP1 developer's version of T-Mobile's G1 through Google. For a small fee ($25) for developer access to the Android Market plus the full price of the phone, I now have a totally unlocked phone with r00t access to the phone's OS.

I will follow up in another post with a brief overview of my initial reactions, the steps I took to use a custom build of Android (JFv1.5, to be precise) and a small collection of links I used to get started. In the meantime, I've gotta take a break from one-handed typing :p