Friday, November 27, 2009

Convert a Grayscale Photo to RGB so that iPhoto will Import It

Update 2009/12/16: I wrote a more recent post about using Preview to convert a grayscale photo so that iPhoto will import it. That method is simpler. This method is better if you have a large number of grayscale photos to import.

Install ImageMagick.
convert photo_from_iphoto.jpg srgb.icm
convert photo_as_grayscale.jpg -profile srgb.icm photo_as_srgb.jpg

Tuesday, November 24, 2009

Unwrap text in Emacs

C-u 9 9 9 9 C-x f
C-x h
M-x fill-region

Thursday, November 12, 2009

SSH Port Forwarding

# Forward localhostport to destinationhost:destinationhostport
# using sshdhost.
#
# e.g, forward localhost:80 to remotehost:8080 using anysshdhost
# sudo ssh -L 80:remotehost:8080 user@anysshdhost
sudo ssh -L localhostport:destinationhost:destinationhostport user@sshdhost

# Forward sshdhost:sshdhostport to
# destinationhost:destinationhostport using sshdhost.
#
# e.g., forward localhost:80 to remotehost:8080 using localhost
# ssh -R 80:remotehost:8080 root@localhost
ssh -R sshdhostport:destinationhost:destinationhostport user@sshdhost