# Detect if we have an interactive shell
case "$-" in
*i*) export INTERACTIVE=yes ;;
*) unset INTERACTIVE ;;
esac
# Say hello
test -n "$INTERACTIVE" && {
echo "Hello ${SUDO_USER}!"
}
# Load user's environment
test -f /home/${SUDO_USER}/.profile && {
echo "✔ Loading your .profile"
. /home/${SUDO_USER}/.profile
}
test -f /home/${SUDO_USER}/.vimrc && {
echo "✔ Aliasing vim to use your .vimrc"
# alias vim="vim -u ~${SUDO_USER}/.vimrc --cmd 'set rtp^=~${SUDO_USER}/.vim'"
alias vim="HOME=/home/$SUDO_USER vim"
}
# Activate virtualenv
test -d ENV && {
test -n "$INTERACTIVE" && echo "✔ Activating virtualenv"
. ENV/bin/activate
}
# Check gitconfig
test -n "$INTERACTIVE" && {
alias git="HOME=/home/$SUDO_USER git"
if [ ! -r /home/$SUDO_USER/.gitconfig ]
then
echo Please set git user and e-mail *in your own \$HOME* before running git
echo in this project. In addition, make sure this tool user can read your
echo ~/.gitconfig.
echo
echo "The following should work (remember: as your own user!)"
echo git config --global user.name "My Username"
echo git config --global user.email "my@email"
echo chmod 644 \~/.gitconfig
echo chmod +x \~
echo
fi
}
# Show running jobs
test -n "$INTERACTIVE" && qstat
# Up arrow
"\e[A": history-search-backward
# Down arrow
"\e[B": history-search-forward
[uwsgi]
plugin = python3
socket = /data/project/TOOLNAME/TOOLNAME.sock
chdir = /data/project/TOOLNAME/www/python/src
venv = /data/project/TOOLNAME/www/python/venv
module = app
callable = app
manage-script-name = true
mount = /TOOLNAME=app:app
single-interpreter = true