Linux provides several powerful tools to monitor system performance, especially memory and CPU usage. Sometimes we need to identify the processes that are consuming high memory and CPU to troubleshoot performance issues. You can use preinstalled system utilities like ps, top commands or external tools like htop, vmstats etc. Each tool comes with different advantages. This article explains how to identify the top processes consuming memory and CPU using simple commands. 1. Using the ps Command The ps command is one of the most versatile tools for displaying information about running processes. You can easily filter the output fields and…
Author: Rahul
Comments are an important part of any programming languages that help users to understand about working of code block. Similar to other programming languages Python also allows us to add comments in our code. We can use single line comments or multiline comment for block of code. Assuming you have to comment out multiple adjacent lines in a file, then you can use multi-line comments in your Python application. In this tutorial, you will learn about comment block of code in Python scripts. We can use triple quotes to comment out a block of code in Python. You can either…
Regular expressions are powerful input validators and are especially so for formats that follow a predictable pattern, such as phone numbers. A well-constructed regex will ensure that the input is according to the expected format and reduces errors, hence improving data quality. This article explores how the following regex is used in the validation of common phone number formats across Python, Java, and JavaScript: The Regular Expression Here is the common regular expression that helps you to validate common phone number formats. /^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4}$/ The example phone numbers that matches by the above regex. 123-456-7890 (123) 456-7890 123.456.7890 123 456 7890…
The warning message indicates that the globally installed Angular CLI version in your system is greater than the locally installed one in the project. The problem is that the older version is being used because Angular CLI looks for the local version first when executing commands on a project. This version mismatch may cause incompatibility issues and errors such as the one you’re experiencing. This tutorial will help you to resolve “Your global Angular CLI version is greater than your local version” issue in your Angular application. 1. Local Angular CLI Version Upgrade To fix the mismatch, update the existing…
Would you like to convert your text documents or articles into speech that you can listen to wherever you want? This Python script makes it easy for you. It takes text input from a file and generates an audio output in mp3 or .wav format. Then you can put your feet up and listen to it while driving, working out, or just chilling. We will utilize pyttsx3, an offline text-to-speech conversion library. You do not have to do anything but just mention the name of your text file and the name the audio file will be stored as. The script…
As of today Docker is the most popular tool for running and managing containers. However, if you don’t manage the logs generated by Docker containers, they can grow large and take up too much disk space. Automatic log rotation is the solution to keep log files under control. This tutorial will help you to setup automatic log rotation in different scenarios using simple, clear instructions. What Is Log Rotation? Log rotation means automatically limiting the size and number of log files generated by the Docker containers. Instead of one large log file, it splits logs into smaller chunks or keeps…
Samba is an opensource program that was developed for file sharing and printing over network using SMB protocol. Now a days it is basically used for providing Linux file system shares to accessible on Windows systems. This tutorial will help you step by step guide to install and configure Samba server on Ubuntu to share files and folders across different computers on a network. The steps are simple and written in easy-to-understand language, so anyone can follow along. Step-by-Step Guide to Install and Configure Samba Follow the below steps to complete setup for a working Samba server on your Debian…
Tomcat is a web server for deploying java-based web applications. It is developed and actively maintained by the Apache foundation. As of today, during updating this article Tomcat 11 is the latest version available for the installation. You can also check for the latest version on tomcat download page. This tutorial will help you to install and configure latest Tomcat on your Ubuntu 24.04 system. You can also use the same instructions for Ubuntu 24.10 and 22.04. Step 1: Update Your System Before installing any software, it’s important to update your system. This ensures that you have the latest security…
Oracle Java 25 has been released for the Java SE platform. Since this is a long-term support (LTS) version, it will be supported until September 2028. It includes many improvements and bug fixes. If you are using a workstation, you should consider upgrading to this version. Production users should upgrade only after making sure all their applications are compatible with this version. This tutorial will help you to install Oracle Java 25 on Ubuntu 24.04 LTS, 22.04 LTS ,and 20.04 LTS systems using the official Debian file. Follow the steps below to install Java on the Ubuntu command line. Step…
PowerShell provides powerful tools for managing and interacting with files, even when they are large. If you’re working with massive text files, you may only want to view specific portions, such as the first or last few lines, to avoid loading the entire file into memory. In this article, we will explore how to efficiently retrieve the first and last 10 lines of a file using simple PowerShell commands. Fetching the First 10 Lines of a File To extract the first 10 lines of a large file, PowerShell’s Get-Content cmdlet can be used with the -TotalCount parameter. This method allows…


