Hooking app exit in Firefox extensions

I’ve spent the last few days since joining Better Advertising working on a new feature for a Firefox extension called Ghostery. We’ll be announcing the new feature soon, but until then I thought I’d share some of what I’ve learned so far. I’ve never worked on an extension before but as it turns out, it’s really quite easy to pick up; some fairly simple XML (aka XUL) for composing the UI and JavaScript for the rest. One of the trickier bits has to do with scope. After doing some testing I figured out that the entry point into an extension is via the browser window; that is, your extension code will be executed each time you open a new window and that means that all your code is basically scoped to a single window. ...

February 10, 2010 · 2 min · chetan

Best concerts of 2009

This year was something of an anomaly for me: I only went to five shows. Two of those shows, however, were music festivals and easily made up for the otherwise quiet concert calendar — Lollapalooza with a staggering 35 shows in three days and the Newport Folk Festival with another 6. I also went to 3 free shows at Madison Square Park: Jonatha Brooke, Raul Malo, and the John Scofield Trio. I’m a huge fan of Raul Malo and the Mavericks so we ended up braving some of the worst rain of the summer to see him. It rained through most of his shortened set, but it was still worth it.

December 31, 2009 · 3 min · chetan

Best music of 2009

I’ve been procrastinating publishing this latest post for several weeks now. I’ve had ample time to write it; that’s not the problem at all. No, I simply find it painfully, frustratingly difficult to narrow my collection down to only a handful of records, especially in a year with so many fantastic releases to choose from.

December 31, 2009 · 2 min · chetan

Upgrading the Mac Pro: Adding a 2nd GPU

tl;dr- Yes, you can add a 2nd GPU; OS X will ignore it; Windows will use it. Make sure to disable the card in the 1st slot to use it for gaming. Apple makes great hardware, there’s no doubt about it. However, occasionally they make decisions that not only boggle the mind but are completely infuriating. Like putting non-standard ports on a laptop and charging twenty bucks for the proper adapter cable! A similar problem I ran into recently is the issue of the graphics card in the Mac Pro: only specially branded “Mac-compatible” GPUs will work in OS X. What’s the problem with that you ask? Availability and pricing.

December 17, 2009 · 3 min · chetan

Classmates.com just earned a spot on my blacklist

Just fixed another longstanding pet peeve of mine: I finally added classmates.com and cmates.com to my email server’s blacklist. How these guys have managed to stay in business for so long is beyond. They don’t even try to hide the fact that they’re spammers. They even sign all their messages with a valid domain keys signature! DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/simple; d=classmates.com; s=prod20081009.key.pem; t=1248374724; bh=PH2W8/WWF0Eq5UeHS7xrebJL9l g=; h=Date:from:to:Subject:Mime-Version:Content-Type:Message-Id; b=IMICZJvpMfW9pEWFSGX9gnScTOsQb0sI3edRgw7jHekqAK8OuJoFkmGBYcLC8IhpD mnoepYufrgbzzCEUWiYwpqCNSJ7PkqiyDs5n9upo4qtyEa29vgv6rXb39vQ+FjymKV+ E39Tuzsm2MuXTTO+e0C7LlOozzqnSfh30yovIOI= Gotta love the sheer audacity of it.. ...

July 23, 2009 · 1 min · chetan

Fixing SquirrelMail's weird reply behavior

After years of being annoyed by the fact that SquirrelMail, an otherwise fine product, doesn’t include the date and name of the sender when replying to emails like just about every other email client on the planet, I finally broke down and fixed it. Below is the simple 1 line patch against SquirrelMail 1.4.19. It will most likely work on older 1.4.x versions as well. Download patch (squirrelmail-1.4.19-reply_body.patch) --- squirrelmail-1.4.19/src/compose.php 2009-05-14 06:26:29.000000000 +0000 +++ squirrelmail/src/compose.php 2009-07-23 16:09:59.000000000 +0000 @@ -856,7 +856,7 @@ $rewrap_body = explode("\n", $body); $from = (is_array($orig_header->from) && !empty($orig_header->from)) ? $orig_header->from[0] : $orig_header->from; sqUnWordWrap($body); - $body = ''; + $body = "\n\n\nOn " . getLongDateString( $orig_header->date, $orig_header->date_unparsed ) . " {$send_to} wrote:\n"; // MOD BY chetan $cnt = count($rewrap_body); for ($i=0;$i<$cnt;$i++) { sqWordWrap($rewrap_body[$i], $editor_size, $default_charset);

July 23, 2009 · 1 min · chetan

Installing Google Gears on Mac OS X

If you’re looking to install Google Gears on OS X, installation order can be somewhat important. The Safari version installs as a standard OS X browser plugin and will be picked up by all the browsers on your system. Sounds good, except that the Firefox version is actually a standard Firefox XPI extension and the two will conflict — you actually won’t be able to install the XPI unless you first disable the plugin via the Tools > Add-ons > Plugins menu option. ...

July 15, 2009 · 1 min · chetan

Writing command line interfaces for Spring apps

I recently needed to script some tasks for a Spring-based app at work so we could shove it into a crontab. It proved to be much easier than I thought. You can use your spring.xml config file for wiring up your beans as usual, but rather than deal with various property files you can easily override properties on the fly using system properties. See the following example: In your spring.xml make sure you have this line: ...

June 30, 2009 · 1 min · chetan

Installshield sucks

And furthermore, Peachtree sucks. Last weekend I battled this error thrown by the Peachtree 2008 installer and this weekend I had the great pleasure of upgrading to Peachtree 2010 and being greeted by the very same error. The fix in both cases? Simply copy the contents of the CD to the local harddisk (a network share works just as well) and then run setup.exe from there. Don’t be fooled by the suggested “solutions” from Microsoft or Installshield like I was. ...

May 31, 2009 · 1 min · chetan

Error of the day

sigh.

October 9, 2008 · 1 min · chetan