Category: Linux

Create a Port Listener to verify connectivity

How to test an open port without having the application installed. Suppose you have a situation where you just created a new Linux server (CentOS 6) and you will eventually have an application run on Tomcat port 8080/tcp. You will want this application to use some sort of a Reverse Proxy and this all goes through a firewall that sits…

Read More »

Kickstart validation

Customizing a kickstart file to meet your requirements can be challenging.  One typo or incorrect setting and it simply won’t work.  Validation of a success or fail can be achieved with a time consuming reboot.  However, there is a quicker solution. Be certain to validate the kickstart on the same operating system version as the kickstart file or you may…

Read More »

Add custom DNS entries to Pi-Hole

Pi-Hole is the black hole for the internet. As of the most recent Pi-hole Version v2.13.2 with Web Interface Version v2.5.2, a local network should have the necessary tools, DNS and DHCP servers, to run successfully. With that said, what if you want custom DNS settings? I tried this approach successfully, so now one IP resolves to several domain names….

Read More »

Add Root Certificates to a CentOS Linux Server

Adding a root authority certificate to a server that does not already have the cert may be added to the server manually. CentOS 6 Install the ca-certificates package: yum install ca-certificates Enable the dynamic CA configuration feature: update-ca-trust force-enable Add it as a new file to /etc/pki/ca-trust/source/anchors/: cp foo.crt /etc/pki/ca-trust/source/anchors/ Use command: update-ca-trust extract CentOS 7 CentOS 7.0 and later…

Read More »

Fix the CentOS Root Certificate Authority file

For whatever the reason, the /etc/pki/tls/certs/ca-bundle.crt file may get corrupted, in my case, accidentally overwritten.  I could have gone the route of copying the ca-bundle.crt file from another vanilla server, but I wanted a more elegant solution.  There is one, download a new certificate bundle. Download the new certificate bundle.  Since my ca-bundle.crt was overwritten, there was no need to…

Read More »

How to Combine Multiple Images Quickly

If you have ever started an eBay auction and wanted to add your large picture collection to it, you will quickly realize that you can only add up to 12 pictures.  While it is true pictures can be added to the body of the auction and linked to an alternate sources, that is extra work. As a work-a-round to the…

Read More »

Check if user account is locked in Linux

If you ever needed to know if an account is locked in CentOS Linux, there are a few commands to find those answers. Password Lock a password using passwd. Additional confirmation that the password is locked.  The double !! indicates that the password is locked.  Note that this user does not have a password. Unlock the password.  Note that the password…

Read More »

A quick way to install the ELK stack (Kibana 4.4)

By combining the massively popular Elasticsearch, Logstash, and Kibana (what was the ELK Stack is now the Elastic Stack), Elastic has created an end-to-end stack that delivers actionable insights in real time from almost any type of structured and unstructured data source. There are many resources that offer installation procedures from simple to complex configurations.  This is my take on a simple installation…

Read More »

Create a large file in Linux for testing

There are many ways to go about this.  A common favorite is the use of the dd command. This simple two letter command requires so many parameters to accomplish the simple goal of generating a file of a specific size. There is another way, and it’s easier to remember too. Create a 100MB file using dd will look something like…

Read More »

Reduce the number of commands with sed

Suppose there is a situation that a server has multiple files that are nearly identical and you want to remove content from them.  In this example suppose that server has multiple NIC cards.  There is content that needs to be deleted. The situation, you have five NIC cards.  Each ifcfg-ethx config file contains the values for NM_CONTROLLED, HWADDR, GATEWAY, and…

Read More »

Remove the ^M from config files

Working in both Windows and Linux environments can from time to time create undesirable effects when modifying Linux configuration files on Windows boxes. After the edits and copying the file to the Linux box, a quick check of the file using the cat revealed nothing out of the ordinary.  However, the vim revealed the hidden ^M. I’m still not entirely…

Read More »

audit2allow error and explanation.

While troubleshooting some SELinux enforcement related issues using audit2allow, an ERROR message presented itself. After some research, a logical explanation was presented. The following error is an implication that there were no avc denials in the /var/log/uadit/audit.log and that the generated module was empty. That response was satisfactory and also correct for this situation. However, when running an all inclusive…

Read More »

Add a new hard disk without rebooting in Linux

Having added a virtual hard drive to a virtual machine, the fdisk -cul command doesn’t reveal any new drives.  There are a few ways to get Linux to recognize this new drive without having to reboot the computer. A tried and true method that I have used on many occasions is this approach.  The problem with this approach is that…

Read More »

One way to compile xtables-addons without error

There seems to be some consistency on how to compile xtables-addons.  Notice I didn’t suggest an agreement in the more popular approaches.  It seems that much of the approach is more of a copy and paste from one site to the next with some slight variation.  What generally isn’t immediately obvious is the version of CentOS used or the version…

Read More »

How to create a directory with permissions in Linux

The other day I was reading through some newsgroups on how to better automate a script.  Part of the script contained an interesting command that looked promising; however, could not get it work. This is the command. While it looks interesting, a quick execution of it created three directories, icinga:icinga, 0700, and mydirectory. This was not the desired effect. Looking…

Read More »

Elasticsearch bootstrap checks failed [RESOLVED]

After installing Elasticsearch the application failed to start with a bootstrap error. ERROR: bootstrap checks failed max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] max number of threads [1024] for user [username] is too low, increase to at least [2048] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least…

Read More »

“cannot set user id: Resource temporarily unavailable” [Resolved]

There are several servers that seemed to be setup identically with a local user account called user1 which may be found using getent passwd user1. However, for one reason or another, the account had become inaccessible and returned an error. Although a reboot of the CentOS 6 server resolved the issue, I wanted to know more. It is Linux after…

Read More »