Joining the Let’s Encrypt Help Forum

Good Morning from my Robotics Lab! This is Shadow_8472, and today I am finding help towards getting an SSL certificate from Let’s Encrypt. Let’s get started!

The Time to Get Help

Manually setting up an HTTPS secured service from your home is not beginner level by any stretch of the disillusioned imagination. In many ways, it reminds me of installing Linux for the first time. The system as a whole is irreducibly complex; multiple project-sized milestones rely on each other for usefulness, so I won’t see any results basically until I’m done.

So far, ButtonMash is running Rocky Linux 8. I have NGINX installed, but it can’t be properly configured to serve HTML over HTTPS until I have an SSL certificate. SSL certificates are available for free from Let’s Encrypt, but the process for getting and renewing them is reportedly labor intensive once you do know what you’re doing. ACME clients (Automatic Certificate Management Environment) can automate this work, but the installation options alone are exhaustive.

Joining Let’s Encrypt’s Community

I have made a good faith effort to self-educate, but I’ve slowed down to the point where I feel like I’m posting the same thing week after week with dribbles of progress. The documentation has far exceeded my attention span. It’s time to look for help.

Let’s Encrypt –like many well-respected technical projects– has a designated community support forum [1]. It’s just not on Discord or some other platform I’m already on. After weeks of self-research, I made an account and started looking around.

Unsurprisingly, the people I found in such a niche community are more knowledgeable about all things related to security certificates. The more I talk about my project there, the more important concepts are brought to my attention. For example, I keep coming across terms I keep seeing, but have so far remained clueless about. When those come up in conversation I look them up and only ask if I can’t find the answer in a reasonable amount of time.

3D Printing Corner

My brim decision is really backfiring now. I might even say it’s a worse idea than using a raft at this point. For what it’s worth, I made the time to glue a couple of those calibration cubes together. One drop, then press together. My father used a pencil on Sonic during a final dry fit to help for gluing the two halves together.

Side Project

My mother’s new sewing table has a fancy elevator platform to hide away her machine. This week, she got a power cord stuck in its mechanism where a couple clips jammed against it and each other. I was quick to find a 3D printed solution to keep it from happening again once we dislodged it[2]. I settled on a design aimed at holding phone chargers, but it was about the right size when I scaled it up to 200% and told it to use solid infill on the clip. My father and I installed it under the elevator and used a couple Velcro straps to lock the cords in so they don’t fall out.

Takeaway

I have never been excited about mastering a network backbone. It’s been one of those things that always feels simple enough to reach for, but complex enough to challenge my perseverance. I’m glad I’ve found a place that seems friendly enough.

Final Question

Certbot is the preferred ACME client, but there’s a list with tens of them on it [3]. Someone name-dropped Caddy, but I’ve been studying NGINX. Have you gone through Let’s Encrypt before? If so, what ACME client do you use?

Works Cited

[1] Internet Security Research Group, community.letsencrypt.org, [Online]. Available: https://community.letsencrypt.org/ [Accessed Mar 25, 2022].

[2] TJH5, “Cable Holder,” thingiverse.com,Aug. 13, 2017. [Online]. Available: https://www.thingiverse.com/thing:2481258 [Accessed Mar 25, 2022].

[3] Internet Security Research Group, “ACME Client Implementations,” community.letsencrypt.org, Mar. 6, 2022. [Online]. Available: https://letsencrypt.org/docs/client-options/ [Accessed Mar 25, 2022].

NGINX: Project Redirect

Good Morning from my Robotics Lab! This is Shadow_8472, and today I am configuring NGINX on my home server, ButtonMash. Let’s get started!

NGINX Reinstall

I sat down this week to work on NGINX, and any tutorials I tried –even ones specially recommended to me– kept referencing files that didn’t exist. Staff member Pokey on the bitmerge Discord server suggested I check my version. The Rocky Linux 8 repositories are distributing version 1.14.1 whereas the latest version is 2.21.6 on their website [1]. A little further research revealed that one of those noted differences –directories for sites-available and sites-enabled– are commonly packaged with NGINX and not part of the upstream codebase.

A little research turned up a quick article on ServerDiary [2]. Turns out NGINX maintains repositories with stable and mainline releases of their software for Red Hat and CentOS – the later of which I am trusting to stay open for the time being. The instruction-by-instruction directions were clearly, but briefly described, and while I followed their instructions to enable the mainline release, I’m trying to admin ButtonMash as if it were a production environment: so I reverted to the stable version. In addition to the commands found on ServerDiary, I worked out this one for myself after trying to enable nginx-stable:

sudo yum-config-manager --disable nginx-mainline

Technology Backbone

I tried configuring NGINX to blindly pass HTTPS packets from incoming IP, but it was being more trouble than it was worth. I kept getting SSL_ERROR_RX_RECORD_TOO_LONG, which comes up when a browser expecting to make an HTTPS connection instead is offered an HTTP one – so far as I can tell.

There’s probably a way to convince it to cooperate. My productive time is probably better spent focusing directly on my technology backbone though. I expect I’ll learn the same skills at about the same time either way, but I won’t be redoing the project three or four times this way.

I registered a domain name from NameSilo. New interface on some pages aside, the process was as straightforward as the previous times I’ve done it. The real trick is when I master subdomains and I can use the same domain name for services intended for family use.

Going forward, my next immediate step is obtaining a security certificate from Let’s Encrypt with that domain name. Only then, will I have what I need to set up NGINX properly.

3D Printing Corner

Work here was slow again. For anyone not in the know: I printed a Sonic figure split front and back. I intend to glue and paint it. To practice, I made myself eight calibration cubes to glue together. I managed to locate some sandpaper and I sanded down the flat surfaces of four of the cubes.

Once I had a feel for how the PLA was reacting to being sanded, I sanded Sonic and worked on that brim I totally shouldn’t have printed. The two halves were more flush in a dry fit.

Side Projects

My father’s Debian install keeps freezing, only opening up when he sends a system request to kill everything in his session, returning him to a login screen. As this is an infrequent occurrence, I taught him a little about SSH. I had him sit down at DerpyChips, and after telling Derpy to forget about the Mint install at the same IP, I had my father log in remotely and practice using top to find a process ID (PID) and kill problematic programs with a little more finesse. While I’m not looking forward to the next crash, we have practiced for when it happens and I have a good feeling about this new procedure.

My laptop power cord has been slipping away from its 19.5 volt side, exposing the three, jacketed wires inside it. As much as I’d liked to have pushed it back up, wires don’t have good compression strength. Instead: I pinched the cord half way to the transformer and ran my fingers toward the end, stretching the outer case, encouraging my cord into a more presentable condition.

A while back, we made our own network cable to serve ButtonMash and now GoldenOakLibry. It’s been dropping connection this week. I was able to convince it to come back online for a few days, but almost as if it knew I needed to pad my post, it fizzled again, seemingly for good. I used a connectivity tester, and it failed a few connections. We found one that happened to be long enough, and I was able to reach ButtonMash. GoldenOakLibry needed to be disconnected and reconnected from the local switch before it came back online.

Final Question

I have several large tasks with no immediate payout expected. These projects will likely be research -heavy, making for less interesting reading. What kinds of side projects should I work on?

Works Cited

[1] F5 Networks, Inc. nginx.com, [Online]. Available:https://www.nginx.com/. [Accessed: Mar 21, 2022].

[2] Serverdiary, “How to install latest official Nginx on Centos 8 / RHEL 8”serverdiary.com, [Online]. Available:https://serverdiary.com/linux/how-to-install-latest-official-nginx-on-centos-8-rhel-8/. [Accessed: Mar 21, 2022].

Misadventures in Studying NGINX

Good Morning from my Robotics Lab. This is Shadow_8472, and today I am getting lost while exploring SSL certificates… again. Let’s get started!

Installing NGINX

At last count, I had about six or seven projects I should hook into it, but most of them are on hold because I don’t want some stranger finding his way into my home network and rearranging things without permission. I set up Vaultwarden to manage its own HTTPS connections, and I learned a lot about what SSL is and how it works. But this is not a recommended configuration and I want to learn the proper, more advanced way of doing things.

I ignored plenty of guides’ advice on my path to a Vaultwarden server. They recommend some sort of ingress controller, and I’m currently exploring one called NGINX. I’ve come across quite the debate as to whether to use a container or install it native. The tutorials for the container edition all use Docker, but I’m using Podman and I’m uneasy about root permission nuances between the two projects making things needlessly more challenging, so I installed the package on ButtonMash.

sudo dnf install nginx

To confirm installation, I enabled the web server with a few systemctl commands and opened a port in ButtonMash’s firewall. NGINX now proudly displays its welcome page.

A Web of Dependencies

NGINX does not lend itself to solo study. It is a do-everything solution for networking. With so many use cases from serving HTML pages to load balancing containers, I have spent weeks pouring through tutorials without finding a keystone lesson for my use case. Some of that time was spent looking into some sort of web interface I falsely believed was included. See NGINX Proxy Manager vs. NGINX for details. I will stick with bare NGINX if for now mainly because NGINX Proxy Manager’s website ironically has an expired SSL certificate.

I got lost researching what I would need for a project this week. Proper HTTPS for Vaultwarden is a good choice of target. That will require an SSL certificate, and that means Let’sEncrypt. An SSL certificate requires either a domain name or a subdomain, so that means arranging one of those.

Somewhere along the way, I got lost and visited this blog’s host cPanel in the interest of moving its SSL to Let’sEncrypt. The experience was unexpectedly surreal, like I was paging through a book written in a language I’m trying to learn – there was a flood of jargon, but the bits I recognized made for moments of satisfaction.

3D Printing Corner

I want to glue the Sonic figure I printed, but I’d just as soon have some experience with gluing large, flat surfaces together before I go smashing a larger project together and hoping it sticks (literally). I had the idea to print up eight calibration cubes for practice. I tried some lower infill settings and got inferior, but adequate results. My biggest complaint was how many tries it took for the overall first layer. I had to settle with a couple curling corners, but a perfect print wasn’t the goal anyway. Gluing will have to wait until next week though.

Side Project

Also on the topic of 3D printing, my mother has been into quilting as of late and she commissioned some more bias tape makers like the ones I made during the early stages of the pandemic. I found what I thought was the model on Thingiverse and its description linked a revision that folds it in half again. I used a spreadsheet to scale the model to a couple different sizes.

Takeaway

I feel like I am assembling a jigsaw puzzle without the box. Each piece must be studied and understood before placing it. Half the challenge is knowing what pieces need to be in place before it’s time to begin studying others. Placing more than one at a time is very difficult, but the HTTPS piece interlocks with so many others, its ecosystem doesn’t lend itself to a project of the week format of study like what I have going on here.

Final Question

