当前位置: 首页 > news >正文

Linux Shell 实现一键部署tomcat10+java13

        

tomcat 前言

Tomcat 服务器是一个免费的开放源代码的Web 应用服务器,属于轻量级应用服务器,在中小型系统和并发访问用户不是很多的场合下被普遍使用,是开发和调试JSP 程序的首选。对于一个初学者来说,可以这样认为,当在一台机器上配置好Apache 服务器,可利用它响应HTML(标准通用标记语言下的一个应用)页面的访问请求。实际上Tomcat是Apache 服务器的扩展,但运行时它是独立运行的,所以当你运行tomcat 时,它实际上作为一个与Apache 独立的进程单独运行的。

java 前言

Java具有大部分编程语言所共有的一些特征,被特意设计用于互联网的分布式环境。Java具有类似于C++语言的形式和感觉,但它要比C++语言更易于使用,而且在编程时彻底采用了一种以对象为导向的方式。

tomcat + java下载

tomcat下载java 下载
downloaddownload

Linux 各系统下载使用参考

Red HatRocky Linux Oracle Linux

AlmaLinux 

ubuntususelinuxesxiRHEL标准安装系统安装参考YUM参考

MobaXterm 远程连接工具

Red Hat Enterprise 9.0 文档Kickstart 生成器
downloaddownloaddownloaddownloaddownloaddownloaddownload参考参考配置参考download参考Kickstart 
版本兼容性

安装 tomcat+java

  • 创建安装自动化脚本

  • 实现在线下载tomcat,java,解压安装tomcat,java,环境变量设置,端口更改8082,开启(Server Status ,Manager App,Host Manager 用户名密码admin/admin)删除软件包,企业微信机器人通知
  • 以下基于Redhat系统
  • tomcat 安装位置 /opt/tomcat
  • java 安装位置/opt/jdk
  • Redhat 9 functions使用需要执行安装yum install initscripts -y 
  • curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=XXXXX' #更改自己的企业微信机器人地址 
  • curl -o /etc/yum.repos.d/redhat.repo http://mirrors.aliyun.com/repo/Centos-8.repo #阿里在线repo
  • yum install figlet -y #用于将文字转换为放大艺术字(使用figlet Mysql显示)
