Using Ubuntu, How Do You Install a C++ Compiler and Run a Basic C++ Program?

Problem scenario
You want to install a C++ compiler in Ubuntu.  You want to write a basic C++ program and run it.  How do you do these things?

Solution
1. As root, install a C++ compiler with this command:

apt install g++

2. Create a basic program.  Here is an example.  Name this file hello.cpp and put this as the content:

#include <iostream>

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 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 Install Npm and/or node.js on a AWS Instance of RHEL?

Problem scenario
Using a RHEL server in AWS, you try this command “npm -v”, and it shows that npm is not installed.  You want to use the npm utility or you want Node.js to be installed on your RedHat version 7 Linux server in AWS.  You may have tried various yum commands but received errors about dependencies.  Various other scripts fail to get npm to be a recognized command.  How do you install npm and/or Node.js without changing yum repositories and without using the wget command?

How Do You Install npm on a CentOS/RedHat/Fedora Server?

Problem scenario
You enter the command “npm -v” but get an error about the command not being found or recognized.  How do you install npm on a RedHat derivative Linux server?

Solution
(You may want to see these directions instead if you want to use a script that will work on any distribution of Linux (including RHEL, Debian or SUSE distributions). 

How Do You Use JEA (Just Enough Administration) to Give Users the Rights to Perform Select PowerShell Tasks?

Problem scenario
You want to empower non-administrator users to perform a subset of Windows administrator-level functions.  Specifically you want to give a user with limited privileges the ability to check the local software firewall rules.  This user needs to validate if they are configured appropriately.  This user account will otherwise have limited privileges.  You want to adhere to the recommended practice of least privileges.  You want to use JEA (Just Enough Administration) to enhance the user’s privileges. 

How Do You Find Files That Were Modified Recently and Have a Specific String in Their Name?

Problem scenario
On a Windows computer you want to find .txt files that were modified within the past four days. Using PowerShell you want to find files in a directory and its subdirectories that were modified within a certain time (within the past four days) and have a pattern in the name of “.txt”. How do you search every folder on the computer (or server) to filter files with 

A List of C# Books

Agile Principles, Patterns, and Practices in C# by Robert C. Martin and Micah Martin
Beginning ASP.NET 4.5.1: in C# and VB (Wrox Programmer to Programmer) by Imar Spaanjaars
Beginning C# Object-Oriented Programming (Expert’s Voice in .NET) by Dan Clark
Beginning C# Programming with MonoGame by A.T. Chamillard
Beginning C# Programming with Unity: Visual Studio Edition by A. T. Chamillard
Beginning C# 6 Programming with Visual Studio 2015 by Benjamin Perkins,

How Do You Install an Older Version of Ansible on an AWS Instance of Red Hat Linux?

Problem scenario
You are using Red Hat Enterprise Linux in AWS.  You need to install an older version of Ansible — not the newest.  The pip command and other supported ways of deploying Ansible automatically use the newest version.  You also want to install Maven. 

Solution
Run this script with “sudo”. (You could run it as root, but that is not recommended.)  The server must be in a Security Group with access to the internet.

How Do You Troubleshoot the Java Error “class … is public, should be declared in a file named foobar.java”?

Problem scenario
You copied a Java program from the Internet.  You named the file foobar.java.  You try to compile it (e.g., with “javac foobar.java”), but you get this error:

foobar.java:6: error: class ContInt is public, should be declared in a file named ContInt.java
public class ContInt
       ^
1 error

What do you do?

Solution
Rename foobar.java to be ContInt.java.