How Does sorted(list_arg1, key=arg2) Work in Python?

Question
You see that Python’s sorted reserved word has an option to use a key (rather than the default mechanism). How does the key parameter/flag in Python’s sorted function work?

Short Answer:
The word “key” designates a special function that you create. It accepts two parameters and returns positive or negative numbers. These help give you the ability to sort the list in a non-standard way.

How are Provisioners in Terraform Different from User Data?

Question
How are Terraform provisioners different from Terraform User Data? Both usually involve scripts to customize a server.

Answer
Provisioners have built-in support for CM tools and can have scripts longer than 16 KB; these things are not true with User Data. (This was taken from page 213 of Terraform: Up & Running, 2nd Edition by Yevgeniy Brikman (O’Reily),

How Do You Find the Working Directory in an Azure DevOps Release Pipeline?

Problem scenario
A Terraform task is failing in an Azure DevOps release pipeline. You cannot see a variable setting for the working directory. How do you determine the working directory?

Solution
Go to Edit your release pipeline. Go to “View YAML” in the upper right hand corner. Search for “working”. You should see it (e.g., as workingDirectory).

The working directory key probably has a value that is a variable (e.g.,

What Is The Disambiguation of The Word “heap” in I.T.?

Problem scenario
You have read about heaps in computer programming and in operating systems. What do the different definitions of “heap” mean in I.T.?

Overview
Merriam-Webster’s Dictionary (11th Edition, on page 574) defines a heap as “a collection of things thrown one on another” or as a “pile.” The same word can have completely different meanings in English; a trash heap,

How Do You Create a File on a Server with Terraform?

Problem scenario
You are trying to get user data to create a file on a server in Terraform. It is in a directory that requires sudo privileges. You use the “sudo” command in the Bash script. The Bash script executes except a file is never transferred. How do you get Terraform to copy a file to a new server?

Solution
Use the Terraform-supported cloud_config option instead of having a Bash script transfer the file.