From 2769f22dfce318885b9ce5fd40cbd6db6c588c5c Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Sat, 27 Aug 2022 10:16:52 +0200 Subject: [PATCH] fix: enable syntax highlighting on all code blocks --- content/posts/alpine-commit-hooks.md | 4 ++-- content/posts/mail-dns-setup.md | 4 ++-- content/posts/openrc-async-services.md | 16 ++++++++-------- content/posts/spotify-on-musl.md | 20 ++++++++++---------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/content/posts/alpine-commit-hooks.md b/content/posts/alpine-commit-hooks.md index 29fb901..becf5bc 100644 --- a/content/posts/alpine-commit-hooks.md +++ b/content/posts/alpine-commit-hooks.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 diff --git a/content/posts/mail-dns-setup.md b/content/posts/mail-dns-setup.md index d077eca..2997a32 100644 --- a/content/posts/mail-dns-setup.md +++ b/content/posts/mail-dns-setup.md @@ -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" ``` diff --git a/content/posts/openrc-async-services.md b/content/posts/openrc-async-services.md index 34ba98b..4050275 100644 --- a/content/posts/openrc-async-services.md +++ b/content/posts/openrc-async-services.md @@ -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 ``` diff --git a/content/posts/spotify-on-musl.md b/content/posts/spotify-on-musl.md index 0a814dd..e1e08e9 100644 --- a/content/posts/spotify-on-musl.md +++ b/content/posts/spotify-on-musl.md @@ -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) +++