How Do You Troubleshoot the PowerShell Error “Cannot connect to CIM Server: Access is denied”?

Problem scenario
You run a PowerShell command with a user who is not a local administrator on the server.  You get the error “Cannot connect to CIM server: Access is denied”.  How do you circumvent this error?

Possible solution #1
Make the user a local administrator.  Then try again.

Possible solution #2
Use JEA to allow the user to run the command. 

How Do You Troubleshoot the Powershell Error “Cannot find Get-Command”?

Problem scenario
You run a PowerShell command.  You get “Cannot find Get-Command” even though the command you entered was not Get-Command.  How do you solve this error?

Possible Solution #1
As an Admininstrator of the server, go to Server Manager -Tools -Computer Management.  In this Window (or MMC) go to System Tools -Local Users and Groups -Users.  Double click on the User that received the error.  

How Do You Create a Function in the C Programming Language?

Problem scenario
You are familiar with functions in programming languages (e.g., Python or SQL).  You like how you can create a modular program with a function.  Functions can allow you to reuse code and do data processing in a way that is readable.  Logic can be created rapidly when you know how to use a function.  How do you write a function in the C?

Solution

Prerequisites
Install the C compiler. 

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.  Can you store .ini and other configuration files in a version control system?

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” {