Vault实战(一)-Vault介绍

1 Vault介绍

Vault 是一个基于身份的秘密和加密管理系统。秘密是您想要严格控制访问的任何内容,例如 API 加密密钥、密码和证书。 Vault 提供由身份验证和授权方法控制的加密服务。使用 Vault 的 UI、CLI 或 HTTP API,可以安全地存储和管理、严格控制(限制)和审核对机密和其他敏感数据的访问。

2 为什么需要 Vault

  • 执行密码轮换策略很痛苦
  • 掌握机密的员工离职后可能泄密或是恶意报复
  • 开发者不小心把机密信息随着代码上传到公网的源码仓库造成泄密
  • 管理多个系统的机密非常麻烦
  • 需要将机密信息安全地加密后存储,但又不想将密钥暴露给应用程序,以防止应用程序被入侵后连带密钥一起泄漏

3 Vault 架构图

Vault 只暴漏了存储后端(Storage Backend) 和 API,其他部分都被保护起来了。Vault 并不信任后端存储,存放的都是密文。

4 安装部署

4.1 二进制部署

4.1.1 下载二进制资源包

官方下载地址:Install | Vault | HashiCorp Developer 

$ ls
vault_1.15.4_linux_amd64.zip

4.1.2 解压安装

$ unzip vault_1.15.4_linux_amd64.zip
Archive:  vault_1.15.4_linux_amd64.zipinflating: vault                   
$ mv vault /usr/bin/

4.2 yum方式安装

$ yum install -y yum-utils
$ yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
$ yum -y install vault

5 Vault使用 

5.1 启动 Vault

5.1.1 Dev 模式

