podman对容器映像签名和分发

熟悉podman

此示例容器将运行一个非常基本的 httpd 服务器,该服务器仅为其索引页提供服务

[root@mr ~]# podman ps -a
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
[root@mr ~]# podman run -dt -p 8080:8080/tcp -e HTTPD_VAR_RUN=/run/httpd -e HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \
>                   -e HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \
>                   -e HTTPD_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/httpd/ \
>                   registry.fedoraproject.org/f29/httpd /usr/bin/run-httpd
Trying to pull registry.fedoraproject.org/f29/httpd:latest...

Getting image source signatures
Copying blob d77ff9f653ce done
Copying blob aaf5ad2e1aa3 done
Copying blob 7692efc5f81c done
Copying config 25c76f9dcd done
Writing manifest to image destination
Storing signatures
78dda9890d0f6cb13e47b347445ac93f43e4d993f4da5405943bf98c5bc9ab1a
[root@mr ~]#

由于容器在分离模式下运行(在命令中由 -d 表示),因此 Podman 将在运行后打印容器 ID。请注意,我们使用端口转发来访问 HTTP 服务器。要成功运行,至少需要 slirp4netns v0.3.0。

[root@mr ~]# rpm -qa|grep slirp4netns
slirp4netns-1.1.8-2.module_el8.7.0+1106+45480ee0.x86_64

检查正在运行的容器您可以”检查”正在运行的容器,以获取有关其自身的元数据和详细信息。我们甚至可以使用 inspect 子命令来查看分配给容器的 IP 地址。由于容器在无根模式下运行,因此不会分配 IP 地址,并且该值将在检查的输出中列为”无”。

[root@mr ~]# podman inspect -l|grep -i ipaddress
               "IPAddress": "10.88.0.4",
                         "IPAddress": "10.88.0.4",
[root@mr ~]#

注意:-l 是最新容器的便利参数。还可以使用容器的 ID 而不是 -l。

podman对容器映像签名和分发

查看容器的日志您还可以使用 Podman 查看容器的日志:

[root@mr ~]# podman logs -l
=> sourcing 10-set-mpm.sh ...

=> sourcing 20-copy-config.sh ...

=> sourcing 40-ssl-certs.sh ...

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.88.0.4. Set the 'ServerName' directive globally to suppress this message
[Mon Aug 15 16:09:45.049113 2022] [ssl:warn] [pid 1:tid 140289699057024] AH01882: Init: this version of mod_ssl was compiled against a newer library (OpenSSL 1.1.1b FIPS  26 Feb 2019, version currently loaded is OpenSSL 1.1.1 FIPS  11 Sep 2018) - may result in undefined or erroneous behavior
[Mon Aug 15 16:09:45.053794 2022] [ssl:warn] [pid 1:tid 140289699057024] AH01909: 10.88.0.4:8443:0 server certificate does NOT include an ID which matches the server name
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.88.0.4. Set the 'ServerName' directive globally to suppress this message
[Mon Aug 15 16:09:45.135165 2022] [ssl:warn] [pid 1:tid 140289699057024] AH01882: Init: this version of mod_ssl was compiled against a newer library (OpenSSL 1.1.1b FIPS  26 Feb 2019, version currently loaded is OpenSSL 1.1.1 FIPS  11 Sep 2018) - may result in undefined or erroneous behavior
[Mon Aug 15 16:09:45.136249 2022] [ssl:warn] [pid 1:tid 140289699057024] AH01909: 10.88.0.4:8443:0 server certificate does NOT include an ID which matches the server name
[Mon Aug 15 16:09:45.136619 2022] [lbmethod_heartbeat:notice] [pid 1:tid 140289699057024] AH02282: No slotmem from mod_heartmonitor
[Mon Aug 15 16:09:45.143579 2022] [mpm_event:notice] [pid 1:tid 140289699057024] AH00489: Apache/2.4.39 (Fedora) OpenSSL/1.1.1 configured -- resuming normal operations
[Mon Aug 15 16:09:45.143701 2022] [core:notice] [pid 1:tid 140289699057024] AH00094: Command line: 'httpd -D FOREGROUND'
[Mon Aug 15 16:13:55.037879 2022] [autoindex:error] [pid 49:tid 140289360692992] [client 192.168.29.1:62999] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
192.168.29.1 - - [15/Aug/2022:16:13:55 +0000] "GET / HTTP/1.1" 403 4650 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36 Edg/104.0.1293.54"
192.168.29.1 - - [15/Aug/2022:16:13:55 +0000] "GET /icons/apache_pb2.gif HTTP/1.1" 200 4234 "http://192.168.29.138:8080/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36 Edg/104.0.1293.54"
192.168.29.1 - - [15/Aug/2022:16:13:55 +0000] "GET /icons/poweredby.png HTTP/1.1" 200 2616 "http://192.168.29.138:8080/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36 Edg/104.0.1293.54"
192.168.29.1 - - [15/Aug/2022:16:13:55 +0000] "GET /favicon.ico HTTP/1.1" 404 209 "http://192.168.29.138:8080/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36 Edg/104.0.1293.54"
[root@mr ~]#

