Skip to content

Instantly share code, notes, and snippets.

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

Pat onpaws

🚴‍♂️
building things
View GitHub Profile
@onpaws
onpaws / seafowl-logs.stdout
Created July 6, 2023 03:31
seafowl-udf-go-attempt-to-call
This file has been truncated, but you can view the full file.
2023-07-06T03:30:05.143Z DEBUG hyper::proto::h1::io > parsed 5 headers
2023-07-06T03:30:05.143Z DEBUG hyper::proto::h1::conn > incoming body is content-length (44 bytes)
2023-07-06T03:30:05.143Z DEBUG hyper::proto::h1::conn > incoming body completed
2023-07-06T03:30:05.144Z DEBUG sqlparser::parser > parsing expr
2023-07-06T03:30:05.144Z DEBUG sqlparser::parser > parsing expr
2023-07-06T03:30:05.144Z DEBUG sqlparser::parser > prefix: Value(Number("1", false))
2023-07-06T03:30:05.144Z DEBUG sqlparser::parser > get_next_precedence() TokenWithLocation { token: Comma, location: Location { line: 0, column: 0 } }
2023-07-06T03:30:05.144Z DEBUG sqlparser::parser > 0: , 1: 2 2: )
2023-07-06T03:30:05.144Z DEBUG sqlparser::parser > next precedence: 0
@onpaws
onpaws / cleanup-evicted-pods.sh
Created June 12, 2023 20:57
Clean up evicted pods Kubernetes
# k8s will evict pods when resources get too tight, and by default retains a long history of evictions (either >12k, or 1000 on Rancher)
# This commmand will clean up the stale/evicted pods
kubectl get pods -A | grep Evicted | while read namespace pod rest; do kubectl delete pod $pod -n $namespace; done
@onpaws
onpaws / ShowHN.md
Last active June 6, 2023 16:17
Seafowl FUSE Show HN

comment: Hello HN! I'm an engineer at Splitgraph and recently started learning Rust so I could make my first contribution to Seafowl [0], an early stage analytical database. Along the way I figured out a database hosting hack on GCP and wanted to share it with HN. It's a way to achieve "true" scale to zero database hosting that could be useful for certain side projects or spiky traffic situations.

A recurring problem I've faced with side projects is the need for Postgres, but no desire to deploy or maintain new instances. So when I learned GCP's "always free" tier includes serverless [1] I got curious to see if I could run a database.

While a lot of classic databases aren't usually a great fit for serverless, Seafowl separates compute, storage and catalog (catalog == a SQLite file of metadata). [2] Last month I was able to introduce GCS bucket compat to Seafowl, which enabled me to mount the catalog via gcsfuse (i.e. an adapter that allows attaching

@onpaws
onpaws / zgrep.sh
Created May 20, 2023 00:18
Grep over gzipped logs
zgrep 'admin_' /var/log/auth.log.*.gz
# syntax=docker/dockerfile:1
### Seafowl https://github.com/splitgraph/seafowl/blob/main/Dockerfile
# Assumes Seafowl binary is already present
# Download from https://github.com/splitgraph/seafowl/releases
FROM debian:bullseye-slim
COPY ./seafowl /usr/local/bin/seafowl
@onpaws
onpaws / curl.sh
Created March 14, 2023 19:52
HOWTO check a redirect/rewrite config with curl
curl -L -s -o /dev/null -D - www.example.com/some/path
@onpaws
onpaws / brew.sh
Created August 1, 2022 10:57
brew install --verbose --build-from-source sgr
$ brew install --verbose --build-from-source sgr
==> Downloading https://files.pythonhosted.org/packages/2d/6a/885bc91484e1aa8f618f6f0228d76d0e67000b0fdd6090673b777e311913/asciitree-0.3.3.tar.gz
Already downloaded: /Users/paws/Library/Caches/Homebrew/downloads/bbe04a2e4e9d916a520b534f8c2b90333bbea0c045f3bbfe7d5ad6a344fa116b--asciitree-0.3.3.tar.gz
==> Verifying checksum for 'bbe04a2e4e9d916a520b534f8c2b90333bbea0c045f3bbfe7d5ad6a344fa116b--asciitree-0.3.3.tar.gz'
==> Downloading https://files.pythonhosted.org/packages/d7/77/ebb15fc26d0f815839ecd897b919ed6d85c050feeb83e100e020df9153d2/attrs-21.4.0.tar.gz
Already downloaded: /Users/paws/Library/Caches/Homebrew/downloads/fe6cdd0c4ee0b8da4037c0f8bc4a7ce1f6194ca0ca06f2812515c5ad0c565913--attrs-21.4.0.tar.gz
==> Verifying checksum for 'fe6cdd0c4ee0b8da4037c0f8bc4a7ce1f6194ca0ca06f2812515c5ad0c565913--attrs-21.4.0.tar.gz'
==> Downloading https://files.pythonhosted.org/packages/cc/85/319a8a684e8ac6d87a1193090e06b6bbb302717496380e225ee10487c888/certifi-2022.6.15.tar.g
@onpaws
onpaws / brew-logs
Created July 20, 2022 12:33
brew install --verbose onpaws/splitgraph/sgr
paws@leo  /usr/local/etc  brew install --verbose onpaws/splitgraph/sgr
==> Downloading https://files.pythonhosted.org/packages/2d/6a/885bc91484e1aa8f618f6f0228d76d0e67000b0fdd6090673b777e311913/asciitree-0.3.3.tar.gz
Already downloaded: /Users/paws/Library/Caches/Homebrew/downloads/bbe04a2e4e9d916a520b534f8c2b90333bbea0c045f3bbfe7d5ad6a344fa116b--asciitree-0.3.3.tar.gz
==> Verifying checksum for 'bbe04a2e4e9d916a520b534f8c2b90333bbea0c045f3bbfe7d5ad6a344fa116b--asciitree-0.3.3.tar.gz'
==> Downloading https://files.pythonhosted.org/packages/d7/77/ebb15fc26d0f815839ecd897b919ed6d85c050feeb83e100e020df9153d2/attrs-21.4.0.tar.gz
Already downloaded: /Users/paws/Library/Caches/Homebrew/downloads/fe6cdd0c4ee0b8da4037c0f8bc4a7ce1f6194ca0ca06f2812515c5ad0c565913--attrs-21.4.0.tar.gz
==> Verifying checksum for 'fe6cdd0c4ee0b8da4037c0f8bc4a7ce1f6194ca0ca06f2812515c5ad0c565913--attrs-21.4.0.tar.gz'
==> Downloading https://files.pythonhosted.org/packages/cc/85/319a8a684e8ac6d87a1193090e06b6bbb302717496380e225ee10

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