Auto tab completion for SSH hosts

July 17th, 2008

This handy tip from Mac OS X Hints will allow you to setup auto completion for SSH hosts in BASH.

Mac OS X UPS

July 7th, 2008

Mac OS X UPS article. Quoted from : radiotope :

The file that controls this, and is called when OS X is shutting down due to a UPS being on battery is /usr/libexec/upsshutdown. Like many things on OS X, it’s just a shell script. Compare the OS X version with the version on OS X Server. You’ll notice that includes the -u flag:

# Take the system down.
#
if [[ -n $1 && "WaitForUPS" == $1 ]] ; then
#
# Wait for UPS to take the system down abruptly and unexpectedly.
#
shutdown -hu now "${MSG}"
else
#
# Gently shutdown the system immediately.
#
shutdown -h now "${MSG}"
fi

Whereas OS Server does not:

${SI_PATH}/Apache/Apache stop
servermgrdctl stop

#
# Shutdown watchdog and its services.
#
${SI_PATH}/Watchdog/Watchdog stop

#
# Wait for watchdog and take the system down cleanly.
#
sleep 10
shutdown -h now "${MSG}"

(and, yes, this is even under OS 10.4.8 on both machines)

Of course, the simple fix is to edit this file on OS X Server and add the “-u” flag. I’m just still a little puzzled how this got added to OS X and not OS X Server. Of course, remember that any modification you make to a system file may get nuked when you run an update, so, if you do change this, remember to check it after any update (or, check the updater and find out ahead of time).

I’ve even customized this script to go ‘properly’ shut down other machines that I know are connected to the same UPS.

Compiling Rsync3 on Mac OS 10.5

July 1st, 2008

Jaharmi.com has a tutorial stepping though the compilation of Rsync3.