[root@mr ~]# podman top -l
USER        PID         PPID        %CPU        ELAPSED          TTY         TIME        COMMAND
default     1           0           0.000       6m41.225719555s  pts/0       0s          httpd -D FOREGROUND
default     23          1           0.000       6m41.225933692s  pts/0       0s          /usr/bin/coreutils --coreutils-prog-shebang=cat /usr/bin/cat
default     24          1           0.000       6m41.225970422s  pts/0       0s          /usr/bin/coreutils --coreutils-prog-shebang=cat /usr/bin/cat
default     25          1           0.000       6m41.226000575s  pts/0       0s          /usr/bin/coreutils --coreutils-prog-shebang=cat /usr/bin/cat
default     26          1           0.000       6m41.22807663s   pts/0       0s          /usr/bin/coreutils --coreutils-prog-shebang=cat /usr/bin/cat
default     27          1           0.000       6m41.228195335s  pts/0       0s          httpd -D FOREGROUND
default     28          1           0.000       6m41.228245362s  pts/0       0s          httpd -D FOREGROUND
default     31          1           0.000       6m41.228288782s  pts/0       0s          httpd -D FOREGROUND
default     49          1           0.000       6m41.228320044s  pts/0       0s          httpd -D FOREGROUND
[root@mr ~]#

对容器执行检查点操作对容器执行检查点操作会停止容器,同时将容器中所有进程的状态写入磁盘。这样,容器以后可以还原,并在与检查点完全相同的时间点继续运行。此功能要求在系统上安装 CRIU 3.11 或更高版本。不支持此功能作为无根;因此,如果您想尝试一下,则需要使用相同的命令(但使用sudo)以root身份重新创建容器。要对容器使用检查点,请使用

[root@mr ~]# podman ps
CONTAINER ID  IMAGE                                        COMMAND               CREATED        STATUS            PORTS                   NAMES
78dda9890d0f  registry.fedoraproject.org/f29/httpd:latest  /usr/bin/run-http...  8 minutes ago  Up 8 minutes ago  0.0.0.0:8080->8080/tcp  hungry_bell
[root@mr ~]# podman container checkpoint -l
78dda9890d0f6cb13e47b347445ac93f43e4d993f4da5405943bf98c5bc9ab1a
[root@mr ~]# ls
anaconda-ks.cfg  container-web.service

恢复容器恢复容器仅适用于以前是检查点的容器。恢复的容器将继续与检查点操作同时运行。

[En]

Restore Container restore containers apply only to containers that were previously checkpoints. The restored container will continue to run at the same time as the checkpoint operation.

[root@mr ~]# podman container restore -l
78dda9890d0f6cb13e47b347445ac93f43e4d993f4da5405943bf98c5bc9ab1a
[root@mr ~]# podman ps -a
CONTAINER ID  IMAGE                                        COMMAND               CREATED         STATUS             PORTS                   NAMES
78dda9890d0f  registry.fedoraproject.org/f29/httpd:latest  /usr/bin/run-http...  10 minutes ago  Up 10 minutes ago  0.0.0.0:8080->8080/tcp  hungry_bell

迁移容器实时将容器从一台主机迁移到另一台主机,容器将在迁移的源系统上设置检查点,将其传输到目标系统,然后在目标系统上进行恢复。传输检查点时,您可以指定输出文件。

[En]

The migration container migrates the container from one host to another in real time, and the container will checkpoint on the migrated source system, transfer it to the destination system, and then restore it on the destination system. When you transfer checkpoints, you can specify the output file.

停止容器
要停止 httpd 容器,请执行以下操作:
podman stop –latest
您还可以使用 ps 子命令检查一个或多个容器的状态。在这种情况下,我们应该使用 -a 参数列出所有容器。
podman ps -a

移除容器删除 httpd 容器:
podman rm –latest
您可以通过运行 podman ps -a 来验证容器的删除。

[root@mr ~]# podman rmi docker.io/alpine localhost:5000/alpine
Untagged: docker.io/library/alpine:latest
Untagged: localhost:5000/alpine:latest
Deleted: c059bfaa849c4d8e4aecaeb3a10c2d9b3d85f5165c66ad3a4d937758128c4d18
[root@mr ~]#

如何使用 Podman 对容器映像进行签名和分发

对容器映像进行签名源于仅信任专用映像提供程序的动机,以缓解中间人 (MITM) 攻击或对容器注册表的攻击。对图像进行签名的一种方法是使用 GNU 隐私卫士 (GPG) 密钥。此技术通常与任何符合 OCI 的容器注册表(如 Quay.io)兼容。值得一提的是,OpenShift 集成容器注册表开箱即用地支持这种签名机制,这使得单独的签名存储变得不必要。从技术角度来看,我们可以在将映像推送到远程注册表之前利用 Podman 对映像进行签名。之后,所有运行Podman的系统都必须配置为从远程服务器检索签名,远程服务器可以是任何简单的Web服务器。这意味着在映像拉取操作期间,每个未签名的映像都将被拒绝。但是这是如何工作的呢?首先,我们必须创建一个GPG密钥对或选择一个本地可用的密钥对。要生成新的GPG密钥,只需运行并按照交互式对话框进行操作即可。现在我们应该能够验证密钥是否在本地存在

[root@mr ~]# podman run -d -p 5000:5000 docker.io/registry
Trying to pull docker.io/library/registry:latest...

Getting image source signatures
Copying blob 3790aef225b9 done
Copying blob e2ead8259a04 done
Copying blob 79e9f2f55bf5 done
Copying blob 0d96da54f60b done
Copying blob 5b27040df4a2 done
Copying config b8604a3fe8 done
Writing manifest to image destination
Storing signatures
673e89cc9f072e6474e59413691a2fb08af9dda10f5e9898eb827bb84e2d4388
[root@mr ~]# ss -antl
State      Recv-Q     Send-Q         Local Address:Port          Peer Address:Port     Process
LISTEN     0          128                  0.0.0.0:5000               0.0.0.0:*
LISTEN     0          128                  0.0.0.0:8080               0.0.0.0:*
LISTEN     0          128                  0.0.0.0:22                 0.0.0.0:*
LISTEN     0          128                     [::]:22                    [::]:*
[root@mr ~]# podman pull docker://docker.io/alpine:latest
Trying to pull docker.io/library/alpine:latest...

