Skip to content

Instantly share code, notes, and snippets.

View diyism's full-sized avatar

Malcolm Ke Win diyism

View GitHub Profile
@diyism
diyism / playwright-go.txt
Last active October 28, 2024 18:19
playwright-go
# how to work in kali/debian/ubuntu22.04(jammy), ref: https://gist.github.com/diyism/4b892a4339f35561dd2ec48158a8c75d
# the playwright in playwright-go currently only supports ubuntu 20.04(focal)
$ sudo singularity build -s ubuntu_focal/ docker://ubuntu:focal
$ sudo singularity shell --writable ubuntu_focal/
$ pwd // /root
$ mkdir WorkSpace_sing_ubuntu_focal
$ cd WorkSpace_sing_ubuntu_focal
$ apt update
@diyism
diyism / x11docker (linux sanbox like android shelter app)
Last active October 9, 2024 01:57
x11docker (linux sanbox like android shelter app)
========update============
不需要x11docker, 更简单的方法, 直接允许容器访问host的X server:
https://gist.github.com/diyism/8f0d4b1cdfc4e9d0839927e78c90a327
=========================
"现在有很多国产linux程序了,比如 钉钉/飞书,
则linux上也有了隔离国产程序的需求,
试了1.virtualbox, 2.firejail, 3.docker theasp/novnc,
都不够方便实用, 最好用启动单个程序最快的是x11docker
@_:10个我离不开的android应用:
@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 <[email protected]>
# 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 June 18, 2024 17:21
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")