July 9th, 2008

Recently I’ve noticed quite a few new spam messages making through my mail server into my mailbox so time to update Spam Assassin and let it know what its missing:

1. I have a seperate mailbox I access explicitly for the purpose of holding Spam, so when my personal junk email folders have a significant amount of real spam in which dont have the ***SPAM*** mark, I move them over to the Spam mailbox.

2. Logging into my mail server as root, I can then proceed to the mailbox store, and inform spamassassin that everything in there should be treat as spam.   It’s always a good idea to double check the mail though !

3. Command I use to inform SpamAssassin is the sa-learn command :

 sa-learn –spam –progress <path-to-spam-mailbox>

July 9th, 2008

Steps to get from docbook to fully interactive webhelp..

1. Generate HTMLHELP via Oxygen.

2. (can compile to CHM) or carryon and import HTMLHelp project (hhp) file into Robohelp.

February 16th, 2008

This little snippet is a script I have running via Cron, set to execute every 30 minutes.  If like me, you have maybe running forum software that isnt so great handling image uploads in posts and find that users complain because they themselves arent too sure how to resize images prior to posting then this may be useful.

What it does is scan a specified folder every 30 minutes(as set by cron) for new uploaded jpg’s that are greater than a specified size.  Using the ImageMagick libraries, it then applies compression and resizes proportionally the image if it exceeds a specified height & width.  Images which have been uploaded as 2Mb originals have been processed and saved as 20k files, thats 1% of the original size without any real noticable difference in quality.  People tend to upload images which are suitable for professional printing and far exceed the quality required for simple website viewing.

This is my code:

#!/bin/bash
src_dir="/var/www/ukordinance/images/fbfiles/images"
DATETIME=`date +%d-%m-%Y-%H:%M`
echo "Looking for files in : $src_dir on $DATETIME"
#find $src_dir -iname '*.jp*g' -size +100k -mmin -30
for i in `find $src_dir -iname '*.jp*g' -size +256k` ;
do
echo "Processing : "$i
convert -resize 1024x768\> -quality 80 $i $i;
done

About Me

Welcome to my blog. Here you'll find mainly work related content, a suppository for all my notes which otherwise would end up on a post it note.