Tag: shell

40 posts
Migrating from GNU stow to chezmoi

Migrating from GNU stow to chezmoi

Why I swapped GNU stow's symlink farm for chezmoi: one command to bootstrap a Mac with Homebrew packages and macOS settings, a small daily sync loop, and agent skills shared between Claude Code and Codex.

Jun 11, 2026

Get the latest release from a GitHub repo

The following is a collection of ways to get the latest release of a program from its GitHub repository, using the command line. The example repositories used below can be replaced with any repository hosted on GitHub.

Apr 10, 2026
Background jobs and inherited file descriptors

Background jobs and inherited file descriptors

Why & backgrounds execution but doesn't stop output from flooding your terminal.

Mar 27, 2026
M
marko.tech
marko.tech

Keyboard Shortcuts Supercut

A list of the most useful keyboard shortcuts for the terminal

Dec 4, 2025
M
marko.tech
marko.tech

Using brewski, a custom alias for maintaining Homebrew packages

A simple alias to update, upgrade, and cleanup your brew installation on macOS.

Oct 2, 2025
M
marko.tech
marko.tech

fzf ftw

fzf-tools is a zsh plugin that enhances command line efficiency with interactive selection for files, history, scripts, and git commits.

Jun 8, 2025
dunkirk.sh icon
dunkirk.sh
dunkirk.sh

Musings about Atuin

its a bit tricky on nix, but it's sooo worth it

Apr 23, 2025
Dynamic shell variables

Dynamic shell variables

Learn variable indirection in Bash with ${!var} syntax. Build context-aware configs, function dispatch, and dynamic variable name resolution.

Jan 10, 2025
Running only a single instance of a process

Running only a single instance of a process

Prevent multiple script instances with file locking. Use flock in Bash, fcntl in Python, and syscall.Flock in Go for single-instance processes.

Dec 30, 2024
SSH saga

SSH saga

Complete SSH setup guide: key pairs, authorized_keys, sshd_config, ssh_config, known_hosts, agent forwarding, and hardening for secure remote access.

Dec 16, 2024
Discovering direnv

Discovering direnv

Automate environment variables per directory with direnv. Load .envrc files on entry, unload on exit. Integrate with Python venv and uv workflow.

Oct 1, 2024
Bash namerefs for dynamic variable referencing

Bash namerefs for dynamic variable referencing

Master Bash namerefs with declare -n to create dynamic variable references. Build generic functions for arrays and associative arrays without eval.

Sep 19, 2024
Shell redirection syntax soup

Shell redirection syntax soup

Complete guide to Bash redirection. Master stdout, stderr, pipes, tee, file descriptors, and shorthand syntax with practical examples for every case.

Sep 11, 2024
HTTP requests via /dev/tcp

HTTP requests via /dev/tcp

Make raw HTTP requests with Bash's /dev/tcp file descriptor. Build health check scripts without curl or wget using TCP socket connections.

Aug 7, 2024
The *nix install command

The *nix install command

Replace mkdir, cp, and chmod with a single install command. Copy files, create directories, and set permissions in one step with GNU coreutils.

Jul 27, 2024
Here-doc headache

Here-doc headache

Avoid here-doc pitfalls when running remote commands via SSH. Learn variable expansion gotchas and simpler alternatives for deployment scripts.

Jul 18, 2024
Devtools FM icon
Devtools FM
devtools.fm

Robby Russell - oh my zsh, Planet Argon

Robby Russell shares the origin story of Oh My ZSH and how Planet Argon evolved alongside the terminal customization revolution he sparked.

Jul 14, 2024
I kind of like rebasing

I kind of like rebasing

Master git rebase for cleaner commit history. Learn interactive rebasing, squashing commits, and rebasing feature branches onto main with practical examples.

Jun 17, 2024
Pesky little scripts

Pesky little scripts

Organize custom scripts with comma-prefixed naming. Improve tab completion and eliminate clutter by prefixing script names with special characters.

Oct 28, 2023
Dotfile stewardship for the indolent

Dotfile stewardship for the indolent

Manage dotfiles across devices with GNU Stow. Symlink configuration files from git repo to home directory with simple, idempotent commands.

Sep 26, 2023
Using DNS record to share text data

Using DNS record to share text data

Share data via DNS TXT records using dig and base64 encoding. Learn limitations, security concerns, and practical use cases for DNS tunneling.

