Google Search keeps saying “Mobile data is off”

I have Wifi and 4G data turned on but Google search returns with a message that says –
“Mobile data is off: No data connection. Consider turning on mobile data or turning on Wi-Fi”.

There is working Internet connection because I can search directly from the browser, other apps can connect or download. Only gets stuck with that message using Google Search app on Android.

ANSWER

When this happens, there are a few things that can help fix this issue.

First, is to restart the Android phone.

If restarting does not fix it, then the second thing is to turn on Airplane Mode. Wait a few seconds before turning it off.

However, if after doing either of the above, or both, that still doesn’t fix Google app from being able to connect to the Internet properly then the last resort is to clear its data and cache.

Go to Settings > Apps > Google.

What you need to look for is Storage related. There should be a Manage Storage > Clear All Data setting, and Clear Cache setting. These are separate buttons. Proceed by deleting cache first, then data. Clearing of cache and data only affects the device you are on. Google has most, if not all, of that information on their servers anyway. You won’t really lose anything. The app will sync back as soon as it’s connected.

Once done try using Google app again and search for something.

Should all else fail, reinstall the Google app. Chances are your Android won’t have permission to uninstall the app itself, only to rollback to previous versions, although there is an uninstall button in Google Play Store for said app. Do it anyway. Then update the app. If the phone is rooted, you just might be able to do a complete uninstall/install.

Install app latest version with Ubuntu Snap

I want to install application most recent version on Ubuntu. With this command snap refresh <app name>, but it doesn’t work.

Getting a ‘snap “<app name>” has no updates available’ message instead.

There is a higher version from snap info <app name> for example below.

channels:
  latest/stable:    12.5 2021-09-23 (50) 516MB classic
  latest/candidate: ↑                          
  latest/beta:      ↑                          
  latest/edge:      12.5 2021-09-19 (50) 516MB classic
  12.0/stable:      12.0 2020-06-12 (30) 462MB classic
  12.0/candidate:   ↑                          
  12.0/beta:        ↑                          
  12.0/edge:        ↑                          
  11.0/stable:      11.0 2019-09-04  (6) 399MB classic
  11.0/candidate:   ↑                          
  11.0/beta:        ↑                          
  11.0/edge:        ↑       

What I need do to force the update to latest version?

ANSWER

If you look at the “tracking” value after the snap info command, you will see the channel the app is currently on.

That’s the same channel listed in the “channels” information. To get that latest version you want, change the channel accordingly. Let us say you are at 12.0/stable now. You want to download and update to 12.5. That means you need to change to latest/stable channel in this case.

For that we will need to add an option that is --channel=<channel name> to change the target channel.

The command it will look like this in the terminal:

:~$ snap refresh <app name> --channel=latest/stable

This will immediately begin the download process to update to that version of that channel specified.

Add sudo optionally. Optional because Ubuntu will prompt you for your password if you don’t. A pop-up dialog window will appear for you to enter the password.

Is my PC Windows 11 Compatible?

How do I know if my computer of Windows 10 can be install to Windows 11? Will it immediatly update to the new Windows 11 version if yes? I have checked updates and installed all. However I am still got Windows 10. Nothing pops out to say I want to install Windows 11 or not. So a lot of people are saying about compatible hardware. How to check mine compatible?

ANSWER

A lot of PCs with Windows 10 running on it fail on the TPM 2.0 requirement part, although these are fairly capable machines. Even newer ones that are more than powerful enough (e.g. gaming machines) that don’t have the required TPM version so those fail the compatiblity check too. TPM is Trusted Platform Module and Microsoft’s minimum requirement for Windows 11 is version 2.0.

Then there is also the supported processor (CPU) where a number also fall short on with older hardware.

With the impending release of Windows 11, a lot of information has been thrown into the Internet leading up to the release date set on Tuesday – October 5, 2021. Which can be quite confusing with all that fanfare especially about the TPM 2.0 confusion.

There are a few things you can do to determine compatiblity from Microsoft. Read the official minimum system requirements – https://www.microsoft.com/en-ph/windows/windows-11-specifications#table1 – which is provided by Microsoft for Windows 11 compatibility. There is also a link there on how TPM 2.0 might be enabled on your machine.

You can also read more about the Windows 11 upgrade at the following official Microsoft pages:

  1. https://www.microsoft.com/en-ph/windows/windows-11#pchealthcheck
  2. https://blogs.windows.com/windows-insider/2021/08/27/update-on-windows-11-minimum-system-requirements-and-the-pc-health-check-app/

If you do not want to read through all that content, Microsoft has also provided a quick way to check for Windows 11 compatiblity via a PC Health Check app. Download, install and then run the tool to get the results. It is only a few MB in size. Download link here: https://aka.ms/GetPCHealthCheckApp or you can also find the same information in #1 link in the list above (If you’ve only read it, right?).

Good luck!

A way to stream Netflix in Nintendo Switch?

Is there a way to install custom app that can play Netflix on my Nintendo Switch, much like those unverified sources installation approach on Android?

I read there is easier way through “secret browser” to play Netflix. But many comments say it does nt work.

ANSWER

Short answer is – NO / None / Nada.

Unless, you install Android on or jailbreak it. The former means you’ll be technically booting to Android system. The latter is much more like what you probably have heard of people jailbreaking their iPhones, then run apps that were not supposed to be playable on the device.

Both are risky. It can cause irreversible damage to your Nintendo Switch. And you’ll end up with what they popularly call as a bricked device. Just an expensive paperweight on other words. The choice is yours. Read and understand thoroughly before you decide to go ahead. If you like to tinker then this should be a fun exercise.

The other claim that you can “play Netflix” on a browser on the Nintendo Switch without doing anything overly technical is only half true. Yes there is that so called secret browser that you can force to show and use much like you would a browser on your Mac or phone. It involves manually setting an IPv4 address as DNS in your Switch’s Internet connection settings.

While you can logon to a Netflix account or browse the catalog, that’s about all you can do there. When you start playing a movie Netflix will say the browser does not support the minimum requirements for streaming the content.

So you are left with a browser, that is awkward and clunky to use.

Don’t bother!

Get a tablet instead if you want a portable device for watching movies on the go.

Identify Songs Playing Using Smartphone

What nice and safe apps are there that I can install on iPhone or Android to identify songs playing from another source? Preferable to have no ads, unlimited use and free of charge.

ANSWER

A few years back when I was in that apps discovery phase on my Android and installing as many as I can even when those apps would hardly ever be used after the first try, I came upon Shazam. Was impressed by it. It was able to ID the songs quite accurately. It sometimes took a while, a few longer seconds, sometimes but it normally was able to pick up and tell me the song title and artist. The sound quality it is listening to also is a factor for proper identification. It did have some success on getting the songs right in a public place, like a bar or a cafe, where music was playing loudly and a lot of other noise around.

There are many sound discovery or music recognition apps out there for both Android and iPhone. I have heard of SoundHound or Musixmatch.

I have not used such apps for a long time. Shazam was free when it came out. No ads then. I might have installed it again years after, and as I recall the UI changed this time with ads too. But I could be wrong. It might have been a different app. SoundHound, Musixmatch and Shazam come with free and paid versions. Whether these apps have limited use for free versions, you can find that out or DON’T.

Try out those 3 apps, OR you don’t really have to go to all the trouble. Google Assistant on Android can do the same magic. Just ask it, “Which song is this?”. Type it or say it. Better the latter. I have done it several times, for example while driving and listening to a local FM radio station.

Apple’s Siri can do the same.

Alternative to Cron

For Linux systems what is a good alternative to cron?

ANSWER

(1) systemd

A lot of Linux distros are already using systemd. I’d say the major ones have been on systemd for a long time. It is capable of scheduling tasks just like cron, and has other features such as setting CPU/memory limit, randomized schedules to name a few. I haven’t used it yet. But I’ve seen some and creating a task is very different from what you may be used to with your traditional cron. It’s verbose. The good thing is there’s a lot of examples and documentation about it, plus it is built-in to your Linux system already.

