Skip to content

Instantly share code, notes, and snippets.

package main
import (
"flag"
"fmt"
"log"
"os"
"runtime/debug"
"runtime/pprof"
"strconv"
# Install https://www.vaultproject.io/
brew install vault
# Start dev vault server in a separate terminal
vault server -dev
# ==> Vault server configuration:
# ...
# Unseal Key: 7ACQHhLZY5ivzNzhMruX9kSa+VXCah3y87hl3dPSWFk=
# Root Token: 858a6658-682e-345a-e4c4-a6e14e6f7853
@etsangsplk
etsangsplk / Certificates.go
Created June 15, 2020 17:09 — forked from Mattemagikern/Certificates.go
Create x509 certificate chain using Golang. Root CA, Designated CA, server CA
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
@etsangsplk
etsangsplk / ca_and_cert_golang_demo.go
Created June 9, 2020 18:36 — forked from shaneutt/LICENSE
Golang: Demonstrate creating a CA Certificate, and Creating and Signing Certs with the CA
package main
import (
"bytes"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
struct e(node);
struct e(ast);
typedef struct e(node) * e(node);
typedef struct e(ast) * e(ast);
/* FIXME: I am slightly uncomfortable imposing a hard limit on the maximum size of “documents” that this Paws
* interpreter can handle. I’d love to use some sort of arbitrary-integer representation for this, but
* at the moment, that’s extra work I cannot afford. */
typedef unsigned long long int e(ast_index);
@etsangsplk
etsangsplk / gist.go
Created May 12, 2020 14:50 — forked from alexedwards/gist.go
ACME Autocert for Go
package main
import (
"crypto/tls"
"flag"
"fmt"
"log"
"net/http"
"time"
@etsangsplk
etsangsplk / autocert-server.go
Created May 12, 2020 14:50 — forked from samthor/autocert-server.go
Demo autocert server in Go
package main
import (
"crypto/tls"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/user"
@etsangsplk
etsangsplk / bubbesort.go
Created March 29, 2019 23:21 — forked from emre/bubbesort.go
bubblesort in golang
package main
import "fmt"
func main() {
x := []int{
48, 96, 86, 68,
57, 82, 63, 70,
37, 34, 83, 27,
@etsangsplk
etsangsplk / README.md
Created June 19, 2018 16:37 — forked from emschwartz/README.md
1st ETH -> XRP Interledger Escrow Payment

1st ETH -> XRP Interledger Escrow Payment

Here are the transaction IDs (and links to the block explorers) for the first livenet Ethereum and Ripple Consensus Ledger (RCL) escrowed transfers comprising an Interledger payment.

  1. Ethereum prepare: 0x00cbb6149b9cfb3cedf280251c3060b2a38776fa7792b578b6f9f39ce5ee0266
  2. RCL prepare: 7F0A5F16C84568D96DA6A66058CD9EAA881236237642BF7427A458957A752B6B
  3. RCL fulfill: 12A4CAFAE95254844513C5C11488A1195C08DEFF673C97AC74AAC121935DDE36
  4. Ethereum fulfill: 0xb59dd839ab0b5e7d4e663b7cfc0ddb70eaf73dd2785b3d3a4abdf1a61817007d

SHA-256 Condition: `d2

@etsangsplk
etsangsplk / README.md
Created June 19, 2018 16:37 — forked from emschwartz/README.md
1st ETH -> XRP Interledger Escrow Payment

1st ETH -> XRP Interledger Escrow Payment

Here are the transaction IDs (and links to the block explorers) for the first livenet Ethereum and Ripple Consensus Ledger (RCL) escrowed transfers comprising an Interledger payment.

  1. Ethereum prepare: 0x00cbb6149b9cfb3cedf280251c3060b2a38776fa7792b578b6f9f39ce5ee0266
  2. RCL prepare: 7F0A5F16C84568D96DA6A66058CD9EAA881236237642BF7427A458957A752B6B
  3. RCL fulfill: 12A4CAFAE95254844513C5C11488A1195C08DEFF673C97AC74AAC121935DDE36
  4. Ethereum fulfill: 0xb59dd839ab0b5e7d4e663b7cfc0ddb70eaf73dd2785b3d3a4abdf1a61817007d

SHA-256 Condition: `d2