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
# Download cudnn from https://developer.nvidia.com/cudnn
# untar archive
tar -zxf cudnn-7.5-linux-x64-v5.1.tgz # cuda 7.5 cudnn 5.1
sudo cp -P include/cudnn.h /usr/include
sudo cp -P lib64/libcudnn* /usr/lib/x86_64-linux-gnu/
sudo chmod a+r /usr/lib/x86_64-linux-gnu/libcudnn*
# Swap should take place on the Instance Storage (ephemeral) disk and not an EBS device.
# Check that your ephemeral storage is mounted sudo mount /dev/xvda2 /mnt
sudo dd if=/dev/zero of=/mnt/swapfile bs=1M count=16348 # create 16G swap
# Permission
sudo chown root:root /mnt/swapfile
sudo chmod 600 /mnt/swapfile
# Activate swapfile
sudo mkswap /mnt/swapfile
sudo swapon /mnt/swapfile
# add this to /etc/fstab
pip install --upgrade --no-deps
#! /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
# stop and remove containers
docker rm $(docker ps -a -q)
docker stop $(docker ps -a -q)
ssh -nNT -L port_local:host:port_remote server # no shell associated
# ssh -L <local port>:<remote computer>:<remote port> <user>@<remote ip>

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
apt-get install libxml2-dev libxslt-dev zlib1g-dev
logging.basicConfig(
format='%(asctime)s -- %(name)s -- %(levelname)s -- %(message)s', level=logging.DEBUG)
sudo apt-get install libxml2-dev libxslt-dev python3-dev zlib1g-dev
pip3 install lxml