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: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: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:75773
Created March 8, 2009 12:33
my .bash_aliases
# avoid mistakes
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# convenience
alias l='ls -laFh'
alias untar='gtar -zxvf $*'
alias sl='slogin $(whoami)@$(hostname)'
#alias pu='pushd $* > /dev/null'
@mbadran
mbadran / gist:75771
Created March 8, 2009 12:32
my .bash_logout
echo -en "\nduration: "
echo -e "`expr $SECONDS / 3600` hours `expr $SECONDS / 60` mins `expr $SECONDS % 60` secs\n"
sleep 1
@mbadran
mbadran / gist:96341
Created April 16, 2009 09:46
uncompress tar archive
tar -zxvf dotfiles.tgz
@mbadran
mbadran / gist:96342
Created April 16, 2009 09:46
list files in tar archive
tar -t dotfiles.tgz
@mbadran
mbadran / gist:96343
Created April 16, 2009 09:47
create a symbolic link
ln -s /full/path/to/source /full/path/to/destination/link_name
@mbadran
mbadran / gist:96339
Created April 16, 2009 09:43
compress files into tar archive
tar -zcvf dotfiles.tgz .bash*
@mbadran
mbadran / gist:130447
Created June 16, 2009 00:17
improve the bash prompt (basic)
PS1="[$?/\T]\h:\w% "