Uncategorized 03 Aug 2009 12:26 am

Renaming jpegs using EXIF data

Here’s a handy bash snippet I just got done using to rename a bunch of jpegs that had their ctimes/atimes mangled.  This resets the time to whatever the createtime is in the EXIF data, and renames the file to something meaningful (if you used an undelete program that spits out random filenames). Enjoy.

#!/bin/bash
find /home/maxvend/recover -type f -iname \*.jpg | while read names; do
#Extract the exif create date
ctime=`exiftool -dateFormat "%Y-%m-%d %T" -CreateDate $names | cut -d: -f2-6`;
#set the atime, mtime
touch -cma --date="$ctime" $names;
#Rename the file to something meaningful.
newname=/home/maxvend/recover/`ls --full-time -Gg $names | awk -F" " '{print $4 " " $5}' | xargs -I xx date --date="xx" +%Y-%m-%d-%H%M%S`"_picture.jpg"
if [ -e $newname ]; then
cp -pv $names $newname.2
else
cp -pv $names $newname
fi
done;

Fedora Directory Server & Sysadmin 25 Jul 2007 05:50 pm

Installing Fedora Directory Server

This time around I’m using CentOS 5 for my base OS. FDS is nice because it gives you some nice (for linux) GUI tools for managing users and such. Get the base system installed to your liking, and remember to set the hostname to whatever you want the domain to be…for example c5-devel.alpha.test will be the alpha.test domain.

Download the FC6 FDS package here , and install with rpm -Uvh. You want the FC6 package for CentOS 5, since CentOS 5 uses Apache 2.2…more details here.

Note that this next part (installing Java) differs from the original FDS install guide…they tell you to jack around with jpackage, blah blah, this way is much much easier. And it works, the best of my knowledge. Yeah, its not managed by rpm, but honestly, who actually updates Java through RPM? And you expected it not to break??? Bahahah

Anyways…

Download the latest JDK 5.0 here… You want the “Linux self-extracting file” (as of writing this it is JDK5 Upd 12 – jdk-1_5_0_12-linux-i586.bin )

Copy the installer to the /usr/local directory, then run sh ./jdk-1_5_0_12-linux-i586.bin. Do the windows install..(type yes for everything).

Make a symlink from the java there to /usr/bin/java: ln -s /usr/local/jdk1.5.0_12/bin/java /usr/bin/java.

Now go ahead and run the /opt/fedora-ds/setup/setup program to set up your domain. Fill in as you feel appropriate…I usually choose option 3 for the custom install, as it doesn’t ask too many annoying questions. (and I can set my administration port as 1337…hehe)

Start up your console:
./startconsole -u admin -a http://c5-devel.alpha.test:1337/
If you see the login screen, and can log in, congratulations! You have a working install of FDS. In later posts, I’ll go into how to configure stuff.