Skip to content

Instantly share code, notes, and snippets.

View beauzeaux's full-sized avatar

Nick Beaulieu beauzeaux

  • Microsoft
  • Bellevue, WA
View GitHub Profile
@beauzeaux
beauzeaux / gist:1e58686b6d5193cbaf30
Created May 8, 2015 21:49
Deploy Script for OpenWPM on Google Compute Engine
import os
import argparse
import json
from pprint import pprint
from tempfile import NamedTemporaryFile
from jinja2 import Environment, PackageLoader
from libcloud.common.types import ProviderError
from libcloud.compute.types import Provider
from libcloud.compute.deployment import (MultiStepDeployment,
ScriptDeployment, ScriptFileDeployment, FileDeployment)
@beauzeaux
beauzeaux / sqlite2parquet.py
Created April 23, 2015 19:58
sqlite2parquet
import sqlite3
import os
import argparse
try:
import pyspark
import pyspark.sql
except ImportError:
import sys
import os
==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: libgit2-0 is already the newest version.
==> default: python-git is already the newest version.
==> default: 0 upgraded, 0 newly installed, 0 to remove and 92 not upgraded.
==> default: Running provisioner: salt...
@beauzeaux
beauzeaux / newbie_blaze.ipynb
Last active August 29, 2015 14:13
Newbie Blaze Questions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@beauzeaux
beauzeaux / Random
Created April 16, 2013 15:40
A more showy version of bwk's random program for 333. Builds up some more suspense at the expense of time / student sanity.
#!/usr/bin/env python2
from random import randint
import sys
from time import sleep
MAX_TIME = 3 + randint(0,3)
SHOWMAN_RUNS = 40
SHOWMAN_SLEEP = .05
f = open(sys.argv[1])
lines = f.readlines()
@beauzeaux
beauzeaux / PercolationVisualizer.java
Created September 17, 2012 00:59
Fixed drawing bug with degenerate case of N=1 when reading from text file
/****************************************************************************
* Compilation: javac PercolationVisualizer.java
* Execution: java PercolationVisualizer input.txt
* Dependencies: Percolation.java StdDraw.java In.java
*
* This program takes the name of a file as a command-line argument.
* From that file, it
*
* - Reads the grid size N of the percolation system.
* - Creates an N-by-N grid of sites (intially all blocked)