Skip to content

Instantly share code, notes, and snippets.

@PeronGH
PeronGH / README.md
Created October 3, 2026 06:30
Bun on Android: LD_PRELOAD workaround for bun install crashing with signal 31 (SIGSYS: openat2/fchmodat2)

Bun on Android: fix bun install crashing with signal 31 (SIGSYS)

On Android (Termux, native bun-linux-aarch64-android build), bun install dies as soon as it links a package that has a bin entry (typescript, esbuild, …):

Resolved, downloaded and extracted [52]
Unknown signal 31          bun install

Exit code is 159, and the shell may print Bad system call. The same crash affects bun add/remove/update, workspaces, bun patch --commit, and bun x . bun init is affected too, but it fails silently: no bun.lock and no node_modules/.bin.

@PeronGH
PeronGH / oppo-weather-api.md
Created September 4, 2026 11:52
OPPO Weather Backend API — Reference

OPPO Weather Backend API — Reference

Unofficial documentation of the private HTTP API behind the OPPO/OnePlus/realme Weather app ("weatherservicesdk" protocol). Reverse-engineered from Weather 16.45.2 (net.oneplus.weather, international build) and verified against the live server with hand-crafted requests. Everything needed to build a working client is contained in this document.

Upstream data provider: The Weather Company / weather.com (see Data provider).

@PeronGH
PeronGH / oplus-nxp-nfc-api.md
Last active September 3, 2026 14:56
OPlus / NXP Vendor NFC API — door card emulation reference

OPlus / NXP Vendor NFC API — door card emulation reference

Complete reference for the vendor-private NFC API of OPlus (OPPO/OnePlus/Realme, "ColorOS") phones, as used by the FinShell "Fineasy" app (com.fintech.life) for its door card (access card) feature, with the NXP-chip API and the NFCC-level mechanism documented in depth for a Mifare Classic implementation.

Everything marked [inferred] derives from log strings, call-site timing, or constants — not vendor sources. All other claims are verified from decompiled vendor stacks, and the NCI-level mechanism is cross-checked against NXP's public documentation (see §12).

Provenance: proprietary OPlus vendor library nfcvendorlib.jar, the OPlus NFC service NfcNci.apk (versionName 16.0.0.250924), and the NXP vendor JNI libnq330nfc_nci.so, all from a OnePlus device running ColorOS 16 (Android 16, API 36) with com.android.nfc versionCode 160000024.


@PeronGH
PeronGH / gz302ea-bios-311-314-diff.md
Last active September 2, 2026 03:33
ASUS ROG Flow Z13 (GZ302EA) — BIOS Update Analysis: 311 vs 314

ASUS ROG Flow Z13 (GZ302EA) — BIOS Update Analysis: 311 vs 314

Device: ASUS ROG Flow Z13 GZ302EA — AMD "Strix Halo" (Ryzen AI Max+ 395 class, FP11 platform) Images analyzed: Official ASUS Windows updaters ASUS_GZ302EA_311_BIOS_Update.exe and ASUS_GZ302EA_314_BIOS_Update.exe Method: Full static analysis — capsule extraction, custom UEFI FV/FFS/section parser with LZMA and Tiano decompression, whole-image structural diff (every FFS file and section hashed and compared across both images), string-package diffing of setup modules, and parsing of the AMD Embedded Firmware Structure / PSP directory tables. No official changelog exists; all findings below are observed directly in the firmware images.


1. Executive summary

@PeronGH
PeronGH / boox-cross-flashing.md
Last active August 26, 2026 14:07
Cross-flashing a BOOX device over EDL

Cross-flashing a BOOX device over EDL (Poke4S → Poke4Lite)

Boox ships an unlocked bootloader but a restricted fastboot. So we have to use EDL (Qualcomm 9008 / Firehose).

Tested on a Poke4S (QCM2290, A/B + Virtual A/B, 4 GiB super) running 4.0.2, flashed with Poke4Lite 4.0.0.

Wipes all user data. Only sensible between models sharing hardware.

1. Firmware

@PeronGH
PeronGH / kimi-code-prompts-0.23.5.md
Last active July 12, 2026 12:13
Coding Agent System Prompt

Kimi Code CLI — Extracted Prompts

Extracted from /workspace/.local/lib/node_modules/@moonshot-ai/kimi-code/dist/main.mjs.

Package: @moonshot-ai/kimi-code
Version: 0.23.5
Embedded raw sources: 47
Additional direct runtime prompt constants: 3

Source paths and bundle line numbers are retained for provenance. Template placeholders are intentionally unrendered.

@PeronGH
PeronGH / fex-on-fedora.md
Created April 21, 2026 07:09
FEX on Fedora
sudo dnf install fex-emu fuse
mkdir -p ~/.fex-emu
echo '{"Config":{"RootFS":"/usr/share/fex-emu/RootFS/default.erofs"}}' > ~/.fex-emu/Config.json
@PeronGH
PeronGH / oci-byoi-arm-notes.md
Created April 19, 2026 08:01
OCI Custom Image Import on ARM Always Free — hard-won notes

OCI Custom Image Import on ARM Always Free — hard-won notes

Field notes from wiping a FreeBSD Always Free A1.Flex and standing up a fresh Fedora 43 aarch64 via BYOI. Captures the things that are either undocumented, contradicted between docs pages, or only discoverable by trying.

Environment: us-sanjose-1, VM.Standard.A1.Flex (4 OCPU / 24 GB), 200 GB BV / 10 VPUs, Fedora-Cloud-Base-Generic-43-1.6.aarch64.qcow2.

TL;DR — the working recipe

  1. Upload the aarch64 qcow2 to an Object Storage bucket.
  2. Create the custom image via raw API (CLI can't do it) with launchMode=CUSTOM and explicit launchOptions containing firmware=UEFI_64 plus PV everywhere.
@PeronGH
PeronGH / factory-api.ts
Last active March 15, 2026 15:25
LLM API Extraction PoC
#!/usr/bin/env -S deno run -A --env
/**
* factory-api.ts — Factory.ai auth + local API proxy.
*
* Login (saves credentials to .env):
* deno run -A factory-api.ts login > .env
*
* Serve (auto-reads .env, proxies with injected credentials):
* deno run -A --env factory-api.ts serve [--port 8000] [--host 127.0.0.1]
*
@PeronGH
PeronGH / fedora-lid-close.md
Created February 25, 2026 03:11
Prevent Sleep on Lid Close — Fedora (GNOME/GDM)

Prevent Sleep on Lid Close — Fedora (GNOME/GDM)

Tested on Fedora 43 with GNOME Shell 49.4. Two layers need to be configured: systemd-logind (the system) and GDM's gsd-power (the greeter), because GDM runs its own GNOME settings daemon that suspends independently.

1. Tell systemd-logind to ignore the lid switch

sudo mkdir -p /etc/systemd/logind.conf.d

sudo tee /etc/systemd/logind.conf.d/lid.conf << 'EOF'