How to connect to an IPython instance on beach

If you want to play with some of the examples that we will show in these tutorials, you can connect to beach and run them through an iPython notebook. You will need the following installed on your machine:

  • iPython notebook
  • ssh

TL;DR

Open a terminal and run:

localhost> ssh [username@]beach.colorado.edu
beach> git clone https://github.com/mcflugen/bmi-tutorial
beach> cd bmi-tutorial
beach> source scripts/setup-beach.sh
beach> ipython notebook --no-browser

Open another terminal and run:

localhost> ssh -N -L 8888:localhost:8888 [username@]beach.colorado.edu

Go here: http://localhost:8888

The Details

First open an ssh connection to the server and start the IPython notebook,

localhost> ssh [username@]beach.colorado.edu

If your username on your computer is different than that on beach, you will need to include your username as shown in the above example. You now need to get the tutorial materials from GitHub, set your environment and start the iPython notebook.

beach> git clone https://github.com/mcflugen/bmi-tutorial
beach> cd bmi-tutorial
beach> source scripts/setup-beach.sh
beach> ipython notebook --no-browser

Note the port that IPython is running on. IPython will print out a few lines, one of them should look like,

[I 10:24:23.092 NotebookApp] The IPython Notebook is running at: http://localhost:8888/

In this example, IPython is running on port 8888 (the default).

To view IPython notebook in you browser, you will need to forward this port to the port IPython is running on on the server. You also do this with ssh,

localhost> ssh -N -L 8888:localhost:8888 [username@]beach.colorado.edu

Now to connect to the IPython notebook that's running on the server, point your browser to http://localhost:8888