2019-11-23 19:30:39 +00:00
|
|
|
# Global network bashrc/profile file
|
|
|
|
# Updated 2019-11-12
|
|
|
|
|
|
|
|
function venv() {
|
|
|
|
DIR="/home/$USERNAME/.venvs"
|
|
|
|
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
echo "No command specified"
|
|
|
|
|
|
|
|
elif [ $1 = "--help" ] || [ $1 = '-h' ]; then
|
|
|
|
echo "Custom python Virtualenv manager
|
|
|
|
\"Because pipenv is too hard and everything else sucks\"
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
list List available virtualenvs
|
|
|
|
show Alias of list
|
|
|
|
delete <venv> Delete a virtualenv
|
|
|
|
del Alias of delete
|
|
|
|
rm Alias of delete
|
|
|
|
load <venv> Activate a virtualenv for usage
|
|
|
|
new <venv> <python> Create a new virtualenv. If <python> is not specified,
|
|
|
|
then the system default python is used
|
|
|
|
"
|
|
|
|
elif [ $1 = "list" ] || [ $1 = "show" ] || [ $1 = "ls" ]; then
|
|
|
|
ls $DIR
|
|
|
|
elif [ $1 = "load" ]; then
|
|
|
|
. $DIR/$2/bin/activate
|
|
|
|
elif [ $1 = "new" ]; then
|
|
|
|
virtualenv $DIR/$2 --python=$3
|
|
|
|
elif [ $1 = "delete" ] || [ $1 = "del" ] || [ $1 = "rm" ]; then
|
|
|
|
rm -rf $DIR/$2
|
|
|
|
elif [ $1 = "go" ]; then
|
|
|
|
cd $DIR/$2
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function parse_git_branch() {
|
|
|
|
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
|
|
|
}
|
|
|
|
|
2018-11-27 06:30:55 +00:00
|
|
|
function up() { cd $(eval printf '../'%.0s {1..$1}); }
|
2019-11-23 19:30:39 +00:00
|
|
|
|
|
|
|
function pipin() { pip freeze | grep $1; }
|
|
|
|
|
|
|
|
alias bk='cd -'
|
2018-11-27 06:30:55 +00:00
|
|
|
alias fuck='sudo $(history -p \!\!)'
|
|
|
|
alias doc='cd ~/Documents'
|
2019-11-23 19:30:39 +00:00
|
|
|
alias dn='cd ~/Downloads'
|
2018-11-27 06:30:55 +00:00
|
|
|
alias version='uname -orp && lsb_release -a | grep Description'
|
|
|
|
alias activate='source ./bin/activate'
|
|
|
|
alias ipconfig='ip address show'
|
|
|
|
alias cls='clear'
|
|
|
|
alias mklink='ln -s'
|
2019-11-23 19:30:39 +00:00
|
|
|
alias ls='/usr/bin/ls -lshF --color --group-directories-first --time-style=long-iso'
|
2018-12-13 05:50:43 +00:00
|
|
|
alias gg='cd ~/Git'
|
2019-11-23 19:30:39 +00:00
|
|
|
alias gmtime='/usr/bin/date -u --iso-8601=seconds'
|
|
|
|
alias date='/usr/bin/date --iso-8601=seconds'
|
|
|
|
alias whatismyip='curl https://icanhazip.com/'
|
2018-12-13 05:50:43 +00:00
|
|
|
|
2019-11-23 19:30:39 +00:00
|
|
|
export rc=/home/$USERNAME/.bashrc
|
2019-08-24 18:37:52 +00:00
|
|
|
export PS1="\[\e[0;97m\]\[\e[37m\]\u\[\e[1;94m\]@\[\e[94m\]\H\[\e[0;33m\]$(parse_git_branch) \[\e[37m\]\w\[\e[33m\] \[\e[0;97m\]$\[\e[0m\] "
|