Skip to content

Instantly share code, notes, and snippets.

@piotrkochan
piotrkochan / shred.ps
Created March 9, 2023 18:48
start virtualbox hdd shred image with hdd selector
$vm_name = "shred"
$iso_path = "C:\...\shredos-2021.08.2_23_x86-64_0.34_20221231.iso"
$directory = "C:\...\VirtualBox VMs\shred\vmdks"
# Stop the virtual machine if it's running
if ((VBoxManage.exe showvminfo $vm_name | Select-String 'State' | Select-String 'running') -ne $null) {
VBoxManage.exe controlvm $vm_name poweroff -forc
}
# Remove all existing VMDK files from the directory
@piotrkochan
piotrkochan / choco-packages.txt
Last active September 1, 2024 18:05
chocolatey list
7zip|24.7.0
7zip.install|24.7.0
altdrag|1.461.0
androidstudio|2024.1.1.11
autodesk-fusion360|2.0.19440
bitwarden|2024.8.1
brave|1.67.123
chocolatey|2.3.0
chocolatey-compatibility.extension|1.0.0
chocolatey-core.extension|1.4.0
@piotrkochan
piotrkochan / sync.ps1
Created July 2, 2024 17:07
Chocolatey - sync packages with github gist
# Chocolatey Package Export Script
# Get the list of installed Chocolatey packages
$chocoList = choco list --local-only --limit-output
$packageList = $chocoList -join "`n"
# GitHub Personal Access Token (replace with your own)
# https://github.com/settings/tokens?type=beta
$token = "xxxxx"
groups:
- name: ProxySQL_Cluster
rules:
# Alert for cluster sync conflicts
- alert: ProxySQLClusterSyncConflicts
expr: |
sum by (module_name) (
rate(proxysql_cluster_syn_conflict_total[5m])
) > 0
for: 5m