-
-
Save shuxiaokai/8a5f6baf9c3ee017cfc6b973ab59b22f to your computer and use it in GitHub Desktop.
Revisions
-
nmichlo revised this gist
Sep 8, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ # run vscode in background if needed !(ps -ef|awk '/code-server/&&!/awk/{exit 1}') && (nohup code-server --port 9000 --auth none &) # run ngrok tunnel if needed from pyngrok import ngrok if not ngrok.get_tunnels(): ngrok.connect(port=9000) -
nmichlo revised this gist
Sep 8, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,10 +3,10 @@ # install deps if needed !(command -v "code-server" 1>/dev/null) || (curl -fsSL https://code-server.dev/install.sh | sh && echo) !(python -c "import pyngrok" 2>/dev/null) || (pip install -qqq pyngrok) # run vscode in background if needed !(ps -ef|awk '/code-server/&&!/awk/{exit 1}') && (nohup code-server --port 9000 --auth none &) # run ngrok tunnel from pyngrok import ngrok -
nmichlo revised this gist
Sep 8, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,11 +2,11 @@ # Copy this script into a colab cell # install deps if needed !(command -v "code-server" 1>/dev/null) || (curl -fsSL https://code-server.dev/install.sh | sh && echo) !(python -c "import pyngrok" 2>/dev/null) || (pip install -qqq pyngrok && echo) # run vscode in background if needed !(ps -ef|awk '/code-server/&&!/awk/{exit 1}') && ((nohup code-server --port 9000 --auth none &) && echo) # run ngrok tunnel from pyngrok import ngrok -
nmichlo created this gist
Sep 8, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ # Adapted from https://amitness.com/vscode-on-colab # Copy this script into a colab cell # install deps if needed !(command -v "code-server" >out) || (curl -fsSL https://code-server.dev/install.sh | sh && echo) !(python -c "import pyngrok" >out) || (pip install -qqq pyngrok && echo) # run vscode in background if needed !(ps -ef|awk '/code-server/&&!/awk/{exit 1}') && (nohup code-server --port 9000 --auth none &) # run ngrok tunnel from pyngrok import ngrok if not ngrok.get_tunnels(): ngrok.connect(port=9000) print('CONNECT:', ngrok.get_tunnels()[0].public_url) # kill ngrok & vscode !echo !kill $(ps -ef|awk '/ngrok|code-server/&&!/awk/{print $2}')