gitsang's Technical Blog and Notes

website·Indexed 30 days ago

https://gitsang.github.io

A collection of technical guides and personal notes covering Linux system administration (LVM, systemd, firewalld), Java development (Spring MVC, closures, anonymous inner classes), C++ (GoogleTest), and cloud infrastructure (Alibaba Cloud subdomain management, ELK stack, RocketMQ).

Tokens
32.6K
Snippets
187
Records
249
Agent score
75%

What's inside gitsang

  1. Overview of SpringMVC Layered Architecture

    SpringMVC follows the Model-View-Controller (MVC) pattern to achieve high cohesion and low coupling. The architecture is divided into:

    1. View Layer: The presentation layer (JSP, HTML) used for UI display. It is often tightly coupled with the Controller layer.
    2. Controller Layer: Handles request routing and coordinates between the View and Service layers.
    3. Model Layer: Divided into the Service Layer (business logic) and the DAO Layer (database persistence).
  2. Understand the Schrödinger's Cat thought experiment

    Schrödinger's Cat is a thought experiment designed to illustrate the problem of quantum superposition at a macroscopic scale. In the experiment, a cat is placed in a box with a radioactive substance that has a 50% chance of decaying and releasing poison. According to quantum mechanics, if the box remains closed, the system exists in a superposition where the cat is simultaneously alive and dead. The state is only 'determined' (wave function collapse) at the moment of observation when the box is opened.
  3. Understand the concept of Laplace's Demon

    Laplace's Demon is a scientific hypothesis suggesting that if an entity knew the precise position and momentum of every atom in the universe, it could use Newton's laws to predict the entire past and future. However, modern quantum mechanics challenges this, citing the Uncertainty Principle and information processing limits (estimated at 10^120 bits based on cosmic entropy, light speed, and Planck length).
  4. RocketMQ Overview

    RocketMQ is an open-source distributed messaging middleware originally developed by Alibaba and donated to the Apache Software Foundation in 2016. It is designed for high performance and reliability, supporting strict message ordering and low-latency writes even with billions of accumulated messages. It is developed in Java and provides SDKs for C++ and Go.
  5. Deploy ELK in a distributed architecture using Filebeat

    To reduce the resource burden on application servers, deploy the ELK stack on a separate, high-performance server. Instead of installing the full ELK stack on every machine, install only Filebeat on each data-collecting server and configure it to send logs to the central ELK server's IP address.
  6. Understand Two-Phase Commit (2PC) basics

    Two-Phase Commit (2PC) is used to ensure that multiple operations (e.g., deducting money from account A and adding it to account B) either all succeed or all fail.

    1. Prepare Phase: The coordinator sends a 'prepare' request to all participants. Participants check if they can execute the operation (e.g., check for sufficient balance) and lock/freeze the necessary resources.
    2. Commit Phase: If all participants respond with success, the coordinator sends a 'commit' request to execute the operation. If any participant fails or doesn't respond, a 'rollback' is initiated.

    Key Constraint: 2PC handles business-level exceptions (e.g., insufficient funds) but does not inherently solve system-level failures (e.g., network partitions or crashes) without additional mechanisms like persistence and retries.

  7. Retrieve detailed package information with yum

    Use the yum info and yum provides commands to get metadata about packages or identify which package provides a specific file.
    # Get information about a specific package
    yum info <package_name>
    
    # List information for all packages that have updates
    yum info updates
    
    # List information for all installed packages
    yum info installed
    
    # List information for installed packages not in the Yum repository
    yum info extras
    
    # Find which package provides a specific file or capability
    yum provides <file_path>
  8. Understand the site structure and content organization

    The site organizes content into three primary areas:

    • Docs: Contains technical documentation and learning notes.
    • Blog: Contains essays and miscellaneous writings.
    • Home: Displays the author's personal technology stack.
  9. Understand the concept of closures in programming

    A closure is an entity that stores a function along with its associated environment (lexical environment), allowing the function to continue operating even when it is removed from its original context. It consists of two primary characteristics:

    1. Enclosure (Isolation): It isolates the internal environment from external states, preventing external states from affecting the internal logic.
    2. Bundling: It packages the necessary external environment variables into its own internal space so it can exist independently of the original scope.
  10. Analyze the Single-Particle Double-Slit Experiment

    The single-particle double-slit experiment demonstrates that observation affects particle behavior. While particles passing through two slits typically create an interference pattern (suggesting wave-like behavior or quantum entanglement where particles act as a single system), the act of observing which slit a single electron passes through causes the interference pattern to disappear. When observation ceases, the pattern reappears, proving that the act of measurement collapses the quantum state.
  11. Use cgdb for an enhanced GDB interface

    cgdb is a frontend for GDB that provides a vi-like interface with synchronized code display, serving as a more powerful alternative to gdb -tui for developers familiar with vi.