(2) jobber

There’s an alternative to cron that I like to use called jobber. You can find it here: https://dshearer.github.io/jobber/

Quoting from the jobber website:

Jobber is a utility for Unix-like systems that can run arbitrary commands, or β€œjobs”, according to a schedule. It is meant to be a better alternative to the classic Unix utility cron

I’ve used jobber several times in little projects and some even in production. It is pretty robust and stable. As with anything new, using it requires some reading. The time format to schedule a task, or job, in jobber is not at all different from cron. It has other features such as error handling and reporting, as well as execution history.

jobber tasks are defined in a YAML file. That file can be placed in a user’s home directory. It’s not so hard to create a task for jobber. Their site has a good documentation found here: https://dshearer.github.io/jobber/doc/v1.4/#

There are pre-packaged binaries officially available to download for Debian/Ubuntu, and Red Hat. Or check your Linux distro’s application repository if it’s there. If not you could always compile it yourself. The last time I used this tool I also compiled it on the server. Easy to do that, and is explained also at their website.

Getting an MYSQLDump error

I upgrade MySQL DB from 5.6 to 5.7 version not too long now with no issues happened after. But at that time I did not use mysqldump command. Now I tried to backup the database and gettting this error message:

mysqldump: Error: ‘Access denied; you need (at least one of) the PROCESS privilege(s) for this operation’ when trying to dump tablespaces

How to fix this error.

ANSWER

The PROCESS privilege requirement was added only in MySQL version 5.7.31. This is an expected behavior and affects mysqldump utility. There is a report here and some discussions –

https://bugs.mysql.com/bug.php?id=100219

If your user has no admin privilege to the MySQL database, the quick workaround is to add the –no-tablespaces option. The usage like below.

mysqldump --no-tablespaces -u user -p DB_NAME > BACKUP_FILE.sql

On the other hand, if you have admin access, then grant that user the PROCESS privilege like this:

GRANT PROCESS ON *.* TO user@localhost;

Be warned that such privilege is usually reserved for server administrator users. It works on a global context, so it cannot be specified on a per database approach. Granting just any user this PROCESS privilege is not a good idea. It may cause “data leaks” when sensitive queries gets exposed because this privilege can allow a user to see queries being executed in active sessions. This becomes more critical when the server instance is shared.

Accidentally deleted all in Git branch

HELP! What to do?

I made first commit. Noticed a file that is not supposed to be save with sensitive values. Did not want to get the history for this one file in there, that would be viewable still.

Proceed to revert that first commit, thinking it will go back when no files was committed.

All files are gone now as result! I cannot find in my project folder even recycle bin.

ANSWER

First commit? But you want to undo for a file or two? Easy peasy. No need for revert. It’s only 1 commit! Then you would not have been in this trouble you are now.

Delete the .git folder! Mind you this is before you should have done any git voodoo. Re-init git, add files, then commit. Then you’re done. You’re back in business without having so much down time.

Now going to the other solution. I have encountered this before like you. The files are still there. So to speak. Git knows it, since it has the history for that action. A simple git log will prove.

Normally, you can pick the files back one by one simply by using the checkout command. But first, get a list of these files, including full path to it. This will show all the files that have been affected or deleted in your case.

git status

THEN

git checkout path/to/filename

For a few files, this approach works. Not very convenient when you have dozens to hundreds of files to recover. This may be your situation too. For some reason, using a wildcard will not work.

