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?

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:

 » Read more..

What is Writing Your own Provisioner in Terraform?

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

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

To learn about provisioners, see this:

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

 » Read more..

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).

 » Read more..

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?

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


super_dictionary = {}
super_dictionary[”top_of_nested”] = big_dictionary

You may also want to see this:

 » Read more..

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 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.  » Read more..

How Does sorted(list_arg1, key=arg2) Work in Python?

You see that Python’s sorted reserved word has an option to use a key (rather than the default mechanism). How does the key parameter/flag in Python’s sorted function work?

Short Answer:
The word “key” designates a special function that you create. It accepts two parameters and returns positive or negative numbers. These help give you the ability to sort the list in a non-standard way.

 » Read more..

What Is The Disambiguation of The Word “heap” in I.T.?

Problem scenario
You have read about heaps in computer programming and in operating systems. What do the different definitions of “heap” mean in I.T.?

The same word can have completely different meanings in English; a trash heap, a heap in computer programming or a heap in the context of operating systems are three types of “heaps”. Their definitions are completely independent of one another.

 » Read more..