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: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:75739
Created March 8, 2009 11:48
my .vimrc
"let mysyntaxfile="~/.syntax.vim"
set nocompatible " Use Vim defaults (much better!)
set bs=2 " allow backspacing over everything in insert mode
set ai " always set autoindenting on
" set backup " keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
@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: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: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: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:75752
Created March 8, 2009 12:04
show top 10 process hogs (bsd)
ps -Armo pid=#,ucomm=,%cpu=%,rsz=* | head -10
@mbadran
mbadran / gist:75756
Created March 8, 2009 12:05
show uptime (bsd)
uptime | awk {'print $3" "$4" "$5'} | sed -e 's/:/ hours, /' -e 's/,$/ minutes/'
@mbadran
mbadran / gist:75758
Created March 8, 2009 12:10
show free memory (bsd)
top -u -FR -l1 | grep 'PhysMem' | cut -c 1-9 -c 65-80
@mbadran
mbadran / gist:75759
Created March 8, 2009 12:10
create jar file
jar -cvmf MANIFEST.MF filename.jar dirname