Forked from rashmibanthia/jupyter_notebook_ec2.sh
Last active
March 30, 2016 07:19
-
-
Save flyakite/6f13b4c297e62a252120a67809b04de1 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
#Code adapted from https://gist.github.com/yangj1e/3641843c758201ebbc6c (Modified to Python3.5) | |
cd ~ | |
#wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda2-2.4.0-Linux-x86_64.sh | |
wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda3-2.4.1-Linux-x86_64.sh | |
bash Anaconda3-2.4.1-Linux-x86_64.sh -b | |
echo 'PATH="/home/ubuntu/anaconda3/bin:$PATH"' >> .bashrc | |
source .bashrc | |
jupyter notebook --generate-config | |
key=$(python -c "from notebook.auth import passwd; print(passwd())") | |
cd ~ | |
mkdir certs | |
cd certs | |
certdir=$(pwd) | |
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mycert.pem -out mycert.pem | |
cd ~ | |
sed -i "1 a\ | |
c = get_config()\\ | |
c.IPKernelApp.pylab = 'inline'\\ | |
c.NotebookApp.certfile = u'$certdir/mycert.pem'\\ | |
c.NotebookApp.ip = '*'\\ | |
c.NotebookApp.open_browser = False\\ | |
c.NotebookApp.password = u'$key'\\ | |
c.NotebookApp.port = 8888" .jupyter/jupyter_notebook_config.py | |
# to start Jupyter: | |
# $jupyter notebook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The SSL certificate is self-generated, so when accessing from a browser, we need to bypass the verification warning.