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
@Vigrond
Vigrond / jellyfinchromecast.md
Last active April 20, 2024 18:31
Jellyfin with Chromecast
@nitred
nitred / optimal_mtu.md
Last active May 6, 2024 10:50
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 November 22, 2023 09:03
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 April 25, 2024 13:24
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 April 4, 2024 17:49
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 April 1, 2024 06:23
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 April 12, 2024 07:32
Realtek bluetooth usb adapter RTL8671b
@legeana
legeana / nftables.conf
Last active November 16, 2023 15:26
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 May 2, 2024 05:47
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 March 3, 2024 22:01
Convert VMWare to Hyper-V (vmdk to vhdx)