Skip to content

Instantly share code, notes, and snippets.

View wholroyd's full-sized avatar

William Holroyd wholroyd

  • Google
  • Raleigh, NC
View GitHub Profile
@wholroyd
wholroyd / preparations.md
Last active April 11, 2024 09:17
Getting Minikube on WSL2 Ubuntu working

Windows Preparation

  1. Ensure hypervisor functionality is enabled in BIOS.

    • I know it sounds stupid, but if you already have it enabled, disable it, restart the machine, and enable it again.
    • Otherwise you will hit microsoft/WSL#5363
  2. Launch a PowerShell prompt in Administrator mode [Win+X > Windows PowerShell (Admin)]

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
@wholroyd
wholroyd / genesis_public_key
Created February 22, 2018 15:13
genesis_public_key
04a1d39448fcbf8eac4f80fde2dd0947ccd54bc77104e7a4004c41d082f64eec2e72afd999ecfcfdd945945b0f90cc5e71a0b1a0a8e24a4e7012d30968006fa204
@wholroyd
wholroyd / extensions.md
Last active August 28, 2017 15:38
C# 8 Syntax Suggestions

Current syntax for extensions on a reference type...

public static class PersonExtensionClass
{
  public string FullName(this Person person)
  {
    return $"{person.FirstName} {person.MiddleName} {person.LastName}";
  }
}
@wholroyd
wholroyd / dotnetlayout-jenkins.md
Last active January 19, 2023 17:00
.NET project structure, using Jenkinsfile
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  reports/
 src/
@wholroyd
wholroyd / windbg_commands.txt
Created August 10, 2017 19:58
Debugging 32bit dump from 64bit machine
// Install the Windows SDK first for windbg
// Install the soswow64 module from https://github.com/poizan42/soswow64/releases
// Additonal hints at https://theartofdev.com/windbg-cheat-sheet/
// Open the 64bit dump with the 32bit windbg
// Run these commands...
.loadby sos clr
.load wow64exts
.load c:\debugger\soswow64.dll
@wholroyd
wholroyd / DateTime_parsing.cs
Created May 27, 2016 04:15
Keep the timezone as an offset and not an adjustment
var test = "2016-11-21T23:00:00-05:00";
var temp1 = DateTime.Parse(test);
temp1.Dump(); // Returns: 11/22/2016 4:00:00 AM
var temp2 = DateTimeOffset.Parse(test);
temp2.Dump(); // Returns: 11/21/2016 11:00:00 PM -05:00
var temp3 = DateTimeOffset.Parse(test).DateTime;
temp3.Dump(); // Returns: 11/21/2016 11:00:00 PM
@wholroyd
wholroyd / Example1.cs
Created April 22, 2016 16:36 — forked from davidfowl/Example1.cs
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@wholroyd
wholroyd / gist:864a3596b79cde62bd31d85a98d013bf
Created April 3, 2016 01:14 — forked from jeremypruitt/gist:ca62a5cdc95f579713b9
Modified ansible windows remoting script
# Configure a Windows host for remote management with Ansible
# -----------------------------------------------------------
#
# This script checks the current WinRM/PSRemoting configuration and makes the
# necessary changes to allow Ansible to connect, authenticate and execute
# PowerShell commands.
#
# Set $VerbosePreference = "Continue" before running the script in order to
# see the output messages.
#
@wholroyd
wholroyd / ec2-user-data.ps1
Created April 3, 2016 01:13 — forked from mefellows/ec2-user-data.ps1
Packer Community Plugins - Example Windows 2012 Setup
<powershell>
write-output "Running User Data Script"
write-host "(host) Running User Data Script"
cmd.exe /c net user /add vagrant FooBar@123
cmd.exe /c net localgroup administrators vagrant /add
Set-ExecutionPolicy -ExecutionPolicy bypass -Force
# RDP
# install 7-zip, curl and vim
# (Windows 2012 comes with .NET 4.5 out-of-the-box)
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the instance fires up!
# This has been tested on Windows 2012 64bits AMIs provided by Amazon (eu-west-1 ami-a1867dd6)
#
# Inject this as user-data of a Windows 2012 AMI, like this (edit the adminPassword to your needs):
#
# <powershell>
# Set-ExecutionPolicy Unrestricted