Skip to content

Instantly share code, notes, and snippets.

View Raymo111's full-sized avatar

Raymond Li Raymo111

View GitHub Profile
@Raymo111
Raymo111 / 34a9f20c-45b3-4051-9970-a60632a2afa5.jsonl
Created July 24, 2026 01:24
claude-carafe-2f50f409-v1-prod full trace
{"type":"mode","mode":"normal","sessionId":"34a9f20c-45b3-4051-9970-a60632a2afa5"}
{"type":"permission-mode","permissionMode":"auto","sessionId":"34a9f20c-45b3-4051-9970-a60632a2afa5"}
{"type":"file-history-snapshot","messageId":"cedc7c6f-61cd-48fe-83ca-5e9c2196eeda","snapshot":{"messageId":"cedc7c6f-61cd-48fe-83ca-5e9c2196eeda","trackedFileBackups":{},"timestamp":"2026-07-20T01:34:26.528Z"},"isSnapshotUpdate":false}
{"parentUuid":null,"isSidechain":false,"promptId":"357900ee-1c5c-4d68-a806-867e90c69d31","type":"user","message":{"role":"user","content":"find my karabiner config and have ghostty match terminal in every config (I need the same shortcuts and stuff that is passed through to macos terminal also working in ghostty)"},"uuid":"cedc7c6f-61cd-48fe-83ca-5e9c2196eeda","timestamp":"2026-07-20T01:34:26.527Z","permissionMode":"auto","origin":{"kind":"human"},"promptSource":"typed","userType":"external","entrypoint":"cli","cwd":"/Users/eng9","sessionId":"34a9f20c-45b3-4051-9970-a60632a2afa5","version":"2.1.2
@Raymo111
Raymo111 / Unbork-qt6.md
Last active June 18, 2025 04:10
How to un-bork QT/KWin after rm-rfing *qt6*

So you ran rm -rf /usr/lib/libQt6* /usr/lib/qt6* /usr/include/qt6* /usr/bin/qt6* as root without thinking twice?

...And didn't have any backups of /usr/?

Here's how to fix it.

  1. yay -Qv {plasma-desktop,dolphin,kio,qt6-base} shows the versions of the 3 different systems of QT/KDE packages. Note these down. I got:
plasma-desktop 6.3.5-1
dolphin 25.04.2-1
@Raymo111
Raymo111 / archinstall.md
Last active January 24, 2026 18:29
Arch Linux Install with BTRFS, LUKS, and systemd-boot, dual-booted with a UKI and Windows 11 on a shared EFI partition

Arch Linux Install with BTRFS, LUKS, and systemd-boot, dual-booted with a UKI and Windows 11 on a shared EFI partition

By Raymo111

Last updated 2025-09-28

Disclaimer: I have personally tested the steps in this install. However, I'm not responsible for anything you do.

Pre-install

  1. Boot Windows, install the latest updates, remove OEM bloatware, open Disk Management, and shrink the Windows partition to make room for Arch.
  2. Download the latest Arch ISO and flash it with Etcher.
  3. Control Panel > Power Options > Choose what the power buttons do > Change settings that are currently unavailable > Uncheck Fast startup.
@Raymo111
Raymo111 / CMakeLists.txt
Created March 29, 2022 23:00
CS 136 CMakeLists
cmake_minimum_required(VERSION 3.16)
project(CS_136 C)
##################################################
set(ASSIGNMENT Final)
##################################################
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
@Raymo111
Raymo111 / cs241-mips.xml
Last active January 27, 2022 19:19
CS 241 MIPS KSyntaxHighlighting
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="CS 241 MIPS" version="1" kateversion="5.0" section="Assembler" extensions="*.asm;*.hex;" mimetype="text/x-mips" author="Raymond Li" priority="1">
<highlighting>
<list name="type">
<item>.word</item>
</list>
<list name="rinstr">
<item>add</item>
<item>sub</item>
@Raymo111
Raymo111 / Dark Reader pdf light mode.js
Created January 17, 2022 03:55
PDFium light mode for Dark Reader
let eee = "#eeeeee"
let sr = document.querySelector("#viewer").shadowRoot.querySelector("#toolbar").shadowRoot
sr.querySelector("#toolbar").style.backgroundColor = "lightgray"
sr.querySelector("#toolbar").style.color = "black"
let ce = sr.querySelector("#center").firstElementChild.shadowRoot
ce.querySelector("#pageselector").style.backgroundColor = eee
ce.querySelector("#pageselector").style.color = "black"
ce.querySelector("#divider").style.color = "black"
ce.querySelector("#pagelength").style.color = "black"
sr.querySelector("[aria-label='Zoom level']").style.backgroundColor = eee
@Raymo111
Raymo111 / csamarkup2tikz.py
Created December 2, 2021 22:56
Python script to convert CSAcademy Graph Editor Markup to TikZ
import json
before = """\\begin{center}
\\begin{tikzpicture}[every node/.style={draw,circle,minimum size=25pt}]
\\begin{scope}[yscale=-1]
\\draw[thick]"""
after = """;
\\end{scope}
\\end{tikzpicture}
\\end{center}"""

Konsole delete word

By Raymond Li (Raymo111) 29 August 2021

To map shortcuts like Ctrl+Bksp/Del to delete words backwards and forwards in Konsole:

  1. Go to Settings > Edit Current Profile... > Keyboard > Edit...`
  2. Edit (or add) the following key combos if they don't already exist:
Key Combination Output (Explanation)
Backspace-Ctrl \x7f Backspace without Ctrl should just delete the character before the cursor
Backspace+Ctrl \E\b Backspace with Ctrl should delete the word before the cursor. ^H should be encoded as \x08 (ascii control character code in hex) but Konsole converts that to \b, it's code for backspace.

1920x1080 HD webcam on Linux

By Raymond Li (Raymo111)

Last updated 8 Sept 2021

So your webcam is giving you a 5:4 low-res video and you can't do anything about it?

  1. Load the v4l2loopback kernel module:
sudo depmod -a
sudo modprobe v4l2loopback devices=1 max_buffers=2 exclusive_caps=1 card_label="VirtualCam"

You can do this persistently by creating a config file like video.conf in /etc/modprobe.d/ with the following in it:

@Raymo111
Raymo111 / pwrstatd-powerfail.sh
Last active August 21, 2021 23:24
UPS battery power notification
#!/bin/bash
#.
#.
#.
# (append this)
# Send a desktop notif
sudo -u raymo DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "Warning: Utility power has failed. Now running on battery." -i battery-caution -u critical -t 10000 -h 'string:desktop-entry:ups' -a UPS