TIL: How to Fix ”Cannot Read Termcap Database” With Tmux and Kitty on MacOs

The Problem I use the Kitty terminal emulator with Tmux as my main tool for working with code. My Tmux settings (~/.tmux.conf) contain the following lines to enable true-color-support: # true colors set -g terminal-overrides ',xterm-256color:Tc' set -g default-terminal "tmux-256color" set -as terminal-overrides ',xterm*:sitm=\E[3m' When I open tmux on MacOs I get the following error message: Cannot read termcap database; using dumb terminal settings. The Solution Solution as a GitHub Gist:
Read more →

TIL: How to Remove Headers From ps Command on MacOs

Today I’ve started to setup my MacBook Pro for work. It’s my first Mac and I’m not amused. If you only know Linux, there are some pitfalls. My .bashrc script contains the following lines: # # ~/.bashrc # # Fish if [[ $(ps --no-header --pid=$PPID --format=cmd) != "fish" ]] then exec fish fi I use bash as my login shell, but fish as my main interactive shell. Fish is not POSIX-compliant which can lead to problems.
Read more →

How I Remove Duplicate Lines From a File With awk

One of the repositories I maintain is a beginner’s GitHub repo. New developers can make their first pull request by adding their GitHub handle to a simple text file. When pull requests get merged into the master branch, they often contain duplicates. The file has more than 7,000 lines. Names are not sorted alphabetically. I needed a simple way to remove all duplicates lines from the file without sorting the lines.
Read more →

TIL: Pass Multiple Commands to Xargs

I’m using fd, an alternative to the Unix native find, to find a list of files and copy them to a different location, using xargs. On Unix, we use cp to copy the files, but the command is silent. I don’t know which files cp will copy. Maybe I could use echo to log the files? How can I pass multiple shell commands to xargs? Previous command: fd --changed-within 1hour -0 | xargs -I cp {} /new/location/ fd -0 --changed-within: find all files changed within a time frame, separate results by null character |: pipe previous command as stdin to the next command xargs -I cp {} /new/location/: takes the input from previous command (fd) and uses cp to copy the files; {} is a placeholder What does not work:
Read more →

TIL: How to Set Multiple GOPATHs

How to set multiple workspaces (GOPATH) A Go Workspace is how Go manages our source files, compiled binaries, and cached objects used for faster compilation later. It is typical, and also advised, to have only one Go Workspace, though it is possible to have multiple spaces. The GOPATH acts as the root folder of a workspace. 1 Why multiple workspaces? I’d like to install my global binaries into a central location.
Read more →

TIL: How to Create Full Text RSS Feed for Hugo

Who wants to read an incomplete RSS feed that forces you to open the original website? Hugo is the static site generator that powers my blog. Hugo ships with a default RSS template which only shows a summary of your articles. If you want to read the full content, you’ll need to visit the website. That sucks. I want to create a full-text RSS feed for my blog. Template Lookup Order We’ll need to create a modified RSS template.
Read more →

Receive Webhooks via ifttt

ifttt is a no-code/low-code tool for automation. You can chain trigger events (“if someone tweets a new tweet with the hash-tag coding”) to commands (“then send me an email”). My goal was to receive a webhook event, so that I can send an email. I create my newsletter via buttondown.email. I have a script that creates a new newsletter draft from my blog posts via GitHub actions. Everything happens automatically.
Read more →

TIL: GitHub Actions on cron Job Might Be Late

Today I learned that scheduled GitHub Actions might be late or not run at all. 😠 I’ve written a script which fetches my blog posts every week on Monday and creates a draft with my newsletter provider. The script uses a cron job. I assumed that the cron job will run at the specified time. Unfortunately, that’s not the case as per this post in the GitHub support forums: Many times, there is a delay when triggering the scheduled workflow.
Read more →

Quick Tip: Unicode Characters in Kitty Terminal

Read more →

Use Jetbrains Mono in VS Code (or: Can You Adjust Line Spacing?)

VS Code is the default editor/IDE at my future day job. Today I wanted to switch the default font to the free JetBrains Mono font. The font is easy to read and it also comes with font ligatures, a feature that I love for programming. How To Use JetBrains Mono As Your Font With Recommended Settings Download the Font Find the installation instructions on the official website. For Arch Linux:
Read more →

Sign up for the newletter!

powered by Buttondown