博客列表
AWS-SAA
AWS SAA-C03 认证: Step1 (20%): 看B站Stephane Maarek Step2: (30%): 注册AWS-free tier 建一个 VPC,划分子网;开两台 EC2,前面挂一个 ALB(负载均衡器),后面连一个 RDS 数据库。 Step3: (50%): 最新的 SAA 题库 SLA && Trade-off FinOps
May 12, 2026
Enterprise Devices
打印机 企业复合机支持热插拔(Hot-Swap)架构。 开盖: 机器报“缺粉”时,直接在开机状态下打开前盖。 拔出: 捏住对应的颜色(CMYK)碳粉盒把手,直接抽出来。 摇匀(关键动作): 拿出新的碳粉盒,左右水平摇晃 5-6 下。因为碳粉是物理颗粒,长时间静置会结块,摇匀是为了防止打印出白条。 推入: 顺着轨道推到底,关上门。 等待自检: 机器屏幕会提示“正在补充碳粉”,电机转动一两分钟后,自动恢复打印。全程对用户无感。 IP 电话与视频会议连不上(网络与协议层排障) 1. IP 电话(VoIP)排障逻辑 IP 电话本质上就是一台只有一块小屏幕的“Linux 微型电脑”。 电源层(L1): 绝大多数企业 IP 电话没有电源插头!它们使用的是 PoE(以太网供电) 交换机。如果电话黑屏不开机,第一步不是找插座,而是去机房看对应的交换机端口灯亮不亮,或者网线是不是断了。 网络层(L2/L3): 企业的交换机里通常划分了 Voice VLAN(语音专网)。如果一台电脑能上网,但拔下这根网线插到电话上却打不通,通常是因为交换机端口没有配置正确的 Voice VLAN ID,导致电话无法获取语音网段的 DHCP 地址。 应用层(L7): 如果屏幕亮了,也有 IP 地址,但是打不出电话。这就去检查 SIP 注册状态。这说明电话没有成功连接到总部的 Call Manager(呼叫中心服务器),这时候才需要你去 Ping 语音服务器的 IP 看通不通。 视频会议设备(如 Polycom 宝利通、罗技、华为 TE 等) 视频会议设备的故障,90% 集中在两个极端:最底层的物理线缆,和最顶层的防火墙策略。 物理 I/O 故障(最常见): “会议室没声音/没图像!” 过去一看,HDMI 线被上一个开会的人拔了,或者麦克风阵列的线被保洁阿姨扫地时碰掉了。 所以排障第一步:永远先顺着设备把所有物理线缆摸一遍,按紧。 防火墙 UDP 阻断: 视频会议走的是极其消耗带宽的 UDP 视频流。如果设备能连上网,但是加入会议后“黑屏”或者“听不到对方声音”,极大概率是公司的边缘防火墙(Firewall)没有放行特定的音视频端口(比如 UDP 10000-20000 段)。这时候你只需收集好设备的 IP 和目标会议室的 IP,把工单丢给网络安全组去开通策略即可。
May 7, 2026
Network Engineer
1.x: 1️⃣ 网络体系结构与通信过程:探讨 OSI 七层模型与 TCP/IP 模型的对应关系,以及数据在各层是如何自上向下封装、自下向上解封装的 。 网络协议三要素: 语法(Syntax): 规定数据与控制信息的结构或格式 。 语义(Semantics): 规定各个控制信息的具体含义 。 比如系统发出这个控制信息,是要求完成何种动作(是建立连接还是断开连接)。 同步 / 时序(Timing): 对事件实现顺序和时间的详细说明 。比如数据应该在何时发送、以多快的速率发送 。 考点二:架构师的系统分层视角(三大体系结构对比)
May 3, 2026
Regex
What is a regular expression (or regex)? Wikipedia defines regular expressions as: “a sequence of characters that define a search pattern” They are available in basically every programming language, and you’ll probably most commonly encounter them used for string matches in conditionals that are too complicated for simple logical comparisons (like “or”, “and”, “in”). A couple of examples of regular expressions to get started: [ -~] Any ASCII character (ASCII characters fall between space and “~”) ^[a-z0-9_-]{3,15}$ Usernames between 3 and 15 characters When to use regex Use regular expressions with caution. The complexity of regex carries a cost. Avoid coding in regex if you can ‘Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.’ – Jamie Zawinski
April 27, 2026
jekyll 博客迁移为 Hugo
jekyll 博客迁移为 Hugo 痛点:Hugo (对比 Jekyll) 在 DevOps 和静态网站生成(SSG)的圈子里,Jekyll 是前辈,但 Hugo 是目前的“性能之王”。以下是它在工程体验上的三大降维打击: 1. Zero Dependency Jekyll 的痛点: 它是用 Ruby 写的。你为了跑起来,必须折腾 Ruby 环境、装 bundler、解决 Gemfile 版本冲突。换台电脑经常跑不起来,让人非常崩溃。 Hugo 的优势: 它是用 Go 语言编写的。Hugo 编译出来就是一个独立的二进制文件。不需要装 Go 环境,不需要装任何依赖,下载那个 .exe 或执行 brew install hugo,立刻就能跑,极其干净。 2. 最快的静态网站生成器 Jekyll 的痛点: 当你的博客文章超过 100 篇时,Jekyll 的本地编译速度会肉眼可见地变慢,每次保存可能要等好几秒浏览器才会刷新。 Hugo 的优势: 号称“世界上最快的静态网站生成器”。哪怕你有上万篇文章,它的构建时间也是以毫秒计算的。保存瞬间,渲染完成。 3. 极简的本地预览指令 在 Hugo 中,只需要在博客根目录下敲下这一行命令: # -D 参数表示同时渲染草稿 (Drafts) hugo server -D 本地实时更新: http://localhost:1313/ Jekyll 到 Hugo 的企业级迁移 SOP: 阶段一:本地架构重组 (Directory Restructuring) Hugo 的目录规范和 Jekyll 类似,但更加严谨。我们需要把你的资产“重定向”到 Hugo 认识的路径里。请在终端执行以下操作: 1. 清理历史包袱 (Drop Legacy Dependencies) 既然不用 Jekyll 了,Ruby 的依赖和本地编译的产物必须立刻销毁,防止环境污染。
April 26, 2026
Docker
Docker Commands docker pull redis:8. redis:8.0.6-alpine docker images [devops@lb01 ~/docker/redis]$ docker images IMAGE ID DISK USAGE CONTENT SIZE EXTRA my-nodejs:v1 954fdbfce62a 194MB 48.1MB U nginx:latest 7f0adca1fc6c 237MB 65.8MB U redis:8.0.6-alpine 5f61955be8ab 86.8MB 24.9MB U docker run -p 6000:3000 –name -d redis-example redis:8.0.6-alpine [devops@lb01 ~/docker/redis]$ docker run -p 6000:3000 -d --name redis-example redis:8.0.6-alpine d7d16d237b5f664fa779edeb6af5b7696ef8b595b76104aa6a7475a27a4ac10c [devops@lb01 ~/docker/redis]$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d7d16d237b5f redis:8.0.6-alpine "docker-entrypoint.s…" 8 seconds ago Up 7 seconds 6379/tcp, 0.0.0.0:6000->3000/tcp, [::]:6000->3000/tcp redis-example [devops@lb01 ~/docker/redis]$ ss -lntup Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process udp UNCONN 0 0 127.0.0.1:323 0.0.0.0:* udp UNCONN 0 0 [::1]:323 [::]:* tcp LISTEN 0 4096 0.0.0.0:6000 0.0.0.0:* tcp LISTEN 0 511 0.0.0.0:80 0.0.0.0:* tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* tcp LISTEN 0 4096 [::]:6000 [::]:* tcp LISTEN 0 511 [::]:80 [::]:* tcp LISTEN 0 128 [::]:22 [::]:* tcp LISTEN 0 32 *:21 *:* docker exec -it d7d16d237b5f /bin/bash [devops@lb01 ~/docker/redis]$ docker exec -it d7d16d237b5f /bin/bash OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory # 报错后查询 Github issus ,了解到切换到 /bin/sh 后成功运行并进入到容器内 [devops@lb01 ~/docker/redis]$ docker exec -it d7d16d237b5f /bin/sh /data # ls /data # pwd /data [devops@lb01 ~/docker/redis]$ docker exec -it d7d16d237b5f /bin/sh /data # cd / / # ls bin dev home media opt root sbin sys usr data etc lib mnt proc run srv tmp var / # env HOSTNAME=d7d16d237b5f SHLVL=1 HOME=/root OLDPWD=/data TERM=xterm PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PWD=/ / # / # exit [devops@lb01 ~/docker/redis]$ docker exec -it d7d16d237b5f /bin/sh /data # curl /bin/sh: curl: not found Difference: docker ps / docker ps -a [devops@lb01 ~/docker/redis]$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d7d16d237b5f redis:8.0.6-alpine "docker-entrypoint.s…" 31 minutes ago Up 31 minutes 6379/tcp, 0.0.0.0:6000->3000/tcp, [::]:6000->3000/tcp redis-example [devops@lb01 ~/docker/redis]$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d7d16d237b5f redis:8.0.6-alpine "docker-entrypoint.s…" 31 minutes ago Up 31 minutes 6379/tcp, 0.0.0.0:6000->3000/tcp, [::]:6000->3000/tcp redis-example 37fb32f3b1f9 redis:8.0.6-alpine "docker-entrypoint.s…" 43 minutes ago Exited (0) 43 minutes ago redis-1 8ffc7554566c 7f0adca1fc6c "/docker-entrypoint.…" 31 hours ago Exited (0) 30 hours ago sre-tutorial-nginx e329c77b6133 my-nodejs:v1 "docker-entrypoint.s…" 3 days ago Exited (1) 30 hours ago web Docker Deploy the Demo Project Workflow with Docker: Push: js,Mongo DB ==> Git ==> Jenkins: Build JS APP & Create Docker Image ==> Docker Repository( Docker Hub ) Pull: From "Docker Hub" Developing with Containers need: JS and Node application, MongoDB Docker Container
April 21, 2026
IAM-Least Privilege Principle
Use least privilege principle to secure your CI/CD pipeline IAM Permissions && Access Control Prompt–The Over-Permissioned Pipeline Disaster-Real Security Risk: Developer sets up CodeBuild,gets “Access Denied” errors Frustrated,they attackAdministratorAccess policy to fix it quickly Pipeline works!Problems solved…or is it? CodeBuild now has full access to delete databases,modify IAM,access all s3 bucket Attacker compromises the build through malicious code in dependencies Now attacker has admin access to your entire AWS account The Principle of Least Privilege - Only What’s needed,Nothing More. Least Privilege = Grant minimum permissions required to do the job CodeBuild needs to read one S3 bucket?Grant exactly that,not all S3 buckets CodeDeploy nedds to update EC2 instances?Grant only deployment permission Dont’t grant Full S3 access EC2 admin IAM modification Think: What’s the smallest set of permissions for this to work? Benefits: Limits blast radius if compromised Building Secure IAM Policies for Pipeline Services IAM Policy = JSON document with permissions
April 20, 2026
Bash Scripting Documetry
Bash Scripting Bash: Bourne Again Shell Bash Syntax for Scripting Bash scripts are sequences of commands executed by the Bash shell. They automate tasks and can be used to perform complex operations. Understanding Bash syntax is crucial for writing effective scripts. Basic Syntax Here are some basic rules for using Bash in scripts: Comments: Comments start with a # and Bash ignores them. Command Order: Commands run one after the other, from top to bottom. Semicolons: Use ; to run multiple commands on the same line. Let's go through them one by one with examples. This script prints a greeting message [devops@lb01 ~]$ # This script prints a greeting message! [devops@lb01 ~]$ echo "hello!!" echo "hello# This script prints a greeting message!" hello# This script prints a greeting message! Best Practices for Writing Scripts Here are some tips for writing clean and efficient scripts: Use comments to explain your code. Choose meaningful variable names. Test your scripts thoroughly before using them in production. Introduction to Bash Scripting Bash scripts are files containing commands that you run in the terminal. They automate tasks and make your work more efficient. Creating a Bash Script To create a script, start with the shebang #! followed by the path to Bash, usually /bin/bash. Make sure your script has execute permissions. Example: Simple Bash Script #!/bin/bash # This script prints a greeting message echo "Hello, World!" Using Variables in Scripts Variables store data that your script can use. Assign values using the = sign without spaces. Example: Using Variables [devops@lb01 ~]$ name="dslfaj" [devops@lb01 ~]$ echo "hello,$name" hello,dslfaj ====================================== #!/bin/bash # Assign a value to a variable name="World" echo "Hello, $name!" Bash Variables Understanding Variables in Bash Variables in Bash are used to store data that can be used and manipulated throughout your script or command-line session. Bash variables are untyped, meaning they can hold any type of data.
April 18, 2026