This is a copy & paste & run script but you need to make 2 changes:
- <PASSWORD> : set your user passoword.
- <TOKEN>: paste your ngrok token.
Then you have to open your VSC and install Remote - SSH extension.
https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh
Use Ctrl+Shift+P and search for: Command 'Remote-SSH: Open Configuration' and paste the output of the script.
Use Ctrl+Shift+P and search for: Command 'Remote-SSH: Connect to Host...'
Select colab-ssh.
Confirm that you have a LINUX server.
Confirm you want to CONTINUE.
Enter the password fot the one you change in the script.
Wait for VSCode to download some files to your colab folder to run the VSC server.
Before opening in the VSC workspace you need to install Python extension on the VSC server.
Go yo extension tab on the left and search for Python extension.
You will see that is already installed in your local VSC but not in the server.
Install it.
If everthing is ok you will see a pop-up to navigate trought google drive folders.
If not, go to the Explorer tab on the left.
Select the path to: /content/drive/My Drive/Colab Notebooks/
Input your password.
Open a jupyter notebook.
VSC code will do everthing you are use to.
It will configure workspace and ask for a python path: Select: /usr/bin/python
You will see that .vscode folder is now living in colab folder with a settings.json with this path.
Is everything ok the jupyter server is going to start.
You can now use VSC code as your coding best friend and run your script on your colab ...your also best friend.