I have created a screenshot script that allows you to take a screenshot and upload it to your server, just by pressing a hotkey. This is only for Mac OS X, but it could be adapted to your flavor of linux. With this script, you can choose between a full screen screenshot or a selected region. I will be describing the later.

- First you’ll need to set up an SSH key pair and send the public key to your server. I had a hard time finding an elegant tutorial, but this one at Slice Host was the best I could find. Read these three paragraphs: SSH keygen, SSH copy, and SSH Permisions. Make sure you don’t use a password.
- Download and install growl (this is optional but really useful). After installation you’ll need to copy growlnotify in the extras directory (in the DMG you downloaded) to your /usr/local/bin/ directory. You also may need to run: sudo chmod +x /usr/local/bin/growlnotify.
- Download this script to a permanant location on your computer. I put mine in ~/Scripts with all my other scripts.
- Edit the script to include your username, server address, and screenshot location. You can also modify the naming scheme and uncomment then #open $FINAL_ADDRESS line if you want it to open after it’s uploaded.
- You’ll now need to make the script executable. So run the command: chmod +x ~/Scripts/screen_shot_me.sh
- Download and install something like QuickSilver or FastScripts lite to let you setup global shortcuts to trigger the script! (Read how to do this step and the next below.)
- Set up your keyboard shortcut application to launch the shell script. I use Cmd+Shift-4 (and I disable Apple’s default action for that shortcut, which is to take a screenshot and save it to your desktop). You can also use Cmd+Shift+2 or Cmd+Shift+5 which are unused.
- Now press the shortcut key, select the area you want uploaded, and growl will let you know when it’s done uploading. The URL is now on your clipboard! Cmd+V when you’re ready!

I thought I’d also share how I setup my global keyboard shortcut program. I’ve been using LaunchBar for my keyboard interface application, instead of QuickSilver and I’ve been loving it. Unfortunatley I’m not sure how to do “Triggers” in LaunchBar, but that’s ok! Because I’ve found FastScripts Lite!
- Download and install FastScripts Lite (it’s at the bottom in fine print).
- Download this AppleScript to launch your shell script (you may need to edit this if you didn’t put the script from above in ~/Scripts).
- Put the script in ~/Library/Scripts
- FastScripts Lite should see it and you can then specify a shortcut key in the Fast Scripts Lite Shourtcuts tab.
Yay! You should be done. Now you can take screenshots as fast as your internet connection allows!
I found this answer on the macromates.com mailing list and thought it should be easier to find. Hopefully you found this post easily.
So it is a bit complicated to set the default document type in Text Mate, but I’ll show you how using HTML as the example language.
…[you'll] need to find the UUID of the language you want as default. All the default languages are stored in TextMate.app/Contents/SharedSupport/Bundles in the Syntaxes folder of the bundle. This is in the binary plist format, so you’ll need to convert it
first to readable form.
So from the terminal you’ll need to run the following command and restart Text Mate (don’t forget this!):
plutil -convert xml1 /Applications/TextMate.app/Contents/SharedSupport/Bundles/HTML.tmbundle/Syntaxes/HTML.plist && defaults write com.macromates.textmate OakDefaultLanguage $(grep -A1 uuid /Applications/TextMate.app/Contents/SharedSupport/Bundles/HTML.tmbundle/Syntaxes/HTML.plist | tail -1 | cut -d ">" -f 2 | cut -d "<" -f 1)
And Voila! Now when you open a new document in Text Mate, the default language is set to HTML!
Let me explain the command:
- First it uses the property list utility (plutil) to convert HTML.plist from binary to XML1
- Then it uses defaults to write the UUID (universal unique identifier) of the HTML language to the com.macromates.textmate file. But we don’t know the UUID so we have grep and cut find it for us.
- Inside the $() (which is executed first and gives us the output) we use the Global Regular Expressions Parser (grep) binary to grab the string “uuid” from the freshly converted HTML.plist and show that line, and the line after it (-A1).
- We pass that output to tail and get just the last line (which should look something like: <string>OUR LONG UUID</string>)
- Then using cut we set the delimiter to ‘>’ and print whatever’s after ‘>’ (output: OUR LONG UUID</string>)
- Using cut again we set the delimiter to ‘<’ and print whatever’s before the ‘<’ (output: OUR LONG UUID)
- And finally ending the chain piping with a )
Now if you want you could throw that in a bash script and replace HTML with $1. Save it as changeTMDefaultNewDocumentType.sh. Chmod +x the file. And then run:
./changeTMDefaultNewDocumentType.sh XML
And it would switch the default to XML (or whatever you specify, as long as it’s a syntax directory that exists).
Well I just installed Safari 4 and it seems to work pretty good, but there are a few things I had to tweak and install.
- You need to install Glims (I uninstalled it using this app first, but I don’t know if that’s necessary)
- Install Safari Adblock
- For 1Password you’ll need edit the Safari > MaxBundleVersion in /Applications/1Password.app/Contents/Resources/SupportedBrowsers.plist to be “5528.16″ instead of “5528.1″. Now open 1Password and uncheck and then check the Safari plugin in the preferences.
- Now Restart Safari and everything should be good.
- I like to have the downloads window auto close after 5 seconds and I don’t let safari keep my download history.

Some things you’ll need to know:
- Gmail won’t load if you have setup the Offline mode w/ Gears, so you need to remove gmail.com from your Gears prefernces.
- Gears doesn’t work, and any webkit browser (like Fluid) won’t work with gears either (as the system wide web kit browser has been updated)
- If Safari won’t load it’s because you need to uninstall Glims first (don’t worry you can reinstall the new version and it should load fine)
Yeah my new connection is something like that…

If you’re a Quicksilver user, doing a simple Google search with it is exceptionally easy. Here’s the steps to do it:
1. Search for “***” in your favorite search engine.
2. Bookmark the search query and append “qss-” before the http:// in the bookmark (you’ll need to edit it).
3. Hit your Quicksilver shortcut key then press Command+R for it to reload your new bookmark.
4. Now type your bookmark name, press enter, type your search query, and press enter again.
Voila, your search query was opened in your favorite (default) browser. If this didn’t happen then you need to install the “Web Search Module” in Quicksilver’s Plugin pane. If you don’t see it, search for “web” under “All Plugins” and then click the gear and choose “Install plugins from the web without asking”.
You can’t tell but Rascal’s wearing a santa hat and he’s smiling for the camera. 
hardstatus alwayslastline
hardstatus string '%{= rW}%-Lw%{= wb}%54>%n%f*%t%{-}%+Lw%< %{= bW}%-=%h | %c:%s | %H %l%{-}'
I created a nice text exapnder snippet and I thought I’d share it.
do shell script "/opt/local/bin/wget -O- -q http://tr.im/api/trim_url.xml?url=$(php -r 'echo urlencode($argv[1]);’ $(pbpaste)) | tr ‘>’ ‘\n’ | tr ‘<’ ‘\n’ | grep -m 1 -A 1 url | tail -1″
I fixed this so that it escapes the URL from your clipboard (before it would cut the url short before the &) using php.
It grabs the clipboard contents, sents it to http://tr.im and then grabs the url. You just type your expander code and poof whatever was in the clipboard is now shrunk to a http://tr.im/url
I also made a few other ones that are pretty simple. This one types the current playing artist - track in iTunes:
do shell script("osascript -e 'tell application \"iTunes\" to artist of current track as string' | tr '\n' ' ' && echo \"-\" | tr '\n' ' ' && osascript -e 'tell application \"iTunes\" to name of current track as string'")
There’s probably an easier way to do it than calling an shell script to run an applescript from within a apple script but it was 4 am and I haven’t had time to change it.
Also, an uber simple uptime:
do shell script ("uptime | awk -F',' '{print $1 $2}'")
That’s all for now!
1. Insert CD/DVD source
2. Fire up a Terminal, you can then determine the device that is you CD/DVD drive using the following command:
$ drutil status
Vendor Product Rev
MATSHITA DVD-R UJ-835E GAND
Type: DVD-ROM Name: /dev/disk1
Cur Write: 8x DVD Sessions: 1
Max Write: 8x DVD Tracks: 1
Overwritable: 00:00:00 blocks: 0 / 0.00MB / 0.00MiB
Space Free: 00:00:00 blocks: 0 / 0.00MB / 0.00MiB
Space Used: 364:08:27 blocks: 1638627 / 3.36GB / 3.13GiB
Writability:
Book Type: DVD-ROM
3. Umount the disk with the following command:
$ diskutil unmountDisk /dev/disk1
Disk /dev/disk1 unmounted
4. Create the ISO file with the dd utility (may take some time):
$ dd if=/dev/disk1 of=file.iso bs=2048
5. Test the ISO image by mounting the new file (or open with Finder):
$ hdid file.iso
6. The ISO image can then be burnt to a blank CD/DVD.
I recently was trying to administer my mac from my in-laws house and I wanted to install an application that used Installer.app. So, I thought I’d create an SSH tunnel and and VNC in it. Unfortunatley, I didn’t have VNC configured. So it was off to the search engines. Here’s what I came up with:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -clientopts -setvnclegacy -vnclegacy yes -setvncpw -vncpw VNCPASSWORDHERE -restart -agent
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent
