Skip to content

Instantly share code, notes, and snippets.

@KrYpTeD974
Last active December 18, 2019 12:13
Show Gist options
  • Save KrYpTeD974/317937ad2b091d98855b to your computer and use it in GitHub Desktop.
Save KrYpTeD974/317937ad2b091d98855b to your computer and use it in GitHub Desktop.
.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'
# Some more alias to avoid making mistakes:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias apt='aptitude'
alias nano='nano -m'
# Lancer l'actualisation de l'horloge
ntpd
#Desactiver le Ctrl+S en ssh
stty ixany
stty ixoff -ixon
# 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
}
alias cd="venv_cd"
alias ..='cd ..'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
alias ......='cd ../../../../../'
alias process='ps aux | grep'
alias rsb='source ~/.bashrc'
[[ -s /etc/profile.d/autojump.sh ]] && . /etc/profile.d/autojump.sh
alias p="python"
alias error="cat /var/log/apache2/error.log | tail -n "
alias access="cat /var/log/apache2/access.log | tail -n "
# Si on est dans un terminal
case "$TERM" in
xterm*|rxvt*)
# on execute les commandes
source ~/.fzf.bash
export PYTHONSTARTUP=~/.startup_python.py
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment