mipsel-openwrt-linux交叉编译libwebsockets

2023-10-31

mipsel-openwrt-linux交叉编译libwebsockets


1.下载libwebsockets

官网:https://libwebsockets.org/
GitHub源码:
git clone https://libwebsockets.org/repo/libwebsockets

2.准备条件

交叉编译完成zlib(可能不需要)和openssl,目前我还是使用的openssl,虽然它的代码被很多人诟病,但是目前资料还是较多,暂时仍选用openssl。对于交叉编译zlib和openssl在其它的总结上有说明,这里不再细说。编译安装玩成后记得其目录,后面要用。

3.编译安装libwebsockets

libwebsockets为了跨平台选择使用cmake生成makefile,所以最好先了解一下cmake,对于编译过libmysqlclient的人来说,cmake并不陌生。

解压完libwebsockets源码后,在其中创建mipsel文件夹,我们将安装交叉编译后的程序到该文件夹下。

git clone https://libwebsockets.org/repo/libwebsockets
cd libwebsockets
mkdir mipsel
cd mipsel
vim compile.sh

简单的编译脚本:

#########################################################################
# File Name: compile.sh
# Author: loon
# mail: 2453419889@qq.com
# Created Time: 2018年09月06日 星期四 09时37分51秒
#########################################################################
#!/bin/bash

cd ..
cmake \
    -DCMAKE_INSTALL_PREFIX=/home/ubuntu/work/libwebsockets/mipsel \
    -DCMAKE_C_COMPILER=mipsel-openwrt-linux-gcc-4.8.3 \
    -DCMAKE_CXX_COMPILER=mipsel-openwrt-linux-g++ \
    -DLWS_OPENSSL_INCLUDE_DIRS=/usr/local/ssl-mipsel/include  \
    -DLWS_OPENSSL_LIBRARIES="/usr/local/ssl-mipsel/lib/libssl.so;/usr/local/ssl-mipsel/lib/libcrypto.so"
    #-DZLIB_INCLUDE_DIR=/home/ubuntu/work/zlib-1.2.8/mipsel/include \
    #-DZLIB_LIBRARY=/home/ubuntu/work/zlib-1.2.8/mipsel/lib  \
make
make install

对于cmake的参数需要结合源码中的CMakeLists.txt和cmake的知识来确认,然后结合自己的交叉编译器即可。这其中由于库的不同版本肯定会遇到一些问题,这需要结合问题去解决,后面我将我遇到的一些问题进行了记录。

4.常见问题

可能出现的错误1:

-- Build files have been written to: /home/ubuntu/work/libwebsockets
[  1%] Building C object CMakeFiles/websockets.dir/lib/core/alloc.c.o
In file included from /home/ubuntu/work/libwebsockets/lib/core/private.h:134:0,
                 from /home/ubuntu/work/libwebsockets/lib/core/alloc.c:1:
/home/ubuntu/work/libwebsockets/include/libwebsockets.h:223:25: fatal error: openssl/ssl.h: No such file or directory
 #include <openssl/ssl.h>
                         ^
compilation terminated.
CMakeFiles/websockets.dir/build.make:62: recipe for target 'CMakeFiles/websockets.dir/lib/core/alloc.c.o' failed
make[2]: *** [CMakeFiles/websockets.dir/lib/core/alloc.c.o] Error 1
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/websockets.dir/all' failed
make[1]: *** [CMakeFiles/websockets.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
[  1%] Building C object CMakeFiles/websockets.dir/lib/core/alloc.c.o
In file included from /home/ubuntu/work/libwebsockets/lib/core/private.h:134:0,
                 from /home/ubuntu/work/libwebsockets/lib/core/alloc.c:1:
/home/ubuntu/work/libwebsockets/include/libwebsockets.h:223:25: fatal error: openssl/ssl.h: No such file or directory
 #include <openssl/ssl.h>
                         ^
compilation terminated.
CMakeFiles/websockets.dir/build.make:62: recipe for target 'CMakeFiles/websockets.dir/lib/core/alloc.c.o' failed
make[2]: *** [CMakeFiles/websockets.dir/lib/core/alloc.c.o] Error 1
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/websockets.dir/all' failed
make[1]: *** [CMakeFiles/websockets.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

编译时遇到这种问题可以看到是没有找到相关的openssl的头文件,可能是没有正确指明头文件位置,或者cmake中的指定openssl头文件的指令有误。

可能出现的错误2:

[ 44%] Linking C executable bin/libwebsockets-test-fuzxy
lib/libwebsockets.a(ssl.c.o): In function `lws_ssl_get_error':
ssl.c:(.text+0x270): undefined reference to `SSL_get_error'
lib/libwebsockets.a(ssl.c.o): In function `lws_ssl_elaborate_error':
ssl.c:(.text+0x444): undefined reference to `ERR_error_string_n'
ssl.c:(.text+0x44c): undefined reference to `ERR_get_error'
lib/libwebsockets.a(ssl.c.o): In function `lws_ssl_bind_passphrase':
ssl.c:(.text+0x488): undefined reference to `SSL_CTX_set_default_passwd_cb_userdata'
ssl.c:(.text+0x4a4): undefined reference to `SSL_CTX_set_default_passwd_cb'
lib/libwebsockets.a(ssl.c.o): In function `lws_context_init_ssl_library':
ssl.c:(.text+0x4d8): undefined reference to `SSL_library_init'
ssl.c:(.text+0x4e0): undefined reference to `OPENSSL_add_all_algorithms_noconf'
ssl.c:(.text+0x4e8): undefined reference to `SSL_load_error_strings'
ssl.c:(.text+0x504): undefined reference to `SSL_get_ex_new_index'
ssl.c:(.text+0x524): undefined reference to `SSL_CTX_get_ex_new_index'
lib/libwebsockets.a(ssl.c.o): In function `lws_ssl_destroy':
ssl.c:(.text+0x574): undefined reference to `SSL_CTX_free'
ssl.c:(.text+0x5a0): undefined reference to `SSL_CTX_free'
ssl.c:(.text+0x5a8): undefined reference to `ERR_remove_thread_state'
ssl.c:(.text+0x5b0): undefined reference to `SSL_COMP_free_compression_methods'
ssl.c:(.text+0x5b8): undefined reference to `ERR_free_strings'
ssl.c:(.text+0x5c0): undefined reference to `EVP_cleanup'
ssl.c:(.text+0x5d0): undefined reference to `CRYPTO_cleanup_all_ex_data'
lib/libwebsockets.a(ssl.c.o): In function `lws_ssl_capable_read':
ssl.c:(.text+0x63c): undefined reference to `SSL_read'
ssl.c:(.text+0x6dc): undefined reference to `SSL_pending'

这种情况明显是没有找到链接库,我们结合config生成时的警告来进一步确定:

WARNING: Target "cmTC_2456e" requests linking to directory "/usr/local/ssl-mipsel/lib".  Targets may link only to libraries.  CMake is dropping the item.
-- Looking for SSL_CTX_set1_param - not found
-- Looking for SSL_set_info_callback
WARNING: Target "cmTC_b8022" requests linking to directory "/usr/local/ssl-mipsel/lib".  Targets may link only to libraries.  CMake is dropping the item.
-- Looking for SSL_set_info_callback - not found
-- Looking for X509_VERIFY_PARAM_set1_host
WARNING: Target "cmTC_7f323" requests linking to directory "/usr/local/ssl-mipsel/lib".  Targets may link only to libraries.  CMake is dropping the item.
-- Looking for X509_VERIFY_PARAM_set1_host - not found
-- Looking for RSA_set0_key
WARNING: Target "cmTC_92ac5" requests linking to directory "/usr/local/ssl-mipsel/lib".  Targets may link only to libraries.  CMake is dropping the item.
-- Looking for RSA_set0_key - not found
-- Looking for X509_get_key_usage

可能前面会有类似这样的警告产生,这是由于库文件仅仅指明路径还是不够的,还需要指明具体的库文件的名字,比如libssl.so等,需要指明具体的库的名字(这算是对cmake不熟悉造成的一个比较低级的错误)。

应该是:
-DLWS_OPENSSL_LIBRARIES="/usr/local/ssl-mipsel/lib/libssl.so;/usr/local/ssl-mipsel/lib/libcrypto.so"
而不是:
-DLWS_OPENSSL_LIBRARIES=/usr/local/ssl-mipsel/lib

可能出现的错误3:

-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/work/libwebsockets/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/work/libwebsockets/CMakeFiles/CMakeError.log".
CMake Error: Unable to open check cache file for write. /home/ubuntu/work/libwebsockets/CMakeFiles/cmake.check_cache
Makefile:1937: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1

目前不是很清楚什么原因导致了cmake执行时出问题了,目前我的解决方法就是删除源码重新下载编译。

5.最终结果

编译安装结果

解决完所有问题后执行我们的脚本就会自动完成配置cmake、编译和安装过程。

...
[ 81%] Building C object CMakeFiles/websockets_shared.dir/lib/tls/openssl/openssl-client.c.o
[ 82%] Building C object CMakeFiles/websockets_shared.dir/lib/misc/sha-1.c.o
[ 83%] Building C object CMakeFiles/websockets_shared.dir/lib/plat/unix/unix-caps.c.o
[ 84%] Building C object CMakeFiles/websockets_shared.dir/lib/plat/unix/unix-fds.c.o
[ 85%] Building C object CMakeFiles/websockets_shared.dir/lib/plat/unix/unix-file.c.o
[ 86%] Building C object CMakeFiles/websockets_shared.dir/lib/plat/unix/unix-misc.c.o
[ 87%] Building C object CMakeFiles/websockets_shared.dir/lib/plat/unix/unix-init.c.o
[ 88%] Building C object CMakeFiles/websockets_shared.dir/lib/plat/unix/unix-pipe.c.o
[ 89%] Building C object CMakeFiles/websockets_shared.dir/lib/plat/unix/unix-service.c.o
[ 90%] Building C object CMakeFiles/websockets_shared.dir/lib/plat/unix/unix-sockets.c.o
[ 91%] Building C object CMakeFiles/websockets_shared.dir/lib/roles/http/server/server.c.o
[ 92%] Building C object CMakeFiles/websockets_shared.dir/lib/roles/http/server/lws-spa.c.o
[ 93%] Building C object CMakeFiles/websockets_shared.dir/lib/event-libs/poll/poll.c.o
[ 94%] Building C object CMakeFiles/websockets_shared.dir/lib/misc/lejp.c.o
[ 95%] Building C object CMakeFiles/websockets_shared.dir/lib/roles/http/server/lejp-conf.c.o
[ 96%] Linking C shared library lib/libwebsockets.so
/usr/local/ssl-mipsel/lib/libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
[ 96%] Built target websockets_shared
Scanning dependencies of target test-server-extpoll
[ 97%] Building C object CMakeFiles/test-server-extpoll.dir/test-apps/test-server.c.o
[ 98%] Linking C executable bin/libwebsockets-test-server-extpoll
/usr/local/ssl-mipsel/lib/libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
[ 98%] Built target test-server-extpoll
Scanning dependencies of target test-server
[ 99%] Building C object CMakeFiles/test-server.dir/test-apps/test-server.c.o
[100%] Linking C executable bin/libwebsockets-test-server
/usr/local/ssl-mipsel/lib/libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
[100%] Built target test-server
Install the project...
-- Install configuration: "Release"
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/lib/pkgconfig/libwebsockets.pc
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/lib/pkgconfig/libwebsockets_static.pc
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-http.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-adopt.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-network-helper.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-stats.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-service.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-sha1-base64.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-ws-state.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-purify.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-esp32.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-write.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-ring.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-logs.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-vfs.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-context-vhost.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-jwk.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-cgi.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-lejp.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-jws.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-client.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-x509.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-spa.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-ws-ext.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-protocols-plugins.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-plugin-generic-sessions.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-timeout-timer.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-misc.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-genhash.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-writeable.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-ws-close.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-genrsa.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-callbacks.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets/lws-threadpool.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/lib/libwebsockets.a
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/lws_config.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/include/lws-plugin-ssh.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/lib/libwebsockets.so.13
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/lib/libwebsockets.so
-- Set runtime path of "/home/ubuntu/work/libwebsockets/mipsel/lib/libwebsockets.so.13" to ""
-- Up-to-date: /home/ubuntu/work/libwebsockets/mipsel/include/libwebsockets.h
-- Up-to-date: /home/ubuntu/work/libwebsockets/mipsel/include/lws_config.h
-- Up-to-date: /home/ubuntu/work/libwebsockets/mipsel/include/lws-plugin-ssh.h
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/bin/libwebsockets-test-server
-- Set runtime path of "/home/ubuntu/work/libwebsockets/mipsel/bin/libwebsockets-test-server" to ""
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/bin/libwebsockets-test-fuzxy
-- Set runtime path of "/home/ubuntu/work/libwebsockets/mipsel/bin/libwebsockets-test-fuzxy" to ""
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/bin/libwebsockets-test-server-extpoll
-- Set runtime path of "/home/ubuntu/work/libwebsockets/mipsel/bin/libwebsockets-test-server-extpoll" to ""
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/bin/libwebsockets-test-lejp
-- Set runtime path of "/home/ubuntu/work/libwebsockets/mipsel/bin/libwebsockets-test-lejp" to ""
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/bin/libwebsockets-test-client
-- Set runtime path of "/home/ubuntu/work/libwebsockets/mipsel/bin/libwebsockets-test-client" to ""
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/libwebsockets-test-server.key.pem
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/libwebsockets-test-server.pem
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/favicon.ico
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/leaf.jpg
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/candide.zip
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/libwebsockets.org-logo.png
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/http2.png
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/wss-over-h2.png
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/lws-common.js
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/test.html
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/test.css
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/test.js
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/private/index.html
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/lws-ssh-test-keys
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/share/libwebsockets-test-server/lws-ssh-test-keys.pub
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/lib/cmake/libwebsockets/LibwebsocketsConfig.cmake
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/lib/cmake/libwebsockets/LibwebsocketsConfigVersion.cmake
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/lib/cmake/libwebsockets/LibwebsocketsTargets.cmake
-- Installing: /home/ubuntu/work/libwebsockets/mipsel/lib/cmake/libwebsockets/LibwebsocketsTargets-release.cmake

在开发板上的测试结果

这是根据我们配置安装后的mipsel目录下的文件目录树:

ubuntu@ubuntu-virtual-machine:~/work/libwebsockets/mipsel$ tree -a
.
├── bin
│   ├── libwebsockets-test-client
│   ├── libwebsockets-test-fuzxy
│   ├── libwebsockets-test-lejp
│   ├── libwebsockets-test-server
│   └── libwebsockets-test-server-extpoll
├── compile.sh
├── include
│   ├── libwebsockets
│   │   ├── lws-adopt.h
│   │   ├── lws-callbacks.h
│   │   ├── lws-cgi.h
│   │   ├── lws-client.h
│   │   ├── lws-context-vhost.h
│   │   ├── lws-esp32.h
│   │   ├── lws-genhash.h
│   │   ├── lws-genrsa.h
│   │   ├── lws-http.h
│   │   ├── lws-jwk.h
│   │   ├── lws-jws.h
│   │   ├── lws-lejp.h
│   │   ├── lws-logs.h
│   │   ├── lws-misc.h
│   │   ├── lws-network-helper.h
│   │   ├── lws-plugin-generic-sessions.h
│   │   ├── lws-protocols-plugins.h
│   │   ├── lws-purify.h
│   │   ├── lws-ring.h
│   │   ├── lws-service.h
│   │   ├── lws-sha1-base64.h
│   │   ├── lws-spa.h
│   │   ├── lws-stats.h
│   │   ├── lws-threadpool.h
│   │   ├── lws-timeout-timer.h
│   │   ├── lws-vfs.h
│   │   ├── lws-writeable.h
│   │   ├── lws-write.h
│   │   ├── lws-ws-close.h
│   │   ├── lws-ws-ext.h
│   │   ├── lws-ws-state.h
│   │   └── lws-x509.h
│   ├── libwebsockets.h
│   ├── lws_config.h
│   └── lws-plugin-ssh.h
├── lib
│   ├── cmake
│   │   └── libwebsockets
│   │       ├── LibwebsocketsConfig.cmake
│   │       ├── LibwebsocketsConfigVersion.cmake
│   │       ├── LibwebsocketsTargets.cmake
│   │       └── LibwebsocketsTargets-release.cmake
│   ├── libwebsockets.a
│   ├── libwebsockets.so -> libwebsockets.so.13
│   ├── libwebsockets.so.13
│   └── pkgconfig
│       ├── libwebsockets.pc
│       └── libwebsockets_static.pc
└── share
    └── libwebsockets-test-server
        ├── candide.zip
        ├── favicon.ico
        ├── http2.png
        ├── leaf.jpg
        ├── libwebsockets.org-logo.png
        ├── libwebsockets-test-server.key.pem
        ├── libwebsockets-test-server.pem
        ├── lws-common.js
        ├── lws-ssh-test-keys
        ├── lws-ssh-test-keys.pub
        ├── private
        │   └── index.html
        ├── test.css
        ├── test.html
        ├── test.js
        └── wss-over-h2.png

10 directories, 65 files

将除过编译文件的内容拷贝到网关中,我们就可以利用bin目录下的测试服务程序等先测试一下编译后的libwebsockets是否可以在我们的开发板上运行,测试通过则说明我们也可以利用该库开发我们的wss程序。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

mipsel-openwrt-linux交叉编译libwebsockets 的相关文章

随机推荐

  • 利用SpringBoot简单快速搭建WEB项目入门

    我们在WEB应用开发过程中 我们常常用到的语言是JAVA语言 作为WEB应用中的霸主级别中 的存在 却常常被嘲讽 人生苦短 我用python 是python程序员们引以为傲的格言 人们经常 将JAVA与时代新宠Python作比较 至今网上还
  • 用Python每天自动给女朋友免费发短信,谁说程序员不懂浪漫?

    前言 之前发过一篇文章 用 Python 制作的给父母天气预报提醒的小工具天气变冷了 给父母制作一个天气提醒小助手 这篇文章我同步到博客上之后 有读者在评论区留言 对于部分微信没有网页版接口 导致无法实现这个功能 这位读者建议 建议用发短信
  • Linux自动删除tomcat日志文件

    查看Linux启动的所有crontab crontab l 编辑crontab crontab e bin sh export LANG zh CN export WEB HOME webhome find dir path dir pru
  • 【渗透测试】Struts2系列漏洞

    目录 S2 001 1 漏洞原理 2 影响版本 3 验证方法 S2 005 1 漏洞原理 2 影响版本 3 验证方法 无回显 4 验证方法 有回显 S2 007 1 漏洞原理 2 影响版本 3 漏洞验证 S2 008 1 漏洞原理 2 影响
  • k8s 探针

    1 前言 Kubernetes探针 Probe 是用于检查容器运行状况的一种机制 探针可以检查容器是否正在运行 容器是否能够正常响应请求 以及容器内部的应用程序是否正常运行等 在Kubernetes中 探针可以用于确定容器的健康状态 如果容
  • CSDN账号等级提升规则

    2023最新 大家登录CSDN主要有两种需求 一是获取资源 另一种是发放资源 CSDN大约从2022年开始 不断调整等级规则 CSDN账号达到4级才能有资格上传付费资源 我搜索发现CSDN账号可能因实名的原因 没有买卖的 本文主要介绍3个内
  • 使用uni.share在IOS上分享不显示图片的问题

    问题背景 使用uni app跨平台 编译运行到ios上 发现分享图文的时候 图片无法显示 在安卓上分享正常 uni分享朋友圈api地址 uni share provider weixin scene WXSenceTimeline type
  • 寻找凸包

    问题 点集 Q 的凸包 convex hull 是一个最小的凸多边形 P Q 中的每个点或在 P 的边界上或 在 P 的内部 我们用 CH Q 表示点集 Q 的凸包 问题定义 输入 平面上的点集 Q 输出 Q 的凸包 CH Q a 请给出一
  • CreateEvent人工重置事件对象

    include
  • 基于springboot的在线考试系统

    本系统和现在有的考试系统有以下几种优势 a 和现在有的系统比较起来 本系统有科目 章节 老师 学生 班级等信息的管理 还有批阅试卷查看已批阅试卷等 传统的考试系统划分并不细 业务功能简单 b 和学校的考试系统还有外面的考试系统比较起来 本系
  • 【配置文档】配置使用CGAL库的经验分享

    诸多经验贴都建议参考CGAL官方网站的步骤一步一步配置 因为我懒得看英文所以找的都是中文博客和问答 结果走了不少弯路 这里开一篇经验贴 记录错误也方便以后的查阅 本文是基于VS2017的配置和使用 这里是CGAL的使用手册 文章目录 一 需
  • Python案例篇2-pycharm import cx_Oracle模块引发的No module named ‘custom_exceptions‘

    一 问题描述 最近在自学python 然后用到Oracle数据库 于是开始学习cx Oracle模块 代码 import cx Oracle dbConnect host cx Oracle makedsn mylocalhost mypo
  • Linux防火墙查看及白名单添加

    一 临时白名单添加 执行即生效 重启防火墙后失效 查看防火墙状态 service iptables status 查看白名单列表 sudo iptables nL 添加白名单 sudo iptables I INPUT m state st
  • Spring AOP 源码分析 - 拦截器链的执行过程

    1 简介 本篇文章是 AOP 源码分析系列文章的最后一篇文章 在前面的两篇文章中 我分别介绍了 Spring AOP 是如何为目标 bean 筛选合适的通知器 以及如何创建代理对象的过程 现在我们的得到了 bean 的代理对象 且通知也以合
  • java:无法从静态上下文中引用非静态方法

    编辑以下代码 public class t public int i public void fun public static void main String args i 3 fun 编译 javac t java 得到以下报错 原因
  • c++svd算法_2020DCIC智能算法赛智慧海洋建设TOP1方案

    大家好 我是来自团队Pursuing the Past Youth的Ethan 天池ID是GrandRookie 和队友青禹小生 wbbhcb Chauncy YAO经过2个多月的 征途 最终在本届智能算法赛部分拿到了线上Top1的成绩 下
  • 蓝桥杯第十届青少年Python组省赛试题

    ns 1 3 5 8 cnt 0 for a in ns for b in ns for c in ns if a b and a c and b c print a 100 b 10 c cnt 1 print cnt for i in
  • SpringSecurity详解

    一 Spring Security简介 Spring Security是一个功能强大且高度可定制的身份验证和访问控制框架 Spring Security致力于为Java应用程序提供身份验证和授权的能力 像所有Spring项目一样 Sprin
  • Lora无线终端工作原理及优缺点

    LoRa 数据传输终端是一种基于LoRa 扩频技术的无线数据传输终端 利用 LoRa 网络为用户提供无线数据传输功能 该产品采用高性能的工业级 LoRa 方案 以嵌入式实时操作系统为软件支撑平台 同时提供 RS232 和 RS485 或 R
  • mipsel-openwrt-linux交叉编译libwebsockets

    mipsel openwrt linux交叉编译libwebsockets mipsel openwrt linux交叉编译libwebsockets 1 下载libwebsockets 2 准备条件 3 编译安装libwebsockets