Debugging Kubernetes

23 Jul 2024

Helpful tips for debugging applications running in k8s

build/k8s.png

Handling multiple errors in Rust iterator adapters

17 Dec 2023

Approaches for handling multiple errors within iterator adapters

build/rust.png

Better FastAPI Background Jobs

29 Aug 2022

A more featureful background task runner for Async apps like FastAPI or Discord bots

build/fastapi_logo.png

Useful Linux Examples

21 Dec 2021

A plethora of helpful tips for working in Linux

build/bash_logo.png
Continue to all blog posts

Even More Useful Linux Examples

Continuing my series on “Useful-Linux-Examples”, yet another eclectic collection of useful things in Linux

Run commands for every line in a file (with parallelism)

Example running du -s for each line

parallel -a list-of-file-paths.txt -k du -s {}

Important flags:

  • -a reading from the file, line by line
  • -k preserves order

Monitor the progress of a file lines being generated

watch wc -l my-updating-file.txt

Important flags:

  • -n interval in seconds
  • -d highlight difference

Git

A safer version of git push -f / git push --force

git push --force-with-lease

Add a template repo as a remote to continue to pull updates with their commit messages

git remote add template [template repo]
git fetch --all
git merge template/[branch name] --allow-unrelated-histories

Alternatively, if the template repo is a cookiecutter repo, the following might be better

Get new updates from cookiecutter repo

Check out cruft

Even if the repo was originally started from vanilla cookiecutter, cruft can take over with just the commit of the template repo

Useful packages / commands

  • copier: Alternative updatable template repo tool
  • just: Makefile replacement for project commands