Skip to content

Instantly share code, notes, and snippets.

@mainda01
mainda01 / log.sh
Last active September 8, 2025 14:51
#!/usr/bin/env bash
set -euo pipefail
#####################################
# Domain Layer: Entry & Roll-up Types
#####################################
ENTRY_TYPE_INSIGHT="insight"
ENTRY_TYPE_FACT="fact"
@mainda01
mainda01 / sync_peerings.sh
Created May 7, 2024 11:39
Script to sync both sides of a targeted vnet, with all peers
#!/bin/bash
# Function to display help menu
display_help() {
echo "Usage: $0 [options]"
echo "Options:"
echo " -s, --subscription <subscription_name> Specify the Azure subscription name"
echo " -h, --help Display this help menu"
}
@mainda01
mainda01 / build.sh
Last active August 1, 2024 20:14
Kubeconfig builder with aks polling
#! /usr/bin/env bash
# Use this any time a cluster has been added, rebuilt or removed or if you gain access to
# one you didn't previously have.
# Function to check Azure CLI login status
check_az_login() {
if az account show &>/dev/null; then
echo "Azure CLI is logged in."
else
@mainda01
mainda01 / settings.jsonc
Created May 15, 2023 13:52 — forked from hyperupcall/settings.jsonc
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@mainda01
mainda01 / prepare-kubeconfig-aks.sh
Created April 4, 2023 13:44
Prepare kubeconfig for MBS AKS Clusters
# credentials are merged with .kube/config
az login
for account in dev nonprod prod; do
echo "Changing to us-mbs-${account}"
az account set --name "us-mbs-${account}"
for application in linux win; do
for cluster in eastus eastus-backup; do
if [[ "${cluster}" =~ "backup" ]]; then
@mainda01
mainda01 / get-ubuntu-pod.sh
Created April 4, 2023 13:44
Launch Ubuntu Pod
get-ubuntu-pod () {
cat <<EOF | kubectl apply "$@" -f -
apiVersion: v1
kind: Pod
metadata:
name: ubuntu
labels:
app: ubuntu
spec:
affinity:
@mainda01
mainda01 / compare-drift.sh
Last active March 31, 2023 19:01
Isolate drift between cluster IaC
#!/usr/bin/sh
[ -d ".git" ] && echo "This script must be run outside of a git repo" && exit 1
echo "Source of Truth - Branch (DEV/NONPROD/PROD)?"
read branch_truth
BT=${branch_truth,,}
echo "Source of Truth - Cluster (A/B)?"
read cardnial_truth
#!/bin/sh
echo "Live Clusters"
DEV_SERVICES=`az network dns record-set cname show \
--subscription us-mbs-dev \
--resource-group app-dns-prod-eastus2 \
--zone-name us-mbs-dev.azure.lnrsg.io \
--name dev | jq -r '.cnameRecord.cname' | cut -f1 -d\.`
DEV_LEGACY=`az network dns record-set cname show \
--subscription us-mbs-dev \
# credentials are merged with .kube/config
az login
for account in dev nonprod prod; do
echo "Changing to us-mbs-${account}"
az account set --name "us-mbs-${account}"
for application in linux win; do
for cluster in eastus eastus-backup; do
if [[ "${cluster}" =~ "backup" ]]; then
https://pureinfotech.com/bring-back-classic-context-menu-windows-11