Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
42 4D DE 97 24 00 00 00 00 00 36 00 00 00 28 00 00 00 59 04 00 00 CE 02 00 00 01 00 18 00 00 00 00 00 A8 97 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9B 11 1D 19 24 47 45 DB 75 05 EA E5 97 C0 B9 D9 38 EB 6F 7F 39 F8 7D 95 2A E4 73 D9 53 5B D1 11 3C 59 76 16 9B E5 4B C2 95 12 88 52 0E 86 72 34 75 80 60 4B 05 E9 D9 AE A2 7F 0E 1A B5 96 22 27 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 40 4D 82 7C 08 95 E7 D8 D1 84 C6 94 50 85 6D 0C 4
@mhupfauer
mhupfauer / New-BrodcastMessage.ps1
Created October 8, 2021 14:22
Send Microsoft Teams Message via PowerShell GraphAPI to all users based on regex pattern
function New-BroadcastMessage {
param(
$user_pattern,
$sender_id,
$message
)
Connect-MgGraph "Chat.ReadWrite","Chat.ReadWrite","User.Read.All"
$contacts = Get-MgUser -All:$true | Where-Object {$_.userprincipalname -like $user_pattern}
@mhupfauer
mhupfauer / gist:de1c02204ec6299508de381734ef4f47
Created September 28, 2021 11:22
Get all azure ad users with assigned licenses sku
$out=@{}; Get-AzureADUser -All:$true -Filter "UserType eq 'Member'" | % {$out.Add($_.ObjectId, $_.assignedLicenses.SkuId)}; $out
@mhupfauer
mhupfauer / fix-wuauserv.ps1
Last active May 20, 2021 07:49
Fix Windows Update on Windows 10 clients managed by SCCM
Write-Progress -Activity "Stopping Services" -PercentComplete 1
Stop-Service -Name wuauserv -Force
Stop-Service -Name BITS -Force
Stop-Service -Name CryptSvc -Force
Stop-Service -Name msiserver -Force
Write-Progress -Activity "Stopped Services" -PercentComplete 10
Start-Sleep -Seconds 3
@mhupfauer
mhupfauer / caddy-wp.conf
Created March 26, 2021 00:00
Fail2Ban regex for WordPress on Caddy (with custom rejection HTTP451 for /xmlrpc.php)
[Definition]
failregex = "common_log":"<HOST>\s(.*)\\"POST \/wp-login.php HTTP\/2.0\\" 200
"common_log":"<HOST>\s(.*)\/xmlrpc.php(.*)\s451
ignoreregex =
@mhupfauer
mhupfauer / cloud-init
Created October 31, 2020 19:40
Hetzner Cloud Init Jitsi (native)
#cloud-config
package_upgrade: true
runcmd:
- curl https://download.jitsi.org/jitsi-key.gpg.key | sudo sh -c 'gpg --dearmor > /usr/share/keyrings/jitsi-keyring.gpg'
- echo 'deb [signed-by=/usr/share/keyrings/jitsi-keyring.gpg] https://download.jitsi.org stable/' | sudo tee /etc/apt/sources.list.d/jitsi-stable.list > /dev/null
- apt update
@mhupfauer
mhupfauer / cloud-init
Last active March 4, 2022 17:00
Hetzner Cloud-Init for Docker Hosts
#cloud-config
package_upgrade: true
packages:
- git
runcmd:
- curl -fsSL https://get.docker.com | sh
- curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- chmod +x /usr/local/bin/docker-compose