Make this more useful as a generic tool.

I wanted to stick this in ~/bin/ so it would be handy in the future.