Problem scenario
You are using CentOS/RHEL/Fedora and want to troubleshoot DNS functionality. You are getting “command not found” errors when you try to use the dig or nslookup utilities. What should you do?
Solution
Run this command:
sudo yum -y install bind-utils …
Continue reading “How Do You Install dig and nslookup on a CentOS/RHEL/Fedora Server?”
Problem scenario
Using the AWS CLI how do you determine the AWS region for an S3 bucket?
Solution
Run this command (but replace “foobar” with the name of your bucket):
aws s3api get-bucket-location –bucket foobar …
Continue reading “How Do You Determine the AWS Region for an S3 Bucket?”
Problem scenario
You want to list all the VPC Peering Connections for a specific region using Python.
You want the equivalent of aws ec2 describe-vpc-peering-connections
How do you show (retrieve or fetch) the VPC peering connections using Boto3?
Solution
import boto3
contint = boto3.client(‘ec2’)
var1 = contint.describe_vpc_peering_connections()
print(var1) …
Continue reading “How Do You Display the VPC Peering Connections with Boto3?”
Question
Whenever you read about the MVC, it always involves Microsoft (e.g., and ASP or .NET). Is there a way to use the MVC on purely Linux?
Answer #1
Yes. The ASP.NET MVC framework of the model-view-controller is a Microsoft implementation of it. The MVC generically can be used as an architectural pattern using programming languages on a Linux server. To read more about it,
…
Continue reading “Can You Use the MVC (Model-View-Controller) on Linux?”
Problem scenario
You want to write a program to call a bound function in a new thread. How do you do this?
Solution
Run this program (e.g., python foobar.py):
from threading import Thread
class mighty:
def good():
print(“Good”)
def contint():
print(“Hello!”)
if __name__ == “__main__”:
thread = Thread(mighty.good())
thread.start()
thread.join()
print(“thread finished…exiting”) …
Problem scenario
You are using WordPress for your website. In some text, paragraph blocks you use with the “<Code” syntax on some lines of computer programming code. The first word is indented from the left. You do not want this indenting. What should you do so your code looks like code but does not have this indentation problem?
Solution
Do not use the “Paragraph” formatting.
…
Problem scenario
You want to read input and assign it as a variable in JavaScript. What should you do?
Solution
Create a .html file, saved directly on your desktop or in a /var/www/html/ directory on a web server, with the follow content to illustrate how to do this (then open it in a web browser):
<!DOCTYPE html<html<body<h2Use JavaScript to Change Text</h2<pThis example writes “Hello in JavaScript from Continualintegration.com!” into an HTML element with id=”demo”:</p<p id=”demo”</p<scriptvar foo = prompt(“Please enter input and press enter”); …
Continue reading “How Do You Assign a Variable in JavaScript from User Input?”
Problem scenario
You have installed Postfix (e.g., version 3.2.0) on your Linux server. You know several emails that were sent (or attempted to be delivered) bounced. You want to have a list of those unique email addresses by themselves. What do you do?
Solution
Run this command:
sudo cat /var/log/mail | grep bounce | awk ‘ $0 ~ /@/ {print $5}’ | awk ‘{FS=”to=”; …
Problem scenario
An “if” statement in Bash is throwing an error message “No such file or directory.” What do you do?
Possible solution #1
Replace the parentheses around the arithmetical comparison with double parentheses. Instead of this:
if ( $numlines < 5); then
Use this:
if (( $numlines < 5)); then
Possible solution #2
Replace the “[]” with “(())”.
…
Continue reading “How Do You Troubleshoot a Bash Script with the Error “No such file or directory”?”