This is an old revision of the document!
PHY3026 Computational Physics: Fall 2019
Class materials in git
git clone https://github.com/monttj/computational-physics
Prepare your computing environment
Install MobaXterm
https://mobaxterm.mobatek.net/download.html
Connect to server
Ask to tutor to create accounts for students. Start local terminal in mobaxterm.
ssh -p PORT -X YOURID@210.117.210.IP
Jupyter notebook
To write and excute python code in your local browser, you need to create ssh tunnel to server. First, make sure you are using unique port number for tunnel. Follow the lines in the server.
jupyter notebook --generate-config vi /home/YOURID/.jupyter/jupyter_notebook_config.py
Then you can excute jupyter in server.
jupyter-notebook --no-browser
You can check your port number in c.NotebookApp.port = 8888
. Now, create tunnel in your LOCAL(in desktop)
terminal (not in server!).
ssh -p PORT -f -N -L localhost:TunnelPort:localhost:TunnelPort YOURID@210.117.210.XX
Please don't confuse PORT (port to connect server when login)
and TunnelPort (port to listen data from the server)
!
The address to jupyter notebook will appear in the terminal. Copy & paste into local internet browser.
*Run .py
in jupyter notebook*
%run some_code.py
*Disable ssh tunnel*
This is optional. But it can be required if you are using your own laptop without logout/restart, whatever. Find pid with ssh -p XXX….
(which is ssh tunnel command you wrote in terminal), then quit it.
ps -elf | grep ssh kill -9 <PID>