Laptop

I maintain a laptop repo which sets up a macOS machine as a software development environment.

Install

Clone onto laptop:

export LAPTOP="$HOME/laptop"
git clone https://github.com/croaky/laptop.git $LAPTOP
cd $LAPTOP

Review:

less laptop.sh

Run:

./laptop.sh

What it sets up

The script can safely be run multiple times. I run it most workday mornings. It is tested on the latest version of macOS on a arm64 (Apple Silicon) chip. It:

Ad block script

To improve speed, privacy, and safety on my laptop, the adblock script blocks ads, trackers, and malicious websites at the DNS host level:

adblock

Unlike browser extension ad blockers, it works on all apps on my device (not only web browsers).

Unlike DNS sinkholes, it only works on my laptop (not phones, tablets on the network) but it does not require an additional always-on device such as a Raspberry Pi and it works reliably when using the laptop away from home.

To disable and re-enable it:

adblock undo
adblock

Kill PID scripts

The kill-pid-on-port script kills processes listening on a given port:

kill-pid-on-port 3000

The kill-pid-running script kills running process by its name:

kill-pid-running sqls

Find and replace script

The replace script finds and replaces code/text by a file glob:

replace foo bar **/*.rb