Skip to content

Instantly share code, notes, and snippets.

View brlin-tw's full-sized avatar
Loading status...

林博仁 Buo-ren Lin brlin-tw

Loading status...
View GitHub Profile
@nitred
nitred / optimal_mtu.md
Last active July 19, 2025 12:43
Wireguard Optimal MTU

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
@aaronmdjones
aaronmdjones / freenode-resign-letter.txt
Created May 19, 2021 10:20
My resignation from freenode
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
My resignation from freenode staff
==================================
I joined the freenode staff in March 2019 [1].
Before I joined the staff, Freenode Ltd was sold [2] to a person named
Andrew Lee as part of a sponsorship deal. The informal terms of that
@andrebrait
andrebrait / keychron_linux.md
Last active July 17, 2025 16:18
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@tiran
tiran / python-on-debian.md
Last active July 19, 2025 10:03
Negative Python user experience on Debian/Ubuntu

Negative Python user experience on Debian/Ubuntu

The user experience of Python on a minimal Debian or Ubuntu installation is bad. Core features like virtual environments, pip bootstrapping, and the ssl module are either missing or do not work like designed and documented. Some Python core developers including me are worried and consider Debian/Ubuntu's packaging harmful for Python's reputation and branding. Users don't get what they expect.

Reproducer

The problems can be easily reproduced with official Debian and Ubuntu containers in Docker or Podman. Debian Stable (Debian 10 Buster) comes with Python 3.7.3. Ubuntu Focal (20.04 LTS) has Python 3.8.5.

Run Debian container

@bsidhom
bsidhom / ffcat.sh
Created September 12, 2020 05:28
Concatenate MP4 files and inject 360 metadata. Similar to concat-mp4.py, but depends on https://github.com/google/spatial-media
#!/usr/bin/env bash
# Usage: ffcat <output> <input> [input ...]
set -euo pipefail
# Prints the contents of a concat file for ffmpeg.
function catfile() {
local inputs=($@)
local input
@3lpsy
3lpsy / x-resize
Last active July 8, 2025 09:48
Manual Implementation of Auto Resizing For Non-Gnome Environments (like XFCE) running under Spice/Libvirt
#!/bin/bash
# SPDX-License-Identifier: MIT License
# Steps:
# 1) Make sure bash is available
# 2) Create udev rule
# - path to new udev rule: /etc/udev/rules.d/50-x-resize.rules
# - udev rule content:
# ACTION=="change",KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/usr/local/bin/x-resize"
# 3) Create /var/log/autores directory
# 4) Create script /usr/local/bin/x-resize (this file) and make executable
@nevack
nevack / archived.md
Last active June 14, 2025 14:20
[ARCHIVED] Fix for CSR Dongle 0a12:0001 ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

This gist is currenctly archived.

Please refer to previous revisions if you know what to do.

The patch proposed was merged into kernel in 5.8 release, but no longer working as of linux 5.11

@ntuaha
ntuaha / 台灣地址名稱.ipynb
Created March 28, 2020 13:00
擷取台灣地址NER
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[Unit]
Description=Wormhole Transit Relay
[Service]
Type=forked
ExecStart=/opt/tr-venv/bin/twistd transitrelay
Restart=on-failure
[Install]
WantedBy=default.target
@davlgd
davlgd / sd_bench.fio
Created March 10, 2020 09:38
Raspberry Pi SD Card Speed Test files
# Use FIO to emulate the Apps Class A1 performance test.
# This isn't an exact benchmark as the card isn't in the state required by the
# specification, but is good enough as a sniff test.
#
[global]
ioengine=libaio
iodepth=4
size=64m
direct=1
end_fsync=1