Skip to content

Instantly share code, notes, and snippets.

View shibeta's full-sized avatar
🏠
Working from home

月森風雅 shibeta

🏠
Working from home
View GitHub Profile
@shibeta
shibeta / Reddit 自动中文翻译
Created June 30, 2025 12:33
Tampermonkey脚本,尝试向reddit页面中自动添加tl=zh-hans以启用reddit自带的翻译功能
// ==UserScript==
// @name Reddit 自动中文翻译
// @namespace shibeta
// @version 2.0
// @description 自动将 Reddit 页面的 'tl' URL 参数设置为 'zh-hans' 以触发翻译。使用 sessionStorage 防止在不支持翻译的页面上发生无限重定向循环。
// @author shibeta
// @match http://*.reddit.com/*
// @match https://*.reddit.com/*
// @grant none
// @run-at document-start
@shibeta
shibeta / ip_range_to_cidr_converter.py
Created August 23, 2024 03:40
Convert ip range to ipcidr
'''
Convert
192.168.0.0-192.168.2.255
to
"192.168.0.0/23",
"192.168.2.0/24",
'''
import ipaddress
def ip_range_to_cidrs(start_ip:str, end_ip:str):
@shibeta
shibeta / ipv6-prefix-change.sh
Created August 18, 2024 05:40
因为家里的光猫不会自动重新下发ipv6-pd,所以写了一个脚本,当openwrt路由器ipv6路由不可达时自动重启wan6接口
#!/bin/sh
FLAG_FILE="/tmp/ipv6_prefix_change_flag"
FLAG_VALUE=$(cat $FLAG_FILE 2>/dev/null)
if [ "$FLAG_VALUE" = "1" ]; then
logger -t prefix_change "Script is already running. Skipping execution."
exit 0
fi
@shibeta
shibeta / cloudflare_ddns.py
Last active June 30, 2025 12:26
简单的cloudflare ddns脚本,无须使用ipv6一堆毛病的docker
import requests
import ipaddress
proxy = {
"http": '',
"https": ''
}
# 设置 Cloudflare API token 和域名
api_token = 'https://dash.cloudflare.com/profile/api-tokens' # 替换为你的 Cloudflare API token
@shibeta
shibeta / alist_reload_storage.py
Created August 18, 2024 05:30
reload all storage on alist, since alist does not support auto reload.
import requests
import sys
# Configuration
BASE_URL = "http://ip:8455"
USERNAME = "admin" # to manage storage, admin permission is required
PASSWORD = "{{PASSWORD}}"
MAX_LOGIN_ATTEMPTS = 5
MAX_RELOAD_ATTEMPTS = 3
@shibeta
shibeta / enable_eui64.bat
Last active August 21, 2024 07:01
Run on startup to enable EUI64 on Windows
:: Runas ADMINISTRATOR
@ECHO OFF&(PUSHD "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(
powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)
:: These settings will be restored everytime Windows reboot
netsh interface ipv6 set global randomizeidentifiers=disabled
netsh interface ipv6 set privacy state=disabled
:: Change 网桥 to your interface name, usually Ethernet
:: Show all interface: netsh interface show interface