Linux抓包工具
$ sudo apt install ngrep
$ sudo yum install ngrep
$ sudo dnf install ngrep
ngrep port 80$ sudo apt install ngrep
$ sudo yum install ngrep
$ sudo dnf install ngrep
ngrep port 80/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found #766
GLIBCXX_3.4.20' not found
sudo find / -name "libstdc++.so.6*"
sudo cp somewhere/libstdc++.so.6.0.25 /usr/lib64/
GLIBC_2.18' not found
curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar zxf glibc-2.18.tar.gz
cd glibc-2.18/
mkdir build
cd build/
../configure --prefix=/usr
make -j2
make install
/* Golang 中的 UTF-8 与 GBK 编码转换 */ package main import ( "bytes" "fmt" "golang.org/x/text/encoding/simplifiedchinese" "golang.org/x/text/transform" "io/ioutil" ) // GBK 转 UTF-8 func GbkToUtf8(s []byte) ([]byte, error) { reader := transform.NewReader(bytes.NewReader(s), simplifiedchinese.GBK.NewDecoder()) d, e := ioutil.ReadAll(reader) if e != nil { return nil, e } return d, nil } // UTF-8 转 GBK func Utf8ToGbk(s []byte) ([]byte, error) { reader := transform.NewReader(bytes.NewReader(s), simplifiedchinese.GBK.NewEncoder()) d, e := ioutil.ReadAll(reader) if e != nil { return nil, e } return d, nil } // 编码转换测试 func main() { s := "[debug]: 编码转换测试" gbk, err := Utf8ToGbk([]byte(s)) if err != nil { fmt.Println(err) } else { fmt.Println(string(gbk)) } utf8, err := GbkToUtf8(gbk) if err != nil { fmt.Println(err) } else { fmt.Println(string(utf8)) } }
https://studygolang.com/articles/32899?fr=sidebar
http://www.zyiz.net/tech/detail-112761.html
http://127.0.0.1:6060/debug/pprof/
go tool pprof http://127.0.0.1:6060/debug/pprof/profile
go tool pprof -pdf cpu.prof