How Can You Use CloudTrail for the First Time in Your AWS Account?

Problem scenario
You want to log or monitor AWS activity (e.g., AWS Management Console, AWS CLI, and/or AWS SDK actions). You do not want encryption because you are just testing it out. How do you use CloudTrail to do this?

Solution

  1. Log into AWS.
  2. Go to this link: https://console.aws.amazon.com/cloudtrail/
  3. Click “Create a trail”
  4. Enter a descriptive name for your trail.

How Do You Fix the Stack Storm Error “Failed to authenticate”?

Problem scenario
You run an st2 command, but it fails with an error like this:

Failed to authenticate with credentials provided in the config.
ERROR: 401 Client Error: Unauthorized
MESSAGE: Invalid or missing credentials for url: http://127.0.0.1:9100/tokens

What should you do?

Solution
Run a command like this (but replace “jdoe” and “passwordhere” with your credentials respectively):

st2 login jdoe –password ‘passwordhere’

Now run the st2 command(s).

How Do You Pass an Array to a Method in Java?

Problem scenario
You want to pass an argument to another piece of code (e.g., a function in Java). How do you pass an array as a parameter to another portion of code?

Solution
Java only has methods — not functions (according to this posting).

This code (which should be called contInt.java) will pass a two-dimensional array called twoD to the method “coolp”.

How Do You Create Peering Connections to EC-2 Instances, inside VPCs, So They Can Communicate with Each Other?

Problem scenario
You want to use peering connections between two VPCs (in the same region) so that EC-2 instances in each VPC can communicate with each other. How do you do this?

Solution
Prerequisite

This assumes you have two VPCs already created in the same region. This assumes you have EC-2 instances also created.

i. Create one VPC. Go to VPC and give it a name.

How Do You Troubleshoot the Error “unexpected EOF while looking for match `\”‘”?

Problem scenario
You run a Bash command or an Ansible playbook, but you get stymied by this problem: “unexpected EOF while looking for match `\”‘”

What should you do when you see this message?

Solution
Verify your escape characters have a space after the symbol that they are escaping.

For example, if you have \””

change it to \” “

The escape character may be working on two sequential symbols (without a space).

How Do You Troubleshoot “ModuleNotFoundError: No module named ‘zlib'”?

Problem scenario
You are trying to install Python 3 but you get a message about zlib. This is the full message:

rm /usr/local/lib/python3.9/lib-dynload/_sysconfigdata__linux_x86_64-linux-gnu.py
rm -r /usr/local/lib/python3.9/lib-dynload/__pycache__
/bin/install -c -m 644 ./Misc/python.man \
/usr/local/share/man/man1/python3.9.1
if test “xupgrade” != “xno” ; then \
case upgrade in \
upgrade) ensurepip=”–altinstall –upgrade” ;; \
install|*) ensurepip=”–altinstall” ;; \
esac; \
./python -E -m ensurepip \
$ensurepip –root=/ ; \
fi
Traceback (most recent call last):
File “<frozen zipimport”, …

How Do You Troubleshoot “build.cfg No such file” or “libgnu.a No Such file”?

Problem scenario
You do not have make installed, but you are trying to install it. You get the following message:

build.sh: line 21: ./build.cfg: No such file or directory
sed: can’t read lib/Makefile: No such file or directory
sed: can’t read lib/Makefile: No such file or directory
sed: can’t read Makefile: No such file or directory
sed: can’t read lib/Makefile: No such file or directory
./lib/libgnu.a: No such file or directory

What should you do?