Skip to content

Instantly share code, notes, and snippets.

View ohaiibuzzle's full-sized avatar

OHaiiBuzzle ohaiibuzzle

View GitHub Profile
@ohaiibuzzle
ohaiibuzzle / msm8916-uf896-nomodem.dts
Last active October 17, 2026 19:19
Disable rproc on uf896 (msm8916) and re-gain ~85MB of RAM
// SPDX-License-Identifier: GPL-2.0-only
/* uf896 with the modem disabled: frees the 85 MB mpss + 1 MB mba carveouts */
#include "msm8916-thwc-uf896.dts"
&mpss {
status = "disabled";
};
&mpss_mem {
@ohaiibuzzle
ohaiibuzzle / dahua-noactivex.user.js
Created October 9, 2026 10:19
Log into DaHua legacy NVRs/XVRs without the ActiveX Stub
// ==UserScript==
// @name Dahua DVR/NVR/XVR WebUI — login without ActiveX/NPAPI
// @namespace dahua.noactivex
// @version 1.0.0
// @description Stubs the old NPAPI/ActiveX video plugin so legacy Dahua web UIs can log in and reach the Setup/config pages in a modern browser. Live preview/playback will NOT work (they require the real plugin); settings, network, users, P2P, etc. do.
// @author anonymous
// EDIT the @match line below to your device's IP (Dahua factory default shown):
// @match http://192.168.1.108/*
// @run-at document-start
// @noframes
#!/sbin/openrc-run
ZRAM_SIZE=96M
ZRAM_ALGO=zstd
start() {
ebegin "Starting ${RC_SVCNAME}"
modprobe zram num_devices=1
echo ${ZRAM_ALGO} > /sys/block/zram0/comp_algorithm
#!/bin/bash
set -euo pipefail
ALPINE_VERSION_MAJOR="3.23"
ALPINE_VERSION="${ALPINE_VERSION_MAJOR}.4"
ALPINE_ARCH="x86_64"
ALPINE_ROOTFS="https://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION_MAJOR}/releases/${ALPINE_ARCH}/alpine-minirootfs-${ALPINE_VERSION}-${ALPINE_ARCH}.tar.gz"
# Download the Alpine Linux root filesystem
diff --git a/0006-Fix-introspection-failures.patch b/0006-Fix-introspection-failures.patch
deleted file mode 100644
index 0cdc95c..0000000
--- a/0006-Fix-introspection-failures.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-# Patches from https://github.com/archeYR/libfprint-CS9711
-From 02b285c9703c38d308fbe47a3c566ef1e7f883ca Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Adam=20S=C5=82abo=C5=84?= <asaillen@protonmail.com>
-Date: Mon, 16 Feb 2026 23:56:18 +0100
#!/bin/bash
source /etc/telegram/telegram.conf
if [ -z "$BOT_TOKEN" ] || [ -z "$CHAT_ID" ]; then
echo "Error: BOT_TOKEN and CHAT_ID must be set in /etc/telegram/telegram.conf"
exit 1
fi
# Function to send a message to Telegram
#!/bin/bash
API="https://api.open-meteo.com/v1/forecast?latitude=35.6895&longitude=139.69171&current=temperature_2m,relative_humidity_2m,apparent_temperature,is_day,precipitation,cloud_cover,wind_speed_10m,wind_direction_10m,wind_gusts_10m&timezone=Asia%2FBangkok&forecast_days=1"
curl --max-time 2 -s $API |
jq -r '"It'"'"'s currently "
+ (.current.temperature_2m | tostring)
+ (.current_units.temperature_2m | tostring) +
" with "
+ (.current.relative_humidity_2m | tostring)
@ohaiibuzzle
ohaiibuzzle / usb_notifier.py
Last active March 17, 2024 21:00
macOS USB Notifier
#!/usr/bin/env python3
import subprocess
import plistlib
import time
def send_notification(title, message, sound=None):
command = 'display notification "{}" with title "{}" sound name "{}"'\
.format(message, title, sound) \
@ohaiibuzzle
ohaiibuzzle / pkg_pl.py
Last active September 3, 2023 20:03
Script to calculate right values for MSR_PKG_POWER_LIMIT
import math
# Get this value by reading msr 0x606
rapl_power_unit_value = 0x330A0E08
# pkg_pl_value = 0x860000DD8600
# Extract the power unit values
# Power units are in bits 3:0
power_units = pow(0.5, (rapl_power_unit_value & 0xF))
time_units = pow(0.5, ((rapl_power_unit_value & 0xF0) >> 8))
@ohaiibuzzle
ohaiibuzzle / iOS2Simulator.py
Last active August 13, 2023 08:16
Script to convert decrypted iOS apps to iOS Simulator (arm64 Macs only)
# Script to recursively find mach-o binaries in a directory
# and convert the buildtools using vtool to IOSSIMULATOR
import os
import subprocess
# Path to the vtool
vtool_path = "/usr/bin/vtool"
codesign_path = "/usr/bin/codesign"
xattr_path = "/usr/bin/xattr"