Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
How to Delete a Git Branch Remotely and Locally?
Git is a distributed version control system that helps developers manage changes and collaborate on projects efficiently. Git branches provide a way to work on different parts of the same project concurrently without interfering with each other's code. Branches serve as separate instances of a project, with their own commit histories and codebases. This allows multiple developers to work on the same file simultaneously without affecting each other's work. It also enables testing new features before integrating them into the main project, allowing developers to experiment with new ideas without compromising the stability of existing code. Git Branches ...
Read MoreConfigure Collectd as a Central Monitoring Server for Clients
Collectd is a lightweight system statistics collection daemon that gathers performance metrics such as CPU usage, memory utilization, disk I/O, and network traffic. It operates as a central monitoring solution, allowing administrators to collect data from multiple client systems and analyze it from a single server location. This article demonstrates how to configure Collectd as a central monitoring server to collect metrics from distributed client machines and visualize the data using modern dashboards. Prerequisites Before configuring Collectd, ensure you have the following − A server running Linux (Ubuntu or Debian preferred) One or more client ...
Read MoreHow to quickly sum all the numbers in a file on Linux?
Consider that we have a file named bar that contains different numbers inside it. The bar file looks something like this − immukul@192 linux-questions-code % cat bar 11 12 13 We need to get the sum of all the numbers present in the above file. There are several approaches and solutions that we can consider using different commands and techniques. Let's explore these possible solutions one by one. Bash Script Approach The most basic approach is to open the file and read the contents, then calculate the sum of all the numbers using a ...
Read MoreHttps connection using curl on Linux
curl is a versatile command-line tool that supports various protocols including HTTPS for secure web connections. It enables users to transfer data from or to servers and is commonly used for connecting to web servers and retrieving data. This tutorial covers how to use curl to make secure HTTPS connections and handle SSL/TLS certificates properly. What is Curl? Curl is a command-line tool that allows users to transfer data from or to a server using various protocols, including HTTP, HTTPS, FTP, and more. It supports many different types of websites and can be used to connect to any ...
Read MoreMapping Hostnames with Ports in /etc/hosts
The /etc/hosts file is a simple text file used to map hostnames to IP addresses locally on a system. It provides hostname resolution by bypassing DNS servers, allowing administrators to define custom IP-to-hostname mappings. Each line represents a single mapping with the IP address followed by one or more hostnames separated by spaces. Understanding the Hosts File Structure The hosts file is located at /etc/hosts on Unix-like systems and C:\Windows\System32\drivers\etc\hosts on Windows. It follows a simple format where each line contains an IP address followed by hostnames: 192.168.1.100 myserver.local 127.0.0.1 localhost ::1 localhost When ...
Read MorePrint Lines Between Two Patterns in Linux
Printing lines between two patterns is a common text processing task in Linux when you need to extract specific sections from files. While the grep command can find lines matching patterns, it cannot easily extract content between two different patterns. For this purpose, sed and awk commands provide powerful pattern-matching capabilities. This article demonstrates various methods to print lines between two patterns using sed and awk commands with different conditions and filtering options. Sample File Setup First, let's create an example file to demonstrate the pattern matching techniques − cat example.txt Information ...
Read MoreConfiguring Squid Proxy Server with Restricted Access and Setting Up Clients to Use Proxy
Are you looking to configure a Squid Proxy Server with restricted access and set up clients to use the proxy? Squid is a powerful caching proxy server that provides network performance optimization, security filtering, and access control capabilities for organizations. What is Squid Proxy Server? Squid Proxy Server is a popular open-source proxy server that improves network performance and security by caching and filtering web content. It acts as an intermediary between clients and web servers, allowing administrators to control internet access, block specific websites, and monitor network traffic. Installing Squid Proxy Server Install Squid Proxy ...
Read MoreHow to replace spaces in file names using bash script on Linux?
Consider a case in which one directory on my local machine looks something like this − immukul@192 dir1 % ls -ltr total 0 -rw-r--r-- 1 immukul staff 0 Jul 3 20:44 sample code.txt -rw-r--r-- 1 immukul staff 0 Jul 3 20:44 sample code with love.txt In the above directory named dir1, there are two .txt files present and both these files have spaces in between the words in their name, and we need to replace these spaces using a bash script on Linux. In order to achieve what we want, we must first be aware ...
Read MoreConvert Hex to ASCII Characters in the Linux Shell
Hexadecimal (Hex) is a base-16 numbering system that uses digits 0-9 and letters A-F to represent values. Converting hex to ASCII characters is a common task in Linux systems, especially when dealing with encoded data, network protocols, or binary file analysis. Hex digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F ASCII (American Standard Code for Information Interchange) is a character encoding standard that represents text in computers and communication equipment. Each ASCII character corresponds to a specific numeric value that can be expressed in hexadecimal format. ...
Read MoreCreate a file of certain size in Linux
When using Linux, we often need to create files of specific sizes for testing, development, or system administration tasks. This is particularly useful for testing disk space, creating dummy files for benchmarking, or generating placeholder files of predetermined sizes. There are several efficient methods to achieve this using built-in Linux commands. Each method has its own advantages depending on the specific use case and performance requirements. Available Methods Linux provides multiple utilities for creating files of specific sizes, each with distinct characteristics: Command Speed File Content Best Use Case ...
Read More