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
- The virtual ports on Linux bridges are called
- 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.
- Linux bridge - Switch implemented in Linux kernel
-
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
andtraceroute
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 => HTTPverbs
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 firstls
are taken as arguments to secondls
successivelylocate
uses a DB to find files -> fast.- DB is usually updated daily by cron job that calls
updatedb
- DB is usually updated daily by cron job that calls
Thu May 19 2022
git bisect
- binary search on commit history to find the commit at which something changed (like a bug appearing)- https://git-scm.com/docs/git-bisect
- change to commit in middle -> test code ->
git bisect good
orgit bisect bad
-> repeat for either half.
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
- https://www.hackthebox.com/blog/Dirty-Pipe-Explained-CVE-2022-0847
- Smallest unit of memory that CPU controls -
page
, usually 4 KB - Translation lookaside Buffer (TLB)
- Memory cache that maps virtual memory to physical memory. Maps pages (vritual) to frames (physical)
- Smallest unit of memory that CPU controls -
Thu Mar 31 2022
- KPI - Key Performance Indicator
- For startups - KPI to track growth must be
revenue
for paying customers,usage
if otherwise - https://kpi.org/KPI-Basics
- For startups - KPI to track growth must be
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 Pythonfrom 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
- https://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art026
/usr/include
- Contains C header files (among others)##include </path/to/file.h> => appended to
/usr/include`
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
- getattr(object, name, default)
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
- Liquor/spirits - has been distilled
- only last 100 years, we haven’t physiologically or culturally adapted
Thu Jan 06 2022
- Folio number in mutual funds - unique ID like bank account number
Sun Jan 02 2022
- AAAA record - name to IPv6 address.
- A record - name to IPv4 address.
- Pass multiple lines of text to a command -
<<
,heredoc
https://linuxize.com/post/bash-heredoc/