Install psql on macOS with Homebrew

brew install libpq brew link --force libpq psql --version libpq includes psql and other PostgreSQL client utilities. The brew link --force step symlinks the binaries into your PATH so psql is available from any terminal. If you don’t have Homebrew installed yet: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Fix casks with `depends_on` that reference pre-Mavericks

If you get an error like Error: Cask 'hex-fiend-beta' definition is invalid: invalid 'depends_on macos' value: ":lion", where hex-fiend-beta can be any cask name and :lion any macOS release name, run the following command: /usr/bin/find "$(brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' -print0 | /usr/bin/xargs -0 /usr/bin/perl -i -pe 's/depends_on macos: \[.*?\]//gsm;s/depends_on macos: .*//g' This strips out all depends_on macos references from installed casks. It’s a blunt instrument – you’re editing Homebrew’s metadata files directly – but it gets things working again. ...

'[solved] xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist'

Error: xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist Use sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --install to install the standalone command line developer tools. See man xcode-select for more details. xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist Use sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --install to install the standalone command line developer tools. See man xcode-select for more details. ...

Installing SSHPass on Ubuntu and macOS

SSHPass is a small command-line utility that lets you pass a password directly to an SSH connection, which means no interactive password prompt. Useful when you’re writing scripts that need to connect to remote machines without manual intervention. A word of warning before you go ahead: SSHPass is not secure. The password gets passed as a command-line argument, which means it can show up in process listings and shell history. It’s fine for personal automation on your own machines, but don’t use it in shared environments or anything that touches production systems. ...