Skip to content

Instantly share code, notes, and snippets.


Adam Rush adamrushuk

View GitHub Profile
adamrushuk /
Created Sep 26, 2022
AKS Periscope Kustomize Deployment Script
#!/usr/bin/env bash
# AKS Periscope Kustomize Deployment Script
# This script will do the following:
# - create a SAS token valid for 60 minutes
# - deploy AKS Periscope into your cluster
# - collect and save logs into the storage account specified
# Set some variables for where you want the logs uploaded to:
adamrushuk / aks-disk-detach-wait.ps1
Last active Sep 23, 2022
AKS Disk Detach Wait Scripts
View aks-disk-detach-wait.ps1
# get disk for aks to check attachment state during disk expansion
# vars
$subscriptionName = ""
$aksClusterName = ""
$aksClusterResourceGroupName = ""
$pvcName = ""
# login
Connect-AzAccount -UseDeviceAuthentication
adamrushuk / Clear-DeletedBranches.ps1
Created May 29, 2021
Clear deleted git branches
View Clear-DeletedBranches.ps1
function Clear-DeletedBranches {
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
[Parameter(Mandatory = $false)]
$GitDir = $PWD
$defaultBranch = ((git symbolic-ref --short refs/remotes/origin/HEAD) -split "/")[1]
adamrushuk /
Created Nov 2, 2020
Testing process to expand k8s PVCs without losing data
# Testing process to expand k8s PVCs without losing data
#region Install
# Check the current cluster
kubectl config current-context
# Add bitnami repo
helm repo list
helm repo add bitnami
View packer_v1.6.0_20200625-1233.log
2020/06/25 12:34:07 [INFO] Packer version: 1.6.0 [go1.13.12 linux amd64]
2020/06/25 12:34:07 Checking 'PACKER_CONFIG' for a config file path
2020/06/25 12:34:07 'PACKER_CONFIG' not set; checking the default config file path
2020/06/25 12:34:07 Attempting to open config file: /home/adamr/.packerconfig
2020/06/25 12:34:07 [WARN] Config file doesn't exist: /home/adamr/.packerconfig
2020/06/25 12:34:07 Setting cache directory: /mnt/c/Users/adamr/code/Packer-Templates/azure-test/packer_cache
2020/06/25 12:34:07 Creating plugin client for path: /usr/local/bin/packer
2020/06/25 12:34:07 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-builder-azure-arm"}
2020/06/25 12:34:07 Waiting for RPC address for: /usr/local/bin/packer
2020/06/25 12:34:07 packer-builder-azure-arm plugin: [INFO] Packer version: 1.6.0 [go1.13.12 linux amd64]
# Set GitLab pipeline status
# vars
# status can be one of: running, pending, success, failed, canceled, skipped, created, manual
# get required info
adamrushuk / Publish-AzDOArtifactFeed.ps1
Created Jun 20, 2019
Publish a PowerShell Module to an Internal Azure DevOps Artifacts feed
View Publish-AzDOArtifactFeed.ps1
param (
[string]$AzDOAccountName = 'adamrushuk',
[string]$AzDOArtifactFeedName = 'dev',
[string]$ModuleFolderPath = (Join-Path -Path $env:SYSTEM_ARTIFACTSDIRECTORY -ChildPath "PowerShellPipeline\PSModule\PSvCloud")
# Variables
$feedUsername = 'NotChecked'
adamrushuk / KeePass.ps1
Created Mar 17, 2019
KeePass PowerShell examples
View KeePass.ps1
#Requires -RunAsAdministrator
# Testing KeePass automation against KeePass v2.39.1
# Vars
$masterKeyCredential = New-Object -TypeName 'PSCredential' -ArgumentList ('KPMasterUser', (ConvertTo-SecureString -String 'Passw0rd123!' -AsPlainText -Force))
$repoPath = 'C:\Code\KeePass\KeePassDB'
$databaseName = 'KeePassDatabase'
$databasePath = Join-Path -Path $repoPath -ChildPath "$databaseName.kdbx"
$databaseProfileName = 'KeePassDatabaseProfile01'
$testGroupName = 'TestAccounts'
adamrushuk / ConfigureAzureForSecureTerraformAccess.ps1
Created Feb 17, 2019
Configures Azure for secure Terraform access. Loads Azure Key Vault secrets into Terraform environment variables for the current PowerShell session.
View ConfigureAzureForSecureTerraformAccess.ps1
Configures Azure for secure Terraform access.
Configures Azure for secure Terraform access using Azure Key Vault.
The following steps are automated:
- Creates an Azure Service Principle for Terraform.
- Creates a new Resource Group.
- Creates a new Storage Account.
adamrushuk / 01-Boxstarter.ps1
Last active Jul 14, 2021
New Computer Configuration Scripts - run each script in order
View 01-Boxstarter.ps1
# Install Boxstarter and Chocolatey
Set-ExecutionPolicy -ExecutionPolicy "RemoteSigned" -Verbose
. { iwr -useb } | iex; get-boxstarter -Force
# Set Explorer options
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -DisableShowRecentFilesInQuickAccess -DisableShowFrequentFoldersInQuickAccess -DisableExpandToOpenFolder -DisableShowRibbon
# Set Taskbar options
Set-TaskbarOptions -Size Large -Lock -Dock Bottom -Combine Always