Have you ever wanted to make cron run a scheduled task on some weird interval like every 29 days? I was faced with that problem just the other day.
I was starting to get annoyed with DynDNS’s nag emails, asking me to either log in and “touch” my WRT54GL router’s host record every 30 days or to upgrade to a paid service that does not require a periodic touch.
Of course, you can create a cron job that calls programs like ez-ipupdate to automate this periodic touching. The problem is, even though cron is quite flexible, it does not support intervals of 29 days. …Continue reading » Stupid Cron Tricks

Yesterday I wrote a custom log file rotator script in bash for one of my embedded Linux boxes (yes, I know about logrotate but this was a special situation that required a custom script).
One of the building blocks I needed for this script was a function that could return the size of a file. The wc command seemed appropriate for this: …Continue reading » Just the File Size Please

I finally used Windows’ arp command for something useful.
Last week I was configuring numerous brand new LinkSys routers for various branch offices. After successfully configuring the first one, I plugged in the second and tried to connect to it’s web admin page. Unfortunately, my connection attempt kept on timing out. After a couple of minutes of pulling my hair out, I remembered something I had learned about in school a few years ago — Address Resolution Protocol or ARP for short. …Continue reading » Arp Tip

Many Linux distributions are preconfigured to automatically and periodically rotate syslog log files by means of cron jobs that call logrotate or a similar log rotation script. However, if you want to clear a log file manually, you can simply use the greater than sign followed by the log file name. For example, to manually clear the file kern.log, you can run this command:
me@mycomputer:> /var/log/kern.log
The beauty of this is that the cleared out file still retains its original permissions and ownership.
