Linux

Create a year calendar for 2008 using pcal

I wanted to make a whole year calendar and found pcal, a command line tool. pcal -F 1 -E -B -O -p -w -o 2008.ps 2008 -F starting weekday; 1 is Monday -E specifies European formatted dates -B leave unused date boxes blank, default is grey -O selected days will be printed as outlined characters […]

Read More
Photo etc

Number of shots taken by Nikon D80 camera

The Nikon D80 camera contains a EXIF tag value that counts the number shots taken Tag (hex) Tag (dec) IFD Key Type Tag description 0x00a7 167 Makernote Exif.Nikon3.ShutterCount Long Number of shots taken by camera This can be extracted by running the following command exiv2 -pt picturename.JPG … Exif.Nikon3.ShutterCount Long 1 5263 This example shows […]

Read More
Scripting

Backup mysql databases into separate files

This bach script makes separate backup files of all the databases in mysql and saves the result in the mysql_backup folder. #!/bin/bash -v USERNAME=’yourusername’ PASSWORD=’yourpassword’ HOSTNAME=’yourhostname’ BackupFolder=’/backup’ for i in $(echo ‘SHOW DATABASES;’ | mysql –user $USERNAME -p$PASSWORD -h $HOSTNAME | grep -v ‘^Database$’ ); do mysqldump –user $USERNAME -p$PASSWORD -h $HOSTNAME –opt $i > […]

Read More
Scripting

Strip EXIF tags from JPG files

Sometimes it’s a good idea to remove the hidden data a JPG file contains, like when you publish picures on the Internet. An easy way to remove all EXIF-tags from your JPG files is to run the command using jhead jhead -purejpg *.jpg

Read More