Skip to content

Instantly share code, notes, and snippets.

ted kaemming tkaemming

Block or report user

Report or block tkaemming

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tkaemming
tkaemming / calls.sql
Created Jul 19, 2019
ClickHouse Table Schema for Tracking Call Timing and Similarity with Service Delegator
View calls.sql
CREATE TABLE calls (
-- Kafka Message Details
timestamp DateTime,
partition UInt8,
offset UInt64,
-- Call Signature
service String,
method String,
View gist:33a6fafaa009737c2007fd0905f89f90
Python 3.5.0 (default, Sep 23 2015, 04:42:00)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.72)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import six
>>> six.binary_type(10)
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
View stack.py
def foo():
bar()
def bar():
try:
baz()
except Exception as error:
import traceback
traceback.print_exc()
View tzinfo.py
>>> t = int(time.time())
>>> (int(datetime.datetime.utcfromtimestamp(t).strftime('%s')) - t) / 3600
8
>>> (int(datetime.datetime.utcfromtimestamp(t).replace(tzinfo=pytz.utc).strftime('%s')) - t) / 3600
8
@tkaemming
tkaemming / deobfuscate.py
Last active Dec 8, 2016
parse proguard mapping files in python
View deobfuscate.py
import pprint
import itertools
import operator
import sys
from collections import namedtuple
Class = namedtuple('Class', [
'old',
'new',
@tkaemming
tkaemming / read-payload.py
Created May 2, 2016
read a raw http payload (piped from from nc) for sentry and dump it as formatted json
View read-payload.py
import base64, json, sys, zlib
request = sys.stdin.read()
headers, payload = request.split('\r\n\r\n', 1)
result = json.loads(zlib.decompress(base64.b64decode(payload)))
sys.stdout.write(json.dumps(result, indent=2))
View drumkify.py
"""
makes text read like it was written by a drunk person
er, makes txet rea dlike i twas rwitten by a durnk persob
"""
import random
import sys
drinks = float(sys.argv[1])
You can’t perform that action at this time.