This file contains hidden or 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 ( | |
"context" | |
"database/sql" | |
"database/sql/driver" | |
"fmt" | |
"path" | |
"sync" | |
"sync/atomic" |
This file contains hidden or 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: apiextensions.k8s.io/v1 | |
kind: CustomResourceDefinition | |
metadata: | |
# name must match the spec fields below, and be in the form: <plural>.<group> | |
name: komucrontabs.stable.example.com | |
spec: | |
# group name to use for REST API: /apis/<group>/<version> | |
group: stable.example.com | |
# list of versions supported by this CustomResourceDefinition | |
versions: |
This file contains hidden or 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 ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"crypto/sha256" | |
"encoding/base64" | |
"errors" | |
"fmt" |
This file contains hidden or 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 ( | |
"fmt" | |
"os" | |
"github.com/klauspost/reedsolomon" | |
) | |
// You can use erasure encoding to; |
This file contains hidden or 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 ( | |
"fmt" | |
"net/http" | |
"github.com/go-chi/chi" | |
"github.com/gorilla/mux" | |
) |
This file contains hidden or 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
# gotten from; https://github.com/jetstack/cert-manager/releases/download/v1.3.3/cert-manager.yamlhttps://github.com/jetstack/cert-manager/releases/download/v1.3.3/cert-manager.yaml | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: cert-manager | |
app.kubernetes.io/component: controller | |
app.kubernetes.io/instance: cert-manager | |
app.kubernetes.io/name: cert-manager | |
name: cert-manager |
This file contains hidden or 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
def sample_anomalous(samples): | |
""" | |
Sampling: | |
- Central limit theorem(Alan Turing) | |
- 3-sigma rule: In a normal distribution, 99.7% of the values are not anomalous. | |
Which means you can throw away 99.7% without losing context. | |
- You may also use 2-sigma(95%) or 1-sigma(68%) | |
see: | |
1. https://youtu.be/inrqE0Grgk0?t=26080 (Emmanuel T Odeke) | |
2. https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule |
This file contains hidden or 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 ( | |
"fmt" | |
"math" | |
"testing" | |
) | |
/* ---------- package ---------- */ | |
type h struct { |
This file contains hidden or 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 ( | |
"log" | |
"math/rand" | |
"os" | |
"syscall" | |
"testing" | |
"time" |
This file contains hidden or 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 "fmt" | |
// Usage: | |
// | |
// func main() { | |
// defer panicHandler() | |
// } | |
// |