Nacos适配人大金仓国产数据库

news2024/9/20 6:15:51

nacos版本2.2.0

人大金仓版本8.6.0

一、相关文件

Nacos官方文档-数据源插件icon-default.png?t=N6B9https://nacos.io/zh-cn/docs/v2/plugin/datasource-plugin.html


Nacos2.2.0源码icon-default.png?t=N6B9https://github.com/alibaba/nacos/archive/refs/tags/2.2.0.zip

 人大金仓驱动icon-default.png?t=N6B9https://download.csdn.net/download/qq_36802726/88165221

 二、Nacos源码修改

1.配置人大金仓依赖

下载源码与驱动。

源码打开后,如果项目依赖下载太慢可以换成阿里的:可以打开maven的setting.xml文件,把内容换成以下内容:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <mirrors>
        <mirror>
            <id>alimaven</id>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
    </mirrors>
</settings>

 引入人大金仓驱动,先用maven 安装kingbase8.8.6.0.jar:

//打开命令行,使用以下命令安装本地jar
mvn install:install-file -Dfile=D:\library\kingbase8.8.6.0.jar -DgroupId=com.kingbase -DartifactId=kingbase8 -Dversion=8.6.0 -Dpackaging=jar

引入依赖,打开项目父pom文件 nacos-all

 <!--人大金仓 -->
        <dependency>
            <groupId>com.kingbase</groupId>
            <artifactId>kingbase8</artifactId>
            <version>8.6.0</version>
        </dependency>

 2、源码修改

 2.1.找到DataSourceConstant.java,增加kingbase数据常量

 


public class DataSourceConstant {
    public static final String MYSQL = "mysql";
    
    public static final String DERBY = "derby";

    public static final String KINGBASE = "kingbase";
}

 2.2、新建人大金仓数据源插件

 2.2.1、ConfigInfoAggrMapperByKingbase
/*
 * Copyright 1999-2022 Alibaba Group Holding Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed 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 and
 * limitations under the License.
 */

package com.alibaba.nacos.plugin.datasource.impl.kingbase;

import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant;
import com.alibaba.nacos.plugin.datasource.impl.base.BaseConfigInfoAggrMapper;

/**
 * The derby implementation of ConfigInfoAggrMapper.
 *
 * @author zc
 **/

public class ConfigInfoAggrMapperByKingbase  extends BaseConfigInfoAggrMapper {
    
    @Override
    public String getDataSource() {
        return DataSourceConstant.KINGBASE;
    }
}

 

 2.2.2、ConfigInfoBetaMapperByKingbase.java
 2.2.3、ConfigInfoMapperByKingbase.java
 2.2.4、ConfigInfoTagMapperByKingbase.java
 2.2.5、ConfigInfoTagsRelationMapperByKingbase.java
 2.2.6、GroupCapacityMapperByKingbase.java
 2.2.7、HistoryConfigInfoMapperByKingbase.java
 2.2.8、TenantCapacityMapperByKingbase.java
 2.2.9、TenantInfoMapperByKingbase.java

2.3、plugin/datasource/src/main/resources/META-INF/services 下增加以下数据

 

#
# Copyright 1999-2022 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed 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 and
# limitations under the License.
#

com.alibaba.nacos.plugin.datasource.impl.mysql.ConfigInfoAggrMapperByMySql
com.alibaba.nacos.plugin.datasource.impl.mysql.ConfigInfoBetaMapperByMySql
com.alibaba.nacos.plugin.datasource.impl.mysql.ConfigInfoMapperByMySql
com.alibaba.nacos.plugin.datasource.impl.mysql.ConfigInfoTagMapperByMySql
com.alibaba.nacos.plugin.datasource.impl.mysql.ConfigTagsRelationMapperByMySql
com.alibaba.nacos.plugin.datasource.impl.mysql.HistoryConfigInfoMapperByMySql
com.alibaba.nacos.plugin.datasource.impl.mysql.TenantInfoMapperByMySql
com.alibaba.nacos.plugin.datasource.impl.mysql.TenantCapacityMapperByMySql
com.alibaba.nacos.plugin.datasource.impl.mysql.GroupCapacityMapperByMysql

com.alibaba.nacos.plugin.datasource.impl.derby.ConfigInfoAggrMapperByDerby
com.alibaba.nacos.plugin.datasource.impl.derby.ConfigInfoBetaMapperByDerby
com.alibaba.nacos.plugin.datasource.impl.derby.ConfigInfoMapperByDerby
com.alibaba.nacos.plugin.datasource.impl.derby.ConfigInfoTagMapperByDerby
com.alibaba.nacos.plugin.datasource.impl.derby.ConfigInfoTagsRelationMapperByDerby
com.alibaba.nacos.plugin.datasource.impl.derby.HistoryConfigInfoMapperByDerby
com.alibaba.nacos.plugin.datasource.impl.derby.TenantInfoMapperByDerby
com.alibaba.nacos.plugin.datasource.impl.derby.TenantCapacityMapperByDerby
com.alibaba.nacos.plugin.datasource.impl.derby.GroupCapacityMapperByDerby

com.alibaba.nacos.plugin.datasource.impl.kingbase.ConfigInfoAggrMapperByKingbase
com.alibaba.nacos.plugin.datasource.impl.kingbase.ConfigInfoBetaMapperByKingbase
com.alibaba.nacos.plugin.datasource.impl.kingbase.ConfigInfoMapperByKingbase
com.alibaba.nacos.plugin.datasource.impl.kingbase.ConfigInfoTagMapperByKingbase
com.alibaba.nacos.plugin.datasource.impl.kingbase.ConfigInfoTagsRelationMapperByKingbase
com.alibaba.nacos.plugin.datasource.impl.kingbase.GroupCapacityMapperByKingbase
com.alibaba.nacos.plugin.datasource.impl.kingbase.HistoryConfigInfoMapperByKingbase
com.alibaba.nacos.plugin.datasource.impl.kingbase.TenantCapacityMapperByKingbase
com.alibaba.nacos.plugin.datasource.impl.kingbase.TenantInfoMapperByKingbase

 

 2.4、修改配置文件连接数据库

 

### kingbase:
spring.sql.init.platform=kingbase
db.num=1
db.url.0=jdbc:kingbase8://192.168.0.1:54321/nacos?currentSchema=nacos&allowEncodingChanges=true&clientEncoding=UTF8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
db.user.0=nacos
db.password.0=nacos
db.pool.config.driverClassName=com.kingbase8.Driver

 需要注意url的第一个nacos代表数据库名,参数currentSchema后面是数据库的模式名。

2.5、手动增加数据源

不然后面启动项目会报错

Invocation of init method failed; nested exception is ErrCode:500, ErrMsg:Nacos Server did not start because dumpservice bean construction failure :
No DataSource set

在ExternalDataSourceServiceImpl 

找到方法public void init() 追加

  if(Objects.isNull(jt.getDataSource())){
            jt.setDataSource(dataSourceList.get(0));
        }

完整方法

    @Override
        public void init() {
        queryTimeout = ConvertUtils.toInt(System.getProperty("QUERYTIMEOUT"), 3);
        jt = new JdbcTemplate();
        // Set the maximum number of records to prevent memory expansion
        jt.setMaxRows(50000);
        jt.setQueryTimeout(queryTimeout);
        
        testMasterJT = new JdbcTemplate();
        testMasterJT.setQueryTimeout(queryTimeout);
        
        testMasterWritableJT = new JdbcTemplate();
        // Prevent the login interface from being too long because the main library is not available
        testMasterWritableJT.setQueryTimeout(1);
        
        //  Database health check
        
        testJtList = new ArrayList<>();
        isHealthList = new ArrayList<>();
        
        tm = new DataSourceTransactionManager();
        tjt = new TransactionTemplate(tm);
        
        // Transaction timeout needs to be distinguished from ordinary operations.
        tjt.setTimeout(TRANSACTION_QUERY_TIMEOUT);
        
        dataSourceType = DatasourcePlatformUtil.getDatasourcePlatform(defaultDataSourceType);
        
        if (PropertyUtil.isUseExternalDB()) {
            try {
                reload();
            } catch (IOException e) {
                FATAL_LOG.error("[ExternalDataSourceService] datasource reload error", e);
                throw new RuntimeException(DB_LOAD_ERROR_MSG, e);
            }
            
            if (this.dataSourceList.size() > DB_MASTER_SELECT_THRESHOLD) {
                ConfigExecutor.scheduleConfigTask(new SelectMasterTask(), 10, 10, TimeUnit.SECONDS);
            }
            ConfigExecutor.scheduleConfigTask(new CheckDbHealthTask(), 10, 10, TimeUnit.SECONDS);
        }
        if(Objects.isNull(jt.getDataSource())){
            jt.setDataSource(dataSourceList.get(0));
        }
    }

 

2.6、配置调试

maven执行 mvn install

如果控制台显示

java: 程序包com.alibaba.nacos.consistency.entity不存在java: 程序包com.alibaba.nacos.consistency.entity不存在 

 可以执行

 然后刷新一下maven在执行 mvn install

成功后进行运行配置

-Dnacos.standalone=true 代表单例运行 

 这说明项目启动成功

3、人大金仓数据库

CREATE SCHEMA nacos AUTHORIZATION nacos;
CREATE TABLE config_info (
  id bigint NOT NULL,
  data_id varchar(255) NOT NULL,
  group_id varchar(128) NOT NULL,
  tenant_id varchar(128) default '',
  app_name varchar(128),
  content text,
  md5 varchar(32) DEFAULT NULL,
  gmt_create timestamp NOT NULL DEFAULT '2010-05-05 00:00:00',
  gmt_modified timestamp NOT NULL DEFAULT '2010-05-05 00:00:00',
  src_user varchar(128) DEFAULT NULL,
  src_ip varchar(20) DEFAULT NULL,
  c_desc varchar(256) DEFAULT NULL,
  c_use varchar(64) DEFAULT NULL,
  effect varchar(64) DEFAULT NULL,
  type varchar(64) DEFAULT NULL,
  c_schema text DEFAULT NULL,
  ENCRYPTED_DATA_KEY varchar(100) DEFAULT NULL,
  constraint configinfo_id_key PRIMARY KEY (id),
  constraint uk_configinfo_datagrouptenant UNIQUE (data_id,group_id,tenant_id));
 
CREATE INDEX configinfo_dataid_key_idx ON config_info(data_id);
CREATE INDEX configinfo_groupid_key_idx ON config_info(group_id);
CREATE INDEX configinfo_dataid_group_key_idx ON config_info(data_id, group_id);
CREATE SEQUENCE config_info_id_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table config_info  alter column id set default nextval('config_info_id_seq'); 
 
 
 
CREATE TABLE his_config_info (
  id bigint NOT NULL,
  nid bigint NOT NULL,
  data_id varchar(255) NOT NULL,
  group_id varchar(128) NOT NULL,
  tenant_id varchar(128) default '',
  app_name varchar(128),
  content text,
  md5 varchar(32) DEFAULT NULL,
  gmt_create timestamp NOT NULL DEFAULT '2010-05-05 00:00:00.000',
  gmt_modified timestamp NOT NULL DEFAULT '2010-05-05 00:00:00.000',
  src_user varchar(128),
  src_ip varchar(20) DEFAULT NULL,
  op_type char(10) DEFAULT NULL,
  ENCRYPTED_DATA_KEY varchar(100) DEFAULT NULL,
  constraint hisconfiginfo_nid_key PRIMARY KEY (nid));
 
 
CREATE INDEX hisconfiginfo_dataid_key_idx ON his_config_info(data_id);
CREATE INDEX hisconfiginfo_gmt_create_idx ON his_config_info(gmt_create);
CREATE INDEX hisconfiginfo_gmt_modified_idx ON his_config_info(gmt_modified);  
 
