diff options
author | User Mms <mms@voyager.local> | 2024-10-16 22:36:17 +0200 |
---|---|---|
committer | User Mms <mms@voyager.local> | 2024-10-16 22:36:17 +0200 |
commit | 4bfd917c266fe3ad9bcd61748e8febe971e50006 (patch) | |
tree | 99d7df43d39e9876365f99a075d0a13560f04959 /content | |
parent | b29c885dd8a4fad3a1e6b12e02fbd501f2edb7fc (diff) |
feat: bsd & broken system
Diffstat (limited to 'content')
-rw-r--r-- | content/blog/2024/broken-system.md | 44 | ||||
-rw-r--r-- | content/bsd/_index.md | 10 | ||||
-rw-r--r-- | content/bsd/blocking-bad-bots-openbsd.md | 4 | ||||
-rw-r--r-- | content/bsd/freebsd-gaming/scummvm.md (renamed from content/bsd/gaming/scummvm.md) | 11 | ||||
-rw-r--r-- | content/bsd/jails-usage-examples.md | 138 | ||||
-rw-r--r-- | content/bsd/open-bsd-web-stack.md | 4 | ||||
-rw-r--r-- | content/bsd/relayd-custom-webserver.md | 4 | ||||
-rw-r--r-- | content/bsd/thinkpad/_index.md | 2 | ||||
-rw-r--r-- | content/bsd/thinkpad/fixing-resume-on-thinkpad-x1-extreme-g2-on-freebsd.md | 4 | ||||
-rw-r--r-- | content/bsd/thinkpad/fixing-thinkpad-x1-wifi-on-freebsd.md | 8 | ||||
-rw-r--r-- | content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md | 4 | ||||
-rw-r--r-- | content/bsd/thinkpad/freebsd-on-thinkpad-x1-extreme-g2.md | 12 | ||||
-rw-r--r-- | content/bsd/thinkpad/switching-between-speakers-and-headphones-on-freebsd.md | 4 | ||||
-rw-r--r-- | content/bsd/why-bsd.md | 16 | ||||
-rw-r--r-- | content/bsd/why-not-bsd.md | 8 |
15 files changed, 109 insertions, 164 deletions
diff --git a/content/blog/2024/broken-system.md b/content/blog/2024/broken-system.md new file mode 100644 index 0000000..8cde9c4 --- /dev/null +++ b/content/blog/2024/broken-system.md @@ -0,0 +1,44 @@ ++++ +title = "Broken system" +author = ["Michał Sapka"] +date = 2024-10-16T22:28:00+02:00 +categories = ["blog"] +draft = false +weight = 2001 +image_dir = "blog/images" +image_max_width = 600 +Abstract = "I am not a smart person" +Listening = "Steve Kirk - Thimbleweed Park (Original Soundtrack)" +Listening_url = "https://thimbleweedpark.bandcamp.com/album/thimbleweed-park-original-soundtrack" ++++ + +A very short update: last week I broke my computer. +FreeBSD did its best, but my sheer stupidity wouldn't listen. + +I updated my ZFS, which worked fine. +It informed me info about potentially needing to update my bootloader, but what the hell. +I'll have time for it later! + +Later was when I forgot about that and rebooted my system. +"ReBOOTING" is not the correct word, as it was not booting. +FreeBSD was starting, but it could not find any bootable partition. +They warned me, but I didn't listen. + +After two evenings of trying to fix it (I still think it's possible), I gave up. +I downloaded `GhostBSD`, mounted my ZFS datasets (the problem was not with them, but with booting up), created a small `tar` backup which I moved to my NAS. +Then, making sure I had the backup, I reinstalled the system as fresh. + +About that backup, well. +For one, I had stuff I didn't want to lose, but I had yet to add any external storage, like git server. +Not a smart move on my side. +Good thing, that `ZFS` is designed to be moron-resilient. +The other part is that my `tar` command didn't include `dotfiles`, and I never bothered to back those as well. +My `GNUS` state is lost, never to be recovered ever again. + +But the upside here is that I am much more experienced local-admin than I was when I first moved to `FreeBSD`. +Setup when smooth like butter. +Real butter. + +I used this occasion to move this site to my server & create the next iteration. +I'm still evolving, but backwards. +What you are seeing here is, of course, a work in progress. diff --git a/content/bsd/_index.md b/content/bsd/_index.md index 20fb007..5a5030e 100644 --- a/content/bsd/_index.md +++ b/content/bsd/_index.md @@ -2,10 +2,18 @@ title = "Michal's Guide to BSD" author = ["Michał Sapka"] date = 2024-03-06T14:45:00+01:00 +categories = ["bsd"] draft = false -weight = 1001 +weight = 2001 +primary_menu = "bsd" +image_dir = "bsd" +image_max_width = 600 abstract = "A site dedicated to BSD family of systems" noreturn = "yes" +[menu] + [menu.bsd-null] + weight = 2001 + identifier = "michal-s-guide-to-bsd" +++ {{< menu "bsd" >}} diff --git a/content/bsd/blocking-bad-bots-openbsd.md b/content/bsd/blocking-bad-bots-openbsd.md index 6527390..3b447b5 100644 --- a/content/bsd/blocking-bad-bots-openbsd.md +++ b/content/bsd/blocking-bad-bots-openbsd.md @@ -4,12 +4,12 @@ author = ["Michał Sapka"] date = 2023-12-11T19:08:00+01:00 categories = ["bsd"] draft = false -weight = 2002 +weight = 3002 primary_menu = "bsd" abstract = "How do I fight bad crawlers?" [menu] [menu.bsd] - weight = 2002 + weight = 3002 identifier = "openbsd-blocking-bad-bots-using-relayd" parent = "obsdweb" name = "Blocking bad bots using Relayd" diff --git a/content/bsd/gaming/scummvm.md b/content/bsd/freebsd-gaming/scummvm.md index cb365f4..2a9003c 100644 --- a/content/bsd/gaming/scummvm.md +++ b/content/bsd/freebsd-gaming/scummvm.md @@ -2,13 +2,16 @@ title = "ScummVM" author = ["Michał Sapka"] date = 2024-09-20T21:34:00+02:00 +categories = ["bsd"] draft = false -weight = 2001 +weight = 3001 primary_menu = "bsd" +image_dir = "bsd" +image_max_width = 600 abstract = "Running old adventure games" [menu] [menu.bsd] - weight = 2001 + weight = 3001 identifier = "scummvm" parent = "gaming" +++ @@ -30,3 +33,7 @@ Since ScummVM abstracts the OS from the game, any problems you may experience sh Getting the games may be problematic. Most modern remakes are not using the classic engines, so they may not work. + +{{< image class="centered" alt="Screenshot ScummVM running Monkey Island 2" file="scummvm.png" >}} +Monkey Island 2 running on ScummVM +{{< /image >}} diff --git a/content/bsd/jails-usage-examples.md b/content/bsd/jails-usage-examples.md index e9b8c0a..a4d7e41 100644 --- a/content/bsd/jails-usage-examples.md +++ b/content/bsd/jails-usage-examples.md @@ -4,14 +4,15 @@ author = ["Michał Sapka"] date = 2023-12-01T21:29:00+01:00 categories = ["bsd"] draft = false -weight = 2001 +weight = 3001 primary_menu = "bsd" +image_dir = "bsd" +image_max_width = 600 abstract = "How can we use FreeBSD Jails?" [menu] [menu.bsd] - weight = 2001 + weight = 3001 identifier = "freebsd-examples-of-jail-usage" - parent = "freebsd" name = "Some examples of using Jails" +++ @@ -23,134 +24,3 @@ But what can we do with it? A very common use pattern on FreeBSD desktop is to use Jails to encapsulate dependencies, so they don't pollute the main OS. Don't want that pesky Pyton? Straight to Jail. Java? Straight to jail! - - -## Simple jail - Ltex-Ls {#simple-jail-ltex-ls} - -I am not a native speaker, so my English skills are far from perfect. -My terrible typing skills don't add anything good into the mix. -Therefore, I am in need of a good grammar and spell checker. -There is Grammarly, but it's closed source and cloud based. -We don't want that. - -Luckily an alternative exist - [LanguageTool](https://languagetool.org/). -It is quite good and can run locally! -I use it via an LSP - [Ltex-Ls](https://valentjn.github.io/ltex/ltex-ls/installation.html). -Technically it's aimed at Latex, but it can work with any filetype. - -The problem with ltex-ls is that is runs on JVM. -I really don't need that on my system. -Let's lock it in a jail and allow our NeoVim[^lsp] to use it. -[^lsp]: I can, of course, run in any other editor which supports the LSP standard, be it Emacs or some bad one. - -First, let's create a Jail and call it \`ltex\`. -For now we can allow it access to the internet, as we will download some files. - -```shell -ltex { - ip4 = inherit; - interface = em0; -} -``` - -We will remove network access after we are done with the setup. -We don't want any of our writings to leak to the web. - -Then, let's log into the jail - -```shell -doas jexec ltex /bin/sh -``` - -and add the dreaded java - -```shell -pkg install openjdk-jre -``` - -then, let's fetch our latex-ls - -```shell -cd /root -wget https://github.com/valentjn/ltex-ls/releases/download/16.0.0/ltex-ls-16.0.0.tar.gz -tar -xvf ltex-ls-16.0.0.tar.gz -``` - -for ease of use, let's remove the version number from the directory - -```shell -mv ltex-ls-16.0.0/ ltex -``` - -And our jail is ready, so let's leave it (either \`exit\` or the good, old Ctrl+d). -We can now open our nvim config file. -This is not a guide about this part, so let's just assume you have LSP and LSP-Config intalled. - -Our config will look like this: - -```lua -lspconfig.ltex.setup{ - on_attach = on_attach, - cmd = { "doas", - "jexec", - "ltex", - "/root/ltex/bin/ltex-ls" }, --- rest of config omitted -} -``` - -Notice, that we now run the command as root inside the Jail. -It would make sense to allow passwordless-doas to our user due to \`doas\`. -I will update this guide if I figure out if we can commit this security nightmare here. - -But let's go a step further. -Ltex-Ls allows to use machine learning based grammar check based on ngram data. -We can add it to our jail. -Let's log back in - -```shell -doas jexec ltex /bin/sh -``` - -Next we need to fetch the ngram data (you can find it on [LanguageTool website](https://dev.languagetool.org/finding-errors-using-n-gram-data.html). -We need to have a \`ngrams\` folder which contains \`en\` (as the language shortcut). -The ngrams should be inside the \`en\`. - -I propose you move the files to \`/var/ngrams/en\` inside the Jail. - -We can now tell \`NeoVim\` to inform the \`ltex-ls\` runtime to use the ngrams. - -```lua --- our old config -lspconfig.ltex.setup{ - on_attach = on_attach, - cmd = { "doas", - "jexec", - "ltex", - "/root/ltex/bin/ltex-ls" }, - -- ngram settings added - settings = { - ltex = { - additionalRules = { - languageModel = '/var/ngrams/', - }, - }, - }, - -- rest of config still omitted -``` - -Note that we instructed the LSP to use `/var/ngrams` folder. -For program running inside a Jail, the Jail is full system. -Even though we can access the ngram data on the host OS under `/jail/containers/ltex/var/ngrams` (depending on your config), for Jail, the `/jail/containers/ltex/` prefix doesn't exist as it points to root for the jail. - -We can now remove networking from the jail, so our Jail config just defines the existence of the jail - -```shell -ltex { -} -``` - -And boom. We've got machine language grammar checking which is completely offline and does not pollute our primary system. -Our tinfoil friends will be proud of us. - -[this article will be expanded with more examples in the near future] diff --git a/content/bsd/open-bsd-web-stack.md b/content/bsd/open-bsd-web-stack.md index a332f1e..19cef2a 100644 --- a/content/bsd/open-bsd-web-stack.md +++ b/content/bsd/open-bsd-web-stack.md @@ -4,12 +4,12 @@ author = ["Michał Sapka"] date = 2023-07-19T19:08:00+02:00 categories = ["bsd"] draft = false -weight = 2001 +weight = 3001 primary_menu = "bsd" abstract = "How to setup the web server stack work?" [menu] [menu.bsd] - weight = 2001 + weight = 3001 parent = "openbsd" identifier = "obsdweb" name = "Webstack: Relayd, Httpd and Acme-Client" diff --git a/content/bsd/relayd-custom-webserver.md b/content/bsd/relayd-custom-webserver.md index d4b04fa..66fc1a6 100644 --- a/content/bsd/relayd-custom-webserver.md +++ b/content/bsd/relayd-custom-webserver.md @@ -4,12 +4,12 @@ author = ["Michał Sapka"] date = 2023-07-19T19:30:00+02:00 categories = ["bsd"] draft = false -weight = 2003 +weight = 3003 primary_menu = "bsd" abstract = "How to forward request to webserver?" [menu] [menu.bsd] - weight = 2003 + weight = 3003 identifier = "openbsd-forwarding-requests-from-relayd-to-a-custom-webserver" parent = "obsdweb" name = "Forwarding requests from Relayd to a custom webserver" diff --git a/content/bsd/thinkpad/_index.md b/content/bsd/thinkpad/_index.md index f96f182..3e1bd50 100644 --- a/content/bsd/thinkpad/_index.md +++ b/content/bsd/thinkpad/_index.md @@ -6,6 +6,8 @@ categories = ["bsd"] draft = false weight = 3001 primary_menu = "bsd" +image_dir = "bsd" +image_max_width = 600 abstract = "My my laptop on FreeBSD" [menu] [menu.bsd] diff --git a/content/bsd/thinkpad/fixing-resume-on-thinkpad-x1-extreme-g2-on-freebsd.md b/content/bsd/thinkpad/fixing-resume-on-thinkpad-x1-extreme-g2-on-freebsd.md index 4f1af8a..f85dad3 100644 --- a/content/bsd/thinkpad/fixing-resume-on-thinkpad-x1-extreme-g2-on-freebsd.md +++ b/content/bsd/thinkpad/fixing-resume-on-thinkpad-x1-extreme-g2-on-freebsd.md @@ -5,7 +5,9 @@ date = 2023-03-16T23:02:00+01:00 categories = ["bsd"] draft = false weight = 3005 -primary_menu = "bsd-thinkpad" +primary_menu = "bsd" +image_dir = "bsd" +image_max_width = 600 abstract = "you need to load the driver" [menu] [menu.bsd-thinkpad] diff --git a/content/bsd/thinkpad/fixing-thinkpad-x1-wifi-on-freebsd.md b/content/bsd/thinkpad/fixing-thinkpad-x1-wifi-on-freebsd.md index df2625b..6a05af0 100644 --- a/content/bsd/thinkpad/fixing-thinkpad-x1-wifi-on-freebsd.md +++ b/content/bsd/thinkpad/fixing-thinkpad-x1-wifi-on-freebsd.md @@ -5,7 +5,9 @@ date = 2023-08-03T21:40:00+02:00 categories = ["bsd"] draft = false weight = 3003 -primary_menu = "bsd-thinkpad" +primary_menu = "bsd" +image_dir = "bsd" +image_max_width = 600 abstract = "replacing a wificard fixes everything" [menu] [menu.bsd-thinkpad] @@ -39,9 +41,9 @@ After a few nags met with silence, I just gave up and ordered a used [Intel AC 9 Have I mentioned that ThinkPads are still good devices? Replacing the WiFi adapter was sparkly[^fn:4] but easy. Just pop the two antenna connectors, unscrew a single screw, remove the card, and do the same in reverse for the new one. Try to do that with a MacBook![^fn:5] -{{< img-c "intel-ac9260.jpg" >}} +{{< image class="centered" alt="Opened laptop with a screwdrive on top" file="intel-ac9260.jpg" >}} Sitting and working nicely -{{< /img-c >}} +{{< /image >}} Then, with a single reinstall[^reinstall] of the system, everything started working. I'm still limited to WiFi 2, but it works over 5GHz. diff --git a/content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md b/content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md index e61fca6..5b7a19a 100644 --- a/content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md +++ b/content/bsd/thinkpad/freebsd-configuring-nvidia-and-xorg-on-thinkpad-x1-extreme-g2.md @@ -5,7 +5,9 @@ date = 2023-03-16T23:02:00+01:00 categories = ["bsd"] draft = false weight = 3006 -primary_menu = "bsd-thinkpad" +primary_menu = "bsd" +image_dir = "bsd" +image_max_width = 600 abstract = "A tutorial on making Nvidia work" [menu] [menu.bsd-thinkpad] diff --git a/content/bsd/thinkpad/freebsd-on-thinkpad-x1-extreme-g2.md b/content/bsd/thinkpad/freebsd-on-thinkpad-x1-extreme-g2.md index 3dda5af..895f75e 100644 --- a/content/bsd/thinkpad/freebsd-on-thinkpad-x1-extreme-g2.md +++ b/content/bsd/thinkpad/freebsd-on-thinkpad-x1-extreme-g2.md @@ -5,7 +5,9 @@ date = 2023-02-25T22:30:00+01:00 categories = ["bsd"] draft = false weight = 3002 -primary_menu = "bsd-thinkpad" +primary_menu = "bsd" +image_dir = "bsd" +image_max_width = 600 abstract = "it works, but there are drawbacks" [menu] [menu.bsd-thinkpad] @@ -28,9 +30,9 @@ It's more involved than something like Fedora, and some concepts were foreign to Within 15 mins of booting from the USB Drive, I had a working hardened system running on an encrypted ZFS drive with wireless networking and essential services configured. -{{< img-c "freebsd-setup-fs.png" "https://docs.freebsd.org/en/books/handbook/bsdinstall/" >}} +{{< image source="https://docs.freebsd.org/en/books/handbook/bsdinstall/" class="centered" alt="White, all caps "Run BSD" over black background" file="freebsd-setup-fs.png" >}} Partitioning -{{< /img-c >}} +{{< /image >}} Many things worked out of the box, but not all of them. @@ -55,9 +57,9 @@ FreeBSD is supposed to be more user-friendly, but it seems not to be the case he Work on [fully supporting](https://wiki.freebsd.org/WiFi/Iwlwifi) the card is already planned, but I have no idea when I can expect results. From what I've learned, the team can't reuse code from Linux due to licensing incompatibilities between [GPL](https://www.gnu.org/licenses/gpl-3.0.html) and [BSD license](https://docs.freebsd.org/en/articles/license-guide/) [update: there are more problems]. -{{< img-r "freebsd-beastie.png" >}} +{{< image transparency="yes" src="https://docs.freebsd.org/en/books/handbook/bsdinstall/" forced_width="150" class="pull-right" alt="White, all caps "Run BSD" over black background" file="freebsd-beastie.png" >}} FreeBSD Beastie -{{< /img-r >}} +{{< /image >}} This is one of the few instances when I am rethinking my life choices, and I would love to be able to help with C code. Also, Bluetooth on this card is not supported, and there is no work done to address it - but luckily, I am already de-wirelessing my life. diff --git a/content/bsd/thinkpad/switching-between-speakers-and-headphones-on-freebsd.md b/content/bsd/thinkpad/switching-between-speakers-and-headphones-on-freebsd.md index 837be33..f317980 100644 --- a/content/bsd/thinkpad/switching-between-speakers-and-headphones-on-freebsd.md +++ b/content/bsd/thinkpad/switching-between-speakers-and-headphones-on-freebsd.md @@ -5,7 +5,9 @@ date = 2023-03-16T23:02:00+01:00 categories = ["bsd"] draft = false weight = 3004 -primary_menu = "bsd-thinkpad" +primary_menu = "bsd" +image_dir = "bsd" +image_max_width = 600 abstract = "How to change the audio sevices?" [menu] [menu.bsd-thinkpad] diff --git a/content/bsd/why-bsd.md b/content/bsd/why-bsd.md index 6bde63d..72ecf3a 100644 --- a/content/bsd/why-bsd.md +++ b/content/bsd/why-bsd.md @@ -4,14 +4,16 @@ author = ["Michał Sapka"] date = 2024-05-01T21:48:00+02:00 categories = ["bsd"] draft = false -weight = 2001 +weight = 2002 primary_menu = "bsd" +image_dir = "bsd" +image_max_width = 600 abstract = "Reasons why BSD may be the best OS for you" menu_item_override = "Why I run BSD on a PC" menu_item_override_start_li = true [menu] [menu.bsd] - weight = 2001 + weight = 2002 identifier = "why-i-run-a-bsd-on-a-pc" post = "but" +++ @@ -67,9 +69,9 @@ Netflix gives back, but it does not dictate the direction. But the biggest differential factor between BSDs and GNU/Linux is the way it is structured. -{{< img-r "run-bsd.png" >}} +{{< image forced_width="200" class="pull-right" alt="White, all caps "Run BSD" over black background" file="run-bsd.png" >}} RunBSD -{{< /img-r >}} +{{< /image >}} In Linux, all components are designed to work together, but are completely separate. You've got the kernel, init systems, multimedia daemons, userland, bootloader, virtualization and containerization mechanisms, package managers, and so on. @@ -140,9 +142,9 @@ More often than not, using BSD is just a next phase after being involved in Linu Also, it seems hard to be _only_ focused on BSD, so people being paid to do BSD work tend to do the same with GNU/Linux. All in all, I found the crowd to be very welcoming of new people. -{{< img-r "openbsd.png" >}} -RunBSD -{{< /img-r >}} +{{< image transparency="yes" forced_width="200" class="pull-right" alt="A yellow fish named puffy over the text - OpenBSD" file="openbsd.png" >}} +OpenBSD +{{< /image >}} You can find amazing people over at [bsd.cafe](https://wiki.bsd.cafe/) or [bsd.network](https://bsd.network/). The oldest public UNIX system, [SDF](https://sdf.org/) is running on NetBSD and quite a few of it's members are active in BSD community. diff --git a/content/bsd/why-not-bsd.md b/content/bsd/why-not-bsd.md index 881da81..2569094 100644 --- a/content/bsd/why-not-bsd.md +++ b/content/bsd/why-not-bsd.md @@ -4,14 +4,16 @@ author = ["Michał Sapka"] date = 2024-04-20T22:13:00+02:00 categories = ["bsd"] draft = false -weight = 2002 +weight = 2003 primary_menu = "bsd" +image_dir = "bsd" +image_max_width = 600 abstract = "Reasons why BSD may not be the best OS for you" menu_item_override = "perhaps you shouldn't" menu_item_override_end_li = true [menu] [menu.bsd] - weight = 2002 + weight = 2003 identifier = "bsds-may-not-be-a-system-for-you" +++ @@ -94,7 +96,7 @@ Ever used the basic _Shell_? Too bad, as _Shell_ is what you should assume in all your scripts. -## Pace of change {#pace-of-change} +## Pce of change {#pce-of-change} Next: do you like to call yourself an _early adopter_? Being in the _bleeding edge_ is what gets you going? |