Re: I did not realize I was an OpenBSD user!

2021-12-27 Thread Brian Brombacher
Hi David,

Thank you for the write-up, this was an awesome read.  I was on the edge of a 
cliff waiting to hear what device or app you replaced next.

Bravo, excellent job done!

-Brian

> On Dec 27, 2021, at 1:03 AM, David Rinehart  wrote:
> 
> A long read, but may be interesting...
> 
> I Wanted to get into a nix OS at home, after being away for many 
> years. Researched a short list of nix OSs. To be honest, OpenBSD was at 
> the bottom of the list due to text install and what seemed like a 
> limited list of ports. Tried the others. If I got an install I liked, 
> they all failed on updates with various script errors. I can 
> troubleshoot and fix script errors - the point is I want to spend time 
> working on my code. I was down to my last option - OpenBSD.
> 
> I'd been watching CDE progress to open source - Fond memories of a Sun / 
> Solaris / CDE environment. When CDE / MWM did go open source, OpenBSD 
> was supported. I did the OpenBSD / CDE install on my desktop at the end 
> of 2018 and it has been great. I've since moved on to a more modern 
> window manager but CDE got my foot in the door.
> 
> When it came time to update to a new OpenBSD version I did a clean 
> install and started scripting my custom changes. From long ago, I prefer 
> not to upgrade in place, due to the cruft. Sure I could figure out a way 
> to analyze what is not needed but why bother. The OpenBSD install is so 
> simple and fast. I install, run a script to configure and then have a 
> shiny new machine. For small server roles, it takes 15-20 minutes to 
> reinstall. Desktop machines take an hour or so, due to ports installs. 
> With other OSs it would take several days to reinstall my desktop, 
> including base system, latest drivers, GUI apps and then customizing all 
> the settings. Scripting configuration and package installs is so much 
> simpler.
> 
> Then, I replaced my DNS / DHCP / NTP / Web server with OpenBSD. At this 
> point, I started going fanless for new machines - APU2D4 (now APU2E4) is 
> more than needed but provides headroom for the future. I studied and 
> configured unbound and it has been so stable. I've had a home web server 
> for years which migrated from PERL to C# to C++ and from plain HTML to 
> Angular with JQuery Mobile. I migrated this code to run with httpd 
> slowcgi (sort of like a poor man's serverless config - perfect for home 
> use).
> 
> Next, I had several off the shelf systems I wanted to replace - 
> Multi-room audio, NAS, VPN Router, Wifi AP.  I estimated the lines of
> code running on my existing home network and the numbers were crazy.
> 
> For multi-room audio, I set up a proof of concept with some old 
> computers and configured mpd to use sndio. It worked great. I purchased 
> several more APU2D4 machines and USB Behringer UCA202 DACs for the 
> audio. I created C++ microservices to run with httpd slowcgi and build / 
> send mpc commands to control mpd. Simple, no library dependencies and 
> easy to update / test. Maybe someday I'll change the interface but this 
> has been working well. For UI, I created a page to select a room and 
> send commands. Wanting a single volume control, I opted to expose master 
> volume (rather than mpd volume). I needed to select music, so I created 
> another page to access music data. I'm only really interested in 
> playlists, artists, genres and songs, so I provided these in the song UI 
> and allow adding to the queue of whatever room is currently selected. 
> Each room can operate independently or output to multiple rooms.
> 
>> From the beginning I have used amd to mount NAS NFS shares. Tweaked the 
> mount_nfs parameters to get better throughput - It is great.
> 
> With the concept of rooms on the web page, I added more remote control 
> features. I control all infrared home audio and video devices with IP2IR 
> from Global Cache. Used to have an app (that had issues) - replaced it 
> with my web page. Then, added control of a home theater receiver using 
> it's REST API.
> 
> In my spare time, I had created a mobile first remote control for the 
> whole home audio and video. Put all the remotes in a drawer. With one 
> web page, it works across-platforms on any device with a browser (all 
> types of phones, desktops, tablets) with zero install. The page 
> refreshes when others make changes, so there are no issues with synch 
> across clients.
> 
> With a few nodes on my network, I wanted to see status over time. I used 
> d3js to create a network diagram web page. Added an APU2 machine to the 
> network for running cron jobs. Added a script to create SVGs for CPU, 
> memory, network and disk from symux RRD files. Now click a node in the 
> diagram and see the machine stats. I can change the time reference for 
> the last 24 hours, 7 days, 30 days or year. The SVG charts are built on 
> a schedule, based on priority of the machines. It is incredible to have 
> this visibility. Always wanted to monitor my network over time but did 

I did not realize I was an OpenBSD user!

2021-12-26 Thread David Rinehart
A long read, but may be interesting...

I Wanted to get into a nix OS at home, after being away for many 
years. Researched a short list of nix OSs. To be honest, OpenBSD was at 
the bottom of the list due to text install and what seemed like a 
limited list of ports. Tried the others. If I got an install I liked, 
they all failed on updates with various script errors. I can 
troubleshoot and fix script errors - the point is I want to spend time 
working on my code. I was down to my last option - OpenBSD.

I'd been watching CDE progress to open source - Fond memories of a Sun / 
Solaris / CDE environment. When CDE / MWM did go open source, OpenBSD 
was supported. I did the OpenBSD / CDE install on my desktop at the end 
of 2018 and it has been great. I've since moved on to a more modern 
window manager but CDE got my foot in the door.

When it came time to update to a new OpenBSD version I did a clean 
install and started scripting my custom changes. From long ago, I prefer 
not to upgrade in place, due to the cruft. Sure I could figure out a way 
to analyze what is not needed but why bother. The OpenBSD install is so 
simple and fast. I install, run a script to configure and then have a 
shiny new machine. For small server roles, it takes 15-20 minutes to 
reinstall. Desktop machines take an hour or so, due to ports installs. 
With other OSs it would take several days to reinstall my desktop, 
including base system, latest drivers, GUI apps and then customizing all 
the settings. Scripting configuration and package installs is so much 
simpler.

Then, I replaced my DNS / DHCP / NTP / Web server with OpenBSD. At this 
point, I started going fanless for new machines - APU2D4 (now APU2E4) is 
more than needed but provides headroom for the future. I studied and 
configured unbound and it has been so stable. I've had a home web server 
for years which migrated from PERL to C# to C++ and from plain HTML to 
Angular with JQuery Mobile. I migrated this code to run with httpd 
slowcgi (sort of like a poor man's serverless config - perfect for home 
use).

Next, I had several off the shelf systems I wanted to replace - 
Multi-room audio, NAS, VPN Router, Wifi AP.  I estimated the lines of
code running on my existing home network and the numbers were crazy.

For multi-room audio, I set up a proof of concept with some old 
computers and configured mpd to use sndio. It worked great. I purchased 
several more APU2D4 machines and USB Behringer UCA202 DACs for the 
audio. I created C++ microservices to run with httpd slowcgi and build / 
send mpc commands to control mpd. Simple, no library dependencies and 
easy to update / test. Maybe someday I'll change the interface but this 
has been working well. For UI, I created a page to select a room and 
send commands. Wanting a single volume control, I opted to expose master 
volume (rather than mpd volume). I needed to select music, so I created 
another page to access music data. I'm only really interested in 
playlists, artists, genres and songs, so I provided these in the song UI 
and allow adding to the queue of whatever room is currently selected. 
Each room can operate independently or output to multiple rooms.

>From the beginning I have used amd to mount NAS NFS shares. Tweaked the 
mount_nfs parameters to get better throughput - It is great.

With the concept of rooms on the web page, I added more remote control 
features. I control all infrared home audio and video devices with IP2IR 
from Global Cache. Used to have an app (that had issues) - replaced it 
with my web page. Then, added control of a home theater receiver using 
it's REST API.

In my spare time, I had created a mobile first remote control for the 
whole home audio and video. Put all the remotes in a drawer. With one 
web page, it works across-platforms on any device with a browser (all 
types of phones, desktops, tablets) with zero install. The page 
refreshes when others make changes, so there are no issues with synch 
across clients.

With a few nodes on my network, I wanted to see status over time. I used 
d3js to create a network diagram web page. Added an APU2 machine to the 
network for running cron jobs. Added a script to create SVGs for CPU, 
memory, network and disk from symux RRD files. Now click a node in the 
diagram and see the machine stats. I can change the time reference for 
the last 24 hours, 7 days, 30 days or year. The SVG charts are built on 
a schedule, based on priority of the machines. It is incredible to have 
this visibility. Always wanted to monitor my network over time but did 
not have the tools.

Next, with some experience and confidence with OpenBSD, I replaced the 
VPN router with an APU2 gateway. Simple install with pf and more stats 
for the network diagram.

Auto-update - at this point, I created cron jobs to update all machines 
during off-hours. I don't notice the updates unless I look at uptime on 
the machines.

I bought two more APU2 machines and configured