Linux | RHEL / CentOS 中 YUM history / downgrade 命令回滚操作

注:英文引文,机翻未校


在 RHEL/CentOS 系统上使用 YUM history 命令回滚升级操作

作者: 2daygeek
译者: LCTT DarkSun

为服务器打补丁是 Linux 系统管理员的一项重要任务,为的是让系统更加稳定,性能更加优化。厂商经常会发布一些安全/高危的补丁包,相关软件需要升级以防范潜在的安全风险。

Yum (Yellowdog Update Modified) 是 CentOS 和 RedHat 系统上用的 RPM 包管理工具,yum history 命令允许系统管理员将系统回滚到上一个状态,但由于某些限制,回滚不是在所有情况下都能成功,有时 yum 命令可能什么都不做,有时可能会删掉一些其他的包。

我建议你在升级之前还是要做一个完整的系统备份,而 yum history 并不能用来替代系统备份的。系统备份能让你将系统还原到任意时候的节点状态。

某些情况下,安装的应用程序在升级了补丁之后不能正常工作或者出现一些错误(可能是由于库不兼容或者软件包升级导致的),那该怎么办呢?

与应用开发团队沟通,并找出导致库和软件包的问题所在,然后使用 yum history 命令进行回滚。

回滚 / 降级注意事项:

  • 它不支持回滚 selinux,selinux-policy-*,kernel,glibc (以及依赖 glibc 的包,比如 gcc)。
  • 不建议将系统降级到更低的版本(比如 CentOS 6.9 降到 CentOS 6.8),这会导致系统处于不稳定的状态

让我们先来看看系统上有哪些包可以升级,然后挑选出一些包来做实验。

# yum update
Loaded plugins: fastestmirror, security
Setting up Update Process
Loading mirror speeds from cached hostfile
epel/metalink | 12 kB 00:00
 * epel: mirror.csclub.uwaterloo.ca
base | 3.7 kB 00:00
dockerrepo | 2.9 kB 00:00
draios | 2.9 kB 00:00
draios/primary_db | 13 kB 00:00
epel | 4.3 kB 00:00
epel/primary_db | 5.9 MB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 2.5 MB 00:00
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.7.1-8.el6 will be updated
---> Package git.x86_64 0:1.7.1-9.el6_9 will be an update
---> Package httpd.x86_64 0:2.2.15-60.el6.centos.4 will be updated
---> Package httpd.x86_64 0:2.2.15-60.el6.centos.5 will be an update
---> Package httpd-tools.x86_64 0:2.2.15-60.el6.centos.4 will be updated
---> Package httpd-tools.x86_64 0:2.2.15-60.el6.centos.5 will be an update
---> Package perl-Git.noarch 0:1.7.1-8.el6 will be updated
---> Package perl-Git.noarch 0:1.7.1-9.el6_9 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================
 Package Arch Version Repository Size
=================================================================================================
Updating:
 git x86_64 1.7.1-9.el6_9 updates 4.6 M
 httpd x86_64 2.2.15-60.el6.centos.5 updates 836 k
 httpd-tools x86_64 2.2.15-60.el6.centos.5 updates 80 k
 perl-Git noarch 1.7.1-9.el6_9 updates 29 k
Transaction Summary
=================================================================================================
Upgrade 4 Package(s)
Total download size: 5.5 M
Is this ok [y/N]: n

你会发现 git 包可以被升级,那我们就用它来实验吧。运行下面命令获得软件包的版本信息(当前安装的版本和可以升级的版本)。

# yum list git
Loaded plugins: fastestmirror, security
Setting up Update Process
Loading mirror speeds from cached hostfile
 * epel: mirror.csclub.uwaterloo.ca
Installed Packages
git.x86_64 1.7.1-8.el6 @base
Available Packages
git.x86_64 1.7.1-9.el6_9 updates

运行下面命令来将 git1.7.1-8 升级到 1.7.1-9

# yum update git
Loaded plugins: fastestmirror, presto
Setting up Update Process
Loading mirror speeds from cached hostfile
 * base: repos.lax.quadranet.com
 * epel: fedora.mirrors.pair.com
 * extras: mirrors.seas.harvard.edu
 * updates: mirror.sesp.northwestern.edu
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.7.1-8.el6 will be updated
--> Processing Dependency: git = 1.7.1-8.el6 for package: perl-Git-1.7.1-8.el6.noarch
---> Package git.x86_64 0:1.7.1-9.el6_9 will be an update
--> Running transaction check
---> Package perl-Git.noarch 0:1.7.1-8.el6 will be updated
---> Package perl-Git.noarch 0:1.7.1-9.el6_9 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================
 Package Arch Version Repository Size
=================================================================================================
Updating:
 git x86_64 1.7.1-9.el6_9 updates 4.6 M
Updating for dependencies:
 perl-Git noarch 1.7.1-9.el6_9 updates 29 k
Transaction Summary
=================================================================================================
Upgrade 2 Package(s)
Total download size: 4.6 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 4.6 M
(1/2): git-1.7.1-9.el6_9.x86_64.rpm | 4.6 MB 00:00
(2/2): perl-Git-1.7.1-9.el6_9.noarch.rpm | 29 kB 00:00
-------------------------------------------------------------------------------------------------
Total 5.8 MB/s | 4.6 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
 Updating : perl-Git-1.7.1-9.el6_9.noarch 1/4
 Updating : git-1.7.1-9.el6_9.x86_64 2/4
 Cleanup : perl-Git-1.7.1-8.el6.noarch 3/4
 Cleanup : git-1.7.1-8.el6.x86_64 4/4
 Verifying : git-1.7.1-9.el6_9.x86_64 1/4
 Verifying : perl-Git-1.7.1-9.el6_9.noarch 2/4
 Verifying : git-1.7.1-8.el6.x86_64 3/4
 Verifying : perl-Git-1.7.1-8.el6.noarch 4/4
Updated:
 git.x86_64 0:1.7.1-9.el6_9
Dependency Updated:
 perl-Git.noarch 0:1.7.1-9.el6_9
Complete!

验证升级后的 git 版本.

# yum list git
Installed Packages
git.x86_64 1.7.1-9.el6_9 @updates
或
# rpm -q git
git-1.7.1-9.el6_9.x86_64

现在我们成功升级这个软件包,可以对它进行回滚了。步骤如下。

使用 YUM history 命令回滚升级操作

首先,使用下面命令获取 yum 操作的 id。下面的输出很清晰地列出了所有需要的信息,例如操作 id、谁做的这个操作(用户名)、操作日期和时间、操作的动作(安装还是升级)、操作影响的包数量。

首先,使用下面命令获取 yum 操作的 id。下面的输出很清晰地列出了所有需要的信息,例如操作 id、谁做的这个操作(用户名)、操作日期和时间、操作的动作(安装还是升级)、操作影响的包数量。

# yum history# yum history list all
Loaded plugins: fastestmirror, presto
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
 13 | root | 2017-08-18 13:30 | Update | 2
 12 | root | 2017-08-10 07:46 | Install | 1
 11 | root | 2017-07-28 17:10 | E, I, U | 28 EE
 10 | root | 2017-04-21 09:16 | E, I, U | 162 EE
 9 | root | 2017-02-09 17:09 | E, I, U | 20 EE
 8 | root | 2017-02-02 10:45 | Install | 1
 7 | root | 2016-12-15 06:48 | Update | 1
 6 | root | 2016-12-15 06:43 | Install | 1
 5 | root | 2016-12-02 10:28 | E, I, U | 23 EE
 4 | root | 2016-10-28 05:37 | E, I, U | 13 EE
 3 | root | 2016-10-18 12:53 | Install | 1
 2 | root | 2016-09-30 10:28 | E, I, U | 31 EE
 1 | root | 2016-07-26 11:40 | E, I, U | 160 EE

上面命令显示有两个包受到了影响,因为 git 还升级了它的依赖包 perl-Git。 运行下面命令来查看关于操作的详细信息。

# yum history info 13
Loaded plugins: fastestmirror, presto
Transaction ID : 13
Begin time : Fri Aug 18 13:30:52 2017
Begin rpmdb : 420:f5c5f9184f44cf317de64d3a35199e894ad71188
End time : 13:30:54 2017 (2 seconds)
End rpmdb : 420:d04a95c25d4526ef87598f0dcaec66d3f99b98d4
User : root
Return-Code : Success
Command Line : update git
Transaction performed with:
 Installed rpm-4.8.0-55.el6.x86_64 @base
 Installed yum-3.2.29-81.el6.centos.noarch @base
 Installed yum-plugin-fastestmirror-1.1.30-40.el6.noarch @base
 Installed yum-presto-0.6.2-1.el6.noarch @anaconda-CentOS-201207061011.x86_64/6.3
Packages Altered:
 Updated git-1.7.1-8.el6.x86_64 @base
 Update 1.7.1-9.el6_9.x86_64 @updates
 Updated perl-Git-1.7.1-8.el6.noarch @base
 Update 1.7.1-9.el6_9.noarch @updates
history info

运行下面命令来回滚 git 包到上一个版本。

# yum history undo 13
Loaded plugins: fastestmirror, presto
Undoing transaction 53, from Fri Aug 18 13:30:52 2017
 Updated git-1.7.1-8.el6.x86_64 @base
 Update 1.7.1-9.el6_9.x86_64 @updates
 Updated perl-Git-1.7.1-8.el6.noarch @base
 Update 1.7.1-9.el6_9.noarch @updates
Loading mirror speeds from cached hostfile
 * base: repos.lax.quadranet.com
 * epel: fedora.mirrors.pair.com
 * extras: repo1.dal.innoscale.net
 * updates: mirror.vtti.vt.edu
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.7.1-8.el6 will be a downgrade
---> Package git.x86_64 0:1.7.1-9.el6_9 will be erased
---> Package perl-Git.noarch 0:1.7.1-8.el6 will be a downgrade
---> Package perl-Git.noarch 0:1.7.1-9.el6_9 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================
 Package Arch Version Repository Size
=================================================================================================
Downgrading:
 git x86_64 1.7.1-8.el6 base 4.6 M
 perl-Git noarch 1.7.1-8.el6 base 29 k
Transaction Summary
=================================================================================================
Downgrade 2 Package(s)
Total download size: 4.6 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 4.6 M
(1/2): git-1.7.1-8.el6.x86_64.rpm | 4.6 MB 00:00
(2/2): perl-Git-1.7.1-8.el6.noarch.rpm | 29 kB 00:00
-------------------------------------------------------------------------------------------------
Total 3.4 MB/s | 4.6 MB 00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
 Installing : perl-Git-1.7.1-8.el6.noarch 1/4
 Installing : git-1.7.1-8.el6.x86_64 2/4
 Cleanup : perl-Git-1.7.1-9.el6_9.noarch 3/4
 Cleanup : git-1.7.1-9.el6_9.x86_64 4/4
 Verifying : git-1.7.1-8.el6.x86_64 1/4
 Verifying : perl-Git-1.7.1-8.el6.noarch 2/4
 Verifying : git-1.7.1-9.el6_9.x86_64 3/4
 Verifying : perl-Git-1.7.1-9.el6_9.noarch 4/4
Removed:
 git.x86_64 0:1.7.1-9.el6_9 perl-Git.noarch 0:1.7.1-9.el6_9
Installed:
 git.x86_64 0:1.7.1-8.el6 perl-Git.noarch 0:1.7.1-8.el6
Complete!

回滚后,使用下面命令来检查降级包的版本。

# yum list git# rpm -q git
git-1.7.1-8.el6.x86_64

使用YUM downgrade 命令回滚升级

此外,我们也可以使用 YUM downgrade 命令回滚升级。

# yum downgrade git-1.7.1-8.el6 perl-Git-1.7.1-8.el6
Loaded plugins: search-disabled-repos, security, ulninfo
Setting up Downgrade Process
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.7.1-8.el6 will be a downgrade
---> Package git.x86_64 0:1.7.1-9.el6_9 will be erased
---> Package perl-Git.noarch 0:1.7.1-8.el6 will be a downgrade
---> Package perl-Git.noarch 0:1.7.1-9.el6_9 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================
 Package Arch Version Repository Size
=================================================================================================
Downgrading:
 git x86_64 1.7.1-8.el6 base 4.6 M
 perl-Git noarch 1.7.1-8.el6 base 29 k
Transaction Summary
=================================================================================================
Downgrade 2 Package(s)
Total download size: 4.6 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): git-1.7.1-8.el6.x86_64.rpm | 4.6 MB 00:00
(2/2): perl-Git-1.7.1-8.el6.noarch.rpm | 28 kB 00:00
-------------------------------------------------------------------------------------------------
Total 3.7 MB/s | 4.6 MB 00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
 Installing : perl-Git-1.7.1-8.el6.noarch 1/4
 Installing : git-1.7.1-8.el6.x86_64 2/4
 Cleanup : perl-Git-1.7.1-9.el6_9.noarch 3/4
 Cleanup : git-1.7.1-9.el6_9.x86_64 4/4
 Verifying : git-1.7.1-8.el6.x86_64 1/4
 Verifying : perl-Git-1.7.1-8.el6.noarch 2/4
 Verifying : git-1.7.1-9.el6_9.x86_64 3/4
 Verifying : perl-Git-1.7.1-9.el6_9.noarch 4/4
Removed:
 git.x86_64 0:1.7.1-9.el6_9 perl-Git.noarch 0:1.7.1-9.el6_9
Installed:
 git.x86_64 0:1.7.1-8.el6 perl-Git.noarch 0:1.7.1-8.el6
Complete!

注意: 你也需要降级依赖包,否则它会删掉当前版本的依赖包而不是对依赖包做降级,因为 downgrade 命令无法处理依赖关系。

至于 Fedora 用户

命令是一样的,只需要将包管理器名称从 yum 改成 dnf 就行了。

# dnf list git
# dnf history
# dnf history info
# dnf history undo
# dnf list git
# dnf downgrade git-1.7.1-8.el6 perl-Git-1.7.1-8.el6

How to display Date and Time in history command

如何在历史记录命令中显示日期和时间

January 20, 2020

We all are familiar with the history command. It stores all the commands executed by bash in the terminal into the .bash_history file, which helps us recheck the previously executed commands for further investigation.

我们都熟悉 history 命令。它将 bash 在终端执行的所有命令存储到 .bash_history 文件中,这将有助于我们重新检查用户之前执行的命令以进行进一步调查。

By default, the history command shows only the commands executed by users and does not print the date and time, although it logs the time when the command was run.

默认情况下,history 命令仅显示用户执行的命令,不会打印日期和时间,但会记录命令运行的时间。

Whenever you run the history command, it looks for an environment variable called HISTTIMEFORMAT, which tells it how to format the date and time with the history command.

每当你运行 history 命令时,它会寻找一个名为 HISTTIMEFORMAT 的环境变量,该变量用于指定如何在 history 命令中格式化日期和时间。

If the value is null or not set, it will show default results, like most systems do (without date and time).

如果该值为空或未设置,则会显示默认结果,就像大多数系统一样(不显示日期和时间)。

HISTTIMEFORMAT takes values from strftime (strftime – convert date and time to a string). When you have date and time in the history command output, it might help you track issues more easily.

HISTTIMEFORMAT 从 strftime(strftime — 将日期和时间转换为字符串)中获取值。当 history 命令的输出中包含日期和时间时,它可以帮助你更轻松地跟踪问题。

  • %T: Replaced by the time (%H:%M:%S).
    %T:替换为时间(%H:%M:%S)。

  • %F: Equivalent to %Y-%m-%d (the ISO 8601:2000 standard date format).
    %F:相当于 %Y-%m-%d(ISO 8601:2000 标准日期格式)。

See below for the default history command output.

请参阅下面的默认 history 命令输出。

# history
    1  yum install -y mysql-server mysql-client
    2  service mysqld start
    3  sysdig proc.name=sshd
    4  sysdig -c topprocs_net
    5  sysdig proc.name=sshd
    6  sysdig proc.name=sshd | more
    7  sysdig fd.name=/var/log/auth.log | more
    8  sysdig fd.name=/var/log/mysqld.log
    9  sysdig -cl
   10  sysdig -i httplog
   11  sysdig -i proc_exec_time
   12  sysdig -i topprocs_cpu
   13  sysdig -c topprocs_cpu
   14  sysdig -c tracers_2_statsd
   15  sysdig -c topfiles_bytes
   16  sysdig -c topprocs_cpu
   17  sysdig -c topprocs_cpu "fd.name contains sshd"
   18  sysdig -c topprocs_cpu "proc.name contains sshd"
   19  csysdig
   20  sysdig -c topprocs_cpu
   21  rpm --import https://s3.amazonaws.com/download.draios.com/DRAIOS-GPG-KEY.public
   22  curl -s -o /etc/yum.repos.d/draios.repo http://download.draios.com/stable/rpm/draios.repo
   23  yum install -y epel-release
   24  yum update
   25  yum makecache
   26  yum -y install kernel-devel-$(uname -r)
   27  yum -y install sysdig
   28  sysdig
   29  yum install httpd mysql
   30  service httpd start

