tsaoyu
10/4/2017 - 11:16 AM

Configure remote Jupyter notebook access.md

Jupyter notebook is a great interactive debug tool for scientific research. It have been widely used in my daily work flow.
This gist will explain how to access Jupyter notebook on your desktop remotely. 

Requirements 1: Python installation with Juypter notebook tools. 
To test that, use terminal and enter `juypter-notebook`. If everything config correctly, a browser page will prompt out.

Requirements 2: Ngrok
Ngrok is the softwave and service that forward your notebook connection to the internet. It can help to bypass the firewall and 
give you easy access to notebook with their URL.

Configuretion of Juypter notebook:

Configuration file of Juypter notebook usually located at `~/.jupyter`, if no configuration have been create yet, you can do it manually by
```
jupyter notebook --generate-config
```

```
jupyter notebook password
```

Configure Ngrok,

1. download ngrok
2. install authtoken
3. create secure tunnel
  ./ngrok http 8888
4. use link in 'Status' bar to access your notebook
5. Enter password to use your notebook

Automatic scripts

Linux/Mac OS

```
#!/bin/bash

ENV_DIR=~/D3HRE_notebooks/Notebooks/

printf "Starting iPython notebook from: $ENV_DIR \n\n"
cd $ENV_DIR


GREEN='\033[0;32m'
NC='\033[0m'

# Activate virutalenv
devpy
# Start notebook
jupyter-notebook &
Notebook_id=$!
printf "Notebook ${GREEN} started${NC}, creating forward tunnel. \n \n"
# Start ngrok tunnel forwarding
ngrok http 8888 &
printf "${GREEN} Tunnel have been created. ${NC}\n"
```

Windows

to be added