Monday, December 26, 2022

Mouse/Keyboard Battery Levels Displayed in Panel

 A Gnome Shell Extension for Ubuntu 22.04 that displays the battery level of your wireless mouse and /or keyboard in your upper panel;  Battery Indicator (upower).  You can get it by visiting  https://extensions.gnome.org with the Chrome Browser then clicking on the “Click here to install browser extension” link.  Once installed, you can search for Battery Indicator (upower) at https://extensions.gnome.org and simply turn it on for your system.  

If you do not want the Chrome Browser extension or don't use Chrome Browser you can open Ubuntu Software Center and search for the Extension Manager tool.  Install the Extension Manager App on your Ubuntu 22.04 system and use it to search for and install Battery Indicator (upower).  


Once installed and running, you will see your mouse and/or keyboard battery level on your upper panel.




Tuesday, December 20, 2022

Install Dropbox on Ubuntu 22.04

Step 1.  Get the Ubuntu Dropbox installer.
Navigate to Dropbox's Linux software download site at https://www.dropbox.com/install-linux. We want to get the "Ubuntu 14.04 or higher (.deb) 64-bit" Installer (.deb) file. As of this writing the version is 20.03.04.

Step 2: Run the Dropbox Installer
Once your .deb file has downloaded, navigate to the folder where it was stored and Right Click on the dropbox_2020.03.04_amd64.deb file (or whatever your .deb file was called) and select OPEN WITH ---> SOFTWARE INSTALLER from the right click menu.  This launchs the Ubuntu Software Installer and begin installing the Dropbox Installer.  It will ask for your Ubuntu password just like all other software you install on Ubuntu.

Step 3: Run Dropbox Installation
Once the Dropbox Installer finishes installing you will find an icon for it in your applications menu called DROPBOX.  Click on it's icon to launch it.  Once it starts it will ask for your Dropbox user name and password.  After you enter them, Dropbox will send you a code to finish the process (mine was sent to my email address).  

NOTE:  Dropbox has a three devices linked limit I think.  If you have this problem (more than 3 devices attached to your account), just go to Dropbox's website, log onto your account and mange your linked devices dropping devices that no longer need access.

You are Done.
You should now see the Dropbox icon in the system tray area of  your Ubuntu 22.04 system. If you clicking on it you can manage your Dropbox Account and syncing settings. In addition you'll find a Dropbox folder in your Home Directory and any files you copy into this fold will get synced to your online Dropbox.

Sunday, December 11, 2022

Ubuntu 22.04 Stuttering Video Chrome/Firefox/Totem

I was having trouble with YouTube videos stuttering.  They were NOT dropping frames, but about every 5 seconds they would freezing for 1/2 a second, then playing normally for another 5 seconds, then stutter again.  This was not affecting audio, just the video.  In addition I noticed that this was occurring in FirefoxChrome, and local videos played with Ubuntu's Totem video player. All were having the same stuttering video issue.

I tried several internet suggestions, from turning off hardware decoding support to turning off all browse extensions, nothing worked.  I then remembered that GNOME DESKTOP also had Extensions and that I had recently added one, Clipboard Indicator by Tudmotu.  I went to my Gnome Extensions and disabled Clipboard Indicator and like magic all the stuttering disappeared.  

I like having the ability to add Extension but Gnome Desktop has a very poor track record of supporting Extensions consistently from version to version.  Without exception most Gnome Desktop Extensions require some kind of update every time Gnome updates the Desktop.  

So if you're having weird, hard to figure out problems, and you've recently added any Gnome Desktop Extensions or Gnome has update Desktop, then you should disable your Extensions and see if the problems goes away.  If it does, just turn your Extensions back on, one at a time, until you find the one causing the problem.  

UPDATE:  I noticed that I was still having a stutter just not as pronounced (maybe a tenth of a second) I check to see which Nvidia Driver I was using and saw that it was Nvidia Propriety Version 510. I noticed that Version 515 and 525 were in my list of choices (as of 12-12-2022).  I went with the newest 525 driver and it seems to have fixed it.  I re-enabled Clipboard Indicator by Tudmotu and no issues. 


UPDATE #2:  12-26-2022.  I'm still getting stuttering during all video playback but only after letting the my system run for a few hours.  After a reset or restart video plays just fine for a few hours, then starts the stuttering again.  Maybe some kind of memory leaking program? Not sure now.


UPDATE #3:  1-2-2023.  I noticed that Gnome Shell was using 10GB of memory, so yes it's a memory leak and it's Gnome Shell. You can reset your computer daily or you can use ALT - F2, then type "r" and hit ENTER, which will restart Gnome Shell, which is quicker than a full computer reset.  This problem could still being caused by an Extension for Gnome Desktop but I've turned them all off with no effect on the issue.  Another solution I found was that you can use Wayland instead of X11/xorg. (Change on your login screen). I'm not sure Wayland is ready for daily use yet so I guess I'll be using the ALT-F2  r  ENTER workaround for now.  

If you want you can run this command in a Terminal window or created a Bash Script with this command in it, which also resets Gnome Shell;

killall -3 gnome-shell

UPDATE #4:  1-5-2023.  I've turned off all extension and the memory leak slows but doesn't stop.  I've made a Bash Script that executes the "killall -3 gnome-shell" command and created a desktop shortcut to it.  Now if I notice the stuttering I just click on the desktop shortcut and Gnome Shell restarts.  When It restarts it shows about 270 mb in System Monitor.  After about 12 hours of up-time it gets up to over a one Gb.  With all the Extension disabled it show about 185 mb and creeps up to 700 mb in 12 hours.     

Just after resetting Gnome Shell



Wednesday, November 30, 2022

Installing Wine 7.01 on Ubuntu 22.04

I used Wine to run Photoshop CS2 on my Ubuntu 20.04 box (Intel Core I5).  It worked without issue. I've upgraded that box to 22.04 LTS and Photoshop still works without issues.  I've now retired that box to the garage and I've build a new system using an AMD 5900x 12 core CPU which is running a clean install of Ubuntu 22.04 (no upgrade, fresh install).  I've installed Wine 7.01 Stable on the new box and it works good with a few test programs I've installed....BUT......

Photoshop CS2 will not run stably on the new box. It either won't start or crash on closing.  Here is a sample of the crash screen:
  

When You Click on the CANCEL Button you get this:

Click on the SHOW DETAILS Button give you the following long list of information which I don't under stand (three pictures need to show all the long screens of information):



This information means very little to me and I haven't been able to fix this on my New AMD box.  If anyone knows how to fix this issue please reply to this post, I get notified when someone replies.

Anyway Wine has worked great for me for years and I only really need it for Photoshop CS2 but I've installed it on the new box anyway.  Here's how to install Wine 7.01 on your Ubuntu 22.04 System. (This info is compiled from Wine's Install page for Ubuntu.  I've followed them and know they work.  If you need more information or are installing Wine on another version of OS visit their Download page for information on what you need to change to get this working for you).

Open a Terminal Window and type in the following six commands (in red) one at a time, letting each one finish before moving to the next:



If your system is 64 bit, enable 32 bit architecture:
sudo dpkg --add-architecture i386 


Download and add the repository key:
sudo mkdir -pm755 /etc/apt/keyrings

sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key


Set the WineHQ sources file for your version of Ubuntu (this is 22.04):
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources


Update your package info:
sudo apt update

Now only do one of the following based on weather you need the Stable (recommend) Wine version or want a newer but not as tested Development Branch (use if there is some feature you need and it's only in the Development branch), and if your you like life on the edge go for the Staging Branch (should only be done on non-production machine).

ONLY PICK ONE OF THESE 3 COMMANDS, DO NOT RUN MORE THAN ONE!

Stable branch (recommended)
sudo apt install --install-recommends winehq-stable


Development branch (think beta but if you need a certain feature go for it)
sudo apt install --install-recommends winehq-devel


Staging branch (think alpha, testing only, not on production machine)
sudo apt install --install-recommends winehq-staging

Hope this helps you get Wine working on your Ubuntu 22.05 box.  Remember if you know what is causing my error's please comment any suggestions. 

Friday, November 25, 2022

Openshot AppImage is not working on Ubuntu 22.04

Openshot AppImage version 2.6.1 is NOT working on Ubuntu 22.04.1.  The app starts and allows you to import video/audio/image file into your project but will NOT allow you to add those imports to your video timeline.  As a mater of fact the entire video time line section looks like it's missing stuff.

APPIMAGE Version

A few quick searches and I found out that there is a Flatpak version out there, so I removed the AppImage version and installed the Flatpak version which works just fine.


FLATPAK Version

Here is how to install Flatpak support on Ubuntu 22.04 and then install OpenShot using Flatpak.  Open a Terminal window and type the following six commands, let each one finish before run the next one;

1. Update your System
sudo apt update && sudo apt update

2. Install stuff Flatpak needs to run on your system
sudo apt install flatpak

3. Add the Flathub repository (lets you find Flatpak Apps)
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

4. Reboot your system
reboot

5. Install Openshot using Flatpak
flatpak install flathub org.openshot.OpenShot

6. Run Openshot using Flatpak
flatpak run org.openshot.OpenShot

If you want you can just look in your applications menu, there should be a short cut icon for Openshot there too (you do not need to always launch Openshot from a Terminal Window you can just click on the icon).

I like the AppImage applications because they have everything they need in a single file (mostly).  Yes they are bigger files, yes they start slowly but you just download their file and set it to allow execution and your done, no installations and you update when you want (of course that just bit me in the ass with Openshot lol).

Hope this helps someone else who was wondering why Openshot stopped on Ubuntu 22.04.






Tuesday, November 15, 2022

Replace GNOME's Next to Useless File Manager

The default Gnome File Manager is next to useless for anything other than basic file moving.  Over the last few years the entire Gnome Desktop seems like it is being made for a tablet/touch screen not a true desktop computer.  It feels like they have removed more features than they've added.  When the most exciting thing about your new desktop release is the new theme you may want to reevaluate your work and ask your users what they need/want. Okay, enough "soap boxing" let's fix what we can.

In my opinion one of the best File Managers out there is Nemo.  Nemo is part of the Cinnamon Desktop which Linux Mint uses by default.



Nemo has too many features to list them all out here but a few highlights are; Add your most used favorite folder/places to the left side bar, right click context menu, duel panel split window option, open a terminal window in the current fold location, Clam virus scanner integration (if Clam is installed), Icon, List, and Compact views (list view is customizable), plugins and much more.  Enough of the "about section" let's install it.

I'm running Ubuntu 22.04 so these instructions are for it.  There are two levels of installation for Nemo, one is just adding it as an extra File Manager without making it the default; two, install it and make it the default File Manager for your OS (this does not remove Gnomes file manager just changes which one is default). Both start with the same command so open a Terminal Window and type the following:

sudo apt install nemo

If you just want to try Nemo or are looking for option one (adding it as an extra, non-default, File Manager) you are done!  Go try it and see if you like it.

If you do like it and want to make it your Default File Manager open a Terminal Window and type the following three commands one at a time:

xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search

gsettings set org.gnome.desktop.background show-desktop-icons false

gsettings set org.nemo.desktop show-desktop-icons true

You are now completely done.  You have installed Nemo and made it your Default File Manager.  I reset my system after completing this but I don't know if that is totally necessary but couldn't hurt.


To completely undo the changes and remove Nemo from your system, type the following four commands into a Terminal Window one at a time letting each one finish before executing the next one:

gsettings set org.gnome.desktop.background show-desktop-icons true

gsettings set org.nemo.desktop show-desktop-icons false

xdg-mime default nautilus.desktop inode/directory application/x-gnome-saved-search

sudo apt purge nemo nemo*


Monday, November 14, 2022

Installing psensor Graphical Temperature Monitoring App

psensor is a GUI (Graphical User Interface) temperature and hardware monitoring software for Linux.  Since I just build this Linux box a few months ago I wanted to make sure I got the air flow right and everything inside is running cool since this box stays on 24/7. I tried a few command line apps along with with a few other GUI monitors but psensor picked up all my hardware temperature sensors, my CPU, NVME drive, SSD drive, spinning hard drive and video card along with it's fan's RPMs.

Screen shot so you can see if psensor will be useful for you

Let's install it.  Open a Terminal window as we will be doing most of our work from there.

psensor needs a helper app, lm-sensors, so in your Terminal window type:

sudo apt install lm-sensors

Once lm-semsors installs we need to detect the sensors on your system. In your Terminal window type:

sudo sensors-detect

During the detect phase you will be asked about each sensor check before it's done.  Follow the on-screen instructions and enter your answers after carefully reading each question (I just answered YES to all of them). When you are asked to “automatically add lines”, answer YES. Once the wizard is done, reboot your system.

Now let's make sure we are getting readings that psensor will need. In your Terminal window type:

sensors

You should see some output in your Terminal window that looks like this:



Once you're getting some readings we can install psensor so we'll have a nice graphical window display with our temperature sensors listed and we'll be able to change their names so that we know what we're looking at.

In your Terminal windows type:

sudo apt install psensor


This will install psensor.  Once it finishes, you should be able to find a shortcut to it in your SHOW APPLICALTIONS MENU.  Click on the psensor application icon and you should see something like the following:



If you want to name or rename your sensors (right side list) you simple go to MENU-->PSENSOR-->SENSOR PREFERENCE.  This will launch a pop up screen, like the following, which allows you to change the sensor's name.


Just select the sensor that you want to change the name of by clicking on it and then type what you want to called it in the NAME section under the DETAIL tab.  When finished just click OK and your changes will be saved.

When you are done looking at your systems sensors and you click the CLOSE "X" on the psensor window you need to know that it does NOT stop the program.  psensor stays running in the background and puts an icon of a thermometer in your "system tray" area?  (panel? ).  (I couldn't find it's official name in 30 seconds or less so here's a screen shot).


To close psensor completely you have to click on the little thermometer icon and select QUIT.  The reason it stays running is so you can graph your hardware temperature/fan/stress during different operations. 
  
Over all psensor is a nice monitor program that allows you to set the sensor's names to something that will be meaningful to you.




Sunday, November 06, 2022

Configure Geany for Python Programming

I use the GEANY text editor/IDE when I need a quick light weight versatile text editor.  I also use it for writing programming code (Python/PHP/HTML). It's available for Linux (including the Raspberry Pi), Windows, and MacOS. It has too many features to list but it allows plugins and helper apps to run or be launched from inside Geany but you have to install the Apps and configure GEANY to use them.  Since I've been writing Python code lately let's configure GEANY to help us out while coding. I'm running Ubuntu 22.04 LTS with Python 3.10.6 installed (also QT5)


Prerequisite:  You need to have Python 3.x installed and working on your system


Let's install GEANY by running the below command in a Terminal Window;
sudo apt install geany

Once GEANY is installed, let's get it's helper Apps installed by typing the following four (4) commands into a Terminal Window.  Let each command finish before executing the next;

sudo apt install pycodestyle
pycodestyle checks code formatting and style

sudo apt install python3-pyflakes pyflakes3
pyflakes3 checks dependencies and import statements

sudo apt install pylint
Pylint analyses your code without actually running it. It checks for errors, enforces a coding standard, looks for code smells, and can make suggestions about how the code could be refactored.

sudo apt install pep8
This document gives coding conventions for the Python code comprising the standard library in the main Python distribution. 

GEANY only has three configurable menu item (under the BUILD menu)  but you can link those three menu items to bash scripts in order to execute multiple helper Apps.  To do this we need to create a bash file (.sh) with the commands we want the helper Apps to run on our code.

To do this we can use GEANY (lol).  Open Geany and create a NEW file from the FILE menu (or press CTRL n).  Once you have a new blank file open, copy and paste the following bash script into that file and SAVE the file in your HOME directory with the file name CheckPythonCode.sh

#!/bin/bash

# This Bash Script is used by GEANY to check your code for errors
echo "======  pycodestyle  ======"
pycodestyle $1
echo "======  pyflakes3  ======"
pyflakes3 $1
echo "======  pylint  ======"
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" --reports=n $1
pylint -f parseable -r n $1


Now that you've saved the your new bash script file as CheckPythonCode.sh in your HOME directory we can edit the menu items in Geany to do what we want them to do.  Close your CheckPythonCode.sh bash script and create another NEW File (CTRL n).  We are going to make a Python hello_world.py program and we are going to add a few comment lines to the beginning to tell our helper Apps to ignore a few error types.  Here is the hello_world.py code, we need to copy and paste the following into our NEW Blank file in Geany and save it wherever you keep your python code file or just in your HOME directory;

# pylint: disable=missing-module-docstring
# pylint: disable=missing-class-docstring
# pylint: disable=missing-function-docstring

# This program prints Hello, world!
print('Hello, world!')

NOTE:  The added comment lines tell our pylint helper App to ignore the errors missing-module-docstring, missing-class-docstring, and missing-function-docstring, which are just comments describing modules, classes, and/or functions.


Now with our hello_world.py file open in Geany go to the BUILD menu as pictured.


Once in the BUILD Menu, select the SET BUILD COMMANDS option, which will bring up the following popup screen;


We need to make the following changes;  
NOTE: clicking on a button LABEL will allow you to change that LABEL.

Button number 1 (LABEL - Compile) should have the following text in the COMMAND section;
python3 -m py_compile "%f"

Button number 2 (LABEL - Check) should have the following text in the COMMAND section;
~/CheckPythonCode.sh "%f"

Button number 3 (LABEL - Lint) should have the following text in the COMMAND section;
pep8 --max-line-length=80 "%f"

LABEL - Execute, should have the following text in the COMMAND section;
python3 "%f"

If your Buttons don't look like the picture or close to that, you have to make sure you have a python file open in Geany while editing these COMMANDs

You can now Compile, check your Formatting/Style and check your Dependencies/Import Statements for whatever python file you have open and active in Geany.  You can also launch and execute your code that you have open in Geany.  










Wednesday, November 02, 2022

Installing QT5 for Python 3.x Ubuntu 20.04

I built a new Ubuntu box and needed to install Qt5 to go along with Python 3.10.6.  After some googling I found a discussion at GITHUB which had instructions that worked for me.  I'm just documenting what I did so I can repeat the process when needed.  

Open a Terminal Window so that we can install the needed components.  In the Terminal Window enter the following commands one at a time in the order that they appear.  Let each command finish before moving to the next command:  

sudo apt install python3-pip

pip3 install --user pyqt5  

sudo apt-get install python3-pyqt5  

sudo apt-get install pyqt5-dev-tools

sudo apt-get install qttools5-dev-tools


After all five commands above have finished we need to add two lines to the configuration file /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf .   To do this, open the default.conf file for editing by executing the below sudo gedit command in a Terminal Window, then copy and paste the two lines below to the bottom of the default.conf file:

sudo gedit /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf

/usr/lib/x86_64-linux-gnu/qt5/bin
/usr/lib/x86_64-linux-gnu


NOTE: if one or both of these lines are already in your default.conf file do NOT duplicate that line.  Just add the line or lines that are NOT in the default.conf file. 


Now we need to create the uic.py file. To do this open a text editor (like gedit) and copy and paste the below text into the into this new file.  Once you've copied and pasted the below text into the new file we save it as uic.py.  Save the uic.py file to your home directory (I saved mine to a directory called bin in my home directory because bin is in my PATH).  

#!/usr/bin/python3

import subprocess
import sys

child = subprocess.Popen(['pyuic5' ,'-x',sys.argv[1]],stdout=subprocess.PIPE)

print(str(child.communicate()[0],encoding='utf-8'))


Once you've save the uic.py file, open a Terminal Window and navigate to where you saved the uic.py file (probably in your home directory).  Once there we need to change the Permissions on the uic.py file to allow execution.  Use the below command in your Terminal Window to do this. Make sure you are in the same directory as your uic.py file in your Terminal Window.

chmod +x uic.py


Now we need to create a symlink.  To do this open a Terminal Window and navigate to the directory where you saved the uic.py file (probably your HOME directory).  Once there type the following command into your Terminal Window:

sudo ln uic.py "/usr/lib/x86_64-linux-gnu/qt5/bin/uic"


Last we will create a Desktop Link so that Qt5 Designer shows up in your App Menu.  To do this open a text editor (like gedit or geany) and copy and paste the below text into the editor.  Once you've copied and pasted the below text into your text editor save the file as qtdesigner.desktop in the directory  /.local/share/application/ which is located in your HOME folder (you may have to turn on "show hidden folder" in you file manager to see this directory).

[Desktop Entry]

Name=Qt5 Designer
Icon=designer
Exec=/usr/lib/x86_64-linux-gnu/qt5/bin/designer
Type=Application
Categories=Application
Terminal=false
StartupNotify=true
Actions=NewWindow
Name[en_US]=Qt5 Designer

[Desktop Action NewWindow]
Name=Open a New Window
Exec=/usr/lib/x86_64-linux-gnu/qt5/bin/designer


If all went well you should now have Qt5 and Qt5 Designer installed in your Ubuntu 20.04 running nicely with your your Python 3.x. You should also have the Qt5 Designer App list in your App Menu as a click to launch Application.

Hope this helps as it worked for me.  If you run into trouble please visit the link to the GITHUB discussion on this topic.  Like I said this is just a rewrite of information from that discussion.

Monday, September 19, 2022

SNAP Store Won't Update

If you are getting either of these errors 

Unable to update "Snap Store": (null): cannot refresh "snap-store": snap "snap-store" has running apps (ubuntu-software)

or

Pending update of "snap-store" snap close the app to avoid disruptions (7 days left)

Then the snap-store process is running while you are trying to update it.  The snap-store process will sometime start and run in the background even if the you didn't start it. I assume this is so it can check to see if anything needs updated. So to update the Snap Store we need to 'kill' it's process then run the update.  Here's how:

Open a Terminal window and type the following:

sudo pkill snap-store && sudo snap refresh snap-store

If sudo pkill snap-store doesn't work then open the System Monitor and find the snap-store process and force end it.  Then run sudo snap refresh snap-store .

Tuesday, July 12, 2022

Firefox Audio Low Ubuntu 20.04

 About two week ago my Firefox audio was playing but very low or no sound at all.  This was happening on anything with video (Youtube, local news sites, etc.).  When I would bring up the sound settings I would see a separate audio slider for Firefox and it was set to either very low or off.  If you slide the slide up, Firefox would play sound just fine, until you closed it, then, on the next opening of Firefox the volume would be very low again.  

After a few google searches of this problem I found a solution that worked for me.

1.  Open a Terminal Window.

2.  In the Terminal type the following and hit ENTER

rm ~/.config/pulse/*

That's it.  You should now have your sound back in Firefox.  Since this fix remove files involved in PULSE AUDIO (your sound system files) other programs may have the same issues and not just Firefox.  I had about six files in the  ~/.config/pulse/ directory, all of which looked like temp files and one was called cookie.  So if you're having trouble with sound in a app this may fix that too, not just Firefox.

NOTE: My Firefox version is 102.0 (64-bit).

Saturday, June 18, 2022

Ubuntu 22.04 "After Install" Fixes

Some Ubuntu 22.04 "After Install" things that I did. 


1. Install restricted media codecs to play various kinds of audio/video media files

sudo apt install ubuntu-restricted-extras


2.  Access the new screenshot tool that also includes screencasting.

Press the Print Screen Key to take the screenshot


3. Cleaning your system

Use the apt autoremove command to remove unneeded packages (Ones that are not required anymore).

sudo apt autoremove


4. Add AppImage support

In 22.04 AppImage applications won’t run even if you setting the "Allow Execution" file permission. To get them to run, you need to install the libfuse2 library which AppImage files need to run:

sudo apt install libfuse2


This is a quick and dirty post just to get the methods on "paper" before I forget.


Saturday, June 04, 2022

Adding AppImage Apps to a Files "File Association" List

Some AppImage programs don't create file association or don't add themselves as an "Open With" option (in the list when right clicked on).  Let's use XnView as an example;

1.  Created a file named xnview.desktop in your favorite text editor and add the following to it. When done just save it (I wanted a desktop shortcut too so I saved mine in my Desktop folder).  Replace USERNAME with your user name. I also store all my AppImages files in my Home directory in the folder AppImages and all my custom Icons are stored in my Pictures folder in a folder called Icons.  You may need to change the paths in the Exec= and Icon= sections to match your setup.

[Desktop Entry]
Encoding=UTF-8
Name=XnView
Comment=Image Viewer
Exec=/home/USERNAME/AppImages/XnView_MP.glibc2.18-x86_64.AppImage %F
Type=Application
Icon=/home/USERNAME/Pictures/Icons/XnView.png
Categories=Graphics;
MimeType=image/xnview;
Name[en_US]=XnView

2.  Once saved, the xnview.desktop file appeared on your desktop (if you saved it to your Desktop folder).  I right clicked on it's icon and selected the Allow Launching. If you saved your's elsewhere you will have to find it, right click on it, select Permissions and check the "Allow Executing File as a program" tick box.

3.  Opened a Terminal Window and navigated to your Desktop folder (or the location of where you saved your xnview.desktop file) by typing;
cd Desktop

4.  Now copy the xnview.desktop file to  /usr/share/applications directory.
sudo cp xnview.desktop /usr/share/applications/xnview.desktop

5. Now to edit your mimeapps.list file.  Type the following into your Terminal Window
gedit ~/.config/mimeapps.list

6.  Once Gedit opens your mimeapps.list files, we need to add the following line under the section [Added Associations];  
 image/jpeg=xnview.desktop; 

7.  Once done adding the single line, just save your mimeapps.list file and close Gedit.

That's it.  Now when you Right Click on a graphics file you will now find XnView as one of the apps you can use to open that file with.  You can also make it the Default App for opening that file type or just add it to the list of apps that can open that file type. The first time, you may have to pick the "Other Application" option to find XnView or your AppImage App.

I've done this on Ubuntu 20.04 and on 22.04.  Worked on both.

Wednesday, May 25, 2022

AppImage Apps not working on Ubuntu 22.04 (fix)

Ubuntu 22.04 does not included the libfuse2 package by default. The AppImage distribution and most AppImage Apps need the libfuse2 package to function.  So AppImage will not work on Ubuntu 22.04 out of the box.  We need to install the libfuse2 package through a Terminal Window to fix this problem. Just open a Terminal Window and type the following:

sudo apt install libfuse2*

That's it, your AppImage's should now work.  Short and easy!

New Build and Extra Internal Hard Drives - Ubuntu 22.04

 I'm building a new system for Ubuntu 22.04.  My old system is a Core I5 4th Gen. Intel CPU with 16gb ram and an Nvidia Gtx 950. I upgraded it to a 1 TB Samsung ssd main drive with a 2 TB Western Digital sata storage drive. It's a system I build in 2014 so it's time for some new hardware.

My new build is an AMD Ryzen 9 5900x 12 core / 24 thread CPU sitting on an Asus TUF Gaming 570x Wifi Plus motherboard with 32gb of DDR4 ram.  My main hard drive is a Samsung 980 Pro 1TB PCIe Gen 4 x4 NVMe Internal Solid State Drive. For graphics I'm using an EVGA XC Gaming Nvidia RTX 3060.  For a case I got a Fractal Design Meshify 2 Light Tempered Glass with a MainGear 850 Watt full modular power supply. (For anyone looking to do a build, all these parts worked flawlessly with Ubuntu 22.04).  

To have some fun with this build I made a 3 hour road trip to the closest MicroCenter Store.  If you've never been to one it's well worth the time to visit if your a tech/computer geek. The staff was knowledgeable, courteous and went out of their way to be helpful.  

The giant square in the center is the CPU duel cooling fans/radiators

After I got the core system up and running i decided I wanted to add a couple more internal hard drives for storage.  I had a Samsung 1TB 860 SSD sata laying around and I bought a new Western Digital 8TB WD Red Plus NAS Internal Hard Drive HDD - 5640 RPM, SATA 6 Gb/s for about $179.

So let's add a couple of internal hard drives to our new Ubuntu 22.04 box:

The first thing you need to do is to physically install your new internal hard drive and get your BIOS to recognize it.  To physically connect your hard drive to your computer, making sure your computer is powered off and unplugged from the wall.  Once powered off, opening your case and find a location that was made for your hard drive (3.5 inch, 2.5 inch, NVMe socket, etc...).  

  • NVMe drives just plug into their socket at a 45 degree angle, then move the free end towards the motherboard and put it's hold down screw in (Check your motherboard manual for the NVMe socket location).


  • 3.5 and 2.5 inch drives are going to be SATA drives in modern computers.  You will have places inside your computer case designed to hold these kind of hard drives. Usually you will have to use four small screws to attach these drives to your case.  Once attached, you need to connect a SATA data cable from your hard drive to your motherboard (red in picture below).  In addition you will need to connect a SATA power cable from your hard drive to your computers power supply (yellow, black and red in the picture below).  


  • This is just an overview, there are to many cases, hard drives, cables designs to list all the options you may see.  You should watch a few YouTube videos that match your case and hard drive types.

Once your hard drive is mounted and it's power & data cables are plugged into your motherboard and power supply, you can power your computer back on.  Most new computers will flash a message on the screen during boot saying it found a new hard drive. Some will wait for you to press a key before continuing to boot.  On some computers you will have to go into your BIOS or UEFI and manually tell your computer you've added a hard drive. 
If you need help with this step you will need to read your motherboard manual or google your motherboard/computer to find online help with this step.  There are just too many options to cover in this post.  Google or YouTube it! or, god forbid RTFM.

Now that your new internal hard drive is physically installed let's go through the steps you need to take in Ubuntu to get it to recognize your new internal hard drive and let you puts some data on it.  


MAKE A DIRECTORY TO LINK YOUR NEW DRIVE TO

Linux (Ubuntu) needs a directory to link your new hard drive to.   To make this directory open a Terminal Window and type the following commands in red into your Terminal Window. You can and should change drivename to something you can remember (no spaces). I named mine Storage.
sudo mkdir /media/drivename

Once the directory is created we need to change its permissions so we can save, change and delete things on our new hard drive.  To do this type the following into your Terminal Window.  Replace drivename with the same name as you did in the above statement.
sudo chmod 777 /media/drivename

 

We need to create a Boot Table, Partition and Format our new hard drive, for that let's install Gparted.

INSTALLING GPARTED

1.  Open a Terminal Window and type the commands shown in red.

2.  Update your software and libraries
sudo apt-get update
sudo apt-get upgrade

3. Install Gparted
sudo apt install gparted



USING GPARTED

Now close the Terminal Window and open your application Menu and find the GPARTED App we just installed and open it.  It will ask for your password which it will need since we are making hardware changes.

Once Gparted is open you should see your main system hard drive with two partitions (maybe more). The 2nd partition is your SWAP file. 


Click on the drop down box in the right/upper side of the window and select your newly installed hard drive.  It will probably be listed as /dev/sdb  I'm pick /dev/sdc as a sample here.  You can see on my system I have three hard drives and one usb drive in my list. (four total).  /dev/sda is my main drive, /dev/sdb is a 1.82 TB internal hard drive, /dev/sdc is a 4.55 TB internal hard drive, and because I know and based on it's size /dev/sde is a 8gb usb thumb drive.  You'll want to pick your NEWLY INSTALLED internal hard drive (probably /dev/sdb).



Once you have your newly installed hard drive selected, on the MENU click on DEVICE -->CREATE PARTITION TABLE.  



It will popup a dialog box warning you about erasing everything on the selected hard drive. It is serious about the erasure thing so make sure you have your newly installed hard drive selected. In addition, it is asking you to choose a Partition Table Type.  If this drive will only be used with Linux (Ubuntu) You should pick GPTIf you are duel booting with MS Windows, pick MSDOS. Click on the APPLY button making the selected changes. I'm assuming you picked GPT for the rest of this tutorial.




Once the new Partition Table is created on the newly installed hard drive we need to make a new Partition on it. On the MENU click on PARTITION--->NEW


It will then display the Create New Partition sub-window.  Assuming that you want to use the all the room on your newly installed internal hard drive and have it as one big drive and that it will be used for Ubuntu only (not duel boot with windows) do not bother any of the numbers or settings on the left side (your numbers will be different from my example).  All you need to do is give your drive a PARTITION NAME and a LABEL.  You should leave Primary Partition alone and make sure FILE SYSTEM is set to EXT4 (choose FAT32 if duel booting with MS windows).  Once all that is filled out just click on the ADD button at the bottom of the Create New Partition sub-window.  After Clicking the ADD button, you have to click on the Green Check Make icon near the top of the app, just below the menu.  It will ask you to confirm your choices, then bring up a PROGRESS window and finally when it's done you'll get a DETAILS window with a CLOSE button.  Just Click that CLOSE button. 

Once your done creating a new partition you need to format your new drive.  To do this just Right Click on your newly created partition (see image below) then select FORMAT TO from the drop down menu and pick EXT4 (FAT32 if duel booting with MS windows) from the list.  Then click on the Green Check Mark Icon near the top of the app, just below the menu.  It will again ask you to confirm your choices. Then it brings up a PROGRESS window and finally when it's done you'll get a DETAILS window with a CLOSE button.  Just Click that CLOSE button


We are done using PARTED.  You can now close it.  Your hard drive will now show up in your file manager but will not be mounted.  You can click on it to manually mount it for use then click on it's eject button to unmount it when done.  The downside to this is that you would have to mount it every time you boot your system.  To make the new hard drive automatically mount on system boot we need edit the fstab file but we need some information about the new hard drive first.


We need to find the UUID number for your newly installed hard drive.  We need this number to add an entry in your fstab file.  The fstab file is used during boot to mount hard drives, cd/dvd drives, network shares and other hardware you might want to access from/on your machine.  Once added to the fstab file your new hard drive will mount every time your system is starts.

Let's find your new hard drives UUID.  You will need this number and it's long so I suggest that you copy and paste it into a text editor.  It is also case sensitive. 
 
To find your new drives UUID we need to open a Terminal Window and type the following command.
sudo blkid

This will generate a screen that looks something like this (below).  We need the UUID="b224be41-3132-4f17-95a7-e5ae9f6d5245"part without the quotes (").  We will need it to look like UUID=b224be41-3132-4f17-95a7-e5ae9f6d5245 .  Best thing to do is copy the line and paste it into a text editor and delete the parts you don't need including the quotes.  You can just write this long number down or print it to paper and type it in later when we edit our fstab file.  Figuring out which line we need to copy is best done by looking at the LABEL, PARTLABEL and TYPE.  They will be the same as what you set them too when you set them up in GPARTED.



Once you have your UUID we need to edit you fstab file.  We need to be careful here, if we do it wrong our system may not boot.  To open your fstab file for editing we need to use the sudo command because fstab is a system file.  There are two or three text editor we can use but gedit is a nice graphical one. If you want or need to use another, you can just replace gedit with nano or vm (sudo nano /etc/fstab OR sudo vm /etc/fstab) in the below command. The fstab file is just a text file so lets open it for editing 

sudo gedit /etc/fstab

This is a sample my fstab file for reference. Your will look different

Once fstab is open for editing in gedit (or other text editor) we need to add a new entry at the bottom of the file (last line).  Here is the line you need to add.  Replace YOUR-UUID-NUMBER with your new hard drives UUID you got using the sudo blkid command.  You also need to replace drivename with directory name you linked your hard drive to in step one. 

UUID=YOUR-UUID-NUMBER   /media/drivename   ext4 defaults 0 2

If you used fat32 instead of ext4 your entery will look something like this:

UUID=YOUR-UUID-NUMBER   /media/drivename  vfat defaults,user,exec,uid=1000,gid=100,umask=007 0 0

Once you've added the line you need.  Check itThen Double Check it!  I'm serious, check it again.  Get this wrong and you may end up in a "no boot" situation.  If you are sure it's correct, save the fstab file.

Okay let's test it. Open a Terminal Window and type:

sudo mount -a

If you did everything correct after running that last command you should be able to open your file manager and see your new hard drive listed and be able to click on it, showing no files, then right clicking on the empty file list and creating a new folder, then right clicking on the new folder and renaming it and lastly right clicking on the renamed folder and move it to trash or delete it.

If you can make a new folder, rename it, and then delete it, you should be good to go.  You should try copying a text file or picture to the new hard drive and open it, edit it and save it back to the new hard drive.

If you can't do these things, something went wrong.  You should go back and remove anything you added to fstab using the sudo gedit /etc/fstab command and re-saving the fstab file in it's original state.

You would think there would be a better, easier way to do this but I haven't found one yet.






Sunday, February 06, 2022

Adding or Changing Default Aliases

 I wanted to add a shorter ls command to use in the Terminal that showed directories and their contents in the format I wanted to see them in.  I decided that I'd also shorten the command by 50% (well one letter) by using just 'l' instead of 'ls'.  I read the 'man' page for ls and a few trusted websites and finally settled on the following parameters;  

ls -h -F -l -o -g --group-directories-first --color=auto

These parameters when added to 'ls' basically lists the directories first then files in alphabetical order A-Z, show how many files are in the directory, the permissions of the directory/file, the directory/file size, it's creation date/time, and it's name all in pretty colors. 

Once I figured out what parameters I wanted I created a '.sh' shell script file called 'l.sh' and put it in my home directory's 'bin' folder which is also in my PATH.  It worked well but I had to type 'bash l.sh' to get it to work.  While testing I used just the 'l' command a few times and it worked but it did not run my l.sh script file it used something else and it was different from the standard 'ls' command too.  

After some reading I figured out that there was a special file called '.bashrc' and it had sections in it for ALIASES.  The .bashrc file was located in my home folder and can be opened with your favorite text editor.  

I found this section in my .bashrc file which was using the 'l' command I wanted but it had it's own parameters (not the one's I wanted)  

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF' 

So I edited the .bashrc file and replaced the alias l='ls -CF' to my parameters;
alias l='ls -h -F -l -o -g --group-directories-first --color=auto'

I saved the .bashrc file and rebooted the computer (The .bashrc file loads at start up which is why I rebooted, you may not have too but better safe then sorry).  So when I was done this section of my .bashrc file looked like this;

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -h -F -l -o -g --group-directories-first --color=auto'

And just like that I can now just type 'l' (without the ' ' ) and it runs my version of the ls command.  You can also add other alias in this section (my audio breaks sometimes so I have a fixaudio.sh script file that I alias here too, so now I just type 'fixaudio' and my audio fix program executes).  If you are going to do a lot of aliases you can also link to another file you create and add it's file name to a section in .bashrc near this section.


NOTE:  Backup your original .bashrc file before you edit it.  There is other stuff in it, not just the alias section.

 


Wednesday, January 19, 2022

Installing and Updating ClamAV & ClamTK

Virus are becoming more common on Linux Systems.  Why take a chance when there is a nice free antivirus option with little overhead available for Linux, ClamAV.  With it you can control manual or automatic scanning, which directories or files are scanned, signature updates and more.  With the addition of ClamTK you also get a graphical interface. I use both to manually scan directories.

This article will tell you how to install and update ClamAV (Antivirus Command Line App) and ClamTK (Graphical Front End).

Open a Terminal Window and copy & paste the commands in RED into the Terminal one at a time in the order they appear.  Press the ENTER key after each command to execute it.

 

Section One:
How to install ClamAV.

1.  Check for system updates

sudo apt-get update

2. Install all system updates 

sudo apt-get upgrade

3. Install ClamAV and run it as a Process 

sudo apt-get install clamav clamav-daemon -y


Section Two:
Update the ClamAV Signature Database

1. Stop the ClamAV Process

sudo systemctl stop clamav-freshclam

2. Update the Signature Database   

sudo freshclam

3.  Restart the ClamAV Process

sudo systemctl start clamav-freshclam

NOTE: Section Two is how you manually update the ClamAV Signature Database but the graphical interface, ClamTk, will give you an option to automate the Signature Database updates.


If you just want to use ClamAV from the Terminal (Command Line) then you can stop here but if you want a nice Desktop Front End that will give you a graphical interface then proceed to Section Three and install ClamTK


Section Three:
Download the latest version of ClamTK for your distro 

1.  In a web browser go to this site and download the ClamTK installer for your distro (.deb was mine for Ubuntu) 

https://gitlab.com/dave_m/clamtk/-/wikis/Downloads

2.  Once downloaded run the following command in Terminal (command line).  Replace the CHANGE_ME part with the name of the file you downloaded.  (Mine was called clamtk_6.14-1_all.deb so my command was "sudo dpkg -i Downloads/clamtk_6.14-1_all.deb"

sudo dpkg -i Downloads/CHANGE_ME

3.  After ClamTK installs you can run it from the terminal with the command (clamtk) or you use your desktop to start the app by clicking on it.

clamtk

NOTE: From time to time ClamTK will tell you that "Updates Are Available" and only provide you with a button that says BACK that does nothing when clicked. This just means that ClamTK (the Graphical Front End) has been updated.  This isn't related to ClamAV or it's Signature Database  To install the update just repeat all 3 steps in Section Three.  The "Updates Are Available" warning often confused me into thinking that ClamAV needed updated or it's Signature Database needed updated but I have those options set to Automatic Updates.  So when you see this it's just the ClamTK advising that they have updated their graphic front end. Your ClamAV and it's Signature Database are fine and have been doing their automatic updates.    


That's it you're done.  You now have a nice antivirus program for your Linux machine and a little piece of mine.