Skip to content

Instantly share code, notes, and snippets.

View smudge1977's full-sized avatar

Kode Keith smudge1977

  • UK
View GitHub Profile
@smudge1977
smudge1977 / fix_lxd_docker_iptables.sh
Last active August 2, 2025 13:50
LXD and Docker network bridges co-habiting the same host
#!/bin/bash
# Fix LXD and Docker iptables conflicts
# Run this script with sudo to permanently fix networking issues
set -e
echo "Fixing LXD and Docker iptables conflicts..."
# Check if running as root
@smudge1977
smudge1977 / get_ip.sh
Created November 16, 2023 10:34
Get IP v4 from ip a output
# Regex to match the first IP address for the interface br0
REGEX="(\b25[0-5]|\b2[0-4][0-9]|\b[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}"
[[ $(ip -4 address | grep -A1 "br0") =~ $REGEX ]]
echo "${BASH_REMATCH[0]}"