-
-
Save gazon1/15f525eb1614ffb4e186aa7780dd5fcd to your computer and use it in GitHub Desktop.
aliases for ml enginier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Bin/bash | |
# https://unix.stackexchange.com/questions/423401/show-error-message-if-bash-script-terminates-due-to-set-e | |
set -e | |
err_report() { | |
echo "Error on line $1" | |
} | |
trap 'err_report $LINENO' ERR | |
start_jupyter () { | |
screen_name=$1 | |
screen -S $screen_name | |
jupyter-lab --ip=0.0.0.0 | |
} | |
wget_relative() { | |
URL="some_site/$1" | |
wget "${URL}" | |
} | |
pip_install() { | |
if [ -z "$1" ] # Is parameter #1 zero length? | |
then | |
echo "-Parameter #1 is zero length.-" # Or no parameter passed. | |
else | |
python3 -m pip install --user $1 | |
fi | |
} | |
alias pinst="pip_install" | |
alias sjup="start_jupyter" | |
alias wgetr="wget_relative" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment