Profiling ZSH: How I made my shell start 90% faster

Over the years, my .zshrc has grown to include many tricks & tools I rely on daily. But it also meant that my shell took a fair amount of time to start up, around 1 second: 1 2 3 $ time zsh -i -c exit ... zsh -i -c exit 0.31s user 0.14s system 47% cpu 0.949 total One second may not sound like a lot, but it meant that every time I opened a new terminal tab, my shell prompt wouldn’t show up until after I started typing....

July 18, 2024 · 9 min · Kian Kasad

Start Docker containers on-demand with systemd socket activation

If you have a Docker container which is running all the time but is used infrequently, it may be a good idea to start the container only when a connection is received. This is particularly useful for resource-intensive servers. In my case, I use this for a Minecraft server, which can take several gigabytes of memory even when idle, so I want to keep it running as little as possible....

June 17, 2024 · 7 min · Kian Kasad

Ignoring Files - Intro to Git part 6

Sometimes you don’t want git to track files in a repository. Maybe you’re working on a Java project and you want Git to silently ignore all files ending in .class. Or maybe it’s a C program and you want Git to ignore *.o. Either way, there are two ways to accomplish this. The gitignore file Git has a few special files that you can use to affect how Git operates. One of these is the ....

February 8, 2021 · 3 min · Kian Kasad

Checking Out - Intro to Git part 5

In the previous tutorial, the checkout subcommand was used to switch betweeen branches, but there’s a lot more that it can do. “Checking out” is how you switch between different points of the repository’s history. You can checkout branches, tags, and commits. Tags Tags are just named pointers to commits (with optional extra data). They’re usually used for marking versions of software, which makes it really easy to jump between versions in a git repository....

December 1, 2020 · 3 min · Kian Kasad

Branching and Merging - Intro to Git part 4

If you’ve followed along with the previous tutorials, you now know how to work with commits, stage files, view the commit log, and maybe a few other things. Now it’s time to use one of git’s most useful features: branching. What is a branch? In reality, a branch is just a named pointer to a commit. But for most purposes, thinking of a branch like a branch of a tree is fine....

August 28, 2020 · 3 min · Kian Kasad