Skip to content

Instantly share code, notes, and snippets.

😃 Set status

Russ Cam russcam

😃 Set status
View GitHub Profile
russcam / NEST_7x_NetTopologySuite_Geometries.linq
Created January 12, 2021 00:39
Using NetTopologySuite Geometries with NEST 7.x
View NEST_7x_NetTopologySuite_Geometries.linq
<Query Kind="Program">
russcam / ThreadpoolStats.cs
Created August 24, 2020 01:59
Get Threadpool, worker and IOCP thread statistics
View ThreadpoolStats.cs
using System;
using System.Text;
using System.Threading;
public static class ThreadpoolStats
public static string GetThreadPoolStats()
ThreadPool.GetMaxThreads(out int maxWorkerThreads, out int maxIoThreads);
ThreadPool.GetAvailableThreads(out int freeWorkerThreads, out int freeIoThreads);
russcam / TcpStats.cs
Created August 24, 2020 01:43
Get active TCP connection states and statistics
View TcpStats.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.NetworkInformation
public static class TcpStats
private static int _stateLength = Enum.GetNames(typeof(TcpState)).Length;
private static int _longestState = Enum.GetNames(typeof(TcpState)).Max(s => s.Length);
russcam / elastic-gnaf.fsx
Last active October 1, 2020 07:22
Building a realtime Australian address search with the G-NAF dataset
View elastic-gnaf.fsx
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
russcam / Ingesting_Attachments.cs
Last active October 13, 2021 12:29
Ingesting attachments with Elasticsearch and NEST 7.x
View Ingesting_Attachments.cs
using System;
using Elasticsearch.Net;
using Nest;
namespace Example
private static void Main()
var defaultIndex = "attachments";
russcam / PowerShell
Created March 12, 2019 23:58 — forked from jchandra74/PowerShell
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization
View PowerShell

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

russcam / GuestUsers.ps1
Created February 26, 2019 05:10
PowerShell script module for creating and adding guest users to Azure AD
View GuestUsers.ps1
New-Module -Name GuestUsers -Scriptblock {
$modules = Get-Module -ListAvailable AzureAD*
if ($null -eq $modules) {
Write-Output "Install AzureADPreview module"
Install-Module AzureADPreview
elseif (($modules | ?{ $_.Name -eq "AzureAD" }).Count -eq 1) {
Write-Output "Uninstall AzureAD module and install AzureADPreview module"
russcam / LinkChecker.linq
Created January 30, 2019 00:14
Checks for broken links in HTML pages
View LinkChecker.linq
<Query Kind="Program">
void Main()
russcam / Procmon.ps1
Created November 3, 2018 05:47
PowerShell Script module for interacting with Process Monitor (Procmon)
View Procmon.ps1
Functions for working with Process monitor
#Requires -Version 3.0
New-Module -Name Procmon -Scriptblock {
russcam /
Last active September 26, 2018 11:10
Change the passphrase and private key password for a PKCS#12 archive
if [[ -z "$new_archive" ]]; then