Automagic

Well my previous post on Symlinks was only partially right. It turns out iTunes doesn’t work very well when it has to share its library. If either computer decides it needs to write anything to the library database, it locks the other out. I had other problems with symlinking iCal’s database — it seems to keep a cache somewhere that I can’t find. So I had to resort to some AppleScripting — maybe the most elite AppleScript I’ve ever written. Here’s everything, some scripted, some not, that our computers do automatically for us…
Media Synchronization
My uber-script runs at 1:00am on the iMac. It starts by cleaning out the downloads folder, deleting any downloaded TV shows over 21 days old, then moves any downloaded music into the appropriate folder and adds it to the local iTunes library. Then it gets really clever, and logs into the remote Home Theater Mac over SSH and begins sending it instructions. It shuts down the remote iTunes, deletes its Library (which is a data island, because we do all our media maintenance on the iMac) and copies over the iMac’s iTunes Library. Note that it copies the Library only — the music remains on a network share that both computers have access to.
Then, once both iTunes are in sync, it starts up the remote iTunes which triggers a sync with my iPhone, getting me a playlist of my most recent music, plus my favorites (I only have a 4GB so I have to manage well) and does something similar locally to sync Nic’s iPod.
Both computers use the network shared Videos folder to populate FrontRow with our movies and TV content.
Calendar Synchronization
I failed to get WebDAV up and running on my new host, and Symlinks didn’t work out. But a wonderful and free service called iCalX came to the rescue. Microsoft finally added WebDAV publishing to Outlook 2007, so I publish my work calendar from there, my personal calendar syncs from my iPhone with the Home Theater Mac and from there to iCalX, and Nic publishes her calendar from the iMac. Any WebDAV client can subscribe to them and iCalX provides a nice little PHP iCalendar view online.
Address Book Synchronization
The OS X Address Book doesn’t complain too much about sharing its library between two computers, and provides little other utility for syncing or sharing (unless you want to pay $99 a year for .Mac — an otherwise useless service). I explored lots of options, but the only unattended one is Exchange syncing (or Kerio), and I don’t want to run a mail server any more. So I finally just decided to let Address Book share. The only caveat is that to make sure Address Book’s on multiple machines match up you have to quit Address Book to dump its in-memory cache and force it to re-read the database. It was easy enough to add some quit, open and hide commands to my uber-script, and that seems to solve the problem. Putting those commands in before each iTunes syncs with its connected portable device makes sure that both the iPhone and iPod have the latest contacts.
Nic’s cell phone is still a non-Apple device, but it syncs nicely over Bluetooth. A little app called Proximity detects when she comes into range of the Home Theater Mac, and fires a tiny AppleScript that does an automatic sync for her. A little blue light on her phone is the only indicator that its even happening.
Document Backup
This is actually another potentially useful service of .Mac, but I’m too cheap to be sold that easily. A really nice online service called Mozy provides free back-ups up to 2GB, and unlimited back-up for $5 a month (sign-up with that link and get me more free space!) We just eeked in under the 2GB mark backing up all our documents. This happens automatically every Sunday night at 1:00am, in place of the usual media sync.
I’ll be taking a semi-annual physical back-up of our document, music and pictures — pictures are copied between both Macs anyway. I have yet to figure out a way to back up 280GB of videos, save for having a second hard drive stored elsewhere, but I think, in case of a fire, we can live with only losing our movie collection.
Cleaning up
After either scheduled task (media sync or back-up, depending on the night of the week) the iMac goes to sleep until 9:00am, or until called for, while the Home Theater Mac studiously downloads things it thinks we might want to watch.
My script is likely pretty unique to our set-up, but I had to search long and hard to find the various parts that make it work — sending script instructions to a remote Mac over SSH was particularly tricky — so I’m posting it here for anyone who’s interested in picking it apart.

One other thing to be aware of, much of the script works against a shared drive, so it needs to be mounted for this to work. I use a little app called Automount Maker to get my media share to mount on boot, but its possible for the volume to get dismounted during the day (our microwave interferes with our wireless, for example, because there are so many wireless networks around, and that can kill the connection). I’d love to hear any ideas on how to make sure a volume stays mounted!

The Idea Virus

The notion that an idea can become contagious, in precisely the same way that a virus does, is at once common-sensical and deeply counter-intuitive. It is common-sensical because all of us have seen it happen: all of us have had a hit song lodged in our heads, or run out to buy a book, or become infected with a particular idea without really knowing why. It is counter-intuitive, though, because it doesn’t fit with the marketer’s traditional vision of the world.
Advertisers spent the better part of the 20th century trying to control and measure and
manipulate the spread of information—to count the number of eyes and ears that they could reach with a single message. But this notion says that the most successful ideas are those that spread and grow because of the customer’s relationship to other customers—not the marketer’s to the customer.

Its a really cool concept, and I think it applies to much more than just marketing. Read more, or find the whole book online.

Singing in the rain

