Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View JanKoppe's full-sized avatar
🐧
NOOT NOOT!

Jan Koppe JanKoppe

🐧
NOOT NOOT!
View GitHub Profile
@nitred
nitred / optimal_mtu.md
Last active April 16, 2024 06:57
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
@zh4n7wm
zh4n7wm / generate-signed-urls-and-cookies-for-cloudfront-with-python-and-golang.md
Last active July 12, 2023 21:27
AWS CloudFront generate signed urls and cookies with Python and Golang
@kralo
kralo / IKEV2C_0USER.ini
Last active February 21, 2023 15:02
[HOWTO] configuration example for lancom host to ubuntu 16.04 vpn client
[PROFILE1]
Name=T-IKEV2C_0USER
ConnMedia=21
ConnMode=0
SeamRoaming=1
PriVoIP=1
Gateway=1.2.3.4
PFS=14
UseComp=0
IkeIdType=3
@blha303
blha303 / 1001.conf
Last active July 2, 2019 08:24
Asterisk 1.0.0.1 context
[1001]
exten => _X.,1,Set(CALLERID(name)=1.0.0.1)
exten => _X.,n,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,Playback(1001-recordtype) ; "Enter record type on your phone keypad, followed by the hash key. Press 1 to go to next character"
exten => _X.,n,Read(recordtype,,,si,)
exten => _X.,n,Playback(1001-domain) ; "Enter domain name to retrieve record, followed by the hash key"
exten => _X.,n,Read(domain,,,si,)
exten => _X.,n,Set(RECORD="${SHELL(/usr/bin/1001.py "${recordtype}")}")
exten => _X.,n,Set(ADDR="${SHELL(/usr/bin/1001.py "${domain}")}")
@elfmimi
elfmimi / NUCxxx.cfg
Last active March 11, 2024 00:24 — forked from TheLastMutt/mini51.c
OpenOCD utils for Nuvoton NUC123 , NUC126 and others
# Housekeeping stuff for OpenOCD targeting Nuvoton NUC123 , NUC126 and others.
# by Ein Terakawa <applause@elfmimi.jp>
#
# based on TheLastMutt's mini51.cfg
# https://gist.github.com/TheLastMutt/d1c1948acaace7444c1c#file-mini51-cfg
# Usage example
#
# Read config regs.
# openocd -f NUCxxx.cfg -c ReadConfigRegs -c exit
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active April 22, 2024 13:01
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active April 16, 2024 12:18
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@jweyrich
jweyrich / aws_alb_log_parser.py
Last active April 18, 2024 18:44
AWS ALB Log Parser written in Python
#!/usr/bin/env python3
# coding=utf8
#
# AUTHOR: Jardel Weyrich <jweyrich at gmail dot com>
#
from __future__ import print_function
import re, sys
def parse_alb_log_file(file_path):
fields = [
@DiegoQueiroz
DiegoQueiroz / query_activedirectory.py
Last active October 18, 2023 10:43
Python-LDAP Query Active Directory Example (with paged results to prevent ldap.SIZELIMIT_EXCEEDED exception)
# -*- coding: utf-8 -*-
# requires python-ldap (usually pip install python-ldap)
# But this package requires OpenLDAP libraries, so it is a pain to install it on Windows.
# So, if you're on Windows, I recomment to use pre-compiled binaries with this command (virtualenv supported):
# pip install https://download.lfd.uci.edu/pythonlibs/h2ufg7oq/python_ldap-3.1.0-cp37-cp37m-win_amd64.whl
import ldap
from ldap.controls import SimplePagedResultsControl
variable "hcloud_token" {
}
provider "hcloud" {
token = "${var.hcloud_token}"
}
resource "hcloud_server" "kube-master" {
name = "kube-master"
image = "ubuntu-18.04"