Skip to content

Instantly share code, notes, and snippets.

View mrhillsman's full-sized avatar
🎓
Learning

Melvin Hillsman mrhillsman

🎓
Learning
View GitHub Profile
@mrhillsman
mrhillsman / forcedeletefinalizers.sh
Created January 15, 2024 19:52
Get all namespaces, filter by status Terminating, output the json, replace the finalizers with an empty set, then finally push the updated namespace's json representation back to the cluster.
for ns in `kubectl get namespaces | awk '/Terminating/ NR>1 {print $1}'`; \
do kubectl get namespace ${ns} -o json | tr -d "\n" | \
sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" | \
kubectl replace --raw /api/v1/namespaces/${ns}/finalize -f -; done;
@mrhillsman
mrhillsman / 1_simple.go
Created August 15, 2022 13:15 — forked from sosedoff/1_simple.go
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
# DOES NOT WORK
package main
import (
pgov1 "github.com/crunchydata/postgres-operator/pkg/apis/postgres-operator.crunchydata.com/v1beta1"
"log"
)
func main() {
pgcs := &pgov1.PgclusterSpec{}
@mrhillsman
mrhillsman / brian.md
Created September 6, 2021 06:34 — forked from TETYYS/brian.md
All Brian TTS characters
Character code (character) Duration (ms) Alias to Pronounced as
27 (�) 656 None Escape
33 (!) 1333 None Exclamation mark
35 (#) 409 None Hash
36 ($) 425 None Dollar
37 (%) 631 None Percent
38 (&) 329 None And
43 (+) 396 None Plus
45 (-) 706 None Dash
@mrhillsman
mrhillsman / 00_README.md
Created May 30, 2021 15:52 — forked from reagent/00_README.md
Custom HTTP Routing in Go

Custom HTTP Routing in Go

Basic Routing

Responding to requests via simple route matching is built in to Go's net/http standard library package. Just register the path prefixes and callbacks you want invoked and then call the ListenAndServe to have the default request handler invoked on each request. For example:

package main

import (
[
{
"id": "1",
"name": "aci-containers-operator",
"starttime": "starttime",
"endttime": "endtime",
"install": true,
"operand": [
{
"install": true
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: cassandradatacenters.cassandra.datastax.com
spec:
group: cassandra.datastax.com
names:
kind: CassandraDatacenter
listKind: CassandraDatacenterList
plural: cassandradatacenters
@mrhillsman
mrhillsman / submariner.io_servicediscoveries_crd_v1.yaml
Created July 28, 2020 22:28
apiextensions.k8s.io/v1 CRD for submariner servicediscoveries CR
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: servicediscoveries.submariner.io
spec:
group: submariner.io
names:
kind: ServiceDiscovery
listKind: ServiceDiscoveryList
plural: servicediscoveries
@mrhillsman
mrhillsman / submariner.io_submariners_crd_v1.yaml
Created July 28, 2020 19:26
apiextensions.k8s.io/v1 CRD for submariner CR
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: submariners.submariner.io
spec:
group: submariner.io
names:
kind: Submariner
listKind: SubmarinerList
plural: submariners