$ vault server -dev
==> Vault server configuration:Administrative Namespace: Api Address: http://127.0.0.1:8200Cgo: disabledCluster Address: https://127.0.0.1:8201Environment Variables: GODEBUG, HISTCONTROL, HISTSIZE, HOME, HOSTNAME, LANG, LESSOPEN, LOGNAME, LS_COLORS, MAIL, OLDPWD, PATH, PWD, SHELL, SHLVL, SSH_CLIENT, SSH_CONNECTION, SSH_TTY, TERM, USER, XDG_RUNTIME_DIR, XDG_SESSION_ID, _Go Version: go1.21.4Listener 1: tcp (addr: "127.0.0.1:8200", cluster address: "127.0.0.1:8201", max_request_duration: "1m30s", max_request_size: "33554432", tls: "disabled")Log Level: Mlock: supported: true, enabled: falseRecovery Mode: falseStorage: inmemVersion: Vault v1.15.4, built 2023-12-04T17:45:28ZVersion Sha: 9b61934559ba31150860e618cf18e816cbddc630==> Vault server started! Log data will stream in below:2023-12-19T21:48:24.515+0800 [INFO]  proxy environment: http_proxy="" https_proxy="" no_proxy=""
2023-12-19T21:48:24.515+0800 [INFO]  incrementing seal generation: generation=1
2023-12-19T21:48:24.515+0800 [WARN]  no `api_addr` value specified in config or in VAULT_API_ADDR; falling back to detection if possible, but this value should be manually set
2023-12-19T21:48:24.516+0800 [INFO]  core: Initializing version history cache for core
2023-12-19T21:48:24.516+0800 [INFO]  events: Starting event system
2023-12-19T21:48:24.516+0800 [INFO]  core: security barrier not initialized
2023-12-19T21:48:24.516+0800 [INFO]  core: security barrier initialized: stored=1 shares=1 threshold=1
2023-12-19T21:48:24.516+0800 [INFO]  core: post-unseal setup starting
2023-12-19T21:48:24.525+0800 [INFO]  core: loaded wrapping token key
2023-12-19T21:48:24.525+0800 [INFO]  core: successfully setup plugin runtime catalog
2023-12-19T21:48:24.525+0800 [INFO]  core: successfully setup plugin catalog: plugin-directory=""
2023-12-19T21:48:24.525+0800 [INFO]  core: no mounts; adding default mount table
2023-12-19T21:48:24.529+0800 [INFO]  core: successfully mounted: type=cubbyhole version="v1.15.4+builtin.vault" path=cubbyhole/ namespace="ID: root. Path: "
2023-12-19T21:48:24.530+0800 [INFO]  core: successfully mounted: type=system version="v1.15.4+builtin.vault" path=sys/ namespace="ID: root. Path: "
2023-12-19T21:48:24.530+0800 [INFO]  core: successfully mounted: type=identity version="v1.15.4+builtin.vault" path=identity/ namespace="ID: root. Path: "
2023-12-19T21:48:24.532+0800 [INFO]  core: successfully mounted: type=token version="v1.15.4+builtin.vault" path=token/ namespace="ID: root. Path: "
2023-12-19T21:48:24.532+0800 [INFO]  rollback: Starting the rollback manager with 256 workers
2023-12-19T21:48:24.532+0800 [INFO]  rollback: starting rollback manager
2023-12-19T21:48:24.532+0800 [INFO]  core: restoring leases
2023-12-19T21:48:24.533+0800 [INFO]  expiration: lease restore complete
2023-12-19T21:48:24.533+0800 [INFO]  identity: entities restored
2023-12-19T21:48:24.533+0800 [INFO]  identity: groups restored
2023-12-19T21:48:24.533+0800 [INFO]  core: Recorded vault version: vault version=1.15.4 upgrade time="2023-12-19 13:48:24.533557895 +0000 UTC" build date=2023-12-04T17:45:28Z
2023-12-19T21:48:24.806+0800 [INFO]  core: post-unseal setup complete
2023-12-19T21:48:24.807+0800 [INFO]  core: root token generated
2023-12-19T21:48:24.807+0800 [INFO]  core: pre-seal teardown starting
2023-12-19T21:48:24.807+0800 [INFO]  rollback: stopping rollback manager
2023-12-19T21:48:24.807+0800 [INFO]  core: pre-seal teardown complete
2023-12-19T21:48:24.807+0800 [INFO]  core.cluster-listener.tcp: starting listener: listener_address=127.0.0.1:8201
2023-12-19T21:48:24.807+0800 [INFO]  core.cluster-listener: serving cluster requests: cluster_listen_address=127.0.0.1:8201
2023-12-19T21:48:24.807+0800 [INFO]  core: post-unseal setup starting
2023-12-19T21:48:24.807+0800 [INFO]  core: loaded wrapping token key
2023-12-19T21:48:24.807+0800 [INFO]  core: successfully setup plugin runtime catalog
2023-12-19T21:48:24.807+0800 [INFO]  core: successfully setup plugin catalog: plugin-directory=""
2023-12-19T21:48:24.808+0800 [INFO]  core: successfully mounted: type=system version="v1.15.4+builtin.vault" path=sys/ namespace="ID: root. Path: "
2023-12-19T21:48:24.808+0800 [INFO]  core: successfully mounted: type=identity version="v1.15.4+builtin.vault" path=identity/ namespace="ID: root. Path: "
2023-12-19T21:48:24.809+0800 [INFO]  core: successfully mounted: type=cubbyhole version="v1.15.4+builtin.vault" path=cubbyhole/ namespace="ID: root. Path: "
2023-12-19T21:48:24.809+0800 [INFO]  core: successfully mounted: type=token version="v1.15.4+builtin.vault" path=token/ namespace="ID: root. Path: "
2023-12-19T21:48:24.809+0800 [INFO]  rollback: Starting the rollback manager with 256 workers
2023-12-19T21:48:24.810+0800 [INFO]  rollback: starting rollback manager
2023-12-19T21:48:24.810+0800 [INFO]  core: restoring leases
2023-12-19T21:48:24.810+0800 [INFO]  identity: entities restored
2023-12-19T21:48:24.810+0800 [INFO]  identity: groups restored
2023-12-19T21:48:24.810+0800 [INFO]  expiration: lease restore complete
2023-12-19T21:48:24.810+0800 [INFO]  core: post-unseal setup complete
2023-12-19T21:48:24.810+0800 [INFO]  core: vault is unsealed
2023-12-19T21:48:24.813+0800 [INFO]  core: successful mount: namespace="" path=secret/ type=kv version=""
WARNING! dev mode is enabled! In this mode, Vault runs entirely in-memory
and starts unsealed with a single unseal key. The root token is already
authenticated to the CLI, so you can immediately begin using Vault.You may need to set the following environment variables:$ export VAULT_ADDR='http://127.0.0.1:8200'The unseal key and root token are displayed below in case you want to
seal/unseal the Vault or re-authenticate.Unseal Key: SbJGQUMajGWHZSNpYCTuxemXerDVUaHTjSWEmpR8Qhg=
Root Token: hvs.vLVLD2gBlgnLAhCrc83pDWSaDevelopment mode should NOT be used in production installations!^C==> Vault shutdown triggered
2023-12-19T21:48:35.466+0800 [INFO]  core: marked as sealed
2023-12-19T21:48:35.467+0800 [INFO]  core: pre-seal teardown starting
2023-12-19T21:48:35.467+0800 [INFO]  rollback: stopping rollback manager
2023-12-19T21:48:35.467+0800 [INFO]  core: pre-seal teardown complete
2023-12-19T21:48:35.467+0800 [INFO]  core: stopping cluster listeners
2023-12-19T21:48:35.467+0800 [INFO]  core.cluster-listener: forwarding rpc listeners stopped
2023-12-19T21:48:35.819+0800 [INFO]  core.cluster-listener: rpc listeners successfully shut down
2023-12-19T21:48:35.819+0800 [INFO]  core: cluster listeners successfully shut down
2023-12-19T21:48:35.819+0800 [INFO]  core: vault is sealed

