How Do You Find the Subscription ID for an Azure Account?

Problem scenario
You want to find the subscription ID for your Azure account.  What do you do?

Possible Solution #1
Log into the Azure Portal.  In the upper right click on your account and then click on “My permissions.”  You should see an alphanumeric string near your subscription.

Possible Solution #2
Prerequisite

If you have Windows 7 you need to install Azure PowerShell;

How Do You Delete a CloudFormation Stack with the AWS CLI?

Problem scenario
You deployed servers with CloudFormation.  You know the name of the stack.  How do you delete the stack with the AWS CLI?

Solution

Prerequisite
This assumes you have installed and configured the AWS CLI.  If you need help with this, see this posting.

Procedure
Run this command (but replace “continualstack” with the name of the stack that you want to delete:
aws cloudformation delete-stack –stack-name continualstack

How Do You Copy All the Files in a Given Subdirectory and Place Them into a New .tar.gz File?

Problem scenario
You want to make copies of every file in a subdirectory and create a single .tar.gz file.  What do you do?

Possible Solution #1 (the files with the full path aka directory tree they are in)
Run this command: tar -czvf archive.tar.gz /path/to/source/files/subdirectory/

The above command will take a copy of all the files in /path/to/source/files/subdirectory/ and create a single file that is compressed with those copies. 

How Do You Write a Groovy Program to Read in User Input from the Keyboard and Print It Out?

Problem scenario
You want to test out Groovy as a scripting language.  You want a Groovy program to read in user input and print it out to the screen.  How do you do this?

Prerequisite
This assumes that you have already installed Groovy on a Linux server.  If you are running a Red Hat derivative (e.g., CentOS, RHEL, or Fedora), click on this link

How Do You Unprotect a Git Repository That Is in a GitLab Project?

Problem scenario
You have a Git repository that is protected in a GitLab project.  You want to allow developers to upload code directly to the master branch (not alternative branches).  What do you do?

Solution
It may be more advisable to work with a branch of a git repository.  This is a basic solution for testing or those instances when you want to work directly with the master branch.  

How Do You Pronounce quay.io?

Problem scenario
You are interested in the quay.io to store Docker images. You do not know how to say the term “quay” as in “quay.io.” How should it be pronounced?

Answer
The word “quay” is pronounced “kway” (rhymes with stray). (The pronunciation “key” may be acceptable too.) If you want to see the source, click on this external page:
https://developers.redhat.com/blog/2019/06/26/using-quay-io-to-find-vulnerabilities-in-your-container-images/

How Do You Troubleshoot the C Compile-Time Error “gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory”

Problem scenario
You run gcc to compile a C program, but you get this error:
“gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory”

Solution
Install a C compiler.  If you do not know how, see this posting.

How Do You Troubleshoot the Ansible Problem “ERROR! Syntax Error while loading YAML. mapping values are not allowed here”?

Problem scenario
You are trying to run an Ansible playbook with the “become: yes” stanza.  You get this error after your ansible-playbook command:

“ERROR! Syntax Error while loading YAML.
  mapping values are not allowed here

The error appears to have been in ‘/home/cooluser/good.yaml’: line 5, column 10, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be…”

What should you do?

How Do You Run a Java Program That Has Compiled Successfully?

Problem scenario
You have compiled the source code of a Java program into bytecode (with a .class extension). You try to run it (execute the bytecode) with a javac command (javac HelloWorld), but you get “error: Class names, ‘HelloWorld’, are only accepted if annotation processing is explicitly requested
1 error “

What should you do?

Solution
Run it with the java command like this (with no “.class” extension): java HelloWorld

How Do You Find the Instance Ids of Virtual Servers in AWS Using Python?

Problem scenario
You want to write a Python program to display the instance IDs of virtual servers in AWS.  What do you do?

Solution

Prerequisites
This assumes you have installed Boto3.  If you do not know how, see this posting.  This assumes that you are running it on a server that has access to AWS (e.g., it has access to the internet).