Skip to content

Instantly share code, notes, and snippets.

View kbourgoin's full-sized avatar

Keith Bourgoin kbourgoin

View GitHub Profile
@amontalenti
amontalenti / tb.py
Created August 8, 2014 05:31
extract Python Traceback from log files (based on https://gist.github.com/originell/1923003)
"""
Extract unique Python-Exceptions with their Traceback from a log/text file.
Usage::
python extract_exceptions.py -f logfile.txt
Furthermore it supports excluding exceptions you don't want to have::
@kbourgoin
kbourgoin / logging_snippet.py
Created April 3, 2013 22:26
Useful for turning on logging quickly
formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(name)s - %(message)s')
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
handler.setFormatter(formatter)
root_logger = logging.getLogger()
root_logger.addHandler(handler)
root_logger.setLevel(logging.INFO)
@jessor
jessor / github irc service hook optimization
Created January 30, 2011 23:54
this is how you can omit having join/parts of github's irc bot in your channel
1. Set your channel invite only but allow messages from outside:
/mode #yourchannel +i-n
2. Set an inite exception for any user whose ident is longer than two chars, this
/mode #yourchannel +I *!??*@*
3. In the repository administration, give the irc bot a nick like 'G'