Skip to content

Instantly share code, notes, and snippets.

@KrYpTeD974
Last active December 16, 2015 16:40
Show Gist options
  • Save KrYpTeD974/5465244 to your computer and use it in GitHub Desktop.
Save KrYpTeD974/5465244 to your computer and use it in GitHub Desktop.
Mon .bashrc
#~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022
# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS=' --color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias la='ls $LS_OPTIONS -A'
alias l='ls $LS_OPTIONS -lh'
alias ll='ls $LS_OPTIONS -lhA'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias apt='aptitude'
# Lancer l'actualisation de l'horloge
ntpd
#Desactiver le Ctrl+S en ssh
stty ixany
stty ixoff -ixon
# Activation du cache de pip pour éviter de télécharger 20 fois la même lib
PIP_DOWNLOAD_CACHE='~/.pip/cache';
export PIP_DOWNLOAD_CACHE;
# la configuration de virtualenv wrapper
export WORKON_HOME=/root/virtualenvs
mkdir -p $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh
alias mkvirtualenv='mkvirtualenv --python python2.7'
# Active AutoJump
[[ -s /etc/profile.d/autojump.sh ]] && . /etc/profile.d/autojump.sh
# Active fzf (fuzzy Search)
source ~/.fzf.bash
# multi extracteur
extract () {
if [ -f $1 ]
then
case $1 in
(*.7z) 7z x $1 ;;
(*.lzma) unlzma $1 ;;
(*.rar) unrar x $1 ;;
(*.tar) tar xvf $1 ;;
(*.tar.bz2) tar xvjf $1 ;;
(*.bz2) bunzip2 $1 ;;
(*.tar.gz) tar xvzf $1 ;;
(*.gz) gunzip $1 ;;
(*.tar.xz) tar Jxvf $1 ;;
(*.xz) xz -d $1 ;;
(*.tbz2) tar xvjf $1 ;;
(*.tgz) tar xvzf $1 ;;
(*.zip) unzip $1 ;;
(*.Z) uncompress ;;
(*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "Error: '$1' is not a valid file!"
exit 0
fi
}
has_virtualenv() {
if [ -e .venv ]; then
workon `cat .venv`
fi
}
# en gros ça m'active un virtualenv si il y a un fichier .venv avec un nom
# de virtualenv dedans dans le dossier courrant
venv_cd () {
builtin cd "$@" && has_virtualenv
}
#crée un nouveau projet + virtualenv + .venv
new_project () {
mkdir $1
cd $1
echo $1 > .venv
mkvirtualenv $1
pip install ipython
pip install ipdb
}
kill_9(){
psp | fzf | awk '{print $1}' | xargs kill -9
}
#update-alternatives --install /usr/bin/python python /usr/bin/python2.7 2
alias altpython='update-alternatives --config python'
alias cd="venv_cd"
alias ..='cd ..'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
alias ......='cd ../../../../../'
alias process='ps aux | grep'
alias rsb='source ~/.bashrc'
alias kp="killall python"
alias ws="./wsmalawi.sh start"
alias logap="cat /var/log/apache2/error.log | tail -n "
alias kk="kill_9"
alias np='new_project'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment