$ ssh -A vm
$ git config --global url."[email protected]:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "[email protected]:"]
insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"strconv" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
labels: | |
product: k8s-elastic | |
name: elastic-config | |
data: | |
elasticsearch.yaml: | | |
discovery.type: single-node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL = /bin/bash | |
MAKEFLAGS=-s | |
BINARY = mboard | |
TEST_DIRECTORIES = ./handlers ./services | |
$(BINARY): | |
go build -o $(BINARY) | |
echo "Binary:" $(CURDIR)/$(BINARY) | |
install: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BenchmarkIsPalindrome5Chars-8 100000000 19.8 ns/op | |
BenchmarkIsPalindrome10Chars-8 50000000 27.2 ns/op | |
BenchmarkIsPalindrome20Chars-8 30000000 48.1 ns/op | |
BenchmarkIsPalindrome40Chars-8 20000000 112 ns/op | |
BenchmarkIsPalindrome80Chars-8 5000000 337 ns/op | |
BenchmarkIsPalindromeFalsy-8 100000000 13.8 ns/op | |
BenchmarkIsPalindromeFalsyVeryLong-8 2000000 709 ns/op |
- response_type is a constant set for particular app on server (1)
- redirect_uri, too (1)
- "state" parameter is echoed by server and checked by client (1)
- hash of "state" parameters is stored in LocalStorage and destroyed on receiving redirect (1)
- "client_id" parameter is checked (after obtaining token, make a request to server to get "token_id" for this token and compare to existing one) (2, 3)
- IP is saved for particular token on grant and checked on access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then echo "Usage: $0 database"; exit 0; fi | |
schema_dir='/code/in/schema/' | |
migrations=$(find $schema_dir -name '*-GROUPS*.sql') | |
for migration in $migrations; do | |
echo "UNDOING" $migration | |
sql=$(sed -n '/@UNDO/ { s///; :a; n; p; ba; }' $migration) |