Skip to content

Instantly share code, notes, and snippets.

Avatar
🤸

Amanda Falke abstractmachines

🤸
View GitHub Profile
@abstractmachines
abstractmachines / calcuating-probability.md
Last active May 29, 2022
How to calculate probability
View calcuating-probability.md

How to calculate probability

Counting Distinct Objects

Combinations and Permutations

Combinations: Order Doesn't Matter

$$ C = \frac{n!}{(n-r)!r!}$$

View debugging-kubernetes-flow-chart.md

Debugging Kubernetes Flow Chart

Not sure of the source of this

image

@abstractmachines
abstractmachines / kubernetes-envtest-an-api-server.md
Last active Sep 21, 2021
Kubernetes envtest: An API Server
View kubernetes-envtest-an-api-server.md

Kubernetes envtest

A testing environment for Kubernetes

Note: Everything mentioned here is also in the Controller Runtime's pkg envtest docs.

envtest can run on a local control plane, or an existing cluster.

  • To start up a local control plane, envtest spins up a local instance of control plane binaries. These would be, etcd and kube-apiserver. It's available as a package under controller-runtime.
  • Alternatively, an existing cluster can be used to run envtest, by loading up CRDs and client config.
View vscode-go.md

How to keep VSCode's Go Extension from removing Go imports while developing

We would think this would be enough for VSCode's Go Linter/formatter, but nopes:

{
  "editor.formatOnSave": false,
}

We instead need to do this:

@abstractmachines
abstractmachines / taints-tolerations-affinity.md
Last active Aug 13, 2021
taints, tolerations and node affinity
View taints-tolerations-affinity.md

Taints, tolerations and node affinity : the e-magnetism of Kubernetes Nodes in the Kube Scheduler

We can think of Node Affinity as analagous analogus to magnetic attraction;

We can think of Node Taints as the complement of that (magnetic repulsion);

We can think of the determinant of a Node's eventual location as being "up to the Kube scheduler.

That's why we'll often have an effect of NoSchedule for nodes we'll want an exception of sorts for.

View go-receiver-and-factories.go
// Receiver arguments: https://tour.golang.org/methods/1
// Factory patterns:
// https://www.sohamkamani.com/golang/2018-06-20-golang-factory-patterns/
// https://stackoverflow.com/questions/49712313/golang-factory-method
package main
import "fmt"
type Instrument struct {
@abstractmachines
abstractmachines / concurrency-parallelism.md
Last active May 27, 2021
Concurrency versus parallelism
View concurrency-parallelism.md
@abstractmachines
abstractmachines / python-vscode.md
Created May 6, 2021
Python VSCode with black and flake8
View python-vscode.md

Python VSCode settings.json w black and flake8

{
    "editor.formatOnSave": true,
    "python.formatting.provider": "black",
    "files.insertFinalNewline": true,
    "python.testing.pytestEnabled": true,
    "python.linting.pylintEnabled": false,
 "python.linting.flake8Enabled": true,