I hereby claim:
- I am kbni on github.
- I am kbni (https://keybase.io/kbni) on keybase.
- I have a public key ASDqHaSe6rQElE-gX3Bn_a3cqTVz-H8MlBBsZPzXeClOfQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
### Keybase proof | |
I hereby claim: | |
* I am kbni on github. | |
* I am kbni (https://keybase.io/kbni) on keybase. | |
* I have a public key ASDqHaSe6rQElE-gX3Bn_a3cqTVz-H8MlBBsZPzXeClOfQo | |
To claim this, I am signing this object: |
Set-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) | |
$IconDownloadTemplate = 'https://img.icons8.com/windows/2x/{colour}/{thing}.png' | |
$IconSaveTemplate = 'icons/{thing}.{colour-name}.png' | |
$WantedIcons = @' | |
https://img.icons8.com/windows/2x/{colour}/server | |
https://img.icons8.com/windows/2x/{colour}/windows-client | |
https://img.icons8.com/windows/2x/{colour}/linux-client | |
https://img.icons8.com/windows/2x/{colour}/mac-client |
// ==UserScript== | |
// @name HaloPSA Tweaks | |
// @namespace https://kbni.net.au/ | |
// @version 20210528.1342 | |
// @description just some HaloPSA tweaks | |
// @author Alex Wilson | |
// @match https://psa.anspired.com.au/* | |
// @grant none | |
// ==/UserScript== |
sub bulk_terminate_alarms(limit) { | |
counter = 0; | |
clear_key_regex = "^(SW_PKG)"; | |
clear_message_regex = "(changed to UNSUPPORTED)$"; | |
for (n : GetAllNodes()) { | |
for (a : n->alarms) { | |
if(a->state == 0 && (a->key ~= clear_key_regex || a->message ~= clear_message_regex)) { | |
a->terminate(); | |
println("Alarm terminated: " . a->key . ": " . a->message); |
import json | |
from datetime import datetime, timedelta | |
import pendulum | |
import pytz | |
from kombu.serialization import register | |
from miso.utils import ServiceResult | |
class SpecialJSONEncoder(json.JSONEncoder): | |
""" |
from munch import munchify, Munch | |
def automunchify(data): | |
return munchify(data, AutoMunch) | |
class AutoMunch(Munch): | |
""" For convenience, we'll use this instad of the standard Munch so if we add a dict | |
into the Munch that dict itself will be munchified. |
#!/usr/bin/env bash | |
# Author: Alex Wilson <admin@kbni.net> | |
# | |
# Basic script to assist with managing zato hosts | |
function script_help() { | |
echo "$(basename "$0") - Zato control script" | |
echo "author: Alex Wilson <admin@kbni.net>" | |
echo "" | |
echo "arguments:" |
#!/usr/bin/env bash | |
# Author: Alex Wilson <admin@kbni.net> | |
# | |
# Basic script to assist with managing zato hosts | |
function script_help() { | |
echo "$(basename "$0") - Zato control script" | |
echo "author: Alex Wilson <admin@kbni.net>" | |
echo "" | |
echo "arguments:" |
#$VerbosePreference = "Continue" | |
$SnapShotVM = @("KBNI-TS1", "KBNI-DC1", "KBNI-WWW1") | |
$LogFile = "C:\Logs\RollingCheckpoints.txt" | |
$LogDir = New-Item -Type Directory -Path (Split-Path -Path $LogFile) | |
Foreach($VM in $SnapShotVM) { | |
$m = Measure-Command { Get-VM $VM | Get-VMSnapshot | Sort-Object -Descending | Select -Skip 24 | Remove-VMSnapshot -Verbose | Out-Host } | |
$log = [string]::Format("Removing old snapshots for ${VM} took {0:N2} seconds", $m.TotalSeconds) | |
$log | Out-Host | |
$log | Out-File -Append -FilePath $LogFile |