Categories
Uncategorized

SSHKeyChain install fix

I like SSHKeychain. I’ve used it for a long time. However, I recently tried to install it and noticed that it kept blowing up in the post-install phase. Having quick look at the installer, I saw this:

% cd /Volumes/SSHKeychain 
% cat SSHKeychain.pkg/Contents/Resources/postinstall 
#!/bin/sh
chown -R $USER:$USER "$2/SSHKeychain.app"
#chown root:admin "$2/SSHKeychain.app/Contents/Resources/TunnelRunner"
#chmod u+s "$2/SSHKeychain.app/Contents/Resources/TunnelRunner"

It assumes you have a group named after you. This is not the case for me. Now, I could copy the package to a read-write location, and edit the postinstall script to fix this.

However, it turns out the failure in postinstall means the package still installed OK. So, it’s easy to fix the failure by manually chown(1)ing at the command line.

% sudo chown -R $LOGNAME /Applications/SSHKeychain.app
Password:
Categories
Uncategorized

Domain Specific Languages

I’ve just finished reading Martin Fowler’s Domain specific Languages. I’ve come away very impressed. The book’s subtitle isn’t “Computer Science for the working coder” but it may as well be. It covers a variety of topics related to parsing and code generation. Most of these I had heard of before but here they get given a thorough coverage.

One of the best features of the book is the style of writing. It’s part overview, part reference. Throughout, Fowler uses humour well to raise it from the level of a dry academic tome. The main example that runs throughout is a state machine for gothic mansion security systems.

Many of the patterns described (like BNF or Expression Builder) are things that I had come across before. Yet they’re fleshed out fully here, often with nuances you didn’t think about. For example, I first came across Expression Builder in Josh Bloch’s Effective Java. Here, it’s given a clear idea of where to and not to to use it. Plus plenty of code examples to illustrate.

But what really stood out for me was the section on external DSL’s. I’ve written my share of ad-hoc configuration file parsers, but using a proper parser generator has always seemed like a bit too much effort. Here, the basics are clearly shown (most of the examples use ANTLR) and it has suddenly opened up to me quite how simple it can be. Lovely! I can’t wait to find out a project to try it all out on.

What’s not so good? Not that much. Because of my background, I was a little irritated to see the lack of HTML escaping in the templating example. The main problem for most people might be the languages used for the examples: Java; C# and Ruby. Whilst it’s all fairly readable, you may have to bone up a little first if you’re less familiar. Fowler references other languages like Lisp, but acknowledges he’s not an expert there. Personally I enjoyed learning bits of C#—for example the Parse Tree Manipulation chapter was an eye opener.