I updated my jpeg geotag-removal script to recurse subdirectories. With that came the requirement to filter out irelevant files (not jpeg, no EXIF information). Below is the new script. I hope you find it useful:
#!/bin/bash
# Will remove non-essential EXIF from a jpeg while retaining Date/Time value.
# Use it to remove GPS information from pictures I want to put on the internet.
# Created Wed Aug 11 18:43:03 PDT 2010
# For handling spaces. See:
# http://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for img in $@; do
file_type=`file -b $img`
file_type=${file_type:0:15}
if [ -d "$img" ]; then
echo "$img" is a directory - recursing
$0 "$img/*"
elif [ $file_type == "JPEG image data" ]; then
# Grab the original date/time
DT=`jhead "$img"|grep 'Date/Time'`
# If the date information started out
# blank, trying to tack it back on
# will result in an error
if [ "$DT" == '' ]; then
continue;
else
# Current format: " Date/Time : yyyy:mm:dd hh:mm:ss"
# jhead requires: yyyy:mm:dd-hh:mm:ss
DT=${DT:15:25}-${DT:25}
# Strip non-essential information
jhead -purejpg "$img"
# Put the date/time back
jhead -mkexif -ts$DT "$img"
fi
else
echo "$img" is not a JPG - ignoring $file_type
fi
done
Archive for 2010
Hacking Tracks to accept shorter usernames
Monday, October 18th, 2010I’m looking at Tracks/Shuffle to manage to-do lists on my phone/computer. I’m scouring the tubes for one that doesn’t involve me handing my data off to someone else. I like Shuffle because it can synch to any Tracks server you specify, and since Tracks is free software, it’s easy to install on any server.
In an effort to be able to use my usual login (kj), I H@X0R-H@X0R-H@X0R-ed the code to lower the minimum login from 3 to 2 characters. It’s not rocket science, but I hope it’ll save somebody else a bit of grepping:
In app/models/user.rb, line 115, change
validates_length_of :login, :within => 3..80
to
validates_length_of :login, :within => 2..80
In spec./models/user_spec.rb, line 81, change
it_should_validate_length_of :login, :within => 3..80
to
it_should_validate_length_of :login, :within => 2..80
If you’re feeling really ambitious, you could even change the error messages to be accurate. In test/unit/user_test.rb,. line 87:
assert_error_on u, :login, “is too short (minimum is 3 characters)”
to
assert_error_on u, :login, “is too short (minimum is 2 characters)”
Again in test/unit/user_test.rb,. this time on line 107:
assert_errors_on u, :login, ["can't be blank", "is too short (minimum is 3 characters)"]
to
assert_errors_on u, :login, ["can't be blank", "is too short (minimum is 2 characters)"]
Intermittent server outages
Saturday, August 7th, 2010I noticed while I was in Portland last week that the server was down. When I got home, I discovered that the UPS was off. I pushed the button and turned it back on.
A day or two later, it was off again. I eventually figured out what it was:
Penny likes to sit atop the UPS. The newest member of our family likes to swat at Penny. Apparently, sometimes she hits the UPS power button instead.
I taped some cardboard over the button. I do not anticipate any further outages.
Technology as explained by my mother: The Internet
Wednesday, July 7th, 2010I was lamenting to my mother the difficulty in explaining technical answers to people who have limited experience with technology. She sighed sympathetically and said something along the lines of, “It’s very difficult for people who are used to dealing with a physical object to understand this thing fluttering all around us, breaking all the laws of physics.”
“Wait, where did you think the Internet is?”
She made a fluttering motion with her hands, “All around us. Like God.”
Technology as explained by my mother
Friday, July 2nd, 2010Someday I’d like to rent out a hall or theater and charge $5 a head for my mom to answer the audience’s technical questions. The audience would require a certain amount of savvy to realize that her answers are hilarious, not informative.
I’ll probably never get around to renting that space, so in the mean time, I’ll be posting them here, in a series I call “Technology As Explained By My Mother “. The first installment has already been posted. I’ve got a few such episodes drafted, I can be reasonably certain this will be at least a three-part series. I hope you enjoy them as much as I do.
Facial hair in the news
Wednesday, June 30th, 2010Some exciting news for those of us who love facial hair:
AUSSIE women find facial hair attractive and more men have sex and are “wilder in the bedroom”.
Technology as explained by my mother: Links
Tuesday, June 29th, 2010I was fielding technology questions from a family friend who had a hilarious misunderstanding about what a link was (he expressed a concern that too many people would link to his web page and cause a short circuit). I went to tell my mom so we could both laugh about it, but first I quizzed her to make sure she knew what a link was.
I asked something along the lines of “If I told you Google links to CNN, would you know what that meant?”
A google is a thing that appears there and you click it and it does something, whether you want it to or not.
She stopped to tell me to stop making that face. I didn’t catch what she said when she continued because I was trying to keep a straight face.
Random Blogroll Category v1.5.1
Monday, June 28th, 2010I just committed a minor revision to my WordPress plugin Random Blogroll Category. The line that was supposed to remove an extraneous HTML tag was completely wrong. The latest version will put out valid HTML.
It’s worth noting that I have no further plans for developing this plugin unless it is broken by a future WordPress update.


