SpamAssassin is a tool to remove Spam from incoming email. The following describes a way of training Spam Assassin to be more effective.
Email is stored within Cyrus, and mail that gets through SpamAssassin into a user's inbox is then moved to the "put_spam_here" folder by the user.
This script is run hourly, empties the "put_spam_here" folder, and hopefully trains spamassassin to catch more spam.
Normally when writing a shell script and not wanting more than one of 'it' to run at a time, I use something like :
LOCK=/tmp/something
if [ -f $LOCK ]; then
# lock file already exists....
exit 1
fi
trap "/bin/rm $LOCK" EXIT SIGKILL SIGTERM SIGQUIT
touch $LOCK
# rest of script here
The other day, I went to create yet-another-script and this time stumbled onto lockfile-progs, in which case my locking algorithm can be slightly more elegant like :
I've created a quick howto which might help someone who is suffering from a BASH PS1 prompt which gets too unwieldy when your `pwd` is quite long. see here
intro:
The Unix BASH shell is customisable. This covers one way of setting your PS1 so it doesn't get too long when in a deeply nested file hiearchy. It assumes you already know what PS1 is etc.
subject:
bash PS1 prompt customisation
When writing bash shell scripts, I keep forgetting how to do arithmetric.... so here is a reminder for me ....
#!/bin/bash # Either : f=10 let f=f+1 echo "$f is now 11" # Or : f=10 f=$(($f+1)) echo "$f is now 11" # More advanced : # (Random number between 0 and 8 inclusive) f=`perl -le 'print int rand 9'` echo "$(($f+10)), $(($f+20)), $(($f+30)) prints e.g. 2, 14, 24, 24"
End memory jogging post.
Recent comments
6 hours 14 min ago
2 days 16 hours ago
3 days 14 hours ago
6 days 2 hours ago
1 week 1 day ago
1 week 5 days ago
2 weeks 17 hours ago
3 weeks 4 hours ago
3 weeks 6 days ago
3 weeks 6 days ago