Skip to content

Instantly share code, notes, and snippets.

@StevenSong
Created April 2, 2022 01:14
Show Gist options
  • Save StevenSong/9251f4a8ee7a91624c6941018b54d685 to your computer and use it in GitHub Desktop.
Save StevenSong/9251f4a8ee7a91624c6941018b54d685 to your computer and use it in GitHub Desktop.
# Launch jupyter notebook in a new tmux session for Colab to connect to
# https://research.google.com/colaboratory/local-runtimes.html
SESSION=colab
tmux new -d -s $SESSION
tmux send-keys -t $SESSION "jupyter notebook \
--NotebookApp.allow_origin='https://colab.research.google.com' \
--port=8888 \
--NotebookApp.port_retries=0 \
--no-browser" Enter
sleep 0.5
URL=$(jupyter notebook list | grep 'http\S*' -o)
echo "$URL" | pbcopy
echo "$URL (copied to clipboard)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment