What is an Azure Logic App?

Question
You have heard about Azure's Logic Apps.  What are they and what do they do?

Answer
Azure Logic Apps are a PaaS solution.  Logic Apps execute in response to a triggering event (e.g., recurring on a schedule based on time, receiving a REST API call, or a Tweet being posted).  They initiate a variety of different tasks as you can determine the OS architecture (either Windows or Linux) without having to manage that same OS.

Logic Apps are very flexible and powerful.  Logic Apps can do many things such as message queueing, monitor Twitter accounts (if you enter your Twitter account's credentials), integrate with SalesForce, or send REST API POST calls with authentication headers. 

How Do You Install Redis on RedHat 7?

Problem scenario
You want to install Redis on RedHat Enterprise Linux 7.x.  (Redis gets its name from "REmote DIctionary Server" according to this external link.  It is one of the most popular NoSQL solutions on the market according to G2 Crowd.)  What do you do to install Redis on a RHEL server?

Solution
Prerequisite
This solution requires wget.  You may need to install it: sudo yum -y install wget

Procedures
Run these three commands:
sudo wget -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/
sudo rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-*.rpm
sudo yum -y install redis

To test the installation, run these two commands:

sudo service redis start
redis-cli ping  
# This should return the word "PONG"

How Do You Install Zookeeper on Any Type of Linux?

Updated on 5/14/20 with a minor update on 11/13/21

Problem scenario
You want to install Apache Zookeeper with a script.  You want the same script to work regardless of what distribution of Linux you are using (e.g., Ubuntu/Debian, RedHat (including CentOS/Fedora), or SUSE).  How do you write a script to install the latest version of Zookeeper?

Solution
The file that is attached called zki.txt is not needed but is attached as a reference copy of the below.  Create a file in /tmp/ and call it zookeeper.sh.  Below is the content of /tmp/zookeeper.sh:

#!/bin/bash
# Written by www.continualintegration.com

version=3.7.0 #change this as needed
debianjavaversion=11

distro=$(cat /etc/*-release | grep NAME)

debflag=$(echo $distro | grep -i "ubuntu")
if [ -z "$debflag" ]
then   # If it is not Ubuntu, test if it is Debian.
  debflag=$(echo $distro | grep -i "debian")
  echo "determining Linux distribution..."
else
   echo "You have Ubuntu Linux!"
fi

rhflag=$(echo $distro | grep -i "red*hat")
if [ -z "$rhflag" ]
then   #If it is not RedHat, see if it is CentOS or Fedora.
  rhflag=$(echo $distro | grep -i "centos")
  if [ -z "$rhflag" ]
    then    #If it is neither RedHat nor CentOS, see if it is Fedora.
    echo "It does not appear to be CentOS or RHEL..."
    rhflag=$(echo $distro | grep -i "fedora")
    fi
fi

if [ -z "$rhflag" ]
  then
  echo "...still determining Linux distribution..."
else
  echo "You have a RedHat distribution (e.g., CentOS, RHEL, or Fedora)"
  yum -y install java-1.8.0-openjdk* nc   # install nc for initial testing only.
  JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk
  echo 'export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk' >> ~/.bashrc
  source ~/.bashrc
  source /etc/environment
fi

if [ -z "$debflag" ]
then
  echo "...still determining Linux distribution..."
else
   echo "You are using either Ubuntu Linux or Debian Linux."
   apt-get -y update # This is necessary on new AWS Ubuntu servers.
   apt -y install openjdk-$debianjavaversion-jre-headless unzip
fi

suseflag=$(echo $distro | grep -i "suse")
if [ -z "$suseflag" ]
then
  if [ -z "$debflag" ]
  then
    if [ -z "$rhflag" ]
      then
      echo "*******************************************"
      echo "Could not determine the Linux distribution!"
      echo "Installation aborted. Nothing was done."
      echo "******************************************"
      exit
    fi
  fi
else
   zypper -n install java-1_8_0-openjdk
fi

curl https://dlcdn.apache.org/zookeeper/zookeeper-$version/apache-zookeeper-$version-bin.tar.gz > /tmp/apache-zookeeper-$version-bin.tar.gz 
cp /tmp/apache-zookeeper-$version-bin.tar.gz /bin/apache-zookeeper-$version-bin.tar.gz
cd /bin
tar -zxvf apache-zookeeper-$version-bin.tar.gz
sudo mkdir -p /usr/lib/jvm/java-$debianjavaversion-openjdk-amd64/conf/management/
sudo touch /usr/lib/jvm/java-$debianjavaversion-openjdk-amd64/conf/management/management.properties

echo 'tickTime=2000
dataDir=/var/zookeeper
clientPort=2181' > /bin/apache-zookeeper-$version-bin/conf/zoo.cfg

echo "To find the version that is installed, and confirm installation worked, run these two commands."
echo "cd /bin/apache-zookeeper-"$version"-bin/bin"
echo "sudo /bin/bash zkServer.sh start-foreground"
echo "Then start a second terminal session to the server"
echo "From the second terminal session, run this echo command:"
echo "echo status | nc 127.0.0.1 2181"
echo "Then use Ctrl-c on the first terminal to exit out and move on."

How Do You Install a C Compiler on Linux?

Problem scenario
You want to program in the C programming language on a Linux server.  How do you code in C and test your programs?

Solution
Overview

Install the C compiler.

Procedures
1.  To find your distribution of Linux run this command:  cat /etc/*-release | grep -i pretty

2.  Find the one option of the below three that applies to your Linux:

  • For a Red Hat distribution (e.g., CentOS/RHEL/Fedora), run this command:  sudo yum -y install gcc gcc-c++
  • For a SUSE distribution of Linux, run this command:  sudo zypper -n install gcc gcc-c++

          # If you need assistance configuring a repository for SUSE for the first time, see this posting.

  • For Debian or Ubuntu distributions, run this command:

           sudo apt-get -y update && sudo apt-get -y install build-essential

How Do You Get Zypper Commands to Work to Install Packages on SUSE?

Problem scenario
No repositories are configured on your Linux SUSE server.  You want to install packages.  You cannot use zypper commands to install Linux utilities or other packages.  You want to know how to you use SUSE direct address XML files to install packages.  You think these XML files could help.  When zypper commands fail because a repository has never been configured on Linux SUSE, how do you begin to install packages?  How can you configure your server to work with a publically available (e.g. internet) server?

Solution
Run these two commands:

sudo zypper ar http://download.opensuse.org/distribution/leap/42.3/repo/oss/ openSUSE-Leap-42.3-Oss
sudo zypper se gcc

Now you are ready to install regular packages with zypper.  (The second command above searches for a C compiler.  You could search for a different package, but this one is common.)

A List of Chef Books

A Practical Guide to Continuous Delivery by Eberhard Wolff         
Automation through Chef Opscode: A Hands-on Approach to Chef by Navin Sabharwal and Manak Wadhwa
Chef Essentials by John Ewart
Chef Cookbook - Third Edition by Matthias Marschall      
Chef Infrastructure Automation Cookbook - Second Edition by Matthias Marschall
Chef Server on AWS (AWS Quick Start) by AWS Whitepapers and Amazon Web Services
Configuration Management with Chef-Solo by Naveed ur Rahman
Customizing Chef: Getting the Most Out of Your Infrastructure Automation by Jon Cowie
Exploration of Chef: Fast And Easy Learning! by Michael Bohner
Implementing Chef by Matt Stratton
Infrastructure as Code: Managing Servers in the Cloud by Kief Morris
Instant Chef Starter by John Ewart
Learning Chef by Rishabh Sharma
Learning Chef: A Guide to Configuration Management and Automation  by Mischa Taylor  and Seth Vargo
Learning MCollective: Parallel Server Management in Puppet and Chef  by Jo Rhett
Managing Windows Servers with Chef by John Ewart
Mastering Chef by Mayank Joshi
Mastering Chef Provisioning by Earl Waud
Test-Driven Infrastructure with Chef: Bring Behavior-Driven Development to Infrastructure as Code by Stephen Nelson-Smith
Using Chef with Microsoft Azure by Stuart Preston

How Do You Install Sysdig in a New Docker Container to Try It Out?

Problem scenario
You want to monitor Docker containers.  Therefore you want to install Sysdig to try it out.  How do you pull down a Docker container that has Sysdig installed in it?

Solution

Prerequisites
Docker needs to be installed.  If you need to install Docker on a CentOS/RedHat/Fedora distribution, see this posting.  If you need to install Docker on a Debian/Ubuntu, see this posting.  If you need to install Docker on a Linux SUSE, see this posting.  The Docker service needs to be running.

Procedures
1.  If your server (the Docker host) is using a Debian/Ubuntu distribution, run this command:
sudo apt-get -y install linux-headers-$(uname -r)

If your server (Docker host) is using a CentOS/RedHat/Fedora distribution, run this command:
sudo yum -y install kernel-devel-$(uname -r)

2.  Be advised that it is not recommended to use --privileged and docker.sock in the way that this step describes.  This is for testing purposes in a non-production environment.  The Docker host should otherwise be secure, and you should not have sensitive data on it. 

To test out Sysdig, run these two commands:
docker pull sysdig/sysdig

docker run -i -t --name sysdig --privileged -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro sysdig/sysdig

How Do You Prepare Any Distribution of Linux in GCP to Have Similar Features to New AWS Instances?

Problem scenario
You want to have your Google Cloud Platform servers be ready for what you consider to be "regular" usage.  What should you do to get a server to be ready for these four things listed below?

1.  Able to SSH into it via Putty with a non-root user.
2.  Able to sudo with this non-root user.
3.  Files when modified in vi in "insert mode" can to receive clipboard-copied content with a right-click of a mouse.
4.  The user can press the up key to see previous commands in the history of commands entered.

(These settings are typical with AWS AMIs.)  How do you have a Linux server of any distribution (CentOS/RHEL/Fedora, Debian/Ubuntu, or SUSE) have these four traits before you have ever logged into it?

Solution

Summary
Use the "Startup script" in Google Cloud Platform.  This script comes with precautions.  Be careful when pasting it.  The lines can potentially not wrap properly.  Carriage returns could be introduced to make this script fail.  Be very careful because this script creates a user with sudoer privileges.  It also has a plaintext password in it for this user!  This script is for informational purposes.

If you use Puppet for example, the facter tool will be able to retrieve the entire script below after the script below runs.  This is a potential security concern!

This will create two "ChallengeResponseAuthentication yes" stanzas in most Red Hat family servers.  You can manually comment one out.  It will not prevent you from logging on.

Procedures
1.  When creating an virtual machine in Google Cloud Platform, there is a field for Startup script.  You may have to click the link "Management, disks, networking, SSH keys" to see the Startup script text field.  You can use this in the text field for "Startup script" if you want a user named "cooluser" with a password of "coolpassword" that can log in via SSH right from the beginning.  Use the content of this attachment.  It is a bash script named gcp_start_script_for_linux.txt.  The extension .txt is used so it is not blocked by strict security software programs.

2.  After the server is up, in the GCP web console click on the server's name.  This way you can view the details.  Click the "Edit" button.  Scroll down to the "Custom Metadata" or search for the word "start".  Click on the "X" to the right of it to eliminate the script as this picture shows (otherwise the script will run every time the server is rebooted):

Scroll down and click "Save".

3.  You are done.

For future reference

The settings are permanent.  You can reboot the server, and the settings will remain.  This posting, via the attached script, answers these four questions:
#1  How do you get a new Linux server in GCP to allow for Putty connections with a non-root user from the beginning?
#2  How do you get new Linux servers to have a non-root user be given sudoer privileges before you log in manually to the virtual machine? 
#3  How do you get Linux servers to support right-click mouse insertions of text via the vi text editor before you ever have logged into it? 
#4  How can you get the Linux server to support browsing previous commands with the up arrow before you have logged into it?

What Is the Equivalent of “find where the site.pp file should go on the Puppet Master”?

Problem scenario
You are managing a Puppet master server.  You want to find where the site.pp file should be.  Where do you look to determine the configuration?

Solution
The result of this command is the canonical answer:
puppet master --configprint manifest

If the above returns "No manifest", then run this command:
sudo puppet master --configprint all | grep basemodule

One of the paths resulting from the above command could be the answer to your question.  You may need to build out a directory tree on the Puppet master server with a command like this:

mkdir -p /etc/puppet/code/environments/production/manifests/

What is RedShift?

Question
There are five technology-related concepts called "Redshift" or "red shift."  What is the difference between them?

Answer
We hope to provide a thorough disambiguation of the term "Redshift" or "red shift."

In physics we know that visible light has a wavelength.  Depending on the color we see, the wavelength can be longer or shorter than others.  The longest wavelength is red (according to this page https://socratic.org/questions/what-color-of-light-has-the-longest-wavelength).  When objects in space move closer to a telescope, their wavelengths shorten and the light appears to be more blue (according to this posting https://www.space.com/25732-redshift-blueshift.html that worked).  When objects move farther away, they appear to be more red as the movement affects one cycle of a wave.  That is the trajectory increases the length of one wavelength so the visible color is more red (Space.com).

There is an economics of technology concept called "red shift theory" that was coined by Greg Papadopoulos (Informationweek.com).  This theory states that companies that use vastly more servers and I.T. infrastructure than normal companies will grow more rapidly than normal companies (Informationweek.com).  It is interesting to note that before 2008, he in effect predicted that Hadoop would satisfy the heavy demands of businesses.  He thought that large numbers of commodity (or low cost) servers could overcome the limitations of Moore's Law (Informationweek.com).  (In some articles there is no space between the words "red" and "shift" when referring to Papadopoulos's theory.  In some articles words are in uppercase.)  To learn more about this term, see this link (Zdnet.com).  

Amazon Redshift is a data warehouse PaaS offering for AWS.  It is based on PostgreSQL and the company ParAccel's technology (Wikipedia.com).  The color "red" can refer to Oracle's red logo; Oracle is nicknamed "Big Red" and this is the source of the term Redshift (according to a Quora answer).

Redshift is also a collection of astronomy software applications that can be used in planetariums or used to control telescopes.  To learn more see this external link or Wikipedia.

There is a Linux application called Redshift.  It is designed for the GUI desktop of Linux.  Redshift changes the color display throughout the day based on your geographic location and the season.  It makes it easy on the user's eyes and helps prevent insomnia.  To learn more about it, see this website, the main GitHub site for the project or Wikipedia.