Linux

Remove duplicate packages when querying the rpm database

Today I had to solve a RPM problem on a Red Hat Enterprise Linux WS release 4 (Nahant Update 6) system (RHEL4) where there were duplicate packages when querying the rpm database. This had happened after an upgrade to update 6 using up2date from the command line. It seemed like i386 and x64 packages had […]

Read More
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
Scripting

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
Linux

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