Skip to content

Instantly share code, notes, and snippets.

Ian Schenck ianschenck

Block or report user

Report or block ianschenck

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ianschenck / dhcp
Created Aug 3, 2016
Captive Portal on TP-Link TL-WA7210N using CHAOS CALMER (15.05.1, r48532), Files under /etc/config/
View dhcp
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
import interface
class IFoo(interface.Interface):
def foo(self):
"""foo this object."""
class IBar(interface.Interface):
ianschenck /
Last active Aug 29, 2015
Run twisted wsgi like an old-school, socket sharing fcgi subprocess
# Many very old fcgi containers had a trick probably inherited from old
# inetd, where a socket is syscall dup2'd onto fd 0 of a subprocess.
# The parent creates and binds the socket while the children then just
# listen on it.
# Something to note is that supervisord provides this facility with its
# [fcgi-program] configuration section. The benefit here is simple inet
# or fcgi style graceful restarts. Anyhow, here is how you grab a
# socket that is fd 0 and start your twisted wsgi container on it. The
# wsgi application here is `application`.
ianschenck /
Last active Jan 25, 2020
Run your flask app under twisted wsgi, ALWAYS.
if __name__ == "__main__":
reactor_args = {}
def run_twisted_wsgi():
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.wsgi import WSGIResource
resource = WSGIResource(reactor, reactor.getThreadPool(), app)
site = Site(resource)
class Pool(object):
def __init__(self, factory, size, finalizer=None):
self._factory = factory
self._finalizer = finalizer or lambda x: None
self._pool = list()
self._pool_sema = threading.Semaphore()
for _ in range(size):
View stamp_version_ldflags
go install path/to/main -ldflags "-X path/to/main.commit $(git rev-parse HEAD)"
View go-misc.el
(defun go-build ()
"Build a go package"
(compile "go build"))
(defun go-test ()
"Test a go packages"
(compile "go test -v"))
(defun go-vet ()
"Vet a go package"
ianschenck / gist:7238329
Last active Dec 27, 2015
Mesos/Marathon/Docker on 12.04 with 3.8+ kernel.
View gist:7238329
set -o errexit -o nounset -o pipefail
function -h {
cat <<USAGE
USAGE: mesos-docker-setup
Installs tools for running Docker under Mesos with Marathon.
}; function --help { -h ;}
ianschenck /
Created Aug 2, 2013
Fabric file to setup ceph quicky.
Deploy Ceph.
import base64
import ConfigParser
import os
import StringIO
import struct
import time
You can’t perform that action at this time.