The
Jupyter Notebook (previously IPython Notebook)
provides a feature-rich interactive environment for learning and using the Python Programming language. If you're studying for a BSc or MSc at the University College London Department of Geography then it's likely that you've encountered these Notebooks in one or more of your modules or in the preparation of a dissertation. Usually this will be from one of the workstations in Pearson 110a that forms part of the Geography Linux Cluster. Since physical access to Pearson 110a is not always practical, you may wish to have direct access to these files from another computer. This guide will show you how to remotely run and work with Jupyter Notebooks hosted on the Linux Cluster in a manner that is fast.Preamble on operating systems
While the machines in Pearson 110A run a
Linux OS, it is likely that you use either
Mac OS X or
Microsoft Windows on your own computer. The bulk of this guide is written for somebody using the terminal on a Linux computer, and Apple fans should be able to enter all these same commands on the
Mac Terminal. The
On Windows section adapts these instructions for a Windows terminal emulator, although it is important to read
On Linux first.
However, I strongly urge any Windows users intending on working extensively with Python and Jupyter Notebooks to consider installing a Linux distribution. Don't be alarmed: this need not be a drastic switch as there are two simple ways to set up Linux
alongside Windows. The first is to use a
virtual machine, an OS that runs
inside your current system. This is very simple to setup (see
here) and I myself use this method to work from UCL's library computers. The second option, and the one I use for my personal laptop, is
dual-booting. Although this is somewhat involved, there are
plenty of resources available to guide you through the process, and a native Linux install is always faster than a virtual one. Whichever option you go for, you'll need to choose one from among the many
distributions of Linux.
Ubuntu and
Linux Mint are most often suggested for beginners, and for
I would recommend opting for a more lightweight flavour (featuring MATE, Xfce or LXDE as the desktop environment) for use on a virtual machine or an ageing laptop.On Linux/ Mac OS X
Manual
The section provides a very explicit set of instructions to get up and running with remote Jupyter Notebooks. If you're familiar with the command-line interface then you could skip to Automatic, where they're condensed to shell functions, but it's probably worth going through this just once to make sure that everything is working smoothly. Here I use the character $ to indicate the line is a command to be entered, while # denotes comments. Anything enclosed in angle brackets (<>) must be replaced, including the brackets themselves, as specified.
Run Notebook Server
The first step is use the program
SSH to remotely log into one of the machines in Pearson 110a and start up a Notebook server. Because of the way the Linux cluster is set up, this requires a two-step (or "multi-hop") log in. To make the first hop, open a new terminal and enter the following command, replacing <USER> with your UCL username and <GATEWAY> with the name of any one of the gateway servers listed on
Geography Remote Access page.