Skip to content

Instantly share code, notes, and snippets.

View nrrb's full-sized avatar
🐦‍⬛
Unhinged Crow Content

Nicholas Bennett nrrb

🐦‍⬛
Unhinged Crow Content
View GitHub Profile
@nrrb
nrrb / index.html
Last active August 29, 2015 14:06
Laundry Cam Setup Notes with Logitech C210 on Ubuntu 14.04 x64
<html>
<head>
<title>LaundryCam</title>
<link rel="apple-touch-icon-precomposed" href="./apple-touch-icon.png" />
<meta http-equiv="refresh" content="5">
</head>
<body>
<img src="./snap.jpg">
</body>
</html>
@nrrb
nrrb / notes.md
Last active October 22, 2015 15:37
Setting Up Anonymous Rotating Proxies With Tor

Running Your Own Anonymous Rotating Proxies

  • Install Ubuntu 14.04 x64

  • Install Tor: https://www.torproject.org/docs/debian.html.en

  • Install packages: sudo apt-get install build-essential

  • Change to superuser shell sudo su -

  • Create folder mkdir -p /opt/delegate && cd /opt/delegate

  • Download Delegate source wget http://www.delegate.org/anonftp/DeleGate/delegate9.9.11.tar.gz && tar xfz delegate9.9.11.tar.gz

  • Change directory to delegate source cd delegate9.9.11

@nrrb
nrrb / lxml_utils.py
Created September 19, 2014 19:53
Some utility functions for working with the Python module lxml when parsing HTML
from urlparse import urljoin
import lxml.html
def clean_xpath(path):
"""
When copying XPath from the developer console of Firefox or Chrome,
the browser inserts 'tbody' tags in table declarations which are
generally not there in the original source. These need to be removed
in order for lxml to work with said XPath expression.
@nrrb
nrrb / Preferences.sublime-settings
Last active August 29, 2015 14:06
Sublime Text Setup Notes
{
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.light.tmTheme",
"font_size": 11,
"ignored_packages":
[
],
"shift_tab_unindent": true,
"spacegray_sidebar_font_large": true,
"spacegray_sidebar_tree_large": true,
"spacegray_tabs_auto_width": true,
@nrrb
nrrb / notes.md
Last active August 29, 2015 14:06
Python Development Environment in Windows 8
@nrrb
nrrb / fives.txt
Last active August 29, 2015 14:05
Generating possible English word combinations for Wordlock-brand padlock.
AARON
AERIE
AHEAD
AHIND
AHINT
AHSAN
AHULL
AHUNT
AHUSH
AILIE
@nrrb
nrrb / summarize.py
Last active August 29, 2015 14:04
Image Metadata Extraction
# -*- coding: utf-8 -*-
# This doesn't use any Python libraries for extracting image metadata. Instead,
# it relies on the very handy exiftool utility and parsing the results.
# exiftool: http://www.sno.phy.queensu.ca/~phil/exiftool/
from __future__ import unicode_literals
import unicodedata
import subprocess
import csv
import os
import re
@nrrb
nrrb / BbhaJ.markdown
Last active August 29, 2015 14:00
A Pen by Nick Bennett.
@nrrb
nrrb / cut_zeroes_from_edgelist.py
Created March 21, 2014 02:14
A simple script to read an edgelist CSV file (each row is "vertex1,vertex2,value") and write to another edgelist file only the rows with non-zero values.
import csv
import sys
if __name__=="__main__":
if len(sys.argv) < 3:
print 'Syntax:'
print 'python {0} edgelist.csv output.csv'.format(__file__)
sys.exit(1)
input_row_count, output_row_count = 0, 0
@nrrb
nrrb / contractors.csv
Last active May 4, 2026 02:44
Scraping Chicago's Department of Buildings list of general contractors using selenium.
We can't make this file beautiful and searchable because it's too large.
Phone,Address,Lic Expr,Company Name,License Type
(773)342-1988,3966 WEST GRAND AVENUE  CHICAGO  IL 60651,06/24/2014,#1 QUALITY CHOICE INC,"E - $500,000 PROJECT CEILING"
(312)656-8984,1119 BLANCHAN AVE.  LA GRANGE PARK  IL 60526,06/20/2014,"(XRB) CONSTRUCTION SERVICES, LLC.","E - $500,000 PROJECT CEILING"
(312)256-4251,2210 N LAPORTE  CHICAGO  IL 60639,11/11/2014,"1 VISION CONSTRUCTION COMPANY, INC","E - $500,000 PROJECT CEILING"
(224)402-4282,1011 WOODLAND DR.  GLENVIEW  IL 60025,05/28/2014,"1-KJO HOLDING, LLC.","E - $500,000 PROJECT CEILING"
(773)342-8200,1001 NORTH MILWAUKEE AVENUE SUITE 400 CHICAGO  IL 60622,07/07/2014,1001 NORTH INCORPORATED,"D - $2,000,000 PROJECT CEILING"
(877)685-6095,5070 N. KIMBERLY AVE. UNIT C CHICAGO  IL 60630,11/24/2014,"123 REMODELING, INC","D - $2,000,000 PROJECT CEILING"
(773)842-9406,4919 N. MOBILE AVENUE  CHICAGO  IL 60630,01/18/2015,"1248 W GRACE, LLC","D - $2,000,000 PROJECT CEILING"
(630)327-4614,"1639 W. WALNUT STREET, UNIT 202  CHICAGO  IL 60612",08/27/2014