This repository has been archived on 2024-05-02. You can view files and clone it, but cannot push or open issues or pull requests.
omni-ansible/playbooks/files/bashrc.sh
Ethan N. Paul 2901a1685d Ongoing baseline establishment work
Create provision playbook with modular platform-interop framework
Implement first version of update-system playbook
Implement var organization
Implement basic structure of inventory file
2018-11-27 01:30:55 -05:00

74 lines
2.0 KiB
Bash

function up() { cd $(eval printf '../'%.0s {1..$1}); }
alias fuck='sudo $(history -p \!\!)'
alias doc='cd ~/Documents'
alias explorer='nautilus'
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'
alias ls='ls -lshF --color --group-directories-first --time-style=long-iso'
function venv() {
DIR="/home/$USER/.virtualenvs"
[[ -d $DIR ]] || mkdir $DIR
if [ ! -v $1 ] || [ $1 -eq '--help' ] || [ $1 -eq '-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 [ ! -v $1 ] || [ $1 -eq "list" ] || [ $1 -eq "show" ]; then
echo "hello"
ls $DIR
elif [ $1 -eq "del" ] || [ $1 -eq "rm" ]; then
if [ ! -v $2 ]; then
echo "Error: virtualenv name parameter not provided"
else
if [ ! -d "$DIR/$2" ]; then
echo "Error: virtualenv $2 does not exist"
else
rm -rf $DIR/$2
fi
fi
elif [ $1 -eq "new" ]; then
if [ ! -v $2 ]; then
echo "Error: virtualenv name parameter not provided"
else
if [ -d "$DIR/$2" ]; then
echo "Error: virtualenv $2 already exits"
elif [ -v $3 ]; then
virtualenv $2 --python=$3
else
virtualenv $2
fi
fi
elif [ $1 -eq "load" ]; then
if [ ! -v $2 ]; then
echo "Error: virtualenv name parameter not provided"
elif [ ! -d "$DIR/$2" ]; then
echo "Error: virtualenv $2 does not exist"
else
source $DIR/$2/bin/activate
fi
else
echo "No parameter provided"
fi
}