fix: enable syntax highlighting on all code blocks

master
ptrcnull 1 month ago
parent 47848dd1a7
commit 2769f22dfc
  1. 4
      content/posts/alpine-commit-hooks.md
  2. 4
      content/posts/mail-dns-setup.md
  3. 16
      content/posts/openrc-async-services.md
  4. 20
      content/posts/spotify-on-musl.md

@ -12,8 +12,8 @@ tl;dr:
### Example hook
```bash
#!/bin/bash
```shell
#!/bin/sh
if ! mount | grep -q '/boot/efi'; then
mount /boot/efi

@ -8,7 +8,7 @@ Since I always struggle with DNS records for mailservers... here are some exampl
## DMARC
```
```text
_dmarc TXT "v=DMARC1; p=none; rua=mailto:dmarc@domain.tld"
```
@ -19,7 +19,7 @@ _dmarc TXT "v=DMARC1; p=none; rua=mailto:dmarc@domain.tld"
## SPF
```
```text
@ TXT "v=spf1 mx -all"
```

@ -22,28 +22,28 @@ So, the final solution was:
- create a custom runlevel (I chose the name "async", but it doesn't matter)
```bash
sudo mkdir /etc/runlevels/async
```console
$ doas mkdir /etc/runlevels/async
```
- add `default` as a [stacked runlevel](https://wiki.gentoo.org/wiki/OpenRC/Stacked_runlevel)
```bash
sudo rc-update add -s default async
```console
$ doas rc-update add -s default async
```
- remove services from `default` and add them to `async`
```bash
sudo rc-update del chronyd
sudo rc-update add chronyd async
```console
$ doas rc-update del chronyd
$ doas rc-update add chronyd async
```
- add changing runlevel to `async` to `inittab`
Add this line to `/etc/inittab`:
```
```text
::once:/sbin/openrc async
```

@ -11,7 +11,7 @@ with minimal setup, but... I'd really like to get Spotify to run natively, mostl
Let's start by downloading Spotify's deb package from [the official repository](https://repository-origin.spotify.com/pool/non-free/s/spotify-client/) and unpacking it into downloads.
Most of the files are in `usr/share/spotify`, so we'll try to just go there and run it.
```
```console
$ cd usr/share/spotify
$ ./spotify
zsh: no such file or directory: ./spotify
@ -19,7 +19,7 @@ zsh: no such file or directory: ./spotify
Oh right, it's missing some stuff. What stuff though?
```
```console
$ ldd spotify
(114 lines skipped...)
Error relocating ./libcef.so: __libc_realloc: symbol not found
@ -44,7 +44,7 @@ Error relocating ./spotify: __cxa_thread_atexit_impl: symbol not found
It seems that it uses a lot of glibc-specific stuff, but we can use Adelie Linux's [gcompat](https://git.adelielinux.org/adelie/gcompat) to make it work.
```
```console
$ apk add gcompat
(1/3) Installing musl-obstack (1.2.2-r0)
(2/3) Installing libucontext (1.1-r0)
@ -69,14 +69,14 @@ so I pushed my changed to a fork on GitHub instead of creating a merge request t
After recompiling gcompat and trying to run Spotify again, it still complains about missing glibc:
```
```console
$ ./spotify
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by libcef.so)
```
Fortunately, another `patchelf`, this time to `libcef.so`, makes the error go away:
```
```console
$ patchelf --remove-needed ld-linux-x86-64.so.2 libcef.so
$ ./spotify
```
@ -91,7 +91,7 @@ but as we don't use the loader, we can remove it from the Makefile and build aga
Another recompile of gcompat later, maybe now it would launch?
```
```console
$ ./spotify
[1] 26559 segmentation fault (core dumped) ./spotify
```
@ -124,7 +124,7 @@ Aaand... it shows a window!
Sadly, after a while, the enthusiasm goes away - the window stays white and doesn't display any content.
Command line argument `--show-console` doesn't give us any helpful info either:
```
```console
$ ./spotify --show-console
14:54:32.302 I [f:156 ] Access allowance changed from online: 0 stream: 0, sync: 0, persistent conn: 0 to online: 1 stream: 1, sync: 0, persistent conn: 1
14:54:32.334 I [f:77 ] Connectivity policy is initially allow_all
@ -135,7 +135,7 @@ $ ./spotify --show-console
Okay, but A. Wilcox [had the same issue](https://catfox.life/2020/07/06/live-from-adelie-streaming-spotify-on-musl/) - maybe we can use that?
```
```console
$ ldd spotify
/lib/ld-musl-x86_64.so.1 (0x7f0b5dbf5000)
libgcompat.so.0 => /lib/libgcompat.so.0 (0x7f0b5dbe1000)
@ -150,7 +150,7 @@ $ ldd spotify
It seems to match (libm/libdl before libcef), so let's try removing them and see what happens:
```
```console
$ patchelf --remove-needed libm.so.6 libcef.so
$ patchelf --remove-needed libdl.so.2 libcef.so
$ ./spotify --show-console
@ -163,7 +163,7 @@ $ ./spotify --show-console
Unfortunately, it still shows the white window and `strace` reveals that it still segfaults:
```
```console
28567 +++ killed by SIGSEGV (core dumped) +++
28566 +++ killed by SIGSEGV (core dumped) +++
28565 +++ killed by SIGSEGV (core dumped) +++

Loading…
Cancel
Save