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: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:96342
Created April 16, 2009 09:46
list files in tar archive
tar -t dotfiles.tgz
@mbadran
mbadran / gist:96341
Created April 16, 2009 09:46
uncompress tar archive
tar -zxvf dotfiles.tgz
@mbadran
mbadran / gist:96339
Created April 16, 2009 09:43
compress files into tar archive
tar -zcvf dotfiles.tgz .bash*
@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: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: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: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: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:75760
Created March 8, 2009 12:11
display jar contents
jar tf filename.jar