Skip to content

Instantly share code, notes, and snippets.

View diyism's full-sized avatar

Malcolm Ke Win diyism

View GitHub Profile
@diyism
diyism / cloaky test (cbeuw Cloak + sniproxy)
Last active October 17, 2022 07:54
cloaky test (cbeuw/Cloak + sniproxy)
$ cat cloaky_server.json
{
"ProxyBook": {
"sniproxy": [
"tcp",
"127.0.0.1:443"
]
},
"BindAddr": [
"===server lan ip=========:443"
@diyism
diyism / compile termux-bootstraps.zip
Last active December 14, 2023 20:20
compile termux-bootstraps.zip
#########################################################################################
在Termux+pRoot(AnLinux, Andronix)里跑不起来dockerd进程, 也跑不了任何x64程序/命令,
用alpine-term应用(https://github.com/diyism/alpine-term 578MB,
https://github.com/sylirre/vmConsole 1.01GB)才行,
可以在它的docker里跑x86-64的docker image,用随身的arm64 android手机/平板就可以运行任何x64 docker app了
安装好后在alpine-term应用里执行sudo apk add -u go 会报错 untrsuted signature, 需要先:
sudo apk add -X https://dl-cdn.alpinelinux.org/alpine/v3.18/main -u alpine-keys --allow-untrusted
#########################################################################################
@diyism
diyism / build_waydroid_v5.sh
Created June 11, 2022 10:35 — forked from cniw/build_waydroid_v8.sh
Build Waydroid for Debian or Ubuntu based distro v5
#!/bin/bash
# script name: build_waydroid_v5.sh
# description: Build Waydroid for Debian or Ubuntu based distro v5
# upstream : https://gist.github.com/cniw/98e204d7dbc73a3fa1bf61629b2a2fc1
# author : Wachid Adi Nugroho <wachidadinugroho.maya@gmail.com>
# date : 2022-05-11
NC='\033[0m'
RED='\033[1;91m'
GREEN='\033[1;92m'
@diyism
diyism / databend mysql on storj s3.txt
Last active May 19, 2022 04:34
databend mysql on storj s3
$ wget https://github.com/datafuselabs/databend/releases/download/v0.7.51-nightly/databend-v0.7.51-nightly-x86_64-unknown-linux-musl.tar.gz
$ tar xf databend-v0.7.51-nightly-x86_64-unknown-linux-musl.tar.gz
$ nano databend-query.toml
$ cat databend-query.toml
[storage]
type = "s3"
[storage.s3]
bucket = "databend"
endpoint_url = "https://gateway.us1.storjshare.io"
@diyism
diyism / rclone with storj(ipfs).txt
Last active January 4, 2024 00:47
rclone with storj(ipfs)
curl https://rclone.org/install.sh | sudo bash
装最新版rclone支持storj的150GB免费空间(apt里版本太旧不支持storj),
本地上传/下载到storj us带宽大概0.8MB/s,
而在VPS里玩能到8MB/s,
用"rclone rcd --rc-web-gui"能启动网页版管理界面,
觉得可作为VPS的扩展盘使用,
可惜没集成player,folder comparer
https://docs.storj.io/dcs/how-tos/sync-files-with-rclone/rclone-with-native-integration/
@diyism
diyism / qv2ray gun over cloudflare gprc.txt
Last active May 7, 2022 11:29
qv2ray gun over cloudflare gprc
#ssh into your vps
wget https://github.com/Qv2ray/gun/releases/download/0.2.1/gun-dedicated-linux-amd64
mv gun-dedicated-linux-amd64 gun
sudo install gun /usr/bin/
wget https://github.com/diyism/microsocks/releases/download/v1.0.3/microsocks
sudo install microsocks /usr/bin/
while true; do nohup /usr/bin/microsocks -i 127.0.0.1 -p 8081 >/dev/null 2>&1; sleep 1; done &
while true; do nohup /usr/bin/gun -mode server -local :8443 -remote 127.0.0.1:8081 -name <password> -cert cert.pem -key cert.key >/dev/null 2>&1; sleep 1; done &
#or share site key with caddy, cloudflair proxy 443, 8443(Plesk Panel SSL), 2083/2087/2096(Cpanel SSL), 2053(Kerberos remote login):
#gun -mode server -local :2096 -remote 127.0.0.1:8081 -name <password> -cert /root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/mydomain.com/mydomain.com.crt -key /root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/mydomain.com/mydomain.com.key
@diyism
diyism / naive proxy quic.txt
Last active June 6, 2022 17:19
naive proxy quic
#ssh into your vps:
wget https://go.dev/dl/go1.18.3.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz
cd /root/ ; nano ./profile #add "export PATH=$PATH:/usr/local/go/bin"
exit
#ssh into your vps again
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
${GOPATH}/bin/xcaddy build --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive
Caddyfile in server(installed latest github.com/klzgrad/forwardproxy@naive):
@diyism
diyism / v2ray wss over cloudflare 8443 proxy.txt
Last active February 21, 2023 08:00
v2ray wss over cloudflare 8443 proxy
use "time curl --socks5 localhost:8081 https://1.1.1.1 | head -n 20" to compare naiveproxy, v2ray, wssocks, and qv2ray:
naive quic direct: 0.4s
naive http2 direct: 0.4s
v2ray over cloudflare wss: 0.4s to 0.7s
wssocks-linux-amd64 over cloudflare wss: 0.6s
qv2ray gun over cloudflare grpc 0.7s to 0.9s
(naive http2 won't proxy over cloudflare: Network/http2/help: "The connection from Cloudflare to your origin will be made over HTTP 1.x")
@diyism
diyism / vercel php serverless.md
Last active November 18, 2022 01:38
vercel php serverless

build your vercel php serverless website:

  1. create github private repo

  2. create vercel.json in the private repo:

    {
      "builds":[{"src": "/api/*.php", "use": "vercel-php@0.5.2"},
                {"src": "/api/*.go", "use": "@vercel/go"},
    

{"src": "**/*.ico", "use": "@vercel/static"},

@diyism
diyism / cloudflared tunnel.txt
Last active April 6, 2024 15:16
cloudflared tunnel
# don't use cloudflared-linux-arm64, will happen error to use /etc/resolv.conf which doesn't exist in android
// wget https://github.com/cloudflare/cloudflared/releases/download/2022.4.1/cloudflared-linux-arm64
$ wget https://github.com/diyism/TermuxXserver/releases/download/test/termux-cloudflared
$ install termux-cloudflared /data/data/com.termux/files/usr/bin/cloudflared
$ cloudflared tunnel login #it will auto open android browser from termux, generate ~/.cloudflared/cert.pem
$ cloudflared tunnel create www1 #generate ~/.cloudflared/<tunnel id>.json, include tunnel secret
$ cloudflared tunnel route dns www1 www1.mysite.com #add dns record in dns server
$ nano ~/.cloudflared/www1.yml