Skip to content

Instantly share code, notes, and snippets.

View Froosh's full-sized avatar

Robin Frousheger Froosh

View GitHub Profile
@Froosh
Froosh / imx23-holiday.dts
Last active March 18, 2024 12:38
MooresCloud Holiday Lights devicetree source file (with hardware SPI and i2c 24c64 EEPROM support)
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright 2012 Freescale Semiconductor, Inc.
*
* Author: Fabio Estevam <fabio.estevam@freescale.com>
* Adjusted for MooresCloud Holiday lights, based on the OLinuXino open hardware
* Edits by Robin Frousheger
*/
/dts-v1/;
@Froosh
Froosh / Remove-OldModules.ps1
Last active December 6, 2023 00:46
Remove old modules, useful for after a few Az or Microsoft.Graph metamodule upgrades
Get-InstalledPSResource -Scope CurrentUser |
Group-Object -Property Name |
ForEach-Object -Process {
$VersionsToRemove = $PSItem.Group | Sort-Object -Property Version -Descending | Select-Object -Skip 1
foreach ($Version in $VersionsToRemove) {
Uninstall-PSResource -Verbose -Name $Version.Name -Version $Version.Version -SkipDependencyCheck
}
}
@Froosh
Froosh / combinedEndpoints.bicep
Created December 10, 2022 12:48
Combine the primary and secondary endpoints from a storage account into one object of arrays, rather than two separate objects
var storage = {
properties: {
primaryEndpoints: {
dfs: 'https://frooshtinkering.dfs.core/'
web: 'https://frooshtinkering.z26.web.core/'
blob: 'https://frooshtinkering.blob.core/'
queue: 'https://frooshtinkering.queue.core/'
table: 'https://frooshtinkering.table.core/'
file: 'https://frooshtinkering.file.core/'
}
@Froosh
Froosh / Set-NonDefaultKDSConfig.ps1
Last active October 26, 2021 12:36
Set-KDSConfiguration for non-default KDS Root Key generation in Windows Server 2022. Do this **before** running Add-KdsRootKey as there is (probably) no _supported_ way to remove existing KDS Root Keys from an AD.
#Requires -Version 5.1
#Requires -RunAsAdministrator
Param (
# Woo, Password Based Key Derivation Function number 2
[ValidateSet('PBKDF2', 'SP800_108_CTR_HMAC')]
[string]
$KdfAlgorithm = 'PBKDF2',
# Honestly, SHA512 is the default on Server 2022, but this might also work on older Server versions
@Froosh
Froosh / B2C_1A_PasswordResetDemo.xml
Created June 3, 2021 06:57
Azure AD B2C Password Reset Demo with Predicate Validation
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
PolicySchemaVersion="0.3.0.0"
TenantId="__B2CTenantName__"
PolicyId="__BaseFileName__"
DeploymentMode="__deployment_mode__"
PublicPolicyUri="https://__B2CTenantName__/__BaseFileName__">
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Date: 6 November 2020
OpenPGP Key Transition Statement for Robin Frousheger
I have created a new OpenPGP key and will be transitioning away from my
old key. The old key has not been compromised but has been set to
expire soon. All future correspondence should be encrypted to the new
@Froosh
Froosh / Add-MIMAdministrator.ps1
Last active February 4, 2019 03:15 — forked from ryannewington/Add-AdministratorToFimService.ps1
Creates an administrator in the FIM/MIM service from an existing AD account
#Requires -Version 3
#Requires -Modules LithnetRMA
[CmdletBinding()]
Param (
# Username of the user to add
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]
@Froosh
Froosh / async-udp-demo.ps1
Created January 19, 2019 03:01
PowerShell demo of UDP receive techniques, trying for proper async processing of packets
#Requires -Version 5.1
Set-StrictMode -Version Latest
$VerbosePreference = [System.Management.Automation.ActionPreference]::Continue
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
$UPnPReceivePort = [uint16] 1900
$UPnPMulticastGroup_v4 = [System.Net.IPAddress]::Parse("239.255.255.250")
$UPnPMulticastGroup_v6 = [System.Net.IPAddress]::Parse("[FF02::C]")
@Froosh
Froosh / Backup-MIMConfig.ps1
Last active June 20, 2018 12:03
Backup MIM Config (Synchronisation and Service/Portal) and create diffs/history with git
#Requires -Version 5
[CmdletBinding()]
Param (
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]
$MIMBackupPath = "C:\MIMBackup"
,
[Parameter()]
@Froosh
Froosh / Decrypt-CiscoPassword.ps1
Last active February 26, 2018 05:51
I had a need to decrypt some Cisco VPN enc_GroupPwd entries, but didn't want put client info into random web forms, and didn't to install python to use the first result I found. So I converted the python to PowerShell, and here we are :)
# Converted from https://github.com/axcheron/cisco_pwdecrypt/
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', 'CiscoPassword')]
[CmdletBinding(PositionalBinding = $false)]
[OutputType([String])]
Param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]