Skip to content

Instantly share code, notes, and snippets.

View ayanamist's full-sized avatar

ayanamist ayanamist

View GitHub Profile
@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/[email protected]/app-release.apk",
"note": "https://topjohnwu.github.io/Magisk/releases/23000.md"
},
"stub": {
"versionCode": "21",
"link": "https://cdn.jsdelivr.net/gh/topjohnwu/[email protected]/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)
@ayanamist
ayanamist / fcmproxy.go
Last active August 17, 2021 06:16
FCM proxy
package main
import (
"bufio"
"errors"
"flag"
"fmt"
"io"
"log"
"net"
@ayanamist
ayanamist / throttle.js
Created December 29, 2014 05:54
throttle function for node.js
/**
* 限制fn同时执行的个数,fn必须符合node函数规范,即参数最后一位是回调函数
* 如果有this绑定需求,需要提前bind好,否则this会变null。
*
* @param fn
* @param concurrency
* @returns {Function}
*/
function throttle(fn, concurrency) {
if (concurrency <= 0) {