From charlesreid1

NOTE: These notes are from approx. 2015 so Jupyter Notebook is referred to as iPython Notebook.

iPython Notebook

An iPython notebook server is running on port 9999 on the ethane server.

To run the notebook server, navigate to the public notebook directory:

cd /www/notebooks 

start screen to run in the background:

screen

and execute the following command to run the notebook with a predefined profile:

# first, create the myserver profile 
# (procedure detailed below)

ipython notebook --profile=myserver 

Then you can close the window and ethane will continue to serve the iPython notebook.

To create the myserver profile: #Step_5:_Create_iPython_Profile

Setting Up Remote iPython Notebook

Step 1: Install some (apt-get) stuff

$ sudo apt-get install libatlas-dev libpng12-dev libfreetype6 libfreetype6-dev g++ libzmq-dev liblapack-dev gfortran python-dev build-essential python-qt4

Step 2: Install some (python) stuff

This can potentially be run from a virtualenv:

$ pip install numpy scipy tornado pyzmq pandas ipython pygments matplotlib

Step 3: Get PyQT4

If you need to get pyqt4 running in a virtualenv, you'll need to run this script as sudo: https://gist.github.com/jlesquembre/2042882

The short version:

$ wget https://raw.github.com/gist/2042882/160eb22a86f9c5a120033b9b05213b2aab8f79f6/postmkvirtualenv
$ chmod +x postmkvirtualenv
$ ./postmkvirtualenv

Step 4: Change Matplotlib backend

Edit this file:

.matplotlib/matplotlibrc

and add this line:

backend: Qt4Agg

Step 5: Create iPython Profile

Create an iPython profile:

$ ipython profile create myserver

and edit this profile's configuration file:

$ vim ~/.ipython/profile_myserver/ipython_notebook_config.py

to add these lines:

c = get_config()

c.IPKernelApp.pylab = 'inline'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha1:yourhashedpassword'
c.NotebookApp.port = 9999

(note that on Mac, you may run into this issue [1])

Done

Run the server with your profile:

$ ipython notebook --profile=myserver