class:phy3026

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
class:phy3026 [2019/09/04 13:50] minerva1993class:phy3026 [2023/03/06 13:44] (current) – external edit 127.0.0.1
Line 7: Line 7:
  
 ===Prepare your computing environment=== ===Prepare your computing environment===
 +Choose one of following methods to connect to use ssh and the other linux commands
 +**Use Mac OS or Linux**
 +You can directly access to the server with native bash (terminal) in Mac os or Linux.
 +You can also install Linux (usually Ubuntu) to virtual box ({{https://www.virtualbox.org/|link}} but the performance will be largely degraded since the os will share resources with native Windows
 +
 +**Install ubuntu via Microsoft appstore**
 +This part is written based on Windows 10 1903 update.
 +Open Control Panel (제어판) - Programs and Features (프로그램 및 기능) -  Turn Windows features on or off (Windows 기능 끄키/켜기) - activate 'Windows Subsystem for Linux' (Linux용 Windows 하위시스템 항목 활성화) - 재부팅
 +
 +Open Microsoft appstore, search for 'Ubuntu' - install Ubuntu 18.04
 +
 +Type username and root password. If you failed to correctly verify password (비밀번호를 두 번 입력해야하는데 실수로 서로 다르게 입력하여 계정 생성에 실패할경우), go to Settings (설정) - Apps & features (앱 및 기능) - Ubuntu 18.04 LTS (Ubuntu 18.04 LTS 클릭) - Advanced options - Reset)
 +
 +In terminal, you can use linux commands like ssh, ls, cd.
 +
 +*Optional: change ubuntu mirror and update
 +In terminal,
 +<code>
 +sudo vi /etc/apt/sources.list
 +:%s/archive.ubuntu.com/mirror.kakao.com/    (콜론 포함하여 vi기능에서 찾아바꾸기임)
 +('kr.archive.ubuntu.com'부분은 사람마다 다를 수 있으니 적당히 바꾸면 됨)
 +:wq                                            (저장하고 나오기)
 +sudo apt-get update
 +sudo apt-get upgrade                           (설치하시겠습니까? [Y/n]등의 메시지 나오면 Y 선택하여 설치)
 +sudo apt install python2.7                     (python 2.7 설치. 기본은 3.5)
 +sudo pip install numpy                         (예를 들어 numpy 설치)
 +</code>
 +
 +Next, you need to install Xming {{https://xming.ko.softonic.com/|link}} to forward graphic output from server to your local computer. Then you add following lines in your bashrc
 +<code>
 +vi ~/.bashrc
 +GG                (vi 명령어, 맨 아래로 이동하기)
 +i                 (vi 쓰기모드)
 +export DISPLAY=0:0
 +esc key           (쓰기모드에서 나가기)
 +:wq               (저장하고 파일 닫기)
 +source ~/.bashrc  (변경사항 적용)
 +</code>
 +
 +
 **Install MobaXterm** **Install MobaXterm**
 <code> <code>
 https://mobaxterm.mobatek.net/download.html https://mobaxterm.mobatek.net/download.html
 </code> </code>
-{{ :class:mobaxterm_portable_v10.9.zip |MobaXterm}}+{{ :class:mobaxterm_portable_v12.1.zip |MobaXterm}}
  
 **Connect to server** **Connect to server**
Line 17: Line 57:
 Ask to tutor to create accounts for students. Start local terminal in mobaxterm. Ask to tutor to create accounts for students. Start local terminal in mobaxterm.
 <code> <code>
-ssh -p PORT -X YOURID@210.117.210.IP+ssh -X YOURID@210.117.210.IP
 </code> </code>
  
Line 24: Line 64:
 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. 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.
 <code> <code>
 +##DO THIS ONLY AT THE FIRST TIME##
 jupyter notebook --generate-config jupyter notebook --generate-config
 vi /home/YOURID/.jupyter/jupyter_notebook_config.py vi /home/YOURID/.jupyter/jupyter_notebook_config.py
 +##DO THIS ONLY AT THE FIRST TIME##
 </code> </code>
  
Line 33: Line 75:
 </code> </code>
  
-You can check your port number in ''c.NotebookApp.port = 8888''. Now, create tunnel in your ''LOCAL'' terminal (not in server!).+You can check your port number in ''c.NotebookApp.port = 8888''. Now, create tunnel in your ''LOCAL(in desktop)'' terminal (not in server!).
 <code> <code>
-ssh -p PORT -f -N -L localhost:TunnelPort:localhost:TunnelPort YOURID@210.117.210.XX+ssh -f -N -L localhost:9XXX:localhost:9XXX YOURID@210.117.210.XX
 </code> </code>
-Please don't confuse ''PORT'' and ''TunnelPort''! 
  
-The adress to jupyter notebook will appear in terminal. Copy & paste into local internet prowser.+The address to jupyter notebook will appear in the terminal. Copy & paste into local internet browser.
  
 *Run ''.py'' in jupyter notebook* *Run ''.py'' in jupyter notebook*
  • class/phy3026.1567572636.txt.gz
  • Last modified: 2023/03/06 13:44
  • (external edit)