Skip to content

Instantly share code, notes, and snippets.

View yujqiao's full-sized avatar

Yujia Qiao yujqiao

View GitHub Profile
@yujqiao
yujqiao / ica_watch.py
Last active September 22, 2025 14:55
ICA Application Status Watcher
'''
This is a helper script to watch application status and send notification on any state change.
Use at your own risk.
Set env var APPLICATION_NO to your case number e.g. ISC25000000000
Set env var CHECK_INTERVAL to refresh interval in seconds
Set env var INITIAL_COOKIES to the cookie after log in to ICA website, in http header format
Implement your own notification logic in send_notification
'''
@yujqiao
yujqiao / Caddyfile
Last active April 7, 2025 09:31
WSJ + archive.today reverse proxy using caddy
{
# needed to use replace-response plugin
order replace after encode
}
# serve a site that redirect all articles to archive.today, and reverse proxy other pages
http:// {
@wsjArticles path /articles/*
redir @wsjArticles "http://archive.today/?run=1&url=https://cn.wsj.com{uri}" 302
@yujqiao
yujqiao / count_clients.sh
Created September 21, 2022 05:03
Count online clients on OpenWrt
#!/bin/sh
mac_blacklist="01:00:8c:fa:1a:ae:d1"
leases=$(cat /tmp/dhcp.leases | sed 's/*/unknown/')
IFS='
'
online_cnt=0
# grep NUD status, see also https://www.ccexpert.us/routing-tcp-ip-2/neighbor-unreachability-detection.html
@yujqiao
yujqiao / crun.fish
Created February 18, 2021 14:22
Fish script to compile and run c program like go run
# Compile and run c program, just like `go run`
# Usage: crun hello.c
# Put this to ~/.config/fish/config.fish, or create a file in ~/.config/fish/functions/
function crun
set prog $argv[1]
set exec (mktemp)
if gcc $prog -o $exec
set_color brgreen
echo -e Compilation success. Running...\n
@yujqiao
yujqiao / gsoc2020-ds.md
Last active March 1, 2023 12:35
GSoC 2020 Sequential Data Structures
@yujqiao
yujqiao / gsoc2020-ds-notes.md
Last active August 26, 2020 03:22
GSoC 2020 - Chapel - Notes on Data Structure
@yujqiao
yujqiao / README.md
Created February 14, 2020 14:07
FeelUOwn 一起听歌

依赖

服务器需要 python3.7 以上版本 客户端除了 FeelUOwn 无其他依赖

客户端

__init__.py放到~/.FeelUOwn/plugins/sync下,如果没有此目录请建立

服务器

直接运行server.py就行