Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Directly login, run interactive job and start VS Code Server from local machine

Code Block
# Set DUO default to push if you didn’t do it yet. 
# Run this command on O2:  
echo 'export DUO_PASSCODE=push’ >> $HOME/.bashrc

# On your local machine
# set up alias. You could add this row to your ~/.bash_profile
alias vscode='PORT=51234; CLUSTER_USER=YourHMSID; ssh -L $PORT:127.0.0.1:$PORT $CLUSTER_USER@o2.hms.harvard.edu -t "hostname; echo port is: $PORT; kill -9 $(/usr/sbin/lsof -t -i:$PORT) 2>/dev/null; srun --pty -p priority -t 8:0:0 --tunnel $PORT:$PORT bash -c \"hostname; echo port is: $PORT; kill -9 $(/usr/sbin/lsof -t -i:$PORT) 2>/dev/null; export PORT=$PORT; ~/.local/lib/code-server-3.12.0/bin/code-server & bash;\""'

# login to O2, start interative job and run vs code server
vscode

...