This article will help you to create IPtables rules that you can directly use for your daily or routine needs, These examples will act as basic templates for you to work on iptables with these rules which suit your specific requirement.Deleting the IPtables or Existing RulesBefore you start building new IPtables set of rules, you should clean up all the default rules, and existing rules. Use the IPtables flush command, below are some examples –#iptables --flush (or) # iptables --FDefault Policies ChainThe default policy is ACCEPT, change the policy to DROP for all the INPUT, FORWARD, OUTPUT.# iptables -P INPUT ... Read More
A system call is the fundamental interface between an application and the Linux kernel. When a Unix/Linux program does a file I/O, network data transfer or invokes some process which directly or indirectly interact with the low level instructions, then system call is involved. Making these calls usually involves using a library called glibc which contains the functions.ExamplesBelow is a list of some frequently used system calls and their purpose.Sr.NoSystem CallPurpose1chmodchange permissions of a file2chdirchange working directory3forkcreate a child process4unlinkdelete a name and possibly the file it refers toA systems programmer writes program that will not directly make the systems ... Read More
The wc command also known as word count command is a fundamental command any Linux user should be aware of. It is mostly used with the l switch to do a line count, but it can actually give count of multiple things with various arguments supplied to it. Below is a list of what are those possible arguments. The we will see examples on each of them.Sr.NoCommandUsage1wc -cDisplay number of bytes2wc -mDisplay number of characters3wc -wDisplay number of words4wc -lDisplay number of lines5wc -LDisplay length of longest lineLets consider the below file for our examples.ubuntu@ubuntu:~$ cat inspire.txt Mastering anything needs ... Read More
Terminating a thread before it has completed is called Thread cancellation. For an example, if multiple threads are concurrently searching through a database and one thread returns the result, the remaining threads might be canceled. Another situation might be occurred when a user presses a button on a web browser that stops a web page from loading any further. Often, using several threads a web page loads — each image is loaded in a separate thread. When the stop button is pressed by a user on the browser, all threads loading the page are canceled. A thread which is to ... Read More
Signals are software interrupts which sent to a program to indicate that an important event has occurred. A Signal may be handled by following one of two possible handlers:A default signal handlerA user-defined signal handlerUser-defined signal handler can override this default action that is called to handle the signal. Signals are handled in different ways. Some signals (such as changing the size of a window) are simply ignored; others (such as an illegal memory access) are handled by terminating the program.A signal handler function may have any name, but must have return type void and have one int parameter.Example − ... Read More
A program loaded into memory and executing is called a process. In simple, a process is a program in execution.Let’s inspect how to create a process in LinuxA new process can be created by the fork() system call. The new process consists of a copy of the address space of the original process. fork() creates new process from existing process. Existing process is called the parent process and the process is created newly is called child process. The function is called from parent process. Both the parent and the child processes continue execution at the instruction after the fork(), the ... Read More
The border-bottom-style property changes the style of bottom border. You can try to run the following code to implement the border-bottom-style property:Example This is demo content
Amdahl’s LawSuppose, Moni have to attend an invitation. Moni’s another two friend Diya and Hena are also invited. There are conditions that all three friends have to go there separately and all of them have to be present at door to get into the hall. Now Moni is coming by car, Diya by bus and Hena is coming by foot. Now, how fast Moni and Diya can reach there it doesn’t matter, they have to wait for Hena. So to speed up the overall process, we need to concentrate on the performance of Hena other than Moni or Diya.This is ... Read More
The border property allows you to specify color, style, and width of lines in one property.ExampleYou can try to run the following code to specify border property: This example is showing shorthand property for border.
The width property is used to set the width of an image. This property can have a value in length or in %. While giving value in %, it applies it in respect of the box in which an image is available.ExampleYou can try to run the following code to set the width of an image:
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP