Skip to content

Instantly share code, notes, and snippets.

View michaelkosir's full-sized avatar

Michael Kosir michaelkosir

View GitHub Profile
@michaelkosir
michaelkosir / aws-lambda-handler.go
Last active January 23, 2026 15:43
AWS Lambda Go Handler
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"time"
"github.com/aws/aws-lambda-go/lambda"
@michaelkosir
michaelkosir / pdev.sh
Created October 14, 2025 15:50
Quickly deploy Postgres development servers locally using Docker
# Usage:
# pdev
# pdev 17.6
# pdev list
# pdev list 18
# pdev stop
pdev() {
pattern='^[0-9]+\.[0-9]+(\.[0-9]+)?$'
if [[ -z $1 || $1 == "latest" || $1 =~ $pattern ]]; then
@michaelkosir
michaelkosir / vdev.sh
Last active October 14, 2025 15:24
Quickly deploy Vault development servers locally using Docker
# Usage:
# vdev
# vdev 1.20
# vdev 1.19-ent
# vdev 1.17.5-ent.hsm.fips1402
# vdev list
# vdev list 1.20
# vdev stop
vdev() {
pattern='^[0-9]+\.[0-9]+(\.[0-9]+)?(-rc\d)?(-ent)?(\.hsm)?(\.fips1402)?$'
# .zshrc
autoload -Uz compinit
compinit
VAULT_ENCRYPTION_KEY="example"
# export
export PATH="$PATH:/Users/michael.kosir/.hcv/bin"
export DOCKER_HOST="unix:///Users/$USER/.colima/docker.sock"
@michaelkosir
michaelkosir / Dockerfile
Last active March 6, 2025 05:56
An example Python web application distroless image using uv. An extremely fast Python package and project manager, written in Rust.
# Stage 0
# Installs dependencies and builds the application
# Artifacts will be copied to the final image
FROM debian:12-slim AS build
ARG PYTHON_VERSION="3.13"
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin
ENV UV_COMPILE_BYTECODE="1"
@michaelkosir
michaelkosir / pgp-fingerprints.sh
Created December 11, 2024 18:44
Get PGP fingerprints
export URL="https://apt.releases.hashicorp.com/gpg"
curl -fs $URL | gpg --with-colons --with-fingerprint --quiet | grep -oE "[0-9A-F]{40}"
@michaelkosir
michaelkosir / multipass-base.yml
Last active April 12, 2024 14:25
My base configuration for Multipass
# cloud-config
# Get PGP fingerprint
# export URL="https://apt.releases.hashicorp.com/gpg"
# curl -fs $URL | gpg --with-colons --with-fingerprint --quiet | grep -oE "[0-9A-F]{40}"
package_update: true
package_upgrade: true
apt: