diff options
author | Félix Sipma <gueux@gueux.org> | 2014-10-29 11:28:29 +0100 |
---|---|---|
committer | Félix Sipma <gueux@gueux.org> | 2014-10-29 11:28:29 +0100 |
commit | 6a1f5655f9522874ed97e49fe3d62d4cfb3ed73e (patch) | |
tree | 07183993b471c0b23130fae9e4ce4796878c2225 | |
parent | 41f39e03513d627b7cb31a3b39a4a006153b95f5 (diff) |
bash
-rw-r--r-- | .bash_aliases | 113 | ||||
-rw-r--r-- | .bash_profile | 153 | ||||
-rw-r--r-- | .bashrc | 64 |
3 files changed, 330 insertions, 0 deletions
diff --git a/.bash_aliases b/.bash_aliases new file mode 100644 index 0000000..9c20c0f --- /dev/null +++ b/.bash_aliases @@ -0,0 +1,113 @@ +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias dir='dir --color=auto' + alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# Some more ls aliases +alias ll='ls -lh' la='ls -A' lla='ls -lhA' + +# Some more alias to avoid making mistakes: +alias rm='rm -i' cp='cp -i' mv='mv -i' + +alias c='clear' +alias gdb="gdb -q" +alias bc="bc -q" +alias g++="g++ -Wall -g" +alias h='history' +alias less='less -i' +alias ifuse='ifuse --root' +alias wakeonlan-prout='wakeonlan 00:1A:4D:47:21:5B' + +# Traduction +#alias enfr="translate -s en -d fr" +#alias fren="translate -s fr -d en" +#alias esfr="translate -s es -d fr" +#alias fres="translate -s fr -d es" +#alias defr="translate -s de -d fr" +#alias frde="translate -s fr -d de" +#alias frzh="translate -s fr -d zh" +#alias zhfr="translate -s zh -d fr" +#alias frit="translate -s fr -d it" +#alias itfr="translate -s it -d fr" +#alias frnl="translate -s fr -d nl" +#alias nlfr="translate -s nl -d fr" +alias enfr="torsocks wr enfr" +alias fren="torsocks wr fren" + +alias halt="sudo systemctl halt" +alias reboot="sudo systemctl reboot" +alias hibernate="sudo systemctl hibernate" +alias suspend="sudo systemctl suspend" +#alias halt="sudo halt" +#alias reboot="sudo reboot" +#alias hibernate="sudo pm-hibernate" +#alias suspend="sudo pm-suspend-hybrid" + +#alias edit="editor.sh" +alias edit="vim" +#alias edit="emacsclient -a \"\" -t" +alias ys="apt-cache search" +alias ysh="apt-cache show" +alias yshp="apt-cache showpkg" +alias yr="sudo apt-get remove" +alias yar="sudo apt-get autoremove" +alias yc="sudo apt-get clean" +alias firefox="iceweasel" +alias au="aunpack" +alias ap="apack" +alias wu="sudo ifup wlan0" +alias wd="sudo ifdown wlan0" +alias wdu="sudo ifdown wlan0 && sudo ifup wlan0" +alias maud="sudo mount /dev/disk/by-uuid/740c3fb1-1337-45e2-9541-2e4eb1983ec7 /media/audio" +alias umaud="sudo umount /media/audio" +alias mvid="sudo mount /dev/disk/by-uuid/fc9258ef-174d-4613-acf7-a3062a826468 /media/video" +alias umvid="sudo umount /media/video" +alias mbak="sudo mount /dev/disk/by-uuid/8c1ac9ed-b4aa-4532-b8ab-707134f38a07 /media/backup" +alias musb="sudo mount /dev/disk/by-uuid/580C-617C /mnt/usb" +alias umusb="sudo umount /media/usb_disk" +alias dl="rlwrap telnet localhost 4000" +alias pon="sudo pon dsl-provider" +alias vd="mldonkey_http_preview" +alias mipod="sudo ifuse /dev/fuse /media/ipod" +alias umipod="sudo umount /media/ipod" +#alias man="man -LC" +alias manf="man -Lfr" +alias pdf2ps="pdftops" +alias pstopdf="ps2pdf" +alias ps2ps="pstops" +alias proxy-imap="ssh -L:10043:gueux.org:993 gueux" +alias proxy-gueux="ssh -L:3128:gueux.org:3128 gueux" +alias proxy-ens="ssh -L:3128:www-cache.ens-lyon.fr:3128 asie.ens" +alias ac="abookc" +alias cg="cp-gueux.pl" +alias smbfs="fusesmb" +alias mkvmerge-gui="mmg" +alias phone="linphonec" +alias ipod-x11vnc="x11vnc -geometry 320x200" +alias netris="netris -k c\ ruiepfhn" +alias beep="echo '\x07'" +alias iso-create="mkisofs -v -r -J -o" +alias ftp="lftp" +alias weather="ctw FRXX0153" +#alias scanimage="scanimage --mode gray --resolution 300 --format tiff" +#alias ack="ack-grep" +alias httpcode="hc" +alias quvim="quvi --exec='mplayer %u'" +alias cal='ncal -MC3' ycal='ncal -MCy' +alias xpdf='wxpdf.pl' +alias ncmpc='ncmpcpp' +alias rem='rem -m -g' +alias remcal='rem -ccu+5 -m' +alias vim-addons="vim-addons -t $XDG_CONFIG_HOME/vim" +alias vim-addon-manager="vim-addon-manager -t $XDG_CONFIG_HOME/vim" +alias ghc-sandbox="ghc -no-user-package-db -package-db .cabal-sandbox/*-packages.conf.d" +alias ghci-sandbox="ghci -no-user-package-db -package-db .cabal-sandbox/*-packages.conf.d" +alias runhaskell-sandbox="runhaskell -no-user-package-db -package-db .cabal-sandbox/*-packages.conf.d" +alias cabal-install-yesod="cabal install --max-backjumps=-1 --reorder-goals yesod-platform yesod-bin" diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..38521cf --- /dev/null +++ b/.bash_profile @@ -0,0 +1,153 @@ +# ~/.bash_profile: executed by bash(1) for login shells. +# see /usr/share/doc/bash/examples/startup-files for examples. +# the files are located in the bash-doc package. + +# The default umask is set in /etc/login.defs +#umask 022 + +# Our default OpenPGP key ID +[ -f "${GNUPGHOME:-$HOME/.gnupg}/gpg.conf" ] && \ + export keyID=$(sed -nr 's/^default-key\s+//p' "${GNUPGHOME:-$HOME/.gnupg}/gpg.conf") + +# Re-edit a history substitution line if it failed; edit a recalled +# history line before executing +shopt -s histreedit histverify + +# Don't put duplicate lines or lines starting with a space in the +# history. See bash(1) for more options. +export HISTCONTROL=ignoreboth HISTSIZE=150000 HISTFILESIZE=150000 + +# Set a colorized/unicode PS1? +which tput &>/dev/null && tput setaf 1 &>/dev/null && PROMPT_COLOR=yes || PROMPT_COLOR=no +which locale &>/dev/null && [ $(locale charmap) = UTF-8 ] && PROMPT_UTF8=yes || PROMPT_UTF8=no +export PROMPT_COLOR PROMPT_UTF8 +export PROMPT_COMMAND="history -a;$PROMPT_COMMAND" + +# Import .bashrc if it exists +[ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc" + +export XDG_CONFIG_HOME="$HOME/.config" \ + XDG_CACHE_HOME="$HOME/.cache" \ + XDG_DATA_HOME="$HOME/.local/share" + XDG_RUNTIME_DIR="/run/user/$UID" + +add2Path() { + local var="$1"; shift + local path="${!var}" + while [ $# -gt 0 ]; do + [ -d "$1" ] && path="$1${path:+:$path}" + shift; + done + export $var="$path" +} +#export PATH="$HOME/bin:$HOME/.cabal/bin:$HOME/.local/bin:/usr/local/bin:/usr/local/sbin:/bin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/sbin" +add2Path LD_LIBRARY_PATH "$HOME/lib" "/usr/local/lib" +add2Path LD_RUN_PATH "$HOME/lib" "/usr/local/lib" +#export PERL5LIB="$HOME/lib/perl/lib/perl:$HOME/lib/perl/share/perl:$HOME/lib/perl/lib/perl5:$HOME/share/perl" +#add2Path PERL5LIB "$HOME/lib/perl/share/perl" +add2Path PERL5LIB "$HOME/lib/perl/lib/perl" "$HOME/lib/perl/share/perl" "$HOME/lib/perl/lib/perl5" "$HOME/share/perl" +add2Path CLASSPATH "/usr/share/java/" +add2Path PYTHONPATH "$HOME/lib/python2.7/site-packages" +add2Path R_LIBS "$HOME/lib/R" + +export NPM_PACKAGES="$XDG_DATA_HOME/npm/packages" +add2Path NODE_PATH "$NPM_PACKAGES/lib/node_modules" + +add2Path PATH "$HOME/bin" "$HOME/.cabal/bin" "$NPM_PACKAGES/bin" +add2Path MYMANPATH "$HOME/share/man" "$NPM_PACKAGES/share/man" + +export MANPATH="$MYMANPATH:$(manpath)" + +export TZ=Europe/Paris + +#################### mpc +export MPD_HOST="prout.gueux.org" +#export MPD_HOST="localhost" +#export MPD_HOST="elpopo" +export MPD_PORT="6600" + +export MAILDIR="$HOME/mail" + +export EPROLOG="/usr/bin/pl" +export PYTHONSTARTUP="$HOME/.pystartup" +export PERL_CPANM_OPT="-l ~/lib/perl" + +export PREFIX="$HOME" +export AC_PREFIX_DEFAULT="$HOME" +export AC_DEFAULT_PREFIX="$HOME" + +export OO_FORCE_DESKTOP=gnome + +#export BROWSER=/usr/local/bin/luakit +export BROWSER=/usr/bin/iceweasel + +export NNTPSERVER="snews://news.gmane.org:563" +export SLRNPULL_ROOT="$HOME/news/slrnpull" + +export SANE_DEFAULT_DEVICE='net:elpopo.gueux.org:epson2' + +export ANSIBLE_NOCOWS=1 + +#if which ruby >/dev/null && which gem >/dev/null; then +# PATH="$(ruby -rubygems -e 'puts Gem.user_dir')/bin:$PATH" +#fi + +export GIMP2_DIRECTORY="$XDG_CONFIG_HOME/gimp2" +#export VIMINIT="$XDG_CONFIG_HOME/vim/vimrc" +export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC' +export PENTADACTYL_RUNTIME="$XDG_CONFIG_HOME/pentadactyl" +export PENTADACTYL_INIT="source $PENTADACTYL_RUNTIME/pentadactylrc" +# export DOTREMINDERS="$XDG_CONFIG_HOME/remind/remind.rem" +export XAUTHORITY="$XDG_CACHE_HOME/X11/Xauthority" + +export LEDGER_FILE="$HOME/manonfelix-annex/comptes.journal" + +export EDITOR="vim" +export VISUAL="vim" + +export DEBFULLNAME="Félix Sipma" +export DEBEMAIL="gueux+debian@gueux.org" +export BTS_DEFAULT_CC="gueux+debian@gueux.org" + +#################### less +#export PAGER="less" +#export LESSCHARSET=utf-8 +export LESSHISTFILE="$XDG_DATA_HOME/less/lesshst" +#export LESSKEY="$XDG_DATA_HOME/less/lesskey.bin" + +# Make less more friendly for non-text input files, see lesspipe(1) +which lesspipe &>/dev/null && eval "$(SHELL=/bin/sh lesspipe)" +which lesskey &>/dev/null && [ -f "$HOME/.lesskey" ] && lesskey "$HOME/.lesskey" +export LESS='-R --ignore-case --prompt=?f%f .?n?m(file %i of %m) ..?ltlines %lt-%lb?L/%L. :byte %bB?s/%s. .?e(END) ?x- Next\: %x.:?pB%pB\%..%t' + +if [ "$TERM" != dumb ]; then + which dircolors &>/dev/null && eval "$(dircolors -b)" + + # Instead of most use TERMCAP info for less to get colored man pages + export LESS_TERMCAP_mb=$'\e[01;36m' + export LESS_TERMCAP_md=$'\e[01;36m' + export LESS_TERMCAP_me=$'\e[0m' + export LESS_TERMCAP_se=$'\e[0m' + export LESS_TERMCAP_so=$'\e[0;47;30m' + export LESS_TERMCAP_ue=$'\e[0m' + export LESS_TERMCAP_us=$'\e[01;33m' +fi + + +# Don't let GTK and QT applications redefine their own input sequences +export GTK_IM_MODULE=xim QT_IM_MODULE=xim + +# If an intruder manages to log in, it's safer to flush out +# keys/identities. +keychain.sh flush +[ $EUID -ne 0 ] && eval $(keychain.sh start) + +#eval $(keychain --clear --eval --noask --timeout 30 ${HOME}/.ssh/id_rsa $keyID) +k5start -f ${HOME}/.keytabs/elpopo_gueux.keytab + +# Auto startx when log in at VC/1 (unless we're root) +if [ -z "$DISPLAY" ] && [ $(tty) = /dev/tty1 ] && [ $EUID -ne 0 ]; then + exec -l msva-perl startx -- -nolisten tcp &>~/.X.log + # exec replaces the shell, there is no fork here; hence beyond this + # point is a blackhole. +fi @@ -0,0 +1,64 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +[[ $- =~ i ]] || return + +# Check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# Set variable identifying the chroot you work in (used in the prompt below) +[ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ] && \ + debian_chroot=$(< /etc/debian_chroot) + +if [ "$TERM" = dumb ] || [ "$PROMPT_COLOR" != yes ] || [ "$PROMPT_UTF8" != yes ]; then + PS1='\u@\H:${debian_chroot:+($debian_chroot)}\w\$ ' +else + PS1='\[\e[30;1m\]\342\224\214\342\224\200\342\224\244\[$([ $? -eq 0 ] && echo "\e[0m\]\#\[\e[30;1m\]:\[\e[0m" || echo "\e[0;31m\]\#\[\e[30;1m\]:\[\e[0;31m")\]\!\[\e[0m\] !\j \[\e[0;36m\]\D{%F %T}\[\e[30;1m\]\342\224\234\342\224\200\342\224\244${SSH_TTY:+ssh://}\[$([ $EUID -eq 0 ] && echo "\e[37;41m\e[1m" || echo "\e[0;33m")\]\u@\H\[\e[0m\e[30;1m\]:${debian_chroot:+(\[\e[0;32m\]$debian_chroot\[\e[30;1m\])}\[\e[1;34m\]\w\[\e[30;1m\]\342\224\202\[\e[0m\]\n\[\e[30;1m\]\342\224\224 \$\[\e[0m\] ' +fi + +if [ "$TERM" != dumb ]; then + # Set window name, unless we're on a raw linux console + [[ "$TERM" =~ ^(.+\.)?linux$ ]] || \ + PROMPT_COMMAND+='printf "\e]2;%s: %s\a" "${USER}@${HOSTNAME}" "${PWD/#$HOME/~}"' +fi + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# 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 +fi + +# Aliases +#make-completion-wrapper _apt_get _apt_get_install apt-get install +#complete -F _apt_get_install yi +# +#make-completion-wrapper _apt_get _apt_get_remove apt-get remove +#complete -F _apt_get_remove yr +# +#make-completion-wrapper _apt_cache _apt_cache_show apt-cache show +#complete -F _apt_cache_show ysh +# +#make-completion-wrapper _apt_cache _apt_cache_search apt-cache search +#complete -F _apt_cache_search ys +# +#make-completion-wrapper _apt_cache _apt_cache_showpkg apt-cache showpkg +#complete -F _apt_cache_show yshp +# +#complete -F _apt_get y + +[ -n "$keyID" ] && alias refresh-key="gpg --refresh-key $keyID" + +# Enable programmable completion features. +[[ $PS1 && -f ${XDG_CONFIG_HOME}/bash_completion ]] && . ${XDG_CONFIG_HOME}/bash_completion + +# See gpg-agent(1) +export GPG_TTY=$(tty) |