Skip to content

Instantly share code, notes, and snippets.

@mjgarton
mjgarton / accountno.go
Created February 25, 2019 13:47
reverses bill customer account number id into bill customer account number.
package main
import (
"bufio"
"fmt"
"log"
"os"
"github.com/google/uuid"
)
kubectl --context=dev-aws -n customer-platform port-forward cockroachdb-1 26257:26257 &
kubectl --context=dev-aws -n customer-platform exec -ti cockroachdb-1 cat /cockroach/cockroach-certs/node.key >/tmp/node.key
kubectl --context=dev-aws -n customer-platform exec -ti cockroachdb-1 cat /cockroach/cockroach-certs/node.crt >/tmp/node.crt
chmod 600 /tmp/node.crt /tmp/node.key
PGSSLCERT=/tmp/node.crt PGSSLKEY=/tmp/node.key PGCLIENTENCODING=utf8 psql -w "postgresql://root@localhost:26257/itemdb?sslmode=require"
@mjgarton
mjgarton / plumber.go
Last active October 14, 2023 15:22
"plumber" message munging application
package main
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"log"
"os"
@mjgarton
mjgarton / tlsconn_test.go
Created August 9, 2016 15:08
Demonstrate TLS vs plain TCP RST behaviour
package tlsresettest
import (
"crypto/tls"
"io"
"io/ioutil"
"net"
"strings"
"testing"
)