This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |