Thursday, October 13, 2022

How to Rig Barrier for "Silent Running" on Startup

 I looked the web over but couldn't find a definitive answer to this question. The default, once you've installed Barrier, is for it to pop up a GUI (Graphical User Interface) box where you can set your configurations. But no where in that window is there an option to set Barrier to not show the window upon startup, leaving one to close out the box on each startup or reboot of your computer.

Or is there such a setting? Well, I happened to stumble across it at one point, and the great thing is it works! And the other great thing--especially for terminal-phobic Linux users (can there be such a person?)--is that it can all be done through the GUI. In other words, no terminal commands needed!

That was part of my problem, in that I was led astray in my online searches for this answer by people attempting to use complicated command line syntax. So, since I tend to prefer the terminal, I was looking for a command option I could use, but failed to find one.

So, this is my definitive answer of how to set Barrier for silent running on startup.

  1. First, you'll need to have the Barrier box/window open on your computer. If it isn't already up, you can right-click on its system tray icon and select "Show" from the pop-up menu, that is assuming you've already started barrier. If you haven't, then start it from your system's menu and the window should appear.

  2. Next, left-click on the "Barrier" menu item in the top-left corner of the window. Select "Settings" from the menu that is shown.

  3. Then, you'll see two boxes that probably do not have a check-mark in them, which are labeled: "Minimize to System Tray" and "Hide on startup." Put checks in those two boxes and click on OK.

  4. Note: on the newer version of Barrier, you'll also see a third box labeled: "Start Barrier on startup." Click that box as well, otherwise it will not start up, you'll have to show the box and click the start button to activate it. Also, to have it autostart upon login, you'll need to put it in your system's autostart settings or folder, at least in Linux.

  5. Once again, left-click on "Barrier" in the menu, but this time select "Save configuration." Select a directory and a file to save your configuration into and click on SAVE to save the configuration you have changed in settings.

  6. Now, reboot your OS to test out the new settings. It should no longer show you the box, but it will show an icon in the system tray, which will enable you to show the widow again, quit, or other options.

Yep, its that easy! Enjoy.

Friday, September 16, 2022

How to Use a Downloaded Bash File

I have a web page of mostly bash scripts located at: https://nlgg.rlcopple.com/index.php?currdir=&currfile=Download+Scripts.php

On that web page is a link to this web page with the promise of how to use those scripts, for those new to Linux or have never dealt with it before. So that is what you will find here, a post on how to use a bash script that you downloaded from my site. It would apply equally as well to other downloaded bash scripts.

Step 1 – Download the File

First, of course, you will need to download the desired script. The easiest way is to simply click on the link. But if it displays the text of the script instead of downloading the file, you can check the contents of the file that way, but saving it in a file on your computer would require you to copy the text, then paste it into a text editor, then save the file, giving it a name.

So, for most folk, the best way is to right-click (that means to hover your mouse over a target and then press down on the right mouse button instead of the left), then in the pop-up menu that should appear, you should select the option that says something similar to, “Save link as . . .” which will then, when clicked, will download the file to your hard drive. Make sure you remember where you put it and the name you gave it, if you changed it from the default.

Step 2 – Check the Contents of the File

This is the step most tend to skip. Why should you look the file over? 1) To identify any potential problems. Even if you feel you don’t have the chops to figure out the coding on a bash file, most of the commands are obvious, like “echo” means to copy the string of text to your terminal window. But there are other more practical reasons.

Frequently, a bash script file will have what are called comments in them. These are text preceded with the hash sign: #. Any comments in the file will tell you two basic things: 1) What the coding is meant to do, and 2) any instructions on how to use the script file. For instance, in my Install programs script, you will want to look over the list of programs it will install from repositories and flatpaks and adjust them to your liking.

Step 3 – Make the File Executable

The next step is to make the downloaded file executable. In Windows you generally accomplish that by including the correct file extension such as *.exe, *.msi, *.bat. Of course, the file must match the extension to work. But that isn’t the way to “mark” a file as executable in Linux.

Perhaps the easiest for new Linux users is to locate the file in your file manager, right-click the file to bring up the pop-up menu, Then select “Properties”, then the “Permissions” tab, then locate the text which says something to the effect of “make this file executable.” Click that box and click OK.

Or, if you want to use the command line in a terminal, you simply enter the following line and at the end of it, press Enter:

chmod +x [name of file]

Step 4 – Running the File

You can run a bash script file at this point. However, unless you saved it in a directory that is included in your PATH, you would run it by including the entire absolute path. For example, let’s assume we have a bash script file we’ll called “laughatme” and that we have already marked it as executable; and we have put the file in the bin directory under our home. There are three ways to run the file.

Method 1

You can run the file using an absolute path. So if we wanted to run the above mentioned bash file, I would enter the following command from any directory in a terminal window.

/home/$USER/bin/laughatme

In some distributions you may need to put “bash” before the line for it to work.

Method 2

If you are already in the directory where the bash file is at, or if you change to the directory where the file resides, you can enter the following shorthand:

./laughatme

Method 3

The easiest way is to put the directory as part of your path statement. Your path variable holds all the directories that your system will look for any program you tend to use from the command line. Each directory is deliminated by a colon - “:”.

To check which directories are in the $PATH variable, enter the following command in a terminal:

echo $PATH

Generally, you will see where most programs are put: /usr/bin being the most common. Other directories you may see are: /bin:/sbin:/usr/sbin. On occasion, some distributions will check if there is a bin directory in the user’s home directory, and add it into the path. If wherever you put the script at is not in one of the directories listed in the path, then you have two options:

1) You can move the bash script file to one of the directories listed.

If you use this method, it is best to put scripts like this into a home directory file. Those are any directories that begin with “/home”. If you do put it into a system directory like “/usr/bin”, then you will probably want to change the ownership of the file from your user name to “root.” Assuming the directory you are in contains the file, you would enter:

sudo chown root:root laughatme

Another common place to put scripts aside from $HOME/bin is $HOME/.local/bin

2) Add the directory it is in into the PATH variable.

In my example above, I would add the following command to the end of your .bashrc file in your home directory:

[[ -d $HOME/bin ]] && [[ $PATH != *”$HOME/bin”* ]] && export PATH=”$PATH:$HOME/bin”

That is a simplified IF/Then statement in bash. So if there exists a valid directory of “bin” in the users home directory, and the directory is not included in the PATH variable, then and only then will it add the path to the $PATH variable.

Once the path has been added to the $PATH variable, then you should be able to simply enter the name of the script file no matter what directory you are in (you may need to close out your terminal window and open a new one to activate the new path statement):

laughatme

That is it! You are now ready to use the script file, enjoy!

Saturday, September 3, 2022

My ASUS ROG Falchion Mechanical Keyboard Keeps Shutting Down My Linux Computer

I recently purchased a great keyboard for my Linux systems. It is a wireless mechanical keyboard. It is designed with gaming in mind, though I don’t intend to use it for that purpose.

It has one glitch,however. Its power saving feature causes the keyboard to power off/restart/or hibernate your whole system after 2 minutes is up. I did some Internet searching, and this workaround to disable the power function worked for me on x11.

1. You need to edit the following file:

sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf

2. You’ll need to append the following lines to the end of the file:

Section "InputClass"
     Identifier "disable asus falchioh sys control"
     MatchIsKeyboard "on"
     MatchProduct "ASUSTeK ROG FALCHION System Control"
     Option "Ignore" "on"
EndSection

3. Save it and reboot. That should fix the issue for Xorg.

For Wayland, you'll need to do the following:

1. You'll need to create the following file in its directory:

sudo nano /etc/udev/hwdb.d/99-asus-falchion.hwdb

2. Copy and paste the following into that file: 

evdev:input:b*v0B05p193Ee0111*
  KEYBOARD_KEY_10081=reserved
  KEYBOARD_KEY_10082=reserved
  KEYBOARD_KEY_70070=reserved
  KEYBOARD_KEY_70071=reserved
  KEYBOARD_KEY_70072=reserved
  KEYBOARD_KEY_70073=reserved
  KEYBOARD_KEY_70074=reserved
  KEYBOARD_KEY_70075=reserved
  KEYBOARD_KEY_70076=reserved
  KEYBOARD_KEY_70077=reserved

