Posts

How to change the order of columns in the output

In this tutorial, How to change the order of columns in the output of `uniq -c` command. I use read the file and show the unique Name from the file. How many time this name of the file? The content of file as example below [HuuPV@DevopsRoles ~]$ cat devopsroles.txt  huu huu phan van dev devopsroles dev huu huu I use awk, sort uniq command to read file and show the unique Name as example below [HuuPV@DevopsRoles ~]$ cat devopsroles.txt | awk '{print $1}' | sort | uniq -c | sort -nr       4 huu       2 dev       1 van       1 phan       1 devopsroles Now, How to change the order of columns in the output of file [HuuPV@DevopsRoles ~]$ cat devopsroles.txt | awk '{print $1}' | sort | uniq -c | sort -nr | awk '{ print $2,$1}' huu 4 dev 2 van 1 phan 1 devopsroles 1 [HuuPV@DevopsRoles ~]$ cat devopsroles.txt | awk '{print $1}' | sort | uniq -c | sort -nr | awk '{ print $1,$2}' 4 huu 2 dev 1 van 1 phan 1 devopsroles ...

ntfsfix fix NTFS not mount from Linux

Introduction Encountering issues with mounting an NTFS-formatted external USB drive on Fedora 32 is a common problem for Linux users. This typically happens due to file system errors or compatibility issues between Linux and NTFS. Fortunately, Linux provides powerful tools like ntfsfix to resolve these issues effectively. In this guide, we’ll walk you through the step-by-step process of identifying the problem, fixing the corrupted NTFS filesystem, and ensuring your external USB drive works seamlessly on Fedora 32. Whether you’re a beginner or an experienced Linux user, this solution will help you troubleshoot and resolve NTFS drive mounting issues with ease. How to Fix Corrupted NTFS External USB Drive on Fedora 32 Step 1: Install Required Packages First, install the ntfs-3g and ntfsprogs packages on your Fedora system to ensure you have the necessary tools for working with NTFS partitions. Run the following command:  sudo dnf install ntfs-3g ntfsprogs Step 2: Identify Your Ex...

How to Fix the semanage command not found in Centos 8

Introduction Encountering the "semanage command not found" error in CentOS 8? Learn how to fix it by installing the necessary package. This step-by-step guide will help you resolve the issue and get back to managing SELinux policies efficiently. If you're working with SELinux (Security-Enhanced Linux ) on CentOS 8, you may come across the error `bash: semanage: command not found`. This error indicates that the `semanage` command, which is essential for managing SELinux policies, is not available on your system. In this guide, we'll walk you through the steps to fix this issue by installing the required package. By the end of this tutorial, you'll have the `semanage` command up and running on your CentOS 8 system. Understanding the Error: "semanage command not found" What is the `semanage` Command? The `semanage` command is a part of SELinux, which stands for Security-Enhanced Linux. SELinux is a security architecture integrated into the Linux kernel, pro...

How to Upgrade php version on Centos 7: A Comprehensive Guide

Introduction Learn how to upgrade PHP version on CentOS 7 from PHP 7.1 to PHP 7.4 in this detailed guide. Follow our step-by-step instructions to ensure a smooth upgrade process on your CentOS 7 server. Upgrading your PHP version on CentOS 7 is essential for ensuring that your server is secure, efficient, and compatible with the latest web applications. In this guide, we will walk you through the process of upgrading from PHP 7.1 to PHP 7.4. Whether you're running a personal blog, a business website, or a complex application, keeping your PHP version up to date is crucial. This tutorial will cover everything you need to know, from checking your current PHP version to enabling the Remi repository and updating your server. Why Upgrade PHP on CentOS 7? PHP is a server-side scripting language that powers a large percentage of websites on the internet. Each new version of PHP brings improvements in performance, security, and features. By upgrading to PHP 7.4, you can take advantage of ...

How to Install Specific Version of Package use YUM

Image
Introduction Learn how to install specific versions of packages using YUM on CentOS/ RHEL systems with detailed steps and advanced examples. YUM (Yellowdog Updater, Modified) is a powerful package management tool used in CentOS and RHEL-based systems. While installing the latest version of a package is straightforward, sometimes you might need a specific version. This guide covers the steps to install a specific package version using YUM, from basic to advanced examples. Understanding YUM and RPM YUM is a front-end tool for RPM (Red Hat Package Manager) that manages package installations, updates, and removals. RPM is the underlying package format used by Red Hat-based distributions. Understanding these tools is crucial for efficient package management. What is YUM? YUM simplifies the process of managing RPM packages by resolving dependencies and retrieving package metadata from repositories. It can install, update, and remove packages from your system. What is RPM? RPM is a low-level...

