Attempting to configure a virtual machine connected to the local network

I am trying to install/configure a virtual machine for Alpine Linux since I figured Jellyfin in a container might be the best / "easiest" way to access my media files from my new Android TV. But all I have accomplished so far, after booting Alpine from inside the vm, is to disconnect my own remote headless server from the network.

Thanks to anticipation, I can still SSH log in to my server using the wireless interface.
I have strictly followed the FAQ's last section (VMs on the real network), except my wired interface is re0 and not em0.

Here is my server's current configuration, before I return it to normal awaiting the next attempt:

srv$ cat /etc/hostname.athn0                                                                                                                                                                                    
join sylvainsab wpakey *******
inet autoconf
inet6 autoconf
srv$ cat /etc/hostname.re0                                                                                                                                                                                      
up
srv$ cat /etc/hostname.veb0                                                                                                                                                                                     
add re0
add vport0
up
srv$ cat /etc/hostname.vport0                                                                                                                                                                                   
inet autoconf
inet6 autoconf
up
srv$ more /etc/vm.conf                                                                                                                                                                                          
switch "my_switch" { interface veb0 }
vm alpine {
        disable
        memory 4G
        boot device disk
        disk /var/www/jellyfin/alpine_jellyfin.qcow2
        cdrom /var/www/jellyfin/alpine-virt-3.24.2-x86_64.iso
        local interface { switch "my_switch" } 
}

What might I be doing wrong ?

reddit.com
u/sylvainsab — 11 days ago
▲ 2 r/kodi

Kodi unable to connect to local media/file server

Hello,

I installed Kodi on my new Thomson 55MG7C15 smart TV with the intention to watch my film/series collection that is hosted on a local OpenBSD server.

Unfortunately, Kodi seems unable to connect to my server. I have first tried to connect via SFTP (add-on), then via NFS (natively supported), with the same error : Unable to connect : “The connection to the network location couldn't be established This could be due to the network not being connected. Would you like to add it anyway?” Yes/No.

The only reason I can think of for this is that I would not use an address of the correct format. What else could it be ? And how can I be sure that the address I enter is in the correct format for either SFTP or NFS ?

Cheers

reddit.com
u/sylvainsab — 11 days ago
▲ 26 r/BSD

*BSD general use case examples

I just updated a short article on the BSD's. I have notably tried to help make more sense of these obscure systems for the ordinary bycomer, by finding notable examples of real use cases by major actors.

As of now, I basically have :

  • Four big tech companies (FreeBSD)
  • NASA (NetBSD)
  • Military (OpenBSD)

Would you agree that these are good examples ? If not, would you have any better ones ?

Thank you

PS Some will say I should add DragonFly to the list. Maybe, but I don't know enough about this OS for now. In the future enhancements of this article, I would also like to mention more directly UNIX and its creators at Bell Labs. This will be done sooner or later.

u/sylvainsab — 1 month ago

Is this good for a suckless start ? (C & shell newbie)

Hello,

Since yesterday I have made what feels like a stratospheric step forward while learning how to actually implement getopt/getopts in C and shell (pdksh/ksh88) scripting, respectively.

I am also enthralled by the suckless philosphy of minimalism, clear code, and sane defaults.
Having put forward three basic scripts, I wonder if you would like to review them and comment on any defects and/or good practices ? See below :

nwpg (training script)

#!/bin/ksh

PROGRAM_NAME="nwpg" ;
PROGRAM_VERSION="0.2" ;
USAGE="usage: nwpg [-l language] [-d directory] project_title" ;

#		nwpg (NeW ProGram)
#	    pdksh/ksh88 version
#	Simple script that initiates a new project
#	in the user's $HOME/hax directory.
#	Such a project consists of a parent folder
#	named after the project	and three files:
#	the algorithm, the code, the documentation,
#	i.e. main.algo, main.c, main.md 
# 

DEFAULT_DIR="$HOME/hax/" ;
DEFAULT_LANGUAGE="C" ;
COUNT_ARGS="$#";
integer dir_flag=0 ;
integer lang_flag=0 ;

if [[ $COUNT_ARGS -eq 1 || $COUNT_ARGS -eq 3 || $COUNT_ARGS -eq 5  ]]
then
	eval project_title=\${$#} ;
else
	echo $USAGE;
	exit 2 ;
fi

while getopts 'l:d:' opt ;
do
	case $opt in
		d)
			integer dir_flag=1 ;
			directory="$OPTARG" ;;
		l)
			integer lang_flag=1 ;
			language="$OPTARG" ;;
		?)
			echo $USAGE ;
			exit 2 ;;
	esac
done
shift $(($OPTIND - 1))

if [ $dir_flag -eq 1 ]
then
	PROJECT_FULL_PATH="$directory/$project_title" ;
else
	PROJECT_FULL_PATH="$DEFAULT_DIR/$project_title" ;
fi

if [ $lang_flag -eq 0 ]
then
	language="$DEFAULT_LANGUAGE" ;
fi

case "$language" in
	C | c )
		FILE_EXT="c" ;;
	Python | PY | Py | python | py )
		SHEBANG='#!/usr/local/bin/python' ;
		FILE_EXT="py" ;;
	Rust | RS | Rs | rust | rs )
		FILE_EXT="rs" ;;
	Ruby | RB | Rb | ruby | rb )
		FILE_EXT="rb" ;;
	Shell | sh )
		SHEBANG="#!/bin/sh" ;
		FILE_EXT="sh" ;;
	PYTHON | RUST | RUBY )
		echo "Don't shout !\n" ;
		exit 2 ;;
	* )
		echo "unsupported language: $language" ;
		exit 2 ;;
