Skip to content

Instantly share code, notes, and snippets.

View innomatics's full-sized avatar
💭
Saving the world

Justin Hopkins innomatics

💭
Saving the world
  • AgriNous
  • Melbourne, Australia
View GitHub Profile
@innomatics
innomatics / gist:c3d0836b52cda3a59a686398b1c37b1f
Created May 21, 2025 02:27
Any google sheet cell is a formula
=reduce(false, <range>, lambda(acc, curr, OR(acc, ISFORMULA(curr))))
CRDTs
Conflict-free Resolution Data Types
https://jakelazaroff.com/words/an-interactive-intro-to-crdts/
@innomatics
innomatics / monitor.sh
Created December 19, 2024 01:02
Monitor UMC404HD input with ALSA
#!/bin/bash
# Period should be half of buffer
export BUFFER="--buffer-size=32 --period-size=16"
# See arecord -D hw:CARD=U192k,DEV=0 --dump-hw-params
export UMC404HD="-D hw:CARD=U192k,DEV=0 -f S32_LE -c4 -r44100"
arecord $UMC404HD -t raw $BUFFER | aplay $UMC404HD $BUFFER
@innomatics
innomatics / install_redis_cli.sh
Last active March 20, 2024 00:53
Install latest redis-cli on ubuntu
#!/bin/bash
set -e
apt update
apt install -y lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list
apt update
apt install -y redis-tools
@innomatics
innomatics / Shell
Created March 16, 2024 14:55
Rosegarden Build Dependencies Ubuntu 22.04
sudo apt install \
build-essential \
cmake \
make \
qtbase5-dev \
qtdeclarative5-dev \
qttools5-dev \
qttools5-dev-tools \
libqt5svg5-dev \
ladspa-sdk \
@innomatics
innomatics / ecr_report.sh
Last active March 20, 2024 10:32
ECR Usage Report
#!/bin/bash
set -e
account_prefix=agrinous
accounts="master dev stg etc"
format_bytes() {
echo $1 | numfmt --to=iec-i
}
```shell
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker ${USER}
# Avoid logout / login
newgrp docker
export XAUTHORITY=$HOME/.Xauthority

OS Ventura 13.4

Make bash default shell

chsh -s /bin/bash
touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile

CLI dev tools

#!/bin/bash
# Every folder in the script path should be a git repository.
# Update each folder/repo with a remote pull (if they are on the default branch).
set -e
REMOTE=origin
for folder in $(find .. -mindepth 1 -maxdepth 1 -type d); do
if [ -d $folder/.git ]; then