首页
📈统计
📬留言
💘关于
更多
💞友链
📺直播
🎠壁纸
Search
1
docker部署chromium
5 阅读
2
prometheus+alertmanager告警
2 阅读
3
minio部署以及使用挂载
2 阅读
4
typecho背景透明设置
2 阅读
5
httpd文件服务器
1 阅读
🎑Linux
centos
ubuntu
deepin
debian
🎉Typecho
🎻小程序
🍕生活
🍞其他
☸k8s
🤖监控配置
登录
Search
标签搜索
shell
脚本
文档
doc
存储
typecho
chromium
lazy-balancer
Typecho
累计撰写
57
篇文章
累计收到
37
条评论
首页
栏目
🎑Linux
centos
ubuntu
deepin
debian
🎉Typecho
🎻小程序
🍕生活
🍞其他
☸k8s
🤖监控配置
页面
📈统计
📬留言
💘关于
💞友链
📺直播
🎠壁纸
搜索到
57
篇与
的结果
2026-10-27
lazy-balancer 部署
docker-compose部署cat > docker-compose.yml <<EOF services: lazy-balancer: image: v55448330/lazy-balancer-v2:latest container_name: lazy-balancer restart: unless-stopped ports: - "181:8000" # 管理面板 - "50000:80" # HTTP 流量 - "443:443" # HTTPS 流量 ulimits: nofile: soft: 1048576 hard: 1048576 volumes: - ./data:/app/data - ./certs:/app/certs - ./logs:/app/logs - ./waf:/app/waf EOF
2026年10月27日
1 阅读
0 评论
0 点赞
2026-10-21
docker部署chromium
docker部署chromiumversion: "3.7" services: chromium: image: lscr.io/linuxserver/chromium:latest container_name: chromium environment: - PUID=1000 # 改成你的用户ID,可用 id 命令查看 - PGID=1000 # 改成你的组ID - TZ=Asia/Shanghai - LC_ALL=zh_CN.UTF-8 # 中文界面 - CUSTOM_USER=admin # 登录用户名,建议设置 - PASSWORD=ssss # 登录密码,强烈建议设置 - CHROME_CLI=https://www.google.com # 可选:启动时打开的页面 volumes: - ./config:/config # 持久化浏览器配置、书签、登录状态 ports: - "3001:3001" # HTTPS 端口,日常访问用这个 shm_size: "1gb" # 共享内存,打开复杂页面时避免卡死 restart: unless-stoppeddocker-compose up -d
2026年10月21日
5 阅读
0 评论
0 点赞
2026-10-21
typecho背景透明设置
背景透明cssbody { --theme: #ff6800; --background: rgba(255, 255, 255, 0.7); color: #000000 !important; /* 强制黑色 */ } a { color: #000000 !important; } /* ===== 鼠标移动上去显示粉色加粗下划线 ===== */ a:hover { text-decoration: underline !important; text-underline-offset: 4px !important; /* 下划线距离文字稍微拉开 */ text-decoration-color: #ff69b4 !important; /* 下划线颜色改为粉色 */ text-decoration-thickness: 2px !important; /* 新增:下划线加粗为 2px */ }
2026年10月21日
2 阅读
0 评论
0 点赞
2026-05-20
v2ray部署使用
安装部署v2ray# 一键部署 bash <(curl -s -L https://raw.githubusercontent.com/xyz690/v2ray/master/go.sh) # 自定义部署 bash <(curl -s -L https://raw.githubusercontent.com/xyz690/v2ray/master/install.sh)显示一下信息代表安装成功(可直接用以下配置进行连接)(以下配置在链接时使用):---------- V2Ray 配置信息 ------------- 地址 (Address) = 207.148.27.37 端口 (Port) = 8080 用户ID (User ID / UUID) = 20be1f8e-2169-4aa1-843e-5ead4250a9f7 额外ID (Alter Id) = 0 传输协议 (Network) = kcp 伪装类型 (header type) = dtls ---------- END ------------- V2Ray 客户端使用教程: https://git.io/v2ray-client 提示: 输入 v2ray url 可生成 vmess URL 链接 / 输入 v2ray qr 可生成二维码链接 ---------- V2Ray vmess URL / V2RayNG v0.4.1+ / V2RayN v2.1+ / 仅适合部分客户端 ------------- vmess://ewoidiI6I*****g==配置文件要注意(建议直接复制安装结果中 vmess://**** 地址,直接导入,避免自己填配置出错): Network(传输协议): kcp type(伪装类型):dtls 不对的话连不上!!!相关命令v2ray info 查看 V2Ray 配置信息 v2ray config 修改 V2Ray 配置 v2ray link 生成 V2Ray 配置文件链接 v2ray infolink 生成 V2Ray 配置信息链接 v2ray qr 生成 V2Ray 配置二维码链接 v2ray ss 修改 Shadowsocks 配置 v2ray ssinfo 查看 Shadowsocks 配置信息 v2ray ssqr 生成 Shadowsocks 配置二维码链接 v2ray status 查看 V2Ray 运行状态 v2ray start 启动 V2Ray v2ray stop 停止 V2Ray v2ray restart 重启 V2Ray v2ray log 查看 V2Ray 运行日志 v2ray update 更新 V2Ray v2ray update.sh 更新 V2Ray 管理脚本 v2ray uninstall 卸载 V2Raylinux配置# 配置config.json,根据你v2ray生成的配置信息,修改下面内容 cat > config.json <<EOF { "inbounds": [ { "port": 1080, "protocol": "socks", "tag": "socks-inbound", "settings": { "auth": "noauth", "udp": true } }, { "port": 1081, "protocol": "http", "tag": "http-inbound", "settings": { "auth": "noauth" } } ], "outbounds": [ { "protocol": "vmess", "settings": { "vnext": [ { "address": "123.11.56.34", # 修改对应IP "port": 8884, # 修改对应端口 "users": [ { "id": "5da8a40b-9b70-42d9-832e-37e06b815b84", # 修改对应id "alterId": 0 } ] } ] } } ] } EOF # 安装v2ray命令 wget https://packages.emal.cc/package/softinstall/produce/v2ray/v2ray-linux-64.zip unzip v2ray-linux-64.zip mv v2ray /usr/local/sbin/ # 配置v2ray service cat > /usr/lib/systemd/system/v2ray.service <<EOF [Unit] Description=v2ray service After=network.target syslog.target Wants=network.target [Service] Type=simple #写你的frps的需要用绝对路径 ExecStartPre=/bin/sleep 2 ExecStart=/usr/local/sbin/v2ray run -config /root/config.json # 可选:添加停止命令(确保能正确终止进程) ExecStop=/bin/kill -TERM $MAINPID [Install] WantedBy=multi-user.target EOF # 启动v2ray systemctl daemon-reload && systemctl start v2ray && systemctl enable v2ray # 设置全局代理 cat > proxy.sh <<EOF proxy_on() { export http_proxy=http://127.0.0.1:1081 export https_proxy=http://127.0.0.1:1081 export HTTP_PROXY=http://127.0.0.1:1081 export HTTPS_PROXY=http://127.0.0.1:1081 export no_proxy=localhost,127.0.0.1,*.local echo "✓ 代理已开启: http://127.0.0.1:1081" } proxy_off() { unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY no_proxy echo "✓ 代理已关闭" } proxy_status() { echo "http_proxy = ${http_proxy:-未设置}" echo "https_proxy = ${https_proxy:-未设置}" echo "HTTP_PROXY = ${HTTP_PROXY:-未设置}" echo "HTTPS_PROXY = ${HTTPS_PROXY:-未设置}" echo "no_proxy = ${no_proxy:-未设置}" } EOF # 开启、关闭、查看代理 proxy_on # 开启代理 proxy_off # 关闭代理 proxy_status # 查看代理上面配置完后linux访问# 这是你可以看到机器能够访问到google了,说明代理成功了 curl https://www.google.comwindows配置#内核:下载v2ray-windows-64.zip文件 https://packages.emal.cc/package/softinstall/produce/v2ray/v2ray-windows-64.zip #客户端:下载v2rayN.zip https://packages.emal.cc/package/softinstall/produce/v2ray/v2rayN.zip 对v2ray-windows-64.zip 和 v2rayN进行解压,然后将 v2rayN 目录下所有文件复制到v2ray-windows-64解压后的目录,即两个下载好的文件需要在同一目录。 【【【点击v2rayN.exe启动】】】 注意电脑右下角 V 图标,双击图标,点右上角 服务器 ,添加[VMess]服务器。 (^▽^)(^▽^)(^▽^)(^▽^)(^▽^)(^▽^) 进行配置: 客户端的配置需要根据你的服务端进行相应的配置,因为你的服务端协议可能是vmess等。如果你的服务端配置是协议vmess,则配置如下:保存后,右键电脑右下角 V 图标测试打开浏览器,访问www.google.com,如下:Android v2ray客户端#一般手机是arm架构,我就直接给出对应客户端了,其他架构需要你去网上找设备相应的CPU架构并进行选择下载: https://packages.emal.cc/package/softinstall/produce/v2ray/v2rayNG_1.4.13_arm64-v8a.apk使用方法:(1)打开 v2rayNG APP (2)点击右上角 + 号 (3)选择 手动输入[Vmess] (4)别名随意,地址(填服务器外网IP地址),端口(你设置的V2Ray端口),用户ID,额外ID:0,加密方式:auto,其他设置默认 (5)右上角 √ 保存 (6)右下角 V图标 点击启动. (7)打开浏览器试试吧MacOS v2ray客户端:https://packages.emal.cc/package/softinstall/produce/v2ray/V2RayX.app.zipLinux内核 v2ray客户端:# Debian、Ubantu、CentOS等电脑桌面发行版(不能完全通用,可以尝试一下) https://packages.emal.cc/package/softinstall/produce/v2ray/v2rayLui-v2.1.3.zipIOS v2ray客户端:需要国外账号,推荐shadow(小火箭)rocket,quantumult(圈),kitsunebi测试打开浏览器,访问www.google.com,如下:
2026年05月20日
1 阅读
0 评论
0 点赞
2026-05-15
minio部署以及使用挂载
部署miniocat > docker-compose.yaml <<EOF #docker-compose.yaml services: minio: image: quay.io/minio/minio:latest container_name: minio restart: unless-stopped ports: - "9002:9000" # API端口 - "9001:9001" # 控制台端口 environment: MINIO_ROOT_USER: admin MINIO_ROOT_PASSWORD: Xzm7_GTD.com MINIO_DOMAIN: minio.local volumes: - ./data:/data - ./config:/root/.minio command: server /data --console-address ":9001" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] interval: 30s timeout: 20s retries: 3 EOF docker-compose up -d命令行使用# 进入容器 docker exec -it minio sh # 设置别名 mc alias set myminio http://localhost:9000 admin Xzm7_GTD.com # 创建存储桶 mc mb myminio/my-bucket # 列出存储桶 mc ls myminio将桶挂载到本地# Ubuntu/Debian sudo apt-get update sudo apt-get install -y fuse s3fs # CentOS/RHEL (需要先安装 EPEL 源) sudo yum install -y epel-release sudo yum install -y fuse s3fs # TencentOS Server yum -y install s3fs-fuse.x86_64 # 创建存储凭证的文件 echo "你的ACCESS_KEY:你的SECRET_KEY" > ~/.passwd-s3fs # ACCESS_KEY: 登录用户名,SECRET_KEY: 登录密码 # 关键步骤:设置文件权限为 600,否则 s3fs 会拒绝读取 chmod 600 ~/.passwd-s3fs # 1. 创建一个本地目录作为挂载点 mkdir -p /mnt/minio-bucket # 2. 执行挂载命令 # 请将 `你的存储桶名` 替换为实际的 bucket 名称 # 请将 `http://127.0.0.1:9000` 替换为你 MinIO 服务器的 API 地址 s3fs 你的存储桶名 /mnt/minio-bucket \ -o passwd_file=~/.passwd-s3fs \ -o url=http://127.0.0.1:9000 \ -o use_path_request_style \ -o stat_cache_expire=15 \ -o enable_noobj_cache \ -o kernel_cache \ -o max_stat_cache_size=2000 # stat_cache_expire=15 文件属性缓存过期时间(秒),到期后会重新从服务端获取 15 秒 # enable_noobj_cache 缓存“文件不存在”的查询结果,减少对服务端的无效查询 开启 # kernel_cache 利用内核页面缓存,提升重复读取的性能 开启 # max_stat_cache_size=2000 最大缓存文件属性数量,防止内存占用过高 2000 #use_path_request_style 参数对于 MinIO 是必须的,它能确保使用正确的请求格式 #你的 MinIO 服务器 API 地址(url)就是你之前部署时映射的 9000 端口 #验证挂载:挂载成功后,你可以通过 df -h 命令看到新的文件系统,或者直接 cd /mnt/minio-bucket 和 ls 来查看桶内的文件常用命令# 1. 列出所有桶(最常用) mc ls myminio/ # 2. 列出桶内文件(包括递归) mc ls myminio/uat/ mc ls myminio/uat/ --recursive # 3. 以人类可读格式显示大小 mc ls --human-readable myminio/ # 4. 显示更详细信息(包括版本ID) mc ls --verbose myminio/uat/ # 5. 只显示桶名(不显示其他信息) mc ls myminio/ | awk '{print $5}'
2026年05月15日
2 阅读
0 评论
0 点赞
2026-05-14
prometheus+alertmanager告警
部署docker-compose.yamlmkdir -p /data/docker-compose/prometheus cat > /data/docker-compose/prometheus/docker-compose.yml <<EOF networks: monitor: driver: bridge services: prometheus: image: prom/prometheus container_name: prometheus hostname: prometheus restart: always command: - '--config.file=/etc/prometheus/prometheus.yml' - '--web.enable-admin-api' - '--storage.tsdb.retention.time=7d' volumes: - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml - ./prometheus/rules.yaml:/etc/prometheus/rules/rules.yaml - /etc/localtime:/etc/localtime - ./prometheus/data:/prometheus/ ports: - "9090:9090" networks: - monitor alertmanager: image: prom/alertmanager container_name: alertmanager hostname: alertmanager restart: always volumes: - /etc/localtime:/etc/localtime - ./alertmanager/emal.tmpl:/etc/alertmanager/email.tmpl - ./alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml ports: - "9093:9093" networks: - monitor grafana: image: grafana/grafana container_name: grafana hostname: grafana restart: always volumes: - /etc/localtime:/etc/localtime - ./grafana/data:/var/lib/grafana #- ./grafana/conf/sample.ini:/usr/share/grafana/conf/sample.ini - ./grafana/conf/grafana.ini:/etc/grafana/grafana.ini ports: - "3000:3000" networks: - monitor EOF创建相关配置目录cd /data/docker-compose/prometheus mkdir alertmanager grafana prometheus创建alertmanager配置文件cat > alertmanager/emal.tmpl <<EOF <h2>@告警通知</h2> 告警程序: prometheus_alert <br> 告警级别: {{ .Labels.severity }} 级 <br> 告警类型: {{ .Labels.alertname }} <br> 故障主机: {{ .Labels.instance }} <br> 告警主题: {{ .Annotations.summary }} <br> 告警详情: {{ .Annotations.description }} <br> 触发时间: {{ .StartsAt.Local.Format "2006-01-02 15:04:05" }} <br> {{ end }}{{ end -}} {{- if gt (len .Alerts.Resolved) 0 -}}{{ range .Alerts }} <h2>@告警恢复</h2> 告警程序: prometheus_alert <br> 故障主机: {{ .Labels.instance }}<br> 故障主题: {{ .Annotations.summary }}<br> 告警详情: {{ .Annotations.description }}<br> 告警时间: {{ .StartsAt.Local.Format "2006-01-02 15:04:05" }}<br> 恢复时间: {{ .EndsAt.Local.Format "2006-01-02 15:04:05" }}<br> {{ end }}{{ end -}} {{- end }} EOF cat > alertmanager/alertmanager.yml <<EOF global: resolve_timeout: 30s smtp_smarthost: 'smtp.163.com:465' smtp_from: 'demo@163.com' # 你的邮箱 smtp_auth_username: 'demo@163.com' # 你的邮箱 smtp_auth_password: 'DCFVGYHBNJMKLOIU' # QQ邮箱授权码,需要在设置,开启SMTP服务,然后复制授权码到这里 smtp_hello: '163.com' # QQ:qq.com 163:163.com 162:162.com smtp_require_tls: false templates: - '/etc/alertmanager/email.tmpl' route: group_by: ['env','instance','type','group','job','alertname'] group_wait: 30s group_interval: 1m repeat_interval: 1h receiver: 'email' receivers: - name: 'email' email_configs: - to: 'demo@163.com' # 你的邮箱 html: '{{ template "email.to.html" . }}' send_resolved: true inhibit_rules: - source_match: severity: 'critical' target_match: severity: 'warning' equal: ['alertname', 'dev', 'instance']创建prometheus配置文件cat > prometheus/prometheus.yml <<EOF global: scrape_interval: 20s # 调整为15秒,减轻负载 evaluation_interval: 15s #scrape_timeout: 240s # 配置Alertmanager地址 alerting: alertmanagers: - static_configs: - targets: - 192.168.4.20:9093 # 保持你的IP:端口配置 rule_files: - "/etc/prometheus/rules/rules.yaml" scrape_configs: - job_name: 'prometheus' static_configs: - targets: ['192.168.4.20:9090'] labels: instance: 'prometheus-server' - job_name: 'cloud' static_configs: - targets: ['192.168.4.20:9100'] labels: instance: '192.168.4.20' EOF cat > prometheus/rules.yaml <<EOF groups: - name: server-alarm rules: - alert: "内存告警" expr: (1 - (node_memory_MemAvailable_bytes / (node_memory_MemTotal_bytes))) * 100 > 90 for: 30s labels: severity: warning annotations: summary: "{{$labels.instance}}: 检测到 高内存 使用率!" description: "{{$labels.instance}}: 内存使用率在 90% 以上" value: "{{ printf \"%.0f\" $value }}%" - alert: "CPU告警" expr: (1 - avg(irate(node_cpu_seconds_total{mode="idle"}[2m])) by(instance)) * 100 > 80 for: 30s labels: severity: warning annotations: summary: "{{$labels.instance}}: 检测到 高CPU 使用率!" description: "{{$labels.instance}}: CPU使用率在 80% 以上" value: "{{ printf \"%.0f\" $value }}%" - alert: "系统盘告警" expr: 100 - (node_filesystem_free_bytes{fstype=~"tmpfs|ext4|xfs",mountpoint=~"/"} / node_filesystem_size_bytes{fstype=~"tmpfs|ext4|xfs",mountpoint=~"/"} * 100) > 80 for: 30s labels: severity: warning annotations: summary: "{{$labels.instance}}: 检测到 高磁盘 使用率!" description: "{{$labels.instance}}: / 磁盘使用率在 80% 以上" value: "{{ printf \"%.0f\" $value }}%" - alert: "数据盘告警" expr: 100 - (node_filesystem_free_bytes{fstype=~"tmpfs|ext4|xfs",mountpoint=~"/data"} / node_filesystem_size_bytes{fstype=~"tmpfs|ext4|xfs",mountpoint=~"/data"} * 100) > 80 for: 30s labels: severity: warning annotations: summary: "{{$labels.instance}}: 检测到 高磁盘 使用率!" description: "{{$labels.instance}}: /data 磁盘使用率在 80% 以上" value: "{{ printf \"%.0f\" $value }}%" - alert: "磁盘使用率过高" expr: (1 - node_filesystem_free_bytes{fstype!="tmpfs"} / node_filesystem_size_bytes{fstype!="tmpfs"}) * 100 > 80 for: 30s labels: severity: warning annotations: summary: "{{$labels.instance}}: 磁盘使用率过高" description: "{{$labels.instance}} 挂载点 {{$labels.mountpoint}} 使用率超过80%" value: "{{ printf \"%.0f\" $value }}%" EOF部署node_exporterwget https://packages.emal.cc/package/softinstall/produce/prometheus/prometheus.tar.gz tar -zxvf prometheus.tar.gz -C /data # 创建service服务 cat > /usr/lib/systemd/system/node_exporter.service <<EOF [Service] ExecStart=/data/prometheus/node_exporter-1.9.1.linux-386/node_exporter --web.listen-address=0.0.0.0:25070 --collector.textfile.directory=/opt/node_exporter/text/ ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure [Install] WantedBy=multi-user.target [Unit] Description=node_exporter After=network.target EOF # /opt/node_exporter/text/ 这是自定义的采集,可以写脚本来获取,如下 cat > /opt/node_exporter/text/text_runner <<EOF #!/usr/bin/env bash METRIC_FILE="/opt/node_exporter/text/text.prom" # 容器总数 dockers_all=$(docker ps -aq|wc -l) # 容器运行个数 dockers_running=$(docker ps -a|awk 'NR>1{print $NF}'|wc -l) # 异常容器 dockers_Exit=$(docker ps -a|grep "Ex"|wc -l) # 可用内存 frees_status=$(free -m|awk 'NR==2{print $4}') # buff frees_buff=$(free -m|awk 'NR==2{print $6}') # frees_used frees_used=$(free -m|awk 'NR==2{print $3}') # 写入临时文件 cat > "$METRIC_FILE" << EOF # HELP dockers_all docker容器总个数 # TYPE dockers_all gauge dockers_all ${dockers_all} # HELP dockers_Exit docker容器停止个数 # TYPE dockers_Exit gauge dockers_Exit ${dockers_Exit} # HELP dockers_running docker容器运行个数 # TYPE dockers_running gauge dockers_running ${dockers_running} # HELP frees_status 可用内存 # TYPE frees_status gauge frees_status ${frees_status} # HELP frees_buff 缓存 # TYPE frees_buff gauge frees_buff ${frees_buff} # HELP frees_used 系统使用 # TYPE frees_used gauge frees_used ${frees_used} # HELP docker_exit_container 异常的容器名称 # TYPE docker_exit_container gauge EOF docker ps -a | awk '/Exited \(0\)/ { print "docker_exit_container{name=\"" $NF "\"} 1" }' >> "$METRIC_FILE" EOF # text.prom 文件就是text_runner执行后的结果部署docker-compose.yamldocker-compose up -d查询是否能够获取到数据curl http://localhost:9100/metrics | grep "dockers_running"
2026年05月14日
2 阅读
0 评论
0 点赞
1
2
...
10