vim /tomcat_java_install.sh
#!/bin/sh
# -*- coding: utf-8 -*-
# Author: CIASM 
# Date: 2023/04/02<<!
████████╗ ██████╗ ███╗   ███╗ ██████╗ █████╗ ████████╗
╚══██╔══╝██╔═══██╗████╗ ████║██╔════╝██╔══██╗╚══██╔══╝██║   ██║   ██║██╔████╔██║██║     ███████║   ██║   ██║   ██║   ██║██║╚██╔╝██║██║     ██╔══██║   ██║   ██║   ╚██████╔╝██║ ╚═╝ ██║╚██████╗██║  ██║   ██║   ╚═╝    ╚═════╝ ╚═╝     ╚═╝ ╚═════╝╚═╝  ╚═╝   ╚═╝
!source /etc/rc.d/init.d/functions#tomcat configuration file
server_xml=/opt/tomcat/conf/server.xml
tomcat_user_xml=/opt/tomcat/conf/tomcat-users.xml
manager_xml=/opt/tomcat/conf/Catalina/localhost/manager.xml
context_xml=/opt/tomcat/webapps/host-manager/META-INF/context.xml#Define data path variables
data_downloads=/data/downloads
drive=/opt/tomcat_url=https://dlcdn.apache.org/tomcat/tomcat-10/v10.1.7/bin/
tomcat_gz=apache-tomcat-10.1.7.tar.gz
tomcat_catalogue=apache-tomcat-10.1.7
tomcat_new=tomcat
tomcat_PREFIX=/opt/tomcatjava_url=https://repo.huaweicloud.com/java/jdk/13+33/
java_gz=jdk-13_linux-x64_bin.tar.gz
JAVA_PREFIX=/opt/jdk
java_catalogue=jdk-13
java_catalogue_new=jdkfunction install_java (){
if [ ! -d ${JAVA_PREFIX} ];then
yum install net-tools wget -y
mkdir -p $data_downloads
wget -N -P $data_downloads $java_url$java_gz
tar -zxf $data_downloads/$java_gz -C $drive
mv $drive/$java_catalogue $drive/$java_catalogue_newif [ $? -eq 0 ];thensed -i '$aexport JAVA_HOME=/opt/jdk' /etc/profilesed -i '$aexport PATH=$JAVA_HOME/bin:$PATH:$CATALINA_HOME/bin' /etc/profilesource /etc/profilejava -version 2>&1 | tee /var/log/java_version.logaction "The java Install Sussess..." /bin/trueelseaction "The java Install Failed..." /bin/false exit 1fielseecho -e "\033[31mThe java already Install...\033[0m"
fi
}function install_tomcat (){
if [ ! -d ${tomcat_PREFIX} ];then
wget -N -P $data_downloads $tomcat_url$tomcat_gz
tar -zxf $data_downloads/$tomcat_gz -C $drive
mv $drive/$tomcat_catalogue $drive/$tomcat_new
useradd -M -d /opt/tomcat tomcat 
chown -R tomcat. /opt/tomcat
chmod +x /opt/tomcat/bin/*.shif [ $? -eq 0 ];thensed -i '$aexport CATALINA_HOME=/opt/tomcat' /etc/profilesource /etc/profilerm -rf /opt/tomcat/conf/tomcat-users.xmlrm -rf /opt/tomcat/webapps/host-manager/META-INF/context.xmlrm -rf /opt/tomcat/conf/server.xml/opt/tomcat/bin/version.sh | tee /var/log/tomcat_version.logConfigurin_tomcatmanager_xmlaction "The tomcat Install Sussess..." /bin/trueelseaction "The tomcat Install Failed..." /bin/false exit 1fielseecho -e "\033[31mThe tomcat already Install...\033[0m"
fi
}function Configurin_tomcat (){
cat >>/usr/lib/systemd/system/tomcat.service<<EOF
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target mysqld.service tomcat.keygen.service[Service]
Type=forkingEnvironment=JAVA_HOME=/opt/jdk
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms4096M -Xmx4096M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.shUser=tomcat
Group=tomcat
Restart=always[Install]
WantedBy=multi-user.target
EOFcat >>$tomcat_user_xml<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements.  See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
-->
<tomcat-users xmlns="http://tomcat.apache.org/xml"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"version="1.0">
<!--By default, no user is included in the "manager-gui" role requiredto operate the "/manager/html" web application.  If you wish to use this app,you must define such a user - the username and password are arbitrary.Built-in Tomcat manager roles:- manager-gui    - allows access to the HTML GUI and the status pages- manager-script - allows access to the HTTP API and the status pages- manager-jmx    - allows access to the JMX proxy and the status pages- manager-status - allows access to the status pages onlyThe users below are wrapped in a comment and are therefore ignored. If youwish to configure one or more of these users for use with the manager webapplication, do not forget to remove the <!.. ..> that surrounds them. Youwill also need to set the passwords to something appropriate.
-->
<!--<user username="admin" password="<must-be-changed>" roles="manager-gui"/><user username="robot" password="<must-be-changed>" roles="manager-script"/>
-->
<!--The sample user and role entries below are intended for use with theexamples web application. They are wrapped in a comment and thus are ignoredwhen reading this file. If you wish to configure these users for use with theexamples web application, do not forget to remove the <!.. ..> that surroundsthem. You will also need to set the passwords to something appropriate.
-->
<!--<role rolename="tomcat"/><role rolename="role1"/><user username="tomcat" password="tomcat" roles="tomcat"/><user username="both" password="tomcat" roles="tomcat,role1"/><user username="role1" password="tomcat" roles="role1"/>
--><user username="admin" password="admin" roles="manager-gui,admin-gui"/> 
</tomcat-users>
EOFcat >>$context_xml<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements.  See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
-->
<Context privileged="true" antiResourceLocking="false"docBase="$catalina.home /webapps/manager"><CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"sameSiteCookies="strict" /><Valve className="org.apache.catalina.valves.RemoteAddrValve"allow="^.*$" /><Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>
EOFcat >>$server_xml<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements.  See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may notdefine subcomponents such as "Valves" at this level.Documentation at /docs/config/server.html-->
<Server port="8005" shutdown="SHUTDOWN"><Listener className="org.apache.catalina.startup.VersionLoggerListener" /><!-- Security listener. Documentation at /docs/config/listeners.html<Listener className="org.apache.catalina.security.SecurityListener" />--><!-- APR library loader. Documentation at /docs/apr.html --><Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /><!-- Prevent memory leaks due to use of particular java/javax APIs--><Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /><Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /><Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /><!-- Global JNDI resourcesDocumentation at /docs/jndi-resources-howto.html--><GlobalNamingResources><!-- Editable user database that can also be used byUserDatabaseRealm to authenticate users--><Resource name="UserDatabase" auth="Container"type="org.apache.catalina.UserDatabase"description="User database that can be updated and saved"factory="org.apache.catalina.users.MemoryUserDatabaseFactory"pathname="conf/tomcat-users.xml" /></GlobalNamingResources><!-- A "Service" is a collection of one or more "Connectors" that sharea single "Container" Note:  A "Service" is not itself a "Container",so you may not define subcomponents such as "Valves" at this level.Documentation at /docs/config/service.html--><Service name="Catalina"><!--The connectors can use a shared executor, you can define one or more named thread pools--><!--<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"maxThreads="150" minSpareThreads="4"/>--><!-- A "Connector" represents an endpoint by which requests are receivedand responses are returned. Documentation at :HTTP Connector: /docs/config/http.htmlAJP  Connector: /docs/config/ajp.htmlDefine a non-SSL/TLS HTTP/1.1 Connector on port 8080--><Connector port="8082" protocol="HTTP/1.1"connectionTimeout="20000"redirectPort="8443" /><!-- A "Connector" using the shared thread pool--><!--<Connector executor="tomcatThreadPool"port="8080" protocol="HTTP/1.1"connectionTimeout="20000"redirectPort="8443" />--><!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2This connector uses the NIO implementation. The defaultSSLImplementation will depend on the presence of the APR/nativelibrary and the useOpenSSL attribute of the AprLifecycleListener.Either JSSE or OpenSSL style configuration may be used regardless ofthe SSLImplementation selected. JSSE style configuration is used below.--><!--<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"maxThreads="150" SSLEnabled="true"><UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /><SSLHostConfig><Certificate certificateKeystoreFile="conf/localhost-rsa.jks"type="RSA" /></SSLHostConfig></Connector>--><!-- Define an AJP 1.3 Connector on port 8009 --><!--<Connector protocol="AJP/1.3"address="::1"port="8009"redirectPort="8443" />--><!-- An Engine represents the entry point (within Catalina) that processesevery request.  The Engine implementation for Tomcat stand aloneanalyzes the HTTP headers included with the request, and passes themon to the appropriate Host (virtual host).Documentation at /docs/config/engine.html --><!-- You should set jvmRoute to support load-balancing via AJP ie :<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">--><Engine name="Catalina" defaultHost="localhost"><!--For clustering, please take a look at documentation at:/docs/cluster-howto.html  (simple how to)/docs/config/cluster.html (reference documentation) --><!--<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>--><!-- Use the LockOutRealm to prevent attempts to guess user passwordsvia a brute-force attack --><Realm className="org.apache.catalina.realm.LockOutRealm"><!-- This Realm uses the UserDatabase configured in the global JNDIresources under the key "UserDatabase".  Any editsthat are performed against this UserDatabase are immediatelyavailable for use by the Realm.  --><Realm className="org.apache.catalina.realm.UserDatabaseRealm"resourceName="UserDatabase"/></Realm><Host name="localhost"  appBase="webapps"unpackWARs="true" autoDeploy="true"><!-- SingleSignOn valve, share authentication between web applicationsDocumentation at: /docs/config/valve.html --><!--<Valve className="org.apache.catalina.authenticator.SingleSignOn" />--><!-- Access log processes all example.Documentation at: /docs/config/valve.htmlNote: The pattern used is equivalent to using pattern="common" --><Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"prefix="localhost_access_log" suffix=".txt"pattern="%h %l %u %t &quot;%r&quot; %s %b" /></Host></Engine></Service>
</Server>
EOFsystemctl daemon-reload  &&  systemctl enable --now tomcat
firewall-cmd --zone=public --add-port=8082/tcp --permanent && firewall-cmd --reload
}function manager_xml (){
cat >>$manager_xml<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements.  See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
-->
<Context privileged="true" antiResourceLocking="false"docBase="$catalina.home /webapps/manager"><CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"sameSiteCookies="strict" /><Valve className="org.apache.catalina.valves.RemoteAddrValve"allow="^.*$" /><Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>
EOFsystemctl restart tomcat
rm -rf $data_downloads/*
}function Deployment_completion_notification (){host_ID=`dmidecode -s system-serial-number | sed -r 's/\s+//g'`host_IP=`ifconfig -a | grep inet | grep -v '127.0.0.1' | awk '{ print $2}' | awk 'NR==1'`memory_Size=`dmidecode -t memory | grep Size | grep -v No | awk '{sum+=$2} END {printf "%.0fG\n",sum/1^C4}'`CPU_Model=`cat /proc/cpuinfo | grep 'model name' | awk '{print $6}' | uniq`Disk_size=`fdisk -l | grep "sda:" | awk '{print $3$4}'`redhat_version=`cat /etc/redhat-release | grep "release" | awk '{print $6}'`redhat_core=`cat /proc/version | grep "version" | awk '{print $3}'`tomcat_version=`cat /var/log/tomcat_version.log | grep "Server version" | awk '{print $4}'`tomcat_server=`systemctl status tomcat | grep "Active" | awk '{print $2}'`java_version=`cat /var/log/java_version.log | sed -e 's/"//g' | grep "java version" | awk '{print $3}'`curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=XXXX' \-H 'Content-Type: application/json' \-d '{"msgtype": "markdown","markdown": {"content": " **system check** <font color=\"info\"> complete </font>  \n> **Host IP Address** \n[http://'$host_IP'](http://'$host_IP') \n> **Hardware information** \nhostSN:<font color=\"info\"> '$host_ID' </font> \nCPU_Model:<font color=\"info\"> '$CPU_Model' </font> \nmemory_Size:<font color=\"info\"> '$memory_Size' </font> \nDisk_size:<font color=\"info\"> '$Disk_size' </font> \nSystem_version:<font color=\"info\"> '$redhat_version' </font> \nsystem_core:<font color=\"info\"> '$redhat_core' </font> \n> **tomcat install** \ntomcat_server:<font color=\"info\"> '$tomcat_server' </font> \ntomcat_version:<font color=\"info\"> '$tomcat_version' </font> \njava_server:<font color=\"info\"> '$java_version' </font> \n",}}'
}function main (){
install_java
install_tomcat
Deployment_completion_notification 
}main

执行安装

sh /tomcat_java_install.sh

企业微信机器人提醒 

访问 http://Ip:8082 

Server Status

  • 用户名密码admin/admin

Manager App  

  • 用户名密码admin/admin

Host Manager

  • 用户名密码admin/admin

相关文章:

Linux Shell 实现一键部署tomcat10+java13

tomcat 前言 Tomcat 服务器是一个免费的开放源代码的Web 应用服务器&#xff0c;属于轻量级应用服务器&#xff0c;在中小型系统和并发访问用户不是很多的场合下被普遍使用&#xff0c;是开发和调试JSP 程序的首选。对于一个初学者来说&#xff0c;可以这样认为&#xff0c;当…...

软硬皆施,WMS仓库管理系统+PDA,实现效率狂飙

人工经验Excel表格&#xff0c;是传统第三方仓储企业常用的管理模式。在这种管理模式下&#xff0c;对仓库员工的Excel操作能力、业务经验和工作素养要求极高。一旦员工的经验能力不足&#xff0c;就会导致仓库业务运行不顺畅&#xff0c;效率低下&#xff0c;而员工也会因长时…...

DJ3-2 传输层(第二节课)

目录 一、如何实现可靠数据传输 1. 需要解决地问题 2. 使用的描述方法 二、rdt1.0&#xff1a;完全可靠信道上的可靠数据传输 1. 前提条件 2. 有限状态机 FSM 三、rdt2.0&#xff1a;仅具有 bit 错误的信道上的可靠数据传输 1. 前提条件 2. 有限状态机 FSM 3. 停等协…...

FrIf-FrIf功能模块概述和与底层驱动的交互

总目录链接==>> AutoSAR入门和实战系列总目录 总目录链接==>> AutoSAR BSW高阶配置系列总目录 文章目录 1 FlexRay 接口模块概述2 与FlexRay底层驱动的交互1 FlexRay 接口模块概述 FlexRay 接口模块通过 FlexRay 驱动程序模块间接与 FlexRay 控制器通信。 它…...

【LeetCode】前 K 个高频元素(堆)

目录 1.题目要求&#xff1a; 给你一个整数数组 nums 和一个整数 k &#xff0c;请你返回其中出现频率前 k 高的元素。你可以按 任意顺序 返回答案。 2.解题思路&#xff1a; 代码展示&#xff1a; 1.题目要求&#xff1a; 给你一个整数数组 nums 和一个整数 k &#xff0…...

Java ---多态

&#xff08;一&#xff09;定义 官方&#xff1a;多态是同一个行为具有多个不同表现形式或形态的能力。多态就是同一个接口&#xff0c;使用不同的实例而执行不同操作。 生活中的多态&#xff0c;如图所示&#xff1a; 多态性是对象多种表现形式的体现。 现实中&#xff0c;…...

13个程序员常用开发工具用途推荐整理

作为一名刚入门的程序员&#xff0c;选择合适的开发工具可以提高工作效率&#xff0c;加快学习进度。在本文中&#xff0c;我将向您推荐10个常用的开发工具&#xff0c;并通过简单的例子和代码来介绍它们的主要用途。 1. Visual Studio Code Visual Studio Code&#xff08;V…...

TCP分包和粘包

文章目录TCP分包和粘包TCP分包TCP 粘包分包和粘包解决方案&#xff1a;TCP分包和粘包 TCP分包 场景&#xff1a;发送方发送字符串”helloworld”&#xff0c;接收方却分别接收到了两个数据包&#xff1a;字符串”hello”和”world”发送端发送了数量较多的数据&#xff0c;接…...

手撕深度学习中的优化器

深度学习中的优化算法采用的原理是梯度下降法&#xff0c;选取适当的初值params&#xff0c;不断迭代&#xff0c;进行目标函数的极小化&#xff0c;直到收敛。由于负梯度方向时使函数值下降最快的方向&#xff0c;在迭代的每一步&#xff0c;以负梯度方向更新params的值&#…...

英文打字小游戏

目录 1 实验目的 2 实验报告内容 3 实验题目 4 实验环境 5 实验分析和设计思路 6 流程分析和类图结构 ​编辑 7. 实验结果与测试分析 8. 总结 这周没有更新任何的文章&#xff0c;感到十分的抱歉。因为我们老师让我们做一个英文打字的小游戏&#xff0c;并要求撰写实验…...

PCB生产工艺流程三:生产PCB的内层线路有哪7步

PCB生产工艺流程三&#xff1a;生产PCB的内层线路有哪7步 在我们的PCB生产工艺流程的第一步就是内层线路&#xff0c;那么它的流程又有哪些步骤呢&#xff1f;接下来我们就以内层线路的流程为主题&#xff0c;进行详细的分析。 由半固化片和铜箔压合而成&#xff0c;用于…...

算法竞赛进阶指南0x61 最短路

对于一张有向图&#xff0c;我们一般有邻接矩阵和邻接表两种存储方式。对于无向图&#xff0c;可以把无向边看作两条方向相反的有向边&#xff0c;从而采用与有向图一样的存储方式。 $$ 邻接矩阵的空间复杂度为 O(n^2)&#xff0c;因此我们一般不采用这种方式 $$ 我们用数组模…...

[学习篇] Autoreleasepool

参考文章&#xff1a; https://www.jianshu.com/p/ec2c854b2efd https://suhou.github.io/2018/01/21/%E5%B8%A6%E7%9D%80%E9%97%AE%E9%A2%98%E7%9C%8B%E6%BA%90%E7%A0%81----%E5%AD%90%E7%BA%BF%E7%A8%8BAutoRelease%E5%AF%B9%E8%B1%A1%E4%BD%95%E6%97%B6%E9%87%8A%E6%94%BE/ …...

晶体基本知识

文章目录晶体基本知识基本概念晶胞&#xff1c;晶格&#xff1c;晶粒&#xff1c;晶体晶胞原子坐标(原子分数坐标)六方晶系与四轴定向七大晶系和十四种点阵结构学习资料吉林大学某实验室教程---知乎系列晶体与压敏器件晶体基本知识 基本概念 晶胞&#xff1c;晶格&#xff1c…...

免费CRM如何进行选择?

如今CRM领域成为炙手可热的赛道&#xff0c;很多CRM系统厂商甚至打出完全免费的口号&#xff0c;是否真的存在完全免费的crm系统&#xff1f;很多企业在免费使用过程中会出现被迫终止的问题&#xff0c;需要花费高价钱才能继续使用&#xff0c;那么&#xff0c;免费crm系统哪个…...

关于金融类iOS套壳上架,我帮你总结了这些经验

首先说明&#xff0c;本文中出现的案例的&#xff0c;没有特别的专门针对谁&#xff0c;只是用于分析&#xff0c;如有觉得不妥的&#xff0c;请及时联系我删除&#xff0c;鉴于本文发出之后&#xff0c;可能造成的一些影响&#xff0c;所以大家看看就好了&#xff0c;千万不要…...

4年功能测试月薪9.5K,3个月时间成功进阶自动化,跳槽涨薪6k后我的路还很长...

前言 其实最开始我并不是互联网从业者&#xff0c;是经历了一场六个月的培训才入的行&#xff0c;这个经历仿佛就是一个遮羞布&#xff0c;不能让任何人知道&#xff0c;就算有面试的时候被问到你是不是被培训的&#xff0c;我还是不能承认这段历史。我是为了生存&#xff0c;…...

python url解码详解

python url解码 url是数据的一个部分&#xff0c;一般会用来做什么呢&#xff1f;比如网站的 URL&#xff0c;比如搜索引擎中的 url&#xff0c;再比如网页中的图片等。 你也许不知道&#xff0c;在 Web页面中的图片、链接、超链接都是 URL&#xff0c;也就是 url。 而如果想要…...

leetcode102:二叉树的层序遍历

给你二叉树的根节点 root &#xff0c;返回其节点值的 层序遍历 。 &#xff08;即逐层地&#xff0c;从左到右访问所有节点&#xff09;。 示例 1&#xff1a; 输入&#xff1a;root [3,9,20,null,null,15,7] 输出&#xff1a;[[3],[9,20],[15,7]] 示例 2&#xff1a; 输入…...

深度学习openMMLab的介绍和使用

文章目录MMCV介绍MMCV的安装修改链接中的cu113修改链接中的torch1.10.0物体分类MMCLS源码下载配置参数解读配置文件的组成如何生成完整配置文件定义自己的数据集构建自己的数据集训练自己的任务物体检测MMDetection语义分割MMSegmentation姿态估计MMPose未完成&#xff0c;持续…...

SciencePlots——绘制论文中的图片

文章目录 安装一、风格二、1 资源 安装 # 安装最新版 pip install githttps://github.com/garrettj403/SciencePlots.git# 安装稳定版 pip install SciencePlots一、风格 简单好用的深度学习论文绘图专用工具包–Science Plot 二、 1 资源 论文绘图神器来了&#xff1a;一行…...

Linux简单的操作

ls ls 查看当前目录 ll 查看详细内容 ls -a 查看所有的内容 ls --help 查看方法文档 pwd pwd 查看当前路径 cd cd 转路径 cd .. 转上一级路径 cd 名 转换路径 …...

【快手拥抱开源】通过快手团队开源的 KwaiCoder-AutoThink-preview 解锁大语言模型的潜力

引言&#xff1a; 在人工智能快速发展的浪潮中&#xff0c;快手Kwaipilot团队推出的 KwaiCoder-AutoThink-preview 具有里程碑意义——这是首个公开的AutoThink大语言模型&#xff08;LLM&#xff09;。该模型代表着该领域的重大突破&#xff0c;通过独特方式融合思考与非思考…...

Nginx server_name 配置说明

Nginx 是一个高性能的反向代理和负载均衡服务器&#xff0c;其核心配置之一是 server 块中的 server_name 指令。server_name 决定了 Nginx 如何根据客户端请求的 Host 头匹配对应的虚拟主机&#xff08;Virtual Host&#xff09;。 1. 简介 Nginx 使用 server_name 指令来确定…...

视觉slam十四讲实践部分记录——ch2、ch3

ch2 一、使用g++编译.cpp为可执行文件并运行(P30) g++ helloSLAM.cpp ./a.out运行 二、使用cmake编译 mkdir build cd build cmake .. makeCMakeCache.txt 文件仍然指向旧的目录。这表明在源代码目录中可能还存在旧的 CMakeCache.txt 文件,或者在构建过程中仍然引用了旧的路…...

如何应对敏捷转型中的团队阻力

应对敏捷转型中的团队阻力需要明确沟通敏捷转型目的、提升团队参与感、提供充分的培训与支持、逐步推进敏捷实践、建立清晰的奖励和反馈机制。其中&#xff0c;明确沟通敏捷转型目的尤为关键&#xff0c;团队成员只有清晰理解转型背后的原因和利益&#xff0c;才能降低对变化的…...

jdbc查询mysql数据库时,出现id顺序错误的情况

我在repository中的查询语句如下所示&#xff0c;即传入一个List<intager>的数据&#xff0c;返回这些id的问题列表。但是由于数据库查询时ID列表的顺序与预期不一致&#xff0c;会导致返回的id是从小到大排列的&#xff0c;但我不希望这样。 Query("SELECT NEW com…...

LangChain 中的文档加载器(Loader)与文本切分器(Splitter)详解《二》

&#x1f9e0; LangChain 中 TextSplitter 的使用详解&#xff1a;从基础到进阶&#xff08;附代码&#xff09; 一、前言 在处理大规模文本数据时&#xff0c;特别是在构建知识库或进行大模型训练与推理时&#xff0c;文本切分&#xff08;Text Splitting&#xff09; 是一个…...

Yii2项目自动向GitLab上报Bug

Yii2 项目自动上报Bug 原理 yii2在程序报错时, 会执行指定action, 通过重写ErrorAction, 实现Bug自动提交至GitLab的issue 步骤 配置SiteController中的actions方法 public function actions(){return [error > [class > app\helpers\web\ErrorAction,],];}重写Error…...

用js实现常见排序算法

以下是几种常见排序算法的 JS实现&#xff0c;包括选择排序、冒泡排序、插入排序、快速排序和归并排序&#xff0c;以及每种算法的特点和复杂度分析 1. 选择排序&#xff08;Selection Sort&#xff09; 核心思想&#xff1a;每次从未排序部分选择最小元素&#xff0c;与未排…...