Posts
Python Basics: Keeping Non-owning References with weakref
Putting an object in an ordinary dictionary keeps a strong reference to it. Sometimes a registry should find an object only while some other part of the program still owns it. The …
October 21, 2026
Python Basics: Generating Tokens with secrets
A simulation can use a repeatable random sequence. An access token should not be predictable from a demonstration seed. Python’s secrets module draws on operating-system randomness …
October 21, 2026
Python Basics: Choosing Implementations with singledispatch
A formatting function may need one implementation for text and another for numbers. functools.singledispatch provides a shared function name with implementations registered for …
October 21, 2026
Python Basics: Checking Message Tags with hmac
A checksum detects a change only when you already trust the expected checksum. A message authentication code adds a shared secret key. Python’s hmac module lets two parties holding …
October 21, 2026
Python Basics: Capturing and Filtering warnings
A function may still work while using an option that callers should replace. A warning communicates that condition without necessarily stopping execution. Python’s warnings module …
October 21, 2026
Linux Basics: Generate Small Lists with Bash Brace Expansion
Typing several related names is easier when their shared parts appear only once. Bash brace expansion generates short lists of text, including combinations and numeric sequences. …
October 21, 2026
Linux Basics: Extract Fields with Bash Regex Captures
A shell script sometimes needs just one field from a small, predictable string. Bash can match a regular expression and keep its captured groups without starting a separate …
October 21, 2026
Linux Basics: Diagnose Bash Pipeline Failures
A pipeline can finish successfully even when an earlier stage failed. Bash offers two complementary tools: pipefail changes the pipeline’s overall status, and PIPESTATUS identifies …
October 21, 2026
Linux Basics: Control Bash Filename Matching
Filename patterns can miss hidden files, leave an unmatched pattern unchanged, or stop at the first directory level. Bash has options for each situation. Practice including …
October 21, 2026
Linux Basics: Check Background Tasks with Bash wait
Starting a command in the background only tells you that it was launched. To learn whether its work succeeded, keep its process ID and wait for its completion. Bash’s wait builtin …
October 21, 2026