A Case for Snakes

TL;DR The Problem If you work on the command line, chances are you hate filenames with spaces in them; don’t even get me started on awkward punctuation and inconsistent capitalization! A file like: My Important Document - Final Version (2).pdf ... means I’m either going to have to quote it: vi 'My Important Document - Final Version (2).pdf' ... or, even more horribly, escape it: vi My\ Important\ Document\ \-\ Final\ Version\ \(2\).pdf If you are writing a Bash script, then you have to think about…​ Word splitting because you forgot to quote $file, which can unintentionally split a filename into multiple arguments. Unexpected globbing can lead you astray because *, ?, and […​] mean something very different to the shell than they do to the user writing them in a filename. Did you know that Unix thinks newlines are perfectly acceptable in a filename, even though I can’t think of one single use case in which you would want this!?! All these and more make your scripts increasingly likely to fall over unexpectedly, and this could all be avoided if filenames were just house-trained better. Given this typographical hellscape, who are the villains committing these sins of syntax? Well, it isn’t me! this_is_my_file_csw_v1.adoc is about as adventurous as I get. It’s You’re unsubscribed..eml when I copy a file from an email to my file system so I can actually refer to it again when I need it, or it’s some file I’ve downloaded (Old Paper Texture.jpg) or an application has generated — Bogos Data/WORD TEMPLATES/Basic Report Template.doc. I feel like the Kyle Reese of the command line, dodging overly verbose Terminators in a typographical wasteland. Now, I say this knowing that I should write my bash scripts to take all of these things into consideration because decrying what I consider to be poor filename etiquette doesn’t mean that I’m not going to still encounter it. I think it’s more that when I see it, I have to do something about it. ...

October 28, 2026 · 5 min · Charles Webster

Bash Operator Cheatsheet

This cheat sheet covers Bash operators including file tests, string comparisons, logical operations, and arithmetic evaluations. 1. File Test Operators File test operators check the status of files. Operator Description Example -e File exists (any type) [[ -e file.txt ]] -f File exists and is a regular file [[ -f script.sh ]] -d File exists and is a directory [[ -d myfolder ]] -r File is readable [[ -r data.txt ]] -w File is writable [[ -w output.log ]] -x File is executable [[ -x script.sh ]] -s File exists and is not empty [[ -s nonempty.txt ]] -L File is a symbolic link [[ -L shortcut ]] -b File is a block device [[ -b /dev/sda1 ]] -c File is a character device [[ -c /dev/ttyS0 ]] -p File is a named pipe (FIFO) [[ -p pipefile ]] -S File is a socket [[ -S /var/run/docker.sock ]] ...

March 26, 2025 · 4 min · Charles Webster

Diagnosing SMB Latency

1. Diagnosing the Problem Check Network Speed Use iperf3 to measure network throughput between the two Macs. # On Mac B (SMB Server) iperf3 -s # On Mac A (Client) iperf3 -c <Mac B's IP> If the speed is close to 1Gbps, the network is performing as expected. If it’s significantly lower (e.g., below 500 Mbps), there may be a bottleneck in the network hardware or cabling. Check Latency with ping Use ping to measure round-trip time between Mac A and Mac B. ping -c 10 <Mac B's IP> A response time below 1ms is expected. If latency is higher, check for network congestion or interference. Test File Transfer Speed Copy a large file using rsync to measure SMB performance. rsync --progress /Volumes/SharedDrive/testfile.bin ~/Desktop/ A well-performing SMB connection on a 1Gb network should achieve speeds close to 110 MB/s. ...

March 26, 2025 · 3 min · Charles Webster

Building a Gigabyte Brix SUSE Distro

Download the latest copy of SUSE tumbleweed Burn this ISO image to thumb drive dd if=<location_of_iso> of=/dev/rdisk<thumbdrive_disk_number> bs=1m Put this in the front USB slot of the Brix Power off and power on (a hard reboot is important) Press the delete key repeatedly to get to Brix BIOS Change boot order in boot section to specify USB drive as 1st boot Save and Exit (reboot on thumb drive) Run installer ...

July 9, 2024 · 2 min · Charles Webster