Skip to content

Instantly share code, notes, and snippets.

@joodicator
joodicator / parse.py
Created August 24, 2017 05:09
Minecraft Wireshark YAML TCP stream parser
#!/usr/bin/env python
"""
Requires pyCraft <https://github.com/ammaraskar/pyCraft>
and pyYAML <https://pypi.python.org/pypi/PyYAML>.
Usage: ./parse.py stream1.yml [stream2.yml ...]
or: ./parse.py < stream1.yml
Input files are TCP streams of *unencrypted* Minecraft connections
@joodicator
joodicator / parse.py
Created May 17, 2018 01:41
Analyse Minecraft Wireshark YAML TCP stream dumps using pyCraft
#!/usr/bin/env python
from __future__ import print_function
import sys
import os
import re
import io
import base64
import zlib
from threading import Condition
import traceback
import time
from minecraft.networking.connection import Connection
from minecraft.networking.packets import clientbound, serverbound
from minecraft.networking.types import (
Position, PositionAndLook, RelativeHand, BlockFace,
)
@joodicator
joodicator / estimate_scrabble_word_count.py
Created November 4, 2021 17:55
estimate_scrabble_word_count.py
from itertools import combinations
from functools import reduce
from operator import mul
from math import factorial, perm
from collections import Counter
import re
# English letter frequencies from
# <https://en.wikipedia.org/wiki/Letter_frequency>.
eng_letter_freqs = {