Skip to content

Commit

Permalink
deploy: 19d43db
Browse files Browse the repository at this point in the history
  • Loading branch information
wangduanduan committed Dec 22, 2024
1 parent b313f38 commit e77e394
Show file tree
Hide file tree
Showing 54 changed files with 523 additions and 332 deletions.
2 changes: 1 addition & 1 deletion archives/index.html

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions categories/all/index.html

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion categories/all/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@
</image>
<generator>Hugo -- gohugo.io</generator>
<language>en</language>
<lastBuildDate>Tue, 17 Dec 2024 21:10:40 +0800</lastBuildDate><atom:link href="https://wdd.js.org/categories/all/index.xml" rel="self" type="application/rss+xml" />
<lastBuildDate>Sun, 22 Dec 2024 15:46:13 +0800</lastBuildDate><atom:link href="https://wdd.js.org/categories/all/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>kamailio 启动参数控制</title>
<link>https://wdd.js.org/kamailio/kamailio-cli-params/</link>
<pubDate>Sun, 22 Dec 2024 15:46:13 +0800</pubDate>

<guid>https://wdd.js.org/kamailio/kamailio-cli-params/</guid>
<description>-a mode Auto aliases mode: enable with yes or on, disable with no or off 一般都是关闭 --alias=val Add an alias, the value has to be &amp;#39;[proto:]hostname[:port]&amp;#39; (like for &amp;#39;alias&amp;#39; global parameter) 设置对外别名, 在多个对外别名时,相比于在脚本中写死, 更好的方式 是在启动时传入, alias一般都是服务的对外域名或者IP 如果km有多个对外域名,并且不同的环境都不同,这块配置就合适在脚本里写死 --atexit=val Control atexit callbacks execution from external libraries which may access destroyed shm memory causing crash on shutdown. Can be y[es] or 1 to enable atexit callbacks, n[o] or 0 to disable, default is no.</description>
</item>

