Skip to content

Instantly share code, notes, and snippets.

@Lekensteyn
Lekensteyn / modules.py
Last active November 8, 2023 10:10
Print a table with enabled nginx modules https://wiki.debian.org/Nginx
#!/usr/bin/env python
#
# Prints information about modules, whether these are enabled or not.
# The goal is to quickly find whether a module appears in some package
# variant for some distro version.
#
# Written for use in https://wiki.debian.org/Nginx
#
# The resulting table should appear as:
#
@Lekensteyn
Lekensteyn / nvml-debugdump.c
Last active April 15, 2024 18:00
Make libnvidia-ml.so (nvidia-smi) write plaintext debug logs (mirror of https://lekensteyn.nl/files/nvml-debugdump.c)
/**
* Make libnvidia-ml.so (nvidia-smi) write plaintext debug logs.
*
* Usage:
*
* gcc -shared -fPIC -ldl nvml-debugdump.c -o nvml-debugdump.so
* LD_PRELOAD=./nvml-debugdump.so nvidia-smi --debug=debug.log -q
*
* For other NVML applications, set env var __NVML_DBG_FILE=debug.log
*
@Lekensteyn
Lekensteyn / inject-tls-secrets.py
Last active April 30, 2024 10:40
Extracts a subset of TLS secrets and injects them in an existing capture file (requires Wireshark 3.0).
#!/usr/bin/env python3
# Extracts a subset of TLS secrets and injects them in an existing capture file.
#
# Author: Peter Wu <peter@lekensteyn.nl>
import argparse
import os
import shlex
import subprocess
import sys