Monday, December 28, 2020

How to Use a Bash Script File

 A Bash script file is simply a file containing a list of commands as one might enter from a terminal command prompt, with the addition of some more programming options like If . . . then, for, and while statements. It can be made to do most any function on a Linux, Apple, or other Unix based operating systems. They can greatly simplify and automate certain tasks.

For example, on a Debian based system, to preform an upgrade from the terminal requires entering at least two lines of text-based commands into a terminal. First, one must do an update to update the repositories to ensure one has all the most recent changes to them. Then you accomplish the upgrade, so the terminal commands would look like this:

sudo apt update
sudo apt upgrade

To create a bash file, you open your favorite text editor and give it an appropriate name, like in this case we might name this file "aptup.sh"

Note, the "sh" extension is commonly used for bash script files, but unlike MSWindows, that doesn't make it executable for Linux. You could put any extension on there you want, or none at all.

Now, enter the following to create the bash file:

#!/bin/bash

# This is a script file to make updates simpler!

sudo apt-get update
sudo -y apt-get upgrade

exit

The first line is the same for every bash file. It essentially tells the system what program and where it is at that will run this file.

The second line is optional. It is a comment. Every line that begins with a # will be ignored by the bash program, except the very first line, of course. But it is a good practice to put a general purpose statement at the beginning of your file, if for no other reason, if you forget what this file does, it serves as a good reminder for you, and provides any introductory information for others who might look at your source code. You can put as many or as few comments in a file as you want, put them anywhere you desire, or none at all. As long as a line has a # before it, it will not be run by the system. As a matter of fact, putting a # before lines of code is a good way to not have them run without deleting them entirely.

On the update and upgrade commands, you'll notice two changes I've made from the initial "apt" commands above. First, I've used "apt-get" instead of "apt". Apt is designed to be run interactively by the user, where as apt-get has provisions for running inside a script.

The second change is adding in the -y option. This option allows the script to become more automated by assuming a "yes" answer to any yes/no questions it asks. Typically, an upgrade script will list out the files it intends to upgrade, then ask you if you want to proceed with the upgrade.

The last line is optional at the end of the file, but it is good practice to put it in. It tells the bash script to stop processing and exit the file. It becomes more necessary if you want to stop processing earlier in the script, like during an if . . . then statement.

Once you have saved the file, there are a couple more steps to turn this into an executable file.

One, you should put this file into a directory that is in your path statement. To discover what is in your PATH statement, enter the following into a terminal window:

echo $PATH

Yes, it needs to be in all caps. Variables in Linux are case-sensitive.

What this does is it allows you to run the program no matter where you are in your directory structure. Otherwise, you would have to enter the full path every time you ran the script: /usr/bin/aptup.sh instead of just aptup.sh

The logical place to place this file is in your /usr/bin directory. That will make it available to all users of the computer and is where the bulk of user based programs reside. Or you can put it in a home directory and add that directory to your PATH environment variable by doing the following steps:

I usually create a bin directory in my home folder. You can do this using your file manager, but I'll show you here how to accomplish it from the command line. This is where I put all my scripts.

Bonus Info: In Solus, you don't have to add the user home directory bin to the path statement. If you create the directory, it automatically picks it up and adds it for you!

To create the bin directory ensure you are in your home directory by entering:

cd ~

Then enter (unless you already have one):

mkdir ./bin

Then to enter it into you path variable, enter:

export PATH=$PATH:$HOME/bin

If you run it from a terminal, it will only be good for the life of that terminal session. To have it come up every time a new terminal session is started, enter that command in your .bashrc or .profile file, whichever your system uses to initialize a terminal session. For Debian based systems, that will generally be .bashrc

Two, you'll want to make your file executable. Like the above, you don't have to do this, as long as you wish to preface every command with "bash" and the full path to where the file is, even if it is in a path where your system looks for executable program files. It is an easy command to do. Enter:

chmod +x ~/bin/aptup.sh

To accomplish the same in most file managers. right-click on the file and select "properties" from the menu. Go to the "permissions" tab and make sure to check off the box "make file executable" or something similar.

Now you should be ready to use your script file by simply typing in the name: aptup.sh! And your system will get updated by one command instead of two.

Wednesday, December 23, 2020

How to Install Parrot OS

 I have installed Parrot OS, but despite the Calamaris installer, it ended up not being a simple event. I attempted to install the MATE security edition on a virtual Gnome Box machine. The installation went fine until when it was about 93% of the way done, it stopped and sat on the following command: /usr/sbin/sources-media -u. It sat on it until the 600 seconds was up. I tried installing it with different settings, and still it would hand up at that spot, only to force me to close the installation and failed to install the operating system.

While on the Live installation of the system, I decided to take a look at the file. I discovered that it was a script file, and that the -u switch caused it to go into an update. The switch activates the following commands:

if [ "$1" = "-u" ]; then
    umount $CHROOT/$MEDIUM_PATH
    rm $CHROOT/etc/apt/sources.list.d/debian-live-media.list || true
    chroot $CHROOT apt-get update
    exit 0
fi

The fourth line updates the new system, which can be done equally well either before or after you install the system. However, the reason it was hanging is because as of today, it required almost 1700 updates, which alone would go beyond the 600 seconds it allows it to finish. However, it also ask several questions and requires user interaction to finish. Which means that was why it was hanging up. With no movement as it sat there and waited for my input in vain since the system didn't provide a way for me to do that, naturally it would time out. And since there wasn't any provision made for that in the install process, it ends the installation with only 7% more to go. Also, due to the big amounts of updates, you can't update it before you start the install because there isn't enough room on the "USB", virtual though it may be, to do it.

So with the only option left to update after the install, I had to disable the update in order to finish the installation. So I commented out the update command line in the file by putting a "#" at the beginning of that line so that it now showed:

#    chroot $CHROOT apt-get update

That allowed it to bypass the update and finish the install. Then I was able to do the giant update manually. Here are the commands to do this.

To edit the file, use your favorite text editor to comment out the line as described above. My favorite is nano from the command line BEFORE you start the install process from the live boot up.

sudo nano /usr/sbin/sources-media

Once you boot up into your new system, you can start the upgrade process using the following commands from the terminal, which I recommend you use instead of the GUI interface to update this many files.

sudo apt update
sudo apt upgrade

Then check on it every once in a while because it will wait for your interaction at points. (Note: when you get to the section right after it downloads all the files and displays the change log to you with a ":" waiting for your input, you can just press enter until it tells you you can press "q" to exit it.)

Then enter the following command to remove unneeded files:

sudo apt autoremove

Once you've upgraded all the files, you're good to go!

Saturday, November 14, 2020

How to Fix Non-free Software Error in Debian

 As I mentioned last time, there is some tweaking to do when Debian is installed. Recently, I discovered another needed tweak one needs to do, especially if you need "Non-free" software for some firmware, in my case for my wifi on my HP Laptop. Previously, I tried to install Debian on my HP Laptop, but encountered this error message, which meant I wouldn't be able to use my system. That's when I decided to install Linux Mint Debian Edition on my laptop instead, because I knew it would work.

But it confused me somewhat, because to me, "Non-free" means I need to shell out some money to buy software for, something. Unfortunately, the version of Debian I downloaded (a Cinnamon enabled package), failed to tell me exactly what needed the "non-free" software, and it was the middle of the night and I needed to finish up so I could get some sleep. But, I needed a working system the next day, which is why I installed Linux Mint, because I was sure it would work out of the box.

But, on my Acer Asprire laptop, I was able to install Debian just fine, using the net installer version, which hooks you up to the internet to download most of the packages. So I assumed it was the version of Debian I tried to install, and I tried to install Debian again using the net installer. Yet, again, it encountered this error when I tried to install it, but unlike the previous time, it told me what firmware I needed. So, with that error on my HP Laptop, I opened my Aspire laptop and did some research on this error. Here is what I found out.

I discovered that "non-free" doesn't mean that you have to buy anything--rather it means that the firmware is proprietary software. I read that Debian doesn't enable this "feature" out of the box due to concerns about "non-free" software on their distribution. I found out that to solve this issue, you simply need to edit your repository list file, and add some additional text to the end of each line in the file. Here is the procedure to fix this problem.

First, you need to use a text editor to edit the source.list file. You can use your favorite editor, or use the following command line in a terminal (ensure the user has sudo privileges):

sudo nano /etc/apt/sources.list

Then on the end of each line that begins with "deb", tack on the following words after the "main" keyword:

contrib non-free

For example, one line commonly found in this list would be

deb http://deb.debian.org/debian buster main

When you've edited it, it should look like:

deb http://deb.debian.org/debian buster main contrib non-free

Once you've done that to every line in the file that starts with "deb", save the file edits under the same name, then enter first:

sudo apt update

then us sudo apt install to install your firmware. In my case, it indicated that I needed the:

sudo apt install firmware-iwlwifi

package.  So, with that information, I went ahead with the install, hooking my HP laptop to an Ethernet connection for its internet access, which worked fine. Once I installed Debian, I was able to follow the above steps to install the "non-free" software, then I was able to set up my wifi without further incident and disconnect the Ethernet cable. I'm typing on my Debian system right now, even!

Thanks for reading.

PS: You can reedit the file and take those words off the end if you do fear downloading other proprietary software in the future.

Monday, November 9, 2020

How to Enable Adduser on Debian

 I prefer to use adduser over useradd when possible. It simply is more logical to my mind. One time when I installed Debian, though I knew it was a Debian based program, when I typed in:

sudo adduser

All I saw in return is the "Program not found" or something similar. I discovered after checking on it using:

which adduser

. . . that it resided in the /usr/sbin directory. After doing a check on the $PATH environment variable using:

sudo env

My suspicions were confirmed--that /usr/sbin was not in the $PATH variable. Why doesn't Debian put it there by default? Hard to say. It appears that they do have the /sbin directory in the path, which should point to /usr/sbin since it is a symbolic link At any rate, not knowing at the time how Linux processed the $PATH and where I should put it, I proceeded to do some research. In DOS, everything used to go into the Autoexec.bat file, which always was run on startup. 

To make a long story shorter, what I discovered was that one: There was one difference between how the DOS and Linux path statements were used. For Linux, the big difference is you put "export" before the PATH= part. So the statement to add to the appropriate file is:

export PATH=$PATH:/usr/sbin

All caps on the PATH part is important, and the colon separates each entry. Putting $PATH on the right side of the =, appends what you add to it. So if the PATH statement echos out "/usr/bin" the resulting output from the above export statement would be "/usr/bin:/usr/sbin". The "export" command makes it usable beyond this one instance which is what you want.

Two: Where to put it? That turned out to be more complicated that one might think. There were multiple files to try. There is a file to put it in if you want only one user to use it, another for all users on the system except for root, and yet another if you only want root to have access to it. On top of that, the file you put it in can differ between major distributions. Like the Mandrake version I saw given as an example that one website used ".bash_profile" whereas in Debian, it is ".bashrc".

Since I figured where as the user programs are mostly installed in the /usr/bin directory, which was included in the PATH by default, that the /usr/sbin directory contained programs that would be more system type files that should primarily be accessed by a root user. So obviously, it would go in the root's home directory, which is at /root as it turns out. So, you would want to enter the following to edit that file in the root home directory:

sudo nano /root/.bashrc

Then add the line at the end of the file:

export PATH=$PATH:/usr/sbin

When I did that, it worked when I attempted to access the program from root using sudo, but not as just a simple user.

(Note: the period it begins with means it is a hidden system file. Use Ctrl-H in your file manager to see it or "ls -a" if using the command line.)

You can use

sudo env

To verify that /usr/sbin is now part of the $PATH variable. Now you should be able to run

adduser --help

As well as any other programs in the /usr/sbin directory!

May the Linux force be with you!


Monday, October 19, 2020

How to Fix LibreOffice Not Activating the Alt-[key] Menu Function

 A recent update (I assume) in Libre Office (I'm currently using version 6.1) broke my Alt-Key menu function. I would press on the Alt key, and the lines would appear under the letters of the menu items indicating what letter to push to activate that menu list, only when I hit the key, nothing happened. I tried other Alt functions on the system, which worked fine, like Alt-Tab cycling through the open windows. But no Alt-menu key functionality at all.

So I did some initial research and I pretty much came up with links of old Ubuntu related issues back in the 2011-16 years that didn't seem to apply to me since I use Linux Mint Debian Edition. But one comment at least set me on the right path, as it mentioned something about opening your keyboard layout function and changing something there. I use the Cinnamon desktop, being it is my favorite and the only one that comes with the Debian edition out of the box.

So I opened my system settings and went to my keyboard. After poking around in the Shortcut section to make sure nothing had changed there that may have overwritten the Alt function for menu keys, I went to layout. That appeared in order, but then I noticed an option button on the bottom right corner of the window. I clicked it, and low and behold, I noticed a selection there labeled "Alt/Win key behavior"!

While not getting my hopes up too high, I clicked on it and discovered a whole list of options. "Default" was selected, which seemed normal enough. But if the default action had changed on a recent update...

One of the options was labeled "Add the standard behavior to Menu key." I decided to give it a try. When I went back to LibreOffice Writer, the Alt-Menu key function worked! Strange that they wouldn't make that the default behavior when it has been in use for so long. Anyway, I was glad I found the setting to switch it back, as I use the Alt-F-U function all the time. Hopefully this will be helpful to others having the same problem.


UPDATE: (11/3/2020)

Well, my problem returned. I checked the setting I had above and it hadn't changed. So I started searching for other solutions.

One of the things I noticed is that when I opened up LO writer, that there was no blinking cursor active in the new document that it brought up. If I clicked in the document with the mouse and the cursor was there, then the Alt-key functions would work. So the first thing I checked was the LO settings, in "Tools" and "Options" on the menu. After going through those settings, I could find nothing that would tell LO where to "start" upon opening a new document.

Then I suspected it could have something to do with the Default template that was installed. So I opened that template:

  1. By going to "File," in the menu.
  2. Then "Templates"
  3. Then "Manage Templates."
  4. Select the Default template and open it in the window that pops open.
  5. Then I set it up with the settings in the Styles settings how I like it to open.
  6. Once that was done and I made sure the cursor was at the beginning of the document, I used the mouse to once again click on "Files"
  7. "Templates"
  8. And "Save as Template..." 
  9. In the window that pops up, give it a name (doesn't matter what it is, but it sounds logical to me to name it "MyDefault")
  10. Then make sure you click the box in the bottom left corner of the window labeled "Save as default template."
  11. Select an appropriate category to save the template under and click "Save."

Now when you open Writer, it will open your default template you just created, with the cursor at the beginning of the document, and all the Alt-key functions will be at your command!

Apparently, this is something that will need to be done on all fresh installs of LibreOffice Writer if the Alt keys cannot be accessed right out of the box. Which I would need to do anyway due to how I like it to open with different fonts and layout settings.



Sunday, May 24, 2020

My Linux Journey

It started out innocent enough. Back around 2003 or 04, I ended up with an old laptop that I had no use for. I’d been interested in Linux, so I decided to obtain the installation files for Debian and install it on this laptop. This all happened prior to getting a cable modem; it would have probably taken a week to download them using my modem. So I paid to obtain the disks for the cost of the CDs and shipping. They arrived one day, and I attempted an install. After some time, I finished the install, and I was staring at a command line. The little cursor blinked at me, or was that a sarcastic wink?

It’s not that I was unfamiliar with working from a command line. I learned my chops first on a DCL machine (that’s Digital Command Language) back in the 80s, and after that, on MSDos. I reluctantly bought in 1994, a laptop with Windows 3.11; I was so reluctant to give up my command line, familiar as I was with typing a program’s name into the terminal to run it. Of course, I grew to love Windows, in a love/hate sort of way, and became an “expert” in that interface even as I had in MSDos.

But this wasn’t MSDos. Only one or two of the commands I recalled from my MSDos days appeared to work in this alien world. So I started the process of figuring how to access the help pages and began the task of learning a new system. However, I didn’t get very far. I tried to install X-windows, a graphical “windows manager” (which I now know is not the same thing as a complete desktop environment). All I ever did back then was to see a big “X” across the screen. No menu, no buttons, nothing. Then, as fate would have it, I did something that trapped me in the X-window. I couldn’t use the command line nor do anything. Even reboots would log me back onto the giant X window. I finally gave up.

Ironically, these last two days I’ve been testing out installing the “Vanilla” Debian first in VirtualBox, then on my living room backup laptop, which I had before I received my current one—about a month before we moved to Colorado in 2018. I’ve successfully installed it, though it has a long install process compared to your average Linux distro.

It ended up crashing it in Virtualbox. But not before I learned enough that I was ready to install it onto my living room laptop. So I did, and it is now up and running. It has progressed a lot since the early 2000s. For instance, when a newbie like myself starts tinkering with attempting to pull together a desktop environment, not knowing that was what I needed, I was lost, alone, and clueless about what direction I needed to go. But, the Debian I installed lately had several desktop environments that I could use. So, I picked my favorite so far—Cinnamon--and when it was finally done, I booted up into a fully functional graphical interface that I was already familiar with along with a system that I only had to make about two or three tweaks to obtain a fully functional system.

“Tweaks to obtain a fully functional system? What?”

Yep, you heard right. And my experience probably only will go to show why installing a system like Debian is a bigger task than Linux Mint, especially for someone who is unfamiliar with how Linux works. I, on the other hand, have been using Linux by this point for 9 years. I realized it had been that long when Facebook offered up one of those “Remember When” post for me to share with everyone (which I didn’t share; you can thank me later) that was 9 years old, and wanted me to share a post I had done on my experience of getting a fully functional Linux system up for the first time that had become my default operating system I used on a regular basis. I kept a dual boot into Windows to run QuickBooks, which doesn’t play very well, even using Wine. I’ll give you one example of what I had to do, right out of the box.

Once the install on Debian was done, I started to work on setting up the ssh server. Ssh is a way for a user using a computer, to log in and work on another computer. One can open it up to the Internet, but in my case, I only needed to go over the network. At any rate, one of the first task in setting up an ssh server is adding a user to the new system that will give me the ability to log in from the other computer. I like to use the adduser command. So, I typed in the command, followed by my user name and group. Well, Debian couldn’t appear to locate the command. I thought “What? How could the system be missing such a foundational command?” It didn’t make any sense. I tried useradd, with the same results.

So after a bit of exploring, I attempted to install the adduser command. It said it was already installed. “Ahhhh!” the problem appeared solved, to a degree. Because Linux has at least one similarity with Windows, the PATH variable. It does the same thing as it does in Windows as well, which is to tell the system where to look for executable programs that you want to run, no matter where you initiate them from in the directory structure. So I went to Google and did a search on what directory adduser would be found in (it was in the /usr/sbin directory). Then I printed out the PATH variable, and sure enough it wasn’t there. So, all I had to do was to include it in the PATH directory, and all would be right in the Debian world, right! Well, sort of, in that even that task became something of a problem.

You see, in Windows, there is one file that the path command goes in. The commands for it are very similar. In windows, it is:

PATH=%PATH%;C:\\directory to add to the path statement

Pre-XP, to make it permanent, one would add it to the “autoexec.bat” file, a file Windows would run every time the system booted up. XP and those that followed, it was added to the advanced system under “Environmental Variables” graphically. So, in Windows, for any one version, there was only one file or place you had to edit to add a directory to the PATH variable and have it stick from session to session.

Not so in Linux. First you have several spots you could add it to for the individual user (at least 3 files), or several spots (at least 4 files) for every user. Now, these are easy enough to find upon searching on the internet, as I did. However, whether it was due to it being entered in at the wrong time so that it was overwritten, or the system ignored each file that I put the path statement in, for whatever reason, None of them worked. I believe I tried every file I could find to put my path statement in, which was:

Export PATH=$Path:/usr/sbin

The export command is the part unique to Linux, but it shouldn’t always be used, as I soon discovered. One of the system-wide files I entered this command into was located in the file: /etc/profiles. Once I entered the command in and rebooted, it booted up as far as the login screen. I entered my password, and it went away, only to have the login reappear. So, figuring I must have entered the password in wrong, I entered it again only to have it do the same thing. I must have entered my password in 5-7 times, the last couple of times carefully entering in my password. It still came back. I had to come to one conclusion: that the file required the path statement without the export command. Why? I don’t know. That’s just the way it is.

Now, I could have just deleted the system off of Virtualbox. It was, after all, just a test. However, I wasn’t ready to give up on it, just yet. I had to figure out a way to get into the system, edit that file, and take the “export” part out. After doing a few searches on the internet, the only solution I had found was a cryptic editing of the kernel, by adding a -l on the end of it, that would allow me to bypass the login screen. However, when I reached the point of adding that to the kernel file, it didn’t quite look the same. I was unsure where to put the -l and I said to myself, “There has to be an easier way to do this. Editing the load kernel command was too deep and crazy way to do this.” And, behold! There was an easier, more user friendly way to accomplish this.

I sort of stumbled upon it, though it is probably common knowledge among experienced Linux users. Once the grub boot menu appeared, I selected the “Advanced” option of the operating system. Then I opted for the recovery/command line to go into root. I was in! I edited the “export” off the file, saved it, then rebooted. I went into the login screen and upon entering the password, I stood on the pathway to success! All was well, once again, in the Debian world.

Sort of, because when I checked the PATH variable, it still didn’t show the sbin directory under the usr directory. So I was back to square one. I checked the websites once again, and there was one file I had yet to try: bashrc in the HOME directory. However, the preferred way to add any changes to that file was to enter them in a different file, under a different directory, and include them in the bashrc file. I knew the system processed this file too, because I had already done this with some aliases I had set up. Aliases like twifi, which ran the command:

bash /home/rick/MyScripts/ToggleWiFi.sh

To turn on and off my wifi. All I would have to do in a terminal window to run that would be to enter twifi.

I started to edit the .bashrc file to have it include a different file, when it dawned upon me that the first system upgrade would replaced that file, then I would have to add those lines back in. Though it was sort of like cheating, I knew the .bash_aliases file would to included by default in any new file. So I edited that file to add to the path the desired directories. Once I had saved it, rebooted, and checked the path statement. I held my hands up in a victory shout as the desired directories were in the PATH variable, finally!

That is just one example of my “tweaks” I did to get a more fully functional system. I do have to say, that a major Linux distribution upon which Ubuntu (and several others that are based off of Ubuntu) as well as a smattering of others, who has been around for this long, could have such a simple-to-fix-bug in it. This is exactly the kind of experience that keeps Windows users from moving to Linux. But be assured, Windows user, that distributions such as Ubuntu and Linux Mint don’t have this problem. They generally work like you would expect them too. I’d point any Linux newbie to install one of those distros as your first one. But in Debian’s favor, it has come a long way toward being more user friendly than when I installed it almost 20 years ago.

But between my first attempt at installing Debian and the last successful attempt to install it on my backup laptop—an Acer Aspire—I’ve installed several different distributions on the old laptop. All of the distros, a small handful requiring some tweaking, have been successful installs. I’ve used them for various lengths of time. Most all of them picked up my Brother network printer without a hitch, which for my previous experience is very, very good. In the past, I’ve had to fiddle with the drivers and various settings before I could get it to work.

My first working Linux distro (short for distribution) was Lubuntu using the LXDE desktop environment. I used it on a test laptop that was “resource challenged” before being confident that I could install it on my main laptop. I worked on and off for over 4 or 5 months of setting it up just the way I liked it. This is when I made that Facebook post 9 years ago. I stuck with that OS (operating system) for quite some time before trying other distros. From there I installed Xubuntu (uses the Xfce desktop environment) on my main computer. Then a few months ago, back around Aug. 2018, I ordered a new computer, an HP Laptop with 2 T of HD space. It had Windows 10 installed on it. Up until then, I had a dual-boot system, MS Windows 8 and Xubuntu on my Aspire. With this computer, however, I decided to go totally Linux, something I could do since I no longer needed to use Quickbooks. More on that in a future post. And, I decided to go with a totally new distro, Linux Mint. I was impressed with Mint’s Cinnamon desktop, which I fell in love with. Mainly because of both the slick looking interface and the flexible and intuitive structure of the settings menus. In short, it simply works as a desktop environment.

I also need to back up a bit to describe my Linux HD transplant. My son had bought, some years ago, a new Asus laptop. After a period of use, his hard drive crashed and he was ready to throw it away. I told him to hold on, I would take it. I figured I would get a hard drive for it and I would have a new computer. But, I promptly forgot all about it. Then, a few years later I discovered Lubuntu, a version of Ubuntu that used the memory efficient LXDE desktop environment. While I was on it, I accidentally spilled some coffee on the keyboard, effectively causing the keyboard to be near usable. My immediate solution was to go and get a usb keyboard, and I continued using the computer that way.

Meanwhile, I came across my son’s old Asus laptop. It had been long enough that I forgot what was even wrong with it. An attempt to boot up failed, reminding me that it was the hard drive’s boot blocks on the disk that caused the issue. So I did a search on Amazon for hard drives, and discovered a 1 terabyte drive I could obtain for a reasonable price, so I bought it, and I installed Lubutu on it successfully. Once I had it up and running, I liked using it better than my old Acer computer. So after transferring my files over to the Asus laptop, it became my primary laptop that I used day in and day out. That is, until another cup of coffee, or it may have been sweet tea, was dumped over the keyboard, yet again. This time, it totally made the keyboard unusable as well as affecting the computer itself. I could use the external keyboard, but it became difficult to get around to the point that it was an unusable computer.

Problem was, I didn’t have enough money to buy a new computer. All I had was my Acer Aspire computer to fall back on. The problem with that was my current files and work was on the hard drive now trapped inside an unusable computer. What to do?

Then I had an idea, though I didn’t know if it was even possible at the time. So I did a search on the Internet to find out if it was possible to move a hard drive, and transplant it into a different laptop, and have it work. I expected to find a big negative to that question, but to my surprise I discovered that it was indeed possible. However, in my case, since I was moving from a “Legacy” computer to an EFI booting computer, that I would need to go in and adjust the partitions on the drive to make space to create an EFI partition. Naturally I found this out after I attempted to simply move the HD over to the new computer and it failed to boot. I was successful in reducing the size of the main partition, and creating an EFI partition, and installing the boot software to it, that when I plugged it in the next time, I saw my old system’s login, and after a little checking, I could access all my files. I hadn’t lost one of them. I breathed a big sigh of relief.

For the record, just know that this is something that cannot be done if I still had a Windows system. They link their OS to the computer it comes with. You take that HD out and stick in another computer, you’ll have two broken systems. I was a wee bit proud that I had successfully navigated the “Linux rapids” and had pulled off such a major operation that when I turned on the computer and it began booting up into my familiar system, I said, “It lives! It LIVES!!! Haaaaaa, ha, ha, ha, ha!”

Of course, I was back to using my old computer which required me to use an external keyboard. But hey, at least I was operational again, except this time with a full terabyte HD. So I used it until I had the money for a new computer which happened in the summer of 2018. By that time, I had installed Xubuntu on my old Acer Aspire and had been using it for a few months. So when I bought this HP laptop, that I am currently using, I decided I would move the pre-installed Windows 10 from a dual boot situation and install it in VirtualBox once I had my new Linux system up and running.

I also decided I would install a completely new distro, and I decided to first try Linux Mint. After installing that distro, I immediately fell in love with it. It simply worked out of the box, and it was fairly intuitive. I’ll probably do a post on why I like Linux Mint and why I recommend it to Linux newbies in a later post. I’ve also installed and used briefly the following Linux distros, in no particular order: Linux Mint Debian (this is a version of Linux Mint based on Debian instead of Ubuntu, which the standard one is based on Ubuntu), PCLinusOS with the MATE DE (desktop environment), POP OS, Ubuntu Studio (current installed as a dual boot on my main computer)Ubuntu Bungee, Zorin OS, Manjaro (this is the only Arch-based distro that I tried), and possibly one or two others I might have forgotten. Distro hopping? No, not really. I basically wanted to get a good feel and flavor of the different distros out there. So for a time I was installing a new distro nearly every week. I’ve had Debian installed on it for 2 or 3 weeks now. I’ll probably stick with it, using it to test out desktop environments as well as other distros in a VirtualBox. No more crashed on my main computer in VB. This last crash took out my Windows virtual drive. Luckily I didn’t have much on it of importance.

If you have any suggestions as to topic I could tackle, let me know in the comments. Thanks for reading. My posts are usually not this long.

Friday, May 8, 2020

How to Modify Your Keyboard in Linux Using Xmodmap

Like me, you may have used or are using Quickbooks. If you have, you may have also used the “Use keypad key as a Tab key” function of QB. I used it extensively, like all the time, when I regularly worked in the program as a bookkeeper. Some people prefer having the key set that way, others will simply stick to the Keypad Enter key functioning like the return/enter key when pressed.

When I started using Linux, I discovered GNUCash, which is close (close, but not identical) to QB. One of the ways it isn’t identical to QB is with the keypad enter key being able to act like the Tab key. So, naturally, I looked for a way to make it happen. And I did, as follows. Note: you can use this to reassign most any key on the keyboard to function as a different key; it is known as the “xmodmap” command.

I’ll use Linux Mint’s Cinnamon desktop environment as an example, but you can enter in these shortcuts according to the shortcut-keyboard’s entry process of your particular desktop environment. In Linux Mint, you’ll want to go to your menu → Preferences → Keyboard, then click on the shortcut tab. Once that is open, select “Custom Shortcuts” on the left panel, then click on the button at the bottom of that window where it says “Add custom shortcut.” That will bring up a window. In the first field, it wants the name this will go by. I’ve used the description of the shortcut’s purpose for that field. For instance, in this case, I’ve called this function: KP_Enter → Tab. In the next field goes the actual command. Enter:

xmodmap -e "keycode 104 = Tab"

A keycode is a number given to each key on one’s keyboard. Code 104 is the one listed for the Keypad’s Enter key by my keyboard. A keysym, on the other hand, is a name given to main keys used that are control and function keys. Common ones are Tab, Return, Control_L and Control_R, Alt_L and Alt_R. Note, these names are case sensitive. If you enter “return” or “RETURN,” it will not work, it must be “Return.”

To discover what the keycode and keysym of any key is, enter in a terminal window the following:

xev | grep keycode

Then press a key. It should show the line with the keycode, as well as the keysym name (last entry within the parenthesis) for your keyboard. When you’re done, click the X in the box with your mouse to return to the command line.

Now, you could use keysym alone to do this:

xmodmap -e “keysym KP_Enter = Tab”

Problem is, when you go back, you have to use the keycode 104 as any attempt to point to the Keysym Tab will point one to the wrong key to change. So, to change the key back to operating as an enter or a Return key (Use xev as above to know what the keysym for your main enter key is), you would enter the following:

xmodmap -e “keycode 104 = Return”

Once those two fields are filled in, click the “Add” button. Then you will want to double-click in the first unassigned keyboard binding for the new custom keyboard shortcut you just created, and press the key combinations you wish to assign to that function. For instance, in my example, I use Ctrl-Shift-{ to turn on the Tab functionality of the keypad’s enter key, and Ctrl-Shift-} to return it back to working as an enter key.

Now, it is important to know that this changes the key for all operations and programs. Not just GNUCash. That’s why you’ll want to have a key to change it back, if you tend to use it in some applications as an enter key. Like the calculator, for example. You may be used to hitting that key in doing 10-key entry, expecting it to perform as an enter key to get a total. Thus, the key to change it back on the fly. I, however, tend to leave it on the Tab functionality and use the main Enter key to add the total in calculator or other programs. It’s what you are used to.

Another tip, you can start any preferred changes by entering the appropriate command in your startup file (Menu → Preferences → Startup Applications).

That’s it. You can change most any key to do the job of a different key using the “xmodmap” command.

Happy Linuxing!

Thursday, April 9, 2020

Installing Coapp in Firefox/Download Helper.

When I installed DownloadHelper extension in Firefox recently, in my Makutu Lindoz distro, I ran into a problem when I tried to install a helper app it had to have in order to operate correctly. So, I installed it. However, when I returned to try to download a video, it again acted like I needed to install the coapp, as they called it. I installed it again, only to have it repeat the problem.

I then went on the Internet to see if other people had this problem and any solutions. I found that down through previous versions of Firefox and DownloadHelper have had this problem for some time. And while several people had suggestions, I couldn’t ever find a solution to the problem. However, I seem to have stumbled upon doing something right, because I fixed my issue and now DownloadHelper works as expected. So I’ll tell you what I did, and hopefully if you retrace my steps, you can fix the issue on your machine as well.

One of the suggestions was to check the permission of the file “net.downloadhelper.coapp.json” which is located in either your home directory or more than likely you’ll find it in:

/usr/lib/mozilla/native-messaging-hosts/net.downloadhelper.coapp.json


But, as I later discovered, that wasn’t the problem. Another suggestion was that it shouldn’t be in the “lib” directory, but in one called “lib64”. However, creating a directory with that name and putting the file in it didn’t fix it either.

While going through all that, I found where the DownloadHelper settings could be accessed: by clicking on the icon for the app in the upper right corner of your Firefox browser window, then click on the gear icon in the bottom right of the window that drops down. Then in the following window, there is a spot where you can see whether the helper app is installed or not. It said it wasn’t installed (even though it was) and hitting its reset button didn’t fix it either.

Then I had an idea. I knew on my main computer running Linux Mint, that Download Helper on Firefox worked just fine. So I did some research on my Mint computer to see how it was set up. I couldn’t find any differences save one: On Mint I had installed 74.0, but the one I installed on Lindoz was 74.0.1. I had installed it through the Software Manager. I checked the Synaptic Package Manager; it had 74.0.1 on it as well. On a hunch, I did the following which has fixed it for now.

1. I uninstalled Firefox on the Software Manager.

2. I then went to a terminal and entered the following:

sudo apt-get update
sudo apt-get install firefox


When I went to the settings in DownloadHelper, it now showed the coapp as installed, and when I tested it, it downloaded and converted the file as I expected it would.

I’m not sure how I fixed it. Because it works on the one installed from apt repository as opposed to the repository that Software Manager uses (though I would expect it to be exactly the same program)? Or, could it be that it does better at installing it when Firefox is installed after the coapp is installed? Or some other reason I’ve not considered?

One more note, the file it is looking for to determine whether it is installed or not is:

/opt/net.downloadhelper.coapp/bin/net.downloadhelper.coapp-linux-64


That file was already there with executable privileges; Firefox should be picking it up. All I did to get it working was to uninstall Firefox from the Software Manager (where I had initially installed it) and reinstalled Firefox through the command line. For whatever reason, it worked. Perhaps if you do that, it could solve your problem too. Good luck!

Wednesday, April 8, 2020

Which Linux Distro Should I Use?

One reason why many haven’t hopped on the Linux bandwagon yet is the difference between every other OS (Operating System) and the vast array of confusing Linux distributions, at last count, close to 600 of them . You have the big ones, like RedHat, Debian, Arch, openSUSE, CentOS, Gentoo, and others. Additionally, these major Linux distros have “children.” Ubuntu, being the biggest one and based on Debian, which also has distros based on it such as Lubuntu, Xubuntu, Linux Mint, ElementaryOS, Ubuntu Studio, just to name a few off the top of my head.

Confusing? For the new Linux user trying to decide what distro to start with, it can be very confusing. There is no hope that your average user will try each distro and make a decision. How does one decide among the various distributions what will fit you? The answer is in the question: deciding why you want to get on Linux and what your needs are. Until you know that, you’ll be shooting at the wind.

Before we get into that, it could be helpful to know why there are so many distros. Yes, one big reason there are so many distros is because Linux is a community effort. Instead of one company like Microsoft or Apple owning and controlling one OS, you have a large community of people who put together the Linux kernel (the base of an OS), a desktop environment and a set of pre-installed programs to create customized OS’s. However, while the vast array of choices may appear to be a disadvantage, it is also true that it is an advantage. Because you are more likely to find a distro that will not only meet your needs but you will fall in love with.

The main parts of a distribution of note for a new user are a GUI (Graphical User Interface)--also called a “desktop environment”, a set of pre-installed software packages, and the list of software packages in their repositories that you can download, usually for free. The way they combine the various elements of these things together, with the Linux kernel, makes up a Linux distro.

So, for example, if you wanted to install Linux onto an older computer that can barely run Windows, whatever version, you would likely pick from among the distros that have a GUI and collection of software that minimize CPU load, RAM load, and the like. Examples of such systems would be Puppy Linux, Lubuntu, Xubuntu. Note, in such a case, you’ll likely have to be able to do some things more manually. For example, to set the date in Linux Mint, it is a full, graphical process. But, in Lubuntu’s GUI, it only pops up a link indicating that you need to plug in a specialized code to get the date to display or show in the panel the way you want. I would always have to go and check on the Internet what those codes were. There are many examples similar to that example.

So, first, why are you wanting to switch to Linux? Are you fed up with how slow MSWin OS is going? You might want to try Xubuntu or even Linux Mint is said to be a low-memory, faster-running system. Lubuntu is a good choice—for someone who likes to use the command line and edit files. However, truth is, most any Linux distro will be faster than MS Windows. Or do you have a power computer that has plenty of disk space and memory, and you want to take advantage of that? Or, do you want an OS that simply will work out of the box with little set up, or are you a tinkerer who wants to get you feet wet in a terminal at a command prompt? There are other potential needs a person may list. The point is, there is a distro out there for you.

For example, let’s say you like the Windows environment, but the slowness of it is getting to you. You keep clearing out stuff, only to have Windows slow down again. Plus, my experience has been that the older a Windows system gets, the slower it gets, for some reason. That is one of the reasons I switched to Linux: everything usually runs snappy, and it stays that way. But let’s assume that you are afraid of having to learn a lot of new stuff, and operate with an unfamiliar system. Is there a system that has the look and feel of Windows? Why, yes there is! It is called Lindoz, a Makutu distro. You can switch the desktop environment to a “classical Win98”, or XP, Win7, or Win10. I installed it on my backup laptop recently, and it is pretty cool.

So, what do I recommend for you? That depends on what your needs are. That said, for the first Linux distro someone coming from another operating system should get, I would suggest you start with Linux Mint using the Cinnamon desktop environment. Why? Because it is the easiest to install, has one of the more refined intuitive interfaces out there, requiring minimal learning curve, and it just flat out works. It also has a low profile in RAM, leaving plenty of space to run programs before hitting the swap file. Are there other good beginning distros out there? Sure. Straight up Ubuntu is a good choice, as would be many others I could list. But I would recommend that for most first time users start with Linux Mint. Once you’ve gotten your feet wet with Linux in general, you may want to try out other distros to find one that more suits your needs if Mint doesn’t quite “do it for you.” For instance, if you are a creator of streaming and/or uploading YouTube videos, you may want to try Ubuntu Studio. It comes prepackaged with a lot of the best software for doing that and is designed creators, both artists and YouTube creators.

One final note, a warning really. If you are ready to jump ship and ditch your Windows OS, don’t immediately go out and download a Linux distro, and install it over your Windows OS. That is the way of a lot of potential pain. Rather, I would find a backup laptop or desktop that you don’t mind loosing most of the files on, for the purpose of installing and learning more about Linux. Do not, I repeat, do not use your primary computer for this purpose. Once you’ve used it for a while on a backup computer, and you’ve backed up your files, then you may want to install it, once you know it will meet your needs.

Whatever computer you install it on, if you wish to keep the Windows on it, first make a ISO copy of the OS (Sorry, how to do that would be the topic of another tip), and make sure you have the Windows ID key for your specific version of Windows, before you install. I failed to get the key, though I did create and ISO of the OS. Why? Because you may wish to install it into a VirtualBox (a program that will run other OS’s inside of Linux through using it as a virtual machine). Luckily, for me, I found the key stored in a Linux variable so I was able to fully install it in a VirtualBox.

But, what about a dual boot system? You can do that. I heard another recommend against it, because sometimes there are install issues. I did do a dual boot for a long time, with no problems. Because I needed to have access to Excel to run some highly customized spreadsheets that couldn’t run in LibreOffice due to the difference in programming languages. I didn’t want to go through the process of translating that to LibreOffice’s language, so I opted for a dual boot.

Aside from the potential for installation issues I mentioned above, however, I encountered a couple of issues that I didn’t like.

One, it was hard to transfer information back to the Linux side and even more so back to Windows. That’s because if I stored a file while in Windows, I could reboot into Linux and still see, get, and read the file, even though that was a lot of trouble. However, Windows couldn’t read the files on the Linux system. Only if I stored them in the Windows drive from Linux. So if I had a lot of that type of thing to do, I could spend a lot of time waiting for a system to boot up. Windows in a VirtualBox, however, you can drag and drop, or copy and paste between the two OS’s with just a little setup.

Two, realistically, I would usually only go into Windows when I had too. That caused another issue. What is the slowest time you normally experience in a Windows OS? During the initial startup, correct? Sometimes it seems you have to wait forever for all the background apps to load, and everything to get put into place before it gets to a “normal” speed. Compound that with downloading updates in the background, which due to how infrequently I would boot into Windows, meant nearly every time I did boot into Windows, that slowed things down that much longer. Then, once they were downloaded, the only way to install them in Windows appeared to be when you shutdown, and boot into the system, and we all know how long that can take. In some cases, nearly 24 hours.

What about Wine? I did use that on my previous computer to install my copy of MSOffice 2003 (I know, it’s ancient, but hey, it still works.) to access Excel for those spreadsheets. It took a little arm-twisting of the software to accomplish it, but I was able to install it in Wine and have it fully operational. Then I read that Wine had security issues. So that’s why I installed Linux alongside of Windows in a dual-boot system. But for the reasons listed above, I decided when I installed Mint (which I’m using as I type), I would move to a VirtualBox install of Windows, which has worked out wonderful for me so far.

But the point being, that before you overwrite MS Windows, you may want to make sure, if you need it again, you can reinstall it using the ISO file and your ID key. Also, goes without saying, but you’ll want to create a backup of any user files you wish to keep. So the best way is to get a older backup laptop that you can “play” on without worries about if it crashes and such.

Also, another way you can easily “try out” a system initially is most Linux distros have a “Live Boot” option. As a matter of fact, it tends to be the default option when you plug in a bootable flash drive containing a Linux ISO file. It means that the flash drive has the whole operating system on it, and it will give you a taste of the distro before you install it to your hard drive. You can easily see if it will recognize all your hardware, wi-fi, printers, etc. instead of discovering such problems after the install.

So, I’ve rambled on long enough about this. I think you should have an idea, if you’ve been researching this already, about your top 3 or so distros to try out. If not, do your research, do some live boot test of some distros you want to try out, then install one or two or three of them, then make a decision.

Welcome to the Linux world, and good luck!

Tuesday, March 24, 2020

How do I Give Sudo Privilege to a GUI application

This will be a quicky tip.

We all know of the sudo giving temporary root privilege to command-line functions, but what about GUI programs? They need the GUI authentication, or there will not be a chance to enter it.

Well, there is a new command in town to accomplish this task, you can enter pkexec and it will give you a graphic authentication for root useage.

Example: to open Nemo files with root privileges, go to a terminal and type in:

pkexec nemo

Once you hit enter, it will allow you to enter your password and run the program with root privilege. That's it!

How to create desktop program launchers in Linux

I've seen some people, like myself, that tend to create shortcut keys for their favorite programs. For others, with only a few favorites, they'll create panel shortcuts. For others, however, they literally litter their desktop with a slew of icons, much like they might for their smart phone.

This tendency probably occurs because when Windows first came out, nearly every program you installed in it would pop in what was called a desktop "shortcut." They called it that because it was a shortcut in contrast to going through the menu to start it. In LInux, they are called "launchers," because, well, they launch programs.

Programs in LInux systems, however, rarely do that, which is why you'll usually see Linux desktops with hardly any icons. Usually just the Computer file system, the home directory of the user, and often any mounted drives like a CD or USB drive.

As with most things in Linux, there are several ways to skin this cat, and which option will work for you depends upon which desktop GUI (Graphical User Interface) you are using.

For example, I use a Cinnamon desktop GUI. The easiest way to create desktop launchers of your most used programs is to use the menu to browse until you've found the program you want to use. Alternately, you can use the search function at the top to easily find any program. Then right-click on the program and select "Add to Desktop" from the pop-up menu. If you try that in whatever GUI you are working in and that option isn't there, never fear. There are other options.

Also, the following method can be used for command-line programs for which there are not graphical interfaces at your ready, like the text-based editor: nano.

In Cinnamon, and other GUIs, you can often right-click on an open spot on your desktop.  There you will see in the pop-up menu, one choice that says, "Create New Launcher Here..." GUIs other than Cinnamon will likely have similar wording. If not, there is still yet another option which I will go through in a minute.

What pops up in Cinnamon looks like this:


Different GUIs will likely have similar fields. First, you will likely want to change the icon to one more resembling the program you are about to enter. To do that, click on the icon above, which resembles a rocket. You can browse or search your options there to select one.

Then you'll want to give your program a name, like "Silly Windows clone of Explorer" Whatever you type there will be displayed below the icon on your desktop.

Next, you'll fill in the command-line part of the program. This is the command you would type into the terminal on a command-line, with an appropriate place holder for any file that would tend to go with it.  Since the default is to include any file after it, there is no need for a place holder for LibreOffice Writer.

For instance, if you wanted to create one for LibreOffice Writer, the command would be lowriter  or libreoffice --writer

Don't know the command-line version of a program? Here's how you find it. Open the terminal (Ctl-Alt-t) and enter the following: man (progam name)  It will then display a "manual page" for the program. Look under the "Synopsis" section, and it will tell you the command to run it, and further on it should tell you if it needs a parameter to use any files passed to it. Another option is to enter in the terminal: libreoffice -h or --help. That will give you a shorter listing of the command-line entry, but man is more complete and you have a chance to see the beginning without having to scroll back up if the help info is larger than a page.

So, if you entered "man libreoffice", you would get an extended help file listing out the things to know. You can also enter "info (your program) to get a cleaner Synopsis information.

Going back to entering the info in our launcher window, the next field is the Comment section. This is a "what this program does" spot and will show up whenever someone hovers over the icon. Something like "A cool word processor"

The next entry is whether or not to click the box next to "Launch in Terminal." You'll want to click it if it is going to run a command-line only program, like nano. Otherwise, you'll want to leave it unchecked.

For instance, let's say you wanted to have a desktop entry that would check if any of your programs from your repositories needed upgrading. You would create a launcher with the name of "Update check," then the command: sudo apt list --upgradable, a comment that says "Check to see if any upgrades need to be done," then click the box that says to Launch in Terminal.  Once you hit OK, it will put an icon on the desktop that will launch the apt program, and after verifying your credentials, it will give you a list of all upgradable programs in the terminal window.

Once you hit OK, it will then give you the option to put it in the menu as well. Just say nope or you can click it and follow the instructions for it to preform that function.

So, you don't have either function, how do you accomplish that ability?

For this option, you'll be creating and editing a desktop file.

Where are these files? For systemwide icons for everyone who might log in, put the desktop files in /usr/share/applications (you'll need root usr privilege). For each logged in person, you can put the files into their home directory: /home/$USER/.local/share/applications or /home/$USER/Desktop on Cinnamon.

The simplest way to accomplish this is to copy a file and paste it right back, then edit the new file to reflect the new information, paying attention especially to the name, exec, and comment sections. You can change the terminal to true if you need it. Don't forget to rename the file itself to (whatever you want to call it).desktop   

You can create the file from scratch. Before you do that, it would be a good idea to check this more detailed article on what to enter.

There you go. Another reason why I like Linux Mint Cinnamon, it makes it real easy to do what would be a more manual and not user friendly functions.

Monday, March 23, 2020

Intro and First Tip: Extracting Audio from a Video File

Howdy, Linux partners!

I'm starting this Linux blog because I keep thinking, once I've figured out how to do something in Linux, that I should share it with the world, so those who are searching for answers will find them.


To that end, i'll state that there are a lot more people with a higher knowledge of Linux than I. They often know all the obscure commands from memory, whereas I often have to look them up. While I don't consider myself an Linux guru, I have used it as my main OS for several years now. I started out using Lubuntu using the LXDE interface (GUI), then moved to Xubuntu using a xfce GUI (Graphical User Interface). I really liked the xfce GUI, save for a couple of small issues.

I kept hearing about Linux Mint, and what a good setup it is. So I decided to give it a spin. I also heard a lot of good things about the Cinnamon GUI, which is one of the GUI's you can get installed, the other two being the other two being MATE and Gnome. Likely you could install other GUI's on top of the Mint system.  I thought about using xfce but I was hoping I could solve the problems that I mentioned. So I tried Cinnamon and I loved it.

My issues? One was the xfce power manager didn't have an option for "do nothing when the lid is closed" and the date/time function required one to look up date coding in order to adjust the display to your preferences.

I was presently sold on Cinnamon when I clicked on the system date. It pops up a calendar, like they all do. However, it has a link at the bottom of the calendar that says, "Date and Time Settings". I clicked on it, expecting the code entry fields. What greeted me, however, was a GUI for setting the date and time so I didn't have to go search for the codes on the web. (LIke a common set of codes looks like this: %h%h:%m%m. That's when you know you have a good system, when the programmers pay attention to small details like that.

But, that is not my first tip on this blog. My first tip will be concerning how to extract music/soundtrack from a video. It is actually easier than you would think.

I use OpenShot to edit my videos. It isn't a full-featured editor, but it gets the job done. One of its drawbacks is being able to separate the audio from the video. Ideally I'd like to edit them in the program. But, without that option, I would need to first extract the music from a video file, edit it with a program, then import it back into your project.

To extract the audio from the file for editing, first you should have a program called Audacity. That one would normally be in the repositories. If not, you can download it from their website.  Once installed, all you do is open the video file with Audacity and it will (at least I've tried it with mp4 files, your mileage may vary) show only the audio in the file, which you can then edit and save as a mp3 file, ready to re-import into OpenShot.

Yes, it really is that easy.