Skip to content

Instantly share code, notes, and snippets.

@anoopengineer
anoopengineer / Mac SSH Autocomplete
Created November 21, 2015 17:34 — forked from aliang/Mac SSH Autocomplete
Add auto complete to your ssh, put into your .bash_profile
_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 "\[" ;
@anoopengineer
anoopengineer / linux_commands
Created March 6, 2012 12:47
Useful but uncommon Linux Commands
Recursively deleting all backup files that CVS creates (CVS creates backup files like .#Filename.java.1.1):
find ./ -name \.\*|xargs rm -f
Recursively changing ownership of CVS checkout
find ./ -name Tag | xargs sed -i -e "s/old_username/new_username/"
Recursively removing tabs from source files:
find . -name *.java -exec sed -ie 's/<Ctrl V and then a TAB>/ /g' {} \;
@anoopengineer
anoopengineer / Adding context menu to Git Portable
Created October 3, 2011 07:32
Things to do immediately after installing the portable version of Git
1. Add the <git_portable_folder>/cmd folder to PATH variable
2. Take a command prompt. Go to <git_portable_folder> and run "regsvr32 git-cheetah\git_shell_ext.dll" to add right click context menu (Git Bash here & Git Gui here) to the portable mysysgit installation