Skip to content

Instantly share code, notes, and snippets.

View aarkwright's full-sized avatar
💭
fruit flies like a banana

aarkwright

💭
fruit flies like a banana
View GitHub Profile
@aarkwright
aarkwright / git_track_stop.txt
Created July 7, 2020 15:07
Stop tracking specific directory with git
git rm -r --cached <dir_path>/
@aarkwright
aarkwright / python_decorator_guide.md
Created July 7, 2020 15:56 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@aarkwright
aarkwright / get_esxi_installed_packages.ps1
Last active August 10, 2020 13:51
A PowerCLI snippet used to get a list of installed packages on ESXi hosts. I used to figure out if the tools-light package is consistent in my environment.
# Connect to both our SRM enabled vCenters
Connect-VIServer <your_vcenter_server>
# ^^ repeat as needed
# An array to store collected data and output it to .csv at the end
$Results = @()
# Set an array to store our ESXi hosts and populate it with data
$ESXs = @()
$ESXs += Get-Cluster "some cluster name" | Get-VMhost
@aarkwright
aarkwright / vSphere_linux_disk_uuid_correlation.md
Last active July 7, 2021 09:55
vSphere VM to Linux - Device UUID correlation

PREREQUISITE:

Set disk.EnableUUID to TRUE in your vSphere VM config parameters under:

vSphere > VM > Edit Settings > VM Options > Advanced > Configuration Parameters > Edit Configuration

Note: VM needs to be offline to add/change this k:v pair

@ OS level (CentOS/Fedora/RHEL example)

@aarkwright
aarkwright / terraform_azurerm_linux_virtual_machine
Created July 8, 2021 15:23
Terraform - AzureRM - azurerm_linux_virtual_machine
│ Error: creating Linux Virtual Machine "<redacted>" (Resource Group "<redacted>): compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidParameter" Message="StorageProfile.dataDisks.lun does not have required value(s) for image specified in storage profile." Target="storageProfile"
│ with azurerm_linux_virtual_machine.virtual_machine[0],
│ on main.tf line 89, in resource "azurerm_linux_virtual_machine" "virtual_machine":
│ 78: resource "azurerm_linux_virtual_machine" "virtual_machine" {