The most important lesson in tech is to know where to seek help. I had to seek out a new
Discord server familiar with NGINX this week when I should have looked them up a week ago. How long does it take before you look for specialized help?

Exporting a Discord Server

Good Morning from my Robotics Lab! This is Shadow_8472, and today I am learning about Discord Chat Exporter so I can archive an old role play I was a part of in 2017. Let’s get started!

Vanishing Data Only Hosted Elsewhere

Discord is a communications platform built around the idea of [guild] servers, channels, and posts. Guild servers are exclusively hosted by the parent company, leaving you relying on them to maintain their physical servers. While they provide easy access to chat history going back years and years, they do not provide you with the tools to extract that history in the case you are one day unable to access the service.

In around the middle of 2017, I met a very good friend on PonyvilleSquare forums. He was advertising a My Little Pony role play I joined. We moved the game to Discord at my request. It was a good thing too, because the forums were defunct within a week or two. I lost a minor detail or two from character creation, but we went on to have one of the best games I’ve ever been a part of. I liked the story well enough to go through it again, polishing it into more of a novel format with all the original players’ blessings. It’s always bothered me though that should Discord either go out of business or deplatform me for wrongthink.

Downloading a Server

Discord is rolling out some new rules at the end of the month, and I don’t know if either everyone in my circle of friends will still be welcome when it hits. Ideally, we can transition to using a decentralized platform, like how e-mail operates, where we can be in complete control our live chat server. [Matrix] fits my criteria for this end goal.

What better way to learn about Matrix than to find some tool to migrate a server I don’t want to lose? The Discord bot API only needs to see a server’s history, and it shouldn’t be impossible to record that data into a format Matrix clients can accept. In fact, one of the key talking points of Matrix is its ability to bridge to one or more chat platforms while being as inconspicuous as reasonably possible per platform. However: of the bridges I found, the only one that mentioned history listed it as not-a-feature. If there is a tool to directly migrate from Discord to Matrix, I either didn’t find it or didn’t recognize it.

Instead, I settled with another tool to archive our MLP role play: Discord Chat Exporter[1]. Discord Chat Exporter is a bot that reads Discord channels and reproduces them in a variety of static formats including HTML, plaintext, and a couple others. I found their OCI “Docker” container worked very nicely. Their documentation is clear, though I could nitpick how it didn’t like where I put the –media flag on my first try to download embedded pictures and similar.

3D Printing Corner

I’ve been trying to print a figure of Sonic I found on Thingiverse for a few weeks now. I was having a lot of trouble with the first layer sticking in previous weeks, but I finally added a bed-leveling print to my routine. Sonic himself is split front to back and arranged so he only needs minimal supports. Along the way, I tried slowing the first layer way down and adding this ugly brim I’m having trouble removing. I’ll get it next week when I glue the halves together and sand it.

Side Project

My earliest working NFS automounts were entries in the File System TABle (fstab) for my laptop. Later, I learned to mount file shares as needed with systemd. My laptop spends time off my home network, and without a timeout in my settings, I’m left with extended boot times and programs hanging until I get home and they can finish saving. Today, I copied the relevant files over to a directory on GoldenOakLibry and on over to my laptop, adding a 5 second timeout as suggested in the awesome tutorial I originally followed by Ray Lyon on Ray Against the Machine [2].

Takeaway

Imperfect solutions that achieve most of your goals are often a reasonable compromise when a full solution is a lot harder to research or even get around to doing. I’m glad I now have my MLP game properly downloaded, but even better would be the ability to import everything from a Discord server on over to Matrix.

Final Question

Do you know of a tool or set of tools that can migrate a Discord server to Matrix?

Works Cited

[1] Tyrrrz, “DiscordChatExporter” github.com, [Online]. Available: https://github.com/Tyrrrz/DiscordChatExporter. [Accessed Mar. 7, 2022].

[2] R. Lyon, “On-Demand NFS and Samba Connections in Linux with Systemd Automount,” Ray Against the Machine, Oct. 7, 2020. (Edited Aug. 26, 2021). [Online]. Available: https://rayagainstthemachine.net/linux%20administration/systemd-automount/. [Accessed Mar. 7, 2022].

My Discord Bot Understands Strange Dice

Good Morning from my Robotics Lab! This is Shadow_8472, and today I’m coding Discord dice bot to a practical state. Let’s get started!

Discord Bot Communication Skills

When last I wrote about this bot, I described a custom development environment: a custom OCI container with Python with Discord.py installed and a directory mounted from the host machine. To update the bot, I save the new source file from the host and restart it from within the container.

Programming is boring to describe, so I’ll spare myself writing all the details. Long story short, I needed to translate user requests into a form the core function understood. I used Regular Expressions (Regex) to both separate intended inputs from potential garbage and to extract the kind and number of dice to roll. regex101.com [1] was of great help in testing these expressions.

On one minor note: I got the bot into a Git repository, but I am nothing but a bumbling beginner.

My goal for next time is to produce a container with my code internalized. I’m also scheming something that will let my group know when I’m “playing around with the source code” or the bot is running from within a production container.

Commenting System

Any good program has comments left by its developer – notes for future work on the project. Wise use of comments can speed up development.

by reminding a programmer where work left off or clearly marking off major sections. Working on the command line with the Nano text editor, colors are nicely highlighted, but with all the comments I’m leaving, a simple note left to myself looks no different than commented out code blocks yet to be implemented or scheduled for deletion.

#A simple comment is useful for a quick note.

