Public Gists by mattsears

Gravatar
Thu Aug 06 07:10:43 -0700 2009
1
2
3
# Bash Completions for SSH known_hosts and config hosts
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
complete -W "$(echo `cat ~/.ssh/config | cut -f1,2 -d ' ' | sed -e 's/Host[^s+]//g; s/^ *//; s/ *$//; /#.*/d' -e '/^$/d' | uniq`;)" ssh
Gravatar
Fri Jun 19 05:44:54 -0700 2009
1
2
3
  # A handy way to display lists from collection
  def list(stuff, options = {}, &block)
    return content_tag(:p, "None") if stuff.nil? || stuff.empty?