Posts Tagged ‘tab’

Firefox 3.6 Tab Navigation

Sunday, January 31st, 2010

If you have taken the plunge and upgraded to Firefox 3.6, you may notice that spawning tabs acts a little differently now.

It you middle click, or right click>open in new tab, you will notice the tab will no longer spawn at the end, but next to the current working tab.

Since I live on tabs, this is weird for me, since its not the normal behavior.

Well I found out how to change it back!

Open firefox to the about:config page, locate browser.tabs.insertRelatedAfterCurrent and set it to false.

That’s it!

SSH Tab completion!

Saturday, November 29th, 2008

So I was using stuble upon and I found a cool one.  Adding tab completion to SSH/SCP!

The original code is at http://drawohara.com/post/6584031/life-changing-shell-function

But I propose a slightly different egrep line, which helps me at work (as our hostnames have numbers in them)

Basically, edit your .bash_profile or .bashrc files ( I prefer .bash_profile ), and add in the following lines:

SSH_COMPLETE=( $(cat ~/.ssh/known_hosts | \
sed -e 's/ .*//g' -e 's/,.*//g' | \
uniq | egrep -v "^([0-9]{1,3}.){4}$") )
complete -o default -W "${SSH_COMPLETE[*]}" ssh
complete -o default -W "${SSH_COMPLETE[*]}" scp

Once added, type source ~/.bash_profile (or ~/.bashrc)

This will parse the ~/.ssh/known_hosts file on login, and find any hostnames (but not IPs) and store them in a temporary variable.  This variable is parsed to add tab completion to the ssh and scp commands.

To use, type ssh dan-[tab] and it will auto complete the domain (if it was previously listed in the known_hosts file!)