Skip to content

Latest commit

 

History

History
99 lines (78 loc) · 4.1 KB

File metadata and controls

99 lines (78 loc) · 4.1 KB

Setting up VSCode

Prerequisites

  • Visual Studio Code is installed on your local machine
  • WUSTL microsoft account login information
  • Basic understanding of how to navigate VSCode GUI
    • Press Mac:CMD+SHIFT+P or Windows:CTRL+SHIFT+P to open the Command Palette

Terminal Setup

  • Ability to execute bash commands in the integrated terminal
  • Windows users will need to install git for Windows, then set the default shell in VSCode to Bash.
    • In the Command Palette, type Terminal: Select Default Profile and select the command from the dropdown menu.
    • A list of detected shells will appear at the top of the screen. Select Git Bash from the list.

Setup code command

a. On your local machine, open Visual Studio Code.

b. Open the Command Palette.

c. Type shell command to find the Shell Command: Install 'code' command in PATH command.

d. After executing the command, restart the terminal for the new $PATH value to take effect.

e. verify setup by typing code --version in the terminal. If it prints out the version of Visual Studio Code, proceed.

Now when you are using a terminal, you can simply type code . to start editing files in the current folder. You can also add an option -r and provide the path to a file. This will open the file in a new tab in the current window: code -r <filename>.

Install Extensions Locally

  • Open VSCode on your local machine
  • Go to Extensions image (Shortcut: Cmd+Shift+X)
  • Search and install the following extensions:
    • ms-python.python - Python language support
    • ms-toolsai.jupyter - run Jupyter notebooks
    • ms-toolsai.datawrangler - view data interactively within VSCode
    • ms-vscode-remote.vscode-remote-extensionpack - for ssh and tunneling to connect to and use IDE features on the server
    • ms-vscode.remote-explorer - see remotes to connect to
    • GitHub.remotehub - navigate github repos without needing to clone
    • ms-vscode.remote-repositories - view and edit remote repositories
    • GitHub.copilot
    • GitHub.copilot-chat

Remote Development

Install Extension on HTCF

A button will appear on some extensions giving you the option to also install on the remote machine. This will install the extension to your home folder on HTCF.

You can list all installed extensions with their versions by running code --list-extensions --show-versions.

Configuring SSH

While still on your local machine:

a. Enter the following at the terminal prompt to create the ssh config file and folder if they do not already exist:

mkdir -p ~/.ssh && chmod 700 ~/.ssh
[ ! -f ~/.ssh/config ] && touch ~/.ssh/config && chmod 600 ~/.ssh/config

b. Press CMD + SHIFT + P to open the Command Palette. Begin typing and select Remote-SSH: Open SSH Configuration File. Open the configuration file in your home directory.

c. Paste the following in ~/.ssh/config, substituting your username. Save and close the file.

Host htcf
Hostname login.htcf.wustl.edu
User yourusername # change this
ControlMaster auto
ControlPath ~/.ssh/control:%h:%p:%r

d. Confirm that you are able to login after entering ssh htcf at the terminal prompt.

Note: Now to login you can select the "Open a remote window" button in the bottom-left corner of the window. image Select Connect to a Host and click htcf.

Configure SSH Keys (optional)

By setting up SSH keys you won't have to enter your credentials every time you log on to HTCF.

Enter the following at the prompt of a local terminal:

ssh-keygen -t ed25519
chmod 400 ~/.ssh/id_ed25519
export PUBKEYPATH="$HOME/.ssh/id_ed25519.pub"

With your username:

export USER_AT_HOST="[email protected]"
ssh-copy-id -i "$PUBKEYPATH" "$USER_AT_HOST"