Organize Photos Into Monthly Folders

I had a few months worth of photos on my phone that needed to be imported and sorted.

All I wanted to do was move the photos into monthly folders. So I found exiftool that had some options that did what I wanted.

If you have Homebrew on mac you can install it like this.

brew install exiftool

Here is the command I used to move my photos.

exiftool -d %m "-directory

If you wanted to move them into year/month folders, it would go something like this

exiftool -d %Y/%m "-directory

Have a look at the docs and organize away.

Silex and Phar on Dreamhost

You can’t run Silex apps directly on Dreamhost yet. After a bit of digging around I came up with this.

You need to create a file ~/.php/5.3/phprc in your home directory, not under the website directory and put these lines in there.


extension=phar.so
detect_unicode = Off
phar.readonly = Off
phar.require_hash = Off
suhosin.executor.include.whitelist = phar

Its not immediate, but in about 15 mins it should work.

Reference http://serverfault.com/questions/317416/enabling-phar-on-dreamhost-shared-hosting

Vote up my answer if it works for you.

Commit Tips

If you are still using CVS and Subversion or moved on to something distributed its a good idea to keep in mind how to commit.

Commits and commit messages are pretty important. I’ve had single user repos for years and I still put decent messages and commit sensibly in case I need to go back and figure out something.

Here are a few tips that hopefully will help to do better commits.

  • A commit shouldn’t be a number of unrelated things.
  • Each commit should be a single step that you are doing to achieve something.
  • Your commit message should describe just the step you did.
  • No blank commit messages, blank means you did nothing. :)
  • In a traditional VCS like CVS or Subversion always do an update and merge any changes before you commit.
  • In a DVCS like Git or Mercurial commit what you did, then pull, update, merge, commit, and push. (This might change depending on the tool you use.)

If you keep your commits per step you will find you can pick and move, release, make patches or do pull requests easier.

Show/ Hide Hidden Files In Mac Finder

The first thing you notice in Mac Finder is there is no way to show hidden files. In Windows Explorer or Gnome this is in the menus. On mac you need to set a environment variable called “com.apple.finder AppleShowAllFiles” to toggle the state of hidden files.

I manually changed this a couple of times, but its annoying to do all the time. So I thought of adding it to a bash script to make things easier.

#!/bin/bash
SHOW_FILES=`defaults read com.apple.finder AppleShowAllFiles`
if [ $SHOW_FILES = "FALSE" ]; then
	defaults write com.apple.finder AppleShowAllFiles TRUE
else
	defaults write com.apple.finder AppleShowAllFiles FALSE
fi
killall Finder

References
Mac OS X – Show / Hide Hidden Files in Finder