Skip to content

Instantly share code, notes, and snippets.

View pbering's full-sized avatar

Per Bering pbering

View GitHub Profile
@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 December 15, 2023 05:55
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 March 21, 2024 10:21
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 = "26.0.0"
,
[Parameter(Mandatory = $false)]
[string]$ComposeVersion = "2.25.0"
,
[Parameter(Mandatory = $false)]
@BorysVrublevskyi
BorysVrublevskyi / Kubernetes-Hybrid-Cluster-on-Hyper-V.md
Last active April 8, 2024 12:44
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 March 22, 2024 16:23
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"
)
@joepie91
joepie91 / vpn.md
Last active May 18, 2024 02:43
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.