Skip to content

Instantly share code, notes, and snippets.

View Ianvdl's full-sized avatar
🐘
The local elephant tamer

Ian van der Linde Ianvdl

🐘
The local elephant tamer
View GitHub Profile
@Ianvdl
Ianvdl / software_versions.ps1
Last active September 17, 2020 07:54
A puppet fact to get software versions on Windows
$list1 = $(gci -recurse HKLM:Software\Microsoft\Windows\CurrentVersion\Uninstall | gp | select-object displayname,displayversion)
$list2 = $(gci -recurse HKLM:SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall | gp | select-object displayname,displayversion)
$software = $list1 + $list2
#exact names
$names = 'Dropbox', 'RStudio', 'paint.net', 'Puppet Agent', 'Google Chrome', 'Adobe Acrobat DC'
ForEach($name in $names)
{
$item = $($software | where-object {$_.DisplayName -eq $name})
if ($item)
@Ianvdl
Ianvdl / megaraid.conf
Created September 13, 2023 07:12
Monitoring MegaRAID using Telegraf
# Documented at https://ivdl.co.za/2023/09/12/monitoring-megaraid-arrays-using-telegraf-and-megaraidsas-status-on-linux/
# Covers megaraidsas-status and megacli
# Modifications to sudoers file required - documented above
[[inputs.exec]]
commands = ["bash -c 'sudo megaraidsas-status | grep RAID | grep -q -v degraded && echo true || echo false'"]
name_override = "megaraid_optimal"
value_field_name = "is_optimal"
data_format = "value"
@Ianvdl
Ianvdl / 0fixup.md
Created March 4, 2024 13:31 — forked from silent1mezzo/0fixup.md
On undoing, fixing, or removing commits in git

A git choose-your-own-adventure!

This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. It isn't that git is so complicated that you need a large document to take care or your particular problem, it is more that the set of things that you might have done is so large that different techniques are needed depending on exactly what you have done and what you want to have happen.