使用nmap arp 快速扫描,发现局域网设备的IP地址。

命令:

nmap -sn -PR 192.168.1.0/24

结果:

nmap -sn -PR 192.168.2.0/24
Starting Nmap 7.80 ( https://nmap.org ) at 2021-06-29 08:41 CST
Nmap scan report for _gateway (192.168.2.1)
Host is up (0.00086s latency).
Nmap scan report for 192.168.2.8
Host is up (0.00054s latency).
Nmap scan report for hesy-ThinkPad-P15v-Gen-1 (192.168.2.64)
Host is up (0.000040s latency).
Nmap scan report for 192.168.2.170
Host is up (0.00087s latency).
Nmap scan report for 192.168.2.223
Host is up (0.00033s latency).
Nmap done: 256 IP addresses (5 hosts up) scanned in 2.22 seconds

扫描255台主机,一个C网段,只需要2秒多钟。

参数说明:
-sn: Ping Scan - disable port scan
-PR (ARP Ping)
最常见的Nmap使用场景之一是扫描一个以太局域网。 在大部分局域网上,特别是那些使用基于 RFC1918私有地址范围的网络,在一个给定的时间绝大部分 IP地址都是不使用的。 当Nmap试图发送一个原始IP报文如ICMP回声请求时, 操作系统必须确定对应于目标IP的硬件 地址(ARP),这样它才能把以太帧送往正确的地址。 这一般比较慢而且会有些问题,因为操作系统设计者认为一般不会在短时间内 对没有运行的机器作几百万次的ARP请求。

当进行ARP扫描时,Nmap用它优化的算法管理ARP请求。 当它收到响应时, Nmap甚至不需要担心基于IP的ping报文,既然它已经知道该主机正在运行了。 这使得ARP扫描比基于IP的扫描更快更可靠。 所以默认情况下,如果Nmap发现目标主机就在它所在的局域网上,它会进行ARP扫描。
参考链接:nmap主机发现 相关文档

安装irrlicht-1.8.4.zip 的时候,提示下面的这个错误。

Irrlicht/CIrrDeviceLinux.h:33:10: fatal error: X11/extensions/xf86vmode.h: 没有那个文件或目录
   33 | #include <X11/extensions/xf86vmode.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

解决办法:

apt-file search xf86vmode.h

libxxf86vm-dev: /usr/include/X11/extensions/xf86vmode.h

安装缺少的包:

sudo apt install libxxf86vm-dev

从github下载vcpkg源码包

git clone https://github.com/Microsoft/vcpkg.git

进入源码目录

cd vcpkg

执行./bootstrap-vcpkg.sh

./bootstrap-vcpkg.sh

编译好后,进行安装

./vcpkg integrate install

vcpkg创建软链接

sudo ln -s /home/const/vcpkg/vcpkg /usr/bin

vcpkg用法

vcpkg list

输出:

ade:x64-linux                                      0.1.1f#1         ADE Framework is a graph construction, manipulat...
angle:x64-linux                                    2020-05-15#2     A conformant OpenGL ES implementation for Window...
assimp:x64-linux                                   5.0.1#4          The Open Asset import library
brotli:x64-linux                                   1.0.9#1          a generic-purpose lossless compression algorithm...
bzip2:x64-linux                                    1.0.8#1          bzip2 is a freely available, patent free, high-q...
curl:x64-linux                                     7.74.0#7         A library for transferring data with URLs
curl[non-http]:x64-linux                                            Enables protocols beyond HTTP/HTTPS/HTTP2
curl[openssl]:x64-linux                                             SSL support (OpenSSL)
curl[ssl]:x64-linux                                                 Default SSL backend

vcpkg search 用法

vcpkg search opencv4

输出:

vcpkg search opencv4
opencv4                  4.5.2            computer vision library
opencv4[ade]                              graph api
opencv4[contrib]                          opencv_contrib module
opencv4[cuda]                             CUDA support for opencv
opencv4[dnn]                              Enable dnn module
opencv4[eigen]                            Eigen support for opencv
opencv4[ffmpeg]                           ffmpeg support for opencv
opencv4[gdcm]                             GDCM support for opencv
opencv4[halide]                           Halide support for opencv
opencv4[ipp]                              Enable Intel Integrated Performance Primitives
opencv4[jasper]                           JPEG 2000 support for opencv
opencv4[jpeg]                             JPEG support for opencv
opencv4[lapack]                           LAPACK support for opencv
opencv4[nonfree]                          allow nonfree and unredistributable libraries
opencv4[openexr]                          OpenEXR support for opencv
opencv4[opengl]                           opengl support for opencv
opencv4[openmp]                           Enable openmp support for opencv
opencv4[ovis]                             opencv_ovis module
opencv4[png]                              PNG support for opencv
opencv4[qt]                               Qt GUI support for opencv
opencv4[quirc]                            Enable QR code module
opencv4[sfm]                              opencv_sfm module
opencv4[tbb]                              Enable Intel Threading Building Blocks
opencv4[tiff]                             TIFF support for opencv
opencv4[vtk]                              vtk support for opencv
opencv4[webp]                             WebP support for opencv
opencv4[world]                            Compile to a single package support for opencv

gocv介绍
gocv是OpenCV4在Go中的绑定,使用它可以在Go里做图像处理。
Github: https:/​/github.com/hybridgroup/gocv
opencv介绍
OpenCV的全称是Open Source Computer Vision Library,是一个跨平台的计算机视觉库。OpenCV是由英特尔公司发起并参与开发,以BSD许可证授权发行。

Ubuntu/Linux安装步骤

go get -u -d gocv.io/x/gocv
cd ~/go/pkg/mod/gocv.io/x/gocv@v0.27.0

编译动态库

sudo make install

编译静态库

sudo make install BUILD_SHARED_LIBS=OFF

验证安装

go run ./cmd/version/main.go

运行结果:

gocv version: 0.27.0
opencv lib version: 4.5.2