How Do You Troubleshoot Two WordPress Websites when You Expect There to Be Only One?

Problem scenario
You seem to have two versions of a website being hosted. When you log into WordPress and make changes, they aren't taking effect. You notice that the website you have is duplicated with one older version and one newer version. Both are hosted. You use a VPN or proxy tunnel website and find differences in your website. You want to consolidate these. How do you find out what is going on?

Solution
Root cause: there are two servers hosting your website.

Use traceroute in Linux, tracert from a Windows command prompt, or use https://www.uptrends.com/tools/find-ip-address-of-my-website

These tools can help you track down a second web server that is hosting your website.

Did you ever update the /etc/hosts file on a Linux computer or update the C:\Windows\System32\drivers\etc\hosts file on a Windows computer? If one of these files make your website domain resolve to a different IP address, you could theoretically see two different versions of your website.

How Do You Troubleshoot “Warning FailedScheduling … default-scheduler no nodes available to schedule pods”?

Problem scenario
You are running EKS in AWS. You get this message "Warning FailedScheduling … default-scheduler no nodes available to schedule pods". How do you troubleshoot it?

Solution
Verify your nodes are healthy with this command: kubectl get nodes

If you are using EKS, you may need to create nodes. Here is a command to do that (but replace "foo" with the name of the EKS cluster that you have, and "bar" with the name of the node-group you want to create, and subnet-123456 with the subnet you have and "arn:aws:iam::123456789:role/nameofrole" with the ARN of the IAM role that can create nodes):

aws eks create-nodegroup --cluster-name foo --nodegroup-name "bar" --subnets subnet-123456 --node-role arn:aws:iam::123456789:role/nameofrole

# If you want to see what subnets you can choose from, run this command:
# aws eks describe-cluster --name foo --query 'cluster.resourcesVpcConfig.subnetIds'
# If you can remember a pattern in the name of the relevant role (i.e., "foobar"), try a command like this to find the exact IAM role:
# aws iam list-roles | grep -i foobar

The command kubectl describe pods may have you some clues. You may want to see this posting if the worker nodes have an issue with subnet.env. Another related posting is How Do You Get Kubernetes Nodes to Be Ready?.

How Is a Process Different from a Daemon in Linux?

Question
How is a process different from a daemon in Linux?

Answer
A process subsumes a daemon. A daemon is a process that runs for a long period of time (e.g., the duration the server is on). It may require no interaction with a user. A logging process or a web service like Nginx are examples of daemons.

This answer was paraphrased from page 34 of The Linux Programming Interface.

See also:

What Is a Decorator in I.T. or DevOps?

Problem scenario
You have read about decorators in object-oriented programming and in Python. Is there a disambiguation of what a decorator is?

Solution
In object-oriented programming, inheritance allows for an object to change from its class at compile time (according to page 201 of Programming Interviews Exposed). In OOP, the decorator pattern is a structural design pattern (according to the inside of the front cover of Design Patterns) and is a way to modify an object in OOP at run-time (according to page 201 of Programming Interviews Exposed). The intent of a decorator is to dynamically extend an object's functionality (according to page 175 of Design Patterns). The decorator can also be known as a wrapper (according to page 175 of Design Patterns).

In Python you can do object-oriented programming. However a decorator in Python should be thought of something completely different. There are class decorators and function decorators in Python.

"A [function] decorator in Python is a function that takes another function as its argument, and returns yet another function." (This quote was taken from https://towardsdatascience.com/how-to-use-decorators-in-python-by-example-b398328163b.)

"There's been a number of complaints about the choice of the name 'decorator' for this feature. The major one is that the name is not consistent with its use in the GoF book … The name 'decorator' probably owes more to its use in the compiler area -- a syntax tree is walked and annotated. It's quite possible that a better name may turn up." (This quote without the hyperlink was taken from https://www.python.org/dev/peps/pep-0318/.)

How Do You Save All the Emails in Your Gmail Account Locally?

Problem scenario
You want all the emails in your gmail account to be saved. You want the text of the messages searchable, and you want to save the attachments. How do you do this?

Solution

  1. Export your messages to an .mbox format. Refer to the "email" option here: https://support.google.com/accounts/answer/3024190?hl=en
  2. Install Thunderbird.
  3. Install the ImportExportTool NG add-on in Thunderbird. If you need assistance, see this posting.
  4. Import the .mbox file.
  5. Create a folder for the files.
  6. Highlight all the emails once you see them. Right click on a highlighted portion, and go to "Save Selected Messages" -> "HTML Formats with attachments". Then choose the folder created in step #5.
  7. You are done.

How Do You Troubleshoot Vagrant when You Receive “The box you’re attempting to add doesn’t support the provider you requested”?

Problem scenario
You run "vagrant up", but you get one of the following error messages:

The box you're attempting to add doesn't support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn't
simply misspell it.

If you're adding a box from HashiCorp's Vagrant Cloud, make sure the box is
released.

Name: foobar/Windows2016
Address: https://vagrantcloud.com/foobar/Windows2016
Requested provider: [:libvirt]
"

"The following settings shouldn't exist: provider"

What should you do?

Solution
Go to your Vagrantfile. Find the "provider" stanza. You need to have a stanza like this (but substitute "virtualbox" for "vmware_fusion" if necessary):

config.vm.provider "virtualbox"

How Do You Fix the Error “grep: memory exhausted”?

Problem scenario
You run a grep command but it fails. You get a message about "memory exhausted." What should you do?

Solution
Possible Solution #1
If you are comparing two files line-by-line, try reversing the order of the file arguments for the grep command. For example try these two versions:

grep -f a.txt b.txt
grep -f b.txt a.txt

If the file in the left argument is smaller, we know it uses less memory.

Possible Solution #2
If you have enough disk space, add swap space. See this posting if you need more assistance.

Possible Solution #3
See How Do You Add Memory to a Server? for resizing the VM to add more memory.

A List of Terraform Books

1492046906Terraform: Up & Running: Writing Infrastructure as Code by O'Reilly Media
B08H8XD9W4Terraform Cookbook: Efficiently define, launch, and manage Infrastructure as Code across various cloud platforms by Packt Publishing
1098114671

Infrastructure as Code: Managing Servers in the Cloud by O'Reilly Media
1838642730Learning DevOps: The complete guide to accelerate collaboration with Jenkins, Kubernetes, Terraform and Azure DevOps by Packt Publishing
1491977086Terraform: Up and Running: Writing Infrastructure as Code by O'Reilly Media
B08FYSXCC2HashiCorp Certified: Terraform Associate Practice Test
B01MZYE7OYThe Terraform Book by Turnbull Press
B07V1JHDGSLunchtime Labs: Terraform with AWS: Streamline your infrastructure operations | Learn how to use the Terraform Infrastructure as Code (IaC) tool to manage AWS in a Lunchtime

How Do You Respond to a Vagrant Prompt for which Interface the Network Should Bridge to?

Problem scenario
You are running Vagrant to create a VM on Oracle VirtualBox. You are given a prompt after your "vagrant up" command:
"Which interface should the network bridge to?"
No option seems to work. You have used a variety of different names, GUIDs, syntaxes, etc. What should you do?

Solution
Use "1)" or "2)" or any of the integer values listed above the question. There should be something like this several lines above the question:

=> default: Available bridged network interfaces:
1) enp1s0
2) virbr0