How Do You Write a Hello World Program in Golang?

Problem scenario
You want to test out the Golang compiler.  You want to know how to write a basic Go program and run it.  What do you do?

Solution
Prerequisites

You must have the Golang compiler installed.  If you need help, see this posting.

Procedures
1.  Create a file called hw.go with the following five lines:

package main
import “fmt”
func main() {
fmt.Println(“This is a Hello World program!”)
}

2. 

 » Read more..

How Do You Install the Lua Compiler on a CentOS/RHEL/Fedora Server?

Problem scenario
You want to run Lua programs on your Red Hat derivative distribution of Linux server (e.g., CentOS/RHEL/Fedora).  

Solution
1.  Make a script like this called lua.sh with the following lines:

yum -y install readline-devel gcc
curl https://www.lua.org/ftp/lua-5.3.5.tar.gz > /tmp/lua-5.3.5.tar.gz
mv /tmp/lua-5.3.5.tar.gz /opt/
cd /opt/
tar -xzvf lua-5.3.5.tar.gz
cd lua-5.3.5
sudo make linux test
echo “ENV=$ENV:/opt/lua-5.3.5/src/” >>

 » Read more..

What Are The Differences between CMD and ENTRYPOINT in Docker?

Question
Dockerfile has reserved words CMD and ENTRYPOINT.  They seem to do the same thing.  What are the differences between CMD and ENTRYPOINT in Docker besides their words’ lengths?

Answer
There are many similarities between these two reserved words in Dockerfile “language.”  But here are three differences:

#1  “…CMD can be overwritten by an argument to docker run, while ENTRYPOINT can be overwritten only by using the –entrypoint option of docker run.” is a quote taken from page 43 of 

 » Read more..

How Do You Install docker-compose on Any Distribution of Linux?

Problem scenario
You want a Bash script to install Docker on any distribution of Linux.  You want to use the same script for each Linux server.  How do you write a script that will install docker-compose on any type of Linux including CentOS/RHEL/Fedora, Debian/Ubuntu and Linux SUSE?

Solution
Overview

This will work with AWS or Azure servers or on-premise servers.  It requires that the server have access to the internet.

 » Read more..

How Do You Troubleshoot the Ansible Message “AnsibleOptionsError…ansible.cfg…File contains no section headers”?

Problem scenario
You try to run an Ansible playbook but you get this error “AnsibleOptionsError…ansible.cfg…File contains no section headers”

Your ansible.cfg file has headers. What should you do?

Solution
Eliminate indentations.  The [header] should be on the far left of the screen with no leading spaces.

 » Read more..

How Do You Troubleshoot the Bash Error “syntax error near unexpected token”?

Problem scenario
You run a Bash script with a function that you developed yourself.  When you run the script, you get the error “syntax error near unexpected token”.  What should you do to solve this?

Solution
Call the function without the parentheses.  Do not use this: contintfunc()

Use this when you call, not define, your previously defined function:

contintfunc

 » Read more..

How Do You Use an .sls File to Push down Configuration Changes Using SaltStack?

Problem scenario
You want to leverage the CM tool SaltStack.  You have Salt Master installed, and now you want to push down files to Salt Minion client servers.  How do you do this?

Solution
Prerequisites

This solution requires Salt Master to be configured.  If you need assistance, see this posting.

Procedures
1.  The Salt Minion client servers will need to run this:  sudo systemctl start salt-minion

2.a.  On the Salt Master server create a directory /srv/salt/ (e.g., sudo mkdir -p /srv/salt)

2.b.   Create this file: /srv/salt/top.sls with the following three lines of content:

How Do You Use Python to Create a Server in AWS?

Problem scenario
You want to be able to create EC-2 instances in AWS with a Python script.  How do you do this?

Solution
Prerequisites

This assumes you have installed Boto3.  If you do not know how, see this posting.

Procedures
As a reference, you may go here to learn more about Boto’s features:  http://boto3.readthedocs.io/en/latest/guide/migrationec2.html
Use this program:

“”” Usage instructions
1.  » Read more..

How Do You Get a Head Set (Or Pair of Ear Buds) to Work with Your Windows Machine?

Problem scenario
You insert 3.5 mm jack for your headphones (audio cable) that is known good into your laptop.  You cannot hear sound out of it.  You go to different parts of the Control Panel, but you cannot see evidence that your Windows computer (laptop or desktop) sees the device.  How do you get your headphones to work?

Root cause
Some I.T. policies disable the 3.5 mm audio jack on the Windows computers. 

 » Read more..

How Do You Solve the Error “failed to push some refs” after a “git push origin master”?

Problem scenario
You have two Linux servers (server A and server B).  You have a Git repository on server A.  You are logged into server B as jdoe. You cloned a Git repository from server A (with a “git clone git@gitlabFQDN:/path/to/nameOfRepo.git” command).  You added some files and used “git commit” on server B.  From server B you run this command as the Linux user jdoe: git push origin master

You get this problem:

remote: GitLab: You are not allowed to upload code for this project.

 » Read more..