Getting Started with Seeed Studio XIAO ESP32S3 Sense: Camera Streaming


1. Setting Up the Development Environment

I recommend using PlatformIO (VS Code extension) instead of Arduino IDE. PlatformIO has native support for the XIAO ESP32S3 Sense, so you don’t need to fall back on “ESP32S3 Dev Module.”

  • Install VS Code
  • Install PlatformIO IDE extension
  • Create a new project, and select:
    • Board: Seeed Studio XIAO ESP32S3
    • Framework: Arduino

Your platformio.ini should look like this:

[env:seeed_xiao_esp32s3]
platform = espressif32
board = seeed_xiao_esp32s3
framework = arduino
monitor_speed = 115200


2. LED Blink Test

Always start simple. Run a blink sketch to confirm that the board and toolchain are working.

#include <Arduino.h>
#define LED_BUILTIN 21   // Yellow onboard LED

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
}

If the yellow LED blinks, your setup is good to go.


3. Camera Initialization & Web Streaming

The XIAO ESP32S3 Sense comes with an OV2640 camera module. Below is a simplified snippet of the setup code (PlatformIO + Arduino framework):

#include "esp_camera.h"
#include <WiFi.h>
#include <WebServer.h>

#define XCLK_GPIO_NUM  10
#define SIOD_GPIO_NUM  40
#define SIOC_GPIO_NUM  39
#define Y9_GPIO_NUM    48
#define Y8_GPIO_NUM    11
#define Y7_GPIO_NUM    12
#define Y6_GPIO_NUM    14
#define Y5_GPIO_NUM    16
#define Y4_GPIO_NUM    18
#define Y3_GPIO_NUM    17
#define Y2_GPIO_NUM    15
#define VSYNC_GPIO_NUM 38
#define HREF_GPIO_NUM  47
#define PCLK_GPIO_NUM  13

const char *ssid = "YourWiFi";
const char *password = "Password";

WebServer server(80);

void startCameraServer() {
  server.on("/", HTTP_GET, []() {
    server.send(200, "text/html", "<h1>ESP32S3 Camera</h1><img src=\"/stream\">");
  });
  server.begin();
}

When successful, you’ll see an IP address in the Serial Monitor (e.g. 192.168.1.104).
Open http://192.168.1.104/stream in a browser to view the camera feed.


4. WiFi Connection & Debugging

A very common beginner issue is WiFi not connecting. Here are some tips:

  • ESP32 supports only 2.4GHz WiFi (no 5GHz support).
  • Keep your SSID and password simple (no unusual characters).
  • Use a WiFi scan to confirm available networks:
Serial.println("Scanning WiFi...");
int n = WiFi.scanNetworks();
for (int i = 0; i < n; i++) {
  Serial.printf("%d: %s (%d dBm)\n", i+1, WiFi.SSID(i).c_str(), WiFi.RSSI(i));
}
  • Print connection status codes while connecting:
    • 1 = WL_NO_SSID_AVAIL → AP not found
    • 3 = WL_CONNECTED → Connected successfully
    • 4 = WL_CONNECT_FAILED → Wrong password

5. Power Supply Pitfalls (The Biggest Trap!)

Here’s the #1 issue I ran into:

  • When powered via PC USB → everything worked, video stream was fine.
  • When powered via a cheap USB adapter or power bank → black screen, page not loading, or extreme lag.

Why? The ESP32S3 + Camera can draw 500–700mA at peak. Many USB adapters and thin cables can’t supply this reliably.

Fixes

  • Use a stable 5V / 2A USB power adapter
  • Use a short, thick USB cable (30–50 cm, rated for 2A current)
  • If you must use a weak power source, lower the camera load:
config.frame_size   = FRAMESIZE_QQVGA;   // 160x120
config.jpeg_quality = 20;                // High compression
config.xclk_freq_hz = 10000000;          // Lower clock speed
config.fb_count     = 1;                 // Single framebuffer

6. Common Issues & Solutions

  • Black screen → Power supply too weak / camera init failed
  • Page loads but extremely slow → WiFi unstable or CPU overloaded with JPEG compression
  • WiFi won’t connect → Check 2.4GHz availability, WPA2-PSK(AES) recommended
  • High latency → Either power issue or resolution too high

7. Suggested Beginner Workflow

  1. Verify development environment with LED Blink
  2. Test WiFi connectivity with a network scan
  3. Connect to WiFi and run basic camera streaming
  4. Solve power supply issues for stability
  5. Fine-tune resolution, frame rate, and JPEG quality for your use case

8. Changing PlatformIO Default Project Directory

By default, PlatformIO creates all new projects under:

~/Documents/PlatformIO/Projects/

On Linux, this path expands to something like:

/home/username/Documents/PlatformIO/Projects/

If you prefer to keep your projects in another location (for example, under ~/dev/platformio_projects), you can change this setting inside VS Code.

Steps:

  1. Open VS Code.
  2. Press Ctrl+Shift+P → type Preferences: Open User Settings (JSON).
  3. In the settings.json, add the following line: "platformio-ide.projectsDir": "/home/yourname/dev/platformio_projects"
  4. Save and restart VS Code.

From now on, all new PlatformIO projects will be created under your custom directory.


Getting Started with Seeed Studio XIAO ESP32S3 Sense + Arduino IDE (LED Blink Test)


If you’ve just received your Seeed Studio XIAO ESP32S3 Sense, this step-by-step guide will walk you through setting up the Arduino IDE, installing the correct board support, and running your first LED blink test.


1. Install Arduino IDE


2. Install ESP32 Board Support

  1. Open Arduino IDE → File → Preferences
  2. In Additional Board Manager URLs, add the following link:
https://espressif.github.io/arduino-esp32/package_esp32_index.json
  1. Click OK to save.
  2. Go to Tools → Board → Board Manager.
  3. Search for esp32, then install esp32 by Espressif Systems (latest version, currently 3.3.0).

⚠️ Important:
Do not use Arduino ESP32 Boards by Arduino. That package has incomplete support. Always use Espressif Systems (official).


3. Select the Correct Board

Navigate to:
Tools → Board → esp32 → ESP32S3 Dev Module

(Even though the XIAO ESP32S3 is not explicitly listed, selecting “ESP32S3 Dev Module” works perfectly.)


4. Select the Serial Port

Go to Tools → Port and choose your device, e.g.:

/dev/ttyACM0

If you don’t see it:

  • Try a different USB cable (must be a data cable, not a charge-only cable).
  • On Linux, you may need to add your user to the dialout group:
sudo usermod -a -G dialout $USER

Log out and log back in.


5. Test the LED (Blink Example)

Create a new sketch (.ino) and paste the following code:

#define LED_BUILTIN 21   // Onboard yellow LED on GPIO21

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // turn LED on
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);   // turn LED off
  delay(500);
}
  • Click Upload (→).
  • If the small yellow LED starts blinking, everything is working! 🎉

6. Troubleshooting

  • LED doesn’t blink
    • The power LED (always on) cannot be controlled. The correct controllable LED is the small yellow LED on GPIO21.
  • Compilation error: missing partition CSV
    • Ensure you selected ESP32S3 Dev Module.
  • No /dev/ttyACM0 port found
    • Check your USB cable (use a proper data cable).
    • Add user to dialout group (Linux).

✅ Conclusion

At this point, your XIAO ESP32S3 Sense is successfully set up with Arduino IDE. You can now control the onboard LED and are ready to explore more advanced features such as WiFi and the camera module.

AWS CLI Setup and Configuration on Windows


1. Install AWS CLI

Download and install the AWS CLI v2 for Windows:
👉 AWS CLI v2 MSI Installer (64-bit)

Verify installation:

aws --version

2. Create Access Keys

In the AWS Console:

  • Go to Security credentials
  • Under Access keys, click Create access key
  • Save both:
    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY (⚠️ only shown once)

3. Configure Credentials

Run in PowerShell:

aws configure

Enter:

AWS Access Key ID: <your_key_id>
AWS Secret Access Key: <your_secret_key>
Default region name: ap-northeast-1
Default output format: json

4. Verify Setup

aws sts get-caller-identity

Expected output:

{
  "UserId": "...",
  "Account": "123456789012",
  "Arn": "arn:aws:iam::123456789012:user/your-user"
}

✅ Done! You are now ready to use AWS CLI on Windows.
Example:

aws s3 ls

Docker/主机上用 nftables 做透明代理端口改写


场景:当容器或主机访问 xx.xx.xx.xx:5668 / 9100 时,自动改写为 yy.yy.yy.yy.yy:26880 / 26881


主机上执行(PREROUTING)

# 新建一个名为 nat 的 IPv4 表;若系统已存在同名表会报错,可用 `nft list tables` 先检查
sudo nft add table ip nat

# 在 ip nat 表下创建基础链 prerouting;用于 NAT,挂载在 prerouting hook(路由前处理进入本机的包),priority -100 是常见优先级
sudo nft add chain ip nat prerouting '{ type nat hook prerouting priority -100; }'

# 规则:当目标 IP=xx.xx.xx.xx 且 TCP 端口=5668 时,做 DNAT,把目标改写为 yy.yy.yy.yy.yy:26880
sudo nft add rule ip nat prerouting ip daddr xx.xx.xx.xx tcp dport 5668 dnat to yy.yy.yy.yy.yy:26880

# 规则:当目标 IP=xx.xx.xx.xx 且 TCP 端口=9100 时,做 DNAT,把目标改写为 yy.yy.yy.yy.yy:26881
sudo nft add rule ip nat prerouting ip daddr xx.xx.xx.xx tcp dport 9100 dnat to yy.yy.yy.yy.yy:26881

# 查看当前 prerouting 链规则,确认是否写入成功(会显示 handle 编号,可用于回滚删除)
sudo nft list chain ip nat prerouting


(可选)容器内做出站透明代理(OUTPUT)

# 仅在容器内部执行;容器需要具备 CAP_NET_ADMIN
sudo nft add table ip nat

# 在 ip nat 表下创建 output 链;用于 NAT,挂载在 output hook(处理容器自己发出的包),priority -100 常见
sudo nft add chain ip nat output '{ type nat hook output priority -100; }'

# 规则:容器内发向 xx.xx.xx.xx:5668 的连接,DNAT 到 yy.yy.yy.yy.yy:26880
sudo nft add rule ip nat output ip daddr xx.xx.xx.xx tcp dport 5668 dnat to yy.yy.yy.yy.yy:26880

# 规则:容器内发向 xx.xx.xx.xx:9100 的连接,DNAT 到 yy.yy.yy.yy.yy:26881
sudo nft add rule ip nat output ip daddr xx.xx.xx.xx tcp dport 9100 dnat to yy.yy.yy.yy.yy:26881

# 查看当前 output 链规则,确认是否写入成功
sudo nft list chain ip nat output


PREROUTING vs OUTPUT 对比表

场景使用链生效时机适用对象典型用途
主机 / 宿主机执行prerouting路由前处理进入主机的数据包外部请求、容器出网经过主机转发的流量拦截发往特定 IP:PORT 的连接并转发到代理
容器内执行output容器自己发出的数据包刚产生时容器内进程主动发起的连接在容器内部“透明代理”出站连接

PREROUTING是“从外面拦截”,不跨命名空间、不要容器权限、不依赖容器DNS;OUTPUT是“从里面改写”,容易踩权限/命名空间/DNS的坑,更容易出问题。

Two Must‑Do Keys to Make RustDesk + ZeroTier Work Reliably from Outside Your Home LAN

1) ZeroTier Managed Routes (both are required)

  • <ZT_CIDR>:(LAN): the ZeroTier overlay subnet (ensures traffic to ZeroTier members goes through the tunnel)
  • <LAN_CIDR> via <ZT_SERVER_IP>:via : route all traffic to the home LAN via the server node (so the phone can reach the home LAN hbbr/target PCs)

How to set:

  • ZeroTier Central → your Network → Routes → Add
  • Ensure the phone’s ZeroTier client is Authorized and Online

2) Quick fix for common issue
“ID does not exist”
Check:

  • ID Server:
  • Relay Server:
  • Public Key: the full content of the server’s id_ed25519.pub

Client service not started:

  • Open the RustDesk Client GUI, click “Start service” at the bottom, wait until the status shows “Ready,” then try again

How to Integrate Anthropic Models into Open WebUI


