Follow these steps to install graphite on OS X Lion.
- Python 2.7
- Brew
- Git
| """ | |
| Usage: | |
| import debug | |
| class BaseHandler(tornado.web.RequestHandler): | |
| def get_error_html(self, status_code, **kwargs): | |
| if self.application.settings['debug']: | |
| return debug.display(self, kwargs['exception']) |
| ''' | |
| Copyright 2010 Josiah Carlson | |
| Released into the public domain | |
| copy_redis.py | |
| A convenient utility function for copying data from one redis server to | |
| another. | |
| Requires http://github.com/andymccurdy/redis-py . |
| socket.on('connection', function(client){ | |
| // helper function that goes inside your socket connection | |
| client.connectSession = function(fn) { | |
| if (!client.request || !client.request.headers || !client.request.headers.cookie) { | |
| disconnectAndRedirectClient(client,function() { | |
| console.log('Null request/header/cookie!'); | |
| }); | |
| return; | |
| } |
| Setup | |
| ===== | |
| [stunnel acccept port 443 connect 8443] | |
| || | |
| [haproxy | |
| * accept port 80 | |
| default: connect 8080 (nginx) | |
| host: 'push.*' => connect 8090 (node) | |
| * accept port 8443 |
| #include <assert.h> | |
| #include <stdint.h> | |
| #include <algorithm> | |
| #include <vector> | |
| using namespace std; | |
| struct IPrange | |
| { |
| # encoding: utf-8 | |
| """ | |
| A python logging Handler that use ZeroMQ (ØMQ). | |
| +------+ +------+ +-------+ | |
| | app1 | | app2 | | app X | | |
| +------+ +------+ +-------+ | |
| | PUSH | PUSH | PUSH | |
| | | | |
| #!/bin/sh | |
| wget https://github.com/rg3/youtube-dl/zipball/master -O youtube-dl.zip | |
| unzip youtube-dl.zip | |
| cd rg3-youtube-dl-ceba827/ | |
| python youtube-dl --batch-file ../pycon2012_video_urls.txt |
| import gevent | |
| from thrift.server.TServer import TServer | |
| # XXX Hackish, but should be safe: monkey patch gevent socket support into | |
| # Thrift. Overall I think this is cleaner than reimplementing all of TSocket. | |
| from thrift.transport import TSocket; TSocket.socket = gevent.socket | |
| from thrift.transport.TTransport import TTransportException | |
| class TGEventServer(TServer): | |
| """Gevent socket server.""" |