Skip to content

Instantly share code, notes, and snippets.

View SQLDBAWithABeard's full-sized avatar
🦄
Generally bearding

Rob Sewell SQLDBAWithABeard

🦄
Generally bearding
View GitHub Profile
@SQLDBAWithABeard
SQLDBAWithABeard / All About Eve, 1950
Last active January 22, 2026 15:53
CopyModuleForTesting
Fasten your seatbelts. It's going to be a bumpy night.
function Expand-ZipSubdirectory {
<#
.SYNOPSIS
Extracts only a specific subdirectory from a ZIP archive.
.DESCRIPTION
Expand-ZipSubdirectory allows selective extraction of a single subdirectory
from a ZIP file. Unlike Expand-Archive, which extracts the entire archive,
this function filters ZIP entries by path and extracts only the matching
subtree.
@SQLDBAWithABeard
SQLDBAWithABeard / Expand-ZipSubdirectory.ps1
Last active January 8, 2026 12:15
trail cam timelaps to video script
function Start-TimelapseProcessing {
<#
.SYNOPSIS
Copies image files from SD card, renames them, creates a timelapse video using ffmpeg, and compresses it with HandBrake.
- Source: D:\DCIM\100MEDIA
- Destination: $env:USERPROFILE\OneDrive\Desktop\100media\<date>
- Renames files to lowercase
- Creates timelapse video (mp4)
- Compresses video with HandBrake
#>
@SQLDBAWithABeard
SQLDBAWithABeard / The Wizard of Oz, 1939
Last active August 20, 2025 14:18
sending test syslog messages
There's no place like home.
@SQLDBAWithABeard
SQLDBAWithABeard / Airplane, 1980
Last active July 13, 2025 22:37
insult generator
I am serious. And don't call me Shirley.
@SQLDBAWithABeard
SQLDBAWithABeard / profileforcontainers.ps1
Last active July 2, 2024 08:32
ProfileForContainers
function Load-Profile {
$env:POSH_THEMES_PATH = (Get-ChildItem /workspaces/* -Recurse -Directory|Where-Object Name -eq themes)[0].FullName
function global:Set-PoshPrompt {
param(
$theme
)
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\$theme.omp.json" | Invoke-Expression
}
@SQLDBAWithABeard
SQLDBAWithABeard / remove-filesystemitem.ps1
Last active April 11, 2024 16:02
cant remove unempty dorectories
function Remove-FileSystemItem {
<#
.SYNOPSIS
Removes files or directories reliably and synchronously.
.DESCRIPTION
Removes files and directories, ensuring reliable and synchronous
behavior across all supported platforms.
The syntax is a subset of what Remove-Item supports; notably,
@SQLDBAWithABeard
SQLDBAWithABeard / rough-k8s-backup.ps1
Last active December 6, 2023 11:39
rough-k8s-backup
$resources = (kubectl api-resources --namespaced=$true 2>$null | Where-Object { $_ -notmatch "events" } | Select-Object -Skip 1 | ForEach-Object { $_.Split()[0] })
$output_folder = 'C:\temp\K8s-output'
if(!(Test-Path $output_folder)) {
New-Item $output_folder -ItemType Directory | Out-Null
}
foreach($resource in $resources){
@SQLDBAWithABeard
SQLDBAWithABeard / prompt.ps1
Created May 2, 2023 08:27
Random OhMyPosh prompt :-)
function Load-Profile {
$env:POSH_THEMES_PATH = '{0}\Programs\oh-my-posh\themes' -f $env:LOCALAPPDATA
function global:Set-PoshPrompt {
param(
$theme
)
& oh-my-posh.exe init pwsh --config "$env:POSH_THEMES_PATH\$theme.omp.json" | Invoke-Expression
}
@SQLDBAWithABeard
SQLDBAWithABeard / linux-badge.svg
Last active March 24, 2025 23:18
dbachecks status badges
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.