IT: Software Problems / Issues and Solutions (150)

Keywords: HTML, IT, Libre Office, Pi, PiR2, Raspberry, RDC, SQL, Windows-10 ICH180RR

Note: Some of My Other Programming Tips can be found at Web Source 01

Table of Contents



Introduction

The following list of Software Problems and Solutions has been prepared to facilitate my computer life.

Microshaft Windoze: The largest collection of computer problems

(To enlarge .....Click it)
thumb: Windoze.jpg
Windoze.jpg


Problem Definition (and Solution)

1. Problem: RDC: Clipboard stops working

Solution (on Windows machine)
  1. Load up task manager (right click taskbar and select Task Manager)
  2. Go to the Processes Tab
  3. Select rdpclip.exe
  4. Click End Process
  5. Go to the Application Tab
  6. Click New Process
  7. Type rdpclip
  8. Click Ok
  9. There, copy and paste should now work normally again.
  10. ...But couldn't find rdpclip, so restarted RDC and it was fixed.
    Source 1

2. Problem: Raspberry Pi: Non-Functioning "PrtSc" Button

The Raspberry OS does not respond to the "prt sc" key. Instead of using the PrtSc button, on the Raspberry Pi, use scrot in Terminal mode. A better solution would make use of the "prt sc" Keyboard key.

Solution 1
  1. Open a Terminal Window
  2. type "scrot" or "scrot -d5"
  3. ... adding the " -d5" will delay the action by 5 seconds.
  4. ... optionally follow "scrot -d5" by a path & file name
  5. ... the image of the whole screen will be captured and stored
  6. ... by default it will be stored in the /Home/Pi folder
  7. ... by default at 17:03 its name will resemble:
  8. ....... "2021-02-25-170341_1364x768_scrot.png"
Solution 2 Gnome-screenshot
  1. Open a Terminal Window
  2. type sudo apt install gnome-screenshot"
  3. which will install this as an application

Source 2

3. Problem: HTML: Immediate Redirect

When designing a web page using html, a redirect to another webpage can be accomplished using:
< a href=" "> Web Link Name < /a>
but this forces the user to click on the web link. How to do an "Immediate Redirect"?


Solution (in HTML)
Source 3

4. Problem: HTML: Filezilla doesn't work



Solution (on Windows machine)
Source 4

5. Problem: Raspberry Pi: Find IP address of Raspberry on WiFi



Solution (on Windows-10 machine)
Source 5

6. Problem: LibreDraw: How to Control Resolution of Snap-to-grid

when using LibreDraw, the end points of arrows or lines cannot always be aligned with grid points. I feel that the resolution of the grid should be finer. My question is how to change (or set) this resolution before I begin to create the drawing.

Solution (on Windows machine)
  1. Select the menu "Tools : Options... : LibreOffice Draw : Grid";
  2. Make sure that the checkbox "Visible Grid" is checked;
  3. In the section "Resolution", set "Horizontal" to 0.25 '', and set "Vertical" to 0.25 '';
  4. In the section "Subdivision", set "Horizontal" to 2, and set "Vertical" to 2;
  5. Click "OK".
  6. This has been tested and solves the problem
  7. Note, this doesn't work on the Mac.

Source 6 June 28 '20

7. Problem: IT: Copy a "Whole Web Page" Including Its Images

Sometimes one wishes to make a local copy of a "whole web page", (perhaps in case it might disappear at a future date). This can be done on any computer or laptop, even on a Raspberry Pi. It works with the Chromium browser (and perhaps others). It doesn't copy any subpages that are referenced or called, but it converts all such references to external web links. Beware because no local back-up will be made of non-image files. Instead, it converts such references (to non-image files) into external web links. (This prevents an never-ending copy of a chain of web-links that might try to copy almost everything on the web.) If the new local copy of the web page runs in an environment that can access the web, the new local copy functions "perfectly".

Solution (using Chromium)

when using Chromium to view a simple web page, you can make a copy of the web page (including all the images that it references).
  1. Hit ctrl-S.
  2. A submenu might pop up in a small window
  3. If you see the submenu, click on "Save as"
  4. It will suggest a name for the copy of the web page
  5. You can over-ride this name and/or change the target directory
  6. Then Hit Enter or click on the Save button
  7. It will save the html file that defines the web page
  8. It will also create a subfolder for images
  9. ... This folder will have also have the new name
  10. All the local images referenced will be stored in that folder
  11. ... but images referenced as external images will be skipped
  12. ... I have seen it save jpg and png types of images
  13. The images will retain their original names
  14. local non-image files (.txt, .pdf, .html)
  15. ... (their web links will now point to the web).
  16. ... a back-up copy of them will not be made (unfortunately)
  17. This copy of the web page is stored and functions locally
  18. ... and is only one level deep meaning that
  19. ... All of the images will function as local images (not www)
  20. ... All of the web links will all function (as links to www)
  21. ... All of the non-images file types will work (as links to www)
  22. if you click on the html copy of the web page and you are
  23. ... connected to the web, no web-links (www) will work.
  24. -end-

Source 7

8. Problem: IT: How to Backup an SQL Database that is on a Server

Backups are important. But how do I backup my SQL Database that is on my server?

Solution (on a Windows machine)
  1. Dump the SQL database in a format that can be reloaded as a NEW sql database.
    	To backup iGalri.com
    	by D@CC
    	date: 2021DApr23
    	
    	Steps:
    	---------
    	LogIn to Globat
    	Click on MySQL DB
    	Click on  User
    	Click on Database name: dbinfo
    	Clkck on tab: Export
    	Select: Custom-display all possible options
    	Page Down 
    	Click on CSV (Comma Separated Variables)
    	Click on button: Go
    	Select/name the destination folder on the PC eg: 
    	       C:\Users\David\Data\MySQL_2021DApr23
    	Accept filename: dbinfo.sql
    	Watch it download approx 1 record / row  (approx 100 rows per second)
    	Use EditLite to view the file: eg record 1158 is:
    	(2044, 2, 'N', 'N', 'E', 'co0001', 'IMG_4887.JPG', 1619019991, 'David@ColeCanada.com', '', '', '', 0, '', '<h2> PAP Solids Day 2021 </h2> From time to time, perhaps once a year, the solids in the septic tank must be pumped out and taken away.  The septic field at Parc Anderson Park treats only the liquids portion of the sewage.  This year, Solids Day was April 21. <br>  |DKC$date-up2', '', '99B0B0TW001', 1104, 0, 0);
    	-------
    	Then use Filezilla to DownLoad a copy of  ePhotoCaption.com/G/co0001/*.*
    	When it encounters a duplicate file; reply "Skip" for "all future errors".
    	
    	/Backup_igalri.txt
    	
  2. encrypt the file
  3. archive it on an external backup drive
  4. To restore the sql database:
  5. get it from the archive drive
  6. decrypt it
  7. use it to create a new sql database
  8. verify it
  9. done.

Source 8

9. Problem: IT: How do I encrypt a file using a long encryption key

I have researched this previously. I have chosen my definition of a good encryption salt key. It is in a book. What Python software should I use to do the encrypting? Where should I store my long encryption salt key?

Solution (Usually on A Linux Machine)
  1. No well-documented solution yet using Python!!
  2. Use Python3
  3. from hashlib import sha256
  4. etc.

Source 9

10. Problem: IT: How to make a weblink Sensitive to a Place on an Image

Sometimes we wish to make webinks sensitive to places on an image. Here is how to do it. First you choose an image. Then choose a shape (eg circle or rectangle) that is to become sensitive. Then select the coordinates of the shape (relative to the top left corner of the image. Then modify the following code to put your ideas into action.

Here you simply put your image inside a hyper link and use ismap attribute which makes it special image and when the user clicks some place within the image, the browser passes the coordinates of the mouse pointer along with the URL specified in the tag to the web server. The server uses the mouse-pointer coordinates to determine which document to deliver back to the browser. When ismap is used, the href attribute of the containing tag must contain the URL of a server application like a cgi or PHP script etc. to process the incoming request based on the passed coordinates. The coordinates of the mouse position are screen pixels counted from the upper-left corner of the image, beginning with (0,0). The coordinates, preceded by a question mark, are added to the end of the URL. For example, if a user clicks 20 pixels over and 30 pixels down from the upper-left corner of the following image ? Which has been generated by the following code snippet ?

< !DOCTYPE html >
< html >
   < head >
      < title >Image Hyperlink Example< /title >
   < /head >
   < body>
      < p>Click following link
      < a href = "150.html" target = "_self" > 
         < img src = "/images/logo.png" alt = "Tutorials Point" border = "0"/ > 
      < /a >
   /image.html
   < /body >
< /html>

The following "ismap.html" code is used to respond to the "click" anywhere on the image.

< !DOCTYPE html>
< html>
   < head >
      < title>ISMAP Hyperlink Example< /title >
   < /head >
   < body >
      < p>Click following link

< a href = "cgi-bin/ismap.cgi" target = "_self"> < img ismap src = "images/logo.png" alt = "Tutorials Point" border = "0"/ > < /a > /ismap.cgi < /body > < /html >
The following "ismap.html" code is used to respond to the "click" anywhere on the image.
< !DOCTYPE html>
< html>
   < head>
      < title>USEMAP Hyperlink Example< /title>
   < /head>
   < body>
      < p>Search and click the hotspot/< /p >
      < br> < b> rectangle is in top left corner, circle is left of center < /b>< br> 
      < img src = images/html.gif alt = "HTML Map" border = "0"  name="ht" usemap = "#html"/>

      < !-- Create  Mappings -->

      < map name = "html">
         < area shape = "circle" coords = "80,80,20" 
            onMouseOut="ht.src='images/html.gif'" 
            onMouseOver="ht.src='images/c80_80_20.gif'" 
            href = "css/Xcindex.htm" alt = "CSS Link" target = "_self"/>
         
         < area shape = "rect" coords = "5,5,40,40" alt = "jQuery Link" 
            onMouseOut="ht.src='images/html.gif'" 
            onMouseOver="ht.src='images/r5_5_40_40.gif'" 
            href = "jquery/Xrindex.htm" target = "_self"/>
      < /map >
   < br >
   /usemap.html using usemap not ismap
   < /body >
< /html >
This will use the following image ?
(To enlarge .....Click it)

thumb: images/html.gif
images/html.gif



To test image.html click here to run image.html with ismap

To test image.html click here to run image.html with usemap (c and r)

The best way to add each sensitive area to the image is using paint:
    To add a circle, select circle and define it from its top left corner to its bottom right.
          Name an 80,80,20 circle as c80_80_20.gif .
    To add a rectangle, select rectangle and define it from its top left corner to its bottom right.
          Name a 5,5,40,40 rectangle as r5_5_40_40.gif .
    Don't use polygons unless absolutely necessary. LOL
Solution (on Windows machine)
  1. Server Side Image Maps
  2. For more info, click on the link below.
  3. Download any logo.png and html.gif into the /images folder
  4. Download html.gif into the /images folder
  5. Put the ismap.cgi into the 150/cgi-bin folder
  6. In index.html replace "tutorialspoint.com" with "150.html"
  7. Create index.htm and place into the /css folder

Source 10a: HTML Image Links
Source 10b: Highlighting the sensitive area during mousehover
Jason Kleban suggests replacing the whole image during the mouse hover. Not a bad idea: outlining the sensitive area during mouse hover.

11. Problem: Raspberry Pi: Cannot Snap icons into Position on the Desktop

All of the files and folder icons were spread across the middle of the screen in one line. I couldn't move them. For some reason I thought this was a Snap-To-Grid problem

Solution (on Raspberry Pi machine)
  1. sudo apt update
  2. sudo apt install snapd
  3. [Then reboot]
  4. [This solved the problem]

Source 11:

12. Problem: Raspberry Pi: How to find a file somewhere on the Pi

The problem is compounded because I might:
-only know a portion (a subphrase) of the filename e.g. "snap"
-not know the subdirectory
-not know the case of the letters; so use "-iname" not "name"

Issue: the find continues after it encounters something like
find: `./thinclient_drives`: Permission denied


Solution (on Raspberry Pi machine)
  1. in the Terminal window:
  2. cd .. [a few times]
  3. sudo find -iname *snap*
  4. Returns:
    ./Desktop/InstallingSnapOnAPi.txt
    ./allSNAP.txt

Source 12: none

13. Problem: Raspberry Pi: bad folder:thinclient_drives

Xrdp creates a strange directory called thinclient_drives In Ubuntu 18.04, Bionic Beaver, if you are using xrdp for remote access, you may notice a directory called "thinclient_drives" appearing in your home directory. In the permissions it may show a bunch of question marks, which looks scary. There seems to be a bug in xrdp code which attempts to share drives, clipboard and other things. It is creating this directory and not mounting it correctly. Here is how to get rid of it. Edit /etc/xrdp/xrdp.ini. Update the allow_channels setting to say allow_channels=false. After saving the change, remove the spurious thinclient_drives directory. If the system will not allow you to remove it, first unmount it with sudo umount $HOME/thinclient_drives You will not be able to use shared drives, clipboard, and so on, but those do not seem to be working anyway.

Solution (on Raspberry Pi machine)

Source 13 Catch22cats...

14. Problem: Raspberry Pi: Remove a Directory

I want to delete a directory within the current directory
don't use "sudo"

Solution (on Raspberry Pi machine)
  1. dir dir-name
    [to ensure that the dir is in the current directory]
  2. rm -r dir-name

Source 14 na

15. Problem: IT: EditPad Lite: Block Text Mode

Sometimes, when editing a text document, one wishes to insert, delete or change a whole rectangular block of text. Simply do this:

Solution (on Windows machine)

Source 15

16. Problem: IT: Insufficient GMAIL Space

Google and Apple both provide storage space up on the internet for us, but only a limited amount of free space. Apple backs up our iPhone to the Internet. When the Apple free space is full (usually with copies of iPhone pictures), Apple asks us to pay for more storage space. It is difficult to manually manage this space. Apple will charge $2 /month. Google keeps a copy of all of our gmail up on the Internet. When the Google free space is full (usually with video attachments to gmails), Google asks us to pay for more storage space. But it is easy to manage this space. It is especially easy to delete all emails with attachments larger than 10 Meg. The instructions below explain how to do it.

Solution (on Windows machine)
  1. Go to a Windows PC
  2. Sign in to gmail,using your gmail address and your gmail password
  3. In the searrch box , type in: Size greater than 10 MB.
  4. If you have emails bigger than 10Megabytes, they will be listed
  5. Click on each one (or click on the box above to select all 50)
  6. Click on the littele garbage can to delete them
  7. Keep doing this until you have deleted them all
  8. You should now have lots of free space
  9. Sign out of gmail.

17. Problem: Pico: can't import name RTC

Issue:
When I boot my pico, the shell says:
WARNING: Could not sync device's clock: can't import name RTC
WARNING: Could not validate time: can't import name RTC
NOTE This does not prevent the pico from functioning


Solution (on Raspberry Pi machine)
  1. Refer to the Source 17
  2. Apparently that fixes this issue.

Source 17

18. Problem: Need a Cross-Computer Clipboard

When using multiple computers, sometimes it is necessary to copy-n-paste text from one machine to another. Two solutions exist.
1. Between Windows 10 and Raspberry Pi
Use Remote Desktop Connectionto control the Raspberry,
then simply ^-C and ^-V as usual
2. Between any two computers that can run Chrome or Chromium
Use google-Docs to Create a temporary document on the cloud.

Solution (using Chrome browser)
  1. Type "Document" in the URL fileld
  2. Click on "Sign-in - Google Docs"
  3. Either Click on File-Open-Documents
    then select an existing file
    or
  4. . . . .Click on File-New
  5. Type "MyKeep" on the bottom line (to record the file name)
  6. Click on File-Rename (and accept "MyKeep" as the new name )
  7. Copy and Paste anything (even html links) into the Google Document
  8. Go to the other machine and access Google Docs
  9. Copy and Paste it there
  10. From time-time archive it to:
    file:///C:/Documents/2021/GoogleDocs/MyKeep_2021EMay11.txt

Source 18

19. Problem: How to Hide Folders from Public



Solution (on Internet) If you hide the root directory, then no one will be able to access anything in that folder including images and other media. Yes create an .htaccess file inside the directory you wish to deny access to. Enter the following:
  1. order allow,deny
  2. allow from 127.0.0.1
  3. deny from all

Source 19: Hide Root-Page

20. Problem: How to selectCode to copy Code Segment

How to display software code on a web page, allowing the user to "selectCode" to copy it.

Solution (in html code) Use a snippet of the body of the following html code
< !DOCTYPE html>
< html>
< body>

< p>Click on the button to copy the text from the text field. Try to paste the text (e.g. ctrl+v) afterwards in a different window, to see the effect.< /p>

< button onclick="myFunction()">selectCode< /button>< br>

< textarea id="multiliner" name="multiliner" rows="10" cols="60">
line1
line2
line3< /textarea>

< script>
function myFunction() {
  var copyText = document.getElementById("multiliner");
  copyText.select();
  copyText.setSelectionRange(0, 99999)
  document.execCommand("copy");
}
< /script>
< br>
Example:

1. Insert the code between the textarea tags.
2. If it is HTML code, you must replace each "<" with "&lt;".
3. User can click on the bottom right hand corner to expand the code window.
4. User clicks on the "selectCode" button to copy the text from the text field.
5. Try to paste the text (e.g. ctrl+v) afterwards in a different window, to see the effect.
6. You can also define attributes of rows, cols, etc



Source 20: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_copy_clipboard

21. Problem: How to Install Bluetooth Device on RPi



Solution (on Raspberry machine)
  1. to be verified

Web Source 02

22. Problem: Raspberry Pi: How to use Python Libraries

Programming is made easier when libraries of code are available. Any programmer should create and maintain a library of his/her commonly used routines. An example is the personal IX Library that is being prepared for my Pi and Pico coding. Article 155 (Web Source 03) describes where a library should be placed and how to use such a library.

Solution (on Raspberry Pi machine)
  1. Modules (even test modules) should be properly named.
  2. Commonly used routines should be placed in libraries
  3. Subroutine or Functions used by only one program should be in the program's folder

Web Source 03

23. Problem: Raspberry Pico: What's in the main.py module

The Pico has a very limited folder structure. In fact all modules are in the root, and no folders are allowed (as of 2021FJun20). Before starting up the Pico, the human should plug some headphones or an external speaker into the pico or attach a LED panel. When a pico starts up (outside of Thonny) it looks for a module called "main.py" and starts up that module as the first program. My recommendation is that this main pico program should blink the pico's main green led twice two times: "blink-blink" then "blink-blink" again. If a Cytron Maker Pi Pico accompanies the Pico, the buzzer should beep with the blinks. The human should interpret this as "22" meaning button 22. The human should acknowledge this by pressing the Pico-Button 22 once. This main module should have a short menu. The Pico should then display and/or speak the menu, item by item. When the human hears the desired submenu item he/she should press (i.e. click) the pico-button on GP22 once meaning "Yes" or "Acknowledge". When answering menu questions, a double-click of the pico-button means "No-No" or "No Sir!". To function satisfactorily, the Pico doesn't need a keyboard nor a mouse. . . . . just the Pico-Button-22 or a jumper to touch GP22 to ground on the Pico.

The pico is often used to provide an ADC (Analog to Digital Converter) for the Raspberry Pi. If this is the case, the Pico should begin sampling the main ADCs. The Pico should send each sample to the Raspberry by a serial port. The format of each sample is defined by the RAPasc protocol. The RAPasc means "Readings ADC with Periods (using 7-bit ascii characters). The protocol for the serial transmission between the Pico and the Raspberry Pi is called the pktix Protocol, which means the "Packet-9" communications protocol. Each message is sent in a series of packets between the Pico and the Pi processors. These two protocols have been defined in more detail elsewhere in these articles (see Web Source 04).

Solution (on Raspberry Pi and Pico machines)
  1. Pico To Pi Communications:
  2. A program called "main.py" containing the "picoLe-22" menu must be on the Pico.
  3. The main.py on the Pico should call the "pktixTx_pico.py to send the ADC samples.
  4. The Pico will already be sampling the ADCs and sending the readings to the Pi.
  5. Each reading includes the numerical sample and the time.
  6. Any program on the Pi wishing to read the Pico ADC must call "pktixRx_pi.py.
  7. This never-ending stream of ADC samples can be used at any time by Pi software.
  8. In the future, the Pi will be able to request Pico information using the serial ports.

Source: Pix - Interpretive Ascii Protocol for Pi Control of a 2040 (177)

24. Problem: What is Python gmtime?

"gmtime" is a Python function in the Python module "time" which can be imported on a Raspberry Pi or Pico. It returns the current (non-local) mean time in Greenwich, England. This time is used as a global standard time, and does NOT change with DayLight Saving time (DST). People in Greenwhich, England do use DayLight Saving time. In Ottawa EST, we also use DayLight Saving time, so EST is 5 hours earlier than a clock on the wall in Greenwich. But during DayLight Saving time, from Spring to Fall each year, EST is 4 hours earlier than gmtime. To get the local time here in Ottawa (which takes DST into consideration, of course), use Python localtime function after importing the time module. When logging information, the timeStamp should use the gmtime function.

Solution (on Raspberry machine)
  1. timestamps using gmtime:
  2. import time
  3. timeStamp=time.time()
  4. print("The unix GMT time number now is:"+timeStamp)
  5. print("local date/time:"+localtime())
  6. print("gmtime date/time:"+gmtime())
  7. print("Google Home says that the time in Greenwich is 1 hour earlier.)

Source XX

25. Problem: What did Python import

After using an "import" statement in Python, how can we list the modules etc. that were just imported. After "import time", simply code "dir(time)" to see the list of functions, entry points etc that were imported. Note that the Pico time module imports a smaller number of functions than the Pi time module.

Solution (on Windows machine)

Source XX

26. Problem: Python: If all else fails. . .

When debugging Python code that has defined functions, and your function doesn't seem to be executing, no matter what changes you make. . . the changes seem to be ignored. Well, Python doesn't warn you that the same function name is defined twice. You can change one of them, but the other continues to run unchanged.

Solution (in Python code)
  1. Search for 2 copies of the same function definition.
  2. Maybe you are changing one copy. . .
  3. But the other copy is always run. . .
  4. That just might be the issue.

Source XX

27. Problem: Python: How to Use a Formula, Not a Conversion Factor



Solution (in Python)
  1. Define and Use A Function of a Single Variable:
  2. In Python function: def convert(a, 20.0):
  3. def convert(a,c):
  4.   b=a*c
  5.   return b
  6. will return the first parameter converted by multiplying it by 20.0
  7. the conversion function is "a*20.0"
  8. but if the conversion formula is (a-5.0)*20.0
  9. define the formula function
  10. def formula(a):
  11.   b=(a-5.0)*20.0
  12.   return b
  13. then change convert
  14. def convert(a,func):
  15.   b=func(a)
  16.   return b
  17. answer=convert(7.0,formula)
  18. print(answer)
  19. will produce
  20. 40.0

Source XX

28. Problem: Which Python Libraries Did I Create



Solution (on Raspberry machines)
  1. See 155 PiIX.py Library (My Python Functions)
  2. (in Web source 05 below)

Source 05: 155 Pi: PiIX.py Library (My Python Functions) by David Cole on 2021 F Jun 23

29. Problem: Use French accents throughout a webpage



Solution (on Windows machine)
Be sure to include the character set citation in the < head > tag
  1. < head>
  2. < meta charset="ISO-8859-1">
  3. < /head>

Source 06: Using Unicode for French Accents by w3schools on 2022

XX. Problem:



Solution (on Windows machine)

Source XX

XX. Problem:



Solution (on Windows machine)

Source XX

External References

Books/Newspapers

Books/Newspapers 1: none

YouTube Videos

Source V01: na by on

Web Sites

Web Source S150:01: www No Known Source
Web Source S150:02: Adding_BT_SPEAKER.txt
Web Source S150:03: 155 Pi: PiIX.py Library (My Python Functions) by David Cole on 2021 E May 29
Web Source S150:04: 165 Pi: The Mak Pi ADC by David Cole on 2021 F Jun 20
Web Source S150:05: 155 Pi: PiIX.py Library (My Python Functions) by David Cole on 2021 F Jun 23
Web Source S150:06: Using Unicode for French Accents by w3schools on 2022

WebMaster: Ye Old King Cole

Click here to return to ePC Articles by Old King Cole

Created 2021 A Jan 08
Updated 2024 F Jun 28

(c) ICH180RR Corp

/150.html