Why Would Boto3 Not Show a Peering Connection That the AWS CLI Shows?

Problem scenario
You have found an AWS CLI command that shows you output consistent with the console. You run this:

aws ec2 describe-vpc-peering-connection –region us-west-2 | grep pcx-abcd1234

The results show you a peering connection called pcx-abcd1234

You run this from a Python3 interpreter prompt:

import boto3
foo = boto3.resource(‘ec2’)
foo.describe_vpc_peering.connections()
print(foo)

You then search the output for pcx-abcd1234. You do not see it.

In DevOps, What Is a Manifest?

Problem scenario
You have read about manifests in books or articles that pertain to DevOps, but are not sure what they are. What is a manifest in the I.T. field?

Answer
Manifest: Syntactic text, usually a file with a variety of details, that is used for the purpose of convergence towards a desired state.

The definition above applies to a Puppet manifest or a Kubernetes manifest.

How Do You Troubleshoot the Java Compilation Problem “error expected … illegal start of type”?

Problem scenario
When trying to compile a Java program, you get this output:

ContInt.java:15: error: expected
System.out.println(“test”);
^
ContInt.java:15: error: illegal start of type
System.out.println(“test”);
^

What do you do?

Solution
Create a class for the System.out.println statement to be in.

Here is code that would cause the error:

import java.util.Scanner; …

How Do You Use Amazon Simple Queue Service?

Problem scenario
You want to use Amazon SQS. How do you use this in AWS?

Solution

  1. Log into the AWS console.
  2. Go here: https://console.aws.amazon.com/sqs/
  3. Click “Get Started”
  4. Enter a queue name (e.g., contintqueue)
  5. Click “Quick-Create Queue”
  6. Click the radio button associated with the queue. Then click “Queue Actions” (the button near the top left).

How Do You Troubleshoot “error: no suitable method found for toString(String)”?

Problem scenario
You are trying to print out a multi-dimensional array in Java. When you try to compile your program, you get this:

error: no suitable method found for toString(String)
System.out.println(Arrays.toString(Arrays.toString(var1)));
^
method Arrays.toString(long[]) is not applicable
(argument mismatch; String cannot be converted to long[])

What should you do?

Solution
You need to pass a one-dimensional array to Arrays.toString in the System.out.println statement.

How Do You Install Apache Presto on Any Type of Linux?

Problem scenario
You want to install Apache Presto to try it out. How do you do this with a script that will work on Debian/Ubuntu, CentOS/RHEL/Fedora and/or SUSE?

Solution
Prerequisites
i. You have Python installed as “python” (not just python3). If you need assistance installing Python, see this posting. Verify that python –version works. You may need to use sudo ln -s $(which python) /bin/python

ii.