Skip to content

Instantly share code, notes, and snippets.

@mowings
mowings / README.md
Created November 17, 2022 19:12
Multi-arch builds with docker descktop and buildx

Create a builder

docker buildx create --use

Build and push

docker buildx build --platform linux/arm64/v8,linux/amd64 . -t foo:latest --push
@mowings
mowings / README.md
Created September 15, 2022 20:33 — forked from magnetikonline/README.md
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
@mowings
mowings / gist:df16235258271deb0c1ada80091c2b87
Created August 31, 2022 17:30
bash function for getting pod logs by prefix (single pod)
# kube get pod logs by pod name
function podlogs() {
k logs -f $(k get pods | grep "$1" | cut -d ' ' -f 1)
}
@mowings
mowings / readme.txt
Created December 22, 2021 14:45
Update a k8s docker image in a deployment, daemonset etc
kubectl set image deployment/my-deployment app=myimage
@mowings
mowings / registry.md
Last active December 14, 2021 18:10
List docker registry image base names and tags

List base image names and tags

curl https://docker.example.com/v2/_catalog.           # List repos (base image names)
curl https://docker.example.com/v2/myimage/tags/list   # List image tags

Ok for image names to have forward slashes

To get all images in a registry, call the catalog API, then call tags/list for each result.

@mowings
mowings / cell_metrics.txt
Last active October 4, 2021 14:41
Cell Signal Strength Metrics (RSRP. RSRQ, SINR, RSSI)
Source: https://wiki.teltonika-networks.com/view/Mobile_Signal_Strength_Recommendations
RSRP
RSRP Signal strength Description
>= -80 dBm Excellent Strong signal with maximum data speeds
-80 dBm to -90 dBm Good Strong signal with good data speeds
-90 dBm to -100 dBm Fair to poor Reliable data speeds may be attained, but marginal data with drop-outs is possible. When this value gets close to -100, performance will drop drastically
<= -100 dBm No signal Disconnection
RSRQ
@mowings
mowings / kubectl.txt
Created September 15, 2021 22:03
kubectl cp example
kubectl cp production/my-pod-77d5978bbd-hlmzb:/app/output.csv output.csv
@mowings
mowings / readme.md
Last active August 14, 2021 14:52
Postgresql Queues

Use UPDATE SKIP LOCKED to manage queue concurrency

DELETE FROM queue
WHERE itemid = (
  SELECT itemid
  FROM queue
  ORDER BY itemid
  FOR UPDATE SKIP LOCKED
 LIMIT 1
8.2.2. TCP log format
---------------------
The TCP format is used when "option tcplog" is specified in the frontend, and
is the recommended format for pure TCP proxies. It provides a lot of precious
information for troubleshooting. Since this format includes timers and byte
counts, the log is normally emitted at the end of the session. It can be
emitted earlier if "option logasap" is specified, which makes sense in most
environments with long sessions such as remote terminals. Sessions which match
the "monitor" rules are never logged. It is also possible not to emit logs for
@mowings
mowings / tmux.md
Created April 19, 2021 20:17
tmux command to renumber windows

tmux movew -r