Tech Notes

  • Networking: GRE and IPSec Tunnels

    GRE tunnel use-cases: GRE tunnels: Main components: GRE Packet: (transport protocol+GRE header)(encapsulate(Original Payload + passenger protocol) Configuration: See below scenario: R1:interface Tunnel100tunnel mode greip address 102.1.1.1 255.255.255.0ipv6 enable                     tunnel source Loopback0           tunnel destination 2.2.2.2 R2:interface Tunnel100tunnel mode greip address 102.1.1.2 255.255.255.0ipv6 enable                     tunnel source Loopback0           tunnel destination 1.1.1.1 Please note that 1.1.1.1 and 2.2.2.2 should be reachable from each…

  • Linux: Kernel and Hardware

    The terms “kernel” and “operating system” (OS) are sometimes used interchangeably, but they refer to different components of the software that manages a computer. Here’s a detailed explanation of each: Kernel: The kernel is the core component of an operating system. It acts as the bridge between applications and the actual data processing done at…

  • Linux: Processes, Threads and signals

    What is a process? https://www.youtube.com/watch?v=4rLW7zg21gI https://www.youtube.com/watch?v=ls5cGi12kGw&list=PLtK75qxsQaMKLUENMaPlD_O2qS8ZBGjuy A process is program in execution. So what is a program ?: A program is an executable program. A program contains code or set of processor instructions which are stored as a file on disk. CPU has a program counter. Program is loaded into the memory and then program…

  • Linux: Services, Daemons and IPTables

    Service: A service is program which runs in the background. It answers to the requests etc. For instance, the “web service” might be provided by an httpd daemon like Apache or Nginx. Daemon:  a daemon is a type of program that runs in the background, and a service is the functionality that is provided to the system…

  • Linux Users and Permissions

    To check which users are logged in, we can use “w” command: To check users history who logged in: List all users: Create and delete users:

  • Linux File System

    What is the purpose of file system Think of file system as a closet. Each slot in the closet is used to store jackets, socks, t-shirts etc. this makes the closet clean and not cluttered. Same is the purpose of the file system. Disk and Partitions: Partition are different blocks in a disk. We use…

  • Linux inodes and Links

    What is inode ? Each inode provides a unique identifier for each file and directory on the filesystem. When a file is created, it is assigned an inode number, which is unique within the filesystem. This allows the system to manage files by their inode numbers rather than by their names, which can be changed…

  • Leetcode: Data Parsing

    937. Reorder Data in Log Files Solution 1: Solution 2: 1st watch how sorted function works in python: https://www.youtube.com/watch?v=D3JvDWO-BY4 2 log files were shared and asked to write program to create a report based on aggregated values of parsed input

  • RegEx

    https://www.youtube.com/watch?v=sa-TUpSx1JA Meta Characters Meta Character Meaning of the meta character when searching . (dot) any character except new line \d any digit: 0-9 \D not a digit(0-9) \w any word character: a-z, A-Z,0-9, _ \W not word character \s whitespace: space, tab, newline \S not whitespace Anchors: don’t match character but match invisible position before/after…

  • Networking IPv6

    IPv6 replaces the 32-bit IPv4 address with a 128-bit address.128-bit IPv6 addresses are represented by breaking them up into eight 16-bit segments. Each segment is written in hexadecimal between 0x0000 and 0xFFFF, separated by colons. An example of a written IPv6 address is 3ffe:1944:0100:000a:0000:00bc:2500:0d0b. IPv6 Header: IPv6 types: Link Local address: starts with FE80::/10 take…