Skip to content

Instantly share code, notes, and snippets.

@teadur
teadur / debianpreseedosx.sh
Created August 24, 2022 12:04 — forked from Data-ptr/debianpreseedosx.sh
Modifying a Debian ISO (amd64) with a preseed file, but on OSX
#
# Figured out using:
# https://wiki.debian.org/DebianInstaller/Preseed/EditIso
# https://www.thegeekstuff.com/2009/07/how-to-view-modify-and-recreate-initrd-img/
# https://gist.github.com/Aktau/5510437
# https://www.cyberciti.biz/faq/how-to-extract-a-deb-file-without-opening-it-on-debian-or-ubuntu-linux/
#
## Go home
cd
@teadur
teadur / Ansible Disk Check
Created September 15, 2020 08:01 — forked from alexanderadam/Ansible Disk Check
Show disk space and warn about disk full in Ansible
* Shows a message while asserting like:
ok: [host] => {
"msg": "disk usage 4.2B of total 20.0GB (21.0%) (should exceed limit 90.0%)"
}
* Note this only looks at first mount point on current node
* Fails if disk is near-full
* Last step pushes to a push-based monitoring service, which will alert us if it doesn't get there after some time
* Need to setup a variable `disk_limit`, which is the max acceptable usage ratio, e.g. set it to 0.8 if you want to keep disks within 80% of max size
@teadur
teadur / ddnsserver.py
Created November 1, 2019 17:50 — forked from pklaus/ddnsserver.py
Simple DNS server (UDP and TCP) in Python using dnslib.py
#!/usr/bin/env python
# coding=utf-8
import argparse
import datetime
import sys
import time
import threading
import traceback
import socketserver
@teadur
teadur / em_syslog2.rb
Created October 30, 2019 06:38 — forked from lorenzoplanas/em_syslog2.rb
An EventMachine Syslog Protocol
# this is a configurable version of an EventMachine syslogger
# It was build to replace https://github.com/melito/em-syslog
#
# You can instantiate many of them (no global variables) as
# well as configure the facility. It also quacks like a ruby
# logger so it can be interchanged with a ruby logger.
#
# Example:
#
# # 11 is the facility code for an FTP daemon