Skip to content

Instantly share code, notes, and snippets.

View p-sherratt's full-sized avatar

Paul Sherratt p-sherratt

View GitHub Profile
@p-sherratt
p-sherratt / go-dns-resolver.md
Created September 20, 2024 18:09
Understanding Go's DNS Resolver Selection

Understanding Go's DNS Resolver Selection

Courtesy of ChatGPT o1-preview

This document provides a comprehensive guide to how Go's net package selects a DNS resolver. It includes a flowchart illustrating the decision-making process, a table summarizing environment variables that influence resolver choice and behavior, and example scenarios demonstrating practical applications.


Table of Contents

@p-sherratt
p-sherratt / makefile-help.md
Last active November 21, 2022 06:27
Makefile pretty help target

Another variant for the pile at: https://gist.github.com/prwhite/8168133

help:
	@sed \
		-e '/^[a-zA-Z0-9_\-]*:.*##/!d' \
		-e 's/:.*##\s*/:/' \
		-e 's/^\(.\+\):\(.*\)/$(shell tput setaf 6)\1$(shell tput sgr0):\2/' \
		$(MAKEFILE_LIST) | column -c2 -t -s :
@p-sherratt
p-sherratt / global_address_report.py
Created August 4, 2022 09:14
Produce a "CIDR report" from Netbox
#!/usr/bin/env python3
# quick hacky script to produce a "CIDR report" of your global address space from Netbox
# this is released to the public domain, free of copyright and licensing.
# by Paul Sherratt
import urllib3
urllib3.disable_warnings()