Skip to content

Instantly share code, notes, and snippets.

@gazon1
Created July 27, 2019 07:07
Show Gist options
  • Save gazon1/15f525eb1614ffb4e186aa7780dd5fcd to your computer and use it in GitHub Desktop.
Save gazon1/15f525eb1614ffb4e186aa7780dd5fcd to your computer and use it in GitHub Desktop.
aliases for ml enginier
#!/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