随笔分类 -  Go语言

1 2 3 4 5 ··· 12 下一页
摘要:// 同步转发并且比对响应结果 cd /production/www/go_replay/ ulimit -n 65000 /usr/local/bin/gor --input-raw :80 --input-raw-track-response --input-raw-bpf-filter "ho 阅读全文
posted @ 2021-08-24 11:31 ma_fighting 阅读(516) 评论(1) 推荐(0) 编辑
摘要:GOREPLAY是一个网络流量转发的应用,之前的名字叫GOR,GITHUB上的作者有介绍,更准确说应该是HTTP流量转发,作者的目标应该是WEB型应用在内网的转发,因为HTTP是一个应用广泛的协议,并且是标准的,因此从这个角度出发编写出来的转发应用能够在绝大多数的场景使用。这也会带来一定的问题,假设 阅读全文
posted @ 2020-05-29 19:01 ma_fighting 阅读(1629) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/c359719435/article/details/80300433 查看max conn: 阅读全文
posted @ 2019-11-29 19:16 ma_fighting 阅读(669) 评论(0) 推荐(0) 编辑
摘要:查看 max files: 阅读全文
posted @ 2019-11-29 19:13 ma_fighting 阅读(1407) 评论(0) 推荐(0) 编辑
摘要:1,如果一端的Socket被关闭(或主动关闭,或因为异常退出而 引起的关闭),另一端仍发送数据,发送的第一个数据包引发该异常(Connect reset by peer)。 Socket默认连接60秒,60秒之内没有进行心跳交互,即读写数据,就会自动关闭连接。 2,一端退出,但退出时并未关闭该连接, 阅读全文
posted @ 2019-11-29 19:10 ma_fighting 阅读(52437) 评论(0) 推荐(1) 编辑
摘要:https://razeencheng.com/post/simple-use-go-exec-command.html 阅读全文
posted @ 2019-11-22 14:03 ma_fighting 阅读(263) 评论(0) 推荐(0) 编辑
摘要:systemd 启动的服务, 跟系统的ulimit 没有关系. 大概的意思就是通过systemd启动的服务,不会使用ulimit中的配置,需要在systemd中或者service配置文件中定义,可以通过查看 /proc/<pid>/limits文件中的内容来确定 修改service定义,增加"Lim 阅读全文
posted @ 2019-11-22 14:01 ma_fighting 阅读(907) 评论(0) 推荐(0) 编辑
摘要:package main import ( "io" "log" "os" "time" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/moun... 阅读全文
posted @ 2019-11-12 11:18 ma_fighting 阅读(2734) 评论(1) 推荐(1) 编辑
摘要:package 测试 import ( "fmt" "github.com/magiconair/properties/assert" "net/http" "net/http/httptest" "testing" ) func TestPing(t *testing.T) { for i:=0; i<10; i++ { t.Run("sds", func(t *testing.T) { t.P 阅读全文
posted @ 2019-11-09 13:58 ma_fighting 阅读(248) 评论(0) 推荐(1) 编辑
摘要: 阅读全文
posted @ 2019-11-02 11:31 ma_fighting 阅读(288) 评论(0) 推荐(0) 编辑
摘要:apiVersion: v1 # 【必须】版本号kind: Pod # 【必选】Podmetadata: # 【必选-Object】元数据 name: String # 【必选】 Pod的名称 namespace: String # 【必选】 Pod所属的命名空间 labels: # 【List】 阅读全文
posted @ 2019-10-31 10:16 ma_fighting 阅读(10814) 评论(0) 推荐(0) 编辑
摘要:vi /var/log/syslog 查看指定服务的: 阅读全文
posted @ 2019-10-29 15:40 ma_fighting 阅读(9749) 评论(0) 推荐(0) 编辑
摘要:常用请求头: 协议头 说明 示例 状态 Accept 可接受的响应内容类型(Content-Types)。 Accept: text/plain 固定 Accept-Encoding 可接受的响应内容的编码方式。 Accept-Encoding: gzip, deflate 固定 Accept-Da 阅读全文
posted @ 2019-10-14 10:41 ma_fighting 阅读(535) 评论(0) 推荐(0) 编辑
摘要:不久前用go写了个http client,去模拟某网站(*.com)的登录操作。网站的登录逻辑:1.验证登录账号和密码;2.下发token。此token通过cookie下发;3.redirect到主页(/)。主页对token进行校验,渲染、展示页面信息。简单调用http.DefaultClient. 阅读全文
posted @ 2019-10-12 18:14 ma_fighting 阅读(1695) 评论(0) 推荐(0) 编辑
摘要:func Random(strings []string) string { for i := len(strings) - 1; i > 0; i-- { num := rand.Intn(i + 1) strings[i], strings[num] = strings[num], strings[i] } str := "" for i := 0; i < len(st... 阅读全文
posted @ 2019-09-26 14:08 ma_fighting 阅读(2282) 评论(0) 推荐(0) 编辑
摘要:简介 go module公共代理仓库,代理并缓存go模块。你可以利用该代理来避免DNS污染导致的模块拉取缓慢或失败的问题,加速你的构建 地址 https://mirrors.aliyun.com/goproxy/ 使用帮助 1.使用go1.11以上版本并开启go module机制 2.导出GOPRO 阅读全文
posted @ 2019-08-05 17:59 ma_fighting 阅读(3552) 评论(0) 推荐(0) 编辑
摘要:1 前言 有时候编译Go项目会出现GO err is shadowed during return的问题,是因为作用域导致变量重名,return时不是你预期的变量导致的。 2 样例 这里先复现问题,然后进行问题说明。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 阅读全文
posted @ 2019-08-05 10:25 ma_fighting 阅读(391) 评论(0) 推荐(0) 编辑
摘要:package main import ( "fmt" "net" "reflect" "github.com/thinkeridea/go-extend/exnet" ) func main() { ip := "192.168.1.1" n, _ := exnet.IPString2Long(ip) s, _ := exnet.Long2IPString(n) fmt.Printl... 阅读全文
posted @ 2019-07-15 17:14 ma_fighting 阅读(1313) 评论(0) 推荐(0) 编辑
摘要:package main import ( "bytes" "crypto/hmac" "crypto/sha1" "encoding/base64" "encoding/json" "fmt" "io" "io/ioutil" "mime/multipart" "net/http" "os" "... 阅读全文
posted @ 2019-06-15 13:34 ma_fighting 阅读(1579) 评论(0) 推荐(0) 编辑
摘要:this user requires mysql native password authentication 在连接mysql的url上加上?allowNativePasswords=true,这次正常了。 阅读全文
posted @ 2019-06-15 13:32 ma_fighting 阅读(2400) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 12 下一页
历史天气查
点击右上角即可分享
微信分享提示