Archive


Category: 似水流年

  • IDaaS – Identity as a Service

    Identity as a Service 身份认证作为一种服务, 包括身份验证,用户管理, 访问控制等功能, 实现安全的身份认证和访问控制, 减少从头构建身份认证管理系统的成本和复杂性. 例如 Okta, Authing, Auth0, AWS Cogito/IAM, 以及开源的 Keycloak, 它主要包含如下关键组件 认证服务器 Authentiation Server 负责用户的身份认证与授权, 支持多种身份验证协议, 如 OAuth, OpenID Connect 和 SAML. Authentiation Server 维护用户的身份信息和凭据, 并验证用户的身份以颁发访问令牌. 客户端 Clients Confidential Clients Public Clients Bearer-only Clients 令牌 Token Access Token ID Token 身份提供者 Identity Provider IDAP Active Directory SNS: Google, […]

  • Vue.js 示例

    1. 计数器组件(基础响应式) <template> <div> <p>Count: {{ count }}</p> <button @click="increment">+1</button> <button @click="reset">Reset</button> </div> </template> <script setup> import { ref } from 'vue'; // 响应式变量 const count = ref(0); // 方法 const increment = () => count.value++; const reset = () => count.value = 0; </script> 核心概念: ref 创建响应式变量 @click 事件绑定 模板中直接使用变量 2. Todo List(列表渲染 & […]

  • Designing Data Intensive Applications 1

    Reliable, Scalable, and Maintainable Applications 数据库 A data-intensive application is typically built from the standard building blocks that provide the commonly needed functionality 缓存 Remember the result of an expensive operation to speed up reads. 搜索及索引 Allow users to search data by keyword or filter it by various ways 流处理 Send a messenger to another […]

  • gRPC transport

    At a high level there are three distinct layers to the library: Stub, Channel, and Transport. Stub The Stub layer is what is exposed to most developers and provides type-safe bindings to whatever datamodel/IDL/interface you are adapting. gRPC comes with a plugin to the protocol-buffers compiler that generates Stub interfaces out of .proto files, but […]

  • Solve the dependency hell by maven

    Resolving version conflicts in Maven can be tricky, but Maven provides several strategies and mechanisms to handle dependency conflicts effectively. Here’s a deeper dive into how you can resolve version conflicts in Maven: 1. Maven’s Dependency Mediation (Nearest-Wins Strategy) Maven uses a nearest-wins strategy to resolve version conflicts. This means that when multiple versions of […]

  • Reasoning process of deep seek

    Question you are an expert of macos and bash, the output is empty by the following command line, what’s wrong? how to fix it? echo "expiration = 1738939379000"|sed -n ‘s/^expiration\s=\s([0-9]+)$/\1/p’ Reasoning process Okay, let me try to figure out why the sed command isn’t giving any output. The user ran the command: echo "expiration = […]

  • 普通软件工程师如何用AI提升效率

    一、未来最有潜力的AI应用方向 1. 自主AI代理(Autonomous Agents) 示例: 自动修复代码的AI(如AutoDebug):当单元测试失败时,AI能分析日志,定位错误并提交修复PR。 自动化运维:AI监控服务器指标(如CPU飙升),自动扩容或回滚问题版本。 2. 企业级RAG(检索增强生成) 示例: 内部知识库问答:用LangChain+GPT搭建工具,输入“如何申请服务器权限?”,AI直接引用公司内部文档生成步骤。 代码库搜索:用Sourcegraph+AI,输入“用户登录逻辑在哪?”,AI定位到具体代码文件并解释逻辑。 3. AI原生开发工具 示例: 需求转代码:在Jira写需求“实现JWT登录接口”,AI自动生成对应REST API代码和Swagger文档。 智能重构:用JetBrains AI Assistant,输入“将这段Java代码转为Kotlin”,AI自动转换并保持功能一致。 4. AI驱动的效能优化 示例: SQL优化:将慢查询日志喂给ChatGPT,生成添加索引或重写的建议。 缓存策略:用AI分析API调用模式,推荐Redis缓存哪些高频数据。 二、普通工程师如何用AI提效(实操案例) 1. 代码开发 生成模板代码: 操作:在VS Code中用GitHub Copilot,输入注释// 用Python读取CSV文件并统计各列平均值,自动生成Pandas代码。 解释复杂代码: 操作:将一段不理解的正则表达式粘贴到ChatGPT,提问“请逐行解释这段正则匹配的逻辑”。 2. 调试与优化 快速定位Bug: 操作:将错误日志NullPointerException at UserService.java:58发给CodeWhisperer,AI建议检查userRepository.findById()是否可能返回null。 性能分析: 操作:用PyCharm的Profiler生成性能报告,让AI分析“如何优化这个O(n²)的排序算法?”。 3. 文档与协作 自动生成文档: 操作:用Mintlify插件,选中代码中的Swagger注解,自动生成API文档网站。 会议纪要整理: 操作:用钉钉/飞书的内建AI工具,上传会议录音,生成摘要并提取待办事项。 4. 学习与决策 技术选型辅助: 操作:向Claude提问“微服务场景下,Kafka和RabbitMQ该如何选择?请对比吞吐量和可靠性”。 快速学习新技术: 操作:让Perplexity […]

  • AWS KMS 和 AWS Secrets Manager

    AWS 提供多种服务来管理敏感数据,其中 AWS Key Management Service (KMS) 和 AWS Secrets Manager 是用于保护和管理密钥及凭据的核心服务。下面详细介绍这两者的功能、区别及其相关技术。 1. AWS KMS (Key Management Service) AWS KMS 是一个托管的密钥管理服务,用于创建、存储和控制加密密钥,以保护 AWS 资源和应用程序中的数据。 1.1 AWS KMS 的主要功能 密钥管理 生成、存储、轮换和销毁加密密钥 支持对称密钥和非对称密钥(RSA、ECC) 支持HMAC(哈希消息认证码)密钥 数据加密 直接使用 KMS 进行数据加密(Encrypt/Decrypt API) 使用 KMS 生成的数据密钥(Data Key)进行本地加密 权限控制 通过 AWS IAM 进行细粒度权限控制 允许基于资源的访问策略(Resource Policies) 密钥轮换 可自动或手动轮换密钥,提升安全性 FIPS 140-2 认证 KMS 提供符合FIPS 140-2 […]