From 87fb917a6f575fff36ad1614d754ebc161b62f4b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 31 Dec 2025 15:52:45 +0200 Subject: Update content for gemtext --- about/resources.gmi | 206 ++++---- gemfeed/atom.xml | 1299 +-------------------------------------------------- index.gmi | 2 +- uptime-stats.gmi | 2 +- 4 files changed, 106 insertions(+), 1403 deletions(-) diff --git a/about/resources.gmi b/about/resources.gmi index 085baede..c5c51862 100644 --- a/about/resources.gmi +++ b/about/resources.gmi @@ -35,110 +35,110 @@ You won't find any links on this site because, over time, the links will break. In random order: -* Think Raku (aka Think Perl 6); Laurent Rosenfeld, Allen B. Downey; O'Reilly -* Polished Ruby Programming; Jeremy Evans; Packt Publishing -* Programming Perl aka "The Camel Book"; Tom Christiansen, brian d foy, Larry Wall & Jon Orwant; O'Reilly -* Learn You a Haskell for Great Good!; Miran Lipovaca; No Starch Press -* The Practise of System and Network Administration; Thomas A. Limoncelli, Christina J. Hogan, Strata R. Chalup; Addison-Wesley Professional Pro Git; Scott Chacon, Ben Straub; Apress -* Programming Ruby 3.3 (5th Edition); Noel Rappin, with Dave Thomas; The Pragmatic Bookshelf +* Ultimate Go Notebook; Bill Kennedy * The Go Programming Language; Alan A. A. Donovan; Addison-Wesley Professional -* Learn You Some Erlang for Great Good; Fred Herbert; No Starch Press +* Raku Recipes; J.J. Merelo; Apress +* Modern Perl; Chromatic ; Onyx Neon Press +* Clusterbau mit Linux-HA; Michael Schwartzkopff; O'Reilly +* Kubernetes Cookbook; Sameer Naik, Sébastien Goasguen, Jonathan Michaux; O'Reilly +* Higher Order Perl; Mark Dominus; Morgan Kaufmann * Perl New Features; Joshua McAdams, brian d foy; Perl School -* Terraform Cookbook; Mikael Krief; Packt Publishing -* Pro Puppet; James Turnbull, Jeffrey McCune; Apress -* The Docker Book; James Turnbull; Kindle -* Developing Games in Java; David Brackeen and others...; New Riders +* Systemprogrammierung in Go; Frank Müller; dpunkt +* Learn You a Haskell for Great Good!; Miran Lipovaca; No Starch Press * Distributed Systems: Principles and Paradigms; Andrew S. Tanenbaum; Pearson -* DevOps And Site Reliability Engineering Handbook; Stephen Fleming; Audible -* The Kubernetes Book; Nigel Poulton; Unabridged Audiobook -* Funktionale Programmierung; Peter Pepper; Springer -* The Pragmatic Programmer; David Thomas; Addison-Wesley -* 100 Go Mistakes and How to Avoid Them; Teiva Harsanyi; Manning Publications -* 21st Century C: C Tips from the New School; Ben Klemens; O'Reilly -* Amazon Web Services in Action; Michael Wittig and Andreas Wittig; Manning Publications -* Raku Recipes; J.J. Merelo; Apress -* DNS and BIND; Cricket Liu; O'Reilly +* 97 things every SRE should know; Emil Stolarsky, Jaime Woo; O'Reilly +* Programming Perl aka "The Camel Book"; Tom Christiansen, brian d foy, Larry Wall & Jon Orwant; O'Reilly * Hands-on Infrastructure Monitoring with Prometheus; Joel Bastos, Pedro Araujo; Packt -* Site Reliability Engineering; How Google runs production systems; O'Reilly -* Leanring eBPF; Liz Rice; O'Reilly -* C++ Programming Language; Bjarne Stroustrup; -* Go Brain Teasers - Exercise Your Mind; Miki Tebeka; The Pragmatic Programmers -* Effective awk programming; Arnold Robbins; O'Reilly -* Effective Java; Joshua Bloch; Addison-Wesley Professional -* Raku Fundamentals; Moritz Lenz; Apress -* Ultimate Go Notebook; Bill Kennedy +* Amazon Web Services in Action; Michael Wittig and Andreas Wittig; Manning Publications +* Terraform Cookbook; Mikael Krief; Packt Publishing +* Concurrency in Go; Katherine Cox-Buday; O'Reilly +* 21st Century C: C Tips from the New School; Ben Klemens; O'Reilly +* Think Raku (aka Think Perl 6); Laurent Rosenfeld, Allen B. Downey; O'Reilly +* The DevOps Handbook; Gene Kim, Jez Humble, Patrick Debois, John Willis; Audible * The KCNA (Kubernetes and Cloud Native Associate) Book; Nigel Poulton -* Kubernetes Cookbook; Sameer Naik, Sébastien Goasguen, Jonathan Michaux; O'Reilly -* 97 things every SRE should know; Emil Stolarsky, Jaime Woo; O'Reilly -* Higher Order Perl; Mark Dominus; Morgan Kaufmann -* Modern Perl; Chromatic ; Onyx Neon Press +* Polished Ruby Programming; Jeremy Evans; Packt Publishing +* 100 Go Mistakes and How to Avoid Them; Teiva Harsanyi; Manning Publications +* The Pragmatic Programmer; David Thomas; Addison-Wesley +* Developing Games in Java; David Brackeen and others...; New Riders +* DNS and BIND; Cricket Liu; O'Reilly +* Programming Ruby 3.3 (5th Edition); Noel Rappin, with Dave Thomas; The Pragmatic Bookshelf +* Java ist auch eine Insel; Christian Ullenboom; +* Funktionale Programmierung; Peter Pepper; Springer * Chaos Engineering - System Resiliency in Practice; Casey Rosenthal and Nora Jones; eBook +* The Kubernetes Book; Nigel Poulton; Unabridged Audiobook +* Go Brain Teasers - Exercise Your Mind; Miki Tebeka; The Pragmatic Programmers +* Data Science at the Command Line; Jeroen Janssens; O'Reilly +* Pro Puppet; James Turnbull, Jeffrey McCune; Apress * Object-Oriented Programming with ANSI-C; Axel-Tobias Schreiner * Seeking SRE: Conversations About Running Production Systems at Scale; David N. Blank-Edelman; eBook -* Concurrency in Go; Katherine Cox-Buday; O'Reilly -* Java ist auch eine Insel; Christian Ullenboom; -* Clusterbau mit Linux-HA; Michael Schwartzkopff; O'Reilly +* Leanring eBPF; Liz Rice; O'Reilly +* Effective awk programming; Arnold Robbins; O'Reilly * Tmux 2: Productive Mouse-free Development; Brain P. Hogan; The Pragmatic Programmers -* Systemprogrammierung in Go; Frank Müller; dpunkt -* The DevOps Handbook; Gene Kim, Jez Humble, Patrick Debois, John Willis; Audible -* Data Science at the Command Line; Jeroen Janssens; O'Reilly +* Site Reliability Engineering; How Google runs production systems; O'Reilly +* The Practise of System and Network Administration; Thomas A. Limoncelli, Christina J. Hogan, Strata R. Chalup; Addison-Wesley Professional Pro Git; Scott Chacon, Ben Straub; Apress +* The Docker Book; James Turnbull; Kindle * Systems Performance Tuning; Gian-Paolo D. Musumeci and others...; O'Reilly +* C++ Programming Language; Bjarne Stroustrup; +* Effective Java; Joshua Bloch; Addison-Wesley Professional +* Learn You Some Erlang for Great Good; Fred Herbert; No Starch Press +* DevOps And Site Reliability Engineering Handbook; Stephen Fleming; Audible +* Raku Fundamentals; Moritz Lenz; Apress ## Technical references I didn't read them from the beginning to the end, but I am using them to look up things. The books are in random order: -* Implementing Service Level Objectives; Alex Hidalgo; O'Reilly -* BPF Performance Tools - Linux System and Application Observability, Brendan Gregg; Addison Wesley * The Linux Programming Interface; Michael Kerrisk; No Starch Press * Understanding the Linux Kernel; Daniel P. Bovet, Marco Cesati; O'Reilly +* Implementing Service Level Objectives; Alex Hidalgo; O'Reilly +* Groovy Kurz & Gut; Joerg Staudemeier; O'Reilly +* BPF Performance Tools - Linux System and Application Observability, Brendan Gregg; Addison Wesley * Go: Design Patterns for Real-World Projects; Mat Ryer; Packt -* Algorithms; Robert Sedgewick, Kevin Wayne; Addison Wesley * Relayd and Httpd Mastery; Michael W Lucas -* Groovy Kurz & Gut; Joerg Staudemeier; O'Reilly +* Algorithms; Robert Sedgewick, Kevin Wayne; Addison Wesley ## Self-development and soft-skills books In random order: * Influence without Authority; A. Cohen, D. Bradford; Wiley -* Buddah and Einstein walk into a Bar; Guy Joseph Ale, Claire Bloom; Blackstone Publishing -* The Daily Stoic; Ryan Holiday, Stephen Hanselman; Profile Books -* The Power of Now; Eckhard Tolle; Yellow Kite -* Staff Engineer: Leadership beyond the management track; Will Larson; Audiobook +* Atomic Habits; James Clear; Random House Business +* Digital Minimalism; Cal Newport; Portofolio Penguin +* Slow Productivity; Cal Newport; Penguin Random House +* Stop starting, start finishing; Arne Roock; Lean-Kanban University +* Time Management for System Administrators; Thomas A. Limoncelli; O'Reilly +* The Bullet Journal Method; Ryder Carroll; Fourth Estate +* Eat That Frog!; Brian Tracy; Hodder Paperbacks +* Ultralearning; Scott Young; Thorsons * Solve for Happy; Mo Gawdat (RE-READ 1ST TIME) * The 7 Habits Of Highly Effective People; Stephen R. Covey; Simon & Schuster UK -* The Phoenix Project - A Novel About IT, DevOps, and Helping your Business Win; Gene Kim and Kevin Behr; Trade Select -* Stop starting, start finishing; Arne Roock; Lean-Kanban University -* The Off Switch; Mark Cropley; Virgin Books (RE-READ 1ST TIME) -* 101 Essays that change the way you think; Brianna Wiest; Audiobook -* Digital Minimalism; Cal Newport; Portofolio Penguin -* The Obstacle Is The Way; Ryan Holiday; Profile Books Ltd -* Soft Skills; John Sommez; Manning Publications -* Search Inside Yourself - The Unexpected path to Achieving Success, Happiness (and World Peace); Chade-Meng Tan, Daniel Goleman, Jon Kabat-Zinn; HarperOne -* The Courage to Be Disliked; Ichiro Kishimi and Fumitake Koga; Audiobook -* 97 Things Every Engineering Manager Should Know; Camille Fournier; Audiobook -* The Software Engineer's Guidebook: Navigating senior, tech lead, and staff engineer positions at tech companies and startups; Gergely Orosz; Audiobook -* The Good Enough Job; Simone Stolzoff; Ebury Edge -* Coders at Work - Reflections on the craft of programming, Peter Seibel and Mitchell Dorian et al., Audiobook +* The Daily Stoic; Ryan Holiday, Stephen Hanselman; Profile Books +* The Complete Software Developer's Career Guide; John Sonmez; Unabridged Audiobook +* Never Split the Difference; Chris Voss, Tahl Raz; Random House Business * Meditation for Mortals, Oliver Burkeman, Audiobook -* Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press -* Ultralearning; Scott Young; Thorsons -* Deep Work; Cal Newport; Piatkus * Psycho-Cybernetics; Maxwell Maltz; Perigee Books * Ultralearning; Anna Laurent; Self-published via Amazon -* Never Split the Difference; Chris Voss, Tahl Raz; Random House Business -* Slow Productivity; Cal Newport; Penguin Random House -* The Complete Software Developer's Career Guide; John Sonmez; Unabridged Audiobook -* Eat That Frog!; Brian Tracy; Hodder Paperbacks * The Joy of Missing Out; Christina Crook; New Society Publishers -* Getting Things Done; David Allen -* Eat That Frog; Brian Tracy +* 101 Essays that change the way you think; Brianna Wiest; Audiobook +* The Courage to Be Disliked; Ichiro Kishimi and Fumitake Koga; Audiobook +* The Good Enough Job; Simone Stolzoff; Ebury Edge * So Good They Can't Ignore You; Cal Newport; Business Plus +* The Obstacle Is The Way; Ryan Holiday; Profile Books Ltd +* Buddah and Einstein walk into a Bar; Guy Joseph Ale, Claire Bloom; Blackstone Publishing +* The Power of Now; Eckhard Tolle; Yellow Kite +* The Software Engineer's Guidebook: Navigating senior, tech lead, and staff engineer positions at tech companies and startups; Gergely Orosz; Audiobook +* The Phoenix Project - A Novel About IT, DevOps, and Helping your Business Win; Gene Kim and Kevin Behr; Trade Select +* Eat That Frog; Brian Tracy +* The Off Switch; Mark Cropley; Virgin Books (RE-READ 1ST TIME) +* Consciousness: A Very Short Introduction; Susan Blackmore; Oxford Uiversity Press +* Search Inside Yourself - The Unexpected path to Achieving Success, Happiness (and World Peace); Chade-Meng Tan, Daniel Goleman, Jon Kabat-Zinn; HarperOne +* Deep Work; Cal Newport; Piatkus * Who Moved My Cheese?; Dr. Spencer Johnson; Vermilion -* The Bullet Journal Method; Ryder Carroll; Fourth Estate -* Atomic Habits; James Clear; Random House Business -* Time Management for System Administrators; Thomas A. Limoncelli; O'Reilly +* Staff Engineer: Leadership beyond the management track; Will Larson; Audiobook +* Coders at Work - Reflections on the craft of programming, Peter Seibel and Mitchell Dorian et al., Audiobook +* Soft Skills; John Sommez; Manning Publications +* Getting Things Done; David Allen +* 97 Things Every Engineering Manager Should Know; Camille Fournier; Audiobook => ../notes/index.gmi Here are notes of mine for some of the books @@ -146,30 +146,30 @@ In random order: Some of these were in-person with exams; others were online learning lectures only. In random order: +* The Well-Grounded Rubyist Video Edition; David. A. Black; O'Reilly Online * Red Hat Certified System Administrator; Course + certification (Although I had the option, I decided not to take the next course as it is more effective to self learn what I need) -* Algorithms Video Lectures; Robert Sedgewick; O'Reilly Online * AWS Immersion Day; Amazon; 1-day interactive online training +* Linux Security and Isolation APIs Training; Michael Kerrisk; 3-day on-site training * MySQL Deep Dive Workshop; 2-day on-site training -* Structure and Interpretation of Computer Programs; Harold Abelson and more...; -* F5 Loadbalancers Training; 2-day on-site training; F5, Inc. -* Cloud Operations on AWS - Learn how to configure, deploy, maintain, and troubleshoot your AWS environments; 3-day online live training with labs; Amazon +* Apache Tomcat Best Practises; 3-day on-site training * Ultimate Go Programming; Bill Kennedy; O'Reilly Online -* Linux Security and Isolation APIs Training; Michael Kerrisk; 3-day on-site training -* The Ultimate Kubernetes Bootcamp; School of Devops; O'Reilly Online -* The Well-Grounded Rubyist Video Edition; David. A. Black; O'Reilly Online * Protocol buffers; O'Reilly Online -* Apache Tomcat Best Practises; 3-day on-site training +* Functional programming lecture; Remote University of Hagen * Scripting Vim; Damian Conway; O'Reilly Online +* F5 Loadbalancers Training; 2-day on-site training; F5, Inc. +* Algorithms Video Lectures; Robert Sedgewick; O'Reilly Online +* Cloud Operations on AWS - Learn how to configure, deploy, maintain, and troubleshoot your AWS environments; 3-day online live training with labs; Amazon +* The Ultimate Kubernetes Bootcamp; School of Devops; O'Reilly Online * Developing IaC with Terraform (with Live Lessons); O'Reilly Online -* Functional programming lecture; Remote University of Hagen +* Structure and Interpretation of Computer Programs; Harold Abelson and more...; ## Technical guides These are not whole books, but guides (smaller or larger) which I found very useful. in random order: +* How CPUs work at https://cpu.land * Raku Guide at https://raku.guide * Advanced Bash-Scripting Guide -* How CPUs work at https://cpu.land ## Podcasts @@ -177,58 +177,58 @@ These are not whole books, but guides (smaller or larger) which I found very use In random order: +* Cup o' Go [Golang] * Hidden Brain -* Backend Banter +* The ProdCast (Google SRE Podcast) * Wednesday Wisdom -* Modern Mentor -* Deep Questions with Cal Newport +* Maintainable +* The Pragmatic Engineer Podcast +* Fallthrough [Golang] +* Backend Banter * BSD Now [BSD] -* Cup o' Go [Golang] +* Dev Interrupted * The Changelog Podcast(s) -* The Pragmatic Engineer Podcast -* Maintainable -* Fork Around And Find Out -* The ProdCast (Google SRE Podcast) +* Deep Questions with Cal Newport +* Modern Mentor * Pratical AI -* Dev Interrupted -* Fallthrough [Golang] +* Fork Around And Find Out ### Podcasts I liked I liked them but am not listening to them anymore. The podcasts have either "finished" (no more episodes) or I stopped listening to them due to time constraints or a shift in my interests. * Ship It (predecessor of Fork Around And Find Out) -* Modern Mentor -* CRE: Chaosradio Express [german] +* FLOSS weekly * Go Time (predecessor of fallthrough) * Java Pub House -* FLOSS weekly +* CRE: Chaosradio Express [german] +* Modern Mentor ## Newsletters I like This is a mix of tech and non-tech newsletters I am subscribed to. In random order: -* VK Newsletter -* The Imperfectionist -* Golang Weekly +* Ruby Weekly * The Valuable Dev +* The Imperfectionist * Changelog News -* Ruby Weekly +* Monospace Mentor * Register Spill -* byteSizeGo +* Golang Weekly * Applied Go Weekly Newsletter -* Monospace Mentor -* The Pragmatic Engineer +* VK Newsletter * Andreas Brandhorst Newsletter (Sci-Fi author) +* The Pragmatic Engineer +* byteSizeGo ## Magazines I like(d) This is a mix of tech I like(d). I may not be a current subscriber, but now and then, I buy an issue. In random order: -* freeX (not published anymore) +* Linux User * LWN (online only) * Linux Magazine -* Linux User +* freeX (not published anymore) # Formal education diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index d87a3523..a3f0a08d 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,1308 +1,11 @@ - 2025-12-31T15:49:49+02:00 + 2025-12-31T15:51:17+02:00 foo.zone feed To be in the .zone! gemini://foo.zone/ - - Terminal multiplexing with `tmux` - Z-Shell edition - - gemini://foo.zone/gemfeed/2024-06-23-terminal-multiplexing-with-tmux.gmi - 2024-06-23T22:41:59+03:00 - - Paul Buetow aka snonux - paul@dev.buetow.org - - This is the Z-Shell version. There is also a Fish version: - -
-

Terminal multiplexing with tmux - Z-Shell edition


-
-Published at 2024-06-23T22:41:59+03:00; Last updated 2025-05-02
-
-This is the Z-Shell version. There is also a Fish version:
-
-./2025-05-02-terminal-multiplexing-with-tmux-fish-edition.html
-
-Tmux (Terminal Multiplexer) is a powerful, terminal-based tool that manages multiple terminal sessions within a single window. Here are some of its primary features and functionalities:
-
-
    -
  • Session management
  • -
  • Window and Pane management
  • -
  • Persistent Workspace
  • -
  • Customization
  • -

-https://github.com/tmux/tmux/wiki
-
-
-         _______
-        |.-----.|
-        || Tmux||
-        ||_.-._||
-        `--)-(--`
-       __[=== o]___
-      |:::::::::::|\
-jgs   `-=========-`()
-    mod. by Paul B.
-
-
-

Table of Contents


-
-
-

Before continuing...


-
-Before continuing to read this post, I encourage you to get familiar with Tmux first (unless you already know the basics). You can go through the official getting started guide:
-
-https://github.com/tmux/tmux/wiki/Getting-Started
-
-I can also recommend this book (this is the book I got started with with Tmux):
-
-https://pragprog.com/titles/bhtmux2/tmux-2/
-
-Over the years, I have built a couple of shell helper functions to optimize my workflows. Tmux is extensively integrated into my daily workflows (personal and work). I had colleagues asking me about my Tmux config and helper scripts for Tmux several times. It would be neat to blog about it so that everyone interested in it can make a copy of my configuration and scripts.
-
-The configuration and scripts in this blog post are only the non-work-specific parts. There are more helper scripts, which I only use for work (and aren't really useful outside of work due to the way servers and clusters are structured there).
-
-Tmux is highly configurable, and I think I am only scratching the surface of what is possible with it. Nevertheless, it may still be useful for you. I also love that Tmux is part of the OpenBSD base system!
-
-

Shell aliases


-
-I am a user of the Z-Shell (zsh), but I believe all the snippets mentioned in this blog post also work with Bash.
-
-https://www.zsh.org
-
-For the most common Tmux commands I use, I have created the following shell aliases:
-
- -
alias tm=tmux
-alias tl='tmux list-sessions'
-alias tn=tmux::new
-alias ta=tmux::attach
-alias tx=tmux::remote
-alias ts=tmux::search
-alias tssh=tmux::cluster_ssh
-
-
-Note all tmux::...; those are custom shell functions doing certain things, and they aren't part of the Tmux distribution. But let's run through every aliases one by one.
-
-The first two are pretty straightforward. tm is simply a shorthand for tmux, so I have to type less, and tl lists all Tmux sessions that are currently open. No magic here.
-
-

The tn alias - Creating a new session


-
-The tn alias is referencing this function:
-
- -
# Create new session and if alread exists attach to it
-tmux::new () {
-    readonly session=$1
-    local date=date
-    if where gdate &>/dev/null; then
-        date=gdate
-    fi
-
-    tmux::cleanup_default
-    if [ -z "$session" ]; then
-        tmux::new T$($date +%s)
-    else
-        tmux new-session -d -s $session
-        tmux -2 attach-session -t $session || tmux -2 switch-client -t $session
-    fi
-}
-alias tn=tmux::new
-
-
-There is a lot going on here. Let's have a detailed look at what it is doing. As a note, the function relies on GNU Date, so MacOS is looking for the gdate commands to be available. Otherwise, it will fall back to date. You need to install GNU Date for Mac, as it isn't installed by default there. As I use Fedora Linux on my personal Laptop and a MacBook for work, I have to make it work for both.
-
-First, a Tmux session name can be passed to the function as a first argument. That session name is only optional. Without it, Tmux will select a session named T$($date +%s) as a default. Which is T followed by the UNIX epoch, e.g. T1717133796.
-
-

Cleaning up default sessions automatically


-
-Note also the call to tmux::cleanup_default; it would clean up all already opened default sessions if they aren't attached. Those sessions were only temporary, and I had too many flying around after a while. So, I decided to auto-delete the sessions if they weren't attached. If I want to keep sessions around, I will rename them with the Tmux command prefix-key $. This is the cleanup function:
-
- -
tmux::cleanup_default () {
-    local s
-    tmux list-sessions | grep '^T.*: ' | grep -F -v attached |
-    cut -d: -f1 | while read -r s; do
-        echo "Killing $s"
-        tmux kill-session -t "$s"
-    done
-}
-
-
-The cleanup function kills all open Tmux sessions that haven't been renamed properly yet—but only if they aren't attached (e.g., don't run in the foreground in any terminal). Cleaning them up automatically keeps my Tmux sessions as neat and tidy as possible.
-
-

Renaming sessions


-
-Whenever I am in a temporary session (named T....), I may decide that I want to keep this session around. I have to rename the session to prevent the cleanup function from doing its thing. That's, as mentioned already, easily accomplished with the standard prefix-key $ Tmux command.
-
-

The ta alias - Attaching to a session


-
-This alias refers to the following function, which tries to attach to an already-running Tmux session.
-
- -
tmux::attach () {
-    readonly session=$1
-
-    if [ -z "$session" ]; then
-        tmux attach-session || tmux::new
-    else
-        tmux attach-session -t $session || tmux::new $session
-    fi
-}
-alias ta=tmux::attach
-
-
-If no session is specified (as the argument of the function), it will try to attach to the first open session. If no Tmux server is running, it will create a new one with tmux::new. Otherwise, with a session name given as the argument, it will attach to it. If unsuccessful (e.g., the session doesn't exist), it will be created and attached to.
-
-

The tr alias - For a nested remote session


-
-This SSHs into the remote server specified and then, remotely on the server itself, starts a nested Tmux session. So we have one Tmux session on the local computer and, inside of it, an SSH connection to a remote server with a Tmux session running again. The benefit of this is that, in case my network connection breaks down, the next time I connect, I can continue my work on the remote server exactly where I left off. The session name is the name of the server being SSHed into. If a session like this already exists, it simply attaches to it.
-
- -
tmux::remote () {
-    readonly server=$1
-    tmux new -s $server "ssh -t $server 'tmux attach-session || tmux'" || \
-        tmux attach-session -d -t $server
-}
-alias tr=tmux::remote
-
-
-

Change of the Tmux prefix for better nesting


-
-To make nested Tmux sessions work smoothly, one must change the Tmux prefix key locally or remotely. By default, the Tmux prefix key is Ctrl-b, so Ctrl-b $, for example, renames the current session. To change the prefix key from the standard Ctrl-b to, for example, Ctrl-g, you must add this to the tmux.conf:
-
-
-set-option -g prefix C-g
-
-
-This way, when I want to rename the remote Tmux session, I have to use Ctrl-g $, and when I want to rename the local Tmux session, I still have to use Ctrl-b $. In my case, I have this deployed to all remote servers through a configuration management system (out of scope for this blog post).
-
-There might also be another way around this (without reconfiguring the prefix key), but that is cumbersome to use, as far as I remember.
-
-

The ts alias - Searching sessions with fuzzy finder


-
-Despite the fact that with tmux::cleanup_default, I don't leave a huge mess with trillions of Tmux sessions flying around all the time, at times, it can become challenging to find exactly the session I am currently interested in. After a busy workday, I often end up with around twenty sessions on my laptop. This is where fuzzy searching for session names comes in handy, as I often don't remember the exact session names.
-
- -
tmux::search () {
-    local -r session=$(tmux list-sessions | fzf | cut -d: -f1)
-    if [ -z "$TMUX" ]; then
-        tmux attach-session -t $session
-    else
-        tmux switch -t $session
-    fi
-}
-alias ts=tmux::search
-
-
-All it does is list all currently open sessions in fzf, where one of them can be searched and selected through fuzzy find, and then either switch (if already inside a session) to the other session or attach to the other session (if not yet in Tmux).
-
-You must install the fzf command on your computer for this to work. This is how it looks like:
-
-Tmux session fuzzy finder
-
-

The tssh alias - Cluster SSH replacement


-
-Before I used Tmux, I was a heavy user of ClusterSSH, which allowed me to log in to multiple servers at once in a single terminal window and type and run commands on all of them in parallel.
-
-https://github.com/duncs/clusterssh
-
-However, since I started using Tmux, I retired ClusterSSH, as it came with the benefit that Tmux only needs to be run in the terminal, whereas ClusterSSH spawned terminal windows, which aren't easily portable (e.g., from a Linux desktop to macOS). The tmux::cluster_ssh function can have N arguments, where:
-
-
    -
  • ...the first argument will be the session name (see tmux::tssh_from_argument helper function), and all remaining arguments will be server hostnames/FQDNs to connect to simultaneously.
  • -
  • ...or, the first argument is a file name, and the file contains a list of hostnames/FQDNs (see tmux::ssh_from_file helper function)
  • -

-This is the function definition behind the tssh alias:
-
- -
tmux::cluster_ssh () {
-    if [ -f "$1" ]; then
-        tmux::tssh_from_file $1
-        return
-    fi
-
-    tmux::tssh_from_argument $@
-}
-alias tssh=tmux::cluster_ssh
-
-
-This function is just a wrapper around the more complex tmux::tssh_from_file and tmux::tssh_from_argument functions, as you have learned already. Most of the magic happens there.
-
-

The tmux::tssh_from_argument helper


-
-This is the most magic helper function we will cover in this post. It looks like this:
-
- -
tmux::tssh_from_argument () {
-    local -r session=$1; shift
-    local first_server=$1; shift
-
-    tmux new-session -d -s $session "ssh -t $first_server"
-    if ! tmux list-session | grep "^$session:"; then
-        echo "Could not create session $session"
-        return 2
-    fi
-
-    for server in "${@[@]}"; do
-        tmux split-window -t $session "tmux select-layout tiled; ssh -t $server"
-    done
-
-    tmux setw -t $session synchronize-panes on
-    tmux -2 attach-session -t $session | tmux -2 switch-client -t $session
-}
-
-
-It expects at least two arguments. The first argument is the session name to create for the clustered SSH session. All other arguments are server hostnames or FQDNs to which to connect. The first one is used to make the initial session. All remaining ones are added to that session with tmux split-window -t $session.... At the end, we enable synchronized panes by default, so whenever you type, the commands will be sent to every SSH connection, thus allowing the neat ClusterSSH feature to run commands on multiple servers simultaneously. Once done, we attach (or switch, if already in Tmux) to it.
-
-Sometimes, I don't want the synchronized panes behavior and want to switch it off temporarily. I can do that with prefix-key p and prefix-key P after adding the following to my local tmux.conf:
-
-
-bind-key p setw synchronize-panes off
-bind-key P setw synchronize-panes on
-
-
-

The tmux::tssh_from_file helper


-
-This one sets the session name to the file name and then reads a list of servers from that file, passing the list of servers to tmux::tssh_from_argument as the arguments. So, this is a neat little wrapper that also enables me to open clustered SSH sessions from an input file.
-
- -
tmux::tssh_from_file () {
-    local -r serverlist=$1; shift
-    local -r session=$(basename $serverlist | cut -d. -f1)
-
-    tmux::tssh_from_argument $session $(awk '{ print $1} ' $serverlist | sed 's/.lan./.lan/g')
-}
-
-
-

tssh examples


-
-To open a new session named fish and log in to 4 remote hosts, run this command (Note that it is also possible to specify the remote user):
-
-
-$ tssh fish blowfish.buetow.org fishfinger.buetow.org \
-    fishbone.buetow.org user@octopus.buetow.org
-
-
-To open a new session named manyservers, put many servers (one FQDN per line) into a file called manyservers.txt and simply run:
-
-
-$ tssh manyservers.txt
-
-
-

Common Tmux commands I use in tssh


-
-These are default Tmux commands that I make heavy use of in a tssh session:
-
-
    -
  • Press prefix-key DIRECTION to switch panes. DIRECTION is by default any of the arrow keys, but I also configured Vi keybindings.
  • -
  • Press prefix-key <space> to change the pane layout (can be pressed multiple times to cycle through them).
  • -
  • Press prefix-key z to zoom in and out of the current active pane.
  • -

-

Copy and paste workflow


-
-As you will see later in this blog post, I have configured a history limit of 1 million items in Tmux so that I can scroll back quite far. One main workflow of mine is to search for text in the Tmux history, select and copy it, and then switch to another window or session and paste it there (e.g., into my text editor to do something with it).
-
-This works by pressing prefix-key [ to enter Tmux copy mode. From there, I can browse the Tmux history of the current window using either the arrow keys or vi-like navigation (see vi configuration later in this blog post) and the Pg-Dn and Pg-Up keys.
-
-I often search the history backwards with prefix-key [ followed by a ?, which opens the Tmux history search prompt.
-
-Once I have identified the terminal text to be copied, I enter visual select mode with v, highlight all the text to be copied (using arrow keys or Vi motions), and press y to yank it (sorry if this all sounds a bit complicated, but Vim/NeoVim users will know this, as it is pretty much how you do it there as well).
-
-For v and y to work, the following has to be added to the Tmux configuration file:
-
-
-bind-key -T copy-mode-vi 'v' send -X begin-selection
-bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
-
-
-Once the text is yanked, I switch to another Tmux window or session where, for example, a text editor is running and paste the yanked text from Tmux into the editor with prefix-key ]. Note that when pasting into a modal text editor like Vi or Helix, you would first need to enter insert mode before prefix-key ] would paste anything.
-
-

Tmux configurations


-
-Some features I have configured directly in Tmux don't require an external shell alias to function correctly. Let's walk line by line through my local ~/.config/tmux/tmux.conf:
-
-
-source ~/.config/tmux/tmux.local.conf
-
-set-option -g allow-rename off
-set-option -g history-limit 100000
-set-option -g status-bg '#444444'
-set-option -g status-fg '#ffa500'
-set-option -s escape-time 0
-
-
-There's yet to be much magic happening here. I source a tmux.local.conf, which I sometimes use to override the default configuration that comes from the configuration management system. But it is mostly just an empty file, so it doesn't throw any errors on Tmux startup when I don't use it.
-
-I work with many terminal outputs, which I also like to search within Tmux. So, I added a large enough history-limit, enabling me to search backwards in Tmux for any output up to a million lines of text.
-
-Besides changing some colours (personal taste), I also set escape-time to 0, which is just a workaround. Otherwise, my Helix text editor's ESC key would take ages to trigger within Tmux. I am trying to remember the gory details. You can leave it out; if everything works fine for you, leave it out.
-
-The next lines in the configuration file are:
-
-
-set-window-option -g mode-keys vi
-bind-key -T copy-mode-vi 'v' send -X begin-selection
-bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
-
-
-I navigate within Tmux using Vi keybindings, so the mode-keys is set to vi. I use the Helix modal text editor, which is close enough to Vi bindings for simple navigation to feel "native" to me. (By the way, I have been a long-time Vim and NeoVim user, but I eventually switched to Helix. It's off-topic here, but it may be worth another blog post once.)
-
-The two bind-key commands make it so that I can use v and y in copy mode, which feels more Vi-like (as already discussed earlier in this post).
-
-The next set of lines in the configuration file are:
-
-
-bind-key h select-pane -L
-bind-key j select-pane -D
-bind-key k select-pane -U
-bind-key l select-pane -R
-
-bind-key H resize-pane -L 5
-bind-key J resize-pane -D 5
-bind-key K resize-pane -U 5
-bind-key L resize-pane -R 5
-
-
-These allow me to use prefix-key h, prefix-key j, prefix-key k, and prefix-key l for switching panes and prefix-key H, prefix-key J, prefix-key K, and prefix-key L for resizing the panes. If you don't know Vi/Vim/NeoVim, the letters hjkl are commonly used there for left, down, up, and right, which is also the same for Helix, by the way.
-
-The next set of lines in the configuration file are:
-
-
-bind-key c new-window -c '#{pane_current_path}'
-bind-key F new-window -n "session-switcher" "tmux list-sessions | fzf | cut -d: -f1 | xargs tmux switch-client -t"
-bind-key T choose-tree
-
-
-The first one is that any new window starts in the current directory. The second one is more interesting. I list all open sessions in the fuzzy finder. I rely heavily on this during my daily workflow to switch between various sessions depending on the task. E.g. from a remote cluster SSH session to a local code editor.
-
-The third one, choose-tree, opens a tree view in Tmux listing all sessions and windows. This one is handy to get a better overview of what is currently running in any local Tmux session. It looks like this (it also allows me to press a hotkey to switch to a particular Tmux window):
-
-Tmux sessiont tree view
-
-
-The last remaining lines in my configuration file are:
-
-
-bind-key p setw synchronize-panes off
-bind-key P setw synchronize-panes on
-bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "tmux.conf reloaded"
-
-
-We discussed synchronized panes earlier. I use it all the time in clustered SSH sessions. When enabled, all panes (remote SSH sessions) receive the same keystrokes. This is very useful when you want to run the same commands on many servers at once, such as navigating to a common directory, restarting a couple of services at once, or running tools like htop to quickly monitor system resources.
-
-The last one reloads my Tmux configuration on the fly.
-
-E-Mail your comments to paul@nospam.buetow.org :-)
-
-Back to the main site
-
-
-
- - Projects I currently don't have time for - - gemini://foo.zone/gemfeed/2024-05-03-projects-i-currently-dont-have-time-for.gmi - 2024-05-03T16:23:03+03:00 - - Paul Buetow aka snonux - paul@dev.buetow.org - - Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to 'get rid of them' from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time. - -
-

Projects I currently don't have time for


-
-Published at 2024-05-03T16:23:03+03:00
-
-Over the years, I have collected many ideas for my personal projects and noted them down. I am currently in the process of cleaning up all my notes and reviewing those ideas. I don’t have time for the ones listed here and won’t have any soon due to other commitments and personal projects. So, in order to "get rid of them" from my notes folder, I decided to simply put them in this blog post so that those ideas don't get lost. Maybe I will pick up one or another idea someday in the future, but for now, they are all put on ice in favor of other personal projects or family time.
-
-
-Art by Laura Brown
-
-.'`~~~~~~~~~~~`'.
-(  .'11 12 1'.  )
-|  :10 \    2:  |
-|  :9   @-> 3:  |
-|  :8       4;  |
-'. '..7 6 5..' .'
- ~-------------~  ldb
-
-
-
-

Table of Contents


-
-
-

Hardware projects I don't have time for


-
-

I use Arch, btw!


-
-The idea was to build the ultimate Arch Linux setup on an old ThinkPad X200 booting with the open-source LibreBoot firmware, complete with a tiling window manager, dmenu, and all the elite tools. This is mainly for fun, as I am pretty happy (and productive) with my Fedora Linux setup. I ran EndeavourOS (close enough to Arch) on an old ThinkPad for a while, but then I switched back to Fedora because the rolling releases were annoying (there were too many updates).
-
-

OpenBSD home router


-
-In my student days, I operated a 486DX PC with OpenBSD as my home DSL internet router. I bought the setup from my brother back then. The router's hostname was fishbone, and it performed very well until it became too slow for larger broadband bandwidth after a few years of use.
-
-I had the idea to revive this concept, implement fishbone2, and place it in front of my proprietary ISP router to add an extra layer of security and control in my home LAN. It would serve as the default gateway for all of my devices, including a Wi-Fi access point, would run a DNS server, Pi-hole proxy, VPN client, and DynDNS client. I would also implement high availability using OpenBSD's CARP protocol.
-
-https://openbsdrouterguide.net
-https://pi-hole.net/
-https://www.OpenBSD.org
-https://www.OpenBSD.org/faq/pf/carp.html
-
-However, I am putting this on hold as I have opted for an OpenWRT-based solution, which was much quicker to set up and runs well enough.
-
-https://OpenWRT.org/
-
-

Pi-Hole server


-
-Install Pi-hole on one of my Pis or run it in a container on Freekat. For now, I am putting this on hold as the primary use for this would be ad-blocking, and I am avoiding surfing ad-heavy sites anyway. So there's no significant use for me personally at the moment.
-
-https://pi-hole.net/
-
-

Infodash


-
-The idea was to implement my smart info screen using purely open-source software. It would display information such as the health status of my personal infrastructure, my current work tracker balance (I track how much I work to prevent overworking), and my sports balance (I track my workouts to stay within my quotas for general health). The information would be displayed on a small screen in my home office, on my Pine watch, or remotely from any terminal window.
-
-I don't have this, and I haven't missed having it, so I guess it would have been nice to have it but not provide any value other than the "fun of tinkering."
-
-

Reading station


-
-I wanted to create the most comfortable setup possible for reading digital notes, articles, and books. This would include a comfy armchair, a silent barebone PC or Raspberry Pi computer running either Linux or *BSD, and an e-Ink display mounted on a flexible arm/stand. There would also be a small table for my paper journal for occasional note-taking. There are a bunch of open-source software available for PDF and ePub reading. It would have been neat, but I am currently using the most straightforward solution: a Kobo Elipsa 2E, which I can use on my sofa.
-
-

Retro station


-
-I had an idea to build a computer infused with retro elements. It wouldn't use actual retro hardware but would look and feel like a retro machine. I would call this machine HAL or Retron.
-
-I would use an old ThinkPad laptop placed on a horizontal stand, running NetBSD, and attaching a keyboard from ModelFkeyboards. I use WindowMaker as a window manager and run terminal applications through Retro Term. For the monitor, I would use an older (black) EIZO model with large bezels.
-
-https://www.NetBSD.org
-https://www.modelfkeyboards.com
-https://github.com/Swordfish90/cool-retro-term)
-
-The computer would occasionally be used to surf the Gemini space, take notes, blog, or do light coding. However, I have abandoned the project for now because there isn't enough space in my apartment, as my daughter will have a room for herself.
-
-

Sound server


-
-My idea involved using a barebone mini PC running FreeBSD with the Navidrome sound server software. I could remotely connect to it from my phone, workstation/laptop to listen to my music collection. The storage would be based on ZFS with at least two drives for redundancy. The app would run in a Linux Docker container under FreeBSD via Bhyve.
-
-https://github.com/navidrome/navidrome
-https://wiki.freebsd.org/bhyve
-
-

Project Freekat


-
-My idea involved purchasing the Meerkat mini PC from System76 and installing FreeBSD. Like the sound-server idea (see previous idea), it would run Linux Docker through Bhyve. I would self-host a bunch of applications on it:
-
-
    -
  • Wallabag
  • -
  • Ankidroid
  • -
  • Miniflux & Postgres
  • -
  • Audiobookshelf
  • -
  • ...
  • -

-All of this would be within my LAN, but the services would also be accessible from the internet through either Wireguard or SSH reverse tunnels to one of my OpenBSD VMs, for example:
-
-
    -
  • wallabag.awesome.buetow.org
  • -
  • ankidroid.awesome.buetow.org
  • -
  • miniflux.awesome.buetow.org
  • -
  • audiobookshelf.awesome.buetow.org
  • -
  • ...
  • -

-I am abandoning this project for now, as I am currently hosting my apps on AWS ECS Fargate under *.cool.buetow.org, which is "good enough" for the time being and also offers the benefit of learning to use AWS and Terraform, knowledge that can be applied at work.
-
-My personal AWS setup
-
-

Programming projects I don't have time for


-
-

CLI-HIVE


-
-This was a pet project idea that my brother and I had. The concept was to collect all shell history of all servers at work in a central place, apply ML/AI, and return suggestions for commands to type or allow a fuzzy search on all the commands in the history. The recommendations for the commands on a server could be context-based (e.g., past occurrences on the same server type).
-
-You could decide whether to share your command history with others so they would receive better suggestions depending on which server they are on, or you could keep all the history private and secure. The plan was to add hooks into zsh and bash shells so that all commands typed would be pushed to the central location for data mining.
-
-

Enhanced KISS home photo albums


-
-I don't use third-party cloud providers such as Google Photos to store/archive my photos. Instead, they are all on a ZFS volume on my home NAS, with regular offsite backups taken. Thus, my project would involve implementing the features I miss most or finding a solution simple enough to host on my LAN:
-
-
    -
  • A feature I miss presents me with a random day from the past and some photos from that day. This project would randomly select a day and generate a photo album for me to view and reminisce about memories.
  • -
  • Another feature I miss is the ability to automatically deduplicate all the photos, as I am sure there are tons of duplicates on my NAS.
  • -
  • Auto-enhancing the photos (perhaps using ImageMagick?)
  • -
  • I already have a simple photoalbum.sh script that generates a