Skip to content

Instantly share code, notes, and snippets.

View PhilMurwin's full-sized avatar

Phil Murwin PhilMurwin

View GitHub Profile
@PhilMurwin
PhilMurwin / garlic-os-tips.md
Created May 23, 2023 18:43 — forked from milnak/garlic-os-tips.md
[GarlicOS Tips for Windows] My set of GarlicOS tips

Garlic OS Tips

GarlicOS Installation

This is for a single SD card. You can use two SD cards, but I find a single SD card is cheap and easy to manage.

Download RG35XX-MicroSDCardImage.7z.001 and RG35XX-MicroSDCardImage.7z.002

Extract RG35XX-MicroSDCardImage.7z.001 using 7-zip (open the .7z.001 file) to somewhere on your hard drive (not the USB card!).

@PhilMurwin
PhilMurwin / pwsh_makecert.ps1
Created March 16, 2023 17:26
Powershell New Self Signed Cert
# https://mattou07.net/posts/create-a-self-signed-certificate-for-iis-with-powershell/
# https://www.yaplex.com/how-to-create-a-self-signed-certificate-for-iis-using-powershell/
# https://adamtheautomator.com/new-selfsignedcertificate/
$binding = Read-Host -Prompt 'Enter the site you need a cert for: '
$cert = New-SelfSignedCertificate -DnsName "$binding" -NotAfter (Get-Date).AddMonths(72) -CertStoreLocation "cert:\LocalMachine\My"
Write-Host "Cert [$binding] has been created in the local machine cert store."
Write-Host "Cert will expire in 6 years."
@PhilMurwin
PhilMurwin / SQLServer_FindString.sql
Created January 12, 2023 19:59
SQL Server - Find a string in any table in the database
DECLARE @SearchStr nvarchar(100) = 'SEARCH_TEXT'
DECLARE @Results TABLE (ColumnName nvarchar(370), ColumnValue nvarchar(3630))
SET NOCOUNT ON
DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)
SET @TableName = ''
SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')
WHILE @TableName IS NOT NULL
@PhilMurwin
PhilMurwin / node_notes.md
Created July 11, 2022 04:06
Windows Nodejs Notes
@PhilMurwin
PhilMurwin / GenerateSelfSignedCert_2022.ps1
Created February 3, 2022 16:46
Generate Self Signed Cert using powershell
#GenerateSelfSignedCert_2022.ps1
# Information from: https://www.tutorialspoint.com/how-to-create-a-self-signed-certificate-using-powershell
# Additional/Similar information from: https://petri.com/create-self-signed-certificate-using-powershell
# Get Current Directory
$curDir = Get-Location
#Write Header
Write-Host "`n WARNING: This script is provided AS-IS with no warranties and confers no rights." -ForegroundColor Yellow
@PhilMurwin
PhilMurwin / selfsigned_wildcard_cert.md
Created September 24, 2021 17:55 — forked from PSGM/selfsigned_wildcard_cert.md
Creating a self-signed wildcard certificate for server authentication in a Windows environment

Creating a self-signed wildcard certificate for server authentication in a Windows environment

We are increasingly using, or being required to use, SSL-encrypted sessions (or technically, TLS-encrypted sessions) for application services. In technical terms, because the Fully Qualified Domain Name (FQDN) in the Uniform Resource Locator (URL) used by a client to access a service needs to match the Common Name (CN) in the certificate used by that service, we potentially have a proliferation of certificates (at least one per server) that need to be available to clients

One approach to addressing this proliferation is to use wildcard certificates that match multiple FQDNs within a domain. Below is a discussion on generating self-signed wildcard certificates as a way of addressing this

What

@PhilMurwin
PhilMurwin / TSQL-READ_XML_into_Temp_Table.sql
Created March 9, 2021 22:10
Read XML into temp table on ms sql server
--=========================================================
-- SQL Server 2008 apparently has a bug that causes issues when trying to read from XML into a temporary table.
-- This can be overcome with the simple addition of an option to your query.
--=========================================================
-- Additional information can be found at the links below
--
-- http://connect.microsoft.com/SQLServer/feedback/details/562092/an-insert-statement-using-xml-nodes-is-very-very-very-slow-in-sql2008-sp1
-- http://stackoverflow.com/questions/3978807/why-insert-select-to-variable-table-from-xml-variable-so-slow
--=========================================================
@PhilMurwin
PhilMurwin / ListExtensions.cs
Last active February 7, 2023 22:29
Extension methods to serialize lists
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
@PhilMurwin
PhilMurwin / Visual Studio solution file headers
Last active February 22, 2022 21:02 — forked from DanAtkinson/Visual Studio solution file headers
Visual Studio solution file headers - 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017, 2019, 2022
== Visual Studio .NET 2003 (DO NOT COPY THIS LINE) ==
Microsoft Visual Studio Solution File, Format Version 8.00
# Visual Studio .NET 2003
VisualStudioVersion = 7.1
== Visual Studio 2005 (DO NOT COPY THIS LINE) ==
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
VisualStudioVersion = 8.0
@PhilMurwin
PhilMurwin / stringList.txt
Created August 23, 2019 20:23
C# List<string> A-Z, handy for testing filters, auto complete, etc. ( This list consists of star wars terms. )
var stringList = new List<string>
{
"Ackbar",
"Amidala",
"Anakin",
"Antilles",
"BB-8",
"Boba",
"Bossk",
"C-3PO",