Why Cannot You Ping an IP Address of an AWS Server when the Security Group Should Allow for Pinging?

Problem scenario
In AWS you manually added a Security Group rule for the source of a given IP address. This IP address is either the internal or external IP address. You can ping one of them (either the internal or external IP address). Why cannot you ping each IP address?

Solution
Check to see if a firewall is running on the Linux server.

How Do You Run an Ansible Playbook?

Problem scenario
You want to run an Ansible playbook to push configuration changes down (e.g., transfer files to managed nodes). How do you do this?

Solution
Prerequisites
This assumes that you have set up Ansible. If you need directions for deploying an Ansible control server, see this posting. If you need directions for deploying a managed node after the central Ansible server has been set up,

How Do You Solve the Linux Error “hostname: Name or service not known”?

Problem scenario
You run hostname -f and you get this error: “hostname: Name or service not known”

How do you solve this problem?

Solution
Do these things in this order:

  1. Verify you have the hostname in the /etc/hostname file.
  2. Verify the name above matches what is in /etc/hosts for the local IP address.
  3. Try rebooting the server.

What Should You Do when the Apache Mesos Web UI Keeps Refreshing and Sending a Pop-up “Failed to connect to …:5050”?

Problem scenario
You deployed Apache Mesos. The web UI is having problems. You see the error “Failed to connect to x.x.x.x:5050.” What should you do?

Solution

  1. Go to the back-end of the Apache Mesos server. Run this command: sudo systemctl stop mesos-master
  2. sudo find / -name mesos-master.sh
  3. Change directory into the parent of the “bin” directory that houses the mesos-master.sh as found above.

How Do You Write a Java Program to Read in Letters and Numbers?

Problem scenario
You want to create a basic Java program that can read alphanumeric input interactively. How do you write such a program?

Solution
1. Verify the “javac” command works. Run “man javac” to see the man page. If you do not get a man page, install the Java development tools. On a RedHat derivative, run this: sudo yum -y install java-devel

2.

In Python, What Are Some Disadvantages to Using os.execlp to Fork a Process?

Question
In Python you are familiar with importing the os module and using different exec variations. What are some reasons that you would not use os.execlp?

Answer
1. If you use os.execlp to call another program, that program is more likely to return “Killed”. The resources of the child process are, by default, more limited in part because the fork operation is expensive from a system’s resources perspective.

How Do You Install Java so You Can Compile Programs on a RHEL Server?

Problem scenario
You have installed Java. But you cannot use the javac command. You get errors like this: “-bash: javac: command not found”

How do you install Java so you can compile programs on a RedHat Linux server?

Solution
Run this command: sudo yum -y install java-devel

If you want to do this on a Debian or Ubuntu Linux server,

How Do You Reclaim Swap Space on a Linux Server?

Problem scenario
You mounted 2 GB of swap space (virtual memory) called 2GB.swap. (You followed these directions. Later you added RAM to the server.) This 2 GB swap space is still mounted. How do you clear it and repurpose it on your hard drive?

Solution
1. Run this command: sudo swapoff -a
2. Modify the /etc/sysctl.conf file. (You may want to back it up before you make a change.) Here is what you need to do to change it:
Run this command: sudo vi /etc/sysctl.conf
# eliminate the “vm.swappiness=10” stanza

3.

How Do You Get a Raspberry Pi to Work Again after Two GPIO Pins Were Connected When They Should Not Have Been?

Problem scenario
You recently connected a jumper connector to two GPIO pins accidentally on your Raspberry Pi. Now your Raspberry Pi will not start, and it seems fried. There is a red light that is on. There is no flashing light and no green light. There is no output to the monitor. You are not sure if the Raspberry Pi is wasted.

Solution
1.