Skip to content

Instantly share code, notes, and snippets.

@lambdan
lambdan / arch_install.txt
Last active November 22, 2025 08:09
Arch install steps
# assumes you are connected to the internet (try pinging google)
# apply swedish keyboard layout
loadkeys sv-latin1
# apply swedish timezone
timedatectl set-ntp true
ln -sf /usr/share/zoneinfo/Europe/Stockholm /etc/localtime
hwclock --systohc
@lambdan
lambdan / temps.sh
Last active November 16, 2025 11:53
CPU/AIO/Nvidia temperature monitoring script on Arch Linux
#!/bin/sh
# requires bc, lm-sensors, nvidia-smi
CPU_MODEL=$(cat /proc/cpuinfo | grep "model name" | uniq | sed 's/model name[[:space:]]*:[[:space:]]*//')
SENSORS_OUTPUT=""
# Helper functions for min/max tracking
declare -A MIN_VALUES
declare -A MAX_VALUES
@lambdan
lambdan / rotl_mp3s.txt
Created October 14, 2025 06:13
Roderick on the Line - MP3 urls for episodes 0-598
http://www.podtrac.com/pts/redirect.mp3/traffic.libsyn.com/secure/themerlinshow/rotl_0482.mp3
http://www.podtrac.com/pts/redirect.mp3/traffic.libsyn.com/secure/themerlinshow/rotl_0484.mp3
http://www.podtrac.com/pts/redirect.mp3/traffic.libsyn.com/themerlinshowhi/rotl_0035.mp3
http://www.podtrac.com/pts/redirect.mp3/traffic.libsyn.com/themerlinshowhi/rotl_0036.mp3
http://www.podtrac.com/pts/redirect.mp3/traffic.libsyn.com/themerlinshowhi/rotl_0037.mp3
http://www.podtrac.com/pts/redirect.mp3/traffic.libsyn.com/themerlinshowhi/rotl_0038.mp3
http://www.podtrac.com/pts/redirect.mp3/www.merlinmann.com/storage/b2w-031.mp3
http://www.podtrac.com/pts/redirect.mp3/www.merlinmann.com/storage/rotl/ballew-rotl-song.mp3
http://www.podtrac.com/pts/redirect.mp3/www.merlinmann.com/storage/rotl/rotl-0018.mp3
http://www.podtrac.com/pts/redirect.mp3/www.merlinmann.com/storage/rotl/rotl_00023.mp3
@lambdan
lambdan / spotify-csv-to-m3u.py
Last active October 9, 2025 19:58
Spotify CSV (Exportify) to m3u by matching ISRC
import os, json, csv, sys, subprocess
from tqdm import tqdm
# Export from Spotify using exportify.app, then run this on it when you have the songs!
metaFile = "meta.json"
audioExts = [".mp3", ".flac", ".ogg", ".opus", ".wav", ".m4a", ".aac"]
musicDir = "/Volumes/Media/Music/Organized/" # CHANGE THIS!
playlistBasepath = "../" # CHANGE THIS relative to musicDir from the playlists perspective
@lambdan
lambdan / myrient_size.py
Last active January 4, 2025 13:38
Myrient: Calculate size of folder
# usage:
# python3 myrient_size.py URL
# OR
# python3 myrient_size.py URLS.txt
# (where URLS.txt contains 1 URL per line)
from bs4 import BeautifulSoup
import sys, requests
import urllib.parse
@lambdan
lambdan / install_chromium_130.sh
Last active December 7, 2024 18:30
Install chromium 130 on Debian amd64/arm64 (131 is broken on arm64)
#!/bin/sh
set -e
do_install() {
echo "#######################################################"
echo "# Chromium Install Script (modified 2024-12-07 19:29) #"
echo "#######################################################"
if [ -f "/etc/apt/sources.list" ]; then
# This is unneccessary (doesnt exist) for node:20 images atleast but just in case...
echo "Backing up existing sources.list"
@lambdan
lambdan / perforce_discord_bot.py
Last active April 17, 2024 22:30
Simple python script that just checks for p4 commits and sends them to a Discord webhook
import subprocess, time, os, requests
CHECK_INTERVAL = 1 # check changes every n secs
DISCORD_WEBHOOK = "https://discord.com/api/webhooks/..."
LAST_CACHE = "last.txt"
# read last commit from cache file
last = 0
if os.path.isfile(LAST_CACHE):
with open(LAST_CACHE,'r') as f:
@lambdan
lambdan / get_tags.md
Last active March 15, 2024 11:05
Blueprint node to get all tags of an Ability (Unreal Engine Gameplay Ability System GAS)

Preview

In .h file:

// Returns all tags related to this ability
UFUNCTION(BlueprintPure, Category="GAS|Ability|Tags")
void GetTags(FGameplayTagContainer & OutAbilityTags, FGameplayTagContainer & OutCancelAbilitiesWithTags, FGameplayTagContainer & OutBlockAbilitiesWithTags, FGameplayTagContainer & OutActivationOwnedTags, FGameplayTagContainer & OutActivationRequiredTags, FGameplayTagContainer & OutActivationBlockedTags, FGameplayTagContainer & OutSourceRequiredTags, FGameplayTagContainer & OutSourceBlockedTags, FGameplayTagContainer & OutTargetRequiredTags, FGameplayTagContainer & OutTargetBlockedTags, FGameplayTagContainer & OutCooldownTags);
@lambdan
lambdan / Unreal C++ Forward Declaration TLDR.md
Created January 23, 2024 11:50
Unreal C++ Forward Declaration TLDR

Unreal C++ Forward Declaration TLDR

In .h file:

In the .h file you forward declare:

#include ...
#include "...generated.h"
@lambdan
lambdan / get_running_exes.py
Created November 28, 2023 22:57
Get running exes in Python (as a list)
import os
def get_running_exes(): # https://www.geeksforgeeks.org/python-get-list-of-running-processes/
wmic_output = os.popen('wmic process get description, processid').read().strip()
items = wmic_output.split("\n")
exes = []
for line in items:
if ".exe" in line.strip():
exe = line.split(" ")[0].rstrip()