Archive for December 24th, 2014

Frozen Pond

WwudSfM.jpg (4132×2722).

Frozen Pond

Mother Jones

Mother Jones

4 hours of Warner Brothers cartoons for a Saturday morning

php code to get the latest TED talks

[insert_php]
$channel_name = ‘TEDxTalks’;//Be sure to change this to your channel
$count = 8;//# of videos you want to show (MAX = 20)
$em_width = 420;//width of embedded player
$em_height = 315;//height of embedded player
$wrap_class = ‘video’;//class name for the div wrapper

//The output…
$sxml = simplexml_load_file(“http://gdata.youtube.com/feeds/api/users/$channel_name/uploads?max-results=$count”);
foreach ($sxml->entry as $entry) {
$vidKey = substr(strrchr($entry->id,’/’),1);
echo ”

“;
}
[/insert_php]

Changing image names using EXIF tool

exiftool and a way to rename your pictures into something sensible

ExifTool is probably your best start:
http://www.sno.phy.queensu.ca/~phil/exiftool/

I second exiftool. Lots of options to rename files. If you rename files based on createtime and perhaps other fields like resolution you will end up with unique filenames and then you can filter the duplicates
Here is a quick command which will rename every file in a directory according to createDate

exiftool "-FileNameCreateDate" -d "%Y%m%d_%H%M%S.%%e" DIR

If the files were all captured with the same device it is probably super easy since the exif info will be consistent. If the files are from lots of different sources…good luck.

#!/bin/sh
OUTF=rem-duplicates.sh;
echo "#! /bin/sh" > $OUTF;
find "$@" -type f -print0 |
xargs -0 -n1 md5sum |
sort --key=1,32 | uniq -w 32 -d --all-repeated=separate |
sed -r 's/^[0-9a-f]*( )*//;s/([^a-zA-Z0-9./_-])/\\\1/g;s/(.+)/#rm \1/' >> $OUTF;
chmod a+x $OUTF; ls -l $OUTF

It should be straightforward to change “md5sum” to some other key — e.g. EXIF Date + some other EXIF fields.
(Also, isn’t this really a question for superuser.com or similar?)

Same thing, but faster…
You md5sum everyfile, but you only need to do it for files with the same size:

#/bin/bash
find "$@" -type f -not -empty -printf "%-32i%-32s%p\n" \
| sort -n -r \
| uniq -w32 \
| cut -b33- \
| uniq -D -w32 \
| cut -b33- \
| xargs -0 -d"\n" -l1 md5sum \
| uniq --all-repeated=separate -w32 \
| cut -b35-

True Lebowski – parody/mashup of Big Lebowski/True Detective

Return top

Geek

I've seen things. Now I'm gonna write about them.