We can set this environment variable in three ways based on our requirements.

我们可以根据需求以三种方式设置这个环境变量。

  • Temporarily for the current user
    临时对当前用户生效

  • Permanently for the current user or another user
    永久对当前用户或其他用户生效

  • Permanently for all users
    永久对所有用户生效

Note: Don’t forget to add a space before the last single quote, otherwise the output will be messy.

注意:不要忘记在最后一个单引号之前添加空格,否则输出会很混乱。

Method 1: Temporarily for the Current User

方法 1:临时对当前用户生效

Run the following command to set the HISTTIMEFORMAT variable temporarily for the current user. This setting will be lost after a reboot.

执行以下命令,将 HISTTIMEFORMAT 变量临时设置为当前用户。重启后该设置将失效。

# export HISTTIMEFORMAT='%F %T '

Method 2: Permanently for the Current User

方法 2:永久对当前用户生效

Append the following HISTTIMEFORMAT variable to the .bashrc or .bash_profile file to make it permanent for the current user.

将以下 HISTTIMEFORMAT 变量追加到 .bashrc 或 .bash_profile 文件中,使其对当前用户永久生效。

# echo 'HISTTIMEFORMAT="%F %T "' >> ~/.bashrc

or

# echo 'HISTTIMEFORMAT="%F %T "' >> ~/.bash_profile

Run the following command to apply the changes made to the file.

运行以下命令以使文件中的更改生效。

# source ~/.bashrc

or

# source ~/.bash_profile

Method 3: Permanently for All Users

方法 3:永久对所有用户生效

Append the following HISTTIMEFORMAT variable to the /etc/profile file to make it permanent for all users.

将以下 HISTTIMEFORMAT 变量追加到 /etc/profile 文件中,使其对所有用户永久生效。

# echo 'HISTTIMEFORMAT="%F %T "' >> /etc/profile

Run the following command to apply the changes made to the file.

运行以下命令以使文件中的更改生效。

# source /etc/profile

See the sample output below.

请参阅以下示例输出。

# history
    1  2017-08-16 15:30:15 yum install -y mysql-server mysql-client
    2  2017-08-16 15:30:15 service mysqld start
    3  2017-08-16 15:30:15 sysdig proc.name=sshd
    4  2017-08-16 15:30:15 sysdig -c topprocs_net
    5  2017-08-16 15:30:15 sysdig proc.name=sshd
    6  2017-08-16 15:30:15 sysdig proc.name=sshd | more
    7  2017-08-16 15:30:15 sysdig fd.name=/var/log/auth.log | more
    8  2017-08-16 15:30:15 sysdig fd.name=/var/log/mysqld.log
    9  2017-08-16 15:30:15 sysdig -cl
   10  2017-08-16 15:30:15 sysdig -i httplog
   11  2017-08-16 15:30:15 sysdig -i proc_exec_time
   12  2017-08-16 15:30:15 sysdig -i topprocs_cpu
   13  2017-08-16 15:30:15 sysdig -c topprocs_cpu
   14  2017-08-16 15:30:15 sysdig -c tracers_2_statsd
   15  2017-08-16 15:30:15 sysdig -c topfiles_bytes
   16  2017-08-16 15:30:15 sysdig -c topprocs_cpu
   17  2017-08-16 15:30:15 sysdig -c topprocs_cpu "fd.name contains sshd"
   18  2017-08-16 15:30:15 sysdig -c topprocs_cpu "proc.name contains sshd"
   19  2017-08-16 15:30:15 csysdig
   20  2017-08-16 15:30:15 sysdig -c topprocs_cpu
   21  2017-08-16 15:30:15 rpm --import https://s3.amazonaws.com/download.draios.com/DRAIOS-GPG-KEY.public
   22  2017-08-16 15:30:15 curl -s -o /etc/yum.repos.d/draios.repo http://download.draios.com/stable/rpm/draios.repo
   23  2017-08-16 15:30:15 yum install -y epel-release
   24  2017-08-16 15:30:15 yum update
   25  2017-08-16 15:30:15 yum makecache
   26  2017-08-16 15:30:15 yum -y install kernel-devel-$(uname -r)
   27  2017-08-16 15:30:15 yum -y install sysdig
   28  2017-08-16 15:30:15 sysdig
   29  2017-08-16 15:30:15 yum install httpd mysql
   30  2017-08-16 15:30:15 service httpd start

via:

  • How To Use YUM History Command To Rollback An Updates In RHEL/CentOS Systems | 2DayGeek
    https://www.2daygeek.com/rollback-fallback-updates-downgrade-packages-centos-rhel-fedora/

    作者:2daygeek 译者:lujun9972 校对:wxy 本文由 LCTT 原创编译,Linux中国. 荣誉推出 | 2018-01-18 08:47

  • How To Display Date And Time In History Command
    https://www.2daygeek.com/display-date-time-linux-bash-history-command/

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

驱动开发系列39 - Linux Graphics 3D 绘制流程(二)- 设置渲染管线

一:概述 Intel 的 Iris 驱动是 Mesa 中的 Gallium 驱动,主要用于 Intel Gen8+ GPU(Broadwell 及更新架构)。它负责与 i915 内核 DRM 驱动交互,并通过 Vulkan(ANV)、OpenGL(Iris Gallium)、或 OpenCL(Clover)来提供 3D 加速。在 Iris 驱动中,GPU Pipeline 设置 涉及…

中国的Cursor! 字节跳动推出Trae,开放Windows版(附资源),开发自己的网站,内置 GPT-4o 强大Al模型!

Trae是什么 Trae 是字节跳动推出的免费 AI IDE,通过 AI 技术提升开发效率。支持中文,集成了 Claude 3.5 和 GPT-4 等主流 AI 模型,完全免费使用。Trae 的主要功能包括 Builder 模式和 Chat 模式,其中 Builder 模式可帮助开发者从…

【洛谷排序算法】P1012拼数-详细讲解

洛谷 P1012 拼数这道题本身并非单纯考察某种经典排序算法(如冒泡排序、选择排序、插入排序、快速排序、归并排序等)的实现,而是在排序的基础上,自定义了排序的比较规则,属于自定义排序类型的题目。不过它借助了标准库中…

阿里云可观测全面拥抱 OpenTelemetry 社区

作者:古琦 在云计算、微服务、容器化等技术重塑 IT 架构的今天,系统复杂度呈指数级增长。在此背景下,开源可观测性技术已从辅助工具演变为现代 IT 系统的"数字神经系统",为企业提供故障预警、性能优化和成本治理的全方…

STM32开发学习(三)----使用STM32CUBEMX创建项目

前言 开始正式接触代码,学习代码开发,先熟悉STM32CUBEMX软件,控制开发板的GPIO。(STM32F103C8T6)。 正式开始 1.打开软件 2.点击ACCESS TO MCU SELECTOR,进入软件选择,可能会弹出更新,等待更新完成即可。…

初识Skywalking

背景 筒子们,最近雷袭又接触到一项新工具:Skywalking,本着好东西要和大家分享的原则,在对它有了初步了解,草草的进行了实践之后,就迫不及待的把它推荐给大家了。在写本篇博客时,本人对Skywalkin…

【论文笔记】ClipSAM: CLIP and SAM collaboration for zero-shot anomaly segmentation

原文链接 摘要 近年来,CLIP 和 SAM 等基础模型在零样本异常分割 (ZSAS) 任务中展现出良好的性能。然而,无论是基于 CLIP 还是基于 SAM 的 ZSAS 方法,仍然存在不可忽视的关键缺陷:1) CLIP 主要关注不同输入之间的全局特征对齐&am…

1分钟用DeepSeek编写一个PDF转Word软件

一、引言 如今,在线工具的普及让PDF转Word成为了一个常见需求,常见的pdf转word工具有收费的wps,免费的有pdfgear,见下文: PDFgear:一款免费的PDF编辑、格式转化软件-CSDN博客 还有网上在线的免费pdf转word工具smallp…

内容中台的企业CMS架构是什么?

企业CMS模块化架构 现代企业内容管理系统的核心在于模块化架构设计,通过解耦内容生产、存储、发布等环节构建灵活的技术栈。动态/静态发布引擎整合技术使系统既能处理实时更新的产品文档,也能生成高并发的营销落地页,配合版本控制机制确保内…

【Uniapp-Vue3】开发userStore用户所需的相关操作

