How Do You Eliminate Unwanted Indentation at the Top of Text in WordPress Postings?

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.

How Do You Assign a Variable in JavaScript from User Input?

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”); …

How Do You Print the Email Addresses That Bounced after They Were Sent from Your Postfix Server?

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=”; …

How Do You Troubleshoot a Bash Script with the Error “No such file or directory”?

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 “(())”.

How Do You Get Your Linux Email Server to Deliver Email Consistently?

Problem scenario
You quickly set up an email server on a virtual machine in a public cloud. Some emails from the server are being received but some are not being received. What could be wrong?

Solution
1. If you are using Postfix, check the files in these locations:

/var/spool/postfix/private/bounce
/var/spool/postfix/bounce
/usr/lib/postfix/bounce

2. Look at the file /var/log/mail for clues about what could be wrong.

How Do You Install GitLab on a CentOS/RHEL/Fedora Server?

Problem scenario
You want to install GitLab on a Red Hat derivative of Linux. What should you do?

Solution
1. Get a CentOS/RHEL/Fedora Linux server with either 3.5 GB of RAM or at least 1.5 GB of RAM and 2 GB of virtual memory. If you need to add more memory (e.g., to an AWS EC-2 instance or a physical on-premise server), this posting can help you.

How Do You Set up a Send-Only Email (Postfix) Server on a Linux SUSE AWS Instance?

Problem scenario
You have a monitoring tool on a Linux server that needs to send out emails upon certain events happening. You want to install and configure an email server. You need to send outbound emails, but you do not need to receive inbound emails. How do you configure Linux SUSE to be able to send out regular emails over the internet?

Solution
1.

In Python How Is the List Function “remove” Different from “pop”?

Problem scenario
You want to know how remove is different from pop when manipulating a list in Python. What should you do?

Solution
Here are four facts which should help elucidate the differences.

  1. The remove keyword searches for a matching item in the list — not by its indexed, integer value; then the first matching item is removed. (We tested it.