Skip to content

Instantly share code, notes, and snippets.

import ipaddress
import os
import socket
import subprocess
def parse_ip_port(c):
ip_h, port_h = c.split(":")
return str(ipaddress.IPv4Address(socket.htonl(int(ip_h, 16)))), int(port_h, 16)
const uint32_t CONNECTIONLESS_HEADER = 0xFFFFFFFF;
const uint8_t A2S_GETCHALLENGE = 'q';
const uint8_t S2C_CHALLENGE = 'A';
const uint8_t C2S_CONNECT = 'k';
const uint8_t S2C_CONNECTION = 'B';
const uint32_t PROTOCOL_HASHEDCDKEY = 0x02;
const uint32_t PROTOCOL_STEAM = 0x03;
@Yepoleb
Yepoleb / ytmusic.py
Last active November 4, 2023 05:19
Youtube Music downloader with automatic ID3 tagging. Uses mutagen and requests.
#!/usr/bin/env python3
# License: GPLv3
import re
import json
import shutil
import subprocess
import sys
import urllib.parse
@Yepoleb
Yepoleb / dxrextract.py
Created August 30, 2016 02:00
Attempt to extract images from Macromedia Director dxr/dir files
import struct
import collections
import PIL.Image
# Attempt to extract images from Macromedia Director dxr/dir files
PATH = "ber.dxr"
CHUNK_FMT = ">4sL"
CHUNK_SIZE = struct.calcsize(CHUNK_FMT)
# Compile: nim c --mm:arc --threads:on --threadanalysis:off threadbugs.nim
import threadpool
type
DataItem = object
value: int
ContainerItem = object
data: ref DataItem
import dynlib
type
PixelRgba = object
r, g, b, a: uint8
Image = ref object of RootObj
width: int
height: int
@Yepoleb
Yepoleb / labyrinth.nim
Created July 12, 2021 16:27
Labyrinth generator in nim
import random
type
TileType = enum
wall, path
Direction = enum
north, east, south, west
Playfield = object
@Yepoleb
Yepoleb / bonus_del.py
Created July 7, 2021 13:52
Query GOG DB index for removed bonus content
import sqlite3
import datetime
import json
import csv
import sys
INDEX_PATH = "gogdb_index.sqlite3"
START_DATE = "2021-01-12"
conn = sqlite3.connect(INDEX_PATH)
# Compile: gcc aoc_day1.s -nostdlib -fPIC -o aoc_day1
.intel_syntax noprefix
.data
.section .rodata
filename:
.string "input_1.txt"
errormsg_open:
.string "Failed to open file\n"
.set errormsg_open_len, . - errormsg_open - 1
Pernauer Chemiewerke products and their detergemtinfo.at number.
http://www.detergentinfo.at/PR<num>.php
51 Clever Glasreiniger 1000ml
102 Clever Weichspüler Wildrose 1,5l
103 Clever Weichspüler Wasserlilie 1,5l
125 Clever Allzweckreiniger 1000ml
164 bi good Allzweckreiniger 1000ml
165 bi good Badreiniger 500mL
166 bi good Glasreiniger 500mL