ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
sudo apt-get install debootstrap dchroot | |
mkdir tmp-os | |
sudo debootstrap --arch i386 --variant=minbase stable os-tmp http://ftp.debian.org/debian/ | |
sudo chroot os-tmp /bin/bash | |
apt-get update && apt-get install curl vim mc wget |
# This enables a publicly available server to forward connections to your computer behind a NAT. | |
# So if you access http://xx.xx.xx.xx:8080/ on your browser, traffic is redirected to your machine behind a NAT. | |
# on your local host, type: | |
ssh -R xx.xx.xx.xx:8888:localhost:80 [email protected] | |
# now wait for your shell, and type: | |
socat TCP-LISTEN:8080,FORK TCP:127.0.0.1:8888 | |
# This command outputs nothing, just keep it running. While you don't ^C, your tunnel is up and running! |
from __future__ import absolute_import | |
import signal | |
import gevent | |
import gevent.pool | |
from rq import Worker | |
from rq.timeouts import BaseDeathPenalty, JobTimeoutException | |
from rq.worker import StopRequested, green, blue | |
from rq.exceptions import DequeueTimeout |
#!/usr/bin/python | |
from silk import * | |
import json | |
import random | |
import datetime | |
import time | |
def strTimeProp(start, end, format, prop): | |
stime = time.mktime(time.strptime(start, format)) | |
etime = time.mktime(time.strptime(end, format)) |
{ | |
"event_id": 10750, | |
"sensor": { | |
"name": "snorby.org", | |
"interface": "eth0", | |
"id": 0, | |
"filter": null, | |
"encoding": null, | |
"detail": null | |
}, |
# Alt 1: very explicit, but requires knowledge on what type of workers exist | |
from rq.workers.gevent import GeventWorker | |
w = GeventWorker(4) | |
# Alt 2: A bit like an "Abstract Factory", no need for knowing the implementing | |
# class names, backward compatible, and kind='forking' by default | |
from rq import Worker | |
w = Worker(4, kind='gevent') | |
# Alt 3: I don't think (2) works without really nasty tricks. This one is as |
(This gist is pretty old; I've written up my current approach to the Pyramid integration on this blog post, but that blog post doesn't go into the transactional management, so you may still find this useful.)
I've created a Pyramid scaffold which integrates Alembic, a migration tool, with the standard SQLAlchemy scaffold. (It also configures the Mako template system, because I prefer Mako.)
I am also using PostgreSQL for my database. PostgreSQL supports nested transactions. This means I can setup the tables at the beginning of the test session, then start a transaction before each test happens and roll it back after the test; in turn, this means my tests operate in the same environment I expect to use in production, but they are also fast.
I based my approach on [sontek's blog post](http://sontek.net/blog/
#!/usr/bin/env python | |
from gevent import monkey | |
monkey.patch_all() | |
import sys | |
import redis | |
import urllib2 | |
import traceback | |
from cgi import escape | |
# -- gsdproxy |