Posts

Anthony’s Cookies grand opening

Anthony

Another gourmet treats shop joined the burgeoning scene in the Mission. Anthony’s Cookies opened today to a line that stretched around the corner.

Opening

As one of the officials present said, it takes courage to start a business in this economic climate. Specially in as business-hostile a city as San Francisco, if I may add.

Anthony

Inside the store was a buzzing hive of activity, with the eponymous proprietor busy preparing batches of free cookies for the awaiting hordes. At $5 for a half dozen, these cookies are a steal. I tried the double chocolate chip, it came fresh from the oven and had a strong chocolate aroma and the right texture. All in all, a great addition to a neighborhood that already has more than its share of good places to indulge a sweet tooth. I added him to my Google map of recommended bakeries, ice cream parlors and sweet shops in San Francisco.

Podcasts, the new remaindered bin?

After eight years of a automobile-free life in San Francisco, I bought a car in December 2007. Acxiom had relocated us from our lovely downtown San Francisco office (a 15 minute walk from home) to the outer boondocks of Foster City (viable transit options: none). Before I started commuting, I simply could not fathom the point of podcasts. Now, I understand where they can be useful, but they are still not my cup of tea.

The main reason why is that podcasts are like the remaindered bin at a bookstore (remember them?). Sure, it is fun to rummage through them in search of a bargain, but usually you don’t find the books you really want there, and if you value your time as you should, it is not a productive investment thereof. Audiovisual media like podcasts force you to take them in at their speed, unlike the written word that can be scanned efficiently for triage. The so-called rich media are actually low in information value, “rich” should really be construed as in “rich foods”, i.e. pejoratively.

Audible, the downloadable audiobook company, has a promotion where they are giving away a free copy of Stephen Covey’s The 7 Habits of Highly Effective People. I was thinking of salvaging the daily 60 to 90 minutes of my life I lose to commuting by listening to books that I actually want, perhaps even learn a new language, and Dr. Covey’s often frighteningly earnest self-help book seemed to fit the bill for a test run. I soon found my attention would wander back to the road and I found it impossible to concentrate on the book, a good thing, I guess.

Back to classical music it is…

SOCKS and SSH, two great flavors that go together

I am currently in New Orleans for a friend’s wedding, and staying at the InterContinental. The hotel has wired Internet access, but like all expensive hotels, wants to charge an extortionate fee ($7/hour) for it. This is annoying as the same hotel chains’ budget-priced hotels usually offer it as a complimentary service.

I noticed my email was going through, however. On further inspection, it turns out they only intercept port 80 HTTP traffic, but not on other ports. Security through (very thin) obscurity, in other words.

I tried using Firefox from my home machine over X and SSH port forwarding, but it was painfully slow.

At this point, I was considering setting up a HTTP proxy on my home machine and using it over SSH port forwarding, but I remembered reading something about SSH and SOCKS. I had never used a SOCKS proxy before, but it turns out this is incredibly easy: just add the -D option to ssh with a local port number, e.g. 9999, and set up your browser to use localhost:9999 as the SOCKS proxy. It worked flawlessly with my Mac OS X SSH client and Solaris 10 stock server.

This has applications beyond routing around hotel paywalls. Many public WiFi access points are unsecured. Even if they are legit (many are peer-to-peer vs. infrastructure, and presumably used by thieves to harvest passwords), they can be snooped for passwords trivially easily. Using SSH and SOCKS provides you with security when using an untrusted Internet access point, even for non-SSL sites. My email uses IMAPS and SMTP TLS so I don’t need to reconfigure it to use SOCKS, but that would also be an important protocol to secure.

All in all, a very worthwhile addition to my toolset. I can’t believe I waited so long to try it.

Update (2009-04-12):

To its credit, New Orleans’ Louis Armstrong international airport has free WiFi throughout the terminal. Chic!

Real-world organizational change

The economic crisis headlines are rife with CEOs and other executives behaving in ways contrary to the interests of shareholders. Business schools teach agency theory, an economic discipline that aims to solve the problem where an agent of principals (e.g. shareholders) needs to be given wide power to perform his job, but could abuse these powers in ways inimical to the principal’s interests, specially when accountability is difficult because the agent controls the information fed back to the principals. The standard recommendation of agency theory is to align the agent’s incentives with those of the principal by setting performance-based compensation such as stock option schemes.

