Skip to content

Instantly share code, notes, and snippets.

View fffonion's full-sized avatar

Wangchong Zhou fffonion

View GitHub Profile
@fffonion
fffonion / rerun-gha.user.js
Last active February 6, 2026 11:51
Auto retrigger GHA
// ==UserScript==
// @name Rerun GHA automagically
// @namespace http://yooooo.us
// @updateURL https://gist.github.com/fffonion/171720e4b6a23f0587e50dbecbab1ebf/raw/rerun-gha.user.js
// @downloadURL https://gist.github.com/fffonion/171720e4b6a23f0587e50dbecbab1ebf/raw/rerun-gha.user.js
// @version 0.48
// @description awesome!
// @author You
// @match https://github.com/*/*/pull/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
@fffonion
fffonion / verify_season.py
Created December 25, 2025 22:54
Jellyfin Season Verification
import requests
import sys
from datetime import datetime
# Configuration
JELLYFIN_URL = "http://jellyfin:8096" # Change to your Jellyfin server URL
API_KEY = "123456789" # Create one from Dashboard -> API keys
LOG_FILE = "jellyfin_invalid_seasons.log"
@fffonion
fffonion / setup-dashbutton.py
Created September 28, 2019 22:32
Setting up dash button without Amazon App
import requests
import re
import sys
# Initial work from: https://mpetroff.net/2016/07/new-amazon-dash-button-teardown-jk29lp/
h = requests.Session()
BASE_URL = "http://192.168.0.1"
@fffonion
fffonion / main.cpp
Created June 30, 2020 09:20
Read Xiaomi Mijia temperature and humidity sensor 2 (LYWSD03MMC) from ESP32
#include <Arduino.h>
#include <BLEDevice.h>
BLEClient *pClient;
BLEScan *pBLEScan;
#define SCAN_TIME 10 // seconds
bool connected = false;
@fffonion
fffonion / animated.sh
Created September 29, 2024 08:35
Prepare telegram stickers
#!/bin/bash
mkdir -p ani ani-s
input_file="$1"
fix_factor="${2:-1}"
# Get the duration of the video
duration=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$input_file")
@fffonion
fffonion / patch_nginx_listeners.py
Last active January 14, 2024 23:05
Patch nginx configurations to add quic listeners and use new http2 directive.
#!/usr/bin/env python3
import os
import re
import sys
import argparse
def modify(path, args):
print("DO: ", path)
@fffonion
fffonion / replaceCert.ps1
Created December 19, 2023 14:20
Replace cert for Remote desktop and Windows Admin Center
function 测试UAC
{
[OutputType([bool])]
param()
process {
[Security.Principal.WindowsPrincipal]$用户 = [Security.Principal.WindowsIdentity]::GetCurrent();
return $用户.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator);
}
}
@fffonion
fffonion / github-widescreen.user.js
Last active September 25, 2023 08:43
github-widescreen.user.js
// ==UserScript==
// @name Github Widescreen Fix
// @namespace http://tampermonkey.net/
// @updateURL https://gist.github.com/fffonion/4f7bd4511ca1b6798ec422ae37fd5376/raw/github-widescreen.user.js
// @downloadURL https://gist.github.com/fffonion/4f7bd4511ca1b6798ec422ae37fd5376/raw/github-widescreen.user.js
// @version 0.2
// @description try to take over the world!
// @author You
// @match https://github.com/*/*/actions/runs/*/job/*
// @match https://github.com/*/*
@fffonion
fffonion / .htaccess
Last active September 20, 2023 00:40
Google镜像 恢复背景图片,代理谷歌快照,去除了url跳转,关闭安全搜索 http://g.yooooo.ushttp://gc.yooooo.us
#Redirect 301 ^/$ /search.htm
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} !^/index\.htm
#RewriteCond %{REQUEST_URI} !^/image\.htm
#RewriteCond %{REQUEST_URI} !^/m\.htm
#RewriteCond %{REQUEST_URI} !^/mi\.htm
@fffonion
fffonion / extract_subtitles.sh
Last active August 26, 2023 21:10
Extract subtitles track
#!/bin/bash
f="$1"
IFS=$'\r\n'
filename="${f%.*}"
bf=$(basename "$filename")
options=()
moptions=()
for s in $(ffprobe "$f" -show_entries stream=index,codec_type,codec_name:stream_tags=language,title -of compact 2>/dev/null|grep "codec_type=subtitle"); do