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 \" \
@ookangzheng
ookangzheng / README.md
Created October 3, 2022 06:15 — 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 / gist:213d6c3a23f855150eb67eee74d49ae2
Created June 21, 2022 19:20 — 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 / 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
View alacritty.yaml
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
@ookangzheng
ookangzheng / npm-audit.md
Last active May 7, 2021 03:08 — forked from KittyGiraudel/npm-audit.js
npm-audit
View npm-audit.md
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)
@ookangzheng
ookangzheng / npm-audit_report-generation.sh
Created May 5, 2021 03:12 — forked from aravindkumarsvg/npm-audit_report-generation.sh
Generates npm audit report for multiple directories and searching for multiple package.json inside those given directories
View npm-audit_report-generation.sh
#!/bin/bash
# Global variable declarations
format="json"
directories=()
current_directory=`pwd`
report_directory="${current_directory}/report/"
fresh_report_directory="0"
# usage
@ookangzheng
ookangzheng / raspi-setup-gitea.md
Created May 3, 2021 09:27 — forked from afragen/raspi-setup-gitea.md
Installing Gitea on Raspberry Pi 3 b+ with nginx and automatic backups
View raspi-setup-gitea.md

Setup Gitea on Raspberry Pi (3b+)

These instructions are based on this article: https://docs.gitea.io/en-us/install-from-source/.

Setup Raspberry Pi with minimal Raspbian image. You need to connect to the HDMI port and set the following:

Use Noobs to install Raspian.

Open menu Preferences > Raspberry Pi Settings

@ookangzheng
ookangzheng / aria2
Created April 6, 2021 09:44 — forked from wigging/aria2
command line download of torrent magnet link using aria2
View aria2
# Command to download file via bittorrent magnet link using aria2.
# See website and documentation at https://aria2.github.io
# -d specifies the directory to store the downloaded file
# --seed-time=0 disables seeding after download has completed
aria2c -d ~/Downloads --seed-time=0 "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C"
View conventional_commit_messages.md

Conventinal 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