Skip to content

Instantly share code, notes, and snippets.

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
@rtldg
rtldg / purge.py
Created May 16, 2023 22:31
purge old cloudflare pages deployments
# SPDX-License-Identifier: WTFPL
# pip install cloudflare
# Create token with Account -- Cloudflare Pages:Edit, Workers Scripts:Edit
# CLOUDFLARE_API_TOKEN="secret" python purge.py
import CloudFlare
cf = CloudFlare.CloudFlare()
zones = cf.zones.get()
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 / 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 ?;
);
@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 / 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 / notes.bat
Created October 9, 2022 11:56
old sourcemod compiling thing
# building sourcemod
# open VS2015 x86 Native Tools Command Prompt (ACTUALLY DON'T ???)
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevcmd\ext\vcvars.bat"
mkdir alliedmodders
cd alliedmodders
git clone --recurse-submodules -j8 https://github.com/alliedmodders/sourcemod
cd sourcemod
#define BDL 0
#define BUL 1
#define FDL 2
#define FUL 3
#define BDR 4
#define BUR 5
#define FDR 6
#define FUR 7
char axis_pairs[3][12][2] =
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
;SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetKeyDelay, 10
winTitle := "ahk_class UnityWndClass ahk_exe ShiningJumpJump.exe"
Loop
{
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <output_info_plugin>
#define PLUGIN_NAME "Show Triggers (Brushes) Redux"
#define PLUGIN_AUTHOR "JoinedSenses, edited by Blank"