Skip to content

Instantly share code, notes, and snippets.

View Neurostep's full-sized avatar

Maksim Terekhin Neurostep

  • Amsterdam, Netherlands
View GitHub Profile
@r0mdau
r0mdau / find-k8snode-interface.sh
Last active June 14, 2024 15:53
How to get tcpdump for containers inside Kubernetes pods
# 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
  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
  • Centralized locking can be based on this K/V store.
@Kartones
Kartones / postgres-cheatsheet.md
Last active July 17, 2024 05:41
PostgreSQL command line cheatsheet

PSQL

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)
@PellePedro
PellePedro / tcpdump & ngrep
Created September 20, 2013 16:44
tcpdump & ngrep
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 :

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: