søndag den 13. december 2015

JHead Rename images based on EXIF info

I just discovered JHead, a tool for manipulating JPEG images based on EXIT information. I don't know why I didn't find this tool before. This is extremely useful and convenient. I have tried a couple of tools on Windows and Mac but nothing is as convient at this one.

Install using homebrew:

brew install libjpeg
brew install jhead

libjpeg includes jpgtran, which is prerequisite for jhead but did not install as part of the jhead install.

I name my files using a date timestamp:

jhead -autorot -nf%Y-%m-%d-%Hh%Mm%S *.jpg

References:
http://www.phpied.com/installing-jpegtran-mac-unix-linux/
http://www.sentex.ca/~mwandel/jhead/
http://moinne.com/blog/ronald/bash/rename-your-photos-from-the-comandline-using-jhead

tirsdag den 8. december 2015

Release it

I am reading Release It by Nygard and these are some of the things to remember:


  • Use limits on queries. E.g. LIMIT 1 on Postgres or MySQL
  • Watch out for point-point connections
  • Set Socket.setSoTimeout() to protect against servers under heavy load
  • Use circuit breakers to degrade functionality gracefully under load
  • Return different errors for resource not available and application failures 
  • Fail fast, check availability of all required resources (ram, db, integration points, input)
  • Purge data (database, caches, logs)
  • Steady state
  • Bulkheads 
  • Cooperative demand control, handshaking between client and server to allow clients to back off. Problematic with http as the setup and teardown of connections is often the most expensive. Alternatively consider health checks either from client or from load balancer. Build handshaking into lowlevel protocols. 

SublimeText 2 Shortcuts

I am new to SublimeText 2 and so I need a little reminding of various shortcuts. Multiple cursors is one of the things I loved the most in Emacs. So I find this page very useful.

Simple overview of selection.