The OpenDNS service is great — it provides anti-phishing and the ability to filter out some of the less desirable detritus from the internets.
OpenDNS needs to be periodically notified about what your IP address is, and I don’t have a windows or macintosh box that’s always on. I do have an ubuntu box, though, but there weren’t any instructions on OpenDNS’ site to do this properly.
Cron does periodic jobs very well — but rather than using “crontab -e”, it’s much better to install a system-level cron job by adding a file to the /etc/cron.d directory. The file only needs to be readable — there’s no need to set the execute bit. You can choose the effective user that will run the command (in this case I ran as “nobody”), and a backup of your system that includes /etc will pick up your crontab entry.
Here’s the contents of /etc/cron.d/opendns:
47 * * * * nobody curl -u USERNAME:PASSWORD -s https://updates.opendns.com/nic/update | grep -vE "^good"
Replace USERNAME and PASSWORD with your opendns username and password.
The grep squelches success messages. No news is good news.
Related posts:
- Installing Trac on Ubuntu
Here’s the condensed version, using the installation guide for help: Install the software sudo apt-get install python-setuptools python-subversion sudo easy_install Trac Initialize the Trac project We’re going to run the...... - HOWTO install etherpad on ubuntu 9.10
Etherpad was opensourced by google, and has some generic installation instructions. Here’s the translation for Ubuntu Karmic Koala (release 9.10): Install the prerequisites: sudo apt-get install mysql-server-5.1 mercurial sun-java6-jdk sun-java6-jre...... - Simple MySQL backup to gmail on Ubuntu/Debian
Backing up your MySQL database (if it’s a reasonable size, like < 100s of MB) can be done with a cronjob that runs mysqldump, gzip, and mpack. First set up...... - How to bounce an application with Applescript
Say, for whatever reason, you want to bounce iphoto once an hour. You can do that with AppleScript and cron. Copy this into ~/bin/bounce-iphoto: #!/usr/bin/osascript on appIsRunning(appName) tell application "System......
Could you add a few sentences about why you prefer cron.d to crontab -e?
@Darrell: Sure. When I backup a unix box, I normally only worry about rsync’ing /etc, /home, and then doing a mysqldump. Because crontabs are stored in /var/spool/cron, it’s just one more thing to worry about backing up and restoring later.
Automated installation scripts are also possible with cron.d, because the script knows it owns a whole file, rather than trying to do surgery on a file it has to share with other applications.