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
| #!/usr/bin/env python | |
| from urllib2 import urlopen | |
| class TooBig(Exception): pass | |
| def download(url, max_size): | |
| fo = urlopen(url) | |
| size = int(fo.headers.get("Content-Length", 0)) | |
| if size and (size > max_size): |
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
| server { | |
| listen 4433; | |
| server_name localhost; | |
| location / { | |
| proxy_pass http://localhost:5984; | |
| proxy_intercept_errors on; | |
| proxy_redirect off; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; |
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 | |
| if [ $# -ne 1 ]; then | |
| echo "usage: $(basename $0) DB" | |
| exit 1 | |
| fi | |
| case $1 in | |
| -h | --help ) echo "usage: $(basename $0) DB"; exit;; | |
| esac |
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
| from collections import deque | |
| from cherrypy import expose | |
| stdout = deque() | |
| def log(message): | |
| stdout.append(message) | |
| class WebServer: |
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
| def stdout_readline(process): | |
| return process.stdout.readline() | |
| def make_web_readline(url): | |
| def web_readline(process): | |
| return urlopen(url).read() | |
| return web_readline | |
| def run_logger(server_process, name, readline): |
OlderNewer