- dasel: Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool
- keychain: keychain ssh-agent front-end
Article of the week: A Brief History of the ‘ls’ command
The ls command, which lists files, is one of the most essential utilities for Unix and Linux users and, not surprisingly, one of the oldest. In its earliest form it was called listf
and was available on the Massachusetts Institute of Technology’s Compatible Time Sharing System (CTSS) by July, 1961.
Tip of the week: Managing your passphrase-protected ssh keys with Keychain:
Interacting with ssh-agent
can be confusing, using keychain
to manage your ssh keys means only entering your passphrase once, at boot time. Add the following to your .bashrc
or .zshrc
:
# macOS
eval "$(keychain --eval --ignore-missing --quiet --inherit any id_rsa id_ed25519 google_compute_engine)"
# Linux
eval "$(keychain --eval --ignore-missing --quiet id_rsa id_ed25519 google_compute_engine)"
If you’re not a CLI purist, 1Password can also manage your ssh keys in the same way.
Continue reading
- SpotiFetch: A fetch tool for Spotify
- fkill-cli: Fabulously kill processes
Article of the week: Vim Tab Madness. Buffers vs Tabs
Learning how to use and embrace buffers and windows leads to a far more cohesive editing experience in Vim and will help eliminate a lot of frustration when trying to use tabs unnaturally.
Tip of the week: How to define and use variables in jq
, with a real world script example:
The below script uses gh
to find open PRs across your team. Define the variable org
and team
using the values from GitHub.
#!/usr/bin/env bash
members="$(gh api /orgs/${org}/teams/${team}/members | jq -rj '.[]|"author:",.login," "')"
gh api -X GET search/issues \
-f q="${members} is:open draft:false created:>$(date -d "90 days ago" +%Y-%m-%d)" \
| jq -jr 'def cls: {
"black": "[30m",
"yellow": "[33m",
"blue": "[34m",
"green": "[32m",
"bold": "[1m",
"reset": "[0m",
}; .items[] | "
" +
cls.blue + cls.bold + .title + cls.reset + "
" +
cls.green + cls.bold + ">> " + cls.reset + "Created on: ", cls.yellow + (.created_at|fromdate|strftime("%Y-%m-%d")) + cls.reset + "
" +
cls.green + cls.bold + ">> " + cls.reset + "Created by: ", cls.green + .user.login + cls.reset + "
" +
cls.green + cls.bold + ">> " + cls.reset + .pull_request.html_url + "
"'
Continue reading
- sd: Intuitive find & replace CLI (sed alternative)
- ugit: Your damage control git buddy
Article of the week: The TTY demystified
In present time, we find ourselves in a world where physical teletypes and video terminals are practically extinct. Unless you visit a museum or a hardware enthusiast, all the TTYs you’re likely to see will be emulated video terminals — software simulations of the real thing. But as we shall see, the legacy from the old cast-iron beasts is still lurking beneath the surface.
Tip of the week: Get practical information using curl
:
curl cheat.sh/<command> # command examples
curl whatismyip.akamai.com # find your public IP
curl https://status.plaintext.sh/t # status for popular services
curl wttr.in/<city> # weather
Continue reading
- zpy: Zsh helpers for Python venvs, with pip-tools
- dua: View disk space usage and delete unwanted data, fast
Article of the week: The Forgotten History of the Blinking Cursor
“I remember him telling me the reason behind the blinking cursor, and it was simple,” Kiesling’s son writes. “He said there was nothing on the screen to let you know where the cursor was in the first place. So he wrote up the code for it so he would know where he was ready to type on the Cathode Ray Tube.”
Tip of the week: POSIX has getopt
and Bash has getopts
, but both only support single dash arguments. For more robust argument handling, try zparseopts
in your scripts:
% cat << 'EOF' > zparse.zsh
#!/usr/bin/env zsh
zparseopts -- f:=foo -foo:=foo b:=bar -bar:=bar
[[ -n $foo ]] && echo "you passed ${foo[2]}"
[[ -n $bar ]] && echo "you passed ${bar[2]}"
EOF
% ./zparse.zsh --foo var1 --bar var2
you passed var1
you passed var2
% ./zparse.zsh -f one -b two
you passed one
you passed two
% ./zparse.zsh --foo apple
you passed apple
To read about all the different options available, see run-help zshmodules
.
Continue reading
- dog: A command-line DNS client
- tmuxp: tmux session manager
Article of the week: 6 deprecated Linux commands and the tools you should be using instead
This article shares a handful of older tools that you might be still using, what you should be using instead, and why you should switch to these improved alternatives that provide the same functionality, if not more.
Tip of the week: Use Python as a simple jq
replacement:
foo='{"cities": {"boston": "ma", "miami": "fl", "seattle": "wa"}}'
python -c "import sys, json;print(json.loads(sys.stdin.read())['cities']['seattle'])" <<< "$foo"
# Bonus: use `jo` to create json:
foo="$(jo -p cities=$(jo boston=ma miami=fl seattle=wa))"
Continue reading