Skip to content

Instantly share code, notes, and snippets.

@henri
henri / ubuntu_mptcp_disable_cheat_sheet.txt
Created November 6, 2026 00:54
mptcp disable cheat sheet
sudo sysctl -w net.mptcp.enabled=0
echo "net.mptcp.enabled = 0" | sudo tee /etc/sysctl.d/99-disable-mptcp.conf
sudo sysctl --system
@henri
henri / copyq_modify_menu_items.txt
Last active November 6, 2026 03:23
CopyQ cheatsheet
(1) Open CopyQ menu
(2) Select 'File' menu
(3) Select 'Command/Global Shortcuts...'
(4) Click 'Add'
(5) Activate 'In Menu' and 'Display'
(6) Under Display -> Command tab enter :
copyq:
var text = str(data(mimeText))
if (/^text-to-match/i.test(text)) {
@henri
henri / byobu_cheatsheet.txt
Last active September 20, 2026 22:30
byobu (wrapper to screen and tmux) cheatsheet
# access basic byobu help
F1
# access the built in session and window system (tmux)
F12 s
# access information about the various F12 options
F12 ?
@henri
henri / create-vm.bash
Last active August 14, 2026 05:13
Quickly Setup KVM/QEMU libvert VM - Great for Testing
#!/usr/bin/env bash
#
#
# (C)2026 Henri Shustak, All Rights Reserved
# Licence : GNU GPLv3 or later
#
#
# new-vm.bash
# Interactively creates a KVM/QEMU libvirt VM with a configurable
# boot mode (BIOS or UEFI), generic "linux2022" OS variant, a
@henri
henri / walk_proc_to_detect_trace.bash
Last active July 27, 2026 22:34
linux detect activated strace
#!/bin/bash
# Detect processes being ptraced via /proc/<pid>/status
# I am sure there are better ways!
while true; do
for pid in /proc/[0-9]*/status; do
tracer=$(grep -m1 "^TracerPid:" "$pid" 2>/dev/null | awk '{print $2}')
if [[ -n "$tracer" && "$tracer" != "0" ]]; then
target_pid=$(echo "$pid" | grep -oP '\d+')
tracer_comm=$(cat /proc/${tracer}/comm 2>/dev/null)
# set existing process to be in 'Best Effort' class with priority 6 in that class
# within the 'Best Effort' class priority 0 is highest and 7 is the lowest
ionice -c 2 -n 6 -p <PID>
# check what values are set for an existing process
ionice -p <PID>
@henri
henri / badblocks_cheat_sheet.txt
Last active July 27, 2026 22:35
badblocks cheatsheet
# run a scan and create a log file badblocks.log
sudo badblocks -v -s -o badblocks.log /dev/sdX # assumes sdX is your raw device
@henri
henri / cgroup_cheatsheet.txt
Created April 22, 2026 03:31
linux cgroup cheat sheet
# full process tree organized by cgroup
systemd-cgls
# resource usage per cgroup
systemd-cgtop
# view cgroup filesystem
ls /sys/fs/cgroup/
@henri
henri / grub_linux_identify_UEFI_not_running_macOS.txt
Created April 5, 2026 06:59
Display Power Issues on Linux Mint Cinnamon (iMac / Apple Computers)
# resolve power management issues on intel mac computers running LINUX
#
# add the acpi_osi=!Darwin Kernel Parameter
#
# edit GRUB:
sudo nano /etc/default/grub
# find the line GRUB_CMDLINE_LINUX_DEFAULT and add 'acpi_osi=!Darwin', 'quiet' and 'spash' paraemters example follows :
GRUB_CMDLINE_LINUX_DEFAULT="acpi_osi=!Darwin quiet splash"