aboutsummaryrefslogtreecommitdiff
path: root/content/posts/2021-12-03-debian-based-riced-up-distribution-for-developers.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/posts/2021-12-03-debian-based-riced-up-distribution-for-developers.md')
-rw-r--r--content/posts/2021-12-03-debian-based-riced-up-distribution-for-developers.md275
1 files changed, 0 insertions, 275 deletions
diff --git a/content/posts/2021-12-03-debian-based-riced-up-distribution-for-developers.md b/content/posts/2021-12-03-debian-based-riced-up-distribution-for-developers.md
deleted file mode 100644
index 0755282..0000000
--- a/content/posts/2021-12-03-debian-based-riced-up-distribution-for-developers.md
+++ /dev/null
@@ -1,275 +0,0 @@
1---
2title: Debian based riced up distribution for Developers and DevOps folks
3url: debian-based-riced-up-distribution-for-developers-and-devops-folks.html
4date: 2021-12-03T12:00:00+02:00
5draft: false
6---
7
8## Introduction
9
10I have been using [Ubuntu](https://ubuntu.com/) for quite a longtime now. I have
11used [Debian](https://www.debian.org/) in the past and
12[Manjaro](https://manjaro.org/). Also had [Arch](https://archlinux.org/) for
13some time and even ran [Gentoo](https://www.gentoo.org/) way back.
14
15What I learned from all this is that I prefer running a bit older versions and
16having them be stable than run bleeding edge rolling release. For that reason, I
17stuck with Ubuntu for a couple of years now. I am also at a point in my life
18where I just don't care what is cool or hip anymore. I just want a stable system
19that doesn't get in my way.
20
21During all this, I noticed that these distributions were getting very bloated
22and a lot of software got included that I usually uninstall on fresh
23installation. Maybe this is my OCD speaking, but why do I have to give fresh
24installation min 1 GB of ram out of the box just to have a blank screen in front
25of me? I get it, there are many things included in the distro to make my life
26easier. I understand. But at this point I have a feeling that modern Linux
27distributions are becoming similar to [Node.js project with
28node_modules](https://devhumor.com/content/uploads/images/August2017/node-modules.jpg).
29Just a crazy number of packages serving very little or no purpose, just
30supporting other software.
31
32I felt I needed a fresh start. To start over with something minimal and clean.
33Something that would put a little more joy into using a computer again.
34
35For the first version, I wanted to target the following machines I have at home
36that I want this thing to work on.
37
38```yaml
39# My main stationary work machine
40Resolution: 3840x1080 (Super Ultrawide Monitor 32:9)
41CPU: Intel i7-8700 (12) @ 4.600GHz
42GPU: AMD ATI Radeon RX 470/480/570/570X/580/580X/590
43Memory: 32020MiB
44```
45
46```yaml
47# Thinkpad x220 for testing things and goofing around
48Resolution: 1366x768
49CPU: Intel i5-2520M (4) @ 3.200GHz
50GPU: Intel 2nd Generation Core Processor Family
51Memory: 15891MiB
52```
53
54## How should I approach this?
55
56I knew I wanted to use [minimal Debian netinst
57](https://www.debian.org/CD/netinst/) for the base to give myself a head
58start. No reason to go through changing the installer and also testing all that
59behemoth of a thing. So, some sort of ricing was the only logical option to get
60this thing of the grounds somewhat quickly.
61
62> **What is ricing anyway?**
63> The term “RICE” stands for Race Inspired Cosmetic Enhancement. A group of
64> people (could be one, idk) decided to see if they could tweak their own
65> distros like they/others did their cars. This gave rise to a community of
66> Linux/Unix enthusiasts trying to make their distros look cooler and better
67> than others... For more information, read this article
68> [What in the world is ricing!?](https://pesos.github.io/2020/07/14/what-is-ricing.html).
69
70I didn't want this to just be a set of config files for theming purpose. I
71wanted this to include a set of pre-installed tools and services that are being
72used all the time by a modern developer. Theming is just a tiny part of it.
73Fonts being applied across the distro and things like that.
74
75First, I choose terminal installer and left it to load additional components.
76Avoid using graphical installer in this case.
77
78![](/assets/dfd-rice/install-00.png)
79
80After that I selected hostname and created a normal user and set password for
81that user and root user and choose guided mode for disk partitioning.
82
83![](/assets/dfd-rice/install-01.png)
84
85I left it run to install all the things required for the base system and opted
86out of scanning additional media for use by the package manager. Those will be
87downloaded from the internet during installation.
88
89![](/assets/dfd-rice/install-02.png)
90
91I opted out of the popularity contest, and **now comes the important part**.
92Uncheck all the boxes in Software selection and only leave 'standard system
93utilities'. I also left an SSH server, so I was able to log in to the machine
94from my main PC.
95
96![](/assets/dfd-rice/install-03.png)
97
98At this point, I installed GRUB bootloader on the disk where I installed the
99system.
100
101![](/assets/dfd-rice/install-04.png)
102
103That concluded the installation of base Debian and after restarting the computer
104I was prompted with the login screen.
105
106![](/assets/dfd-rice/install-05.png)
107
108Now that I had the base installation, it was time to choose what software do I
109want to include in this so-called distribution. I wanted out of the box
110developer experience, so I had plenty to choose.
111
112Let's not waste time and go through the list.
113
114## Desktop environments
115
116I have been using [Gnome](https://www.gnome.org/) for my whole Linux life. From
117version 2 forward. It's been quite a ride. I hated version 3 when it came out
118and replaced version 2. But I got used to it. And now with version 40+ they also
119made couple of changes which I found both frustrating and presently surprised.
120
121The amount of vertical space you loose because of the beefy title bars on
122windows is ridiculous. And then in case of
123[Tilix](https://gnunn1.github.io/tilix-web/) you also have tabs, and you are
124100px deep. Vertical space is one of the most important things for a
125developer. The more real estate you have, the more code you can have in a
126viewport.
127
128But on the other hand, I still love how Gnome feels and looks. I gotta give them
129that. They really are trying to make Gnome feel unified and modern.
130
131Regardless of all the nice things Gnome has, I was looking at the tiling window
132managers for some time, but never had the nerve to actually go with it. But now
133was the ideal time to give it a go. No guts, no glory kind of a thing.
134
135One of the requirements for me was easy custom layouts because I use a really
136strange monitor with aspect ratio of 32:9. So relying on included layouts most
137of them have is a non-starter.
138
139What I was doing in Gnome was having windows in a layout like the diagram
140below. This is my common practice. And if you look at it you can clearly see I
141was replicating tiling window manager setup in Gnome.
142
143![](/assets/dfd-rice/layout.png)
144
145That made me look into a bunch of tiling window managers and then tested them
146out. Candidates I was looking at were:
147
148- [i3](https://i3wm.org/)
149- [bspwm](https://github.com/baskerville/bspwm)
150- [awesome](https://awesomewm.org/index.html)
151- [XMonad](https://xmonad.org/)
152- [sway](https://swaywm.org/)
153- [Qtile](http://www.qtile.org/)
154- [dwm](https://dwm.suckless.org/)
155
156You can also check article [13 Best Tiling Window Managers for
157Linux](https://www.tecmint.com/best-tiling-window-managers-for-linux/) I was
158referencing while testing them out.
159
160While all of them provided what I needed, I liked i3 the most. What particular
161caught my eye was the ease to use and tree based layouts which allows flexible
162layouts. I know others can be set up also to have custom layouts other than
163spiral, dwindle etc. I think i3 is a good entry-level window manager for
164somebody like me.
165
166## Batteries included
167
168The source for the whole thing is located on Github
169https://github.com/mitjafelicijan/dfd-rice.
170
171Currenly included:
172
173- `non-free` (enables non-free packages in apt)
174- `sudo` (adds sudo and adds user to sudo group)
175- `essentials` (gcc, htop, zip, curl, etc...)
176- `wifi` (network manager nmtui)
177- `desktop` (i3, dmenu, fonts, configurations)
178- `pulseaudio` (pulseaudio with pavucontrol)
179- `code-editors` (vim, micro, vscode)
180- `ohmybash` (make bash pretty)
181- `file-managers` (mc)
182- `git-ui` (terminal git gui)
183- `meld` (diff tool)
184- `profiling` (kcachegrind, valgrind, strace, ltrace)
185- `browsers` (brave, firefox, chromium)
186- programming languages:
187 - `python`
188 - `golang`
189 - `nodejs`
190 - `rust`
191 - `nim`
192 - `php`
193 - `ruby`
194- `docker` (with docker-compose)
195- `ansible`
196
197Install script also allows you to install only specific packages (example for:
198essentials ohmybash docker rust).
199
200```sh
201su - root \
202 bash -c "$(wget -q https://raw.github.com/mitjafelicijan/dfd-rice/master/tools/install.sh -O -)" -- \
203 essentials ohmybash docker rust
204```
205
206Currently, most of these recipes use what Debian and this is totally fine with
207me since I never use bleeding edge features of a package. But if something major
208would come to light, I will replace it with a possible compilation script or
209something similar.
210
211This is some of the output from the installation script.
212
213![](/assets/dfd-rice/script.png)
214
215Let's take a look at some examples in the installation script.
216
217### Docker recipe
218
219```sh
220# docker
221print_header "Installing Docker"
222curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --yes --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
223echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
224apt update
225apt -y install docker-ce docker-ce-cli containerd.io docker-compose
226
227systemctl start docker
228systemctl enable docker
229systemctl status docker --no-pager
230
231/sbin/usermod -aG docker $USERNAME
232```
233
234### Making bash pretty
235
236I really like [Oh My Zsh](https://ohmyz.sh/), but I don't like zsh shell. When
237I used it, I constantly needed to be aware of it and running bash scripts was a
238pain. So, I was really delighted when I found out that a version for bash
239existed called [Oh My Bash](https://ohmybash.nntoan.com/). Let's take a look at
240the recipe for installing it.
241
242```sh
243# ohmybash
244print_header "Enabling OhMyBash"
245sudo -u $USERNAME sh -c "$(curl -fsSL https://raw.github.com/ohmybash/oh-my-bash/master/tools/install.sh)" &
246T1=${!}
247wait ${T1}
248```
249
250Because OhMyBash does `exec bash` at the end, this traps our script inside
251another shell and our script cannot continue. For that reason, I executed this
252in background. But that presents a new problem. Because this is executed in
253background, we lose track of progress naturally. And that strange trick with
254`T1=${!}` and `wait ${T1}` waits for the background process to finish before
255continuing to another task in bash script.
256
257Check [Multi-Threaded Processing in Bash Scripts](https://www.cloudsavvyit.com/12277/how-to-use-multi-threaded-processing-in-bash-scripts/)
258for more details.
259
260## Conclusion
261
262Take a look at
263https://github.com/mitjafelicijan/dfd-rice/blob/develop/tools/install.sh script
264to get familiar with it. This is just a first iteration and I will continue to
265update it because I need this in my life.
266
267The current version boots in 4s to the login prompt, and after you log in, the
268desktop environment loads in 2s. So, its fast, very fast. And on clean boot, I
269measured ~230 MB of RAM usage.
270
271And this is how it looks with two terminals side by side. I really like the
272simplicity and clean interface. I will polish the colors and stuff like that,
273but I really do like the results.
274
275![](/assets/dfd-rice/desktop.png)