What Does AI Stand For in addrinfo?

Problem scenario
You see several variables that start with “ai_”. What does the “a” and “i” stand for?

Solution
The “a” stands for “address” and the “i” stands for “info”.

The man page for getaddrinfo says “The getaddrinfo() function is defined for protocol-independent nodename-to-address translation.” taken from http://www.nsc.ru/cgi-bin/www/unix_help/unix-man?getaddrinfo.

Therefore ai_flags, ai_family, ai_scoktype, ai_protocol, ai_addrlen,

Why Is There an Apparent Difference Between “docker run” and the Series of Two Commands “docker create” And “docker start”?

Problem scenario
When you run “docker run“, the container has a port that is exposed and the web application works properly.  When you use “docker create” then “docker start“, the service is not exposed properly. You believe that “docker run” the same as a series of two steps, first “docker create” then “docker start“.

Is It OK to Delete /lib64/libk5crypto.so.3 from a Linux Server?

Problem scenario
You want to rebuild libk5crypto.so.3. Can you delete this file?

Solution
No. Once you delete it, sudo commands will stop working. You will not be able to log into the server via SSH either if the file is moved from the /lib64/ directory.

To learn more about the file and an rpm package that provides it, go here: https://centos.pkgs.org/8/centos-baseos-x86_64/krb5-libs-1.17-18.el8.i686.rpm.html

How Do You Run a Bolt Command from a Linux Server to a Windows Server?

Problem scenario
You want to run a PowerShell script or run an interactive command on a Windows server. You have Puppet Bolt installed on a Linux server. You do not need to use SSL. What do you do?

Solution
Run a command like this (but substitute x.x.x.x with the IP address of the Windows server, jdoe with the username and coolpassword with jdoe’s password):

bolt command run “Get-Process” –Targets winrm://x.x.x.x –no-ssl –user jdoe –password coolpassword

To run a script called “cool.ps1”,

How Do You Troubleshoot Kubernetes when the Pods Are Not Working Correctly?

Problem scenario
You deployment Kubernetes. You used “kubectl create” to deploy some pods. Pods are not getting IP addresses and the status is Pending. What do you do?

Solution

  1. Run a command like this (but replace “foobar” with the namespace of the Kubernetes pods you are trying to troubleshoot):

kubectl get all -n foobar

  1. The above command should list relevant deployment names or pod names.

How Do You Get a footer.php File to Have a Change Apply in WordPress?

Problem scenario
You clicked “Update file” after you made changes to a .php file in WordPress (via the Theme Editor). You have refreshed the web page, but the changes have not taken effect. What should you do?

Possible Solution #1
Can you update the theme? If the theme has an update waiting, getting it updated can fix this problem.

Possible Solution #2
Clear the history of your web browser.

How Do You Write a Palindrome Tester Function in Python?

Problem scenario
You want to write a palindrome tester function in Python without the :: operator in the code (that reverses the order of the list). What do you do?

Solution

def palindrome_tester(s):
s = s.lower()
x = len(s) // 2
for i in range(x):
if s[i] == s[-(i+1)]:
pass
else:
return False
return True

var_string = “mmnMM”

if (palindrome_tester(var_string)):
print(var_string + ” is a palindrome!”)
else:
print(var_string + ” is NOT a palindrome!”) …

How Do You Write a Terraform Module in AWS?

Problem scenario
You want to write a Terraform module in AWS. What do you do?

Solution
You will use the keyword “module” in a .tf file, and you will use either “terraform init” or “terraform get” to install the module. The directions below were adapted from https://www.howtoforge.com/how-to-create-a-terraform-module/.

Prerequisite
You need to have Terraform installed;

How Do You Troubleshoot the yum Repository “Errors during downloading metadata for repository”?

Problem scenario
You try to use a yum command on RHEL 8.2. But you get this error:

Docker Repository 0.0 B/s | 0 B 00:00 Errors during downloading metadata for repository ‘foobar’: – Curl error (6): Couldn’t resolve host name for https://yum.dockerproject.org/repo/main/centos/7/repodata/repomd.xml [Could not resolve host: yum.dockerproject.org] Error: Failed to download metadata for repo ‘foobar’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

What should you do?

How Do You Troubleshoot the InsufficientFreeAddressSpaceInVpc Error?

Problem scenario
You run an AWS CLI command. But you get this message:

An error occurred (InsufficientFreeAddressSpaceInVpc) when calling the CreateDefaultSubnet operation: The VPC ‘vpc-123abcd’ does not have enough free address space to allocate an additional /20 subnet.

How do you troubleshoot this AWS CLI error?

Solution
Go to the VPC section of AWS. Find the VPC in the error and click on it.