Skip to content

Instantly share code, notes, and snippets.

View matejskubic's full-sized avatar

matejskubic

View GitHub Profile
@matejskubic
matejskubic / README.md
Last active June 23, 2026 07:11
Deploy DevOps Infrastructure Initialization

Infrastructure Initialization

Deploy to Azure

Intention

This folder initializes the minimum Azure foundation needed for DevOps-driven infrastructure deployments.

What It Does

@matejskubic
matejskubic / Delete-ObsoleteGitBranches.ps1
Created May 28, 2026 08:20
git: delete obsolete local branches
git fetch --prune; git for-each-ref --format="%(refname:short) %(upstream:track)" refs/heads | ? { $_ -match "\[gone\]" } | % { git branch -d (($_ -split " ")[0]) }
@matejskubic
matejskubic / README.md
Last active April 24, 2026 19:33
Azuve VM Eviciton shutdown

Azure Spot VM Eviction Monitor

Overview

This directory contains scripts that detect an Azure Spot VM eviction and trigger a graceful forced OS shutdown before Azure terminates the machine.

File Purpose
Notify-AzureVMEviction.ps1 Production monitor - polls IMDS every 2 s; shuts down on eviction
Shutdown VM on eviction.xml Task Scheduler definition example for recurring monitor execution
@matejskubic
matejskubic / Open Source License.md
Created February 11, 2026 10:03
Open Source License Obligations & Comparisons

Overview

This document summarizes a group discussion comparing major open‑source licenses (GPL‑2.1, MIT, Apache 2.0, MS‑PL, and LGPL) and clarifies obligations when using GPL‑2.1 or LGPL libraries in commercial, internal, or customer‑specific software scenarios. The focus is on practical compliance requirements for developers and organizations.


License Comparison

GPL‑2.1

@matejskubic
matejskubic / generate-rows.sql
Created July 24, 2025 19:10
SQL generationg many sequential random rows
-- Generate 4M rows using Ben-Gan style with 8-row seed
WITH E1(N) AS (
SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1
UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 -- 8-row seed
),
E2(N) AS (SELECT 1 FROM E1 AS a CROSS JOIN E1 AS b), -- 64 rows (8 × 8)
E4(N) AS (SELECT 1 FROM E2 AS a CROSS JOIN E2 AS b), -- 4k rows (64 × 64)
E8(N) AS (SELECT 1 FROM E4 AS a CROSS JOIN E4 AS b), -- 16M rows (4k x 4k)
Numbers AS (SELECT TOP (4000000) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS n FROM E8)
@matejskubic
matejskubic / Configure-RemoteDesltop.ps1
Last active July 21, 2025 10:13
Configure Windows security policies to hide the last signed-in username, conceal user information on the lock screen, and require manual username entry at logon.
### Configure Windows security policies to hide the last signed-in username, conceal user information on the lock screen, and require manual username entry at logon.
# logon: Don't display last signed-in Username
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "DontDisplayLastUserName" -Value 1
# Do not display user information when the session is locked
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "DontDisplayLockedUserID" -Value 3
# Force Manual Username Entry (required to press CTRL+ALT+DEL before logging on to Windows)
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "DisableCAD" -Value 0
@matejskubic
matejskubic / Enable-AzureFunction.http
Last active May 7, 2025 11:27
Enable disabled AzureFunction
PATCH /subscriptions/_subscriptionId_/resourceGroups/_rg_/providers/Microsoft.Web/sites/_function_name_?api-version=2022-03-01
{
"properties": {
"enabled": true,
"adminEnabled": true
}
}
@matejskubic
matejskubic / AppRegistrationsScanner.ps1
Created December 13, 2024 10:16
Entra Security Scanner for App Registrations
#Requires -Version 3.0
#The script requires the following permissions:
# Application.Read.All (required)
# AuditLog.Read.All (optional, needed to retrieve Sign-in stats)
#For details on what the script does and how to run it, check: https://www.michev.info/blog/post/5940/reporting-on-entra-id-application-registrations
[CmdletBinding(SupportsShouldProcess)] #Make sure we can use -Verbose
Param(
[switch]$SkipExcelOutput=$false,
@matejskubic
matejskubic / Install-D365FOupdate.ps1
Created June 21, 2024 07:52
Dynamics D365 FO OneBox download and install update
$puId = "40"
$url = "https://d365opsasteuiwypep2gu3b.blob.core.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47-e54b86e7/njj7L1Up2RUdqSA1tKG4Tw?skoid=9ef30196-cd78-4a47-955e-89a3947f0a23&sktid=975f013f-7f24-47e8-a7d3-abc4752bf346&skt=2024-06-21T06%3A17%3A36Z&ske=2024-06-24T07%3A17%3A36Z&sks=b&skv=2024-05-04&sv=2024-05-04&st=2024-06-21T06%3A17%3A36Z&se=2024-06-24T07%3A17%3A36Z&sr=b&sp=r&sig=hSWXJzM9VGPDHWOMBtQTqNoFgg7CQbeZeWJP%2FX0kJMw%3D"
$file = "d:\$puId.zip"
C:\DynamicsTools\azcopy.exe cp "$url" $file
mkdir d:\pu
C:\DynamicsTools\7za.exe x $file -od:\pu\
pushd d:\pu
C:\DynamicsTools\UpdateDevBox.ps1 $puId
@matejskubic
matejskubic / APIM-policy-fragment.xml
Created June 4, 2024 14:08
Get Logic App Standard workflow trigger url
<fragment>
<choose>
<when condition="@(null != context.Variables.GetValueOrDefault<string>("LaWfName", null))">
<cache-lookup-value key="@(context.Variables.GetValueOrDefault<string>("LaWfName", null))" variable-name="LAWfTriggerUri" caching-type="internal" />
<choose>
<when condition="@(string.IsNullOrEmpty(context.Variables.GetValueOrDefault<string>("LAWfTriggerUri", null)))">
<send-request mode="new" timeout="20" ignore-error="false" response-variable-name="LAWfTriggerResponse">
<set-url>@{
var laName = context.Variables.GetValueOrDefault<string>("LaName", null);
var laWfName = context.Variables.GetValueOrDefault<string>("LaWfName", null);