vendredi 17 décembre 2010

Fixing modification dates on photos using the creation date in the photo file (set by the camera)

I have a large collection of photos, several dozens of Gb and I accidentally copied them without preserving the orginal creation dates.

Every photo you take has a date set in the file by the camera in what is called exif metadata. Some cameras can also record the exact coordinates where the photo was taken ... anyway, I needed to fix those dates. I also like to keep the files in a year/month/day folder structure.

So, here is my script:

#!/bin/sh

DATE=`exiftool "$1" | grep 'Create Date' | sed -e 's/.*: //;s/://g;s/..$//;s/ //g'`

DEST=`echo $DATE | sed 's@^\(....\)\(..\)\(..\).*@/media/shared/Pictures/\1/\2/\3/@'`
touch -t $DATE "$1"

if [ -d "$DEST" ]; then
cp -an "$1" "$DEST"
else
mkdir -p "$DEST"
cp -an "$1" "$DEST"
fi

vendredi 10 décembre 2010

Windows XP SP3 Installation fiasco

So, here I was again, creating a new vm for Windows XP. I have a Windows XP SP3 iso from work I use. This is my work computer and we have a volume license. Anyway, legal all the way.

So I insert the cd, it installs fine and the first thing I do is start Windows Update. It needs to install 85 updates totaling 107 Mb and claims it will take 51 minutes with my connection ... it took about 15 minutes including installation ... although only 82 were installed, the other three were skipped (I guess they needed a reboot).

Anyway, on the reboot, it keeps restarting as soon as it gets to the blue background. Not the BSOD background, the somewhat lighter background before the Welcome page loads.

Safe mode works without an issue, so I somehow suspect graphics driver issues, remember this is a vm - and I enabled 3d. So I try VGA mode, and there I briefly see a bsod. So I disable the automatic restart on error, and the fucker does not allow me to switch to another mode, like VGA.

So, instead of seeing the blue background I see a higher resolution black background with an hour glass. Go figure ... anyway, go back to the startup options and select "Last Known Good", which I did not feel too comfortable with, since I just installed a whack of updates and this is still the first restart after that massive install .... but I get to the desktop, youpie!!!

But the fun is not over, it wants to send an error report, which is fine by me ... and the error report is corrupt!!!!

So, I know it wants to install the other three updates and I shutdown Windows (Start -> Shutdown)... and it installs the updates. After that I get back into the same loop ... I select Last Known Good and it works ... bloody hell, how do people put up with this I do not know ... And this Last Known Good does not sound right to me ... updates have certainly changed the services and drivers ... ohh my ... I am unsure what to do now. I probably should not have installed the vm tools before the updates? Go figure.

I guess I am condemned to select Last Known Good after every software update .... fsck!

Before you ask, I need Windows XP for work ... sometimes ... and my 5 year old vm was getting issues with disk space, so I decided to install a new one from scratch.

I like the irony of "Last Known Good" ... that should uninstall Windows ....


I go back to windows update, and it wants t install another 7 updates, which I install ... after that, I get back into the looping booting fiasco ... Last Known Good ....