Linux load average

This post documents the high level concepts I need to remember about *nix Load Average. Load average can been seen in the output of uptime and top: From uptime: $ uptime 14:40 up 21 days, 21:48, 5 users, load averages: 2.63 2.75 3.45 From top: root@blog-server-2:~# top -n 1 | head -2 top - 15:28:37 up 10 days, 12:41, 1 user, load average: 0.04, 0.03, 0.00 Tasks: 95 total, 1 running, 94 sleeping, 0 stopped, 0 zombie root@blog-server-2:~# There are 3 decimal numbers shown....

2022-09-16

Open a file or folder from the macOS CLI

You can open the a file from the macOS CLI with the command open. To open a file with the default app, use: open $FILENAME To open the current directory, use: open . To open a specific directory, use open $DIRECTORY_NAME To open a URL, use: open $URL Thanks to this post for teaching me this.

2022-08-09

Translating characters with tr

I recently was having to work with Ansible for several days to deploy changes globally across prod. I was storing my playbook limit in a file like so: [18:45] james_simas@widget ~/Downloads $ cat limit.txt host1.domain.com host2.domain.com host3.domain.com At one point, I needed to use supply the list of hostnames in BASH, but rather than having them be newline separated, I needed them to be separated by commas like this: host1.domain.com,host2.domain.com,host3.domain.com I didn’t want to modify my original files (I still needed them) and this seemed like a problem somebody else has problably solved....

2021-01-14

tarsnap

List archives: tarsnap --list-archives | sort List size of all archives: tarsnap --print-stats Create archive: tarsnap -v -c -f ARCHIVE_NAME /path/to/file /path/to/dir Restore archive: tarsnap -v -x -f ARCHIVE_NAME Delete archive: tarsnap -d -f ARCHIVE_NAME Useful doc: https://www.tarsnap.com/simple-usage.html

Time Machine

Speed up backups: sudo sysctl debug.lowpri_throttle_enabled=0 Normal speed backups: sudo sysctl debug.lowpri_throttle_enabled=1