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 python | |
""" | |
How to use it: | |
1. Just `kill -2 PROCESS_ID` or `kill -15 PROCESS_ID` , The Tornado Web Server Will shutdown after process all the request. | |
2. When you run it behind Nginx, it can graceful reboot your production server. | |
3. Nice Print in http://weibo.com/1682780325/zgkb7g8k7 | |
""" |
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
# -*- coding: utf-8 -*- | |
# 14/12/16 | |
# create by: snower | |
import sys | |
import time | |
import re | |
import logging | |
import traceback | |
from tornado.ioloop import IOLoop |
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
# -*- coding: utf-8 -*- | |
# 14-9-20 | |
# create by: snower | |
import linecache | |
import sys | |
import types | |
__all__ = ['extract_stack', 'extract_tb', 'format_exception', | |
'format_exception_only', 'format_list', 'format_stack', |
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
# -*- coding: utf-8 -*- | |
# 15/1/16 | |
# create by: snower | |
import time | |
import greenlet | |
import threading | |
m = greenlet.getcurrent() |
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
# -*- coding: utf-8 -*- | |
# 14-8-20 | |
# create by: snower | |
import os | |
import time | |
import multiprocessing | |
from logging.handlers import RotatingFileHandler, TimedRotatingFileHandler | |
class RotatingFileHandler(RotatingFileHandler): |
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
# -*- coding: utf-8 -*- | |
# 15/8/21 | |
# create by: snower | |
import sys | |
import time | |
import sevent | |
import logging | |
import traceback |
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
// main | |
package main | |
import ( | |
"fmt" | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
"sync" | |
"time" | |
) |
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
nc64.exe 192.168.199.109 5000 | "C:\Program Files\Wireshark\Wireshark.exe" -k -S -i - |
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
# -*- coding: utf-8 -*- | |
# 15/5/21 | |
# create by: snower | |
import sys | |
import logging | |
from sevent import tcp | |
from sevent import current | |
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)1.1s %(message)s', datefmt='%Y-%m-%d %H:%M:%S', filemode='a+') |
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
# -*- coding: utf-8 -*- | |
# 15/10/29 | |
# create by: snower | |
import sys | |
import os | |
import shlex | |
import subprocess | |
def run_command(command): |
OlderNewer