Skip to content

Instantly share code, notes, and snippets.

View indexftw's full-sized avatar
👺
I may be slow (to respond.)

indexftw

👺
I may be slow (to respond.)
View GitHub Profile
@nitred
nitred / optimal_mtu.md
Last active May 25, 2025 17:06
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
@mgbckr
mgbckr / switch_bluetooth_profile.sh
Last active April 27, 2025 13:00
Method to make audio quality better for bluetooth headsets on linux (Fedora 34) using mSBC
#!/bin/bash
# source: https://bbs.archlinux.org/viewtopic.php?pid=1973004
# prepare via enabling mSBC codec for HSP/HFP:
# https://wiki.archlinux.org/title/PipeWire#Low_audio_quality_on_Bluetooth
# the `bluez-monitor.conf` is located at:
# `/usr/share/pipewire/media-session.d/bluez-monitor.conf`
# note that the settings gui needs to be restarted after editing the file and calling
# `systemctl --user restart pipewire.service`
#msbc=`pactl list | grep Active | grep msbc`
@andrebrait
andrebrait / keychron_linux.md
Last active May 28, 2025 09:46
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.

@neggles
neggles / New-GPUPDriverPackage.ps1
Last active May 29, 2025 16:29
Hyper-V GPU Virtualization
<#
.SYNOPSIS
Create a GPU-P Guest driver package.
.DESCRIPTION
Gathers the necessary files for a GPU-P enabled Windows guest to run.
.EXAMPLE
New-GPUPDriverPackage -DestinationPath '.'
.EXAMPLE
New-GPUPDriverPackage -Filter 'nvidia' -DestinationPath '.'
.INPUTS
@maximlt
maximlt / run_python_script_in_conda_env.bat
Last active May 2, 2025 11:15
Run a Python script in a conda environment from a batch file
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.
rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init
rem Define here the path to your conda installation
set CONDAPATH=C:\ProgramData\Miniconda3
rem Define here the name of the environment
@peteristhegreat
peteristhegreat / Readme.md
Last active May 20, 2025 01:39
Realtek bluetooth usb adapter RTL8671b
@legeana
legeana / nftables.conf
Last active May 3, 2025 03:38
nftables port forwarding + wireguard
table inet nat {
chain prerouting {
type nat hook prerouting priority dstnat;
iifname eth0 jump external-pre
}
chain external-pre {
tcp dport 8022 mark set 1 dnat ip to 10.200.200.2:ssh
tcp dport 8022 mark set 1 dnat ip6 to [fd00::2]:ssh
tcp dport 8080 mark set 1 dnat ip to 10.200.200.2:http
@ajaxray
ajaxray / mysqldump_to_mega.sh
Last active June 4, 2024 02:51
Backup MySQL database to MEGA.nz cloud storage
#!/bin/bash
# ----------------------------------------------------
# A Shell script to take MySql database backup
# and upload to MEGA cloud storage using megatools
# ----------------------------------------------------
# REQUIREMENTS : You should have -
# 1. Registered and verified MEGA account - https://mega.nz/
# 2. Installed megatools - https://github.com/megous/megatools
# ----------------------------------------------------
@rahilwazir
rahilwazir / vmdk_vhdx.md
Last active May 21, 2025 11:54
Convert VMWare to Hyper-V (vmdk to vhdx)