Skip to content

Instantly share code, notes, and snippets.

View ohaiibuzzle's full-sized avatar

OHaiiBuzzle ohaiibuzzle

View GitHub Profile
#!/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"
$TargetUrl = "https://pixiv.net/ranking.php?mode=daily&content=illust&p="
$Pages = 4
Add-Type -TypeDefinition @'
using System.Runtime.InteropServices;
public class Wallpaper {
public const uint SPI_SETDESKWALLPAPER = 0x0014;
public const uint SPIF_UPDATEINIFILE = 0x01;
public const uint SPIF_SENDWININICHANGE = 0x02;
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
import urllib.request
import html.parser
import json
TARGET_URL = (
"http://www.pix" "iv.net/ran" "king.php" "?mode=daily&content=illust&p="
)
PAGES = 4
# get a UA from useragents.me/api