Tag: Unix

37 posts

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

Background jobs and inherited file descriptors

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

·
Mar 27, 2026

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

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

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

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

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

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

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

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

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

·
Jul 18, 2024

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

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

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

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

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

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

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

·
May 13, 2023

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

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

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

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

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

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

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

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

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

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) &'

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

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

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 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

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

Amazon ya no está "en las nubes"

Pues eso, que desde hoy, Amazon proporciona almacenamiento persistente a sus instancias de “Elastic Computing Cloud” (EC2).Y no solo eso, que podría parecer facil dado que ya tienen su “Simple Storage Server” (S3, el guardian de mi musica por ahora), sino que añaden caracteristicas interesantísimas

·
Aug 21, 2008

mod_rewrite Voodoo

Vale, post eminentemente técnico, no se me pierdan.Resulta que estoy trabajando contra un Apache ‘restringido’, y no acepta ProxyPass/ProxyPassReverse.Y claro, cuando uno quiere presentar varios servidores en un único front… esa es la opción más habitual… al menos hasta donde yo se.Así que, anulada

·
Aug 21, 2008

Las cosas que me gustan de Unix, **revisited**

Jajajajaja… haciendo una nueva imagen de EC2 para un proyecto me acabo de encontrar con este mensaje…[…] /mnt/gailenora /mnt/img-mnt1+0 records in1+0 records out1048576 bytes (1.0 MB) copied, 0.00264 s, 397 MB/smke2fs 1.40.4 (31-Dec-2007)NOTE: rsync with preservation of extended file

·
Aug 13, 2008

Las cosas sencillas que me hacen amar Unix...

…o como pedirle educadamente y en dos lineas que haga el DROP ALL TABLES que necesito para la integración continua de un proyecto, y sobre una mysql que no soporta dicho comando…export MYSQLCMD=“mysql -s -u root mibasededatos”echo “show tables;” | ${MYSQLCMD} | sed “s/^/DROP TABLE /” | sed “s/$/;/”

·
Jul 22, 2008