Landing Page
Google Authenticator
Google Authenticator is a mobile app that provides two-factor authentication (2FA) for your accounts. It enhances your account security by requiring a second form of verification in addition to your password. Here’s how to install and use Google Authenticator: Installation Download the App: For Android: Go to the Google Play Store, search for “Google Authenticator,” […]
The Importance of Apache Access Log
What is the Apache access log : The Apache access log is a file that records detailed information about each request made to an Apache HTTP Server. This log file is useful for monitoring server performance, troubleshooting errors, and identifying potential security issues. The format of the log file is configurable and can include information […]
The main difference Codeigniter3 Vs Codeigniter4
CodeIgniter 3 and CodeIgniter 4 are both PHP web application frameworks, but there are some key differences between the two versions: Architecture: CodeIgniter 4 has a new modern architecture, which is more modular and flexible than CodeIgniter 3. It uses namespaces and autoloading, making it easier to organize and manage code. Dependencies: CodeIgniter 4 requires PHP 7.2 […]
The Next Big Thing in .ini File Purpose
.ini is the file extension for initialization files. These files are used to store configuration settings for various programs, including operating systems, applications, and web servers. The format of a .ini file is simple and easy to read, with sections and properties separated by equal signs (=). A .ini file typically consists of sections, which are […]
Commonly used GIT commands for developers
When I started software development, my biggest concern was the source control system. There needs to be more detailed documentation, and senior developers in your team expect you to know this by default. They take it for granted. I started with VSS, SVN, ClearCase, PVCS, and git. It has been git for a while now […]
When to use Backtracking Approach in Algorithms?
What is Backtracking? For any given problem — be it a decision-making problem like whether to stop the vehicle at any instance — in autonomous driving, an optimization problem like choosing the best path from my home to the office, or an enumeration problem like generating all possible permutations and combinations of teams play-outs in […]
How State Works in React with Code Examples
In this Blog, we are going to learn about React State with some examples. React State is a built-in object in React components. React State allows us to manage the changing of data in an application. React State is defined as key-value pairs objects for specifying the various data we want to track in the […]
Data Streams with AWS Kinesis
When talking about messaging and asynchronous data processing, it is very common you hear about the jargon “data stream”. Let us start with the basic question. What is a data stream? The data stream is nothing but data that is continuously generated by thousands of data sources, which typically send data records simultaneously for processing. […]
Micro-services asynchronous communication — AWS SNS
What is SNS? Amazon SNS is the abbreviation of the popular AWS service ‘simple notification service’. It is a managed publish/subscribe (also known as “pub/sub”) service from Amazon Web Services. Essentially with SNS, one can publish messages to ‘SNS topic’, which will be received by multiple subscribers at the same time. Publisher/Subscribe in simple terms […]
Micro-services asynchronous communication— AWS SQS
Asynchronous messaging We have point-to-point (1 to 1 message) and publisher-subscriber (1 to many messages) patterns typically used in messaging systems for async communication. Point-to-Point: the message is sent from one application(producer) to another application(consumer). Even if there are more consumers listening, one of them will get the message. Also, message delivery is guaranteed by […]
Most Useful GitHub Commands for Programmers
In this Blog, we going to learn about GitHub commands and their purpose. Every programmer should have a piece of good knowledge of GitHub commands. Here I listed some of the most important commands for programmers for their day-to-day use. git init Initialize the project folder as a git repository. git clone <HTTP link or […]
React JS Tutorial for Beginners — Introduction
What React JS? Simply from the Official website, React JS is “a javascript library for building user interfaces”. React JS is developed by Facebook and a community of individual developers and companies. React JS is widely used as a base in building single-page web applications. React JS allows users to create reusable UI components. Features of React JS Virtual Document […]
What is Fanout & its uses in Cloud Applications?
What is this ‘fanout’? Fanout is a common design pattern used in cloud applications, to take advantage of parallel processing. Parallel processing — example Let us see how OTT providers like Youtube, Netflix, and Amazon Prime use this pattern to save time in solving their important time-consuming tasks of video transcoding, optimized for different devices […]
How does Serverless Architecture work?
TL;DR: Serverless removes the architecture responsibilities like hardware provisioning, scaling, and maintenance in cloud-based application development. Serverless Architecture Serverless (also called Serverless computing) is a way of software development, where the software application is built and run without having to manage servers (hardware). This is more attractive for application developers as it provides a complete abstraction […]
How Virtualization Technology works?
What is Virtualization? Virtualization is the means by which we create a virtual counterpart of an actual item, by software or hardware & software. The virtualized item could be another hardware, operating system (OS), storage device or network. As defined above we have,Hardware virtualization for virtualizing any hardware device. Mostly this refers to PC.Desktop virtualizing isfor desktop, […]
How video DRM works?
Industry standard DRMs (like Widevine, Playready, Fairplay) protects content in all possible ways. Transferred over the internet (content is always encrypted, licensing key exchange is through HTTPS key exchange mechanism) Played back on devices (hardware level protection) In this blog we will see how the content is encrypted and encryption key are transferred and used […]
Cross Compilation with example
What is Cross Compilation? Typically any desktop or server application have almost the same development platform (CPU + OS — that runs your build) and the target platform (CPU + OS — that runs your production application) are the same. Platform is nothing but the combination of CPU architecture, and Operating System. The process of building […]
Digital Data — Audio
Data Formats: Everything is 0s and 1s for a digital computer and thats how data is stored, retrieved and manipulated. There are more than 1000 types of data we store and use in computers starting from a simple text, video, audio, graphics, games, etc… If computers can only recognise 0 and 1, how different things […]
Statically Linked Executable (elf executable)
What is static linking? How to statically link an executable? Most of the time you have to take your executable built in 1 machine and run other machine. Sometimes for specific applications like embedded and real time machines, the destination m/c are really small and might not have all the standard libraries (like gcc libraries) […]
Device driver — Compile, Load/Unload, Test
Compiling driver: As discussed earlier a Linux loadable kernel module (LKM) is different from other binary executables. Hence, it cannot be compiled the way we compile normal C files. Compiling a Linux module is a separate process. We use the help of kernel Makefile for compilation. The makefile we will have contents as given below. When you […]
Device driver — File Operations structure
In the previous posts we discussed about what are device drivers and how to create one, load them into linux kernel and test them. In this post we will discuss about what to be implemented in a device driver. Core function for device drivers: An important structure in any device driver is the file_operations. It holds the pointers […]
How File system works in Internals
Filesystem(FS) is a part of OS, whose purpose is to store and retrieve information (data) from any storage medium. Without a FS, information on storage medium is meaningless or just a single piece of huge data and we cannot navigate through directories/files. Device driver or File system Let’s discuss this in detail. Any storage device […]
File System — Important Data Structure
As discussed in earlier post we know that File System is an organized way to access huge information/data stored in permanent storage devices. To retrieve meaning of the raw data from the storage device, we need a FS.In this we post we will discuss some of the important data structures used in UNIX based file system. i-node […]
How to Compile & Boot a Linux Kernel
Compile & Boot Linux from source code It becomes absolutely necessary for a Kernel Hacker (Linux) to compile various kernel sources and boot them for either taking traces or testing a modification for a kernel module. Although there are lot of blogs talk about this compile and booting, I found the following resource useful (http://www.wikihow.com/Compile-the-Linux-Kernel). […]
Big Endian and Little Endian — read + write word
I thought sharing some code for accessing word from in little & big endian ways will be helpful for someone. get_word() implementation: int get_word(int address) { int i = address — from; //From is the start address of memory in the Linear Address Space if (CONSTANTS.BIG_ENDIAN) { return (((int) memory[i] << 24) | (((int) memory[i […]
Virtual Memory — Deep dive in Memory Management
What is Virtual memory? Virtual memory is the ‘memory management’ component of operating system, which creates the illusion to users of a very large (main) memory. Typically when RAM runs low, ‘memory manager’ move some data from RAM to a special location in disk and frees RAM. The freed memory can be used to serve […]
Databases — Running multi-line scripts from command line
In a typical application using Database, it is natural all the changes for fixing bugs or new features are sent as SQL scripts. In most of the cases we have single line scripts (DDL / DML statements). But there are some scenarios we need to run multi-line scripts like creating and running some procedures / […]
Are Computers same for 40 years — Von Newman Architecture
Have you ever wondered how exactly the computer does all the tasks from browsing, playing games, videos, editing documents, etc… By Computers I mean everything from mobile phones, and laptops to Dedicated server class machines and even the world’s fastest supercomputers. All most all of them work on the same basic design done by Von […]
How Timer Interrupt works in System?
Most of the system programmer used the Timer Interrupt for various reasons especially in synchronization. Some of the including me didn’t spent much time on how exactly it works. This post is my attempt to explain my understanding on how it works? Most of the IBM compatible PCs come with a hardware unit called Programmable […]
Starting a Process from ELF executable file
We all know that the standard file for representing executable, shared library and object file is ELF in UNIX based systems. In this post we will not talk about ELF file formats or any details of how to load it in to memory, but about the steps kernel does after loading ELF into memory and [...]
Basic Machine Architecture — MIPS R2000 ISA
MIPS R2000 is a RISC processor. Its ISA has fixed-width 32 bit instructions and fall into one of the following three categories: R-type, I-type, and J-type All the Instructions — can also be grouped under following functional groups. Arithmetic Instructions: +, -, *, / operations on std data-structures (short, int, long, float) Logical Instructions: AND, OR, […]
Character set encoding and rendering — ASCII/Unicode and code page
Character encoding: Source: https://www.digital-detective.net/character-encoding-quick-primer/ Character encoding — Why ? If you use anything other than the most basic English text, people may not be able to read the content you create unless you say what character encoding you used. For example, you may intend the text to look like this: but it may actually display like this: What [...]
Insertion sort on a sorted array — O(n)
How insertion sort works? Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It works best on a nearly sorted list. It has the following characteristics Stable; i.e., does not change the relative order of elements with equal keys In-place; i.e., only requires a […]
Ransomware — what should you do?
What is Ransomware? Ransomware is a type of malware. The attacker encrypts the victim’s data and threatens to publish it if the demanded ransom is not paid. The victim will not be able to access their data as the attacker encrypts the data. Users are shown instructions for how to pay a fee to get […]
Implementing the Design Patterns in OS Kernel
Most of us know about design patterns. But let me give the crux of — what a design pattern is? before getting into the topic. Design Patterns are the set of solution to typical and most commonly occurring problems in designing software program. They are mostly related to object orient design but not restricted to OOD. […]
Interview Question: Count 1’s in a sorted binary array
Problem statement: A binary array sorted in decreasing order is given. We need to count the number of 1’s in it. Examples: Input: arr[] = {1, 1, 0, 0, 0, 0, 0} Output: 2 Input: arr[] = {1, 1, 1, 1, 1, 1, 1} Output: 7 Input: arr[] = {0, 0, 0, 0, 0, 0, […]
Throttling in Web application: with code — Django app
What is Throttling? Throttling is a mechanism created in server-side to control the rate of requests that clients can make to an API or web servers. Typically it is done as a defensive mechanism to improve security and performance. Sometimes throttling is also referred to as rate-limiting, in general throttling is a bit broader than […]
TDD with Django
What TDD (test-driven development)? Test Driven Development (TDD) is software development process, where requirements are converted to test cases first and implemented later. In simple terms, automated test cases for each functionality are created and tested first. The added test cases obviously fails, then we implement the functionality to pass the test case. Why TDD? Developer […]
Cache in Django web application
Why to use cache in a web application? We know that the dynamic data received on web application is an extension to the static websites, which used to serve only static file over HTTP protocol. When we send dynamic web page each time a user requests, the server does lot of computation in generation of […]
Loadable Kernel Modules and Device Drivers
OS development over time We all know that kernel is the core part of any OS. It is the set of code running in privileged mode (kernel mode or Ring3 security level). Operating Systems can be classified based on the architecture of their kernel as below: Monolithic kernel OS This is the old style of […]
Wait-free locks: RCU for synchronization
What is RCU? Read-Copy-Update(RCU) is way of implementing wait-free synchronization between multiple processes/threads (alternative to lock mechanism). It works well in multiple reader and writer scenarios (especially ready heavy scenario). The key idea in RCU is doing a write/update operation in 2 steps namely ‘removal’ and ‘reclaim’.In step 1 (removal step), we have to remove references to […]
Runtime analysis – Sorting n strings using Merge sort
Given problem: A list of n strings each of length n is sorted into lexicographic order using the merge sort algorithm. Solution: Comparing two strings require O(n) comparisons, hence each merge will take O(n2) time. So, the recurrence equation will be: T(n) = 2 T(n/2) + O(n2) The n in the equation represents no.of elements […]
Heap Sort’s recurrence relation and Runtime analysis
Let us start with the heapsort algorithm: The build_maxheap() funnction has a standard implementation of O(n). The important part of the sorting is the for loop, which executes for n times. Inside that we have a swap method call and heapify method call. The heapify method is a standard walk through of complete binary tree. […]
Implementing stack with two queues
Problem statment Given two queues with their standard operations (enqueue, dequeue, isempty, size), implement a stack with its standard operations (pop, push, isempty, size). Solution There can be two ways you can solve the above problem. Option A: The stack – efficient when pushing an item Option B: The stack – efficient when popping an item In this post lets us discuss the an implementation […]
Insertion sort on a sorted array – O(n)
Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It works best on a nearly sorted list. It has the following characteristics Stable; i.e., does not change the relative order of elements with equal keys In-place; i.e., only requires a constant amount O(1) of […]
Impact of Multi-Column Indexes in Database Systems
What is multiple-column index? MySQL or many RDBMS supports multiple-column indexes. i.e. The index key will be more than 1 column in the table. For example, consider a table consolidated CREATE TABLE `consolidated` ( `consolidated_id` int(11) NOT NULL AUTO_INCREMENT, `pub_id` int(11) DEFAULT NULL, `cp_id` int(11) DEFAULT NULL, `ro_id` int(11) DEFAULT NULL, `country_id` int(11) DEFAULT NULL, […]
Coin Exchange Problem — Greedy or Dynamic Programming?
Coin Exchange Problem: Coin exchange problem is nothing but finding the minimum number of coins (of certain denominations) that add up to a given amount of money. It is a knapsack type problem. The interesting fact is that it has 2 variations: 1. Greedy Algorithm: For some type of coin system (canonical coin systems — […]
Want to know about RAM – SRAM and DRAM (or SDRAM)
Everyone of us are familiar with RAM (Random Access Memory), this post is an attempt to explore the different types of RAM and how they store the data. We typically have 2 types of RAM SRAM (Static RAM) DRAM (Dynamic RAM) SDRAM (Synchronous DRAM) — is simply DRAM, which is synchronized with System Bus (newer […]
OOPS in Kernel/Device Drivers development
OOPS — Abstraction One of the core concept in object oriented paradigm is ‘Abstraction’. As most of us know Abstraction is nothing but hiding complete technical details (how its implemented or working) from the user (client code using the system/object/module) and exposing only necessary details for interacting with system/object/module. Static Function & Variables I guess […]
Adding a new system call to Linux Kernel
Let us try to create a toy system call to do add operation, which takes 2 arguments and return their added value. Following are the steps in adding a new system call to Linux Kernel: Step 1: Unzip and untar the latest Linux kernel source (https://www.kernel.org currently 3.14 is the stable version) into /usr/src/ directory. Step […]
System call in Linux — (x86 Arch implementation)
System calls are used by user programs in order get service from the operating system. Some of the popular system calls are we normally use are open, read, write, close, wait, exec, fork, exit, and kill. There are usually 100’s of system call available in OS. For example, Linux has 300+ system calls. Why we […]
Dive deep on device drivers
Device drivers and OS In the beginning almost all OS were implemented as a single huge kernel with all device drivers included as part of the kernel. If we think further this design make sense, as almost all device drivers require the hardware/resource access and these accesses are provided by being part of the kernel […]
Device driver in layman’s terms
What is a device driver? Device driver is simply a program which executes in kernel mode (unrestricted mode) interacting directly with hardware of the corresponding device. In the previous post we discussed about the different modes (restricted and unrestricted) of operation. They mainly do all the talking/interaction with raw hardware as part OS. Why we need them? […]
Kernel mode & User mode
As we all know that CPU (micro-processor) executes all the instructions. Most of the modern architectures support at least 2 modes of CPU operation. Even if architecture supports more than 2 modes, they are usually grouped under 2 modes to have compatibility (of OS — across all machines). Mode 1 — Every operation possible is allowed […]
Data Structures for Programmers
What is a Data Structure? We will not be talking about data structures implementation in this post, but about their usage or choice during programming. As usual lets start from the basic definition. Data Structure is a particular way of storing and organizing data in a computer so that it can be used efficiently. They […]
Performance Testing — Web Apps
What is performance testing? Type: Non-Functional testing What is tested?: System’s behaviour under extreme conditions Objective: 3 S’s — Speed, Scalability, Stability Image src: https://www.multidots.com/services/performance-testing/ How it is done? It is typically done with some variations on the load (no.of concurrent users hitting system under test). Each of them have a defined objective. Load Testing: Check for bottlenecks […]
Sorting Algorithms — Choices
We all know about the standard comparison based sorting algorithms and their time/space complexity. Algorithms like bubble sort, insertion sort, selection sort, quick sort, merge sort, Heap sort operate with a asymptotic lower bound of O(n log n). Also, other unconventional sorting algorithms like Bucket Sort, Counting Sort, Radix Sort run in O(n) We will not talk […]
Heard about the Google worldwide outage?
Have you all heard about the Global Google outage on December 14, 2020, affecting most of the essential services, including Gmail, YouTube, Google Drive, Google Docs, Google Calendar, and Google Play. If not, this blog will benefit you. First, to understand — if you think if this is the first time we had a global […]
Concerns and Clarifications on WhatsApp privacy policy, which lost them millions of customers
What is that update causing this buzz? With WhatsApp’s new update in the first week of Jan 2021, its users across the globe started receiving an in-app notice on its update to terms and privacy policy. The notification read, “By tapping Agree, you accept the new terms and privacy policy, which take effect on 8 […]