Skip to content

Instantly share code, notes, and snippets.

@andrea-fantini
Created September 3, 2020 02:43
Show Gist options
  • Save andrea-fantini/09d9216acba8df76a5f638891e18c91d to your computer and use it in GitHub Desktop.
Save andrea-fantini/09d9216acba8df76a5f638891e18c91d to your computer and use it in GitHub Desktop.
Simple bash script to start Jupyter notebooks server
#!/bin/bash
# Simple bash script to start automated launching jupyter notebook servers accessible via LAN
# Every time I want to start a notebook I need to activate my conda base environment, check the local IP, and launch the server with that IP. This script automates that process.
source $(conda info --base)/etc/profile.d/conda.sh
conda activate base
echo 'Activated environment :' $CONDA_DEFAULT_ENV
my_ip=$(hostname -I)
echo 'Local IP address :' $my_ip
echo 'Launching Jupyter Notebook server'
jupyter notebook --ip $my_ip --port 8888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment