Systemd

How to create a Systemd daemon quickly?

If you have a script or a binary and want to run it as a Systemd service, keep following. This blog will show you how to take any such executable code and run it using Systemd. Sure, you can do similar stuff using Docker as well. Although there are certain downsides of using Docker (alone) for managing the daemons. Systemd is good at log management on the node over a Docker container. If a container fails, you may or may not have access to the logs. Systemd provides constructs in managing dependencies quite well. And finally, you may not be using Docker on the machine, while Systemd is quite ubiquitous on any Linux. ...

June 19, 2021 Â· 2 min Â· Suraj Deshmukh
Node Exporter

Monitor your PC with Prometheus Grafana stack

How do you monitor your own computer? Of course, using Prometheus, node-exporter and Grafana. You might ask why would you wanna do that when you can simply use the operating system provided, “System Monitor”. Well, yes, you can use that. But the data you get from the OS System Monitor is coarse-grained. OS system monitor is not configurable, but this stack is. It is like running htop but where you can go back in history, unlike htop, which only shows the current state. Using this stack of Prometheus, node-exporter, and Grafana is a proactive approach than being reactive to the problems that occur on a PC. Instead of digging later to figure out what went wrong, you are already collecting metrics so you can see on dashboards what went wrong. ...

April 2, 2021 Â· 2 min Â· Suraj Deshmukh

Linux Partitioning Guide

I use Fedora Linux as my primary desktop OS. Every time there is a fresh install, I find myself confounded on how to partition the OS. So I thought I might as well make a permanent note of how I do it so that I always have a place to come back to. Partitioning Scheme This is how I partition my Fedora during installation: Partition Mounted On Size Encrypted Filesystem Boot /boot 512M No ext4 Boot EFI /boot/efi 200M No vfat Swap - 1.5 times the RAM Yes swap Home /home 265G Yes ext4 Root / 211G No ext4 Encryption Note that Swap and Home partitions have to be encrypted. Swap extends the RAM and can have a sensitive copy of RAM data like passwords, keys, etc. Hence always ensure to encrypt the Swap partition. Home partition is equally essential to be encrypted because this is where your data will live. Things like configuration, SSH keys, GPG keys, API keys are all stored in the home in various directories. So it is of utmost importance that you encrypt these two directories. ...

January 11, 2021 Â· 2 min Â· Suraj Deshmukh

Project specific scripts

There are always scripts that you write to automate some mundane tasks. And then you put that script in a directory that is in your PATH. But what this does is that it pollutes your system global PATH and shows up in places you wouldn’t want it to be in. I was struggling with this issue for a while and struggling to get a proper solution. But there is a very simple and clever trick to solve this problem. You extend your PATH to have a relative path .scripts in it. Like following (this is a snippet from my .bashrc). ...

June 23, 2019 Â· 2 min Â· Suraj Deshmukh