命令执行后的返回文本中会有 Unseal Key 和 Root Token 两个参数,这两个参数很关键一定要记录好。 

5.1.2 生产模式

5.1.2.1 配置文件
$ vim /etc/vault/config.hcl
storage "raft" {path    = "/data/vault"node_id = "node-1"}listener "tcp" {address     = "127.0.0.1:8200"tls_disable = "true"}api_addr = "http://127.0.0.1:8200"cluster_addr = "https://127.0.0.1:8201"ui = true$ mkdir -p ./vault/data

5.1.2.2 启动

$ vault server -config=/etc/vault/config.hcl
==> Vault server configuration:Administrative Namespace: Api Address: http://127.0.0.1:8200Cgo: disabledCluster Address: https://127.0.0.1:8201Environment Variables: GODEBUG, HISTCONTROL, HISTSIZE, HOME, HOSTNAME, LANG, LESSOPEN, LOGNAME, LS_COLORS, MAIL, OLDPWD, PATH, PWD, SHELL, SHLVL, SSH_CLIENT, SSH_CONNECTION, SSH_TTY, TERM, USER, XDG_RUNTIME_DIR, XDG_SESSION_ID, _Go Version: go1.21.4Listener 1: tcp (addr: "127.0.0.1:8200", cluster address: "127.0.0.1:8201", max_request_duration: "1m30s", max_request_size: "33554432", tls: "disabled")Log Level: Mlock: supported: true, enabled: trueRecovery Mode: falseStorage: raft (HA available)Version: Vault v1.15.4, built 2023-12-04T17:45:28ZVersion Sha: 9b61934559ba31150860e618cf18e816cbddc630==> Vault server started! Log data will stream in below:2023-12-19T22:08:53.771+0800 [INFO]  proxy environment: http_proxy="" https_proxy="" no_proxy=""
2023-12-19T22:08:53.779+0800 [INFO]  incrementing seal generation: generation=1
2023-12-19T22:08:53.856+0800 [INFO]  core: Initializing version history cache for core
2023-12-19T22:08:53.856+0800 [INFO]  events: Starting event system
2023-12-19T22:09:28.104+0800 [INFO]  core: security barrier not initialized
2023-12-19T22:09:28.104+0800 [INFO]  core: seal configuration missing, not initialized
2023-12-19T22:09:28.104+0800 [INFO]  core: security barrier not initialized
2023-12-19T22:09:28.106+0800 [INFO]  storage.raft: creating Raft: config="&raft.Config{ProtocolVersion:3, HeartbeatTimeout:5000000000, ElectionTimeout:5000000000, CommitTimeout:50000000, MaxAppendEntries:64, BatchApplyCh:true, ShutdownOnRemove:true, TrailingLogs:0x2800, SnapshotInterval:120000000000, SnapshotThreshold:0x2000, LeaderLeaseTimeout:2500000000, LocalID:\"node-1\", NotifyCh:(chan<- bool)(0xc00284d260), LogOutput:io.Writer(nil), LogLevel:\"DEBUG\", Logger:(*hclog.interceptLogger)(0xc002760330), NoSnapshotRestoreOnStart:true, skipStartup:false}"
2023-12-19T22:09:28.107+0800 [INFO]  storage.raft: initial configuration: index=1 servers="[{Suffrage:Voter ID:node-1 Address:127.0.0.1:8201}]"
2023-12-19T22:09:28.107+0800 [INFO]  storage.raft: entering follower state: follower="Node at node-1 [Follower]" leader-address= leader-id=
2023-12-19T22:09:36.223+0800 [WARN]  storage.raft: heartbeat timeout reached, starting election: last-leader-addr= last-leader-id=
2023-12-19T22:09:36.223+0800 [INFO]  storage.raft: entering candidate state: node="Node at node-1 [Candidate]" term=2
2023-12-19T22:09:36.226+0800 [INFO]  storage.raft: election won: term=2 tally=1
2023-12-19T22:09:36.226+0800 [INFO]  storage.raft: entering leader state: leader="Node at node-1 [Leader]"
2023-12-19T22:09:36.239+0800 [INFO]  core: security barrier initialized: stored=1 shares=5 threshold=3
2023-12-19T22:09:36.256+0800 [INFO]  core: post-unseal setup starting
2023-12-19T22:09:36.261+0800 [INFO]  core: loaded wrapping token key
2023-12-19T22:09:36.261+0800 [INFO]  core: successfully setup plugin runtime catalog
2023-12-19T22:09:36.261+0800 [INFO]  core: successfully setup plugin catalog: plugin-directory=""
2023-12-19T22:09:36.261+0800 [INFO]  core: no mounts; adding default mount table
2023-12-19T22:09:36.268+0800 [INFO]  core: successfully mounted: type=cubbyhole version="v1.15.4+builtin.vault" path=cubbyhole/ namespace="ID: root. Path: "
2023-12-19T22:09:36.268+0800 [INFO]  core: successfully mounted: type=system version="v1.15.4+builtin.vault" path=sys/ namespace="ID: root. Path: "
2023-12-19T22:09:36.269+0800 [INFO]  core: successfully mounted: type=identity version="v1.15.4+builtin.vault" path=identity/ namespace="ID: root. Path: "
2023-12-19T22:09:36.283+0800 [INFO]  core: successfully mounted: type=token version="v1.15.4+builtin.vault" path=token/ namespace="ID: root. Path: "
2023-12-19T22:09:36.284+0800 [INFO]  rollback: Starting the rollback manager with 256 workers
2023-12-19T22:09:36.284+0800 [INFO]  rollback: starting rollback manager
2023-12-19T22:09:36.285+0800 [INFO]  core: restoring leases
2023-12-19T22:09:36.286+0800 [INFO]  expiration: lease restore complete
2023-12-19T22:09:36.290+0800 [INFO]  identity: entities restored
2023-12-19T22:09:36.290+0800 [INFO]  identity: groups restored
2023-12-19T22:09:36.290+0800 [INFO]  core: usage gauge collection is disabled
2023-12-19T22:09:36.293+0800 [INFO]  core: Recorded vault version: vault version=1.15.4 upgrade time="2023-12-19 14:09:36.290555421 +0000 UTC" build date=2023-12-04T17:45:28Z
2023-12-19T22:09:36.852+0800 [INFO]  core: post-unseal setup complete
2023-12-19T22:09:36.859+0800 [INFO]  core: root token generated
2023-12-19T22:09:36.866+0800 [INFO]  core: pre-seal teardown starting
2023-12-19T22:09:36.866+0800 [INFO]  core: stopping raft active node
2023-12-19T22:09:36.866+0800 [INFO]  rollback: stopping rollback manager
2023-12-19T22:09:36.866+0800 [INFO]  core: pre-seal teardown complete

