Another entry in my virtual “braindump” category, so I don’t have to look it up somewhere else all the time.

If you want to periodically delete files in a specific directory the unix program find comes to the rescue. In my specific case I needed to delete all the movie files from a surveillance camera that where older than 30 days.

This is the crontab entry to accomplish that:
0 0 * * * /usr/bin/find /videos/ -type f -name '*.avi' -mtime +30 -exec rm {} \;
(everything in one line)

The code runs the program /usr/bin/find every day at midnight (0 0 * * *). It checks the directory called /videos for everything that is a file (-type f), has a name that ends in .avi (-name '*.avi') and is created 30 days ago or before that (-mtime +30).
The command then executes rm (remove) on all those files (-exec rm {} \;).

This article shows how to run a file-, print-, HTTP proxy- DHCP-, and time server for small and medium enterprises (SME) on one single Debian Sarge system. It is very easy to set up, and management is done with an easy-to-use web interface called eBox so once the system is set up, you can forget about the command line.

…not that I would “forget about the commandline” but this could actually come in handy sometimes.

read more | digg story

While searching for an easy way to do server side Spam filtering, so I don’t have to bear with all those spams when looking at my Inbox with Webmail, I found IMAP Spam begone. It’s a python script that scans your Inbox for new messages and hands them to Spamassasin to check their spam status and copies them to a pre-defined folder in your Maildir if it is found to be a spam message. Client side spam filtering is done with Apple Mail on my iBook which works very good for me. So there is a second layer of filtering in place in case something still gets through.

Although isbg.py is rather old and hasn’t been updatet in about three years it works very conveniently and tags nearly all of my Spams, moves them to my Junk folder and deletes them from my Inbox. The script is called from a cronjob and run every 10 minutes so there is a slight chance that I still find Spams in my Webmail before isbg.py is able to run and delete them.

The reason I settled for this “external” integration of Spamassasin via isbg.py is that I didn’t want to mess around with the transport rules of my MTA because of the chance to do something not all users are happy with. With IMAP Spam begone I have an individual solution that works for me without altering the way all the other people experience the mail service.

Below you’ll find the command line options I have running, for further explanations please refer to the projects homepage.

isbg.py --spaminbox INBOX.Junk --spamc --delete --nostats --expunge

Update: Since the ISBG site seems to be down currently, I’ll provide a download link for the script here.

isbg.py

Because I searched for it now for half an hour and could only find it in the Google cache.

Irssi proxy usage:

First you’ll need to have the proxy module installed, either configure
irssi with –with-proxy and do make install, or manually:

cd src/irc/proxy
make
mkdir ~/.irssi/modules
cp .libs/libproxy.so ~/.irssi/modules/

In irssi, say:

/LOAD proxy

You really should set some password for the proxy with:

/SET irssiproxy_password secret

Then you’ll need to configure the ports/ircnets the proxy listens in, something like:

/SET irssiproxy_ports ircnet=2777 efnet=2778 freenode=2779

There we have 3 different irc networks answering in 3 ports. Note that you’ll have to make the correct /IRCNET ADD and /SERVER ADD commands to make it work properly.