Skip to content

Instantly share code, notes, and snippets.

@mdellavo
mdellavo / nj-open-data-purchasing.md
Last active July 21, 2016 13:56
Playing around with NJ Open Data - Purchases

I've been playing around with purchasing information from NJ's Open Data portal (https://data.nj.gov/). These are things that caught my eye as I was looking over the data - I have no idea what most of this means.

From the portal:

Purchasing represents the procurement from vendors of goods and services that are recorded in the State’s purchasing system and for which payment must be made amounts already spent, amounts the State is obligated to pay to a specific vendor as a result of an order or contract, and amounts that are set aside for imminent purchases are included in purchasing data.

There about 500,000 purchases spanning 12 years.

Below is the output of simple keyword searches over the contents of the purchasing CSV data. The goal is to survey the data, the results are meant to be innacurate for the sake of speed of discovery. I added the header row and removed unrelated lines for clarity. This is pretty quick and dirty - it could be formatted better.

Without more context it's impossible to

From minimal raspbian Jessie image

After initial boot

  • resize partition and extend filesystem

Kernel Config

  • license
  • gpu mem

Kodi

def divide(collection, decider):
"""
Divide the items of collection into A and B according to decider(item)
:param collection: a sequence of items
:param decider: a function that takes an item and returns true of false
:return: a pair of lists (A, B)
>>> divide(range(10), lambda x: x%2 == 0)
([0, 2, 4, 6, 8], [1, 3, 5, 7, 9])
import time
import socket
import threading
import paramiko
class ServerInterface(paramiko.ServerInterface):
def get_allowed_auths(self, username):
return "none"
def check_auth_none(self, username):
@mdellavo
mdellavo / sftp-server-test.py
Created December 16, 2015 16:59
Paramiko leaks Transports and Channels via Transport.server_accepts
import time
import socket
import threading
import paramiko
class ServerInterface(paramiko.ServerInterface):
def get_allowed_auths(self, username):
return "none"
def check_auth_none(self, username):
@mdellavo
mdellavo / simple-cloudformation.json
Last active August 29, 2015 14:16
Simple cloudformation stack with a single node in a vpc exposing ssh
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Simple",
"Resources" : {
"VPC" : {
"Type" : "AWS::EC2::VPC",
"Properties" : {
import json
import base64
import os
from argparse import ArgumentParser
import getpass
import pprint
from Crypto.Cipher import AES
from Crypto import Random
import pprint
def oper(op):
def _oper(arg):
return {op: arg}
return _oper
ne = oper('$ne')
gt = oper('$gt')
def toBigDecimal(x : java.math.BigDecimal) : BigDecimal = {
Option(x) match {
case Some(i) => i
case None => BigDecimal(-1)
}
}
var Log = require("log").Log;
var TAG = __file__.getName();
Log.d(TAG, "initializing hello world");
exports.name = 'Hello';
exports.description = 'Hello World';
exports.icon = 'http://example.com/icon.png'