2023年9月1日 Dockerfile: 通过 buildkit 支持多行语法 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/09/01/dockerfile-buildkit-here-syntax/ 今天在看 docker 文档的时候, 发现了一个新语法 Dockerfile - here documents 语法 , 即 多行语法。 在 Dockerfile 1.4 中添加。 如果你知道 cat 的 here document 语法, 就会很好理解。 1 2 3 4 cat > demo.txt <<EOF > 123 > asdb > EOF 该语法在使用时有一些限制条件 该语法只支持在 RUN 和 COPY 下使用。 需要通过 buildkit 解析语法……
阅读全文
2023年8月30日 Aliyun Cdn Api Setting 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/08/30/aliyun-cdn-api-setting/ 参考文档 Aliyun CDN 在线 API Online: https://api.aliyun.com/api/Cdn/2018-05-10/BatchSetCdnDomainConfig Aliyun CDN Document 域名配置功能函数: https://help.aliyun.com/zh/cdn/developer-reference/parameters-for-configuring-features-for-domain-names Aliyun CDN SDK: https://github.com/alibabacloud-go/cdn-20180510……
阅读全文
2023年8月29日 Opentelmetry(2): 【内部分享】 从入门到精通 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/08/29/opentelmetry-introduce-techsharing/ 01. 我们为什么需要做链路追踪 当 服务逻辑复杂、 调用链条过长 , 甚至夸多个部门协作时。 一个请求 从被接受到应答 中间过程就是个 黑盒, 如果出现不稳定的情况, 例如 响应慢, 相应错误 的时候, 排查起来效率低下, 甚至无法排查。 如果想要解……
阅读全文
2023年8月28日 Nginx: 最常见的 2 中 http to https 跳转场景 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/08/28/nginx-http-https-redirect-scenarios/ 1. Nginx 上层无代理, 用户直接访问 这种方式比较简单。 我们对 http 和 https 都具有控权。 用户是直接访问 Nginx 服务器。 所以可以直接通过在 http server 上配置到 301 跳转 到 https 服务器即可。 # http server server { listen 80; server_name _; return 301 https://$host$request_uri; } # https server server { listen 443 ssl http2; server_name www.example.com; # ... other } 通常, 我……
阅读全文
2023年8月22日 使用 Aliyun Cli 更新 CDN HTTPS 证书 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/08/22/aliyun-cli-update-cdn-https-certificate/ Aliyun API 文档 SetDomainServerCertificate - 设置域名证书 使用 aliyun cli 命令行 1 2 3 4 5 6 $ aliyun --profile my-profile \ cdn SetDomainServerCertificate \ --DomainName YOUR_CDN_DOMAIN \ --CertName Your_UPLOADED_CERT_FILE_NAME \ --CertType upload \ --ServerCertificateStatus on……
阅读全文
2023年8月22日 使用 STS 登陆 Aliyun 命令行 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/08/22/aliyun-sso-login-and-configure/ 使用 acs-sso 登陆, 获取 sts token 1 $ acs-sso login --profile my-profile 配置 aliyun configure, aliyun cli 非交互式登陆 1 2 3 4 5 6 7 $ aliyun configure set \ --profile my-profile \ --mode StsToken \ --region cn-hangzhou \ --access-key-id AccessKeyId \ --access-key-secret AccessKeySecret \ --sts-token StsToken 使用 aliyun --profile my-profile XXXX 执行命令 2. 使用 jq 提取字段, 完成自动登陆 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 #!/bin/bash……
阅读全文
2023年8月14日 Golang 接入 OpenTelemetry 完整过程和思路(附源码) - Gin Demo 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/08/14/golang-opentelemetry-notes/ 为了更方便的查看代码, 建议直接跳转到 Github 仓库: https://github.com/tangx/opentelemetry-gin-demo 使用笔记 1. 使用 Otel-Collect-Contrib 初始化 trace.Provider 这里使用 app -> collector-contrib 进行转发, 应用不直接对后端的存储。 适配性 更高。 collector-contrib 最常见的两种协议 grpc / http(s)。 传入 endpoint 地址进行初始化 Provid……
阅读全文
2023年8月5日 kubernetes集群中夺命的5秒DNS延迟 如果在 公众号 文章发现状态为 已更新, 建议点击 查看原文 查看最新内容。 状态: 未更新 原文链接: https://typonotes.com/posts/2023/08/05/k8s-dns-5s-resolv/ kubernetes集群中夺命的5秒DNS延迟 问题原因 相关文章 kubernetes集群中夺命的5秒DNS延迟 破案:Kubernetes/Docke……
阅读全文
2023年7月14日 Aliyun Rds Pgsql Permission Best Practise 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/07/14/aliyun-rds-pgsql-permission-best-practise/ 注意: 在 PgSQL 中, 用户是基于 实例 的, 权限是基于 数据表/数据库 的。 换句话说, 创建的用户是可以看见所有数据库和数据表的, 但是看不到其具体内容。 创建只读用户 0. 登陆/切换 目标数据库 直接登陆目标数据库 1 2 ## login psql -u root -d dbname ; 或者登陆后切换到目标……
阅读全文
2023年7月13日 Pgsql Stop Spliting Values in Mulitple Lines 建议点击 查看原文 查看最新内容。 原文链接: https://typonotes.com/posts/2023/07/13/pgsql-stop-spliting-values-in-mulitple-lines/ psql doesn’t split your string in multiple lines. It’s the string that contains new-line characters (ASCII 10), and psql displays them accurately. The + at the end of every line is psql’s way of telling you that the value is continued in the next line. You can use the unaligned mode (psql option -A) to get rid of the +, but the output format is less attractive then. You can get rid of the newlines in a string with 1 2 3 4 5 SELECT translate(..., E'\n', ''); # or SELECT REPLACE(..., E'\n', ''); decode will be able to handle such a string.……
阅读全文