Is It a Best/Recommended Practice to Run “sudo systemctl start docker”?

Problem scenario
You read that you should not run a Docker container as root or with sudo privileges. Can you start the docker service with sudo systemctl start docker?

Solution
Yes, it is acceptable. You can use this:

sudo systemctl start docker

This solution was taken from https://docs.docker.com/config/daemon/systemd/.

What Does the Verb To Abstract Mean in Computing?

Question
In I.T., what does abstract or the act of abstraction mean?

Answer (Disambiguation of abstraction)

Examples
For TCP/IP Networking
The seven layers of the OSI model are abstractions. (This was taken from worlddidac.org.)

For Containerization
We find this quote in Docker Up and Running (by Matthias & Kane on page 125): "One of Docker's major strengths is its ability to abstract away the underlying hardware and operating system so that your application is not constrained to any particular host or environment." Another relevant quote is "[a] Kubernetes Operator is an abstraction for deploying non-trivial applications on Kubernetes." (This last quote was taken from a Nebulaworks' engineer; see the full quote here.)

For Programming
An application programming interface (better known as an API) is an abstraction; reducing an application to an interface enables other people or programs to invoke methods or functions of the program.

In programming an abstract data type is a logical concept; its actual implementation within the same programming language can vary (and use different built-in data types). (The previous sentence was paraphrased from page 634 of Cracking the Coding Interview.)

Abstraction is a feature of object-oriented programming; to read more see https://whatis.techtarget.com/definition/abstraction. Frederick Brooks said "[r]epresentation is the essence of programming." (As taken from page 103 of The Mythical Man Month.)

For Quality Assurance
For some testing, such as functional testing, of an application, someone will abstract away the details of the underlying implementation (by coding an abstraction merely for testing). This testing has its advantages and disadvantages. In some contexts, speed of testing is important. In other situations, a human's attention is important. There are pragmatic benefits to focusing on basic operational tests; if someone is too caught up in the details of unit testing (with the theoretical differences emphasized), they may not realize a fundamental problem has been introduced to the code. Functional tests that are automated or configured abstract away behind-the-scenes specifics.

For Intellectual Property
A software design is ineligible for a patent it is for an abstract idea. In the Alice Corp. v CLS Bank International lawsuit, the Supreme Court abstractness was defined as something conventional, overtly obvious or too broad to warrant a patent. The courts do not support improper attempts "to monopolize an abstract idea." (This paragraph and final quote were taken from this external site.)

Explanation:
To abstract is to reduce complexity of an asset, tool, or technology. Through the process of abstraction complex systems are represented in an understandable way. Distributed systems work to integrate multiple components of computing resources and data from disparate sources for real-time updates and rapid performance. The communication contract or protocol between the different assets on a network can be readily defined through abstraction. Industry standards help abstraction benefit rapid provisioning of I.T. infrastructure. Architecting modern software would be far more time-consuming without abstracting components.

Loosely coupled components are readily breakable. In other words they are disassociated from each other relative to tightly coupled components. Thus the trend toward loose coupling is a trend toward abstraction. Linux philosophy itself is modular, and the principle of loose coupling does not apply to merely programming or systems administration. The Law of Demeter, normally a programming concept, has applicability to microservices.

Microservices include atomic publishers, listeners and other tools that perform discrete tasks. They are popular because they can be replaced with different vendors or other competing tools without requiring every system to be similarly changed; microservices prevent vendor-lock-in while promoting scalability. They can support implementing (or abstracting) the underlying resources to for network communication over a TCP socket. Abstraction can play a role in asynchronous communications. A message queue can keep content throughout a network outage, and data processing can ensue with minimal human operation.

The best way of building fault-tolerant systems is to find some general-purpose abstractions with useful guarantees, implement them once, and then let applications rely on those guarantees.

Page 321 of Designing Data-Intensive Applications by Kleppman.

Byte code, CPU registers, cycles in gates of CPUs, random access memory, system calls, motherboard circuitry including capacitors and power supply electrical currents are quite complex when trying to comprehend the details of each component at the same time. AWS, Azure and GCP afford an abstract way of leveraging data center assets.

If QA tests are decoupled from one another (e.g., invoking an interface without a GUI), they can run independently. Thus abstracting a test from another allows for granular and parallel testing. Truly atomic tests renders the order of testing irrelevant (according to page 205 of Continuous Delivery by Humble and Farley). Not all tests can be atomic. Loosely coupled testing is ideal for the pipelinization of value streams. (See What is Pipelinization in Technology/Computing? if you want to read more about it.)

Certain business reports and features of an application may be only understood by professionals with domain knowledge. Abstracting the jargon from the application enables testing and development to progress.

Specialized systems can require deep technical knowledge. With abstraction such systems can be leveraged by other people seeking integrate other tools for dynamic solutions. To simplify a tool for its utilization is an example of abstraction. Disassociating a message publishing component from a server, container, cluster, network, or other technology enables an engineer to manage something useful. Given the context of certain businesses, abstraction allows teams to cooperate and interact productively with a reduced dependency on jargon and enterprise idiosyncrasies. What are called Software Engineers in modern times deal with networking, infrastructure, databases and security (often programmatically) through emulated or virtualized infrastructure resources. Abstractions empower manageability through the reduction of complexity.

To learn more about abstraction in I.T., you may also want to read this. We do want to acknowledge that there are implementations and architectures that involve too much abstraction. We hope you have a greater understanding of what it means to "abstract" something in the world of technology.

Are Income Taxes on a Bonus the Same Rate as a Regular Paycheck?

Problem scenario
You heard that income tax on a company's bonus are taxed at a higher rate. Is this true?

Answer
Yes. To calculate your approximate tax liability, you could use this website for informational purposes:

(You may want to talk to an accountant before relying on the statements here. This is not legal or tax advice.)

Is It a Best/Recommended Practice to Use AWS VPC Peering Connections?

Problem scenario
You have heard about AWS VPC Peering Connections. Should you use them?

Solution
The short answer is "yes."

Some "best practices" for VPCs are merely step-by-step directions for setting it up while describing options that you may or may not want to take. This posting, on a technical blog of a large reputable company, was cited in The DevOps Handbook (on page 404). It provides numerous options as opposed to many hard-and-fast rules. Unfortunately, it was published in 2014. VPC Peering connections were widely available as of 2018 (according to Amazon).

Newer VPC "best practices" guides mention and suggest encouragement of peering connections:
https://cloudacademy.com/blog/top-13-amazon-virtual-private-cloud-best-practices/
https://www.buurst.com/2019/04/17/blog-aws-vpc-best-practices/
https://searchcloudsecurity.techtarget.com/feature/VPC-security-best-practices-and-how-to-implement-them-in-AWS

CockroachDB recommends peering connections to improve security. Another source recommends VPC peering connections.

In some instances, peering connections could be a security problem (according to stackarmor.com). In theory your VPC could be exposed to attacks from the intruders in other VPCs connected via peering connections. "Attack surface reduction is a cyber security best practice." (This quote was taken from https://www.anetworks.com/attack-surface-reduction/.)

We think VPC Peering Connections are great, but you always have to be reasonably sure each VPC is also properly configured because they could potentially increase your attack surface.

Python Challenge of the Day (2/17/22)

Problem scenario
You have a program as follows:

class Location:
    def __init__(self, country="US", state="CA", city="Los Angeles"):
        self.country = country
        self.state = state
        self.city = city

    def printer(self):
        return [self.country, self.state, self.city]

new_loc = Location("Mexico", "Mexico City", "Mexico City", "good neighborhood")
print(new_loc.printer())

Here are your choices of what it could print out:

a. TypeError: init() takes from 1 to 4 positional arguments but 5 were given
b. TypeError: init() takes from 1 to 3 positional arguments but 4 were given
c. ['Mexico', 'Mexico City', 'Mexico City']
d. None of the above

Which one does it print?

Scroll down to see the answer.


Answer
A. The reason is that the class methods always pass the self when there are stanzas like this:

new_loc = Location("Mexico", "Mexico City", "Mexico City", "good neighborhood")

The self is invisible, but behind-the-scenes, it is there.

It accepts four positional arguments: country, state, city, and self. The line causing the error includes "good neighborhood". To read more about this, see this StackOverflow posting.

The arity of the __init__ constructor (in the class Location) is variable -- but passing four arguments is excessive. It can handle three explicit parameters as "self" is passed implicitly. Python will print out "__init__() takes from 1 to 4 positional arguments but 5 were given"

Is It Possible for an I.T. Staffing Company to Provide Notice that Your Contract Will End?

Problem scenario
A staffing company wants you to agree to give a 15 or 30 day notice before you voluntarily leave. But they have to give you no notice. One attorney said that in that business model, this is common. Another attorney says that it is not unreasonable to ask for this clause to be reciprocal. You do not think that the company will agree to making it reciprocal. Is it possible for the project owner to give a contractor advance notice that the contract will end sooner than expected?

Answer
Yes. Ask for the clause to be reciprocal or ask for the clause to be removed. If you are constructively terminated in certain jurisdictions, quitting without notice is acceptable. Some staffing companies will either remove the clause or make the notice reciprocal. You should always ask for the staffing company to provide notice as soon as they hear from the client that your contract will end. Even if they won't concede to the notice in the contract, they will likely tell you via email (during this negotiation phase) that they will let you know as soon as possible. Ideally it will be in the contract. But sudden terminations can happen even when there is no indication from the interviewer or staffing company that they would do such a thing. This way a sudden termination may be less sudden. It can be easier to secure employment when you have a job.

You may or may not want to insist that the "as much notice as possible" clause is in the contract. Many contracts have an "entire agreement" clause which says if the agreement between the parties is not in the contract, it is probably not enforceable. Emails can form a basis of fraudulent attempt by one party to induce you to signing a contract, but this collateral evidence may or may not withstand the "entire agreement" clause. In other words such pre-execution-of-the-contract emails may not be enforceable if a subsequent contract was signed with an "entire agreement" clause, but those emails could still provide some assistance to you in a legal proceeding. You never know when an end client may want to the end the contract, but the staffing company does not think you will need to know right away that your work is ending. If you express your interest in learning right away that it is ending, they may fit protective language into the contract to give you a right to know immediately. The end client may share with you their advance notice to the staffing company. Some staffing companies will pay you for the notice period without having you work for any end client if the clause is in the contract.

Do PostgreSQL Tables Have Clustered Indexes like SQL Server Database Tables Have?

Problem scenario
You are curious if a clustered index is the same as the table in PostgreSQL. You are familiar with SQL Server tables. Do PostgreSQL tables have clustered indexes like SQL Server tables have?

Answer
No. The source is here.

What is a Validation Webhook?

Question
In the context of Kubernetes, what is a validation webhook?

Answer
They are an API invocation to confirm a resource was created properly. Unlike a mutating webhook, validation webhooks make no changes to resources deployed in Kubernetes. Also unlike a mutating webhook, validation webhooks happen at a different step in the admission controller process. The admission controller process starts with an API request and ends with persisting data to etcd.

See the diagram here and visually search for "diagram representing."

Object schema validation precedes validation webhooks; object schema validation happens after mutating webhooks.

See also https://banzaicloud.com/blog/k8s-admission-webhooks/.

Do Ordered Dictionaries in Python Consume More Memory than Regular Dictionaries?

Question
You are considered using ordered dictionaries in Python (e.g., because of the way they handle temporal data). Will your program use more memory this way compared to using a regular dictionary?

Answer
Yes. All things being equal, ordered dictionaries use more memory than normal dictionaries.

# You will see that Python 3's ordered dictionaries consume more memory than regular dictionaries
# This was adapted from https://lerner.co.il/2019/05/12/python-dicts-and-memory-usage/

import sys
from collections import OrderedDict

x = OrderedDict()
y = {}

for i in range(1, 123456):
    x[i] = "filler text"
    y[i] = "filler text"


print(sys.getsizeof(x))
print("The size of the ordered dictionary is above and the regular dictionary is below.")
print(sys.getsizeof(y))

Amazing Growth for I.T. Jobs in Security

In November of 2017 Continualintegration.com posted What is DevSecOps (or DevOpsSec, SecDevOps, or rugged DevOps)?. At the time, Indeed found 192 jobs with a search for "devsecops". Today, 2/10/22, in four years and three months later, Indeed returns 19,002 jobs for a search of "devsecops." There are roughly 100x as many jobs now that include the word "devsecops" on Indeed. The website has grown, but this is still an amazing finding.