git checkout *
git checkout path/to/*

It executes but does nothing.

Sometimes commands like below will do the trick. Or it won’t. YMMV. But may be limited to *NIX-compatible OSes. For Windows, use Git Bash for one.

git ls-files -d | xargs git checkout --

In my experience, I did the following steps in git.

git log
git checkout COMMIT_ID
git commit -m "Restore my files"
git checkout master

The first command is to get the commit ID.

Second is to checkout at that commit. Now you’ll be in limbo. You’re not back at master branch where you started out. Instead this checkout will be outside of master. You’ll see a message such as

HEAD detached at COMMIT_ID_SHORTENED

This is all good. Don’t worry. Just commit those files again. That’s the third command up there.

Then once done, checkout to master. The last command shown up there.

If for some reason there are files that conflict, the switch to master branch won’t succeed. Just add those conflicting files too.

git add path/to/file/name
git commit -m "Some more files"
git checkout master

Now all is good. Look at your folder. All files are there again.

Auto-create MySQL Database in Java

Many Java / JDBC / JPA examples show only how to create DB table(s) if not existing. Like putting the table defintion or DDL in a .sql file, where the program can pick it up and execute on run-time.

But not with the database itself.

How can database be created on the fly?

ANSWER

With JDBC this can be done as a parameter to the URL connection string.

In the example shown below –

datasource.url=jdbc:mysql://localhost:3306/SCHEMA_NAME?createDatabaseIfNotExist=true

The parameter (comes after ?) – createDatabaseIfNotExist – must be set at value of true.

As I recall, this works only after MySQL version 5.1.

Note: SCHEMA is MySQL speak for database. It is common to call that even with other products. Other databases or code implementations may also term it as CATALOG.

Create Fat .gitignore in Intellij

Rather than create my .gitignore file by hand or copy from a previous project, I do not prefer this method. Is there a quicker way to generate the .gitignore file with many of the things I don’t want to be tracked by Git to be included in it.

ANSWER

Intellij IDEA

Plugin: https://plugins.jetbrains.com/plugin/7495–ignore/

Add that to your Intellij IDEA app. There is a button in that page to automatically download and install this plugin. Make sure the Intellij app is running before hitting that button.

Or you could simply download, then install manually. Select the Versions tab in the plugin page. Choose the version you want to download. Find the zipped file in your “downloads” folder.

To install manually, head over to: Settings > Plugins > (gear icon) > Install Plugin from Disk

The gear icon might be different with other versions of IntelliJ.

The plugin should be activated already, not needing an app restart.

Eclipse

For Eclipse, I’m not sure of a plugin that has pre-defined lists. I can right click on a folder/file and add to .gitignore (Team > Ignore), is what I did before. Haven’t tried an Eclipse Marketplace search.

Visual Studio Code (VS Code)

Click extension then type in “gitignore” in the search box. Look for the extension by CodeZombie. Versions as of this writing is 0.7.0.

To use, do the following:

Start command palette (with Ctrl+Shift+P or F1) and start typing Add gitignore

Other

Another way is to go to gitignore.io OR github.com/github/gitignore and get a generated .gitignore template from there. Search/select the application, OS you want. Then copy/download the generated templates.

Fatal: Refusing to Merge Unrelated Histories

fatal: refusing to merge unrelated histories

I get this error every now and then. This happens when I created a new branch first right after a new Git project was started (by me), without bothering to base it from the Master branch. The reason is the lack of permission/access to being able to write or put anything on the latter branch.

Rather than waiting for someone to kick off the Master branch, I just go ahead and start my own branch as I’ve mentioned earlier. Later on, somebody from the team who has write permissions to Master, starts a README file just to initiate it. Thus the “unrelated histories” issue happens from then on. Two branches that started off independently from each other and with no common base.

The issue appears when I want to merge my branch to Master. Git will say my branch is behind on commit on the branch it will be merged into. If I try to merge it, it gets rejected. The pipeline also won’t allow for merge conflicts like this, and advises me to fix it first.

ANSWER

As I recall, this behavior started after a certain Git version only. This to avoid to unnecessarily create a parallel history being merged into the project, because a previous merge happened between to branches that didn’t have a common base.

I’ve used Git’s “–allow-unrelated-histories” option to fix this problem. I’ll do this via command line.

Pull the Master branch into mine with the option above included.

Fix the merging conflict.

Commit the changes.

Push to remote repository.

Then this time the merge request to Master will not warn that my branch is behind a commit.

Others have commented saying that rebasing also does the trick for them. I do not recall having gone that route though.

The paragraph is green. Why?

I came across this sort of “CSS riddle” recently.

It goes something like this.

Given this CSS definition,

body {
  max-width: 28em;
  margin: auto;
  padding: 1em;
}

html {
  --color: green;
}

body {
  color: yellow;
}

p {
  --color: inherit;
  color: red;
  color: var(--color, blue);
}

what would be the color of the <p> element?

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent bibendum, lorem vel tincidunt imperdiet, nibh elit laoreet felis, a bibendum nisl tortor non orci. Donec pretium fermentum felis, quis aliquet est rutrum ut. Integer quis massa ut lacus viverra pharetra in eu lacus. Aliquam tempus odio adipiscing diam pellentesque rhoncus. Curabitur a bibendum est. Mauris vehicula cursus risus id luctus. Curabitur accumsan venenatis nibh, non egestas ipsum vulputate ac. Vivamus consectetur dolor sit amet enim aliquet eu scelerisque ipsum hendrerit. Donec lobortis suscipit vestibulum. Nullam luctus pellentesque risus in ullamcorper. Nam neque nunc, mattis vitae ornare ut, feugiat a erat. Ut tempus iaculis augue vel pellentesque.</p>

Source: https://codepen.io/shshaw/pen/wvJmOOq

ANSWER

The output color is Green. As if the title wasn’t a giveaway.

Try it out yourself too.

Here is an explanation: https://twitter.com/SelenIT2/status/1400832345016606722

Quoting from that Tweet:

It does inherit it. But then the color gets overridden with the inherited value of the *custom property* named `–color`, which doesn’t know anything about the actual `color` property and gets independently inherited all the way down from `html`

What Password Managers available in Linux

List of Password Managers that are available in Linux?

Aside from BitWarden. I want to know some alternatives you guys are using. Prefer it’s standalone program instead of browser plugin or extensions.

ANSWER

I am using KeePassXC personally for some time. 1Password for work-related stuffs.

The first one is a KeePass variant and open-source. It has a Qt-based application that has been available for Linux for a while. Then, 1Password support in Linux was in beta since last year. Recently it has been moved out of beta.

Others I know off the top of my head,

  • AuthPass
  • Password Safe (for Gnome DE)
  • KeePassX (where KeePassXC was forked)

View what’s inside the Keystore

I have a file with java keystore type that I would like to inspect. Can the contents of the keystore of java be viewed if I don’t have it password? I want to verify an SSL certificate is inside of it. Maybe also check the details are correct, expiration date and so on. What tool can be used to open the keystore?

ANSWER

The normal notion that because the Java Keystore (JKS for short) asks for a password, then I cannot see what is in it is not entirely correct. The password for the JKS does not prevent that. Instead the purpose of the password is to protect the integrity of the JKS. The intention is that without the password, I should not be able to modify the contents, such as adding certificates or deleting some.

With the proper tool I can still read what is inside of a JKS. Normally we just use the keytool. This command line tool usually comes with the Java installation in your system. Try to find it in the installation directory of Java. It resides together with other Java binaries in the ../bin/ directory.

Without password warnings will be displayed, like this one:

*****************  WARNING WARNING WARNING  *****************
* The integrity of the information stored in your keystore  *
* has NOT been verified!  In order to verify its integrity, *
* you must provide your keystore password.                  *
*****************  WARNING WARNING WARNING  *****************

How to print what is inside the JKS:

(1) View all as a list

:~$ keytool -list -keystore /path/to/keystore/file

(2) View all as a list with details

:~$ keytool -list -v -keystore /path/to/keystore/file

(3) View a specific entry only using alias with details (The alias is the text that comes out in command #1 before the date, without the comma)

:~$ keytool -list -alias "the alias text" -v -keystore /path/to/keystore/file