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,

How Do You Troubleshoot the GCP BigQuery Error ‘Table name “foobar” missing dataset while no default dataset is set in the request’?

Problem scenario
You run a BigQuery query. But you get a pop-up message that says ‘Table name “mockdata” missing dataset while no default dataset is set in the request.’

What should you do?

Solution
Did you specify a dataset (or database name) before foobar?

For example, if your dataset is called “cool”, your BigQuery query should refer to “foobar” as “cool.foobar”.

How Do You Troubleshoot ‘Exception in thread “main” java.lang.NullPointerException org.apache.hadoop.mapreduce.tools.CLI.displayJobList’?

Problem scenario
When you run hadoop commands, you get an error like this:

Exception in thread “main” java.lang.NullPointerException
at org.apache.hadoop.mapreduce.tools.CLI.displayJobList(CLI.java:784)
at org.apache.hadoop.mapreduce.tools.CLI.displayJobList(CLI.java:769)
at org.apache.hadoop.mapreduce.tools.CLI.listAllJobs(CLI.java:697)
at org.apache.hadoop.mapreduce.tools.CLI.run(CLI.java:428)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90)
at org.apache.hadoop.mapred.JobClient.main(JobClient.java:1277)

What should you do?

Solution
Find the mapred-site.xml file. Make sure it has these stanzas (within the configuration and /configuration tags):

<property> …

What Does AI Stand For in addrinfo?

Problem scenario
You see several variables that start with “ai_”. What does the “a” and “i” stand for?

Solution
The “a” stands for “address” and the “i” stands for “info”.

The man page for getaddrinfo says “The getaddrinfo() function is defined for protocol-independent nodename-to-address translation.” taken from http://www.nsc.ru/cgi-bin/www/unix_help/unix-man?getaddrinfo.

Therefore ai_flags, ai_family, ai_scoktype, ai_protocol, ai_addrlen, ai_canonname, ai_addr,

Why Is There an Apparent Difference Between “docker run” and the Series of Two Commands “docker create” And “docker start”?

Problem scenario
When you run “docker run“, the container has a port that is exposed and the web application works properly.  When you use “docker create” then “docker start“, the service is not exposed properly. You believe that “docker run” the same as a series of two steps, first “docker create” then “docker start“.