Skip to content

Instantly share code, notes, and snippets.

View hermannolafs's full-sized avatar
☸️

Hermann Ólafsson hermannolafs

☸️
View GitHub Profile
@hermannolafs
hermannolafs / argocdlogin.sh
Created September 30, 2025 14:09
argo login with kubectl pf on localhost:8080:80
argocd login localhost:8080 --skip-test-tls --username admin --grpc-web --plaintext --password (kubectl get secret -n argocd argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)I
@hermannolafs
hermannolafs / argocd.sh
Created September 22, 2025 11:34
for when arog doesn't have an ip or anything
kubectl get secret -n argocd argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d | pbcopy && kubectl -n argocd port-forward svc/argocd-server 8080:80 & sleep 2 && open http://localhost:8080 && fg
@hermannolafs
hermannolafs / eks_context.fish
Created September 18, 2025 08:09
uses Tailscale CLI and Fzf to set the kube context in a really fancy cool way
function eks_context
set -l operator_choice (
tailscale status \
| awk '
/-operator/ {
name=$2;
status=substr($0, index($0,$5));
color = (status ~ /active/) ? "\033[32m" : \
(status ~ /offline/) ? "\033[31m" : "\033[90m";
printf "%s\t%s%s\033[0m\n", name, color, status
@hermannolafs
hermannolafs / ecr_profile_login.fish
Last active September 8, 2025 12:51
Fish functions with AWK sprinkles for AWS cli shit
function ecr_profile_login -d "ECR docker login using current profile"
aws ecr get-login-password | docker login --username AWS --password-stdin (aws sts get-caller-identity --query Account --output text).dkr.ecr.(aws configure get region).amazonaws.com
end
@hermannolafs
hermannolafs / Makefile
Created February 11, 2025 09:22
make command to convert .env to .env.fish (with --global)
convert-env-file-to-fish: ## take the existing .env and convert to fish format in .env.fish
@awk '{ split($$1, a, "="); printf "set -gx %s \"%s\"\n", a[1], a[2]; }' .env > .env.fish
@hermannolafs
hermannolafs / Makefile
Created November 27, 2024 13:00
AWK Makefile help message,
.DEFAULT_GOAL := help
.PHONY: help
help: ## This help message
@awk -F '[, ]+' '/^[a-zA-Z0-9_-]+:.*##/ { \
target = $$0; \
sub(/^[ \t]*/, "", target); \
sub(/:.*##/, "##", target); \
split(target, parts, "##"); \
gsub(/^[ \t]*|[ \t]*$$/, "", parts[1]); \
@hermannolafs
hermannolafs / release.yaml
Created October 29, 2024 12:28
GitHub action to build and push container and helm chart to ghcr.io
name: Example of building a container and it's relevant helm chart, and pushing to container registry
on:
release:
types: [ published ]
permissions:
contents: read
jobs:
@hermannolafs
hermannolafs / helm.tf
Last active October 18, 2024 11:45
Terraform which bootstraps Cert Manager CRDs, Cert Manager helm chart and Traefik using the Kubernetes and Helm providers
##########################################
# Cert manager
##########################################
data "http" "cert_manager_crds" {
url = "https://github.com/cert-manager/cert-manager/releases/download/v${var.cert_manager_version}/cert-manager.crds.yaml"
}
locals {
cert_manager_crds = {
@hermannolafs
hermannolafs / main.tf
Last active October 29, 2024 14:45
terraform cert manager crds and helm chart install
# It's recommended to install this before the chart
# This is part of bootstrapping a cluster,
# but you probably should not be doing it this way, dingus
data "http" "cm_crds" {
url = "https://github.com/cert-manager/cert-manager/releases/download/v${var.cert_manager_version}/cert-manager.crds.yaml"
}
locals {
crd_map = {
@hermannolafs
hermannolafs / dev_vm.tf
Last active October 14, 2024 08:42
Azure Developer VM: Azure VM with AADSSHLoginForLinux extension, auto shutdown and VM AD login roles
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 4.0"
}
azuread = {
source = "hashicorp/azuread"
version = "~> 3.0"