diff --git a/content/tech/_index.md b/content/tech/_index.md new file mode 100644 index 0000000..76f61b0 --- /dev/null +++ b/content/tech/_index.md @@ -0,0 +1,8 @@ ++++ +title = "Tech" +sort_by = "date" +template = "blog.html" +page_template = "post.html" ++++ + +Here you can see some useful tips and tricks that I encountered that helped me use \*NIX operating systems more effectively. diff --git a/content/tech/freebsd.md b/content/tech/freebsd.md new file mode 100644 index 0000000..731fa44 --- /dev/null +++ b/content/tech/freebsd.md @@ -0,0 +1,67 @@ ++++ +title = "FreeBSD Tips and Tricks" +date = 2025-06-12 +slug = "freebsd" ++++ + +# GPU Drivers + +On June 10, 2025, the new FreeBSD 14.3 was released and I decided to try it out. After installing the OS from a USB stick on my bare-metal box (very smooth installation process by the way) I was greeted with the TTY login prompt. Using the built-in `pkg` package manager, I installed my favorite window manager, sway, which unfortunately failed to launch with a cryptic error message "No displays found". After looking in the very helpful [FreeBSD Handbook](https://docs.freebsd.org/en/books/handbook/x11/), it turned out that the GPU drivers weren't preinstalled in the OS, so I had to install them manually and add the respective kernel module to automatically load during boot. + +``` +pkg install drm-kmods +sysrc kld_list+=i915kms # replace by amdgpu if using an AMD GPU +``` + +Unfortunately this was not enough, the system still wasn't able to start the graphics. After looking at the logs for some time, I found out that the version of the kernel modules responsible for the GPU drivers wasn't updated for the latest kernel revision yet. Fortunately, FreeBSD developers have a separate repository called `FreeBSD-kmods` with updated drivers so that I didn't need to compile the ports (BSD lingo for source-based packages) manually. However, this repository wasn't enabled by default, so I had to force the package manager to update from it. + +``` +pkg upgrade -r FreeBSD-kmods +``` + +This was enough to make sway launch (by using `seatd-launch sway`, as the post-install message from the `seatd` package mentioned) and fully use it to the best of its abilities. + +# (Wired) 802.1x authentication + +My university uses an `802.1x` authenticated network (both wired and wireless) on campus, in order to connect to it, I had to use `wpa_supplicant` with the following configuration (`/etc/wpa_supplicant.conf`) + +``` +network={ + key_mgmt=WPA-EAP + eap=PEAP + phase1="peaplabel=0" + phase2="auth=MSCHAPV2" + identity="user@school.edu" + password="password" +} +``` + +After that it was enough to make sure that the wired interface (in my case `em0`) used the supplicant (`/etc/rc.conf`) and restart the network configuration service `netif`: + +``` +sysrc ifconfig_em0="WPA SYNCDHCP" # replace em0 by your interface name +service netif restart +``` + +TODO: In the current state of things, certificates aren't checked during the connection process. It is a good idea + +# `i3status` not using colors + +This was merely a quality-of-life issue that for some reason `i3status` fails to detect that it should format its output for `swaybar` to parse it, therefore I had to force it in the config (`~/.config/i3status/config`) + +``` +general { + colors = true + interval = 5 + output_format = "i3bar" +} +``` + +# Wireguard + +Since FreeBSD 14, FreeBSD has excellent support for Wireguard VPNs. I just had to install the `wireguard-tools` package (`pkg install wireguard-tools`), copy my config to `/usr/local/etc/wireguard/` and add the following two lines to `/etc/rc.conf` to automatically configure the connection at boot: + +``` +wireguard_enable="YES" +wireguard_interfaces="wg0" +``` diff --git a/static/firacode.ttf b/static/firacode.ttf new file mode 100644 index 0000000..bd73685 Binary files /dev/null and b/static/firacode.ttf differ diff --git a/static/style.css b/static/style.css index d2e4d15..cdb8a15 100644 --- a/static/style.css +++ b/static/style.css @@ -141,7 +141,6 @@ h4 { object-fit: cover; } - .left { float: left; margin: 0; @@ -183,3 +182,12 @@ h4 { filter: invert(1); } } + +@font-face { + font-family: firacode; + src: url(firacode.ttf); +} + +code { + font-family: firacode; +} diff --git a/templates/base.html b/templates/base.html index 16d9a69..ac6c0b9 100644 --- a/templates/base.html +++ b/templates/base.html @@ -12,6 +12,7 @@ <a href="https://git.brloh.is">git/</a> <a href="/lang">lang/</a> <a href="/math">math/</a> + <a href="/tech">tech/</a> <a href="/travel">travel/</a> <span class="right"> Bear's den 🐻 diff --git a/templates/blog.html b/templates/blog.html index da6548c..03b76e2 100644 --- a/templates/blog.html +++ b/templates/blog.html @@ -6,7 +6,7 @@ {% block nav %} <ul> - <li><a href="{{ section.permalink | safe }}">{{ section.title | lower }}/</a></li> + <li><a href="{{ section.permalink | safe }}">./</a></li> {% for page in section.pages %} <li><a href="{{ page.permalink | safe }}">{{ page.slug }}/</a></li> {% endfor %} diff --git a/templates/post.html b/templates/post.html index d4080fc..c98c97e 100644 --- a/templates/post.html +++ b/templates/post.html @@ -9,7 +9,7 @@ <!-- If you are using pagination, section.pages will be empty. You need to use the paginator object --> {% set section = get_section(path=page.ancestors | last) %} - <li><a href="{{ section.permalink | safe }}">{{ section.title | lower }}/</a></li> + <li><a href="{{ section.permalink | safe }}">../</a></li> {% for p in section.pages %} <li><a href="{{ p.permalink | safe }}">{{ p.slug }}/</a></li> {% endfor %}