- deploy with deb packages
- no daemon (rely on an external process manager)
- log into syslog
This file contains 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
start on runlevel [2345] | |
stop on runlevel [06] | |
pre-start script | |
start mongodb-node replset=rs_local_a port=27017 | |
start mongodb-node replset=rs_local_a port=27117 | |
start mongodb-node replset=rs_local_a port=27217 | |
sleep 3 | |
mongo localhost:27017 /etc/mongo-initiate-localrs.js |
I hereby claim:
- I am pior on github.
- I am pior (https://keybase.io/pior) on keybase.
- I have a public key whose fingerprint is 5F09 D929 05A5 B510 0A7C 57A1 35B8 10EC AA42 DE4C
To claim this, I am signing this object:
This file contains 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
Logstash 1.4.2 snippet |
This file contains 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
dev=# create table pior.event_stage ( | |
event_id CHAR(56), | |
user_id VARCHAR(20), | |
session_id VARCHAR(32), | |
ts timestamp NOT NULL DEFAULT sysdate | |
) ; | |
CREATE TABLE | |
dev=# insert into pior.event_stage VALUES ('event_123', 'user_123', 'session_123'); | |
INSERT 0 1 |
This file contains 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 os | |
from pyramid.config import Configurator | |
def main(global_config, **settings): | |
settings = {k: os.path.expandvars(v) for k, v in settings.items()} | |
config = Configurator(settings=settings) | |
config.include(__name__) | |
return config.make_wsgi_app() |
This file contains 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 base64 | |
import random | |
from binascii import unhexlify, b2a_base64 | |
def long_to_bytes (val): | |
""" | |
Use :ref:`string formatting` and :func:`~binascii.unhexlify` to | |
convert ``val``, a :func:`long`, to a byte :func:`str`. |
This file contains 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
def make_bcp47_language_tag_re(): | |
""" | |
Reference: http://www.rfc-editor.org/rfc/bcp/bcp47.txt# | |
Validator: http://schneegans.de/lv/ | |
""" | |
regular = (r"(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka" | |
"|zh-min|zh-min-nan|zh-xiang)") | |
irregular = (r"(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon" | |
"|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR" | |
"|sgn-BE-NL|sgn-CH-DE)") |
This file contains 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
from gevent.monkey import patch_all | |
patch_all() | |
import sys | |
import time | |
import gevent | |
import requests | |
import logging |
This file contains 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
""" | |
ARC implementation | |
Based on | |
http://code.activestate.com/recipes/576532-adaptive-replacement-cache-in-python/ | |
Original Paper | |
https://www.usenix.org/legacy/events/fast03/tech/full_papers/megiddo/megiddo.pdf | |
Warning: patented by IBM |
OlderNewer