3.After saving the file, run the following command:

sudo systemd-hwdb update

Then reboot into your Wayland session and you should be good to go!


Friday, August 19, 2022

Update to Post: Setting Up an Operating System with a Home Directory on a Separate Disk

In my last post, which was a while ago, I went over how I installed Peppermint OS onto my Acer Aspire laptop. On that article, I had some instructions on how to do it that I need to update.

The issue was, whenever I edited the /etc/fstab file and mounted it with the old home files on that disk by rebooting, the new distro’s desktop would be replaced with the last instance of the desktop look, feel, and panel/dock that I had on the previous install of that desktop environment’s config files. But I figured our a way that is more efficient than what I presented the last time. Here are the main changes that I have to offer to what I wrote in How I Installed Peppermint OS PCNetSpec Edition onto a Computer with a Separate Disk as the Home Directory

You should do these steps before you update and upgrade the system. One of the first things you should do is to edit the fstab file in the /etc directory, before much changes happen to your current home directory after an install. It doesn’t matter whether you do these steps before or after you edit the fstab file and set it to use your drive for a home directory. If you do edit the fstab file before you do this, just make sure you don’t reboot until you’ve done the following steps:

After mounting the old disk on /mount/rick/myhome as instructed in the second set of steps, look for point #4 of the above referenced article, go to the config directory where your desktop files are configured. This is normally at ~/.config/(desktop directory). If you are doing this on a peppermint install, that would be the XFCE DE. But I believe these steps would work for most DEs, However, I’ve only tested this on XFCE thus far. Note, I will use my own disk’s label and directory below. Make sure you use your own directory for your setup. Enter:

cd /media/$USER/myhome/$USER/.config

cp -r ~/.config/* ./ This will effectively copy all config files over to your disk myhome mount.

With that steps done, you are now ready to reboot into your system, assuming you have already edited the fstab file to mount the new disk to /home. Otherwise, you’ll need to edit and add the disk info as detailed in the above article to switch your home directory to the disk it is on. Then you will be ready to sudo reboot!

That’s all you have to do to save the settings on a newly installed distro with an XFCE desktop environment.

Also, in my original article, I have some instructions on how to access the blkid app when it isn’t in the path of the user, by adding that path to the users current path variable, which you can check by entering echo $PATH into a terminal.You will be looking for the /usr/sbin directory, specifically, that is where the program resides.

Or, you may wish to not add that directory path to the $Path variable. You can still run the program by adding “sudo” to the beginning of the command, like this:

sudo blkid

Enter your password in and then it will run the app and you can do the same to reboot the computer from the command line in a terminal--sudo reboot or you can use the DE’s logout function.

If you did not run any of the programs on your new system, the files you copy from your “new” home directory will be the settings for the current desktop environment to your “old” home directory. will overwrite past settings for the specific distro onto your soon-to-be home directory, thus preserving the distro’s settings. If you wish to save certain settings from your old home directory, I would suggest copying the whole .config directory to a backup directory:

mkdir ~/.old-config && cp -r ~/.config/* ~/.old-config

You can, of course, use whatever naming scheme you wish for the backup directory.

Then proceed with the home directory instructions and your own tweaks to the system.

Friday, February 25, 2022

How I Installed Peppermint OS PCNetSpec Edition onto a Computer with a Separate Disk as the Home Directory

. . . and kept the original Peppermint settings once I linked my home drive on the alternate disk.

Yep, that's the setup I have on my Acer Aspire 5 thin laptop (using a AMD Ryzen 3 cpu and a AMD Radeon GPU). I have a 119 GB nvme drive, and an alternate SSD drive of 1 TB. I bought that drive once I realized my computer had a spot for it when i was installing more memory in it. It was then that I had the "brilliant" idea of using that spot for my home directory, especially since I was afraid that the nvme card wouldn't be big enough to hold my whole home directory plus system files. So I ordered and installed the drive. I followed some directions on the Internet on how to move my home directory to a separate hard drive. I successfully had a system that gave me plenty of room to expand on both the system (119 GB) and on my home directory (1 TB). Plus, I have a 2 TB external drive which connects via USB for doing my backups.

Now, I had, at the time--after a period of distro hopping (that is a term for anyone who regularly installs new Linux, or other kernel/systems such as BSD, on their computer because of various reasons), looking for a distribution that would work best for me--installed Neptune OS, which uses the KDE Plasma desktop environment (DE). I used that distro for around one year before I decided to distro hop again. If I recall correctly, the first distro hopping I did on this laptop, was in the following progression: Peppermint OS (had a problem updating), Sparky Linux (couldn't get it to install correctly), Garuda Linux (it broke down on an upgrade), Linux Mint Debian Edition (mostly as I needed a stable system and I knew it would work) and a few others I don't recall right now. Somewhere in that first distro hopping period, is when I started using that extra 1 TB drive.

There are several posiitives to doing it this way, but the biggest one is: All of your user settings for the various programs you use are retained upon installing a new distro. For example, upon reconnecting my home directory to the new computer system and opening up my fresh install of Brave or Firefox browser, all of my settings and bookmarks are just as I left them. I was even still logged into my Google account!

Likewise, the main downside is that all of my user settings were retained. Which was a negative when after installing a new distro with, for example the XFCE DE, I would set up the DE like I would want it. But when I connected my home drive to it, all my settings would revert to a previous distro's XFCE's configuration. That actually happened when I first installed Peppermint OS on the Acer, as soon as I connected with my home directory, the panels, theming, wallpapers, all switched over to a previous install of an XFCE DE I had when I ran for a time OpenSUSE, with all its keybindings (the good thing) and all of its inherent problems like the settings for the display not sticking, that is, not being saved and reloaded on a reboot/restart of the session (definitely not a good thing).

So, when it came time to do a fresh install of Peppermint on the system, I decided I wanted to try something I'd not done before. My usual process after installing and updating the system and programs was to reconnect my home drive to the install. "How?"

1) Open a terminal bash session and type:

lsblk

. . . to identify the device location of the home drive. Helps ensure that I've got the correct drive.

2) I then run the following command:

blkid

This will give you a list of the drives and partitions on your disks, but the key part you are looking for is the partition where your home directory is residing. You should be able to see the UUID sequence of letters and numbers in groups of four. It will look something like: xxxx-xxxx-xxxx-xxxx-xxxx. You'll want to mark and copy just the number/letter combination using your mouse to mark the text and holding down the Ctrl and Shift keys at the same time, then pressing and releasing the "C" key. That key combination is usually represented as Ctrl+Shift+C.

If you are on a Debian-based distro, or Debian itself, you may not be able to find the command on your computer. While it is often there in /usr/sbin, it is only that the command's path isn't in the user's path environment variable. To correct that, type in the following command into the terminal:


export PATH="/usr/sbin:$PATH"

It will only last until you close the terminal. To make it a last beyond that terminal session, enter the same command in the .bashrc file, or one it includes. Now, if the program is there, it should show up.

3) Now, I edit the fstab file in the /etc/ directory using your favorite text editor--I tend to use nano since it is on most systems. The purpose of the fstab file is that it will tell your operating system where to mount and find your system, boot files, as well as any other directories such as the one that we just created in our example above.

sudo nano /etc/fstab

4) Then I make an entry for attaching my home directory upon bootup:

I enter "UUID=" then I paste the number/letter that I copied in step 2 above by again holding down the Ctrl and Shift buttons, but this time pressing and releasing the "V" key. Press the spacebar or the tab key, then enter "/home" which will tell the system where to mount the drive. After another space or tab, you'll enter the filesystem it uses, which in most cases will be ext4. Then you'll enter some flags or commands that tell what the drive will do. So after another space or tab, enter "default,noatime", followed by a "0" and a space, then a final 0. By the time you're finished, you should have something that looks like the following, with, of course, your specific UUID code in place of the x's:

UUID=xxxx-xxxx-xxxx-xxxx-xxxx /home ext4 default,noatime 0 0

You'll notice that the pattern matches that of the other drive as well. Once entered, save the file by pressing and holding the Ctrl key, then press the "S" key. Now you are ready to exit the file by once again holding down the Ctrl key while pressing the "X" key.

5) Then, to activate the switch to the new home directory, you'll need to reboot. Once you've done that, you should have access in your home directory to all the files you had on the disk before. The advantage of this is big, in that while I would recommend backing up your home directory, just in case you over write it with your new system you're installing, there is no need to restore your home directory's files from a backed up copy. Plus, as I've already mentioned earlier, you'll automatically have all your user settings for your programs. So, if for instance, if you use Thunderbird as your email client, you won't have to reset up your email accounts again. It's as if you never switched systems.

So what did I do differently to fix my other problem?

1) Certainly before step # 5, but you can do this at any point after you install and update a new system, I'll first create a temp mount point for the old home directory.

For Debian and systems based on it, you'll enter:

cd /media

For Arch and most other systems save a few, you'll add a "/run" directory so that you'll enter:

cd /run/media

2) Then you'll need to create a directory for your user

sudo mkdir $USER

In my case, it would create the directory "rick" so it would read /media/rick

3 ) However, you'll need to change the ownership of the user's directory to the user, so you would enter:

sudo chown $USER:$USER $USER

4) Then you would create the mount point directory inside the user's directory:

cd $USER && mkdir /myhome

5) Then we would mount the directory:

sudo mount /dev/sda1 /media/$USER/myhome

or on non-debian-based systems:

sudo mount /dev/sda1 /run/media/$USER/myhome

Of course, you can name the mount directory anything you desire, within reason. Also, my home directory is on partition 1 of the disk, thus my /dev/sda1 entry. You'll want to put whatever drive and partition that your home directory is located in place of sda1.

What this does is it makes the soon-to-be home directory accessible to you before you mount it as your /home directory.

6) It is easier to do the next part in a file manager. Go into your newly mounted home drive, and go into the ".config" directory. If you don't see it, try pressing Ctrl-H. That will show all the hidden files. Those are all the directories and files that start with a period.

Once in, delete all the folders of past programs that you've used before or you no longer need. Don't worry here about removing something your system might need. Especially good to get rid of old DE directories like XFCE or KDE (which pretty much covers all directories and files that start with a "k"). The only config files and directories that should be remaining are of programs you are currently planning on using. 


For example, I have a file in the .config directory called kitty. it is a terminal application that I prefer using. But, if you fail to keep any config files, all it would mean is that you would have to start over setting up that program.

But the main thing is to delete or rename any desktop environment's configuration files, that will give your system a fresh "blank slate" to put its default setting into. If you don't find the setting file you are looking for in the $HOME/.config directory, check in your $HOME directory as a lot of programs will put their configuration files in there instead of the /.config directory.

Once I've done the above, I would then continue with the steps 1 - 5 above where ever you left off at. Once you've rebooted, you should log into your home directory with all your files intact, including the settings for your programs, yet it won't affect the desktop environment's settings in a bad way.

So, that is how I keep my desktop environment's settings while reusing my /home directory.

Monday, March 8, 2021

How to Deal with a "filter failed" error in CUPS

 I ran across this error recently when I installed a new Linux distribution on my writing computer called "Neptune OS", which is a Debian based distro. I spent about 2 days troubleshooting this problem, and I finally ran across the solution (at least in my case) that allowed me to print again.

So, installed this distro that I wanted to try out for my channel series: "New User Linux Reviews." I installed it, which went smooth enough, Then, in checking out the distro, one of the functions I check out was whether the system installed the printer (I have a network printer, a Brother MFC-L2710DW) or not, how easily it was to install it if it didn't, and did it work or not?

So when I went to check out the printer, I was pleasantly surprised to find the printer had been automatically detected and installed. So I initiated a test page print to see if it would print. Unfortunately, it didn't. And the only error message I found was "filter failed," which I discovered in my research could be caused by several different issues.

Probably the best troubleshooting guide that I found on the web was in the Arch Wiki:

https://wiki.archlinux.org/index.php/CUPS/Troubleshooting#CUPS:_%22Filter_failed%22 

It listed several of the major reasons it could give that error, as well as what to do about them, though it failed to give me a solution to my problem. Still, it pointed me in the right direction to figuring out, quite by accident, my solution.

After scouring the web for potential causes and solutions to this problem, and coming up empty handed, I realized that there wasn't much out on the web to help people address this issue (thus, the reason for this blog post). So after finding the Arch Wiki article mentioned above, I read through my error_log file in

/var/logs/cups/

That is when I discovered that the problem was an app called "pdftopdf" that it failed to create a "log file." Which created a cascade effect of other apps--that CUPS relies upon--to error out as well. Since some of those apps are also cups filters, it gave me the "filter failed" error in the print queue.

But, I still had to figure out what to do about it. After trying out a few other options, and they failed as well, I finally noticed one error message in the error_log file, which read: 

open /usr/share/cups/data/default-testpage.pdf: no such file or directory

On a whim, I decided to go to that directory and find out what was there. What I found were several pdf files that I realized were templates. However, what I also noticed was a file called

default-testpage.pdf.XXXXX

The "XXXXX" stands for some other letters that started with a "C" but I've already forgot exactly what they were (I'm not even sure about the "C" either). I wondered what would happen if I deleted  the extra letters from the end of that file so that it ended in "pdf," whether it might not find the file and print it. So I did that, then I went back to the printer queue and hit the "reprint" button: it printed!

Okay, so that meant that the CUPS system wasn't coordinating with what the printer was looking for as far as file names. I suspected it might be the CUPS system which was at fault, since I've had this printer for some time now, and have installed it on multiple systems without much issues, save for Arch distros, which while they install CUPS, rarely appear to have their daemon active, much less a GUI print manager application installed.

From that data, I wrongfully concluded that the two files I had noticed in that directory (default-testpage.pdf.XXXX, modified to default_testpage.pdf and file testprint which I had modified to testprint.pdf, were still there. I had assumed that these files were temp files that would disappear once they printed. I should have known better, however, that these were templates with names like "standard.pdf, secret.pdf, topsecret.pdf, classified.pdf and unclassified.pdf just to name a few of the other files in the directory.

However, what caused me to realize that bit of truth were the messages that now popped up on all three of the printers I had installed on the system that said something about a missing file, in bright red at the top, and they failed to even acknowledge that I had printed a test page, nothing in the print queue, nothing in the error_log file save something about not being able to create a profile or something along those lines. That is, once I deleted those two files.

So, what was I to do? That's when I wondered if my Linux Mint CUPS folders on my laptop might have the same list of files, like, maybe I could use those files? So I checked and they did have those same files. So I copied them all over to the same directory on my desktop, and guess what? Suddenly, the printers worked!

All I can figure was that one or more of those files were corrupted and/or the printer was looking for names that CUPS had given different names to use as templates. Not finding the expected template pdf file, it crashed. Once I changed the name of that one file, the printer was able to print the file. In copying over the files from a working copy of CUPS in this directory only, I somehow fixed the system.

So for everyone out there who has the same error in the error_log file, that could be your issue and solution as well.

May the Linux Force be with you!

 

UPDATE (3/14/21): I reinstalled the system and here is the file I noticed with the extra ending on it in the PDF templates that are in the /usr/share/cups/data directory:

default-testpage.pdf.distrib

I also printed out a normal text from the Kwrite program successfully, before I ever changed anything. The printer works out of the box. The only part that doesn't appear to work is the test page which should print out when you select "Print Test Page" under the maintenance button on the "Printers" section of the System Settings.

Once I had confirmed that everything else would print, I removed the ".distrib" ending so that the file read: default-testpage.pdf, which is exactly the file name that the error log said CUPS was looking for. Once I made that one change, it would print the test page just fine.

So, the bottom line is that to fix this apparent error, all one has to do is change the file name from:

default-testpage.pdf.distrib

to:

default-testpage.pdf

And you'll be good to go!

You can do that by entering the following command at a terminal prompt:

mv /usr/share/cups/data/default-testpage.pdf.distrib /usr/share/cups/data/default-testpage.pdf

May the Linux force be with you!


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.