Ignoring local changes to .rvmrc in git

A project at work has an .rmvrc file in the git repo that I modified to use a custom gemset. I don’t want to commit my changes (to avoid accidentally merging and pushing it upstream), but I also want to avoid needlessly stashing and popping it after each rebase.

Finally, the solution to my problem:

Add .rvmrc to the local git exclude file:

$ echo ".rvmrc" >> .git/info/exclude

Remove .rvmrc from files being tracked for changes:

$ git update-index --assume-unchanged .rvmrc

scrub_jpeg: delete all EXIF, IPTC, and XMP tags from your JPEG photos

Sdettling-scrub

flickr.com/photos/sdettling/3054797800

A friend photographer of mine recently grumbled about the lack of a simple way of batch removing of all metadata tags (IPTC, EXIF, XMP) from JPEGs (e.g. before uploading to online galleries).

A quick google search did not bring up any truly favorable candidates; most were convoluted GUI editors that tried to do too much, some reminded me of Win95 software from questionable sources, and the remaining were just ImageMagick incantantions with a little Perl or Bash thrown in (definitely not for someone who does not have Terminal.app permanently open).

I finally found jhead, which offers an argument called -purejpg promising exactly what I was looking for. Unfortunately, in testing it turned out it was modifying my actual images! If anyone would like to investigate further, I could supply a test image clearly illustrating skin tone differences before and after.

This is the last thing I needed. As with all software that's modifying possibly cherished moments in batch mode without supervision, you want to feel safe it's not doing something you may not be aware of.

Since having recently played with the exiv2 gem, I knew that reading and modifying metadata is no longer a complicated task. Hence, scrub_jpeg was born:

% brew install exiv2
% gem install scrub_jpeg
% scrub_jpeg *.jpg

Check out the project page for more info.

And before someone asks, I realize this is still not optimal for someone not familiar with the shell, but this is just version 0.0.1 and at least I know my photos are safe. ;-)

Haskell Gtk2Hs on Mac OS X 10.6

Just installed gtk2hs on my Macbook. Here are some notes for future reference.

First, install all dependencies. Most tutorials use macports, but I'm a fan of Homebrew myself.

$ brew update
$ brew install gtk+ gtkglext cairo cairomm libsvg-cairo libglade glade

Second, install gtk2hs. This used to be a real pain, but nowadays gtk2hs has been packed into a cabal package. Please thank your local gtk2hs package maintainer that made this possible!

$ cabal update
$ cabal install gtk2hs-buildtools
$ cabal install gtk

There is no step three!

But there maybe a catch. I got this error while cabal was installing gtk:

Building gio-0.12.0...
: cannot satisfy -package-id mtl-2.0.1.0-5b7a9cce5565d8cc8721ba4f95becf1b

This was peculiar, because running cabal list mtl clearly showed mtl 2.0.1.0 was installed. Thankfully ksf on #haskell straightened me out:

$ ghc-pkg list -v mtl
WARNING: cache is out of date: /Library/Frameworks/GHC.framework/Versions/7.0.3-x86_64/usr/lib/ghc-7.0.3/package.conf.d/package.cache
  use 'ghc-pkg recache' to fix.

Running ghc-pkg recache prior to running cabal install gtk fixed everything.

Here's a HelloWorld.hs you can build to test if gtk2hs works for you:

module GUI where

import Graphics.UI.Gtk

main = do
  initGUI
  win <- windowNew
  onDestroy win mainQuit
  widgetShow win
  mainGUI

 

Why is a developer like a newborn baby?

what I’ve learned while on maternity leave:

  • Babies speak their own language. It takes some time to figure it out, but once you do, life becomes easier.
  • Making a baby laugh is one of the best feelings in the world.
  • Once a baby trusts you, they feel safe to explore their surroundings without anxiety or doubt.
  • Babies will tell you when they’re hungry. Just be sure to have something ready for them when that time comes.
  • Babies like to fight against the urge to sleep. They will rage the hardest right before they pass out.
  • Your life is never the same once you welcome a baby into it. And that’s a good thing.

