Skip to content

Instantly share code, notes, and snippets.

View shaun-mills's full-sized avatar
🌴
Good Times

Shaun Mills shaun-mills

🌴
Good Times
  • PingIdentity
  • California
  • 14:55 (UTC -07:00)
  • X @shauncodes
View GitHub Profile
@alex-mtx
alex-mtx / Count-Ports.ps1
Created July 20, 2016 15:12
Detecting Port Exhaustion on Windows via PowerShell
# originally posted on msdn: https://blogs.msdn.microsoft.com/debuggingtoolbox/2010/10/11/powershell-script-troubleshooting-for-port-exhaustion-using-netstat/
## Original author: frank.taglianetti@microsoft.com
## Displays port counts per IP address
## Parameters = none
## Modified 12/6/2011 to include Windows Vista or later
## TCP Parameters documented in http://support.microsoft.com/kb/953230
function MaxNumOfTcpPorts #helper function to retrive number of ports per address
{
@brikis98
brikis98 / main.tf
Last active March 14, 2023 23:43
A hacky way to create a dynamic list of maps in Terraform
# The goal: create a list of maps of subnet mappings so we don't have to statically hard-code them in aws_lb
# https://www.terraform.io/docs/providers/aws/r/lb.html#subnet_mapping
locals {
# These represent dynamic data we fetch from somewhere, such as subnet IDs and EIPs from a VPC module
subnet_ids = ["subnet-1", "subnet-2", "subnet-3"]
eips = ["eip-1", "eip-2", "eip-3"]
}
# Here's the hack! The null_resource has a map called triggers that we can set to arbitrary values.
# We can also use count to create a list of null_resources. By accessing the triggers map inside of