Guide to Remote Development with PyCharm and Jupyter Notebook

•

Learn how to use PyCharm, Jupyter Notebook, and Visual Studio for remote development. This guide includes instructions on using SSH and Git.

Thank you for reading this post, don’t forget to subscribe!
  • Use Pycharm or Jupiter Notebook
  • Use Visual Studio
  • Git
A modern coding setup featuring two monitors displaying colorful code snippets, with a small potted plant and a keyboard on the desk.

I. Using Pycharm or Jupyter Notebook

Follow this link for more detail.
Type it in the command prompt: ssh -N -L localhost::localhost:<ip_address>
For example, ssh -N -L localhost:8887:localhost:8887 thtran@10.63.246.10
Go ahead and open localhost:8887 on your local browser.

II. Using Visual Studio

1. Visual studio, WSL2 to connect to server

– It is good to visualize files on your HPC and debug, read more here. It works well on WSL2, read more here.

– Use visual code to connect to the server, download here.

2. Remote development using SSH and visual studio:

Follow the instruction here for more detail about using SSH on Visual studio.
Add key to HPC server so you do not need to enter a password to access the server, read here.

To use а SSH key pair to connect to a server, you must place the “public” part on the server. Please refer to the first section of the article for instruction on how to generate key pairs. It covers Windows, Mac, and Linux. Now, when you have a key pair, you must add a public key. Put it in the “authorized_keys” file in your home directory on the server.

a. Connect to the server using your current key
ssh cloud-user@1.2.3.4 -i /current_private_ssh_key
b. Add a public key to the “authorized_keys” file

You can add a public key to the “authorized_keys” file using “nano” text editor (or any text editor of your choice):

nano /home/cloud-user/.ssh/authorized_keys

Paste your public key from the new line:

Nano text editor displaying SSH authorized_keys file

Save changes by pressing Ctrl+X, Y, Enter.

If you don’t have “nano” installed

You can install “nano” by running the following commands on Ubuntu:

sudo apt update && sudo apt upgrade
sudo apt install nano
On CentOS:
yum update
yum install nano -y
c. Verify new key

Do not terminate existing SSH session. Open new session with the key you have just added:

ssh cloud-user@1.2.3.4 -i /new_private_ssh_key

If the connection is established successfully, you all right. To remove one of the keys, just remove it from “authorized_keys” using the same “nano”.

3. How to use a public key to connect to server

Generate a public and private key. Copy the public key to file authorized_keys on the server. Close and reconnect.
First, recheck your connection. Use: ssh cloud-user@<ip_address> -i /new_private_ssh_key.
Upload file to HPC server or download file to the local machine for small file, read here.
Remote python development in Visual studio, check here.
Using Conda Environment Remotely with Visual Studio Code, read here.
Ctrl + Shift + p > use the Python: Select Interpreter command > Select the conda env

III. Using Git

Basic:

Or read basic knowledge about Git here.

For advance resource for learning Git, you can read here.

Leave a Reply

One-Time
Monthly
Yearly

Make a one-time donation

Make a monthly donation

Make a yearly donation

Choose an amount

$5.00
$15.00
$100.00
$5.00
$15.00
$100.00
$5.00
$15.00
$100.00

Or enter a custom amount

$

Your contribution is appreciated.

Your contribution is appreciated.

Your contribution is appreciated.

DonateDonate monthlyDonate yearly

Discover more from Therapy and Relaxation

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from Therapy and Relaxation

Subscribe now to keep reading and get access to the full archive.

Continue reading