How to resolve Error: rpmdb open failed In CentOS

In this tutorial, How to resolve Error: rpmdb open failed Error In CentOS. I was testing on nginx web server in Centos 7 VM Linode . Unfortunaely, I have install new package with yum command , I got this error message: error: rpmdb: BDB0113 Thread/process 3050/139803232012096 failed: BDB1507 Thread died in Berkeley DB library error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db5 -  (-30973) error: cannot open Packages database in /var/lib/rpm CRITICAL:yum.main: Error: rpmdb open failed It seemes like YUM broke down. I have not run any yum command. Solve problem, just do the following steps.   First backup the rpm database using command as root user: # mv /var/lib/rpm/__db* /tmp Run the following command: # yum clean all # yum update Clean backup # rm -i /tmp/__db* I hope this helps you.

How to Safely Remove old kernels in CentOS, RHEL and Fedora

Image
Introduction Learn how to safely remove old kernels on CentOS , RHEL , and Fedora to free up space and improve system performance. Step-by-step guide with best practices for maintaining your Linux system. As you continue to update and upgrade your Linux system, particularly on distributions like CentOS, RHEL, and Fedora, old kernels can accumulate over time. While these kernels are essential for booting your system, having too many can clutter your boot menu and consume valuable disk space. This guide will walk you through the process of safely removing old kernels from your system without risking stability, ensuring that your Linux machine runs smoothly and efficiently. Why Should You Remove Old Kernels? The Problem with Accumulating Kernels Linux kernels are the core of the operating system, responsible for managing hardware and system processes. Every time you update your system, a new kernel may be installed, but the old ones aren't automatically removed. This can lead to seve...

How to install aide centos

Image
Introduction In this tutorial, we will explore how to install and configure AIDE (Advanced Intrusion Detection Environment) on CentOS. AIDE is a powerful tool designed for monitoring changes to files on the system, helping you detect unauthorized access and modifications.  Ideal for system administrators and security professionals, this guide will provide step-by-step instructions to ensure a successful setup of AIDE on your CentOS system. By the end of this tutorial, you will have a robust intrusion detection system in place, capable of providing detailed reports about the integrity of your files and system security. What does Aide mean AIDE is one of the most popular tools for monitoring the server changes in a LINUX based system.  It call as Advanced Intrusion Detection Environment. Install AIDE on Centos $ sudo yum install aide Check AIDE Version on your system $ sudo aide -v Configure AIDE $ sudo cp /etc/aide.conf /etc/aide.conf_BK Add lines not check /tmp ...

After install setup Fedora 30

Image
In this tutorial, Things to Do After Fresh Installation Fedora 30. Let do it! TO DO 1. Update your Fedora Always keep your system updated to the latest version of packages. $ sudo dnf update 2. Change the hostname $ sudo hostnamectl status # view current hostname $ sudo hostnamectl set-hostname --static "VivoS15" # set up new hostname 3. DNF tweak edit /etc/dnf/dnf.conf file $ sudo cp /etc/dnf/dnf.conf /etc/dnf/dnf.conf_ORIG [huupv@localhost ~]$ cat /etc/dnf/dnf.conf [main] gpgcheck=1 installonly_limit=3 clean_requirements_on_remove=True fastestmirror=true deltarpm=true 4. Install RPM fusion repository $ sudo dnf update --refresh $ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm $ sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm 5. Player and codecs $ sudo dnf install youtube-dl vlc $ sudo dnf in...

Checks for open/closed ssh ports using nmap command

Image
Introduction Welcome to our detailed guide on how to check for open and closed SSH ports. In today's networked world, maintaining secure server connections is critical. Secure Shell (SSH) is a network protocol that provides administrators with a secure way to access a remote computer.  However, ensuring that your SSH ports are configured correctly is essential to prevent unauthorized access and breaches.  This tutorial will provide you with step-by-step instructions on using various tools to determine the status of SSH ports on your system. Whether you're a seasoned system administrator or a novice user, these skills are fundamental to managing and securing your network connections. In this tutorial, How to checks all ports if they are closed or open and if the current ssh version? Using nmap command. Read man nmap page. First, you need to install nmap . For ubuntu $ sudo apt-get install nmap For centos $ sudo yum install nmap For example, checks for open/closed ports...