I Started My New Job (And Have MacOS Woes)

Today I started my first job in tech. While I’m pretty excited, it’s a big step. I have to learn new workflows and tools (Jira) and become familiar with a new code-base (Angular nx workspace). Plus, I now have a Mac for work. I underestimated the differences between my Linux box and MacOs. As terminal user with lots of scripts and shell modifications, I heavily rely on my dotfiles. I came to the realization that my files are not as portable as I’ve thought.
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 →

How to Install Docker Compose v2 on Linux (2021)

In the video Docker Compose v2: What’s New in 2021: DevOps and Docker Live Show (Ep 126) Bret Fisher introduces compose v2. compose is an instrument for running multiple docker containers on your local machine. I use it often to spin up a database container and a separate application container. compose v2, a plugin for docker, is written from the ground up in Go and integrates better with existing tools.
Read more →

The Terminal Sparks Joy

The Terminal Sparks Joy
Today I realized that using tools like the terminal, Vim or Tmux “spark joy” for me. The term comes from Marie Kondo’s bestselling book about tidying up. It loosely translates from original Japanese to ”the feeling of excitement and pleasure”. I thoroughly enjoy using Unix and its tools. For me, it’s like a mini game where I can always learn something new and feel more productive. For example, you can be productive with Vim after a few days.
Read more →

Fake Webcam Background for Arch Linux With Docker (Using akvcam)

Fake Webcam Background for Arch Linux With Docker (Using akvcam)
Note: Updated to work with latest release (2021-06-23). Fake virtual backgrounds for your online meeting on Linux I’ve been attending a lot of video conference calls lately — like so many of us. Others had nice-looking virtual backgrounds. But there was no option to create those backgrounds on my Linux machine. For example, the Zoom version for Linux only allows me to “touch up my appearance”. But there is no option to set a virtual background.
Read more →

TIL: How to Watch YouTube Videos With mpv and Keyboard Shortcuts

Distraction-free YouTube (and other videos) on your computer The free YouTube version has ads and suggestions what to watch. Those try to keep the user on YouTube’s website. Tons of useful videos exist. If you’re like me, you’ll soon fall into the rabbit hole and spend too much time on YouTube. Today I learned how to use a distraction-free method of watching YouTube with mpv and (optionally) Vimium.
Read more →

How to Restart Systemd (Strongswan VPN) Service After Suspend

I’m running a VPN service via systemd on my machine. The service provides a systemd script for me. I can query the service with the standard commands, for example: sudo systemctl status strongswan.service This works fine, except when the computer went to sleep (suspend or hibernate). My machine also stops the wi-fi connection on sleep. When I wake up the machine, the wi-fi connection automatically starts again. My VPN service does not resume.
Read more →

Sign up for the newletter!

powered by Buttondown