Skip to content

Instantly share code, notes, and snippets.

@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 / push-go-crypto.sh
Created September 5, 2017 11:54
Extracts commits from the src/crypto/tls/ directory (from Go upstream) in a reproducible way, preserving all metadata (including committer info).
#!/bin/bash
# Extracts commits from the src/crypto/tls/ directory (from Go upstream) in a
# reproducible way, preserving all metadata (including committer info).
#
# Strategy:
# 0. Create a new temporary working repo.
# 1. Fetch go branch/commit that should be pulled from.
# 2. Rewrite history of go branch, extracting just the src/crypto/tls/ commits.
# 3. Push the updated branch back to tls-tris.
@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