Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@timguoqk
timguoqk / tf8_aws.sh
Last active February 8, 2017 06:46 — forked from dennybritz/tf8_aws.sh
Tensorflow 0.12 on AWS GPU instance installation
# Install build tools
sudo apt-get update
sudo apt-get install -y build-essential git python-pip libfreetype6-dev libxft-dev libncurses-dev libopenblas-dev gfortran python3-matplotlib libblas-dev liblapack-dev libatlas-base-dev python3-dev python3-pydot linux-headers-generic linux-image-extra-virtual unzip python3-numpy swig python3-pandas python-sklearn unzip python3-pip python3-venv
# Install CUDA 8
wget https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb
sudo dpkg -i cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb && rm cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb
sudo apt-get update
sudo apt-get install -y cuda
@dbp
dbp / circle.yml
Last active June 29, 2017 09:53
Haskell project with Stack on CircleCI
dependencies:
cache_directories:
- "~/.stack"
pre:
- wget https://github.com/commercialhaskell/stack/releases/download/v0.1.2.0/stack-0.1.2.0-x86_64-linux.gz -O /tmp/stack.gz
- gunzip /tmp/stack.gz && chmod +x /tmp/stack
- sudo mv /tmp/stack /usr/bin/stack
override:
- stack setup
- stack build
@albertz
albertz / TaskSystem.py
Last active September 24, 2019 15:31
Multiprocessing with real subprocess (fork+exec), not just fork
"""
Here are all subprocess, threading etc related utilities,
most of them quite low level.
"""
from threading import Lock, currentThread
import sys
import os
from StringIO import StringIO
@donalod
donalod / OSXRoamingKnobs
Last active September 9, 2017 19:12
OSXRoamingKnobs
# Via @srynearson tweet https://twitter.com/Srynearson/status/534421250261942272 #kudos Bill Mullady
# Re: http://community.arubanetworks.com/t5/Unified-Wired-Wireless-Access/Mac-OS-X-Lion-MacBook-Air-issue/m-p/113885#M24396
sudo defaults read /Library/Preferences/com.apple.airport.opproam
Password:
{
deltaRSSI = 10;
disabled = 0;
useBonjour = 0;
useBroadcastBSSID = 1;
@Zolmeister
Zolmeister / xmonad.hs
Created August 30, 2013 04:07
Xmonad + Gnome 3 config
--
-- xmonad example config file.
--
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
--
-- Normally, you'd only override those defaults you care about.
--
import XMonad
@jrenner
jrenner / box2d_air_resistance.java
Last active January 14, 2022 04:30
box2d air resistance
float dragForce;
Vector2 appliedDrag = new Vector2();
float dragAngle;
float p, A, Cd, v; // elements of the formula see wikipedia entry for Drag (physics)
/*
ρ is the density of the fluid,
v is the speed of the object relative to the fluid,
A is the cross-sectional area
Cd is the drag coefficient – a dimensionless number.
sample drag co-efficients (http://en.wikipedia.org/wiki/Drag_coefficient)