This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import interface | |
class IFoo(interface.Interface): | |
def foo(self): | |
"""foo this object.""" | |
class IBar(interface.Interface): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): | |
self.put(self._factory()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go install path/to/main -ldflags "-X path/to/main.commit $(git rev-parse HEAD)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun go-build () | |
"Build a go package" | |
(interactive) | |
(compile "go build")) | |
(defun go-test () | |
"Test a go packages" | |
(interactive) | |
(compile "go test -v")) | |
(defun go-vet () | |
"Vet a go package" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit -o nounset -o pipefail | |
function -h { | |
cat <<USAGE | |
USAGE: mesos-docker-setup | |
Installs tools for running Docker under Mesos with Marathon. | |
USAGE | |
}; function --help { -h ;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Deploy Ceph. | |
""" | |
import base64 | |
import ConfigParser | |
import os | |
import StringIO | |
import struct | |
import time |