5.2 查看vault服务状态

5.2.1 dev模式 

$ vault status
Key             Value
---             -----
Seal Type       shamir
Initialized     true
Sealed          false
Total Shares    1
Threshold       1
Version         1.15.4
Build Date      2023-12-04T17:45:28Z
Storage Type    inmem
Cluster Name    vault-cluster-5f63f394
Cluster ID      435b526b-a3fa-f015-455b-efdc6391fade
HA Enabled      false

dev模式下,sealed为false,HA Enabled为false。

dev模式不可用于生产环境。

5.2.2 生产模式

$ vault status
Key                Value
---                -----
Seal Type          shamir
Initialized        true
Sealed             true
Total Shares       5
Threshold          3
Unseal Progress    0/3
Unseal Nonce       n/a
Version            1.15.4
Build Date         2023-12-04T17:45:28Z
Storage Type       raft
HA Enabled         true

5.3 server 初始化 

以下均在生产模式下演示。

$ vault operator init
Unseal Key 1: omkhzlj2RQI0uYTqFjLnc49yuKNMcuzB6u0vJ8j0zFd8
Unseal Key 2: VRaHponsWwEV7R2860A/jIBEielq+Nq2b6qBeofjdWxL
Unseal Key 3: 8JjtnzwqYYzC3/RA2iojCfctb0UXS2hYbEfWFL7Vfppc
Unseal Key 4: dFhdpx2ehGdky1YnUsMz2hN4YRtZ7G8DkABD/v4xFFGF
Unseal Key 5: 9iUEPwMERYWPyago35VthjFvyST0IofsVnWMgvbR9CwTInitial Root Token: hvs.V1KqX0oFDc9Hj1xTy6Iini3IVault initialized with 5 key shares and a key threshold of 3. Please securely
distribute the key shares printed above. When the Vault is re-sealed,
restarted, or stopped, you must supply at least 3 of these keys to unseal it
before it can start servicing requests.Vault does not store the generated root key. Without at least 3 keys to
reconstruct the root key, Vault will remain permanently sealed!It is possible to generate new unseal keys, provided you have a quorum of
existing unseal keys shares. See "vault operator rekey" for more information.

