Skip to content

Instantly share code, notes, and snippets.

View onpaws's full-sized avatar
🚴‍♂️
building things

Pat onpaws

🚴‍♂️
building things
View GitHub Profile

Following the Python steps for making a Homebrew formula, I'm running into a problem where a cryptography release doesn't compile inside my formula.

How to repro

  • brew create --python --set-name "repro" https://github.com/splitgraph/sgr/archive/refs/tags/v0.3.10.tar.gz
  • paste the contents of repro.rb over the file that opens
  • run brew install --verbose --debug --build-from-source repro
did:3:bafyreidkyc4t5hqqko7rkf7wvaoerph5a45cysunl4snjcvue7g2qnhg5y
@onpaws
onpaws / offset-adjust
Created December 21, 2020 21:56
Adjust A/V offset on a video file - ffmpeg
ffmpeg \
-i "$input" -itsoffset "$offset" \
-i "$input" \
-map 0:0 \
-map 1:1 \
-acodec copy \
-vcodec copy \
"$output"
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 November 8, 2020 17:54
View Node.js HTTPS requests inside Wireshark

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 September 14, 2020 12:34
Cheatsheet for Helm charts on Azure Container Registry

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 September 8, 2020 08:43 — forked from alexanderkjeldaas/setup-k3s-on-hetzner.sh
Setup k3s on Hetzner with CSI drivers
#!/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 September 1, 2020 17:23
Accessing a Service inside Kind without an Ingress
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 August 26, 2020 19:21
Postgres cheat sheet
# 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 August 13, 2020 12:20
k8s get all resources in a namespace
# 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>