Problem scenario
You have read about the Google Datastore and Google Firestore. But you do not know the differences. What are they?
Solution
Go here.
…
Continue reading “How Does Google Datastore Compare/Contrast with Google Firestore?”
A Technical I.T./DevOps Blog
Problem scenario
You have read about the Google Datastore and Google Firestore. But you do not know the differences. What are they?
Solution
Go here.
…
Continue reading “How Does Google Datastore Compare/Contrast with Google Firestore?”
Problem scenario
You want each line of a file to have a prefix or suffix attached. How do you print out this combination of a fixed string with each individual line of the file?
Solution
cat foobar.txt | awk ‘{ print “prefix” $1 “suffix” }’ …
Continue reading “How Do You Write a Bash Command That Combines a String with Each Line of a File?”
Question
Normally when you use the man page, you just type man nameofcommand. But you have seen integer numbers between 1 and 9 (inclusive) between the “man” and the command’s name. What do those numbers signify?
Answer
This legend was taken from “man man” on a Linux server:
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions), …
Continue reading “What Does the Number “2” in a man Command Mean?”
Problem scenario
You have a list in Python that you copy into another variable. You change the original list and the copied version changes. Why does the copied version get copied and what can you do to overcome this?
Solution
There is something called a “deep” copy and a “shallow” copy. This program will illustrate both the problem and the solution:
list_a = [3, …
Continue reading “Why in Python Does a Variable Copy Get Changed when You Change Its Source?”
Problem scenario
You want to use the copy feature in Python. What do you do?
Solution
To see the different types of copying, use a mutable object such as a list. Here is an example:
import copy
var1 = [1, 2, 3, 4]
shallow_copy = var1
deep_copy = copy.deepcopy(var1)
var1.append(999999999999)
print()
print(shallow_copy)
print(” — Shallow copy above and deep copy below —.”)
print(deep_copy)
For most (or perhaps all) intents and purposes,
…
Continue reading “How Do You Use the .copy() Feature in Python?”
Question
You were told to write a Python program in virtualenv (a layer of virtualization). Why are you being asked to do this?
Answer
Isolation of dependencies is one of the dozen factors in 12 Factor App. Using pip or pip3 on an entire Linux system to install packages for PyPI is inadvisable (according to page 32 of Expert Python Programming).
…
Continue reading “Why Should You Use virtualenv when Using Python?”
One of the following scenarios apply:
Problem scenario #1
You are trying to view namespaces on a Linux server. You run “lsns” but you get “lsns: command not found.”
Problem scenario #2
You run this: sudo apt -y install util-linux
You see “util-linux is already the newest version (2.27.1-6ubuntu3.8)”
What should you do on a Debian derivative of Linux (e.g.,
…
Continue reading “How Do You Get the Linux Command “lsns” to Work?”
Problem scenario
You want to install MongoDB on a RHEL server. What do you do?
Solution
1. Create this file: /etc/yum.repos.d/mongodb-org-4.4.repo
[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
sudo yum -y update
sudo yum -y install mongodb-org
If you are using Debian or Ubuntu,
…
Problem scenario
You receive a message that says “Error SSL Validation Failure” from a Chef command. What should you do?
Solution
Run this command:
knife ssl fetch https://url/of/chef/server
For more information, see this external posting (but beware of the risks of bypassing SSL).
…
Continue reading “How Do You Fix the “Error SSL Validation Failure” Message with Chef?”
Problem scenario
You have a Water pick for your gums and teeth (also known as a water flosser, Waterpik, or an oral irrigator). It takes time for the pressure to become optimal when you turn it on. You want the pressure to be forceful and not take time once the water basin is full and the device is on. It used to work quickly; it would start spitting out water immediately.
…
Continue reading “How Do You Get the Water to Spurt Out of a Water Flosser Immediately?”