How Do You Troubleshoot the C Program Error “error: expected ‘;’ before string constant”?

Problem scenario
You try to compile a program with “gcc nameofprog.cc”.  You get this output: “foobar.cc.:55:error: expected ‘;’ before string constant”

What do you do to compile your program?

Solution
Go to line 55 of foobar.cc.  If there is a printf command, be sure that the thing to be printed is surrounded by parentheses.  Here is an example of a line that will cause the problem:
   printf “This is a test”;

…

How Do You Log onto a Free WiFi Network When There Is a “Internet not available” Error?

Problem scenario
You try connect via your wireless router to a WiFi network (e.g., at a restaurant, hotel, or public library).  You open a web browser because you were told you would be prompted with a splash screen.  On this page you would agree to the terms of service and/or enter a password.  You are not seeing this web page.  You try different URLs (e.g., www.yahoo.com, www.google.com).  You are never prompted for a username or password.

…

How Do You Troubleshoot the C Program Error “warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]”?

Problem scenario
You try to compile a program with “gcc nameofprog.cc”.  You get this output:

“warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]”

What do you do to compile your program?

Solution
The program may still compile and run.  Look for the a.out file to be created.  It may be a working C program.  Just run it like this:  ./a.out

To get rid of the error,

…

Why Does the Repoquery Command Return Incorrect Information When the %{Size:M} Flag Is Used?

Problem scenario
You ran this command:  sudo repoquery openssl* –qf “%{name} %{size:m}”

You saw the following:

openssl 492 M
openssl-devel 1542 M
openssl-devel 1542 M
openssl-libs 991 M
openssl-libs 1221 M
openssl-perl 70.3 M
openssl-pkcs11 54.3 M
openssl-static 1068 M
openssl-static 1268 M
openssl098e 803 M
openssl098e 793 M

You know that the openssl packages are 

…

Is It Acceptable to Store Configuration Files in Git, Subversion, CVS or Another Code Versioning Tool?

Problem scenario
You like the backup feature of a code versioning tool for potentially restoring files in a disaster recovery situation.  You want to store complete code bases including necessary configuration files in such a repository.  

This reputable link (https://www.cyberciti.biz/tips/my-10-unix-command-line-mistakes.html) says to use code versioning tools to store configuration files.  However this different reputable link says to not use code versioning tools to store configuration files. 

…

How Do You Access the Networking Port of a Docker Container When There Appears to Be No Port Mapping, Just a Single Port Exposed by Itself?

Problem scenario
You run “docker ps -a” and see values in the PORTS column.  You see values such as these for two separate containers:

Container 1 has this:  0.0.0.0:32775->5000/tcp

Container 2 has this:  5731/tcp

You cannot reach the containers that have no “->” symbol in them via web browsers or other network connectivity tools.  You can reach those containers with the “->” symbol in the PORTS value. 

…

How Do You Use Terraform to Create AWS Servers?

Problem scenario
You want to use Terraform to deploy EC-2 instances (VMs in AWS).  How do you do this?

Solution
These directions can work on a Linux server in your enterprise, a Linux server in Azure or a Linux server in AWS.

1.  Install Terraform.  See this link if you do not know how.

2.  Create a file like this called contint.tf with this as the content:

provider “aws” {
 

…

How Do You Install Docker on Debian 9 in GCP?

Problem scenario
You are running Debian 9 in GCP.  You want to install Docker on this server.  What should you do?

Solution
1.  Create a script in /tmp/ call installer.sh with the following lines of content:

#!/bin/bash
apt-get -y update
apt-get install -y apt-transport-https ca-certificates wget software-properties-common
wget https://download.docker.com/linux/debian/gpg
apt-key add gpg
echo “deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable” | sudo tee -a /etc/apt/sources.list.d/docker.list
apt-get -y update
apt-cache policy docker-ce
apt-get -y install docker-ce

2. 

…