Skip to content

Instantly share code, notes, and snippets.

import subprocess
import json
def run_axfr_query(name_server, domain):
# Run the AXFR query using dig
command = f"dig @{name_server} {domain} AXFR +noall +answer"
output = subprocess.check_output(command, shell=True, universal_newlines=True)
# Parse the output and create the JSON dictionary
records = {}
@mlow
mlow / battery-monitor.service
Created November 17, 2025 15:51
battery-monitor.sh - A simple battery monitor script which sends desktop notifications when your battery level reaches predefined thresholds
# $HOME/.config/systemd/user/battery-monitor.service
# Then: systemctl daemon-reload && systemctl enable --now --user battery-monitor.service
[Unit]
PartOf=graphical-session.target
After=graphical-session.target
Requisite=graphical-session.target
[Service]
ExecStart=%h/.local/bin/battery-monitor
Restart=on-failure