Skip to content

Instantly share code, notes, and snippets.

@BitFis
BitFis / cmake-variables
Last active August 5, 2022 13:37
Convert cmake variables to a markdown with bash
#!/bin/bash
# Copyright (C) 2022 Lucien Zuercher <[email protected]>
# SPDX-License-Identifier: MIT
set -e
export CMAKE_COMMAND=${CMAKE_COMMAND:-"cmake"}
color_error="\e[0;91m"
color_reset="\e[0m"
@Kas-tle
Kas-tle / extract-heads.sh
Last active January 22, 2023 02:45
Extract tile heads from a minecraft world
# Depends on:
# sudo apt install libjson-perl
# sudo apt install libcompress-raw-zlib-perl
if [[ ! -d world ]]; then
tar -xf ${1} world
fi
if [[ ! -d run ]]; then
git clone https://github.com/MirrgieRiana/nbt_to_json_perl.git run
@rlaphoenix
rlaphoenix / mitm_decrypt_enc_client_id.py
Last active May 30, 2025 13:04
Recover Client ID from most Widevine License Servers, CDM Implementations, and CDM APIs (if forcing privacy mode)
"""
Super trivial 'exploit' to Recover Client IDs from Challenges where it's Encrypted by Privacy Mode.
This can be done on 90% of third-party CDM Implementations, APIs, Proxies. It might work on some
license servers which they use their own certificate, but only if they forget to verify the signature
of the service certificate. So this wont work on any License Server that proxies to Google's Server.
The attack effectively boils down to the missing verification of Service Certificate signatures.
So just replace the public key of a service cert with one you have the private key for, and then
give it that. Now you can decrypt.
@xrat
xrat / sshpingpong
Last active March 16, 2023 21:44
Calculate time needed to send 1 byte back and forth within an SSH connection
#!/bin/bash
#
me=sshpingpong
#
# Measure close to minimal packet latency (RTT) of an SSH connection
#
prgversion="$me * 2022-07-27 (c) Andreas Schamanek"
#
# @author Andreas Schamanek <https://andreas.schamanek.net>
# @license GPL <https://www.gnu.org/licenses/gpl.html>
@lelandbatey
lelandbatey / columnize.py
Last active August 9, 2024 13:12
columnize.py parses STDIN as column-based data, printing as nicely formatted columns
#!/usr/bin/env python3
#
# Copyright (c) 2022 Leland Batey. All rights reserved.
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
columnize.py reads column-oriented text data and prints that data as
nicely-padded columns to STDOUT. Input data *must* be line-oriented; data that
spans multiple lines will not be correctly understood and will not be correctly
version: "3.7"
services:
project-zomboid:
image: ghcr.io/cyrale/project-zomboid
restart: unless-stopped
environment:
SERVER_NAME: "pzserver"
ADMIN_PASSWORD: "pzserver-password"
ports:
@erwiese
erwiese / check-http.sh
Last active November 26, 2022 03:43
Monitor a HTTP service, search for strings and reports connection times
#!/bin/bash
# Check availability and response time for a website
# Output is in InfluxDB line protocol
measurement="http.stat"
function dorequest () {
local url=$1
local chkstr=$2
@Neo-Desktop
Neo-Desktop / .links
Last active February 6, 2025 08:22
Modern.ie Hyper-V (2012) Instances
@rlaphoenix
rlaphoenix / _restream_cenc.md
Last active June 26, 2025 08:05
Ways to re-stream and decrypt MPEG-CENC live streams. (or just play on desktop)

Disclaimer

  1. All content keys were redacted, they should be 128-bit hex strings.
  2. These methods involve the use of ffmpeg and -cenc_decryption_key which is not part of stable releases as of July 2022. Use nightlies from gyan.dev or some other autobuild in the meantime. Hopefully it gets added in the next stable release.
  3. On my end none of these were particularly reliable. This may change in the future as FFmpeg evolves. The direct method of playing with ffplay is currently the most reliable out of the listed methods.

xTeVe (for Emby/Plex)

@wchargin
wchargin / pct.sh
Last active March 14, 2023 23:26
unix filter for computing percentiles / quantiles
#!/bin/sh
die() {
printf >&2 'fatal: %s\n'
exit 1
}
case $# in
0) die 'no percentiles provided' 'usage: pct P [P ...]' ;;
1) ps="$1" ;;
*)