Skip to content

Instantly share code, notes, and snippets.

View schigh-ntwrk's full-sized avatar

Steve High schigh-ntwrk

  • Pennsatucky
  • 17:23 (UTC -04:00)
View GitHub Profile
@schigh-ntwrk
schigh-ntwrk / macnst.zsh
Created March 15, 2023 22:15
MacOS zshell func to show who is using what port (not mine, but i forgot where I stole it from)
# check to see who is using what port
function macnst (){
netstat -Watnlv | grep LISTEN | awk '{"ps -o comm= -p " $9 | getline procname;colred="\033[01;31m";colclr="\033[0m"; print colred "proto: " colclr $1 colred " | addr.port: " colclr $4 colred " | pid: " colclr $9 colred " | name: " colclr procname; }' | column -t -s "|"
}
@schigh-ntwrk
schigh-ntwrk / burrow.go
Last active December 1, 2021 21:31
Get burrow consumer lag via ngrok
package main
/*
To run this file:
go run main.go -uri 'https://my.ngrok.uri.from.burrow.container'
*/
import (
"context"
"encoding/json"
@schigh-ntwrk
schigh-ntwrk / nakedbraces.go
Last active May 26, 2021 17:57
use of naked braces in Go
t.Run("multi config default pool size", func(t *testing.T) {
_ = os.Setenv(EnvKafkaGlobalBrokers, "0.0.0.0:9092")
_ = os.Setenv(EnvKafkaSubscriberTopicGroups, "A:B|C:D")
cfgs, err := ConsumerConfigsFromEnv()
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if len(cfgs) != 2 {
t.Fatalf("expected two config, got %d", len(cfgs))