How Do You Troubleshoot the Message “ImportError: cannot import name ‘pubsub_v1′”?

Problem scenario
From the Python command prompt or when running a Python program, you receive this message “ImportError: cannot import name ‘pubsub_v1′”. What should you do?

Solution
Possible Solution #1
Try to run the program as sudo: sudo python nameOfProg.py

Possible Solution #2
Prerequisite
This assumes that pip has been installed.

What is a Jenkins Executor?

Question
What is a Jenkins executor?

Answer
It is a designation in the Jenkins master server’s settings that governs resource allocation (e.g., CPU and RAM) on any Jenkins nodes and the master server itself. When a server (either the master or a node) is designated as having two or more executors, the server can process as many jobs simultaneously as the number of executors for which it has been designated.

How Do You Use the seq Reserved Word in a Bash Script to Generate Content for a File?

Problem scenario
You want to rapidly create hundreds of lines of text for a file. You want to do some testing and you need a file you can delete. You also want to use the seq keyword.

Solution
Here is a program that uses the seq keyword:

#!/bin/bash
COUNTER=100

for varnum in `seq $COUNTER`
do
date goodfile
echo $varnum goodfile
done

Some people recommend not using the seq keyword.

How Do You Troubleshoot the Message “ImportError: No module named ‘google'”?

Problem scenario
From the Python command prompt or when running a Python program, you receive this message “ImportError: No module named ‘google'”. What should you do?

Solution
Possible Solution #1
Try to run the program as sudo: sudo python nameOfProg.py

Possible Solution #2
Prerequisite
This assumes that pip has been installed.

What Common Utility Can Provide Compression and Encryption for Files on Linux and How Would You Use It?

Problem scenario
You want to use the same command for encryption and compression. You want to avoid installing other packages. What should you do?

Solution
Use zip. The tar command by itself does NOT do compression (according to this external posting).

One advantage of zip is that it is usually pre-installed on most Linux servers. The user and group of the files thus compressed will be retained automatically.

A List of I.T. Security Books

This is a list of I.T. Security books.

Applied Cryptography: Protocols, Algorithms and Source Code in C

Building Secure and Reliable Systems: SRE and Security Best Practices

Database Security

Defend I.T.: Security by Example

Hack I.T. – Security Through Penetration Testing

Hacking Exposed Web Applications, Third Edition

Hacking Web Apps: Detecting and Preventing Web Application Security Problems

Hadoop Security: Protecting Your Big Data Platform

Hands-On Security in DevOps: Ensure continuous security,

How Do You use the Built-in Exception Handling Functionality of Python?

Problem scenario
You want to use the built-in exception handling in your Python program. You know some part or parts of the code may throw an error. How do you use the “except” keyword?

Solution
Use the “try” key word. Here is an example of a program that throws an error:

commandthatdoesnotexist
x = 1 + 1
print(x)

python3 progwitherror.py
Traceback (most recent call last):
File “progwitherror.py”,

How Do You Connect to an Aurora MySQL Database from a Linux Server with a MySQL Command?

Problem scenario
You are using an Aurora or RDS MySQL database. You have a Linux server that you want to run MySQL commands from (rather than install a SQL front-end). What should you do?

Solution

1. Install a MySQL client. If you need assistance with this, see this posting.

2. Make sure the Security Group governing the Aurora or RDS region allows for incoming connections from one of the following:
a) if you are using an EC-2 server in the same region,