Skip to content

Instantly share code, notes, and snippets.

View ohaiibuzzle's full-sized avatar

OHaiiBuzzle ohaiibuzzle

View GitHub Profile
@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
#!/bin/bash
echo "Please make sure GPTK dmg is mounted"
read -p "Press enter to continue"
# Install GPTK
ditto /Volumes/Game\ Porting\ Toolkit-1.0/lib/ ~/Library/Application\ Support/Whisky/Libraries/Wine/lib
cd ~/Library/Application\ Support/Whisky/Libraries/Wine/lib
@ohaiibuzzle
ohaiibuzzle / LG V50 150MHz Underclock.txt
Last active November 17, 2023 16:04
Some OC profiles for my LG V50
konabess://H4sIAAAAAAAAAM3Wy26cMBQG4FdBdBskX8FO06q7dtEu21U3YDwJKrfgJI0myrsXSMcx0TkpSJlRZ+nfPnwD6BcPsbmq+vg8blzTVrWNz+LSOjMufP0c/ZAkopJ8+7KPvrelHUzdmV/jjt1gr8cd16Zrzi7726T/PdT2ztYuIdHDz/ZdXpaDdS4xtq5d9CG6IPf04/sxcNXehqtkWp3HuN7aMimq9mVQtdVNldf+Gk955vPw+p/myw/2ct602DKRn46ywuy4NM9xceuCuFisNwfQi+X8Plh+BC00sFDMkjKZE3J0CwssDLOw0qZCHN3CAwtHLLQ0lOP3RcMWtdkiAovALDrjiqDvSwpbJGzRuEUGFolZhCZCoc+IwxYOWyRuSQNLilh2kiq2lcJgisApWUDJEIrakZKqo1NUQFEIBUMQGEFgBDkgQIhL6BvV7HMvwTW7fA+31aziRW7/k5p9vdpy2KI3W9bU7KmqbVXNnqjaVtXs69UmYMv2altTsyeqtjUte4Q+GT/g7rr6ZvyA6/o+ybgk82/CTAtX+79nIh9Np6eoqczQTWfnF5z5uzxlaYbO8dGqOYKgcw4ROIdqHs6RCvX4CJ4jFh6hNUPm+Aico7PFGJZhHB+BYxQNx3CB/isfgWPkQsMkqvEROEbocAyV6LPy0T/GxI9/AHUOwwmCDAAA
@ohaiibuzzle
ohaiibuzzle / tof_pc_login.sh
Last active May 23, 2024 05:37
Script to login to ToF on PlayCover
# Script to login to ToF on PlayCover
# Select the ToF version
echo "Please select the region of ToF you want to login to:"
echo "[1] Global"
echo "[2] China"
read -p "Enter your choice: " choice
if [ $choice -eq 1 ]; then
import os
import subprocess
import json
import urllib
import urllib.request
import urllib.parse
API_HOST = "hk4e-api-os.hoyoverse.com"
def get_wish_urls():
"""
A simple and silly HTTP server that plays audio from internet sources
"""
from http import server
import urllib
import subprocess
ffplay = None
player = None
url = None