Skip to content

Instantly share code, notes, and snippets.

View hUwUtao's full-sized avatar
😔
being vibecoded out of no free time

stdpi hUwUtao

😔
being vibecoded out of no free time
View GitHub Profile
@hUwUtao
hUwUtao / Bai3.md
Last active September 22, 2025 07:39
Học sinh giỏi TPHN - Tin Học: Bài 3

Bài 3: Rừng cây "RC.*" (draft)

Trong một rừng cây có $N$ cây, các cây được đánh số từ $1$ đến $N$, có tất cả $M$ loại cây.
Cây thứ $i$ thuộc loại $B_i ;(1 \leq B_i \leq M).$

Chênh lệch chiều cao của rừng cây được tính theo công thức: tổng các giá trị tuyệt đối của hiệu chiều cao giữa tất cả các cặp cây khác loại nhau.
Nghĩa là chênh lệch chiều cao của rừng cây được tính bằng công thức

$\sum |C_i - C_j|\forall 1 \le i < j \le N, ; B_i \ne B_j$

@hUwUtao
hUwUtao / state.md
Last active September 1, 2025 09:41
OpenDCHU - A Linux kernel driver to tamper with DCHU

OpenDCHU

An open source implementation of InsydeDCHU driver

Supported features

  • Fan hwmon
  • Fan state set (two state no graph)
  • Perf state set (hobo)
  • Keyboard light brightness (5 state)
@hUwUtao
hUwUtao / lokiquery.md
Created June 13, 2025 14:26
pihole dnsmasq log loki parsed
{job="dnsmasq"} | regexp `(?P<syslog_date>[A-Z][a-z]{2} \d{2} \d{2}:\d{2}:\d{2}) dnsmasq\[(?P<pid>\d+)\]: (?P<state>[^\s\[]*)(\[(?P<qtype>[A-Z]*)\])? (?P<domain>[^\s]*) (from (?P<client>.*))?(is (?P<destination>[^<]*))?`
@hUwUtao
hUwUtao / README.md
Created May 17, 2025 16:29
Android 15 Thirdpary app that support predictive back gesture.
borked means it was support on android 14 but not on android 15, which i found android 15 was not play well with activity transition???

Open source

  • Symphony

Borked

  • Shizuku
@hUwUtao
hUwUtao / original.js
Last active September 4, 2024 17:57
Force UrlEncode URL (might not webserver compliant)
"".split("/")
.map((p, i) =>
i >= 3
? p
.split("")
.map((c) =>
"?#".includes(c)
? c
: `%${c.charCodeAt(0).toString(16).padStart(2, "0")}`,
)
@hUwUtao
hUwUtao / readme.md
Last active July 24, 2024 16:42
automatically deploy wings

Install

  1. sudo su
  2. install acme.sh as root
  3. open port 80 and acme.sh --issue --standalone -d <YOUR_DOMAIN>
echo "DOMAIN=<YOUR_DOMAIN>">.env
curl -LO https://gist.githubusercontent.com/hUwUtao/896f925b51f0c50e100af70c671450d0/raw/28e5e79cb9d1e49427addee286f986cc75a11c49/wings.sh
chmod +x wings.sh
./wings.sh
@hUwUtao
hUwUtao / compare_in_range.c
Last active May 17, 2024 12:13
prime related c pracs
int main() {
ll a,b,c,d,e=0,f=0;
scanf("%lld %lld %lld %lld", &a,&b,&c,&d);
#define in(n,l,g) n >= l && n <= g
for(ull i = (a<c?a:c) ; i<= (b>d?b:d) ; i++){
if(!pr(i)){
if(in(i,a,b))e++;
if(in(i,c,d))f++;
//printf("%lld %lld %lld\n",i,e,f);
}
@hUwUtao
hUwUtao / encit.sh
Last active May 12, 2024 19:02
A tool to quickly encrypt stuff without yapping about command line. Result a self-extract and pipeable. Still require user-typed password :))
#!/usr/bin/bash
COMPRESSION=${COMPRESSION:-"gzip"}
ALGORITHM=${ALGORITHM:-"-aes-256-cbc"}
OUTC=$([ "$PLSAVE" == true ]; printf ">\"$1\"")
OUTF="$1.sh"
echo $OUTC $OUTF
@hUwUtao
hUwUtao / 1.py
Last active March 1, 2024 10:12
cp 101
def main():
fs = open("flowers.inp", "r")
n = int(fs.readline())
a = list(map(int, fs.readline().split(" ")))
for i, c in enumerate(a[:-3]):
if c == a[i+1] == a[i+2] and c != a[i+3]:
print(n - i -1)
return
print(n)
main()
@hUwUtao
hUwUtao / 32.js
Created January 21, 2024 13:11
simai explode
copy(
[...document.querySelectorAll("table")]
.slice(1, -3)
.flatMap((d) =>
[...d.querySelector("tbody").querySelectorAll("tr")].map((r) =>
[...r.querySelectorAll("td")].map((r) => r.innerHTML),
),
)
.map((r) =>
r[0].startsWith("<a")