Skip to content

Instantly share code, notes, and snippets.

View Randomblock1's full-sized avatar

Benjamin G. Randomblock1

View GitHub Profile
@Randomblock1
Randomblock1 / patch.c
Created March 8, 2026 05:00
Metashape Pro patch
// gcc -shared -fPIC -o patcher.so patcher.c -ldl -O2
// Run with LD_PRELOAD=/path/to/patch.so metashape
#define _GNU_SOURCE
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
@Randomblock1
Randomblock1 / benchmarks.md
Created March 5, 2026 22:48
llama.cpp Vulkan vs HIP 6.4.4 backend Radeon 890M

llama.cpp benchmarks for various compiler settings and backends on my machine

CPU: Ryzen 9 HX 370 GPU: Radeon 890M (gfx1150) HIP version: 6.4.43484-9999 (HSA_OVERRIDE_GFX_VERSION=11.0.0) Linux framework 6.18.13-200.fc43.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Feb 19 19:54:01 UTC 2026 x86_64 GNU/Linux Fedora Linux 43 (KDE Plasma Desktop Edition)

llama2-7b

Default compile settings

build/bin/llama-bench -m ~/Downloads/llama-2-7b.Q4_0.gguf -ngl 99 -fa 0,1 -dev Vulkan0,ROCm0

@Randomblock1
Randomblock1 / bunx-util.ts
Created November 7, 2025 06:28
Utility for reading & patching .bunx files to use Bun runtime instead of Node on Windows
/**
* Parse and patch Bun's Windows .bunx metadata files.
*
* Commands:
* bun run bunx-util.ts inspect <path-to-file.bunx>
* bun run bunx-util.ts patch-shebang <path-to-file.bunx> [--out <dest-path>] [--no-backup]
*
* Format reference (from src/install/windows-shim/BinLinkingShim.zig):
*
* Layout (UTF-16LE unless noted):
@Randomblock1
Randomblock1 / mounriver-studio.desktop
Created October 31, 2025 14:19
Linux .desktop file for MounRiver Studio 2 (so it shows up in GUI app lists)
[Desktop Entry]
Name=MounRiver Studio
Exec="PUT YOUR INSTALL PATH HERE/mounriver-studio 2"
Icon="PUT YOUR INSTALL PATH HERE/resources/app/resources/linux/code.png"
Type=Application
Categories=Development;IDE;
@Randomblock1
Randomblock1 / chatgpt-4o-system-prompt.md
Created July 6, 2024 01:26
ChatGPT-4o System Prompt

You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture. Knowledge cutoff: 2023-10 Current date: 2024-07-05

Image input capabilities: Enabled Personality: v2

Tools

bio

@Randomblock1
Randomblock1 / MassFFmpegConvert.ps1
Last active July 13, 2022 20:49
Mass convert videos from one type to another
# By default, this will convert all MP4 files in the specified directory to AV1-encoded MKV files.
# You can specify parameters to the command, or modify the default behavior below.
# Run `Get-Help MassFFmpegConvert.ps1` for more information.
param(
[Parameter(Mandatory)]
[String]$path = ".",
[Parameter()]
[String]$inputExtension = "mp4",
[String]$outputExtension = "mkv",
@Randomblock1
Randomblock1 / README.md
Last active November 11, 2021 13:08
JavaScript code for Nativefier Discord to add a counter and native style

You need Nativefier and this icon. Then, save discord.js, the icon, and build.sh in the same folder. Finally, just execute build.sh! ./build.sh (remember to chmod 755 build.sh first)!