Skip to content

Instantly share code, notes, and snippets.

View asantoni's full-sized avatar

Albert Santoni asantoni

View GitHub Profile
@jhorneman
jhorneman / Logging to a web page
Created July 26, 2012 09:18
Some code snippets showing how one could send logging output to a web page in Python
# web_page_logger.py
import logging
class WebPageHandler(logging.Handler):
def __init__(self):
logging.Handler.__init__(self)
self.messages = []
def emit(self, record):
@tonyc
tonyc / gist:1384523
Last active June 3, 2024 15:34
Using strace and lsof

Using strace and lsof to debug blocked processes

You can use strace on a specific pid to figure out what a specific process is doing, e.g.:

strace -fp <pid>

You might see something like:

select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)