Skip to content

Instantly share code, notes, and snippets.

View mzpqnxow's full-sized avatar
🙈
Look at all this free stuff!

AG mzpqnxow

🙈
Look at all this free stuff!
View GitHub Profile
@mzpqnxow
mzpqnxow / disable-mdns-chrome.sh
Last active March 10, 2026 21:21
Disable MDNS in Chrome via Chrome policies on the commandline
#!/bin/bash
#
# Disable mDNS for Chrome, Chromium and Brave
# Used on Debian 13
#
# Confirm it works:
# $ lsof -n -i -P | grep -F '224.'
#
# You can/should also just disable multicast on your interfaces if you don't need it
# $ sudo ifconfig $iface -multicast
@mzpqnxow
mzpqnxow / DiscordSOCKS5.md
Created August 24, 2020 04:45
Use SOCKS5 proxy with Discord on Linux

Using SOCKS5 Proxy With Discord on Linux

You may only need the environment or the command-line parameter to force Discord to use a proxy. It doesn't hurt to use both

So if you're behind a firewall and need to go through, e.g. an SSH dynamic port forward (a SOCKS5 channel inside an SSH session) you can use the following:

$ nohup ssh -D1080 proxy_server &
$ http_proxy=socks5://127.0.0.1:1080 https_proxy=socks5://127.0.0.1:1080 /opt/Discord/Discord --proxy-server="socks5://127.0.0.1:1080"
@mzpqnxow
mzpqnxow / build-smbclient-static.sh
Last active November 2, 2025 20:13
Building lightweight (somewhat statically linked) smbclient executable
```
# This won't build a *complete* statically linked smbclient exe, but it will do better ... :/
$ ./configure --without-winbind \
--without-ldap \
--without-ads \
--disable-cups \
--without-quotas \
--disable-avahi \
--without-syslog \
--without-pam \
@mzpqnxow
mzpqnxow / build-ecryptfs-debian-buster.sh
Last active October 24, 2025 10:21
Build ecryptfs-utils from source on Debian 10
#!/bin/bash
set -e
#
# As of 11/24/2019, Debian still can't get it together with ecryptfs-utils so there
# is no longer an ecryptfs-utils in the apt repositories, removing the ability for
# a user to use ecryptfs at all, unless they build from source and manually configure
# the system
#
# Before using this, please see the status of the bugreport:
#
@mzpqnxow
mzpqnxow / 6k.sh
Last active June 21, 2025 14:31
Set single 6k display on Xorg/Debian with xrandr when not advertised via EDID (example: Dell U3224KB)
#!/bin/bash
# Set up modeline and activate it for DELL U3234KB 6k display
# For a single monitor, easy to modify to set more than one, if you can afford two 6k monitors ...
# Tested on cards capable of 6k @ 60hz using Xorg modesetting and intel drivers
# Set up/etc/X11/xorg.conf.d/20-intel.conf like this per Debian documentation:
#
# Section "Device"
# Identifier "Intel Graphics"
# Driver "modesetting"
# EndSection
@mzpqnxow
mzpqnxow / GUIDE.md
Last active June 4, 2025 21:10
Enable post-quantum Key Exchange for OpenSSH

Enabling Post-Quantum Key Exchange on OpenSSH >= 8.0

As of version 8.0, OpenSSH supports an experimental post-quantum key exchange using the sntrup4591761x25519-sha512@tinyssh.org key exchange

Step 1: Check to see if you already have support

Only >= 8.0 have support, but some vendors may currently or eventually backport it into 7.9 (though this is unlikely due to refactoring in 8.0)

Check OpenSSH Client

@mzpqnxow
mzpqnxow / json.sh
Last active May 29, 2025 15:30
JSON in (almost) pure Bash
# functions for parsing and generating json
# This is part of libubox and requires jshn, part of libubox
# sudo apt-get install -y build-essential liblua5.1-0-dev
# git clone https://github.com/yubo/libubox && cd libubox
# mkdir build && cd build
# cmake ../
# make -j
# sudo cp bin/jshn /usr/bin/jshn
# source <this>
# See https://openwrt.org/docs/guide-developer/jshn for examples / how to use
@mzpqnxow
mzpqnxow / gh2gogs.sh
Created May 11, 2025 22:39
Migrate github.com URL to a gogs instance
#!/bin/bash
# Hacky one-shot github2gogs migration
#
# Needs minor modifications if you want to push to a user rather than an organization
# or if your gogs gitconfig doesn't have r/w ssh set up
#
#
# Also, create a token in Gogs->Profile->Settings->Application and set it
# using:
# $ export GOGS_TOKEN=<insert token here>
@mzpqnxow
mzpqnxow / config-aes-gcm.h
Created September 8, 2020 18:04
Configure mbedtls for aes-gcm ONLY as a static library
#ifndef MBEDTLS_CONFIG_H
// Build mbtedtls with this as your configuration file and you'll have only what you need
// for AES GCM. You'll find a pretty small statically linked exe, at least when compared
// with WolfSL, OpenSSL, etc, etc. which (to be fair) are really meant to always have some
// amount of SSL/TLS support enabled
#define MBEDTLS_CONFIG_H
#define MBEDTLS_AES_FEWER_TABLES
#define MBEDTLS_NO_UDBL_DIVISION
#define MBEDTLS_AES_C
#define MBEDTLS_CIPHER_C
@mzpqnxow
mzpqnxow / rebuild.py
Created March 15, 2025 16:46
Rebuild local files from pristine SVN
#
# This is roughly equivalent to `svn export`
# Useful when you have a .svn directory but are unable to reach the SVN
# repository that it came from (e.g. a network-based one)
# If you have /tmp/someworking/.svn:
# $ python rebuild.py /tmp/someworking /tmp/rebuilt
# That will unpack all of the pristine files into /tmp/rebuilt
#
# mzpqnxow (by way of LLMs, with a few minor fixes)
#