Skip to content

Instantly share code, notes, and snippets.

View Seas0's full-sized avatar
High Round-Trip Time warning.

Seas0

High Round-Trip Time warning.
View GitHub Profile
@Seas0
Seas0 / rpdb_post_mortem_template.py
Created July 7, 2025 06:45
A simple wrapper for calling rpdb as post mortem mode when parallel training
def main():
...
if __name__ == "__main__":
try:
main()
except Exception as e:
# Spin up the rpdb remote debugger
import os, sys, pdb, bdb, traceback, importlib.util
if sys.gettrace() is not None:
@Seas0
Seas0 / katex-copier.md
Created March 3, 2025 04:04
KaTeX Copier

KaTeX Copier

To copy KaTeX formula with ease.

javascript:(function(){const d={inline:["$","$"],display:["$$","$$"]};function cT(f){f.querySelectorAll(".katex-mathml + .katex-html").forEach(e=>e.parentNode.removeChild(e));f.querySelectorAll(".katex-mathml").forEach(e=>{let a=e.querySelector("annotation");if(a){let container=e.closest(".katex"),isD=container&&(container.classList.contains("katex-display")||(container.parentElement&&container.parentElement.classList.contains("katex-display")));let o=isD?d.display[0]:d.inline[0],c=isD?d.display[1]:d.inline[1],r=document.createElement("span");r.textContent=o+a.textContent+c;r.className="katex-tex";e.parentNode.replaceChild(r,e)}})};function kT(f){f.querySelectorAll(".katex-mathml + .katex-html").forEach(e=>e.parentNode.removeChild(e));f.querySelectorAll(".katex-mathml").forEach(e=>{let a=e.querySelector("annotation");if(a){let container=e.closest(".katex"),isD=container&&(container.classList.contains("katex-display")||(container.parentElement&&container.
@Seas0
Seas0 / multiple-tailnets.md
Last active June 6, 2025 08:18
Multiple Tailnets Guide

Running multiple tailscaled instances with netfilter integration disabled


This guide explains how to spawn multiple instances of tailscaled on a single system using a systemd.service(5) template and, optionally, customized configurations. By setting "netfilterMode": "off" in all configurations (or by manually configuring them using tailscale up --netfilter-mode off), you can connect to multiple Tailnets simultaneously without resorting to SOCKS proxy–based userspace networking, while preserving functionalities like Magic DNS integration with systemd-resolved (i.e. you can simutaneously have direct access to other machines in BOTH tailnets via their hostnames).

DISCLAIMER: This method completely disables Tailscale’s automatic (iptables/nftables) netfilter firewall rule creation and management. As firewall rules from an earlier tailscaled instance would be wiped out by a new one, potentially locking you out.

@Seas0
Seas0 / syncthing-automerge.py
Created February 15, 2025 01:45 — forked from solarkraft/syncthing-automerge.py
Monitors a Syncthing-synced directory and tries to merge conflicting files (based on https://www.rafa.ee/articles/resolve-syncthing-conflicts-using-three-way-merge/). Probably adaptable for other directory types, but only tested with Logseq (works for me™️).
# This script automatically handles Syncthing conflicts on text files by applying a
# git three-way merge between the previously synced version and each divergent version.
# It depends on the watchdog package and git.
# For automatic dependency installation when running with ´uv run --script deconflicter.py´:
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "watchdog",

Keybase proof

I hereby claim:

  • I am seas0 on github.
  • I am seas0 (https://keybase.io/seas0) on keybase.
  • I have a public key ASCIOtFRE9zI4ZaPq16-M4l6ffcprzgdB_qhG33LN_XuHQo

To claim this, I am signing this object:

@Seas0
Seas0 / Fira_Code_Nerd_Font_Mono_Embedded.css
Last active February 12, 2023 12:10
Fira_Code_Nerd_Font_Mono_Embedded
This file has been truncated, but you can view the full file.
@font-face {
font-family: 'FiraCode Nerd Font Mono';
font-style: normal;
font-weight: 400;
src: url('data:font/ttf;charset=utf-8;base64,AAEAAAASAQAABAAgRkZUTZNpp5MAJFmUAAAAHEdERUYPStnwACNTVAAAAIJHUE9TzIinKwAkENQAAEjAR1NVQr2bzsQAI1PYAAC8+k9TLzKCKI+WAAABqAAAAGBjbWFwnqCARQAAaMwAABM2Y3Z0IEaSGV4AAIr0AAAAqGZwZ22eNhXSAAB8BAAADhVnYXNwAAAAEAAjU0wAAAAIZ2x5Zs5k3lgAAVkUAB7VYGhlYWQXYMshAAABLAAAADZoaGVh/vABRQAAAWQAAAAkaG10eJMEWE0AAAIIAABmwmxvY2E1t9xMAACLnAAAzXhtYXhwO0EPRQAAAYgAAAAgbmFtZYlD4fIAIC50AAAJn3Bvc3RYmkcnACA4FAADGzhwcmVwis2cHgAAihwAAADWAAEAAAAGAIPW+dsiXw889QKfB54AAAAA3c/67gAAAADf9YWc8h38GAXICWAAAAAIAAAAAQAAAAAAAQAABwj9qAAABLDyHf7oBcgAAQAAAAAAAAAAAAAAAAAAAAQAAQAAM10IxwBgAHgACgACAkADeACNAAAEqQKJAAMAAwAEBLABkAAFAAAE9ASSAAAAkgT0BJIAAAKrADIBPgAAAgAACQAAAAAAAOAAAu8SAfn7AgAgOAAAAABDVERCAMAADf//Bwj9qAAABwgCWGAAAJ/f1wAABB0FYQAAACAABgSwAFAAAAAABLAAAASwAAAAAAHRAUcAagCKACUAawHvAPkBWwBhAIMBmQDHAacAaQCVAL4AdgBnAJAAmgCfAMMAgwCFAbUBlwCwANMAsACzABMAKQDBAH8ApwD7ARUAWwCnAM4AkQDSAQ8APQCnAF0A5wBbAMsAVwBQAJEAMQAJAD4ALwCP
@Seas0
Seas0 / Fira_Code_Nerd_Font_Mono.css
Last active February 12, 2023 11:35
Fira_Code_Nerd_Font_Mono.css
@font-face {
font-family: "Fira Code Nerd Font Mono";
font-style: normal;
font-weight: 300;
src: url('https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Light/complete/Fira%20Code%20Light%20Nerd%20Font%20Complete%20Mono.ttf') format('truetype');
}
@font-face {
font-family: "Fira Code Nerd Font Mono";
font-style: normal;
font-weight: 400;
@Seas0
Seas0 / ft2232_to_digilent_jtag.md
Created May 9, 2021 06:07 — forked from rikka0w0/ft2232_to_digilent_jtag.md
FT2232 to Digilent JTag for Xilinx FPGAs (ISE/Vivado)

The Digilent JTag uses FT2232, but its configuration EEPROM contains secrete data needed to be recoginzed by Xilinx ISE/Vivado. The following method only works on linux (tested on Ubuntu16.04), but the patched FT2232 doggle also works on Windows. Since WSL1 does not provide USB device access, the following method will not work for WSL1.

DONT use FT_Prog on offical Digilent cable, as it can trash the firmware! The offical eeprom contains secrete data that cannot be handled correctly by FT_Prog.

Here are steps to create a Digilent-like Jtag that can be used in Xilinx ISE and Vivado

  1. Install softwares: sudo apt-get install libftdi1 ftdi-eeprom
  2. Create a file "flash_digilent.conf" with the following content: