blog.86428642.xyz Technical Blog
website·Indexed 31 days ago
https://blog.86428642.xyzA personal technical knowledge base and development log covering Linux (Docker, rsync, iptables, WebRTC), Android (Jetpack), FrontEnd (Vue, VitePress, PageSpy), and BackEnd (Golang garbage collection, I/O multiplexing, C++). Includes practical experiments on Docker container networking, storage, and image building.
What's inside blog.86428642.xyz
- rsync is a fast and reliable tool for synchronizing files and directories across local and remote systems (via LAN or Internet). It uses a delta-transfer algorithm to send only the modified parts of files, which significantly reduces bandwidth and time. Key capabilities include incremental backups, partial file synchronization, breakpoint resumption, encrypted transfers, and bandwidth limiting. It is commonly used in CI/CD pipelines (e.g., via Makefiles and SSH keys) to automate the deployment of compiled binaries to servers.
Overview of Vue.js Core Concepts
Vue.js is a progressive JavaScript framework designed for building user interfaces. It employs a component-based architecture where websites and applications are broken down into independent components, each with its own state and functionality, allowing for communication between components to manage complex applications.
Key architectural principles include:
- Data-Driven Programming: Vue focuses on data and state changes rather than direct DOM manipulation, which prevents unstructured DOM operations and improves maintainability.
- Flexible Data Binding: Provides simple syntax rules for rapid development of full-featured frontend programs.
- Progressive Nature: Designed with a simple API to ensure a low barrier to entry for developers.
Overview of Android Jetpack
Android Jetpack is a collection of components, tools, and guidelines designed to accelerate Android app development. It provides standard APIs to simplify common programming patterns such as Activity and Fragment lifecycle management, asynchronous task handling, and data persistence. Jetpack components are compatible with most Android platforms from Android 4.0 (API level 14) to the latest versions.GitHub Repository: https://github.com/androidx/androidxOverview of Android Development Environment and Languages
Android is a mobile operating system developed by Google, based on the Linux kernel. Development is primarily split into two areas: frontend development (UI design, user interaction, and interface logic using the Android SDK and XML) and backend development (data storage, network requests, and business logic). The primary programming languages used for Android development are Java and Kotlin.Android Jetpack Architecture Components Reference
Architecture components help developers build robust, testable, and maintainable app structures:
databinding: Binds UI views to data models directly in XML layout files.hilt: A dependency injection framework based on Dagger.room: An abstraction layer over SQLite for easier database operations.lifecycle: Tools for managing the lifecycle of components to avoid memory leaks.navigation: Framework for implementing a single-Activity, multi-Fragment architecture.paging: A loader for implementing paginated data loading in RecyclerView.startup: Automates the initialization of app dependencies.work: WorkManager for scheduling deferrable background tasks.datastore: A modern, asynchronous, and secure replacement for SharedPreferences.savedstate: Preserves lightweight user data when the system kills the process.
Android Jetpack Core Libraries Reference
The Core libraries provide fundamental tools and backward compatibility for the latest Android features:
activity.*: Classes for creating and managing Activity lifecycles (e.g., AppCompatActivity).arch.core: Auxiliary classes for designing application architecture.annotation: Annotations to improve code readability and maintainability.collection: Memory-optimized data structures like SparseArray and ArrayMap.core: The primary core library for API backward compatibility.Customview: Helpers for creating custom views.fragment.*: Tools for managing Fragment lifecycles and transactions.appcompat: Support library for using modern features (e.g., Toolbar, DrawerLayout) on older Android versions.
Understand Go's Garbage Collection evolution
Go has evolved its garbage collection mechanism to reduce Stop-The-World (STW) pauses and improve efficiency:
- Go 1.3 (Mark-and-Sweep): Uses a simple mark-and-sweep approach. It requires a full STW to stop the program, mark all reachable objects starting from global and stack objects, and then sweep unmarked objects.
- Go 1.5 (Tri-color Marking): Introduces three colors to track object states:
- White: Potential garbage (not yet reached).
- Grey: Reachable objects whose children haven't been fully scanned.
- Black: Reachable objects that have been fully scanned. To prevent the accidental deletion of active objects during concurrent execution, Go uses Write Barriers (Insertion or Deletion barriers) to maintain the 'Tri-color Invariant' (preventing black objects from pointing to white objects without a grey path).
- Go 1.8 (Tri-color + Hybrid Write Barrier): Further optimizes STW by using a Hybrid Write Barrier. Key rules include:
- Stack-reachable objects are marked black at the start of GC.
- New objects created on the stack during GC are marked black.
- Deleted references are marked grey.
- Added references are marked black.
Understand the iptables network model
iptables controls network packets entering, leaving, and forwarding through network interfaces using a system of five chains and four tables.
Five Chains:
PREROUTING: Filters packets as they arrive at the network interface, before routing.POSTROUTING: Filters packets as they leave the network interface, after routing.INPUT: Filters packets entering the operating system to interact with local processes.OUTPUT: Filters packets leaving the operating system from local processes.FORWARD: Filters packets being forwarded from one interface to another.
Four Tables:
FILTER: Acts as a firewall to determine if packets are allowed. Supports:INPUT,OUTPUT,FORWARD.NAT: Handles Network Address Translation (source/destination addresses). Supports:PREROUTING,POSTROUTING,INPUT,OUTPUT.MANGLE: Used for modifying packet header data. Supports:PREROUTING,POSTROUTING,INPUT,OUTPUT,FORWARD.RAW: Used for configuring exemptions from connection tracking in the NAT table.
Understand the I/O Multiplexing Event Notification Mechanism
I/O multiplexing follows a three-step event notification process to handle data readiness without blocking the main execution thread:
- Register for a readable event.
- The system monitors for the arrival of readable data.
- The system notifies the application that the data is now readable.
Use PageSpy for remote frontend debugging in mobile WebViews
PageSpy is an open-source frontend debugging platform designed to solve the difficulty of debugging hybrid pages (WebViews) in mobile apps. Unlike on-device tools like vConsole which are limited by small screen sizes, PageSpy connects the mobile client to a management backend. This allows developers to view real-time debugging information, network requests, and logs on a desktop browser. Key features include real-time monitoring and the ability to save and replay session logs, including user interactions (clicks, scrolls), page responses, and associated network traffic.Understand the difference between Docker containers and Virtual Machines
Docker containers provide a lightweight alternative to Virtual Machines (VMs) by solving the 'environment configuration' problem. While VMs run a full guest operating system (leading to high resource consumption, redundancy, and slow boot times), Docker containers package the application and its dependencies into a single image. They leverage Linux cgroups and Linux namespaces to create isolated environments without the overhead of a full guest OS, allowing applications to run as if they were on a physical machine while remaining portable across different environments.Understand Public and Private IP address concepts
IP addresses act as network 'house numbers' used to locate devices.
- Private IP (Internal IP): Used within a local area network (LAN). These addresses are not routable on the global Internet. Common private address ranges include:
- Class A: 10.0.0.0 – 10.255.255.255
- Class B: 172.16.0.0 – 172.31.255.255
- Class C: 192.168.0.0 – 192.168.255.255
- Public IP: An address reachable across the global Internet. In home broadband, these are typically dynamic (changing with each dial-up/reconnection), while dedicated lines may provide static public IPs.
- Private IP (Internal IP): Used within a local area network (LAN). These addresses are not routable on the global Internet. Common private address ranges include: