Skip to content

Instantly share code, notes, and snippets.

@marjamis
marjamis / Corefile
Last active September 24, 2022 04:26
CoreDNS Example
(global_configurations) {
log {
class all
}
errors
cache
prometheus :9153
}
coredns.io:5300 {
@marjamis
marjamis / Makefile.cert-generation
Last active April 21, 2025 01:40
TLS Certificate generation for webservers. Includes CA's, server, and client certificates. Not to be used for production as the settings need heavy reviewing before that step
.DEFAULT_GOAL := helper
# Uses the required .env for docker-compose to find root location.
CERTS_LOCATION ?= $(shell cat .env | grep -i CERTS_LOCATION | cut -f2 -d\=)
CA_LOC ?= $(CERTS_LOCATION)/ca
# Default location for client certificates to be stored.
CLIENT_LOC ?= $(CERTS_LOCATION)/client_certificates_remote
# Specific files for easier reference and changes. May change this in the future.
CA_CRT ?= $(CA_LOC)/ca.crt
@marjamis
marjamis / wordle-starting-word.txt
Last active July 3, 2025 13:05
Todays starting wordle word example
urson
@marjamis
marjamis / Dockerfile.build-go
Last active April 20, 2023 09:39
Starter application files
FROM golang:1.19 as build
WORKDIR /go/src/
COPY go.* .
RUN go mod download
COPY . .
# --mount flag allows for speedier builds of the binary
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=linux go build -o app main.go
# Final image in the build process
@marjamis
marjamis / sha256sum-duplication-checker.sh
Last active September 24, 2022 04:23
Bash scripts and examples
#!/bin/sh
SHA256SUMS_FILE="./sha256_sums"
UNIQ_COUNTS_SORTED="./uniq_counts_sorted"
find . -type f -exec sha256sum {} \; > $SHA256SUMS_FILE
cat $SHA256SUMS_FILE | sort -k1 | cut -f1 -d\ | uniq -c | sed "s:^ *::g" | sort -rk1 > $UNIQ_COUNTS_SORTED
IFS="
@marjamis
marjamis / names.txt
Last active December 15, 2022 08:33
Possible project names
hound
sleuth
waldo
snoop/snooper
seeker