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
## Useful Commands | |
Get kubectl version | |
kubectl version | |
Get cluster info: |
# 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:
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 : |
1) Filter Table
Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.
package main | |
// Demonstrates how taking the address of an embedded struct | |
// leaks the embedding struct's memory. | |
type Inner struct { | |
x int | |
} | |
type Outer struct { |
This gist shows how to use rebase
to change the Git history of a repo.
Imagine you realise that the first commit to your repo should be different
(maybe it's incomplete, includes something it shouldn't or simply could be
cleaner). However, since then you and others have made many changes to the repo
that you want to preserve. Here we show how to split the first commit into
multiple and re-attach the remaining version history to these new commits.
Let's make a dummy git repo rebase-root
and add two files to it. We commit
them with the commit #1.