Password less SVN on Mac OS
It's pain to enter password tens of times when doing "svn up", "svn ci" on your own computer everyday. To make everything simpler:
local > ssh-keygen -t dsa
press enter twice if asking to enter a password phase.
local > ssh {user}@{server}
server > mkdir .ssh (If there is no .ssh sub directory at your home directory)
server > touch .ssh/authorized_keys2 (If there is no file authorized_keys2 in .ssh directory)
server > chmod go-rw -R .ssh
server > exit
local > ssh {user}@{server} 'cat >> .ssh/authorized_keys2' < .ssh/id_dsa.pub
local > ssh {user}@{server} (You should be able to login without entering a password)
Textmate script to restart mongrel
I often find myself needing to restart the rails app I am working on while in Textmate. Sure, its easy enough to switch to a terminal window and hit up-arrow, but since Textmate is a wonderfully developer friendly app, I decided to see what I could do about automating a common task.
In Textmate go to Bundles -> Bundle Editor -> Edit Commands

Use the + at the bottom to create a new Command

This gives you a blank template for a new command. The command editor gives you control over several aspects of your current working document and project. Since this is an app restart for development purposes, I choose to save all files before executing the command. Then, I just put in a few shell commands that will be executed directly. I like to do a clean restart so that the same script works even if this is the first time starting it up:
echo "Restarting the App..."
cd "$TM_PROJECT_DIRECTORY"
mongrel_rails stop
mongrel_rails start -d -p4040
This command takes no input, and puts the output into a tooltip. Finally, I need to select a key combination. cmd-R is taken, so I settled on cmd-G (for GO!).

That’s it. My very own custom command in Textmate in under 5 min. I leave the “Stop App” command as an exercise for the user.
