How Do You Troubleshoot The Linux Error “Failed to execute operation: Invalid argument”?

Problem scenario
You try to enable a service with this command: sudo systemctl enable foobar

But you get this error: “Failed to execute operation: Invalid argument”

What should you do?

Solution
1. Find the .service file for foobar (e.g., /etc/systemd/system/foobar.service).
2. Find the “Install” section. Is there an extra character? Make sure the line looks right. If you still have a problem,

How Do You Delete a Kubernetes Cluster in AWS?

Problem scenario
You try to manually delete EC-2 instances (both worker nodes and the master node of Kubernetes), but this does not work. The EC-2 instances are re-created. How do you delete the cluster?

Solution
Prerequisite
Install and configure the AWS CLI; if you need assistance, see this posting.

Procedures
Run these three commands but substitute “contint.k8s.local” with the name of your cluster:

export KOPS_CLUSTER_NAME=contint.k8s.local
export KOPS_STATE_STORE=s3://$KOPS_CLUSTER_NAME-state
kops delete cluster –name contint.k8s.local –yes …

How Do You Find The Web UI Credentials for Foreman after You Installed It?

Problem scenario
You want to log into the web UI of Foreman. What do you do?

Solution
1. Run this command: sudo find / -name foreman-installer -type f
2. Based on the results above, run this: sudo /path/to/foreman-installer –foreman-version # Replace “path/to” with the results of the first command (e.g., /usr/sbin/”).
3. The output from the above command should show you the credentials for the administrator user.

How Do You Know What Version of Foreman Is Installed?

Problem scenario
You inherited a server with Foreman installed. What should you do to find out what version is installed?

Solution
1. Run this command: sudo find / -name foreman-installer -type f
2. Based on the results above, run this:
sudo /path/to/foreman-installer –foreman-version

# Replace “path/to” with the path results of the first command (e.g., /usr/sbin/”).

Where Is The “Welcome to Nginx!” Page Stored in a Docker Container?

Problem scenario
You installed Nginx in a Docker container on a RedHat Linux server.  You go to this container with a web browser and see the default screen.  Where is the default file (on the back-end) that users see from the front-end by default that says “Welcome to nginx!”?

Solution
This is the name and location of the file (assuming the Docker container was created via the public repository):

/usr/share/nginx/html/index.html

How Do You Determine which yum-config-manager Repos Can be Enabled?

Problem scenario
You want to see options for the yum-config-manager command. How do you find which repositories can be enabled for a Red Hat Enterprise Linux server?

Solution
Run this command: sudo yum repolist all

With the output on the left, you will need what is left of the “/” (forward slash) if one appears in a command like this: sudo yum-config-manager –enable rhui-REGION-rhel-server-rhscl

Let’s say you see this output below from the sudo yum repolist all command:

rhui-REGION-rhel-server-source-supplementary/7Server/x86_64 Red Hat Enterprise Linux Server 7 Supplementary (SRPMs) disabled

To use this output,

How Do You Use rpm to Remove a Repository You Installed?

Problem scenario
You accidentally used a command like this:
sudo rpm -ivh http://path/to…

You accidentally installed and configured a remote repository that you do not want to retrieve packages from. How do you use rpm to remove the configuration?

Solution
1. Run this command: cd /etc/yum.repos.d/
2. Delete the file that is there as a consequence of your “rpm” command.

How Do You Troubleshoot a Web Server in GCP Not Working via a Web Browser when Port 80 Is Not Blocked?

Problem scenario
From a web browser these commands succeed (where x.x.x.x is the external IP address of the Linux VM serving the web service):

Test-NetConnection -ComputerName x.x.x.x -Port 80
Test-NetConnection -ComputerName x.x.x.x -Port 443

But when you open a web browser and go to the x.x.x.x IP address, but the page does not load. You may get an error message about it timing out or not being reached or available.