Skip to content

Instantly share code, notes, and snippets.

View thimslugga's full-sized avatar
👋

Adam Kaminski thimslugga

👋
View GitHub Profile
@thimslugga
thimslugga / emporia-vue-v3.yaml
Created November 11, 2024 12:54 — forked from bradsjm/emporia-vue-v3.yaml
Emporia VUE V3 ESPHome Configuration
substitutions:
name: emporia-vue-v3
friendly_name: Emporia Vue V3
area: "Garage"
# Circuit Labels used for publishing to Home Assistant
circuit_1: "Dryer" #"Circuit 1"
circuit_2: "AC Blower/Heat" #"Circuit 2"
circuit_3: "AC Condenser" #"Circuit 3"
circuit_4: "Water Heater" #"Circuit 4"
@thimslugga
thimslugga / init.vim
Created October 20, 2024 20:46 — forked from onixus74/init.vim
vim-like-vscode
" VIM-VSCODE
"*****************************************************************************
" VIM-PLUG CORE
"*****************************************************************************
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
let g:vim_bootstrap_langs = "elixir,eelixir,html,javascript,typescript,python,ruby,yaml"
let g:vim_bootstrap_editor = "nvim" " nvim or vim
@thimslugga
thimslugga / sles-ec2-stonith-debug.sh
Last active September 26, 2024 00:06
Enable debugging for external/ec2 stonith resource
#!/bin/bash
# Check if script was run as non-root user
function is_root() {
if [[ ${EUID} -ne 0 ]]; then
echo "This script must be run as root."
exit 1
fi
}
is_root
@thimslugga
thimslugga / rocky-linux-nm-cloud-setup.sh
Created August 23, 2024 14:10
Setup NM Cloud Setup Plugin on Rocky Linux 9
#!/usr/bin/env bash
sudo dnf install -y NetworkManager-cloud-setup
sudo systemctl enable --now nm-cloud-setup.service
sudo systemctl enable --now nm-cloud-setup.timer
sudo mkdir -pv /etc/systemd/system/nm-cloud-setup.service.d
cat <<'EOF' | sudo tee /etc/systemd/system/nm-cloud-setup.service.d/00-override.conf
@thimslugga
thimslugga / .bash_aliases
Created August 9, 2024 17:32 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@thimslugga
thimslugga / lib.sh
Last active August 6, 2024 03:20
AL2023 ec2-net-utils lib.sh
#!/bin/bash
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may
# not use this file except in compliance with the License. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
@thimslugga
thimslugga / 00-proxmox-8-ec2-cloud-config.yaml
Last active July 30, 2024 19:37
Proxmox 8 on EC2 Bare Metal
#cloud-config
# vim: syntax=yaml
disable_ec2_metadata: false
# Runs on each boot
bootcmd:
# Replace default 127.0.0.1 IP in /etc/hosts with private IP address
- sed -i'' 's/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\([[:space:]]*[{]{fqdn}}\)/{{ ds.meta_data.local_ipv4 }}\1/' /etc/cloud/templates/hosts.debian.tmpl
@thimslugga
thimslugga / modify_screensharing.sh
Created July 24, 2024 10:20 — forked from timsutton/modify_screensharing.sh
Enabling screen sharing on macOS Monterey as of 12.1 beta 2
#!/bin/bash
# A cleaner alternative to this approach, but which requires a restart, is to populate TCC's SiteOverrides.plist inside
# the TCC app support directory with the following:
# <?xml version="1.0" encoding="UTF-8"?>
# <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
# <plist version="1.0">
# <dict>
# <key>Services</key>
# <dict>
@thimslugga
thimslugga / aws-ec2-sanitize-ami.sh
Last active May 3, 2025 02:29
Run this script to sanitize your instance after baking AMIs
#!/usr/bin/env bash
#set -ex
# Usage: bash <(curl -sL https://gist.github.com/thimslugga/<>/sanitze-clean.sh)
#
# https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html-single/configuring_and_managing_cloud-init_for_rhel_8/index
# https://docs.aws.amazon.com/imagebuilder/latest/userguide/security-best-practices.html
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/building-shared-amis.html
# https://github.com/aws/amazon-ecs-ami/blob/main/scripts/cleanup.sh
# https://github.com/awslabs/amazon-eks-ami/blob/main/templates/shared/provisioners/cleanup.sh