5.4 对 key 解封

初始化后,vault 还不知道如何使用具体的存储,因此处于封锁状态,在上面的 output 内容中有这样一句话:

Vault initialized with 5 key shares and a key threshold of 3.

说明 threshold 为 3,也就是说至少要对 3 个 key 执行解封操作后,server 才可以使用。

$ vault operator unseal omkhzlj2RQI0uYTqFjLnc49yuKNMcuzB6u0vJ8j0zFd8
Key                Value
---                -----
Seal Type          shamir
Initialized        true
Sealed             true
Total Shares       5
Threshold          3
Unseal Progress    1/3
Unseal Nonce       31e20274-c828-a988-5221-6b4b5643a04f
Version            1.15.4
Build Date         2023-12-04T17:45:28Z
Storage Type       raft
HA Enabled         true
$ vault operator unseal VRaHponsWwEV7R2860A/jIBEielq+Nq2b6qBeofjdWxL
Key                Value
---                -----
Seal Type          shamir
Initialized        true
Sealed             true
Total Shares       5
Threshold          3
Unseal Progress    2/3
Unseal Nonce       31e20274-c828-a988-5221-6b4b5643a04f
Version            1.15.4
Build Date         2023-12-04T17:45:28Z
Storage Type       raft
HA Enabled         true
$ vault operator unseal 8JjtnzwqYYzC3/RA2iojCfctb0UXS2hYbEfWFL7Vfppc
Key                     Value
---                     -----
Seal Type               shamir
Initialized             true
Sealed                  false
Total Shares            5
Threshold               3
Version                 1.15.4
Build Date              2023-12-04T17:45:28Z
Storage Type            raft
Cluster Name            vault-cluster-c341ffa4
Cluster ID              17b670dc-768d-2c9b-56d1-37fabca8eb16
HA Enabled              true
HA Cluster              n/a
HA Mode                 standby
Active Node Address     <none>
Raft Committed Index    31
Raft Applied Index      31

 每解封一个key,其Unseal Progress就会发生改变。

5.5 创建 engine

和其他数据存储一样,要使用 vault 我们同样需要创建 database,但在 vault 中,数据是按照类似文件系统的 path 来组织的,需要用下面的命令来开启相应的 engine。

$ vault secrets enable -path=secret kv

创建了一个 path secret,并且以 kv 类型进行存储。 

5.6 封存vault 

如果觉得系统存在风险,可以使用root token登录vault,执行以下命令将vault重新封印 。

$ vault login -address='http://127.0.0.1:8200' hvs.EjKzWarVoX2yQOQkNTrO3RCd
$ vault operator seal -address='http://127.0.0.1:8200'

5.7 重建root token

如果root token泄露或root token不甚丢失,可以使用本节的方法重建root token。重建 Root 令牌有两种办法,分别是一次性密码(one time password)简称OPT,以及 pgp。本次使用OPT方式重建。

$ export VAULT_ADDR=http://127.0.0.1:8200 
$ vault operator generate-root -init  ##生成OPT密码,这个密码我们需要记住,后面需要用到

