fredag, januar 19, 2007

Creating thumbnails from first page of a pdf

Using imagemagick - convert:

convert "document.pdf[0]" -thumbnail 150x150 "firstpageofpdf.png"

Since convert uses gs (ghostscript) to process the pdf, remember that gs also needs to be in the php PATH. And of course, that the apache www-user has the correct folder permissions.

Labels:

fredag, desember 08, 2006

Amavisd Spamassassin status header on all messages

Remember, the recipient domain has to be in local_domain_maps in amavisd.conf for the status header to appear.

Example:
@local_domains_maps = ( [ ".$mydomain", ".domain.no", "domain.no" ] );

torsdag, november 16, 2006

MySQL backup

mysqldump --all-databases --quick --single-transaction -u backup -p| gzip > mybackup.sql.gz

Change backup with user of your choice and type password at prompt. Or create a localhost-only backup user with read-all privileges.

fredag, september 22, 2006

amavisd-release

To release a file from quarantine, use the amavisd-release program. I could not find this on my ubuntu machine where I installed amavisd-new with apt-get. So I copied the amavisd-release program from the original amavis package and put it in /usr/sbin/

Then I added to the 50-user file: (The newest ubuntu uses a conf.d/ for the amavisd-new settings files. Most others distros use amavisd.conf

$interface_policy{'SOCK'} = 'AM.PDP';
$policy_bank{'AM.PDP'} = {protocol=>'AM.PDP'};
$unix_socketname='/var/amavis/amavisd.sock';

I restarted amavis, and typed the following:

amavisd-release mail_id secret_id

and it WORKED!

I use mysql for quarantine storage, but this should work with regular file quarantine too.

Amazing.

onsdag, september 20, 2006

Remove password from ssl server key

# openssl rsa -in server.key.pass -out server.key
Enter pass phrase for server.key.pass:
writing RSA key

onsdag, mai 24, 2006

Stuffit download page

For easy access, so you don't need to fill in email address.

http://simsub.digitalriver.com/cgi-bin/stuffit-download

torsdag, mars 23, 2006

Delete all files older than 7 days

This works in the Terminal app on Mac OS X Tiger 10.4.4:

find /path -mtime +7 -exec rm -rf {} ';'