How Do You Get Past “ImportError: No module named ‘boto'”?

Problem scenario
You want to retrieve VPC peering connection info and other VPC info via Boto3. With Python 3 you tried to run this Python 2 (and Boto 2.x) program:

import boto.vpc
c = boto.vpc.connect_to_region(‘us-east-1’)
vpcs = c.get_all_vpcs()
vpc_peering_connection = c.create_vpc_peering_connection(vpcs[0].id, vpcs[1].id)

(It was written by the person who developed Boto 2.x here.)

You have a variety or problems with the syntax not working.

How Do You Create a Function in JavaScript?

Problem scenario
You want to create a function in JavaScript. This way you can use code over-and-over. How do you use a function in JavaScript?

Solution
Call this file contint.html

<!DOCTYPE html<html<body<h2This demonstrates accepting input and using a function in JavaScript</h2<p id=”demo”</p<scriptx = 5
var foo = prompt(“Please enter a number”);

function contintFunction(p1, p2) {
return p1 * p2; …

How Do You Get Nginx Logs to be in JSON format?

Problem scenario
The book Expert Python Programming (page 278) says 12 Factor app recommends that the application should not be aware of the format of the logs. JSON format for logs can be beneficial for various purposes. You want Nginx’s access logs — but not error logs — to be in JSON format. What do you do?

Solution
Use a file like this for your nginx.conf.

What are SLIs and SLOs?

Question
What does SLI and SLO stand for?

Answer
SLI is an initialism for Service Level Indicator. SLO is an initialism for Service Level Objective.

A Service Level Indicator is a metric of service such as query-per-second, megabytes per second, transactions per minute, HTTP requests per minute etc. These are quantifiable measurements of some I.T. service. SLIs, among other things, are the metrics of a monitoring system.

How Do You Configure the Wireless Security Camera with a TCP/IP Network?

Problem scenario
You have a camera (e.g., a TCP/IP ADT security camera) attached to your a router on the network with your laptop. You know the camera’s MAC address by looking at the back of the camera itself (or you know its IP address on your network which is even more helpful). How do you use this camera over the network?

Solution
1.

How Do You Find the Web UI of a GitLab Server on Your Network?

Problem scenario
You inherited a GitLab server on your network to manage. You want to find the front end of the URL. What should you do?

Solution
Find the external IP address. Log into the back-end. If it has access to the internet, run this command: curl icanhazip.com

If you have no access to the internet, run this command: ip addr show

Use the IP addresses exhaustively in a web browser with a port in this fashion (where ppp should be replaced with the port number you want to try): http://x.x.x.x:pppp

The port number may be one to five numbers long.

What Type of Linux File Has Permissions That Are Symbolized with a “c”?

Problem scenario
You run this command: sudo ls -lh /dev

You see output like this:

crw-rw—- 1 root tty 7, 131 Dec 23 19:20 vcsa3
crw-rw—- 1 root tty 7, 132 Dec 23 19:20 vcsa4
crw-rw—- 1 root tty 7, 133 Dec 23 19:20 vcsa5
crw-rw—- 1 root tty 7, 134 Dec 23 19:20 vcsa6

You want to know if the “c” is a link to another file or something else.

How Do You Get Molecule Commands to Work when You Get “Unable to contact the Docker daemon”?

Problem scenario
When in virtualenv you try to run a Molecule command. But you get this message:

ERROR: Unable to contact the Docker daemon. Please refer to https://docs.docker.com/config/daemon/ for managing the daemon

What should you do?

Solution
1. Exit virtualenv. Run this command: deactivate

2. Go back into virtualenv (e.g., run a command like this source my_env/bin/activate).