This is an old revision of the document!
PHY3026 Computational Physics: Fall 2018
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
You can check your port number in c.NotebookApp.port = 8888
. Now, create tunnel in your LOCAL
terminal (not in server!).
ssh -p PORT -f -N -L localhost:TunnelPort:localhost:TunnelPort YOURID@210.117.210.XX
Please don't confuse PORT
and TunnelPort
!
Then you can excute jupyter in server.
jupyter-notebook --no-browser
The adress to jupyter notebook will appear in terminal. Copy & paste into local internet prowser.
*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>