How Are Processes and Threads Different from Each Other in Python?

Problem scenario
You have heard of processes and threads in Python.  Are there illustrative Python programs that use processes and threads to demonstrate the differences between processes and threads themselves?

Solution
Here are two differences between processes and threads in Python:

Difference #1  Children processes keep running when parent process is killed.  Child threads stop processing when parent process is killed.

Python script A (with spawned threads):

“”” This program spawns no other PIDs. …

How Do You Troubleshoot Connecting to a Docker Registry when You Receive an Error Response from a Daemon about an “i/o timeout”?

Problem scenario
You run a command like this: docker login docker.artifactory

You receive a message like this:
“Error response from daemon: Get https://docker.artifactory:80/v1/users/: dial tcp x.x.x.x:443: i/o timeout”

What should you do?

Solution
Make sure there is no firewall or security group blocking connectivity from the client reaching the Docker registry.  Even if you are running the “docker registry” command from the back-end of the Docker registry server itself,

In a Groovy Program How Do You Assign an Element in an Index to Be the Value of a Given Variable?

Problem scenario
You are trying to write a simple Groovy program.  You have an array of individual strings.  How do you assign one of them to be the value that a variable is?

Solution
To assign an element of an array, should have quotes around the variable and the $ symbol and the syntax ” as String” should follow the closing quote mark.

def input = System.console().readLine ‘Please provide some input: ‘
def x = input
def boardArray = new String[2]
boardArray[0] = “”
boardArray[1] = “”
boardArray[1] = “$x” as String //This is the correct version
println boardArray[1] …

Why Cannot You Upload Different Docker Images to a Given Docker Repository?

Problem scenario
You have a Docker repository.  You know its name in the Docker registry.  You are having trouble uploading different images to the repository.  What should you do?

Solution
You must use a different Docker repository for each image.  A repository can only hold different versions of the same image.  But only one image can be stored in a repository.  This link provides more details.

How Do You Configure an Amazon VPC?

Problem scenario
You want to use a VPC in AWS.  What do you do to create one?

Solution
1.  Log into the AWS web console.
2.  Go here: https://aws.amazon.com/vpc/
3.  Click “Get started with Amazon VPC”.
4.  Click “Launch VPC Wizard”.
5.  Click “Select”.
6.  Change configurations as desired.  At a minimum click the “Availability Zone” to choose the region that is most appropriate for your needs (i.e.,

How Do You Create a Class for Objects with Many Data Members and Access One Specific Data Member in Groovy?

Problem scenario
You want to use Groovy to create a class and an object that is composed of many individual member data types.  How do you do this and access an individual data type of the object?

Solution
This Groovy program creates two objects from the same class using different syntax.  One method uses syntax “[]” and another method uses the “new” keyword.

@groovy.transform.Canonical
class Program {
    String mem1 = “”
    String mem2 = “”
    String mem3 = “”
    String mem4 = “”
    String mem5 = “”
    String mem6 = “”
    String mem7 = “”
    String mem8 = “”
    String mem9 = “”
}

programsv1 = new Program( “1”, …

What is “continuous integration” (or CI or “continual integration”)?

Question
What is “continuous integration” or “continual integration”?

Answer
Continuous integration (or continual integration) is the convergence of code from two or more developers via an automated process.  We arrived at this definition from summarizing and extrapolating from the following three quotes:

  1. “Continuous Integration is merging all code from all developers to one central branch of the repo many times a day trying to avoid conflicts in the code in the future.” 

How Do You Troubleshoot the kubectl Message “Connection error: Unable to connect to the server:” with AWS?

Problem scenario
You are using Kubernetes in AWS.  When using a kubectl command you get this error: “Connection error: Unable to connect to the server:  getting credentials: exec: exit status 1  … Could not get token: AccessDenied: Access denied”

What should you do?

Possible Solution #1
Was the user who created the Kubernetes cluster a different user from the user that is configured with your AWS CLI?

What Are ARM Templates (for Azure)?

Question
What are ARM (Azure Resource Manager) templates?

Answer
ARM templates are JSON files that have six element definitions, of which three are mandatory:

$schema
contentVersion
parameters
variables
resources
outputs

The elements $schema, contentversion, and resources are mandatory.

For more information see these links:
https://medium.com/@zaab_it/azure-resource-manager-template-101-1ccddc797f65