Posts
Mar 10, 2026
常用命令
# install
curl -fsSL https://openclaw.ai/install.sh | bash
# auto start
openclaw gateway install
# ~/.config/systemd/user/openclaw-gateway.service
systemctl --user is-enabled openclaw-gateway.service
systemctl --user status openclaw-gatewa...
Oct 23, 2025
连接
psql -h 127.0.0.1 -p 5432 -U admin -d postgres
SQL
重命名表
ALTER TABLE users RENAME TO users_old;
复制表
CREATE TABLE backup_table AS
SELECT * FROM source_table;
当前时间
select now();
2025-10-23 14:05:55.051471
SELECT current_timestamp;
2025...
Sep 24, 2025
rabbitmq
# !/bin/sh
# Build
# docker build -t docker-rabbitmq:1.0 --build-arg RABBIMQ_VERSION=3.8 .
docker run --rm --name myabbitmq -d --restart=always \
-e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=123456 \
-p 127.0.0.1:436...
Sep 24, 2025
Install MongoDB
https://www.mongodb.com/resources/products/compatibilities/docker
export MONGODB_VERSION=6.0-ubi8
docker run --name mongodb -d --restart=always \
--user 1000:1000 \
-p 127.0.0.1:27017:27017 \
-v /srv/docker/mongodb/data/db:...
Sep 24, 2025
Docker
docker run -d --name kafka-broker-1 --restart=always \
-v /srv/docker/kafka/kraft-combined-logs:/tmp/kraft-combined-logs \
-p 0.0.0.0:9092:9092 \
-e KAFKA_NODE_ID=1 \
-e KAFKA_PROCESS_ROLES=broker,controller \
-e KAFKA_LISTENERS=...
Sep 24, 2025
code-server
#!/bin/sh
# This will start a code-server container and expose it at http://127.0.0.1:8080.
# It will also mount your current directory into the container as `/home/coder/project`
# and forward your UID/GID so that all file system ope...
Jul 11, 2025
安装
sudo apt install samba
开放端口
sudo ufw allow 445/tcp
配置文件:/etc/samba/smb.conf
查看运行状态
smbstatus
或者使用docker
https://github.com/dperson/samba
sudo docker run -it --name samba -m 512m -p 139:139 -p 445:445 \
-v /mnt/usb:/srv/testuser/...
May 14, 2025
扫描局域网中的所有主机
nmap -sn 192.168.2.0/24
Starting Nmap 7.93 ( https://nmap.org ) at 2025-05-14 17:35 CST
Nmap scan report for router.ctc (192.168.2.1)
Host is up (0.0024s latency).
Nmap scan report for bogon (192.168.2.2)
Host is up (0.00061s latency)...
Apr 9, 2025
添加配置文件
vi /etc/logrotate.d/cron
/var/log/cron.log {
rotate 4
monthly
compress
missingok
notifempty
}
验证配置文件是否生效
sudo logrotate /etc/logrotate.d/cronlog --debug
Mar 27, 2025
Install nvidia driver
$ sudo apt install nvidia-driver-550
$ sudo reboot
$ nvidia-smi
Wed Mar 26 10:18:27 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.144.03 Driver ...