<item>
<title>DDOS学习笔记</title>
<link>https://wdd.js.org/posts/2024/ddos/</link>
Expand Down
21 changes: 6 additions & 15 deletions categories/all/page/2/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<!doctype html><html lang=en dir=auto><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>all | 洞香春</title><meta name=keywords content><meta name=description content="Eddie Wang的个人博客"><meta name=author content="Eddie Wang"><link rel=canonical href=https://wdd.js.org/categories/all/><link crossorigin=anonymous href=/assets/css/stylesheet.6d3944e058d85363bbe8a792a9b5f40002bca80be859dc19c466dd8de223973e.css integrity="sha256-bTlE4FjYU2O76KeSqbX0AAK8qAvoWdwZxGbdjeIjlz4=" rel="preload stylesheet" as=style><link rel=icon href=https://wdd.js.org/cowboy.ico><link rel=icon type=image/png sizes=16x16 href=https://wdd.js.org/cowboy.ico><link rel=icon type=image/png sizes=32x32 href=https://wdd.js.org/cowboy.ico><link rel=apple-touch-icon href=https://wdd.js.org/cowboy.ico><link rel=mask-icon href=https://wdd.js.org/cowboy.ico><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><link rel=alternate type=application/rss+xml href=https://wdd.js.org/categories/all/index.xml><noscript><style>#theme-toggle,.top-link{display:none}</style></noscript><meta property="og:title" content="all"><meta property="og:description" content="Eddie Wang的个人博客"><meta property="og:type" content="website"><meta property="og:url" content="https://wdd.js.org/categories/all/"><meta property="og:image" content="https://wdd.js.org/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta property="og:site_name" content="洞香春"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://wdd.js.org/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta name=twitter:title content="all"><meta name=twitter:description content="Eddie Wang的个人博客"></head><body class=list id=top><script>localStorage.getItem("pref-theme")==="dark"&&document.body.classList.add("dark")</script><header class=header><nav class=nav><div class=logo><a href=https://wdd.js.org accesskey=h title="洞香春 (Alt + H)"><img src=https://wdd.js.org/cowboy.ico alt aria-label=logo height=35>洞香春</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)"><svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button></div></div><ul id=menu><li><a href=https://wdd.js.org/books/ title=百分之一阅读法><span>百分之一阅读法</span></a></li><li><a href=https://wdd.js.org/freeswitch/ title=FreeSWITCH><span>FreeSWITCH</span></a></li><li><a href=https://wdd.js.org/golang/ title=Golang><span>Golang</span></a></li><li><a href=https://wdd.js.org/kamailio/ title=Kamailio><span>Kamailio</span></a></li><li><a href=https://wdd.js.org/network/ title=Network><span>Network</span></a></li><li><a href=https://wdd.js.org/opensips/ title=OpenSIPS><span>OpenSIPS</span></a></li><li><a href=https://wdd.js.org/vim/ title=VIM><span>VIM</span></a></li><li><a href=https://wdd.js.org/categories/ title=分类><span>分类</span></a></li><li><a href=https://wdd.js.org/fe/ title=前端><span>前端</span></a></li><li><a href=https://wdd.js.org/search/ title=搜索><span>搜索</span></a></li><li><a href=https://wdd.js.org/tags/ title=标签><span>标签</span></a></li><li><a href=https://wdd.js.org/archives/ title=归档><span>归档</span></a></li><li><a href=https://wdd.js.org/about/ title=><span></span></a></li></ul></nav></header><main class=main><header class=page-header><div class=breadcrumbs><a href=https://wdd.js.org>Home</a>&nbsp;»&nbsp;<a href=https://wdd.js.org/categories/>Categories</a></div><h1>all</h1></header><article class="post-entry tag-entry"><header class=entry-header><h2>什么时候应该使用ts范型?</h2></header><div class=entry-content><p>我知道ts支持范型,但是因为几乎用不到,所以对于范型对我来说往往蒙上一层神秘色彩。
<!doctype html><html lang=en dir=auto><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>all | 洞香春</title><meta name=keywords content><meta name=description content="Eddie Wang的个人博客"><meta name=author content="Eddie Wang"><link rel=canonical href=https://wdd.js.org/categories/all/><link crossorigin=anonymous href=/assets/css/stylesheet.6d3944e058d85363bbe8a792a9b5f40002bca80be859dc19c466dd8de223973e.css integrity="sha256-bTlE4FjYU2O76KeSqbX0AAK8qAvoWdwZxGbdjeIjlz4=" rel="preload stylesheet" as=style><link rel=icon href=https://wdd.js.org/cowboy.ico><link rel=icon type=image/png sizes=16x16 href=https://wdd.js.org/cowboy.ico><link rel=icon type=image/png sizes=32x32 href=https://wdd.js.org/cowboy.ico><link rel=apple-touch-icon href=https://wdd.js.org/cowboy.ico><link rel=mask-icon href=https://wdd.js.org/cowboy.ico><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><link rel=alternate type=application/rss+xml href=https://wdd.js.org/categories/all/index.xml><noscript><style>#theme-toggle,.top-link{display:none}</style></noscript><meta property="og:title" content="all"><meta property="og:description" content="Eddie Wang的个人博客"><meta property="og:type" content="website"><meta property="og:url" content="https://wdd.js.org/categories/all/"><meta property="og:image" content="https://wdd.js.org/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta property="og:site_name" content="洞香春"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://wdd.js.org/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta name=twitter:title content="all"><meta name=twitter:description content="Eddie Wang的个人博客"></head><body class=list id=top><script>localStorage.getItem("pref-theme")==="dark"&&document.body.classList.add("dark")</script><header class=header><nav class=nav><div class=logo><a href=https://wdd.js.org accesskey=h title="洞香春 (Alt + H)"><img src=https://wdd.js.org/cowboy.ico alt aria-label=logo height=35>洞香春</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)"><svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button></div></div><ul id=menu><li><a href=https://wdd.js.org/books/ title=百分之一阅读法><span>百分之一阅读法</span></a></li><li><a href=https://wdd.js.org/freeswitch/ title=FreeSWITCH><span>FreeSWITCH</span></a></li><li><a href=https://wdd.js.org/golang/ title=Golang><span>Golang</span></a></li><li><a href=https://wdd.js.org/kamailio/ title=Kamailio><span>Kamailio</span></a></li><li><a href=https://wdd.js.org/network/ title=Network><span>Network</span></a></li><li><a href=https://wdd.js.org/opensips/ title=OpenSIPS><span>OpenSIPS</span></a></li><li><a href=https://wdd.js.org/vim/ title=VIM><span>VIM</span></a></li><li><a href=https://wdd.js.org/categories/ title=分类><span>分类</span></a></li><li><a href=https://wdd.js.org/fe/ title=前端><span>前端</span></a></li><li><a href=https://wdd.js.org/search/ title=搜索><span>搜索</span></a></li><li><a href=https://wdd.js.org/tags/ title=标签><span>标签</span></a></li><li><a href=https://wdd.js.org/archives/ title=归档><span>归档</span></a></li><li><a href=https://wdd.js.org/about/ title=><span></span></a></li></ul></nav></header><main class=main><header class=page-header><div class=breadcrumbs><a href=https://wdd.js.org>Home</a>&nbsp;»&nbsp;<a href=https://wdd.js.org/categories/>Categories</a></div><h1>all</h1></header><article class="post-entry tag-entry"><header class=entry-header><h2>使用Excel理解prometheus的变化率相关函数</h2></header><div class=entry-content><p>counter类型的变化率 rate, irate, increase counter类型一般是只增不减的累积值,例如系统累计的http请求数量, 累计的话单数量。
counter类型的指标变化率一般使用三个函数来计算,rate, irate, increase
指标每隔15s采样一次数据, A列是采集的指标值,B列是对应的采集时间。
demo_api_request_duration_seconds_count{instance="demo-service-0:10000",path="/api/bar",status="200",method="GET"}[1m] 序号 A B 1 294401976 1710549816.105 2 294402185 1710549831.105 3 294402393 1710549846.105 4 294402599 1710549861.105 rate是计算每秒的变化率,
rate 计算方案 (A4-A1) / (B4-B1), 这里选择了首尾两个值的差值,除以时长秒 irate 计算方案 (A4-A3) / (B4-B3) , 这里只选择里最后两个点的差值,除以时长秒 increase 计算方式 (A4-A1) / (B4-B1) * 60, 这里的60是1m, 其实increase就是rate() * windows_seconds的语法糖 guage 296164749 @1710648381.105 296165055 @1710648396.105 296165364 @1710648411.105 296165668 @1710648426.105 296165978 @1710648441.105 296166186 @1710648456.105 296166505 @1710648471.105 296166826 @1710648486.105 296167151 @1710648501....</p></div><footer class=entry-footer><span title='2024-03-16 08:38:46 +0800 CST'>2024-03-16 08:38:46</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;Eddie Wang</footer><a class=entry-link aria-label="post link to 使用Excel理解prometheus的变化率相关函数" href=https://wdd.js.org/posts/2024/learn-prom-with-excel/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>什么时候应该使用ts范型?</h2></header><div class=entry-content><p>我知道ts支持范型,但是因为几乎用不到,所以对于范型对我来说往往蒙上一层神秘色彩。
最近我才真正的体会到范型的真正威力。
下面就介绍我的使用场景。
在和后端接口交互的时候, 后端接口返回的数据都是如下的类型。
Expand Down Expand Up @@ -91,20 +95,7 @@
我发现官方给的例子中,就包括了如何配置跳换的配置。
首先说明一下,我本身就安装了coc-json coc-tsserver这两个插件,所以只需要将如下的配置写入init.vim
" GoTo code navigation nmap &lt;silent> gd &lt;Plug>(coc-definition) nmap &lt;silent> gy &lt;Plug>(coc-type-definition) nmap &lt;silent> gi &lt;Plug>(coc-implementation) nmap &lt;silent> gr &lt;Plug>(coc-references) 这样的话,在普通模式,按gy这个快捷键,就能跳转到对应的类型定义,包括某个npm包的里面的类型定义,非常好用。
亲测有效。</p></div><footer class=entry-footer><span title='2023-07-10 09:30:46 +0800 CST'>2023-07-10 09:30:46</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;Eddie Wang</footer><a class=entry-link aria-label="post link to VIM typescript 跳转到定义" href=https://wdd.js.org/vim/typescript-go-to-definition/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>安装NodeJS, N命令似乎卡住了</h2></header><div class=entry-content><p>我一般会紧跟着NodeJS官网的最新版,来更新本地的NodeJS版本。
我的系统是ubuntu 20.4, 我用tj/n这个工具来更新Node。
但是这一次,这个命令似乎卡住了。
我排查后发现,是n这个命令在访问https://nodejs.org/dist/index.tab这个地址时,卡住了。
请求超时,因为默认没有设置超时时长,所以等待了很久才显示超时的报错,表现象上看起来就是卡住了。
首先我用dig命令查了nodejs.org的dns解析,我发现是正常解析的。
然后我又用curl对nodejs官网做了一个测试,发现也是请求超时。
curl -i -m 5 https://nodejs.org curl: (28) Failed to connect to nodejs.org port 443 after 3854 ms: 连接超时 这样问题就清楚了,然后我就想起来npmirrror上应该有nodejs的镜像。 在查看n这个工具的文档时,我也发现,它是支持设置mirror的。
其中给的例子用的就是淘宝NPM
就是设置了一个环境变量。然后执行source ~/.zshrc
export N_NODE_MIRROR=https://npmmirror.com/mirrors/node 但是,我发现在命令行里用echo可以打印N_NODE_MIRROR这个变量的值,但是在安装脚本里,还是无法获取设置的这个mirror。
我想或许和我在执行sudo n lts时的sudo有关,这个.zshrc在sudo这种管理员模式下是不生效的。普通用户的环境变量也不会继承到sudo执行的环境变量里
最后,我用sudo -E n lts, 成功的从npmmirror上更新了nodejs的版本。
关于curl超时的这个问题,我也给n仓库提出了pull request, https://github.com/tj/n/pull/771</p></div><footer class=entry-footer><span title='2023-07-09 14:20:45 +0800 CST'>2023-07-09 14:20:45</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;Eddie Wang</footer><a class=entry-link aria-label="post link to 安装NodeJS, N命令似乎卡住了" href=https://wdd.js.org/posts/2023/n-stucked/></a></article><footer class=page-footer><nav class=pagination><a class=prev href=https://wdd.js.org/categories/all/>«&nbsp;Prev&nbsp;</a>
亲测有效。</p></div><footer class=entry-footer><span title='2023-07-10 09:30:46 +0800 CST'>2023-07-10 09:30:46</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;Eddie Wang</footer><a class=entry-link aria-label="post link to VIM typescript 跳转到定义" href=https://wdd.js.org/vim/typescript-go-to-definition/></a></article><footer class=page-footer><nav class=pagination><a class=prev href=https://wdd.js.org/categories/all/>«&nbsp;Prev&nbsp;</a>
<a class=next href=https://wdd.js.org/categories/all/page/3/>Next&nbsp;&nbsp;»</a></nav></footer></main><footer class=footer><span>&copy; 2024 <a href=https://wdd.js.org>洞香春</a></span>
<span>Powered by
<a href=https://gohugo.io/ rel="noopener noreferrer" target=_blank>Hugo</a> &
Expand Down
Loading

0 comments on commit e77e394

Please sign in to comment.