by ~de_alchmst
So In the previous entry I takled about how I have two computers so that I can use multiple OSes at the same time without virtualisation. The setup still looks the same: One perfectly good thinkpad next to second bastardised one with a external monitor sitting on top of it connected via ethernet ports.
The main one is connected to the monitor via a USB-C. Turns out USB-C can do DisplayPort connection while also serving power. NEAT!
I'm still not sure if I somehow pseudo-permanently mount (I feel like english is leaving my body again) the screen to the laptop.
I don't think I can mount it while keeping the keyboard attached. It would probably make it more convenient for transport, but it would also be nice to be able to just connect the monitor to the second computer and use that in case the main one breaks.
Well, maybe I just get one of those foldable keyboards or something...
So my current theory I operate on is the following:
In terms of operating systems, you can measure them on a scale based on how well are they designed. This measures how well do they behave, how much control you have, how much bloat there is... This affects all the tasks where you actually use your OS as something more than just a web browser launcher that also sometimes launches games or office programs.
Some of you might say that office programs are actually using the OS, as you manage a lot of files and stuff. well, first of all, I agree with you. But the cloud has abstracted a lot of this, so that the physical computer does not actually mean anything. Also, and I talk from personal experience, many people who are paid to work with office programs do not know even the basics like some files existing outside of the desktop icons.
In short, Raskin was right.
Depression aside, you can imagine the scale as Windows 11 (somehow worse than 10) being one extreme and OpenBSD supposedly being on the other (I need more testing to prove prove) (also I don't count plan9, as I still haven't tried it out)
Then there is the scale of supported software. It tends to be that worse OS has more software.
This makse sense. At first you had the bad stuff. Then people came and made it better, but it's hard to make people switch. Therefore more people use the worse stuff, which means it's more relevant for devs.
Linux seems to be a compromise between the two, and by this, I meed the good kind. You have the UNIX base and it's very customisable if you are dedicated. It can also run most software that you need (or at least some good enough alternative), as long as you don't depend on one very specific and very proprietary thing. Wine has also come a long way, so you can even game now!
I, however, decided to try a different route.
Compromise, no matter how good, is still a compromise after all.
Most things I use computer for can be done on a better OS (OpenBSD, or at least I still think that it's better) and the few I can't are mostly the just-lanuch type. (VMs, games, a bit of office, whatever weird thing people want you to use)
So instead I use both extremes at the same time in a way where I'm mostly not affected by the flaws of Windows.
Plus I also get a second computer to do resource-heavy things on. (yay!)
So originally I wanted to use the second laptop's screen, have both computers melted together like some weird body horror and switch between them via KVM.
This was heavily dependent on the fact that laptops use embeded DisplayPort. Turns out there are not only no official standards on how to do this, but Lenovo decided to use one conector not only for the eDP, but also some other stuff, which means I cannot just transform it to DP. After a bunch of things not working at all because I'm severly uninformed and underqualified for any of this, I just gave up, got a proper external monitor and decided to do the connection via software only.
Also turns out the melting (again, my english is fucked today, sorry) would be more complex than I expected due to physics reasons.
Well, this is it now. Not that cool, but at least it works... Right?
As I already stated, I use Moonlight for remote connection. More specifically, I use the Sunshine server and the QT frontend that is even included in OpenBSD ports.
It is not that simple tho.
First, I run a dhcp server on my main machine. I could set everything statically, but this is more fancy, so I'm doing that. Next, I want the Windows machine to be able to access the internet. For this I made a NAT in pf.conf(5)
ext_if = "iwm0" int_if = "em0" pass out on $ext_if from $int_if:network to any nat-to $ext_if
It feels a bit weird doing NAT from ethernet to Wi-Fi, but hey, it works.
It still has it's Wi-Fi card, even tho I still need to rip the antenas from the monitor and apply them somehow. But I don't want to connect to every Wi-Fi twice, so NAT it is. (Also, it's probably safer to not connect Windwos PC directly to same shady cafe Wi-Fi)
I have originally played with the idea of blocking all access to Microsoft servers, but If I wan't to go the paranoid route, Might as well do it right. I don't know of all servers that Microsoft owns, so I would need to either go with whitelisting method or cut off internet access entirely and do all the internet stuff via WSL. It is still a interface in the possession of Windows tho, so I would still not believe it.
For now, I satteled with having winutil delay feature updates by 2 years.
It's not like I'll be doing anythng secret on that machine anyways. *wink*
Anyways, I would also prefer to have some way to actually work on both, as in having a shared filesystem. (funfact: WSL uses the 9p) protocol) For sharing files between *nix and Windows machines, samba is the way to go. I installed samba and, with the help of AI ,applied the following config file:
[global] workgroup = WORKGROUP netbios name = OPENBASED security = user log file = /var/log/samba/log.%m max log size = 50 interface lo0 em0 bind interfaces only = yes allow insecure wide links = yes [shared] path = /home/samba browseable = yes writable = yes valid users = @sambausers write list = @sambausers oplocks = no level2 oplocks = no sync always = yes #unix extensions = no wide links = yes follow symlinks = yes
(and yes, I named my server OPENBASED. It was late at night and I'm not changing it now. Shame is for the weak!)
I made a '/home/samba' folder ('/home' partition has most space) and gave it to the 'sambausers' groups. I also added myself into it:
sudo usermod -G sambausers de-alchmst
(^C didn't alllow '-' in name, don't look for anything deep in it)
I also had to add a login to samba:
sudo smbpasswd -a de-alchmst
If you add user whose name and password matches your windows user, you can login without entering a password.
I added the 'allow insecure wide links' part to allow myself to share file without needing to copy it and then copy it back. It is unsecure, so don't do it on an open server.
Also as far as AI goes, It knows about OpenBSD basics, but it seems to forget that it uses doas(1) and not 'sudo'.
Maybe just most people install sudo instead? IDK.
Anyways, now I could mount the server as a disk in windows via rightclicking the 'This PC' and selecting 'Map network drive' option.
I like filesystems...
There was however one more thing that bothered me. Moonlight, while great for some stuff, does lack one important feature: shared clipboard.
I took this as a challenge and coded my own sharing deamon using the samba connection in shell.
#!/bin/sh save_file="/home/samba/clipboard.txt" prev="" while true; do file="$(cat $save_file | tr -d '\r')" # unix line endings curr="$(xsel --clipboard)" # other system changed if [ "$file" != "$prev" ]; then prev="$file" printf '%s' "$file" | xclip -selection clipboard # I changed elif [ "$prev" != "$curr" ]; then prev="$curr" printf '%s' "$curr" > $save_file fi sleep 0.5 done
Then I asked AI to translate it to powershell, but it also gave me python. The powershell was adding a bunch of newlines, but the python worked. (after one 'try:' added)
The shell version seems to break when called at login, so I switched to the python version even on the OpenBSD side.
#!/usr/local/bin/python3 import pyperclip import time import os save_file = r"/home/samba/clipboard.txt" # Use raw string for Windows paths prev = "" while True: try: # Read file content with open(save_file, 'r', encoding="utf-8") as f: file_content = f.read().strip() # Get current clipboard curr = pyperclip.paste() # External system changed file if file_content != prev: prev = file_content pyperclip.copy(file_content) # Local clipboard changed elif prev != curr: prev = curr with open(save_file, 'w', encoding="utf-8") as f: f.write(curr) except: pass time.sleep(0.5)
EIDT: encoding must be added in order for non-ascii characters to be copied from windows
I still think python is a terrible scripting language, but it has the libraries...
I also learned a few things about scripting on Windows.
First, you can autostart scripts either by putting them in a specific directory (Shell:startup from the run menu), or by linking them from the task scheduler. The task scheduler way is way faster, so just use that.
Also if you wan't to run python without an empty terminal hanging, call it using the 'pythonw' command instead.
And now armed with shared clipboard, I could edit in fullscreen PowerPoint on one monitor and OpenBSD Firefox on the other without any limits. (yes, moonlight cannot do multiple monitors)
I call this a success of questionable usefulness.
Some other stuff that happened:
I cannot seem to compile ex:forth. It is caused by OpenBSD libc being different from glibc and some library being included instead of being external and stuff. I (by which I mean AI) will look into this more later.
While playing with dd(1) , I kinda bricked myself. I got confused and stuff... Shit happens, OK.
It was quick to reinstal, ~2h, most time spend waiting for software to finish installing. I should probaly start taking backups of entire system images.
As I believe I was at fault, I will give it a pass this time, but if it breaks again, I'm going back to linux.
I decided to give common lisp a try again. I also want to finish ex:forth, so we'll see how it goes. When I compiled a cl project, I was unable to run it. It complained about not being able to allocate memory and directed you to 'ulimit'. (no link, because shell builtin)
Turns out it has nothing to do with 'ulimit', but it's OpenBSD's feature W^X. It is by default enabled on all partitions except '/usr/local'. You can easily fix it by adding 'wxallowed' to the '/home' partition as well.
It's little things like this that make me reconsider OpenBSD. I see what are they going for, but I'm kinda starting to prefer the Linux rule of not breaking userspace. (Am I turning vanilla?)
Also font sizes behaved weirdly. Turns out by dpi was broken, so I just had to add 'xrandr --dpi 96' to my '.xsession'.
I'm still not sure how good OpenBSD truly is, but I feel like this setup would still be nice even with Linux.
I'll keep testing, see you later. (you can subscribe to rss but no pressure)