How Do You Troubleshoot the Vagrant Error “No usable default provider could be found for your system.”?

Problem scenario
On a Linux server you get "No usable default provider could be found for your system." What should you do?

Solution
Install VirtualBox. On an Ubuntu server with 0.5 GB of RAM, you can simply run this command:

sudo apt-get -y install virtualbox

How Do You Fix the Problem of “permission denied” when Trying to Copy a File to a Directory?

Problem scenario
You try to copy a file. It fails with "Permission denied." What should you do?

Possible Solutions
1. Are the permissions of the destination folder/directory permissive? Is you user supposed to be able to write to the destination folder/directory?

2. Is there an open file in the destination directory? Sometimes this can cause unexpected problems (e.g., with Git Bash).

3. Are you sure the location is correct? In today's world with public and private clouds, Git Bash, Git CMD, PowerShell, DOS prompts, Putty terminals, VNC sessions, Remote Desktop Sessions, web UI terminals, servers can become easily confused with each other

Excellent Generic Troubleshooting Tips for I.T. work (e.g., DevOps tasks)

At the time of writing, we suggest these troubleshooting steps for many I.T. tasks. Some of these will not apply to every problem. But if you do not know where to begin, this can help you with "DevOps block."

1. Find the word "error" in the logs. Look at a log with vi (e.g., copy the log to a location where it will not be continually written to). Open the copy with vi. Run this command:
:set ignorecase

Search for the word "error"

2. Reboot the server and try again.

3. Find one server or program that works, see how it is different from the one that fails.

4. Start over from the beginning (redeploy).

5. Find what changed since it was last working. If it never worked, try to deploy it on a different distribution of Linux.

6. If the problem is reproducible, try to isolate the problem. A back-to-basics approach can involve reducing problems to atomic parts. From there you can diagnose an underlying component having a problem and thus find a solution.

What is a Container Breakout?

Question
What is a container breakout?

Answer
A container breakout is an the act of a user or process in a container gaining access to its underlying host server. Containerization is the isolation of processes and/or disk space on a server. A container is isolated from the host server via cgroups and namespaces. Bypassing the cgroup(s) and namespace(s) through intentional acts can be desirable for legitimate systems engineers. While such an operation can denote a "breakout", we find the term "container breakout" to connote the unauthorized circumvention of the isolating cgroups and namespaces. Some Docker hosts and configurations of containers can be exploited by hackers. Thus a new big security concern in the I.T. world is the "container breakout" or "Docker [container] breakout".

To see the term in context, read these examples:

https://www.oreilly.com/library/view/advanced-infrastructure-penetration/9781788624480/5603d194-56b9-4815-8627-439f262d6d15.xhtml

https://news.ycombinator.com/item?id=7909622

https://hub.docker.com/r/gabrtv/shocker/

Page 3 of this PDF uses the term.

https://blog.docker.com/2014/06/docker-container-breakout-proof-of-concept-exploit/

If you want to learn how to secure a Docker container, see this posting.

Do the Credentials “****” in Jenkins, Taken from the Credentials Plugin, Have the Username or the Password?

Problem Scenario
You want to use the credentials from the Jenkins credentials plugin in a Jenkins pipeline. When you assign the credentials to a variable in a pipeline, is it the username, the password, both or something else?

Solution
It is the username and password, but the two are separated by a colon. You will only see "****" in the console output (for security reasons). Here is an example: jdoe:goodP@$$w0rd!

The above is an example with a username of jdoe and a password of goodP@$$w0rd!

How Do You Troubleshoot the Message “ImportError: cannot import name ‘pubsub_v1′”?

Problem scenario
From the Python command prompt or when running a Python program, you receive this message "ImportError: cannot import name 'pubsub_v1'". What should you do?

Solution
Possible Solution #1
Try to run the program as sudo: sudo python nameOfProg.py

Possible Solution #2
Prerequisite
This assumes that pip has been installed. If you need assistance see this posting "How Do You Install pip?".

Procedure
Try this with or without sudo (depending on whether or not you are using "sudo" to run the Python program):

sudo pip install google-cloud-pubsub
# You may want to omit the "sudo" in the above command.

Possible Solution #3
Prerequisite
This assumes that pip has been installed. If you need assistance see this posting "How Do You Install pip?".

sudo pip uninstall google-cloud-pubsub
sudo pip install google-cloud-pubsub

# You may or may not want to omit the "sudo" in the above commands.

What is a Jenkins Executor?

Question
What is a Jenkins executor?

Answer
It is a designation in the Jenkins master server's settings that governs resource allocation (e.g., CPU and RAM) on any Jenkins nodes and the master server itself. When a server (either the master or a node) is designated as having two or more executors, the server can process as many jobs simultaneously as the number of executors for which it has been designated.

In other words if a server has been configured to have three executors, this server can process three jobs concurrently. If the server has been configured to have one or zero executors, then the server can process only one Jenkins job.

The verbatim definition on the Jenkins website of an executor is as follows:
"A slot for execution of work defined by a Pipeline or Project on a Node. A Node may have zero or more Executors configured which corresponds to how many concurrent Projects or Pipelines are able to execute on that Node."

An executor is a subprocess of a main process on a Jenkins node (according to this posting).

How Do You Use the seq Reserved Word in a Bash Script to Generate Content for a File?

Problem scenario
You want to rapidly create hundreds of lines of text for a file. You want to do some testing and you need a file you can delete. You also want to use the seq keyword.

Solution
Here is a program that uses the seq keyword:

#!/bin/bash
COUNTER=100

for varnum in `seq $COUNTER`
do
  date >> goodfile
  echo $varnum >> goodfile
done

Some people recommend not using the seq keyword. An alternative way of writing the above is this:

#!/bin/bash

for varnum in {1..100}
do
  date >> goodfile
  echo $varnum >> goodfile
done

You notice the {1..100} is more terse with no COUNTER variable assignment.

How Do You Troubleshoot the Message “ImportError: No module named ‘google'”?

Problem scenario
From the Python command prompt or when running a Python program, you receive this message "ImportError: No module named 'google'". What should you do?

Solution
Possible Solution #1
Try to run the program as sudo: sudo python nameOfProg.py

Possible Solution #2
Prerequisite
This assumes that pip has been installed. If you need assistance see this posting "How Do You Install pip?".

Procedure
Try this with or without sudo (depending on whether or not you are using "sudo" to run the Python program):

sudo pip install protobuf
# You may want to omit the "sudo" in the above command.

Possible Solution #3
Prerequisite
This assumes that pip has been installed. If you need assistance see this posting "How Do You Install pip?".

Procedures
Run these commands:

sudo pip uninstall protobuf
sudo pip install protobuf

# You may or may not want to omit the "sudo" in the above commands.