start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/bash | |
# Configration | |
MYSQL=/usr/bin/mysql | |
TPCCLOAD=./tpcc_load | |
TABLESQL=./create_table.sql | |
CONSTRAINTSQL=./add_fkey_idx.sql | |
DEGREE=`getconf _NPROCESSORS_ONLN` |
I hereby claim:
To claim this, I am signing this object:
import os, time | |
def is_locked(filepath): | |
"""Checks if a file is locked by opening it in append mode. | |
If no exception thrown, then the file is not locked. | |
""" | |
locked = None | |
file_object = None | |
if os.path.exists(filepath): | |
try: |
# -*- coding: utf-8 -*- | |
import os | |
from datetime import datetime | |
from binascii import crc32 | |
import cPickle as pickle | |
from glob import glob | |
TABLE = {} | |
current_active = max([int(f.replace('.sst', '')) for f in glob('*.sst')] or [1]) |
#!/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. | |
""" | |
import time |
#!/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 | |
""" |
#!/usr/bin/env python2.7 | |
from threading import Event | |
exit = Event() | |
def main(): | |
while not exit.is_set(): | |
do_my_thing() | |
exit.wait(60) |
#!/usr/bin/env python2.7 | |
from threading import Event | |
exit = Event() | |
def main(): | |
while not exit.is_set(): | |
do_my_thing() | |
exit.wait(60) |