HOWTO Restart shoutcast if inbound stream is lost

This is a simple way to get Shoutcast restarted (tested in Ubuntu 8.04) if the inbound stream is lost. You need Lynx installed for this to work, there might be better ways of achieving the same result though. To install Lynx:


$ sudo apt-get install lynx

Put in file shoutcast_supervisor.sh in /usr/bin:

#!/bin/bash
ONLINE=$(lynx -dump localhost:8000 | grep "Stream is up" | wc -l)
if [ "$ONLINE" -eq "0" ]
then
logger -i Inbound connection not found. Restarting Shoutcast.
/etc/init.d/shoutcast restart
fi

Change ownership, group and execution:

$ sudo chown root /usr/bin/shoutcast_supervisor.sh
$ sudo chgrp root /usr/bin/shoutcast_supervisor.sh
$ sudo chmod +x /usr/bin/shoutcast_supervisor.sh

Add the script to cron.d your preferred way, I do it in /etc/cron.d in a file name shoutcast_supervisor:

0 * * * * root /usr/bin/shoutcast_supervisor.sh
15 * * * * root /usr/bin/shoutcast_supervisor.sh
30 * * * * root /usr/bin/shoutcast_supervisor.sh
45 * * * * root /usr/bin/shoutcast_supervisor.sh

Restart cron:

$ sudo /etc/init.d/cron restart

…and the script is run every 15 minutes and will restart the Shoutcast daemon if the inbound connection was lost. Change the interval if you need to check more often. Sometimes this solves connection problems. Check the syslog for any message that the daemon was restarted, like:

$ tail /var/log/syslog

HOWTO Edit your crontab with Emacs

Another “wee” tip. I had a hard time doing this right…

Put emacs in the EDITOR shell variable:

$ EDITOR=emacs
$ export EDITOR

and add the following to your ~/.emacs:

(set 'temporary-file-directory "/tmp")

Now, edit the crontab file via:

$ crontab -e

Edit and save the file, and you should get a response from crontab:

crontab: installing new crontab

If you get an error message, something is wrong. You can check that your edits really changed your crontab using:

$ crontab -l

HOWTO Use Lotus Notes, Domino Designer and Domino Administrator 8.01 on Ubuntu 8.04 via Wine 1.0.0

I just followed Julian’s excellent guide and it worked! Even though the guide was for previous versions of both Notes, Ubuntu and Wine, I did not have to make any additional steps to get it working. All programs works, I haven’t found anything that is broken (yet), and it’s great having the Designer “directly” in Ubuntu instead of firing up VirtualBox.

Thanks Julian, for your excellent guide!