Skip to content

Instantly share code, notes, and snippets.

Avatar
🚴‍♂️
building things

Pat onpaws

🚴‍♂️
building things
View GitHub Profile
View 3box-proof-of-ownership.txt
did:3:bafyreidkyc4t5hqqko7rkf7wvaoerph5a45cysunl4snjcvue7g2qnhg5y
@onpaws
onpaws / offset-adjust
Created Dec 21, 2020
Adjust A/V offset on a video file - ffmpeg
View offset-adjust
ffmpeg \
-i "$input" -itsoffset "$offset" \
-i "$input" \
-map 0:0 \
-map 1:1 \
-acodec copy \
-vcodec copy \
"$output"
View agent-status.txt
root@datadog-pbnx2:/# agent status
Getting the status from the agent.
===============
Agent (v7.24.0)
===============
Status date: 2020-12-15 20:37:18.796087 UTC
Agent start: 2020-12-15 20:00:16.024187 UTC
Pid: 1
@onpaws
onpaws / HOWTO.md
Last active Nov 8, 2020
View Node.js HTTPS requests inside Wireshark
View HOWTO.md

How to see Node.js HTTPS requests inside Wireshark

  • Set up a env var for Node.js:

    export SSLKEYLOGFILE=~/ssl_key_log_file.log

  • Add sslkeylog to Node.js project to wire in the key

    npm i -D sslkeylog

@onpaws
onpaws / helm-azure-cheatsheet.md
Last active Sep 14, 2020
Cheatsheet for Helm charts on Azure Container Registry
View helm-azure-cheatsheet.md

Hosting Helm charts inside Azure Container Registries

# install Helm
brew install helm

# Package your chart (the directory containing Chart.yaml) into a .tgz file
$ helm package mychart/
Successfully packaged chart and saved it to: /Users/admin/projects/helm/chart-0.1.0.tgz

# upload to Azure Container Registry. Needed: Container Registry name
@onpaws
onpaws / setup-k3s-on-hetzner.sh
Created Sep 8, 2020 — forked from alexanderkjeldaas/setup-k3s-on-hetzner.sh
Setup k3s on Hetzner with CSI drivers
View setup-k3s-on-hetzner.sh
#!/bin/bash
LOCATION=${HCLOUD_LOCATION:-nbg1-dc3}
if [ -z "$HCLOUD_TOKEN" ]; then
echo "You need to set HCLOUD_TOKEN to an Hetzner API token!";
exit 1
fi
if [ -z "$SSH_KEY" ]; then
@onpaws
onpaws / no-ingress-kind.sh
Last active Sep 1, 2020
Accessing a Service inside Kind without an Ingress
View no-ingress-kind.sh
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
@onpaws
onpaws / cheatsheet.psql
Last active Aug 26, 2020
Postgres cheat sheet
View cheatsheet.psql
# Start psql
psql "sslmode=require host=postgres-azure.postgres.database.azure.com user=admin@postgres-azure dbname=postgres"
# Connect to database
\c mydatabase
# Show databases
\l
# Show tables
@onpaws
onpaws / getAllResources.sh
Created Aug 13, 2020
k8s get all resources in a namespace
View getAllResources.sh
# via https://stackoverflow.com/a/55796558/2044952
function kubectlgetall {
for i in $(kubectl api-resources --verbs=list --namespaced -o name | grep -v "events.events.k8s.io" | grep -v "events" | sort | uniq); do
echo "Resource:" $i
kubectl -n ${1} get --ignore-not-found ${i}
done
}
# Usage: kubectlgetall <namespace>
@onpaws
onpaws / tip.md
Created Aug 11, 2020
postgres-as-nosql
View tip.md

https://news.ycombinator.com/item?id=24117607

These days you can even just tune pgsql to support kv store formats And you can turn off fsync! Though if you do, disable synchronous_commit instead for most of the performance but none of the potential data corruption (you're still risking data loss, of course, just not corruption).