Skip to content

Instantly share code, notes, and snippets.

View pbering's full-sized avatar

Per Bering pbering

View GitHub Profile
param (
[Parameter(Mandatory = $false)]
[string]$Platform = "ltsc2019"
)
$platformToNanoSeverMapping = @{
"ltsc2019" = "1809";
"ltsc2022" = "ltsc2022"
}
@pbering
pbering / FixSxaHeadlessNavigationContentResolver.cs
Created November 3, 2022 10:50
FixSxaHeadlessNavigationContentResolver
using Newtonsoft.Json.Linq;
using Sitecore.LayoutService.Configuration;
using Sitecore.LayoutService.ItemRendering.ContentsResolvers;
using Sitecore.Mvc.Presentation;
using Sitecore.XA.JSS.Feature.Navigation.ContentsResolvers;
using System.Collections.Specialized;
namespace XmCloudSXAStarter.Patches
{
public class FixSxaHeadlessNavigationContentResolver : IRenderingContentsResolver
@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)]
SET QUOTED_IDENTIFIER on
declare @ApplicationName nvarchar(256) = 'sitecore'
declare @UserName nvarchar(256) = 'sitecore\admin'
declare @Password nvarchar(128) = 'b'
declare @HashAlgorithm nvarchar(10) = 'SHA1'
declare @PasswordFormat int = 1 -- Hashed
declare @CurrentTimeUtc datetime = SYSUTCDATETIME()
declare @Salt varbinary(16) = 0x
declare @HashedPassword varbinary(20)
@pbering
pbering / sitecore-image-tagging.md
Last active December 17, 2019 11:03
Sitecore Docker Image Tagging

Naming and tagging

...

Naming convention

[REGISTRY/]sitecore-<TOPOLOGY>-<ROLE>[-VARIANT[-VARIANT]]:<SITECORE_VERSION>[-VARIANT_VERSION[-VARIANT_VERSION]]-<OS_REPOSITORY>-<OS_TAG>
@pbering
pbering / windows-docker-log.csv
Last active January 3, 2019 13:27
docker log with debug enabled from windows host
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
"EventID","MachineName","Data","Index","Category","CategoryNumber","EntryType","Message","Source","ReplacementStrings","InstanceId","TimeGenerated","TimeWritten","UserName","Site","Container"
"2","dc2node-wvm0","System.Byte[]","461","(0)","0","Information","debug: Registering POST, /build","docker","System.String[]","2","1/3/2019 11:18:10 AM","1/3/2019 11:18:10 AM",,,
"2","dc2node-wvm0","System.Byte[]","462","(0)","0","Information","debug: Registering POST, /build/prune","docker","System.String[]","2","1/3/2019 11:18:10 AM","1/3/2019 11:18:10 AM",,,
"2","dc2node-wvm0","System.Byte[]","463","(0)","0","Information","debug: Registering POST, /build/cancel","docker","System.String[]","2","1/3/2019 11:18:10 AM","1/3/2019 11:18:10 AM",,,
"2","dc2node-wvm0","System.Byte[]","458","(0)","0","Information","debug: Registering POST, /volumes/create","docker","System.String[]","2","1/3/2019 11:18:10 AM","1/3/2019 11:18:10 AM",,,
"2","dc2node-wvm0","System.Byte[]","459","(0)","0","Information","debug: Registering POST, /vo
@pbering
pbering / linux-docker-log.txt
Created January 3, 2019 13:12
docker log with debug enabled from linux host
-- Logs begin at Thu 2019-01-03 11:33:57 UTC, end at Thu 2019-01-03 11:45:56 UTC. --
Jan 03 11:36:29 dc2node-nvm0 systemd[1]: Starting Docker Application Container Engine...
Jan 03 11:36:29 dc2node-nvm0 dockerd[4183]: time="2019-01-03T11:36:29.139064323Z" level=info msg="systemd-resolved is running, so using resolvconf: /run/systemd/resolve/resolv.conf"
Jan 03 11:36:29 dc2node-nvm0 dockerd[4183]: time="2019-01-03T11:36:29.225100467Z" level=info msg="parsed scheme: \"unix\"" module=grpc
Jan 03 11:36:29 dc2node-nvm0 dockerd[4183]: time="2019-01-03T11:36:29.225381975Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
Jan 03 11:36:29 dc2node-nvm0 dockerd[4183]: time="2019-01-03T11:36:29.225666683Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///run/containerd/containerd.sock 0 <nil>}]" module=grpc
Jan 03 11:36:29 dc2node-nvm0 dockerd[4183]: time="2019-01-03T11:36:29.225734985Z" level=info msg="ClientConn switching balancer to \"pick_first\"" modul
@pbering
pbering / Performance.config
Last active January 29, 2023 12:20
Sitecore Performance (Docker friendly)
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<initialize>
<processor type="Sitecore.Pipelines.Loader.ShowVersion, Sitecore.Kernel">
<patch:delete />
</processor>
<processor type="Sitecore.Pipelines.Loader.ShowHistory, Sitecore.Kernel">
<patch:delete />
</processor>
@pbering
pbering / Dockerfile
Created September 16, 2018 19:17
urlrewrite docker reproduce
FROM microsoft/aspnet:4.7.2-windowsservercore-1803
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ARG URLREWRITE_MSI='c:\\install\\urlrewrite.msi'
ADD http://download.microsoft.com/download/D/D/E/DDE57C26-C62C-4C59-A1BB-31D58B36ADA2/rewrite_amd64_en-US.msi ${URLREWRITE_MSI}
RUN Start-Process $env:URLREWRITE_MSI -ArgumentList "/qn", "/l*v", "c:\log.txt" -PassThru | Wait-Process
@pbering
pbering / gist:71aabc8a3224f257d56c2a249a0ccedf
Created September 16, 2018 18:35
urlrewite install in docker log
=== Verbose logging started: 9/17/2018 5:31:33 Build type: SHIP UNICODE 5.00.10011.00 Calling process: C:\Windows\System32\msiexec.exe ===
MSI (c) (C8:C8) [05:31:33:478]: Resetting cached policy values
MSI (c) (C8:C8) [05:31:33:478]: Machine policy value 'Debug' is 0
MSI (c) (C8:C8) [05:31:33:478]: ******* RunEngine:
******* Product: C:\install\urlrewrite.msi
******* Action:
******* CommandLine: **********
MSI (c) (C8:C8) [05:31:33:478]: Client-side and UI is none or basic: Running entire install on the server.
MSI (c) (C8:C8) [05:31:33:478]: Grabbed execution mutex.
MSI (c) (C8:C8) [05:31:33:509]: Cloaking enabled.