Skip to content

Instantly share code, notes, and snippets.

@djw4
djw4 / README.md
Last active August 17, 2022 06:56
Check if NAS is mounted before starting docker-compose
  1. Install htpc.service to /etc/systemd/system/htpc.service

    Note: I run the HTPC services as the user htpc so amend the service file appropriately if needed.

  2. Create service.sh in the same location as referenced by the systemd service and ensure it is executable.

    Note: This should also be where your docker-compose.yml file exists.

  3. Create settings.env in the same directory as service.sh.

  4. Modify settings.env so that the mount directory is referenced per your requirements.

@djw4
djw4 / install-krew.sh
Last active July 27, 2022 00:03
Install the krew plugin for kubectl
#!/usr/bin/env bash
set -eu
OS="$(uname | tr '[:upper:]' '[:lower:]')"
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')"
KREW="krew-${OS}_${ARCH}"
TMP_DIR=$(mktemp -d)
pushd ${TMP_DIR} 1> /dev/null
Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "Calibration" "170 3853 288 3796"
Option "SwapAxes" "1"
EndSection
@djw4
djw4 / lftp.conf
Created May 1, 2017 14:43
lftp.conf
# some useful aliases
alias dir ls
alias less more
alias zless zmore
alias bzless bzmore
alias reconnect "close; cache flush; cd ."
alias edit "eval -f \"get $0 -o ~/.lftp/edit.tmp.$$ && shell \\\"cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig && $EDITOR ~/.lftp/edit.tmp.$$ &&
test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\\" && put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*\""
## make prompt look better