<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Posts on An open source technology learning website</title>
    <link>/post/</link>
    <description>Recent content in Posts on An open source technology learning website</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>zengyiheng &lt;br&gt; &lt;a href=&#39;http://www.beian.miit.gov.cn/&#39;&gt;蜀ICP备18017416号-1&lt;/a&gt;</copyright>
    <lastBuildDate>Thu, 26 Oct 2023 15:49:00 +0000</lastBuildDate>
    
	<atom:link href="/post/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>在LXD环境中安装K8s测试集群</title>
      <link>/post/20231026-kubernetes-inside-lxd/</link>
      <pubDate>Thu, 26 Oct 2023 15:49:00 +0000</pubDate>
      
      <guid>/post/20231026-kubernetes-inside-lxd/</guid>
      <description>&lt;p&gt;尝试在LXD环境中配置k8s， 需要解决两个主要的问题&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;配置LXD的 profile ，解决 k8s 运行时缺少权限的问题&lt;/li&gt;
&lt;li&gt;配置 lxc 容器，解决 kubelet 无法读取 kmsg 的问题&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>在ubuntu系统中安装RootCA证书到信任库</title>
      <link>/post/20221214-installing-a-root-ca-certificate-in-the-trust-store/</link>
      <pubDate>Wed, 14 Dec 2022 04:07:00 +0000</pubDate>
      
      <guid>/post/20221214-installing-a-root-ca-certificate-in-the-trust-store/</guid>
      <description>&lt;p&gt;企业环境中会建立本地证书颁发机构 (CA)，用来颁发证书在组织内部使用。&lt;/p&gt;

&lt;p&gt;为了让 Ubuntu 服务器在企业环境中成为信任的主机并正常运行，这个 CA 必须安装在 Ubuntu 系统的信任库中。&lt;/p&gt;

&lt;p&gt;本文记录了 Ubuntu 系统下的一些具体操作方法：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;如何识别 PEM 和 DER 格式&lt;/li&gt;
&lt;li&gt;如何安装 PEM 格式的证书&lt;/li&gt;
&lt;li&gt;如何将 DER 格式转换为 PEM 格式&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Linux命令中的正则表达式</title>
      <link>/post/20210804-use-regex-pattern-in-linux-command/</link>
      <pubDate>Wed, 04 Aug 2021 03:37:00 +0000</pubDate>
      
      <guid>/post/20210804-use-regex-pattern-in-linux-command/</guid>
      <description>&lt;p&gt;在Linux命令行中，有许多场景会应用到正则表达式：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;apt-cache&lt;/li&gt;
&lt;li&gt;grep&lt;/li&gt;
&lt;li&gt;find&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;笔者在本文中收集一些具体的应用场景&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>ubuntu20.04配置远程唤醒</title>
      <link>/post/20210331-how-to-set-up-wake-on-lan/</link>
      <pubDate>Wed, 31 Mar 2021 03:37:00 +0000</pubDate>
      
      <guid>/post/20210331-how-to-set-up-wake-on-lan/</guid>
      <description>&lt;p&gt;开启计算机远程唤醒功能，有几个必要条件：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;主板要支持，同时 BIOS 中远程唤醒开关已经打开；&lt;/li&gt;
&lt;li&gt;网卡要支持，同时 远程唤醒配置为 Wake-on: g （magic packet activity）&lt;/li&gt;
&lt;li&gt;发出指令的计算机，事先保存了远程唤醒主机的 MAC 地址 ；&lt;/li&gt;
&lt;li&gt;两台主机在同一个二层网络中&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>在 Docker Build 期间如何配置 tzdata</title>
      <link>/post/20210201-how-to-configure-tzdata-during-docker-build/</link>
      <pubDate>Mon, 01 Feb 2021 03:37:00 +0000</pubDate>
      
      <guid>/post/20210201-how-to-configure-tzdata-during-docker-build/</guid>
      <description>&lt;p&gt;今天在运行 docker  build 的时候，遇到了 CI 流程暂停的问题。&lt;/p&gt;

&lt;p&gt;原因是由于 Dockerfile 中 apt-get 添加的程序中附带安装了 tzdata 。默认情况下，它安装过程需要交互界面进行参数选择。&lt;/p&gt;

