How Do You Install a Kitchen or Bath Faucet Aerator When It Does Not Want to Screw On?

Problem scenario
When replacing an aerator to a kitchen or bathroom sink, you cannot easily install a new one.  What is the problem?

Possible solution #1
There is a gasket attached to the new aerator that needs to be removed.

Possible solution #2
The new aerator is a male aerator and you need a female aerator.

How Do You Deploy Puppet Agent 3.x to a RedHat Linux Instance in AWS?

Update on 12/4/17
If you want to install Puppet Agent 5.x (a much newer version), see this posting instead.

Problem scenario
You installed Puppet Master on an AWS instance of RedHat Enterprise Linux.  (See this link if you want to install Puppet Master). You now want another AWS instance of RHEL 7.x to be configured as a Puppet Agent node. You want to run a manifest to make sure that this new Puppet Agent node (i.e.,

How Do You Install Puppet Master on a RedHat Linux Server (an AWS Instance)?

Problem scenario
You want to install Puppet Master on RHEL 7.x running in AWS.  You only have five minutes to complete this task.  How do you install Puppet Master immediately?

Solution
1.  Create puppetinstaller.sh in the /tmp directory.  It should have the following lines (stop before you get to step #2):

#!/bin/bash
# Written by continualintegration.com

yum -y install ntp
echo ‘
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
server 3.us.pool.ntp.org’ >>

How Do You Troubleshoot the Error “Failed to restart puppetserver.service: Unit puppetserver.service not found.”?

Problem scenario
You try this command from the Puppet Master server:

service puppetserver restart

But you get this error:

“Failed to restart puppetserver.service: Unit puppetserver.service not found.”

What should you do?

Solution
Do not use “puppetserver” in the command.  The correct command is:

service puppetmaster restart

[Sassy_Social_Share]

How Do You Get PHP to Have a Separate Line for an Input Field in a Submit Form?

Problem scenario
In a PHP “submit form” you have various fields.  Two of the fields are on the same row.  That is, when you open the page with a web browser, two input box fields are the same distance from the top and bottom of the page.  You want each field to be on its own line.  How do you do you get the PHP form to render the way you want?

How Do You Install and Configure the AWS CLI on a Linux Server (without the pip Command)?

Problem scenario
Using different package managers can lead to dependencies being met while systems administrators will encounter error messages that detect, find or determine something to the contrary (e.g., false unmet dependency errors or conditions).  Some enterprise policies disallow the pip command.  How do you set up the AWS CLI on a Linux server without the pip command?

Solution (Part 1 and Part 2)
Prerequisites
i. 

Using Bash How Do You Replace a Line with a String with a Forward Slash in a File by Its Line Number?

Problem scenario
How do you insert a string with forward slashes using a perl command like this?

perl -i -pe ‘s/.*/Hello World/ if $.==15’ foobar.txt

This command would insert “Hello World” on the 15th line of the text file named foobar.txt.  Instead of “Hello World” you want something else inserted that happens to include forward slashes (“/”).  You want to identify a line in a file by its line number. 

Using Bash How Do You Replace a Line in a File by Its Line Number?

Problem scenario
On your Linux server you know one line in a file needs to be replaced.  You can identify the file by its line number.  You have a string or pattern you want to be inserted where this line is. How do you do this with Bash?

Solution
To replace all the content of line 15 of foobar.txt with “Hello World” run this command:

perl -i -pe ‘s/.*/Hello World/ if $.==15’ foobar.txt

For something more advanced,

How Do You Deploy Puppet Agent to an Ubuntu 16 Linux Server in AWS?

Updated on 4/15/18

Problem scenario
You installed Puppet Master on an AWS instance of Linux.  (See this link if you want to install Puppet Master on Ubuntu.  If you want to install Puppet Master on a Red Hat Enterprise Linux server, see this link). You now want an AWS instance of Ubuntu to be configured as a Puppet Agent node with open source Puppet version 5.

How Do You Have PHP Return an Informative Error Message When a SQL Command Returns No Results?

Problem scenario
You have a PHP web page that integrates with Postgres behind the scenes.  You find that when a SQL command returns nothing (e.g., when a table name is used and it is known to not exist in the underlying database), the PHP web page is blank.  You want the result to be more clear about what happened or potentially happened.  How do you handle an exception or commonly occurring SQL query with no results using PHP?