<jupyter_start><jupyter_text>**Colab RDP** : Remote Desktop to Colab InstanceUsed Google Remote Desktop & Ngrok Tunnel> **Warning :** This notebook is against the Policy of Colab. Use it on your own riskGoogle Colab can give you Instance with 12GB of RAM and GPU for 12 hours (Max.). Anyone can use it to perform Heavy TasksTo use other similiar Notebooks use my Repository **[Colab Hacks](https://github.com/PradyumnaKrishna/Colab-Hacks)**  Before We Started- Create a Ngrok Account to configure tunnel- Don't use username : `root`  Installing Colab SSH Library<jupyter_code>! pip install colab_ssh --upgrade
from colab_ssh import launch_ssh, init_git<jupyter_output><empty_output><jupyter_text>Configure User Setting Username & Password<jupyter_code>username = input("Enter username : ")
password = input("Enter password : ")<jupyter_output><empty_output><jupyter_text>Create User & Set Password<jupyter_code>! sudo useradd -m $username
! sudo adduser $username sudo
! echo '$username:$password' | sudo chpasswd
! sed -i 's/\/bin\/sh/\/bin\/bash/g' /etc/passwd<jupyter_output><empty_output><jupyter_text>Mount Google Drive<jupyter_code>from google.colab import drive
home='/home/'+username+'/drive'
drive.mount(home)<jupyter_output><empty_output><jupyter_text>Setting Chrome Remote Desktop Download Remote Desktop Installation Script<jupyter_code>! wget https://github.com/PradyumnaKrishna/Colab-Hacks/raw/master/Colab%20RDP/install.sh -P /home/$username<jupyter_output><empty_output><jupyter_text>Use the script - It install the required files and configure your instance- Wait at least 4-5 mintues to complete the process<jupyter_code>! sudo chmod +x /home/$username/install.sh
! sudo /home/$username/install.sh<jupyter_output><empty_output><jupyter_text>Run Ngrok Tunnel<jupyter_code>print("Copy authtoken from https://dashboard.ngrok.com/auth")
ngrokToken = input("Enter Token : ")

launch_ssh(ngrokToken, password)<jupyter_output><empty_output><jupyter_text>Connect to instance via SSH - Use the command below in your terminal- When ask for password give your password which is set previously<jupyter_code>print("ssh", username, end='@')
!curl -s http://localhost:4040/api/tunnels | python3 -c \
    "import sys, json; print(json.load(sys.stdin)['tunnels'][0]['public_url'][6:].replace(':', ' -p '))"<jupyter_output><empty_output><jupyter_text>If unable to Connect through SSH then Kill and Start NGROK Tunnel again  Authenticate Through [Remote Desktop Headless](http://remotedesktop.google.com/headless)- Open browser and go to http://remotedesktop.google.com/headless- Dont Download any file simply proceed directly to authenticate button- when you got a command copy and paste it to SSH terminal and complete the process by setting up a pin Now your process completes Visit [Remote Desktop](http://remotedesktop.google.com/access) at http://remotedesktop.google.com/headless to access your instance  Kill Ngrok Tunnel<jupyter_code>! killall ngrok<jupyter_output><empty_output><jupyter_text>Sleep ColabSleep Colab for 12 hours<jupyter_code>! sleep 43200<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10572259941804074, 'fraction_numerical': 0.007112835434852894, 'mean_word_length': 6.4375, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 42, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '17710', 'license': 'MIT', 'n_tokens_mistral': 1018, 'n_tokens_neox': 975, 'n_words': 284, 'path': 'Colab RDP/Colab RDP.ipynb', 'repo_name': 'mrfoxie/Colab-Hacks', 'size': '3093'}