Skip to content

Instantly share code, notes, and snippets.

@kevinquinnyo
kevinquinnyo / badproc.py
Created August 14, 2011 21:31
isolate time range from apache log file(s)
#!/usr/bin/python
import sys
import re
import time
from datetime import timedelta, datetime
now = datetime.now()
d_format = '%d/%b/%Y:%H:%M'
try:
back_minutes = timedelta(minutes=int(sys.argv[2])) #no more trash var
raw_bad_process_time = now.strftime('%d/%b/%Y:') + sys.argv[1] #gets d/m/y
@kevinquinnyo
kevinquinnyo / fuck.html.erb
Created June 20, 2011 03:02
this doesn't work
#pages_controller
def home
@places = Place.all
@stories = Story.all
...