Skip to content

Instantly share code, notes, and snippets.

mbadran /
Created Aug 3, 2010
update OpenDNS network IP (insecurely)
ip=`curl -s`
curl -s -u <username>:<password><network>&myip=$ip
mbadran / gist:368116
Created Apr 16, 2010
case insensitive matches()
View gist:368116
// (?i) toggles case insensitive matching
// also works for m, s, and x modes
mbadran / gist:368113
Created Apr 16, 2010
commandline tips
View gist:368113
# put a process in the background
# bring a background process into the foreground
tail -f filename
# follow a in real time (eg. a log file)
# suspend display on the terminal
View gist:215569
Surround a heredoc with quotes and you can continue the code on the same line:
render :status => 404, :text => <<-'EOH' and return unless setup
article not found<br/>
I, as a server, have failed<br/>
Quotes also give you more freedom/creativity with the terminal ID:
mbadran / gist:133130
Created Jun 20, 2009
handy apt-get commands
View gist:133130
apt-get update
apt-get dist-upgrade
apt-cache search <package>
apt-get install <package>
apt-get remove <package>
apt-get --purge remove <package>
mbadran / gist:130470
Created Jun 16, 2009
make popd silent in bash
View gist:130470
alias popd="popd > /dev/null"
mbadran / gist:130469
Created Jun 16, 2009
replace cd in bash to (silent) pushd
View gist:130469
alias cd="pushd $@ > /dev/null"
mbadran / gist:130447
Created Jun 16, 2009
improve the bash prompt (basic)
View gist:130447
PS1="[$?/\T]\h:\w% "
mbadran / gist:130444
Created Jun 16, 2009
improve the ls command in bash (basic)
View gist:130444
alias l="ls -lahF"