MD5SUM Command in Linux with Examples

Arnab Chakraborty
Updated on 21-Oct-2019 13:16:14

554 Views

Here we will see the md5sum command in Linux system. The MD5 is one of the Message Digest algorithm, that generates hash values to create checksum for the messages. It helps to identify if the integrity is maintained or not. Here we will see some example of md5sum command in Linux system.If we use this command on a string, it will generate a hash value, if we create some minor change in the text, it will generate massive change in the checksum.Examplesh-4.4$ echo 'Hello World' Hello World sh-4.4$ echo 'Hello World' | md5sum e59ff97941044f85df5297e1c302d260 - sh-4.4$If we change the content ... Read More

MCQ on Memory Allocation and Compilation Process in C

Arnab Chakraborty
Updated on 21-Oct-2019 12:52:48

521 Views

Here we will see some MCQ questions on Memory Allocation and Compilation Processes.Question 1 − What will be the output of the following code − Live Demo#include #include int main() {    union my_union {       int i;       float f;       char c;    };    union my_union* u;    u = (union my_union*)malloc(sizeof(union my_union));    u->f = 20.60f;    printf("%f", u->f); }Options −Garbage Value20.600000Syntax Error20.6ExplanationUsing unions, we can use same memory location to hold multiple type of data. All member of union uses same memory location which has maximum space. Here ... Read More

Maximum Possible Edge Disjoint Spanning Tree from a Complete Graph in C++

Arnab Chakraborty
Updated on 21-Oct-2019 12:25:24

232 Views

Suppose we have a complete graph; we have to count number of Edge Disjoint Spanning trees. The Edge Disjoint Spanning trees are spanning trees, where no two trees in the set have an edge in common. Suppose the N (number of vertices) is 4, then output will be 2. The complete graph using 4 vertices is like below −Two edge disjoint spanning trees are like −The maximum number of edge disjoint spanning tree from a complete graph, with N vertices will be $[\frac{n}{2}]$Example#include #include using namespace std; int maxEdgeDisjointSpanningTree(int n){    return floor(n/2); } int main() {    int n = 4;    cout

Sort Array According to Another Array using Pair in C++

Arnab Chakraborty
Updated on 21-Oct-2019 12:20:28

898 Views

Suppose we have two different arrays. We have to sort one array based on the other array using C++ STL pair class. Consider two arrays are like A1 = [2, 1, 5, 4, 9, 3, 6, 7, 10, 8], and another array is like A2 = [A, B, C, D, E, F, G, H, I, J], The output will be like: A1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], A2 = [B, A, F, D, C, G, H, J, E, I]Here we are using the pairs of C++ STL. The pair is formed by taking one ... Read More

Increase Number of Maximum Open Files in Linux

Samual Sam
Updated on 21-Oct-2019 12:18:56

1K+ Views

If you are working on Linux, then you must have encountered many-a-time with “Too many open files (24)” error. Linux operating system provides a way of limiting the amount of files that can be used by every user. This article provides insights on how to increase the number of open files or file descriptors in Linux operating system.The ulimit command has the control over shell or processes and it should require a login as the root user. The ulimit command is used to set the file limits that apply only to your current session.Use the following command to display the ... Read More

Sort Array of Strings by Another String in C++

Arnab Chakraborty
Updated on 21-Oct-2019 12:18:01

374 Views

Suppose we have an array of strings, and another string is there for the reference. We have to take the reference string and using the order of the characters in the reference string we will sort the string array. Here we are considering the strings in the array, and the reference string is in lower case letters.Suppose the string array is like: [“hello”, “programming”, “science”, “computer”, “india”], the reference string is like: “pigvxbskyhqzelutoacfjrndmw”, After sorting the output string will be like [“programming”, “india”, “science”, “hello”, “computer”]The task is simple. We have to traverse the reference string, then store the character ... Read More

Sort Elements of Array Between Multiples of K in C++

Arnab Chakraborty
Updated on 21-Oct-2019 12:15:15

152 Views

Suppose we have an array A, and another integer K. We have to sort the elements that are in between any two multiples of K. Suppose A is like [2, 13, 3, 1, 21, 7, 8, 13, 12], and K = 2. The output will be [2, 1, 3, 7, 13, 21, 8, 13, 12]. Here multiple of 2 are 2, 8 and 12, the elements in between 2 and 8 are 13, 3, 1, 21, 7, they will be sorted as 1, 3, 7, 13, 21, the elements between 8 and 12 is only 13, so that is already ... Read More

Best Presentation Tools for Business

Samual Sam
Updated on 21-Oct-2019 12:14:48

243 Views

It is not uncommon to see many people trying their hands at tools such as PowerPoint and Prezi to deliver everlasting presentations. More often than not, they end up whacking their brains to make their presentations all the more impressive.Call it an all-consuming obsession of a connoisseur, PowerPoint and Prezi no longer holds candle to the several viable alternatives available in the market. There are several new kids on the block. One should definitely give a shot to each of the below mentioned alternatives. Here is a comprehensive and a curated list on the best Prezi alternative tools −EmazeLet me ... Read More

Prevent Fork Bomb by Limiting User Processes in Linux

Samual Sam
Updated on 21-Oct-2019 12:11:38

370 Views

A Fork Bomb is a denial-of-service (DoS) attack against a Linux based system. It makes use of the fork operation to create infinite processes and is called as “Rabbit Virus or wabbit”. The system process continually replicates itself to deplete available system resources, causing resource starvation, slowing or crashing the system. This article gives insights on – how to prevent a fork bomb attack in Linux system.Fork Bomb uses a bash code and gets executed repeatedly. Linux system admin often uses bash function to test the user process limitations and this specific process can be configured in /etc/security/limits.conf file. Once Fork ... Read More

Monitor Linux Server Performance Remotely Using Web Browser

Samual Sam
Updated on 21-Oct-2019 12:07:49

368 Views

Are you looking for speedy server statistics monitoring script? If yes, then this article is for you. Here, we will be explaining about Linux-dash which is a memory efficient, low resource, easy to install, server statistics monitoring script written in PHP.An internet static web page allows you to rearrange various widgets as you want. This script displays residing records of your server, including RAM, CPU, Disk space, community understanding, mounted programs, going for walks approaches and rather more.Linux Dash FeaturesLinux Dash Features should be like this –It is a lightweight and responsive web-based interface for monitoring server resourcesEasy to install ... Read More

Advertisements