How Do You Create a Windows 2016 Server with Vagrant and Oracle VirtualBox?

Problem scenario
You want to use Windows 2016 with 2 GB of RAM. You have Oracle VirtualBox installed on a Linux server. You want the VM to be able to communicate with the host or other VMs on the host. You have a license for Windows 2016. What should you do?

Solution
Prerequisite: You have Oracle VirtualBox set up. You know what adapters you can attach a VM to.

How Do You Write a Java Program to Accept a Character as Input and Do Something with It?

Problem scenario
You want to accept user input with a Java program. How do you write such a program?

Solution
Here is the program:

import java.util.Scanner;

public class acceptChar {

public static void main(String[] args) {
System.out.println(“Please enter a character, then press enter: “);
Scanner in = new Scanner(System.in);
char letter = in.next().charAt(0);
System.out.println(letter);
}
}

Why Do Processes Get CPU Time on a Linux OS when Their Nice Level is Set for Unfavorable Scheduling?

Problem scenario
Some processes are a low priority for an OS given their nice level. Why do they eventually run when the OS is active and busy handling processes that have higher priorities? Wouldn’t a nice level that indicates a low priority keep the process starved of receiving resources?

Answer
There is a round robin scheduling algorithm for the CPU to allocate time.

How Do You Troubleshoot “ssh connect to host x.x.x.x port 22: Connection refused”?

Problem scenario
You get “ssh connect to host x.x.x.x port 22: Connection refused” when trying to SSH. What do you do?

Possible solution #1
Do you have the correct IP address? Can you copy and paste the IP address? Can you run “ip addr show” on different servers? Is the IP addressed used multiple times in different subnets? It could refer to different servers.

What is User Data in AWS, Azure, or Terraform?

Problem scenario
You have heard about user data in AWS, Azure, or Terraform. What is it? What does user data include?

AWS User Data versus Terraform User Data

Answer for AWS
Generally it is a customization that the account owner configured to apply to an EC-2 instance when it first launches. It is either a shell script or a cloud-init directive that is used when an EC-2 instance is launched (according to Amazon’s website).

A List of Python Books

1593279280Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming by No Starch Press

1593279922Automate the Boring Stuff with Python, 2nd Edition: Practical Programming for Total Beginners by No Starch Press

1449355730Learning Python, 5th Edition by O’Reilly Media

0134692888Learn Python 3 The Hard Way (Zed Shaw’s Hard Way Series) by Addison-Wesley Professional

1491957662Python for Data Analysis: Data Wrangling with Pandas, NumPy,

How Do You Fix the Error “The pkg-config script could not be found or is too old.”

Problem scenario
You run a command like “make deps”, but you get this message “configure: error: The pkg-config script could not be found or is too old.” What should you do?

Solution
For an Ubuntu/Debian distribution of Linux, run:

sudo apt-get install -y pkg-config

For a Red Hat distribution of Linux (e.g., CentOS/RHEL/Fedora), run this:

sudo yum install -y pkgconfig

For Archlinux OS,

How Do You Troubleshoot the Message “error: too early for operation, device not yet seeded or device model not acknowledged”?

Problem scenario
You are using a Red Hat Distribution of Linux (e.g., CentOS/RHEL/Fedora). You try to run a snap command. You see this message: “error: too early for operation, device not yet seeded or device model not acknowledged”. What should you do to get the snap command to work?

Solution
Run this command:

sudo dnf reinstall snapd

This solution was taken from this posting:
https://forum.snapcraft.io/t/error-too-early-for-operation-device-not-yet-seeded-or-device-model-not-acknowledged/12421/17

How Do You Get EC-2 Instances to Get IP Addresses by Default?

Problem scenario
In AWS when you try to create an EC-2 instance, on step #3 to “Configure Instance Details”, you are not getting an auto-assigned public IP address. You see this message:

“No default subnet found
Please choose another subnet in your default VPC, or choose another VPC.”

What should you do?

Solution
As of November 2020, you cannot create a default subnet with the AWS Management Console (to the best of our knowledge and this posting https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html#create-default-subnet that says “Currently,