下面来重新生成root token,会提示我们输入shared key,因为默认是需要三个shared key来生成master key,所以命令需要执行三次。最后一次命令执行时,会生成一个encoded token,我们使用otp可以将它解码为root token。

$ vault operator generate-root

解码root token。

$ vault operator generate-root -decode=MDtATTsEGC4ZDzQPORIYVzIHIz8wCGYLGjkODA -otp=XM3cMjJcIjSzxWo6CFuMGk0CjhbY  ##使用这个就可以重新生成root token了
hvs.vnRMPeguAEwaqAVrwcVHpQlU

 参考:https://lonegunmanb.github.io/

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

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

相关文章

FPGA 实现 LeNet-5 卷积神经网络 数字识别,提供工程源码和技术支持

目录 1、前言LeNet-5简洁基于Zynq7020 的设计说明PL 端 FPGA 逻辑设计PS 端 SDK 软件设计免责声明 2、相关方案推荐卷积神经网络解决方案FPGA图像处理方案 3、详细设计方案PL端&#xff1a;ov7725摄像头及图像采集PL端&#xff1a;图像预处理PL端&#xff1a;Xilinx推荐的图像缓…

ASO优化实践经验和改进措施

在积累了大量的实战经验后&#xff0c;小柚总结了一些关于ASO优化的经验给大家分享。共同进步&#xff01;共同学习&#xff01;Fighting&#xff01; 一、关键词研究 关键词研究是ASO优化的基础。在进行关键词研究时&#xff0c;需要了解用户搜索意图、关键词竞争情况和关键…

1265. 数星星(树状数组/蓝桥杯)

题目&#xff1a; 输入样例&#xff1a; 5 1 1 5 1 7 1 3 3 5 5输出样例&#xff1a; 1 2 1 1 0 思路&#xff1a; 树状数组 代码&#xff1a; #include<cstdio> #include<iostream> using namespace std; const int N32010; int n; int tr[N],level[N];int lo…

linux:掌握systemctl命令控制软件的启动和关闭、掌握使用ln命令创建软连接

掌握使用systemctl命令控制软件的启动和关闭 一&#xff1a;systemctl命令&#xff1a; Linux系统很多软件(内置或第三方)均支持使用systemctl命令控制:启动停止、开机自启 能够被systemctl管理的软件一般也称之为:服务 语法: systemctl | start | stop | status | enable …

Qt Q_DECL_OVERRIDE

Q_DECL_OVERRIDE也就是C的override&#xff08;重写函数&#xff09;&#xff0c;其目的就是为了防止写错虚函数,在重写虚函数时需要用到。 /* 鼠标按下事件 */ void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; 参考: Qt Q_DECL_OVERRIDE - 一杯清酒邀明月 - 博客…

Mybatis复习总结

MyBatis是一款优秀的持久层框架&#xff0c;用于简化JDBC的开发 MyBatis本是Apache的一个开源项目&#xff0c;2010年这个项目由apache迁移到了Google&#xff0c;并且改名为 Mybatis&#xff0c;2013年11月迁移至Github。 持久层 指的就是数据访问层&#xff0c;用来操作数…

数组指定部分逆序重放

