Thursday 26 February 2009

Automatic mounting of SSH filesystems in OS X

Getting your MacFUSE SSH filesystem to mount automatically on login isn't Voodoo, but it is Magick.

Here's how it's done using launchd:

Create a Properties List file under, ~/Library/LaunchAgents:

eg: ~/Library/LaunchAgents/com.example.sshfs.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>com.example.sshfs</string>
    <key>ProgramArguments</key>
    <array>
      <string>/opt/local/bin/sshfs</string>
      <string>user@example.com:path/to/share</string>
      <string>/path/to/mountpoint</string>
      <string>-f</string>
      <string>-o</string>
      <string>auto_cache,reconnect,volname=friendly_name</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>

We can now load this into launchd by running,
$ cd ~/Library/LaunchAgents 
$ launchctl load com.example.sshfs.plist

Your SSH filesystem should now be mounted.
$ mount
    .
    .
    .
user@example.com:path/to/share on /path/to/mountpoint (fusefs, nodev, nosuid, synchronous, mounted by user)

Wednesday 18 February 2009

Postbox

Firefox is to the web as Postbox is to ... email. I won't go into any details, there are plenty of reviews out on the Internet already, but here's a little nugget I discovered:

To increase the sanity of threaded conversations so that the originating message is at the top:
  • Tools → Options → Advanced → Config Editor
  • Search for: mail.conversation_display.reverse
  • Toggle value
  • Restart

Thursday 5 February 2009

Yammer as a colaboration tool

Yammer is a new tool that we're playing with at work. 


It's like a mash-up of a micro-blogger (eg: Twitter) and an instant messenger (eg: MSN) but more organisation orientated.


To avoid having to run another program to keep a track of the posts, you can integrate with your favourite IM client. 


Just visit, https://www.yammer.com/account/im and follow the instructions.


We are planning to take an RSS feed of the posts and, using hash tags, produce time lines of product launch sequences, etc.

CLI tweets

Another quicky - Twittering from the command line:

$ curl --basic --user "username:password" --data-ascii "status=Twittering from the commandline" "http://twitter.com/statuses/update.json"

Wrapped in a very simple script:

#!/bin/bash

if [ ${#} -gt 0 ]; then
   STATUS="${*}"
else
   STATUS="$(cat -)"
fi

curl --basic --user "username:password" --data-ascii "status=${STATUS}" "http://twitter.com/statuses/update.json"

Wednesday 4 February 2009

Flushing DNS cache on Mac OS X

This is quick post to capture a command that I sometimes need but always have to look up. 


It flushes the DNS cache on the local OS X instance.



$ dscacheutil -flushcache