Skip to content

Instantly share code, notes, and snippets.

Avatar
🌍

Andreas Thienemann ixs

🌍
View GitHub Profile
View gist:a8e5da2632ac93d5ec744ca9a3e05f28
pdns-auth-master: works
pdns-auth-45: works
pdns-auth-46: not found
Sep 23 14:11:07 Loading '/usr/local/lib/pdns/libgsqlite3backend.so'
Sep 23 14:11:07 This is a standalone pdns
Sep 23 14:11:07 Listening on controlsocket in '/var/run/pdns/pdns.controlsocket'
Sep 23 14:11:07 UDP server bound to 0.0.0.0:53
Sep 23 14:11:07 UDP server bound to [::]:53
Sep 23 14:11:07 TCP server bound to 0.0.0.0:53
@ixs
ixs / prips.py
Created Aug 4, 2021
prips in python - support ipv6
View prips.py
#!/usr/bin/env python3
import ipaddress
import sys
for ip in ipaddress.ip_network(sys.argv[1]).hosts():
print(ip)
@ixs
ixs / ip_finder.sh
Last active Aug 4, 2021
IP Finder als kleine Programmierübung
View ip_finder.sh
#!/bin/bash
set -euo pipefail
# IP Finder als kleine Programmierübung
NAMED=/var/named/data
NETZ="${1:-}"
if [ -z "$NETZ" ]; then
@ixs
ixs / rocky_os_family.py
Last active Jul 4, 2021
Salt custom grain to override os_family grain to ensure Rocky Linux is as part of the RedHat OS family.
View rocky_os_family.py
#!/usr/bin/env python3
# Override os_family grain to ensure Rocky Linux is seen
# as part of the RedHat OS family.
#
# Similar functionality was added in https://github.com/saltstack/salt/pull/59682
# but has not been released yet.
#
# To install, drop this code into /svc/salt/_grains/ and run
# `salt '*' saltutil.sync_all`
@ixs
ixs / apple_contact_picture_crop.py
Last active Jan 14, 2021
Apple iOS compatible image crop for contact/vcard images
View apple_contact_picture_crop.py
#!/usr/bin/env python3
from PIL import Image
import io
import logging
import vobject
import base64
import hashlib
"""
@ixs
ixs / intel_x520_patcher.py
Last active Sep 25, 2022
Intel x520 EEPROM Patcher allows to unlock the x520 network card to work with non-intel branded SFP modules.
View intel_x520_patcher.py
#!/usr/bin/env python3
#
# Simple Intel x520 EEPROM patcher
# Modifies the EEPROM to unlock the card for non-intel branded SFP modules.
#
# Copyright 2020,2021,2022 Andreas Thienemann <andreas@bawue.net>
#
# Licensed under the GPLv3
#
# Based on research described at https://forums.servethehome.com/index.php?threads/patching-intel-x520-eeprom-to-unlock-all-sfp-transceivers.24634/
@ixs
ixs / Makefile
Last active Jul 3, 2020
Makefile to drive ansible from a venv
View Makefile
# Makefile
SHELL = /bin/bash
PYTHON_EXE = python3
TOPDIR = $(shell git rev-parse --show-toplevel)
all: venv ## Build complete environment
help: # Display help
@awk -F ':|##' \
'/^[^\t].+?:.*?##/ {\
@ixs
ixs / tasmota-configure.sh
Last active Jan 31, 2022
Tasmota mass configuration
View tasmota-configure.sh
#!/bin/bash
#
# Do initial configuration of a SP111 plug on your local wifi
#
# Licensed under the GPLv3+
#
TEMPLATE='{"NAME":"SP111 v1.1","GPIO":[56,0,158,0,132,134,0,0,131,17,0,21,0],"FLAG":0,"BASE":45}'
function uriencode {
@ixs
ixs / keepass-recovery.py
Created May 28, 2020
Try multiple passwords to access a keepass database
View keepass-recovery.py
#!/usr/bin/env python3
#
# Forgot the password for my keepass library. I knew the password
# was based on a certain scheme that encodes the year etc.
#
# Rather than trying it out by hand, have a program do it for me.
#
# Quick and dirty...
#
View migrate-system-uids.sh
#!/bin/sh
set -euo pipefail
MAX_SYS_UID=499
MAX_SYS_GID=499
ORIG_MAX_SYS_UID=999
ORIG_MAX_SYS_GID=999
# For debugging, set to echo