Aditya Chatterjee's Blog, page 107
March 9, 2022
firewalld in RHEL
firewalld is a Linux utility used to manage firewall rules. In this article, we discuss firewall management using firewalld.
Table of contents.Introduction.Installation.Zones.Ports.Services.Creating zones.Summary.References.Introduction.A firewall is a set of rules that define whether traffic is allowed through a system.
iptables and firewalld are tools used to manage firewall rules in Linux.
Installation.To install firewalld on RHEL, we first update the system:
$ sudo dnf updateN...
iptables in Linux
We use iptables to create firewall rules. In this article, we learn about iptables and how to manage firewall rules in Linux.
Table of contents.Introduction.Installing iptables.Syntax.CommandsAn example.Summary.References.Introduction.iptables are programs used by systems administrators to define firewall rules in Linux.
A rule is a condition we specify to match a packet.
We can use them to block or allow traffic through a firewall.
This information is stored in tables, these tables h...
March 8, 2022
Finding ASCII value of a character
In this article, we have explained the approach to find the ASCII value of a character in various Programming Languages along with the introduction to ASCII.
Table of contents:
Introduction to ASCIIWhy is ASCII Important?Displaying Characters and their ASCII ValuesASCII characters and their range of valuesConclusionIntroduction to ASCIIASCII Stands for American Standard Code for Information Interchange, it is a character encoding standard. ASCII is used to facilitate the exchange of info...
Find all anagrams of a given string
In this article, we have explained efficient algorithms to Find all anagrams of a given string. This involve techniques like sliding window approach.
Table of Contents1)Problem statement2)Naive approach3)Sliding Window approach4)ConclusionAn anagram of a word is that which is formed by rearranging the letters of the word in some order.
For example,
Some of the anagrams of the word "abcd" are "abdc","bdac","cabd","acdb"....
1)Problem statementGiven two strings s1 and s2. Fi...
March 7, 2022
Bottom view of a Binary Tree
In this article, we have explained the algorithm to find the Bottom view of a Binary Tree.
Table of contentsWhat is Binary Tree?What is Bottom view of a binary tree?AlgorithmCodeComplexityWhat is Binary Tree?Here, Binary itself mean two.
Binary Tree means that a node can have at most two childern, in simple terms a node can have either zero(0) or one(1) or two(2) children.
Distance Vector in Computer Network
In this article, we have covered the idea of Distance Vector in Computer Network in depth along with Routing and Distance Vector Routing protocol.
Table of contents:
Introduction to RoutingIdea of Distance VectorDistance Vector AlgorithmsBellman-Ford algorithmImplementationExampleHow it all worksIntroduction to RoutingWhen we use the internet, the information across networks travels across the planet in small distributed pieces called packets. With the help of these packets, we receive...
Maximum consecutive ones when at most k zeros can be flipped
In this article, we have explored algorithms to Find the longest sequence of consecutive ones when atmost k zeros can be altered to 1. This involve techniques like Sliding Window approach.
Table of Contents1) Problem statement2) Naive approach3) Sliding Window approach4) Conclusion1)Problem statementGiven a binary array. Find the longest sequence of consecutive ones when atmost k zeros can be altered to 1.
For example,
Let the binary array be nums=[1,0,1,1,0,0,1,0].
Let k ...
March 6, 2022
Scalar Variable Types in Python
In this article, we will be discussing what scalar variable types are and how to use them correctly in Python. These are some basic and very important datatypes.
What you will learn from this article:What is a scalar variableThe main scalar variablesHow to use the scalar variablesWhat is a Scalar Variable?A scalar variable is a variable that contains a singular piece of data/information at a time. These variables are mostly immutable meaning you can not change the object once it has been ...
Variable in C++
In this article, we will learn everything about the variables in C++ including rules of variable naming, types of variables and much more.
TABLE OF CONTENTS:
1.What are Variables?
2.Declaration of Variables
--- * With Initialisation
--- * Without initialisation
---* Declaring Multiple Variables
-----* Without Initialisation
-----* With Initialisation
3.Rules for Variable Name
4.Difference between variables and constants
5.Types of Variable(Based on Scope of Variables in c++)
---- * Static vs I...
Different ways to merge dictionaries in Python
In this article, we have explored Different ways to merge dictionaries in Python.
Table of contents:
IntroductionA summary of 6 common methods (Sorted by Python versions)3. Union Operators "|" (Python 3.9+ Only)
4. Unpacking Method: "**" (Python 3.5+)
5. update() Method (All Python Versions)
6. Transferring items to new dictionaries (All Python versions)Applying these methods to complex scenariosIntroduction
In Python, dictionaries can store data with multiple pairs of keys and values. The...