Skip to content

Instantly share code, notes, and snippets.

View Raymo111's full-sized avatar

Raymond Li Raymo111

View GitHub Profile
@Raymo111
Raymo111 / archinstall.md
Last active June 29, 2024 00:35
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 2023-08-06

Disclaimer: I have personally tested every step of this. 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
@Raymo111
Raymo111 / Raymond Li (Raymo111) (2021-02-01 4_18_15 PM).html
Created February 1, 2021 21:30
Personal website (snapshot at 2021-02-01 4:18:15 PM) to be sent to the moon thanks to u/Valphon
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html class="desktop mbr-site-loaded" style>
<!--
Page saved with SingleFile
url: https://raymond.li/
saved date: Mon Feb 01 2021 16:18:15 GMT-0500 (Eastern Standard Time)
____ ____ _ ___ _____
/ ___| _ \| | / _ \ |___ /
| | _| |_) | | _____| | | | |_ \
| |_| | __/| |__|_____| |_| | ___) |
@Raymo111
Raymo111 / keybase.md
Created December 2, 2020 22:45
Keybase proof of ownership

Keybase proof

I hereby claim:

  • I am Raymo111 on github.
  • I am raymo111 (https://keybase.io/raymo111) on keybase.
  • I have a public key whose fingerprint is 64C2 FB18 E104 7522 9FFF 25D1 F058 DF98 2DB4 2F9D

To claim this, I am signing this object: