How Do You Troubleshoot Terraform Commands That Do Not Seem to Use the -var-file= Flag Passed to Them?

Problem scenario
You want to pass the var-file flag in a Terraform command. You have a different configuration/variables file (from the default one) that you want the Terraform command to use. The resulting error indicates that there is insuffient configuration data; the behavior is consistent with no variables files being readable.

How do you get a terraform plan command to look at a different folder location or directory?

How Do You Install Windows DSC on Windows Server 2019?

Problem scenario
You are running Windows Server 2019. You want to install Windows DSC. What do you do?

Solution

  1. Open PowerShell.
  2. Run this command: Install-Module ‘PSDscResources’ -Verbose
  3. When prompted with this question “NuGet provider is required to continue…”, choose “Yes”.
  4. If you believe your Windows Server is in a secure environment, or you have no goals putting sensitive data on your Windows server,

How Do You Secure or Harden a Linux Server?

Problem scenario
You need to make a Linux server very secure. How do you harden a Linux server?

Answer

  1. You may need to reformat the server. Backup the data. When you reinstall Linux use full disk encryption. Make the boot partition read-only.
  2. Enforce complex passwords that must be changed every 30 to 90 days. Use John the Ripper (www.openwall.com/john) to ensure your passwords are strong.

How Do You Rotate a List in Python?

Problem Scenario
Rotating a list can make it appear circular (wherein an iteration from the last element brings you to the first element in the list). You do not want to import any modules. You have a list called foobar. You want to keep the content the same, but adjust the index by 1 on each value. How do you rotate a list in Python?

Solution

foobar = foobar[-1:] + foobar[:-1] …

Why Is You AquaSana UV Water Filter Leaking?

Problem scenario
You have an ultra-violet water filter from AquaSana. It is leaking water. What should you do?

Possible Solutions
Never have the electrical plug in an outlet when making changes! The UV light could blind you if you look at it when it is on.

Make sure the O-rings on the top and bottom are in good condition. Old rubber will not provide a good seal.

How Do You Run an AWS CLI Command to Allow Access to an EC-2 Instance in Security Group?

Problem Scenario
You want to modify a security group to allow SSH connections from an IP address. How do you do this with the AWS CLI?

Solution
You have to know the security group’s ID. Replace “sg-abcd1234” with the group ID, and replace 1.2.3.0/24 with the IP address and subnet mask you want to allow to connect from in this command and then run it:

aws ec2 authorize-security-group-ingress \
–group-id sg-abcd1234 \
–protocol tcp \
–port 22 \
–cidr 1.2.3.0/24

Is a Private Key on a Linux Client Used in SSH Authentication to a Remote Server?

Question
This website (https://kb.iu.edu/d/aews) says “On the SSH command line: Add the -i flag and the path to your private key.”

When running an SSH command, you do not think that the client’s private key would not come into play. You think that the public key would be used. The man page for SSH says

-i identity_file
Selects a file from which the identity (private key) for public key authentication is read

ssh will also try to load certificate information from the filename obtained by appending -cert.pub to identity filenames.

How Do You Log Out of cj.com (aka Commission Junction)?

Problem scenario
You have logged into the CJ website. You want to log out. What do you do?

Solution
Click your name/company name in the upper right hand corner. You should see “Login Manager”, “Privacy Policy”, “© Commission Junction LLC”. Underneath those three things there is a light gray bar that may almost blend in with the background. It says “Logout” in possibly faint gray (medium gray) letters.