Deeper and deeper in to the “source” we go.
A quick dip in to the “filesystem way” of things on Plan9, by writing our own Plan9 protocol (p9) file system for a TM1650 7-segment display driver: tm1650fs.
Every long data transfer starts with a single bit.
There is a goal to all this randomness. To “work out my embedded development muscle”.
So, before we start straight up porting plan9 to other devices, let’s try and poke around a working system first and see what is where.
And sorting out and using I2C on a Raspberry Pi 1 seamed like a good start. A lot has been done here already, so it’s a soft start.
Sorting through it and writing it down for anyone interested: notes/plan9/i2c.
With a first success in compiling a custom kernel and poking around a bme680 sensor.
I was “today years old”, as the internet says, when I realized something profound!
You can use cron with @reboot tag to run scripts at boot instead of torturing yourself with systemd.
So obvious in hindsight.
I don’t know who needs to learn this, but so far, anyone I know took this information by surprise.
A few changes and we have the basic site up in a pretty decent shape.
Sadly, can’t do anything more for the performance. It is what it is, for a (let’s be generous) “server” running a niche OS on a first generation Raspberry Pi.
To get it this far:
create pub and lib directories in _werc directory of the site
generate all other possible versions of favicon icons (ios, android, …), add them somewhere unobtrusive (eg. _werc/pub/) and create a file headers.inc in ___werc/lib__ and add the definitions:
<link rel="apple-touch-icon" sizes="180x180" href="/_werc/pub/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/_werc/pub/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/_werc/pub/favicon-16x16.png"> <link rel="manifest" href="/_werc/pub/site.webmanifest">
while editing headers.inc add the definition for device width:
<meta name="viewport" content="width=device-width, initial-scale=1">
This will make the best practices score happy.
copy over headers.tpl from werc/lib to _werc/lib of the site and change
This will make the accessibility score happy.
edit your _werc/config and add meta description:
meta_description='A collection of notes on various topics.'
This will make the SEO score happy.
All this could be done in headers.tpl, but the system is configurable, so let’s use the options.
To make the barf blog plugin for werc work as a subfolder, we need to patch it up to correctly parse the slug when it’s not attached to the domain root: diff
Now, add top_bar.inc and footer.inc to your _werc/lib to add page header and footer content.
And for custom styles, create style.css in your _werc/pub folder.
So, the time has come to scrape together a system for publishing, as we set out to do.
For the base, so far, we have a 9front installed on a first generation Raspberry Pi. For hosting, we’ll use rc-httpd web server, distributed with 9front. For content management we’ll use the Werc framework, used by other plan9 / 9front related sites, with barf plugin for blog and other nifty things.
Not to go into too many details here, since this is a learning experience and information will be improved over time (I’m sure), so notes for web are available separately.
In short, how we got this working so far:
- (optionally) a new user was created (gotta figure out administration of this thing)
- werc was installed by cloning it with hg from https://code.9front.org/hg/werc
- werc was configured by creating appropriate folders in werc/sites dir
- barf plugin was installed by cloning it with hg from https://code.9front.org/hg/barf in to werc/apps dir
- barf was configured by creating the appropriate folders and files in _werc subfolder
- rc-https was configured (/bin/service/tcp80) to run werc on request
- example files can be found in werc/bin/contrib (tcp80 & rc-httpd/select-handler) or on the werc docs
- since services in /bin/service are run as an “unprivileged” user none, with no privileges (duh) and werc needs to access to tmp files cor cache or its unhappy, configure the namespace for the service (/bin/service/tcp80.namespace) to include a “world” writable folder binded to /tmp
That got us a working set up, that we can now play around with, and do the “timey wimey” magic and “back port” some notes and posts.
For the last little while, nursing a burnout, some time has been spent on the Brotato game.
Now I won’t claim I love rouge games just as much as any other man because then we wouldn’t be here, but I do enjoy them. I also think there is a line between a challenge and being punished.
For example, in Hades I do not mind dying. Sometimes I did in on purpose. The “game” still advances. Effort is not lost. I am not being punished for not learning yet all the enemy moves or an unanswered prayer from rn jesus.
This is not the feeling while playing Brotato. The game is fun! When things go your way. And I do understand the appeal of permanent death and the GiT GuD culture. But sinking in a substantial amount of time to building up a character (slow start before it gets fun when doing it all over again), just to die because TPM spawned an enemy in your path so close you cannot react, kind of crosses the previously mentioned line. Well, I already paid for the game, let’s make it fun.
Before that, on a related note, discovered and experienced while doing this. I did not ever imagine a random number generator could be “too slow” to cause game stuttering. I kid you not: Linux Fix Coming For Recent Stuttering On AMD Ryzen Due To fTPM RNG
Haven’t done any modding in a long while, this was a fun exercise. Once trough, there is not much to it:
- the game is made in Godot engine
- the creator was nice enough to include ModLoader framework
- the community on steam has prepared a very detailed modding guide
The biggest “hurdle”, that no one tells you since every one knows it already, was figuring out you have to restart steam after switching to “modding branch” on steam to publish the mod to steam workshop.
The result of a few hours learning & developing and a “few” hours testing: Second Chance Brotato mod with source for all.