Skip to content

Instantly share code, notes, and snippets.

@damacus
damacus / home-assistant.yaml
Last active July 6, 2022 08:51
Home Assistant Ingress Config
---
ingress:
main:
enabled: true
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
kubernetes.io/ingress.class: "traefik"
module "chart" {
source = "./modules/helm"
count = length(var.charts)
name = element(var.charts, count.index)
}
variable "charts" {
type = list(string)
default = ["plex", "home-assistant"]
@damacus
damacus / charts_v2.tf
Last active August 7, 2023 13:43
charts V2
module "chart" {
source = "./modules/chart"
for_each = local.charts
name = each.key
repository = lookup(each.value, "repository", "https://billimek.com/billimek-charts/")
chart_version = each.value["chart_version"]
}
locals {
@damacus
damacus / count_for_each.tf
Last active August 25, 2020 10:45
Count vs For Each
# count
output "plex_ip" {
value = module.chart[1].ip
}
# for_each
output "plex_ip {
value = module.chart["plex"].ip
}
@damacus
damacus / charts_v1.tf
Last active August 7, 2023 13:42
Chart Module
module "chart" {
source = "./modules/chart"
for_each = local.charts
name = each.key
repository = each.value["repository"]
chart_version = each.value["chart_version"]
}
locals {
docker buildx create --name multi-platform
docker buildx use multi-platform
docker buildx inspect --bootstrap
@damacus
damacus / gist:4286668484f8315c05f4822bbf63363b
Created March 31, 2020 12:41
kitchen diagnose --all Java Cookbook
---
timestamp: 2020-03-31 12:37:38 UTC
kitchen_version: 2.4.0
plugins:
driver:
Proxy:
class: Kitchen::Driver::Proxy
version: 2.4.0
api_version:
provisioner:
@damacus
damacus / .direnvrc
Created May 6, 2019 17:45
Direnv with Chef workstation
use_ruby() {
# enable the chruby command in an environment
source /usr/local/opt/chruby/share/chruby/chruby.sh
# desired Ruby version as first parameter
local ver=$1
# if version not given as parameter and there is a .ruby-version file, get
# version from the file
if [[ -z $ver ]] && [[ -f .ruby-version ]]; then
@damacus
damacus / ruby.sh
Created May 6, 2019 17:42
chruby startup script
#!/bin/env zsh
# 🍳
if [[ -f "/opt/chef-workstation/embedded" ]];then
if [[ ! -L ~/.rubies/chef-workstation ]];then
ln -s /opt/chef-workstation/embedded ~/.rubies/chef-workstation
fi
fi
@damacus
damacus / tidy.sh
Created January 31, 2019 12:15
tidy-it-up.sh
#!/bin/bash
add_leading_dot() {
# Adds a leading . to a file
local filename=$1
local with_leading=$(adddot $filename)
if [[ -f "$filename" ]];then
mv $filename $with_leading
git add $with_leading $filename
fi