&lt;p&gt;在无人干预的 CI 流程中，需要做以下一些更改：&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>使用libnss-libvirt为KVM虚拟机注册IP地址</title>
      <link>/post/20200829-use-libnss-libvirt-get-vm-ip/</link>
      <pubDate>Sat, 29 Aug 2020 03:37:00 +0000</pubDate>
      
      <guid>/post/20200829-use-libnss-libvirt-get-vm-ip/</guid>
      <description>&lt;p&gt;如果你希望通过：&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ssh user@virtualMachine
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;这样的方式连接到 libvirt 建立的 KVM虚拟机，那么你需要先获取到 虚拟机的IP 地址。&lt;/p&gt;

&lt;p&gt;如果虚拟机网络接口配置的是 NAT 模式的话，可以通过 &lt;code&gt;virsh domifaddr VM-Name&lt;/code&gt; 的命令得到它的 IP 地址。&lt;/p&gt;

&lt;p&gt;有没有更加简单的方法，让我们能更方便地使用呢？&lt;/p&gt;

&lt;p&gt;答案就是：使用libnss-libvirt为KVM主机注册虚拟机的地址&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>如何基于SSH网络会话远程应用tar命令</title>
      <link>/post/20200613-how-to-use-tar-command-through-network-over-ssh-session/</link>
      <pubDate>Sat, 13 Jun 2020 02:56:16 +0000</pubDate>
      
      <guid>/post/20200613-how-to-use-tar-command-through-network-over-ssh-session/</guid>
      <description>&lt;p&gt;在维护Linux计算机的时候，可能会遇到这样的场景：远程计算机需要进行备份和清理，但磁盘空间快满了，没有足够的空间完成“tar备份打包”这样的操作了。&lt;/p&gt;

&lt;p&gt;这时，基于 ssh 会话完成远程数据 tar 打包，通过 重定向 将数据备份到 ssh 客户端所在的磁盘上，就能完美地完成任务了。&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>如何在KVM环境中快速创建虚拟机</title>
      <link>/post/20200318-how-to-quickly-create-virtual-machine-in-kvm-virtualized-environment/</link>
      <pubDate>Wed, 18 Mar 2020 02:03:00 +0000</pubDate>
      
      <guid>/post/20200318-how-to-quickly-create-virtual-machine-in-kvm-virtualized-environment/</guid>
      <description>&lt;p&gt;计算机虚拟技术在软件测试，业务部署，远程办公等多应用中已经成为IT技术员工具箱中的基础工具。&lt;/p&gt;

&lt;p&gt;这篇文章介绍KVM中如何快速创建新虚拟机。&lt;/p&gt;

&lt;p&gt;主要涉及的知识点有：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;qemu-img 创建 overlay qcow2 磁盘&lt;/li&gt;
&lt;li&gt;cloud-init 配置&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;下面以创建 ubuntu18.04 虚拟机为例，进行介绍。&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>如何将普通应用部署到 k8s master 上</title>
      <link>/post/20200116-how-to-deploy-common-applications-to-the-k8s-master-node/</link>
      <pubDate>Thu, 16 Jan 2020 06:53:17 +0000</pubDate>
      
      <guid>/post/20200116-how-to-deploy-common-applications-to-the-k8s-master-node/</guid>
      <description>&lt;p&gt;我们知道， 使用 kubeadm 建立的 k8s 集群，master 节点会被标注上 node-role.kubernetes.io/master:NoSchedule 的 taint&lt;/p&gt;

&lt;p&gt;一种办法是将这个 taint 取消掉：&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;kubectl taint nodes --all node-role.kubernetes.io/master-
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;另一种方法是指定 toleration 描述让它能够容忍上面的 taint 。我觉得这种方式更好一些。&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Linux系统下如何测试磁盘速度</title>
      <link>/post/20191221-how-to-measure-hard-disk-speed-on-linux/</link>
      <pubDate>Sat, 21 Dec 2019 10:51:26 +0000</pubDate>
      
      <guid>/post/20191221-how-to-measure-hard-disk-speed-on-linux/</guid>
      <description>&lt;p&gt;服务器运维工作中，有需要查看磁盘的各项参数。本文对这些测试命令进行了汇总。&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>How to Enable Rc.local With Systemd</title>
      <link>/post/20191211-how-to-enable-rc-local-with-systemd/</link>
      <pubDate>Wed, 11 Dec 2019 08:38:53 +0000</pubDate>
      
      <guid>/post/20191211-how-to-enable-rc-local-with-systemd/</guid>
      <description>&lt;p&gt;以前 /etc/rc.local 来配置 Linux 启动项的用户，当升级到基于 Systemd 的系统以后，就不习惯了。&lt;/p&gt;

