Skip to content

Instantly share code, notes, and snippets.

@albal
albal / my-copliot-instructions.md
Created May 31, 2025 11:30 — forked from jonathan-vella/my-copliot-instructions.md
Copilot Instructions for VS Code

GitHub Copilot Instructions for All Projects


applyTo: "**"

Core Development Principles

Code Quality & Maintainability

  • Readability First: Prioritize clear, self-documenting code over clever solutions
@albal
albal / download-k3s-airgap-images.sh
Created February 19, 2025 20:26
Download binaries needed for airgapped K3S install
#!/usr/bin/env bash
#
# Usage:
# ./download-k3s-airgap-images.sh [K3S_RELEASE_TAG] [ARCH]
#
# Examples:
# # Download for the latest stable release, auto-detect arch
# ./download-k3s-airgap-images.sh
#
# # Download for a specific release and architecture
@albal
albal / ca-daemonset.yaml
Created January 22, 2025 23:02
Gist to create a Daemonset suitable for Centos/RedHat targets
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: registry-ca
namespace: kube-system
labels:
k8s-app: registry-ca
spec:
selector:
@albal
albal / led_control.md
Created January 15, 2025 19:00 — forked from ffalt/led_control.md
Lincstation LED commands on TrueNAS 24.10

Disclaimer: These commands with wrong parameters could damage your system. Take care!

Before you use any commands on this page you MUST find out the bus number for the led control on your system

Run

i2cdetect -y 0

i2cdetect -y 1
@albal
albal / get-ips.sh
Created November 13, 2024 17:50
get-ips.sh
#!/bin/bash
# Define an array of remote host IPs
hosts=("10.199.251.11" "10.199.251.12" "10.199.251.13")
# Loop through each host
for host in "${hosts[@]}"; do
echo "Connecting to $host..."
# Execute the command remotely to get the IP address and subnet mask of ens6f0
@albal
albal / ids.txt
Created September 28, 2024 18:53
Vultr compute ids (VMs)
vc2-16c-64gb
vc2-16c-64gb-sc1
vc2-1c-0.5gb-free
vc2-1c-1gb
vc2-1c-1gb-sc1
vc2-1c-2gb
vc2-1c-2gb-sc1
vc2-24c-96gb
vc2-24c-96gb-sc1
vc2-2c-2gb
@albal
albal / notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes.yaml Home Assistant Blueprint: Notify or do something when an appliance like a dishwasher or washing machine finishes
blueprint:
name: Appliance has finished
description: Do something when an appliance (like a washing machine or dishwasher)
has finished as detected by a power sensor.
domain: automation
input:
power_sensor:
name: Power Sensor
description: Power sensor entity (e.g. from a smart plug device).
selector:
@albal
albal / create_vms.ps1
Created March 27, 2024 14:52
Create two VMs in different Azure Regions using Az PowerShell
# Define variables
$username = "kodekloud" # Username for the VM
$plainPassword = "VMP@55w0rd" # Your VM password
$vmSize = "Standard_B1s"
$azureVmPublisherName = "Canonical"
$azureVmOffer = "0001-com-ubuntu-server-jammy"
$azureVmSkus = "22_04-LTS"
# Creating VM credential; use your own password and username by changing the variables
$password = ConvertTo-SecureString $plainPassword -AsPlainText -Force
@albal
albal / new_vms.ps1
Created March 26, 2024 21:56
Creation of two Ubuntu VMs in Azure East and West US
# Define variables
$username = "kodekloud" #username for the VM
$plainPassword = "VMP@55w0rd" #your VM password
$vmSize = "Standard_B1s"
#Creating VM credential; use your own password and username by changing the variables
$password = ConvertTo-SecureString $plainPassword -AsPlainText -Force
$vmCredential = New-Object System.Management.Automation.PSCredential ($username, $password);
$azureVmPublisherName="Canonical"
@albal
albal / gist:132f678829fc3fd424f828abafa69bcc
Created March 19, 2024 17:44
Messing around with Elasticsearch in Python
from datetime import datetime
from elasticsearch import Elasticsearch
from faker import Faker
import sys
import argparse
# Create the argument parser
parser = argparse.ArgumentParser(description='Elasticsearch command line tool')
# Add the command line arguments