Skip to content

Instantly share code, notes, and snippets.

@nitred
nitred / optimal_mtu.md
Last active May 13, 2024 15:03
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
@zhuowei
zhuowei / Ensemble.plist
Last active September 18, 2023 06:26
Put this file as /Library/Preferences/FeatureFlags/Domain/Ensemble.plist and reboot to (hopefully) turn on Universal Control on macOS 12
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- not sure which one it is, so set both -->
<key>Ensemble</key>
<dict>
<key>Enabled</key>
<true/>
</dict>
@krasCGQ
krasCGQ / build-cpio
Last active February 26, 2024 16:57
Scripts to build static-PIE binary of the following; only works on Alpine Linux and other Musl libc based Distros, as some may segfault when done with Glibc.
#!/usr/bin/env dash
#
# SPDX-License-Identifier: Unlicense
#
CC=clang
LD=ld.lld
STRIP=llvm-strip
# -fuse-ld= tells compiler to use specific linker above
@Informatic
Informatic / README.md
Last active April 29, 2024 11:18
openlgtv webOS hacking notes

This is just a dump of some interesting undocumented features of webOS (3.8 specifically, on early 2018 4k LG TV) and other development-related tips.

Homebrew app ideas

@cleverfox
cleverfox / hls2YT.sh
Created March 6, 2021 16:20
FFMPEG h.265 hls to youtube
ffmpeg -i http://192.168.2.11:80/sdi_ext -c:v copy -f hls -method PUT -hls_time 1 -hls_playlist_type event -http_persistent 1 'https://a.upload.youtube.com/http_upload_hls?cid=KEY&copy=0&file=stream.m3u8'
@eybisi
eybisi / hook_dexloader.js
Last active October 28, 2023 19:16
frida script for hooking loaded classes with the help of dexclassloader init
Java.perform(function(){
let ThreadDef = Java.use('java.lang.Thread');
let ThreadObj = ThreadDef.$new();
function stackTrace() {
console.log('------------START STACK---------------')
let stack = ThreadObj.currentThread().getStackTrace();
for (let i = 0; i < stack.length; i++) {
console.log(i + ' => ' + stack[i].toString());
}
console.log('------------END STACK---------------');
@zOrg1331
zOrg1331 / wireguard_layer2.md
Last active May 9, 2024 03:11
wireguard, wireguard layer 2, wireguard over TCP

Intro

This note describes how to connect two networks/devices/VMs over public network using Wireguard with Layer 2 support (ARP, IPv6 link-local, etc).

This can also be achieved using SSH and its "tap" tunnel, however, it does not provide the same level of latency and bandwidth as full-blown VPN such as Wireguard.

In addition, this note describes how to tunnel Wireguard over TCP connection. This may be of use if you encounter firewall in-between so, for instance, you can use TCP port 443 only.

Objective

@swinton
swinton / README.md
Last active March 25, 2024 03:56
Automatically sign your commits from GitHub Actions, using the REST API

Verified commits made easy with GitHub Actions

image

So you want to commit changes generated by a GitHub Actions workflow back to your repo, and have that commit signed automatically?

Here's one way this is possible, using the REST API, the auto-generated GITHUB_TOKEN, and the GitHub CLI, gh, which is pre-installed on GitHub's hosted Actions runners.

You don't have to configure the git client, just add a step like the one below... Be sure to edit FILE_TO_COMMIT and DESTINATION_BRANCH to suit your needs.

@alsunseri
alsunseri / Amazon_AWS_Linux_2_on_KVM_qemu.md
Last active September 21, 2023 00:17
Install and run Amazon AWS Linux 2 locally on KVM virt-manager with qemu virtual disk
@p7cq
p7cq / SSH_Authentication_TPM2_PKCS11_Arch_Linux.md
Last active January 17, 2024 03:30
SSH Authentication with TPM 2.0 and PKCS#11 on Arch Linux

SSH Authentication with TPM 2.0 and PKCS#11 on Arch Linux

Hardware: a TPM 2.0 module based on Infineon SLB9665 cryptographic processor available in the system as /dev/tpmrm0.

Installation

Required software:

# pacman -S tpm2-tools tpm2-pkcs11