Skip to content

Instantly share code, notes, and snippets.

View nbari's full-sized avatar
🌱

nbari

🌱
View GitHub Profile
@nbari
nbari / gist:5626790
Created May 22, 2013 11:06
restart process
import multiprocessing
import time
def worker(num):
print 'worker:', num
@nbari
nbari / gist:5611685
Created May 20, 2013 11:19
nginx log parser
#!/usr/bin/env python
"""
nginx log format
log_format main '$server_name | $host | $remote_addr | $bytes_sent | $time_local | $request_method | $request_uri | $request_time | $status | $http_referer | $http_x_forwarded_for | $http_user_agent | $gzip_ratio | $connection';
"""
import os
import sys
import time