Skip to content

Instantly share code, notes, and snippets.

View mbadran's full-sized avatar

Mohammed mbadran

  • Sydney, Australia
View GitHub Profile
@mbadran
mbadran / gist:75742
Created March 8, 2009 11:50
my .dir_colors
COLOR tty
OPTIONS -F -T 0
# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
@mbadran
mbadran / gist:75737
Created March 8, 2009 11:46
my .screenrc
# turn off the annoying startup message
startup_message off
# change meta key to ctrl+w (ctrl+a goes to start of line by default)
escape "^Ww"
# scrollback for default windows
defscrollback 50000
# warn of activity
@mbadran
mbadran / gist:75748
Created March 8, 2009 12:02
send mail via smtp
% telnet 127.0.0.1 25
HELO mydomain.com
MAIL FROM:<foo@mydomain.com>
RCPT TO:<bar@example.com>
DATA
@mbadran
mbadran / gist:75760
Created March 8, 2009 12:11
display jar contents
jar tf filename.jar
@mbadran
mbadran / gist:75769
Created March 8, 2009 12:32
my .bashrc
# Comment in the above and uncomment this below for a color prompt
PS1='${debian_chroot:+($debian_chroot)}[$?/\t][\e[36m\w\e[m] '
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
@mbadran
mbadran / gist:75770
Created March 8, 2009 12:32
my .bash_profile
# include .bash_login if it exists
if [ -f ~/.bash_login ]; then
. ~/.bash_login
fi
@mbadran
mbadran / gist:75747
Created March 8, 2009 12:01
show uptime (linux)
uptime | awk {'print $3" "$4" "$5'} | sed 's/:/ hours, /' | sed -r 's/,$/ minutes/'
@mbadran
mbadran / gist:75772
Created March 8, 2009 12:33
my .bash_login
# display login messages
echo -e "\nuptime: $(uptime | cut -b 14-27)"
echo -e "\nlast:"
last -3 | head -n $(expr $(last -3 | wc -l) - 2)
@mbadran
mbadran / gist:75744
Created March 8, 2009 12:00
shell colours
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
# Shell text formatted bold red
@mbadran
mbadran / gist:75752
Created March 8, 2009 12:04
show top 10 process hogs (bsd)
ps -Armo pid=#,ucomm=,%cpu=%,rsz=* | head -10