Skip to content

Instantly share code, notes, and snippets.

Justin Reagor cheapRoc

Block or report user

Report or block cheapRoc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cheapRoc
cheapRoc / backoff.go
Last active Dec 9, 2018
Backoff Reference/Example
View backoff.go
package main
import (
"context"
"errors"
"fmt"
"os"
"time"
"github.com/cenkalti/backoff"
View ca.crt.dump
$ openssl x509 -in .keys/crdb/ca.crt -noout -text
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
d0:69:a6:a0:b6:b8:9e:b5:cf:62:98:2e:b7:7d:9e:15
Signature Algorithm: sha256WithRSAEncryption
Issuer: O=Cockroach, CN=Cockroach CA
Validity
Not Before: Jul 24 18:54:32 2018 GMT
View gist:8516537ecaac33d3bbd77781893855aa
openssl genrsa -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt -subj "/C=US/ST=Washington/L=Seattle/O=Test/OU=Test/CN=localhost:8888"
openssl genrsa -out server.key 4096
openssl req -new -sha256 -key server.key -out server.csr -subj "/C=US/ST=Washington/L=Seattle/O=Test/OU=Server/CN=stackable.dev" -reqexts SAN -config <(cat /etc/ssl/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:localhost,DNS:127.0.0.1,DNS:*.stackable.dev,DNS:stackable.dev"))
# openssl req -new -sha256 -key server.key -out server.csr -subj "/C=US/ST=Washington/L=Seattle/O=Test/OU=Server/CN=localhost:8888"
openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt
openssl rsa -in server.key -out server.key
openssl genrsa -out client.key 4096
View gist:bc75deae85ffd9d70a236e4ef319bf4d
root@ctl-1:~# nomad status
ID Type Priority Status Submit Date
vm1_0a4621ec-d40c-d8cc-0b5d-582d009ce725 service 50 pending 2018-05-07T19:17:33Z
root@ctl-1:~# nomad status
ID Type Priority Status Submit Date
vm1_0a4621ec-d40c-d8cc-0b5d-582d009ce725 service 50 pending 2018-05-07T19:17:33Z
root@ctl-1:~# nomad status vm1_0a4621ec-d40c-d8cc-0b5d-582d009ce725
ID = vm1_0a4621ec-d40c-d8cc-0b5d-582d009ce725
Name = vm1_0a4621ec-d40c-d8cc-0b5d-582d009ce725
Submit Date = 2018-05-07T19:17:33Z
View service-groups.tf
provider "triton" {
insecure_skip_tls_verify = true
}
data "triton_network" "public" {
name = "Joyent-SDC-Public"
}
data "triton_image" "lts" {
name = "base-64-lts"
View gist:4adee540e80e6def460e31a3e022b11e
### Keybase proof
I hereby claim:
* I am cheaproc on github.
* I am justinwr (https://keybase.io/justinwr) on keybase.
* I have a public key ASCBgOUBdHRlOfPDdem4t-uIpX8uV1JRhY1w1URz02q95Qo
To claim this, I am signing this object:
View tsg-support.hcl
provider "triton" {
insecure_skip_tls_verify = true
}
data "triton_network" "public" {
name = "Joyent-SDC-Public"
}
data "triton_image" "lts" {
name = "base-64-lts"
View gist:d7499ce8f021d3fe19711d872e3be54f
-[ RECORD 2 ]
id | 339336274754076673
type | SCHEMA CHANGE
description | ALTER TABLE triton.tsg_groups ADD COLUMN created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), ADD COLUMN updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()
username | root
status | succeeded
created | 2018-04-13 13:53:32.751835+00:00
started | 2018-04-13 13:53:32.819834+00:00
finished | 2018-04-13 13:58:11.432305+00:00
modified | 2018-04-13 13:58:11.432305+00:00
View poolchan.go
// Pool holds Clients.
type Pool struct {
pool chan *Client
}
// NewPool creates a new pool of Clients.
func NewPool(max int) *Pool {
return &Pool{
pool: make(chan *Client, max),
}
View data.sql
CREATE TABLE pears (id SERIAL PRIMARY KEY, "name" STRING, apple_id INT REFERENCES apples (id));
INSERT INTO pears (name, apple_id) VALUES ('pear test', (SELECT id FROM apples LIMIT 1));
You can’t perform that action at this time.