aboutsummaryrefslogtreecommitdiff
path: root/content/permadraft
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2019-04-07 23:30:43 +0200
committerKatharina Fey <kookie@spacekookie.de>2019-04-07 23:30:53 +0200
commit38e2353f1bfbe5f68b7751642706de9703fb48ef (patch)
tree347bdc2137048989eee9d3ba7e741c3f8dc1bbfe /content/permadraft
parent427d0da3cda0e5246cf89257bcb95b3501ec0048 (diff)
Archiving some posts to "permadraft"
Diffstat (limited to 'content/permadraft')
-rw-r--r--content/permadraft/000_arch_kernel_updates.md72
-rw-r--r--content/permadraft/000_gnome_vs_unity.md68
-rw-r--r--content/permadraft/000_my_server.md75
3 files changed, 215 insertions, 0 deletions
diff --git a/content/permadraft/000_arch_kernel_updates.md b/content/permadraft/000_arch_kernel_updates.md
new file mode 100644
index 0000000..9b29dbf
--- /dev/null
+++ b/content/permadraft/000_arch_kernel_updates.md
@@ -0,0 +1,72 @@
+Title: The Kernel is dead! Long live the Kernel
+Category: Blog
+Tags: /dev/diary, linux, arch linux, pacman
+Date: 2018-02-08
+Status: Draft
+
+
+So I run Arch Linux and mostly I love it (I'm weird, I know 😝). But there is one thing that's really been annoying me which happens after some `pacman -Syyu` runs: all of my old kernel modules become unavailable, forcing me to do a reboot. But recently I found some stuff online to prevent that from happening so let's document all of it here.
+
+I have similar hooks, with a slight difference - keep `/usr/lib/modules/$(uname -r)` looking exactly the same as before the upgrade.
+
+We need a hook that is run before a pacman transaction
+
+```
+# /etc/pacman.d/hooks/linux-modules-pre.hook
+
+[Trigger]
+Operation = Upgrade
+Type = Package
+Target = linux
+
+[Action]
+Description = Save Linux kernel modules
+When = PreTransaction
+Depends = rsync
+Exec = /bin/sh -c 'KVER="${KVER:-$(uname -r)}"; if test -e "/lib/modules/${KVER}"; then rsync -AHXal --delete-after "/lib/modules/${KVER}" /lib/modules/backup/; fi'
+```
+
+And another hook that is run after a pacman transaction (duh 😜)
+
+```
+# /etc/pacman.d/hooks/linux-modules-post.hook
+
+[Trigger]
+Operation = Upgrade
+Type = Package
+Target = linux
+
+[Action]
+Description = Restore Linux kernel modules
+When = PostTransaction
+Depends = coreutils
+Depends = rsync
+Exec = /bin/sh -xc 'KVER="${KVER:-$(uname -r)}"; if test -e "/lib/modules/backup/${KVER}"; then rsync -AHXal --ignore-existing "/lib/modules/backup/${KVER}" /lib/modules/; fi; rm -rf /lib/modules/backup'
+```
+
+But that's only half of the problem. When we eventually reboot we want to clean up the old modules. This means writing a systemd service which cleas up our old modules when we finally start the new kernel.
+
+```
+# /etc/systemd/system/linux-modules-cleanup.service
+
+[Unit]
+Description=Clean up modules from old kernels
+
+[Service]
+Type=oneshot
+ExecStart=/bin/bash -exc 'for i in /usr/lib/modules/[0-9]*; do if [[ $${i##*/} = \'%v\' ]] || pacman -Qo "$${i}"; then continue; fi; rsync -AHXal "$${i}" /usr/lib/modules/.old/; rm -rf "$${i}"; done'
+
+[Install]
+WantedBy=basic.target
+```
+
+You can specify how long you want to keep your old kernel modules in this config file as well
+
+```
+# /etc/tmpfiles.d/linux-modules-cleanup.conf
+
+R! /usr/lib/modules/.old/* - - - 4w
+```
+
+
+I use `rsync --ignore-existing` to merge the backup even if `/lib/modules/$(uname -r)` still exists, in case most of its contents have disappeared in the upgrade but the directory still exists due to a stray file untracked by pacman.
diff --git a/content/permadraft/000_gnome_vs_unity.md b/content/permadraft/000_gnome_vs_unity.md
new file mode 100644
index 0000000..357744d
--- /dev/null
+++ b/content/permadraft/000_gnome_vs_unity.md
@@ -0,0 +1,68 @@
+Title: Why I still use Unity
+Category: Blog
+Tags: /dev/diary, linux
+Date: 2018-04-04
+Status: Draft
+
+In early 2016, AMD announced a new graphics driver for Linux: `amdgpu`.
+I was incredibly curious what they had been doing and as such,
+I installed Ubuntu 16.04 on my workstaton/ gaming PC
+and bought an R9 380X graphics card to test the new driver
+(previously using an older NVidia card).
+Over the following months I played around with custom Kernel modules,
+tested driver flags and did *so many benchmarks...*
+
+Late 2016, after I finished Google's [summer of code] program, I bought a 4K display.
+This would turn out to be more complicated than I initially thought.
+Using Ubuntu with Unity I had absolutely no issues with the new resolution.
+I switched the UI (not just text) scaling to `1.25`
+which made elements large enough to interact with without cluttering the screen.
+Performance was nice, even with an (at the time) experimental graphics driver.
+I was pretty happy.
+
+[summer of code]: https://spacekookie.de/blog/what-i-have-done-in-gsoc-2016/
+
+Until...the summer of 2017, when I decided that I didn't really want to use Ubuntu anymore
+and installed Arch on the desktop computer, the same OS I use on my laptop and two servers.
+But, this would turn out to be a lot more complicated than initially thought.
+There were a few problems that I encountered because of this
+and this blog article is meant to both track and inform about them.
+A lot of things are happening in the Linux desktop environment world
+and maybe this could be considered a snapshot of a changing ecosystem at some point in the future.
+
+## The competitors
+
+There were two desktop environments I tried.
+`gnome` and `cinnamon`.
+Both are Gtk+ based which is why I chose them.
+Note that KDE is being excluded for exactly that reason;
+I *really* don't like the way that Qt applications look and feel.
+
+GNOME and Cinnamon both share some common components.
+In fact Cinnamon started as a fork of GNOME
+but has since moved a bit further in their own direction.
+The most important component (in my opinion) is the window compositors:
+`mutter` and `muffin` which is a fork of the former made by the Cinnamon project.
+
+#### Compositor?
+
+Now, you might be asking: why a compositor?
+Can't you live without flaming windows or stupid transition effects?
+And my response to that is...well...that's not really all a compositor does.
+In a modern operating system the compositor provides windows with an off-screen buffer to draw into,
+then later blipping all the windows together onto the screen.
+The X server handles the screen and coordinates on it,
+the compositor is responsible for laying out the windows, scaling and moving them.
+Most bugs and performance problems with graphical desktop environments are at the compositor level, not X itself.
+
+### The problems
+
+But anyways, I was being side-tracked here. I was talking about problems.
+
+- Window performance (moving, scaling, minimising) under GNOME and Cinnamon is jumpy and laggy.
+ - Cinnamon (`muffin`) actually does a slightly better job at this than GNOME (`mutter`)
+- Switching workspaces (either directly or into an overview, then to a new workspace) is laggy
+ - GNOME is doing slightly better than Cinnamon in this regards. But neither are acceptable
+ - When I had switched to either of them, I actually stopped using workspace entirely
+- Neither GNOME nor Cinnamon support fractional UI scaling. **This is being worked on by GNOME!**
+
diff --git a/content/permadraft/000_my_server.md b/content/permadraft/000_my_server.md
new file mode 100644
index 0000000..9b175d4
--- /dev/null
+++ b/content/permadraft/000_my_server.md
@@ -0,0 +1,75 @@
+Title: Making my server completely replacable
+Category: Blog
+Tags: /dev/diary, linux, ancible
+Date: 2018-02-08
+Status: Draft
+
+**This is mostly a draft so far, so maybe pad it a bit more 😉**
+
+I have a virtual server running Arch Linux hosted somewhere in Germany
+which I want to use to host some personal services and toolchains.
+Currently this is done via LXD which I was a fan of for quite a while.
+I am using Zfs as a backend for these containers which means
+that I can do quick snapshots and deduplication between the base systems.
+But...I'm not really sure this is a nice way to do it anymore.
+I would like to run services in Containers just because
+it means that the host can be setup in a more clean way.
+
+But right now there is a lot of manual configuration required because
+I'm struggling with the new way that LXD handles network taps.
+And while I'm gonna have to touch my configs anyways, I thought: why not go a bit further?
+
+# Existing setup
+
+```
+ ☁ (icarus) ~> lxc list
++-------------+---------+----------------------+------+------------+-----------+
+| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
++-------------+---------+----------------------+------+------------+-----------+
+| betakookie | STOPPED | | | PERSISTENT | 2 |
++-------------+---------+----------------------+------+------------+-----------+
+| dcmerge | RUNNING | 10.130.123.13 (eth0) | | PERSISTENT | 0 |
++-------------+---------+----------------------+------+------------+-----------+
+| dns | STOPPED | | | PERSISTENT | 1 |
++-------------+---------+----------------------+------+------------+-----------+
+| gitlab | RUNNING | 10.130.123.20 (eth0) | | PERSISTENT | 2 |
++-------------+---------+----------------------+------+------------+-----------+
+| hazelnot | RUNNING | 10.130.123.12 (eth0) | | PERSISTENT | 0 |
++-------------+---------+----------------------+------+------------+-----------+
+| partkeepr | STOPPED | | | PERSISTENT | 3 |
++-------------+---------+----------------------+------+------------+-----------+
+| spacekookie | RUNNING | 10.130.123.10 (eth0) | | PERSISTENT | 2 |
++-------------+---------+----------------------+------+------------+-----------+
+| stats | RUNNING | 10.130.123.22 (eth0) | | PERSISTENT | 0 |
++-------------+---------+----------------------+------+------------+-----------+
+| turtl | STOPPED | | | PERSISTENT | 0 |
++-------------+---------+----------------------+------+------------+-----------+
+| vpn-core | STOPPED | | | PERSISTENT | 0 |
++-------------+---------+----------------------+------+------------+-----------+
+| wiki | RUNNING | 10.130.123.23 (eth0) | | PERSISTENT | 0 |
++-------------+---------+----------------------+------+------------+-----------+
+```
+
+Ultimately I want to run a few core services:
+
+ - My website (Also available in early access on Github 😱)
+ - A friend's static website
+ - Gitlab
+ - Bookstack (my wiki)
+ - Matomo (previously Piwik)
+ - Partkeepr (a tool for managing electronic components)
+ - Turtl (a cool evernote clone)
+ - My own Quassel core (instead of using my ex-girlfriend's one 😉)
+
+And maybe some more that I haven't setup yet.
+Including a VPN between my server,
+my NAS and all of my other devices.
+
+# Future setup idea
+
+I have two servers running pretty much all the time:
+
+ - My cloud server
+ - My NAS at home
+
+What I want to get over is having to manually configure containers and \ No newline at end of file