Friday, December 20, 2024

GUIX Package Manager

 For those who don't know, GUIX is a package manager for Linux. It is supposed to work across all (or most) Linux distributions and provides some level sand boxing between applications. There is also a distribution based entirely on this software. It is supposed to be an alternative to Flatpak and Snap, both of which have their own problems.

Yesterday I spent the day messing around with it. I installed the distro on my test machine, I also tried it on an clean install of Debian. I have used a lot of package managers over the years, Apt, Yum, Pacman, Portage, and yes, Flatpak and Snap, I have used most all of them at one point or another. Guix is without a doubt the worst package manager I have ever used. I have no idea who thought this package manager implementation was a good idea, but I hope they did not quit their day job to develop this garbage.

First the things I liked; Nothing, I didn't like anything about Guix. It does nothing Flatpak or Snap doesn't do, it brings no new ideas or technology to the table, it is just a terrible implementation of a good idea.

Things I didn't like. Fuck where do I start. The Guix distribution took half a day to install a basic system and I do mean basic, no web browser, no email client, nothing more complex than a text editor. Debian takes 30 minutes for a full install, bells, whistle and all. On top of that once I had it install, it was taking up close to 20 GB of storage, what the hell Guix? A full install of Debian comes in well under 5 GB.

Once I had the basic install, I started installing programs, that was a bloody mistake. Every program took half an hour to install and a boat load of other packages would install with it, often simply reinstalling packages that were already on the system. To make things worse, commonly used programs like Firefox and Thunderbird were not available. I either had to compile from source or use Guix equivalents, Icecat and Icedove. Which apparently are freer and more open sourcey than Firefox and Thunderbird, but lack just about every feature implemented in those two programs in the last 5 years.

After nearly 8 hours of screwing about with the distro and still not having a system I could use as a daily driver, I gave it up. I installed a basic install of Debian and whittled it down to the same state the basic install of Guix gave me, as I said earlier, this took me less than 30 minutes to accomplish. I then installed the Guix package manager on this poor machine. Guix immediately brought all its worst features to Debian. It took over an hour to pull down its repository information and then promptly installed a bunch of packages that already existed on the system, which took an hour. Then I tried to install Icecat, and it repeated the same bullshit it did on its own distro and after half an hour when it was finished, I could not actually run Icecat. It was not on the menu and I could not run it from the command line. At this point, I was done with Guix.

No one should be using Guix. I would recommend Gentoo Linux before I would recommend Guix as a distribution. Debian + Flatpak will give you everything Guix gives you, but you will have more storage left, you will spend far less time managing it and you will not hate your computer and yourself everyday. If you want a challenge, install Arch Linux, install Gentoo, heck to Linux from Scratch, but please for the love of god, do not use Guix, don't encourage them.

Sunday, December 1, 2024

Minimalist Linux III

If all that was too much work for you, go to my github where you will find all my config files and a nice little install script to do the heavy lifting for you.

 https://github.com/cjstoddard/My-Openbox

This will make your desktop look and function like mine. However if you actually read the blog posts, making minor changes should not be a problem.


You will still need a basic install of Debian 12.

Tiling windows managers still suck.

Minimalist Linux II

Now that we have a functional desktop, it is time to pretty it up a bit and add a bit of functionality. Nobody normal like a stock boring desktop, so I am going to show you some customization tricks.

The first thing most people do is set wall paper. Find an image you like and download it into your home directory and rename it to something simple, I named mine angel.jpg.

mv background.jpg angel.jpg
Next we want to make it available system wide, for later.
sudo mkdir /usr/share/backgrounds
sudo cp angel.jpg /usr/share/backgrounds/
sudo chown root:root /usr/share/backgrounds/angel.jpg
Now place the picture wherever you want it to go. Normally there is a Pictures folder, you can just put it there.
mkdir Pictures
mv angel.jpg Pictures/
Now run these commands;
feh --bg-scale Pictures/angel.jpg
nano ~/.config/openbox/autostart
Add this line to the autostart file;
(sleep 1; ~/.fehbg) &
Now if you exit out of Openbox and go back in, you should have a nice background. Our next step is to change the Openbox theme, the default is Clearlooks. Which is fine, but for whatever reason lots of people like darker themes. Edit the configuration file;
nano ~/.config/openbox/rc.xml
Look for the <theme> section, and replace <name>Clearlooks</name> with <name>Artwiz-boxed</name>. Restart Openbox and you should see a change in how the windows decorations look. If this is not to your taste, there are many themes available in /usr/share/themes. You will have to google the themes to see how they each look.

The biggest issue with this setup so far is when you boot to the system it drops to the command line and you have to run startx to get to you desktop. There is also no way to lock the screen if you need to. We will need a display manager for this, lightdm is the one I like.
sudo apt install lightdm
sudo systemctl enable lightdm
When you reboot the system, you should come to a graphical login screen. We could leave it there, but that would be boring. To change the background open the configuration file;
sudo nano /etc/lightdm/lightdm-gtk-greeter.conf
At the bottom, add the following line;
background=/usr/share/backgrounds/angel.jpg
This will set the background of the login screen. Any picture you want to use, will have to be placed in the /usr/share/backgrounds/, otherwise it will not work properly.

Next we want to add the ability to lock the screen when needed. Run;
nano ~/.config/openbox/rc.xml
search for </keyboard> and add these lines just above that line;
<!-- Keybindings for [l]ock screen -->
  <keybind key="W-l">
    <action name="Execute">
      <command>i3lock -c 000000</command>
    </action>
  </keybind>
Once you restart Openbox, the screen can now be locked by pressing the Winows key + l.

For the final piece of customization, we are going to use a program called conky to add a dynamic element to your desktop. The first thing we need is a default config file.
cp /etc/conky/conky.conf .conkyrc
nano .conkyrc
The first thing I like to do is make conky transparent. I mean why have wallpaper if you are just going to block it out. Right under conky.config = { add this line;
own_window_transparent = true,
Next look for this section;
${color grey}Networking:
Up:$color ${upspeed} ${color grey} - Down:$color ${downspeed}
and change it to look like this;
$hr
${color grey}Networking:
IP Address:$color ${addr enp3s0}
Up:$color ${upspeed enp3s0} ${color grey} - Down:$color ${downspeed enp3s0}
My network device is enp3s0, you will need to run the command "ip addr" to find your network device and replace accordingly. Now go to the bottom of the file and just above the ]], place these lines;
$hr
${exec cat .keys.txt}
$hr
Now save and exit the file. The last lines I had you place are there because I like to have an onscreen reminder of all those dumb keybindings we setup that I can never remember, so run this command;
nano .keys.txt

and put the following text into it, then save and exit.

-------------------------------------
Keybindings
-------------------------------------
ROX-filer     windows-f(ile manager)
Rofi          windows-m(enu)
Firefox-ESR   windows-w(eb)
Tilix         windows-t(erminal)
Thunderbird   windows-e(mail)
Audacious     windows-a(udio)
VLC           windows-v(ideo)

Print Screen  windows-prtscn
Lock Screen   windows-l

Switch Desktops;
  ctrl-alt-right
  ctrl-alt-left
-------------------------------------
Finally, edit the autostart file

nano ~/.config/openbox/autostart
and add this line, then save and exit the file.
(sleep 5 && conky -c .conkyrc) &
Finally, reboot the system and if all went well, things should look much better. With a display manager and conky running, the amount of memory consumed crawled up above 512 MB, but probably not by much. I consider it to be a worth while trade off for the added functionality and general look of the desktop.

As a final note, I know some of you are going to scream that I should have used a tiling WM like Suckless or i3. I do not like tiling WM's, I prefer stacking WM's. Tiling WM's make me work the way the developers think I should be working, fuck that is all I am going to say about it.

Saturday, November 30, 2024

Minimalist Linux

Honestly, I am not a fan of the minimalist Linux movement. Today's machines are more than capable of handling what we throw at them and RAM is cheap. There is no reason not to use Gnome or KDE and even if you prefer a more legacy look, MATE and Cinnamon work just as well. The problem with minimalist desktops is you sacrifice ease of use and functionality. I don't care what anyone says ctrl-t is not easier than clicking on a button.

Having said that, there is some use for such a setup, for instance if you have a low end machine with limited RAM and no upgrade paths. In this case a GUI that eats less than 512 MB of RAM is nice. I have a Lenovo ideapad-1 with a Celeron G4020 and 4 GB of RAM, I like it because it is light and easy to carry around a busy airport. Gnome or KDE would bring this system to its knees and even MATE is a bit much for it.

In a case like this, I would forgo a Desktop Environment (DE) altogether and just use a Windows Manager (WM), in this case Openbox. A WM provides the basics, windows and decorations nothing more, a DE goes a step further and add the bells and whistles that make things easier to use and flashier.

The first step is to install Debian 12, when you get to the part where it asks what Desktop you want, uncheck everything except the bottom two options. Once that is done, reboot and log in as root, update the system and add the user you created to the sudo group. Then reboot again and log in under you user account.

Next comes installing what you need

sudo apt install xorg xbacklight xbindkeys xvkbd xinit xinput xserver-xorg-input-all xterm openbox obconf dunst dbus-x11 feh hsetroot i3lock libnotify-bin libxcb-xinerama0 lxappearance lximage-qt menu picom rofi scrot tint2 volumeicon-alsa xfce4-power-manager alsa-utils fonts-dejavu fonts-firacode fonts-font-awesome fonts-liberation2 fonts-ubuntu fonts-jetbrains-mono gtk2-engines-murrine gtk2-engines-pixbuf network-manager network-manager-gnome papirus-icon-theme pavucontrol pipewire-audio qt5-style-plugins rox-filer conky

Here we are installing our applications, I am avoiding heavy duty applications like LibreOffice and GIMP in favor of applications like Abiword and Inkscape, which eat less memory. Adjust to taste.

sudo apt install firefox-esr audacious thunderbird vlc emacs abiword gnumeric atril pluma mate-calc tilix inkscape
These next commands setup our WM in a basic configuration

mkdir -p ~/.config/openbox
cp /etc/xdg/openbox/* ~/.config/openbox/
systemctl --user --now enable wireplumber.service
Then we are going to setup the utilities needed for the basic functioning of the desktop. Type the following;

nano ~/.config/openbox/autostart
And add these lines;

hsetroot -solid "#000000"
xfce4-power-manager &
dunst -config ~/.config/dunst/dunstrc &
tint2 &
(sleep 5; volumeicon) &
nm-applet &
The hsetroot command sets the background color, #000000 is hexadecimal for black, for a nice blue, use #2e86c1, if you want to choose your own color, this site will help, https://htmlcolorcodes.com/ . You can set a picture as your background using a program call feh, but I am not covering that here.

Next we need to edit the .xinitrc file so when xorg starts, it knows what WM we are using. Type this command;

nano .xinitrc

and add these lines;

#!/bin/bash
exec openbox-session
Now, type startx and Openbox will start. You will see a blank screen, with a bar at the bottom. Right click on the background and choose terminal off the menu. In the terminal type in;

rofi-theme-selector

Rofi is the tool we will use to find and run programs. In its default state a window pops up in the middle of your screen, I prefer a bar at the top. Off the menu of choices, choose the demnu theme, to set the theme. Then we will want to configure rofi, so it shows icons with the programs. Type in the terminal;

nano .config/rofi/config.rasi

and add these lines to the file;

configuration{
display-drun: "Applications:";
display-window: "Windows:";
font: "JetBrainsMono Nerd Font Medium 10";
modi: ["drun", "window", "run"];
icon-theme: "Papirus";
show-icons: true;
}

@theme "/usr/share/rofi/themes/dmenu.rasi"
The final step is to setup our hotkeys for running the applications we use the most. Type in the following command;

nano ~/.config/openbox/rc.xml

search for </keyboard> and add these lines just above that line;

 <!-- Launch rox-filer when windows-f is pressed -->
  <keybind key="W-f">
    <action name="Execute"><command>rox-filer</command></action>
  </keybind>
<!-- Launch rofi when windows-m is pressed -->
  <keybind key="W-m">
    <action name="Execute"><command>rofi -show drun</command></action>
  </keybind>
<!-- Launch firefox when windows-w is pressed -->
  <keybind key="W-w">
    <action name="Execute"><command>firefox-esr</command></action>
  </keybind>
<!-- Launch tilix when windows-t is pressed -->
  <keybind key="W-t">
    <action name="Execute"><command>tilix</command></action>
  </keybind>
<!-- Launch thunderbird when windows-e is pressed -->
  <keybind key="W-e">
    <action name="Execute"><command>thunderbird</command></action>
  </keybind>
<!-- Launch audacious when windows-a is pressed -->
  <keybind key="W-a">
    <action name="Execute"><command>audacious</command></action>
  </keybind>
<!-- Launch vlc when windows-v is pressed -->
  <keybind key="W-v">
    <action name="Execute"><command>vlc</command></action>
  </keybind>
<!-- Launch scrot for screen caps when windows-print is pressed -->
  <keybind key="W-Print">
    <action name="Execute"><command>scrot 'screenshot-%Y-%m-%dT%H%M%S.png'</command></action>
  </keybind>

With this configuration, your keybindings will be as follows.

ROX-filer         windows-f(ile manager)
Rofi                 windows-m(enu)
Firefox-ESR    windows-w(eb)
Tilix                windows-t(erminal)
Thunderbird   windows-e(mail)
Audacious      windows-a(udio)
vlc                  windows-v(ideo)

Switch Desktops;
  ctrl-alt-right
  ctrl-alt-left
Print Screen  windows-prtscn

All that is left to do is right click on the background and choose Exit, this will drop you back to the command line, reboot the system and log back in. Then type startx to get back to your desktop. To run a program you do not have a hotkey for, simply press the Windows Key + m, at the top rofi will appear, simply start typing the name of the program and when it appears, highlight it and press enter.

Keep in mind, this is a very basic and plain setup. As I said earlier, you can set a background picture and you can add some interesting bling using conky. I may go into these things later. But for now, enjoy your minimalist desktop that consumes less than 512 MB of memory.

Tuesday, November 26, 2024

Building a Firefox Kiosk

 In my home lab I have been experimenting with various types of virtual machines. Mostly this has been complete operating systems. However one of the things Broker servers can do for you is give access to single applications, without the need for complete operating systems. Broker software like VMWare Horizon is expensive, but honestly, something like Remmina, which is a multi protocol desktop connection client, serves the same purpose.

In this example, I am setting up Firefox as a app, when the VM is launched Firefox is all the user has access to. If you wanted to, you could install this setup on a PC and just use it as a kiosk, no virtualization is really needed.

The first step is installing Debian 12, you can use Ubuntu server as well. We want a minimal install, no extra software outside of ssh server, not even a desktop environment. The resource requirements are very low; 1 core, 2 GB of RAM and 8 GB of storage will be more than enough. Once you are done, log in as root and install the needed software

apt update && apt upgrade

apt install sudo firefox-esr xorg openbox lightdm tigervnc-standalone-server tigervnc-common

Once that is done you will need to add the kiosk user, which is the account which the system will automatically log into when anyone accesses the virtual machine.

useradd kiosk

Next, enter the kiosk user account;

su - kiosk

Now we are going to make 2 confiuration files, one for VNC so the account can be accessed remotely and one for Openbox, which is the window manager we will use.

mkdir .vnc

nano .vnc/config

Enter the following text into the file, then press ctrl-x, save the file and exit.

session=openbox
geometry=1200x720
localhost
alwaysshared

Then move on to Openbox;

mkdir -p .config/openbox

nano .config/openbox/autostart

Enter the following text into the file, then press ctrl-x, save the file and exit.

env DISPLAY=:1 firefox-esr -kiosk 'http://url' &

If you want to setup a different application, this is the place to do it. Firefox can be replaced with Chrome or LibreCalc, just make sure the appropriate software is installed. Go a head and exit the kiosk user account by typing exit and you will be back in the root account.

We now want to give over display :1 to the kiosk user so when when someone logs in via RDP, Firefox will display on the VNC connection instead of the local display.

nano /etc/tigervnc/vncserver.users

Enter the following text into the file, then press ctrl-x, save the file and exit.

 :1=kiosk

The next step is to make it so the system booting directly into the kiosk user account and starts the VNC server.

 nano /etc/lightdm/lightdm.conf

Go to the bottom of the files and add these lines, then press ctrl-x, save the file and exit;

[SeatDefaults]
autologin-user=kisok
user-session=openbox
[VNCServer]
enabled=true
command=/usr/bin/Xvnc -rfbauth /etc/vncpasswd
port=5901
width=1200
height=720
depth=32

Finally, we want to setup the VNC password, that will be required when the user initiates a VNC connection.

vncpasswd /etc/vncpasswd

Now, reboot the system. On the local display, you will get a blank screen, if you right click on the background, you should get a menu. When you access it with VNC, Firefox should automatically start up in kiosk mode.

Tuesday, November 19, 2024

Installing VNC Server software into Debian 12

 Something that should be easy to do in Linux is getting VNC server software up and running without too much problem, except its not. All the instructions I found used TightVNC or TigerVNC and for whatever reason required the installation of XFCE to make work. XFCE is not bad really, but it is not the desktop environment that I normally used.

This got me to wondering whatever happened to vino, which was a VNC package I used years ago but no longer seemed to be in favor. I looked around and although it is still available it is no longer being maintained. Further, because of a bug, the last person who worked on it, removed the configuration dialog, which forced the user to configure it with a command line tool. Ultimately though, it is still pretty easy to install and get running without all the extra hoops needed for TightVNC or TigerVNC.

sudo apt install vino
gsettings set org.gnome.Vino prompt-enabled false

Then run this command to make sure the prompt is disabled.

gsettings list-recursively org.gnome.Vino

Finally, add this to your startup programs and reboot the system;

/usr/lib/vino/vino-server --display=:0 &

That is pretty much it. You should now be able to access the desktop with Remmia or similar using port 5900.

Saturday, July 20, 2024

10 things to do after you get your ClockworkPi uConsole

Note: For a more up to date version of this post, please see my github.

https://github.com/cjstoddard/Clockworkpi-uConsole

Unless you bought your uConsole from ebay for way too much money or you bought it from a sketchy Alliexpress seller, you probably waited months to receive it. Once you have it, the question is, what now? Well, The first thing you probably did was  assemble it, I am not going to cover that, there are plenty of Youtube videos out there for that. I am going to cover the things I had to do after I assembled it to get it where I wanted it to be in terms of software and usability. Here are the 10 things you can do to improve your uConsole experience. This list does require some working knowledge of Linux and Raspberry Pi's in general.

1. Get the Community OS image

The first thing t do is either boot to the SD card sent with the uConsole, if you did not get an SD card, get a 32GB SD card and download the stock image.

https://github.com/clockworkpi/uConsole/tree/master#uconsole-os-images

Burn it to the SD card and boot your uConsole with it. Test it out, make sure everything works. Now shut it down, remove this card and set it aside. This is your base line, if something goes wrong you can always boot off this SD card to make sure your problem is not just wonky software.

Next get a 64, 128 or bigger SD card, a 32 GB SD will fill up fast. Go download the community image.

https://forum.clockworkpi.com/t/bookworm-6-6-y-for-the-uconsole-and-devterm/13235

This image is based on a much newer version of the Raspberry Pi image along with an updated kernel. Burn this image to the larger SD card. Use it to boot up your uConsole and make sure everything works.

2. Update your system

Having an up to date system is paramount for any system, run these commands on a regular basis.

sudo apt update

sudo apt upgrade

3. Install useful programs

The first set of programs are text mode programs that I find useful, the second set are GUI programs I use. Adjust according to taste.

sudo apt install sudo mc links cmus htop neofetch tmux ffmpeg net-tools build-essential lame zsh mailutils git ufw default-jre tty-clock calcurse git wget curl flex bison bc libavcodec-extra -y
sudo apt install synaptic tilix audacious flameshot thunderbird filezilla transmission remmina gdebi thonny mozo vlc zim code -y

4. Change Desktop Environment (DE)

I am not a big fan of Wayfire or Wayland. If you want to change your DE to something else, use Tasksel to install the DE of your choice. I would also select Debian desktop environment, this will install things like LibreOffice and GIMP, but if you prefer a minimal setup, then leave it unchecked.

sudo tasksel
If you do this, the default Display Manager does not let you change your DE, for that you will need to install sddm.
sudo apt install sddm
The problem with sddm is when you reboot it will be sideways, so follow the next set of instructions to correct the screen orientation for sddm before you reboot.
sudo echo "xrandr --output DSI-1 --rotate right" >>  /usr/share/sddm/scripts/Xsetup

sudo echo "[X11\]" >> /var/lib/sddm/state.conf

sudo echo "DisplayCommand=/usr/share/sddm/scripts/Xsetup" >> /var/lib/sddm/state.conf

Once you have logged into your new DE, you will likely have to go to the display settings and rotate the display.

5. Safely Overclock your uConsole

The Raspberry Pi Compute Module CPU speed is 1.5 Ghz, and the GPU speed is 500 Mhz.  Most people find this barely usable. You can kick this up by overclocking your CPU and GPU. I have done this many times and I have never had a problem with these settings. While this speed is still not great, you will find the system much more usable. Run the following command;

sudo nano /boot/firmware/config.txt
add these lines to the bottom of the file, save and reboot.
over_voltage=6
arm_freq=2000
gpu_freq=750
gpu-mem=256
After your reboot run;

vcgencmd measure_clock arm
To make sure your CPU is running at 2 Ghz. You can try to set the CPU speed higher using arm_freq=2147, but not all devices will handle this speed gracefully. If you are going to experiment, please do so carefully and don't blame me if your shit breaks.

6. Setup Firewall

If you are going to be using your uConsole in public places, you will want to take some steps to secure it from bad actors. If you have not installed ufw yet, do so now with "apt install ufw".  Before you enable the firewall, you will want to allow ssh connections through your firewall so you can connect to it remotely.

sudo ufw allow ssh
sudo ufw enable

7. Secure ssh access to your system

Next you will want to setup your uConsole so it will only accept ssh connections from system you want it to. First log into your uConsole from the system you want to access it from, then log back out, then run the following command to generate a private and public key set.

ssh-keygen

Just hit enter three times to generate the keys. Next you will want to copy your public key to your uConsole with the following command;

ssh-copy-id remote_username@remote_server_ip_address

Now you should be able to log in using ssh, but the uConsole will not require a password. Repeat these steps from each machine you want to remotely access the uConsole from. Once you have done that, you will now want to disable password authentication so that only connections from systems that the uConsole has a key for will be allowed to log in. Run the following command;

sudo nano /etc/ssh/sshd_config

Search for the line "#PasswordAuthentication yes", delete the # and change yes to no. Save the file and then reboot the system.

8. Install Flatpak

Raspberry Pi OS has the same issue as Debian, the packages tend to fall behind long before a new release is made.  If you have programs that you want to stay up to date on, Flatpak is the way to do it. If you have not installed Flatpak, please do so now with "sudo apt install flatpak". Then to enable the repo run the following command;

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
Now you can install programs from the Flatpak repo, which will be more up to date without breaking your install. For instance, if you want to install Discord, run the following;
flatpak install --user --assumeyes flathub com.discordapp.Discord
You can go to https://flathub.org/ to see what programs are available.

9. Get a screen protector

LCD screens are prone to  getting scratched, so this is a necessary step to preserve you investment in this device. Fortunately the uConsole screen is pretty close to the Blackmagic Pocket Cinema 6K Camera in screen size, so almost any screen protector for it will work for a uConsole.

https://www.amazon.com/dp/B07WCQD1NZ?ref=ppx_yo2ov_dt_b_product_details&th=1 

10. Get a carrying case

A nice hard shell is also a good idea. The one I am using is Hermitshell Hard Travel Case. It is designed for VR headsets, but works great for the uConsole and accessories.

https://www.amazon.com/gp/product/B01DVMTJQE/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Bonus. Build Emacs from source

This is not particularly necessary, you could just install it with "apt install emacs" or "flatpak install flathub org.gnu.emacs", but what fun is that. Besides showing your Hacker Street Cred, this is also a good way to stretch the legs of your new uConsole and make sure that the overclock settings are not causing any problems. For this exercise you will need to enable the source repo's in /etc/apt/sources.list and run "sudo apt update".

sudo apt install build-essential libgtk-3-dev libwebkit2gtk-4.0-dev
sudo apt build-dep emacs

flatpak install flathub org.gnu.emacsflatpak install flathub org.gnu.emacs

git clone https://github.com/emacs-mirror/emacs.git
cd emacs
./autogen.sh
mkdir build
cd build
../configure --with-cairo --with-xwidgets --with-x-toolkit=gtk3
make -j4
sudo make install

Doing it this way means you cannot update Emacs using apt or flatpak and you will need to do it manually. I would make shell script out of this and run it once a month or whatever.

cd emacs
git pull
cd build
make -j4
sudo make install

Alternatively, if you prefer Neovim, here is how to build it from source.

sudo apt-get install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip curl doxygen
sudo apt build-dep neovim

git clone https://github.com/neovim/neovim.git
cd neovim
make -j4 CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make install

Tuesday, July 16, 2024

M5Stack Cardputer

 

On the other side of the cool hardware spectrum from the uConsole, is the M5Stack Cardputer. This is a neat little gadget, with some medicore bits of software. The Cardputer runs about $30, but if you buy it from the manufacturer it will be on a slow boat from China, literally. It is better to grab one off of ebay. I got mine for $45 shipped and had it in 3 days.

In 1985 if you had asked me what a computer would look like in 2025, this is probably what I would have described. Basically what we had back then, maybe slightly more powerful, but definitely smaller. This has a lot in common with the Commodore 64, limited RAM, can only run one program at a time, the main difference being you copy firmware onto the internal storage rather than swap cartridges and it requires a reboot to switch programs.

I do see some potential for this little device, but I struggle to find anything super useful to do with it. It does run Doom pretty well, but beyond that most of the programs pranks and low grade hacking tools. Even the Mp3 players available are not particularly good, mostly because of the under powered hardware. The best program I have found so far is the Pipboy Demo, which does actually have one or two useful features, like a web radio and note pad.

It does have four exposed GPIO pins, one for 3.3v power, one for ground and two for communication, again pretty limited when compared to something like the Rasperry Pi Pico or just about any Arduino.

In theory, this is a neat idea, but in practice, not terribly useful. I think someone needs to port Basic to it and make it easy to swap out programs without rebooting the bloody thing. Until it finds its niche, I suggest skipping this one.

ClockworkPi uConsole, My new favorite toy

 

This is something I ordered months ago and finally received. Clockwork Pi is terrible at getting product out the door, it is so bad, I had basically forgotten that I ordered it. The uConsole hand held costs $189.00 with the Raspberry Pi CM4 board, if you can source your own, they cost $119.00, which is what I suggest you do, simply because you can then get the CM4 with 8 GB of RAM, rather than the 4 GB they send. If you do not want to wait months and months to get one, they regularly become available on ebay, but you will pay a premium for them. You should also be prepared to assemble this yourself, which for me was half the fun.

Things I didn't like:

The screen is a bit small for my eyes, but considering its size, it is a trade off I am willing to make. I am not much of a thumb typist, so the keyboard took some getting use to. The assembly can be a bit tricky and the instructions are a bit vague. The big mistake I made was putting the CM4 in upside down, it would not boot, but I quickly figured the issue out when I saw an actual picture of what it was supposed to look like, so I had to tear it apart again. The default image of the Raspberry Pi OS provided by the company is based on an old version of Debian. Fortunately there is a community image based on the current version of Debian that seems to work really well. Finally, you will find your wifi signal to be weak, it is just a design flaw with positioning of the antenna. It was not a serious problem for me, but if you find it is, there are a couple of hacks out there for fixing the problem.

Things I liked:

This is just fucking cool. On the box it calls the uConsole a "Fantasy Console" and I agree with them. When I very first read Neuromancer back in the late 80's, this was what I envisioned a cyberdeck to looked like, the only thing it is missing is a headset. I like the tiny track ball, it is nicely calibrated for the screen and has a nice feel to it. While the keyboard does take some getting use to, the buttons are very tactile and feel solid. The screen, while a bit small, is very clear with a solid refresh rate. The CM4 with 8 GB of RAM make this a peppy little system, even though the OS does run off an SD card. If your are familiar with the Raspberry Pi 4, runs about the same.

Overall:

I think with some practice this could easily replace my laptop for traveling. Usually when I am out and about, I am not doing anything heavy duty. I don't think I could do any heavy lifting on this system, but for web browsing, email, light document creation and quick programing projects, this would exceed my expectations. Honestly, this thing is a work of art. It is beautiful to behold and a heck of a lot of fun to put together.

Tuesday, June 18, 2024

Radxa X2L Single Board Computer Part 2

I have been experimenting with the Radxa X2L One of the conclusions I have come to is the Picomite Basic firmware is easier to work with on an RP2040 than MircoPython or Circuit Python. I am aware that the Basic programing language is not exactly in vogue these days and Python is superior in almost every way, but really no programing language beats Basic for rapid prototyping. On top of that, I really do like this Basic implementation, it keeps a lot of what made the old 1980's Basic fun, while adding modern features.

  https://geoffg.net/picomite.html

 To keep everything in line, I also opted to use FreeBasic on the Intel side of this system. FreeBasic is a pretty good implementation of the Basic language and even has some switches to make it compatible with old Basic code.

 https://www.freebasic.net/

This project is going to show you how to use FreeBasic to retrieve the IP address of your system in Linux, then transmit your IP address to the RP2040, which will then use Picomite MMBasic to display the data on a SSD1309 OLED. This is useful for systems in a DHCP environment IP addresses change frequently. You could also use this method to display CPU temperatures or even a joke of the day.

 The first thing you will need to do is flash the firmware into the RP2040, this is covered in the Picomite documentation and a dozen or so Youtube video, so I will not go over it. The second thing you will need to do is wire your OLED to the RP2040 GPIO pins. Again, there are plenty of tutorials about how to do this.

Next you will need to connect to the RP2040 through the serial port. I use Minicom in Linux

minicom -D /dev/ttyACM0

Finally before we can start programming, we need to configure the Picomite software to use I2C and the SSD1306 OLED. You do this by typing the following two lines into your terminal program, you will only have to do this once.

OPTION SYSTEM I2C GP2, GP19

OPTION LCDPANEL SSD1306I2C, LANDSCAPE

The GP2 and GP19 switches tell the software what wires you are using for communication, if you are using different GPIO pins, you will need to adjust your command appropriately. The first one is the SDA pin, the second is the SCL pin.

 Now, in your terminal, type edit and press enter. This will open the built in text editor. Go a head and type this program in.

'RP2040.BAS

CLS
Box 0, 0, 128, 64, 2, RGB(WHITE), RGB(BLACK)
Text 10, 10, "Connected", "L", 1, 1, RGB(WHITE), RGB(BLACK)

Input "IP Address: ", ipaddr$
Text 10, 20, ipaddr$, "L", 1, 1, RGB(WHITE), RGB(BLACK)

 The first line is simply a comment stating the name of the program. I do this because when you save a program to the flash memory, it automatically names it whatever is in the first line. Doing this makes it easy to identify which is which.

The next five lines;

  1. Clear the OLED screen
  2. Draws a framing box around the edge of the display
  3. Writes "Connected" to the screen
  4. It then waits for input
  5. Once it receives input, it writes that input to the OLED.

Once you have typed in the program, or done a copy/paste, press the F1 key to save it. Next type "FLASH SAVE 1", This will save the program to the build in storage, so it can be retrieved later. Lastly, you will want to type "run", you should see is waiting for input, leave it be.

Now open a new terminal, if you have not installed FreeBasic, you should do so now. Type "nano intel.bas" and enter this program.

dim as string ipaddr
open pipe "for input as #1ip -4 addr show | grep wl* | grep -oP '(?<=inet\s)\d+(\.\d+){3}'"
        line input #1, ipaddr
close #1

open "/dev/ttyACM0" for output as #1
print #1, ipaddr
close #1

Each line of this program

  1. Defines the variable ipaddr as a string
  2. Runs a shell command to retrieve the IP address of the system
  3. Sets the ipaddr variable to the IP address of the system
  4. Closes the pipe used for running the shell command
  5. Opens the serial port so it can be written to
  6. Transmits the ipaddr variable to the RP2040
  7. Closes the serial port

Once the program has been written, press Ctrl-x, press Y and then enter. This will save the program. To compile the program, type "fbc intel.bas", you should now have an intel executable, simply type "./intel" and press enter. If all went well, you should see the IP address appear in the minicom terminal and on the OLED.

If you want this to run each time the system boots up, type "OPTION AUTORUN 1" into the minicom terminal. This will tell the RP 2040 to run the program in slot 1 on boot up. Then copy the intel executable to /usr/local/bin and add it to you startup programs.

That is pretty much it. You will still have two slots on the RP2040 to save other programs. This is a pretty good start to making the RP2040 useful to you when using the Radxa X2L. I kind of feel like all computers should have an RP2040 built in.

 

Saturday, June 1, 2024

Garbage Terminal: Part 3

 

So, I have this more or less built out, at least in its draft form. The 3D printing process did not go particularly well, which is not a surprise, I have a cheap printer and a very drafty house, so getting a good clean print is rather difficult. However, for version 0.95 I am not going to complain much. It pretty much does what I need it to do and it was built entirely out of parts I had on hand.

The first question of course, is it usable? Well, yes, however is it practical? No. Honestly I would not try to do any meaningful work on this terminal at all. It does not feel comfortable to hold, nor does the keyboard feel right. and the screen is too small for my old eyes.

On top of the feel, the Raspberry Pi Zero is just not designed to be useful in this sort of capacity. The CPU is too slow and the memory is too limited. If I were buying the parts for this today, I would have went for a Raspberry Pi 4 or 5 and a much better miniature keyboard, but even then I am not sure it would be terribly useful for anything, even with a GUI and a touchscreen.

Of course this also leads me to wonder if buying a professionally built hand terminal would be all that useful too me either. There is nothing this can do that a laptop can't do or heck, a bit of hacking and my phone could do most of it. Both of those options would be more useful and more comfortable to use. So yeah, realistically I think I will pass on the idea of a hand terminal.


Sunday, May 26, 2024

Garbage Terminal: Part 2

First things first, I found out that 3 AA batteries will not in fact power a Raspberry Pi Zero with an LCD screen attached. My wife offered up her Jackery Mini battery bank as her contribution to this project. Thankfully this works great. Second things second, I have been trying to work out a 3D printed case for this mess, but so far I have not had a lot of luck.


 This is the current state of the project. It is fully functional, but as you can see, it is waiting for some sort of case. The biggest problem with this build is the keyboard. I remembered why I never used it in a project, it sucks to type on. The size is not the problem, it is the buttons themselves that are the problem.

As you can see here, without the 3D printed cover, the buttons are literally little finger hating buttons. The cover makes it more tolerable, no let me rephrase that, the cover makes it usable. The downside of course is the cover also makes it harder to read the the letters, but if you are going to use this keyboard, the cover is an absolute must.


 

The instructions for getting the keyboard to work are here;

https://github.com/ian-antking/cardkb

The STL files for the keyboard cover are here;

 https://www.thingiverse.com/thing:3359571

Installing the  Pimoroni HyperPixel 4.0" LCD is not terribly difficult, the instructions for getting it to work are here;

https://github.com/pimoroni/hyperpixel4/issues/177


One of the issues I ran into, was the Pimoroni HyperPixel 4.0" LCD screen will not work if I2C is enabled on the Raspberry Pi with the raspi-config tool. I think the driver for the LCD hijacks I2C in some way. This is fine though, because it seems to provide its own I2C driver and a place on the back to attach devices. The keyboard shows up on bus 11 for me. Which can be verified easily enough with "sudo i2cdetect -y 11". 

The screen also does not power off automatically when the Pi is shutdown, which is a problem for battery life. To make this happen run the following command;

 sudo nano /etc/systemd/system/hyperpixel4-backlight.service

Paste the following into the file and save it.

[Unit]
Description=Sets up gpio-poweroff to handle Hyperpixel backlight upon shutdown/reboot
ConditionPathExists=/usr/bin/hyperpixel4-init
ConditionPathExists=/boot/overlays/gpio-poweroff.dtbo
ConditionPathExists=/usr/bin/dtoverlay
DefaultDependencies=no
Before=umount.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c '/sbin/rmmod gpio-backlight;/usr/bin/dtoverlay /boot/overlays/gpio-poweroff.dtbo gpiopin=19 active_low=1'
[Install]
WantedBy=reboot.target halt.target poweroff.target

 Followed by the following commands;

sudo systemctl enable hyperpixel4-backlight.service

sudo systemctl start hyperpixel4-backlight.service

One other issue I had, although not show stopping was annoying. When the Pi booted up I was getting "Boot errors: reached target sound card and error stopped target sound card". This is kind of to be expected because the Pi Zero does not have any sound device. To fix this open /boot/config.txt;

sudo nano /boot/config.txt

Find;

dtoverlay=vc4-kms-v3d

and change it to;

dtoverlay=vc4-kms-v3d,noaudio

Then find;

 dtparam=audio=on

and change it to;

dtparam=audio=off

 After the next reboot, you should not see those errors anymore.

I think that sums up the initial build pretty well. Once I have a case for it and had a chance to actually use it, I will do a part three and discuss software, battery life and usability.

Saturday, May 25, 2024

Radxa X2L Single Board Computer

 I will be coming back to the Garbage Terminal shortly, I had some hiccups with my original design, which is what happens when you pull a bunch of junk out of a parts box.

In the mean time, I have been messing around with a new bit of hardware I bought. Up until version 5, I was a big fan of the Raspberry Pi. With the Raspberry Pi 5 however, I felt it had jumped the shark. Yes, it was a good product, but it has reached the point where they are just as expensive as a low end computer and therefore lost much of their original luster. Enter the Radxa X2L, powered by an 4 core Intel Celeron Processor J4125. This little board costs as little as $39 for the 2GB of RAM version, I picked up the 4GB version for $52 and there is an 8GB version for $82. You can also get them with various amounts of EMMC storage. The really cool thing about this board is it comes with an RP2040 microprocessor built in, along with exposed GPIO headers very similar to the Raspberry Pi Zero.

The first thing I should say about this is don't bother getting it with any EMMC storage. EMMC is stupid slow and for about the same cost as the upgrade, you can get a 128GB NVME M.2 SSD, trust me, you will be happier. Second don't bother getting the M.2 wifi card either, they cost $20-$30 plus shipping, it is just not worth it. Instead just go find a $10 wifi dongle on Amazon, yes it takes a USB port, but the price makes it worth it.

Things I liked:

This board is basically a complete computer the size of my cell phone. It is a larger than an Raspberry Pi, but still reasonably small, so you can mount it on the back of a monitor or an out of the way corner of your media center, even with a 3D printed case.

I love having an RP2040 integrated into this board, I think all computer should have this.

The BIOS has CSM options for booting non UEFI operating systems like FreeDOS. Fewer and fewer systems are coming with this option and I am glad to see Radxa decided to include it.

Considering this is a Celeron CPU, it performs pretty well. X.org runs smoothly, Chrome and Firefox render well and no problems with Youtube.

Things I didn't like:

 When I was messing around with the RP2040, I found some problems than annoyed me. First off, it does not play well with Micropython, I could not get any I2C hardware to work. I had to use CircuitPython instead. 

The second thing I found was I could not chain multiple I2C devices together. I should be able to chain a dozen devices, but I could not even get two to work properly.

I am not sure what the issue here is, I know it is not the RP2040 itself, I have several Raspberry Pi Pico's and a couple of Waveshare Pico Zero's, I2C and Micropython  work flawlessly on these devices. I should not be having these problems and the GPIO is really the selling point of this board, otherwise I might as well just buy a Mini PC.

What am I going to do with this?

The short answer is I don't know. The longer answer is, I have a couple of idea, like maybe a Cyberdeck, ie a custom built hand made computer with flare and style. However, before I start on something, I need to work out the RP2040/GPIO problems I am having. I am currently working on getting some form of two way communication going via serial between the intel processor and the RP2040, once I have worked that out, I will post about how I did it, along with source code.

Saturday, May 11, 2024

Garbage Terminal: Part 1

I decided I wanted a little Linux handheld terminal. I had seen some YouTube videos of them and thought they were a neat idea. However when I went out and started pricing them, I was surprised at how expensive they were. I am sure part of that was just post COVID bullshit, but still. Then I started thinking about it and I realized I probably already had all the parts I needed. So I dug through my parts box and found a Raspberry Pi Zero W, a Pimoroni HyperPixel 4, a mini keyboard, 3 AA battery pack, a toggle switch from the junk drawer and an embarrassingly large pile of various USB flash drives. All stuff from other projects that were upgraded, abandoned or long forgotten. Now I just had to put it all together and make it work.

In the next installment I will go into the building process and include some pictures. However, before I get to building it, I am also thinking about what upgrades I might want to make in the future. I am also thinking about what I would do if I were buying these parts today.  I went out and looked at the current price and found these parts would cost $106.75 at today's prices. Mind you, I bought most of this stuff pre COVID, so it was considerably cheaper, I suspect at the time all of this stuff cost me less than $75.

If I were buying these parts rather than digging them out of my parts box, I would probably make some different choices. For instance the Hyperpixel 4 LCD screen does not play well with the current version of Raspberry Pi OS, which is why I am going to have to use an old version for this build. This LCD also uses all the GPIO pins, I would like to have a few left exposed for other things. I would likely choose the Miuzei Raspberry Pi 4 Touchscreen with Case Fan, This would cost me $30, but it would give me a touch screen and open GPIO pins. This flows right into using a Raspberry Pi 4 rather than a Pi Zero. While this would make the build much bigger and heavier, it would give me a lot more CPU power, memory and sound. I would also get a rechargeable battery pack, 3 AA batteries will probably not last nearly long enough. Unfortunately, buying all this stuff today would probably throw the price well into what just buying one of those Linux handheld terminal I was talking about earlier.

Here is my parts list for anyone who cares.

 Obviously if you shop around, You might get this cheaper, like the switch you can probably get at a hardware store for 89 cents and it never hurts to shop ebay for used hardware.

Monday, March 25, 2024

Review: Daggerheart Open Beta

The open Beta of Daggerheart has been released. For those of you not in the know, Daggerheart is a new fantasy roleplaying game being put out by the popular D&D streaming group Critical Roll as a replacement for D&D.

Over the last 2 weeks my Sunday night game tried it out. The first game was session zero, where we built characters and tried to figure out the rules. The second session was actually playing the game. I want to be critical of this game because there is a lot that did not work for me, however I am going to pull my punches here because it is an unfinished product that may well improve in the final presentation.

Things I didn't like:

The 2d12 game mechanic just seems awkward, I am not sure why they chose 2d12 over 1d20 or even say 2d10. This awkwardness is magnified by the fact that the GM uses a 1d20 for combat. This is weird because it puts the monsters on a flat probability but the characters are on a curved probability. I honestly do not see how this adds anything interesting to the game.

There is no initiative system, no way to lock down whose turn it was or who could do what and when. Combat was a mess until half way through the GM implemented a turn order so no one missed the opportunity to take a turn. This game incentivizes show boat players and marginalizes less aggressive players.

Characters seemed bland, special abilities were highly situational and reminded me of D&D 4th Edition, which is not a good thing. One of my fellow players commented that had we not announced our classes to each other, he would have had no idea what classes we were actually playing.

The Fear and Hope mechanic had a lot of potential, but it honestly fell flat. During the game, I did not generate a single Hope and accounted for 2/3 of the Fear generated during the session. Virtually all of that Fear was used against other members of the party, I was not impacted by the fear I generated and that was frustrating for the other players. Everyone else in the party had a plethora of Hope, but nothing to use it on because their abilities were all situational.

There were layers of needed complexity, such as the severity of the hit determining how mach damage was taken rather that just rolling the damage directly. Evasion/Armor/Armor slots along with Stress being used as extra Hit Points, served to slow the combat down to a crawl.

Things I did like:

Players are incentivized to engage with the game. The more you engage with the game the more chances you have to generate Hope. Players who do not engage with the game tend to have less options available to them over the course of the game.

I liked the Advantage/Disadvantage mechanic, adding a 1d6 to the roll when using Advantage and subtracting a 1d6 to the roll when using Disadvantage has a much larger impact on the game than just rolling 2d20 and taking the better roll.

Overall:

This game does not really work for me all that well. I prefer a unified dice mechanic and the 1d20 flat probability works well for that. Using 2d12 just seems arbitrary to me and unnecessarily bunches up rolls into the 12-14 range making rolling high maddeningly rare. Characters were underwhelming and shy quiet players are quickly pushed to the background. Unless something changes dramatically, I don't see myself playing this game in the future.

Sunday, February 4, 2024

Playing Shadowdark Part II

I wanted to love Shadowdark, I really did. The idea of simplified game mechanics and clarified resource management rules made it a very enticing game. I am sure for some groups is what they need and what they want, for my group not so much. We played six games of Shadowdark, adding in the previous 4 games, a total of 10 games in all. I think we all went into it with an open mind and we gave it a fair chance. In spite of that the game fell flat with us.

Things we didn't like:

To start of with, resource management is not fun. I am not saying it is bad, just boring. My players did not like equipment slots and worrying about torches. This just added a level of book keeping that only served to annoy my players and take away from the enjoyment. They don't mind dealing with things like how much weight they can carry or the lack of dark vision. The problem was, these rules required the players to pay meticulous attention to details they really didn't care about, they wanted to play the game, not do supply room inventory every game.

The next issue was characters tend to be bland with very few id any interesting things the players could do in any given circumstance. Character development is just uninteresting, honestly, there is very little difference between a 1st level character and a 5th level character beyond a few extra hit points. The fact that the player had little control over how development progressed, irritated my group a lot.

The worst part of the game is how fucked spellcasters are. Roll to cast sounds like an interesting idea, but in practice was a terrible idea. Loosing key spells at the wrong time often spelled disaster for the group. Luck tokens are supposed to alleviate the issue, but really didn't, even giving out 2-3 luck tokens to every character in every game did not seem to make a big difference, if the dice were against you, they were against you. Ultimately no one in the game wanted to play a spellcaster and even the one person who did, rarely bothered casting spells and only did it if he had luck tokens available.

Lastly, 4 classes and 6 ancestries is not enough. Ancestries we could probably get by with, but 4 classes just isn't enough and adding enough classes and ancestries to bring the game into parity with D&D 5E breaks on of my rules of DMing, which is keep house rules to a single page, otherwise you are playing the wrong game. I thing that is what this really amounted to, we were just playing the wrong game.

Things we did like:

I don't want anyone to think we hated this game, we didn't, it is just not what we want out of a game. There are things from Shadowdark that I will be bringing back to D&D 5E. I loved the always on Initiative, it just made the flow of the game much smoother. I just ordered everyone by Dexterity score (then alphabetical by character name) and proceeded from there.

My players really enjoyed getting back to rolling for stats rather than point buy or standard array. They did not like rolling for class talents, but they did like at the beginning having to take what you roll and build something out it, even if it was not optimal for what you wanted to do. Lets face it, rolling a 6 in something is a great role playing opportunity.

Overall, Shadowdark is a solid game and I would not turn down a game of it if someone wanted run it, but sadly, fo my group it is just not what we want. One of my players has said over and over, the only thing we want from a game is to be able to play interesting characters and I think that is where Shadowdark fell short for us. So last night we had a session zero and we are going back to D&D 5E.

Saturday, January 27, 2024

A Night on the wall

 

A Night on the Wall is a pure combat session, where the PC's are defending the wall of a city against a monster attack. This is meant as a replacement for the Gauntlet style game or as a quick and dirty game session that can be run with no preparation. This works well for up to 6 characters of 4th level or less. Much after that it becomes an epic battle fought at the end of a campaign rather than a skirmish fight.

Along with the PC's there will be teams of NPC's, each team will contain 4 Commoners and 1 Militia man. The number of teams on the map will depend on the length of the wall to be defended. There should be roughly 1 NPC for each 10 feet of wall, plus 1 team on the ground to act as medics and 1 team to act as runners and defend the wounded.

Generally speaking an attack will last 20 rounds. If a breach occurs and the light sources cannot be re-lit, chances are good the battle will not go well. If the PC's are able to keep a breach from occurring or re-lighting the light sources quickly, they stand a pretty good chance of making it through the 20 rounds. If the PC's make it 20 rounds without an uninterrupted breach, the monsters will withdraw and go look for an easier sector to attack.

Breach:

A breach occurs when two or more light sources next to each other are extinguished and monster bands start coming through that area every round instead of every 1d4 rounds from a random direction. The only way to stop a breach is to re-light the light sources.

What the NPC's will do:

  • NPC's who are reduced to 0 HP will die in 4 turns unless taken to the building where they can be stabilized by the one of medical team, each member of the medical team can restore 1 HP per turn. NPC's will return to the fight if they at at least half their HP restored.

  • NPC's will use their ranged attacks and attempt to stay out of reach of any monsters and will only use their melee weapons if a demon comes within Close distance. The NPC's will use their ranged attack on any monster within Near proximity, otherwise they will be scanning their section of the wall for more monsters.

  • When a light source is extinguished, the closest NPC who is not in a fight will attempt to re-light it with a DC 8 Dex roll. If there is no monster in Close proximity, they have advantage on this roll.

  • If the number of NPC's is reduced to half its starting number, any PC or NPC can call for reinforcements. It takes 1d4 rounds for reinforcements to arrive. Reinforcements will generally be 2 fresh teams of 1 Militia man and 4 Commoners.

  • The Militia men will move around the map to assist with attacks coming in other areas, commoners will assist using their ranged attacks on any monster in near range, but will otherwise stay at their posts.

NPC's

Commoner: AC 10, HP 1, ATK 1 Club (1d4) or 1 Shortbow (far) (1d4), MV near, S +0, D +0, C +0, I +0, W +0, Ch +0, AL L, LV 0.

Militia man: AC 13 (Leather+Shield), HP 5, ATK 1 Shortsword +1 (1d6) or Crossbow (far) +1 (1d6), MV near, S +1, D +1, C +1, I +0, W +0, Ch +0, AL L, LV 1.

What the monsters do:

  • At he beginning of the session, one band of monsters will appear on the map outside the wall from a random direction. Each round thereafter roll 1d4 and on a 1 another band of monsters will appear on the map, approaching from a random direction. If the battle goes 4 consecutive rounds without a monster band appearing, one will appear on the next round.

  • However if at the beginning of a round  two light sources next to each other have been extinguished and have not been re-lit a monster band will automatically approach from that direction.

  • If a monster comes into Close distance of a PC or NPC, the demon will attack, otherwise it will move Near distance in a direction determined by the GM.

  • If a monster comes into Close distance of a light source, they will use their action to extinguish it, this requires a DC 8 Dex roll. If there is no PC or NPC in Close proximity, they have advantage on this roll. If an NPC or PC is also within Close distance, it will extinguish the light first and attack second.

Monster Bands

I use generic monster stat blocks for two reasons, first I can skin them as I please depending on the needs of the setting, and second I did not want the monsters to have special abilities, because this can slow down what is already a long drawn out combat.

To determine what each monster band is, add up the levels of all the PC's in the group and match this number with and equal number of monster levels. Additionally each monster band will have two level 0 monsters for each PC in the group. The 0 level monsters will usually come in first trying to extinguish light sources and kill any commoners near by.

Don't make the monster bands swarms of level 1 monsters. It is bad enough that there are so many NPC's and level 0 monsters, don't slow combat down by adding sixteen level 1 monsters to the attack because there are four 4th level PC's. Read the section "HOW MANY MONSTERS?" on page 193 of the Shadowdark RPG rule book on balancing an encounter.

  • Example 1: For a group of 4 1st level PC's each monster band could contain 4 level 1 monsters and 8 0 level monsters, or 2 level 2 monster, or 1 level 3 and 1 level 1 , or 1 level 8 Monster along withe the 8 level zero monsters.

  • Example 2: A group of four 4th level PC's totaling 16 levels could be facing monster bands made up of two level 8 monsters, and 8 level 0 monsters.

Level 0 Monster: AC 10, HP 1, ATK 1 Claw (1), MV near (Climb), S +0, D +1, C +0, I -3, W +0, Ch +0, AL C, LV 0.

Level I Monster: AC 11, HP 5, ATK 1 Claw +1 (1d4), MV near (Climb), S +1, D +0, C +0, I -2, W +0, Ch +0, AL C, LV 1.

Level II Monster: AC 11, HP 10, ATK 1 Claw +2 (1d6), MV near (Climb), S +2, D +0, C +0, I -2, W +0, Ch +0, AL C, LV 2.

Level III Monster: AC 12, HP 14, ATK 2 Claw +3 (1d6), MV near (Climb), S +3, D +0, C +0, I -2, W +0, Ch +0, AL C, LV 3.

Level IV Monster: AC 12, HP 20, ATK 2 Claw +4 (1d6), MV near (Climb), S +3, D +0, C +0, I -1, W +0, Ch +0, AL C, LV 4.

Level V Monster: AC 13, HP 24, ATK 3 Claw +4 (1d8), MV near (Climb), S +3, D +0, C +0, I -1, W +0, Ch +0, AL C, LV 5.

Level VI Monster: AC 14, HP 29, ATK 3 Claw +5 (1d8), MV near (Climb), S +3, D +0, C +0, I -1, W +0, Ch +0, AL C, LV 6.

Level VII Monster: AC 14, HP 33, ATK 4 Claw +6 (1d8), MV near (Climb), S +4, D +0, C +0, I -1, W +0, Ch +0, AL C, LV 7.

Level VIII Monster: AC 15, HP 37, ATK 4 Claw +7 (1d10), MV near (Climb), S +4, D +0, C +0, I +0, W +0, Ch +0, AL C, LV 8.

Order of the battle:

  • The Monsters go first in every round. When the monsters appear on the map, the PC's and NPC's will have a chance to attack with ranged weapons. Any monsters surviving the first round will make it to the top of the wall at the beginning of the next round and will have both their move and action available to them.

  • PC's go next in order of initiative.

  • NPC's go last in every round.

Adjustments:

As is, this can a difficult scenario to survive, especially if a breach occurs and is not fixed quickly or two, perhaps three consecutive attacks occurring from different directions. To make it easier;

  • The monster bands come every 1d6 rounds.

  • Halve the number of Level Zero Monsters with each band.

  • The PC's and Militia men are given 2 Potions of Healing each and they can get 2 more by visiting the medical team.

  • Add an NPC Cleric to the medical team.

  • Reinforcements are doubled and automatically come 2 rounds after the arrival of each monster band.

  • Make the Militia men tougher

  • Give the players a round of notification that a band is coming from a particular direction, so the PC's have a round to move around the map, or perhaps shoot into the darkness at disadvantage.

Zero Level PC's:

  • If this is being used as a replacement for a Gauntlet style game for Zero level characters, generate the PC's as normal.

  • Each player should roll up 4 characters, if a PC dies, the replacement PC will arrive with the next set of reinforcements.

  • In addition to starting gear, the PC's will be given flint and steel, a torch, a club, shortbow and 20 arrows.

  • Monster bands will consist of one Level I monster and a number of Zero Level Monsters equal to the number PC's.

Player Strategy:

  • Keep the light sources lit at all costs.

  • Commoners pop like balloons, Militia men can take a couple of hits from level zero and level I monsters, but they will still soak up a lot of damage in the long run, use that to your advantage.

  • Ranged attacks are your friend, especially on the first round a monster band is approaching the wall and everyone gets a free shot at them.

  • Let the Commoners and Militia men handle the level 0 monsters, while the PC's tackle the big boys.

  • Sometimes allowing a breach to continue is the best way to funnel the monsters into a single direction of attack. Use this strategy wisely.

     

Shadowdark License. This product is an independent product published under the Shadowdark RPG Third-Party License and is not affiliated with The Arcane Library, LLC. Shadowdark RPG © The Arcane Library, LLC.


License: This adventure is licensed under the Creative Commons Attribution-NonCommercial 4.0 License.

https://creativecommons.org/licenses/by-nc/4.0/legalcode
https://creativecommons.org/licenses/by-nc/4.0/

 

 

Mastodon