Skip to content

Instantly share code, notes, and snippets.

@ergosteur
ergosteur / import-ova-pve.py
Created July 6, 2025 01:19
Script to import OVA/OVF appliances into Proxmox VE
#!/usr/bin/env python3
import os
import sys
import tarfile
import tempfile
import subprocess
import xml.etree.ElementTree as ET
import argparse
import shutil
@ergosteur
ergosteur / DNS_DHCPLeaseEvent.rsc
Created April 23, 2025 02:54
DHCP Lease Event Script for Mikrotik to automatically add DNS A records for new IPv4 DHCP Leases
# DNS_LeaseEvent
# Handles a single DHCP lease bind or release/expire event
# 1) Locate the exact lease by its MAC & IP
:local leaseId [/ip dhcp-server lease find where mac-address=$leaseActMAC and address=$leaseActIP]
:if ($leaseId = "") do={
:log warning "DNS_LeaseEvent: lease not found for $leaseActMAC / $leaseActIP, aborting"
:return
}
@ergosteur
ergosteur / letsencrypt-mikrotik-docker-acme.md
Created April 23, 2025 01:03
Automated Let’s Encrypt on MikroTik via acme.sh Container

Automated Let’s Encrypt on MikroTik via acme.sh Container

(in 13 lucky steps)


This guide shows how to run acme.sh in a RouterOS container on your USB drive, use Cloudflare DNS‑01, and deploy certs via SSH to RouterOS automatically.

0. Initial Docker Configuration

param (
[string]$SourceFile = "C:\source\largefile.iso",
[string]$TargetFile = "D:\target\largefile.iso"
)
$contigUrl = "https://download.sysinternals.com/files/Contig.zip"
$contigFolder = "$env:TEMP\ContigTool"
$contigExe = Join-Path $contigFolder "contig.exe"
$contigZip = Join-Path $contigFolder "contig.zip"
@ergosteur
ergosteur / WingetMenuHelper.ps1
Last active October 30, 2024 02:24
Helper script that creates a sort of Ninite-like experience for Winget
# Load Windows Forms assembly for confirmation dialog
Add-Type -AssemblyName System.Windows.Forms
### Variables
# Array of .NET Desktop Runtime packages
$dotnetDesktopPackages = 5..8 | ForEach-Object { "Microsoft.DotNet.DesktopRuntime.${_}" }
$dotnetRuntimePackages = 5..8 | ForEach-Object { "Microsoft.DotNet.Runtime.${_}" }
# Grouped arrays for applications (with corrected package IDs)
$browsers = @("Mozilla.Firefox", "Google.Chrome", "Vivaldi.Vivaldi", "Waterfox.Waterfox")
@ergosteur
ergosteur / download-virtio-win.py
Last active May 20, 2025 17:41
Script to download the latest version of virtio-win iso keeping the version number.
#!/usr/bin/env python3
# install libraries
# apt install python3-requests python3-bs4 python3-tqdm
import os
import requests
from bs4 import BeautifulSoup
import re
from tqdm import tqdm
import argparse
@ergosteur
ergosteur / debian-x11vnc-console-server-setup-systemd.sh
Last active August 25, 2024 20:39
This script installs and configures x11vnc to run as a systemd service, sharing the console/local display, for Ubuntu/Debian systems.
#!/bin/bash
# -----------------------------------------------------------------------------
# x11vnc Setup Script
# Version: 1.1
# Date: 2024-08-25
# Description:
# This script installs and configures x11vnc to run as a systemd service.
# It checks if x11vnc is already installed, configures the VNC password,
# and creates the necessary systemd service file if it does not already exist.
@ergosteur
ergosteur / youtube-archive.sh
Created July 31, 2024 12:54
Script to archive youtube videos including metadata, safe filenames, support for subs and multiple preset formats. Easily customizable
#!/bin/bash
# Unified script for downloading videos in various formats, supporting individual and batch downloads
# Configuration Variables
archivepath="/volume1/atlantic/users/matt/youtube-dl-archive"
output_template='%(uploader)s/%(upload_date)s %(title).50s [%(id)s][%(resolution)s][%(vcodec).4s+%(acodec).4s][%(dynamic_range)s][%(format_id)s][%(availability)s].%(ext)s'
ffmpeg_location="/var/packages/ffmpeg6/target/bin/"
ytdlp_binary="/var/services/homes/matt/.local/bin/yt-dlp"
options="--windows-filenames --write-thumbnail --embed-chapters --add-metadata --ffmpeg-location=$ffmpeg_location"
alias ffmpeg=ffmpeg6
@ergosteur
ergosteur / Get-AllMailboxDelegation.ps1
Created May 28, 2024 23:23
This PowerShell script retrieves and displays the delegated permissions for a specified mailbox (SendAs, SendOnBehalf, FullAccess) or group (SendAs, SendOnBehalf, Members) in Exchange Online.
<#
.NOTES
Script: Get-AllMailboxDelegation.ps1
Author: ergosteur/Matthieu + Copilot
Date: 28 May 2024
Version: 1.0
.SYNOPSIS
This script retrieves and displays the delegated permissions for a specified mailbox or group in Exchange Online.
@ergosteur
ergosteur / Rename-OldEXOMailboxes.ps1
Last active May 28, 2024 23:22
This script updates the Name and Alias properties of Exchange Online mailboxes to align with Microsoft's new naming convention, as described here: https://techcommunity.microsoft.com/t5/exchange-team-blog/change-in-naming-convention-of-user-s-name-parameter/ba-p/3284733?WT.mc%5C_id=M365-MVP-9501
<#
.NOTES
Script: Rename-OldEXOMailboxes.ps1
Author: ergosteur/Matthieu + Copilot
Date: 28 May 2024
Version: 1.0
.SYNOPSIS
This script updates the Name and Alias properties of Exchange Online mailboxes to align with Microsoft's new naming convention.