Basic comments can be anything from programmer notes on how some code works to incomplete or defunct chunks of code that shouldn’t be executed yet/anymore. Programmers must use them unless the objective is for God alone to know how their programs work.

###################################
#A title marks out major sections.#
###################################

Note: In the editor, I’m using “verse” formatting to represent code. In a fixed width text like you will find in a terminal, the lines should be the same length.

Editors that color code parts of your code are nice, but source files begin to look the same after they’re several screens of scrolling. Marking off large groups of functions keeps them organized like chapters in a book. I like to use spam a bunch of comment characters (# in Python) for extra visibility while flipping between places in the code.

################################################
#A broken pattern marks out scheduled changes.#
The quick, brown fox jumped over the lazy dog.
The little dog laughed to see such a sight.
################################################
#The quick, brown fox got distracted.
#The cow jumped over the candlestick.
################################################
################################################

I’d be surprised if I’m the first to invent a way to partition off major blocks of code for redevelopment. Not only can I quickly revert to old code without much thought, its a landmark for showing which sections are actively being worked on.

3D Printing Corner

It’s been a few weeks since I said I wanted to print something each week. This week is no different, but at least I tried.

Gluing a 3D printed object together from smaller parts allows you to overcome print volume limitations of your printer, a valuable skill to have. As I was browsing Thingiverse for something Sonic the Hedgehog related to print, I found a model of Sonic someone split front to back to require almost no support material.

Slic3r was something else. I had a difficult time getting both front and back on the plate at the same time while avoiding the damaged section. Auto-generated Supports ended up in more places than they needed to be. Sonic’s pupil even needlessly generated one with a corner sticking out of his face. I had to shift the halves around multiple times to accommodate the skirt within the print area while still avoiding the damaged spot in the middle – a challenge, but one I accomplished nonetheless. Setting supports to snug cleaned up most wayward supports, but I had to paint on support blockers around Sonic’s cuffs and fingers.

Optimizing for few supports in this way has a major tradeoff: a much more difficult first layer. I didn’t have the patience, so I left the project for another week.

Takeaway

Basic projects are often less exciting than any creative techniques devised to work on them.

Final Question

How have you used comments in creative ways?

Work Cited

[1] F. Dib, regex101.com, [Online]. Available: https://regex101.com/ [Accessed Feb.

28, 2022]

Alternative 3D Slicing Arrangements

Good Morning from my Robotics Lab! This is Shadow_8472, and today, it’s been a busy week. Derpy needed work, but I still wanted to 3D print. Let’s get started!

New Computer Screen

A couple weeks ago, Derpy’s monitor failed. I pulled the graphics card and brought in a cathode-ray tube based monitor from the garage. Integrated graphics aren’t good enough for slicing 3D prints though.

Between bugging out from construction noise next door this week and taking evenings off to recover, a good chunk into the week passed before I made a move to switch back. My father and I took the opportunity for a deep dusting. With the graphics card physically removed, it wasn’t much more hassle to remove the outer cover… The radiator decoupled from the GPU chip in the heart of the graphics card, and we had couldn’t find any thermal paste to put it back together properly.

With some electrically non-conductive paste on order, I felt my desk was overdue for a cleaning, Special thanks to my whole family for helping out in some capacity or another. I sorted the stuff into Keep, Trash, and ??????!. Keep stayed with the desk, Trash got sorted for disposal, and the rest tagged for dispersal according to where it belonged. My father and I further took the opportunity to remove my monitor shelf, dust the desktop thoroughly, and polish it.

I also addressed the cable management situation. With no electronics at Derpy’s workstation, I was free to swap out the power strip for something with a bit longer of a cord (I swiped it from the 3D printer, which had plenty of cord). As I re-assembled my desk, I was sure to tuck my cables at least somewhat out of sight.

A Light Mode Program on a Dark Mode Theme

This section on down to the side project started off as the combined 3D printing corner/side project sections before it grew to half the post at one point.

With Derpy down for service this week, I couldn’t 3D print. Instead, I explored the option of using PrusaSlic3r on my Manjaro workstation.

My graphical package manager presented me with three versions: an out of date version lacking features I’m after from official repositories, an AUR (Arch User Repository) beta version from git, and one AUR entry with a good version number but included GTK-2 in the name. I chose the GTK-2 one, and it appeared to work perfectly, save for that it defaulting to light mode.

There was no dark mode override in the options. The documentation said Linux versions of Slic3r hook into the global theme, which I most definitely have set to dark. No matter how much I played KDE’s themes in System Settings, Slic3r refused to play nicely. I tried switching to the AUR version labeled git, but it didn’t even compile (two attempts).

Assistance With Diagnostics

During research, I came across some discouraging bits about themes not always working on bleeding edge systems. I was about to give up when I brought this matter up on Engineer Man’s Discord server.

Server regular localhost took notice and suggested I install lxappearance, a theme manager designed with the LXDE desktop environment in mind. It too popped up running light mode, but was exposing its own theme selector on the Widget tab. Hitting Apply didn’t have any apparent system-wide effects until I restarted the graphical package manager into my chosen dark theme.

I rebuilt the GTK-2 version of Slic3r, and it greeted me with dark mode. During the 70 minute wait though, I researched the why of the situation. I pinned the culprit to GTK. Aside from its association with GNOME, I had the hardest time piecing together its purpose with certainty. I figured it was some incompatibility with KDE, and I was half-right.

It Works, but Why?

Lxappearance was actually my biggest clue. With both it and KDE’s theme manager open side by side, I noticed a button under System Settings > Global Theme > Application Style called Configure GNOME/GTK Application Style. It led to an unassuming dropdown menu titled GTK theme with a nondescript preview button. The dropdown had the same list from lxappearance.

Researching GTK has no shortage of results, but what does GTK do? As far as I can tell, GTK stands for GNOME ToolKit. I know KDE doesn’t use GTK at its core, so I conducted my research looking for whatever counterpart I it did use: Qt.

I ran a combined search on GTK vs Qt and learned about their combined history. Qt is to KDE what GTK is to GNOME. Qt is older, but GTK was fully opened up first and became more widely adopted. GTK and Qt serve the purpose of drawing the parts of user interfaces you use, but don’t think about – from buttons to save windows. When developers use them, they provide a unified appearance an end-user can easily configure.

Side Project (Blog Site Building)

I’ve begun research into improving the presentation of this blog. It’s hard to know where to begin. I’m working on four and a half years on the job and I have still to formalize my niche. There are blogs out there for privacy. There are blogs out there for technology and Linux. There are fewer blogs out there for home robotics and AI. This blog is all of those, to an extent. That’s why I’m consolidating my niche to Home Computing for the Privacy-Minded Roboticist. I don’t expect things to change all of a sudden, because I’m still technically covering the supporting technologies: namely Linux. But I want to aim to be doing more with actual robotics from here on.

Over the next several weeks, I intend to make small changes to the site, starting with the “About the Author” page. I’m also working on a community Discord server so we can finally get the conversation going in a place where I don’t need the patience to get WordPress forums going at this present time.

Takeaway

Even though I was out and about, I still managed to find stuff to write about. That said, modular systems can be a bit of both a blessing and a curse at times. Feature A may be implemented any number of times – each can work equally well and provide redundancy in case one project goes unmaintained/unforked, but clashing systems can lead to confusion when an end-user finds himself diagnosing the wrong backbone without realizing there are multiple in the first place.

Final Question

What do you think of my stated niche: Home Computing for the Privacy-Minded Roboticist?

Work Cited

[1] B. King, “What’s the Difference Between GTK+ and Qt?,” makeuseof.com, Feb 20, 2019. [Online]. Available: https://www.makeuseof.com/tag/difference-gtk-qt/. [Accessed Febrewary 21, 2022].

Containerized Development Environment

Good Morning from my Robotics Lab! This is Shadow_8472, and today I am building my own dice bot for Discord using containers. Let’s get started!

Overview

In last week’s post, I learned how difficult a Discord dice roller is to find that is either already in a container or suitable to install into one. However, I did develop my skills along the way, and I believe I’m ready to make a bot of my own from scratch.

Development Environment

None of my machines had Python on them (except perhaps excluding the odd Raspberry Pi I have laying around), so the first order of business was to set up my own environment inside a container. There are a number of base images for running Python, but for development, I chose the latest official Python.

Podman pull python:latest

I went back and forth several times with the geometry of my bot project. I ended up stashing my work last week into a directory and making another to hold this round. When I was done, I had three files of consequence: Dockerfile, requirements.txt file, and a directory called home.

When I tell Buildah to make an image, it first goes to the Dockerfile:

FROM python:latest
COPY requirements.txt .
RUN python -m pip install -r requirements.txt

This takes the Python image, copies in requirements.txt, and references it to install any dependencies that don’t come with Python by default, namely as discord.py. As such, requirements.txt had a single line:

discord

Container base images leave out a lot of quality of life programs one might expect on a normal Linux install, like a text editor. That’s where the home directory comes in.

podman run -t -v /home/shadow8472/<bot project>/home:/root:Z -i dice_development:latest /bin/bash

This command has Podman use that image to make a container, mount that home directory into the container as /root (:Z is to tell SELinux it’s all good), and start a bash shell. From here, I can

podman attach <container name>
cd /root

and run the bot’s .py file. With the shared directory, I can edit it from the relative comfort of the host computer, ButtonMash, and go straight to running it inside the container. Best of all, the container will keep running with the bot if my connection to the host is broken, like if the network drops out or if I willingly close the terminal window. When I want to keep working, I can reattach the container.

Login token as environment variable: will my mental innovation of using the dockerfile to assemble it into a format Python understands work?

Development

I don’t have many comments about the actual development of the bot. It’s been a while since I actually programmed, and it’s been longer still since Python. I learned the basics of async programming a few years ago, and discord.py is building on that introduction, but I’m not setting out to master it just yet.

On my way to first stable “release,” I was coding up a loop meant to fill an array with die rolls. A bit of C++ grammar slipped in, and only after asking around did I identify it on my own and fix it. Another time, I coded an echo! function to practice passing command extensions into my code.

Most of my time went into constantly overhauling the internal logic. My early prototype was hardcoded to build its output string one die at a time, but I had to rework the back end to store the dice as they came in so I could sum them up and display that separately. All this was done while trying to keep it in a near-functional state.

But there are times a feature needs invasive re-working. I have some code in my comments that eliminates string manipulation from a function that should only be dealing with numbers. I’ve tried learning a popular version control system called Git in the past, but I can feel that I might actually stick with it this time. I’ve started reviewing commands, but I have yet to start using it as of writing.

Side Project

My week started off rough. I found my Derpy Chips workstation with a blank screen when I went to pull up last week’s post for some last minute proofreading. Initial diagnostics showed the screen blanks 0-30 seconds after making a picture from waking up. I got some help pouring over journalctrl and Xorg logs, but everything looked normal. The problem persisted through rebooting, pulling the GPU (graphics card), booting to an external drive, driving the monitor with my laptop, and even using a DVI cable instead of an HDMI. Final diagnostics turned up a dying backlight. I re-enlisted a personal museum piece –a vintage cathode ray tube model– to fill in until a suitable replacement can be procured.

3D Printing

Turns out that while I can play Minecraft just fine on integrated graphics, Slic3r pushes a few too many polygons for a smooth experience. I can’t run the old monitor off the graphics card because the card doesn’t have a VGA connector. Until I get a replacement monitor –or at the very least an adapter– I’ll be stuck with printing pre-made .stl objects or else installing Slic3r on another workstation.

What I did instead this week was make my own profile picture for the dice bot. I found a few dice I used to role play with and set them up in my photo booth. I even used a bead from printing the Z-braces to support a die in the back. I tweaked the picture a bit in GIMP to make it look more like the actual dice before uploading it for my friends’ enjoyment. It was not fun to fight the .jpg compression the entire way.

Takeaway

Programming is a completely different side of technology than systems management. It’s been a rewarding experience assembling my own environment to work in. It will need even more tweaking if/when I need to adapt it for use with an IDE, but those are for people who either already know everything that’s going or or those who don’t care to learn what’s going on at a basic level.

Final Question

Async functions are weird. I am after a small function to both log and send a response message. How do I pass an async call to another function? Am I even asking the right question?

I Buildah Discord Bot

Good Morning from my Robotics Lab! This is Shadow_8472, and today I am working on a dice bot for a role play on Discord for a few friends. Let’s get started!

Seeking a Container

Many projects are like a tree in terms of having a general sense of progression up from the root and the fine details take most of the work to perfect. This week, my project was a rose bush. I have an end-goal in mind, but I want to run it from a container, a technology I still haven’t fully introduced myself to.

My plan started out simple: find a Discord dice bot already in a container and get it on the server. DockerHub, a sizable repository of OCI (Open Container Initiative) container images. (Most places call them Docker Containers due to its popularity over the past ten+ years. Searches for help should be worded accordingly.) I located about the only one that met all my simple criteria and made myself a bot account for it.

Discord bot accounts are more similar to human accounts than I gave them credit for. The only big differences are that bot accounts log in with a token instead of a username/password and the interface is different to accommodate a program instead of a human. Just as you only interface with your account to make posts, so too does a bot interface with its account to make posts. Give the login to someone or something else, and Discord shouldn’t care.

Long story short, the bot was set up to use an environment variable when using the image to make a container. Once I got it logged in, it ran into other problems I wasn’t prepared to diagnose.

Learning to Build Containers

With my only obvious option a bust, I set my sights on a Discord dice roller I’ve used in the past made by SkyJedi for the Star Wars tabletop RPG’s and a generic spinoff called Genesys. The game I’ll be running is GURPS, which focuses on using 6-sided dice. Plus it has an interesting turn counter system for combat I’d like to try using. The rest is fluff to me this time around, so long as I get it working.

A quick tell of an intense week is when I spend a whole day watching tutorials on the same subject over and over again until I find one at my level. This was one of those weeks. I remember there being one breakthrough video right at my beginner level that let me go back and follow the logic of more advanced tutorials that previously dazed me. During this intense study session, I puzzled together how to use Buildah at a beginner level, what a Dockerfile does, and went from muck to murk in my understanding of Javascript.

Buildah is a for making OCI containers Podman can later run and another tool I haven’t yet explored can edit. Like Podman, Buildah’s corner of their ecosystem aims to replace Docker commands one for one. It’s a win for people switching from Docker, and a win for newcomers like me who can look back at pertinent Docker documentation.

Docker –at least– takes a layered approach to making containers. Using a Dockerfile (one word, also its file name with no extension) lets you build start with a base image and build it up layer by layer, one command at a time. Parts can then be swapped out and the image rebuilt as needed.

The Star Wars dice bot is written in Javascript. If there’s one thing I learned about Javascript this week, it’s that there are several “frameworks” for both front-end development (used to make things look nice for users) and back-end development (used for internal logic). More specifically: I needed to look into NodeJS, a back-end framework. Node has a few different base images on DockerHub, so I worked with the full one with the intent to swap it out for smaller ones for a much smaller image.

Assembling My Own Containers

It took a very special set of circumstances during my self-study for containers to really click. First, I’ve been working through the Podman plugin for Cockpit. Individual images and containers are presented in an intuitive way. Each container has tabs for info, logs, and console access. The life cycle of a container is tied to executing a single command, but if that command is to start a shell, I can interact directly with the container like I would at any other command line. I could test commands from there, and if I got something right, I could add it to the Dockerfile for my next iteration.

I was actually able to find SkyJedi’s Discord server and contact him directly. He wasn’t familiar with containers enough to help me, but he did direct me to a much simpler bot of his I was rapidly able to package into a Node container – and later a Node:Alpine container.

The difference was login token. No matter what I tried, the full dice bot would not accept its login token. I was not able to figure this out, though I came quite close.

Side Project

I’m considering a new weekly segment where I work with my 3D printer a little bit each week. This week, I printed up a calibration cube using everything I’ve learned so far. It’s still far from perfect. I still need to tune in my Z-braces, as I can tell from some faint ringing I can more easily feel by running my thumbnail across it. I still need to calibrate my E-steps, a process I may need to repeat a few times as I come up with interesting, new ways to improve my printer.

Takeaway

After all that, I looked ahead at a the database I’d need to deal with once I get the bot logging in, and I’m almost certain now that my time will be better served making my own bot in Python. Of minor interest, I was able to learn the curl command better. Rocky Linux apparently doesn’t come with wget, the terminal program I usually use to download files. Curl –on the other hand– copies the contents of links to the stream. When directed to a file, it does the same job as Wget. A cool trick I pulled off involved manually following a redirect link.

Final Question

I feel like a rose bush gardener with nothing to show for his work but the tools he’s learned to use along the way. What projects have you farmed up a bunch of dead ends on?

3D Printer Modding

Good Morning from my Robotics Lab! This is Shadow_8472 and today I am upgrading my 3D printer. Let’s get started!

In Pursuit of a Perfect Print

I really upped my 3D printing quality last week, but I still have a ways to go for so-called perfect prints. The Maker Select Plus was a good choice for its day for learning the basics of printing, but official maintenance options are lacking outside the design’s communist country of origin.

But who says my 3D printer has to remain 100% stock? It’s a time-honored tradition to use what tools you have to improve upon said tool set, and with 3D printing technology, precision parts are easier than ever to manufacture. I don’t need some company to sell me an upgrade I can make myself.

Ringing

I was advised last week that I have a ringing problem with my prints. The head and build plate on my printer each have mass. As these masses whiz around each other with high accelerations, they shift the steel frame ever so slightly in the opposite direction per Newton’s Third Law. This sends waves of energy back and forth through the whole unit and right back into the print area. Unless the slicer has some way of anticipating these waves (good luck), they’ll manifest in the print as filament is laid as ripples.

I’ve found three ways to reduce this effect: print slower, reinforce connections, and tune belts. Slowing the printer as it prints perimeters is a simple setting in PrusaSlic3r. Belts are a bit harder to access, so I won’t be covering those this week.

I located a whole series of Z-braces on Thingiverse[1]. I picked one remixed specifically for my printer (and its many, many clones) after hours of research. In addition to holding the vertical truss in place, the brackets are designed with adjustable feet so I can remove the paper soup I have been shimming my printer level with, allowing the bad vibrations to more efficiently dissipate into the table.

Printing and Error

By some amount of pure, dumb luck, I managed to print around half the pieces by volume in one go overnight: a bracket for each of the two back corners and four nut covers for up top. I’m at a loss for words for how I felt when I first handled the brackets and the flat parts came out smooth. Closer looks over the following days turned up additional flaws.

The other four pieces weren’t nearly so cooperative. The upper brackets have four holes through the first layer. Between them and the outer perimeter, each loop contributed what felt like a 50% chance of failure. I finally got a successful first layer after what felt like forever and the printer messed up one of the bits for the second bracket and I got myself a wafer to photograph. It was recommended I calibrate my flow rate – a worthy project for another time. I’d just as soon keep the quality consistent within a project. Each remaining bracket was printed individually.

The project calls for metal rods, nuts and feet, but since Monoprice shortened the screws to just barely be long enough for the stock printer, those too must be replaced. My father stopped by the hardware store to pick those up. The trip must have gone well, because they carried everything described on Thingiverse down to the exact package in some cases, such as the feet.

Installation

Read your instructions, if you’re following along. I found that each generation added a little something to the files, but cut material from the directions. I got a little mixed up.

We started by installing the feet. The instructions suggested using a press to shove them into their brackets, but my father cut them to size so they fit hand-snug. The brackets fit nicely on their respective corners, and the back ones even had a notch cut out to accommodate stuff sticking out around the power interface. The other side is mirrored.

We tried a number of things with getting the rods situated, but what I found worked best was a pattern of bottom-top-middle. Apply the first Nylok nut to the bottom of the rod and adjust it so the rod is just barely still within the bottom bracket when the nut is as deep as it can go. Add the middle nut, another Nylok, adjust it below its final position, and add a cap. Slip the rod through the upper bracket – be sure to have another cap and then a regular nut. The caps should be pointing into the upper bracket. Tighten the upper capped nut into its final position, then carefully adjust the middle nut into place. To spare your hands and the parts, you may want to grip the rod with pliers through a paper towel while twisting with another tool.

Side Project

I installed the ProjectKorra plugin for Minecraft 1.18, as it was something I’ve done before and every other project I looked into kept looking more involved than I had time for. I needed FTP access to upload it, and Filezilla was already on my laptop when I thought I’d need to either install it special or move to another workstation with it. I did, however, use Derpy to download to cold storage so I wouldn’t be streaming over the Wi-Fi and back.

Takeaway

I printed a white Benchy with an existing .stl file keyed to the other filament spool’s temperature. I had to adjust it mid-print. As for surface quality, maybe there’s a little less ringing, maybe it’s just noise. I will want to tune my printer farther in the future.

Final Question

I’m getting bored of Benchy. What are some other tests I can try?

Work Cited

[1] morjagel, “Z-Brace for Monoprice Maker Select Plus,” Thingverse.com, April 27, 2017. [Online]. https://www.thingiverse.com/thing:2349318. [Accessed Jan. 31, 2022].

Filament Switch: Hard Mode

Good Morning from my Robotics Lab! This is Shadow_8472 and today I am learning a lot about the medium-grain details of printer calibration. Let’s get started!

Low Filament

My red filament is almost gone. I was considering using the rest on printer calibration tests, but when I found it broken, I went ahead and readied my white filament – the spool I have historically had a harder time with. I used my loop of cleaning filament to reach into the print head and push/pull out most of the remaining bits of red gunked up in there. I found a little red afterword, but there was surprisingly little leftover overall.

My printer’s print head works by grabbing the filament directly above the hot end, and there’s just enough room for filament to get lost during loading. I didn’t think much of it when a section of filament broke off in there. I made note, then set the printer up for several hours of operation. As of drafting this paragraph, it hasn’t caused any problems, but I’ve already researched the solution.

Temperature Tower and Mini Test

The first thing I printed was the temperature tower using the same .gcode I downloaded in a previous post. I should have the skills to slice up one for myself now thanks to playing around with the PrusaSlic3r interface, but I’ve used it before and it didn’t destroy my printer. I was expecting this filament to want it a bit warmer than 185 degrees C, but I was surprised when the only slightly warmer floor for 190 turned out the best.

I sliced up a 190 degree version of the mini all-in-one printer test. When I printed it over the central bed’s scratch, I saw a black spot in its middle of the first layer. As the build plate deformed, that must have been where the material went. Other results appeared to be on par with when I successfully printed one in red: I could read more of the test labels, but it felt brittle. The stringing test actually broke in an accident in the completed photo booth.

Benchy, the Benchmark Tugboat

I took part in a 3D maker tradition and printed Benchy, a tugboat designed with a number of challenging geometries. I’d say it came out pretty well – hardly perfect, but my untrained eye only noticed a couple major issues I took to the photo booth about. I found that I could actually use my begging-brother-special camera by letting it do whatever it wanted with auto-focus, then correcting it with a handheld magnifying glass.

I was able to post a series of pictures of Benchy in a few places on Discord and ask for help. Through feedback, I learned my most interesting issue is probably ringing. Ringing (as in like a bell) is when sudden movements cause vibrations the stupid 3D printing machine doesn’t account for. I need to print more slowly and work on a way to level my printer frame without resorting to paper soup like I am now.

My second Benchy went better overall. Per other advice, I used thinner layers and left my case open. I tried slowing the print job, but with Slic3r’s many settings and a delay in communication, I wrongly guessed that limiting long-distance speed would improve quality the most when I should have gone after perimeters instead.

The print itself has more, smaller flaws than my first. For starters, the lettering on the bottom totally failed. I got these odd bubbles over the ship deck and cabin roof. Other than that, the layers were all a whole lot smoother, there was no stringing, and a plaque on the back was clearly something –it wasn’t legible– but it didn’t look like a random mess. I also had some bubbling along the tops of the deck and the cab roof: probably steam from hydrated filament.

With my white filament sent off to the dehydrator, I printed a couple more Benchys in red. They both turned out about the same. The one where I added the front panel back in fixed one of two of the water lines, but seemingly made the other one worse.

Over on the dehydrator, my old, white filament is in for the thermal stress gauntlet. I ran it closer to the glass transition temperature than before to the point where a loop of filament sticking up collapsed under its own weight. Weighing it before and after showed no change in weight. It at least looks like I didn’t accidentally melt the whole spool. If I did, it’s tricky filament anyway. It still feels brittle, but I’ll try using it with a few larger prints as-is and see how they turn out.

Side Project

As soon as the calibration part was off the printbed, I started on a gift for my sister, Taz. She showed interest in helping with cleaning Twilight, so I made her a figure of Tails, Sonic’s two-tailed sidekick/best friend. I found an offering on Thingiverse with Sonic, Tails, and Knuckles. I didn’t like Knuckles’ pose, and I personally prefer Tails anyway. Later, I thought of about eight good reasons pointing out the back of Sonic’s head as to why he might be the more challenging cleanup (his quills).

I wanted Tails to have an inch of height for every foot the character is tall. Tails’ base plate was about 1/8 the height of his figure overall. I grabbed his height from the Sonic Wiki and scaled accordingly. There was no way I would be getting away without at least partially printing on the scratch, so I just left it centered.

While trying to remove unnecessary supports, it became apparent that these models can’t have been intended for anything but resin printing. Internal voids kept begging Slic3r for support material. I removed them in Blender so I could use my favorite infill setting (15% 3D honeycomb). I found another cavity for his mouth and tongue, but I felt lazy and fed him an appropriately squashed and rotated solid “sphere” object to fill his mouth instead. Thinking of infill, I knew the bottom of the baseplate would be due for some sort of modification, so I just printed it solid.

The figure came out… well, let’s just say it was a learning experience for both of us. I may have rushed the slicing a little to keep the secret. The supports were a mess. The print was plagued by this ringing phenomenon I had yet to learn about, and his arms, legs, bangs, and face/chest fluff were tiny – as well worded by Taz when she said something about literally knocking his socks off. He came out recognizable, but a larger follow up attempt is in order after I finish mastering the not-quite basics presented above. For what it’s worth, the base does have some decent heft to it.

Takeaway

I’ve already said this, but there is a lot more to 3D printing than sending it a file and hitting go. Then again, where was consumer 2D computer printing when the technology was ten years old? There’s a story in my family about someone rewriting a pen plotter driver to cross hatch using long lines instead of filling each x individually. Likewise, people are still innovating like crazy before the technology is locked down to the point where it’s baby-proofed so much a first grader can work it without prior 1st hand experience, supervision, or even so much as an explanation.

There is fun to be had while it lasts, but there is a learning curve to climb beforehand. Proper diagnostics are key, otherwise I’m blaming everything on old filament.

Final Question

What is the most challenging tool you ever taught yourself to calibrate?