How Do You Troubleshoot the Python Error “json.decoder.JSONDecode..”Expecting property name enclosed in double quotes…”?

Problem scenario
You are running a Python program that uses “import json”. You get this error: “json.decoder.JSONDecode..”Expecting property name enclosed in double quotes…” You are not allowed to use bson, but you can use other Python packages. What should you do?

Solution
This solution only works if you can eliminate single quotes in the content to be serialized (or translated into JSON). This will get rid of single quotes indiscriminately.

How Do You Copy a File into an S3 Bucket using the AWS CLI?

Problem scenario
How do you copy a file from a Linux server with AWS CLI to an S3 bucket?

Solution
Draft a command like this but replace /tmp/good.txt with the path and name of the source file you are copying, and replace “foobar” with the name of the s3 bucket you are copying to (as the destination):

aws s3 cp /tmp/good.txt s3://foobar/

Run the command.

How Is Traffic Routed when a Browser Goes to a URL and the Website is Powered by a Kubernetes Cluster?

Question
You have been asked to explain how an external request for a website is routed and ultimately fulfilled by a pod in Kubernetes via an ingress controller. When a web browser downloads a website via HTTP and the website is running from a Kubernetes cluster, how does an individual container provide the HTML and/or data? How is external traffic routed to an underlying pod in a Kubernetes Cluster?

Answer
Assuming that external traffic can reach an ingress controller in Kubernetes,

How Do You Troubleshoot “ssh connect to host x.x.x.x port 22: No route to host” on Oracle VirtualBox on a VirtualBox VM?

Problem scenario
You are using Oracle VirtualBox. You get “ssh connect to host x.x.x.x port 22: No route to host”. What do you do?

Solution
In Oracle VirtualBox, go to Devices -Network -Network Settings. Is it attached to “Internal Network”? Try attaching it to “Bridged Adapter” instead.

How Do You Troubleshoot the Python Program Problem “FileNotFoundError: [Errno 2] No such file or directory”?

Problem scenario
Your Python program is trying to invoke a Bash command. But you get an error like this: “FileNotFoundError: [Errno 2] No such file or directory”. What should you do?

Possible Solution #1 Use the shell=True command if your environment is secure. This is not a recommended practice from a security perspective. We have found that this with shell=True syntax can make the error go away:

subprocess.Popen(variableofcommand,

How Do You Get an Android Phone to Filter Ring Notifications Based on the Calling Number?

Problem scenario
You only want your Android phone to ring if certain phone numbers call you. You have “blocked unknown callers” on your Android phone with certain settings. You went to the Phone app -three vertical dots -Settings -Block numbers -Block unknown callers

But you still get calls, or your phone still rings, when unknown callers call you. You tried rebooted or using Hiya’s caller ID and spam protection.