From 29d74e70ec328c784fcea8b32624cf0960fe724c Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Sat, 6 Jun 2026 11:41:02 +0000 Subject: [PATCH] Add README.md --- README.en.md | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 228 insertions(+) create mode 100644 README.en.md create mode 100644 README.md diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..da40aca --- /dev/null +++ b/README.en.md @@ -0,0 +1,114 @@ +# libs + +A collection of practical tools primarily designed for Windows system management, development environment configuration, and file synchronization scenarios. + +## Project Components + +### Python Tools + +| File | Description | +|------|-------------| +| `1.py` | Git repository synchronization tool supporting three sync modes | +| `cmd1.py` | Executes commands and saves logs to a file | +| `lines.py` | Counts lines of code in a directory | +| `user.py` | File synchronization client supporting upload/download/delete operations | + +### C Language Tools + +| File | Description | +|------|-------------| +| `autoconf.c` | Automatically locates MinGW GCC and configures the build environment | +| `conf.c` | INI configuration file parser that generates C code | +| `crash.c` | Windows crash handler that elevates program privileges | +| `install.c` | Windows installation wizard GUI application | +| `mycrash.c` | Native API-based crash analysis tool | +| `sys.c` | Windows kernel driver for terminating the TrustedInstaller process | + +### Shell Scripts + +| File | Description | +|------|-------------| +| `start.sh` | Git environment variable configuration script | + +## Feature Overview + +### 1.py - Git Synchronization Tool + +Offers three synchronization modes: +- `sync_mode1`: Basic git pull and push operations +- `sync_mode2`: Incremental synchronization with timestamp checking +- `sync_mode3`: Full folder synchronization + +Main functions: +- `clone_repo()` - Clone a Git repository +- `commit_and_push()` - Commit and push changes +- `get_latest_commit_time()` - Retrieve the latest commit time + +### user.py - Synchronization Client + +Implements a file synchronization client supporting: +- `Progress` class - File transfer with progress display +- `SyncClient` class - Core synchronization functionality + - `get_server_files()` - Retrieve server file list + - `upload_file()` - Upload a file + - `download_file()` - Download a file + - `scan_local()` - Scan local files + - `sync()` - Execute synchronization + +### lines.py - Code Line Counter + +Counts lines of code in a specified directory: +- `format_size()` - Format file size +- `count_lines_in_file()` - Count lines in a single file +- `scan_directory()` - Scan entire directory + +### install.c - Installation Wizard + +Windows GUI installer with the following steps: +1. Welcome screen +2. License agreement +3. Installation path selection +4. Installation progress display +5. Completion screen + +## Usage Instructions + +### Python Tools + +Ensure Python 3.x is installed and run as follows: + +```bash +python 1.py +python cmd1.py +python lines.py +python user.py +``` + +### C Tools + +Compile using MinGW or Visual Studio: + +```bash +# Compile with MinGW +gcc -o install.exe install.c -lwinmm -ladvapi32 + +# Compile with Visual Studio +cl install.c +``` + +### start.sh + +```bash +chmod +x start.sh +./start.sh +``` + +## Notes + +- Some tools require administrator privileges to run +- `sys.c` is a kernel driver and requires digital signing to load on production systems +- `mycrash.c` and `crash.c` are low-level system analysis tools; use with caution + +## License + +This project is intended solely for learning and communication purposes. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..9beb7dc --- /dev/null +++ b/README.md @@ -0,0 +1,114 @@ +# libs + +这是一个包含多种实用工具的集合项目,主要用于 Windows 系统管理、开发环境配置和文件同步等场景。 + +## 项目组件 + +### Python 工具 + +| 文件 | 功能描述 | +|------|----------| +| `1.py` | Git 仓库同步工具,支持三种同步模式 | +| `cmd1.py` | 命令执行并保存日志到文件 | +| `lines.py` | 统计目录中代码行数 | +| `user.py` | 文件同步客户端,支持上传/下载/删除操作 | + +### C 语言工具 + +| 文件 | 功能描述 | +|------|----------| +| `autoconf.c` | 自动查找 MinGW GCC 并配置编译环境 | +| `conf.c` | INI 配置文件解析器,生成 C 代码 | +| `crash.c` | Windows 崩溃处理,提权运行程序 | +| `install.c` | Windows 安装向导界面程序 | +| `mycrash.c` | 原生 API 崩溃分析工具 | +| `sys.c` | Windows 内核驱动,用于结束 TrustedInstaller 进程 | + +### Shell 脚本 + +| 文件 | 功能描述 | +|------|----------| +| `start.sh` | Git 环境变量配置脚本 | + +## 功能简介 + +### 1.py - Git 同步工具 + +提供三种同步模式: +- `sync_mode1`: 基本的 git pull 和 push 操作 +- `sync_mode2`: 带时间戳检查的增量同步 +- `sync_mode3`: 完整文件夹同步 + +主要函数: +- `clone_repo()` - 克隆 Git 仓库 +- `commit_and_push()` - 提交并推送更改 +- `get_latest_commit_time()` - 获取最新提交时间 + +### user.py - 同步客户端 + +实现文件同步客户端,支持: +- `Progress` 类 - 带进度显示的文件传输 +- `SyncClient` 类 - 同步核心功能 + - `get_server_files()` - 获取服务器文件列表 + - `upload_file()` - 上传文件 + - `download_file()` - 下载文件 + - `scan_local()` - 扫描本地文件 + - `sync()` - 执行同步 + +### lines.py - 代码统计 + +统计指定目录下的代码行数: +- `format_size()` - 格式化文件大小 +- `count_lines_in_file()` - 统计单个文件行数 +- `scan_directory()` - 扫描整个目录 + +### install.c - 安装向导 + +Windows GUI 安装程序,包含以下步骤: +1. 欢迎界面 +2. 许可协议 +3. 安装路径选择 +4. 安装过程显示 +5. 完成界面 + +## 使用说明 + +### Python 工具 + +确保已安装 Python 3.x,运行方式: + +```bash +python 1.py +python cmd1.py +python lines.py +python user.py +``` + +### C 工具 + +需要使用 MinGW 或 Visual Studio 编译: + +```bash +# 使用 MinGW 编译 +gcc -o install.exe install.c -lwinmm -ladvapi32 + +# 使用 Visual Studio +cl install.c +``` + +### start.sh + +```bash +chmod +x start.sh +./start.sh +``` + +## 注意事项 + +- 部分工具需要管理员权限运行 +- `sys.c` 为内核驱动,需要签名才能在正式系统加载 +- `mycrash.c` 和 `crash.c` 用于系统底层分析,请谨慎使用 + +## 许可证 + +本项目仅供学习交流使用。 \ No newline at end of file -- Gitee