Skip to content

Instantly share code, notes, and snippets.

View chenx-dust's full-sized avatar

Chenx Dust chenx-dust

View GitHub Profile
@chenx-dust
chenx-dust / steam-ibus-fix.sh
Created September 20, 2025 10:21
Steam IBus SetEngine Fix
#!/bin/bash
pattern='method call time=[0-9]+\.[0-9]+ sender=[^ ]+ -> destination=[^ ]+ serial=[^ ]+ path=[^ ]+; interface=org.freedesktop.IBus.InputContext; member=SetEngine'
dbus-monitor --address `ibus address` | while IFS= read -r line; do
if [[ $line =~ $pattern ]]; then
read -r raw
engine=$(echo $raw | sed 's/.*string "\([^"]*\)".*/\1/')
ibus engine $engine
echo "Switching to engine: $engine"
@chenx-dust
chenx-dust / bypass.js
Created April 29, 2025 09:32
临时用 hoa.moe 直接转跳脚本
// ==UserScript==
// @name 临时用 hoa.moe
// @namespace https://hoa.moe/
// @version 2025-04-29
// @description try to take over the world!
// @author Chenx Dust
// @match https://hoa.moe/docs/*
// @grant none
// ==/UserScript==
@chenx-dust
chenx-dust / v4pfwd.sh
Created September 13, 2024 06:49
Simple port forward tool using iptables with domain support
#!/bin/bash
# Forward a local port to a port on another machine using iptables
port_forward_add() {
local local_port=$1
local remote_host=$2
local remote_port=$3
local protocol=$4
# Add iptables rule to forward the port
@chenx-dust
chenx-dust / warp.py
Last active January 23, 2024 07:16
Cloudflare WARP 注册 Python 脚本 / Cloudflare WARP Register Python Script
# REWRITE FROM https://github.com/badafans/warp-reg/blob/main/main.go
import base64
from dataclasses import dataclass
import datetime
import json
import random
import string
import urllib.request
import urllib.error
from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey
@chenx-dust
chenx-dust / surge_copilot_service.js
Last active March 24, 2024 08:08
OpenAI ChatGPT API to Github Copilot Surge Script
async function handleRequest(request) {
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "POST, OPTIONS",
"Access-Control-Allow-Headers": "*",
};
if (request.method === "OPTIONS") {
return new Response(null, {
status: 200,