Many thanks to everyone at Quick Left for allowing me to opportunity to add this little project to my résumé.

And for some fun, be sure to replace the word baby or babies in the above list with developer or developers. Turns out they have more in common than you would’ve originally thought...

Commentary by Tara Anderson at Quick Left Blog, emphasis mine.

 

wroc_love.rb 2012 Ruby conference (and gem)

There is a fresh, new Ruby-oriented conference brewing in Wrocław, Poland.

Mark your calendars: wroc_love.rb 2012 is coming in March!

There is now an even easier to keep up-to-date on everything related to this conference, because I released a helper gem:

gem install wroc_love && wroc_love.rb

The wroc_love gem is your one-stop shop, genie in a bottle, personal masseuse, and friend extraordinaire to everything related to the wroc_love.rb Conference 2012.

Tomato USB printer on Mac OS X

I recently upgraded the home network with an Asus RT-N16 router, since the old one quite literally died on me. As soon as I unwrapped the shiny new box, I put Tomato USB on it: my router upgrade firmware of choice. (In case you’re wondering: I just tftp'ed Build v54 straight to the stock router, without DD-WRT’s help.)

The only thing that was missing is I could not get my old Samsung ML-2010 printer to play nice with my Macbook Pro. After lots of unhelpful googling, I’ve nailed down the correct incantation:

  1. Enable USB Printer on Tomato USB
  2. Disable bi-directional support. I am not positive if this strictly necessary, YMMV.
  3. Reboot router.
  4. Add a new internet printer on the Mac, using HP Jetdirect - Socket as the printer protocol, router IP, and port 9100.
  5. There was no built-in support for my printer, so I installed the Samsung ML-2010 Mac driver.
  6. There is no step 6.

The astute reader will cry foul, after all I’m using HP Jetdirect protocol with a Samsung printer. Now you know understand why I missed it the first couple of times. C'est la vie.

Tomato-samsung-ml-2010

Managing home .dotfiles with git and GitHub

This is how I manage my user ~/ profile configuration files using GitHub.

Originally based on Silas Sewell’s description. It’s mainly here for my own reference and posterity, since we all know how widespread link rot is. (At the time of writing, the Pinboard.in blog is down due to unforeseen circumstances, reinforcing my point via circular meta-recursion.)

Features

  • Centralized configuration management
  • Files live in their native locations (no symbolic linking)
  • Home directory is not a git repo
  • All the power of git with a simple alias

First time setup

$ cd ~

$ mkdir .homeconfig.git

$ echo "alias homeconfig='git --git-dir=$HOME/.homeconfig.git/ --work-tree=$HOME'" >> .bashrc

$ source .bashrc

$ homeconfig init

$ homeconfig add .bash_profile .bashrc .bash_aliases

$ homeconfig commit -m 'Initial commit'

$ homeconfig remote add origin git@github.com:GITHUB_USERNAME/homeconfig.git

$ homeconfig push origin master

If you get an error when running config pull to the effect of “You asked me to pull without...” run the following:

$ echo -e '[branch "master"]\n remote = origin\n merge = refs/heads/master' >> ~/.homeconfig.git/config

Setup configuration on second machine

Add your public keys to GitHub (if you haven’t done so already).

$ cd ~

$ mv .bash_profile .bash_profile.bak

$ git clone git@github.com:GITHUB_USERNAME/homeconfig.git homeconfig.git

$ mv homeconfig.git/.git .homeconfig.git

$ shopt -s dotglob

$ mv -i homeconfig.git/* .

$ rmdir homeconfig.git

Logout and log back in. Enjoy!

Feel free to peruse my dotfiles at https://github.com/pithyless/homeconfig.

Suggestions or ideas on how to improve this setup? Leave a comment!