Skip to content

Instantly share code, notes, and snippets.

View ayanamist's full-sized avatar

ayanamist ayanamist

  • 02:29 (UTC +08:00)
View GitHub Profile
@ayanamist
ayanamist / skill-policy-tui.py
Created September 11, 2026 01:48
Python TUI for managing Codex skill invocation policies with checkboxes, change previews, and explicit save confirmation, preserving other YAML fields and comments.
#!/usr/bin/env python3
"""Checkbox editor for skill invocation policy. Requires Python 3 and PyYAML.
Checked = policy.allow_implicit_invocation: false; unchecked = remove the key.
Space toggles, Enter previews, y commits, q/Escape cancels. No YAML reserialization.
"""
import argparse
import curses
import os
from pathlib import Path
@ayanamist
ayanamist / fcm.sh
Last active September 3, 2026 05:01
修复HyperOS新机制,导致GMS后台被打压,丢推送消息,需要通过adb shell来执行
#!/system/bin/sh
# 在 Termux 中先进入 rish,再执行:
# sh hyperos-fcm-termux.sh fix
# sh hyperos-fcm-termux.sh reconnect
set -eu
# GMS 是 Greezer 内置逻辑识别的特殊包,不建议改成其他包。
GMS='com.google.android.gms'
@ayanamist
ayanamist / chrome-update.sh
Created July 1, 2025 05:23
Fetches the latest Google Chrome installer URL for Windows x64.
#!/bin/bash
# This script fetches the latest Google Chrome installer URL for Windows x64.
XML_FILE=$(mktemp --suffix=.xml)
{ curl -s -d @- -o "$XML_FILE" -m 10 https://tools.google.com/service/update2 <<"EOF"
<?xml version="1.0" encoding="UTF-8"?>
<request protocol="3.0" updater="Omaha" updaterversion="1.3.36.372" shell_version="1.3.36.352" ismachine="0" sessionid="{11111111-1111-1111-1111-111111111111}" installsource="taggedmi" requestid="{11111111-1111-1111-1111-111111111111}" dedup="cr" domainjoined="0">
<hw physmemory="16" sse="1" sse2="1" sse3="1" ssse3="1" sse41="1" sse42="1" avx="1"/>
<os platform="win" version="10.0.26100.1742" arch="x64"/>
@ayanamist
ayanamist / tray.ahk
Created May 26, 2025 04:27
Run a console application "proxy.exe" and show a tray icon, provide show/hide console window+restart process ability.
; Script settings
#Persistent
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
; Process and window title variables
ProcessName := "proxy.exe"
ProxyPID := 0
WindowVisible := false
@ayanamist
ayanamist / mitm-cache-proxy.go
Last active June 14, 2022 02:44
一个特殊的MITM http proxy,将图片、js、css请求劫持并缓存在本地,后续再访问时直接从本地返回,避免一些垃圾网站打不开的问题
package main
import (
"bytes"
"compress/gzip"
"errors"
"flag"
"io"
"io/ioutil"
"log"
@ayanamist
ayanamist / errors.go
Created May 28, 2022 02:11
Go errors: combine multiple errors into one
package util
import (
"errors"
"strings"
)
type combinedErr struct {
errs []error
}
@ayanamist
ayanamist / miui_system_apps_url.md
Last active February 8, 2024 14:27
MIUI系统应用在应用商店的url

电脑上打不开,必须要用MIUI系统打开,会跳转到商店对应页面

@ayanamist
ayanamist / go.mod
Created April 15, 2021 07:02
Check Chrome Stable Update
module github.com/ayanamist/CheckChrome
require github.com/google/uuid v1.2.0
@ayanamist
ayanamist / magisk.json
Last active February 1, 2022 16:54
Magisk downgrade channel
{
"magisk": {
"version": "23.0",
"versionCode": "23000",
"link": "https://cdn.jsdelivr.net/gh/topjohnwu/magisk-files@23.0/app-release.apk",
"note": "https://topjohnwu.github.io/Magisk/releases/23000.md"
},
"stub": {
"versionCode": "21",
"link": "https://cdn.jsdelivr.net/gh/topjohnwu/magisk-files@23.0/stub-release.apk"
@ayanamist
ayanamist / xsh6to5.py
Created December 31, 2018 09:15
Convert Xshell 6 *.xsh files to Xshell 5 *.xsh format
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import ConfigParser
import codecs
import sys
import StringIO
def main():
config = ConfigParser.RawConfigParser(allow_no_value=True)