SSH host name completion on a Mac
The list of servers I have to ssh in to is continually growing many of them I need to have an ssh tunnel to get to so I fully use the ~/.ssh/config file to help me out. Now that my .ssh/config file has grown I am starting to forget what name of that one server was. On some unix boxes bash_completion is installed which allows you to type: ssh se[tab] and get: ssh servernamethatisreallylog.com. bash_completion is not installed on the Mac by default. You can install it with macports but I have yet to run in to a real need to install macports yet so I started searching for any other ways to get this working on my Mac.
What I found was a comment on a MacOSXHints hint.
All you need to do is throw this in your ~/.bash_profile file.
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
if [ -f ~/.ssh/config ]; then
cat ~/.ssh/config | \
grep "^Host " | \
awk '{print $2}'
fi
`
COMPREPLY=( $(compgen -W "${comp_ssh_hosts}" -- $cur))
return 0
}
complete -F _complete_ssh_hosts ssh
This will read in your .ssh/known_hosts file and your .ssh/config file and create a list of host names that you can now tab complete with the ssh command. Comes in very handy.
Work around for Google Gears on Snow Leopard
As I talked about in by previous post, Google Gears is not compatible with Snow Leopard. Google has been slow to get out a fix for the problem but seems like some others have found a work around and the guys from MailPlane have published how to use it. It involves downloading the source code, applying a patch and then building a package, or you can just download the package from MailPlane, though they have a “Use at your own risk” disclaimer on it. You will also have to run Safari in 32bit mode. So if you are dieing to get your Google Gears back, especially in light of the gmail outage on September 1st, then try it out. Let me know if you run in to any problems.
http://mailplaneapp.com/download/google_gears/
Blurry Text on External Monitor with Snow Leopard
One of the problems I have off and on with my MacBook Pro is that every once and a while when I have it plugged in to my Dell 2408WFP monitor the text in Terminal and Coda seem to have blurry text. Its like the font smoothing that Mac has built in has been turned of just for those applications. When I installed Snow Leopard this problem was on all the time, nothing I tried seemed to get rid of it.
Looks like I wasn’t the only one with this problem because the great guys over at Mac OS X Hints just posted a hint that will fix this problem. Sounds like there is a bug in Snow Leopard that turns off the font smoothing for some external monitors. Of course none of the Apple monitors have this problem but if you didn’t shell out the extra cash for one of their beautiful monitors you might have this problem. The fix is very simple, just open up Terminal and then paste in:
defaults -currentHost write -globalDomain AppleFontSmoothing -int 2
You can try out using 1 or 3 as the value you are setting to have less or more font smoothing. You will need to restart the app you are having problems with and may even need to unplug and replug in your monitor.
if you decide you just want to get rid of the change just open up terminal and paste in:
defaults -currentHost delete -globalDomain AppleFontSmoothing
This will remove the key/value pair that you added and you will be back to the default Snow Leopard way of font smoothing.
MacOSXHints – Re-enable LCD font smoothing for some monitors
EDIT (9/11/2009)
Looks like you can also set the value back to the default value by going in to System Preferences and selecting the “Automatic Font Smoothing” checkbox, this is found at the bottom of the “Appearance” section.
Google Gears, Snow Leopard and Safari 4
As like many Mac users, I upgraded to Snow Leopard this past week. As expected there are a few programs that don’t work. One of those is Google Gears in Safari 4. Google gears seems to still work correctly in Firefox on Snow Leopard but not in Safari.
If you go to http://gears.google.com where you normally would get a install button you get this message:
“Your browser is not currently supported.”
Searching around I found a ticket in the gears code.google.com for the issue. This morning someone from google updated it with some helpful information.
Snow Leopard and Safari 4 introduced some changes which are incompatible with Gears.
Apple made these changes to improve the security of their OS and of Safari. While we
continue to talk to Apple about the issue there is no workaround for us at this time.Gears continues to work with Firefox on Mac OS X.
You can watch the ticket yourself by staring the conversation.
http://code.google.com/p/gears/issues/detail?id=847#c6
Follow up post: Work around for Google Gears and Snow Leopard
Backing up Flickr
Stories of people loosing every image they have uploaded to flickr have been bouncing around the last few months. It’s nothing new to the web, company provides a service and has some rules and whenever they feel those rules are violated they take action. Right or wrong, it has not helped the trust in the “cloud” at all. So what can you do? Well Dan Benjamin took the FlickrTouchr script which allowed you to download a flickr set to your ipod and modified it to backup your all of your flickr pictures, sets and all.
Check out his article about it here:
http://hivelogic.com/articles/backing-up-flickr/
or you can just grab the latest version of the script from github:
http://github.com/dan/hivelogic-flickrtouchr/tree/master
Not something I currently am going to do as I keep a all of my images on a portable external drive which gets backed up weekly to a terabyte network drive and also gets backed up to Backblaze. I only upload to flickr the images I think are worth people spending there time to look at. The rest go up on my personal photo site hosted by dreamhost.