How Do You Use Python to Create a Tuple with Extracted and Nested Values from JSON Files?

Problem scenario
You have some JSON files like this:

$cat first.json
{“bird”: {“name”: “singy”, “species”: “sparrow”, “amount”: “45”}}

$ cat second.json
{“bird”: {“name”: “flighty”, “species”: “seagull”, “amount”: “21”}}

Within the “bird” key there are other keys. How do you create a tuple with the species values?

Solution
Place first.json, second.json and the Python program below (called reader.py) in the same directory.

Terraform Quiz

Test your knowledge of Terraform. (Updated on 8/2/25.)

1. What is the remote state in Terraform?
_____________________________________________________

2. What underlying tools support the Terraform Application Layer?

a. Java and C++
b. C++ and C
c. Ruby on Rails and Go
d. Groovy and Grails
e. Python, Apache Tomcat, and Maven
f. Flask and Python
g. Perl and Nginx
h.

Terraform Quiz with Answers

If you have not taken the quiz yet, here is a link to test your own knowledge.

1. What is the remote state in Terraform?

A centralized data store with the parameters of the desired configuration for Terraform runs. The parameters for the desired configuration are referred to as a state file in the context of Terraform.

Whereas an individual may use Terraform with the default local state (a local file with desired state configuration data),

How Do You Display the VPC Peering Connections with Boto3?

Problem scenario
You want to list all the VPC Peering Connections for a specific region using Python.

You want the equivalent of aws ec2 describe-vpc-peering-connections

How do you show (retrieve or fetch) the VPC peering connections using Boto3?

Solution

import boto3
contint = boto3.client(‘ec2’)
var1 = contint.describe_vpc_peering_connections()
print(var1) …

Can You Use the MVC (Model-View-Controller) on Linux?

Question
Whenever you read about the MVC, it always involves Microsoft (e.g., and ASP or .NET). Is there a way to use the MVC on purely Linux?

Answer #1
Yes. The ASP.NET MVC framework of the model-view-controller is a Microsoft implementation of it. The MVC generically can be used as an architectural pattern using programming languages on a Linux server. To read more about it,

In Python, How Do You Call a Bound Function as a New Thread with the threading Module?

Problem scenario
You want to write a program to call a bound function in a new thread. How do you do this?

Solution
Run this program (e.g., python foobar.py):

from threading import Thread

class mighty:
def good():
print(“Good”)

def contint():
print(“Hello!”)

if __name__ == “__main__”:
thread = Thread(mighty.good())
thread.start()
thread.join()
print(“thread finished…exiting”) …