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
var Rx = require("rx"); | |
var o = Rx.Observable.interval(100) | |
.take(10) | |
.map(function(x) { if (x % 3 === 1) { throw x; } else { return x; } }) | |
.retry(2) | |
.subscribe(function(a) { console.log("BBB", a); }); |
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
const bufferSize = 2 | |
const startEvery = 1 // also tried -1, 0, 1, 3 | |
Rx.Observable.of(1,2,3,4,5) | |
.bufferCount(bufferSize, startEvery) | |
.filter(function(x) { return x.length > 1; }) | |
.subscribe(console.log.bind(console)); |
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
/* | |
* Function flattens the nested array of Ints | |
* | |
* @param {Array} array | |
* Array (possibly nested) of Ints | |
* | |
* @return {Array} | |
* Return's flatten Arrays of Ints | |
* | |
* testFlatten :: Array(Array Int) -> Array Int |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
- https://prefetch.net/blog/2019/10/16/the-beginners-guide-to-creating-kubernetes-manifests/
- https://gist.github.com/constantlycoding/220f0dcb4aef8b0a14d4f336f0b102b1
- https://kubernetes.io/docs/user-guide/kubectl-cheatsheet/
- https://learnk8s.io/blog/kubectl-productivity/
- https://medium.com/faun/kubectl-commands-cheatsheet-43ce8f13adfb
- https://gist.github.com/so0k/42313dbb3b547a0f51a547bb968696ba
- https://speakerdeck.com/so0k/kubectl-tips-and-tricks
- https://github.com/dennyzhang/cheatsheet-kubernetes-A4
- https://medium.com/bitnami-perspectives/imperative-declarative-and-a-few-kubectl-tricks-9d6deabdde
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
## Useful Commands | |
Get kubectl version | |
kubectl version | |
Get cluster info: |
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
# find the kube node of the running pod, appear next to hostIP, and note containerID hash | |
kubectl get pod mypod -o json | |
# -> save hostIP | |
# -> save containerID | |
# connect to the node and find the pods unique network interface index inside it's container | |
docker exec containerID /bin/bash -c 'cat /sys/class/net/eth0/iflink' | |
# -> returns index | |
# locate the interface of the node |
Hopefully helped another k8s newbie with the following. The question was, how do you update a single key in a secret in k8s? I don't know anything about secrets but I will probably want to know this in the future, so here we go.
First, to create a dummy secret:
apiVersion: v1
kind: Secret
metadata:
name: test-secret
data:
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
tcpdump advanced filters | |
======================== | |
Sebastien Wains <sebastien -the at sign- wains -dot- be> | |
http://www.wains.be | |
$Id: tcpdump_advanced_filters.txt 36 2013-06-16 13:05:04Z sw $ | |
Notes : |
OlderNewer