esac

mkdir -p "$PROJECT_FULL_PATH" ;
touch "$PROJECT_FULL_PATH/"main.{$FILE_EXT,algo,md} ;
if [ -n "$SHEBANG" ]
then
	echo "$SHEBANG\n" >> "$PROJECT_FULL_PATH/main.$FILE_EXT" ;
fi
echo "$FILE_EXT files created in $PROJECT_FULL_PATH" ;

#
#		TODO
#
#	Support more languages / file extensions
#
#

example_C_skel

#include <stdio.h>
#include <unistd.h>

#define PROGRAM_NAME "example_skel"
#define VERSION_NUMBER "0.0"

void print_version()
{
	printf("%s version: %s", PROGRAM_NAME, VERSION_NUMBER);
}

void print_usage(FILE *out)
{
	fprintf(out, "usage: %s [-v] [-h]", PROGRAM_NAME);
}

int main(int argc, char *argv[])
{
	int opt;
	
	while((opt = getopt(argc, argv, "vh")) != -1)
	{
		switch(opt)
		{
			case 'v':
				print_version();
				exit(0);
			case 'h':
				print_usage(stdout);
				exit(0);
			default:
				print_usage(stderr);
				exit(2);
		}
	}
}

mnt_perms (a script I actually use – not online yet)

#!/bin/sh

PROGRAM_NAME="mnt_perms.sh";
PROGRAM_VERSION="0.1";
USAGE="usage: mnt_perms.sh [[-a] | [-f] [-m] [-t] | [-h] | [-v]]";

#
#   mnt_perms.sh
#
# Basic script used to recursively set/reset 
# permissions to defaults on /mnt subdirectories.
# Tested on openbsd.
#

COUNT_ARGS="$#";
integer fam_flag=0;
integer media_flag=0;
integer torrents_flag=0;

function reset_fam {
        chown -R root:famille /mnt/fam ;
        chmod 770 /mnt/fam ;
}

function reset_media {
        chown -R sylvain:media /mnt/mdia/[A-Z][1-9]* ;
        find /mnt/mdia/[A-Z][1-9]* -type d -exec chmod 750 {} \; ;
        find /mnt/mdia/[A-Z][1-9]* -type f -exec chmod 640 {} \; ;
        chown sylvain:media "/mnt/mdia/Z0 Drop" && chmod 770 "/mnt/mdia/Z0 Drop" ;
}

function reset_torrents {
        chown -R root:wheel /mnt/trt ;
        find /mnt/trt -type d -exec chmod 775 {} \; ;
        find /mnt/trt -type f -exec chmod 664 {} \; ;
}

if [ $COUNT_ARGS -eq 0 ]
then
        print "$USAGE";
        exit 2;
fi

while getopts 'afmt' opt ;
do
        case $opt in
                a)
                        integer fam_flag=1;
                        integer media_flag=1;
                        integer torrents_flag=1;;
                f)
                        integer fam_flag=1;;
                m)
                        integer media_flag=1;;
                t)
                        integer torrents_flag=1;;
                h)
                        print "$USAGE";
                        exit 0;;
                v)
                        print "$PROGRAM_NAME version $PROGRAM_VERSION";
                        exit 0;;
                *)
                        print "$USAGE";
                        exit 2;;
        esac
done
shift $(($OPTIND - 1))

if [ $fam_flag -eq 1 ]
then
        reset_fam;
fi
if [ $media_flag -eq 1 ]
then
        reset_media;
fi
if [ $torrents_flag -eq 1 ]
then
        reset_torrents;
fi

Cheers ! PS Here's a bonus in case you fell like this post was not worth it. There's also an older, more ambitious and complex program : geomant.

u/sylvainsab — 1 month ago
▲ 18 r/openbsd

increasing/modifying xterm's default bitmap font's size

I suppose the reason is that xterm was made when monitors had a much narrower DPI rate. In any case, on both two laptops (M1 MacBook Air, Asus PU551) with a fresh openbsd install where I'm willing to go with the default as much as possible, xterm's font is insanely small and makes my eyes pain.

I have not succeeded in finding for a solution while looking through the (very lenghty) manual page for xterm, nor searching through the web meeting various people who faced the same issue.

Has anyone here managed to use/keep xterm's default setup (I am satisfied with the bitmap font), while permanently making the font larger using the .Xresources file or something else ?

reddit.com
u/sylvainsab — 2 months ago
▲ 21 r/openbsd

Dumb question – httpd and the need for relayd

Reading about the newly introduced support for HTTP headers in httpd makes me review the few things I believed I understood about httpd in OpenBSD and self-hosting.

My concern was regarding getting the "highest marks" on various HTTPS/TLS security assessment web resources (unfortunately I can't find the blog post back that goes over the most of them in details). I used to think that relayd was mandatory for this, then I thought httpd would now do the trick since it supports sending headers, then I realized it's not just about headers (or is it ?).

I had quite a pain trying to understand why/how to configure relayd to get those good marks. Maybe it would be a bit different now. Nevertheless, my question remains : can those best "secure (TM)" marks be obtained simply with the current httpd ? How does this new feature change the required configuration ? Are we to expect that it is going to get simpler and we shall see refreshed web tutorials swarming after the next release of OpenBSD ?

reddit.com
u/sylvainsab — 2 months ago