How Do You Write a Flask Program to Accept a Parameter in the URL?

Problem scenario
You want to pass a variable via a URL to a Python program. You want to use Flask for this. What do you do?

Solution
Prerequisite

Install Flask. If you need assistance, see this posting if you are using a CentOS/RHEL/Fedora server or this posting if you are using a Debian/Ubuntu server.

Procedures
This is a multi-route Flask program.

How Do You Change the Resolution of the Screen Size So You Can See the Entire Window/GUI Application?

Problem scenario
You are using a Windows or Mac laptop or workstation with an external monitor. In the external monitor when you maximize applications, you cannot see the very top or very bottom of the window. You cannot see the lower portion of the bottom toolbar or ribbon. How do you get the resolution to fit in the screen and not extend beyond your monitor’s size?

Solution
Root cause: The problem is not with the computer;

How Do You Sort a Dictionary in Python and Use It?

Problem scenario
You want to use a sorted dictionary in Python. What do you do?

Solution
Create a sorted list based on the dictionary’s keys. Use the list as keys to summon the dictionary’s values.

contint_dict = {}
contint_dict[”a_test”] = “123”
contint_dict[”b_test”] = “456”
contint_dict[”c_test”] = “789”
sorted_dict_list = sort1ed(contint_dict.items()) # sorted_dict_list is a list, not a dictionary.
list_of_keys = sorted(contint_dict.keys())

for key_pair in sorted_dict_list:
print(key_pair)

print(“”)
print(“Above are key-pairs. …

How Do You Troubleshoot “conntrack not found in system path” when You Run a kubeadm Command?

Problem scenario
You try to run “kubeadm init”, but you receive this error:

[ERROR FileExisting-conntrack]: conntrack not found in system path
[preflight] If you know what you are doing, you can make a check non-fatal with –ignore-preflight-errors=…

What should you do?

Solution
Install conntrack.

If you are using SUSE Linux run this:

sudo zypper -n install conntrack-tools

If you are using Debian/Ubuntu Linux:

sudo apt -y install conntrack

How Do You Troubleshoot the Flask Message “LookupError: the converter ‘str’ does not exist”?

Problem scenario
You are trying to pass a string parameter to a Flask application via a call to a URL. You get the message “LookupError: the converter ‘str’ does not exist.” What should you do?

Solution
Use the term “string” instead of “str”.

Here is an example of incorrect syntax:
@app.route(“/ccc/”, strict_slashes=False)

This shows the correct syntax:
@app.route(“/ccc/”,

What is Writing Your Own Provisioner in Terraform?

Question
You have heard there is such a thing as customer provisioners (not providers) in Terraform. What is a custom-built provisioner in Terraform?

Answer
There are generic provisioners such as “file”, “local-exec”, and “remote-exec”.

To learn about provisioners, see this: https://www.terraform.io/docs/language/resources/provisioners/

Custom provisioners exist; you can create your own provisioner beyond the generic three (“file”,

How Do You Go to an ELB from Your Workstation?

Problem scenario
You can go to an ELB’s FQDN via an EC-2 instance (with a curl command). But you cannot go to an ELB from your workstation (with a web browser). What should you do?

Possible solution #1
From the EC-2 instance, can you use nslookup FQDNofELB (where FQDNofELB is the FQDN of the ELB)? This should provide you with the IP address (the last of the IP addresses in the results).

How Do You Use a Nested Dictionary in Python?

Problem scenario
You want to create a dictionary of dictionaries in Python. You want to use them. What do you do?

Solution
Here is an example/illustration:

contint_dict = {}
contint_dict[”a_test”] = “123”
contint_dict[”b_test”] = “456”
contint_dict[”c_test”] = “789”

color_animal_dict = {}
color_animal_dict[”blue”] = “dog”
color_animal_dict[”orange”] = “cat”
color_animal_dict[”green”] = “goat”

days_dict = {}
days_dict[”Tuesday”] = “midnight”
days_dict[”Wednesday”] = “noon”
days_dict[”Thursday”] = “evening”

big_dictionary = {}
big_dictionary[”dict_1″] = contint_dict
big_dictionary[”dict_2″] = color_animal_dict
big_dictionary[”dict_3″] = days_dict

print(big_dictionary[”dict_1″][”b_test”])
print(big_dictionary[”dict_2″][”green”])
print(big_dictionary[”dict_3″][”Wednesday”])

super_dictionary = {}
super_dictionary[”top_of_nested”] = big_dictionary
print(super_dictionary[”top_of_nested”][”dict_3″][”Wednesday”])

You may also want to see this: https://pypi.org/project/nested_dict/

How Do You Troubleshoot “timed out waiting for the condition” after Running “kubeadm init”?

Problem scenario
You run “sudo kubeadm init”, and you get this message:

[kubelet-check] It seems like the kubelet isn’t running or healthy.
[kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthz’ failed with error: Get “http://localhost:10248/healthz”: dial tcp 127.0.0.1:10248: connect: connection refused.

[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory “/etc/kubernetes/manifests”. This can take up to 4m0s
[kubelet-check] Initial timeout of 40s passed. …