Skip to content

Instantly share code, notes, and snippets.

View mbadran's full-sized avatar

Mohammed mbadran

  • Sydney, Australia
View GitHub Profile
@mbadran
mbadran / MesloLGS-DZ-Regular-Powerline.ttf
Created January 20, 2012 01:03
Meslo DZ Regular font patched for vim-powerline
@mbadran
mbadran / odupdate.sh
Created August 3, 2010 11:28
update OpenDNS network IP (insecurely)
#!/bin/sh
ip=`curl -s https://secure.internode.on.net/webtools/showmyip?textonly=1`
curl -s -u <username>:<password> https://updates.opendns.com/nic/update?hostname=<network>&myip=$ip
@mbadran
mbadran / gist:368116
Created April 16, 2010 07:03
case insensitive matches()
testString.matches("(?i)^[a-b]*$");
// (?i) toggles case insensitive matching
// also works for m, s, and x modes
// http://www.regular-expressions.info/modifiers.html
@mbadran
mbadran / gist:368113
Created April 16, 2010 06:58
commandline tips
#ctrl-z
# put a process in the background
fg
# bring a background process into the foreground
tail -f filename
# follow a in real time (eg. a log file)
#ctrl-s
# suspend display on the terminal
@mbadran
mbadran / gist:215569
Created October 21, 2009 23:17 — forked from mtodd/gist:180398
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/>
https?
EOH
Quotes also give you more freedom/creativity with the terminal ID:
@mbadran
mbadran / gist:133130
Created June 20, 2009 11:07
handy apt-get commands
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
mbadran / gist:130470
Created June 16, 2009 01:31
make popd silent in bash
alias popd="popd > /dev/null"
@mbadran
mbadran / gist:130469
Created June 16, 2009 01:30
replace cd in bash to (silent) pushd
alias cd="pushd $@ > /dev/null"
@mbadran
mbadran / gist:130447
Created June 16, 2009 00:17
improve the bash prompt (basic)
PS1="[$?/\T]\h:\w% "
@mbadran
mbadran / gist:130444
Created June 16, 2009 00:11
improve the ls command in bash (basic)
alias l="ls -lahF"