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/

Object-Oriented Programming Quiz

1. What are the three types of design patterns?
__________________

2. As a recommended practice in OOP, which is preferred?

a. Object composition
b. Class inheritance
c. Programming to an implementation
d. none of the above

3. Polymorphism happens at which time?

a. Compile time
b. Run time
c. Both of the above
d. None of the above

The sources for C are these:
https://www.geeksforgeeks.org/difference-between-compile-time-and-run-time-polymorphism-in-java/
https://www.nerd.vision/post/polymorphism-encapsulation-data-abstraction-and-inheritance-in-object-oriented-programming

4.

Object-Oriented Programming Quiz & Answers

1. What are the three types of design patterns?
__________________

Answer: Creational, behavioral, structural. Source: Page XV of Design Patterns: Elements of Reusable Object-Oriented Software

2. As a recommended practice in OOP, which is preferred?

a. Object composition
b. Class inheritance
c. Programming to an implementation
d. none of the above

Answer: A. Source: Page 20 of Design Patterns: Elements of Reusable Object-Oriented Software

3.

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

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

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

How are Provisioners in Terraform Different from User Data?

Question
How are Terraform provisioners different from Terraform User Data? Both usually involve scripts to customize a server.

Answer
Provisioners have built-in support for CM tools and can have scripts longer than 16 KB; these things are not true with User Data. (This was taken from page 213 of Terraform: Up & Running, 2nd Edition by Yevgeniy Brikman (O’Reily), Copyright 2019,

How Do You Find the Working Directory in an Azure DevOps Release Pipeline?

Problem scenario
A Terraform task is failing in an Azure DevOps release pipeline. You cannot see a variable setting for the working directory. How do you determine the working directory?

Solution
Go to Edit your release pipeline. Go to “View YAML” in the upper right hand corner. Search for “working”. You should see it (e.g., as workingDirectory).

The working directory key probably has a value that is a variable (e.g.,