Skip to content

Instantly share code, notes, and snippets.

View PhilMurwin's full-sized avatar

Phil Murwin PhilMurwin

View GitHub Profile
@PhilMurwin
PhilMurwin / RasPiNamecheapDNS.md
Last active April 20, 2024 16:45
How to setup DDclient on Raspberry Pi for use with Namecheap DynDNS

How to use Namecheap DynDNS service with ddclient on the Raspberry Pi

Log into your Raspberry Pi (by ssh for example) or open a terminal window if you are working directly on Pi. In the first step we have to install ddclient, a DynDNS software, on the Pi. For this purpose, the following two commands are necessary.

sudo apt-get update
sudo apt-get install ddclient

Note: During installation an installation wizard opens and wants to know some things from you. Here you can safely enter what you want, because we have to adjust the configuration file manually either way, because the wizard does not support the Namecheap.com interface.

@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 / 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 / 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 / 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 / SSMS_Configs.md
Last active February 9, 2022 17:51
SQL Mgmt Studio Configs

Environment > Keyboard > Query Shortcuts

  • Create a Dev database to contain some server level procedures
  • Create a stored proc SPWHO with the sp_who2 script in it.
    • This is used for Ctrl + 3 below
Shortcut Stored Procedure
Alt + F1 sp_help
Ctrl + F1
@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