Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env pwsh
# permission denied in AWX? do this: git add --chmod=+x path/to/file
# instance properties to add to _meta
$properties = @("*")
# regex to exclude instance tags
$tagExclusions = "bd_gitpath|workload_type"
# read cloud inventory json
$cloudInventory = Get-Content inventory.json | ConvertFrom-Json
# determine which subprojects are auditable
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#MaxThreadsPerHotkey 1
; Critical strike + Circular strike + animation cancel
XButton1::
send,{f1}
send,{f4}
sleep,450
; prone
function Optimize-DRSSeparateVMs {
<#
.SYNOPSIS
Creates DRS rules to keep similar VMs on separate VMHosts.Existing AntiAffinity rules are removed.
If VMHosts.count is less than or equal to 4, the max VMs per group is count-1. Otherwise count-2
.EXAMPLE
Create DRS rules on MYCLUSTER
Optimize-DRSSeparateVMs -Cluster MYCLUSTER
.EXAMPLE
Create DRS rules on all clusters
; https://www.autohotkey.com/docs/Hotkeys.htm
; ^ = Control
; * = Wildcard: Fire the hotkey even if extra modifiers are being held down
; ~ = When the hotkey fires, its key's native function will not be blocked (hidden from the system)
; Click positions assume 1920x1080 resolution
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#MaxThreadsPerHotkey 2
SetDefaultMouseSpeed 0
@abix-
abix- / moe.ahk
Last active December 23, 2021 21:29
; https://www.autohotkey.com/docs/Hotkeys.htm
; ^ = Control
; * = Wildcard: Fire the hotkey even if extra modifiers are being held down
; ~ = When the hotkey fires, its key's native function will not be blocked (hidden from the system)
; Click positions assume 1920x1080 resolution
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#MaxThreadsPerHotkey 1
SetDefaultMouseSpeed 0
@abix-
abix- / atlas.ahk
Last active December 6, 2022 00:04
Atlas macros
; https://www.autohotkey.com/docs/Hotkeys.htm
; ^ = Control
; * = Wildcard: Fire the hotkey even if extra modifiers are being held down
; ~ = When the hotkey fires, its key's native function will not be blocked (hidden from the system)
; Click positions assume 1920x1080 resolution
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#MaxThreadsPerHotkey 1
SetDefaultMouseSpeed 0
@abix-
abix- / OneNote.ps1
Last active March 3, 2023 16:51
Converting between OneNote Tables and PowerShell PSObject
function Get-1NotePage {
<#
.SYNOPSIS
Finds the ID of a OneNote page
.DESCRIPTION
http://thebackend.info/powershell/2017/12/onenote-read-and-write-content-with-powershell/
.EXAMPLE
Get-1NotePage -Name "PowerShell Test"
#>
[cmdletbinding()]
<#
.SYNOPSIS
Collect configuration metrics for a VMHost, Cluster, Datacenter, or vCenter. For each VM Host found, these metrics are collected:
-Parent object(Cluster, Datacenter)
-Hardware model
-ESXi build
-IP address
-VMs on host
-physical CPUs(pCPU) on host
-virtual CPUs(vCPU) allocated
vCenter Credentials
vcenter-a domain.local\credentials
old-vcenter sub.domain.local\credentials
Vcenter-reallylongname domain.local\credentials
@abix-
abix- / cvi.ps1
Last active August 29, 2015 14:24
How can I login to vSphere and PowerCLI faster?
function cvi([switch]$client) {
#Read vcenters.csv and draw menu
$vcenters = Import-Csv "C:\Scripts\vcenters.csv"
Write-Host "Select a server from the list"
for($i = 1; $i -lt $vcenters.count + 1; $i++) { Write-Host "[$i] $($vcenters[$i-1].vCenter)" }
#Switch $option to determine selected vCenter
$option = Read-Host
switch -Regex ($option) {
"\d" {