• Linux
  • May 2024
    M T W T F S S
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  
  • Meta

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.

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.

Coming Upgrades

Debian 12 Bookworm has been out for about a month , but I haven’t installed it on anything yet. I haven’t even upgraded any of my Bullseye systems. I found a YouTube video by Drew Grif on the JustAGuy Linux channel that was very helpful. In his video, Drew install five different window managers, i3 among them. I’ve been looking at his script and trying to figure what what files go with each window manager and if I can separate which ones I need for i3. He’s also using Polybar as his status bar which I’m familar with. Maybe I should use his installation scripts and install all of them on a system. Maybe I’ll find that I like one of the others better.

I have been adding and deleting files from his installation script to fit my needs. Today I created new repositories on my Gitea server, cloned them to my main computer, and copied the files to them. Now I’ll be able to modify the scripts and configuration files, and track the changes using git. Having a “fork” of Drew’s repository on my Gitea server will enable me to clone the repositories to a new installation.

I’ve been seeing a lot of of good reviews of Debian 12, and I’m looking forward to upgrading from Bullseye, particularly with window managers. I’m also looking forward to LMDE 6 when it comes out. Now that Linux Mint has released Mint 21.2, LMDE 6 will hopefully be out in a few months.

I’ll probably be upgrading my Mint systems before too long once the inplace upgrade procudures are in place. From what I’ve seen, most of the new features are cosmetic or things I don’t really use. There really hasn’t been much in Mint 21 that wows me. The HP ProBooks that I’d been running Mint 20.x on without much problem haven’t been performing nearly as well with 21.x. They’re running noticeable slower. One of those laptops is a “production” machine that I use daily. To help it out, I installed an SSD and that has helped. I also had an HP USDT that’s a dedicated media system and Mint 21 slowed it down considerably. I ended up installing Debian 11 with i3 on that.

I realize that most of my computers are older, acquired during refresh projects. It’s been five years since I worked on one those projects. Most of the machine have third or fourth generation i5 processors, I can’t expect great performance out of them. Maybe it’s time to start acquiring newer old hardware.

This is a bit off the subject, but the HP ProBook that I use a lot seemed to be running a little warm, so I opened it up to take a look. It’s a bit old, so I figured it might be time to put some fresh thermal paste on the CPU. I pulled out the fan and the heatsink, cleaned everything up, applied new paste, and put it all back together. It’s now running several degrees cooler now, still a bit warm but I think this model tends to run warm . It was nice that I didn’t need to completely disassemble it like the service manual wanted me to.

Links for Drew Grif’s

Joe’s Backup Script

A few years ago, I found a backup script by Joe Collins at EzeeLinux that has served me quite well. Over the years, I’ve made many modifications and added a few features to it, but it’s still basically Joe’s script, and I give him full credit for his work. His backup and restore functions have only gotten minor changes to fit my computing environment.

A couple of days ago, I took a closer look at Joe’s function to check the backup drive to see if it was ready for backups. I saw that it had several routines in it that could be functions in their own right, and at least one routine was something I had added. I ended up rewriting the function so that it called four other functions.

One of his drive-test routines checked to see if the mount-point directory existed, surmising that if it did, the backup driive was mounted. I can see that this work with a desktop environment where the system would detect the drive, create the mount-point, mount the drive, and open the file manager. And this is what happens with my systems that use a desktop environment. I have several systems that use a window manager on a minimal installation of Debian. These systems do not automatically detect and mount a USB drive when it’s plugged in. On these systems, I would have to do one of three things — open a file manager and click on the drive, manually mount the drive from the command line, or use a script.

I recently found a way to extract the correct device name for the backup drive using the lsblk command, assuming that the drive is properly labeled to work with Joe’s BU script. Using that, I was able to automate the mounting process without have to look a the lsblk output, finding the right device name, and entering it with the read command. That got me to thinking that this could easily be applied to the BU script.

My new drive_test function makes function calls to run the checks on the drive, and displays error messages and exits only if the prescribed conditions aren’t met. First, the check_usb function checks to see if a USB drive has been plugged in. Then, bu_drive_label checks the partition label of the drive. If the label is correct, mount_bu determines if the drive is mounted. If the drive is not mounted, as in the case of my minimal Debian systems, the function extracts the proper device name, creates the mount-point (if necessary) , and mounts the drive. Once the drive is mounted, an addition check (bu_drive_fs) is run to determine if the drive is formatted with the correct file system.

In the original script, the backup and restore functions ran the sync command to synchronize cached data to ensure all backed up data is saved to the drive. This process can take a while, so I incorporated a function to print dots until the command completes. Then, since it’s used in the two functions, I made a function for it. Other than that change, and a few minor adjustments for my own need, those functions are pretty much as Joe wrote them.

Joe’s original script used several if-statements to check command line arguments. Early on, I combined them into an if-elif-else structure which serves the same purpose, but, satisfies my coding discipline.

As I said, I’ve been using Joe’s script since he made it available, and with a few tweaks and modifications, it has served me well. I use it on a nearly daily basis. Thanks Joe, for the scripts and Linux videos you’ve made available. I’ve learned from you and been inspired.

Mint Upgrades

My current project is upgrading my Linux Mint 20.3 systems to Linux Mint 21.1. So far, I have two of the laptops done, and they went quite well. The Mint team has done a great job with their mintupgrade utility for upgrading from one LTS version to the next. It worked well with my LMDE upgrades and it’s working well with Linux Mint.

Since I didn’t upgrade until after the Mint 21.1 release came out, the process had to be done in two phases. First, I had to upgrade to Mint 21 (Vanessa) with the mintupgrade tool and do a little cleanup. Then I used the upgrade feature in Update Manager to upgrade to 21.1 (Vera). With those upgrades completed, I reinstalled the applications I manage through GitHub. Naturally, I ended up modifying some of my installatinon scripts to work with Jammy and Mint 21.

The apt-key functionality has been deprecated for a while and I’ve noticed that Jammy/Mint 21 complains about it more. I’ve read a number of articles on how to manage the keys, but I haven’t been able to get a good understanding of it. Some packages I use have updated their installation instructions to do it correctly, but many still haven’t. There were a handful of PPA I use and I’ve seen nothing on their respective pages to circomvent the apt-key problem, nor do they have a link to download their .asc or .gpg key. As I upgrade to Vera, I’m forgoing the use of PPAs. In a couple of cases, I’ve found Flatpak versions of the applications that seem to work.

I’ve got three more machines to upgrade, two desktops and a laptop, and I don’t foresee any problems with any of them. I’m glad that I can use this method. I haven’t had to redo any of my static addresses or SSH configurations. Everything is pretty much working as before. I’ve rarely experienced such painless and seamless upgrades. Of course, now that I’ve said that, I’ve probably jinxed myself.

Win 10 Upgrade

When I did the Windows 10 downgrade a while back, I installed Windows 7 on a different PC and kept the Windows 10 PC around just in case I needed some files or something. Tonight I decided that enough time had passed and that I wasn’t likely to need anything from that PC. It was time to upgrade my Windows 10 PC to Linux. I installed Mint 17.3 on it and started getting it set up the way I want it.

I downloaded my script from the web site to my home directory and all I had to do with it was to rename from conkyrc.txt to .conkyrc. Thanks to the if existing statements in the script, I didn’t have to edit out the WLAN information.

I also installed the chromium browser, Dropbox and curl. I recently read a couple of articles on transfer.sh, a service to upload files temporarily for later retrieval. It uses curl for upload and download from the terminal. I can see where that could be useful. I also installed my printers. Later on I’ll likely be installing some network utilities to troubleshoot network problems. This particularly PC will be replacing the Optiplex 755 in my network area. The 755 will be recycled or donated along with most of my other excess computers (the ones older than the ones I’m now using).

Projects in Various States of Abandonment

I always seem to have little network and computer projects that I’m working on or in planning. I think it’s probably more accurate for me to say that I have a lot of projects in various states of abandonment. Once in a great while, one or two actually get completed.

I haven’t weaned the rest of the family off of Windows yet and I still have a small need for the Microsoft OS myself. I finally retired the HP mid-tower that was running XP. I replaced with with a newer Dell small form factor desktop running Windows 7. I’ll probably upgrade it to Windows 10. I also set up a Dell laptop with Windows 7 for the grandkids as well.

My most recent little project was to clean up my “server” corner. I took some systems that weren’t being used and wiped their drives. I’m planning to donate most of them. I know of a couple of places I can take them.

However, I won’t be getting rid of all of them. There are a few I’ll be keeping around. One is my old Linux tower, the last PC I built from parts. It seems like I bought that QNAS device ages ago but I still don’t have it configured with users and passwords. I’m not even sure about getting it to work with my Linux systems. It has occurred to me that I could put three large drives into my tower along with a boot drive and use it as a NAS.

I’ve also looked into turning an older Dell desktop into a Linux-based Wireless Access Point. Presently I’m using my old Linksys WRT54G as an access point after turning off the wireless on the U-Verse gateway because it kept dropping out.. On thing that it would do, and I’m not sure if it’s advantage or not, is put the WiFi on a different network from the wired network. The PC WAP would act as a gateway between them, dish out IP addresses to wireless devices, and act as a firewall. Once working, I could reconfigure the Linksys device to extend the wireless network to the other end of the house. It’s an idea that’s beein lying dormant for a while.

When my job went away, I picked up a Lenovo M91p SFF desktop for $125. It has an I-7 processor and I brought it up to 8GB of RAM. I’ve got Windows 7 loaded on it but I still need to install the wife’s applications and move her data to it. I’ll probably upgrade it to Windows 10 eventually,

That leaves me with a few others that I’m holding onto – the Gateway laptop, a Lenovo A57 mid-tower, and the HP mid-tower. If I re-purpose them, it will probably as Linux boxes. Once I deploy the M91 to replace the wife’s Dell, I’m not sure what I’ll do with that. Maybe I’ll put in a bigger hard drive, up the memory and replace the Ultra-Small Form Factor 780 I’m using now.

As I said, several projects in various states of abandonment.

Mint on Gateway

Over the weekend, I had planned to copy some files off the Windows partition on my Gateway E-475M but found that it would no longer boot into the Linux partition either. I pulled the drive and copied the data to my Windows 7 PC using a USB adapter. Then, after putting the drive back into the laptop I installed Mint 15 Cinnamon and began getting it set up for use in my yoga room where it will be primarily used to play music, led meditations, YouTube videos and instructional DVDs.

Computer issues

I’ve been running into numerous computer issues at home lately. It started when my son fired up his laptop for the first time in over a year and couldn’t connect to my wireless network. It turns out that he was still on XP Service Pack 2 which didn’t support WPA2. (I had switched from WEP to WPA2 over a year ago when I purchased the X2000 router. I installed SP3 and got him connected. Then after running a gazillion MS updates, he had virtually no free disk space and was only running on 512MB of RAM. I found 2GB of memory for him and a a larger hard drive. I attempted to clone the drive but for whatever reason my cloning attempts failed. I reloaded Windows from scratch. It still ran like crap and I attributed the slowness to his outdated Celeron processor. I had a reasonably nice Dell laptop so I put a 250GB drive into it, loaded Windows and got it configured for him. It’ll be a Christmas present for him, definitely an improvement over what he has.

While working on my son’s laptop, the Windows on my dual-boot Gateway laptop went tango-uniform. I can’t boot into Windows at all but the Linux partition is still good. I really don’t want to reinstall Windows on it because I’d have to reinstall Linux as well. I recall that I had to slipstream drivers to install Windows. I probably still have the CD I made. I haven’t decided what to do with it. I definitely need to pull some data files from the Windows partition so I can install my genealogy program on my Windows PC. Other than that, I’ll probably set it aside for a while. I might just put Linux on it and donate it to a good cause.

Last weekend, one of the grandchildren told me that their computer was shutting down unexpectedly. I had recently upgraded my wife to a better computer so I wiped her old one and set it up for them. The first time they used it was yesterday evening and it crashed with the dreaded “NTLDR missing or corrupt” error. I tested the hard drive and it seems to be healthy. I’m tempted to install Mint on it.

I took a look at the PC that had allegedly been shutting down. I inspected the motherboard and found no questionable capacitors or anything else amiss. I tested the hard drive and the memory and found them both to be in good working order. It didn’t shut down during testing so I turned my attention to the operating system. I ran a virus scan with Avast and another with Malwarebytes and found incredible amounts of malware, mostly browser toolbars and search enhancers. I cleaned it up and it’s running much better. Not having a desk for it, I installed a Cisco wireless card and set it up as a “mobile” PC. I installed the PC in a small TV cart with wheels, added a monitor and a wireless keyboard and mouse.

I’ve been running Linux Mint (Cinnamon) on a Dell E5500 for nearly two months and I’m quite happy with it. I had found a great deal on a Logitech wireless mouse and used that with it for a while, before finally getting myself a Logitech wireless trackball. The trackball is a bit bigger than the mouse but I generally prefer trackballs anyway.

With the end of Microsoft support for Windows XP coming up in a few months, I am definitely looking to decrease my reliance on Windows and expand the use of Linux in my household. For those tasks that are currently bound to Windows applications, I’m looking for Linux alternatives.

To make my administrative life a little easier, I took my AD login batch file, modified it a bit and put it in the All Users Startup Menu so that the shares on the NAS are automatically mapped, to include the appropriate home folder.