Skip to content

Instantly share code, notes, and snippets.

Avatar

Brad Christie Brad-Christie

View GitHub Profile
@Brad-Christie
Brad-Christie / File Locations
Last active Oct 30, 2020
Links to various files that may be helpful to have direct web references to (e.g. use in a dockerfile)
View File Locations
IIS / URL Rewrite Module 2.1
Info: https://www.iis.net/downloads/microsoft/url-rewrite
Installer (x86)
Filename: rewrite_x86_en-US.msi
Resulting URI: http://download.microsoft.com/download/6/8/F/68F82751-0644-49CD-934C-B52DF91765D1/rewrite_x86_en-US.msi
Unattended: msiexec /i rewrite_x86_en-US.msi /quiet /norestart
Installer (x64)
Filename: rewrite_amd64_en-US.msi
Resulting URI: http://download.microsoft.com/download/D/D/E/DDE57C26-C62C-4C59-A1BB-31D58B36ADA2/rewrite_amd64_en-US.msi
Unattended: msiexec /i rewrite_amd64_en-US.msi /quiet /norestart
@Brad-Christie
Brad-Christie / README.md
Last active Aug 8, 2019
Renaming Sitecore Installation (9.2)
View README.md

Renaming Sitecore Instance Post-Install

  1. Stop IIS
  2. Stop the following services:
@Brad-Christie
Brad-Christie / OpenWithDocker.reg
Last active Jul 25, 2019
Open with Docker (Right-Click Context Menu)
View OpenWithDocker.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Docker]
@="Open with Docker"
"Icon"="C:\\Program Files\\Docker\\Docker\\resources\\ddvp.ico"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Docker\command]
@="cmd /c docker.exe run -it --rm --volume \"%V:C:\\host\" --workdir \"C:\\host\" --entrypoint \"powershell.exe\" \"mcr.microsoft.com/windows/servercore:ltsc2019\""
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Docker]
@="Open with Docker"
"Icon"="C:\\Program Files\\Docker\\Docker\\resources\\ddvp.ico"
@Brad-Christie
Brad-Christie / solr.sh
Created Jul 23, 2019
Install SOLR on WSL
View solr.sh
#!/bin/sh
wget https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz
wget https://archive.apache.org/dist/lucene/solr/7.5.0/solr-7.5.0.tgz
tar xzf ./openjdk-12.0.2_linux-x64_bin.tar.gz -C /usr/local/jdk-12.0.2/
tar xzf ./solr-7.5.0.tgz -C /usr/local/solr-7.5.0/
sudo nano /usr/local/solr-7.5.0/bin/solr.in.sh
# SET SOLR_JAVA_HOME="/usr/local/jdk-12.0.2" ]
@Brad-Christie
Brad-Christie / Backup-Sitecore.ps1
Last active Jul 18, 2019
Backup Sitecore Instance (Single Developer Only)
View Backup-Sitecore.ps1
Function GetDatabases {
[CmdletBinding()]
Param(
[Parameter(Position = 0, Mandatory, ValueFromPipeline)]
[ValidateScript({ Test-Path $_ -PathType "Container" })]
[string]$WebRoot
)
Process {
$Databases = @()
@Brad-Christie
Brad-Christie / Install-SolrWebApp.ps1
Created Jul 9, 2019
Uses PowerShell Az module to deploy SOLR as a WebApp
View Install-SolrWebApp.ps1
[CmdletBinding()]
Param(
[Parameter()]
[guid]$SubscriptionId = "16a1fd8b-1684-4b0f-9c72-383d91e35cd7"
,
[Parameter()]
[ValidateSet("Canada Central","Canada East","Central US","East US","East US 2","North Central US","South Central US","West Central US","West US","West US 2")]
[string]$Region = "Central US"
,
[Parameter()]
@Brad-Christie
Brad-Christie / Azure-Docker.ps1
Created Jul 3, 2019
Build a docker base image that allows you to run Azure commands against your subscription
View Azure-Docker.ps1
[CmdletBinding()]
Param(
[Parameter()]
[string]$SubscriptionId = $null
,
[Parameter()]
[string]$CertificatePassword = "secret"
,
[Parameter()]
[ValidateScript({ Test-Path $_ -IsValid })]
@Brad-Christie
Brad-Christie / sitecore-packages.json
Created May 16, 2019
Associative list of sitecore package TO direct download URL (assuming authentication)
View sitecore-packages.json
{
"Sitecore 8.2 rev. 161221.zip": {
"description": "Sitecore Experience Platform 8.2 Update-2",
"url": "https://dev.sitecore.net/~/media/02D2B5F95D1D4B1F894C2E3CA1194E45.ashx"
},
"Sitecore 8.2 rev. 171121 (WDP XP0 package).zip": {
"description": "Sitecore Experience Platform 8.2 Update-6",
"url": "https://dev.sitecore.net/~/media/AFA4C05BA4414C239FA9945E52ABF7DC.ashx"
},
"Sitecore 8.2 rev. 180406 (WDP XP1 packages).zip": {
@Brad-Christie
Brad-Christie / Format-[Un]SafeString.ps1
Created May 16, 2019
How to parse and format a string with placeholders, and only bring in the tokens you want.
View Format-[Un]SafeString.ps1
$Make = "Tesla"
$Model = "X"
$Year = 2017
$Format = "`$Year `$Make `$Model"
Function Format-UnsafeString {
Param(
[Parameter(Position = 0, Mandatory)]
[string]$Format
,
@Brad-Christie
Brad-Christie / Test-Property.Tests.ps1
Created Dec 28, 2018
Test if a property exists on object
View Test-Property.Tests.ps1
. "${PSScriptRoot}\Test-Property.ps1"
Describe "Test-Property" {
Context "Basic Usage" {
BeforeAll {
$obj = @{ Foo = "Bar" }
}
It "Should accept named parameters" {
Test-Property -InputObject $obj -PropertyName "Foo" | Should -Be $true
}