Synchronising notes with the iPhone

In the last post, I wrote somewhat at length about my new note-taking system. I mentioned something about the possibility of synchronising these notes with the Notes application on an iPhone or iPod Touch.

Here's a script that does that. sync_notes

For it to work, you'll need to meet a few prerequisites:

  • A bash shell on your local machine, and the bash_notes system described in my previous post.
  • An iPhone or iPod Touch, jailbroken, with the Notes app. Install 'Erica's Ported Utilities' via to get sqlite3, which is required.
  • Public key access to the iPhod's root account from your local machine. Here's some good instructions.
  • Ruby 1.8.5 or so, and a couple of generally very useful ruby gems:
    gem install net-ssh net-sftp -y

As usual with this sort of thing, download the file to a sensible location, make sure it's in your path (by placing it in /usr/local/bin, perhaps), and chmod it to 775.

Then run it, passing in your iPhod's IP address. For example:


Hint: I've added my iPhod's IP to my /etc/hosts, which means I can do:

sync_notes zaphod

If a note title isn't found on one machine or the other, the note is added. If two notes of the same title have different file modification dates, the older one will be overwritten with the newer one. I decided not to sync deletions, so you'll need to delete a note in both locations if you really want to scrub it from existence. This just seemed prudent.

The sync_notes script is released under the WTFPL. I presume you're not harbouring delusions about your rights, but for the record: I take no responsibility for any files you may clobber using this script. Or for anything else. Making a backup first would be very logical. But it seems to work just fine for me.

Joseph | 20 Jan 2008

Sorry, comments are not available on this post.

stuff & nonsense

  • Topographic viewTopographic view
     shows elements on a webpage according to how deeply nested they are. It's a bookmarklet for web development.
  • The qualifierThe qualifier
     renders controversial statements on this page harmless. Reinstate the slings and barbs by refreshing. Also a bookmarklet.

  • jjmap
    American Diary

    Two weeks with the apple and the lone star (illustrated).

all posts, ordered by month in reverse-chronological order:

In Words

In Other Words