会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
qcy-blog
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
38
39
40
41
42
43
44
45
46
···
49
下一页
2023年12月5日
linux统计当前连接数并倒序排序
摘要: netstat -an | grep ESTABLISHED | awk -F " " '{print $5}'| cut -d ":" -f 1 | sort | uniq -c | sort -nr 28 127.0.0.1 4 192.168.252.128 3 192.168.252.1 1
阅读全文
posted @ 2023-12-05 14:09 朝阳1
阅读(19)
评论(0)
推荐(0)
2023年12月4日
Golang使用kcp
摘要: 安装 go get -u github.com/xtaci/kcp-go import ( "fmt" "github.com/xtaci/kcp-go" "golang.org/x/net/ipv4" "golang.org/x/net/ipv6" "net" ) // KCP 服务器 func
阅读全文
posted @ 2023-12-04 11:11 朝阳1
阅读(607)
评论(0)
推荐(0)
php8自定义扩展
摘要: 1:进入php源码目录下的ext.如 /usr/local/php-8/ext 2.生成自定义扩展的名字 php ext_skel.php --ext python 3.撰写函数原型,编辑 python.stub.php 3.1 默认是test1,test2 <?php /** @generate-
阅读全文
posted @ 2023-12-04 10:58 朝阳1
阅读(173)
评论(0)
推荐(0)
2023年12月2日
Go使用asynq
摘要: asynq是基于reids的队列,支持多种形式 消费者 package main import ( "context" "fmt" "log" "os" "os/signal" "syscall" "time" "github.com/hibiken/asynq" ) // HandleMsg 处理
阅读全文
posted @ 2023-12-02 15:01 朝阳1
阅读(129)
评论(0)
推荐(0)
Go plugin
摘要: 创建plugin_1.go&编译 package main import "fmt" func Greet(name string) { fmt.Println("Hello", name) } go build -buildmode=plugin -o xxxx.so plugin_1.go 加载
阅读全文
posted @ 2023-12-02 09:41 朝阳1
阅读(46)
评论(0)
推荐(0)
2023年11月29日
Tcp3次握手
摘要: 1. 服务器 listen 时,计算了全/半连接队列的长度,还申请了相关内存并初始化。 2. 客户端 connect 时,把本地 socket 状态设置成了 TCP_SYN_SENT,选则一个可用的端口,发出 SYN 握手请求并启动重传定时器。 3. 服务器响应 ack 时,会判断下接收队列是否满了
阅读全文
posted @ 2023-11-29 16:21 朝阳1
阅读(29)
评论(0)
推荐(0)
2023年11月24日
Linux压测支持上万连接
摘要: 参考连接 注意 hard nofile 一定要比 fs.nr_open 要小,否则可能导致用户无法登陆。 临时修改 + 永久修改 第一种:在终端直接运行 ulimit -HSn 102400 这只是在当前终端有效,退出之后,open files 又变为默认值。 第二种:在/etc/profile文件
阅读全文
posted @ 2023-11-24 14:00 朝阳1
阅读(39)
评论(0)
推荐(0)
2023年11月23日
python脚本把日志转成excel
摘要: 之前go写的,转成了python版本,日志是json格式的,按行读取 {"aid":"1111","cid":"2222","callback_url":"http:\/\/ad.toutiao.com\/track\/activate\/?callback=B.eDCQxxxxxGCB&os=0&
阅读全文
posted @ 2023-11-23 12:00 朝阳1
阅读(207)
评论(0)
推荐(0)
python编译成可执行文件
摘要: 安装 pip install pyinstaller 执行 pyinstaller --onefile xxxxx.py 会在当前文件的同级目录生成dist文件夹,可执行文件就在里面
阅读全文
posted @ 2023-11-23 11:37 朝阳1
阅读(29)
评论(0)
推荐(0)
2023年11月22日
Linux 防火墙禁止某个ip访问
摘要: iptables -A INPUT -s 192.168.1.2 -j DROP
阅读全文
posted @ 2023-11-22 16:20 朝阳1
阅读(129)
评论(0)
推荐(0)
上一页
1
···
38
39
40
41
42
43
44
45
46
···
49
下一页
公告