• Linux
  • April 2024
    M T W T F S S
    1234567
    891011121314
    15161718192021
    22232425262728
    2930  
  • Meta

Installing Virginia

I’ve been using Linux Mint for years, at least a decade, and it’s been my daily driver for many of them. Currently, I’m running it on four machines, my main computer, a laptop dedicated to my finances, another laptop that used to be my main laptop, and a desktop I’d intended to replace my wife’s Windows 10 PC. I’d upgraded all of them except my main machine soo after Linux Mint 21.3 Virginia was released, and these upgrade went quite well, with few, if any, problems. And they’ve been working well.

Generally speaking, the updated and new features that have been included in the Mint 21 point releases haven’t had anything that excited me or anything I had a particular need for. Mostly, they were minor cosmetic changes, although I can see the usefulness of the some of the changes made to the Cinnamon desktop and the Nemo file manager might have for someone who primarily uses a GUI interface. I, however, spend most of my time in the terminal and don’t use the GUI all that much. I keep up with the new releases mainly to make updates and upgrades easier down the line.

Yesterday I decided that it was time to upgrade the main machine. The upgrades to the other three Mint machines had been relatively quick and easy, so I didn’t anticipate any problems. Prior to starting the upgrade, I’d installed updates to the other Mint installations, and among the updates was Firefox. Linux Mint, because of their dislike of Snap packages, mantains their own version of Firefox which, I’ve noticed, usually takes twenty to thirty minutes to download and install. I’ve been surprised on occasion by a quick download, but that’s the exception, not the rule., and the latest updates followed the rule.

In over thirty years of working on computers I’ve found that an easy, problem-free upgrade is a rare event, so I should have been wary. While the previous upgrades to Virginia had taken less than an hour, this upgrade took over four hours to complete. (I probably could have installed it from the ISO quicker.) On average, the download rate when downloading packages was about 25 kilobytes per second. I occasionally saw it go as high as 52kb/s and drop down as low as 3kb/s. I do have reasonably fast Internet and while my computer and my network topology isn’t the latest and greatest, it’s quite adequate for the task at hand. Other than the download speeds, the upgrade was otherwise trouble-free.

Already, I’m starting to see information about Linux Mint 22 which will be coming out sometime this summer, and I’m having reservations about my future wth Linux Mint. It has worked very well for me over the years and I really like it. The biggest irritation I have about it lately has been the overall slowness of Firefox updates. Firefox hasn’t been my primary browser for years, preferring chromium-based browsers.Right now, I’m only using Firefox on mly main PC as the web interface for my git repositories.

Yesterday I began an experiment on a Mint laptop where I removed the Mint version of Firefox and replaced it with the Mozilla DEB package. I’ll be keeping an eye on it to see how well it goes.

When Linux Mint 22 Wilma is released this summer will I upgrade to it or try something else as my daily driver? I have Linux Mint Debian Edition (LMDE) running on a couple of machines and it has been working quite well. I can actually see myself living in LMDE on my ‘production’ machines, particularly when considering Canonical’s and Ubuntu’s increased emphasis on pushing Snap packages for applications. It’s going to be increasingly more difficult for the Mint team to work around that.

Debian has become the dominant operating system on my network in the past year or so. I’m running minimal Debian installations with i3WM on several machines as well as Debian-based distributions such as Bunsen Labs, MX Linux, and LMDE. Migrating from the Ubuntu-based Mint to LMDE would likely be a natural transition. As a near term project, I’m planning to install i3WM on one of the LMDE systems as an alternative to the Cinnamon desktop.

So far, Virginia seems to be working well and I’ll likely stay on it until after Wilma is released. Mint 21 will be supported until April 2027, so I don’t have to be in a hurry to upgrade or move on to something else.

Repo Snapshots

Back in September, I created several scripts to create daily, weekly, and monthly snapshots of my local repositories. I don’t remember for sure, but I think I was inspired by one or more videos demonstrating how to create backup using the tar command. The examples I saw were probably separate scripts for each time increment. I created my own scripts and am running them as cron jobs. That’s been working out very well.

This morning I got to thinking that I could probably combine the daily, weekly, and monthly jobs, along with the short script that syncs them to my Gitea server into one script. I cut and pasted the pertinent lines from the scripts into one script and cobbled them together into something workable. The script is meant to run as a daily cron job and use if statements to determine when each snapshot should run.

Later on, I took another look at the script and determined that I could improve upon it. I put the commands for each backup and put them in their own functions, so I could use the test brackets to call the functions, thus eliminating the if statements. The first rendition of this script used the digital representation of the days of the week to deterimine if the weekly snapshot should be performed. Rather than test for 0 or 7 representing Sunday, I changed the day of the week variable to hold the abbreviated day of week (Sun) instead, like I did with my incremental backup scripts.

This new script replaced four scripts in my crontab. It is scheduled to run daily and uses conditional statements to determine which functions will run. The current schedule of backups will be maintained with the weekly snapshot running every Sunday and the monthly on the first of the month. I believe this will be more efficient and help to declutter my crontab.

Mint 21.3 Upgrades

After a month in beta, Linux Mint finally release 21.3 Virginia last Thursday, and I downloaded the ISO and the checksum files. A couple of days later, the updates appeared in the Update Manager. A day or two later I began updating the four Linux Mint systems. Like the entire 21 series, the updates didn’t contain anything that was particularly important to me. For the most part, most of the changes in the current distribution have been cosmetic. But I think it’s good to upgrade anyway because it will make it easier to do an in-place upgrade to Mint 22 when it comes out this summer.

Three of the four systems have been upgraded with the main system being the only one left to upgrade. I started with the HP ProBook 6570b on the back shelf to see how well it would go. I’m happy to say that it went very well, and was quicker than I’d anticipated. Then, a couple of days later, I upgraded the Finance laptop (another ProBook 6570b) and the HP 800 G1 USDT. Neither of them encountered any problems and the upgrades completed even faster than the first. So far, the only new feature I’ve used is to center the login in the display manager screen. I’m not that concerned about the enhancements they’ve made to the file manager, the icons, and the GUI in general.

I will more than likely get around to upgrading the HP 800 G2 SFF within the next few days. There are still four machines running some form of Debian 11 on the network. It will probably be a while before I upgrade the Gitea server because I want to be sure I can back up and, if necessary, recover the Gitea database. The next Debian upgrade will likely be the HP 800 G1 desktop mini which is currently running Debian 11 with the Cinnamon desktop environment. I will probably do a minimum installation of Bookworm with i3. That leave the Gateway E-475M laptop and the HP 110 Netbook which are both running BunsenLabs Beryllium (base on Debian 11). They both run OpenBox which is okay, but I’m thinking I’ll go with minimal Debian and i3.

Debian Upgrades

After putting it off for a long time, I began upgrading my Debian 11 systems to Debian 12. After reviewing the in-place upgrade process, I wrote scripts to handle each stage of the process. There’s probably a way to do it in one script, but I didn’t feel like messing with that.

The first script updates the current Debian installation. Then, after a reboot, the second script uses sed to replace all the isntances of bullseye with bookworm in /etc/apt/sources.list and in /etc/apt/sources.list.d/bullseye.backports.list if it exists. The script also adds non-free-firmware where necessary, and if the backports list exists, renames it to bookworm.backports.list. Then it performs a full upgrade using the updated source lists. Finally, the third script confirms the upgrade by displaying the release and version information. Then it cleans the apt cache and removes orphaned packages.

Overall, the process has worked quite well for me. The only real problem I’ve come across so far was with my main laptop, an HP ElietBook 850 G3 with the i3 window manager. In a termnal window, I lose the half of the bottom line when the window is full. Applications run unside the terminal such as Micro and Bat look fine, but the bottom line of Htop is cutoff when it’s maximized. It only occurs on this particular laptop. The only change has been the upgrade to Bookworm, none of my configuration files have changed. Online searches have provided me with nothing useful.

I’ve got one more deskotp computer on which to do an in-place upgrade, my Gitea server. I’m going to hold off on that for a while until I get a feel for backing up the database. Maybe once I feel comfortable with that, I can do a complete rebuild of the system and provide it with a larger root partition or maybe just a single partition.

Other than that, I have an HP mini-PC that’s currently running Debian 11 with Cinnamon. That one was upgraded in-place from Debian 10. I plan to wipe it and do a fresh Debian 12 installation with i3wm. I also have two older laptops that are currently running BunsenLabs 11 which I’m considering changing to Debian and i3. BunsenLabs uses Openbox and after using a tiling window manager for a while, a floating window manager just doesn’t have much appeal. Plus, on those laptops, I really don’t need most of the applications and utilities that are included with the distro.

Penultimate Day 2023

I guess I was busy this year. I messed around with bash scripts a lot; writing them, modifying them, and even abandoned a few.

When I first changed my GitHub access to use SSH, I couldn’t get it working right, so I put it aside for a while, and eventually set up a local Gitea server (October 2022). This past October, I found some information that finally made GitHub usable for me again. Since my scripts repository hadn’t been touched in well over a year, I deleted all of it, and pushed some of my current scripts to it. I’m not putting all of my bash scripts on GitHub, only some that I think might be useful to others. A lot of my scripts are specific to my personal computing environment.

In the past few months, I’ve been messing around with tar as a means of archiving my financial records and my scripting projects. Now I have several incremental backups running every day. I was kind of surprised at how easy it is to work with and setting up the incremental backups was relatively painless.

Speaking of backups, I did a lot of work on my backup script based on Joe Collins’ script. I set it up mount the USB backup drive if it’s not automatically mounted. I needed that capability on my Debian i3 machines until I found a utility that would automatically mount USB drives. For a few machines where I take regular snapshots, I have it set up to recognize if the correct backup drive has been attached. I also replaced the original nested if statements with case statements for better efficiency.

Another small project of mine was to write a couple of scripts to work with downloaded ISO files. When I download an ISO from a distro’s web site, I also down its SHA checksum. My verify-iso script verifies that the checkums match. The write-iso script writes the ISO to a thumbdrive using the dd command. The scripts lists the available files and the writing script lists available removable media that can be written to.

I’ve been expanding my use of i3 on Debian. I have several laptops and a couple PCs running it on Debian 11 which I plan to upgrade to Bookworm. On the Bullseye system, I originally used Bumblebee Status as my status bar, and I’ve replaced it with Polybar. I have one laptop with an external monitor attached to play around with i3 on multiple monitors.

My son bought my wife a new computer for Christmas, and I had the pleasure of setting it up. It wasn’t nearly as painful as it used to be when I built them. Even copying her files over went rather well. Her Windows 10 computer had been acting up a lot for a while. It was slow and would often lose its network connection and the connectinons for everything else on that switch. A couple of months ago, I started setting up Linux Mint on one of my better machines, getting ready for the day her Lenovo finally died. The new machine is working well for her. It’s running Windows 11 Home which is adequate for her needs and works well in my network environment.

No Zen With Zenity

The idea of incorporating Zenity into my Bash scripts has been on my mind for some time. Having pop-up boxes to prompt for input or to enter a password, or display a warning or an error message, is intriguing. I can think of situation where having a file selector or a graphicl progress bar would be handy. I do have at least a couple of scrlpts in which such things could be very useful.

I’ve come across a lot of online articles and YouTube videos discussing and demonstrating Zenity and similar tools, but what I’ve seen tends to talk about them as individual, one-off tools, not as any kind of integrated system. I see the potential usefulness of these tools, but pop-up boxes seem kind of random, maybe even distracting. I can easily write a prompt, a warning, or an error message, even add color to make it stand out, without having to add extra code to put into a GUI box.

I’m looking to integrate them into a cohesive, integrated workflow. For instance, I have a script that takes an ISO file and its associated checksum file, compares them, shows the progress, and reports the results. The script is completely text based. It would be nice if I could bring up a tool to select the input files, show the progress of the comparison, and display the results. I also have a script to select an ISO file and a USB drive to write it to using the dd command. I’d like to have a simple graphical tool to select the file and the device, write the file to the device, ideally while showing the progress of the operation, and showing success or failure. I’m sure it wouldn’t be very difficult.

Messing with backups

Lately, I’ve been exploring the tar command and tinkering with backups. I don’t know why I’ve never looked into it before. I’ve been using rsync to create snapshots of my home directory on my “production” machines. While technically, not a back up, these snapshots have been useful. I’ve also use rsync to copy certain directories to computers across my network. Over the years, I’ve also written scripts that use zip to create compressed archives of my script directory along with some other directories.

About a month ago I created a few scripts to make, daily, weekly, and monthly snapshots of my local repositories using tar. That’s been working well, and it prompted me to look into setting up incremental and differential backups using tar. I found some articles and YouTube videos on the subject to get familiar with the concepts. It wasn’t until I started actually experimenting with it, that it began to gel, and I cobbled together a couple of rudimentary backup scripts. Soon I was able to flesh them out and write scripts for incremental and differential backups.

I created scripts to make incremental backups of my two main repository directories. One contains a local copy of my public repositories that I have on Github, and the other is my private repository that I store on a local server. As of this writing I’ve only done the initial full backup of the repositories, so it will take awhile to see how well it works. I’ll probably still have to deal with a few bugs. Within hours of doing the first backups, I found a couple of minor bugs which I fixed straight away. They didn’t affect anything operation, they were just minor cosmetic issues how the archive files were named.

I have the scripts setup to append the archive name with a six-digit date (yymmdd) followed by the numerical day of week (0-6). A full backup is done on Sunday (day 0) and incrementals are done the next six days. On Sunday the metadata file is renamed using the date for the previous Sunday and a new metadata file is created for the next week. It will be at least a couple of weeks before I know it’s working as expected, but I’m confident I’ve got it right.

If this works out I’m thinking about implementing incremental backups for other important directories and backing up to external drives. Delving into using tar with incremental and differential backups has kind of opened up some new possibilities.

Update on my GitHub Repos

After GitHub changed to using SSH to push commits to repositories a couple of years ago, I tried to get that all set up and, for the life of me, I couldn’t get it to work. I was apparently missing something, so I gave up on it. About a year ago, I set up a local Gitea server on my home network and that’s been working well for me. The biggest disadvantage of that was there was no access to from outside my network. Everything on my Gitea server is primarily for my own use, but I do have some scripts and projects I might want to share. In the meantime, everything I had on GitHub was sitting stagnant and well out of date.

A few days ago, I decided to take another look at my GitHub presense. I successfully set up my SSH public key on GitHub, and after searching online, I found a couple of git commands that got my old repositories talking to GitHub again via SSH. Then I set forth to update the repositories. I archived the homebankarchive and yt-dl-utilities repos since they’re probably not very useful. I’ll probably remove them complete soon. The FnLoC and FnLoC-Win repositories are still current despite not having done any work on them in a few years. There are some features and improvements I’d like to make, but I don’t know how to implement them. My knowledge of C programming has diminished over the years.

Then I began updating the bashscripts repository by importing up-to-date versions of the scripts from my Gitea repo and pushing them up to GitHub. I also removed some scripts that were of dubious interest. In the last few days I’ve been going through my scripts n the Gitea server, and exporting some of them that others might find useful. I’ve been adding new scripts to the repo a couple at a time and updating them as needed.

For those who are interested, here’s my GitHub.

My Scripts for ISOs

I’ve never really been into distro-hopping, but I do occasionally put different distros in VMs or actual hardware. I currently run Debian, Linux Mint, Linux Mint Debian Edition, MX Linux, and BunsenLabs on different machines. I keep current ISO files for these distributions as well as a few others that look interest me.

I haven’t always checked the ISO files I download against the checksum files. It seemed like a hassle to do it, but I always confirm that the files I download are genuine.

When I need to install a distro on a laptop or desktop, I generally need write the ISO to a USB stick. Some distros, like Mint, have a utility for that, but I’ve found that it’s not always reliable. I’ve copied ISO files to a USB drive with Ventoy installed, but my experience with Ventoy has been rather disappointing. Sometimes it works, and sometimes it doesn’t.

The most consistent method I’ve found, particularly for Debian and Debian-based distributions, has been using dd to write the ISO to a USB drive. As everyone knows, dd is potentially dangerous.

To deal with these problems, I’ve written a couple of scripts to verify and reduce the risks. They aren’t fullproof, but they’ve worked well for me.

My check-iso script displays the ISO and checksum files in a directory and prompts me to enter the appropriate files. I can either type them in, but I usually highlight the file with my mouse and use the center-click to copy it to the prompt. I don’t know if that works in all terminals, but it works in Kitty and Terminator. The script then compares the two checksums and tells me whether they match.

When I download an ISO file from a distro’s website, I get the checksum and put it in a file whose name identifies the distro and the type of checksum, for example, distro-iso.sha256. If the site’s checksum file contains checksums for multiple versions, I’ll break that file down into individual files for each because my script reads the first field on the first line.

The write-iso script lists the available ISO files and a prompt. Then it checks to see if a USB drive is attached and mounted, and lists the available removal media with its capacity. The user enters the appropriate device at the prompt and is prompted to confirm the choice which must be explicity answered with yes or no.

When it comes to scripts, like a poem, they’re never finished. Most of the time, they’re abandoned when they’ve outlived their usefulness or I find something else that does the job better.

config-bak

A little over 4 years ago, I wrote a script to backup my configuration files in case I made a change to them that didn’t work out or accidentally deleted them. My first rendition of the script was quite linear and consisted individual blocks of code for each file I was backing up and it grew to be quite large. But it worked, and I used it in that for for a couple of years. Later on, I put each of those individual routines into functions. It was still quite linear. Recently, I reviewed the script and noticed that most of these functions were identical, the only variations were the configuration files themselves.

After taking a close look at the code, I determined that, with only a few exceptions, most of the files to be backed up were either in the root of my home directory or under the .config directory. I created functions to back up files for each case. There were still some exceptions, such as configuratins that might have different names or locations, depending ont the version, desktop environment, or operating system. I wrote functions for those special cases. Now the script would call a more generic function and pass the path and file name to it, or one of the specific functions for the special cases.

Then I started seeing similarities in the special cases and figured that in most of them, I could use the generic functions using the partiuluar parameters for each case. That left only a small handful of files that didn’t fit either generic case. I have a program whose configuration file is in a hidden folder in the root of the home directory and another file that’s a couple levels down in my .local directory. For these special cases, I created another function that places the backup file directly in the backup folder without any directory name.

Finally, there was my dump of my Cinnamon keybindings which I keep in my .config folder. It’s not a configuration file, per se, but it’s important enough to keep a backup. It’s really the only “special case” file I currently have, so it has it own function to handle it. For the most part, it operates much the same as the other functions, but if the system is running the Cinnamon desktop enviroment, and keybinding dump doesn’t exist in the .config folder, it will create the dump file and copy it to the backup folder.

Over time, I’ve improved the appearance of the script’s output. As the script backs up the new or changed files, it displays the pertinent path and the filename, precede by an ASCII arrow (===>). It looks nice and it lets me know what’s been backed up.

Of course, there is a companion script to restore the configuration files from the local backup. Now that I’ve stremlined the backup script, I’m wondering if I can make the restoration script more modular, eliminating many of the individual functions. A precursory look at the restoration script seems to indicate that I can model it after the backup script. That’s a project for the near future.