Photo etc

Shell scripts for archiving digital photos in directories by month

This is my version of the shell script “Shell scripts for archiving digital photos in directories by date“. It utilizes  the exiftags command available in most linux distributions like Gentoo and debian Linux. Though the metacam program is also usefull since it can read Nikon NEF-files.Here’s an example of a directory tree they create: 2006 […]

Read More
Scripting

Shell scripts for archiving digital photos in directories by date

The fact that most digital cameras store the shooting dates inside JPEG files in the EXIF format makes it possible to automatically archive the photos by date right after they are downloaded, which is exactly what the scripts below do. Here’s an example of a directory tree they create: 1999 1999-07 1999-07-14 IMG_48324.JPG IMG_48325.JPG IMG_48326.JPG […]

Read More
Linux

Shell script for removing duplicate files

The following shell script finds duplicate (2 or more identical) files and outputs a new shell script containing commented-out rm statements for deleting them. You then have to edit the file to select which files to keep – the script can’t safely do it automatically! OUTF=rem-duplicates.sh; echo “#! /bin/sh” > $OUTF; find “$@” -type f […]

Read More
Scripting

Using GNU screen

If you do not like unnecessary windows open, or want to get the maximum out of your terminal session, screen will soon be in your .bash_history numerous times. I found GNU Screen’s barrier to entry quite high, and I wanted to lower it for my readers. GNU Screen enables you to run many shell processes […]

Read More
Security

Script to unmount Busy Devices

First the script tries to umount the drive normally. If that fails, it tries to restart famd which is the most common problem. If that fails it tries to restart xinetd. If that fails it uses the command fuser -ki which asks you if you want to kill each process that’s using that folder. Be […]

Read More