Why Do You Have a Discrepancy between the Maximum Number of File Descriptors between Your /etc/security/limits.conf File and What You Are Seeing in the Logs?

Problem scenario
You run a ulimit -Hn command.  You see the limit of the file descriptors to be what you expect.  But in the logs of an application, there is a discrepancy.  Why is one log reporting that the limit to file descriptors is different from the output of a “ulimit -Hn” or “ulimit -Sn” command?

Solution
Root cause
The ulimit -Hn and ulimit -Sn commands do not show the whole story. 

How Do You Enter Data into a Cassandra Table?

Problem scenario
You want to insert data into a Cassandra table.  How do you do this?

Solution
Prerequisites

Install and configure Cassandra.  If you do not know how, click on this link and go to “Possible Solution #5” at the bottom to determine the distribution of Linux that you have.

Procedures
1.  Create the table with this command:
CREATE TABLE contint(
  

How Do You Install Gradle on Any Type of Linux?

Problem scenario
You want to be able to install Gradle on a Debian/Ubuntu Linux server, a Red Hat derivative of Linux (e.g., CentOS/RHEL/Fedora), or Linux SUSE.  How do you do this with the same script?

Prerequisites
i.  Install Java.  If you need directions, see this posting.
ii.  Install unzip. 

  • If you are using Debian or Ubuntu, run this command: sudo apt-get -y install unzip
  • If you are using a Red Hat deriviative (e.g.,

How Do You Troubleshoot a GitLab Webhook Failing Because of “Execution expired”?

Problem scenario
You try to test an Integration, specifically a Webhook, in GitLab.  The URL is for Jenkins.  You get “Execution expired.”  What could be wrong?

Possible solution #1
See if the GitLab’s IP address or hostname changed.  If the external_url stanza in /etc/gitlab/gitlab.rb uses an old IP address or FQDN, then that may need to be updated.  You may need to run “sudo gitlab-ctl reconfigure” again. 

How Do You Write a Java Program to Accept Text from the Command Terminal and Print It Back Out?

Problem scenario
You want to write a basic Java program to test it out.  How do you write a program to accept user input, specifically a alphanumeric input, and print it back to the screen?

Solution
1.  Install the Java Development Kit if you have not installed it yet.  If you are not sure you have it, run “javac -version“.  If it says that the command is not found,

How Do You Troubleshoot the Ansible Error “Syntax Error while loading YAML expected <block end>, but found ‘-‘”?

Problem scenario
You are trying to run an Ansible playbook with the “become: yes” stanza.  You get this error after your ansible-playbook command:

“ERROR! Syntax Error while loading YAML.
  expected <block end>, but found ‘-‘

The error appears to have been in ‘/home/cooluser/good.yaml’: line 4, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

 

In Python, How Do You Call an Unbound Function as a New Thread with the thread Module?

Problem scenario
You want to write a program to call a unbound function in a new thread with the threading module. How do you do this?

Solution
Run this program (e.g., python foobar.py):

import _thread as thread
def contint():
print(“Hello!”)

#if name == “main”:
foobar = thread.start_new_thread(contint, () )
print(“thread finished exiting”) …

How Do You Troubleshoot the Bash Script Error “line 5: $’\r’: command not found”?

Problem scenario
You drafted a Bash script on a Windows computer.  You then uploaded it to Google Cloud Platform via a web browser feature.  When you run the bash script on a Linux server (e.g., in GCP), you get this error “line 5: $’\r’: command not found”.  You do not want to install dos2unix or any new packages.  What should you do?

Solution
The file needs to be modified or “cleaned up.” 

How Do You Install Jira When You Get an Error about Not Having a Graphical UI or an Error about Using the -c Flag to Use the “console” to Install Jira?

Problem scenario
You are trying to install Jira on a RHEL server (e.g., in AWS).  You run this:

sudo ./atlassian-jira-software-7.8.1-x64.bin

But it gives you an error.  You see a message about not being able to connect to an X server and the -c option will invoke a console method.  You try using the -c flag when invoking the .bin script to install Jira.  The problem keeps happening.  What should you do?

How Do You Troubleshoot “ERROR! ‘service’ is not a valid attribute for a Play”?

Problem scenario
You are trying to use the “service” Ansible playbook reserved word.  You want a service to be started.  But when you run the Ansible playbook, you get “ERROR! ‘service’ is not a valid attribute for a Play”.  How do you fix this?

Solution
Change the formatting of the playbook.  Eliminate spaces and make sure indentation aligns with other sections of the playbook.