Skip to content

Instantly share code, notes, and snippets.

View jsoref's full-sized avatar
📕
Saving the word one project at a time

Josh Soref jsoref

📕
Saving the word one project at a time
View GitHub Profile
@jsoref
jsoref / wait-for-tcp-port.sh
Created September 2, 2022 22:28
A simplistic way to ensure that a certain tcp host:port is available so that a service can depend on it
#!/bin/sh
#/usr/local/bin/wait-for-tcp-port.sh
instance="$1"
host="${instance%%:*}"
port="${instance##*:}"
start=10
loop=$start
while true
do
nc -zvw3 "$host" "$port" 2>/dev/null >/dev/null
@jsoref
jsoref / gh_collect_repo_workflow_logs.sh
Created December 19, 2023 22:40
Get github repository workflow run logs
gh_collect_repo_workflow_logs() {
OWNER="$1"
REPO="$2"
for workflow_run in $(gh api "/repos/$OWNER/$REPO/actions/runs" |jq -r -M '.workflow_runs[].id'); do
for job in $(
gh api "/repos/$OWNER/$REPO/actions/runs/$workflow_run/jobs" | jq '.jobs[].id'
); do
gh run view -R "$OWNER/$REPO" --log -j $job > "$workflow_run.$job.log"
done
done
@jsoref
jsoref / gist:d71accaed6aacdd1567eb626cbeb6a73
Last active January 12, 2024 01:52
Working with evil repositories

Premise

  • check-spelling should be able to work with anything.

  • macOS has some file system character constraints that have proven to be a bit problematic.

Use Docker (or an equivalent) to run Alpine Linux

Set up an alpine environment

docker run -it alpine