CREATE SEQUENCE his_config_info_nid_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table his_config_info  alter column nid set default nextval('his_config_info_nid_seq'); 
 
 
CREATE TABLE config_info_beta (
  id bigint NOT NULL ,
  data_id varchar(255) NOT NULL,
  group_id varchar(128) NOT NULL,
  tenant_id varchar(128) default '',
  app_name varchar(128),
  content text,
  beta_ips varchar(1024),
  md5 varchar(32) DEFAULT NULL,
  gmt_create timestamp NOT NULL DEFAULT '2010-05-05 00:00:00',
  gmt_modified timestamp NOT NULL DEFAULT '2010-05-05 00:00:00',
  src_user varchar(128),
  src_ip varchar(20) DEFAULT NULL,
  constraint configinfobeta_id_key PRIMARY KEY (id),
  constraint uk_configinfobeta_datagrouptenant UNIQUE (data_id,group_id,tenant_id));
 
CREATE SEQUENCE config_info_beta_id_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table config_info_beta  alter column id set default nextval('config_info_beta_id_seq'); 
 
 
CREATE TABLE config_info_tag (
  id bigint NOT NULL ,
  data_id varchar(255) NOT NULL,
  group_id varchar(128) NOT NULL,
  tenant_id varchar(128) default '',
  tag_id varchar(128) NOT NULL,
  app_name varchar(128),
  content text,
  md5 varchar(32) DEFAULT NULL,
  gmt_create timestamp NOT NULL DEFAULT '2010-05-05 00:00:00',
  gmt_modified timestamp NOT NULL DEFAULT '2010-05-05 00:00:00',
  src_user varchar(128),
  src_ip varchar(20) DEFAULT NULL,
  constraint configinfotag_id_key PRIMARY KEY (id),
  constraint uk_configinfotag_datagrouptenanttag UNIQUE (data_id,group_id,tenant_id,tag_id));
CREATE SEQUENCE config_info_tag_id_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table config_info_tag  alter column id set default nextval('config_info_tag_id_seq'); 
 
 
 
CREATE TABLE config_info_aggr (
  id bigint NOT NULL ,
  data_id varchar(255) NOT NULL,
  group_id varchar(128) NOT NULL,
  tenant_id varchar(128) default '',
  datum_id varchar(255) NOT NULL,
  app_name varchar(128),
  content text,
  gmt_modified timestamp NOT NULL DEFAULT '2010-05-05 00:00:00',
  constraint configinfoaggr_id_key PRIMARY KEY (id),
  constraint uk_configinfoaggr_datagrouptenantdatum UNIQUE (data_id,group_id,tenant_id,datum_id));
 
CREATE SEQUENCE config_info_aggr_id_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table config_info_aggr  alter column id set default nextval('config_info_aggr_id_seq'); 
 
 
CREATE TABLE app_list (
 id bigint NOT NULL ,
 app_name varchar(128) NOT NULL,
 is_dynamic_collect_disabled smallint DEFAULT 0,
 last_sub_info_collected_time timestamp DEFAULT '1970-01-01 08:00:00.0',
 sub_info_lock_owner varchar(128),
 sub_info_lock_time timestamp DEFAULT '1970-01-01 08:00:00.0',
 constraint applist_id_key PRIMARY KEY (id),
 constraint uk_appname UNIQUE (app_name));
CREATE SEQUENCE app_list_id_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table app_list  alter column id set default nextval('app_list_id_seq'); 
 
 
CREATE TABLE app_configdata_relation_subs (
  id bigint NOT NULL ,
  app_name varchar(128) NOT NULL,
  data_id varchar(255) NOT NULL,
  group_id varchar(128) NOT NULL,
  gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
  constraint configdatarelationsubs_id_key PRIMARY KEY (id),
  constraint uk_app_sub_config_datagroup UNIQUE (app_name, data_id, group_id));
CREATE SEQUENCE app_configdata_relation_subs_id_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table app_configdata_relation_subs  alter column id set default nextval('app_configdata_relation_subs_id_seq'); 
 
 
 
CREATE TABLE app_configdata_relation_pubs (
  id bigint NOT NULL ,
  app_name varchar(128) NOT NULL,
  data_id varchar(255) NOT NULL,
  group_id varchar(128) NOT NULL,
  gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
  constraint configdatarelationpubs_id_key PRIMARY KEY (id),
  constraint uk_app_pub_config_datagroup UNIQUE (app_name, data_id, group_id));
