How Do You Troubleshoot the Python Message “ImportError: No module named setuptools”?

Problem scenario
You try to run sudo python setup.py build but you encounter a problem. You get a message that says “ImportError: No module named setuptools”. What should you do?

Solution
If you are running Debian/Ubuntu Linux, run this: sudo apt-get -y install python-setuptools

If you are running CentOS/RedHat/Fedora Linux, run this: sudo yum -y install python-setuptools

How Do You Get Apache Tomcat to Work from the Source Installation Media?

Problem scenario(s)
One of the following problems apply.

1. You are trying to start Tomcat on Linux (e.g., with bash catalina.sh start) and you get this error:

java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:262)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:444)

* OR *
2. You have nothing installed on Linux yet. You want to install Apache Tomcat from the source (not binary) installation media here.

How Do You Troubleshoot The Message “Error from server (NotFound): the server could not find the requested resource”?

Updated 9/20/19

Problem scenario
You run the kubectl command. You receive “Error from server (NotFound): the server could not find the requested resource.” How do you resolve this?

Solution
1.a. Run this command: kubectl version | grep Version

Look at the GitVersion values for the client and server. They should match or nearly match.

How Do You Troubleshoot no_manifest Being Returned by a “puppet master –configprint manifest” Command?

Problem scenario

From the Puppet master server you run this command: puppet master –configprint manifest

But it returns “no_manifest”

Manifests are working. Puppet agent nodes are receiving the changes of manifests on the Puppet master server.

This command seems to work perfectly (except for the manifest line): puppet master –configprint all

What is wrong?

Solution

Possible solution #1
The root cause could be a permissions issue.

How Do You Install Katello (and Foreman) on a Linux Server?

Problem scenario
You have heard of a Foreman plugin called Katello that supports Red Hat subscription and repository management. Katello supports other plugins such as Pulp (for downloading content) and Candlepin (for managing the meta aspects of the subscriptions themselves). How do you install Katello?

Solution
Warning 1: This works for CentOS. It may work for Fedora.

How Do You Install AppArmor on a Debian or Ubuntu Linux server?

Problem scenario
You want to protect your Debian/Ubuntu Linux server. You do not want to run SELinux. What should you do?

Solution
Run this command:
sudo apt install apparmor-profiles

Check the status with this command:
sudo apparmor_status

You are done. If you want to learn more go to this site.

AppArmor comes installed and configured with many Debian distributions of Linux.

What Do You Do when an Ansible Playbook is Not Getting a Variable Assigned Properly?

Problem scenario
Ansible variables are not being picked up when the playbook runs. You may get no errors, or you may get errors like these:

“ERROR! Syntax Error while loading YAML…did not find expected key”

“ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path”

What should you do?

Possible Solution #1
Are you using the -i flag when you are running the command to execute the playbook?

What Should You Do to Set Firefox to Be Your Default Browser in Windows 10?

Problem scenario
When you open Firefox in Windows 10 you get a prompt about whether or not it should be your default browser. You choose the option (“Use Firefox as my default browser”) to make it your default browser, but it does not work. You see a window called “Settings” which has options for default applications.

What should you do to get Firefox to be your default browser in Windows 10?

What is a ReplicationController in Kubernetes?

Question
What is a ReplicationController in Kubernetes?

Answer
It is a component that ensures the pods are constantly running (page 90 and 91 of Kubernetes in Action by Luksa). They were designed to create and manage redundant pods (page 91 of Kubernetes in Action by Luksa). They do just that — they do not transfer pods but create new ones on different nodes (page 93 of Kubernetes in Action by Luksa).

How Do You Use PowerShell to Find out if a Given Update Has Been Installed on Your Windows Workstation?

Problem scenario
You want to know if a particular KB was installed on your Windows machine. You know the KB number. How do you use PowerShell to find out if this update has been installed or not?

Solution
Run this: get-hotfix | sls “kb123456789” # Replace kb123456789 with the KB of your choice.