Skip to content

Instantly share code, notes, and snippets.

@soulemike
soulemike / linkedInPostSummary.ps1
Created October 13, 2025 17:19
For the provided list of LinkedIn activity URLs returns an array of hashtables, each containing the original activity URL, the HTML doc for the activity URL, the timestamp of the post, the post content, a shortened version of the post content, and an AI generated summary of the content.
$activities = @"
https://www.linkedin.com/feed/update/urn:li:activity:7383533745330618368
https://www.linkedin.com/feed/update/urn:li:activity:7383532739548979200
https://www.linkedin.com/posts/douglasfinke_ai-that-works-the-sf-unconference-is-under-activity-7383507297903206400-zvu0
"@
$activities = $activities.Split("`n")
$posts = @()
$regex = "[-:](?'id'[0-9]{19})[-\/?\$\s]"
@soulemike
soulemike / AzureArcFeatureMap.mermaid
Last active August 29, 2025 13:59
Azure Arc Feature Map
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@soulemike
soulemike / DefenderForServersMap.mermaid
Created August 27, 2025 17:12
Microsoft Defender for Servers Feature Map
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

If you have ever seen one of my presentations on or we have ever discussed technology security or operations, you have likely heard me say something like: At a certain maturity level everything is just exception management. Keep reading to get more details on one of the most common exception management techniques, compensatory or compensating controls.

What is a control?

The ComplianceForge team provides a nice definition:

"Controls are safeguards or countermeasures implemented to manage risks and protect assets. Cybersecurity controls can be technical, administrative, or physical and are designed to reduce vulnerabilities, prevent threats and ensure confidentiality, integrity and availability of information." (ComplianceForge, 2025)

In the simplest of terms your organization has said, "We care about X". The control documents what you are doing to protect "X".

function Update-MtLicenseCache {
[OutputType([System.Void])]
[CmdletBinding(
SupportsShouldProcess,
ConfirmImpact = "Low"
)]
param (
[Switch]$Force,
[String]$FileName="maesterLicenses.csv"
GraphActivity
| take 1000
| extend properties.timeGenerated, properties.appId, properties.roles, properties.scopes
| extend properties.requestUri, properties.requestMethod, properties.responseStatusCode
//
// Use to filter by App ID
//| where tostring(properties_appId) == "<AppId>"
//
// Use to summarize by app reg permissions used
//| where isnotempty(properties_roles)
function Connect-EntraIga {
[CmdletBinding()]
param (
[Parameter(ParameterSetName="All",Mandatory)]
[switch]$All,
[Parameter(ParameterSetName="Graph",Mandatory)]
[switch]$Graph,
[Parameter(ParameterSetName="All")]
[Parameter(ParameterSetName="Graph")]

Example SSH Server Initialization

The SSH server configuration requires GSSAPIAuthentication yes.

Ref: https://snozzberries.github.io/2023/08/29/powershell-ssh.html

$r=[System.Net.WebRequest]::Create("https://github.com/PowerShell/PowerShell/releases/latest")
$r.AllowAutoRedirect=$false
$r.Method="Head"
$remoteDomain=@(
"10.0.0.10",
"10.0.0.20",
"domain.local"
)
function New-Task([int]$index,[string]$target,[int]$port,[scriptblock]$ScriptBlock)
{
$ps = [Management.Automation.PowerShell]::Create()
$res = New-Object PSObject -Property @{
@soulemike
soulemike / gist:408bec0813561635fb54f156b99df794
Created May 11, 2023 21:01
Convert inline HEX characters to ASCII
$s='wind\x6f\x77["\x64oc\x75\x6den\x74"\x5d\x2ec\x72\x65a\x74\x65E\x6cemen\x74'
($s|Select-String -Pattern "([.\\][.x].{2})" -AllMatches).Matches.Value|select -Unique|%{$s=$s.Replace([string]$_,[char]([convert]::ToInt16($_.Substring(2,2),16)))}
#window["document"].createElement