Skip to content

Instantly share code, notes, and snippets.

View pbering's full-sized avatar

Per Bering pbering

View GitHub Profile
@rudfoss
rudfoss / cross-stage-variables-azure-devops-yaml-pipeline.yml
Last active April 18, 2025 14:49
Cheat-sheet for setting and retrieving variables in Azure DevOps yaml pipelines across different steps, jobs and stages.
# Cheat-sheet for using dynamically defined variables between steps, jobs and stages in Azure DevOps Yaml Pipelines
# Documentation: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch
trigger: none
pr: none
stages:
- stage: DefineVarStage
jobs:
- job: DefineVarJob
@MartinMiles
MartinMiles / Convert-UnicornToSCS.ps1
Created February 16, 2023 20:26
Converts Unicorn configurations into Sitecore CLI serialization (to be reworked to cover more configurations, use and an example)
$rootFolder = "C:\Projects\Upgrade\SC\src"
$files = Get-ChildItem -Filter *serialization.config -Path $rootFolder -Recurse
foreach($file in $files)
{
$newSerializationJson = New-Object -TypeName pscustomobject
Write-Host "Convert Started: " + $file.FullName
@rosskirkpat
rosskirkpat / rke2-windows-debug-commands.md
Created October 13, 2022 01:29
RKE2 Windows and Linux Troubleshooting and Debugging

RKE2 Windows Troubleshooting

High Level Notes

  • For any and all RKE2 Windows Clusters, v1.22.x or higher of RKE2 needs to be used. This is due to a Calico 3.19.x bug in v1.21.x of RKE2 that Tigera will not backport.
  • The minor version of Calico was changed midway through the RKE2 v1.22 lifecycle.
    • rke2 v1.22.3+rke2r1 through v1.22.6+rke2r1 have Calico 3.20.x (3.20.1 for v1.22.3+rke2r1 only and then 3.20.2 until v1.22.7+rke2r1)
    • rke2 v1.22.7+rke2r1 and up have Calico 3.21.4 (or higher)
@jonaskello
jonaskello / prep-windows-node-step1.ps1
Last active May 27, 2024 01:34
Install k8s windows nodes
# Make sure you have enabled "Expose hardware assisted virtualization to the guest OS" for the VMWare CPU
Write-Host "##############################`nInstalling features: Containers, Hyper-V, Hyper-V-PowerShell`n##############################`n"
Install-WindowsFeature Containers
Install-WindowsFeature Hyper-V
Install-WindowsFeature Hyper-V-PowerShell
Write-Host "##############################`nDisabling firewall`n##############################`n"
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
@pbering
pbering / Invoke-DockerInstall.ps1
Last active February 27, 2025 12:52
Installs (and updates) Docker engine, compose and the credentials helper on Windows server and client
# run with defaults: iex (iwr "https://gist.githubusercontent.com/pbering/309c5a14162dcbe70e842295e0319022/raw" -UseBasicParsing).Content
param (
[Parameter(Mandatory = $false)]
[string]$DockerVersion = "27.5.1"
,
[Parameter(Mandatory = $false)]
[string]$ComposeVersion = "2.33.1"
,
[Parameter(Mandatory = $false)]
@BorysVrublevskyi
BorysVrublevskyi / Kubernetes-Hybrid-Cluster-on-Hyper-V.md
Last active July 29, 2024 19:30
Get your own home lab k8s cluster!

Kubernetes hybrid cluster (Linux+Windows) on Hyper-V with local subnet and internet access

Prepare Host

Install CLI utils on your host machine

Kubectl

Helm

@jeanfrancoislarente
jeanfrancoislarente / create-vmss.md
Last active April 11, 2023 18:10
Create a Virtual Machine Scaleset for Azure Pipelines

Creating an Azure DevOps Scale Set Agent Pool

Find SKUs

To create a VM, you need an image. This can be found by using az vm image list. Some examples below:

`az vm image list -p MicrosoftWindowsServer -f windowsserver -s datacenter-core-2004 --all

`az vm image list -p MicrosoftWindowsServer -f windowsserver -s datacenter-core-20H2 --all

@adoprog
adoprog / docker-acr.ps1
Created March 24, 2020 20:16
Compare local Docker images with the ones in Azure Container Registry (ACR)
$registry = "%registry name here, i.e. myregistry%"
$repositories = docker images --digests | % { $_ -replace " +", "," } | convertfrom-csv | where { $_.REPOSITORY.StartsWith($registry) } | group REPOSITORY
Write-Output "Found $($repositories.Count) local repositories from $($registry) registry"
foreach ($group in $repositories) {
$repository = $group.Name.Split('/')[1]
$remoteData = az acr repository show-tags -n $registry --repository $repository --detail | convertfrom-json
foreach ($localRepo in $group.Group) {
$localRepo | Add-Member -NotePropertyName REPO -NotePropertyValue $repository
@jonlabelle
jonlabelle / msbuild-dotnet-aspnet-build.md
Last active September 28, 2024 07:09
Build, Publish and Deploy ASP.NET Web Applications from the Command Line
@jermdavis
jermdavis / Install-Solr.ps1
Last active November 23, 2021 13:30
A PowerShell script to help installing Solr as a service - See https://blog.jermdavis.dev/posts/2017/low-effort-solr-installs for details
Param(
$solrVersion = "6.6.2",
$installFolder = "c:\solr",
$solrPort = "8983",
$solrHost = "solr",
$solrSSL = $true,
$nssmVersion = "2.24",
$JREVersion = "1.8.0_151"
)