Skip to content

Instantly share code, notes, and snippets.

@weining-da
weining-da / pretty_message.py
Last active September 7, 2020 22:32
parse ingress message
#!/usr/bin/env python3
import re
import sys
def main(s):
s = s.replace('{', ' { ').replace('}', ' } ').replace(',', ' , ')
tags = re.findall(r'"<.+/>"', s)
tag_dict = dict()
@weining-da
weining-da / prof_wrangler.py
Created June 18, 2020 02:46
generate gprof-like stats (work in progress)
#!/usr/bin/env python3
import os
import json
import collections
import multiprocessing
import typing
dirp = '/tmp/prof'