Tech, compressed

Small tutorials on various tech-related things.

See wiki.kasad.com (archived) for information/documentation about kasad.com and its services.

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

SRVUSD-BYOD Network Credentials

If you’re simply looking for a tutorial on how to connect your device to the network securely, go to the Tutorials section. Why this article? Android recently got an update which prevents you from connecting insecurely to WPA Enterprise networks. The IT staff for SRVUSD firmly insisted that it is now simply impossible to connect an Android phone to the SRVUSD-BYOD network. I didn’t believe them, so I brought my laptop to school, used Wireshark to dump the WPA handshake, and found the certificate information that is needed to connect securely....

August 31, 2021 · 5 min · Kian Kasad

Trick to shift lines in Vim

It’s easy to select lines in visual mode, delete them, then paste them a few lines lower. However, this won’t adjust the indentation to match surrounding code. Instead, add the following to your vimrc (or init.vim): 1 2 3 " Move visual selection vnoremap K :m '<-2<cr>gv=gv vnoremap J :m '>+1<cr>gv=gv Then select lines using visual mode (v or V) and press J or K to shift them down or up one line, respectively....

May 21, 2021 · 1 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