Skip to content

Instantly share code, notes, and snippets.

// B = back
// F = front/forward
// D = down
// U = up
// L = left
// R = right
#define BDL 0
#define BUL 1
#define FDL 2
@rtldg
rtldg / things.md
Created October 9, 2022 11:59
useful source engine console things

cl_pdump

cl_soundscape_printdebuginfo

sv_soundemitter_trace 1

snd_dumpclientsounds

snd_show 1

@rtldg
rtldg / mpv fucker.nip
Created November 18, 2022 04:27
nvidiaProfileInspector profile for mpv.exe so it stops being recorded by NVIDIA Instant Replay
<?xml version="1.0" encoding="utf-16"?>
<ArrayOfProfile>
<Profile>
<ProfileName>mpv fucker</ProfileName>
<Executeables>
<string>mpv.exe</string>
</Executeables>
<Settings>
<ProfileSetting>
<SettingNameInfo />
@rtldg
rtldg / sqlite3bhoptimerweightedpoints.c
Created December 19, 2022 03:03
Test sqlite extension for bhoptimer's GetWeightedPoints
// SPDX-License-Identifier: CC0
/* vim: set ts=2 : */
/*
This is basically:
SELECT SUM(p2)
FROM (
SELECT (points * POW(?, ROW_NUMBER() OVER (ORDER BY points DESC) -1)) AS p2
FROM playertimes WHERE auth = ? ORDER BY points DESC LIMIT ?;
);
import glob
import urllib.request
import os
plain = ""
for f in glob.glob("*.bsp"):
plain += str(os.path.getsize(f)) + " " + f + "\n"
req = urllib.request.Request("https://check.fastdl.me/nsplain", data=plain.encode(), headers={"User-Agent": "check.py"})
resp = urllib.request.urlopen(req)
print(resp.read().decode('utf-8'))
@rtldg
rtldg / purge.py
Last active January 13, 2025 23:19
purge old cloudflare pages deployments
# SPDX-License-Identifier: WTFPL
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "cloudflare==2.19",
# ]
# ///
# Create token with Account -- Cloudflare Pages:Edit, Workers Scripts:Edit
how many recursive CNAME records does your dns resolver resolve?
well there's an easy way and a hard way to figure out...
let's start with the hard way:
- search golang dns server
- end up with https://gist.github.com/walm/0d67b4fb2d5daf3edd4fad3e13b162cb and save main.go to a folder
- search how to build a golang project and download imports because you don't remember
- edit it to parse the deepest subdomain as an int and return a CNAME minus one of it
- and also return a real A record if the int is 0
- acquire a vps and scp your built binary to it
public void OnPluginStart()
{
char output[0xFFFF], data[0xFFFF];
int outputpos;
int pointer;
char code[] = "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.";
for (int i; code[i]; i++) {
switch (code[i]) {
@rtldg
rtldg / system v amd64 psabi notes.md
Last active May 27, 2026 15:24
Notes so I remember how calling conventions work
@rtldg
rtldg / better-mpv-screenshots.lua
Last active January 6, 2025 01:00
better screenshot filenames for mpv and also helps with long screenshot filenames
-- SPDX-License-Identifier: WTFPL
-- Copyright 2025 rtldg <rtldg@protonmail.com>
--[[
basically this:
screenshot-template="%F %P %n %{sub-text}"
Only includes sub-text in filename if the picture includes subs.
Things this basically does:
- Trim screenshot filenames to remove trailing '.', '_', and (c <= ' ').