Skip to content

Instantly share code, notes, and snippets.

@wannyk
wannyk / _service.md
Last active August 17, 2016 08:58 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@wannyk
wannyk / gevent-multiprocess.py
Created November 6, 2015 06:43 — forked from denik/gevent-multiprocess.py
gevent-multiprocess
import sys
from gevent import server
from gevent.server import _tcp_listener
from gevent.monkey import patch_all; patch_all()
from multiprocessing import Process, current_process, cpu_count
def note(format, *args):
sys.stderr.write('[%s]\t%s\n' % (current_process().name, format%args))