&lt;p&gt;例如，从 ubuntu 18.04 开始， /etc/rc.local 默认都不再启用了。&lt;/p&gt;

&lt;p&gt;如何才能使用它呢？ 或许这篇文章可以给你一些信息。&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>使用 Code Server 在浏览器中编写程序</title>
      <link>/post/20191203-code-server/</link>
      <pubDate>Tue, 03 Dec 2019 09:46:21 +0000</pubDate>
      
      <guid>/post/20191203-code-server/</guid>
      <description>&lt;p&gt;为了编写、分析和调试程序，程序开发人员的计算机中都安装了不同的IDE。有的很重，一运行起来，两三个G的内存就没有了。加上计算机操作系统以及其他常用软件，运行速度有时慢得难以忍受。&lt;/p&gt;

&lt;p&gt;现在好了，VS Code 可以在远程服务器上运行，并通过浏览器将界面带给使用者了。&lt;/p&gt;

&lt;p&gt;这样，大家再也不用担心编程的时候自己的计算机变慢了。&lt;/p&gt;

&lt;p&gt;而且在docker中运行也特别简单，几条命令就OK了&lt;/p&gt;

&lt;h1 id=&#34;服务器端运行命令&#34;&gt;服务器端运行命令&lt;/h1&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>使用 LVM 的快照功能完成 docker 容器挂载数据的备份</title>
      <link>/post/lvm-snapshot-backup-data/</link>
      <pubDate>Wed, 15 May 2019 09:54:03 +0800</pubDate>
      
      <guid>/post/lvm-snapshot-backup-data/</guid>
      <description>&lt;p&gt;在使用docker的过程中，一般是以 -v 参数挂载 host 的目录进入容器保留的。&lt;/p&gt;

&lt;p&gt;可以使用 LVM 的快照，对容器数据进行快速备份。大致流程如下：&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Docker Multi-Stage Build 遇到的问题</title>
      <link>/post/docker-multi-stage-build-problem/</link>
      <pubDate>Tue, 23 Oct 2018 23:21:09 +0800</pubDate>
      
      <guid>/post/docker-multi-stage-build-problem/</guid>
      <description>&lt;p&gt;Docker 17.05.0-ce 开始，提供了多阶段构建方案。方便我们通过这种方式，将前一阶段的结果 COPY 到后面的阶段使用。&lt;/p&gt;

&lt;p&gt;但是，在学习使用它的过程中，我遇到的问题，着实让人摸不清头脑：
  在第二阶段使用 COPY 命令后的目标文件夹中， 老是出现曾经 build 出的同样的结果。&lt;/p&gt;

&lt;p&gt;虽然没有弄清楚原因，还好找到了避免这个问题的方法：将第一阶段的结果文件夹，拷贝到第二阶段编译的容器的其他目录，然后使用mv命令移动到目标文件夹中。&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>网站上线了</title>
      <link>/post/web-online/</link>
      <pubDate>Tue, 26 Jun 2018 17:38:27 +0800</pubDate>
      
      <guid>/post/web-online/</guid>
      <description>大家好，zengyiheng的个人学习网站于2018年6月26日上线了。 这里将关注以下一些话题 Linux 云计算 开源社区 分布式 编程 开发板 容器编排</description>
    </item>
    
    <item>
      <title>Git submodule 子模块的管理和使用</title>
      <link>/post/git-submodule-managed-and-used/</link>
      <pubDate>Tue, 26 Jun 2018 16:20:33 +0800</pubDate>
      
      <guid>/post/git-submodule-managed-and-used/</guid>
      <description>场景 如果我们在Git项目里面，需要在其中使用另外一个Git 项目。也许它是一个第三方开发的Git 库或者是你独立开发和并在多个父项目中使用的。这</description>
    </item>
    
  </channel>
</rss>