Using Python How Do You Write a Palindrome Tester?

Problem scenario
You want to write a Python program that tests if a string is a palindrome. You want the calling function to have five lines of code or fewer. How do you do this?

Solution
Here is a program that interactively prompts you for a string and will tell you if it is palindromic or not.

# You may want to see this documentation page: https://docs.python.org/2.3/whatsnew/section-slices.html

stra = input(“Enter a string: “)

def goodone(stra):
if(str(stra) == str(stra)[::-1]):
print(“It is palindromic.”)
else:
print(“The entered string was not a palindrome.”)

goodone(stra) …

What is Calico?

Question
In the context of container orchestration, you have read or seen “Calico.” What is it?

Answer
“Calico provides a highly scalable networking and network policy solution for connecting Kubernetes pods based on the same IP networking principles as the internet. … Calico also provides fine-grained, intent based network security policy for Kubernetes pods via its distributed firewall.” Taken from https://kubernetes.io/docs/concepts/cluster-administration/networking/

“Calico provides secure network connectivity for containers and virtual machine workloads.

What is Flannel?

Question
You have heard about flannel in the context of container orchestration. What is flannel?

Answer
“Flannel is a simple and easy way to configure a layer 3 network fabric designed for Kubernetes.” Taken from https://github.com/coreos/flannel

“Flannel is a networking technology used to connect Linux Containers. It is distributed and maintained by CoreOS, the producer of the stripped-down CoreOS Linux operating system for containers,

How Do You Find (Or Determine) What Product Key Id Is Associated with Your Windows Computer?

Problem scenario
You lost your product key to your Windows computer. You find command prompt and PowerShell commands do not work to display the key ID. How do you display it (e.g., for upgrade purposes)?

Solution
Use this GUI (.exe) tool found here:
https://gallery.technet.microsoft.com/scriptcenter/Get-Windows-Product-6b5e6f6e

What Is The Difference between git merge and git rebase?

Question
What is the difference between git merge and git rebase?

Answer
git merge takes code from one branch and copies it into another branch. One branch will prevail to the extent there are conflicts. (The details of the syntax are beyond the scope of this solution. The git merge operation can be done in a GUI (e.g., via BitBucket).) The published source code would usually change.

How Do You Install the Azure CLI on a Debian/Ubuntu Linux Server?

Problem scenario
You want to use the Azure CLI on a Debian/Ubuntu Linux server.

Solution

1. Run these commands:

sudo apt-get -y update
sudo apt-get install -y curl apt-transport-https lsb-release gpg
curl -sL https://packages.microsoft.com/keys/microsoft.asc | \
gpg –dearmor | \
sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg /dev/null
AZ_REPO=$(lsb_release -cs)
echo “deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main” | \
sudo tee /etc/apt/sources.list.d/azure-cli.list
sudo apt-get -y update
sudo apt-get -y install azure-cli

2.

How Do You Troubleshoot the Kubernetes Problem “connection to the server localhost:8080 was refused”?

One of the following applies (with #1 being related to Kubernetes anywhere and #2 only being relevant to running Kubernetes in GCP).

Problem scenario #1 (any Kubernetes)
You run a command like this: kubectl get svc

You get an error like this: The connection to the server localhost:8080 was refused – did you specify the right host or port?

What should you do?

How Do You Troubleshoot a kubectl Command That Returns “The connection to the server localhost:8080 was refused – did you specify the right host or port?” when using AWS and EKS?

One of the following problems pertains to you.

Problem scenario #1
You have a kubectl server. You created some new EKS clusters. How do you get the kubectl server to interface, control or manage the new EKS clusters.

or

Problem scenario #2
You are running EKS. You run this command:

kubectl get cluster-info

But you receive this message: “The connection to the server localhost:8080 was refused – did you specify the right host or port?”

What should you do?