在项目根路径下创建的stores文件夹中创建user.js文件 并将以下内容复制到user.js中 import {ref} from "vue" import { defineStore } from pinia; const uniIdCo uniCloud.importObject("uni-id-co") const db uniCloud.database(); const usersTable…

PhotoShop学习01

了解Photoshop 这里省略了Photoshop的软件安装,请自行查找资源下载。 1.打开图片 下图为启动photoshop后出现的界面,我们可以通过创建新文件或打开已有文件来启用photoshop的工作界面。 可以通过左边的按钮进行新文件的创建或打开已有文件。 也可以点…

使用ZFile打造属于自己的私有云系统结合内网穿透实现安全远程访问

文章目录 前言1.关于ZFile2.本地部署ZFile3.ZFile本地访问测试4.ZFile的配置5.cpolar内网穿透工具安装6.创建远程连接公网地址7.固定ZFile公网地址 前言 在数字化的今天,我们每个人都是信息的小能手。无论是职场高手、摄影达人还是学习狂人,每天都在创造…

PyTorch 源码学习:GPU 内存管理之它山之石——TensorFlow BFC 算法

TensorFlow 和 PyTorch 都是常用的深度学习框架,各自有一套独特但又相似的 GPU 内存管理机制(BFC 算法)。它山之石可以攻玉。了解 TensorFlow 的 BFC 算法有助于学习 PyTorch 管理 GPU 内存的精妙之处。本文重点关注 TensorFlow BFC 算法的核…

Go语言--语法基础1

1、语言介绍 什么go语言 go(又称 Golang )是 Google开发的一种静态强类型、编译型、并发型,并具有 垃圾回收功能的编程语言. Go语言有一个吉祥物,下图所示的 Go Gopher 是加拿大的小动物,中文名叫作 囊地鼠 。 诞…

跟着官方文档学习UE C++ TArray容器系列 迭代

一.首先测试下&#xff0c;官方案例 迭代器的方法&#xff0c;有点不常见。有点像个指针&#xff0c;迭代完还自带break. oid AWXTArrayActor::WXLoopArray() {FString JoinedStr1;FString JoinedStr2;TArray<FString> StrArr { "Hello","Baby",&q…

esp工程报错:something went wrong when trying to build the project esp-idf 一种解决办法

最近上手了正点原子esp32s3板子&#xff0c;环境采用的是vscodeesp-idf插件。导入了正点原子的demo测试&#xff0c;每次都报这个错误无法建造。也不是网上说的ninja error&#xff0c;不是中文路径的问题。 在终端中查看&#xff0c;发现是缺少了git。&#xff08;我这里没有…

[ComfyUI]官方已支持Skyreels混元图生视频,速度更快,效果更好(附工作流)

一、介绍 昨天有提到官方已经支持了Skyreels&#xff0c;皆大欢喜&#xff0c;效果更好一些&#xff0c;还有GGUF量化版本&#xff0c;进一步降低了大家的显存消耗。 今天就来分享一下官方流怎么搭建&#xff0c;我体验下来感觉更稳了一些&#xff0c;生成速度也更快&#xf…

SpringBatch简单处理多表批量动态更新

项目需要处理一堆表&#xff0c;这些表数据量不是很大都有经纬度信息&#xff0c;但是这些表的数据没有流域信息&#xff0c;需要按经纬度信息计算所属流域信息。比较简单的项目&#xff0c;按DeepSeek提示思索完成开发&#xff0c;AI真好用。 阿里AI个人版本IDEA安装 IDEA中使…

在Linux桌面上创建Idea启动快捷方式

1、在桌面新建idea.desktop vim idea.desktop [Desktop Entry] EncodingUTF-8 NameIntelliJ IDEA CommentIntelliJ IDEA Exec/home/software/idea-2021/bin/idea.sh Icon/home/software/idea-2021/bin/idea.svg Terminalfalse TypeApplication CategoriesApplication;Developm…

将DeepSeek接入vscode的N种方法

接入deepseek方法一:cline 步骤1:安装 Visual Studio Code 后,左侧导航栏上点击扩展。 步骤2:搜索 cline,找到插件后点击安装。 步骤3:在大模型下拉菜单中找到deep seek,然后下面的输入框输入你在deepseek申请的api key,就可以用了 让deepseek给我写了一首关于天气的…