CREATE SEQUENCE app_configdata_relation_pubs_id_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table app_configdata_relation_pubs  alter column id set default nextval('app_configdata_relation_pubs_id_seq'); 
 
 
CREATE TABLE config_tags_relation (
  id bigint NOT NULL,
  tag_name varchar(128) NOT NULL,
  tag_type varchar(64) DEFAULT NULL,
  data_id varchar(255) NOT NULL,
  group_id varchar(128) NOT NULL,
  tenant_id varchar(128) DEFAULT '',
  nid bigint NOT NULL,
  constraint config_tags_id_key PRIMARY KEY (nid),
  constraint uk_configtagrelation_configidtag UNIQUE (id, tag_name, tag_type));
 
CREATE INDEX config_tags_tenant_id_idx ON config_tags_relation(tenant_id);
CREATE SEQUENCE config_tags_relation_pubs_id_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table config_tags_relation  alter column id set default nextval('config_tags_relation_pubs_id_seq'); 
 
 
 
CREATE TABLE group_capacity (
  id bigint NOT NULL ,
  group_id varchar(128) DEFAULT '',
  quota int DEFAULT 0,
  usage int DEFAULT 0,
  max_size int DEFAULT 0,
  max_aggr_count int DEFAULT 0,
  max_aggr_size int DEFAULT 0,
  max_history_count int DEFAULT 0,
  gmt_create timestamp DEFAULT '2010-05-05 00:00:00',
  gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
  constraint group_capacity_id_key PRIMARY KEY (id),
  constraint uk_group_id UNIQUE (group_id));
CREATE SEQUENCE group_capacity_id_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table group_capacity  alter column id set default nextval('group_capacity_id_seq'); 
 
 
CREATE TABLE tenant_capacity (
  id bigint NOT NULL ,
  tenant_id varchar(128) DEFAULT '',
  quota int DEFAULT 0,
  usage int DEFAULT 0,
  max_size int DEFAULT 0,
  max_aggr_count int DEFAULT 0,
  max_aggr_size int DEFAULT 0,
  max_history_count int DEFAULT 0,
  gmt_create timestamp DEFAULT '2010-05-05 00:00:00',
  gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
  constraint tenant_capacity_id_key PRIMARY KEY (id),
  constraint uk_tenant_id UNIQUE (tenant_id));
CREATE SEQUENCE tenant_capacity_id_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table tenant_capacity  alter column id set default nextval('tenant_capacity_id_seq'); 
 
 
CREATE TABLE tenant_info (
  id bigint NOT NULL ,
  kp varchar(128) NOT NULL,
  tenant_id varchar(128)  DEFAULT '',
  tenant_name varchar(128)  DEFAULT '',
  tenant_desc varchar(256)  DEFAULT NULL,
  create_source varchar(32) DEFAULT NULL,
  gmt_create bigint NOT NULL,
  gmt_modified bigint NOT NULL,
  constraint tenant_info_id_key PRIMARY KEY (id),
  constraint uk_tenant_info_kptenantid UNIQUE (kp,tenant_id));
CREATE INDEX tenant_info_tenant_id_idx ON tenant_info(tenant_id);
 
CREATE SEQUENCE tenant_info_id_seq 
    START WITH 1    
    INCREMENT BY 1  
    NO MINVALUE 
    NO MAXVALUE 
    CACHE 1; 
alter table tenant_info  alter column id set default nextval('tenant_info_id_seq'); 
 
 
 
CREATE TABLE users (
    username varchar(50) NOT NULL PRIMARY KEY,
    password varchar(500) NOT NULL,
    enabled boolean NOT NULL
);
 
CREATE TABLE roles (
    username varchar(50) NOT NULL,
    role varchar(50) NOT NULL
);
 
INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', true);
 
INSERT INTO roles (username, role) VALUES ('nacos', 'ROLE_ADMIN');

三、 构建打包

mvn -Prelease-nacos -Dmaven.test.skip=true -Dpmd.skip=true -Dcheckstyle.skip=true  clean install

或者

