From 38e2353f1bfbe5f68b7751642706de9703fb48ef Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Sun, 7 Apr 2019 23:30:43 +0200 Subject: Archiving some posts to "permadraft" --- README.md | 26 +++++++--- content/blog/999_arch_kernel_updates.md | 72 ------------------------- content/blog/999_gnome_vs_unity.md | 33 ------------ content/blog/999_my_server.md | 65 ----------------------- content/permadraft/000_arch_kernel_updates.md | 72 +++++++++++++++++++++++++ content/permadraft/000_gnome_vs_unity.md | 68 ++++++++++++++++++++++++ content/permadraft/000_my_server.md | 75 +++++++++++++++++++++++++++ 7 files changed, 234 insertions(+), 177 deletions(-) delete mode 100644 content/blog/999_arch_kernel_updates.md delete mode 100644 content/blog/999_gnome_vs_unity.md delete mode 100644 content/blog/999_my_server.md create mode 100644 content/permadraft/000_arch_kernel_updates.md create mode 100644 content/permadraft/000_gnome_vs_unity.md create mode 100644 content/permadraft/000_my_server.md diff --git a/README.md b/README.md index f0e7fc3..e9dd21a 100755 --- a/README.md +++ b/README.md @@ -1,14 +1,27 @@ # fun memory violations -This is my website, running at [spacekookie.de](https://spacekookie.de). It's built with Pelican and my own theme called `crumbs` (because kookies...). +This is my website, running at [spacekookie.de](https://spacekookie.de). +It's built with Pelican and my own theme called `crumbs` (because kookies...). -To understand the theme, you need to understand jinja because it's not very linear. Every sub-component is structured as such and then included. Sometimes parameters are given to the sub-component to distinguish between different page behaviour. +To understand the theme, you need to understand jinja because it's not very linear. +Every sub-component is structured as such and then included. +Sometimes parameters are given to the sub-component to distinguish between different page behaviour. If you have questions, just ask :) +There's a ["permadraft"] folder of articles that never quite made it. +Some of them are farely fleshed out but either the time to publish them passed +or I otherwise thought it'd be a bad idea ot put them on the blog. + +["permadraft"]: https://github.com/spacekookie/website/tree/master/content/permadraft + +Their HTML pages are still being built, but not included in any index. +Feel free to hot-link to them if you like! + ## How to build -You need to have python3 (not sure if it works with python2...) installed. Then you can build the website as follows... +You need to have python3 (not sure if it works with python2...) installed. +Then you can build the website as follows... ```bash pip install pelican markdown webassets @@ -17,8 +30,7 @@ make devserver # The server is hosted on port 8000 ``` -I hope someone can learn from this :) - -## License +There's also a [nix] package over at [kookiepkgs] if you want to see the reproducible build. -It's all MIT. Fuck anything to do with the GNU project 💩 +[nix]: https://nixos.org/nix +[kookiepkgs]: https://github.com/spacekookie/kookiepkgs/blob/master/pkgs/spacekookie-de/default.nix \ No newline at end of file diff --git a/content/blog/999_arch_kernel_updates.md b/content/blog/999_arch_kernel_updates.md deleted file mode 100644 index 9b29dbf..0000000 --- a/content/blog/999_arch_kernel_updates.md +++ /dev/null @@ -1,72 +0,0 @@ -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/blog/999_gnome_vs_unity.md b/content/blog/999_gnome_vs_unity.md deleted file mode 100644 index 46534d2..0000000 --- a/content/blog/999_gnome_vs_unity.md +++ /dev/null @@ -1,33 +0,0 @@ -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](https://spacekookie.de/blog/what-i-have-done-in-gsoc-2016/) 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. - -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/blog/999_my_server.md b/content/blog/999_my_server.md deleted file mode 100644 index f29f9f4..0000000 --- a/content/blog/999_my_server.md +++ /dev/null @@ -1,65 +0,0 @@ -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 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 -- cgit v1.2.3