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
/root@tango56:~# diff -u /usr/local/lib/python2.7/dist-packages/gunicorn/config.py.orig /usr/local/lib/python2.7/dist-packages/gunicorn/config.py | |
--- /usr/local/lib/python2.7/dist-packages/gunicorn/config.py.orig 2014-08-11 16:15:36.000000000 +0000 | |
+++ /usr/local/lib/python2.7/dist-packages/gunicorn/config.py 2014-08-11 16:08:26.000000000 +0000 | |
@@ -906,6 +906,7 @@ | |
class ForwardedAllowIPS(Setting): | |
name = "forwarded_allow_ips" | |
section = "Server Mechanics" | |
+ cli = ["--forwarded-allow-ips"] | |
meta = "STRING" | |
validator = validate_string_to_list |
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
#!/usr/bin/python | |
import os | |
import sys | |
import select | |
class AsyncLineReader(object): | |
BUFSIZE = 4096 |
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
#!/usr/bin/python | |
import json | |
import tornado.gen | |
import tornado.ioloop | |
import tornado.web | |
from futures import ProcessPoolExecutor | |
from solariat_nlp import classify_content | |
def do_work(msg): |
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
#!/usr/bin/python3 | |
import sys | |
import itertools | |
from datetime import datetime | |
def main(s): | |
" find earliest possible legal date or raise ValueError " |
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
#!/usr/bin/python3 | |
""" | |
os.walk traversal problem | |
""" | |
import os | |
import sys | |
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
def counts(nums, maxes): | |
_nums = sorted(nums) | |
_maxes = sorted(maxes) | |
count = 0 | |
res = {} | |
n = None | |
m = None |
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
#!/usr/bin/env python3 | |
from mongoengine import Document, IntField, StringField, connect | |
connect('test') | |
class ChatUser(Document): | |
_access = IntField() # internal access counter | |
chat_id = IntField(required=True, unique=True) |
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 | |
import time | |
import logging | |
from datetime import datetime | |
import pymongo | |
from mongoengine.connection import DEFAULT_CONNECTION_NAME, get_db | |
logger = logging.getLogger(os.path.basename(__file__)) |
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
#!/usr/local/bin/python3 | |
import os | |
import logging | |
logger = logging.getLogger(__name__) | |
def commonpath(d1, d2): | |
" returns the length of longest common leading component " |
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
#!/usr/bin/python3 | |
import os | |
import uuid | |
import psutil | |
RELEASE_MEMORY = True | |
def get_rss_memory(): | |
p = psutil.Process(pid=os.getpid()) |
OlderNewer