This afternoon I went by the church to drop off some random cables and CDs I’d found tucked away in trunks and laptop bags. Things that had been a part of this other life we’ve lived for the past 18 months — called ministry. I visited with the guys in the production booth, busy working away getting ready for the weekend, and then I headed home. Because I don’t do that stuff any more.
I’d be lying if I said there wasn’t a certain… freedom, in not working 80 hours a week. But I’d also be lying if I said I didn’t miss it, or wasn’t still confused about how we got here — or even got there to begin with. And then two things happened: It started pouring rain, pounding on the windshield until I could barely see the road ahead of me. And this song came on the radio. I thought I’d record it, for the significance it held at that moment…
I was sure by now
That you would have reached down
And wiped our tears away
Stepped in and saved the day
But once again, I say Amen,
and its still raining

As the thunder rolls
I barely hear your whisper through the rain:
I’m with you
And as your mercy falls
I raise my hands
and praise the God who gives
And takes away

I’ll praise you in this storm
And I will life my hands
Cause you are who you are
No matter where I am
And every tear I’ve cried
You hold in your hands
You’ve never left my side
And though my heart is torn
I will praise you in this storm

I remember when
I stumbled in the wind
You heard my cry
You raised my up again
My strength is almost gone
How can I carry on
If I can’t find you?

As the thunder rolls
I barely hear your whisper through the rain:
I’m with you
And as your mercy falls
I raise my hands
and praise the God who gives
And takes away

I lift my eyes unto the hills
Where does my help come from?
My help comes from the Lord
The Maker of Heaven and earth

– Casting Crowns: Praise You in This Storm

SymLinks are your friends!

So we have 320GB of data — movies, music, photos and calendar and address book info. We want to manage it on the computer in the bedroom, but we’ll primarily be consuming it (and acquiring it) from the computer connected to the TV.
I looked long and hard for ways to synchronize or share this volume of data, but when it came down to it, there’s no good solution for that. The best way to do it is to point both computers and their associated “database” and “library” folders to a location-agnostic hard drive (a NAS would be nice, but in my case its a FireWire drive shared over the network) using SymLinks.
Aside for some slowness on the computer in the bedroom (which can be forgiven because its a G4 connected over a wireless network — something I plan to remedy in our next apartment) both computers are blissfully unaware that they posses none of the data they think they do. We can import photos, create playlists, mark-up our calendars and rip then watch our movies in the bedroom, with the benefit of a full keyboard and mouse, and consume all of that content, and sync it with our iPhone and iPods, in the living room, with only a remote control.
In conclusion, I love SymLinks and should have learned how to make them earlier. Its even easier with this contextual menu item. (Note: SymLinks are not the same as aliases, which are nowhere near as cool)

iPwned

A new word, that means “When Apple screws you over.”
Its not new — they frequently do this kind of thing to early-adopters (see the iMac G4 – USB 1.1 models.) Its like your punishment for buying their stuff when they hype it. But this is about the lowest they’ve ever sunk.
I know I shouldn’t complain. I paid a premium to be an uber-geek for 2 months. While everyone else dealt with their regular, crappy phones and so-called “smart” phones, I was flying high with my iPhone. It seriously is the best portable device I’ve ever owned, and although I’m sore that none of the new functionality in the promised updates has made its way to my iPhone yet, and even though it has its little issues, its an amazing phone.
And now everyone can have one, because as of yesterday, my iPhone is worth a little more than half what I paid for it… Thanks a lot, Steve. Sure am glad I got in line for something that not even Apple thinks is worth what I paid for it.
Oh well, at least they got their R&D money back in a hurry, too bad they had to screw over their most loyal customers to do it.
Update: My favourite company did the right thing! $100 gift card at the Apple Store! Way to go, Apple! I’m now back in the drooling fan-boy camp!

FAT32 over 32GB on WindowsXP

In Windows XP (might have actually happened in 2000) Microsoft introduced an artificial limitation to FAT32, preventing you from formatting any volume over 32GB in that file system. It instead forces you to use NTFS. A few quick points on NTFS:
– While Microsoft has been unable to enforce any patents on FAT-based files systems because of plenty of prior art (and they have tried, and failed) they can require licensing payments, enforced with patents, for NTFS. Although FAT32 is technically capable of formatting and addressing a volume up to 2TB in size, Microsoft has convinced its customer base into believing that NTFS is required for large volumes.
– NTFS is readable on plenty of non-Windows platforms, but not writable. This means that when you format a USB hard drive to NTFS, and try to use it on a Mac or Linux, you’ll be quite frustrated. If, however, you use a Mac to format the volume to FAT32, Windows will have no issues at all writing-to and reading-from the entire drive — even beyond the 32GB “limit.”
If you haven’t got a Mac on hand to format your drives, you should check out this great little app called Fat32Format that runs from the Windows Command Prompt. There’s no author listed in the article, but he did a fantastic job of solving this problem, and thus has my eternal gratitude.