This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 对Verge的深度CSS注入适配 | |
| 感谢 @ChengZhiMeow 做了大部分的CSS属性匹配和兼容性测试 | |
| */ | |
| @media (prefers-color-scheme: dark) { | |
| .layout-content__left .the-logo, | |
| .layout-content__left .the-menu, | |
| .layout-content__left .the-traffic, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |