Skip to content

Instantly share code, notes, and snippets.

View nealmcb's full-sized avatar

Neal McBurnett nealmcb

View GitHub Profile
@nealmcb
nealmcb / testkernel.py
Created February 24, 2012 05:16
testkernel: automate many linux kernel testing steps - great for a git bisect
#!/usr/bin/env python
"""
The testkernel command does these things to make linux kernel testing easy:
looks in the indicated folder on the web
downloads the .deb files for the kernel of the given type
installs them locally
configures grub2 to reboot to the given kernel on the next reboot
TODO:
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@rdhyee
rdhyee / spark_docker_mesos.md
Created January 17, 2015 17:03
What I'm planning to work on during the Data Science / Docker hackday at Wise.io (2015.01.18)

This is pretty much what I had intended to work on. Specifically I'd like to get the docker images that package up spark in the ipython/scipyserver docker image (https://github.com/rdhyee/ipython-spark/blob/master/Dockerfile) to run on a Mesos cluster. Of relevance is a Spark PR that seems almost ready to go: apache/spark#3074 (combined with https://issues.apache.org/jira/browse/SPARK-2691). If we get the basics working, I'd love to work such integration with https://github.com/rgbkrk/cloudpipe, which I understand to be a hybrid of http://www.multyvac.com/ (I loved its predecessor: picloud) + tmpnb (https://lambdaops.com/ipythonjupyter-tmpnb-debuts/). Wonderful to be able to let people spin up a temporary Jupyter notebook that can run Spark and also be based on an arbitrary docker image.

@georgy7
georgy7 / extract_mbox_attachments.py
Last active April 24, 2024 12:12
Extract attachments from mbox file.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Modified.
# Original script source:
# http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html
# https://web.archive.org/web/20150312172727/http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html
# Usage:
# Run the script from a folder with file "all.mbox"
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward