Skip to content

Instantly share code, notes, and snippets.

View mooneral's full-sized avatar
🎲

Reza mooneral

🎲
  • Netherlands
View GitHub Profile
@korakot
korakot / mongodb.py
Last active November 4, 2023 01:54
Use MongoDB in Colab
# install and start server
!apt install mongodb >log
!service mongodb start
from pymongo import MongoClient
client = MongoClient()
client.list_database_names() # ['admin', 'local']
@entropiae
entropiae / Install pyenv on Ubuntu 18.04 + fish shell
Last active July 15, 2025 23:28
Install pyenv on Ubuntu 18.04 + Fish shell
Install pyenv on Ubuntu 18.04 + fish shell
- Install the packages required to compile Python
$ sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
- Download pyenv code from github
$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
- Define environment variable PYENV_ROOT to point to the path where pyenv repo is cloned
$ echo "set --export PYENV_ROOT $HOME/.pyenv" > ~/.config/fish/conf.d/pyenv.fish
@yashkumaratri
yashkumaratri / Google Colab SSH
Created December 31, 2018 05:19
SSH into google colab
#CODE
#Generate root password
import random, string
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20))
#Download ngrok
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
! unzip -qq -n ngrok-stable-linux-amd64.zip
#Setup sshd