Aditya Chatterjee's Blog, page 119
February 1, 2022
which command in Linux
The which command locates executable files associated with a given command. In this article we discuss it and cover commonly used which commands.
Table of contents.Introduction.Syntax.Commands.Summary.References.Introduction.The which command is used for locating executable files which are associated with a given command.
Its returns 0 if the specified command's file is found and it is an executable.
1 is if the command(s) does not exist or it cannot be executed.
2 if an invalid option ...
rm command in Linux
The rm command is used to delete files and directories in Linux. In this article we have covered commonly used commands and options used with rm to achieve its goal.
Table of contents.Introduction.Deleting files.Deleting directories.Summary.References.Introduction.The rm command is used to delete files and directories in Linux. It does this by unlinking data from the file name so that the user can overwrite on the storage space it is stored in.
Syntax.The syntax is as follows,
rm [OPTI...January 31, 2022
Recovering deleted files with testdisk
testdisk is a powerful data recovery tool, its primary function is to recover lost partitions or rebuild boot sectors using data backups, these functionalities can also be used to recover lost files in Linux. In this article we discuss how to recover such files.
Table of contents.Introduction.Recovering a deleted file.Summary.References.Introduction.testdisk is a command-line data recovery tool used to recover data from deleted or lost partitions. It can also be used to;
recover corrupt...Check if line intersects circle
In this article, we have explained how to check if line intersects circle and have provided three mathematical proofs along with implementation.
Table of ContentsIntroductionAlgebraic ProofGeometric ProofVector ProofPython ImplementationOverviewIntroductionIn this article we will explore the distance from a point to a line formula, it is a useful formula that can be used within coordinate geometry to check if a line intersects with a circle, hence making it a tangent. We shall derive t...
Inventor of Linked List
Linked List is one of the most fundamental Data Structure and it was developed in 1953 by Hans Peter Luhn, Allen Newell, Cliff Shaw and Herbert Simon from IBM and RAND Corporation.
Table of contents:
Who is Inventor of Linked List?Idea of Linked List in 1953Implementation of Linked List in 1955 and beyondPatent on Linked List?ConclusionInventor of Linked ListBackground informationIdea on:1953Implemented on1955InventorsHans Peter Luhn, Allen Newell,Cliff Shaw and Herbert SimonCompany ...
January 30, 2022
Fractional Knapsack problem
In this article, we have explored fractional knapsack problem with examples. We have covered multiple approaches to solve this.
Table of Contents1) Problem Statement2) Naive Approach3) Greedy Approach4) ConclusionPre-requisites:
Solving Unbounded Knapsack Problem using Dynamic Programming0-1 Knapsack Problem (Integral Knapsack)Bin Packing problem1) Problem StatementGiven arrays of weights weights and corresponding values values of n items.These items are to be kept in...
Challenges/ Failures in Distributed Systems
This article cover potential challenges and failures that arise in distributive systems and their respective solutions.
Table of Contents:
What is a Distributed System?BenefitsDistributed Systems: Challenges, FailuresWhat is a Distributed System?A distributed system is a system that utilizes multiple networked computers which together work toward a common purpose/goal. Computers on distributed systems are able to communicate and synchronize their actions through a communication network by ...
sudo, su commands in Linux
In this article we discuss both the sudo and su commands in Linux both of which deal with assigning privileges to user so that they can execute certain commands.
Table of contents.Introduction.Syntax.The sudoers file.Password timeouts.sudo commands.su commands.Summary.References.Introductionsudo command allows a user with proper permissions to execute commands as root user with administrative privileges.
su command allows a user to execute commands with another user's privileges.
Wit...
kill command in Linux
The kill command is commonly used to terminate running processes, it takes the process ID or name as its arguments and sends a signal to the process and the process will act according the the sent signal.
Table of contents.Introduction.Syntax.Commands.Summary.References.Introduction.The kill command is commonly used to terminate processes in Linux, give a processes id PID it sends the default signal SIGTERM which terminates the process.
Keep in mind that processes can only be killed by...
numactl command in Linux
Assuming we want to control how threads are assigned to processor cores or choose where we want to allocate data, then numactl command is right for such tasks. In this article we have discussed how to perform such actions using numactl commands.
Table of contents.Introduction.Syntax.Commands.Summary.References.Introduction.Modern processors take a Non uniform Memory Access (NUMA) approach to hardware design.
Sometimes we want to control how threads are assigned to processor cores so as ...