mvn -Prelease-nacos clean package install -Dmaven.test.skip=true

成功后在distribution的target下生成两个包

nacos-server-2.2.0.tar.gz 是linux环境的

nacos-server-2.2.0.zip 是windows环境的

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/835716.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

无人机航测技术有何特点?主要应用在哪些方面?

无人机航测是航空摄影测量的一种&#xff0c;主要面向低空遥感领域&#xff0c;具有成本低、快速高效、适用范围广等特点。目前&#xff0c;无人机航测主要应用于地形测绘、城市数字化建设、工程建设等方面。 无人机航测技术的特点 1、作业成本低 传统的人工测量技术主要利用…

Bigemap如何查看高清影像图

工具 Bigemap gis office地图软件 分享一个可以查看非常高清影像图的软件&#xff0c;平时外出徒步的时候用来查看路线。 首先要去搜索安装bigemap gis office这个软件&#xff0c;打开软件&#xff0c;要提示你去添加地图的。然后去点击选择地图这个按钮&#xff0c;列表中有…

CobaltStirke BOF技术剖析(一)|BOF实现源码级分析

简介 对BOF(Beacon Object File)的支持是在CobaltStrike4.1版本中新引入的功能。BOF文件是由c代码编译而来的可在Beacon进程中动态加载执行的二进制程序。无文件执行与无新进程创建的特性更加符合OPSEC的原则&#xff0c;适用于严苛的终端对抗场景。低开发门槛与便利的内部Bea…

Linux学习之延时计划任务anacontab和锁文件flock

cat /etc/redhat-release看到操作系统的版本是CentOS Linux release 7.6.1810 (Core)&#xff0c;uname -r可以看到内核版本是3.10.0-957.21.3.el7.x86_64 参考的博客有&#xff1a; 1.《Linux anacron命令用法详解》 2.《详解anacron 命令》 3.《Anacron的用法》 4.《shell脚…

ip网络广播系统网络音频解码终端公共广播SV-7101

SV-7101V网络音频终端产品简介 网络广播终端SV-7101V&#xff0c;接收网络音频流&#xff0c;实时解码播放。本设备只有网络广播功能&#xff0c;是一款简单的网络广播终端。提供一路线路输出接功放或有源音箱。 产品特点 ■ 提供固件网络远程升级■ 标准RJ45网络接口&…

Android:自己写一个简单记事本

一、前言&#xff1a;我的app是点击加号跳转到另一个界面 那么我遇到的问题的是点击加号是一个从一个Fragment跳转到另一个Fragment跳转失败。 二、解决方案&#xff1a; //相应控件的监听里面实现跳转FragmentManager fragmentManagergetFragmentManager();fragmentManager.b…

51单片机学习-AT24C02数据存储秒表(定时器扫描按键数码管)

首先编写I2C模块&#xff0c;根据下面的原理图进行位声明&#xff1a; sbit I2C_SCL P2^1; sbit I2C_SDA P2^0;再根据下面的时序结构图编写函数&#xff1a; /*** brief I2C开始* param 无* retval 无*/ void I2C_Start(void) {I2C_SDA 1; I2C_SCL 1; I2C_SDA 0;I2C_S…

HTML+CSS+JavaScript:利用事件委托实现tab栏切换

一、需求 实现tab栏切换 二、代码素材 以下是缺失JS部分的代码&#xff0c;感兴趣的小伙伴可以先自己试着写一写 <!-- JS方法实现tab栏切换 --> <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8" /><meta …

[java刷算法]牛客—剑指offer链表复习、手写简易正则匹配

&#x1f9db;‍♂️个人主页&#xff1a;杯咖啡&#x1f4a1;进步是今天的活动&#xff0c;明天的保证&#xff01;✨目前正在学习&#xff1a;SSM框架,算法刷题&#x1f449;本文收录专栏 &#xff1a; java刷算法牛客—剑指offer&#x1f64c;牛客网&#xff0c;刷算法过面试…

【传统视觉】C#创建、封装、调用类库

任务 因为实现代码相对简单&#xff0c;然后又没有使用Opencv&#xff0c;所以就直接用C#实现&#xff0c;C#调用。 1.创建类库 1.1新建一个类库 vs2015 > 文件 > 新建 > 项目 using System; using System.Collections.Generic; using System.Linq;namespace Yo…

使用ChatGPT编写技术文档

技术文档对于任何项目都是至关重要的&#xff0c;因为它确保所有利益相关者都在同一层面上&#xff0c;并允许有效的沟通和协作。创建详细而准确的技术文档可能既耗时又具有挑战性&#xff0c;特别是对于那些不熟悉主题或缺乏强大写作技巧的人来说。ChatGPT 是一个强大的人工智…

服务器流量

1.服务器流量分为入流量和出流量 入流量&#xff08;Inbound Traffic&#xff09;是指流向服务器的数据流量&#xff0c;也就是客户端发送到服务器的数据。这些数据可能包括请求信息、文件上传等。 出流量&#xff08;Outbound Traffic&#xff09;是指从服务器流向客户端的数…

[C++] 类与对象(中)类中六个默认成员函数(2)-- 运算符重载 -- 取地址及const取地址操作符重载

1、前言 本篇我们以日期类来展开讲。对于一个日期&#xff0c;我们如何去比大小呢&#xff1f;对年月日依次进行比较可以&#xff0c;但是可以直接比较吗? 我们可以看到&#xff0c;对于自定义类型的日期类直接去比较两个日期的大小是错误的&#xff0c;因此我们需要对运算符赋…

C. Candy Store

Problem - 1798C - Codeforces 思路&#xff1a;要求的最小的标签数量&#xff0c;我们可以先考虑贪心&#xff0c;对于第一个来说它一定会使用一个标签&#xff0c;然后就让后面尽可能多的跟当前这个共用一个标签&#xff0c;如果不行&#xff0c;则在使用一个新的。那么对于共…

Python+Robot Framework实现接口自动化测试

最近在研究PythonRobot Framework的接口自动化&#xff0c;摸清了一些套路&#xff0c;想着总结一下&#xff0c;分享给大家&#xff0c;希望对做自动化的同学有所启发。 主要用到了Python的requests&#xff0c;json&#xff0c;hashlib库&#xff0c;下面以登录和开启文档/目…

“云教室”来了! 麒麟信安打造晋城市红星小学多媒体教室建设新标杆

当前&#xff0c;教育行业正面临教育信息化的重大变革。随着信息技术的发展&#xff0c;集声音、图像、视频动画等多种功能于一体的信息技术课逐渐成为学生群体最受欢迎的课程之一。 近日&#xff0c;麒麟信安为晋城市红星小学量身打造的“云教室”全新上线。据悉&#xff0c;…

IDEA如何生成 serialVersionUID

序列化和反序列化 Java是面向对象的语言&#xff0c;与其他语言进行交互&#xff08;比如与前端js进行http通信&#xff09;&#xff0c;需要把对象转化成一种通用的格式比如json&#xff08;前端显然不认识Java对象&#xff09;&#xff0c;从对象到json字符串的转换&#xff…

【css】css实现字母大小写转换

text-transform 属性用于指定文本中的大写和小写字母。 uppercase&#xff1a;将字母转为大写lowercase&#xff1a;将字母转为小写capitalize&#xff1a;将每个单词首字母转为大写 代码&#xff1a; <style> p.uppercase {text-transform: uppercase; }p.lowercase …

Mendix Excel导出介绍

一、前言 之前我们聊到企业实现应用现代化是一项长期的任重道远的工作&#xff0c;通过Excel导入组件可以作为一个好的起点把企业的业务从线下迁移到线上&#xff0c;当把应用迁移之后&#xff0c;最终结果会有各种的报表展示&#xff0c;这时基于实际业务的需求&#xff0c;我…

springboot jekins打包

新建Item 选择freestyle 配置下拉框 This project is parameterized 配置git 构建shell脚本 脚本 BUILD_IDDONTKILLME . /etc/profile export PROJ_PATHpwd export TOMCAT_APP_PATH/root/local/apache-tomcat-8.5.45 export BASE_PATH/root/localecho $PROJ_PATH echo $TO…