Problem scenario
You want the dot utility to transform "terraform graph" command output to usable files. What should you do?
Solution
Run this command: sudo yum -y install graphviz
A Technical I.T./DevOps Blog
Problem scenario
You want the dot utility to transform "terraform graph" command output to usable files. What should you do?
Solution
Run this command: sudo yum -y install graphviz
Question
You have read about the DOM. What is the Document Object Model and what do the three words mean in this phrase?
Answer
"The Document Object Model (DOM) is an abstract representation of an HTML document that can be queried and manipulated through its API." This quote was taken from page 62 of The Web Application Hacker's Handbook 2nd Edition.
An HTML document is "a file containing hypertext markup language" (taken from 0:07 of the video here).
The word object is an instance of a class (1). The word model refers to the combination of the structure and the behavior of the object (1). The structure and behavior of the object are not persisted via the DOM (2).
(1) 'The name "Document Object Model" was chosen because it is an "object model" in the traditional object oriented design sense: documents are modeled using objects, and the model encompasses not only the structure of a document, but also the behavior of a document and the objects of which it is composed. In other words, the nodes in the above diagram do not represent a data structure, they represent objects, which have functions and identity.' This quote was taken from this W3.org web page.
(2) 'The Document Object Model is not a way of persisting objects to XML or HTML. Instead of specifying how objects may be represented in XML, the DOM specifies how XML and HTML documents are represented as objects, so that they may be used in object oriented programs.' This quote was taken from W3.org web page.
Problem scenario
You are using Oracle VirtualBox. You get “ssh connect to host x.x.x.x port 22: No route to host”. What do you do?
Solution
In Oracle VirtualBox, go to Devices -> Network -> Network Settings. Is it attached to “Internal Network”? Try attaching it to “Bridged Adapter” instead.
Problem scenario
Your Python program is trying to invoke a Bash command. But you get an error like this: "FileNotFoundError: [Errno 2] No such file or directory". What should you do?
Possible Solution #1 Use the shell=True command if your environment is secure. This is not a recommended practice from a security perspective. We have found that this with shell=True syntax can make the error go away:
subprocess.Popen(variableofcommand, shell=True)
Only do the above if you know it is ok with the systems administrator and/or programmers. Some businesses would not allow the above.
Possible Solution #2 We have found that this can happen with the Bash command is composed in a variable. If you hard code the Bash command in the subprocess.Popen(foobar) syntax (where foobar is where you place the bash command with words enclosed with double quotes and followed by commas), the command may work.
Possible Solution #3 The environment variables that the Python program may be different from what you expect. As an intermediate troubleshooting step, you may want the program to invoke something like this /bin/env > /tmp/results.txt (provided that you have no sensitive data in the env environment variable such that the /tmp/ directory should not have). You may find that you need to use full paths to the executables of the Bash command.
Possible Solution #4 Use a Python SDK instead of the subprocess/Popen/Bash commands. Sometimes what you are trying to do will have an SDK associated with it. This option is not always feasible however; sometimes there are no SDKs for what you are trying to do.
Possible Solution #5 If you use the absolute path to the command (e.g., /usr/bin/nmap) and keep getting the error, a space in the arguments can cause the problem. The solution is to put the variable of the command into tokens in a list like this:
This format could cause the problem:comm_to_beex = ["ls -lh"]
This could fix the problem:comm_to_beex = ["ls", "-lh"]
subprocess.run(commtobex, stdout=subprocess.PIPE, text=True)
For running Bash commands with Python 3, this external page has more information.
If you want to purchase a Python book, see this page.
Problem scenario
You only want your Android phone to ring if certain phone numbers call you. You have "blocked unknown callers" on your Android phone with certain settings. You went to the Phone app -> three vertical dots -> Settings -> Block numbers -> Block unknown callers
But you still get calls, or your phone still rings, when unknown callers call you. You tried rebooted or using Hiya's caller ID and spam protection. Nothing seems to work to keep. How do you get your phone to remain silent except for callers from certain numbers?
Solution
Question
You have seen the initialism RDS. What does this term mean?
Answer
Normally it is a reference to AWS' PaaS offering for relational databases called Amazon Relational Database Service.
The term RDS can refer to Reference Data Services in the Microsoft realm (e.g., Azure or SQL Server). Here is more information.
Problem scenario
You are using the AWS CLI. You want to know what region is being used by default. You do not what to use the aws configure command. What should you do?
Solution
Run this:
cat ~/.aws/config
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.
Run reader.py (with python3 reader.py):
import json
lof = ("first.json", "second.json")
counter = 0
t = ()
for x in lof:
counter = counter + 1
with open(x, "r") as reading_content:
i = reading_content.read()
j = json.loads(i)
k = j["bird"]
l = k["species"]
subtup = (l,)
t = t + subtup;
print(t)
Problem scenario
You want an FTP client on your RHEL server despite it being insecure. What should you do?
Solution
We do not recommend using FTP for security reasons. However it is still used in today's world. To install an ftp client, run this:
sudo yum -y install ftp