Skip to content

Instantly share code, notes, and snippets.

View Integralist's full-sized avatar
🎯
Making an impact

Mark McDonnell Integralist

🎯
Making an impact
View GitHub Profile
@Integralist
Integralist / main.go
Created October 9, 2025 11:49
Go URL filter query parsing
package main
import (
"fmt"
"net/http"
"net/url"
)
func main() {
// Simulate a URL with filter parameters
@Integralist
Integralist / README.md
Last active October 2, 2025 11:11
Go API Optional Fields

Handling Optional and Nullable Fields

The API uses the optional package to distinguish between three states for a field in a JSON payload:

  1. Omitted: The field is not present in the JSON request body.
  2. Set to null: The field is present with an explicit null value (e.g., "description": null). This is used to unset or clear a field's value.
  3. Set to a value: The field is present with a non-null value (e.g., "description": "my description" or "description": "").
type Input struct {
	Description optional.String `json:"description"`
@Integralist
Integralist / SOCK5 Proxy.md
Created September 29, 2025 10:46
SOCK5 Proxy

Some people run a SOCKS5 proxy locally that proxies their internet traffic through a different location.

To access the proxy via your web browser you can either modify your system-wide proxy settings or use a Google Chrome browser extension, or in the case of Firefox manually configure the proxy settings.

Modify System-Wide Settings

  • Open System Preferences > Network.
@Integralist
Integralist / README.md
Created September 23, 2025 14:50
Let's Encrypt Pebble with mholt/acmez client
go get -tool github.com/letsencrypt/pebble/v2/cmd/pebble@latest
go tool pebble -version
go tool pebble -config pebble.json
go run main.go

Note

The cert and key here are public and aren't sensitive for the sake of local testing.

@Integralist
Integralist / README.md
Last active September 17, 2025 11:59
Check WHOIS server DNS status #shell

ZoneDB Scripts

This directory contains utility scripts for maintaining and validating the ZoneDB database.

Scripts

check_domain.sh

Purpose: Quick DNS resolution checker for individual domains.

@Integralist
Integralist / DNS Tools.md
Last active September 16, 2025 13:30
DNS Tools: nslookup vs dig vs whois

Quick Reference Table

Tool Primary Question it Answers Best For...
ping "Are you online and can I reach you?" Basic connectivity checks
nslookup "What's the IP address for this domain?" Quick, simple DNS lookups, especially on Windows
host "What's the IP/MX record for this domain?" Clean, easy-to-read DNS lookups
dig "Give me all the DNS details for this domain." Detailed DNS troubleshooting and scripting
whois "Who owns this domain?" Finding domain registration and ownership info
traceroute "What network path do my packets take to reach you?" Diagnosing latency and routing problems
@Integralist
Integralist / Makefile
Last active September 11, 2025 12:11
Go Fuzz Testing
.PHONY: test-fuzz
test-fuzz: ## Run fuzz tests
ifeq ($(strip $(GO_FUZZARGS)),)
@status=0; \
for pkg in $$(go list ./...); do \
for test in $$(go test -list=^Fuzz $$pkg | grep '^Fuzz'); do \
echo ">>> Fuzzing $$pkg $$test"; \
if ! go test -fuzz=$$test -fuzztime=10s $$pkg; then \
echo "❌ FAIL: $$pkg $$test"; \
status=1; \
@Integralist
Integralist / Trapping Shell Signals
Created September 10, 2025 09:00
Trapping Shell Signals #shell
#!/usr/bin/env bash
cleanup() {
echo ">>> cleanup called (reason: $1)"
}
# Trap EXIT, INT, TERM
# In the following code we're passing the 'signal' as an argument to the cleanup function.
#
# trap 'cleanup EXIT' EXIT
@Integralist
Integralist / README.md
Created September 3, 2025 13:08
humanlog.io config file

The config file is stored here:

~/.config/humanlog/config.json

The only thing I really configure is formatter.themes.dark.levels.debug.foreground.html_hex_color, which I set to #8CBBFF:

Tip

You can view via humanlog config show.

@Integralist
Integralist / PR Reviews.md
Created September 1, 2025 07:05
PR Reviews

Tip

"I think many people misunderstand the purpose of code review. The purpose of code review is not for the reviewer to find bugs, and certainly not for them to ensure that the code is bug-free. Anyone who depends on code review to find bugs is living in a fool's paradise. As everyone should know by now, it is not in general possible to find bugs by examining the code.

The primary purpose of code review is to find code that will be hard to maintain. The reviewer looks at the code and tries to understand what it is doing and how. If they can't, that means it will be hard to maintain in the future, and should be fixed now, while the original author is still familiar with it." -- https://infosec.exchange/@[email protected]/115096720467521263