Linux

Rotate and rename images according to their EXIF info

This is my short script to rotate and rename image files accoring to date captured based on their EXIF info. You need jhead and exiv2 to run this. These two programs are also available in Windows and only require you to make small changes to work there as well. #!/bin/bash -x echo Rotating JPEG file(s) […]

Read More
Backup

Backup of Zimbra MailBox using zmmailbox

This is a short script I use to backup the Zimbra mailbox content for my users. This has been used on a Zimbra Collaboration Server (ZCS Open Source Edition) 7.2 installation, but should work on earlier versions as well. I use another script to backup the whole Zimbra installation, but that might be another blog […]

Read More
Windows

Rename AVCHD files using Exiftools

Simple bash script to rename AVCHD/MTS/MOV files to match their recording date and time. #!/bin/bash if [ -z “$1” ]; then echo “Usage: ./rename_video.sh FILETYPE” 1>&2 echo “Example: ./rename_video.sh *.MTS” 1>&2 exit 1 fi for x in “$@” do exiftool ‘-FileName<DateTimeOriginal’ -d %Y%m%d_%H%M_%%f.%%e “$x” done The resulting files will be named like YYYYMMDD_HHMM_BASENAME.ext ie 20120703_1635_05600.MTS […]

Read More
Scripting

Grab several screenshots from specified window in linux

This was a short bash script I wrote to help document some startup problems on a server. The script was grabbing screen dumps from iDRAC during boot on a RHEL6 server, but it can be used on other distributions as well since the console command xwd is common. #!/bin/bash # Description: # Grab screenshot of […]

Read More
Linux

Randomize filenames

This is a simple bash script to create random filenames of all jpg-files (*.jpg) in a folder using the linux commands mv, sha1sum and cut. #!/bin/bash # Randomize filenames for fname in *.jpg; do mv “$fname” $(echo “$fname” | \ sha1sum | \ cut -f1 -d ‘ ‘ | \ cut -b 1-5).jpg done The […]

Read More