Commandline Puzzler

Paul R. Brown @ 2009-09-25T19:39:39Z

Suppose that you have to files that consist of records, one per line, and you want to ensure that none of the records in the second file appear in the first. How do you do it with only the text processing commandline tools commonly available on *nix systems?

(comment bubbles) 7 comments

Hack for Remotely Quitting Apps on MacOS X

Paul Brown @ 2006-11-01T16:15:00Z

Every so often, I'm away from my primary home machine (accessible via secure shell on a non-standard port) and I want to shut down Mail or Adium or RemoteDesktop or some other application. The following hack provides a more graceful shutdown than a kill from the commandline:

$ osascript
tell application "Mail"
        quit
end
<CTRL-D>

Where the "Mail" could be "Adium" or whatever.

(comment bubbles) 0 comments

A Commandline Nano Interface for the Slimserver

Paul Brown @ 2006-05-21T23:34:00Z

We've become almost exclusively digital music consumers. It's easily been six months since we bought our last CD, and a Squeezebox has replaced a CD player as the primary means of playing music in some parts of the house. After some experimentation with SoftSqueeze as a client for the Slimserver that streams music to the Squezebox, I settled on a combination of the headless squeezeslave player with some shell scripts that use the web interface to the Slimserver (via curl) to play, pause, skip, and shuffle, e.g.:

#!/bin/sh
curl -s http://slim.internal:9000/status_header.html\
\?p0=pause\&player=172.16.1.201 > /dev/null

So far, so good with leaving iTunes behind. Now I just need to write a Quicksilver integration...

(comment bubbles) 0 comments