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 update

N...

 •  0 comments  •  flag
Share on Twitter
Published on March 09, 2022 02:26

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...

 •  0 comments  •  flag
Share on Twitter
Published on March 09, 2022 02:20

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 ASCII

ASCII Stands for American Standard Code for Information Interchange, it is a character encoding standard. ASCII is used to facilitate the exchange of info...

 •  0 comments  •  flag
Share on Twitter
Published on March 08, 2022 13:48

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)Conclusion

An 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 statement

Given two strings s1 and s2. Fi...

 •  0 comments  •  flag
Share on Twitter
Published on March 08, 2022 05:58

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.

Some properties of Binary Tree:Each i-th level of binary tree, the maximum number of nodes are 2^i.If Binary tre...
 •  0 comments  •  flag
Share on Twitter
Published on March 07, 2022 07:57

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 Routing

When 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...

 •  0 comments  •  flag
Share on Twitter
Published on March 07, 2022 06:16

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 statement

Given 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 ...

 •  0 comments  •  flag
Share on Twitter
Published on March 07, 2022 05:58

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 ...

 •  0 comments  •  flag
Share on Twitter
Published on March 06, 2022 13:04

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...

 •  0 comments  •  flag
Share on Twitter
Published on March 06, 2022 11:02

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...

 •  0 comments  •  flag
Share on Twitter
Published on March 06, 2022 10:48