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