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 disable delete permission of File and Directory in Linux?
Sometimes you need to protect important files and directories from accidental deletion in Linux. The chattr command allows you to change file attributes to make files immutable, preventing deletion even with root privileges. Syntax chattr [operator] [flag] [filename] Where: operator: + (add), - (remove), or = (set exactly) flag: i makes the file immutable (cannot be modified or deleted) Checking Current File Attributes First, let's examine the current attributes of files in a directory using lsattr ? $ pwd ; ls -l /home/ubuntu/Documents/tutorials total 4 drwxrwxr-x 2 ubuntu ubuntu ...
Read MoreHow to Determine the File System Type in Linux (Ext2, Ext3 or Ext4)?
Linux supports various file system types like Ext2, Ext3, and Ext4, each with different features such as journaling and file size limits. Determining the file system type of your storage devices is essential for system administration and troubleshooting. Using lsblk Command The lsblk command displays all attached devices along with their file system types and partitions ? $ lsblk -f Running the above command gives us the following result − NAME FSTYPE LABEL UUID ...
Read MoreMinification of CSS files
If your app takes more than 3 seconds to load, you lose 50% of visitors. So, a slow-loading website can be frustrating for users, and they can navigate away from your site. However, there can be many causes for the slow website, but one of them is larger CSS files. In real applications, we need to write lots of CSS to style different web pages. So, we can minify the CSS files to reduce the size of CSS files. When we minify the CSS files, it removes the whitespaces, comments, etc., from the file, decreasing the size of the ...
Read MoreHow to Create Multiple User Accounts in Linux?
Adding a single new user to a Linux system can be achieved through the useradd command. However, system administrators often need to add many users at once. Linux provides the newusers command for bulk user creation from a file. Syntax sudo newusers user_details.txt Where user_details.txt is the file containing the details of all the usernames to be added. User Details File Format The user details file follows a specific format with colon-separated fields ? UserName:Password:UID:GID:comments:HomeDirectory:UserShell Creating the User Details File Let's create a file with multiple user entries ...
Read MoreLiquid Layout in CSS
As the name suggests, a liquid layout is a flexible web design approach that adapts HTML element dimensions according to screen size. Unlike fixed layouts that use hardcoded pixel values, liquid layouts use percentage-based widths to create fluid, responsive designs. Liquid layouts prevent content overflow issues and ensure compatibility across different devices and screen sizes. They are essential for modern responsive web design. Syntax selector { width: percentage%; max-width: value; /* optional */ min-width: value; /* optional */ } Example 1: Pure ...
Read MoreHow to Create a Shared Directory for All Users in Linux?
When multiple users need access to the same set of directories or files, we need to create shared folders in Linux. Linux uses users and groups with specific permission levels to enable secure data sharing. Below are the steps to create shared folders where multiple users can read and update files. Step 1: Create the Shared Directory First, create the directory that will be shared. The -p flag creates the directory and ignores errors if it already exists ? sudo mkdir -p /bigproject/sharedFolder Step 2: Create a User Group Create a user group ...
Read MoreModern CSS Cards
Modern CSS cards are essential components for displaying information in an organized, visually appealing format. They're commonly used on e-commerce sites to showcase products, on educational platforms for courses, and across various websites to present content in digestible chunks. Syntax .card { display: flex; flex-direction: column; border-radius: value; box-shadow: value; width: value; background-color: value; } Example 1: Basic CSS Card This example creates a simple card with an image, title, ...
Read MoreHow to Count Word Occurrences in a Text File using Shell Script?
Linux shell scripting provides powerful tools to process text files and analyze their content. One common task is counting word occurrences in a file using pattern matching and counting commands. This article demonstrates several approaches to count specific words in text files. Sample Input File Let's create a sample file to demonstrate our examples ? cat inspire.txt Mastering anything needs practice. It also needs patience. And it needs time and other resources. Using grep and wc The grep command finds patterns in text, and when combined with wc, we can ...
Read MoreHow to Count Number of Files and Subdirectories inside a Given Linux Directory?
When working with Linux systems, it's essential to know how to count files and subdirectories within a given directory. Python provides several ways to accomplish this task, from using the os module to leveraging the pathlib library for more modern approaches. Using os.walk() for Recursive Counting The os.walk() function recursively traverses directories and provides separate counts for files and subdirectories ? import os def count_files_and_dirs(directory): file_count = 0 dir_count = 0 for root, dirs, files in os.walk(directory): ...
Read MoreNeon Text Display Using HTML & CSS
Creating neon text effects on web pages is a popular trend that adds visual appeal and draws user attention to important content. Neon text effects can be used for logos, headings, advertisements, and other elements to make them stand out. In this tutorial, we will use the text-shadow CSS property to create various neon text effects. Syntax text-shadow: horizontal-offset vertical-offset blur-radius color; The text-shadow property creates the glow effect by accepting horizontal offset, vertical offset, blur radius, and color values. For neon effects, we typically set both offsets to 0 and use multiple shadow values ...
Read More