Today's Programming: Ruby and Python
I don’t know how long I intend to keep doing this, but I decided I wanted to document my programming as I went along. So yesterday I worked on Scratch and here’s today’s entry.
Ruby
A while ago I got a bunch of kids’ programming books in a Humble Bundle. I tried showing Ruby to my oldest, but I did it one year too soon (she wasn’t yet reading as well as she is today and couldn’t type as well as she can today) so for now she’s not into programming. But I was curious to see how it was presented since the book uses a story to present it (quite different from the Python book in the same bundle). Went through chapter 2 today and, so far, it seems that Ruby is pretty readable like Python is. That said, I’m not sure puts makes more sense than print, but maybe if I delve into the history of Ruby, I’ll understand why it’s puts? The author of this book uses snake case for variable names. I wonder if that’s because it’s the Ruby standard to use snake case instead of camel case or just to make it easier for the kids following along. I *did* really like the built in next and pred methods on numbers. Definitely more readable than a var++ or var = var + 1. Or rather, if you don’t have decades of programming experience (as I do), I think it’s just a faster bit of cognition to see var.next and understand it vs the older ways of doing the same thing.
Today's Programming: Flowers in Scratch 3
First of all, if you’re a Linux user and would like an offline version of Scratch 3, you can get it from https://scratux.org/. They make binaries for a few Linux distros plus an AppImage which works on any of them. On the Raspberry Pi Blog I saw that this week was about making art on the computer. So Stella and I went through the tutorial for making flowers in Scratch. Here’s what the code blocks looked like:
So Long Katello Foreman!
Last year when I went to Red Hat Summit, I saw a lot of use of Satellite. I’d tried the 5.x series’ upstream Spacewalk and it didn’t quite work out for me. But this time I would try it out, gosh darnit! I mean, with the Katello plugin it would even include Pulp, which I’d been interested in trying out before because it could cache RPMs during an upgrade. So I’ve been messing with it here and there. However,I don’t use Puppet scripts (it’s like Chef or Ansible in principle) and I don’t have the need to provision new machines or VMs (especially when that’s already pretty easy with Cockpit and/or Virt-Manager). It’s already easier and works more consistently for me to keep track of whether my computers are up to date (and update them if not) with Cockpit. The RPM caching part of it was neat, but recently it stopped working consistently. Upgrades are VERY fragile and messing up on installing a plugin could bork the whole system. Also the necessary files - puppet, katello-agent, etc were always behind in providing packages for Fedora. Turns out it was a bunch of extra work and frustration just to keep track of my computers - and I was already doing that in Dokuwiki.
Upgrading my Katello-Foreman-Managed RPM build VM to Fedora 32
Because I have this VM registered to Katello (Foreman plugin) to receive updates (basically as a way of both keeping track of the computers and VMs on my network and also to have a GUI to pulp for caching RPMs), I had to deal with Katello-Agent. The latest RPM in the official Foreman/Katello repos is unfortunately for Fedora 29. That version of Fedora has been out of maintenance for a long time. Maybe Foreman (upstream for Satellite) is just used by most of their customers for RHEL sites that don’t have any Fedora nodes? So I did find this copr that provides updated versions: https://copr.fedorainfracloud.org/coprs/slaanesh/system-management/
New Dishes I cooked in April 2020
When it came to new dishes, April was all about bread. First, I made a no-knead bread with America’s Test Kitchen’s recipe.
Almost No-Knead Bread
It came out OK. I actually tried it again the following day to try and get a darker crust. The funny thing is that this is one of the easiest breads to make and yet it’s the one I’ve had the worst results with. The crumb wasn’t as open as it was supposed to be and for all the time it took to proof it was pretty meh.
Ubuntu 2020.04's Server Install
As I mentioned in my k3s on Ubuntu 2020.04 post, I really thought that Ubuntu 2020.04’s server install was prety slick. I’m used to text-only server installs looking like this:
Arch Linux Installation Begins
Here’s a step-by-step collection of screenshots and my thoughts on each step of Ubuntu 2020.04’s server install:
Language Selection
Just starting off, with the language selection, you can see this isn’t the usual ugly ncurses install. It looks like a beautiful matte black.
Checking out k3s and Ubuntu Server 2020.04 Part 2
Clearly there’s a lot I don’t get about Kubernetes and I didn’t install a GUI in that VM so I can’t use the dashboard (which can only be viewed at localhost - or so the instructions seem to indicate) So I decided to go back to basics and look at the Hello Minikube tutorial, but run it in my k3s VM.
kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4
So I think this is the first part of why I was having problems yesterday with the pod I created from Podman. A lot of the commands I saw online implied a deployment, but I hadn’t created one. This is evidenced by:
Checking out k3s and Ubuntu Server 2020.04 Part 1
As I’ve been working on learning server tech, I’ve gone from virtualization to Docker containers and now Podman containers and Podman pods. The pod in Podman comes from a view towards Kubernetes. I moved to Podman because of the cgroupsv2 issue in Fedora 31 and so I figured why not think about going all the way and checking out Kubernetes? Kubernetes is often stylized as k8s and a few months back I found k3s, a lightweight Kubernetes distro that’s meant to work on edge devices (including Raspberry Pis!). For some reason (that I don’t seem to find on the main k3s site), I got it in my head that it was better tailored to Ubuntu than Red Hat, so I decided to also take Ubuntu Server 2020.04 for a spin.
Fedora Silverblue as an HTPC Part 3
Yesterday I mentioned some issues with my Ortek MCE VRC-1100 remote and certain buttons not working. Figured out that in addition to removing the XF…. entries in dconf, also have to remove them in gsettings. Specifically, I had to use the commands:
gsettings set org.gnome.settings-daemon.plugins.media-keys stop-static [’’]
gsettings set org.gnome.settings-daemon.plugins.media-keys play-static [’’]
gsettings set org.gnome.settings-daemon.plugins.media-keys pause-static [’’]
After that, everything was working as it should. So far no negatives to using Fedora Silverblue as our HTPC. We’ll see if that changes as I try to get Lutris to launch some Wine games.
Fedora Silverblue as an HTPC Part 2
One thing to know about Silverblue is that it’s a Gnome environment. I was already running Gnome for the HTPC, but I prefer KDE for my computers usually. When I was installing Silverblue there was no option to go for KDE or anything else. On Silverblue you install via Flatpaks. Any regular installs (ostree instead of rpms) also requires a reboot.
A few things to note based on getting Kodi setup: