Archive


Category: 似水流年

  • Hard skills and soft skills

    1. Hard Skills (Technical Skills) These are the measurable, teachable skills directly related to software development. a. Programming and Software Engineering Fundamentals Programming Languages: Learn multiple paradigms (e.g., Object-Oriented, Functional, Procedural). Examples: Python, Java, C++, JavaScript, Rust, etc. Data Structures and Algorithms: Understand core concepts like arrays, linked lists, trees, graphs, sorting, and searching algorithms. […]

  • Vault for security

    Identity & access management User & group management Service principals SSO MFA Role-based access control Resource-based access control Workload Identity Federation Secrets lifecycle management Static secrets Auto-rotating secrets Dynamic secrets Secrets sync Secret versioning Secret import Webhooks Integrations HCP Terraform AWS Azure Google Cloud Platform Kubernetes GitHub Vercel MongoDB Atlas Twilio Log streaming Security & […]

  • 文本分割的方法

    长文本分割是构建高效检索系统的重要步骤,好的分割方法需要兼顾语义完整性和块大小适中。我们要避免简单的固定长度切分导致语义丢失的问题: 1. 基于句子分割 方法 使用自然语言处理工具将文本分割成句子,然后再组合成适当大小的块。 实现示例 import nltk from nltk.tokenize import sent_tokenize # 下载 punkt 分词器(首次运行需要) nltk.download('punkt') def split_text_by_sentences(text, chunk_size=300): sentences = sent_tokenize(text) chunks = [] current_chunk = "" for sentence in sentences: # 如果当前块加上新句子的长度超过 chunk_size,则开始新块 if len(current_chunk) + len(sentence) > chunk_size: chunks.append(current_chunk.strip()) current_chunk = sentence else: current_chunk += " " + sentence # 添加最后一个块 […]

  • AWS Identity and Access Management

    Overview AWS Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources. With IAM, you can manage permissions that control which AWS resources users can access. You use IAM to control who is authenticated (signed in) and authorized (has permissions) to use resources. IAM provides the infrastructure […]

  • JMPP 让 XMPP 协议老树开新花

    XMPP 是若干年前流行的即时通信 IM 协议, 据说起初的 QQ 就采用了这个协议, 我多年以前也用过它实现过多人聊天, 类似今天的微信群, 时至今日, XMPP 由于采用了 XML 这个冗长的格式, 日趋式微, 我以前就想过用 JSON 来替换 XMPP 中的 XML 格式, 姑且叫它 JMPP(Json Messaging and Presence Protocol) 吧。 XMPP 协议基础知识 XMPP 的核心概念 消息(Message):用于传递即时消息。 状态(Presence):用户在线状态(例如在线、离线、忙碌)。 信息查询(IQ):实现请求-响应模式,用于功能扩展。 Jabber ID(JID):唯一标识用户的地址,类似于 email 地址,例如 user@domain/resource。 XMPP 的通信模型 XMPP 使用客户端-服务器架构,通信过程包括: 客户端通过 TCP 连接到服务器。 使用 TLS 加密连接。 通过 SASL 完成身份验证。 交换 […]

  • 用 JMPP 让 XMPP 老树发新枝

    关于 JMPP 的想法 XMPP 是若干年前流行的即时通信 IM 协议, 据说起初的 QQ 就采用了这个协议, 我多年以前也用过它实现过多人聊天, 类似今天的微信群, 时至今日, XMPP 由于采用了 XML 这个冗长的格式, 日趋式微, 我以前就想过用 JSON 来替换 XMPP 中的 XML 格式, 姑且叫它 JMPP(Json Messaging and Presence Protocol) 吧 一、XMPP 的优缺点 优点 开放性与标准化 XMPP(可扩展消息处理现场协议,Extensible Messaging and Presence Protocol)是一个开放的、基于 XML 标准的通信协议。它被广泛应用于即时通讯(IM)等领域,众多不同的客户端和服务器实现都可以依据这个标准进行交互,促进了不同平台和系统之间的互联互通,例如可以轻松实现桌面客户端、移动应用以及网页端应用之间的消息传递。 可扩展性 其基于 XML 的结构使得很容易扩展功能。开发者可以通过定义新的 XML 标签和命名空间来添加自定义的消息类型、功能模块等,以适应各种不同的业务需求,比如在即时通讯基础上扩展文件传输、语音通话等相关功能的描述信息。 实时性与分布式架构支持 XMPP 天生具备支持实时通讯的能力,并且可以很好地适应分布式的服务器架构,便于构建大规模的通讯网络,能够有效地处理大量用户并发连接和消息交互,像很多大型的企业内部通讯系统或者开源的 IM 服务都基于它构建。 缺点 […]

  • How to set access control for the static files that served by nginx

    To set an access password for static files served by Nginx, you can use HTTP Basic Authentication. Follow these steps: 1. Install htpasswd (if not already installed) The htpasswd utility is part of the Apache apache2-utils package on Debian-based systems or httpd-tools on RHEL-based systems. Debian/Ubuntu: sudo apt update sudo apt install apache2-utils RHEL/CentOS: sudo […]

  • day in and day out

    day in and day out, its the small things that kill our spirit: The sales representative whoe empties his cold coffee and leaves the splatters all over the sink. The manager who uses the last drop of lotion and doesn’t refill the container The analyst who walks away from the printer, leaving the red light […]

  • setup better env for developer

    Setting up a convenient environment on macOS for developers involves configuring the terminal, installing essential tools, and customizing workflows for efficiency. Here’s a comprehensive guide: 1. Update macOS and Install Xcode Command Line Tools Ensure your macOS is up-to-date: sudo softwareupdate –install –all Install Xcode Command Line Tools (required for compilers like gcc and tools […]