How Do You Use a Python Function Decorator?

Problem scenario
You want to use a Python function decorator. What do you do?

Solution
Background: “A decorator in Python is a function that takes another function as its argument, and returns yet another function.” (According to this source.)

Procedures
Run this program:

def enhanced_multiply(paramfunc):
def contint(c,d):
print(“I am going to multiply”,c,”and”,d)
return paramfunc(c,d)
return contint # Here is where contint is elegantly & …

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

Problem scenario
You want a script to install Apache Flink on any type of Linux (including CentOS/RHEL/Fedora, Debian/Ubuntu and SUSE). What should you do?

Solution
Prerequisites
When using Ubuntu/Debian or SUSE servers, 1 GB of RAM is sufficient. For CentOS/RHEL/Fedora, we recommend either more RAM or use virtual memory. To find a script that will create swap space,

How Do You Troubleshoot the Error “ModuleNotFoundError: No module named ‘flask'”?

Problem scenario
You are running a Python program or running a command from the Python 3 interpreter. You get this error:

Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘flask’

What should you do to use Flask with Python 3?

Solution
Prerequisite
You need to have pip3 installed.

How Do You Troubleshoot “/bin/python3.6: bad interpreter: No such file or directory”?

Problem scenario
You are trying to run a pip command. But you get “/bin/python3.7: bad interpreter: Permission denied”. What should you do about these “bad interpreter” errors in response to having run pip commands?

Solution
Use “sudo” before the pip command. It should allow you to run the pip command. You may need to be a different user or obtain sudoer rights.

How Do You Troubleshoot the Java Compilation Error “cannot find symbol”?

Problem scenario
You try to compile a Java program with a javac command. You get this error:

special.java:39: error: cannot find symbol
symbol: class foo
location: class bar

What should you do?

Possible solution
In some cases you need a keyword “new”, but in other cases you need to not have the keyword “new”.

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.