Skip to content

Instantly share code, notes, and snippets.

@cgm999
cgm999 / xterm.diff
Created March 16, 2026 12:26
xterm - replace blink with inverse
--- a/charproc.c
+++ b/charproc.c
@@ -4380,15 +4380,8 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
setExtendedFG(xw);
});
break;
- case 5: /* Blink (less than 150 per minute) */
- /* FALLTHRU */
- case 6: /* Blink (150 per minute, or more) */
- UIntSet(xw->flags, BLINK);
@cgm999
cgm999 / openconnect-sso browser_playwright.py
Last active February 1, 2026 08:01
openconnect_sso - browser_playwright
#!/bin/python3
# required configured python keyring (https://pypi.org/project/keyring/)
# $ keyring get "openconnect-sso" your_email
# $ keyring set "vpnadfscreds" "totp" # totpBase32Secret
import argparse
import os
import sys
import time
@cgm999
cgm999 / get-token-outlook.py
Created February 1, 2026 07:19
get-token-outlook.py (for davmail)
#!/bin/python3
# required configured python keyring (https://pypi.org/project/keyring/)
# $ keyring get "openconnect-sso" your_email
# $ keyring set "vpnadfscreds" "totp" # totpBase32Secret
import argparse
import os
import sys
import time
@cgm999
cgm999 / mul_a_weird.c
Last active January 23, 2026 06:44
Weird issue with compiled C code
#include <stdio.h>
#include <stdint.h>
uint16_t find_inv(uint16_t a) {
uint16_t inv = 1;
for (int i = 0; i < 16; i++) inv *= 2 - a * inv;
return inv;
}
uint16_t mul_a,mul_a_inv;