Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working 👍

Quack~ ookangzheng

🏠
Working 👍
View GitHub Profile
@ookangzheng
ookangzheng / Install-nodejs-with-fnm-on-debian.md
Created October 5, 2022 08:28
Install Nodejs with fnm on Debian
View Install-nodejs-with-fnm-on-debian.md
@ookangzheng
ookangzheng / optimal_mtu.md
Created June 6, 2022 09:02 — 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
@nitred
nitred / optimal_mtu.md
Last active June 1, 2023 07:28
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
View npm-audit.js
const { exec } = require('child_process')
const { promisify } = require('util')
const chalk = require('chalk')
// See: https://docs.npmjs.com/about-audit-reports#severity
const SEVERITY_LEVELS = ['low', 'moderate', 'high', 'critical']
const SEVERITY_THRESHOLD = 'critical'
const run = promisify(exec)
// Get the output of a command. If the command exits with a non-zero code, try
@ookangzheng
ookangzheng / Adblock-list-collection.md
Last active June 14, 2021 04:47
Adblock-list-collection
View Adblock-list-collection.md
@rjhansen
rjhansen / keyservers.md
Last active May 22, 2023 23:46
SKS Keyserver Network Under Attack
View keyservers.md

SKS Keyserver Network Under Attack

This work is released under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Terminological Note

"OpenPGP" refers to the OpenPGP protocol, in much the same way that HTML refers to the protocol that specifies how to write a web page. "GnuPG", "SequoiaPGP", "OpenPGP.js", and others are implementations of the OpenPGP protocol in the same way that Mozilla Firefox, Google Chromium, and Microsoft Edge refer to software packages that process HTML data.

Who am I?

@ookangzheng
ookangzheng / git-refusing.md
Last active December 29, 2020 22:31 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands
View git-refusing.md

Git refusing to merge unrelated histories on rebase

Error: fatal: refusing to merge unrelated histories

Solution:

  • Rebase it git pull --rebase branchname

  • pull git pull origin branchname --allow-unrelated-histories

  • push git push origin master

View unicode.js
// JavaScript 字符串编码使用 UTF-16
"💩".length === 2;
"💩" === "\u{1F4A9}"; // es6
"💩" === "\uD83D\uDCA9"; // es5
// 同一个编码可能使用不同的码位
"ò" === "ò"; // ❎
"ò" === "\xF2"; // ✅
"ò" === "o\u0300"; // ✅
"o\u0300".normalize("NFC") === "\xF2"; // ✅ es6 提供了 normalize 函数
@qoomon
qoomon / conventional_commit_messages.md
Last active June 1, 2023 09:04
Conventional Commit Messages
View conventional_commit_messages.md

Conventional Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@ookangzheng
ookangzheng / awesome-dns-resolver.md
Last active May 13, 2023 14:57
awesome-dns-resolver
View awesome-dns-resolver.md