Skip to content

Instantly share code, notes, and snippets.

View gioxx's full-sized avatar
🧙‍♂️
I do things, I see people, I write.

Giovanni Francesco Solone gioxx

🧙‍♂️
I do things, I see people, I write.
View GitHub Profile
#!/usr/bin/env bash
# Proxmox LXC tuning script
# Usage: sudo ./tune-pct.sh <CTID>
# Applies:
# - pct set <CTID> -features nesting=1,keyctl=1
# - AppArmor unconfined
# - Allow all devices via cgroup2
# - Empty cap drop line
# - pct restart <CTID>
@gioxx
gioxx / swaksWrapper.sh
Last active October 28, 2025 15:59
SMTP interactive tester wrapper for swaks (https://jetmore.org/john/code/swaks/)
#!/usr/bin/env bash
# SMTP interactive tester wrapper for swaks
# Gioxx, 2025 - https://github.com/gioxx
# - Checks and optionally installs swaks and Net::SSLeay (interactive)
# - Prompts the user for SMTP parameters with sensible defaults (Office365)
# - Builds a safe argument vector and runs swaks
# - Appends an RFC-like date to the Subject
set -euo pipefail
@gioxx
gioxx / DDG_AcceptFrom.ps1
Created July 28, 2025 10:33
Export AcceptMessagesOnlyFromMembers value from DDG (Exchange in Cloud)
Get-DynamicDistributionGroup | ForEach-Object {
$group = $_
foreach ($sender in $group.AcceptMessagesOnlyFromSendersOrMembers) {
try {
$resolved = Get-Recipient $sender
[PSCustomObject]@{
GroupDisplayName = $group.DisplayName
GroupPrimaryAddress = $group.PrimarySmtpAddress
SenderDisplayName = $resolved.DisplayName
SenderPrimaryAddress = $resolved.PrimarySmtpAddress
@gioxx
gioxx / proxmox_shutdown.sh
Last active July 31, 2025 13:32
How to properly shutdown virtual machines and LXCs in Proxmox using qm/pct commands (and track operations in a log file).
#!/bin/bash
# Proxmox: Shutdown VMs and LXCs (GSolone, 2025)
# This script stops all running VMs and LXC containers, excluding specified IDs, and logs the operation.
# In DEBUG mode, it only stops one VM and one LXC container for testing purposes, ignoring exclusions.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
logfile="/var/log/proxmox_shutdown.log"
LOCKFILE="/tmp/proxmox_shutdown.lock"
# Timestamp helper
@gioxx
gioxx / FindIMEDownloadURL.ps1
Last active April 8, 2025 08:27
Finds the download URL for IntuneWindowsAgent.
<#
.SYNOPSIS
Finds the download URL for IntuneWindowsAgent.
.DESCRIPTION
This script retrieves the download URL for IntuneWindowsAgent from the registry.
It checks the registry path for the specified subkeys and retrieves the DownloadUrlList and ProductVersion properties.
.EXAMPLE
.\FindIMEDownloadURL.ps1
This command runs the script to find the download URL for IntuneWindowsAgent.
.NOTES
@gioxx
gioxx / Update-CSVDelimiter.ps1
Created February 7, 2025 13:08
Funzione PowerShell che permette di modificare il delimitatore utilizzato in un file CSV (da virgola a punto e virgola, e viceversa). Accetta parametri da riga di comando (file da lavorare, opzione di delimitazione da utilizzare). Il file che gli viene dato in pasto, viene modificato (quindi occhio, fai prima backup del tuo file, se necessario).
function Update-CSVDelimiter {
param (
[string]$FilePath,
[string]$Encoding = "ISO-8859-1", # Default encoding, can be changed
[switch]$ToComma, # Switch to convert ";" to ","
[switch]$ToSemicolon # Switch to convert "," to ";"
)
# Check if the specified file exists
if (Test-Path $FilePath) {
@gioxx
gioxx / Rename.bat
Created January 30, 2025 15:19
Batch che rinomina i file PDF ottimizzati da Stirling PDF, rimuovendo loro il "_Optimized" che hanno in coda al nome del file originale.
@echo off
:: GSolone, 2025
:: Rinomina i file PDF ottimizzati tramite Stirling-PDF e toglie dal nome "_Optimized"
:: Inserisci questo file batch nella cartella contenente i file PDF e lancialo. Spostalo ovunque tu ne abbia necessità.
setlocal enabledelayedexpansion
set "findWord=_Optimized"
for %%F in (*) do (
set "oldName=%%F"
set "newName=!oldName:%findWord%=!"
if not "!oldName!"=="!newName!" ren "%%F" "!newName!"
@gioxx
gioxx / Exchange-iOS-HWVersions.txt
Last active October 4, 2024 08:19
Exchange ActiveSync iOS Hardware Versions (credits: https://justworks.ca/blog/ios-and)
iPod2C1 = iPod Touch 2
iPod3C1 = iPod Touch 3
iPod4C1 = iPod Touch 4
iPod5C1 = iPod Touch 5
iPad1C1 = iPad
iPad2C1 = iPad 2 WIFI
iPad2C2 = iPad 2 WIFI + 3G
iPad2C3 = iPad 2 WIFI + 3G CDMA
iPad2C4 = iPad Mini - WIFI
@gioxx
gioxx / csv_delimiter.py
Created July 29, 2024 12:14
Uno script per modificare il delimitatore dei file CSV (da virgola a punto e virgola).
import csv
import sys
if len(sys.argv) != 3:
print("Utilizzo: python script.py input_file.csv output_file.csv")
sys.exit(1)
input_file = sys.argv[1]
output_file = sys.argv[2]
@gioxx
gioxx / checkVMGuest.ps1
Created November 28, 2023 13:57
Verifica lo stato dei VMware Tools e della Compatibility di tutte le macchine all'interno di un vCenter al quale si è collegati. Vedi l'articolo sul blog: https://go.gioxx.org/checkvmguest
# Retrieve the status (and the version) of the VMware Tools and the Hardware Version (Compatibility) of all VMs powered on
# GSolone, 2023
# Credits
# https://communities.vmware.com/t5/VMware-vSphere-Discussions/How-to-check-VMware-Tools-status-of-VM-use-PowerCLI/td-p/2278893
# https://blogs.vmware.com/PowerCLI/2018/09/discovering-vms-with-specific-vmware-tools-versions.html
Set-Variable ProgressPreference Continue
$arr_VMStats = @()
$ProcessedCount = 0