How Do You Install and Configure Gulp?

Problem scenario
You want to use Gulp the automation tool (https://gulpjs.com/).  How do you install it and get it to work on Linux (either a Debian distribution or a Red Hat distribution)?

Solution
1.  If you are using CentOS, Red Hat Enterprise Linux, or Fedora, run these two commands:

sudo yum -y install nodejs npm  # *
sudo npm install -g gulp

If you are using Debian or Ubuntu Linux,

How Do You Install Groovy on Centos 7.X?

Problem scenario
You want to install Groovy on CentOS 7.x but no yum repositories are configured for directly installing it.  What should you do?

Solution
Run these commands:

sudo yum -y install ant ant-junit antlr-tool apache-commons-cli apache-commons-logging apache-ivy bsf jansi jline junit objectweb-asm tomcat-jsp-2.2-api tomcat-servlet-3.0-api xstream

curl http://rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/groovy-1.8.9-7.el7.noarch.rpm > /tmp/groovy-1.8.9-7.el7.noarch.rpm

sudo rpm -i /tmp/groovy-1.8.9-7.el7.noarch.rpm

How Do You Install npm and Node.Js on Any Distribution of Linux?

Problem scenario
You have Linux servers of different distributions (including Debian/Ubuntu, Red Hat derivatives such as CentOS, RHEL, or Fedora, and Linux SUSE).  You want to install npm and Node.js on them.  What do you do?

Solution
Prerequisites
i.  You need a server with at least 1 GB of RAM.  To add virtual memory, see this posting

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. 

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 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,

How Do You Install Golang on to Any Type of Linux?

Updated on 10/18/19

Problem scenario
You want to do some coding in the Go programming language.  You want a script to install Golang on any distribution of Linux (e.g., CentOS/Red Hat Enterprise Linux/Fedora, Debian/Ubuntu, or SUSE).  What do you do?

Solution
1.  Create a file in /tmp/ called go.sh with the following content:

version=1.10.8 # Change this version as needed
curl https://storage.googleapis.com/golang/go$version.linux-amd64.tar.gz /tmp/go$version.linux-amd64.tar.gz
cp /tmp/go$version.linux-amd64.tar.gz /usr/local/go$version.linux-amd64.tar.gz
cd /usr/local/
tar xzvf go$version.linux-amd64.tar.gz
#echo “export PATH=””$””PATH:/usr/local/go/bin” ~/.profile
echo “export PATH=””$””PATH:/usr/local/go/bin” /etc/profile.d/go.sh
echo “You will have to log out and log back in for go to work.”
echo “You can use the ‘go version’ command to determine what version was installed”

2. 

How Do You Demonstrate Recursion in a Sorting Algorithm Written in Python?

Problem scenario
You want to use recursion in Python in a sorting algorithm. How do you do this?

Solution
Save this program as contintsort.py and run it python contintsort.py. The code closer to the top is in Python 2, and the code closer to the bottom is in Python 3.

# Written by www.continualintegration.com
# Usage is self-explanatory. Just run the program. python contintsort.py
# No extra files are needed. …