Archives / Search ›

Looks like it's going to snow tonight! Finally!

From here:

      TONIGHT:
      [snow] Lo: 23    Cloudy, windy, and colder with snow and blowing
      SNOW             snow. Around 4 to 6 inches should accumulate
                       overnight. The low 23. Winds northwesterly at 15
                       to 25 miles per hour.
      TOMORROW:
      [snow] Hi: 23    Cloudy and windy with periods of snow. Another
      BLOWING SNOW     couple inches of accumulation is likely, making
                       the storm total accumulation 6 to 8 inches.
                       Considerable blowing and drifting snow will cause
                       hazardous travel, especially in rural locations
                       where blizzard conditions are likely. The high 23.
                       Winds northwesterly at 25 to 35 miles per hour
                       with higher gusts of over 50 miles per hour.

Here's how I set up rsync to work automatically from Radio. The problem was in getting SSH authorization to a process executed with sys.unixShellCommand. Radio just executes commands, it doesn't provide any way of connecting standard input. Standard output is returned as the result of the command, and standard error goes to the console log (open Console.app to see it).

Install SSHPassKey. This program will prompt you for a SSH passphrase once, then save it in the Keychain subsequently. It essentially replaces ssh-agent with the Keychain, but it can coexist with ssh-agent. I use both.

I had been using a similar program called SSHAskPassword, but SSHPassKey is better.

The OpenSSH client (ssh) can be configured to use an external password request program with the SSH_ASKPASS environment variable. However, it only does so if the DISPLAY variable is set, and there is no stdin connected. So, from Radio, you can fake the DISPLAY variable like this:

sys.unixShellCommand ("DISPLAY=' ' ~/scripts/sync-weblog.sh")

where the contents of sync-weblog.sh are:

#!/bin/zsh
export SSH_ASKPASS=/Applications/Utilities/SSHPassKey.app/Contents/MacOS/SSHPassKey
export RSYNC_RSH=ssh
rsync -az ~/Sites/sabi.net/log ainaz:web/

If you use SSHPassKey's “configure login environment” option, you don't need to set SSH_ASKPASS, but you still need to set RSYNC_RSH.

One thing I can't seem to do is to get Radio to execute the shell script asynchronously. I don't care about the return value, I just don't want to hang Radio while it's happening. Anyone?

This is a sample test from the new RadioService v0.9a3 (yeah, I'm just catching up…)

WIL WHEATON DOT NET: Wow, that is a gigantic Canadian flag.

OSX, Radio and Upstreaming: How to use rsync to mirror your Radio site. I've got a sample mirror set up here.

‹ Newer Posts