Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working 👍

Quack~ ookangzheng

🏠
Working 👍
View GitHub Profile
View One Liner to Download the Latest Release from Github Repo.md
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
View knot-resolver-http-module-not-found.md

Knot resolver on Debian HTTP module not found

Error Message

kresd -c /etc/knot-resolver/53/kresd.conf
[system] error: module 'kres_modules.http' not found:
	no field package.preload['kres_modules.http']
	no file '/usr/lib/knot-resolver/kres_modules/http.lua'
	no file '/usr/lib/knot-resolver/kres_modules/http/init.lua'
@ookangzheng
ookangzheng / remove-node-modules-on-linux-mac-cli.md
Created Oct 11, 2022
Remove node_modules recursivly on Linux or Mac cli
View remove-node-modules-on-linux-mac-cli.md

One line CLI remove node_modules

find . -name "node_modules" -type d -prune -print -exec rm -rf '{}' \;
View Install-nodejs-with-fnm-on-debian.md
@ookangzheng
ookangzheng / README.md
Created Oct 3, 2022 — forked from sutlxwhx/README.md
Synchronize folders between two servers using rclone and ssh-agent with ssh based authorisation
View README.md

Introduction

This tutorial will help you transfer your folders / files between two server using rclone and ssh-agent.
It was tested between two Ubuntu 16.04 servers.

Installation

First things first. We need to install the neccessary packages:

apt-get update -y
@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