In the real world, of course, the reaction of an agent given a set of incentives is not to act in the way they were designed (too much work) but rather to game the system. In the case of stock options, take large amounts of risk that mostly pays off, but in unlikely cases fails catastrophically, the opposite of insurance, in fact. In the most likely case, they deliver apparently excellent results, and pocket handsome bonuses. When the bets turn spectacularly bad, the shareholders foot the bill. The failure of agency theory is just another example of how intellectually bankrupt and disconnected from reality most B-School curricula are.

This is not a new problem. Historical rulers from Cyrus the Great to Alexander to Peter the Great to Stalin had to control power-hungry and untrustworthy satraps or barons. The way they solved the problem was invariably to set up a network of spies and run two parallel and competing chains of command constantly at each other’s throats, to keep each other honest. To a certain extent, the more arbitrary and capricious the ruler’s favor seems to be, the more effective it is at keeping the underlings in line.

Investors would be well advised to study the tried and proven methods of the great tyrants. The way to control untrustworthy agents is fear and setting up parallel information-gathering networks unbeholden to the agent, not by lavishing rewards that only motivate even worse behavior. Instead of relying on corporate governance consultancies like ISS, they should hire private eyes like Pinkerton to infiltrate their companies.

Garbage-collecting your Mac OS X Address Book

After years of Outlook and Palm synchronization, when I fully switched over to the Mac, I moved my contacts database over to Mac OS X’s Address Book (painfully due to Outlook’s roach motel tendencies, but that’s another story). For the most part I am satisfied, its data model is far more powerful than Outlook’s, and most Mac apps feature excellent Address Book integration. I can call someone using Skype just by right-clicking on a phone number, for instance.

I just noticed, however, that my scripted Address Book backups were pushing the bounds of the reasonable: over 60MB zipped. For a mere 357 contacts, that seems a tad excessive. Upon further inspection, I realized my Address Book directory ~/Library/Application Support/AddressBook was pushing 152MB, the bulk of it in the Images subdirectory.

It turns out there are two causes for this problem:

  1. When you drag and drop an image for a contact, then crop it, Address Book keeps the full-size image around, presumably in case you want to change the crop later. In most cases this is unnecessary and wastes space.
  2. Address Book does not seem to remove the images for a contact when you delete it. Worse, those images get carried over into manual backups and thus backing up, blowing away your Address Book directory and restoring from backup will not get rid of the cruft.

I wrote the short shell script below to back up the AB directory, extract the list of contacts and delete any image that fits in the two categories above. This took me down to a much more reasonable 11MB. You can download the zipped script here.

Disclaimer: I tried my best to make this as generic as possible, but I cannot be held responsible if running this script causes you to lose data, so I would advise you to perform your own backup prior to running it.

#!/bin/sh
backup=$HOME/ab_clean_backup.$$
in_ab=$backup/in_ab
all=$backup/all
datadir="$HOME/Library/Application Support/AddressBook"
db=`echo "$datadir"/*.abcddb`

exit_ab() {
  echo killing AddressBook
  ps -u `whoami` | grep "Address Book" | grep /Applications | awk '{print $2}'|xargs -n 1 kill -9
}

backup_ab() {
  echo "Backing up address book directory $datadir to backup $backup"
  rm -rf  $backup > /dev/null 2>&1
  mkdir $backup
  ditto "$datadir" "$backup"
}

remove_old() {
  echo extract list of contacts in AB from SQLite
  sqlite3 "$db" "select zuniqueid from zabcdrecord"|cut -d: -f 1|sort > $in_ab

  cd "$datadir"
  cd Images

  # comment out the next two lines if you want to keep full-size originals
  echo removing full-scale images
  rm -f *.jpeg

  echo finding all the images
  ls -1|grep -v '\.jpeg$'|sort > $all

  echo removing images with no associated AB record
  comm -13 $in_ab $all | xargs rm
}

exit_ab
backup_ab
remove_old