How Do You Find the Resource Group Names in your Azure Account?

Problem scenario
You want to use an existing Resource Group name.  How do you find which ones you have created?

Solution
1.  Log into the web UI for the Azure Portal.
2.  On the left there often will be an item “Resource Groups” (under favorites).  Click on it.  If it is not there, search for “Resource Groups”

How Do You Write Tic-Tac-Toe in JavaScript?

Problem scenario
You want to write a program using JavaScript. You want to play Tic-Tac-Toe. What do you do?

Solution

1. Save the file below as contint.html to your computer.
2. Open a web browser, preferably Firefox.
3. View the HTML file on your computer via the web browser. (e.g., c:\path\to\contint.html)

<!DOCTYPE html<html<body<h2Play Tic-Tac-Toe with Anyone You Can Share a Keyboard With</h2<p</p<p***************************************************************</p<pTo make your mark, …

How Do You Install kubelet on Any Type of Linux?

Problem scenario
You want a quick, generic way to install kubelet on any type of Linux.  What should you do?

Solution
Run these commands:

cd /tmp

curl -Lo kubelet https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubelet && chmod +x kubelet

sudo mv kubelet /usr/bin/

Test it by running this command: kubelet –version

(If you would prefer to use apt commands,

How Do You Fix a .service File for systemctl Commands to Work?

Problem scenario
You have a bash command that works reliably. But when it is in a .service file (e.g., the ExecStart stanza) the corresponding systemctl command with systemctl start fails. You have tried putting quotes around the arguments in the ExecStart stanza. Using your .service file with systemctl almost works; but there is an unlogged failure that you do not expect. The service (e.g., Logstash or some other service) fails quickly.

How Do You Secure a Docker Container, a Docker Host, and Their Network?

Problem Scenario
You have been tasked with finding ways of securing Docker containers, a Docker host, and your network that has Docker containers.  How do you harden a Docker container and its related infrastructure (i.e., the Docker network and Docker host)?

Solution
Overview

From a pragmatic perspective we understand that there are exceptions to the recommended practices.  (Not the least of which is the rapid rate that technology changes.)  The assertions below are recommended practices. 

How Do You Troubleshoot a Python Error “UnboundLocalError: local variable ‘x’ referenced before assignment”?

Problem scenario
You run a Python program but you get this error: “UnboundLocalError: local variable ‘x’ referenced before assignment”

Solution
Root Cause

You have a function in Python and it refers to a previously assigned variable.  This variable was not passed as a parameter.

Procedures
You need to redeclare (but not necessarily reassign) the variable as a “global”. 

How Do You Delete VM Instances from GCP That Pertain to GKE?

Problem Scenario
You have some GKE standard clusters that you want deleted.  What should you do?

Possible Solution #1 (from the Cloud Shell or with a gcloud command)
1.  Delete the instance group of the instance for the cluster you want to delete.  To do this in the web UI, go to Compute Engine -Instance Groups.  Check the box on the left-hand side and click on “Delete”.

How Do You Write a Tic-Tac-Toe Program in Groovy?

Problem scenario
You want to code a Groovy 2.x program.  You want a program that reads user input, prints out processed output, uses closures (similar to functions in other languages) with and without return statements, handles some exceptions (non-standard input or input that is no longer valid based on what was previously entered), and uses classes.  How do you write a Tic-Tac-Toe (aka naughts and crosses) program in Groovy that has the above things?