Postgres Locale Change in Docker

调整PG的本地语言,因为建立数据全文搜索可以用到, create new Dockerfile as blew codes: FROM postgres:15-bullseye RUN localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 ENV LANG zh_CN.utf8 support docker images list: postgres:15-bullseye postgres:14-bullseye postgres:13-bullseye

2023/05/22 May · 1 min · 29 words · SCys

不停机 - 清理 Docker 日志

不停机即可清理 Docker 的日志 # 检查占用多少空间 $ sudo sh -c 'du -sh /var/lib/docker/containers/*/*-json.log' # 全部清理 $ sudo sh -c 'truncate -s 0 /var/lib/docker/containers/*/*-json.log' # 指定某个容器清理 $ truncate -s 0 $(docker inspect --format='{{.LogPath}}' <container_name_or_id>) 来自 Stackoverflow #41091634

2022/09/19 Sep · 1 min · 35 words · SCys

搭建基于 Maddy 和 Rainloop 的邮件服务器

前期 由于 Google 收紧 Suite 的免费政策,我选择抛弃它。可市面上能够替代这么好用的产品的免费政策已经没有多少可以选择。 Yandex 360 这个不知道什么时候开始收费,注意是俄文网站,有英文可以选; Zoho 不知道是不是免费政策的问题,用户名限制在7个或以上长度的。听说还会有漏收的问题; 飞书 不知道脑袋哪里敲到,竟然选择试试国内服务。发现里面真是各种坑:如果不介意用飞书 App 倒不是不能用;每个成员必须填写手机号码;创建者只能用手机号码登录,我没有找到用邮箱来登录的方法;注册完每个成员添加后,必须收费才能使用密码正确登录,不知道用手机号码是否能正确登录;IMAP 功能要收费; 阿里云 正常收费服务,600一年; 腾讯云 正常收费服务,700一年,有个免费的标准版,连 https 都不支持; 试完这多,然后一天就没了。浪费生命! 准备 还记得12年我就部署过一套400人用的邮件服务。现在已经有更方便的组合。 软件 Docker 个人来说最简单快捷的容器; Docker Compose 同上,保持服务运行; Maddy 支持 IMAP 和 SMTP ,主要是 Go 编写; Rainloop 提供网页操作界面,基本的操作; Nginx 反代工具,可以用 Apache Http 替代 服务器推荐放在国外 Vultr 简单快捷,价格适合; Do - DigitalOcean 简单快捷,价格适合; Hetzner 欧洲服务器,价格适合。带AFF 知识点: SSL 证书申请,日常自动化 acme.sh 即可; DNS 自己有一个独立的域名,能够操作 DNS 记录,包括A,AAAA,MX,TXT,其他为了保护邮箱还有 SPF,DMARC; Linux 命令行,入门即可; 部署 1. 安装 Docker curl -fsSL https://get....

2022/05/07 May · 4 min · 788 words · SCys

NGINX DNS 的配置

NGINX DNS 配置 因为配置了更好用的 AdGuardHome ,所以放弃用 NGINX 代理 DNS TLS 流和 /dns-query。 配置 DOT Dns over TLS 的配置,用 NGINX 的流处理 stream { // 此处用的是流 upstream dot_servers { zone dot 64k; # 配置度对应的服务器 server 1.1.1.1:853 fail_timeout=10s; server 1.0.0.1:853 fail_timeout=10s; } server{ listen 853 ssl; # 一般跑在 853 上,随便改~ ssl_certificate /data/certs/<cert path>; ssl_certificate_key /data/certs/<private key path>; ssl_prefer_server_ciphers off; proxy_pass dot_servers; proxy_ssl on; } } 配置 DOH 默认跑 /dns-query 路径 直接添加到 server 下即可使用...

2022/03/29 Mar · 1 min · 102 words · SCys

Github 国内访问加速

全局替换 github.com 直接全局替换所有请求 https://github.com/ 为对应的代理域名 其中 hub.fastgit.xyz 是之前 hub.fastgit.org (被墙)的替换。 现在还能用的(2022-04)的知名代理 https://ghproxy.cn/https://github.com https://hub.fastgit.xyz/ git config --global url."https://hub.fastgit.xyz/".insteadOf https://github.com/ $HOME/.gitconfig 配置应该增加以下内容 [url "https://hub.fastgit.xyz/"] insteadOf = https://github.com/ 手动修改配置 $HOME/.gitconfig 这个方法比较通用,也可以直接修改 $HOME/.gitconfig [http "https://skia.googlesource.com"] proxy = http://localhost:8080 [https "https://skia.googlesource.com"] proxy = http://localhost:8080 [http "https://googlesource.com"] proxy = http://localhost:8080 [https "https://googlesource.com"] proxy = http://localhost:8080 [https "https://googlesource.com"] proxy = http://localhost:8080 [https "https://github.com"] proxy = http://localhost:8080 [url "https://github.com"] proxy = http://localhost:8080/ # 本地 HTTP 代理服务

2022/02/01 Feb · 1 min · 68 words · SCys