Created
August 25, 2016 14:51
-
-
Save u8sand/cc5b77944fb6394dc19a14918062552b to your computer and use it in GitHub Desktop.
Remote iPython Notebook Configuration + Script
This file contains hidden or 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 | |
conf=config.py | |
cert=mycert.pem | |
port=9999 | |
if [ ! -f $conf ]; then | |
if [ ! -f $cert ]; then | |
openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout "$cert" -out "$cert" | |
fi | |
cat << EOF > $conf | |
c = get_config() | |
c.NotebookApp.open_browser = False | |
c.NotebookApp.ip = '*' | |
c.NotebookApp.port = $port | |
c.NotebookApp.certfile = u'$cert' | |
c.NotebookApp.password = u'$(python -c 'from IPython.lib import passwd; print(passwd())')' | |
EOF | |
fi | |
jupyter-notebook --config="$conf" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment