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
Open a Terminal Window
type "scrot" or "scrot -d5"
... adding the " -d5" will delay the action by 5 seconds.
... optionally follow "scrot -d5" by a path & file name
... the image of the whole screen will be captured and stored
... by default it will be stored in the /Home/Pi folder
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)
< html>
< head>
< title>redirect to Web Link< /title>
< meta http-equiv="refresh" content="3; url = http://ephotocaption.com/a/ePCArticles.html" />
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)
Select the menu "Tools : Options... : LibreOffice Draw : Grid";
Make sure that the checkbox "Visible Grid" is checked;
In the section "Resolution", set "Horizontal" to 0.25 '', and set "Vertical" to 0.25 '';
In the section "Subdivision", set "Horizontal" to 2, and set "Vertical" to 2;
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).
Hit ctrl-S.
A submenu might pop up in a small window
If you see the submenu, click on "Save as"
It will suggest a name for the copy of the web page
You can over-ride this name and/or change the target directory
Then Hit Enter or click on the Save button
It will save the html file that defines the web page
It will also create a subfolder for images
... This folder will have also have the new name
All the local images referenced will be stored in that folder
... but images referenced as external images will be skipped
... I have seen it save jpg and png types of images
The images will retain their original names
local non-image files (.txt, .pdf, .html)
... (their web links will now point to the web).
... a back-up copy of them will not be made (unfortunately)
This copy of the web page is stored and functions locally
... and is only one level deep meaning that
... All of the images will function as local images (not www)
... All of the web links will all function (as links to www)
... All of the non-images file types will work (as links to www)
if you click on the html copy of the web page and you are
... connected to the web, no web-links (www) will work.
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)
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
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?
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.
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)
Server Side Image Maps
For more info, click on the link below.
Download any logo.png and html.gif into the /images folder
Download html.gif into the /images folder
Put the ismap.cgi into the 150/cgi-bin folder
In index.html replace "tutorialspoint.com" with "150.html"
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
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
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.
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)
Go to a Windows PC
Sign in to gmail,using your gmail address and your gmail password
In the searrch box , type in: Size greater than 10 MB.
If you have emails bigger than 10Megabytes, they will be listed
Click on each one (or click on the box above to select all 50)
Click on the littele garbage can to delete them
Keep doing this until you have deleted them all
You should now have lots of free space
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
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)
Type "Document" in the URL fileld
Click on "Sign-in - Google Docs"
Either Click on File-Open-Documents
then select an existing file
or
. . . .Click on File-New
Type "MyKeep" on the bottom line (to record the file name)
Click on File-Rename (and accept "MyKeep" as the new name )
Copy and Paste anything (even html links) into the Google Document
Go to the other machine and access Google Docs
Copy and Paste it there
From time-time archive it to:
file:///C:/Documents/2021/GoogleDocs/MyKeep_2021EMay11.txt
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:
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 "<".
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
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)
Modules (even test modules) should be properly named.
Commonly used routines should be placed in libraries
Subroutine or Functions used by only one program should be in the program's folder
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)
Pico To Pi Communications:
A program called "main.py" containing the "picoLe-22" menu must be on the Pico.
The main.py on the Pico should call the "pktixTx_pico.py to send the ADC samples.
The Pico will already be sampling the ADCs and sending the readings to the Pi.
Each reading includes the numerical sample and the time.
Any program on the Pi wishing to read the Pico ADC must call "pktixRx_pi.py.
This never-ending stream of ADC samples can be used at any time by Pi software.
In the future, the Pi will be able to request Pico information using the serial ports.
"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)
timestamps using gmtime:
import time
timeStamp=time.time()
print("The unix GMT time number now is:"+timeStamp)
print("local date/time:"+localtime())
print("gmtime date/time:"+gmtime())
print("Google Home says that the time in Greenwich is 1 hour earlier.)
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.
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)
Search for 2 copies of the same function definition.