系列文章目录 进阶的卡莎C++_睡觉觉觉得的博客-CSDN博客数1的个数_睡觉觉觉得的博客-CSDN博客双精度浮点数的输入输出_睡觉觉觉得的博客-CSDN博客足球联赛积分_睡觉觉觉得的博客-CSDN博客大减价(一级)_睡觉觉觉得的博客-CSDN博客小写字母的判断_睡觉觉觉得的博客-CSDN博客纸币(…

基于ssm物资进销存论文

摘 要 现代经济快节奏发展以及不断完善升级的信息化技术&#xff0c;让传统数据信息的管理升级为软件存储&#xff0c;归纳&#xff0c;集中处理数据信息的管理方式。本货物进销管理系统就是在这样的大环境下诞生&#xff0c;其可以帮助管理者在短时间内处理完毕庞大的数据信息…

C#中HttpWebRequest的用法

前言 HttpWebRequest是一个常用的类&#xff0c;用于发送和接收HTTP请求。在C#中使用HttpWebRequest可以实现各种功能&#xff0c;包括发送GET和POST请求、处理Cookie、设置请求头、添加参数等。本文将深入介绍HttpWebRequest的用法&#xff0c;并给出一些常见的示例。 目录 前…

Java面试总结——集合篇

摘自javaguide的集合总体框架图&#xff1a; List, Set, Queue, Map 的区别 List&#xff1a;底层基于object[]数组&#xff0c;存储的元素有序、可重复。 Set&#xff1a;底层基于HashMap实现&#xff0c;存储的元素无序&#xff0c;不可重复。 Queue&#xff1a;单…

科研院校和研究所都在用功率放大器做哪些实验

科研院校和研究所在科研工作中常常使用功率放大器进行实验。功率放大器是一种电子设备&#xff0c;其主要功能是将输入信号的功率增加到预定的输出功率水平&#xff0c;并保持信号的波形不失真。它在各个学科领域都有广泛的应用&#xff0c;包括通信、无线电、雷达、生物医学等…

vue3 使用<script lang=“ts“ setup>加上lang=“ts“后编译错误

报错信息 报错原因 加上了langts解决 下载typescript和loader npm install typescript ts-loader --save-dev配置vue.config.js 添加下面的代码 configureWebpack: { resolve: { extensions: [".ts", ".tsx", ".js", ".json"] }…

Axure中继器的使用

一.中继器介绍 在Axure中&#xff0c;中继器&#xff08;Relays&#xff09;是一种功能强大的元件&#xff0c;可以用于创建可重复使用的模板或组件。中继器允许您定义一个主要的模板&#xff0c;并在页面中重复使用该模板的实例。以下是中继器的作用和优缺点&#xff1a; 作…

2023 英特尔On技术创新大会直播 |我感受到的AI魅力

文章目录 前言英特尔技术创新大会 的来历芯生无限 赋能AI创新后记 前言 近年来&#xff0c;人工智能&#xff08;Artificial Intelligence&#xff09;的应用与发展呈现出爆发式增长的态势&#xff0c;成为科技领域最为引人注目的热门话题之一。作为全球领先的半导体公司&…

《Linux C编程实战》笔记:进程操作之ID,优先级

获得进程ID getpid函数 这个函数都用了很多次了&#xff0c;看一下定义和例子就行了 #include<sys/types.h> #include <unistd.h> pid_t getpid(void); 示例程序1 #include<cstdlib> #include<malloc.h> #include<cstring> #include <cs…

SSM整合实战(Spring、SpringMVC、MyBatis)

五、SSM整合实战 目录 一、SSM整合理解 1. 什么是SSM整合&#xff1f;2. SSM整合核心理解五连问&#xff01; 2.1 SSM整合涉及几个IoC容器&#xff1f;2.2 每个IoC容器盛放哪些组件&#xff1f;2.3 IoC容器之间是什么关系&#xff1f;2.4 需要几个配置文件和对应IoC容器关系&…

2.vue学习(8-13)

文章目录 8.数据绑定9.el与data的2种写法10.理解mvvm11.object.defineProperty12. 理解数据代理13 vue中的数据代理 8.数据绑定 单向数据绑定就是我们学的v-bind的方式&#xff0c;vue对象变了&#xff0c;页面才变。但是页面变了&#xff0c;vue对象不会变。 双向数据绑定需要…

时序预测 | Python实现LSTM-Attention电力需求预测

时序预测 | Python实现LSTM-Attention电力需求预测 目录 时序预测 | Python实现LSTM-Attention电力需求预测预测效果基本描述程序设计参考资料预测效果 基本描述 该数据集因其每小时的用电量数据以及 TSO 对消耗和定价的相应预测而值得注意,从而可以将预期预测与当前最先进的行…

vue 学习笔记

生命周期 1&#xff09;定义&#xff1a;vue实例从创建到销毁的过程 2&#xff09;钩子函数 2.1&#xff09;beforeCreate&#xff1a;vue实例初始化之前调用&#xff0c;这个阶段vue实例刚刚在内存中创建&#xff0c;此时data和methods这些都没初始化好。 2.2&#xff09;Cre…

【算法】红黑树

一、红黑树介绍 红黑树是一种自平衡二叉查找树&#xff0c;是在计算机科学中用到的一种数据结构&#xff0c;典型的用途是实现关联数组。 红黑树是在1972年由Rudolf Bayer发明的&#xff0c;当时被称为平衡二叉B树&#xff08;symmetric binary B-trees&#xff09;。后来&am…