Software Engineering
Software design, development practices, architecture, and tooling
Useful Bash Parameter Expansion Patterns
Reference for the high-value forms of {{Bash parameter expansion}}: default values, length, prefix/suffix stripping (greedy and non-greedy), pattern substitution, substring slicing, and case modification. The ${var...} syntax that nobody remembers cold but everyone Googles.
Unix File Permissions Decoded
Unix permissions pack into 12 bits: nine for owner/group/other rwx plus three for setuid, setgid, and the sticky bit, displayed as four octal digits. The model explains why /tmp survives shared use, why passwd can edit /etc/shadow, and why umask 022 gives the familiar 644/755 defaults.
Setuid
Setuid is a Unix permission bit (octal 4000) that makes an executable run with the file owner's effective UID rather than the caller's. It powers passwd, sudo, and ping, and is a perennial privilege-escalation surface.
umask
umask is a per-process mask on Unix that clears permission bits from newly created files and directories. The common 022 value yields 644 files and 755 directories; tighter sites use 027 or 077.
ANSI Escape Sequences: Terminal Colors and Cursor Control
ANSI escape sequences are in-band control codes — standardized by ECMA-48 in 1976 — that terminals interpret to set colors, move the cursor, and clear the screen. The Control Sequence Introducer (CSI = ESC [, bytes 0x1B 0x5B) starts most commands. SGR sequences ending in 'm' control colors: 3/4-bit (16 base), 8-bit (256 palette), and 24-bit truecolor (ESC [38;2;R;G;Bm). Windows ignored them until version 1511 in 2016. Writing escapes to a non-tty stream corrupts log files, so well-behaved tools check isatty() first.
ECMA-48
ECMA-48 is the 1976 European standard 'Control Functions for Coded Character Sets' that defines the escape sequences terminals interpret for cursor movement, screen erasure, and colors. Aligned with ANSI X3.64 (1979) and ISO/IEC 6429 (1983), it specifies the Control Sequence Introducer (ESC [ or 0x9B) plus the parameter grammar — most famously SGR for colors and attributes. The 5th edition (1991) is the current revision and remains the canonical reference for terminal emulator authors.
Sticky Bit
The sticky bit (octal 1000) once asked the kernel to keep an executable's text in swap. Its surviving use is on directories like /tmp: it restricts deletion of files inside to each file's owner, making world-writable scratch space safe.
POSIX ACL
POSIX ACLs extend Unix's owner/group/other model with per-user and per-group entries stored as extended attributes. Managed with setfacl and getfacl, they are supported by ext4, XFS, Btrfs, and others, and shown by a trailing + in ls -l.
Bash (Shell)
GNU Bourne-Again SHell, first released June 8, 1989 by {{Brian Fox}} for the {{GNU Project}} as a free-software replacement for the {{Bourne shell}}; the default login shell on most Linux distributions and, historically, on macOS, maintained since 1990 by {{Chet Ramey}}.
Vixie Cron
The reference implementation of {{Unix cron}} written by Paul Vixie in 1987 and the basis of nearly every modern Linux and BSD cron daemon.
Brooks's Law
Software project management aphorism coined by Fred Brooks in The Mythical Man-Month (1975): adding manpower to a late software project makes it later. Captures the diseconomies of scale in coordinating large engineering teams.
Regex Greedy vs Lazy Quantifiers
By default, regex repetition operators (*, +, ?, {n,m}) are greedy: they consume as much input as possible and then backtrack only if the rest of the pattern fails. Lazy variants written with a trailing ? (*?, +?, ??, {n,m}?) do the opposite, matching the minimum and expanding outward. Possessive quantifiers (*+, ++, ?+) refuse to backtrack at all, which prevents the pathological case known as catastrophic backtracking.
POSIX Shell
Standardized command-language subset defined by {{IEEE 1003.1}} (POSIX.1, formerly POSIX.2) that specifies a portable shell and utilities derived from the {{Bourne shell}}; modern shells like {{dash}}, {{ash}}, and the /bin/sh persona of {{Bash (Shell)}} aim to implement it.
RE2 (Regex Engine)
Google's open-source regular expression library, designed to guarantee linear-time matching with no backtracking. Built on deterministic finite automata derived from Ken Thompson's grep, it is the engine behind Go's regexp package and Cloudflare's WAF.
Cron Expressions and Common Pitfalls
Cron expressions schedule recurring jobs using compact space-separated fields, but their syntax has dialect splits and a notorious day-of-month / day-of-week OR-quirk that has caused outages for decades.
Anacron
A companion to cron that runs periodic jobs on machines which are not guaranteed to be powered on at scheduled times, catching up missed daily, weekly, and monthly tasks after boot.
terminfo
terminfo is a Unix database of terminal capabilities — what ANSI escape sequences each terminal type accepts for clearing, cursor moves, colors, and so on. Created by Mary Ann Horton at Bell Labs in 1981–1982 as a replacement for BSD termcap, it ships compiled per-terminal entries (via the tic compiler) selected by the TERM environment variable. terminfo underpins ncurses and the curses libraries on essentially every modern Unix.
ncurses
ncurses (new curses) is the dominant free-software library for building terminal user interfaces. It abstracts ANSI escape sequence differences across terminals by consulting the terminfo database and rendering an in-memory screen model with differential updates. Started by Zeyd Ben-Halim in 1991 from Pavel Curtis's pcurses, first released as 1.8.1 in November 1993, and maintained for decades by Thomas E. Dickey. Powers vim, htop, mutt, less, and Linux's menuconfig.
Catastrophic Backtracking
A performance failure mode of backtracking regex engines in which nested or overlapping quantifiers cause matching time to grow exponentially with input length. The basis of the ReDoS class of denial-of-service attacks, and the cause of Cloudflare's July 2019 global outage.
The GNU General Public License (GPL): How Copyleft Works
The GPL (GNU General Public License) is a copyleft software license that uses copyright law to ensure derivative works remain open source. Any software incorporating GPL-licensed code must also be released under the GPL when distributed — the 'viral' requirement. This mechanism ensures that corporate users who modify GPL software must share their changes with the community. The trigger is distribution: internal use without distribution does not require source release.
Quartz Scheduler
An open-source job-scheduling library for the JVM whose extended cron grammar with seconds, year, and AND-semantics for day fields is widely copied by other schedulers.
Atomic Group (Regex)
A non-capturing regex group, written (?>...), that discards its backtracking state once a match succeeds. Used to prevent catastrophic backtracking and to express possessive matching in engines that lack the dedicated *+ syntax.
AI Clean Room Engineering: Automated License Stripping and the Threat to Copyleft Open Source
A service called Malice offers 'clean room as a service' — one AI reads GPL-licensed code and generates a specification, a second AI implements from the spec alone, producing functionally identical code with no license obligations. Legally defensible under Baker v. Selden (1879) and the Phoenix Technologies IBM BIOS precedent (1984). Whether protest stunt or business, it exposes a real vulnerability: AI makes copyleft license enforcement effectively impossible.
Pre-commit Code Review Checklist for AI-Assisted Elixir/Phoenix Projects
Pre-commit checklist for AI-assisted Elixir projects: verify docs, check for hardcoded values and debug code, validate security (no secrets, parameterized queries), ensure tests pass, and follow existing patterns.