centos 7 & mysql 5.7 gpg key error proper solution

If you’re running CentOS7 and using the MySQL 5.7 community rpm package you might’ve ran into this error response:

Seems like Oracle has changed their GPG key and it’s not uploaded to gpg servers yet, at least yum can’t find the new key.
So you have to manually replace your key.

Disabling gpgcheck is a very bad idea and should never be done, despite what some chinese blogger suggests for a solution. (https://www.cnblogs.com/minseo/p/15835416.html)
The proper solution is to take the key from the mysql5.7 gpg signature checking documentation page and replace the current contents of /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql with this key.

I will replicate the key here, but be sure to check mysql5.7 gpg signature checking documentation page for the current signature.

DO NOT DISABLE gpgcheck as suggested in the chinese blog.

ionic vue invalid host header solution

You’re doing ionic with vue and are receiving an invalid host header message, black letters on white background.

Create a file vue.config.js in the project root and past this content:

TypeError: Cannot read properties of null (reading ‘length’)

Being the Javascript newbie that I am…
Javascript errors are still a mystery, more so if using Chrome/Chromium.
With Firefox the error was actually more clear.

TypeError: Cannot read properties of null (reading 'length')
means you have a variable that you’re checking it’s property ‘length’ to be a certain value but the variable is null.

Explanation:

In this case localStorage’s ‘urls’ key or rather value of the ‘urls’ key was empty and JSON.parse transformed that to null.
So if you check for urls.length to be greater than 0, you can’t do it and receive this error message.

How do you solve it?

This is the Javascript (and Typescript) way to check if a variable isn’t null and then check its property if it isn’t.
I know, logically this makes no sense, because it’s a logical AND. But hey, it’s Javascript so you don’t have to understand, you have to believe. 😉 HTH