Skip to content

Instantly share code, notes, and snippets.

View balupton's full-sized avatar
🧙‍♀️
Working on Dorothy, a dotfile ecosystem

Benjamin Lupton balupton

🧙‍♀️
Working on Dorothy, a dotfile ecosystem
View GitHub Profile
@balupton
balupton / bash-input-output-testing.bash
Created August 30, 2023 13:24
Bash Input Output Testing
# test input/output availability, accurately but noisely
(: </dev/stdin || printf '%s\n' 'cannot read stdin') || :
(: >/dev/stdin || printf '%s\n' 'cannot write stdin') || :
(: </dev/stdout || printf '%s\n' 'cannot read stdout') || :
(: >/dev/stdout || printf '%s\n' 'cannot write stdout') || :
(: </dev/stderr || printf '%s\n' 'cannot read stderr') || :
(: >/dev/stderr || printf '%s\n' 'cannot write stderr') || :
(: </dev/tty || printf '%s\n' 'cannot read tty') || :
(: >/dev/tty || printf '%s\n' 'cannot write tty') || :
@balupton
balupton / README.md
Last active September 1, 2023 20:22
Stack Overflow Question 76861137 — How to prevent nested function failures being missed in bash?

Exit Status and Bash

I'm @balupton, author of dorothy which is the largest public bash codebase that I am aware of.

Dorothy is coded using set -e (errexit) to avoid || return $? statements on every single one of its thousands of lines of code, for the most part this has worked well, however I was suprised when the down command would report a failure via:

However it would also report a success within the called function:

@balupton
balupton / README.md
Last active January 7, 2023 18:05
Keyboard Layouts for Karabiner Elements

Various key mappings for your macOS machine via Karabiner Elements.

To apply copy the configuration into the simple_modifications section of your $HOME/.config/karabiner/karabiner.json file.

@balupton
balupton / README.md
Last active March 15, 2023 04:52
Supplementing language learning with ChatGPT for Bahasa Indonesia

Using OpenAI's ChatGPT as my Indonesian Tutor

See the various excerpts of my prompts for usage.

@balupton
balupton / plexmediaserver.conf
Last active October 28, 2024 23:16
Dorothy Command for managing a Sharebox: BTRFS Cluster, GoCryptFS, Samba, Plex Media Server, Syncthing, NordVPN, Transmission
# sudo systemctl edit plexmediaserver
[Unit]
AssertPathIsMountPoint=/Volumes/TankSecure
[Service]
User=REDACTED
Group=REDACTED
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/Volumes/REDACTED"
UMask=0007
@balupton
balupton / readme.md
Last active May 3, 2025 04:15
Debugging Ubuntu VPN/Bridge Networking

Networking on my Ubuntu machines is being flaking:

  • docker bridge interface failing
  • traffic not going to vpns
  • when vpn or docker bridge does work it knocks out all dns resolutions

Here are all the things I have tried or yet to try.

docker failures

@balupton
balupton / links.md
Last active January 16, 2025 00:21
Move2Earn, Move2Broke, Move4Free?
@balupton
balupton / android-dev
Last active May 3, 2022 21:22
Dorothy Graveyard
#!/usr/bin/env bash
source "$DOROTHY/sources/strict.bash"
# Android Simulator
app=$(get-app "Android Studio.app")
if test -d "$app"; then
"$app/sdk/tools/emulator" -avd basic
else
echo "Android Studio is not installed"
fi
@balupton
balupton / ossthanks-caution.md
Last active November 27, 2021 05:26
Who to fund? #OSSThanks — An open-source philosopher's advice.

It's also important to fund the small independent projects and maintainers, as they are often struggling with shoestring budgets and often have to abandon their projects from lack of means, or have their projects reimplemented by maintainers who are riding the Pareto principle (where more maintenance, usage, recognition, audience, money, will beget even more maintenance, usage, recognition, audience, money, leaving behind a long tail inside a bloody ocean, where whales and sharks incidentally cannibalise the smaller fish). $10/month could double the budget of a small-time independent maintainer, which help prevents small fish maintainers abandoning their projects, which help prevents the projects getting reimplemented with their resources consolidated by a $10,000/month Pareto maintainer, backed by even bigger entities. Abandoned projects aren't just at risk of Pareto takeovers, but also of transfers to malicious contributors (where a billion installs a month project, or a specifically targeted project, has i

@balupton
balupton / telegram.md
Last active August 22, 2021 17:18
Telegram Groups