How Do You Make an Environmental Variable Persist through a Reboot on a Linux server?

Problem scenario
Every time a server is rebooted, you have to manually set environment variables with the “export” command. You want a variable to persist through a reboot so you do not have to do this manual work. You want a variable to be in the environment of the OS every time you log in. You want the solution to be specific to one user but you want it to work for any distribution of Linux (a Debian or Red Hat derivative including SUSE,

How Do You Troubleshoot the Groovy Error “JAVA_HOME is not defined correctly”?

One of the following situations apply to you:

Problem scenario #1
You try to run a Groovy command (e.g., groovy foobar.groovy), but you get this error:
“groovy: JAVA_HOME is not defined correctly, can not execute: /usr/lib/jvm/java-9-openjdk/bin/java”

Problem scenario #2
You get this error when you run an “hdfs” command:

ERROR: /usr/bin//bin/java is not executable.

What should you do?

How Do You Install Helm on Any Type of Linux?

Problem scenario
You want to use Helm to manage Kubernetes applications. Helm helps you with packages for changes to Kubernetes (in ways that are similar to yum or apt). Helm uses what are called Charts (.yaml files) that enable you to do more with Kubernetes with less trouble. Helm consists of these two things: a CLI tool and a server component that runs as a pod in a Kubernetes cluster (page 531 of Kubernetes in Action by Luksa).

How Do You Create a Server in Azure with Terraform?

Problem scenario
You want to use Terraform to create a virtual machine in Azure. What do you do?

Solution
Prerequisites

i. Terraform must be installed on a Linux server. If you need assistance with this, see this posting.
ii. The Azure CLI must be installed and configured on the Linux server. If you need assistance with this, see this posting.

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.