zsh word splitting

Awhile ago, after I showed him how I indexed my mail with mairix, MARK gave me a zsh function to wrap a call to mairix and then invoke mutt.  For some reason, when using the function, I was never able to pass multiple search terms to mairix and have it return results.  It always failed.

It turns out that this was a zshism that I wasn’t aware of, and Mark might not have been as well.  I finally took the time to get to the bottom of this and I found this FAQ which explains how word splitting differs in zsh.  (All OTHER shells do it wrong, of course.)  In any case, my multiple search terms were being passed to mairix as a single command line argument, so, of course nothing matched.  I edit the script to call mairix ${=*} instead of mairix $* and it works now.

MARK might not have run into this because he might have SH_WORD_SPLIT turned on.  I do not.

Anyway, here’s the function:

mairix_mail (){
  if (( ${#argv} == 0 )); then
    # nothing to do
    mairix --help
    return
  fi
  # search
  mairix ${=*}
  # see the results
  # assumes results are in ~/Maildir/search_results
  mutt -f=search_results
}
alias gm='mairix_mail';

Bunny Block Bid

Killer Bunny CardWelcome to my new section on Our Reading of Killer Bunnies rules. 

In a discussion between Melissa, Chris, Mark, and myself, we have deceided that in a Bunny Block Bid the Kaballa go to the auctioneer instead of the discard pile.  The rules are silent on this, but in the spirit of being as obnoxious as possible, we feel the money going to the player is the way to go.  So let it be written, so let it be done.

Ron Moore on Disaster Preparedness.

Ron Moore is the one of the executive producers and visionaries behind the new Battlestar Galactica.  I follow his blog to get insight into the story lines and when he randomly answers BSG universe questions.  Today, he had a great post looking back at Katrina a year later.  Here’s a small excerpt

The subject is the one most likely to inspire yawns and rolling of eyes, so ready your mouse to click onto something else: Disaster Preparedness.

Still awake?

Okay, look, I’m not writing this because I’ve been sentenced to doing PSA’s off some DUI conviction or something, but I do work on a show that’s premised on the idea of an apocalyptic event actually happening to group of people and their struggle to survive in its aftermath, and so the idea of being ready for the unexpected does actually occur to me on occasion.

The third paragaph above is what hooked me.  The rest of it is worth the read as well.

A child of the Chicago area

In the morning while preparing to leave we normally have the tv on to catch the weather and a quick blast of news.  As usual, because we’re in their home market, an Empire commercial came on.  When the familiar 588-2300 jingle came on, my daughter just sang along with it.

Its both a proud moment and one that is kinda scary.  However, my child is now officially identifiable as a child of  the Chicago area.

I see your Nerd ABC and raise you a DORK ABC

Parent Hacks had a post that alerted me to the Nerd ABC flashcards, which I totally want to get for my daugther.  I shared this with the folks on IRC and it turned into a discussion, thanks to Steve thinking that Fruit Fly wasn’t nerdy enough, of what a set of Programming Language ABC flash cards should look like.

Steve was kind enough to write up what was created by commitee.

OS X moving unix forward

For every stupid hard coded Steve Jobism in OS X1, there’s some really awesome unix extentions I’d like to see elsewhere.  The big one for me today has to do with DNS handling.

I’ve been playing with OpenVPN to get access to my network at home.  Since I have a MacBook Pro from work, that’s been my end point client.  I’ve been using Tunnelblick as my OpenVPN client to connect to OpenVPN server on my linux box (installed via DAG’s RPM repository.)  One thing that bugged me was how to get DNS so I can see my internal home DNS without breaking access to work’s internal DNS.  If I was using a linux laptop, I think my solution would have to do with running a local instance of named with some wacked out config to do caching only and refer to different DNS servers.  Hardly dynamic and a giant PITA to get going.

I was curious about how to make this go though, and what general solutions people had when I came across a post by Mike Erdely titled OpenVPN + DNS + OS X.  That is exactly what I wanted to do!  As a bonus he’s even using Tunnelblick.

Mike shows how OS X’s DNS resolver uses an /etc/resolver directory to get additional per-domain configuration information, as opposed to the blanket /etc/resolve.conf that unix users have come to know.  To get the mac to resolve kgarner.com using my doman’s internal DNS server I just need to create /etc/resolver/kgarner.com and put nameserver 192.168.1.10 inside of it.  This directs OS X’s resolver to ask 192.168.1.10 for any kgarner.com query.  He also shows how to flush OS X’s DNS cache via lookupd so if I had hit any of my public kgarner.com IPs the resolver will send me to the private ip instead of the public one i’ve already hit.  There’s also two simple scripts that you can integrate with OpenVPN to add and remove the /etc/resolver entry as needed.

The fact that OS X’s resolver will check for entries /etc/resolver first is the type of smart unix extentions I’d like to see more of.  There’s no reason Linux’s resolver can’t be doing something like this.  It would make VPNs easier to implement, and doesn’t seem to be that hard to add to the resolver code.

Other examples of OS X moving stuff forward is the init/cron/at all in one launchd.  I’m slowly starting to agree that init, cron, and at are all sides of the same coin.  Don’t get me wrong, launchd has some issues, but the idea is a step in the right direction, especially for machines that will sleep.  A lot of what OS X has done to make unix better is especially for mobile sleep-capable devices like laptops.

1 Ask MARK for a laundry list of them…  🙂 

Keith's attempts to fix the cable of life