Skip to content

Instantly share code, notes, and snippets.

@mag37
mag37 / swapTV.sh
Created July 27, 2025 15:29
A script to swap between 2 sets of audio+video outputs in KDE. Like TV+Desktop.
#!/usr/bin/env bash
# Enable/Activate both monitors and get info from `kscreen-doctor -o | grep -A3 Output`
# Get audio sinks from `pactl list sinks short`
monitorMain="DP-2"
audioMain="alsa_output.pci-0000_0a_00.3.analog-stereo"
monitorTV="HDMI-0"
audioTV="alsa_output.pci-0000_08_00.1.hdmi-stereo"
fullSwap="false" # when set to false we'll only swap primary - not disable the secondary
@mag37
mag37 / Windows 11 VM with VirtManager.md
Last active December 2, 2025 20:28
Windows 11 VM with VirtManager.md

Preparations

  • Install Virtual Machine Manager - probably in your repo with the name virt-manager
  • Install any other requirements for virtualization on your distro
  • Ensure any Virtualization options is enabled in Bios.
  • Get a windows11 iso download here
  • Get virtio drivers iso download here

Setup

  • Edit -> Preferences -> Enable XML editing
  • Create the VM but before Finish - check Customize conf before install
  • @Overview
@mag37
mag37 / docker_registry_compare_Function.sh
Last active January 18, 2023 11:39
A function to use regctl to compare docker-container VS registry to check for available updates.
### Requires the regctl binary, either in PATH or as an alias
### Get it here: https://github.com/regclient/regclient/releases
alias regctl="/path/to/regctl"
regcheck () {
if [[ -z "$1" ]]; then
echo "No container name given, here's the list of currently running containers:"
docker ps --format '{{.Names}}'
else
RepoUrl=$(docker inspect $1 --format='{{.Config.Image}}')
@mag37
mag37 / docker_image_check.sh
Last active January 18, 2023 09:48
Script that uses regctl to compare running container image-hashes to the registry, to check and optionally get updates.
#!/bin/bash
### Check arch:
case "`uname --machine`" in
x86_64|amd64)
architecture="amd64";;
arm64|aarch64)
architecture="arm64";;
*) echo "Architecture not supported, exiting." ; exit ;;
esac