How Do You Troubleshoot the C Compile-Time Error “gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory”

Problem scenario
You run gcc to compile a C program, but you get this error:
“gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory”

Solution
Install a C compiler.  If you do not know how, see this posting.

How Do You Troubleshoot the Ansible Problem “ERROR! Syntax Error while loading YAML. mapping values are not allowed here”?

Problem scenario
You are trying to run an Ansible playbook with the “become: yes” stanza.  You get this error after your ansible-playbook command:

“ERROR! Syntax Error while loading YAML.
  mapping values are not allowed here

The error appears to have been in ‘/home/cooluser/good.yaml’: line 5, column 10, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be…”

What should you do?

How Do You Run a Java Program That Has Compiled Successfully?

Problem scenario
You have compiled the source code of a Java program into bytecode (with a .class extension). You try to run it (execute the bytecode) with a javac command (javac HelloWorld), but you get “error: Class names, ‘HelloWorld’, are only accepted if annotation processing is explicitly requested
1 error “

What should you do?

Solution
Run it with the java command like this (with no “.class” extension): java HelloWorld

How Do You Find the Instance Ids of Virtual Servers in AWS Using Python?

Problem scenario
You want to write a Python program to display the instance IDs of virtual servers in AWS.  What do you do?

Solution

Prerequisites
This assumes you have installed Boto3.  If you do not know how, see this posting.  This assumes that you are running it on a server that has access to AWS (e.g., it has access to the internet).

How Do You Fix the Problem in vi “E138: Can’t write viminfo file /home/cooluser/.viminfo!”?

Problem scenario
You save a file in vi.  When you go to exit you get the error “E138: Can’t write viminfo file /home/cooluser/.viminfo!”

The error appears to be benign.  You can just press ENTER to continue.  But you would rather not do this.

What should you do?

Solution
Find the group that this user should be associated with (e.g.,

How Do You Troubleshoot SonarQube Not Starting Correctly and ce.Log Not Being Created Properly?

Problem scenario
You are running SonarQube.  The service seems to start (based on the output of “sudo systemctl status sonar”).  But based on an nmap command on your server’s external IP address, you see no service is listening.  You go to the logs directory and cannot find the ce.log file.  You cannot reach the web UI for SonarQube.  How do you fix this problem?

Possible Solution #1
Look at your sonar.properties file. 

How Do You Troubleshoot the Kubernetes Error “Metrics not available or pod default/kubia-xxx-bmb”?

Problem scenario
You run “kubectl top pod” but you receive an error such as this:

‘Metrics not available or pod default/kubia-xxx-bmb, age: 1hr10m…   error: Metrics not available for pod default/kubia-xxx-bmb, age: 1hr10m”‘

What should you do?

Updated on 9/2/19.

Solution
Wait five minutes.  Then re-run this command: kubectl top pod

The source of this question and answer were taken from page 432 of Kubernetes in Action by Marko Luksa published in 2018 by Manning. 

How Do You Troubleshoot the Ansible Message “ERROR! the role was not found”?

Problem scenario
You run ansible-playbook on a playbook (e.g., .yaml file) that uses a role.  It fails with the message “ERROR! the role was not found”.  How do you correct this problem?

Solution
Find the ansible.cfg file.  Look at the roles_path stanza.  Add or modify the path that you want Ansible to look at for a role every time the Ansible playbook runs.

How Do You Install Memcached on an Ubuntu Server?

Problem scenario
You want to try out Memcached.  How do you install memcached and php-memcached to test it?

Solution
(These directions were based on ServerMom.org directions.)

1.  Run these commands:

sudo apt-get -y update
sudo apt -y install memcached php-memcached php7.0 apache2
  # apache2 is not necessary but useful for testing purposes

2.  Create this file:
sudo vi /var/www/html/info.php # add the three lines below

<?php
phpinfo(); …

How Do You Find the Most Recently Modified Files in Linux?

Problem scenario
Someone was doing a web conference and modified several files.  You have forgotten what files she modified.  How do you find the files that were modified most recently on a Linux server?

Solution
Run this command:

find $1 -type f -exec stat –format ‘%Y :%y %n’ “{}” \; | sort -nr | cut -d: -f2- | head