≡ Menu

Introduction to Linux Threads – Part I

A thread of execution is often regarded as the smallest unit of processing that a scheduler works on.

A process can have multiple threads of execution which are executed asynchronously.

This asynchronous execution brings in the capability of each thread handling a particular work or service independently. Hence multiple threads running in a process handle their services which overall constitutes the complete capability of the process.
[continue reading…]

How to Setup VirtualBox Guest Additions and Network

In the previous article Install & Create Virtual Machine, we explained how to install VirtualBox and create a Guest machine in it.

This article explains how to setup network for a guest machine and installing Guest Additions in a guest machine.
[continue reading…]

How to Setup Chroot SFTP in Linux (Allow Only SFTP, not SSH)

If you want to setup an account on your system that will be used only to transfer files (and not to ssh to the system), you should setup SFTP Chroot Jail as explained in this article.

In a typical sftp scenario (when chroot sftp is not setup), if you use sftp, you can see root’s file as shown below.

If you want to give sftp access on your system to outside vendors to transfer files, you should not use standard sftp. Instead, you should setup Chroot SFTP Jail as explained below.
[continue reading…]

IP Protocol Header Fundamentals Explained with Diagrams

IP protocol is one of the main protocols in the TCP/IP stack.

It is in the form of IP datagrams that all the TCP, UDP, ICMP and IGMP data travels over the network.

IP is connection less and unreliable protocol. It is connection less in the sense that no state related to IP datagrams is maintained either on source or destination side and it is unreliable in the sense that it not guaranteed that an IP data gram will get delivered to the destination or not.

If an IP datagram encounters some error at the destination or at some intermediate host (while traveling from source to destination) then the IP datagram is generally discarded and an ICMP error message is sent back to the source.
[continue reading…]

In this article, we will start from a small explanation of process IDs and then we will quickly jump on to the practical aspects where-in we will discuss some process related C functions like fork(), execv() and wait() .
[continue reading…]

SWIG Perl Examples – How to Interface Perl to C Using SWIG

SWIG stands for Simplified Wrapper and Interface Generator.

SWIG is used to simplify the task of interfacing different languages to C and C++ programs.

For our discussion, in this article we will explain how to use SWIG to interface from Perl to C programs.
[continue reading…]

In the 1st part of the Linux processes series of articles, we build up the understanding on Linux processes by discussing about the main() function, and environment related C functions.

In this article, we will discuss about the memory layout of a process and the process terminating C functions.
[continue reading…]

How to Write Linux Init Scripts Based on LSB Init Standard

LSB stands for Linux Standard Base.

LSB was started by Linux Foundation to reduce the difference between several Linux distributions, and thereby reducing the cost involved in porting between different distributions. Init scripts are one among them to be standardized.

In this article, we will see how to write an Init script that conforms to LSBInit Standard.
[continue reading…]