If you already have Open WebUI running properly in a Docker environment, simply follow these steps to add Anthropic models support:

  1. Open your Open WebUI in a browser (your server address) and log in with your account.
  2. Click your username at the bottom left corner to enter the Admin Panel.
  3. In the Admin Panel, select “Connections”. Change the API address to http://your server address:9099, and set the API Key to 0p3n-w3bu!.
  4. Open a new terminal (or Docker container terminal) and enter your openwebui directory.
    If you are using Docker, make sure the pipelines service is reachable by the Open WebUI container. You can run the following steps on your host machine or inside the container.
  5. Clone the pipelines project and enter the directory:
    git clone https://github.com/open-webui/pipelines && cd pipelines
  6. Install required dependencies and start the pipelines service:
    pip install -r requirements.txt
    ./start.sh
  7. In your browser, visit https://openwebui.com/f/justinrahb/anthropic.
  8. On that page, click Get, then click Open WebUI URL, and then click Import to WebUI. This will integrate the Anthropic model provider into your local Open WebUI instance.
  9. After import is successful, click the gear icon next to “Functions” to set your Anthropic API Key (you can obtain your key at https://console.anthropic.com/settings/keys).
  10. Save your settings.
  11. Restart both services/terminals if needed (for Docker, restart containers; for terminal, Ctrl+C and rerun pipelines and Open WebUI).
  12. Return to your Open WebUI home – now you can use Anthropic models with streaming capability!

Notes:

  • For Docker deployment, ensure the pipelines service’s 9099 port can be accessed from the Open WebUI container. You might need to set up port mappings or use the same Docker network.
  • If you have firewall, SELinux, or other security software, make sure to allow access to port 9099.
  • If you encounter loading or error issues, check that both the pipelines service and Open WebUI are running, and that network/ports are correctly configured.

That’s it! Now you can harness the power of Anthropic’s state-of-the-art language models right inside your local Open WebUI.


🔧 Update: Support for Claude 4.5 and New Pipelines Behavior

If you see a 403 Forbidden or Not authenticated error when connecting, set the following environment variable before starting Pipelines:

export PIPELINES_API_KEY="0p3n-w3bu!"
./start.sh

Then, in Open WebUI → Admin Panel → Connections, set the same API Key value (0p3n-w3bu!).


Anthropic API Key Now Configured Separately

After importing the anthropic_manifold_pipeline.py, go to Settings → Pipelines → anthropic_manifold_pipeline, and enter your official Anthropic API key (sk-ant-...) under Anthropic API Key.

Do not enter 0p3n-w3bu! here — that one is only for the WebUI ↔ Pipelines connection.


If Claude 4.5 Models Don’t Show Up

Edit the file:

examples/pipelines/providers/anthropic_manifold_pipeline.py

And add these lines inside the get_anthropic_models() list:

{"id": "claude-sonnet-4-5-20250929", "name": "claude-4.5-sonnet"},
{"id": "claude-haiku-4-5-20251001", "name": "claude-4.5-haiku"},

Then restart Pipelines and re-import the .py file from the WebUI.


Uploading or Installing the Pipeline

Option 1: Upload directly

Via Settings → Pipelines → “Click here to select a .py file” and choose your local anthropic_manifold_pipeline.py.

Option 2: Install from GitHub Raw URL

https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/anthropic_manifold_pipeline.py

Verify the Connection

Run:

curl -H "Authorization: Bearer 0p3n-w3bu!" http://127.0.0.1:9099/models

If it returns a JSON list of models (including claude-4.5-sonnet and claude-4.5-haiku), your Pipelines service and Open WebUI are now properly connected.


References:

Gemini CLI Installation Guide


🔧 Installation Methods

Method 1: Quick Installation with npx (Recommended)

Features: No need for global installation, ideal for temporary use

npx https://github.com/google-gemini/gemini-cli

Method 2: Global Installation

Features: Suitable for continuous use

npm install -g @google/gemini-cli

🚀 How to Start

After installation, launch Gemini CLI with the following command:

gemini

🔑 Setting Your API Key

1. Obtain Your API Key

🛠️ Steps to set up API key in GCP:

  • Log in to GCP and enable the Gemini API:
    Access: https://console.cloud.google.com/
  • Enable: search for “Generative Language API” and enable it.
  • Create API key: “APIs & Services” > “Credentials” > Create API key

2. Set the API Key Environment Variable

For Linux / macOS:

export GEMINI_API_KEY="your-api-key"

For Windows:

set GEMINI_API_KEY="your-api-key"

📚 References

Official Repository:
https://github.com/google-gemini/gemini-cli


⚠️ Notes

  • Make sure to manage permissions appropriately in production environments.
  • Always check the official documentation for the latest information.

Claude Code Installation Guide

1. System Requirements

ItemDetails
OSmacOS 10.15 or later / Ubuntu 20.04+ / Debian 10+ / Windows (WSL required)
HardwareMemory: 4GB or more
SoftwareNode.js 18 or higher
NetworkInternet connection required
ShellBash / Zsh / Fish recommended

2. For Windows Users (Installing WSL/Ubuntu)

  1. Install WSL (Windows Subsystem for Linux) and Ubuntu distribution: wsl --install After rebooting, check available distributions as needed: wsl -l -o
  2. If older versions of node/npm are present in the initial state, remove them: sudo apt remove nodejs npm

3. Installing Node.js (Recommended: nvm)

  1. Install nvm (Node Version Manager): curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
  2. source ~/.bashrc
  3. Install and use the Node.js LTS version: nvm install --lts
  4. nvm use --lts

4. Installing Claude Code

To install globally (recommended method):

npm install -g @anthropic-ai/claude-code

Note: It is not recommended to use sudo with the install command.
If you encounter permission errors, please refer to the “Configuration Guide” in the official documentation.

After installation, verify the version:

claude --version

5. Starting and Authenticating Claude Code (OAuth)

  1. Move to your project directory: cd <your-project-directory>
  2. Start Claude Code: claude
  3. On first launch, a selection screen for authentication method will appear.
    Select “2. Anthropic Console account”.
  4. Log into Console via the displayed link or screen in your browser to obtain an authentication code.
  5. Paste the authentication code into the terminal to complete registration.
    The settings will be saved and auto-authentication will occur from the next startup.

6. Manually Setting the API Key for CLI

Specifying via Environment Variable

export ANTHROPIC_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
claude

Persistent Configuration with settings.json

  1. If the .claude folder does not exist in your home directory, create it: mkdir -p ~/.claude
  2. Create or edit ~/.claude/settings.json as follows: { "env": { "ANTHROPIC_API_KEY": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } }
  • After setting this, the claude command will automatically read your API Key.

7. Checking Configuration & Troubleshooting

  • To check installation and authentication status: claude doctor
  • If you encounter permission issues or npm permission errors, please refer to the “Troubleshooting” section in the official documentation.

8. Bedrock Integration Setup

Add the same three lines to your shell startup file.
vi ~/.bashrc
Then append:
export CLAUDE_CODE_USE_BEDROCK="1"

export AWS_REGION="ap-northeast-1"

export AWS_BEARER_TOKEN_BEDROCK=""


Reload:
source ~/.bashrc

use sonnet as model:
/model sonnet

9. How to Update

Automatic Updates (Enabled by Default)

Claude Code updates itself automatically.

To disable automatic updates:

claude config set autoUpdates false --global
# Or
export DISABLE_AUTOUPDATER=1

Manual Update

claude update

10. Frequently Asked Questions & Notes

  • Most errors during installation or startup are related to permission, Node.js version, or network settings.
  • Windows users must always operate in a WSL + Linux environment.
  • For the latest information, FAQ, and support, please consult the official documentation and the official Discord, etc.

EC2 定時自動開關機實踐


1. 技術方案與原理

  • 目標: EC2 定時自動開關機,徹底自動化省錢。
  • 主要組件:
    • Lambda(自動呼叫 EC2 API)
    • EventBridge Scheduler(定時觸發 Lambda)
    • 單個 IAM 角色即可(Lambda用),權限和信任設置到位。

2. Lambda function 編寫與部署

  1. 登錄 AWS Lambda 控制台。
  2. Create function > Author from scratch
  3. 命名(建議分「EC2AutoStop」&「EC2AutoStart」)。
  4. 選 Python 3.x。
  5. 貼入以下代碼:
import boto3

def lambda_handler(event, context):
    ec2 = boto3.client('ec2', region_name='ap-northeast-3')
    ec2.stop_instances(InstanceIds=['i-xxxxxxxxxxxxxxxxx'])
    return 'EC2 stopped'

(開機則改 .stop_instances → .start_instances)

  1. ⚠️ 每次修改都必須點「Deploy」!否則Lambda實際行為不會更新。
  2. 初次建好後用測試功能(Test)驗證能正確操作EC2並產生日誌。

3. Lambda執行角色設定(包含自定義policy/inline policy與信任關係)

步驟1.建立角色與 Action Policy、Inline Policy

  1. IAM > Roles > Create role
  2. Trusted entity 選 Lambda
  3. Attach Policy: AWSLambdaBasicExecutionRole,然後Attach 自定義托管 policy
    名稱建議:AmazonEC2StopStartInstances
  • 內容如下,用於賦予 Lambda 停啟 EC2 權限:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ec2:StartInstances",
                "ec2:StopInstances"
            ],
            "Resource": "*"
        }
    ]
}
  1. Attach 另一個 inline policy
    名稱建議:InvokeSpecificLambda
  • 內容如下,授權本角色可以調用特定 Lambda function(可根據需求擴展其它 function 的 ARN):
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "lambda:InvokeFunction",
            "Resource": [
                "arn:aws:lambda:ap-northeast-3:088xx0000000:function:EC2AutoStop",
                "arn:aws:lambda:ap-northeast-3:088xx0000000:function:EC2AutoStart"
            ]
        }
    ]
}

注意替換 ARN,與你環境中的 Lambda 名稱/region/account-id 一致。

步驟2.補充信任(Trust Relationships)政策

  1. IAM > Roles > 找到你 Lambda 執行用的角色。
  2. 點 “Trust relationships” 分頁,選 “Edit trust policy”
  3. 貼入如下 JSON,允許 Lambda 和 Scheduler 兩種方式 assume 這個角色:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": [
          "lambda.amazonaws.com",
          "scheduler.amazonaws.com"
        ]
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

這裡加入 "scheduler.amazonaws.com",即可允許 EventBridge Scheduler 以這個角色調用 Lambda。

  1. 存檔,確認無誤。

4. EventBridge Scheduler 定時任務設置

  1. AWS Console > EventBridge > Schedules > Create schedule
  2. 務必與 Lambda 選同一 region
  3. 任務 Type 選「Invoke」→「AWS Lambda」。
  4. Lambda function 處選你剛剛部署的 function。
  5. Execution role 處,選 Lambda 上一步設好的執行角色(已信任並賦權)。
  6. 時間排程(cron)範例(JST 08:00 週一至週五):
   cron(0 23 ? * MON-FRI *)
  1. 完成儲存。

5. Lambda 配置最佳實踐(Timeout/Memory)

  • Timeout 設 30-60 秒(防止 Sandbox.Timedout)
  • Memory 推薦 256-512MB
  • 設置路徑:Lambda 控制台 > Configuration > General configuration > Edit
  • 設定完記得 Deploy

6. 問題診斷(CloudWatch 日誌&Scheduler Run History)

狀況核查方式與解決
Lambda test 成功但計劃不中斷檢查 Lambda 角色信任 policy 是否含 scheduler.amazonaws.com
定時沒觸發檢查 Scheduler Run history 與 Lambda CloudWatch Logs
超時Lambda Timeout 要夠長

7. 常見錯誤對應表 & 補充建議

情況對應解法
Lambda執行超時Timeout改30s↑
Scheduler無觸發LambdaLambda角色加 scheduler.amazonaws.com到trust policy
Lambda沒產生日誌執行一次自動產生log group
Lambda可Test計劃無效檢查角色信任關係和權限 policy
改了Lambda沒生效忘記點 Deploy,請務必 Deploy!
  • Action policy及信任完全在Lambda這唯一角色上設,管理簡單有效。
  • inline policy管理更易查維護,精細到臨時或特定EC2都行

How to Control Baloo File Indexer Resource Usage on KDE

If you’re using KDE on Linux with a large home directory, you might notice high disk IO, CPU usage, or unexpected swap activity. In many cases, Baloo File Indexer is the cause—especially during initial indexing. Here’s a quick guide to check, control, and optimize Baloo for a smooth KDE experience:


1. Check Baloo Status and Progress

balooctl status

Shows current state, total files indexed, and files pending for indexing.

Example output:

Indexer state: Indexing file content
Total files indexed: 178,275
Files waiting for content indexing: 355

2. Temporarily Disable Baloo

If you want to immediately stop resource consumption:

balooctl disable

To enable again:

balooctl enable

3. Exclude Unnecessary Folders from Indexing

Recommended! Only index what you really need:

  • Go to System Settings → Search → File Search
    Add folders you wish to exclude (e.g., Downloads, big backup folders, development projects).

Or edit (advanced):

nano ~/.config/baloofilerc

Add lines like:

[General]
excludeFolders[$e]=/home/youruser/Downloads /home/youruser/projects /home/youruser/big_backup

Restart Baloo for changes to take effect:

balooctl disable
balooctl enable

4. Monitor Disk Usage by Baloo

Get the actual index size:

du -sh ~/.local/share/baloo

Several GB is typical with 100k+ files. If it’s too much, use exclusion above.


5. Key Points

  • Initial indexing: Heavy IO/CPU, will finish after the first complete pass.
  • Post-indexing: Resource usage drops dramatically, only new/modified files are scanned.
  • Disabling: Safe, and can be toggled anytime. Your files remain untouched.
  • Rebooting during indexing: Safe, progress resumes automatically.
  • Clean up everything (if needed):
    balooctl purge balooctl enable
通过 WordPress.com 设计一个这样的站点
从这里开始