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.
For it to work, you'll need to meet a few prerequisites:
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:
sync_notes 192.168.1.15
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 | 0 comments