如何移植ftp服务器到arm板子?
很多厂家提供的sdk,一般都不自带ftp服务器功能,
需要要发人员自己移植ftp服务器程序。
本文手把手教大家如何移植ftp server到arm板子。
环境
sdk:复旦微
Buildroot 2018.02.3
1. 解压
$ mkdir ~/vsftpd
$ cp vsftpd-3.0.2.tar.gz ~/vsftpd
$ cd ~/vsftpd $ tar xzf vsftpd-3.0.2.tar.gz
$ cd vsftpd-3.0.2/
软件包获取方法:件文末。
2. 配置工具链
修改Makefile文件:
CC = arm-linux-gnueabihf-gcc
根据自己的平台的工具链
3. 设置交叉编译环境&编译
peng@ubuntu:~/vsftpd/vsftpd-3.0.2$ make
arm-linux-gnueabihf-gcc -c main.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c utility.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c prelogin.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c ftpcmdio.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c postlogin.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c privsock.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c tunables.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c ftpdataio.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c secbuf.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c ls.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c postprivparent.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c logging.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c str.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c netstr.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c sysstr.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c strlist.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c banner.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c filestr.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c parseconf.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c secutil.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c ascii.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c oneprocess.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c twoprocess.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c privops.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c standalone.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c hash.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c tcpwrap.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c ipaddrparse.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c access.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c features.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c readwrite.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c opts.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c ssl.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c sslslave.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c ptracesandbox.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c ftppolicy.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c sysutil.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c sysdeputil.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -c seccompsandbox.c -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 -idirafter dummyinc
arm-linux-gnueabihf-gcc -o vsftpd main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o tunables.o ftpdataio.o secbuf.o ls.o postprivparent.o logging.o str.o netstr.o sysstr.o strlist.o banner.o filestr.o parseconf.o secutil.o ascii.o oneprocess.o twoprocess.o privops.o standalone.o hash.o tcpwrap.o ipaddrparse.o access.o features.o readwrite.o opts.o ssl.o sslslave.o ptracesandbox.o ftppolicy.o sysutil.o sysdeputil.o seccompsandbox.o -Wl,-s -fPIE -pie -Wl,-z,relro -Wl,-z,now `./vsf_findlibs.sh`
make 后,当前目录下会生成两个文件:vsftpd 和 vsftpd.conf,这两个文件是我们要用的。
4. 复制文件
将生成的 vsftpd 复制到目标板 /usr/sbin 目录,vsftpd.conf 复制到目标板 /etc 目录,并添加 vsftpd 为可执行:
- 复制执行文件到目标板
vsftpd拷贝到板子usr/sbin
- 添加可执行权限
chmod +x /usr/sbin/vsftpd
- 复制配置文件到目标板
vsftpd.conf 拷贝到板子/etc/
5. 配置
在目标板上创建一个本地用户ftp,并设置密码123456:
$ adduser ftp
Changing password for root
New password:
Retype password:
Password for ftpadmin changed by root
使用 vi 打开 vsftpd.conf 文件,并进行配置,如下配置可实现正常上传下载功能,(这段可以随便改)
用户:ftp
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
file_open_mode=0777
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to 6902 FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
#chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YESftp_username=ftp #登录用户
secure_chroot_dir=/mnt/ #
6. 打开vsftp
配置完之后,在目标板上打开vsftp,命令:
# /usr/sbin/vsftpd &
注意,后面还有一个 &,表示该服务放到后台运行。
7. 设置开机自启动
如果要让 vsftpd 开机启动,可以创建下面文件S70vsftpd,
然后将该文件添加到/etc/init.d/目录下。
#! /bin/shset -eDESC="vsftpd"
NAME=vsftpd
DAEMON=/usr/sbin/$NAMEcase "$1" instart)printf "Starting $DESC: "start-stop-daemon -S -b -x $NAMEecho "OK";;stop)printf "Stopping $DESC: "start-stop-daemon -K -x $NAMEecho "OK";;restart|force-reload)echo "Restarting $DESC: "$0 stopsleep 1$0 startecho "";;*)echo "Usage: $0 {start|stop|restart|force-reload}" >&2exit 1;;
esacexit 0
开启vsftpd:
/etc/init.d/S70vsftpd restart
重启vsftpd:
/etc/init.d/S70vsftpd restart
8. 客户端测试
下面以pc为例:
C:\Users\ricks>ftp
ftp> open 192.168.31.45
连接到 192.168.31.45。
220 Welcome to EC20 FTP service.
200 Always in UTF8 mode.
用户(192.168.31.45:(none)): root
331 Please specify the password.
密码:
230 Login successful.
- 显示文件列表
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
123
226 Directory send OK.
ftp: 收到 5 字节,用时 0.00秒 1.25千字节/秒。
- 下载文件
ftp> get 123
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for 123 (8 bytes).
226 Transfer complete.
ftp: 收到 8 字节,用时 0.00秒 8.00千字节/秒。
- 退出
ftp> quit
221 Goodbye.
后台回复:tools
相关文章:
如何移植ftp服务器到arm板子?
很多厂家提供的sdk,一般都不自带ftp服务器功能, 需要要发人员自己移植ftp服务器程序。 本文手把手教大家如何移植ftp server到arm板子。 环境 sdk:复旦微 Buildroot 2018.02.31. 解压 $ mkdir ~/vsftpd $ cp vsftpd-3.0.2.tar.gz ~/vs…...
牛批,吾爱出品
可能是因为从事IT的原因,我身边的大多数朋友也是从事相关工作的,而IT工作往往需要长时间对着电脑。这样就很容易眼睛疲劳。今天给大家推荐几款,希望有对有需要的小伙伴有所帮助,大家可以收藏以来哦。 CareUEyes CareUEyes是一款绿…...
基于 Android 的日程管理系统的设计与实现
标题:基于 Android 的日程管理系统的设计与实现 内容:1.摘要 基于 Android 的日程管理系统旨在帮助用户更高效地管理个人日程安排。该系统采用了 Android 平台的优势,结合了简洁的界面设计和强大的功能,为用户提供了便捷的日程管理体验。 在设计与实现过…...
Kubectl 与 Helm 详解
在 Kubernetes 生态中,kubectl 和 Helm 是两个核心工具,分别用于直接管理 Kubernetes 资源和简化应用的部署与管理。本文将深入探讨 kubectl 和 Helm 的功能、使用场景、部署与更新方式,并对比它们的优缺点。 1. Kubectl 详解 1.1 什么是 Kubectl? kubectl 是 Kubernetes…...
centos搭建docker registry镜像仓库
centos搭建docker registry镜像仓库 简介 Docker Registry是一个存储和分发Docker镜像的服务。它允许用户上传、下载和管理 Docker 镜像,为容器化应用的部署提供了便利。 拉取镜像 docker image pull registry证书配置 创建镜像仓库的镜像数据目录和证书目录&…...
Pyecharts之饼图与多饼图的应用
在数据可视化领域,饼图是一种常用的图表类型,特别适合展示数据的比例关系。Pyecharts 为我们提供了强大的饼图绘制功能,不仅可以轻松绘制各种饼图,还能对饼图的样式和数据标签进行深度定制,并且可以组合多个饼图以满足…...
51单片机入门_01_单片机(MCU)概述(使用STC89C52芯片;使用到的硬件及课程安排)
文章目录 1. 什么是单片机1.1 微型计算机的组成1.2 微型计算机的应用形态1.3 单板微型计算机1.4 单片机(MCU)1.4.1 单片机内部结构1.4.2 单片机应用系统的组成 1.5 80C51单片机系列1.5.1 STC公司的51单片机1.5.1 STC公司单片机的命名规则 2. 单片机的特点及应用领域2.1 单片机的…...
蓝桥杯LQ1044 求完数
题目描述 因子:因子也叫因数,例如3515,那么3和5是15的因子。 同时15115,那么1和15也是15的因子。 1,3,5,15 这四个因子是15的所有因子。 完数:如果一个数等于不含它本身的其他因子之…...
Django 日志配置实战指南
日志是 Django 项目中不可或缺的一部分,它帮助我们记录应用程序的运行状态、调试信息、错误信息等。通过合理配置日志,我们可以更好地监控和调试应用程序。本文将详细介绍如何在 Django 项目中实现日志文件分割、日志级别控制以及多环境日志配置,并结合最佳实践和代码示例,…...
[笔记] 极狐GitLab实例 : 手动备份步骤总结
官方备份文档 : 备份和恢复极狐GitLab 一. 要求 为了能够进行备份和恢复,请确保您系统已安装 Rsync。 如果您安装了极狐GitLab: 如果您使用 Omnibus 软件包,则无需额外操作。如果您使用源代码安装,您需要确定是否安装了 rsync。…...
php代码审计2 piwigo CMS in_array()函数漏洞
php代码审计2 piwigo CMS in_array()函数漏洞 一、目的 本次学习目的是了解in_array()函数和对项目piwigo中关于in_array()函数存在漏洞的一个审计并利用漏洞获得管理员帐号。 二、in_array函数学习 in_array() 函数搜索数组中是否存在指定的值。 in_array($search,$array…...
随机矩阵投影长度保持引理及其证明
原论文中的引理 2 \textbf{2} 2 1. \textbf{1. } 1. 引理 1 \textbf{1} 1(前提之一) 1.1. \textbf{1.1. } 1.1. 引理 1 \textbf{1} 1的内容 👉前提: X ∼ N ( 0 , σ ) X\sim{}N(0,\sigma) X∼N(0,σ)即 f ( x ) 1 2 π σ e – x 2 2 σ 2 f(x)\text{}…...
蓝桥杯真题 - 三国游戏 - 题解
题目链接:https://www.lanqiao.cn/problems/3518/learning/ 个人评价:难度 2 星(满星:5) 前置知识:贪心 整体思路 先假设魏蜀吴中的某一个势力最终获胜的情况下,如何求出事件发生的最大数量&a…...
Spring 源码学习(七)——注解后处理器-2
五 InitDestroyAnnotationBeanPostProcessor 类 1 属性 InitDestroyAnnotationBeanPostProcessor 类用于处理初始化与销毁注解;其中第一个属性为用于标识初始化方法与销毁方法注解类型的 initAnnotationType 与 destroyAnnotationType 属性、还有一个用于标识执行顺…...
即梦(Dreamina)技术浅析(一)
1.技术架构与核心组件 2.生成模型的具体实现 3.多模态融合技术 4.训练数据与模型优化 5.用户交互与创作流程 6.技术挑战与解决方案 7.未来发展方向 1. 技术架构与核心组件 即梦的技术架构可以分为以下几个核心组件: 1.1 前端用户界面(UI) 功能模块: 文字输入框:用…...
Spring MVC(二)
介绍 Cookie 与 Session Session 类似哈希表,存储了一些键值对结构,Key 就是 SessionID,Vaule 就是用户信息,客户端发起会话的时候,服务器一旦接收,就会创建会话【也就是 Session】,通过 Sessi…...
java求职学习day15
多线程 1 基本概念 1.1 程序和进程的概念 (1)程序 - 数据结构 算法,主要指存放在硬盘上的可执行文件。 (2)进程 - 主要指运行在内存中的可执行文件。 (3)目前主流的操作系统都支持多进程&a…...
Typesrcipt泛型约束详细解读
代码示例: // 如果我们直接对一个泛型参数取 length 属性, 会报错, 因为这个泛型根本就不知道它有这个属性 (() > {// 定义一个接口,用来约束将来的某个类型中必须要有length这个属性interface ILength{// 接口中有一个属性lengthlength:number}function getLen…...
[操作系统] 进程地址空间管理
虚拟地址空间的初始化 缺页中断 缺页中断的概念 缺页中断(Page Fault Interrupt) 是指当程序访问的虚拟地址在页表中不存在有效映射(即该页未加载到内存中)时,CPU 会发出一个中断信号,请求操作系统加载所…...
【fly-iot飞凡物联】(20):2025年总体规划,把物联网整套技术方案和实现并落地,完成项目开发和课程录制。
前言 fly-iot飞凡物联专栏: https://blog.csdn.net/freewebsys/category_12219758.html 1,开源项目地址进行项目开发 https://gitee.com/fly-iot/fly-iot-platform 完成项目开发,接口开发。 把相关内容总结成文档,并录制课程。…...
14-6-1C++STL的list
(一)list容器的基本概念 list容器简介: 1.list是一个双向链表容器,可高效地进行插入删除元素 2.list不可以随机存取元素,所以不支持at.(pos)函数与[ ]操作符 (二)list容器头部和尾部的操作 list对象的默…...
vue2和vue3指令
Vue 2 和 Vue 3 的指令系统非常相似,但 Vue 3 在指令方面进行了优化和扩展。以下是 Vue 2 和 Vue 3 中指令的对比: 1. 通用指令 这些指令在 Vue 2 和 Vue 3 中都可以使用,功能一致: 指令说明v-bind绑定 HTML 属性或组件 propsv-…...
求整数的和与均值(信息学奥赛一本通-1061)
【题目描述】 读入n(1≤n≤10000)个整数,求它们的和与均值。 【输入】 输入第一行是一个整数n,表示有n个整数。 第2~n1行每行包含1个整数。每个整数的绝对值均不超过10000。 【输出】 输出一行,先输出和,再输出平均值(保留到小数点…...
CodeForces 611:New Year and Domino ← 二维前缀和
【题目来源】 https://codeforces.com/contest/611/problem/C 【题目描述】 They say "years are like dominoes, tumbling one after the other". But would a year fit into a grid? I dont think so. Limak is a little polar bear who loves to play. He has r…...
【ROS2】RViz2界面类 VisualizationFrame 详解
1、简述 VisualizationFrame 继承自 QMainWindow 和 WindowManagerInterface; 窗口顶部是常规布局:菜单栏 和 工具栏 窗口中心是 RenderPanel,用来渲染3D画面 周围是dock区域,包括:DisplaysPanel、ViewsPanel、TimePanel、SelectionPanel 和 ToolPropertiesPanel Windo…...
梯度下降法 (Gradient Descent) 算法详解及案例分析
梯度下降法 (Gradient Descent) 算法详解及案例分析 目录 梯度下降法 (Gradient Descent) 算法详解及案例分析1. 引言2. 梯度下降法 (Gradient Descent) 算法原理2.1 基本概念2.2 算法步骤2.3 梯度下降法的变种3. 梯度下降法的优势与局限性3.1 优势3.2 局限性4. 案例分析4.1 案…...
【Flutter】旋转元素(Transform、RotatedBox )
这里写自定义目录标题 Transform旋转元素可以改变宽高约束的旋转 - RotatedBox Transform旋转元素 说明:Transform旋转操作改变了元素的方向,但并没有改变它的布局约束。因此,虽然视觉上元素看起来是旋转了,但它仍然遵循原始的宽…...
大数运算之C语言实现
一、 前言 在我们代码编程过程中,我们经常需要处理各种规模的数值。从日常工作中的一些简单算术在到科学研究中的复杂计算,数字无处不在。然而,当数值变的异常庞大时,就需要用到大数运算来进行实现。本文我们将介绍大数运算的基本…...
三高“高性能、高并发、高可靠”系统架构设计系列文章
目录 高并发系统的艺术:如何在流量洪峰中游刃有余 《数据密集型应用系统设计》读后感与高并发高性能实践案例 系统稳定性与高可用保障的几种思路 软件系统限流的底层原理解析 技术解决方案调研 延迟队列调研 重试调研 异步回调调研 分库分表调研 分布式事…...
Java设计模式 十八 状态模式 (State Pattern)
状态模式 (State Pattern) 状态模式是一种行为型设计模式,它允许对象在其内部状态改变时改变其行为。状态模式让一个对象在其状态改变时,其行为也随之改变,看起来就像是改变了对象的类。通过将状态的变化封装到不同的状态对象中,…...
Django创建纯净版项目并启动
1.Django的基本目录结构 2. 创建app项目 python manage.py startapp user# python manage.py 是固定的,代表python脚本,主要用于django中的项目管理 # startapp 创建app # user 你的app名字,也就是功能模块名称3.数据库 进入settings.…...
[b01lers2020]Life on Mars1
打开题目页面如下 看了旁边的链接,也没有什么注入点,是正常的科普 利用burp suite抓包,发现传参 访问一下 http://5edaec92-dd87-4fec-b0e3-501ff24d3650.node5.buuoj.cn:81/query?searchtharsis_rise 接下来进行sql注入 方法一…...
element-plus 的table section如何实现单选
如果是单选那么全新的按钮应该隐藏或者不可编辑的状态。但是我没找到改变成不可编辑的方法,只能采取隐藏 <template><!-- 注意要包一层div根元素,否则css样式可能会不生效,原因不详 --><div><el-table ref"proTab…...
利用Qt5.15.2编写Android程序时遇到的问题及解决方法
文章目录 背景1.文件读写 背景 目前我用的是Qt5.15.2来编写Qt程序,环境的配置看我这篇文章【Qt5.15.2配置Android开发环境】 项目中的一些配置的截图: 1.文件读写 假如直接用 QFileDialog::getExistingDirectory来获取路径的话,会得到类…...
奇怪的单词(快速扩张200个单词)
这是一些非常奇怪的单词: screw n.螺丝;螺丝钉 screwdriver n.起子,螺丝刀,改锥 copulation n.连接 copulate a.配合的 bonk n.撞击;猛击 v.轻击;碰撞ebony n.黑檀couple n.夫妇blonde n.金发女郎intimacy…...
three.js+WebGL踩坑经验合集(4.1):THREE.Line2的射线检测问题(注意本篇说的是Line2,同样也不是阈值方面的问题)
上篇大家消化得如何了? 笔者说过,1级编号不同的两篇博文相对独立,所以这里笔者还是先给出完整代码,哪怕跟(3)没有太大区别。 这里我们把线的粗细调成5(排除难选中的因素)ÿ…...
postgresql根据主键ID字段分批删除表数据
生产环境针对大表的处理相对比较麻烦。 方案1、直接truncate,可能会遇到系统卡主的情况,因为truncate的过程中会对表进行加锁,会导致数据不能正常的写入 方案2、创建一个同结构的表结构,rename旧表,不停业务rename表担…...
NIO 和 Netty 在 Spring Boot 中的集成与使用
Netty到底是个啥,有啥子作用 1. Netty 的本质:对 NIO 的封装 NIO 的原生问题: Java 的 NIO 提供了非阻塞 I/O 和多路复用机制,但其使用较为复杂(如 Selector、Channel、Buffer 的配置和管理)。开发者需要自…...
【AI论文】Sigma:对查询、键和值进行差分缩放,以实现高效语言模型
摘要:我们推出了Sigma,这是一个专为系统领域设计的高效大型语言模型,其独特之处在于采用了包括DiffQKV注意力机制在内的新型架构,并在我们精心收集的系统领域数据上进行了预训练。DiffQKV注意力机制通过根据查询(Q&…...
ThinkPHP 8请求处理-获取请求对象与请求上下文
【图书介绍】《ThinkPHP 8高效构建Web应用》-CSDN博客 《2025新书 ThinkPHP 8高效构建Web应用 编程与应用开发丛书 夏磊 清华大学出版社教材书籍 9787302678236 ThinkPHP 8高效构建Web应用》【摘要 书评 试读】- 京东图书 使用Composer初始化ThinkPHP 8应用_thinkphp8 compos…...
【设计模式】JAVA 策略 工厂 模式 彻底告别switch if 等
【设计模式】JAVA 策略 工厂 模式 彻底告别switch if 等 目录 【设计模式】JAVA 策略 工厂 模式 彻底告别switch if 等 优势 适用场景 项目结构 关键代码 优势 消除 switch:将分支逻辑分散到独立的策略类中。 开闭原则:新增类型只需添加新的 TypeHa…...
Pyecharts之词云图、面积图与堆叠面积图
在数据可视化的精彩世界里,我们可以运用各种各样的图表来展现数据的魅力,帮助我们更好地理解和分析数据。Pyecharts 作为一款功能强大的数据可视化工具,为我们提供了丰富的图表类型,今天我们将深入探讨词云图、面积图和堆叠面积图…...
SpringBoot3+Vue3开发学生选课管理系统
功能介绍 分三个角色登录:学生登录,老师登录,教务管理员登录,不同用户功能不同! 1.学生用户功能 选课记录,查看选课记录,退选。选课管理,进行选课。通知管理,查看通知消…...
71.在 Vue 3 中使用 OpenLayers 实现按住 Shift 拖拽、旋转和缩放效果
前言 在前端开发中,地图功能是一个常见的需求。OpenLayers 是一个强大的开源地图库,支持多种地图源和交互操作。本文将介绍如何在 Vue 3 中集成 OpenLayers,并实现按住 Shift 键拖拽、旋转和缩放地图的效果。 实现效果 按住 Shift 键&#…...
Mybatis——sql映射文件中的增删查改
映射文件内的增删查改 准备工作 准备一张数据表,用于进行数据库的相关操作。新建maven工程, 导入mysql-connector-java和mybatis依赖。新建一个实体类,类的字段要和数据表的数据对应编写接口编写mybatis主配置文件 public class User {priva…...
Git进阶笔记系列(01)Git核心架构原理 | 常用命令实战集合
读书笔记:卓越强迫症强大恐惧症,在亲子家庭、职场关系里尤其是纵向关系模型里,这两种状态很容易无缝衔接。尤其父母对子女、领导对下属,都有望子成龙、强将无弱兵的期望,然而在你的面前,他们才是永远强大的…...
立创开发板入门ESP32C3第八课 修改AI大模型接口为deepseek3接口
#原代码用的AI模型是minimax的API接口,现在试着改成最热门的deepseek3接口。# 首先按理解所得,在main文件夹下,有minimax.c和minimax.h, 它们是这个API接口的头文件和实现文件,然后在main.c中被调用。所以我们一步步更改。 申请…...
【云安全】云原生-Docker(五)容器逃逸之漏洞利用
漏洞利用逃逸 通过漏洞利用实现逃逸,主要分为以下两种方式: 1、操作系统层面的内核漏洞 这是利用宿主机操作系统内核中的安全漏洞,直接突破容器的隔离机制,获得宿主机的权限。 攻击原理:容器本质上是通过 Linux 的…...
为什么IDEA提示不推荐@Autowired❓️如果使用@Resource呢❓️
前言 在使用 Spring 框架时,依赖注入(DI)是一个非常重要的概念。通过注解,我们可以方便地将类的实例注入到其他类中,提升开发效率。Autowired又是被大家最为熟知的方式,但很多开发者在使用 IntelliJ IDEA …...
PHP:动态网站开发的强大引擎
在互联网技术日新月异的今天,PHP(Hypertext Preprocessor,超文本预处理器)作为一种开源的服务器端脚本语言,凭借其灵活性和易用性,依然是构建动态网站和Web应用程序的首选之一。从简单的个人博客到复杂的企…...