Skip to content

Instantly share code, notes, and snippets.

@jrheling
jrheling / yourapp
Created June 12, 2018 14:54 — forked from leplatrem/yourapp
gunicorn virtualenv init.d script (could be simpler with upstart)
#! /bin/bash
### BEGIN INIT INFO
# Provides: YOURAPP
# Required-Start: nginx
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The main gunicorn process for YOURAPP
# Description: The gunicorn process that receives HTTP requests
# from nginx and proxies them to YOURAPP.
@jrheling
jrheling / dash-react.py
Last active January 1, 2016 18:33 — forked from eob/dash-listen-2.py
Simple script to watch for and react to Amazon Dash button pushes.
#!/usr/bin/python
# based on https://medium.com/@edwardbenson/how-i-hacked-amazon-s-5-wifi-button-to-track-baby-data-794214b0bdd8
#
# This is a quick hack. As such, it:
# * lacks exception handling
# * has no pretense of object orientation
# * needs root privs (for network monitoring) but doesn't do anything
# to make that safe (e.g. drop privs, etc.)
# * gets configured manually (see below)