How Do You Troubleshoot a C Program That Prints a Warning Message like “expects argument of type ‘int’, but argument 2 has type ‘char *’ [-Wformat=]”?

Problem scenario
You compile a C program (with gcc foobar.cc) but you get an error message like this:

basicprog.c:5:13: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘char *’ [-Wformat=]
printf (“y is a %d\n”,y);

What do you do to not get this error?

Solution
While the code compiles, the executable may not run.  A compilation error can be benign. 

 » Read more..

How Do You Use Terraform and Kubernetes in a Simple Way (as a Proof of Concept)?

Problem scenario
You want to use Terraform and Kubernetes (in EKS). How do you do this in a simple way to test it out?

Solution
Prerequisite

This assumes you have deployed EKS. If you need assistance, see this posting.
This assumes you have installed Terraform. If you need assistance, see this posting.

Procedures

  1. This first step is optional.

 » Read more..

How Do You Fix the AWS CLI Error “Following required service principals [eks.amazonaws.com] were not found in the trust relationships”?

Problem scenario
You run an AWS CLI command, but you get this error:

An error occurred (InvalidParameterException) when calling the CreateNodegroup operation: Following required service principals [eks.amazonaws.com] were not found in the trust relationships of clusterRole arn:aws:iam::12345678910:role/foobar

How do you fix this?

Solution
Draft a command like this (but replace “12345677810:role/foobar” with the equivalent string in the error, and replace foobar.amazonaws.com with the service principal in the error):

aws iam list-roles –query ‘Roles[?Arn==arn:aws:iam::12345678910:role/foobar]’ | grep foobar.amazonaws.com

If the above command returns nothing,

 » Read more..

How Do You Install the dot Utility on a Debian/Ubuntu Server?

Problem scenario
You want the dot utility to transform “terraform graph” command output to usable files. What should you do?

Solution
Run this command: sudo apt -y install graphviz

 » Read more..

A List of PowerShell Books

1593279183PowerShell for Sysadmins: Workflow Automation Made Easy by No Starch Press

1617294160Learn Windows PowerShell in a Month of Lunches by Manning Publications

1449320686Windows PowerShell Cookbook: The Complete Guide to Scripting Microsoft’s Command Shell by O’Reilly Media

1789536669Mastering Windows PowerShell Scripting: Automate and manage your environment using PowerShell Core 6.0, 3rd Edition by Packt Publishing

B085RQNL9XWindows PowerShell and Scripting for Beginners: Complete Beginners Guide to learn Windows PowerShell and its Scripting by Independently published

1617295094Learn PowerShell Scripting in a Month of Lunches by Manning Publications

0735675112Windows PowerShell Step by Step by Microsoft Press

1789808537Windows Server 2019 Automation with PowerShell Cookbook: Powerful ways to automate and manage Windows administrative tasks,  » Read more..

How Do You Test the “mount -a” Command to Verify Sufficient Permissions on a Linux VM?

Problem scenario
You want to test “mount -a” to verify your user has sufficient permissions. You cannot add a physical device to the Linux server. How do you confirm “mount” will work?

Solution
Create a directory to be a mount point:
sudo mkdir /aaa
Find a block device to mount. One way would be to run this: sudo cat /proc/partitions
Once found,

 » Read more..

How Do You Install PostgreSQL on a Debian/Ubuntu Linux Server?

Problem scenario
You are using Debian or Ubuntu Linux and you want to install PostgreSQL. What do you do?

Solution
Run these commands:
sudo apt -y install postgresql
sudo systemctl start postgresql@11-main
sudo pg_ctlcluster 11 main start

 » Read more..

How Do You Install Erlang on a Debian/Ubuntu Server?

Problem scenario
You want to install Erlang on a Debian or Ubuntu Server (e.g., Linux Mint or Kali Linux). What should you do?

Solution
Run this script with sudo (e.g., sudo bash /tmp/erlang.sh):

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

echo “This script can take 20 minutes to run”
apt -y update
apt -y install autoconf
apt -y install libncurses5-dev
apt -y install libncursesw5-dev
apt -y install gcc
apt -y install python3
apt -y install make
cd /bin/
git clone https://github.com/erlang/otp.git
cd otp
./otp_build autoconf
./configure
echo “This next portion may take 15 minutes”
date /tmp/datetime.txt
make
make install
ln -s /usr/local/lib/erlang/bin/erl /usr/bin/erl
ln -s /usr/local/bin/erlc /usr/bin/erlc
ln -s /etc/alternatives/python3 /usr/bin/python
echo “Script run completed.”
echo ” ”
echo “Many errors above (if there are any) may be ignorable”
echo “try the ‘erl’ command with no quotes to see if Erlang was installed”
echo ‘If you get to a carrot prompt,  » Read more..

How Do You Create an EC-2 Instance Running RHEL 8.x in the AWS Web UI?

Problem scenario
You want to use the AWS Management Console to create a server. What do you do?

Solution
Prerequisite

This assumes you have already configured a .ppk file, and you know its password. If you need assistance, see this posting.

Procedures

  1. Log into the AWS management console (aws.amazon.com).
  2. Go to the EC2 Dashboard.

 » Read more..

How Do You Troubleshoot “yum-config-manager command not found”?

Problem scenario
You run a “yum-config-manager” on a Linux server, but you get an error about the command not being found. What should you do?

Possible solution
Run this: sudo yum -y install yum-utils

This should install it. If it doesn’t, you may not have a “yum” distribution of Linux. You may be using SUSE, Debian or Ubuntu Linux. Run this command to find out what family of Linux you need: cat /etc/*-release

 » Read more..