Monday, September 2, 2013

Xbox 360: 120mm fan mod for quietness

I wanted to watch a movie yesterday, but my Xbox's fans are too loud. So I decided to do something about it!


Batch photo resize preserving modify date

On Mac OS with ImageMagick installed (see also this older post):

mkdir resized
cp 2013-09-02*.jpg resized
mogrify -resize 3056x3056 resized/*.jpg
find resized -name "*.jpg" | sed "s/resized\///" | xargs -I {} touch -r "{}" "resized/{}"
mv resized/*.jpg .
rmdir resized

The crazy find/sed/xargs thing does the following:
  1. find : Find all the jpg files in the "resized" folder and return their relative path.
  2. sed : Find and replace all instances of "resized/" with an empty string. sed returns the full string with replacements, not just the match.
  3. xargs touch : Change each of the files in the "resized" folder to have the same modify date