Skip to content

Instantly share code, notes, and snippets.

View wallentx's full-sized avatar
:shipit:
ȋ̴͎ ̶̘͝u̷̥͆s̴͖̾ē̷̠ ̶̟̉a̴͙̕ŗ̸͆č̶̬ḣ̷̭ ̴̡̄b̷̳̒ẗ̷͍ẘ̴̡

William Allen wallentx

:shipit:
ȋ̴͎ ̶̘͝u̷̥͆s̴͖̾ē̷̠ ̶̟̉a̴͙̕ŗ̸͆č̶̬ḣ̷̭ ̴̡̄b̷̳̒ẗ̷͍ẘ̴̡
View GitHub Profile
#!/usr/bin/env bash
fd \
-e plist \
--exclude "Library/Application Support" \
--exclude "Library/Assistant" \
--exclude "Library/Daemon Containers" \
--exclude "Library/Autosave Information" . | \
fzf --preview 'plistutil -p {} | yq -oy . -C -P'
@wallentx
wallentx / yq-format-memory.sh
Last active August 8, 2024 22:28
Real footage of me figuring out a `yq` command
16:00:54 free -h | yq -pp
16:01:06 free -h | yq -pp -oy
16:01:17 free -h | yq
16:01:19 free -h | yq .
16:01:22 free -h | yq -pt
16:03:38 free -h | yq -pp | sed 's/total/\\ttotal/g'
16:03:44 free -h | yq -pp | sed 's/total/\\\ttotal/g'
16:03:49 free -h | yq -pp | sed 's/total/\\\\ttotal/g'
16:03:56 free -h | yq -pp | sed 's/total/\\ttotal/g'
16:03:59 free -h | yq -pp | sed 's/total/\ttotal/g'
@wallentx
wallentx / triggers.md
Created August 7, 2024 18:30
GitHub Actions events that trigger summary

branch_protection_rule

Triggers when branch protection rules are created, edited, or deleted in the repository.

on:
  branch_protection_rule:
    types: [created, deleted]

check_run

Triggers on events related to check runs, such as creation, re-request, completion, and requested action.

@wallentx
wallentx / kafka-at-home
Last active August 2, 2024 18:04
No! We got kafka at home!
#!/usr/bin/env bash
# Mom, can we get kafka, pleeeasee??
# No! We got
# kafka-at-home.sh
process() {
msg="$1"
[[ "$msg" == "quit" ]] && exit 1
echo -e "Received message:"
#!/usr/bin/env bash
set -e
if [[ $OSTYPE == 'darwin'* ]]; then
XARGS='gxargs'
else
XARGS='xargs'
fi
# Default values
patreon scrib baray link in the description down below that's
patreon subcribes liay Linked In the description down below that's
patreon scribes Le baray Linked In the description down below
patreon scribes libray Linked In the description down below that's
patreon scribes libr pay Linked In the description down below
patreon scribes liay Linked In the description down below that's
patreon scribes baray Linked In the description down below that's
patreon subcribes veray Linked In the description down below that's
patreon subscrib baray Link in the description down below that's
patreon subcrib Link in the description down below YouTube legally
Feature Amazon Linux 2 (AL2) Amazon Linux 2023 (AL2023) Bottlerocket
Purpose General purpose; optimized for AWS General purpose; optimized for latest AWS capabilities Purpose-built for hosting container workloads
Support Duration Long-term support until June 30, 2023 Supported for five years post general availability Supported by AWS, with frequent updates
Package Management Uses yum
@wallentx
wallentx / pyo3-config
Last active May 31, 2024 20:15
Generates pyo3_config.txt
#!/usr/bin/env python
import sys
import os
import configparser
import sysconfig
# Function to detect the library directory
def detect_lib_dir():
libdir = sysconfig.get_config_var('LIBDIR')
@wallentx
wallentx / .bash_functions
Last active May 9, 2024 08:41
lol i tried to make a yaml parser in bash like 10 years ago. it sorta works as long as you aren't trying to go beyond 2 nested levels
#######################
# YAML parser for BASH!
#######################
parse_yml() {
local prefix=$2
local s
local w
local fs
s='[[:space:]]*'
@wallentx
wallentx / dumploy.sh
Created May 8, 2024 02:39
A deployment bar that takes doodoos while its loading
#!/bin/bash
trap 'tput cnorm; echo' EXIT
tput civis
end=$(($(date +%s) + 15))
spin='⢿⣿⣻⣿⣽⣿⣾⣿⣷⣿⣿⣾⣿⣷⣿⣯⣿⣟⣿⡿⣿⢿⡿⣿'
i=0 sp="" len=24 cnt=0
gr=$(tput setaf 2)
nc=$(tput sgr0)
while [ $(date +%s) -lt $end ]; do