Skip to content

Instantly share code, notes, and snippets.

Avatar

Nate Oostendorp oostendo

View GitHub Profile
View gist:abd08f4fba2c19eda872556e50098dc9
### Keybase proof
I hereby claim:
* I am oostendo on github.
* I am noostendorp (https://keybase.io/noostendorp) on keybase.
* I have a public key ASCgRplakofZfv-3ERk1uNTBsUUFNs4MWx_5joqaJxCfvwo
To claim this, I am signing this object:
View sslog2csv.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View fluidsynth.service
[Unit]
Description=Fluidsynth
[Service]
Type=forking
# The PID file is optional, but recommended in the manpage
# "so that systemd can identify the main process of the daemon"
PIDFile=/var/run/fluidsynth.pid
ExecStart=/home/pi/bin/fluidsynth_service.sh start
View fluidsynth_service.sh
#!/bin/sh
# start/stop service and create pid file for a non-daemon app
# from https://blog.sleeplessbeastie.eu/2014/11/04/how-to-monitor-background-process-using-monit/
# service command
service_cmd="nice -n -19 fluidsynth -is --audio-driver=alsa /usr/share/sounds/sf2/FluidR3_GM.sf2"
# pid file location
service_pid="/var/run/fluidsynth.pid"
View pip.conf
[global]
no-index = true ; comment this line out if you need to bypass the mirror
find-links = https://sm-mirror.s3-us-west-2.amazonaws.com/pip/index.html
View paypal_to_quickbooks_csv.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:7b9c995650e89cec24ac
sudo apt-get install mongodb-org=2.6.7 mongodb-org-server=2.6.7 mongodb-org-shell=2.6.7 mongodb-org-mongos=2.6.7 mongodb-org-tools=2.6.7
@oostendo
oostendo / gist:6758300
Created Sep 30, 2013
quick python script for converting massive gmail contacts to iphone-friendly address book requires vobject (sudo easy_install vobject). Note this failed on a few unicode contacts which I had to remove from the VCF file manually.
View gist:6758300
import vobject
vcfdata = open("Downloads/00001.vcf").read()
out = open("Downloads/scrubbed.vcf", 'w')
contacts = vobject.readComponents(vcfdata)
done = False
while not done:
try:
contact = contacts.next()
@oostendo
oostendo / gist:6627956
Last active Dec 23, 2015
sip forwarding with twilio
View gist:6627956
# sip.php
#
# quick and dirty outbound routing for sip phones with Twilio
#
# in your twilio sip tab
# set up your sip domain (DOMAIN.sip.twilio.com)
# register credentials for the username as the callback number with no spaces or +1 eg "3135551212" and set password
# validate the callback number
# set this script to the voice url
# set your sip client to authenticate with CALLBACKNUMBER/PASSWORD and host DOMAIN.sip.twilio.com
@oostendo
oostendo / gist:5978514
Created Jul 11, 2013
Polygon approximation for a contour segement with a given number of sides
View gist:5978514
def fixedPoly(contour, polysides = 8):
opencv_contour = contour.reshape(-1, 1, 2)
higherr = 50.0
lowerr = 1.0
tryerr = 25.0
poly = []
#binary search polygon approximations until we get a 4 point polygon
maxiterations = 100
while len(poly) != polysides and maxiterations: