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
@Birch-san
Birch-san / _06_fused_attention_blockptr_jvp.py
Last active September 2, 2025 02:13
Triton fused attention tutorial, updated with JVP support. Albeit with atol=1e-3 accuracy on JVP.
from __future__ import annotations
"""
Fused Attention
===============
This is a Triton implementation of the Flash Attention v2 algorithm from Tri Dao (https://tridao.me/publications/flash2/flash2.pdf)
Credits: OpenAI kernel team
Extra Credits:
import gc
from typing import Tuple
import torch
import torch.nn.functional as F
import triton
import triton.language as tl
import triton.testing
from kernels import get_kernel
@Seas0
Seas0 / multiple-tailnets.md
Last active December 3, 2025 06:12
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.

@thesamesam
thesamesam / xz-backdoor.md
Last active November 30, 2025 22:27
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@padeoe
padeoe / README_hfd.md
Last active December 5, 2025 02:32
CLI-Tool for download Huggingface models and datasets with aria2/wget: hfd

🤗Huggingface Model Downloader

Note

(2025-01-08) Add feature for 🏷️Tag(Revision) Selection, contributed by @Bamboo-D.
(2024-12-17) Add feature for ⚡Quick Startup and ⏭️Fast Resume, enabling skipping of downloaded files, while removing the git clone dependency to accelerate file list retrieval.

Considering the lack of multi-threaded download support in the official huggingface-cli, and the inadequate error handling in hf_transfer, This command-line tool leverages curl and aria2c for fast and robust downloading of models and datasets.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
@jmceleney
jmceleney / xiaomi-enable-mesh-telnet.py
Last active November 9, 2025 22:00
Python3 file that enables netmode4 on a Xiaomi RB01 AX3200 router
import ssl
import socket
# This script simply replays one side of an intercepted conversation between two Xiaomi
# RB01 (International) AX3200 routers negotiating meshing.
# In effect the script poses as a mesh slave, which causes the mesh master to enable netmode4.
# Enabling netmode is needed as one step in unlocking the router and flashing OpenWrt.
# The router should already have been taken through basic set-up before running this script.
# Netmode4 can be confirmed with curl by requesting the following URL, where ${token} is the "stok"
# variable from your admin session:
@francois-rozet
francois-rozet / flow_matching.py
Last active November 24, 2025 19:00
Flow Matching in 100 LOC
#!/usr/bin/env python
import math
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from sklearn.datasets import make_moons
from torch import Tensor
from tqdm import tqdm
@solarkraft
solarkraft / syncthing-automerge.py
Last active November 27, 2025 18:25
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",
@981213
981213 / ch347.c
Last active February 18, 2023 07:02
CH347 SPI library implemented with libusb
// SPDX-License-Identifier: BSD-1-Clause
/*
* Copyright (C) 2022 Chuanhong Guo <[email protected]>
*
* CH347 SPI library using libusb. Protocol reverse-engineered from WCH linux library.
* FIXME: Every numbers used in the USB protocol should be little-endian.
*/
#include <ch347.h>
#include <stdio.h>
@Zeinok
Zeinok / wine-breeze-dark-theme.md
Last active December 1, 2025 09:37
Breeze Dark theme for Wine

Made possible with this reddit post.

Install

wine regedit wine-breeze-dark.reg

Uninstall (Reset Wine color scheme)

wine regedit wine-reset-theme.reg