Skip to content

Instantly share code, notes, and snippets.

View ericfourrier's full-sized avatar
🦉
Building neat tools to secure cloud and source code

Eric Fourrier ericfourrier

🦉
Building neat tools to secure cloud and source code
View GitHub Profile
import asyncio
import aiohttp
from aiohttp import web
import json
WEBSITES = ['http://example.com/', 'http://dummy-a98x3.org', 'http://example.net/']
async def handle(request):
# Fire up 3 requests in parallel
coroutines = [aiohttp.request('get', website) for website in WEBSITES]
# On the remote
jupyter notebook --no-browser --port=8889
# On the client
ssh -N -f -L localhost:8888:localhost:8889 remote_user@remote_host
# The first option -N tells SSH that no remote commands will be executed and is useful for port forwarding.
# The second option -f has the effect that SSH will go to background,
# The last option -L lists the port forwarding configuration (remote port 8889 to local port 8888).
sudo apt-get install libxml2-dev libxslt-dev python3-dev zlib1g-dev
pip3 install lxml
logging.basicConfig(
format='%(asctime)s -- %(name)s -- %(levelname)s -- %(message)s', level=logging.DEBUG)
apt-get install libxml2-dev libxslt-dev zlib1g-dev

Changing Kernel OVH to install docker

Ovh uses custom optimised kernel that are not natively compatible with docker So you need to change the kernel in order to use docker

Instructions

  • Download standard linux kernel sudo apt-get install linux-image-generic
  • Edit /etc/default/grub with GRUB_DEFAULT to 1
  • run sudo update-grub
  • Reboot
ssh -nNT -L port_local:host:port_remote server # no shell associated
# ssh -L <local port>:<remote computer>:<remote port> <user>@<remote ip>
# stop and remove containers
docker rm $(docker ps -a -q)
docker stop $(docker ps -a -q)
#! /bin/bash
# nvidia-370 seems to work
# Adding user to docker sudo (docker required)
sudo usermod -aG docker $(whoami)
# Nvidia pre-requirements
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y linux-headers-$(uname -r)
sudo add-apt-repository ppa:graphics-drivers/ppa
pip install --upgrade --no-deps