Skip to content

Instantly share code, notes, and snippets.

View InBrewJ's full-sized avatar
🐼
eyes

Jason Brewer InBrewJ

🐼
eyes
View GitHub Profile
@InBrewJ
InBrewJ / ETLite.js
Last active March 23, 2023 13:40
An evening's noodling into a generic pipeline runner in JS
// ETLite.js is a cool name, eh?
// A slight bastardisation of the 'Chain of Responsibility' pattern
// Inspired by:
// https://github.com/InBrewJ/ts-for-dsa-minimal/blob/master/typescript-tasks/003-fizzbuzz-chain-responsibility/003-fizzbuzz-chain-responsibility.ts
// In a sense, is this is a 'Tree of Responsibility'?
// It's kind of like a DAG. It IS a DAG?
// We essentially want a tree of stages
// At the end of the pipeline, dump a report
@InBrewJ
InBrewJ / run_rpi4_32.sh
Created March 3, 2023 18:39
Run LushRooms Pi (32 bit, VLC version) in docker with working sound (only jack tested)
# devices / volumes inspired by:
# https://github.com/scottsideleau/docker-vlc
PORT=80
sudo docker run -it --rm --network host -p $PORT:$PORT \
--env PORT=$PORT \
-v $HOME/.pulse:/home/vlc/.pulse:rw \
-v /dev/shm:/dev/shm \
-v /dev/snd:/dev/snd \
@InBrewJ
InBrewJ / lushrooms_pi_pairing.md
Last active February 17, 2023 22:50
LushRooms Pi - how to pair two LRPis

How to pair two LushRooms Pis

  1. Apply the settings below
  2. Load up the LRPi tablet app on the 'master'
  3. Hit the 'pair' button at the top of the screen
  4. Wait until it says 'unpair'
  5. Load up the LRPi tablet app on the 'slave'
  6. It should say: 'Sorry, I'm being controlled by another LushRoom π'
  7. Use the LRPi tablet app on the 'master' as usual
  8. When done, hit 'unpair' on the 'master'
@InBrewJ
InBrewJ / postgres_dbs_accepting_connections.sh
Created February 8, 2023 11:06
Minimal bash script to wait for postgres services in running in docker
#! /bin/bash
is_ready_string="accepting connections"
postgres_ready=0
timescale_ready=0
all_postgres_are_ready=0
echo $postgres_response
echo $timescale_response
@InBrewJ
InBrewJ / ba_scam.html
Last active November 7, 2022 22:44
Incredibly suspect 'free BA tickets' HTML / obfuscated JS
DO NOT RUN THIS CODE
IT IS LIKELY AN ATTACK
TREAD CAREFULLY
DO NOT BELIEVE IN FREE BA TICKETS
BA TICKETS ARE EXPENSIVE AS SHIT AND THERE'S NO WAY THEY WOULD OFFER SUCH JOY IN SUCH unprecedented TIMES
@InBrewJ
InBrewJ / docker-compose.yml
Created August 30, 2022 17:32
Checking PostgreSQL health for dependent services in docker-compose (for e.g. Grafana)
x-pg-healthcheck: &pg-healthcheck
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
x-pg-config: &shared-pg-config
image: postgres:13.0-alpine
restart: 'unless-stopped'
@InBrewJ
InBrewJ / rebase.sh
Created December 24, 2021 11:54
git rebase: always trust one source of commits for merge conflicts
## See https://stackoverflow.com/a/66766065/8249410
## IN A REBASE, THE MEANING OF OURS / THEIRS IS REVERSED
## Because we're replaying commits over the other branch, the commits you're adding over the
## base branch become 'theirs' wrt the base branch
## capeesh?
## To choose the influence of `origin/main` for rebase conflicts
git rebase -s recursive -X ours origin/main
## To choose the influence of your current branch for rebase conflicts
@InBrewJ
InBrewJ / FilterDependabotFromPRs.txt
Last active January 14, 2024 00:30
Filter for PRs from real people (i.e. not dependabot)
is:open is:pr -author:app/dependabot
@InBrewJ
InBrewJ / rebase_from_master.sh
Created October 30, 2020 10:09
Rebasing from master - make your feature branch clean (All credit to @joeyciechanowicz)
git co -b feature-name
# ... do some stuff
git commit -am "message"
# .. go away for a while
git fetch origin/master
git rebase origin master
# ... do some more work
git add .
git commit --amend
@InBrewJ
InBrewJ / disable_network_interface.sh
Last active September 11, 2020 16:34
How to toggle a network interface in Pop OS 20.04 (on the wise ThinkPad)
# To show the current link state
ip link show
# To disable the wlp3s0 interface (the built in one)
if=wlp3s0
sudo ip link set $if down
# or
sudo ip link set wlp3s0 down