A useful script to work offline, in the train, to run in a local git clone of the target repository :
gh issue list --limit 100 --json number --jq .[].number | while read nb; do
gh issue view $nb > $nb.md
gh issue view $nb --comments >> $nb.md
done
Script to install Datalogics PDF Checker CLI on a Linux system:
curl https://raw.githubusercontent.com/Lucas-C/dotfiles_and_notes/master/bin/install-pdfchecker.sh | bash
PDF_Checker/pdfchecker --profile PDF_Checker/CheckerProfiles/everything.json --input $pdf
Useful CLI when you have the RCON password of a Quake 3 server !
I have set up the script below as a cron job to alert me whenever a player connect to my friend server :
#!/bin/bash
set -o pipefail -o errexit -o nounset
cd $(dirname "${BASH_SOURCE[0]}")
date
echo status | quake3-rcon $server_address $rcon_password > quake3-kleph.status
grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' quake3-kleph.status | awk '{ print $4 }' > quake3-kleph.players
if ! diff -q quake3-kleph.players quake3-kleph.players.old; then
echo 'New player detected'
./send_reminder.sh "New player joined kleph.eu Quake3 server: $(comm -13 <(sort quake3-kleph.players.old) <(sort quake3-kleph.players) | tr '\n' ' ')"
fi
mv quake3-kleph.players quake3-kleph.players.old
Bats is a TAP-compliant testing framework for Bash. It provides a simple way to verify that the UNIX programs you write behave as expected.
Used by Travis CI
Urchin is a portable shell program that runs a directory of Unix-style programs and produces pretty output. It is normally used for testing shell programs, where each test case corresponds to a single file in the directory that Urchin runs.
Confusing corners of the unix utilities
shpec - Test your shell scripts!
A smart and user-friendly command line shell
peco - Simplistic interactive filtering tool
percol - adds flavor of interactive filtering to the traditional pipe concept of UNIX shell
shellcheck - ShellCheck, a static analysis tool for shell scripts
One of the most powerful aspects of popular high-level languages is the existence of a comprehensive standard library. Unfortunately, the most popular Linux shell, bash, lacks a full-featured library bundled with it. A number of people have written libraries to compensate for this lack, which can make your life infinitely easier if you need to…
Use set -u
Use set -e
Program defensively – expect the unexpected
Setting traps
Race conditions
Be atomic