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

165 lines
4.4 KiB
Bash
Raw Normal View History

#
# ~/.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
2014-02-18 16:22:31 +01:00
# Configure a set of useful variables
if [[ "$(echo $UNAME | grep -c -i -e '^.*bsd$')" == "1" ]] ; 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 on PATH if you have it
[ -d "$HOME/.local/bin" ] && export PATH="$PATH:$HOME/.local/bin"
# put ~/bin on PATH if you have it
[ -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@uni.lu'
export GIT_COMMITER=$GIT_AUTHOR
export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
# ----------------------------------------------------------------------
# MISC
# ----------------------------------------------------------------------
# GPG config
export GNUPGHOME=~/.gnupg
# SSH config
unset SSH_ASKPASS
if [[ -e "${GNUPGHOME}/S.gpg-agent.ssh" ]] ; then
export SSH_AUTH_SOCK=$GNUPGHOME/S.gpg-agent.ssh
fi
# Easybuild BUILD PATH
export EASYBUILDBUILDPATH=/tmp/
# Tsocks config
export TSOCKS_CONF_FILE=~/.dotfiles/tsocks/tsocks.conf
2014-07-05 18:07:33 +02:00
# BC configuration for interactive usage
test -n "$INTERACTIVE" && export BC_ENV_ARGS=~/.dotfiles/bc/bcrc
2014-07-05 18:07:33 +02:00
# PDSH configuration
export PDSH_RCMD_TYPE=ssh
export PDSH_SSH_ARGS_APPEND="-q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PreferredAuthentications=publickey"
2014-07-05 18:07:33 +02:00
# Vagrant configuration
#export VAGRANT_DEFAULT_PROVIDER=lxc
# ----------------------------------------------------------------------
# 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
# ----------------------------------------------------------------------
# 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