Skip to content

Instantly share code, notes, and snippets.

View coreyasmith's full-sized avatar
🌏
Where do you want to go today?

Corey Smith coreyasmith

🌏
Where do you want to go today?
View GitHub Profile
$datasource = Get-Item .
$referrers = $datasource | Get-ItemReferrer
$pageOnlyReferrers = $referrers | Where-Object { $_.Name -ne '__Standard Values' } | Sort-Object -Property Name -Unique
$pageOnlyReferrers = $pageOnlyReferrers | Where-Object { $_.Paths.Path -like '/sitecore/content/{site-node}' }
if ($pageOnlyReferrers.Count -eq 0) {
return;
}
@nickwesselman
nickwesselman / SitecoreOptions.cs
Created August 31, 2021 13:27
Sitecore ASP.NET Core Multisite
public class SitecoreOptions
{
public static readonly string Key = "Sitecore";
public Uri InstanceUri { get; set; }
public string LayoutServicePath { get; set; } = "/sitecore/api/layout/render/jss";
public string DefaultSiteName { get; set; }
public string ApiKey { get; set; }
public Uri RenderingHostUri { get; set; }
public bool EnableExperienceEditor { get; set; }
- Create your VM as normal, get Windows installed and so on
- Power the VM down, to "Off" state
- On the HOST pc, execute the following 2 commands from an elevated Powershell prompt
Set-VMProcessor -VMName "Name of your VM" -ExposeVirtualizationExtensions $true
Get-VMNetworkAdapter -VMName "Name of your VM" | Set-VMNetworkAdapter -MacAddressSpoofing On
- Start up the VM again
- Inside the VM, execute the following command from an elevated Powershell prompt
@cassidydotdk
cassidydotdk / Install-Solr.ps1
Created April 12, 2019 12:23
Install-Solr.ps1
Param(
$installFolder = "c:\solr",
$solrPort = "8721",
$solrHost = "solr",
$solrSSL = $true,
$downloadFolder = "$PSScriptRoot"
)
$solrVersion = "7.2.1"
$solrName = "solr-$solrVersion"
@BretFisher
BretFisher / docker-for-windows.md
Last active June 5, 2024 10:16
Getting a Shell in the Docker for Windows Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your CLI and it'll drop you in a container with full permissions on the Moby VM. Only works for Moby Linux VM (doesn't work for Windows Containers). Note this also works on Docker for Mac.

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1

@troyfontaine
troyfontaine / README.md
Last active October 15, 2023 09:58
Ubiquiti USG config.gateway.json Syntax

Ubiquiti USG Advanced Configuration

Overview

Integrated DNS Overview

When using a USG with Ubiquiti's Unifi Controller software (version 5.6 and earlier), the functionality of integrating the hostnames of clients (when they request a DHCP lease) into local DNS does not appear to work as you would find with Consumer grade routers. To work around this limitation, we can add static host mappings to a configuration file that will be provisioned to the USG when either a configuration change is made or we force provisioning to the USG itself.

Non-GUI Supported Dynamic DNS Providers

I've added in the necessary syntax for adding Cloudflare DDNS to the USG for VPN/Services setup courtesy of this post by britannic on the Ubiquiti Forums.

Configuration File

@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"
)