Skip to content

Instantly share code, notes, and snippets.

View kbeckmann's full-sized avatar
💾

Konrad Beckmann kbeckmann

💾
View GitHub Profile
@danielkucera
danielkucera / recvlkv373.py
Created February 11, 2019 10:58
./recvlkv373.py 226.2.2.2 2068 out.mjpeg
#!/usr/bin/env python
import socket
import binascii
import sys
def main():
MCAST_GRP = sys.argv[1]
MCAST_PORT = int(sys.argv[2])
@marcan
marcan / xt256img.py
Last active September 28, 2022 19:11
Image to xterm-256 Unicode block art converter
#!/usr/bin/env python3
from __future__ import print_function
import sys, argparse, codecs
from PIL import Image, ImagePalette
xterm256colors = [ # http://pln.jonas.me/xterm-colors
0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x00,
0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xc0,
0x80, 0x80, 0x80, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00,
0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
@marcan
marcan / roca_test.py
Last active June 20, 2022 19:33
Non-obfuscated version of the ROCA Infineon RSA key test
#!/usr/bin/python
import sys
# Credit: https://crypto.stackexchange.com/questions/52292/what-is-fast-prime
generators = [
(2, 11), (6, 13), (8, 17), (9, 19), (3, 37), (26, 53), (20, 61), (35, 71),
(24, 73), (13, 79), (6, 97), (51, 103), (53, 107), (54, 109), (42, 127),
(50, 151), (78, 157),
]
@tony4d
tony4d / p4merge4git.md
Created August 24, 2012 19:00
Setup p4merge as a visual diff and merge tool for git
@rgov
rgov / debruijn.py
Last active November 14, 2023 07:37
de Bruijn sequence generator
def deBruijn(n, k):
'''
An implementation of the FKM algorithm for generating the de Bruijn
sequence containing all k-ary strings of length n, as described in
"Combinatorial Generation" by Frank Ruskey.
'''
a = [ 0 ] * (n + 1)
def gen(t, p):