All posts by Keith Garner

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…  🙂 

Trump Tower

When RachelleB used to work nearby, the soon-to-be Trump tower was on her path to work.  She often did updates of what the tower was looking like.  As she works elsewhere now , there aren’t the regular photo updates.  I’ll try to fill in where I can, but I’m not that hot of a photographer yet.  I also need to take photos from somewhere other than the boat.  The last one, though, wasn’t from the boat.

IMG_0085.jpg

IMG_0089.jpg

For some really I really like the following staircase.  It could be because when I first passed it, it was closer to lunch time and there were a ton of guys going up and down it.

IMG_0094.jpg

Yes… Yes, it is!

For a combined Father’s Day / Birthday gift, I got a Canon Powershot SD630.  I call it mine, but I guess its the whole family’s.  🙂  We still have our Canon Powershot G3 and love it, but we wanted something small we could carry in a purse or backpack without it being too heavy.  We definately have different uses for the two cameras.

Anyway, the whole point is that I might do some more photoblogging than I used to.   Especially the next few weeks while i’m in new toy mode.

I went off to meet Nick at the House of Blues for lunch, on the way I saw this truck.  It made me damn thirsty, and its the whole point of me doing this post.

Mmmmm

Logitech Harmony 688 review

Logitech Harmony 688Dave’s coworker is in the market for a new universal remote, so Dave asked me on my thoughts since we own two of them.  I’ve meant to write a review for awhile, so I wrote Dave back and saved a copy for myself to post here.  Dave asked, "What model number is yours and what do you like and dislike about it?"  The following is my reply.

We’ve got 2 of the 688s.  Its the highest end of the b&w display ones and has ‘buttons optimized for a DVR.’  The color ones are 800 series, iirc.

Anyway, I loved it when I got my parents one (partially as guinea pigs) and loved my first one so much we got a second and they replaced both our sony massives.

I can honestly say its the best remote I’ve ever owned.

Pros:

  • activity based, so it has buttons like ‘watch tv’ and ‘watch dvd’ and ‘play music’  it so simplfies control that my technology challenged parents and in-laws can handle it.
  • has buttons for most every common feature, as opposed to the mostly lcd displays of the old sony.  I can run the remote without looking at it.
  • compact size (again compared to our old ones.)  Its about the same size as the tivo peanut.
  • 6 buttons with accomping lcd readout to handle functions that there aren’t buttons for.  Also supports multiple pages.  The aiwa receiver in single device mode has 7 screens of these.
  • ‘help button’: since the remote tracks the state of devices, it can get out of sync with the devices if an ir signal was missed or a toddler hits a key on the tv.  The help funtionality will try to resend the signals to set the devices how they should be, and then ask you if it fixed it.  If you answer no, it walks through a check of each device asking on its state.  Its awesomely powerful for the clueless.
  • can handle fairly complex setups that include items like a/v switches as well as TVs and Recievers.

Cons:

  • as with any universal, its sometimes difficult or impossible to do really esoteric funtions on receivers.  However, this has rarely been a problem
  • on our model it isn’t supper appearent what the directional arrow buttons are a first.  Minor quibble, but it stumped me for a few minutes, so its worth noting.

Unique item and one of the killer features of the remote that is mostly a pro, but may become a con in the far far future:

  • all of the configuration of the remote is done via a website, then a custom build is downloaded to your pc and loaded onto the remote via usb.
  • the web site is backed by a huge partially user contributed database.  every device I own, no mater how out of the mainstream (audiotron and radio shack supercheap a/v switch) were already there.  The remote can learn (and it sends the learned items to the db) but I haven’t had to do that except in a few cases where I had to reteach it a button or teach it a button that I use that no one else had added to the db.
  • the downside of course is two fold: 1) what happens if the web page goes away and 2) what if they stop supporting my particlar model (the forced upgrade problem.)  I only think of this because as an open source weenie this is always an argument against proprietary software.  🙂

Stupid Finder tricks

As a unix geek, I like to see and sometimes browse /usr for various reasons.  While I can do it from the command line, it would be nice to be able to do it in the Finder.  Thanks to information I found in the article Top Ten Mac OS X Tips for Unix Geeks I was able to make /usr not hidden anymore.  (The article is from 2002, but this bit of imformation is still relevant.)  The following command removes the HFS+ hidden attribute and that lets the Finder show it.  As the full path below implies, you need to have the developer tools installed.

# /Developer/Tools/SetFile -a v /usr

color grep

Every once in awhile I come across a feature of a piece of software, generally, a small utility that I hadn’t known about and that shows immediate value.  Today Jon showed me the --color flag for GNU grep.  It uses color to highlight the term you were searching for in the line returned.  For example:

# grep –color=auto -i metadata todo.txt
Metadata Functions to Move:
   MetadataView…Make sure only our indexed items are passed up.

Its a very simple thing, but one of those that I’m surpised I haven’t been using.  I know have a shell aliases for that.  See the grep documentation for more information.

[Update 6/2: linux.com has a great article on GNU grep’s new features which talks about the color.  One that I’m particularly expected about is the ability to use Perl-style regular expressions.]