go单元测试

go单元测试 ​ 单元测试用例函数以 Test 开头,例如 TestXxx 或 Test_xxx ( Xxx 部分为任意字母数字组合,首字母大写)。函数参数必须是 *testing.T,可以使用该类

比特币原理

比特币原理 ​ 参考学习视频 区块链,就是一个又一个区块组成的链条。每一个区块中保存了一定的信息,它们按照各自产生的时间顺序连接成链条。这个链条被

认识docker

认识docker ​ 最近的三年多时间,关注容器圈的话应该会知道这么几个事情: 容器技术持续火爆 Kubernetes(k8s)成为容器编排管理的标

pprof监控

pprof监控 ​ 参考学习视频 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 28 29 30 31 package main import ( "flag" "github.com/spf13/viper" "log" "myproxyHttp/config" "myproxyHttp/httpproxy" "myproxyHttp/tcpproxy" "net/http" _ "net/http/pprof" "time" ) func main() { cconf := *flag.String("conf", "conf", "configFile path") //fmt.Println("hello

ansible简单管理命令

ansible简单管理命令 ​ 1 2 3 4 5 6 7 8 9 ansible all --list-hosts ansible all -m ping # 查看webserver 有几台 ansible websrvs --list-hosts # 查看 appserver 有几台 ansible appsrvs --list-hosts # ping 10.0 的所有主机 ansible 10.0.0.* -m ping

ansible介绍

ansible介绍 ​ ansible是新出现的自动化运维工具,基于Python开发,集合了众多运维工具(puppet、chef、func、fa

wsl和host主机网络问题

wsl和host主机网络问题 ​ 参考博客 1 New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow windows powershell 管理员执行,运行wsl内部的网络包

linux测试udp-tcp命令

linux测试udp-tcp命令 ​ tcp端口检测 1 2 3 4 telnet localhost 8080 # 输入参数 nc -l -v 8080 # 监听端口 udp测试 1 2 3 nc -vu localhost 8080 # 实际使用时可以只用-u参

syscall使用详解

syscall使用详解 ​ https://golang.hotexamples.com/zh/examples/syscall/-/Listen/golang-listen-function-examples.html 1 2 3 4 5 // Set backlog size to the maximum if err = syscall.Listen(fd, syscall.SOMAXCONN); err != nil { syscall.Close(fd) return nil, err } 参考c底层源码 1 2 3 4 5 6 7 8 SYSCALL_DEFINE2(listen, int, fd, int, backlog) { // sysctl_somaxconn 是系统变量 net.core.somaxconn 的值
T