Skip to content

Instantly share code, notes, and snippets.

View fffonion's full-sized avatar

Wangchong Zhou fffonion

View GitHub Profile
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 /
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 / replaceCert.ps1
Created December 19, 2023 14:20
Replace cert for Remote desktop and Windows Admin Center
function 测试UAC
process {
[Security.Principal.WindowsPrincipal]$用户 = [Security.Principal.WindowsIdentity]::GetCurrent();
return $用户.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator);
fffonion /
Created September 28, 2019 22:32
Setting up dash button without Amazon App
import requests
import re
import sys
# Initial work from:
h = requests.Session()
fffonion / github-widescreen.user.js
Last active September 25, 2023 08:43
// ==UserScript==
// @name Github Widescreen Fix
// @namespace
// @updateURL
// @downloadURL
// @version 0.2
// @description try to take over the world!
// @author You
// @match*/*/actions/runs/*/job/*
// @match*/*
fffonion / .htaccess
Last active September 20, 2023 00:40
Google镜像 恢复背景图片,代理谷歌快照,去除了url跳转,关闭安全搜索 http://g.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 /
Last active August 26, 2023 21:10
Extract subtitles track
bf=$(basename "$filename")
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
index-url =
extra-index-url =
fffonion /
Last active November 16, 2022 08:57
Simple GeoIP and ASNnum query server
  • nginx with ngx_http_geoip_module, echo-nginx-module, lua-nginx-module is required; libgeoip needs to be installed and geoip database should be placed under /usr/share/GeoIP.
  • for current GeoIP and for current IP only
  • to query any IP.
  • for GeoIP of domain-name and to return IP of domain-name only. If multiple IPs are set to single domain-name, all of them will be returned. Only A record will be used.
  • Sample requests are:
$ curl
Country, Region, City
ASN number
fffonion /
Last active August 1, 2022 06:03
artemis resource unpack
# coding:utf-8
import struct
import os
import os.path as opth
import sys
__version__ = 1.0
getPATH0 = lambda: sys.path[0].decode(sys.getfilesystemencoding())
# 命令行处理