Skip to content

Instantly share code, notes, and snippets.

@andrius
Created May 21, 2024 14:54
Show Gist options
  • Save andrius/99819046f9ce2b503d153be254ffba50 to your computer and use it in GitHub Desktop.
Save andrius/99819046f9ce2b503d153be254ffba50 to your computer and use it in GitHub Desktop.
script that open the vscode cli tunnel so you can access your vps from the laptop
#!/usr/bin/env bash
cd /tmp
[ -f vscode_cli.tar.gz ] && rm -f vscode_cli.tar.gz
if [ ! -f code ]; then
# Based on the CPU architecture, download the appropriate version of Visual Studio Code and install it.
if [ "$(uname -m)" == "x86_64" ]; then
curl -Ls 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-arm64' --output vscode_cli.tar.gz
elif [ "$(uname -m)" == "aarch64" ]; then
curl -Ls 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-arm64' --output vscode_cli.tar.gz
fi
tar -xvf vscode_cli.tar.gz
fi
cd ~/code && /tmp/code tunnel --no-sleep --accept-server-license-terms --log error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment