Skip to content

Instantly share code, notes, and snippets.

@Sn0wo2
Sn0wo2 / example.py
Created February 4, 2026 18:57
Masque key
import base64
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ec
private_key = ec.generate_private_key(ec.SECP256R1())
private_bytes = private_key.private_bytes(
encoding=serialization.Encoding.DER,
format=serialization.PrivateFormat.TraditionalOpenSSL,
encryption_algorithm=serialization.NoEncryption()
@Sn0wo2
Sn0wo2 / verge-custom-background.css
Last active January 13, 2026 03:43
VergeCustomBackgroundCSS Inject
/*
对Verge的深度CSS注入适配
感谢 @ChengZhiMeow 做了大部分的CSS属性匹配和兼容性测试
*/
@media (prefers-color-scheme: dark) {
.layout-content__left .the-logo,
.layout-content__left .the-menu,
.layout-content__left .the-traffic,
@Sn0wo2
Sn0wo2 / upgrade_opkg.sh
Last active January 1, 2026 07:37
upgrade opkg all packages
# Thanks https://www.pcoic.com/system/linux/3261.html
#!/bin/bash
set -e
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
echo "==> Updating package lists ..."
opkg update
TMP=$(mktemp)
opkg list-upgradable | grep -v '^Multiple' > "$TMP" || true
@Sn0wo2
Sn0wo2 / run.py
Last active October 24, 2025 17:02
Batch delete unauthorized tailscale machines
# tailscale找了一圈没有批量删除所有未授权设备的地方然后写了个脚本
# docker配置失误发现给我创建了几百个未授权machines...
import requests, ssl, threading, time, queue, sys
from requests.adapters import HTTPAdapter
from urllib3 import Retry
API_TOKEN = "REPLACE_YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_TOKEN}", "Connection": "close"}
BASE_URL = "https://api.tailscale.com/api/v2"
THREADS = 1