1
0
Fork 0
mirror of https://github.com/hcartiaux/dotfiles.git synced 2024-10-18 17:25:23 +02:00
dotfiles/bash/bash_environment
2019-10-21 16:35:28 +02:00

195 lines
5.4 KiB
Bash

#
# ~/.bash_environments
#
# ----------------------------------------------------------------------
# LOCALES
# ----------------------------------------------------------------------
# enable en_US locale w/ UTF-8 encodings
LANG="en_US.UTF-8"
LANGUAGE="en"
LC_CTYPE="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
export LANG LANGUAGE LC_CTYPE LC_ALL
# ----------------------------------------------------------------------
# SYSTEM INFO
# ----------------------------------------------------------------------
# Basic variables
: ${HOME=~}
: ${LOGNAME=$(id -un)}
: ${UNAME=$(uname)}
# complete hostnames from this file
: ${HOSTFILE=~/.ssh/known_hosts}
# readline config
: ${INPUTRC=~/.inputrc}
# Get rid of mail notification
unset MAILCHECK
if [[ $(echo $HOSTNAME | grep -c \\.) != 0 ]] ; then
FQDN=$HOSTNAME
else
FQDN=$(hostname -f)
fi
DOMAIN=$(echo "$FQDN" | cut -d '.' -f 2)
# ----------------------------------------------------------------------
# SHELL TYPE
# ----------------------------------------------------------------------
# detect interactive shell
case "$-" in
*i*) INTERACTIVE=yes ;;
*) unset INTERACTIVE ;;
esac
# detect login shell
case "$0" in
-*) LOGIN=yes ;;
*) unset LOGIN ;;
esac
# ----------------------------------------------------------------------
# PATH
# ----------------------------------------------------------------------
# we want the various sbins on the path along with /usr/local/bin
export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin"
export PATH="/usr/local/bin:$PATH"
# put ~/.local/bin & ~/bin on PATH if it exists
[ -d "$HOME/.local/bin" ] && export PATH="$PATH:$HOME/.local/bin"
[ -d "$HOME/bin" ] && export PATH="$PATH:$HOME/bin"
# Programming stuff
# pkg-config settings
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
# C/C++ include
export C_INCLUDE_PATH=/usr/local/include
export CPLUS_INCLUDE_PATH=${C_INCLUDE_PATH}
export LIBRARY_PATH=/usr/lib:/usr/local/lib
export DYLD_FALLBACK_LIBRARY_PATH=${LIBRARY_PATH}
export MANPATH="/usr/share/man:/usr/local/share/man:$MANPATH"
# ----------------------------------------------------------------------
# EDITOR & PAGER
# ----------------------------------------------------------------------
test -n "$(command -v vim)" && EDITOR=vim || EDITOR=nano
export EDITOR
export SVN_EDITOR=$EDITOR
# Default pager ('less' is so much better than 'more'...)
if test -n "$(command -v less)"; then
export PAGER="less -FiRSwX"
else
export PAGER=more
fi
# ----------------------------------------------------------------------
# VCS Configuration
# ----------------------------------------------------------------------
export CVS_RSH='ssh'
export GIT_AUTHOR='Hyacinthe Cartiaux'
export GIT_AUTHOR_EMAIL='hyacinthe.cartiaux@free.fr'
export GIT_COMMITER=$GIT_AUTHOR
export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
# ----------------------------------------------------------------------
# MISC
# ----------------------------------------------------------------------
# GPG config
export GNUPGHOME=~/.gnupg
# SSH config
unset SSH_ASKPASS
unset SSH_AGENT_PID
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
# Tsocks config
export TSOCKS_CONF_FILE=~/.dotfiles/tsocks/tsocks.conf
# BC configuration for interactive usage
test -n "$INTERACTIVE" && export BC_ENV_ARGS=~/.dotfiles/bc/bcrc
# PDSH configuration
export PDSH_RCMD_TYPE=ssh
export PDSH_SSH_ARGS_APPEND="-q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PreferredAuthentications=publickey"
# Vagrant configuration
#export VAGRANT_DEFAULT_PROVIDER=lxc
# Easybuild
export EASYBUILDBUILDPATH=/tmp/
export EASYBUILD_PREFIX=$HOME/.local/easybuild
export EASYBUILD_MODULES_TOOL=Lmod
export EASYBUILD_MODULE_NAMING_SCHEME=CategorizedModuleNamingScheme
export LOCAL_MODULES=${EASYBUILD_PREFIX}/modules/all
alias ma="module avail"
alias ml="module list"
function mu(){
module use $LOCAL_MODULES
module load tools/EasyBuild
}
# ----------------------------------------------------------------------
# GRID5000 specific
# ----------------------------------------------------------------------
if [[ -n "$(echo $FQDN | grep -o .grid5000.fr)" ]]; then
export OAR_JOB_KEY_FILE=~/.ssh/id_rsa
# export http_proxy=http://proxy:3128
# export https_proxy=$http_proxy
fi
# Grid5000 Puppet 4 admin tools
export GPUPPET_PREFIX=/home/hcartiaux/.gpuppet
export GPUPPET_PLATFORM=production
export GPUPPET_LOCATION=luxembourg
export GPUPPET_USER=hcartiaux
export GPUPPET_SSH_CONFIG=$GPUPPET_PREFIX/ssh/config
alias cdgp='cd $GPUPPET_PREFIX/repo && source setup_env.sh && echo "==> Grid5000 Puppet 4 repository"'
# ----------------------------------------------------------------------
# GAIA specific (XCS Portal config)
# ----------------------------------------------------------------------
if [[ $DOMAIN == "gaia-cluster" ]]; then
# XF
source /XF/App/Scripts/xf_Globalenv.rc
export PATH=$PATH:/XF/Admin/Scripts
export XF_VNC_GEOMETRY="-geometry 1366x850"
export XF_VNC_QUALITY=80
#export XF_DEBUG=0
fi
# -------------------------------------------------------------------
# Ruby & RVM
# -------------------------------------------------------------------
[ -d "/usr/lib/ruby/gems" ] && export PATH="$PATH:$(echo /usr/lib/ruby/gems/*)/bin"
[ -d "$HOME/.rvm/bin" ] && export PATH="$PATH:$HOME/.rvm/bin"
# RVM specific (see http://beginrescueend.com/)
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" || true
if [[ $(which ruby 2>/dev/null | grep -c "$HOME/.rvm") != 0 ]]; then
# Get off my lawn
rvm reset
fi