MongoDB Auth创建账号和权限

MongoDB Auth创建账号和权限

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use admin

db.createUser({
user: 'db_reader',
pwd: 'A123456',
mechanisms: ["SCRAM-SHA-1"],
roles: [{
role: "read",
db: "my-app"
}]
});

db.createUser({
user: "db_manager",
pwd: "A456789",
mechanisms: ["SCRAM-SHA-1"],
roles: ['readWriteAnyDatabase', 'dbAdminAnyDatabase', {
role: "dbAdmin",
db: 'my-app'
}, {
role: "readWrite",
db: 'my-app'
}, {
role: "dbAdmin",
db: 'my-app'
}]
});

db.createUser({
user: 'db_root',
pwd: 'A10111213',
mechanisms: ["SCRAM-SHA-1"],
roles: [{
role: "dbAdminAnyDatabase",
db: "admin"
}, {
role: "root",
db: "admin"
}]
});

OPC-DA-ALL-List-OPC-(一)-安装Matrikon OPC Simulation Server

安装OPC Server模拟器

可以在此处下载
或者去官网下载

双击下载下来的MatrikonOPCSimulation.EXE安装文件

Collecting Information

接受并Next

Complete Setup

选择Complete Setup并Next

Select the install path

安装路径为c:\Program Files\Matrikon\OPC然后Next

Create quick start icon

默认,Next

Confirm password

默认密码是MatrikonOPC然后选择Next

Ready to start

然后选择Next进行安装

最后安装完成会出现如下图示

Install finished

选择第一个和第二个Checked,其他选项Uncheck 第一个的意思是打开MatrikonOPC Configuration Panel 第二个的意思是打开Quick
Start文档(有兴趣可以看一下,英文的)

本次安装包含三部分

  • Analyzer分析器
  • Explorer浏览器
  • Simulation模拟器

260401-openclaw-cn-uninstall卸载

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 运行 OpenClaw 的内置卸载程序
openclaw-cn uninstall --all --yes
openclaw uninstall --all --yes

## npm卸载
npm uninstall -g openclaw-cn
npm uninstall -g openclaw

## 删除本地文件
rm -rf ~/.openclaw
# 如果安装过旧版本,也一并删除
rm -rf ~/.clawdbot ~/.moltbot ~/.molthub

# 清理 npm 缓存
npm cache clean --force

260310-openclaw部署和使用

必需环境

  • Node.js ≥ 22.0.0

  • npm ≥ 10.0.0(或 pnpm ≥ 8.0.0)

安装NodeJs

1

配置npm 或者 pnpm 仓库源

1
2
3
4
5
# 如果还没有安装 pnpm
npm install -g pnpm

# 安装 OpenClaw
pnpm add -g openclaw@latest

安装openclaw

1
2
3
npm install -g openclaw@latest

openclaw --version

启动配置向导

1
2
3
4
openclaw onboard --install-daemon

# 启动 Gateway 控制平面
openclaw gateway --port 18789 --verbose

在终端执行以下命令:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
openclaw onboard --install-daemon

? 选择 AI 模型供应商:
❯ MiniMax M2.5(CN) - 国内可用,中文支持好
Kimi - 月之暗面,长文本处理强
DeepSeek - 推理能力强,代码能力出色
Claude - Anthropic 出品(需国际网络)
OpenAI GPT - 经典选择(需国际网络)
Gemini - Google 出品(需国际网络)
Ollama - 本地模型,完全离线


? 输入 API Key: [粘贴你的 API Key]
✓ 正在验证 API Key...
✓ 认证成功!


? 是否现在配置 Channel(渠道)?
❯ 跳过,稍后配置

? 是否现在安装 Skills(技能)?
❯ 跳过,稍后安装

? 是否现在配置 Hooks(钩子)?
❯ 跳过,稍后配置

常用命令

管理命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 打开 Web Dashboard
openclaw dashboard

# 启动 Gateway 控制平面
openclaw gateway --port 18789 --verbose

# 查看运行状态
openclaw status

# 查看日志
openclaw logs

# 运行诊断工具
openclaw doctor

# 停止所有服务
openclaw stop

Agent 命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 与助手对话
openclaw agent --message "你好" --thinking high

# 发送消息到指定渠道
openclaw message send --to +1234567890 --message "Hello from OpenClaw"

# 列出所有 Agent
openclaw agents list

# 添加新 Agent
openclaw agents add <agent-name>

# 编辑 Agent 配置
openclaw agents edit <agent-name>

Channel 命令

1
2
3
4
5
6
7
8
9
10
11
# 列出所有渠道
openclaw channels list

# 添加新渠道
openclaw channels add

# 删除渠道
openclaw channels remove <channel-name>

# 重启渠道
openclaw channels restart <channel-name>

Skill 命令

1
2
3
4
5
6
7
8
9
10
11
# 列出已安装的技能
openclaw skills list

# 搜索技能(需要先安装 clawhub)
clawhub search <关键词>

# 安装技能
clawhub install <skill-name>

# 卸载技能
openclaw skills uninstall <skill-name>

Plugin 命令

1
2
3
4
5
6
7
8
# 列出所有插件
openclaw plugins list

# 启用插件
openclaw plugins enable <plugin-name>

# 禁用插件
openclaw plugins disable <plugin-name>

更新命令

1
2
3
4
5
6
7
# 更新到最新稳定版
openclaw update

# 切换版本通道
openclaw update --channel stable # 稳定版
openclaw update --channel beta # 测试版
openclaw update --channel dev # 开发版

部署QWen自定义大模型参数

1
2
https://dashscope.aliyuncs.com/compatible-mode/v1
qwen3.5-plus

部署deepSeek大模型

1
2
https://api.deepseek.com
deepseek-v4-flash

260309-Virtualbox主机和虚拟机之间文件夹共享及双向拷贝(Windows<->Windows, Windows<->Linux)

记录下,Virtualbox下如何实现主机和虚拟机之间文件夹共享及双向拷贝
关于双向拷贝
1.设置虚拟机为“双向”共享粘贴

有的人反应只要设置双向粘贴就可以,但是我的不行,我还需要再给虚拟机安装一下增强功能。需要启动虚拟机,安装菜单项“设备”中的最后一项。

安装完增强功能,注意要重启虚拟机,双向拷贝才被启用。

关于文件夹共享
情况一:
Host操作系统:Windows 7
Guest操作系统:Windows Server
1.首先设置共享文件夹

2.虚拟机中的菜单项中,设备 - 分配光驱 – 选择一个虚拟光盘。在弹出的对话框选择 VirtualBox 安装目录下选择
VBoxGuestAdditions.iso
3.虚拟机中的光驱,运行VBoxWindowsAdditions.exe,安装完成后,重启虚拟机中的系统,就能看到主机中的共享目录了。


情况二:
Host操作系统:Windows 7
Guest操作系统:Oracle Linux

和情况一一样先设置共享目录。
然后在Linux虚拟机上边的菜单中,设备->安装增强功能。

出现VBOXADDITIONS,然后运行此软件

可以看到共享文件夹了

挂在这个目录到Linux本地目录。
首先创建一个文件夹
mkdir /home/share
改为可读可写
cd /home/share
chmod 777 .

运行命令加载
sudo mount -t vboxsf -o uid=1000,gid=1000 Share /home/share
红色Share为VirtualBox共享目录的名字

蓝色的/home/share为刚刚创建的目标目录。

260227-Linux-pid-proc(exe & cwd & fd & cmdline)查找文件位置

sudo netstat -tulnp | grep :<端口号>

  • -t:TCP 端口
  • -u:UDP 端口
  • -l:仅显示监听套接字
  • -n:不解析服务名(直接显示端口号)
  • -p:显示进程 PID 和名称

根据 PID 查找相关文件位置

有了 PID,就可以查看该进程的详细信息:

1️⃣ 找到进程的可执行文件路径

1
ls -l /proc/<PID>/exe

示例:ls -l /proc/12345/exe 会显示指向实际可执行文件的符号链接。

2️⃣ 找到进程的当前工作目录

1
pwdx <PID>

或者:

1
readlink /proc/<PID>/cwd

3️⃣ 查看进程打开的所有文件(包括配置文件、日志文件等)

1
ls -l /proc/<PID>/fd/

这列出了该进程打开的所有文件描述符,通过符号链接可以看到实际的文件路径。

4️⃣ 查看进程的完整命令行参数(可能包含配置文件路径)

1
2
3
ps -ef | grep <PID>
# 或者
cat /proc/<PID>/cmdline | tr '\0' ' '

cmdline 文件以 \0 分隔参数,用 tr 转换为空格以便阅读。

5️⃣ 如果进程是一个服务(systemd 管理的),可以查看其单元文件

1
2
systemctl status <服务名>   # 先找到服务名
systemctl cat <服务名> # 查看服务配置文件,其中可能包含 ExecStart 等路径