TIL 2022

06 Apr 2022

Wed Nov 02 2022

  • Tun interface
    • for tunneling, operates at layer 3, virtual interface like tap interface
    • OpenVPN in user space - uses tun interface, kernel space (eth interface) at the other end
    • VPN combines tun interfaces on the devices connected to it

Tue Nov 01 2022

  • Tap interface

    • Linux bridge - Switch implemented in Linux kernel
      • The virtual ports on Linux bridges are called tap interfaces
    • Virtual machine - has to emulate (virtual) Ethernet interface connected to (virtual) ethernet switch (operates at layer 2)
      • virtual NIC expects an Ethernet frame (but a physical NIC will strip the Ethernet header and pass on the payload). Hence we need a tap interface to pass on the ethernet frame as it is to the virtual NIC.
  • Ethernet bridging

    • Combine multiple TAP (virtual) interfaces and physical ethernet interfaces under a single bridge interface

Mon Oct 03 2022

  • Lactase persistence - usually in mammals, lactase (enzyme for milk digestion) fades after weaning phase. In humans, a gene that persisted lactase even after weaning was selected for (can eat milk and milk products).
    • Example of niche construction - organisms modify environment to create new evolutionary pressures.
    • Non-persistent individuals can consume milk without ill-effects due to lactic acid gut bacteria. Also, fermented milk products like yoghurt and cheese contain less lactose than raw milk.

Wed Sep 28 2022

  • ping and traceroute use ICMP (Internet Control Message Protocol - RFC 792)
    • ICMP is a supporting protocol (used for diagnostics)
  • tcpdump -v ip => prints fields in ip header

Tue Sep 13 2022

  • Merchants pay a fee to the bank for processing card transactions
  • UPI is built on top of IMPS (Instant Mobile Payments System)

Sun Aug 28 2022

  • WHERE doesn’t work in aggregated query (HAVING is used)

Tue Jul 26 2022

  • GET, POST, PUT etc => HTTP verbs

Wed Jun 15 2022

  • awk named after initials of founders - Alfred Ahio, Peter Weinberger and Brian Kernighan

Thu Jun 09 2022

  • xargs - template command for multiple arguments (piped from STDIN) example - ls | xargs ls => outputs of first ls are taken as arguments to second ls successively
  • locate uses a DB to find files -> fast.
    • DB is usually updated daily by cron job that calls updatedb

Thu May 19 2022

  • git bisect - binary search on commit history to find the commit at which something changed (like a bug appearing)

Fri May 06 2022

  • https://lwn.net/SubscriberLink/893686/8978976335696804/
    • Python is slow not due to its interpreted nature (only 10% overhead), but due to its dynamic nature.
    • type lookup, dynamic variable lookup, dynamic attributes
    • method call is just attribute lookup with extra step of calling the function => repeatedly making method call inside a loop? Fetch the attribute outside the loop and then call it from there.
  • Minifying - removing unnecessary characters like spaces, indents, new lines
  • Code splitting
    • different URLs, different code required
    • code splitting is splitting the code into separate chunks required by each entrypoint to reduce the initial load time of pages

Thu May 05 2022

  • Modern versions of JavaScript - JSX, TypeScript need to be compiled to JS
  • Compiler in Next.js - Rust

Wed Apr 06 2022

Thu Mar 31 2022

  • KPI - Key Performance Indicator

Sun Mar 27 2022

  • SQL JOIN - First cross product (all members of first * all members of second), filtered by WHERE clause

Wed Mar 02 2022

  • MX record (Mail Exchange) - DNS record that directs email to mail servers

Tue Mar 01 2022

  • Code splitting - each page loads only what’s necessary for that page
  • prefetching in production build of Next - Linked page, components loaded before it is clicked.

Sat Feb 12 2022

  • ctypes library in Python - can import shared object file (.so) into Python
    from ctypes import CDLL
    libfact = CDLL("./fact.so")
    
  • compilation - gcc -shared -o fact.so fact.c

Thu Feb 10 2022

  • Macros in rust => metaprogramming. Code that can write other code
    • Processed before compilation (similar to C)
    • Can match certain pattern in Rust code and replace it.

Wed Feb 09 2022

  • [rv] = await expression => await is used to wait for a Promise to resol

Sat Feb 05 2022

Thu Feb 03 2022

  • getattr() - global method in Python to get method/attribute of an object
    • getattr(object, name, default)
      • object => object of class whose method needs to be returned
      • name => string of attribute/method name
      • default => what to return if not found

Sun Jan 30 2022

  • Context menu - menu that opens on right click
  • GNU Autotools - build system for Unix
    • ./configure, ./make
  • Glib - core application building block for libraries and applications written in C

Mon Jan 10 2022

Thu Jan 06 2022

  • Folio number in mutual funds - unique ID like bank account number

Sun Jan 02 2022

Go to link →