Getting image source signatures
Copying blob 59bf1c3509f3 done
Copying config c059bfaa84 done
Writing manifest to image destination
Storing signatures
c059bfaa849c4d8e4aecaeb3a10c2d9b3d85f5165c66ad3a4d937758128c4d18
[root@mr ~]# podman images
REPOSITORY                            TAG         IMAGE ID      CREATED        SIZE
docker.io/library/busybox             latest      7a80323521cc  2 weeks ago    1.47 MB
docker.io/library/httpd               latest      dabbfbe0c57b  7 months ago   148 MB
docker.io/library/alpine              latest      c059bfaa849c  8 months ago   5.87 MB
docker.io/library/registry            latest      b8604a3fe854  9 months ago   26.8 MB
docker.io/library/centos              latest      5d0da3dc9764  11 months ago  239 MB
quay.io/centos/centos                 latest      300e315adb2f  20 months ago  217 MB
registry.fedoraproject.org/f29/httpd  latest      25c76f9dcdb5  3 years ago    482 MB
[root@mr ~]# podman images alpine
REPOSITORY                TAG         IMAGE ID      CREATED       SIZE
docker.io/library/alpine  latest      c059bfaa849c  8 months ago  5.87 MB
[root@mr ~]# podman tag alpine localhost:5000/alpine
[root@mr ~]# podman images alpine
REPOSITORY                TAG         IMAGE ID      CREATED       SIZE
docker.io/library/alpine  latest      c059bfaa849c  8 months ago  5.87 MB
localhost:5000/alpine     latest      c059bfaa849c  8 months ago  5.87 MB
[root@mr ~]#
[root@mr ~]# cd /etc/containers/
[root@mr containers]# ls
certs.d  oci  policy.json  registries.conf  registries.conf.d  registries.d  storage.conf
[root@mr containers]# cd registries.d
[root@mr registries.d]# ls
default.yaml  registry.access.redhat.com.yaml  registry.redhat.io.yaml
[root@mr registries.d]# vim default.yaml
 sigstore: http://localhost:8000
  sigstore-staging: file:///var/lib/containers/sigstore
[root@mr ~]# gpg --full-gen-key
gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
  (14) Existing key from card
Your selection?

RSA keys may be between 1024 and 4096 bits long.

What keysize do you want? (2048)
Requested keysize is 2048 bits
Please specify how long the key should be valid.

         0 = key does not expire
        = key expires in n days
      w = key expires in n weeks
      m = key expires in n months
      y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y

GnuPG needs to construct a user ID to identify your key.

Real name: marui
Email address: marui
Not a valid email address
Email address: 3215547886@qq.com
Comment: marui
You selected this USER-ID:
    "marui (marui) "

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.

gpg: key 5FFF7EFCD429C026 marked as ultimately trusted
gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/146DAAB2D98BED4A566AD5DC5FFF7EFCD429C026.rev'
public and secret key created and signed.

pub   rsa2048 2022-08-15 [SC]
      146DAAB2D98BED4A566AD5DC5FFF7EFCD429C026
uid                      marui123 (jjyy)
sub   rsa2048 2022-08-15 [E]

[root@mr ~]# gpg --list-keys marui
gpg: checking the trustdb
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
pub   rsa2048 2022-08-15 [SC]
      146DAAB2D98BED4A566AD5DC5FFF7EFCD429C026
uid           [ultimate] marui123 (jjyy)
sub   rsa2048 2022-08-15 [E]

[root@mr ~]# podman push     --tls-verify=false     --sign-by marui123     localhost:5000/alpine
Getting image source signatures
Copying blob 8d3ac3489996 done
Copying config c059bfaa84 done
Writing manifest to image destination

Storing signatures
[root@mr ~]# ls /var/lib/containers/sigstore
'alpine@sha256=a65d71e7a88c3a63246ec299abb0dcec671579ac0af199d96e2a82339f061199'
[root@mr ~]# dnf module install python38 -y

[root@mr ~]# cd /var/lib/containers/
[root@mr containers]# ls
cache  sigstore  storage
[root@mr containers]# cd sigstore/
[root@mr sigstore]# ls
'alpine@sha256=a65d71e7a88c3a63246ec299abb0dcec671579ac0af199d96e2a82339f061199'
[root@mr sigstore]# ss -antl
State       Recv-Q      Send-Q             Local Address:Port             Peer Address:Port      Process
LISTEN      0           128                      0.0.0.0:5000                  0.0.0.0:*
LISTEN      0           128                      0.0.0.0:8080                  0.0.0.0:*
LISTEN      0           128                      0.0.0.0:22                    0.0.0.0:*
LISTEN      0           128                         [::]:22                       [::]:*
[root@mr sigstore]# python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...

[root@mr ~]# ss -antl
State       Recv-Q      Send-Q             Local Address:Port             Peer Address:Port      Process
LISTEN      0           5                        0.0.0.0:8000                  0.0.0.0:*
LISTEN      0           128                      0.0.0.0:5000                  0.0.0.0:*
LISTEN      0           128                      0.0.0.0:8080                  0.0.0.0:*
LISTEN      0           128                      0.0.0.0:22                    0.0.0.0:*
LISTEN      0           128                         [::]:22                       [::]:*
[root@mr ~]# firewall-cmd --add-rich-rule 'rule family=ipv4 source address=192.168.29.0/24 port port=8000 protocol=tcp accept' --permanent
success
[root@mr ~]# firewall-cmd --reload
success

podman对容器映像签名和分发

Original: https://www.cnblogs.com/marymary/p/16590244.html
Author: 溜溜威
Title: podman对容器映像签名和分发



相关阅读

Title: linux 使用mailx发送邮件

1.安装对应的工具
[root@CentOS7 ~]# yum install postfix  mailx -y

[root@CentOS7 ~]# systemctl enable postfix --now

mailx是一个发送邮件的客户端工具
postfix是邮件服务器软件,用来传送邮件的
2.编辑配置文件
[root@CentOS7 ~]# vim /etc/mail.rc

set from=270706881@qq.com #  //对方收到邮件时显示的发件人

set smtp=smtp.qq.com //第三方发邮件的smtp服务器地址

set smtp-auth-user=270706881@qq.com  //第三方发邮件的用户名

set smtp-auth-password=xxxxx  //用户名对应的密码,有些邮箱填的是授权码,需要在邮箱设置中开放
3.发送邮件
格式:mail -s 主题  收件地址
正文
遇到(.)结束
范例:实现给qq邮箱发送邮件

1.qq邮箱需要开启账户的POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务。
进入QQ邮箱->设置->账户->POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务

linux 使用mailx发送邮件
podman对容器映像签名和分发

2.编辑mail的配置文件

[root@CentOS7 ~]# vim /etc/mail.rc
set from=27070881@qq.com
set smtp=smtp.qq.com
set smtp-auth-user=270706881@qq.com
set smtp-auth-password=fyqeguxkkytobjac

3.发送邮件

[root@CentOS7 ~]# mail -s "hello world" 270706881@qq.com < anaconda-ks.cfg

#&#x5982;&#x679C;&#x672A;&#x53D1;&#x9001;&#x6210;&#x529F;&#x6709;&#x5BF9;&#x5E94;&#x7684;&#x63D0;&#x793A;

linux 使用mailx发送邮件
范例:实现linux指定用户发送邮件

给本机的其他用户发送邮件不用配置mailx,只需要:mail 主题 用户名 就行

[root@CentOS7 ~]# mail -s 'hello tom' tom
1234567
.
EOT
[root@CentOS7 ~]# su - tom
Last login: Wed Sep 28 09:12:50 CST 2022 on pts/0
[tom@CentOS7 ~]$ mail
Heirloom Mail version 12.5 7/5/10.  Type ? for help.

"/var/spool/mail/tom": 2 messages
>   1 root                  Tue Sep 27 23:36  19/541   "hello"
    2 root                  Wed Sep 28 09:12  19/537   "hello tom"
& 2
Message  2:
From root@CentOS7.cc  Wed Sep 28 09:12:34 2022
Return-Path: <root@centos7.cc>
X-Original-To: tom
Delivered-To: tom@CentOS7.cc
Date: Wed, 28 Sep 2022 09:12:34 +0800
To: tom@CentOS7.cc
Subject: hello tom
User-Agent: Heirloom mailx 12.5 7/5/10
Content-Type: text/plain; charset=us-ascii
From: root@CentOS7.cc (root)
Status: RO

hello.

&
</root@centos7.cc>

Original: https://www.cnblogs.com/heyongshen/p/16736844.html
Author: 背对背依靠
Title: linux 使用mailx发送邮件

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/133334/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • 利用Tensorboard可视化模型、数据和训练过程

    在60分钟闪电战中,我们像你展示了如何加载数据,通过为我们定义的 nn.Module的子类的model提供数据,在训练集上训练模型,在测试集上测试模型。为了了解发生了什么,我们在模…

    Linux 2022年11月7日
    0100
  • Shell 脚本大全之检测两台服务器指定目录下的文件一致性

    Shell 脚本大全之检测两台服务器指定目录下的文件一致性 bash;gutter:true;</p> <h1>!/bin/bash</h1> …

    Linux 2022年9月14日
    0114
  • 惊了!修仙=编程??

    大家好,我是良许。 印象中,我们接触到的编程书籍都是这样的: 这样的书籍,去除阅读属性之后,还可以用来垫电脑屏幕、垫桌脚、盖泡面、砸产品经理,实乃居家、旅行、自卫必备神器! [En…

    Linux 2022年9月10日
    0134
  • HCNP Routing&Switching之BGP路由过滤和AS-Path-Filter

    前文我们聊了下通过修改BGP路由属性来影响路由,从而达到控制BGP路由的目的;回顾请参考https://www.cnblogs.com/qiuhom-1874/p/15495585…

    Linux 2022年8月26日
    0154
  • [Linux]利用ping给端口加密,限制访问

    Linux中,想对特定的端口加密访问,可以使用iptables的ping方式。 下边是对SSH的22端口加入ping规则 其它端口可自行修改设定 1) iptables-recen…

    Linux 2022年8月26日
    0222
  • Linux上的SQL Server——预告片

    大家可能都听说了,微软在几个星期前宣布发布可以在Linux上完整运行的SQL Server!如果你想看下在Linux上SQL Server如何运行,进行查询是什么样的体验,可以看下…

    Linux 2022年8月24日
    0159
  • linux中安装NodeJS

    一、下载 官网:https://nodejs.org/en/download/ 单击 点击Downloads 点击即可下载,下载后如下所示: 2、上传到服务器 3、解压 tar -…

    2022年8月20日
    091
  • git review & devops过程

    自己搭建的devops环境是gitlab/gerrit/jenkins 首先自己checkout一个自己的代码分支,一般不要在master上做直接修改 修改后git add fil…

    Linux 2022年8月30日
    0158
  • Git-简单的利用SourceTree提交代码(转载)

    http://www.cnblogs.com/shenyangxiaohuo/p/5239723.html posted on2017-05-10 17:23 大米稀饭 阅读(12…

    Linux 2022年8月30日
    0155
  • Linux下yum安装Nginx

    1、Centos6系统库中默认是没有nginx的rpn包的,所以我们需要先更新下rpm依赖库(1):使用yum安装nginx,安装nginx库 rpm -Uvh http://ng…

    2022年8月24日
    0149
  • redis之SDS

    SDS:的优点1.获取长度复杂度为O(1)2.避免strcat内存重分配(可能涉及系统调用), 通过[预分配策略]和[惰性空间释放]实现 3.以二进制存储,主要是安全设计,若存储的…

    Linux 2022年9月14日
    0114
  • 了解Redis这个核心数据类型

    string 字符串 tring 类型是二进制安全的,即 string&#xA0;中可以包含任何数据。 Redis 中的普通 string 采用 raw encoding …

    Linux 2022年9月14日
    0110
  • 如何访问github.io类的网站

    上网查找后看到有两种说法: 找到/etc/hosts文件,Windows一般在/Windows/System32/drivers/etc目录下,MAC在/private/etc目录…

    Linux 2022年10月21日
    0103
  • Centos 6 DNS 配置 解决 Unknown host

    测试服务器Maven 打包时遇到了如下的错误 看上去应该是对 maven.aliyun.com的DNS 域名解析出问题了。 登录到服务器上 ping maven.aliyun.co…

    Linux 2022年9月10日
    0114
  • linux挂载文件系统

    当使用光驱等硬件设备时,必须将其挂载到系统中,只有这样Linux才能识别。 1、给虚拟机中centos7系统添加一块新的硬盘,添加以后必须重启centos7才能生效 2、在root…

    Linux 2022年9月10日
    0152
  • PyTorch介绍-保存和加载模型

    本节我们将会看到如何保存模型状态、加载和运行模型预测 import torch import torchvision.models as models 保存和加载模型权重 PyTo…

    Linux 2022年11月7日
    079
最近整理资源【免费获取】:   👉 程序员最新必读书单  | 👏 互联网各方向面试题下载 | ✌️计算机核心资源汇总