测试环境为esp32c3 4MB flash
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x4000,
otadata, data, ota, 0xd000, 0x2000,
phy_init, data, phy, 0xf000, 0x1000,
ota_0, app, ota_0, 0x10000, 1980K,
ota_1, app, ota_1, 0x200000, 1980K,
*******************************************************************************
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,16K,
otadata,data,ota,0xd000,8K,
phy_init,data,phy,0xf000,4K,
ota_0,app,ota_0,0x10000,1980K,
ota_1,app,ota_1,0x200000,1980K,
*******************************************************************************
0x8000,位置烧录分区表
0x0,烧录bootloader
0x0: bootloader.bin
0x8000: partition-table.bin
0xd000: ota_data_initial.bin
Golang文件名命名规则
在golang源代码中,经常看到各种文件名,比如: bolt_windows.go。
下面对文件名命令规则的说明:
1、平台区分
文件名_平台。
例: file_windows.go, file_unix.go
可选为:windows, unix, posix, plan9, darwin, bsd, linux, freebsd, nacl, netbsd, openbsd, solaris, dragonfly, bsd, notbsd, android,stubs
2、测试单元
文件名test.go或者 文件名平台_test.go。
例: path_test.go, path_windows_test.go
3、版本区分(猜测)
文件名_版本号等。
例:trap_windows_1.4.go
4、CPU类型区分, 汇编用的多
文件名_(平台:可选)_CPU类型.
例:vdso_linux_amd64.go
可选:amd64, none, 386, arm, arm64, mips64, s390,mips64x,ppc64x, nonppc64x, s390x, x86,amd64p32
echo "hello" | socat - udp4-datagram:192.168.31.229:8011
tcpdump -D 获取网络适配器列表,以下是在Ubuntu上获取到的结果:
tcpdump -i <需要监控的网络适配器编号>,例如我想监控我的无线网卡wlan0,则使用tcpdump -i 2。
使用无线网卡wlan0监控IP地址为172.16.86.111上443端口的tcp协议:
tcpdump -i 2 host 172.16.86.111 and tcp port 443
如果想要显示数据包的内容,需要使用-X参数,如,我想要显示捕获的https数据包http header的内容:
tcpdump -X -i 2 host 172.16.86.111 and tcp port 443
@GetMapping("/subwayLines")
public ResponseListBase<SubwayLine> list(@RequestParam(required = false, defaultValue = "0") int page,
@RequestParam(required = false, defaultValue = "20") int size,
@RequestParam(required = false, defaultValue = "") String lineNo,
@RequestParam(required = false, defaultValue = "") String lineName) {
SubwayLine subwayLine = new SubwayLine();
ExampleMatcher em = ExampleMatcher.matching();
if(lineNo != null && !lineNo.equals("")) {
subwayLine.setLineNo(lineNo);
em = em.withMatcher("lineNo", GenericPropertyMatcher::startsWith);
}
if(lineName != null && !lineName.equals("")) {
subwayLine.setLineName(lineName);
em = em.withMatcher("lineName", GenericPropertyMatcher::startsWith);
}
Page<SubwayLine> subwayLinePage = repository.findAll(Example.of(subwayLine, em), PageRequest.of(page, size));
return new ResponseListBase<>(subwayLinePage);
}
注意事项:官方用例写法:
ExampleMatcher matcher = ExampleMatcher.matching()
.withMatcher("firstname", match -> match.endsWith())
.withMatcher("firstname", match -> match.startsWith());
自己的写法:
ExampleMatcher em = ExampleMatcher.matching();
em = exampleMatcher.withMatcher("lineNo", ExampleMatcher.GenericPropertyMatcher::startsWith);
其中重新付值是必须的,查看withMatcher代码会发现,返回一个新的对象,如果不做赋值,会导致没有配置模糊查询
第二个注意点是其中的lineNo必须和对象的名称一致,如果 line_no导致模糊查询不生效。