« October 2007 | Main | December 2007 »

November 26, 2007

Likely in store. Likely? WTF?

So I went to Borders on Wall street today, thinking "hey, let's have a look at Fake Steve's book." I go to their little search engine kiosk, punch in the title and see "Humor" under section and "Likely in store" under availability. Hmmm. Ok. So the kiosk isn't hooked into their inventory. Fair enough, as a friend of mine likes to say. I go to the little help desk and ask "where's humor?" (they didn't get the joke...It was a dumb joke). I head in the direction of the pointing and grunting. I seek. I do not find. I approach another help desk, this one nearer to the section in question. I follow the nice Borders "associate" (when did we stop using "employee" and "clerk," by the way?) over to the section I was just examining, where she proceeds to look for Fake Steve's book on the same shelf I was. Apparently, alphabetical order is still alphabetical order. Glad I'm not crazy. "Let me go ask if anybody has seen it," she says. "Um. Okay," I reply. Now I don't think that I'm expecting miracles. I just want to know if they have a certain book. After about five minutes the (ahem) "associate" comes back with a "I don't think we have it, but we can order it for you." ...to which I reply (admittedly snidely) "If I had wanted to order it, I would have done so from the comfort of my own home from Amazon. Thanks for looking."

I have questions. Why do the Borders associates clearly have no access to inventory numbers? Why could she not tell me "we have two copies." I can understand having difficulty finding a specific volume, what with the abundance of end caps and special tables in the book stores these days. How hard is it to track inventory? Isn't that what those neat shiny computer doodads they have scattered all over the store are supposed to be good at? Grrrrr.

Shipley! Make a distributed version of Delicious Library or something. These people need help.

November 24, 2007

Living with multiple Macs

I have three machines running os X:
  • My Macbook Pro for travelin' to them clients; it lives wherever I am.
  • My iMac for writing code on a big screen; it lives on my desk
  • My Mini for watching movies, listening to music, serving web pages, serving mail, serving my calendars; it lives in my Middle Atlantic rack (highly recommended rack manufacturer, by the way. Nice stuff.)
Synchronizing my data (especially my home directly) has recently become much more important to me. I've been spending rather more time physically at clients and can't afford the "I think I edited that on the desktop machine, which is turned off at home" problem. For code, this is handled quite nicely by subversion, but I also need a simple way to synchronize my home directories between my laptop and my desktop. (I don't so much care about the contents of my home directory in my server because I don't really produce content there). My friend Noah Gift, who really is a gift to my world would tell you to use nfs and apple's offline synchronization to do this for you. This is fancy and fine voodoo, and something I used to do way back when I used Linux primarily (gasp) but I didn't really want to serve my home directory from a central location. Version controlled home is also overkill for me and dealing with conflicting files in svn can be a bit of a pain (yes, Hal, I thought about your suggestion as well). I really want my laptop to act kind of like my iPhone. I want to come home, plug in, deal with a few conflicts if and only if I care at that point, and sync without having to also think.
What is need is a simple directory synchronizer. Ok. Shouldn't be hard to find, right? Wrong. Every (payware, even) GUI file synchronizer I've tried has ended in the spinning beachball of death. Grumble Grumble. Ok again. Time to slide off into command-line utilities. I thought maybe I would use git instead of svn, but I don't want to use git (yet). I'm resistant to use anything designed for version control for this purpose and I'm too lazy to learn yet another one, even though git is supposed to be very fast at resolving differences between trees. Maybe later. Sorry Linus.
Enter a little-known synchronizing tool called Unison. I Love this software.
From the Unison site:
  • Unison runs on both Windows and many flavors of Unix (Solaris, Linux, OS X, etc.) systems. Moreover, Unison works across platforms, allowing you to synchronize a Windows laptop with a Unix server, for example.
  • Unlike simple mirroring or backup utilities, Unison can deal with updates to both replicas of a distributed directory structure. Updates that do not conflict are propagated automatically. Conflicting updates are detected and displayed.
  • Unlike a distributed filesystem, Unison is a user-level program: there is no need to modify the kernel or to have superuser privileges on either host.
  • Unison works between any pair of machines connected to the internet, communicating over either a direct socket link or tunneling over an encrypted ssh connection. It is careful with network bandwidth, and runs well over slow links such as PPP connections. Transfers of small updates to large files are optimized using a compression protocol similar to rsync.
  • Unison is resilient to failure. It is careful to leave the replicas and its own private structures in a sensible state at all times, even in case of abnormal termination or communication failures.
  • Unison has a clear and precise specification.
  • Unison is free; full source code is available under the GNU Public License.
In other words, exactly what I need. :) Good instructions for setting it up for this purpose are available on the Linux Journal site. It's easy to keep it from synchronizing certain directories (I leave ~/Library and ~/svnCheckouts alone, for example) and it's easy to keep it from synchronizing certain file types as well (.DS_Store, .Spotlight*, .Trashes, etc.). If I reorganize my entire home folder on the train, that reorganization is mirrored on the desktop. No muss. No fuss. No "svn move."
So! When I come home, I shutdown my laptop (it's usually sleeping in my bag), restart holding the T key, which turns it into a very expensive external drive, connect a firewire 800 cable between it and my desktop and synchronize. Happy me.

No more Finder, no more Dock

I don't use the either anymore.
I find the Terminal sufficient for most large-scale file movings (especially with the help of tree). Path Finder is where I live to browse my filesystem. Launching applications (also searching the web and making coffee) belongs to Quicksilver, which was recently open-sourced!
FYI: tree compiles on OSX Leopard if you make the following very small changes to tree.c:
--- ./tree-1.5.1.1/tree.c
+++ ./tree-1.5.1.1JS/tree.c
@@ -17,7 +17,7 @@
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

-#include 
+//#include 
#include 
#include 
#include 
@@ -182,7 +182,7 @@
#ifdef CYGWIN
extern int MB_CUR_MAX;
#else
-extern size_t MB_CUR_MAX;
+extern int __mb_cur_max;
#endif

int main(int argc, char **argv)

November 11, 2007

More Leopard calDAV fun. Migration!

As you know from my last post, I have lots and lots of calendars. It used to be much much worse. Sharing calendars between my three Macs before Leopard server was a pain in the ass. Sure, you could put a calendar on a regular DAV server and subscribe to that calendar on your other machines, but you could not write to that calendar from any machine other than that which created it initially. All subscribed machines were read-only. What does this mean to me? You know about my 14 calendars, right? Triple it. That's right. I used to have 42 calendars on each of my 3 machines. 14 calendars to which I could write and 28 to which I was subscribed so I could read any appointments from my other two machines. What a mess.

Leopard calendar server has brought me back to a debatably sane 14 calendars. But how does one migrate all of those calendars spread across multiple machines onto the shiny new calDAV server? Like so:

1. Subscribe to your shiny new calDAV server (under the Accounts tab) in iCal preferences.
2. Create a new calendar on your calDAV server through iCal (File Menu -> new Calendar -> your server) for each of your 14 calendars.
3. Create a *.ics file from your old calendar by:
a. Selecting the calendars you want to export by using the export functionality in iCal (File Menu -> Export) on each of your machines or...
b. Mounting your DAV server and downloading all of 'em at once (assuming you're keeping your calendars on a DAV server now, which I was, this method is a lot easier for obvious reasons)...
4. Select the calendar from the source list (one residing on your new calDAV server) and import the *.ics files you wish to store in the new calendar (File Menu -> import).

Your appointments are now on your calDAV server and will show up on all of your subscribed machines fully editable from all.

More Leopard calDAV fun. Moving appointments between calendars from different sources.

I'm scheduled to within an inch of my life, so there is no surprise that I have 14 calendars in iCal right now. I have calendars for billable hours vs. non-billable hours. I have calendars on my calDAV server that I share with clients, some under a different username than others, and some that I use to synchronize personal calendars across multiple machines, and yet another that I share with my assistant. (Hi Christina!) I have calendars coming out my ears from various sources.

Very often, I'll place an appointment in one calendar and later wish to move it to another. Perhaps I'll have a tentative appointment with a client, so I'll put that in my non-billable calendar. When that appointment happens, perhaps I'll put that into my billable calendar. Unfortunately, my billable calender is under a different username on my calDAV server than my billable calendar (one of them I share, the other I do not). Normally, when I want to move an appointment from one calendar to another I right/ctrl-click the appointment and select the calendar I want to move it to. Unfortunately, the only calendars listed in that contextual menu are those under the same user account as the appointment I'm trying to move. Bummer.

The workaround:

1. Select the appointment you would like to move.
2. Use your favorite method of getting it to the clipboard (I use command-X to cut)
3. Select the calendar from the source list to which you would like to move the appointment
4. Paste (command - v for me)

All appointment data when cut or copied is retained when pasted into the other calendar.

Wouldn't it be nice to have ALL of your calendars in the contextual menu? Radar: 5593635

November 06, 2007

Leopard server, calDAV, and Mozilla Sunbird

For those wishing to use Mozilla Sunbird with the calDAV server that comes with Leopard, it's not setup in Sunbird in (quite) the same way as it is in iCal.

Let's say you have the calDAV Account URL working in ical (which will subscribe you to all of your calendars) and its URL is

 https://somedomain.com:8443/principals/users/username/ 

In Sunbird, you'll have to subscribe to the your calendars individually. Every calDAV user I've setup so far in Leopard server has been given a default calendar called simply "calendar", which you can subscribed to from Sunbird at

https://somedomain.com:8443/calendars/users/username/calendar/
Easy enough. However, if you add a new calendar in iCal, it will create a calendar named with a UUID. In order to figure out what that UUID is, it's easiest to just mount the calDAV in the finder (Command - K) at
https://somedomain.com:8443/calendars/users/username/
You'll see several directories in there: calendar, dropbox, oubox, notifications, etc. The one that looks like a UUID (for example, 037D3206-9C1D-4C6C-8E54-B3E3CAF90ABF) is the directory you'll want to subscribe to in Sunbird. In the example above, you would subscribe to
https://somedomain.com:8443/calendars/users/username/037D3206-9C1D-4C6C-8E54-B3E3CAF90ABF/