Skip to content

Instantly share code, notes, and snippets.

View casebeer's full-sized avatar

Christopher Casebeer casebeer

View GitHub Profile
@carsonmcdonald
carsonmcdonald / gist:911761
Created April 9, 2011 20:48
node.js SPDY proxy
var tls = require('tls');
var fs = require('fs');
var Buffer = require('buffer').Buffer;
var zlib = require('zlib');
var BufferList = require('bufferlist');
var Binary = require('bufferlist/binary');
var Put = require('put');
var http = require('http');
var options =
@twbell
twbell / factual_local_mappings.json
Created June 29, 2011 21:56
Provides a machine-readable mapping between Factual's Global Local Schema and country-specific attributes, denotes which attributes are supported within a specific country, and provides a country-to-table lookup
{
"countries": {
"ar": {
"country": "Argentina",
"table": "PfldJg",
"attributes": {
"factual_id": {
"supported": true,
"mapping": "Factual ID"
},
@juneym
juneym / elasticsearch.yml
Created July 8, 2011 00:30
custom analyzer nGram
index:
refresh_interval: 2
analysis:
analyzer:
ascAnalyzer1:
type: custom
tokenizer: "standard"
@nyergler
nyergler / maildir2mbox.py
Created January 31, 2012 05:39
Convert maildirs (including subfolders) to mbox format
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Frédéric Grosshans, 19 January 2012
Nathan R. Yergler, 6 June 2010
This file does not contain sufficient creative expression to invoke
assertion of copyright. No warranty is expressed or implied; use at
your own risk.
@shawn-sterling
shawn-sterling / graphite
Created February 14, 2012 21:30 — forked from drawks/graphite
Graphite on uwsgi/nginx
#This is the "site config" for nginx
upstream django {
# Distribute requests to servers based on client IP. This keeps load
# balancing fair but consistent per-client. In this instance we're
# only using one uWGSI worker anyway.
ip_hash;
server unix:/tmp/uwsgi.sock;
}
server {
@slinkp
slinkp / sched_icalendar.py
Created May 30, 2012 19:06
Convert PyGotham schedule into iCal format
"""
Parse the pygotham json schedule and make ical output
for use w/ google calendar, etc.
NOTE if you are going to serve the result, apparently google cal won't parse
it unless the header Content-Type: text/calendar is set!
Really useful for testing output: http://icalvalid.cloudapp.net
and http://severinghaus.org/projects/icv/
"""
@krolinventions
krolinventions / reddit-privacy.py
Created June 29, 2012 19:39 — forked from anonymous/reddit-privacy.py
Helps to ensure your privacy on reddit by cleaning up your old posts and comments. Intended to be used with cron.
#!/usr/bin/env python
# put your username and password here
USERNAME = ""
PASSWORD = ""
import urllib, urllib2, cookielib, json, sys, datetime
from optparse import OptionParser
# handle command line arguments
@abeluck
abeluck / gpg-offline-master.md
Last active October 22, 2023 02:59 — forked from KenMacD/cmd.md
GPG Offline Master Key w/ smartcard

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@kadin2048
kadin2048 / emlToMbox.py
Last active March 19, 2024 03:55
Combine a directory of .eml files into a single Unix "mbox" file.
#!/usr/bin/env python3
""" Converts a directory full of .eml files to a single Unix "mbox" file.
This is similar to http://www.cosmicsoft.net/emlxconvert.html
Accepts as input either an individual .eml file or a directory containing one
or more .eml files.
Usage:
$ ./emlToMbox.py inputdir/ output.mbox