Skip to content

Instantly share code, notes, and snippets.

Swyter / launch-sphinx-mod.cmd
Last active June 4, 2023 04:14
Easy batch script to locate a Sphinx install from either GOG or Steam and launch it with the current folder as mod. :)
View launch-sphinx-mod.cmd
:: sphinx PC install search batch script thingie -- created by swyter in january 2019
:: --
:: run this to automatically find either the GOG or the Steam version of the game (the former has priority)
:: and launch it with the current folder's path in the mod parameter. easy peasy lemon squeezy :)
@echo off && setlocal EnableExtensions && setlocal EnableDelayedExpansion && setlocal && set arguments="%*"
Swyter /
Last active May 21, 2023 08:33
Listado de descargas de versiones antiguas de ContaSol, FactuSol, TPVSol y NominaSol de la compañia Software DELSOL

v34 - Beyond Good and Evil - Symbolicated PS2 proto .elf
v36 - King Kong - (0xB398CC66 XOR key for headers) - Symbolicated .elf
v36 - Rayman Raving Rabbids - (0xB398CC66 XOR key for headers) - Symbolicated .elf
v36 - Rayman Raving Rabbids 2 - (0xB398CC66 XOR key for headers) - Multiple symbolicated .elf
v37 - Prince of Persia: The Sands of Time - PS2 proto symbol map file
v38 - Prince of Persia: Warrior Within -
v38 - Prince of Persia: The Two Thrones -
v42 - TMNT -
v42 - My Word Coach - Symbolicated .elf, unpacked data, uncompiled AI scripts
v42 - My Spanish Coach -

View fujifilm-sdk-old-file-scrapper.js
for (i=125; i>0; i--)
xhr = new XMLHttpRequest()"GET", `${('000' + i).slice(-3)}`)
Swyter / gist:a17f5f8a4d5e0d489dea9d4a937f46c8
Last active December 15, 2022 16:16
View gist:a17f5f8a4d5e0d489dea9d4a937f46c8 GOOD BAD BAD BAD BAD BAD GOOD
Swyter /
Last active December 6, 2022 07:26
sh <<EOF && sh -c "# swy: zsh in catalina+ doesn't support inline comments:"
# swy: needed for sed to stop complaining about the wholy unsupported hexadecimal literals
export LANG=C
export LC_ALL=C
# swy: go into the game's binary folder
cd ~/'Library/Application Support/Steam/steamapps/common/MountBlade Warband/Mount and'
# swy: turn their ../../.. hack into the harmless .//.//./ without changing the length of the string
sed -i '' 's|\.\./\.\./\.\.|\.//\.//\./|g' ./'Mount and Blade'
Swyter /
Created November 26, 2022 22:51
Fix for qemu-system-x86_64: kvm_set_user_memory_region: KVM_SET_USER_MEMORY_REGION failed, slot=6, start=0xc004800000000000, size=0x200000000

If you get this crash after booting macOS in KVM with AMD GPU passthrough you'll need to disable Above 4GB decoding on your BIOS/UEFI Setup.

qemu-system-x86_64: kvm_set_user_memory_region: KVM_SET_USER_MEMORY_REGION failed, slot=6, start=0xc004800000000000, size=0x200000000: Invalid argument kvm_set_phys_mem: error registering slot: Invalid argument
./ línea 90:  3507 Aborted                (`core' generado) qemu-system-x86_64 "${args[@]}"

That fixed it.

Swyter /
Last active November 22, 2022 05:42
Linux VFIO KVM Passthrough with AMD Radeon card -- Solution for dmesg error «No more image in the PCI ROM» -- VFIO single graphics card bootup

If you have a black screen when trying to boot your guest OS via qemu/kvm with passthrough for your AMD Radeon card (in my case RX 480/590 or POLARIS10) and nothing is working, and you are able to ssh into the host while the virtualization is running or afterwards and get something like this via dmesg:

vfio_ecap_init: hiding ecap 0x19@0x270
vfio-pci 0000:03:00.0: No more image in the PCI ROM

Then the solution is to boot Linux through pure EFI; the problem is enabling CSM and then either booting the host system through a legacy BIOS bootloader or EFI. TL;DR: Disable CSM, ensure you've a proper EFI boot chain first. Then it will work straight away.

Swyter / csr_bluetooth_btmon.log
Created October 31, 2022 12:49
Full `btmon` dumps for fake CSR Bluetooth dongles on Linux -- requested here:
View csr_bluetooth_btmon.log
Bluetooth monitor ver 5.65
= Note: Linux version 6.0.6-arch1-1 (x86_64) 0.148480
= Note: Bluetooth subsystem version 2.22 0.148481
@ MGMT Open: bluetoothd (privileged) version 1.22 {0x0001} 0.148482
= New Index: 00:00:00:00:00:00 (Primary,USB,hci0) [hci0] 11.241956
= Open Index: 00:00:00:00:00:00 [hci0] 11.2422
View tldmod-font-works-on-macos.txt
r3718 doesn't
r3658 doesn't
r3648 doesn't
r3630 doesn't
r3629 doesn't -- added remaining/missing glsl files, it loads without crashing but font is broken, appears sideways and the uniforms dont color vertices
r3623 doesn't
r3613 crash -- glsl shader issues: -- see the changes on Mar 29, 2022
r3600 works
r3464 works