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