How Do You Unlock a GitHub Repository when You Only Know Its Name?

Problem scenario
You want to unlock a GitHub repository. You know the name of the repo. (When you browse to it in a web browser, you see that it is locked, and you cannot see the files inside as normal.) How do you unlock it?

Solution
You need to find the migration GUID for the locked repository. Then you need to run a command on it.

How Do You List the Kafka Topics when You Cannot Find the kafka-topics.sh File?

Problem scenario
You cannot find kafka-topics.sh. But you want to list the Kafka topics. What should you do?

Solution
Find the kafka-topics binary file. Use something like this (but replace “localhost” with the server name of Zookeeper and “2181” with the TCP port number):

kafka-topics –list –zookeeper localhost:2181

(This was adapted from https://stackoverflow.com/questions/44405663/list-all-kafka-topics.)

How Do You Iterate Through Two Lists of Unequal Length in Python?

Problem scenario
You want to iterate through two lists and perform some operation. The lists are not equal length. You want to iterate through them in some type of step-by-step fashion despite their lack of equality. What should you do?

Solution
Use this as an example:

list_a = [1, 2, 3]
list_b = [”dog”, “cat”, “rat”, “chicken”]

i = 0
j = 0

while (i < …

How Do You Write Python Code to Test if a Dictionary Exists?

Problem scenario
You want to test if a dictionary exists or not. You know its name if/when it exists. What do you do?

Solution

# Suggested usage: 1) run it is as it is.
# 2) uncomment out the dictionary_name1 definition stanza.
# Then run this program again.

#dictionary_name1 = “good_dict”

if ‘dictionary_name1’ in locals():
print(“IT IS IN LOCALS”)
else:
print(“IT IS NOT IN LOCALS”)

if ‘dictionary_name1’ in globals():
print(“IT IS IN GLOBALS”)
else:
print(“IT IS NOT IN GLOBALS”) …

How Do You Install Troubleshoot the Kubernetes Error “dial tcp x.x.x.x:10248 connection refused”?

Problem scenario
You are trying to run “kubeadm init”, but you get this error:

“failed with error: Get “http://localhost:10248/healthz”: dial tcp 127.0.0.1:10248: connect: connection refused.”

What should you do?

Solution
Is the kubelet service running? Run this: sudo systemctl status kubelet

To install the kubelet, see this posting for How Do You Install the kubelet on any type of Linux?

How Do You Troubleshoot the Kubernetes Error “[ERROR Port-10250]: Port 10250 is in use”?

Problem scenario
You are trying to run a kubeadm command. But you get this error:

[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR Port-10250]: Port 10250 is in use
[preflight] If you know what you are doing, you can make a check non-fatal with –ignore-preflight-errors=…

What should you do?

Solution
Remove the kubelet that snap installed;