Skip to content

Instantly share code, notes, and snippets.

View vimagick's full-sized avatar
🐰
🐰🐰🐰🐰🐰🐰🐰🐰🐰

K̶e̶v̶i̶n̶ vimagick

🐰
🐰🐰🐰🐰🐰🐰🐰🐰🐰
View GitHub Profile
@vimagick
vimagick / build.sh
Created January 8, 2026 07:20
build pre-configured ss-tunnel.pkg for macOS
#!/bin/bash
NAME=ss-tunnel
VERSION=1.24.0
PKG_ID=org.duckdns.easypi.$NAME
PKG_NAME=${NAME}_${VERSION}.pkg
DOWNLOAD_URL=https://github.com/shadowsocks/shadowsocks-rust/releases/download/v${VERSION}/shadowsocks-v${VERSION}.aarch64-apple-darwin.tar.xz
DOWNLOAD_DIR=./payload/usr/local/bin
mkdir -p $DOWNLOAD_DIR

Linux

$ docker run --rm -it -v $PWD:/tmp golang:1.23
>>> version=1.9.2
>>> go install github.com/Jigsaw-Code/outline-ss-server/cmd/outline-ss-server@v$version
>>> cd /go/pkg/mod/github.com/\!jigsaw-\!code/outline-ss-server@v$version/cmd/outline-ss-server
>>> sed -i '90s@^@\tslog.LogAttrs(nil, slog.LevelInfo, "TCP: Found client.", slog.String("ID", entry.ID), slog.String("IP", clientIP.String()))@' ../../service/tcp.go
[Interface]
PrivateKey = ******
Address = 192.168.x.x/24
DNS = 8.8.x.x
[Peer]
PublicKey = ******
AllowedIPs = 192.168.x.0/24, 8.8.0.0/16
Endpoint = x.x.x.x:51820
PersistentKeepalive = 25

Keybase proof

I hereby claim:

  • I am vimagick on github.
  • I am vimagick (https://keybase.io/vimagick) on keybase.
  • I have a public key ASCYaaWA0pKAzSqUKYQZKKaFXfQ0OjjeNwQy1sScAWSuKQo

To claim this, I am signing this object:

function FindProxyForURL(url, host) {
return "DIRECT";
}
#!/bin/sh
WG_HOSTS="192.168.X.1 192.168.Y.1 192.168.Z.1"
WG_IFACE=wg
for host in $WG_HOSTS; do
ping -q -W 1 -i 2 -c 3 $host || { ifup $WG_IFACE; break; }
done
@vimagick
vimagick / macos-enable-wireguard-gateway.sh
Last active January 10, 2025 03:47
Enable LAN Access from Wireguard Peers
#!/bin/bash
# enable ip forwarding
sudo sysctl -w net.inet.ip.forwarding=1
# disable pf firewall
sudo pfctl -d
# flush nat rules
sudo pfctl -F nat
#!/bin/bash
CONTAINER_NAME=${1:?container name is empty}
NETWORK_MODE=$(docker inspect -f "{{.HostConfig.NetworkMode}}" $CONTAINER_NAME)
STATE_PID=$(docker inspect --format '{{.State.Pid}}' $CONTAINER_NAME)
VETH_NAME=
if [[ $NETWORK_MODE = "host" ]]; then
VETH_NAME="host"
else
#!/usr/local/bin/bash
#
# Background Music / Sound Effects Downloader
#
BASE_URL=https://www.tukuppt.com
IDX_URL=$BASE_URL/peiyueso/shipin5097/__zonghe_0_0_0_0_0_0_%d.html
#IDX_URL=$BASE_URL/yinxiaomuban/shipin/__zonghe_0_0_0_0_0_0_%d.html
API_URL=$BASE_URL/api/audio
TOTAL_PAGES=46