Linux

Rename file extension recursively

This is a simple bash script to rename all JPG file extensions to JPEG, it works recursively and takes subfolders also. #!/bin/bash function rename_extension { #change all .jpg to .jpeg for file in $1/*.jpg; do mv $file $1/`basename $file .jpg`.jpeg; echo $file; done; # recurse directories for d in $1/*; do if test -d $d; […]

Read More
Linux

Cold backup for the Open Source Edition of Zimbra

Today I’ve setup a cold backup routine to backup my Zimba installation running on my Debian (Etch) 4.0 server that is in full production now for my private domains. This is a slightly modified backup script for the Open Source Edition of Zimbra from the Zimbra Wiki. Please note that the script does a full […]

Read More
Scripting

Getting iptables to survive a reboot

As far as I know Debian doesn’t have any defined way to save your iptables rules. I’ve done it this way: First I’ve made my iptables rules and made sure they work. Second is to save those rules to a configuration file iptables-save > /root/scripts/iptables.save I always try to save my custom scripts and required […]

Read More
Scripting

Resize and watermark images using Imagemagick

This is a modified version of my Resize of images in a folder with imagemagick post back in February. Only difference this time is that i strips out EXIF tags and the script has been cleaned up a bit. Click on the image to see the result in full size. #!/bin/bash # Description: # Script […]

Read More
Security

Determine false positive from rkhunter

I’ve installed rkhunter, a rootkit checking script, on a Ubuntu 7.10 (Gutsy Gibbons) distro and today it mailed a message saying that 3 files had their properties changed. The files were /usr/bin/chattr, /usr/bin/lsattr and /usr/bin/perlBefore doing anything I tried to update rkhunter to see if there had been any updates to fix this message rkhunter –update […]

Read More