Skip to content

Instantly share code, notes, and snippets.

@swayson
Forked from rashmibanthia/jupyter_notebook_ec2.sh
Created February 19, 2016 16:52
Show Gist options
  • Save swayson/cc56b106e47c66cfaa90 to your computer and use it in GitHub Desktop.
Save swayson/cc56b106e47c66cfaa90 to your computer and use it in GitHub Desktop.

Revisions

  1. @rashmibanthia rashmibanthia revised this gist Dec 9, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion jupyter_notebook_ec2.sh
    Original file line number Diff line number Diff line change
    @@ -25,4 +25,4 @@ 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
    c.NotebookApp.port = 8888" .jupyter/jupyter_notebook_config.py
  2. @rashmibanthia rashmibanthia revised this gist Dec 9, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions jupyter_notebook_ec2.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #!/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
  3. @rashmibanthia rashmibanthia created this gist Dec 9, 2015.
    27 changes: 27 additions & 0 deletions jupyter_notebook_ec2.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    #!/usr/bin/env bash

    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
    . .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:1024 -keyout mycert.key -out mycert.pem

    cd ~
    sed -i "1 a\
    c = get_config()\\
    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