Skip to content

Instantly share code, notes, and snippets.

@dpino
dpino / last-successful-build-to-git-commit.sh
Last active August 9, 2024 13:46
Fetch commit of last successful WebKit build (default: GTK-Linux-64-bit-Release-Ubuntu-LTS-Build)
#!/usr/bin/env bash
# set -x
# Return commit of last successful WebKit build (default: GTK-Linux-64-bit-Release-Ubuntu-LTS-Build).
# Changes:
# 2022-11-16: Reworked script using changes suggested by asutherland to fetch commit number of last successful build directly from build.webkit.org.
BUILDER_NAME=${1:-GTK-Linux-64-bit-Release-Ubuntu-LTS-Build}
@Konijima
Konijima / Project Zomboid - How to mod like a boss.md
Last active March 13, 2025 17:26
Project Zomboid - How to mod like a boss

How to mod like a boss 😎

This tutorial I will show you

  • how file load order works
  • how to think and structure lua mods
  • how to modify vanilla behaviour
  • how to use require with passion
  • and more...

@OleksandrKucherenko
OleksandrKucherenko / logger.sh
Created August 17, 2022 08:06
BASH logger that listen to DEBUG environment variable
#!/usr/bin/env bash
# shellcheck disable=SC2155,SC2034,SC2059
# get script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
#
# Register debug logger functions that are controlled by DEBUG= environment variable
# Examples:
# DEBUG=* - print all logs
@mnemnion
mnemnion / git-move.sh
Created August 15, 2022 11:35
Move files from one git repo to another, following renames
#! /bin/bash
# Usage:
# ./git-move.sh path1/ path2/... path/to/destination/repo
args=("$@")
# All but last argument:
paths=("${args[@]::${#args[@]}-1}")
# Last argument:
dest="${args[${#args[@]}-1]}"
@raspi
raspi / setup_namespace_network.sh
Created August 14, 2022 16:57
Setup Linux namespace network with virtual bridge
#!/bin/bash
# (C) Pekka Järvinen 2022
# Name for bridge which virtual namespaces will use to communicate with each other
BRIDGENAME="gamebr0"
# Prefix for network
NETPREFIX="192.168.255."
# Starting IP (NETPREFIX + this)
let STARTIP=10
@wchargin
wchargin / difmap.sh
Last active April 25, 2024 17:57
difmap: diff files under a Unix filter, like difmap -c 'jq .' f1 f2
#!/bin/sh
set -eu
set -x
usage() {
cat <<'EOF'
difmap: diff two files after mapping them through a shell filter
Examples:
@x42en
x42en / progressBar.sh
Created August 4, 2022 12:52
HTOP like color bar - BASH progress bar
#!/bin/bash
ansi() { printf "\e[${1}m${*:2}\e[0m"; }
bold() { ansi 1 "$@"; }
dgreen() { ansi "1;32" "$@"; }
green() { ansi "1;92" "$@"; }
yellow() { ansi "1;93" "$@"; }
orange() { ansi "38;5;214" "$@"; }
red() { ansi "1;91" "$@"; }
lblue() { ansi "1;96" "$@"; }
@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 July 27, 2024 10:17
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.