Category: Linux

Certbot Requires Python 2.7

This article describes how to use certbot with Python 2.7.  The assumption is that you have already installed certbot. At the bottom of this article, is a related post on how to install Python 2.7.  After installing Python, install/run certbot. To run certbot, enable python 2.7 first, then run the certbot commands. If, however, you are still getting errors about...Read More »

Install Python 2.7 on CentOS 6.x

CentOS 6.x uses python 2.6 for various things.  It is the default install and Python 2.7 is not available as a typical install but I  had a need for it and found a solution that worked for me. The test. If you type exit, and type python -V, this will revert to the existing python version.  The scl enable is…

Read More »

smbclient error in Mounting CIFS and NFS

There is a known working samba share.  There are servers that connect to it.  All of them happen to be Windows boxes.  However, wanted to connect a Linux (CentOS 7) to it.  When testing for a connection, it failed with an error message. The command and the error. The resolution turned out to be a simple one.  Update the client...Read More »

CentOS Linux and passwords

User creation and password changes can be handled as one-liners for as long as you use the correct commands.  Today I learned of another password utility other than passwd.  It is chpasswd, a powerful tool to change passwords without the prompt and the password can be encrypted. To create a user may be a two step process. First create the...Read More »

Rename all files to lowercase names

There seems to be several solutions offered for renaming all files in a directory from mixed or upper case to all lowercase names. Of the solutions, one of the worked without issue. ls | while read upName; do loName=`echo "${upName}" | tr '[:upper:]' '[:lower:]'`; mv "$upName" "$loName"; done Although this was found in an Ubuntu forum, it works flawlessly in...Read More »

Remove non-ASCII characters from file

There was a text file that contained non-ASCII characters that acted like spaces within the file, so I used the tried and true dos2unix command to attempt to clean the file; however, the characters remained.  With hundreds of lines to correct, manually deleting the offending areas of the file was not an option.  A real solution is needed. Once again,...Read More »

The truncate command

If you ever get in a bind and a log file has gone out of control and your disk space is full, you may be tempted to delete the log file.  There may be a couple of problems with that.  One, the application is still using the file so that delete may not actually take place until the application is...Read More »

Best Practice for chown

Over the years, I have seen a couple of variations with the use of the chown command. The ":" (colon) vs "." (dot).  While studying for the RHEL6 exam sometime ago, the books that I had used each had one or the other in their documentation.  I have read that the posix standard is using chown with the ":" (colon)....Read More »