Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working 👍

Quack~ ookangzheng

🏠
Working 👍
View GitHub Profile
@ookangzheng
ookangzheng / hetzenr-ddns-update.md
Last active Jun 26, 2022
Hetzner DDNS update script
View hetzenr-ddns-update.md

Auto check latest VPS IP and update DDNS record on Hetzner

Last updated on: 2022/06/26

cd /root/

wget https://gist.githubusercontent.com/ookangzheng/c1f6894470d362c4356911691c24f67d/raw/update-hetzner-dns.sh
@ookangzheng
ookangzheng / gist:213d6c3a23f855150eb67eee74d49ae2
Created Jun 21, 2022 — forked from clyang/gist:4f3e9f4098469cf53715ed64bede3932
10GB以上的測速檔案 (IPv4及IPv6) - 10GB+ Speedtest file urls (IPv4 & IPv6)
View gist:213d6c3a23f855150eb67eee74d49ae2
http://download.xs4all.nl/test/10GB.bin
http://ftp.iinet.net.au/test500MB.dat
http://lg-tor.fdcservers.net/10GBtest.zip
http://lg.ams2-c.fdcservers.net/10GBtest.zip
http://lg.chi2-c.fdcservers.net/10GBtest.zip
http://lg.den2-c.fdcservers.net/10GBtest.zip
http://lg.fra2-c.fdcservers.net/10GBtest.zip
http://lg.la2-c.fdcservers.net/10GBtest.zip
http://lg.lon-c.fdcservers.net/10GBtest.zip
http://lg.mad-c.fdcservers.net/10GBtest.zip
@ookangzheng
ookangzheng / ddns-with-cloudflare-dns.md
Last active Jun 14, 2022
Ddns with Cloudflare DNS #linux
View ddns-with-cloudflare-dns.md

Use case

  1. VPS has dynamic IP which changed few times a week or month.
  2. Self-hosted NAS or homelab which use dynamic IP from ISP.

Setup and config

  1. Download script below and assign excuatable permission
wget https://gist.githubusercontent.com/ookangzheng/321a02aba98c5863b3f95ae3beeb0c45/raw/update-cloudflare.sh && chmod +x update-cloudflare.sh
@ookangzheng
ookangzheng / Debian-setup-timezone.md
Created Jun 14, 2022
Debian setup timezone #linux
View Debian-setup-timezone.md

Setup Timezone

## Get current time
timedatectl status

## Set new timezone
timedatectl set-timezone Asia/Taipei
@ookangzheng
ookangzheng / optimal_mtu.md
Created Jun 6, 2022 — forked from nitred/optimal_mtu.md
Wireguard Optimal MTU
View optimal_mtu.md

About

  • I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
  • I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
  • Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.

Testing

  • On WG server, I started an iperf3 server
  • On WG peer, I wrote a script that does the following:
    • wg-quick down wg0
  • Edit MTU in the /etc/wireguard/wg0.conf file
@ookangzheng
ookangzheng / iperf3-speedtest-with-wireguard-server-client.md
Created Jun 6, 2022
iperf3 speedtest via wireguard between server and client
View iperf3-speedtest-with-wireguard-server-client.md

Start with iperf3

apt install iperf3

Start the server

iperf3 --server
@ookangzheng
ookangzheng / debian11-error-gpg-is-not-signed-while-install-docker.md
Created Jun 3, 2022
Debian 11 gpg error is not signed while install docker
View debian11-error-gpg-is-not-signed-while-install-docker.md

Solution

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg


echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
View install-umami-with-docker-compose.md

Install

mkdir umami
cd umami
wget https://cdn.jsdelivr.net/gh/mikecao/umami@master/sql/schema.postgresql.sql
wget https://cdn.jsdelivr.net/gh/mikecao/umami@master/docker-compose.yml
docker-compose up -d
docker exec -i umami-db-1 psql -U umami -d umami < schema.postgresql.sql
@ookangzheng
ookangzheng / fix-mac-osx-app-damanged-move-to-trash.md
Created May 4, 2022
Fix Mac OSX app damaged and move to trash
View fix-mac-osx-app-damanged-move-to-trash.md
@ookangzheng
ookangzheng / wireguard-fix.md
Last active Mar 30, 2022
Wireguard 疑難雜症
View wireguard-fix.md

Wireguard packet dropped

Method 1

iptables -t mangle -I FORWARD -o wg0 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1372

Method 2