Skip to content

Instantly share code, notes, and snippets.

View Mikael-Lovqvist's full-sized avatar

Mikael Lövqvist Mikael-Lovqvist

View GitHub Profile
@Mikael-Lovqvist
Mikael-Lovqvist / trace_task.py
Last active October 7, 2021 22:57
Python script for gdb, uses procfs to monitor task state then stores timestamp and backtrace to file
import pathlib, re, time
line_pattern = re.compile(r'(.*?):\s+(.*)')
'''
Example usage, note that MODULE is this file and is in the directory you run gdb from
Note that gdb needs root privs
# gdb /bin/subl3 -p $(pidof subl3)
@Mikael-Lovqvist
Mikael-Lovqvist / identity_tracking_demo.py
Last active September 15, 2021 20:07
2021-09-15 Video Log - identity tracking in Python
#This is a demo for VLOG entry https://youtu.be/LfRFxkombTw "Python - track object identities [short]"
greek_alphabet = ['Άλφα', 'Βήτα', 'Γάμμα', 'Δέλτα', 'Έψιλον', 'Ζήτα', 'Ήτα', 'Θήτα', 'Ιώτα', 'Κάππα', 'Λάμβδα', 'Μυ', 'Νυ', 'Ξι', 'Όμικρον', 'Πι', 'Ρώ', 'Σίγμα', 'Ταυ', 'Ύψιλον', 'Φι', 'Χι', 'Ψι', 'Ωμέγα']
class identity_reference:
def __init__(self, target):
self.target = target
self.id = id(target)
try: