How Do You Add Multiple DNS A Records in Active Directory Using a File?

Problem scenario
You want to create multiple A records in DNS. But to do it manually using the MMC would take too long. What should you do?

Solution

  1. Open the MMC and browse Active Directory. On the left the name of the A.D. server should be fairly obvious (e.g., contint or foobarsrv).
  2. Open PowerShell as an administrator.

How Do You Troubleshoot the Python Problem “SyntaxError: EOL while scanning string literal”?

Problem scenario
You are running a Python program or trying to execute a line from the Python interpreter command line. You receive this message: “SyntaxError: EOL while scanning string literal”. What should you do?

Solution
Look for the double quotes and single quotes. Have they all be terminated? Are they in an even number? Was the code copied to a different workstation application and then pasted into vi or a terminal prompt?

How Do You Write a Python Program to Print All the VPCs in Your AWS Account?

Problem scenario
You want to list all the VPCs in your account. You are using Boto3 and Python 3. What do you do?

Solution
Run this four-line program:

import boto3
client boto3.client(‘ec2’)
response = client.describe_vpcs()
print(response)

Citation: The above was adapted from https://stackoverflow.com/questions/47329675/boto3-how-to-check-if-vpc-already-exists-before-creating-it

How Do You Troubleshoot the Ansible Error ‘”hadoop_env” is undefined’?

Problem scenario
You try to run a playbook. But you get a message like this: ‘fatal: … “AnsibleUndefinedVariable” ‘hadoop_env’ is undefined’. What should you do?

Root cause: a variable you defined (e.g., in a playbook or role) is not getting assigned when you run the playbook.

Possible solution #1
Find the vars directory or create it.

How Do You Use the AWS CLI to View the Targets of Routes in Route Tables in a VPC?

Problem scenario
You have a VPC with route tables. You want to search the targets to find a given value. What should you do?

Solution
As of early 2020, the output of aws describe-route-tables –filters –route-table-id abcd1234 –region us-west-2 will not include the word “target”. The value of the target in the JSON output will be the ID of the given target.

How Do You Find the Make and Model of Your Laptop or Desktop Computer Running Windows?

Problem scenario
You are running Windows on your desktop or laptop. You want to find the make and model of the hardware. What do you do?

Solution

  1. Hold the Windows key down and tap the “r” key.
  2. In the command prompt type this: msinfo32
  3. Press enter.
  4. The hardware make will be found under the “System Summary” section in “System Summary”.

How Do You Troubleshoot the Errors “Expecting ‘,’ delimiter: line …column” or “No JSON object could be decoded”?

Problem scenario
You are trying to run a command that consumes a JSON file. You get an error such as “Expecting ‘,’ delimiter: line …column” or “No JSON object could be decoded”. What do you do?

Possible Solution #1
You may have an extra closing brace that you need to eliminate.

Possible Solution #2
Use https://jsonlint.com