Skip to content

Instantly share code, notes, and snippets.

@cbluth
cbluth / webServer.groovy
Created September 21, 2021 15:22 — forked from renatoathaydes/webServer.groovy
A simple web server written in Groovy that provides static and code-generated content
#!/usr/bin/env groovy
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.*
import groovy.servlet.*
@Grab(group='org.eclipse.jetty.aggregate', module='jetty-all', version='7.6.15.v20140411')
def startJetty() {
def server = new Server(8080)
@cbluth
cbluth / aws-auth.configmap.yaml
Last active September 17, 2021 10:44
AWS Auth - EKS ConfigMap
# https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html
---
apiVersion: v1
data:
mapAccounts: |
[]
mapRoles: |
- username: system:node:{{EC2PrivateDNSName}}
rolearn: arn:aws:iam::123123123123:role/RoleEksWorker
groups:
@cbluth
cbluth / ca.md
Created July 7, 2021 16:07 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@cbluth
cbluth / jamf.md
Created July 7, 2021 16:07 — forked from a7ul/jamf.md
removing all restrictions on jamf managed macos device - Provided you have root access.

REMOVE JAMF RESTRICTIONS ON MAC

REMOVE ONLY RESTRICTIONS

sudo jamf removeMDMProfile removes all restrictions

sudo jamf manage brings back all restrictions and profiles

REMOVE ALL RESTRICTIONS AND DISABLE JAMF BINARIES WHILE KEEPING YOUR ACCESS TO VPN AND OTHER SERVICES

sudo jamf removeMDMProfile removes all restrictions

@cbluth
cbluth / errgroup_withcontext.go
Created February 22, 2021 17:09 — forked from dragonsinth/errgroup_withcontext.go
Using errgroup.WithContext() in Golang server handlers
package main
import (
"context"
"encoding/json"
"fmt"
"io"
"log"
"sync/atomic"
"time"
@cbluth
cbluth / main.go
Created February 22, 2021 17:09 — forked from pteich/main.go
Example for using go's sync.errgroup together with signal detection signal.Notify to stop all running goroutines
package main
import (
"context"
"errors"
"fmt"
"os"
"os/signal"
"syscall"
"time"
@cbluth
cbluth / main.go
Created December 31, 2020 15:36 — forked from alex-leonhardt/main.go
golang text/template with a map[string]interface{} populated from mixed json data
package main
import (
"encoding/json"
"os"
"reflect"
"text/template"
)
@cbluth
cbluth / wireguard-over-tcp.md
Created October 16, 2020 09:35 — forked from insdavm/wireguard-over-tcp.md
WireGuard over TCP with udptunnel

WireGuard over TCP with udptunnel

udptunnel is a small program which can tunnel UDP packets bi-directionally over a TCP connection. Its primary purpose (and original motivation) is to allow multi-media conferences to traverse a firewall which allows only outgoing TCP connections.

Server

# udptunnel -s 443 127.0.0.1/51820

Client

@cbluth
cbluth / catalina_devkitpro_setup.md
Created August 26, 2020 10:20 — forked from joshenders/devkitpro_setup_macos.md
Getting started with Nintendo Switch Development using devkitpro on macOS

Getting started with Nintendo Switch Development using devkitpro on macOS

Prerequsite: Ensure Xcode command line tools are installed

xcode-select --install

Install the devkitpro Package Manager

@cbluth
cbluth / gist:f51063b1f86e6bb3934357cb658c232f
Created August 6, 2020 12:50 — forked from RichiH/gist:f2ffb824d428d8ca0c7c40cd62022b56
Prometheus relabelling to get rid of port number
============================================
============================================
============================================
This does what it should:
regex: (.+?)(:80)?
Also see https://golang.org/pkg/regexp/syntax/