Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Richard Slater RichardSlater

🏠
Working from home
View GitHub Profile
@RichardSlater
RichardSlater / index.html
Created Sep 20, 2018
Auto-update LucidCharts
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Go-Live Plan</title>
<meta name="description" content="Go-live Plan">
<meta name="author" content="Richard Slater">
<meta http-equiv="refresh" content="3000">
@RichardSlater
RichardSlater / Test-Redirects.ps1
Created Mar 16, 2018
Redirect Testing Script
View Test-Redirects.ps1
function Test-Url($Target) {
$result = $null;
try {
$result = Invoke-Webrequest -Uri $Target -MaximumRedirection 0 -UseBasicParsing -ErrorAction SilentlyContinue
} catch {}
return $result | `
Select-Object @{name='Result';expression={$mark}}, `
@{name='Target';expression={$Target}}, `
StatusCode, `
@{name='Redirect';expression={if (($_.StatusCode -gt 300) -And ($_.StatusCode -lt 399)) { $result.Headers["Location"] } else { $null }}}
View keybase.md

Keybase proof

I hereby claim:

  • I am richardslater on github.
  • I am richardslater (https://keybase.io/richardslater) on keybase.
  • I have a public key ASB4g0VO17PTCu6I51OBo5Jy2TZh_LksBGxKZlNXndD2UQo

To claim this, I am signing this object:

@RichardSlater
RichardSlater / Initialize-SharedAssemblyInfo.ps1
Last active Feb 10, 2019
Initialize-SharedAssemblyInfo
View Initialize-SharedAssemblyInfo.ps1
function Initialize-SharedAssemblyInfo {
Param(
[Parameter(Mandatory=$False)]
[Switch]$RemoveComments = $False
)
process {
$crlf = [System.Environment]::NewLine;
$current = $PSScriptRoot;
while ((-Not (Test-Path "$current\Solutions")) -Or ($current.Length -lt 4)) {
View X509CertificateRepository.cs
public class X509CertificateRepository {
public IEnumerable<X509Certificate2> FindBySubjectName(StoreName storeName, StoreLocation storeLocation, string subject) {
  var store = new X509Store(storeName, storeLocation);
  store.Open(OpenFlags.ReadOnly);
  var certificates = store.Certificates.Find(X509FindType.FindBySubjectName, subject, validOnly: false);
  foreach (var certificate in certificates) {
   yield return certificate;
  }
  store.Close();
}
View aws-datacenter-ip-ranges.xml
<!-- AWS Region: US East (Northern Virginia) -->
<add ipAddress="72.44.32.0" subnetMask="255.255.224.0" allowed="true" />
<add ipAddress="67.202.0.0" subnetMask="255.255.192.0" allowed="true" />
<add ipAddress="75.101.128.0" subnetMask="255.255.128.0" allowed="true" />
<add ipAddress="174.129.0.0" subnetMask="255.255.0.0" allowed="true" />
<add ipAddress="204.236.192.0" subnetMask="255.255.192.0" allowed="true" />
<add ipAddress="184.73.0.0" subnetMask="255.255.0.0" allowed="true" />
<add ipAddress="184.72.128.0" subnetMask="255.255.128.0" allowed="true" />
<add ipAddress="184.72.64.0" subnetMask="255.255.192.0" allowed="true" />
<add ipAddress="50.16.0.0" subnetMask="255.254.0.0" allowed="true" />
@RichardSlater
RichardSlater / azure-datacenter-ip-ranges.xml
Created Jan 30, 2014
All Azure IP address ranges from all regions.
View azure-datacenter-ip-ranges.xml
<!-- Azure Region: europewest -->
<add ipAddress="157.55.9.112" subnetMask="255.255.255.240" allowed="true" />
<add ipAddress="157.55.12.0" subnetMask="255.255.255.240" allowed="true" />
<add ipAddress="157.55.10.0" subnetMask="255.255.255.224" allowed="true" />
<add ipAddress="157.55.10.32" subnetMask="255.255.255.224" allowed="true" />
<add ipAddress="157.55.10.64" subnetMask="255.255.255.192" allowed="true" />
<add ipAddress="65.52.128.0" subnetMask="255.255.224.0" allowed="true" />
<add ipAddress="94.245.97.0" subnetMask="255.255.255.0" allowed="true" />
<add ipAddress="137.116.192.0" subnetMask="255.255.224.0" allowed="true" />
<add ipAddress="157.55.8.64" subnetMask="255.255.255.192" allowed="true" />
@RichardSlater
RichardSlater / JsonExtractionRule.cs
Created Jan 28, 2014
Visual Studio Test Tools JSON Extraction Rule using JSON.net
View JsonExtractionRule.cs
using System;
using System.ComponentModel;
using System.Globalization;
using Microsoft.VisualStudio.TestTools.WebTesting;
using Newtonsoft.Json.Linq;
namespace Amido.PerformanceTests.Common {
[DisplayName("JSON Extraction Rule")]
[Description("Extracts the specified JSON value from an object.")]
public class JsonExtractionRule : ExtractionRule {
@RichardSlater
RichardSlater / MongoDB.ps1
Created Jan 16, 2014
Desired State Configuration to Install MongoDB on Windows Server 2013
View MongoDB.ps1
configuration MongoDB {
param (
[string[]]$ComputerName = $env:ComputerName
)
node $ComputerName {
File SetupFolder {
Type = 'Directory'
DestinationPath = "C:\setup"
Ensure = 'Present'
}
View Get-AzureRemoteDesktopFileFromSubscription.ps1
Get-AzureService |
Get-AzureRole -Slot Production -InstanceDetails |
ForEach-Object {
Get-AzureRemoteDesktopFile `
-Name $_.InstanceName `
-ServiceName $_.ServiceName `
-LocalPath (Join-Path "C:\RDP" ($_.InstanceName + ".rdp"))
}
You can’t perform that action at this time.