Skip to content

Instantly share code, notes, and snippets.

@perryism
perryism / Dockerfile.gpu
Created December 17, 2017 07:06
nvidia docker
FROM nvidia/cuda
MAINTAINER perry
COPY ./keyboard /etc/default/keyboard
RUN apt-get update && \
apt-get install -y python-pip python-dev build-essential libcupti-dev cuda wget git && \
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb -qO cuda.deb && \
dpkg -i cuda.deb && \
@perryism
perryism / backup.py
Created September 19, 2017 23:39
Make a copy of the original file
"""
Make a copy of a file in case the block is modifying it
Example:
with Backup('filepath') as f:
pickle(f, xx)
"""
from datetime import datetime
@perryism
perryism / make_week_dir.py
Last active September 19, 2017 23:35
Create a folder for the week
from datetime import datetime, timedelta
import os, logging
def week_dir():
now = datetime.now()
now = now - timedelta(days=now.weekday())
return now.strftime("%Y-%m-%d")
def make_week_dir():
try:
@perryism
perryism / gist:87e382cbc9d6ef0e73ba247bd99a1f0c
Last active September 26, 2017 23:33
Use TensorFlow with GPU support
# https://www.tensorflow.org/install/install_linux
# https://developer.nvidia.com/cuda-downloads
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb -qO cuda.deb
sudo dpkg -i cuda.deb
sudo apt-get update
sudo apt-get install -y python-pip python-dev build-essential libcupti-dev cuda
sudo pip install -U pip
### Keybase proof
I hereby claim:
* I am perryism on github.
* I am perrylee (https://keybase.io/perrylee) on keybase.
* I have a public key ASB8r9SSmhz7ykeAh3aaFwfAgfpm90Fs8XpStxg0BVoNLwo
To claim this, I am signing this object: