CCTV

CCTV 买的萤石 C6TC ,有 RTSP 可以玩,萤石的接口比较丰富正好也可以搞自动化 服务器装好 ffmpeg 拍照 photo.sh 将监控 RTSP 流转成照片并按天生成文件夹 #!/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin IP=192.168.2.56 KEY=萤石密码 PHOTO_PATH=/mnt/da/CCTV/living TIME=$(date +%Y%m%d%H%M%S) DATE=$(date +%Y%m%d) SAVE_DAY=365 function photo() { if [ ! -e $PHOTO_PATH/$DATE ] && [ ! -d $PHOTO_PATH/$DATE ]; then mkdir -p $PHOTO_PATH/$DATE fi ffmpeg -i rtsp://admin:$KEY@$IP:554/h264/ch1/main/av_stream -f image2 -vframes 1 -pix_fmt yuvj420p $PHOTO_PATH/$DATE/$TIME.jpg } function del() { find $PHOTO_PATH -type d -mtime +$SAVE_DAY -exec rm -rf {} \; } case $1 in p) photo ;; d) del ;; ?...

May 6, 2023 · Kevin

KMS

KMS 搭建 建议在局域网搭建和使用,不建议放在公网 VPS,会被微软投诉导致 VPS 服务商关闭 VPS 打包 Docker 镜像 Dockerfile FROM alpine:latest as builder WORKDIR /tmp RUN apk add --no-cache git make build-base && \ git clone --branch master --single-branch https://github.com/Wind4/vlmcsd.git && \ cd vlmcsd/ && \ make FROM alpine:latest WORKDIR /tmp COPY --from=builder /tmp/vlmcsd/bin/vlmcsd /usr/bin/vlmcsd EXPOSE 1688/tcp CMD [ "/usr/bin/vlmcsd", "-D", "-d" ] 打包脚本 build.sh #!/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin docker buildx build --no-cache --platform linux/amd64,linux/arm64 -f Dockerfile -t liwei19920307/vlmcsd:latest . --push 打包命令 chmod a+x ....

May 5, 2023 · Kevin

SSH免密登录

SSH 免密登录 生成密钥 ssh-keygen -t rsa 将公钥 id_rsa.pub 复制到被登录服务器的~/.ssh/authorized_keys 文件 ssh-copy-id -p xxx root@xxx.xxx 密钥管理 新建 config touch ~/.ssh/config config 添加如下内容 Host a HostName a.liwei.host Port 1 User root IdentityFile /root/.ssh/id_rsa Host b HostName b.liwei.host Port 2 User root IdentityFile /root/.ssh/id_rsa 登录 登陆 a ssh a 登陆 b ssh b

May 5, 2023 · Kevin