Skip to content

Instantly share code, notes, and snippets.

@vcunat
vcunat / schema.json
Created March 29, 2023 09:41
knot-resolver-config-schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Knot Resolver declarative configuration.",
"type": "object",
"properties": {
"version": {
"type": "integer",
"description": "Version of the configuration schema. By default it is the latest supported by the resolver, but couple of versions back are be supported as well.",
"default": 1
},
@mochaaP
mochaaP / APKBUILD
Created April 15, 2022 15:02
linux-xanmodedge: Alpine build script for Xanmod kernels
# Maintainer: mochaaP <[email protected]>
_flavor=xanmodedge
pkgname=linux-${_flavor}
# NOTE: this kernel is intended for testing
# please resist urge to upgrade it blindly
pkgver=5.17.3
case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;;
@nitred
nitred / optimal_mtu.md
Last active November 19, 2025 14:00
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
@arvati
arvati / alpine_motd_generator.md
Last active December 5, 2025 15:26 — forked from ergoz/motd_generator.sh
Dynamic motd generator for Alpine Linux (/etc/periodic/15min/motd)

Make a dynamic motd for your server

create a crond script to dynamic create an motd message to users

rc-service crond start && rc-update add crond
nano /etc/periodic/15min/motd
chmod a+x /etc/periodic/15min/motd
run-parts --test /etc/periodic/15min

Contents of /etc/periodic/15min/motd

@hasnat
hasnat / knot-resolver.conf
Last active January 18, 2024 20:59
an example split horizontal dns config using knot resolver
-- vim:syntax=lua:set ts=4 sw=4:
-- Refer to manual: https://knot-resolver.readthedocs.io/en/stable/daemon.html#configuration
-- Listen on all interfaces (localhost would not work in Docker)
net.listen('0.0.0.0')
net.listen('0.0.0.0', 853, { kind = 'tls' })
net.listen('0.0.0.0', 443, { kind = 'doh' })
net.listen('0.0.0.0', 8453, { kind = 'webmgmt' })
-- To disable DNSSEC validation, uncomment the following line (not recommended)
@fsamareanu
fsamareanu / cake_debian.txt
Created October 9, 2019 09:53
My short cake crash course
#Set cake as qdisc and bbr as your congestion control (either from shell or add them to sysctl.conf or your OS equivalent)
sysctl net.core.default_qdisc=cake
sysctl net.ipv4.tcp_congestion_control=bbr
#Replace the root qdisc to cake diffserv4 (we get 4 distinct queues this way). Replace enp0231f6 with your interface name:
/sbin/tc qdisc replace root dev enp0s31f6 cake ethernet diffserv4 wash
#Check output. Queue priority (from lowest to highest) is bulk<best effort<video<voice. It should be similar to below one:
@zoonderkins
zoonderkins / dnsdist-config.md
Created April 14, 2019 09:07
dnsdist config
-- listen for console connection with the given secret key
-- controlSocket("0.0.0.0")
-- setKey(please generate a fresh private key with makeKey())

-- start the web server on port 8083, using password 'set a random password here'
-- webserver("0.0.0.0:8083", "set a random password here")

-- accept DNS queries on UDP/5200 and TCP/5200
@pjobson
pjobson / openwrt-on-x86_64.md
Last active November 27, 2025 17:11
OpenWRT on x86_64

OpenWRT on x86_64

This is a very brief tutorial on getting OpenWRT installed on a regular computer, it assumes you know your way around Linux. If you find this and need additional details, please like, subscribe, and comm... oh wait this isn't youtube, just comment.

Updated: Current version is 22.03.5, this was originally written for 18.6.x in 2019.

What You'll Need

  • 1 USB Stick
  • Linux Live ISO