Golang备忘录

1
go env -w GOPROXY=https://goproxy.cn

To debug in VSCode, write .vscode/launch.json

1
2
3
4
5
6
7
8
9
10
11
12
13
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "program": "${workspaceFolder}/main.go",
            "args": ["-h", "192.168.11.128", "-user", "test", "-pwd", "123123", "-p", "1-65535"]
       }
    ]
}

refer to: https://blog.csdn.net/qq_22211217/article/details/101854419

cannot find -lbz2

ubuntu下编译源码出现错误

1
/usr/bin/ld: cannot find -lbz2

解决办法

1
apt-get install libbz2-dev

wireshark过滤数据包的第一个INT

比如,tcp连接,往往包头第一个INT或第二个INT表示包的类型,可以用wireshark过滤显示指定类型的数据包,比如过滤包头第一个INT对应整型值为10的包的过滤表达式为

1
ip.addr == 192.168.1.21 && tcp.port == 7222 && frame[54:4]==0a:00:00:00

附:tcpdump抓包

1
tcpdump -i eth0 -w file.cap host 192.168.168.18 and tcp port 8081

refer to:
https://blog.csdn.net/qq_19167629/article/details/83088878