Jul 16, 2023
Unix-style pipelining with Python's subprocess module

Unix-style pipelining with Python's subprocess module

Build Unix-style command pipelines in Python using subprocess.run with stdout piping for efficient process chaining and output capture.

Jul 13, 2023
Implementing a simple traceroute clone in Python

Implementing a simple traceroute clone in Python

Build a traceroute clone in Python using UDP and ICMP sockets to trace network packet routes and measure hop latency with TTL manipulation.

May 31, 2023
Fixed-time job scheduling with UNIX 'at' command

Fixed-time job scheduling with UNIX 'at' command

Schedule one-time commands with UNIX at command. Learn job queuing, remote scheduling via HTTP API, and managing atd/atrun daemons.

May 13, 2023
Logg for Aslak Raanes icon
Logg for Aslak Raanes
aslakr.folk.ntnu.no/

Hei cgi

Eksempel på enkel cgi i sh(1) #!/bin/sh echo "Content-type: text/plain" echo echo 'Hei!'

May 5, 2023
Associative arrays in Bash

Associative arrays in Bash

Learn how to use associative arrays in Bash to create key-value pairs, mimic dictionaries, and manage complex data structures in shell scripts.

May 2, 2023
Process substitution in Bash

Process substitution in Bash

Use process substitution <() to treat command output as files in Bash. Compare directories, process data, and avoid temporary files with this technique.

Apr 29, 2023
Dynamic menu with select statement in Bash

Dynamic menu with select statement in Bash

Build interactive CLI menus with Bash select statement. Create user-friendly command-line tools with option selection and function dispatch.

Apr 28, 2023
Simple terminal text formatting with tput

Simple terminal text formatting with tput

Format terminal output with tput instead of ANSI codes. Set colors, bold text, underlines, and backgrounds with simple commands in shell scripts.

Apr 22, 2023
Tinkering with Unix domain sockets

Tinkering with Unix domain sockets

Build Unix domain socket servers and clients with Python and socat. Access Docker API via UDS, create HTTP servers, and optimize inter-process communication.

Mar 10, 2023
Colon command in shell scripts

Colon command in shell scripts

Use the colon : command as a no-op in Bash scripts for cleaner debug output with -x flag. Alternative to echo for section markers and comments.

Dec 22, 2022
Auditing commit messages on GitHub

Auditing commit messages on GitHub

Automate commit message validation with GitHub Actions. Enforce refs and closes patterns to maintain clean Git history and link commits to issues.

Oct 5, 2022
To quote or not to quote

To quote or not to quote

Master shell quoting rules: single vs double quotes, backticks vs $(). Learn when to quote variables to prevent spaces and special characters from breaking commands.

Oct 4, 2022
Returning values from a shell function

Returning values from a shell function

Understand how return values work in Bash functions. Learn exit codes, status evaluation patterns, and proper boolean returns with true/false commands.

Sep 24, 2022
Distil git logs attached to a single file

Distil git logs attached to a single file

View git commit history for a single file with git log --follow. Learn to track multiple files with xargs and concatenate their commit logs.

Jun 20, 2022
Health check a server with 'nohup $(cmd) &'

Health check a server with 'nohup $(cmd) &'

Run background health checks in CI with nohup and ampersand. Test server readiness with retry loops and automatic cleanup on success or failure.

Apr 17, 2022
Don't add extensions to shell executables

Don't add extensions to shell executables

Why executable scripts shouldn't have extensions. Learn GitHub's scripts-to-rule-them-all pattern for language-agnostic project automation.

Nov 22, 2021
Use 'command -v' over 'which' to find a program's executable

Use 'command -v' over 'which' to find a program's executable

Replace which with command -v for POSIX-compliant executable lookup. Learn why command -v is the portable alternative for finding program paths.

Nov 15, 2021
Use strict mode while running bash scripts

Use strict mode while running bash scripts

Enable Bash strict mode with set -euo pipefail to catch errors early. Exit on failures, treat unset variables as errors, and handle pipeline failures properly.

Nov 7, 2021
Use curly braces while pasting shell commands

Use curly braces while pasting shell commands

Prevent shell commands from executing immediately when pasting. Use curly braces to safely paste multi-line commands with hidden newline characters.

Nov 7, 2021