How Do You Change The “From” Address in an Email Sent via the Mail Command on Linux?

Problem scenario
You want Linux to send out an email with a alias email address in the “From” field. You are using the mail command on a Linux server. You want to customize the “from” address in the emails that you send. What do you do to choose your own “from” email address (e.g., jdoe@myowndomain.com) in the email that is sent out?

Solution

Prerequisites
You need to have mailx installed.

How Do You Write a Python Program to Show the Status of the Servers in AWS?

Problem scenario
You want to list the statuses of each EC-2 instance in AWS using Python. How do you do this for a given region in AWS (e.g., us-west-1)?

Solution
Prerequisites
This assumes you have installed Boto3. If you do not know how, see this posting “How do you install Boto 3 on a RHEL server in AWS?

How Do You Troubleshoot This Problem “[ERROR KubeletVersion]: couldn’t get kubelet version: executable file not found in $PATH”?

Problem scenario
You run this command: sudo kubeadm init

You get this problem: “[ERROR KubeletVersion]: couldn’t get kubelet version: executable file not found in $PATH”

What should you do?

Solution
Install kubelet. See this posting you need assistance. (If it is a Red Hat distribution of Linux, you can try How Do You Install kubectl,

How Do You Use a YAML File or a YAML Manifest in Kubernetes?

Problem scenario
Kubernetes can use YAML files for configuration. The book Kubernetes in Action by Luksa refers to these files as manifests (pages 148), YAML manifests (page 155) or “pod manifests” (page 451). The Kubernetes website refers to this YAML file as “the PodSpec” here. Pod templates are defined inside these .yaml files (as a subset of the file itself). How do you use these YAML files?

How Do You Troubleshoot an Error like This in Groovy “groovy.lang.MissingMethodException”?

Problem scenario
You run a Groovy program like this: groovy foobar.groovy

You see this message:

Caught: groovy.lang.MissingMethodException: No signature of method: java.lang.Boolean.call() is applicable for argument types: (foobar$_run_closure5$_closure6) values: [foobar$_run_closure5$_closure6@6150c3ec]
Possible solutions: wait(), any(), wait(long), and(java.lang.Boolean), each(groovy.lang.Closure), any(groovy.lang.Closure)
groovy.lang.MissingMethodException: No signature of method: java.lang.Boolean.call() is applicable for argument types: (foobar$_run_closure5$_closure6) values: [foobar$_run_closure5$_closure6@6150c3ec]
Possible solutions: wait(), any(), wait(long), and(java.lang.Boolean), each(groovy.lang.Closure), any(groovy.lang.Closure)
at foobar$_run_closure5.doCall(foobar.groovy:56)

What should you do?

When You Have Two Branches in a Git Repo, How Can You Reconcile the Differences When You Merge Them?

Problem scenario
When you have created a branch of a Git repo, and there have been changes made to the master branch and this second branch you created, what are your options?

Possible Solution #1. You can merge the two branches (e.g., with a pull request). One branch will prevail if there are any conflicts. You can select which branch to prevail with GitLab,

How Do You Find the Storage Space Displaced by a Directory and All of Its Files and Subdirectories on a Linux server?

Problem scenario
How do you find the space used on the disk (e.g., hard disk, SAN or NAS) from the files and subdirectories of a given directory via a Linux command prompt?

Problem scenario
Run a command such as this: sudo du -sh /path/to/subdirectory

It will show you how much space is being consumed (or utilized) by the “subdirectory”.

How Do You Write the Equivalent of a “hello world” Program with Machine Learning in Python?

Problem scenario
You want to be able to say you ran a machine learning program. You know some Python basic. What do you do to write a very simple machine learning program?

Solution
Prerequisite
This assumes that pip has been installed. If you need assistance see this posting.

Procedures

1.

How Do You Troubleshoot Cassandra when It Hangs on the Message “ColumnFamilyStore.java Initializing”?

Problem scenario
You start Cassandra with this command: ./bin/cassandra
You see one of the following messages:

INFO [MigrationStage:1] 2018-04-06 19:01:07,144 ColumnFamilyStore.java:391 – Initializing system_auth.resource_role_permissons_index
INFO [MigrationStage:1] 2018-04-06 19:01:07,163 ColumnFamilyStore.java:391 – Initializing system_auth.role_members

No progress is happening. What should you do?

Solution
Possible Solution #1. Try rebooting the server. This could help the problem.