mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-23 21:20:42 +08:00
Merge branch 'LCTT:master' into master
This commit is contained in:
commit
4c8882394e
@ -0,0 +1,204 @@
|
||||
[#]: subject: "Write your first CI/CD pipeline in Kubernetes with Tekton"
|
||||
[#]: via: "https://opensource.com/article/21/11/cicd-pipeline-kubernetes-tekton"
|
||||
[#]: author: "Savita Ashture https://opensource.com/users/savita-ashture"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "lxbwolf"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15681-1.html"
|
||||
|
||||
用 Tekton 在 Kubernetes 中编写你的第一条 CI/CD 流水线
|
||||
======
|
||||
|
||||
> Tekton 是一个用于创建持续集成和持续交付(CI/CD)系统的 Kubernetes 原生开源框架。
|
||||
|
||||
![][0]
|
||||
|
||||
Tekton 是一个用于创建持续集成和持续交付(CI/CD)系统的 Kubernetes 原生开源框架。通过对底层实施细节的抽象,它还可以帮助你在多个云供应商或企业内部系统中进行端到端(构建、测试、部署)应用开发。
|
||||
|
||||
### Tekton 介绍
|
||||
|
||||
[Tekton][2] 最初被称为 [Knative Build][3],后来被重组为独立的开源项目,有自己的 [治理组织][4],现在是属于 [Linux 基金会][5] 的项目。Tekton 提供了一个集群内的容器镜像构建和部署工作流程,换句话说,它是一个 <ruby>持续集成<rt>continuous integration</rt></ruby>(CI)和 <ruby>持续交付<rt>continuous delivery</rt></ruby>(CD)服务。它由 Tekton 流水线和几个支持组件如 Tekton CLI、Triggers 和 Catalog 等组成。
|
||||
|
||||
Tekton 是一个 Kubernetes 原生应用。它在 Kubernetes 集群中作为扩展被安装和运行,由一套Kubernetes 定制化资源组成,定义了你为流水线创建和复用的构建块。由于 Tekton 是一种 Kubernetes 原生技术,所以它非常容易扩展。当你需要增加你的工作负载时,你只需向你的集群添加节点就可以了。由于其可扩展的设计和社区贡献的组件库,它也很容易定制。
|
||||
|
||||
对于需要 CI/CD 系统来开展工作的开发人员,和为其组织内的开发人员建立 CI/CD 系统的平台工程师,Tekton 是理想选择。
|
||||
|
||||
### Tekton 组件
|
||||
|
||||
构建 CI/CD 流水线的过程非常复杂,因此 Tekton 为每一步都提供工具。以下是 Tekton 提供的主要组件:
|
||||
|
||||
* <ruby>流水线<rt></rt>Pipeline</rt></ruby>: 定义了一组 Kubernetes [自定义资源][6],作为你用来组装 CI/CD 流水线的构建块。
|
||||
* <ruby>触发器<rt>Triggers</rt></ruby>:一种 Kubernetes 自定义资源,允许你根据从事件有效载荷中提取的信息来创建流水线。例如,你可以在每次创建 Git 仓库的合并请求时,触发流水线的实例化和执行。
|
||||
* <ruby>命令行<rt>CLI</rt></ruby>:提供一个名为 `tkn` 的命令行界面,你可以使用它从终端与 Tekton 进行交互。
|
||||
* <ruby>仪表盘<rt>Dashboard</rt></ruby>:是 Tekton 流水线的一个基于网页的图形界面,显示流水线的执行信息。
|
||||
* <ruby>目录<rt>Catalog</rt></ruby>:是一个高质量的、由社区贡献的 Tekton 构建块(任务、流水线等),可在你自己的流水线中使用。
|
||||
* <ruby>中心<rt>Hub</rt></ruby>:是一个基于网页的图形界面,用于访问 Tekton 目录。
|
||||
* <ruby>操作员<rt>Operator</rt></ruby>:是一种 Kubernetes [操作员模式][7],你可以在 Kubernetes 集群中安装、更新、升级和删除 Tekton 项目。
|
||||
* <ruby>链<rt>Chains</rt></ruby>:是一个 Kubernetes <ruby>自定义资源定义<rt>Custom Resource Definition</rt></ruby>(CRD)控制器,使你可以在 Tekton 中处理供应链安全的问题。正在开发中。
|
||||
* <ruby>结果<rt>Results</rt></ruby>:旨在帮助用户对 CI/CD 工作负载历史进行逻辑分组,并将长期结果的存储从流水线控制器中分离出来。
|
||||
|
||||
### Tekton 术语
|
||||
|
||||
![Tekton terminology][8]
|
||||
|
||||
* <ruby>步骤<rt>Step</rt></ruby>:是 CI/CD 工作流程中最基本的实体,例如为 Python 网络应用程序运行一些单元测试或编译一个 Java 程序。Tekton 使用容器镜像执行每个步骤。
|
||||
* <ruby>任务<rt>Task</rt></ruby>::** 是按特定顺序排列的步骤的集合。Tekton 以 [Kubernetes 容器荚][10] 的形式运行任务,其中每个步骤都成为 <ruby>容器荚<rt>pod</rt></ruby> 中的一个运行容器。
|
||||
* <ruby>流水线<rt>Pipelines</rt></ruby>:是按特定顺序排列的任务的集合。Tekton 把所有任务连接成一个 <ruby>有向无环图<rt>directed acyclic graph</rt></ruby>(DAG),并按顺序执行图。换句话说,它创建了一些 Kubernetes 容器荚,并确保每个容器荚按预期成功运行。
|
||||
|
||||
![Tekton pipelines][11]
|
||||
|
||||
* <ruby>流水线运行<rt>PipelineRun</rt></ruby>:顾名思义,是一条流水线的具体执行。
|
||||
* <ruby>任务运行<rt>TaskRun</rt></ruby>:是一个任务的具体执行。你可以选择在流水线外运行一次任务运行,可以通过它查看任务中每个步骤执行的具体情况。
|
||||
|
||||
### 创建你的 CI/CD 流水线
|
||||
|
||||
开始使用 Tekton 的最简单方法是自己编写一个简单的流水线。如果你每天都在使用 Kubernetes,那你可能对 YAML 很熟悉,这正是 Tekton 流水线的定义方式。下面是一个克隆代码库的简单流水线的例子。
|
||||
|
||||
首先,创建一个 `task.yaml` 文件,用你喜欢的文本编辑器打开它。这个文件定义了你要执行的 <ruby>步骤<rt>Step</rt></ruby>。在这个例子中,就是克隆一个仓库,所以我把这个步骤命名为 “clone”。该文件设置了一些环境变量,然后使用一个简单的 shell 脚本来执行克隆。
|
||||
|
||||
接下来是 <ruby>任务<rt>Task</rt></ruby>。你可以把步骤看作是一个被任务调用的函数,而任务则设置步骤所需的参数和工作空间。
|
||||
|
||||
```
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: git-clone
|
||||
spec:
|
||||
workspaces:
|
||||
- name: output
|
||||
description: The git repo will be cloned onto the volume backing this Workspace.
|
||||
params:
|
||||
- name: url
|
||||
description: Repository URL to clone from.
|
||||
type: string
|
||||
- name: revision
|
||||
description: Revision to checkout. (branch, tag, sha, ref, etc...)
|
||||
type: string
|
||||
default: ""
|
||||
steps:
|
||||
- name: clone
|
||||
image: "gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:v0.21.0"
|
||||
env:
|
||||
- name: PARAM_URL
|
||||
value: $(params.url)
|
||||
- name: PARAM_REVISION
|
||||
value: $(params.revision)
|
||||
- name: WORKSPACE_OUTPUT_PATH
|
||||
value: $(workspaces.output.path)
|
||||
script: |
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
CHECKOUT_DIR="${WORKSPACE_OUTPUT_PATH}"
|
||||
|
||||
/ko-app/git-init \
|
||||
-url="${PARAM_URL}" \
|
||||
-revision="${PARAM_REVISION}" \
|
||||
-path="${CHECKOUT_DIR}"
|
||||
cd "${CHECKOUT_DIR}"
|
||||
EXIT_CODE="$?"
|
||||
if [ "${EXIT_CODE}" != 0 ] ; then
|
||||
exit "${EXIT_CODE}"
|
||||
fi
|
||||
# Verify clone is success by reading readme file.
|
||||
cat ${CHECKOUT_DIR}/README.md
|
||||
|
||||
```
|
||||
|
||||
创建第二个文件 `pipeline.yaml`,并用你喜欢的文本编辑器打开它。这个文件通过设置诸如可以运行和处理任务的工作区等重要参数来定义流水线。
|
||||
|
||||
```
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Pipeline
|
||||
metadata:
|
||||
name: cat-branch-readme
|
||||
spec:
|
||||
params:
|
||||
- name: repo-url
|
||||
type: string
|
||||
description: The git repository URL to clone from.
|
||||
- name: branch-name
|
||||
type: string
|
||||
description: The git branch to clone.
|
||||
workspaces:
|
||||
- name: shared-data
|
||||
description: |
|
||||
This workspace will receive the cloned git repo and be passed
|
||||
to the next Task for the repo's README.md file to be read.
|
||||
tasks:
|
||||
- name: fetch-repo
|
||||
taskRef:
|
||||
name: git-clone
|
||||
workspaces:
|
||||
- name: output
|
||||
workspace: shared-data
|
||||
params:
|
||||
- name: url
|
||||
value: $(params.repo-url)
|
||||
- name: revision
|
||||
value: $(params.branch-name)
|
||||
|
||||
```
|
||||
|
||||
最后,创建一个 `pipelinerun.yaml` 文件,用喜欢的文本编辑器打开它。这个文件真正的运行流水线。它调用流水线中定义的参数(继而调用任务文件中定义的任务)。
|
||||
|
||||
```
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: PipelineRun
|
||||
metadata:
|
||||
name: git-clone-checking-out-a-branch
|
||||
spec:
|
||||
pipelineRef:
|
||||
name: cat-branch-readme
|
||||
workspaces:
|
||||
- name: shared-data
|
||||
volumeClaimTemplate:
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
params:
|
||||
- name: repo-url
|
||||
value: <https://github.com/tektoncd/pipeline.git>
|
||||
- name: branch-name
|
||||
value: release-v0.12.x
|
||||
|
||||
```
|
||||
|
||||
把不同工作分在不同的文件中的好处是,`git-clone` 任务可以在多条流水线中复用。
|
||||
|
||||
例如,假设你想为一个流水线项目做端到端的测试。你可以使用 `git-clone` 任务 **来让每一次测试都基于最新的代码**。
|
||||
|
||||
### 总结
|
||||
|
||||
只要你熟悉 Kubernetes,那 Tekton 对你来说就像其他 Kubernetes 原生应用一样简单。它有很多工具可以帮助你创建流水线并与之交互。如果你喜欢自动化,不妨试试 Tekton!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/11/cicd-pipeline-kubernetes-tekton
|
||||
|
||||
作者:[Savita Ashture][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/savita-ashture
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions)
|
||||
[2]: https://github.com/tektoncd/pipeline
|
||||
[3]: https://github.com/knative/build
|
||||
[4]: https://cd.foundation/
|
||||
[5]: https://www.linuxfoundation.org/projects/
|
||||
[6]: https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/
|
||||
[7]: https://operatorhub.io/what-is-an-operator
|
||||
[8]: https://opensource.com/sites/default/files/uploads/tekto-terminology.png (Tekton terminology)
|
||||
[9]: https://tekton.dev/docs/concepts/concept-tasks-pipelines.png
|
||||
[10]: https://kubebyexample.com/en/concept/pods
|
||||
[11]: https://opensource.com/sites/default/files/uploads/tekton-pipelines.png (Tekton pipelines)
|
||||
[12]: https://tekton.dev/docs/concepts/concept-runs.png
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202304/01/180822blxgx0c1k43n4kl4.jpg
|
100
published/20211205 Open source mind mapping with Draw.io.md
Normal file
100
published/20211205 Open source mind mapping with Draw.io.md
Normal file
@ -0,0 +1,100 @@
|
||||
[#]: subject: "Open source mind mapping with Draw.io"
|
||||
[#]: via: "https://opensource.com/article/21/12/open-source-mind-mapping-drawio"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "FYJNEVERFOLLOWS"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15700-1.html"
|
||||
|
||||
使用开源思维导图 Draw.io
|
||||
======
|
||||
|
||||
> 下次你需要头脑风暴、组织想法或计划项目时,不妨试试 Draw.io。
|
||||
|
||||
![][0]
|
||||
|
||||
地图有一些特别之处。我记得小时候打开托尔金《霍比特人》的封面,盯着手绘的中土世界地图,感受简单的图画中蕴含着丰富的可能性。除了描述事物与其他事物之间的关系这一明显目的外,我认为地图在表达可能性方面做得很好。你可以到户外去,沿着这条路或那条路走,如果你这样做了,去想想你将能够看到的所有新的、令人兴奋的事物。
|
||||
|
||||
尽管如此,地图并不一定是有价值和充满可能性的文字。有些地图描述了一个思维过程、计划、算法,甚至是一些随机的想法,这些想法拼命地想要组合成一件潜在的艺术作品,它们被称之为“思维导图”、“流程图”或“创意板”。可以用开源的 [Draw.io][2] 应用程序去很容易地制作。
|
||||
|
||||
### 安装 Draw.io
|
||||
|
||||
Draw.io 是一个开源的在线应用程序,因此你可以将其作为在线应用程序使用,下载 [桌面版本][3],或 [克隆 Git 存储库][4] 并将其托管在你自己的服务器上。
|
||||
|
||||
### 使用 Draw.io 画图
|
||||
|
||||
当你第一次启动 Draw.io 时,你需要选择保存数据的位置。如果你自己托管 Draw.io,你的选择取决于你可以访问哪些 API 密钥。你可以从几个在线存储服务中为在线公共实例进行选择,这取决于你的帐户。如果你不想把你的数据存储在别人的服务器上,你也可以选择把你的工作保存在本地存储上。如果你还不确定,可以单击 “<ruby>稍后决定<rt>Decide later</rt></ruby>” 继续进入应用程序,而无需选择任何内容。
|
||||
|
||||
Draw.io 的交互界面中间有一个很大的工作空间,左边是主工具栏,顶部是工具栏,右边是属性面板。
|
||||
|
||||
![Draw.io interface][5]
|
||||
|
||||
工作流程很简单:
|
||||
|
||||
1. 从左侧工具栏中选择一个形状。
|
||||
2. 在工作空间中编辑形状。
|
||||
3. 添加另一个形状,并连接它们。
|
||||
|
||||
重复这个过程,你就得到了一张图。
|
||||
|
||||
![Draw.io example][7]
|
||||
|
||||
### 项目规划
|
||||
|
||||
当你第一次接受一项大任务时,你通常对你想要的结果有一个非常清晰的想法。假设你想开始一个社区项目来画一幅壁画。你想要的结果是一幅壁画。它很容易定义,你可以或多或少地在脑海中描绘出结果。
|
||||
|
||||
然而,一旦你开始朝着目标前进,你就必须开始弄清楚细节。壁画应该画在哪里?即便知道画在哪,你如何获得在公共墙上作画的许可的?油漆呢?你应该用一种特殊的油漆吗?你会用刷子还是喷枪涂油漆?你需要什么样的专业设备来喷漆?画一幅壁画需要多少人和多长时间?画家工作时的支持服务怎么样?最后,这幅画是关于什么的?一个想法很快就会变得势不可挡,因为你离实现它越近。
|
||||
|
||||
这不仅仅适用于绘制壁画、制作戏剧或电影。它几乎适用于任何不平凡的努力。这正是像 Draw.io 这样的应用程序可以帮助绘制的。
|
||||
|
||||
以下是如何使用 Draw.io 创建项目流程图:
|
||||
|
||||
1. 从头脑风暴开始。没有什么想法是太小或太大的。为每个想法制作一个框,然后双击 Draw.io 工作空间中的框以输入文本。
|
||||
2. 一旦在工作空间中你产生了可能想到的所有想法,就可以将它们拖放到相关的组中。我们的目标是创建一些小任务云或集群,因为它们是同一过程的一部分,所以或多或少会一起进行。
|
||||
3. 一旦你确定了相关任务的集群,就为这些任务命名。例如,如果你正在绘制壁画,那么任务可能是 “许可”、“设计”、“购买”、“绘制”,这反映出你需要首先获得当地政府的许可,然后设计壁画,然后购买用品,最后绘制壁画。每个任务都有组成部分,但大体上,你现在已经确定了项目的工作流程。
|
||||
4. 用箭头连接主要任务。并不是所有的过程都是完全线性的。例如,在你获得市议会的许可后,一旦你设计了你打算画的东西,你可能必须回到他们那里进行最终批准。这很正常。这是一个循环,有一些来回,但最终,你会突破这个循环,进入下一阶段。
|
||||
5. 掌握好你的流程图,完成每一项任务,直到你达到最终目标。
|
||||
|
||||
### 思维导图
|
||||
|
||||
思维导图往往不是关于进步,而是关于保持某种状态或对许多想法进行展望。例如,假设你已经决定减少生活中的浪费。你对自己能做什么有一些想法,但你想组织和保存你的想法,这样你就不会忘记它们。
|
||||
|
||||
以下是如何使用 Draw.io 创建思维导图:
|
||||
|
||||
1. 从头脑风暴开始。没有什么想法是太琐碎或太大的。为每个想法制作一个框,然后双击 Draw.io 工作空间中的框以输入文本。也可以通过选择框并单击右侧属性面板中的色样,为框指定背景色。
|
||||
2. 将你的想法分组或分类。
|
||||
3. 可以选择将想法与彼此直接相关的箭头连接起来。
|
||||
|
||||
![Draw.io waste reduction example][8]
|
||||
|
||||
### 保存你的图表
|
||||
|
||||
你可以将图表保存为 PNG、JPG 图像、Draw.io XML 或纯 XML 文件。如果将其另存为 XML,则可以在 Draw.io 中再次打开它进行进一步编辑。导出的图像非常适合与他人共享。
|
||||
|
||||
### 使用 Draw.io
|
||||
|
||||
有很多很棒的绘图应用程序,但我不经常制作图表,所以可以随时使用 Draw.io。它的界面简单易用,结果干净专业。下次当你需要头脑风暴、组织想法或计划项目时,可以试试 Draw.io。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/12/open-source-mind-mapping-drawio
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/career_journey_road_gps_path_map_520.png?itok=PpL6jJgY (Looking at a map for career journey)
|
||||
[2]: http://draw.io
|
||||
[3]: https://github.com/jgraph/drawio-desktop
|
||||
[4]: https://github.com/jgraph/drawio
|
||||
[5]: https://opensource.com/sites/default/files/uploads/draw-io-ui.png (Draw.io interface)
|
||||
[6]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[7]: https://opensource.com/sites/default/files/uploads/draw-io-example.jpg (Draw.io example)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/draw-io-export.jpg (Draw.io waste reduction example)
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202304/07/144214m945y0naawn5zb95.jpg
|
@ -0,0 +1,149 @@
|
||||
[#]: subject: "Essential tips and tricks for your first tech job"
|
||||
[#]: via: "https://opensource.com/article/23/2/your-first-tech-job"
|
||||
[#]: author: "Fatima https://opensource.com/users/ftaj"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "XiaotingHuang22"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15696-1.html"
|
||||
|
||||
技术领域小白必不可少的工作技巧和诀窍
|
||||
======
|
||||
|
||||
> 开始一份新工作对任何人来说都让人害怕。下面是如何在你的第一份技术工作的早期阶段找到方向。
|
||||
|
||||
刚刚入职那几天确实令人害怕。 我现在依然可以清晰举出很多例子,例如在第一天上班前的晚上无法入睡,因为不知道第二天将要发生什么而内心崩溃。对于大多数人来说,开始一份新工作就像踏入未知领域。即使你已是行业的资深人士,不可否认的是,你内心可能还是会对即将发生的事情感到有点害怕。
|
||||
|
||||
可以理解的是,刚入职的时候你的事情很多。你要认识新的人,有新的项目和技术要了解,有文档要阅读,有教程要看完,还有没完没了的人事培训和要填的文件。这可能让你感觉压力山大,再加上你还面临着相当大程度的不确定性和未知数,以上种种能引起焦虑。
|
||||
|
||||
促使我写这篇文章有两个原因,首先是在我还是学生的时候,大部分讨论都围绕着如何找一份技术工作,却没有人谈论接下来发生的事情。如何在新角色中脱颖而出?现在回过头来看,我想我当时认为最困难的事情是得到一份工作,之后发生什么的一切我都可以自己弄清楚。
|
||||
|
||||
同样的,在我开始在这个行业工作之后,我发现大部分我看到的与职业相关的内容都是讨论如何从一个高级职位升到另一个高级职位。没有人真正谈论在此中间我们要做什么。实习生和初级工程师呢?他们在早期职业生涯中如何找到方向?
|
||||
|
||||
在拥有了三年全职软件工程师的经验(以及之前的几次实习)之后,我将这段时间的经历进行了复盘,并整理出一份我自己在适应新技术职位时使用过的技巧和诀窍清单。我想不只局限于前面的几个月,而是优先考虑如何让这段经历帮助你实现长期的成功。
|
||||
|
||||
### 反思现有的流程和文档
|
||||
|
||||
大多数新员工一开始要么拥有一大堆文档,要么根本没有。你可以将这视为一个机会,而不是被这两种可能性中的任何一种所淹没。
|
||||
|
||||
从现有文档中找到缺口,并想想你可以怎样为下一位入职的工程师做出这方面的改进。这不仅能显示你工作的主动性,还表明你致力于改进团队中的现有流程。
|
||||
|
||||
上述两种极端情况我都遇到过。我在没有任何文档的团队中工作过,也在一些更新文档方面很勤快的团队中工作过。对于前者,你的路径非常简单直接,你可以致力于创建那些缺失的文档。对于后者,你总是可以想办法改进已有的东西。有时,过多的书面文件也会让人感到害怕,尤其是对新员工而言。有些事情可能通过其他媒介进行更好地解释,比如视频教程或截屏。
|
||||
|
||||
### 勤问问题
|
||||
|
||||
我会建议你在开始一份新工作时研究一下公司是否会为你分配搭档。这在公司中是相当普遍的做法。工作搭档的主要作用是在你入职时为你提供帮助。我发现这非常有用,因为这个人能够针对你所有的问题给出指导,你就不必为了寻找合适的人或部门而四处奔波。
|
||||
|
||||
虽然我鼓励提问,但在提问之前也有必要做功课,包括:
|
||||
|
||||
- 做好调查。这包括进行网络搜索、查看论坛和阅读现有文档。使用所有可用的工具。然而,给自己设定时间规划是很重要的。你必须平衡好尽职调查与牢记手头项目截止日期和可交付成果。
|
||||
- 说出来。作为母语不是英语的人,我建议你在提问之前大声把想法说出来。根据我的经验,我经常发现自己会用一种语言(通常是我的母语)思考但不得不用另一种语言来解释,而当我在一些困难的问题中挣扎时这一现象尤为突出。有时这颇有挑战性,因为经过翻译后的想法可能没那么容易理解。
|
||||
- 组织思绪。当你在为某件事而苦苦挣扎时,可能同时有很多不同的想法在你的脑海中翻来覆去。这些想法可能对你来说都挺有道理的,但对于别人来说却不一定说得通。对此,我建议你坐下来,收集你的想法,写下来,然后大声说出来。这一做法可确保当你在解释自己的思维过程时,你能按照预期进行流畅地表达出来,听众也可以紧跟你的思路。
|
||||
|
||||
这种方法称为橡皮鸭调试法,是开发人员在调试时的常见做法。背后的概念是,有时向第三方解释你的问题非常有助于你找到解决方案,同时也证明了你出色的沟通技巧。
|
||||
|
||||
尊重别人的时间。即使你在向你的搭档求助时,也要意识到他们也有自己的日常任务要完成。 我尝试过的一些事情包括:
|
||||
|
||||
- 写下我的问题,然后留出一些时间与我的导师交流,以便与他们交谈。
|
||||
- 整理问题而不是反复寻求帮助,这样导师可以在他们有空的时候着手解决。
|
||||
- 安排 15-20 分钟的快速视频聊天,特别是如果你想共享屏幕,这一方法可以很好地展示你的发现。
|
||||
|
||||
我认为这些方法是更好的选择,因为这么做你能得到对方全部的关注,而不是在他们忙着其他事情的时候每隔几分钟打扰他们一下。
|
||||
|
||||
### 深入研究你的项目
|
||||
|
||||
即使在拥有出色文档的团队中,开始你的技术项目也可能非常艰巨,因为一个项目涉及多个部分。不过,随着时间的推移,你将了解团队是如何做事的。但是,通过记下一张实用清单,这包括基本项目设置、测试要求、审查和部署流程、任务跟踪和文档,你将迅速搞清楚一切,节省了你的时间和潜在的麻烦。
|
||||
|
||||
如果你开始的项目没有文档(我就遇到过这种情况),请看看你能不能找到当前或以前的项目所有者并了解基本的项目结构,这包括设置、部署等。
|
||||
|
||||
- 确定你的团队在 IDE(集成开发环境)中的偏好。你可以自由使用你喜欢的 IDE,但使用和团队相同的 IDE 会比较好,尤其是在调试的时候,因为 IDE 的选择会影响调试。不同的 IDE 提供不同程度的调试支持。
|
||||
- 了解如何进行调试。我的意思不仅仅是使用打印语句(不是说这种方法有什么问题)。充分利用团队的经验!
|
||||
- 了解测试要求。这可能取决于项目的范围和团队的一般惯例,越早弄清楚要求,你在后期推送自己的修改请求时就会越有信心。
|
||||
- 可视化部署过程。这个过程可能因团队、公司等而异。无论这个过程是非正式或正式,请确保你了解自己提交的新代码是如何被部署至新环境中、部署流水线是什么样的、如何安全地部署代码更改、在构建失败后可以怎么做,如何回滚错误的更改,以及如何在生产环境中测试你的更改。
|
||||
- 了解工单流程。了解如何记录工单以及要求的详细程度。你会由此发现每个公司各不相同。有的公司希望我们每天提交工单以显示我们的进度。有的公司可能不需要如此详细。
|
||||
|
||||
基于我刚才提到的所有内容,我建议你可以在入职头几周内做一个有益的、一体化的练习——跟随模仿另一位工程师并进行结对编码。这么做让你可以端到端地观察整个流程,从派单给工程师到部署到生产中都清清楚楚。
|
||||
|
||||
如果刚入职几周时你还没有机会亲身实践,可能你会感到沮丧。为了解决这个问题,你可以让你的经理也给你派一些初级的单子。这些通常是一些小任务,例如代码清理或添加单元测试。不过,它们允许你修补代码库,这有助于提高你的理解并给你带来成就感,这在新工作的初期是非常鼓舞人心的。
|
||||
|
||||
### 当你遇到困难时尤其要大声说出来
|
||||
|
||||
我想强调一下当你碰到困难时沟通的重要性。遇到困难总是难免的,尤其是在一份新工作的最初几个月,尽管这可能会令人沮丧,但这正是你的沟通技巧大放异彩的地方。
|
||||
|
||||
- 让工作中的阻碍和进步透明化。即使是像权限问题一样的小事(新员工常常遇到的障碍之一),也要确保你的经理知道。
|
||||
- 如果有些工作耽搁了,不要等到最后一天才向团队报告。你的项目延迟会推动许多其他事情的发展。对于一些必要的项目延迟请提前告知,以便你的经理可以与相关人员分享这一信息。
|
||||
- 不要因为匆忙而忘记全面测试代码的更改或为你的代码的写文档等事情。
|
||||
|
||||
### 获得技术大局观
|
||||
|
||||
获得技术大局观是我个人一直在努力改进的地方,并且我一直在积极改变自己对此的看法。
|
||||
|
||||
当年我开始实习时,我会非常专注于自己想学的东西。我会非常专注于我的项目,但对其他一切完全视而不见。多年后,我意识到对其他或相邻的项目视而不见可能不是最明智的。
|
||||
|
||||
首先,技术大局观会影响你对自身工作的理解。我曾经天真地以为,只要我专注于自己的项目就可以成为一名优秀的工程师。但事情并非如此。你应该花时间了解其他可能与你的项目有所交互的服务。你无需深入了解细节,但建立基本的理解也会大有帮助。
|
||||
|
||||
新员工的一个普遍经历是与公司其他人脱节,会有这种感觉很正常,尤其是在大公司。我是一个很快就会产生排斥感的人,所以当我刚到 Yelp 时 —— 这是一家比我以前的公司大得多的公司,项目规模也大得多,我优先考虑了解大局。我不仅努力建立对我的项目的理解,还认真了解了其他相邻项目。
|
||||
|
||||
在 Yelp 的头几周,我与团队中的其他各位工程师坐下来,请他们给我一个关于我将要做什么和项目的总体目标的概况。这种方法非常有用,因为我不仅根据工程师的资历和他们在项目上的工作时间得到了不同程度的解释,而且还加深了我对我将要从事的工作的理解。我参加这些会议的目的,是希望我对项目掌握的认识让我能够向街上的陌生人解释我所做的事。为此,我还请我的技术主管向我解释,当用户打开 Yelp 应用程序并搜索内容时,我的工作成果会在什么时候出现。
|
||||
|
||||
在这种情况下架构图也很有用,尤其是它能帮助你了解不同服务是如何交互的。
|
||||
|
||||
### 建立期望
|
||||
|
||||
在过去很长一段时间里,我以为自己只需要尽力而为,成为一名优秀的员工就行。只要我有在工作,达成目标,而且没有人投诉,那就足够好了,对吧?错!
|
||||
|
||||
你必须对你的职业有战略眼光。你不能只是将它外包给人们的一片好心,并希望自己只要达成了目标就能得到想要的结果。
|
||||
|
||||
- 在你开始新工作的那一刻就建立明确的标准。这因公司而异,因为有些组织有非常明确的措施,而其他组织可能几乎没有。如果是后者,我建议你在头几周内找你的经理坐下来谈谈,制定并统一一个标准。
|
||||
- 确保你彻底了解公司将如何评估你以及采用什么方法进行评估。
|
||||
|
||||
我记得在我的第一份全职工作中,我对自己的第一次评估谈话一头雾水。整个谈话非常含糊不清,而且我对自己的长处、短处甚至可以如何改进都一无所知。
|
||||
|
||||
起初,我很容易地将一切都归咎于我的经理,因为作为新员工的我认为这是他们的工作,而不是我的职责。但随着时间的推移,我意识到,就我的绩效评估而言,我不能只是袖手旁观。你不能只做好工作并期望它就足够了。你必须积极参与到这些对话中。你必须确保你的努力和贡献被注意到。为了确保你的工作得到认可,你可以做很多事情,从定期参与技术设计对话到设置团建活动。
|
||||
|
||||
与建立期望相联系的还有积极寻求反馈的重要性。不要等到每三、四个月进行一次正式的绩效评估时才知道自己的表现如何。积极与你的经理建立反馈循环。虽然这听起来很可怕,但尝试定期进行寻求反馈的谈话。
|
||||
|
||||
### 在分布式团队中找到方向
|
||||
|
||||
在过去两年中我们的工作场所在不断变化,如今在远程和分布式团队中工作已成为常态,不再罕见。我列出了一些技巧,帮助你在分布式团队中快速找到工作方向:
|
||||
|
||||
- 建立核心时间并将其设置在你的日历上。核心时间是你的团队一致同意的几个小时,在这段时间里,大家都明白自己应该在线并能随时响应。这样做很方便,因为会议只会安排在这个时间段,让你在计划自己一天的工作时更轻松。
|
||||
- 注意人们的时区和午餐时间。
|
||||
- 在虚拟世界中,你需要付出更大的努力来维持社交互动,而小小的心意却可以大大有助于让工作环境更加友好。
|
||||
|
||||
其中包括:
|
||||
|
||||
- 开始会议时,互相寒暄并询问人们周末/一天过得如何。这有助于打破僵局,让你能够与团队成员建立更私人的、超越工作的联系。
|
||||
- 建议定期举行非正式的虚拟聚会,与团队进行一些随意的闲聊。
|
||||
|
||||
### 维持工作生活间的平衡
|
||||
|
||||
在你职业生涯刚开始的时候,你很容易认为只要投入很多时间就能成功,特别是考虑到我们全天候待命的“忙碌文化”,以及认为建立生活工作的平衡是在职业生涯下阶段才需要考虑的想法。但这些想法与事实相去甚远,因为工作与生活的平衡不会神奇地发生在你身上。你需要积极和非常勤奋地去找到个人的平衡点。
|
||||
|
||||
没有工作与生活平衡的可怕之处在于它是慢慢蔓延到你身上的。刚开始是你下班后还在查看电子邮件,然后慢慢地,你开始周末也在工作,一直感到疲惫不堪。
|
||||
|
||||
我列出了一些提示,可以帮助你避免这种情况:
|
||||
|
||||
- 关闭/暂停通知和电子邮件并将自己设置为离线。
|
||||
- 不要在周末工作。刚开始是你需要在这一个周末工作,但不知不觉间,你会发现自己大部分周末都在工作。不管是什么工作,它可以等到星期一。
|
||||
- 如果你是待命的工程师,请了解公司的相关政策。一些公司提供金钱补偿,而另一些公司可能会以休假代替。利用这个时间。不使用 PTO(带薪休假)和健康日等福利确实会缩短你的工作寿命。
|
||||
|
||||
### 总结
|
||||
|
||||
毫无疑问,开始一份新工作压力很大而且很困难。我希望这些方法和技巧会让你的头几个月变得更轻松,并为你在新职位上取得巨大成功做好准备。记住,勤沟通,确立职业目标,积极主动,有效地使用公司的工具。做到这些,我相信你会做得很好!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/2/your-first-tech-job
|
||||
|
||||
作者:[Fatima][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[XiaotingHuang22](https://github.com/XiaotingHuang22)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/ftaj
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://opensource.com/article/21/5/open-source-burnout
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202304/06/000732j1ipb1whhhlwgpen.jpg
|
@ -0,0 +1,73 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-15674-1.html)
|
||||
[#]: subject: (Why programmers love Linux packaging)
|
||||
[#]: via: (https://opensource.com/article/21/2/linux-packaging)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
为什么程序员喜欢为 Linux 打包
|
||||
======
|
||||
|
||||
> 程序员可以通过 Flatpak 轻松、稳定地发布他们的软件,让他们专注于他们的激情工作:编程。
|
||||
|
||||
![][0]
|
||||
|
||||
如今,人们比以往任何时候都喜爱 Linux。在这个系列中,我将分享使用 Linux 的 21 个不同理由。今天,我将谈一谈是什么让 Linux 的打包成为程序员的理想选择。
|
||||
|
||||
程序员喜欢编程。这可能看起来是一个显而易见的说法,但重要的是要明白,开发软件所涉及的不仅仅是编写代码。它包括编译、文档、源代码管理、安装脚本、配置默认值、支持文件、交付格式等等。从一个空白的屏幕到一个可交付的软件安装程序,需要的不仅仅是编程,但大多数程序员宁愿编程也不愿打包。
|
||||
|
||||
### 什么是打包?
|
||||
|
||||
当食物被送到商店购买时,它是被包装好的。当直接从农民或从环保的散装或桶装商店购买时,包装是你所带的任何容器。当从杂货店购买时,包装可能是一个纸板箱、塑料袋、一个铁罐等等。
|
||||
|
||||
当软件被提供给广大计算机用户时,它也必须被打包起来。像食品一样,软件也有几种打包方式。开源软件可以不进行打包,因为用户在获得原始代码后,可以自己编译和打包它。然而,打包也有好处,所以应用程序通常以某种特定于用户平台的格式交付。而这正是问题的开始,因为软件包的格式并不只有一种。
|
||||
|
||||
对于用户来说,软件包使安装软件变得容易,因为所有的工作都由系统的安装程序完成。软件被从软件包中提取出来,并分发到操作系统中的适当位置。几乎没有任何出错的机会。
|
||||
|
||||
然而,对于软件开发者来说,打包意味着你必须学会如何创建一个包 —— 而且不仅仅是一个包,而是为你希望你的软件可以安装到的每一个操作系统创建一个独特的包。更加复杂的是,每个操作系统都有多种打包格式和选项,有时甚至是不同的编程语言。
|
||||
|
||||
### 为 Linux 打包
|
||||
|
||||
传统上,Linux 的打包方式似乎是非常多的。从 Fedora 衍生出来的 Linux 发行版,如 Red Hat 和 CentOS,默认使用 .rpm 包。Debian 和 Ubuntu(以及类似的)默认使用 .deb 包。其他发行版可能使用其中之一,或者两者都不使用,选择自定义的格式。当被问及时,许多 Linux 用户说,理想情况下,程序员根本不会为 Linux 打包他们的软件,而是依靠每个发行版的软件包维护者来创建软件包。所有安装在 Linux 系统上的软件都应该来自该发行版的官方软件库。然而,目前还不清楚如何让你的软件可靠地被一个发行版打包和包含,更不用说所有的发行版了。
|
||||
|
||||
### Linux 的 Flatpak
|
||||
|
||||
Flatpak 打包系统是为了统一和去中心化 Linux 作为开发者的交付目标而推出的。通过 Flatpak,无论是开发者还是其他人(Linux 社区的成员、不同的开发者、Flatpak 团队成员或其他任何人)都可以自由地打包软件。然后他们可以将软件包提交给 Flathub,或者选择自我托管软件包,并将其提供给几乎任何 Linux 发行版。Flatpak 系统适用于所有 Linux 发行版,所以针对一个发行版就等于针对所有发行版。
|
||||
|
||||
### Flatpak 技术如何工作
|
||||
|
||||
Flatpak 具有普遍吸引力的秘密是一个标准基础。Flatpak 系统允许开发者引用一套通用的软件开发者工具包(SDK)模块。这些模块由 Flatpak 系统的维护者进行打包和管理。当你安装 Flatpak 时,SDK 会根据需要被拉入,以确保与你的系统兼容。任何特定的 SDK 只需要一次,因为它所包含的库可以在任何 Flatpak 中共享。
|
||||
|
||||
如果开发者需要一个尚未包含在现有 SDK 中的库,开发者可以在 Flatpak 中添加该库。
|
||||
|
||||
结果不言自明。用户可以从一个叫做 [Flathub][2] 的中央仓库在任何 Linux 发行版上安装数百个软件包。
|
||||
|
||||
### 开发者如何使用 Flatpak
|
||||
|
||||
Flatpak 被设计成可重复的,所以构建过程很容易被集成到 CI/CD 工作流程中。Flatpak 是在一个 [YAML][3] 或 JSON 清单文件中定义的。你可以按照我的 [介绍性文章][4] 创建你的第一个 Flatpak,你也可以在 [docs.flatpak.org][5] 阅读完整的文档。
|
||||
|
||||
### Linux 让它变得简单
|
||||
|
||||
在 Linux 上创建软件很容易,为 Linux 打包也很简单,而且可以自动化。如果你是一个程序员,Linux 使你很容易忘记打包这件事,因为它只需要针对一个系统,并可以整合到你的构建过程中。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/2/linux-packaging
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brown-package-red-bow.jpg?itok=oxZYQzH- (Package wrapped with brown paper and red bow)
|
||||
[2]: https://flatpak.org/setup/
|
||||
[3]: https://www.redhat.com/sysadmin/yaml-beginners
|
||||
[4]: https://opensource.com/article/19/10/how-build-flatpak-packaging
|
||||
[5]: https://docs.flatpak.org/en/latest/index.html
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202303/29/231331qb9ye8gggeekvce1.jpg
|
@ -0,0 +1,177 @@
|
||||
[#]: subject: "OpenWrt, an open source alternative to firmware for home routers"
|
||||
[#]: via: "https://opensource.com/article/22/7/openwrt-open-source-firmware"
|
||||
[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15671-1.html"
|
||||
|
||||
OpenWrt:一个开源的家用路由器固件替代品
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> OpenWrt 是一个基于 Linux 的开源操作系统,主要针对嵌入式网络设备。
|
||||
|
||||
如果你在家里阅读这篇文章,你可能是用一个 LTE/5G/DSL/WIFI 路由器联网的。这种设备通常负责在你的本地设备(智能手机、PC、电视等)之间路由数据包,并通过内置的调制解调器提供对 WWW 的访问。你家里的路由器很可能有一个基于网页的界面,用于配置该设备。这种界面往往过于简单,因为它们是为普通用户制作的。
|
||||
|
||||
如果你想要更多的配置选项,但又不想花钱买一个专业的设备,你应该看看其他的固件,如 [OpenWrt][2]。
|
||||
|
||||
### OpenWrt 的特点
|
||||
|
||||
OpenWrt 是一个基于 Linux 的、针对嵌入式网络设备的开源操作系统。它主要用于替代各种家用路由器上的原始固件。OpenWrt 具备一个好的路由器应该具备的所有有用功能,如 DNS 服务器([dnsmasq][3]),WiFi 接入点(AP)和客户端功能,用于调制解调器功能的 PPP 协议,而且,与标准固件不同,这一切都是可以完全配置的。
|
||||
|
||||
#### LuCI 网页界面
|
||||
|
||||
OpenWrt 可以通过命令行(SSH)或使用 GUI 配置界面([LuCI][4])进行远程配置。LuCI 是一个用 [Lua][5] 编写的轻量级、可扩展的网页 GUI,它可以精确地配置你的设备。除了配置,LuCI 还提供了很多额外的信息,如实时图表、系统日志和网络诊断。
|
||||
|
||||
![LuCI 网页界面][6]
|
||||
|
||||
LuCI 有一些可选的扩展,以增加更多的配置选择。
|
||||
|
||||
#### 可写文件系统
|
||||
|
||||
它的另一个亮点是可写文件系统。原有的固件通常是只读的,而 OpenWrt 配备了一个可写的文件系统,这要归功于一个巧妙的解决方案,它将 OverlayFS 与 SquashFS/JFFS2 文件系统相结合,允许安装软件包以增强功能。在 [OpenWrt 文档][8] 中可以找到更多关于文件系统架构的信息。
|
||||
|
||||
#### 扩展
|
||||
|
||||
OpenWrt 有一个相关的软件包管理器,[opkg][9],它允许安装额外的服务,比如 FTP 服务器、DLNA 媒体服务器、OpenVPN 服务器、用于实现文件共享的 Samba 服务器、控制电话的 Asterisk 等等。当然,有些扩展需要适当的底层硬件资源。
|
||||
|
||||
### 动机
|
||||
|
||||
你可能想知道为什么要冒着对你的设备造成不可修复的损害和失去保修的风险,而尝试更换路由器制造商的固件。如果你的设备以你想要的方式工作,那么你可能不应该。永远不要碰一个正在运行的系统!但是,如果你想增强功能,或者你的设备缺乏配置选项,那么你应该看看 OpenWrt 是否可以成为一种补救措施。
|
||||
|
||||
在我的例子中,我想要一个旅行用的路由器,当我在露营地的时候,我可以把它放在一个合适的位置,以便让其它设备与这个本地 WiFi 接入点(AP)保持良好连接。该路由器将作为一个普通的客户端连接到互联网,并广播它的 WiFi 接入点让我的其它设备连接到它。这样我就可以配置我的所有设备与这个路由器的接入点连接,当我在其他地方时我只需要改变路由器的客户端连接。此外,在一些露营地,你只能得到一个单一设备的访问代码,我可以通过这种设置来加强。
|
||||
|
||||
作为我的旅行路由器,我选择 TP-Link TL-WR902AC 的原因如下:
|
||||
|
||||
* 很小
|
||||
* 两根 WiFi 天线
|
||||
* 5V 电源(USB)
|
||||
* 低功耗
|
||||
* 成本效益高(你以 30 美元左右的价格得到它)
|
||||
|
||||
为了了解它的尺寸,这里是它在树莓派 4 旁边的样子:
|
||||
|
||||
![TP-Link TL-WR902AC 在树莓派旁边][10]
|
||||
|
||||
尽管这个路由器带来了我所需要的所有硬件功能,但我很快发现,默认的固件并不能让我按照我想要的方式配置它。该路由器主要是作为一个 WiFi 接入点,它可以复制现有的 WiFi 网络或通过板载以太网接口将自己连接到网络。默认的固件对于这些使用情况是非常有限的。
|
||||
|
||||
(LCTT 译注:此型号国内没有销售,它的特点之一是可以通过插入 3G/4G USB 网卡连接到互联网,但由于它不在国内销售,所以没有支持哪种国内 3G/4G USB 网卡的说明,我 [查下来](https://www.tp-link.com/lk/support/3g-comp-list/tl-wr902ac/?location=1963) 似乎华为的 E3372h-320 是可用的。有相关实践的同学可以分享一下经验。
|
||||
|
||||
国内销售的其它类似型号只能通过以太网口或 WiFi 连接到互联网,这种情况下,如果只能通过 3G/4G 连接互联网,那需要另外买一个随身 WiFi /移动路由器。)
|
||||
|
||||
幸运的是,该路由器能够运行 OpenWrt,所以我决定用它来替换原来的固件。
|
||||
|
||||
### 安装
|
||||
|
||||
当你的 LTE/5G/DSL/WiFi 路由器符合 [最低要求][12] 时,很有可能在它上面运行 OpenWrt。下一步,你要查看 [硬件表][13],检查你的设备是否被列为兼容,以及你要选择哪个固件包。OpenWrt 的 [TP-Link TL-WR902AC][14] 的页面还包括安装说明,其中描述了如何刷入内部存储器。
|
||||
|
||||
刷入固件的过程在不同的设备之间可能会有所不同,所以我就不详细介绍了。简而言之,我必须通过将设备连接到一个具有特定 IP 地址的网络接口上的 TFTP 服务器,重命名 OpenWrt 固件文件,然后按复位按钮启动设备。
|
||||
|
||||
### 配置
|
||||
|
||||
一旦刷入成功,你的设备现在应该用新的固件启动了。现在启动可能需要更长的时间,因为与默认固件相比,OpenWrt 具有更多的功能。
|
||||
|
||||
为了开始配置,需要在你的 PC 和路由器之间建立一个直接的以太网连接,OpenWrt 在此充当了一个 DHCP 服务器,并将你的 PC 的以太网适配器配置为一个 DHCP 客户端。
|
||||
|
||||
在 Fedora Linux 上,要激活你的网络适配器的 DHCP 客户端模式,首先你必须通过运行找出连接的 UUID:
|
||||
|
||||
```
|
||||
$ nmcli connection show
|
||||
NAME UUID TYPE DEVICE
|
||||
Wired Conn 1 7a96b...27a ethernet ens33
|
||||
virbr0 360a0...673 bridge virbr0
|
||||
testwifi 2e865...ee8 wifi --
|
||||
virbr0 bd487...227 bridge --
|
||||
Wired Conn 2 16b23...7ba ethernet --
|
||||
```
|
||||
|
||||
选择你要修改的连接的 UUID,然后运行:
|
||||
|
||||
```
|
||||
$ nmcli connection modify <UUID> ipv4.method auto
|
||||
```
|
||||
|
||||
你可以在 [Fedora 联网维基][15] 中找到更多关于这些命令的信息。
|
||||
|
||||
在你连接到路由器后,打开一个网页浏览器并导航到 [http://openwrt/][16]。现在你应该看到 LuCI 的登录管理器:
|
||||
|
||||
![LuCI 登录][17]
|
||||
|
||||
使用 `root` 作为用户名,并将密码留空。
|
||||
|
||||
### 配置 WiFi 和路由
|
||||
|
||||
要配置你的 WiFi 天线,请点击 “<ruby>网络<rt>Network</rt></ruby>” 菜单并选择 “<ruby>无线<rt>Wireless</rt></ruby>”。
|
||||
|
||||
![LuCI 无线配置][19]
|
||||
|
||||
在我的设备上,上面的天线 `radio0` 工作在 2.4GHz 模式,并连接到名为 `MOBILE-INTERNET` 的本地接入点。下面的天线 `radio1` 工作在 5GHz,有一个相关的接入点,SSID 为 `OpenWrt_AV`。通过点击 “<ruby>编辑<rt>Edit</rt></ruby>” 按钮,你可以打开设备配置,以决定该设备属于 LAN 还是 WWAN 网络。在我的例子中,接入点 `OpenWrt_AV` 属于 LAN 网络,客户端连接 `MOBILE-INTERNET` 属于 WWAN 网络。
|
||||
|
||||
![LuCI 配置屏幕][21]
|
||||
|
||||
配置的网络在 “<ruby>接口<rt>Interfaces</rt></ruby>” 面板的 “<ruby>网络<rt>Network</rt></ruby>” 下列出。
|
||||
|
||||
![设备列表][23]
|
||||
|
||||
为了获得我想要的功能,网络流量必须在 LAN 和 WWAN 网络之间进行路由。路由可以在 “<ruby>网络<rt>Network</rt></ruby>” 面板的 “<ruby>防火墙<rt>Firewall</rt></ruby>” 部分进行配置。我没有在这里做任何改动,因为在默认情况下,网络之间的流量是被路由的,而传入的数据包(从 WWAN 到 LAN)必须通过防火墙。
|
||||
|
||||
![防火墙设置][28]
|
||||
|
||||
因此,你需要知道的是一个接口是属于 LAN 还是 (W)WAN。这个概念使它相对容易配置,特别是对初学者来说。你可以在 [OpenWrt 联网基础][25] 指南中找到更多信息。
|
||||
|
||||
### 专属门户
|
||||
|
||||
公共 WiFi 接入点通常受到 [专属门户][26] 的保护,你必须输入一个访问代码或类似的代码。通常情况下,当你第一次连接到接入点并试图打开一个任意的网页时,这种门户就会出现。这种机制是由接入点的 DNS 服务器实现的。
|
||||
|
||||
默认情况下,OpenWrt 激活了一个安全功能,可以防止连接的客户端受到 [DNS 重新绑定攻击][27]。OpenWrt 的重新绑定保护也阻止了专属门户网站被转发到客户端,所以你必须禁用重新绑定保护,以便你可以到达专属门户网站。这个选项在 “<ruby>网络<rt>Network</rt></ruby>” 菜单的 “<ruby>DHCP 和 DNS<rt>DHCP and DNS</rt></ruby>” 面板中。
|
||||
|
||||
### 尝试 OpenWrt
|
||||
|
||||
由于升级到 OpenWrt,我得到了一个基于商品硬件的灵活的旅行路由器。OpenWrt 使你的路由器具有完全的可配置性和可扩展性,而且由于其制作精良的网页 GUI,它也适合初学者使用。甚至有一些 [精选路由器][30] 在出厂时已经安装了 OpenWrt。你还可以用很多 [可用的软件包][31] 来增强你的路由器的功能。例如,我正在使用 [vsftp][32] FTP 服务器,在连接的 U 盘上托管一些电影和电视剧。看看该 [项目主页][33],在那里你可以找到许多切换到 OpenWrt 的理由。
|
||||
|
||||
图片来自: Stephan Avenwedde,[CC BY-SA 4.0][7]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/7/openwrt-open-source-firmware
|
||||
|
||||
作者:[Stephan Avenwedde][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/hansic99
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/lead-images/OSDC_Internet_Cables_520x292_0614_RD.png
|
||||
[2]: https://openwrt.org
|
||||
[3]: https://thekelleys.org.uk/dnsmasq/doc.html
|
||||
[4]: https://openwrt.org/docs/guide-user/luci/start
|
||||
[5]: https://opensource.com/article/20/2/lua-cheat-sheet
|
||||
[6]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_overview_c_0.png
|
||||
[7]: https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
[8]: https://openwrt.org/docs/techref/flash.layout
|
||||
[9]: https://openwrt.org/docs/guide-user/additional-software/opkg
|
||||
[10]: https://opensource.com/sites/default/files/2022-07/OpenWrt_Comparison_RaspberryPi.jpg
|
||||
[12]: https://openwrt.org/supported_devices
|
||||
[13]: https://openwrt.org/toh/start
|
||||
[14]: https://openwrt.org/toh/tp-link/tl-wr902ac_v3
|
||||
[15]: https://fedoraproject.org/wiki/Networking/CLI
|
||||
[16]: http://openwrt/
|
||||
[17]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_login_manager.png
|
||||
[19]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_wireless_section_c.webp
|
||||
[21]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_wifi_device_configuration.webp
|
||||
[23]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_network_devices_0.webp
|
||||
[25]: https://openwrt.org/docs/guide-user/base-system/basic-networking
|
||||
[26]: https://en.wikipedia.org/wiki/Captive_portal
|
||||
[27]: https://en.wikipedia.org/wiki/DNS_rebinding
|
||||
[28]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_firewall_settings.webp
|
||||
[30]: https://opensource.com/article/22/1/turris-omnia-open-source-router
|
||||
[31]: https://openwrt.org/packages/table/start
|
||||
[32]: https://openwrt.org/docs/guide-user/services/nas/ftp.overview
|
||||
[33]: https://openwrt.org/reasons_to_use_openwrt
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202303/29/105431e78pqv0n8x6aqm0l.jpg
|
@ -3,28 +3,30 @@
|
||||
[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15675-1.html"
|
||||
|
||||
如何使用 Kubespray 安装 Kubernetes 集群
|
||||
使用 Kubespray 安装 Kubernetes 集群
|
||||
======
|
||||
|
||||
你是否正在寻找有关如何使用 kubespray 安装 Kubernetes (k8s) 的简单指南?
|
||||
![][0]
|
||||
|
||||
此页面上的分步指南将向你展示如何在 Linux 系统上使用 kubespray 安装 Kubernetes 集群。
|
||||
> 你是否正在寻找有关如何使用 Kubespray 安装 Kubernetes(k8s)的简单指南?
|
||||
|
||||
Kubespray 是一个免费的开源工具,它提供了 ansible playbook 来部署和管理 Kubernetes 集群。它旨在简化跨多个节点的 Kubernetes 集群的安装过程,允许用户快速轻松地部署和管理生产就绪的 Kubernetes 集群。
|
||||
此页面上的分步指南将向你展示如何在 Linux 系统上使用 Kubespray 安装 Kubernetes 集群。
|
||||
|
||||
它支持一系列操作系统,包括 Ubuntu、CentOS、Rocky Linux 和 Red Hat Enterprise Linux,它可以在各种平台上部署 Kubernetes,包括裸机、公共云和私有云。
|
||||
Kubespray 是一个自由开源的工具,它提供了 Ansible <ruby>剧本<rt>playbook</rt></ruby> 来部署和管理 Kubernetes 集群。它旨在简化跨多个节点的 Kubernetes 集群的安装过程,允许用户快速轻松地部署和管理生产就绪的 Kubernetes 集群。
|
||||
|
||||
它支持一系列操作系统,包括 Ubuntu、CentOS、Rocky Linux 和 Red Hat Enterprise Linux(RHEL),它可以在各种平台上部署 Kubernetes,包括裸机、公共云和私有云。
|
||||
|
||||
在本指南中,我们使用以下实验室:
|
||||
|
||||
- Ansible 节点(Kubespray 节点):最小安装的 Ubuntu 22.04 LTS (192.168.1.240)
|
||||
- 3 个控制器节点:最小安装的 Rocky Linux 9 (192.168.1.241/242/243)
|
||||
- 2 个工作节点:最小安装的 Rocky Linux 9 (192.168.1.244/245)
|
||||
- Ansible 节点(Kubespray 节点):最小安装的 Ubuntu 22.04 LTS(192.168.1.240)
|
||||
- 3 个控制器节点:最小安装的 Rocky Linux 9(192.168.1.241/242/243)
|
||||
- 2 个工作节点:最小安装的 Rocky Linux 9(192.168.1.244/245)
|
||||
|
||||
##### kubespray 的最低系统要求
|
||||
### Kubespray 的最低系统要求
|
||||
|
||||
- 主节点:1500 MB RAM、2 个 CPU 和 20 GB 可用磁盘空间
|
||||
- 工作节点:1024 MB、2 个 CPU、20 GB 可用磁盘空间
|
||||
@ -36,7 +38,7 @@ Kubespray 是一个免费的开源工具,它提供了 ansible playbook 来部
|
||||
|
||||
### 步骤 1)配置 Kubespray 节点
|
||||
|
||||
登录到你的 Ubuntu 22.04 系统并安装 ansible。运行以下一组命令:
|
||||
登录到你的 Ubuntu 22.04 系统并安装 Ansible。运行以下一组命令:
|
||||
|
||||
```
|
||||
$ sudo apt update
|
||||
@ -46,7 +48,7 @@ $ cd kubespray
|
||||
$ pip install -r requirements.txt
|
||||
```
|
||||
|
||||
验证 ansible 版本,运行:
|
||||
验证 Ansible 版本,运行:
|
||||
|
||||
```
|
||||
$ ansible --version
|
||||
@ -62,7 +64,7 @@ $ declare -a IPS=(192.168.1.241 192.168.1.241 192.168.1.242 192.168.1.243 192.16
|
||||
$ CONFIG_FILE=inventory/mycluster/hosts.yaml python3 contrib/inventory_builder/inventory.py ${IPS[@]}
|
||||
```
|
||||
|
||||
修改 inventory 文件,设置 3 个控制节点和 2 个工作节点:
|
||||
修改清单文件,设置 3 个控制节点和 2 个工作节点:
|
||||
|
||||
```
|
||||
$ vi inventory/mycluster/hosts.yaml
|
||||
@ -72,7 +74,7 @@ $ vi inventory/mycluster/hosts.yaml
|
||||
|
||||
保存并关闭文件。
|
||||
|
||||
查看并修改文件 “inventory/mycluster/group_vars/k8s_cluster/k8s-cluster.yml” 中的以下参数:
|
||||
查看并修改文件 `inventory/mycluster/group_vars/k8s_cluster/k8s-cluster.yml` 中的以下参数:
|
||||
|
||||
```
|
||||
kube_version: v1.26.2
|
||||
@ -84,35 +86,36 @@ cluster_name: linuxtechi.local
|
||||
|
||||
![][3]
|
||||
|
||||
要启用 kuberenetes 仪表板和入口控制器等插件,请在文件 “inventory/mycluster/group_vars/k8s_cluster/addons.yml” 中将参数设置为已启用:
|
||||
要启用 Kuberenetes 仪表板和入口控制器等插件,请在文件 `inventory/mycluster/group_vars/k8s_cluster/addons.yml` 中将参数设置为已启用:
|
||||
|
||||
```
|
||||
$ vi inventory/mycluster/group_vars/k8s_cluster/addons.yml
|
||||
-----------
|
||||
```
|
||||
|
||||
```
|
||||
dashboard_enabled: true
|
||||
ingress_nginx_enabled: true
|
||||
ingress_nginx_host_network: true
|
||||
-----------
|
||||
```
|
||||
|
||||
保存并退出文件。
|
||||
|
||||
### 步骤 2)将 SSH 密钥从 ansible 节点复制到所有其他节点
|
||||
### 步骤 2)将 SSH 密钥从 Ansible 节点复制到所有其他节点
|
||||
|
||||
首先在你的 ansible 节点上为你的本地用户生成 ssh-keys:
|
||||
首先在你的 Ansible 节点上为你的本地用户生成 SSH 密钥:
|
||||
|
||||
```
|
||||
$ ssh-keygen
|
||||
```
|
||||
|
||||
使用 ssh-copy-id 命令复制 ssh-keys:
|
||||
使用 `ssh-copy-id` 命令复制 SSH 密钥:
|
||||
|
||||
```
|
||||
$ ssh-copy-id [email protected]
|
||||
$ ssh-copy-id [email protected]
|
||||
$ ssh-copy-id [email protected]
|
||||
$ ssh-copy-id [email protected]
|
||||
$ ssh-copy-id [email protected]
|
||||
$ ssh-copy-id sysops@192.168.1.241
|
||||
$ ssh-copy-id sysops@192.168.1.242
|
||||
$ ssh-copy-id sysops@192.168.1.243
|
||||
$ ssh-copy-id sysops@192.168.1.244
|
||||
$ ssh-copy-id sysops@192.168.1.245
|
||||
```
|
||||
|
||||
还要在每个节点上运行以下命令:
|
||||
@ -121,16 +124,16 @@ $ ssh-copy-id [email protected]
|
||||
$ echo "sysops ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/sysops
|
||||
```
|
||||
|
||||
### 步骤 3) 禁用防火墙并启用 IPV4 转发
|
||||
### 步骤 3)禁用防火墙并启用 IPV4 转发
|
||||
|
||||
要在所有节点上禁用防火墙,请从 ansible 节点运行以下 ansible 命令:
|
||||
要在所有节点上禁用防火墙,请从 Ansible 节点运行以下 `ansible` 命令:
|
||||
|
||||
```
|
||||
$ cd kubespray
|
||||
$ ansible all -i inventory/mycluster/hosts.yaml -m shell -a "sudo systemctl stop firewalld && sudo systemctl disable firewalld"
|
||||
```
|
||||
|
||||
运行以下 ansible 命令以在所有节点上启用 IPv4 转发和禁用交换:
|
||||
运行以下 `ansible` 命令以在所有节点上启用 IPv4 转发和禁用交换:
|
||||
|
||||
```
|
||||
$ ansible all -i inventory/mycluster/hosts.yaml -m shell -a "echo 'net.ipv4.ip_forward=1' | sudo tee -a /etc/sysctl.conf"
|
||||
@ -139,7 +142,7 @@ $ ansible all -i inventory/mycluster/hosts.yaml -m shell -a "sudo sed -i '/ swap
|
||||
|
||||
### 步骤 4)启动 Kubernetes 部署
|
||||
|
||||
现在,我们都准备好开始 Kubernetes 集群部署,从 ansible 节点运行下面的 ansible playbook:
|
||||
现在,我们都准备好开始 Kubernetes 集群部署,从 Ansible 节点运行下面的 Ansible 剧本:
|
||||
|
||||
```
|
||||
$ cd kubespray
|
||||
@ -158,7 +161,7 @@ $ ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root
|
||||
|
||||
### 步骤 5)访问 Kubernetes 集群
|
||||
|
||||
登录到第一个主节点,切换到 root 用户,在那里运行 kubectl 命令:
|
||||
登录到第一个主节点,切换到 root 用户,在那里运行 `kubectl` 命令:
|
||||
|
||||
```
|
||||
$ sudo su -
|
||||
@ -170,9 +173,9 @@ $ sudo su -
|
||||
|
||||
![][6]
|
||||
|
||||
完美,上面的输出确认集群中的所有节点都处于就绪状态,并且所有命名空间的 Pod 都已启动并正在运行。这表明我们的 Kubernetes 集群部署成功。
|
||||
完美,上面的输出确认集群中的所有节点都处于就绪状态,并且所有命名空间的 <ruby>容器荚<rt>Pod</rt></ruby> 都已启动并正在运行。这表明我们的 Kubernetes 集群部署成功。
|
||||
|
||||
让我们尝试部署基于 nginx 的部署并将其公开为节点端口,运行以下 kubectl 命令:
|
||||
让我们尝试部署基于 Nginx 的部署并将其公开为节点端口,运行以下 `kubectl` 命令:
|
||||
|
||||
```
|
||||
$ kubectl create deployment demo-nginx-kubespray --image=nginx --replicas=2
|
||||
@ -186,15 +189,15 @@ $ kubectl get svc demo-nginx-kubespray
|
||||
|
||||
![][7]
|
||||
|
||||
现在尝试使用工作节点的 IP 地址和节点端口 (30050) 访问此 nginx 应用。
|
||||
现在尝试使用工作节点的 IP 地址和节点端口(30050)访问此 Nginx 应用。
|
||||
|
||||
使用以下 curl 命令或 Web 浏览器访问此应用。
|
||||
使用以下 `curl` 命令或 Web 浏览器访问此应用。
|
||||
|
||||
```
|
||||
$ curl 192.168.1.245:30050
|
||||
```
|
||||
|
||||
或者
|
||||
或者,
|
||||
|
||||
![][8]
|
||||
|
||||
@ -220,7 +223,6 @@ metadata:
|
||||
```
|
||||
$ kubectl apply -f dashboard-adminuser.yml
|
||||
serviceaccount/admin-user created
|
||||
$
|
||||
```
|
||||
|
||||
创建集群角色绑定:
|
||||
@ -246,7 +248,6 @@ subjects:
|
||||
```
|
||||
$ kubectl apply -f admin-role-binding.yml
|
||||
clusterrolebinding.rbac.authorization.k8s.io/admin-user created
|
||||
$
|
||||
```
|
||||
|
||||
现在,为管理员用户创建令牌:
|
||||
@ -259,15 +260,15 @@ $ kubectl -n kube-system create token admin-user
|
||||
|
||||
复制此令牌并将其放在安全的地方,因为我们将使用令牌登录 Kubernetes 仪表板。
|
||||
|
||||
使用以下 ssh 命令从你的系统连接到第一个主节点
|
||||
使用以下 `ssh` 命令从你的系统连接到第一个主节点:
|
||||
|
||||
```
|
||||
$ ssh -L8001:localhost:8001 [email protected]
|
||||
$ ssh -L8001:localhost:8001 sysops@192.168.1.241
|
||||
```
|
||||
|
||||
注意:替换适合你环境的 IP 地址。
|
||||
|
||||
登录后,切换到 root 用户并运行 “kubectl proxy” 命令:
|
||||
登录后,切换到 root 用户并运行 `kubectl proxy` 命令:
|
||||
|
||||
```
|
||||
$ sudo su -
|
||||
@ -283,11 +284,13 @@ Starting to serve on 127.0.0.1:8001
|
||||
|
||||
完成代理设置后,将以下网址粘贴到浏览器中:
|
||||
|
||||
```
|
||||
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#/login
|
||||
```
|
||||
|
||||
![][12]
|
||||
|
||||
选择令牌登录并粘贴你在上面为管理员用户生成的令牌,然后单击“登录”。
|
||||
选择令牌登录并粘贴你在上面为管理员用户生成的令牌,然后单击“<ruby>登录<rt>Sign in</rt></ruby>”。
|
||||
|
||||
![][13]
|
||||
|
||||
@ -300,7 +303,7 @@ via: https://www.linuxtechi.com/install-kubernetes-using-kubespray/
|
||||
作者:[Pradeep Kumar][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
@ -318,4 +321,5 @@ via: https://www.linuxtechi.com/install-kubernetes-using-kubespray/
|
||||
[10]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Ssh-Tunneling-master-node-kubernetes.png
|
||||
[11]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Proxy-Settings-Kubenetes-Dashbaord-kubespray.png
|
||||
[12]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Kubernetes-Dashboard-Login-Page-KubeSpray.png
|
||||
[13]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Kubernetes-Dashboard-Home-Page-Kubespray.png
|
||||
[13]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Kubernetes-Dashboard-Home-Page-Kubespray.png
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202303/30/074513iy2it365a3fti2f2.jpg
|
@ -0,0 +1,67 @@
|
||||
[#]: subject: "How to set up your own open source DNS server"
|
||||
[#]: via: "https://opensource.com/article/23/3/open-source-dns-server"
|
||||
[#]: author: "Amar Gandhi https://opensource.com/users/amar1723"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15672-1.html"
|
||||
|
||||
如何设置自己的保护隐私的 DNS 服务器
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 通过开源项目 AdGuard Home 运行你自己的 DNS 服务器来控制你的互联网隐私。
|
||||
|
||||
域名服务器(DNS)将域名(如 example.com)与 IP 地址(如 93.184.216.34)相关联。这就是当你输入 URL 或搜索引擎返回 URL 供你访问时,你的网络浏览器如何知道在世界的哪个地方寻找数据。DNS 为互联网用户提供了极大的便利,但也并非没有缺点。例如,付费广告会出现在网页上,因为你的浏览器会自然的使用 DNS 来解析这些广告在互联网上“存在”的位置。同样,跟踪你在线活动的软件通常由通过 DNS 解析的服务启用。你不想完全关闭 DNS,因为它非常有用。但是你可以运行自己的 DNS 服务,以便更好地控制它的使用方式。
|
||||
|
||||
我相信运行自己的 DNS 服务器至关重要,这样你就可以阻止广告并保持你的浏览隐私,远离试图分析你的在线交互的提供商。我过去用过 [Pi-hole][1],今天仍然推荐它。然而,最近,我一直在我的网络上运行开源项目 [AdGuard Home][2]。我发现它有一些值得探索的独特功能。
|
||||
|
||||
### AdGuard Home
|
||||
|
||||
在我使用过的开源 DNS 软件中,[AdGuard Home][2] 是最容易设置和维护的。你可以在一个项目中获得许多 DNS 解析解决方案,例如 DNS over TLS、DNS over HTTPS 和 DNS over QUIC。
|
||||
|
||||
你可以使用一个脚本将 AdGuard 设置为容器或本地服务:
|
||||
|
||||
```
|
||||
$ curl -s -S -L \
|
||||
https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh
|
||||
```
|
||||
|
||||
查看这个脚本以便了解它的作用。了解了它的工作过程后,再运行它:
|
||||
|
||||
```
|
||||
$ sh ./install.sh
|
||||
```
|
||||
|
||||
我最喜欢 AdGuard Home 的一些功能:
|
||||
|
||||
- 一个简单的管理界面
|
||||
- 使用 AdGuard 阻止列表来阻止广告和恶意软件
|
||||
- 单独配置网络上每个设备的选项
|
||||
- 强制在特定设备上进行安全搜索
|
||||
- 为管理界面设置 HTTPS,这样与它的远程交互是完全加密的
|
||||
|
||||
我发现 AdGuard Home 为我节省了时间。它的黑名单比 Pi-hole 上的黑名单更强大。你可以快速轻松地将其配置为 DNS over HTTPS。
|
||||
|
||||
### 没有更多的恶意软件
|
||||
|
||||
恶意软件是你计算机上不需要的内容。它并不总是对你有直接危险,但它可能会为第三方带来危险活动。这不是互联网最初的目的。我认为你应该托管自己的 DNS 服务,以保护你的互联网历史记录的私密性,并避免被微软、谷歌和亚马逊等已知跟踪器掌握。在你的网络上试用 AdGuard Home 吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/3/open-source-dns-server
|
||||
|
||||
作者:[Amar Gandhi][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/amar1723
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://opensource.com/article/18/2/block-ads-raspberry-pi
|
||||
[2]: https://github.com/AdguardTeam/AdGuardHome
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202303/29/150451m9ggza42gagt9gih.jpg
|
@ -0,0 +1,81 @@
|
||||
[#]: subject: "Open-Source Model 'Dolly' Claims to be a Cheaper Alternative to ChatGPT"
|
||||
[#]: via: "https://news.itsfoss.com/open-source-model-dolly/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "lxbwolf"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15678-1.html"
|
||||
|
||||
号称可以成为 ChatGPT 平替的开源模型 “Dolly”
|
||||
======
|
||||
|
||||
> 你需要一款 ChatGPT 的平替?还得是开源的?看起来我们已经被卷入了与 ChatGPT 的开源大战。
|
||||
|
||||
![open source model dolly][1]
|
||||
|
||||
Databricks 这家软件公司,在各个领域都有所建树,尤其是在数据仓库和基于人工智能的解决方案方面。
|
||||
|
||||
最近,随着 ChatGPT 横空出世,Meta、谷歌甚至 Mozilla 都开始效仿 ChatGPT。
|
||||
|
||||
而现在,Databricks 开源了其 <ruby>[大型语言模型][3]<rt>large language model</rt></ruby>(LLM)“Dolly”,也正在以自己的方式进行尝试。
|
||||
|
||||
我们一起来看看它。
|
||||
|
||||
**发生了什么?** 在最近的公告中,Databricks 介绍了他们号称 “**廉价构建**” 的 LLM,使用 [EleutherAI][5] 的已经开源的参数 [模型][4] 提供功能。
|
||||
|
||||
他们在该模型基础上稍作调整,赋予了 Dolly 指令诸如头脑风暴和文本生成的能力。
|
||||
|
||||
当你拿它与 GPT-3 中的 **1750 亿个参数** 比较时,Dolly 的 **60 亿个参数** 就可能显得微不足道。
|
||||
|
||||
但是,当 Databricks 的人看到即使数据量与 GPT-3 相差这么多,Dolly 也能 **展示很多与 ChatGPT 相同的能力** 时,他们感到非常震惊。
|
||||
|
||||
下面是他们展示的其中一个例子:
|
||||
|
||||
![a screenshot of how dolly performs in an open question and answer scenario][6]
|
||||
|
||||
原始模型使用了 [Alpaca][7] 的数据,该模型由斯坦福大学以 Meta 的 [LLaMA][8] LLM 为基础建立。
|
||||
|
||||
但是,正如你所看到的,原始模型产生了一个非常杂乱无章的结果,而 Dolly,通过不同的模型和调整,能够产生一个更为可用的答案。
|
||||
|
||||
> 📝 有趣的事实:“<ruby>多莉<rt>Dolly</rt></ruby>” 名字取自世界上第一只克隆羊。
|
||||
|
||||
**为什么是现在?** 根据 Databricks 的说法,他们认为 **许多公司更愿意建立自己的模型,**而不是将数据发送给某个紧紧掌握模型只对外提供 API 的集中式供应商。
|
||||
|
||||
许多公司可能不愿意将他们最敏感的数据交给第三方,然后在模型质量、成本和所需行为方面进行各种权衡。
|
||||
|
||||
**你想看看吗?**
|
||||
|
||||
当然,但有一个问题。
|
||||
|
||||
你必须 **使用他们的平台来使用 Dolly**,他们已经开源了一个 [Databricks 笔记本][9],可以帮助你在 Databricks 上构建它。
|
||||
|
||||
此外,如果你想获得训练好的权重,你必须联系他们。不过我不确定他们是否会免费提供使用权。
|
||||
|
||||
总而言之,这种开源其模型的举动应该对其他公司有好处,可以保护他们的数据、节省运营成本,其他公司也能使用它创建自己的模型。
|
||||
|
||||
你可以查看其 [公告博客][10],以了解更多技术细节和其他计划。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/open-source-model-dolly/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://news.itsfoss.com/content/images/size/w1304/2023/03/opensource-ai-model-dolly.png
|
||||
[2]: https://news.itsfoss.com/content/images/2023/03/linux-mega-packt.webp
|
||||
[3]: https://en.wikipedia.org/wiki/Large_language_model?ref=its-foss-news
|
||||
[4]: https://huggingface.co/EleutherAI/gpt-j-6B?ref=its-foss-news
|
||||
[5]: https://www.eleuther.ai/?ref=its-foss-news
|
||||
[6]: https://news.itsfoss.com/content/images/2023/03/Dolly_AI.jpg
|
||||
[7]: https://crfm.stanford.edu/2023/03/13/alpaca.html?ref=its-foss-news
|
||||
[8]: https://ai.facebook.com/blog/large-language-model-llama-meta-ai/?ref=its-foss-news
|
||||
[9]: https://github.com/databrickslabs/dolly?ref=its-foss-news
|
||||
[10]: https://www.databricks.com/blog/2023/03/24/hello-dolly-democratizing-magic-chatgpt-open-models.html?ref=its-foss-news
|
@ -0,0 +1,77 @@
|
||||
[#]: subject: "Ubuntu Cinnamon Gets Official Ubuntu Flavor Status"
|
||||
[#]: via: "https://news.itsfoss.com/ubuntu-cinnamon-official/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15677-1.html"
|
||||
|
||||
Ubuntu Cinnamon 正式成为 Ubuntu 官方风味版
|
||||
======
|
||||
|
||||
> 在 Ubuntu 的混合风味中加入肉桂味,完美!
|
||||
|
||||
![][0]
|
||||
|
||||
在等待下个月的 Ubuntu 23.04 吗?
|
||||
|
||||
好吧,我们已经提到,在 Ubuntu 23.04 版本的 [令人兴奋][3] 的事情中,包括一个新的官方的 Cinnamon 风味(它最初是 Ubuntu Cinnamon Remix)。
|
||||
|
||||
而且,它**现在是官方版本*,因为 Ubuntu 的技术委员会以足够的票数 [批准了它][4]。
|
||||
|
||||
### Ubuntu Cinnamon 23.04 值得期待的地方
|
||||
|
||||
![Ubuntu Cinnamon 23.04 的屏幕截图][5]
|
||||
|
||||
如果你之前已经使用过 Ubuntu Cinnamon Remix(非官方),你可能对它有点概念了。
|
||||
|
||||
如果你想要一个带有 Cinnamon 桌面的 Ubuntu 风味版,而没有众多的特殊定制,Ubuntu Cinnamon 适合你。
|
||||
|
||||
而另一方面,Linux Mint 也是一个基于 Ubuntu 的 Cinnamon 桌面。然而,你会得到一个 Mint 特有的主题、图标、工具和调整,体验有所不同。
|
||||
|
||||
基本上,如果你使用 Linux Mint,它不会让你感觉到 “只是另一种 Ubuntu 风味”。
|
||||
|
||||
别忘了,Linux Mint 默认禁用 Snap,而且是 Flatpak 优先的,这与 Ubuntu Cinnamon 23.04 的情况完全相反。
|
||||
|
||||
![Ubuntu Cinnamon 菜单截图][6]
|
||||
|
||||
所以,如果你喜欢使用 Snap 而不是 Flatpak,并且喜欢 Ubuntu 通常的风味版的工作方式,Ubuntu Cinnamon 是一个不错的补充。关于这个版本的其他一些值得注意的地方包括:
|
||||
|
||||
- 预装的应用程序,如 [Synaptic Package Manager][7]、LibreOffice 等
|
||||
- Ubuntu 的 Yaru 主题
|
||||
- 没有像你期望的 Linux Mint 那样的 XApp
|
||||
|
||||
目前,根据其 [最新的日常构建][8],Ubuntu Cinnamon 23.04 几乎已经准备好发布(将于下个月发布)。
|
||||
|
||||
它是否会赢得 Linux Mint 用户的青睐,那是另外一个故事。但是,**Ubuntu 上的新 Cinnamon 版应该会让更多的用户尝试 Cinnamon 桌面,这是件好事**。
|
||||
|
||||
Cinnamon 桌面融合了传统 Windows 风格的布局,并提供了更多的功能。
|
||||
|
||||
你可以在 [Ubuntu Cinnamon 博客][9] 上阅读官方公告。
|
||||
|
||||
你考虑改用 Ubuntu Cinnamon 作为你的首选口味吗?请在评论中分享你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/ubuntu-cinnamon-official/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://news.itsfoss.com/content/images/size/w1304/2023/03/ubuntu-cinnamon-official-flavour.png
|
||||
[2]: https://news.itsfoss.com/content/images/2023/03/linux-mega-packt.webp
|
||||
[3]: https://news.itsfoss.com/ubuntu-23-04/
|
||||
[4]: https://lists.ubuntu.com/archives/technical-board/2023-March/002725.html?ref=its-foss-news
|
||||
[5]: https://news.itsfoss.com/content/images/2023/03/ubuntu-cinnamon-home.jpg
|
||||
[6]: https://news.itsfoss.com/content/images/2023/03/ubuntu-cinnamon-menu.jpg
|
||||
[7]: https://itsfoss.com/synaptic-package-manager/?ref=its-foss-news
|
||||
[8]: https://cdimage.ubuntu.com/ubuntucinnamon/daily-live/current/?ref=its-foss-news
|
||||
[9]: https://ubuntucinnamon.org/ubuntu-cinnamon-flavor-status-announcement/?ref=its-foss-news
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202303/31/091748pq8tq8nluucc5eth.jpg
|
@ -0,0 +1,341 @@
|
||||
[#]: subject: "How to Install CRI-O (Container Runtime) on Ubuntu 22.04"
|
||||
[#]: via: "https://www.linuxtechi.com/install-crio-container-runtime-on-ubuntu/"
|
||||
[#]: author: "James Kiarie https://www.linuxtechi.com/author/james/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15687-1.html"
|
||||
|
||||
如何在 Ubuntu 22.04 上安装 CRI-O 容器运行时
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
CRI-O 是 Kubernetes 的开源轻量级容器运行时。它是使用 <ruby>开放容器组织<rt>Open Container Initiative</rt></ruby>(OCI)兼容运行时的 Kubernetes <ruby>容器运行时接口<rt>Container Runtime Interface</rt></ruby>(CRI)的实现。在运行 Kubernetes 时,它是 Docker 的完美替代品。
|
||||
|
||||
在本指南中,我们将逐步演示如何在 Ubuntu 22.04 LTS 上安装 CRI-O。
|
||||
|
||||
### 先决条件
|
||||
|
||||
在开始之前,这是你需要的:
|
||||
|
||||
- 具有 SSH 访问权限的 Ubuntu 22.04 实例
|
||||
- 在实例上配置的 sudo 用户
|
||||
- 快速稳定的互联网连接
|
||||
|
||||
有了这个,让我们开始吧。
|
||||
|
||||
### 步骤 1:更新系统并安装依赖
|
||||
|
||||
立即登录你的服务器实例,并按如下方式更新包列表:
|
||||
|
||||
```
|
||||
$ sudo apt update
|
||||
```
|
||||
|
||||
更新本地包索引后,按如下方式安装依赖项:
|
||||
|
||||
```
|
||||
$ sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y
|
||||
```
|
||||
|
||||
### 步骤 2:添加 CRI-O 存储库
|
||||
|
||||
要安装 CRI-O,我们需要在 Ubuntu 上添加或启用它的仓库。但首先,你需要根据操作系统和要安装的 CRI-O 版本定义变量。
|
||||
|
||||
因此,定义如下变量:
|
||||
|
||||
```
|
||||
$ export OS=xUbuntu_22.04
|
||||
$ export CRIO_VERSION=1.24
|
||||
```
|
||||
|
||||
完成后,运行以下命令集以添加 CRI-O Kubic 仓库:
|
||||
|
||||
```
|
||||
$ echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /"| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
||||
$ echo "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$CRIO_VERSION/$OS/ /"|sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$CRIO_VERSION.list
|
||||
```
|
||||
|
||||
![][1]
|
||||
|
||||
此后,为 CRI-O 仓库导入 GPG 密钥:
|
||||
|
||||
```
|
||||
$ curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$CRIO_VERSION/$OS/Release.key | sudo apt-key add -
|
||||
$ curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | sudo apt-key add -
|
||||
```
|
||||
|
||||
这会产生如下输出:
|
||||
|
||||
![][2]
|
||||
|
||||
再次更新包索引,使系统与新添加的 CRI-O Kubic 仓库同步:
|
||||
|
||||
```
|
||||
$ sudo apt update
|
||||
```
|
||||
|
||||
### 步骤 3:在 Ubuntu 22.04 上安装 CRI-O
|
||||
|
||||
添加仓库后,使用 APT 包管理器安装 CRI-O 和运行时客户端:
|
||||
|
||||
```
|
||||
$ sudo apt install cri-o cri-o-runc -y
|
||||
```
|
||||
|
||||
![][3]
|
||||
|
||||
安装后,启动并启用 CRI-O 守护程序:
|
||||
|
||||
```
|
||||
$ sudo systemctl start crio
|
||||
$ sudo systemctl enable crio
|
||||
```
|
||||
|
||||
接下来,验证 CRI-O 服务是否正在运行:
|
||||
|
||||
```
|
||||
$ sudo systemctl status crio
|
||||
```
|
||||
|
||||
你应该看到以下输出,表明 CRI-O 服务正在按预期运行:
|
||||
|
||||
![][4]
|
||||
|
||||
### 步骤 4:为 CRI-O 安装 CNI 插件
|
||||
|
||||
接下来,你需要安装 CNI(<ruby>容器网络接口<rt>Container Network Interface</rt></ruby>)以及 CNI 插件。请记住,环回和桥接配置已启用并且足以使用 CRI-O 运行 <ruby>容器荚<rt>Pod</rt></ruby>:
|
||||
|
||||
因此,要安装 CNI 插件,请运行以下命令:
|
||||
|
||||
```
|
||||
$ sudo apt install containernetworking-plugins -y
|
||||
```
|
||||
|
||||
安装后,编辑 CRI-O 配置文件:
|
||||
|
||||
```
|
||||
$ sudo nano /etc/crio/crio.conf
|
||||
```
|
||||
|
||||
取消注释 `network_dir` 和 `plugin_dirs` 部分,并在 `plugin_dirs` 下添加 `/usr/lib/cni/`。
|
||||
|
||||
![][5]
|
||||
|
||||
保存更改并退出配置文件。
|
||||
|
||||
接下来,重启 CRIO 服务:
|
||||
|
||||
```
|
||||
$ sudo systemctl restart crio
|
||||
```
|
||||
|
||||
### 步骤 5:安装 CRI-O 工具
|
||||
|
||||
此外,你还需要安装 `cri-tools` 包,它提供了 `crictl` 命令行程序,用于交互和管理容器和 pod。
|
||||
|
||||
为此,请运行以下命令:
|
||||
|
||||
```
|
||||
$ sudo apt install -y cri-tools
|
||||
```
|
||||
|
||||
安装后,确认 `crictl` 的版本和 `RunTimeVersion` 如下:
|
||||
|
||||
```
|
||||
$ sudo crictl --runtime-endpoint unix:///var/run/crio/crio.sock version
|
||||
```
|
||||
|
||||
![][6]
|
||||
|
||||
一定要检查 CRI-O 是否准备好使用以下命令部署容器荚:
|
||||
|
||||
```
|
||||
$ sudo crictl info
|
||||
```
|
||||
|
||||
![][7]
|
||||
|
||||
`crictl` 命令提供自动补全功能,让你可以通过按 `TAB` 键自动补全命令。要启用命令补全,请运行以下命令:
|
||||
|
||||
```
|
||||
$ sudo su -
|
||||
|
||||
# crictl completion > /etc/bash_completion.d/crictl
|
||||
```
|
||||
|
||||
然后重新加载当前的 Bash 会话:
|
||||
|
||||
```
|
||||
# source ~/.bashrc
|
||||
```
|
||||
|
||||
![][8]
|
||||
|
||||
要使用自动补全功能,你需要注销或启动新的终端会话。然后只需键入 `crictl` 命令并按 `TAB` 键即可查看所有选项。
|
||||
|
||||
```
|
||||
$ crictl
|
||||
```
|
||||
|
||||
![][9]
|
||||
|
||||
### 步骤 6:使用 crictl 程序创建容器荚
|
||||
|
||||
至此,CRI-O 已完全安装和配置并准备好启动容器荚。在本节中,我们将在容器荚中创建一个 Apache Web 服务器并确认它是否正在处理请求。
|
||||
|
||||
首先,我们将使用容器荚配置文件设置一个沙箱或隔离环境,如下所示:
|
||||
|
||||
```
|
||||
$ sudo nano apache_sandbox.json
|
||||
```
|
||||
|
||||
然后我们将以下配置添加到文件中:
|
||||
|
||||
```
|
||||
{
|
||||
"metadata": {
|
||||
"name": "apache-sandbox",
|
||||
"namespace": "default",
|
||||
"attempt": 1,
|
||||
"uid": "hdishd83djaidwnduwk28bcsb"
|
||||
},
|
||||
"linux": {
|
||||
},
|
||||
"log_directory": "/tmp"
|
||||
}
|
||||
```
|
||||
|
||||
保存并退出。接下来使用以下命令创建容器荚。这会打印出很长的字母数字,它是容器荚 ID。
|
||||
|
||||
```
|
||||
$ sudo crictl runp apache_sandbox.json
|
||||
```
|
||||
|
||||
要确认容器荚已创建,请运行命令:
|
||||
|
||||
```
|
||||
$ sudo crictl pods
|
||||
```
|
||||
|
||||
![][10]
|
||||
|
||||
要检索有关创建的容器荚的更多信息,请运行以下命令:
|
||||
|
||||
```
|
||||
$ sudo crictl inspectp --output table 05ba2f0704f22
|
||||
```
|
||||
|
||||
这将打印出 ID、名称、UID、命名空间、创建日期、内部 IP 等详细信息。
|
||||
|
||||
![][11]
|
||||
|
||||
### 步骤 7:在容器荚中创建容器
|
||||
|
||||
这部分中,我们将在容器荚中创建一个 Apache Web 服务器容器。因此,使用 `crictl` 程序从 Docker Hub 拉取 Apache Web 服务器镜像:
|
||||
|
||||
```
|
||||
$ sudo crictl pull httpd
|
||||
```
|
||||
|
||||
你可以如图所示验证拉取的镜像:
|
||||
|
||||
```
|
||||
$ sudo crictl images
|
||||
```
|
||||
|
||||
![][12]
|
||||
|
||||
接下来,我们将为 Apache Web 服务器定义一个容器配置文件:
|
||||
|
||||
```
|
||||
$ sudo nano container_apache.json
|
||||
```
|
||||
|
||||
复制并粘贴以下代码:
|
||||
|
||||
```
|
||||
{
|
||||
"metadata": {
|
||||
"name": "apache"
|
||||
},
|
||||
"image":{
|
||||
"image": "httpd"
|
||||
},
|
||||
"log_path":"apache.0.log",
|
||||
"linux": {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
保存并退出配置文件。
|
||||
|
||||
最后,要将容器连接到之前创建的沙盒容器荚,请运行以下命令:
|
||||
|
||||
```
|
||||
$ sudo crictl create 05ba2f0704f22 container_apache.json apache_sandbox.json
|
||||
```
|
||||
|
||||
这会向终端输出一长串字母数字 ID。请记下此 ID。
|
||||
|
||||
最后,使用 ID 启动 Apache Web 服务器容器,如下所示:
|
||||
|
||||
```
|
||||
$ sudo crictl start 37f4d26510965452aa918f04d629f5332a1cd398d4912298c796942e22f964a7
|
||||
```
|
||||
|
||||
![][13]
|
||||
|
||||
要检查容器状态,请运行以下命令:
|
||||
|
||||
```
|
||||
$ sudo crictl ps
|
||||
```
|
||||
|
||||
![][14]
|
||||
|
||||
要验证 Apache Web 服务器是否正在运行,请使用 `curl` 命令和容器荚的内部 ID 向 Web 服务器发送 HTTP 请求:
|
||||
|
||||
```
|
||||
$ curl -I 10.85.0.2
|
||||
```
|
||||
|
||||
以下输出确认 Web 服务器正在运行:
|
||||
|
||||
![][15]
|
||||
|
||||
### 结论
|
||||
|
||||
这就是全部的指南。我们已经在 Ubuntu 22.04 上成功安装了 CRI-O,并继续创建容器荚和容器。欢迎你提出意见和反馈。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/install-crio-container-runtime-on-ubuntu/
|
||||
|
||||
作者:[James Kiarie][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linuxtechi.com/author/james/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Set-Crio-Repository-Ubuntu-Linux.png
|
||||
[2]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Import-GPG-Keys-for-Crio-Repository-Ubuntu-Linux.png
|
||||
[3]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Apt-Install-Crio-Ubuntu-Linux.png
|
||||
[4]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Start-Enable-Crio-Service-Ubuntu.png
|
||||
[5]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Crio-Conf-Network-Plugins-Directory-Ubuntu.png
|
||||
[6]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Crictl-Crio-Version-Check-Ubuntu-Linux.png
|
||||
[7]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Crictl-Info-Command-Ubuntu.png
|
||||
[8]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Enable-Bash-Completion-Crictl-Command-Ubuntu.png
|
||||
[9]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Crictl-Command-Options-Ubuntu.png
|
||||
[10]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Crictl-Pods-Status-Ubuntu.png
|
||||
[11]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Crictl-Inspect-Pod-Ubuntu-Linux.png
|
||||
[12]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Crictl-pull-image-ubuntu.png
|
||||
[13]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Create-Container-Inside-Pod-Ubuntu-Linux.png
|
||||
[14]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Pods-Status-Crictl-Command-Ubuntu.png
|
||||
[15]: https://www.linuxtechi.com/wp-content/uploads/2023/03/Curl-Command-Httpd-Pod-Ubuntu.png
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202304/03/105419akd0pr3ns2n50nz0.jpg
|
@ -0,0 +1,276 @@
|
||||
[#]: subject: "NixOS Series #5: How to set up home-manager on NixOS?"
|
||||
[#]: via: "https://itsfoss.com/home-manager-nixos/"
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15697-1.html"
|
||||
|
||||
NixOS 系列 #5:如何在 NixOS 上设置主目录管理器
|
||||
======
|
||||
|
||||
在发表这篇文章之前,我解释了如何为一个单用户系统 [在 NixOS 中安装和删除软件包][1]。
|
||||
|
||||
但是,如果你正在供多个用户使用,有一个很好的方法来分别满足每个用户的需求。
|
||||
|
||||
在本指南中,我将指导你如何在 NixOS 上设置一个 <ruby>主目录管理器<rt>Home Manager</rt></ruby>,以及如何使用它来安装软件包。
|
||||
|
||||
如果你是新读者,本系列中讨论的一些资源包括:
|
||||
|
||||
- [使用 NixOS 的原因][2]
|
||||
- [在虚拟机上安装 NixOS][3]
|
||||
- [安装 NixOS 后要做的事情][4]
|
||||
|
||||
### 在 NixOS 上设置主目录管理器
|
||||
|
||||
在本指南中,我将指导你通过 2 种方式来设置主目录管理器:
|
||||
|
||||
- 独立的主目录管理器(使用单独的配置文件)
|
||||
- 作为一个 NixOS 模块(在 `configuration.nix` 文件中使用它)
|
||||
|
||||
那么,让我们从独立方式开始。
|
||||
|
||||
#### 独立安装的主目录管理器
|
||||
|
||||
如果你使用的是 NixOS 的稳定频道,你可以使用以下命令来配置主目录管理器:
|
||||
|
||||
```
|
||||
nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager
|
||||
```
|
||||
|
||||
在编写本指南时,稳定版是 `22.11`。
|
||||
|
||||
而 **如果你在一个不稳定的频道上**,请使用以下命令:
|
||||
|
||||
```
|
||||
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
```
|
||||
|
||||
无论你使用稳定版还是不稳定版,下面的步骤都是一样的。
|
||||
|
||||
一旦完成,更新频道:
|
||||
|
||||
```
|
||||
nix-channel --update
|
||||
```
|
||||
|
||||
最后,使用下面的命令来安装主目录管理器:
|
||||
|
||||
```
|
||||
nix-shell '<home-manager>' -A install
|
||||
```
|
||||
|
||||
🛠️ 在安装时,可能会出现以下错误:
|
||||
|
||||
![安装主目录管理器时出现构建错误][5]
|
||||
|
||||
重新启动你的系统并再次使用安装命令,它将开始安装。
|
||||
|
||||
一旦完成,它将显示独立安装的主目录管理器的位置:
|
||||
|
||||
![主目录管理器在NixOS中的位置][6]
|
||||
|
||||
#### 将主目录管理器安装为 NixOS 模块
|
||||
|
||||
> ⚠️ 如果你选择将主目录管理器作为 NixOS 模块使用,你将需要 sudo 权限。
|
||||
|
||||
如果你在一个稳定的频道上(在写本文的时候,是 `22.11`),你可以使用下面的命令来添加主目录管理器的稳定频道:
|
||||
|
||||
```
|
||||
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager
|
||||
```
|
||||
|
||||
而 **如果你使用的是不稳定通道或主通道**,则使用以下命令:
|
||||
|
||||
```
|
||||
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
```
|
||||
|
||||
一旦你使用上面的任何一条命令完成了添加频道的工作,就用下面的方法更新频道:
|
||||
|
||||
```
|
||||
sudo nix-channel --update
|
||||
```
|
||||
|
||||
接下来,用以下方法打开 `configuration.nix` 文件:
|
||||
|
||||
```
|
||||
sudo nano /etc/nixos/configuration.nix
|
||||
```
|
||||
|
||||
并在 `imports []` 中添加以下一行:
|
||||
|
||||
```
|
||||
<home-manager/nixos>
|
||||
```
|
||||
|
||||
![将主目录管理器安装为 NixOS 模块][7]
|
||||
|
||||
现在,跳到该行的末尾,在 `}` 前添加以下内容:
|
||||
|
||||
```
|
||||
home-manager.users.{username} = { pkgs, ... }: {
|
||||
home.packages = [ ] ;
|
||||
};
|
||||
```
|
||||
|
||||
![NixOS 配置文件中的主目录管理器模块的格式][8]
|
||||
|
||||
上面这一行是为了方便安装和删除软件包而添加的,我接下来会告诉你。
|
||||
|
||||
现在,[保存修改并退出 Nano][9] 文本编辑器。
|
||||
|
||||
接下来,重建配置,并做一个切换:
|
||||
|
||||
```
|
||||
sudo nixos-rebuild switch
|
||||
```
|
||||
|
||||
但如果你使用的是稳定版,并使用上述命令,就会出现以下错误:
|
||||
|
||||
> 🛠️ 错误: 选项 `home-manager.users.user.home.stateVersion` 被使用但没有定义:
|
||||
|
||||
![错误: 选项 `home-manager.users.user.home.stateVersion` 已被使用但未被定义。][10]
|
||||
|
||||
要解决这个问题,你必须在你的主目录管理器块中添加 `home.stateVersion`。
|
||||
|
||||
在写这篇文章时,我正在运行 22.11,所以整个主目录管理器块看起来像这样:
|
||||
|
||||
```
|
||||
home-manager.users.{username} = { pkgs, ... }: {
|
||||
home.stateVersion = "22.11";
|
||||
home.packages = [ ] ;
|
||||
};
|
||||
```
|
||||
|
||||
![如何解决 `home-manager.users.user.home.stateVersion` 选项被使用但没有定义。][11]
|
||||
|
||||
保存修改,按 `Ctrl+O`,按回车键和 `Ctrl+X` 退出 Nano 文本编辑器。
|
||||
|
||||
现在,试着重建配置并再次进行切换,应该可以解决问题。
|
||||
|
||||
### 如何在 NixOS 上使用主目录管理器安装软件包
|
||||
|
||||
现在你已经安装了主目录管理器,如何用它来安装软件包:
|
||||
|
||||
#### 使用独立安装的主目录管理器
|
||||
|
||||
首先,用下面的方法打开配置文件:
|
||||
|
||||
```
|
||||
nano /home/$USER/.config/nixpkgs/home.nix
|
||||
```
|
||||
|
||||
跳到行末,在 `}` 前添加以下代码块:
|
||||
|
||||
```
|
||||
home.packages = [];
|
||||
```
|
||||
|
||||
现在,你所要做的就是在这两个大括号之间写上软件包的名称。
|
||||
|
||||
例如,如果我想安装 `htop`,我将得输入以下内容:
|
||||
|
||||
```
|
||||
home.packages = [pkgs.htop];
|
||||
```
|
||||
|
||||
是的,你通常要在软件包的名称后面加上 `pkgs.`。
|
||||
|
||||
但是,如果你想在每次安装新包时不使用 `pkgs.`,可以改变代码块的语法,如图所示:
|
||||
|
||||
```
|
||||
home.packages = with pkgs; [];
|
||||
```
|
||||
|
||||
而现在,你不再需要在每次安装时使用 `pkgs.`:
|
||||
|
||||
```
|
||||
home.packages = with pkgs; [htop];
|
||||
```
|
||||
|
||||
例如,在这里,我想安装 `htop`、`firefox`和 `libreoffice`,所以我的 `home` 块会看起来像这样:
|
||||
|
||||
![在 NixOS 上使用主目录管理器安装多个软件包][12]
|
||||
|
||||
一旦你完成了添加你喜欢的软件包,保存配置文件并使用以下命令来安装软件包:
|
||||
|
||||
```
|
||||
home-manager switch
|
||||
```
|
||||
|
||||
#### 使用 NixOS 模块方式
|
||||
|
||||
首先,用以下命令打开 `configuration.nix` 文件:
|
||||
|
||||
```
|
||||
sudo nano /etc/nixos/configuration.nix
|
||||
```
|
||||
|
||||
在配置部分,我已经添加了主目录管理器块,所以剩下的就是在 `home.packages = [ ];` 里面添加软件包的名称,格式如图所示:
|
||||
|
||||
```
|
||||
home.packages = [ pkgs.package_name ] ;
|
||||
```
|
||||
|
||||
> 💡我已经在上节提到软件包名称前你可以使用 `pkgs.` 。
|
||||
|
||||
例如,如果我想 [安装 htop][13]、Firefox 和 LibreOffice,那么我将添加:
|
||||
|
||||
```
|
||||
pkgs.htop pkgs.firefox pkgs.libreoffice
|
||||
```
|
||||
|
||||
然后我的主目录管理器块会看起来像这样:
|
||||
|
||||
![作为 NixOS 模块在主目录管理器中安装多个软件包][14]
|
||||
|
||||
现在,保存修改并退出文本编辑器。
|
||||
|
||||
接下来,重建配置并使用以下命令进行切换:
|
||||
|
||||
```
|
||||
sudo nixos-rebuild switch
|
||||
```
|
||||
|
||||
这是这样!软件包将很快被安装。
|
||||
|
||||
### 这就结束了
|
||||
|
||||
我认为你应该选择独立安装,因为你不需要使用超级用户的权限。另外,如果你运行一个有多个用户的系统,为不同的用户拥有不同的配置文件是相当方便的。
|
||||
|
||||
因此,除非你想用一个文件来实现各种目的,否则我认为没有其他理由使用模块选项。
|
||||
|
||||
就这样,我结束了 NixOS 的初学者系列。我希望它能给你一个足够好的平台来熟悉这个独特的 Linux 发行版。
|
||||
|
||||
💬 你喜欢 NixOS 系列文章吗?对于 NixOS 的初学者,我们还有什么要介绍的吗?请提供你的宝贵意见。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/home-manager-nixos/
|
||||
|
||||
作者:[Sagar Sharma][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sagar/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://linux.cn/article-15645-1.html
|
||||
[2]: https://linux.cn/article-15606-1.html
|
||||
[3]: https://linux.cn/article-15624-1.html
|
||||
[4]: https://linux.cn/article-15663-1.html
|
||||
[5]: https://itsfoss.com/content/images/2023/02/building-error-while-installing-home-manager.png
|
||||
[6]: https://itsfoss.com/content/images/2023/02/location-of-home-manager-in-NixOS.png
|
||||
[7]: https://itsfoss.com/content/images/2023/02/install-home-manager-as-NixOS-module.png
|
||||
[8]: https://itsfoss.com/content/images/2023/02/syantax-for-home-manager-module-in-NixOS-config-file.png
|
||||
[9]: https://linuxhandbook.com/nano-save-exit/?ref=itsfoss.com
|
||||
[10]: https://itsfoss.com/content/images/2023/02/The-option--home-manager.users.user.home.stateVersion--is-used-but-not-defined..png
|
||||
[11]: https://itsfoss.com/content/images/2023/02/how-to-solve-The-option--home-manager.users.user.home.stateVersion--is-used-but-not-defined..png
|
||||
[12]: https://itsfoss.com/content/images/2023/02/install-multiple-packages-using-home-manager-on-NixOS.png
|
||||
[13]: https://itsfoss.com/use-htop/
|
||||
[14]: https://itsfoss.com/content/images/2023/02/install-multiple-packages-in-home-manager-as-a-NixOS-module.png
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202304/06/110641k8v9q1152hhhh114.jpg
|
@ -0,0 +1,107 @@
|
||||
[#]: subject: "3 surprising things Linux sysadmins can do with systemd"
|
||||
[#]: via: "https://opensource.com/article/23/3/3-things-you-didnt-know-systemd-could-do"
|
||||
[#]: author: "Alan Smithee https://opensource.com/users/alansmithee"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15685-1.html"
|
||||
|
||||
三件可以用 systemd 做的令人惊讶的事情
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 它不仅仅是为了让你的电脑启动得更快。
|
||||
|
||||
当 systemd 刚问世时,有很多关于它能加快启动时间的消息。这项功能对大多数人都有吸引力(对那些不重启的人来说就不那么重要了),所以在很多方面,这也是它今天仍然拥有的声誉。虽然 systemd 确实是在启动过程中并行启动服务起到了作用,但它的作用远不止于此。以下是你可能没有意识到 systemd 可以做的三件事,但你应该好好利用。
|
||||
|
||||
### 1、简化 Linux ps
|
||||
|
||||
如果你曾经使用过 `ps`,甚至只是 `top` 命令,那么你就会知道你的电脑一直都在运行数百个进程。有时,这正是你需要的信息,以便了解你的计算机或其用户在做什么。其他时候,你真正需要的是一个总体的概览。
|
||||
|
||||
`systemd-cgtop` 命令提供了一个基于<ruby>控制组<rt>cgroup</rt></ruby>任务安排的计算机负载的简单视图。[控制组][2] 对现代 Linux 很重要,基本上是容器和 Kubernetes 的底层支持结构(这也是云计算可以扩展的原因),但它们也是家庭电脑上的有用结构。例如,从 `systemd-cgtop` 的输出中,你可以看到用户进程的负载,而不是系统进程:
|
||||
|
||||
```
|
||||
Control Group Proc+ %CPU Memory Input/s Output/s
|
||||
/ 183 5.0 1.6G 0B 3.0M
|
||||
user.slice 4 2.8 1.1G 0B 174.7K
|
||||
user.slice/user-1000.slice 4 2.8 968.2M 0B 174.7K
|
||||
system.slice 65 2.2 1.5G 0B 2.8M
|
||||
```
|
||||
|
||||
你也可以只查看你的用户空间进程,或者查看用户空间进程和内核线程。
|
||||
|
||||
这绝不是对 `top` 或 `ps` 的替代,而是从一个不同的、独特的角度来观察你的系统。在运行容器时,它可能是至关重要的,因为容器使用控制组。
|
||||
|
||||
### 2、Linux 定时任务
|
||||
|
||||
[Cron][3] 是 Linux 的一个经典组件。当你想安排一些事情定期发生时,你会使用 Cron。它很可靠,而且相当好地集成到你的系统中。
|
||||
|
||||
问题是,Cron 并不了解有些计算机会被关闭。如果你有一个安排在午夜的 Cron 任务,但你每天在 23:59 关闭你的电脑,那么你的 Cron 任务就永远不会运行。Cron 没有任何工具可以检测到一夜之间错过了工作。
|
||||
|
||||
作为对这个问题的回答,有一个很好的 [Anacron][4],但它不像 Cron 那样集成的好。要让 Anacron 运行,你需要做很多设置。
|
||||
|
||||
第二个选择是 systemd 计时器。和 Cron 一样,它也是内置的,可以随时使用。你需要写一个单元文件,这肯定比单行的 Crontab 条目多,但也很简单。例如,这里有一个单元文件,在开机 30 分钟后运行一个假想的备份脚本,但每天只运行一次。这可以确保我的电脑得到备份,并防止它每天尝试备份超过一次。
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Backup
|
||||
Requires=myBackup.service
|
||||
|
||||
[Timer]
|
||||
OnBootSec=30min
|
||||
OnUnitActiveSec=1d
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
```
|
||||
|
||||
当然,你也可以干预并提示运行一个任务。多亏了 `OnUnitActiveSec` 指令,systemd 不会试图运行你手动激活的作业。
|
||||
|
||||
### 3、运行 Linux 容器
|
||||
|
||||
容器使启动一个复杂的服务变得非常容易。你可以在短短几分钟内运行一个 [Mattermost][5] 或 Discourse 服务器。在某些情况下,困难的部分是在你运行容器后管理和监控它们。Podman 使得管理它们变得容易,但是用什么来管理 Podman 呢?嗯,[你可以使用 systemd][6]。
|
||||
|
||||
Podman 有一个内置的命令来生成单元文件,这样你的容器就可以被 systemd 管理和监控:
|
||||
|
||||
```
|
||||
$ podman generate systemd --new --files --name example_pod
|
||||
```
|
||||
|
||||
然后你所要做的就是启动服务:
|
||||
|
||||
```
|
||||
$ systemctl --user start pod-example_pod.service
|
||||
```
|
||||
|
||||
和其他服务一样,systemd 确保你的容器荚在任何情况下都能运行。它记录问题,你可以用 `journalctl` 和其他重要的日志来查看,你也可以用 `systemd-cgtop` 在控制组中监控它的活动。
|
||||
|
||||
它不是 [Kubernetes 平台][7],但对于一两个容器来说,你只需要在可靠和可预测的基础上提供服务,Podman 和 systemd 是一对很棒的组合。
|
||||
|
||||
### 下载 systemd 电子书
|
||||
|
||||
systemd 的内容还有很多,你可以从作者 [David Both][8] 的新书《[systemd 实用指南][1]》中了解基础知识,以及很多实用的技巧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/3/3-things-you-didnt-know-systemd-could-do
|
||||
|
||||
作者:[Alan Smithee][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/alansmithee
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://opensource.com/downloads/pragmatic-guide-systemd-linux
|
||||
[2]: https://www.redhat.com/sysadmin/cgroups-part-four?intcmp=7013a000002qLH8AAM
|
||||
[3]: https://opensource.com/article/17/11/how-use-cron-linux
|
||||
[4]: https://opensource.com/article/21/2/linux-automation
|
||||
[5]: https://opensource.com/education/16/3/mattermost-open-source-chat
|
||||
[6]: https://www.redhat.com/sysadmin/podman-run-pods-systemd-services?intcmp=7013a000002qLH8AAM
|
||||
[7]: https://www.redhat.com/en/technologies/cloud-computing/openshift/aws?intcmp=7013a000002qLH8AAM
|
||||
[8]: https://opensource.com/users/dboth
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202304/02/135545u0rwtqdemqefme3e.jpg
|
@ -0,0 +1,149 @@
|
||||
[#]: subject: "How to Install and Use Neovim on Ubuntu and other Linux Distributions"
|
||||
[#]: via: "https://itsfoss.com/install-neovim/"
|
||||
[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15680-1.html"
|
||||
|
||||
如何安装和使用 Neovim
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 你一定已经听说过著名的 Vim 文本编辑器。然而,这篇文章是关于它的复刻 Neovim。
|
||||
|
||||
Vim 也是 Vi 的一个复刻,这使得 Neovim 成为复刻的复刻。所以,你最终可以使用任何东西,因为它有一些独特的特征。
|
||||
|
||||
如果你决定使用 Neovim,让我帮助你在 Ubuntu 和其他 Linux 发行版上开始使用它。
|
||||
|
||||
### Neovim 概述
|
||||
|
||||
![][2]
|
||||
|
||||
[Neovim][3] 是一个以其简单的维护和社区贡献而闻名的项目。此外,开发工作很好地分配在多个开发人员之间。
|
||||
|
||||
对于最终用户而言,Neovim 的可扩展性远超人们的预期。Neovim 的目标是在不损害 Vim 传统功能的情况下提供更好的应用。
|
||||
|
||||
使用 [Neovim 的 GUI][4],你可以获得增强的编辑体验。
|
||||
|
||||
### Neovim 的特点
|
||||
|
||||
虽然你可以在其官方网站及其 [GitHub 页面][5] 上探索所有相关信息。让我强调一些特点:
|
||||
|
||||
- 现代图形界面
|
||||
- 从多种语言访问 API,包括(C/C++、C#、Go、Haskell、Java/Kotlin、JavaScript/Node.js、Lua、Perl、Python、Ruby、Rust 等等)
|
||||
- 嵌入式、可编写脚本的终端仿真器
|
||||
- 异步任务控制
|
||||
- 多个实例之间的共享数据
|
||||
- XDG 基本目录支持
|
||||
- 与大多数 Vim 插件兼容,包括 Ruby 和 Python 插件
|
||||
|
||||
> 💡 我们建议你在开始使用 Vim 和 Neovim 之前,先了解其用法。
|
||||
|
||||
### 在 Ubuntu 和 Linux 上安装 Neovim
|
||||
|
||||
由于 Neovim 的流行,安装它很简单。因为 Neovim 在你选择的任何发行版的官方仓库中都可用。
|
||||
|
||||
> 如果你需要,我们还有一个 [在 Linux 上安装 Vim][6] 的指南。
|
||||
|
||||
要在 Ubuntu 上安装 Neovim,只需单击停靠区中的 Ubuntu 软件图标。然后,搜索 Neovim。你可以根据自己的喜好选择 Snap 或 deb 版本。但是,deb 包版本是过时的 Neovim 版本。
|
||||
|
||||
![neovim listed on ubuntu software center][7]
|
||||
|
||||
如果你不想要 Snap 版本,你可以从 [Neovim 的 Github 发布页][8] 获取最新的 deb 文件。如果你仔细查看发布页面,还有一个 Appimage 文件。
|
||||
|
||||
如果你想使用终端而不是 GUI,你可以执行以下操作:
|
||||
|
||||
对于基于 **Ubuntu 和 Debian** 的发行版,输入以下命令进行安装:
|
||||
|
||||
```
|
||||
sudo apt install neovim
|
||||
```
|
||||
|
||||
对于 **Manjaro 和 Arch Linux**,使用以下命令更新你的系统并安装 Neovim:
|
||||
|
||||
```
|
||||
sudo pacman -Syu neovim
|
||||
```
|
||||
|
||||
对于 **Fedora**,使用以下命令:
|
||||
|
||||
```
|
||||
sudo dnf install -y neovim
|
||||
```
|
||||
|
||||
要安装 **Flatpak**,你可以使用此命令:
|
||||
|
||||
```
|
||||
flatpak install flathub io.neovim.nvim
|
||||
```
|
||||
|
||||
最后,要安装 **Snap 包**,请使用以下命令:
|
||||
|
||||
```
|
||||
sudo snap install nvim --classic
|
||||
```
|
||||
|
||||
如果你更喜欢从源代码构建软件,请遵循该项目的 Github 页面上给出的 [步骤][9]。
|
||||
|
||||
### 如何使用 Neovim
|
||||
|
||||
要在安装完成后使用 Neovim,只需从应用菜单启动它,方法是按超级键并输入 `neovim`。这将打开一个带有 Neovim 的终端窗口。
|
||||
|
||||
![][10]
|
||||
|
||||
或者你可以打开你选择的任何终端仿真器并输入以下命令:
|
||||
|
||||
```
|
||||
nvim
|
||||
```
|
||||
|
||||
是的,不是 `neovim`,而是 `nvim`。例如,要编辑 `/etc/fstab`,请输入以下命令:
|
||||
|
||||
```
|
||||
sudo nvim /etc/fstab
|
||||
```
|
||||
|
||||
现在 fstab 文件将被打开,如下面的截图所示:
|
||||
|
||||
![][11]
|
||||
|
||||
如果你无法退出编辑器,请不要担心,按下 `Shift+Z+Z`。例如,如果此快捷键令人困惑,请使用你需要的键在任何文本编辑器中输入大写的 `ZZ` 就明白了。
|
||||
|
||||
关于这一点,我应该重申,你需要学习 Vim 或 Neovim 并阅读文档才能有效地利用其所有功能。
|
||||
|
||||
### 总结
|
||||
|
||||
安装和启动 Neovim 非常简单,但学习它肯定需要一些键盘操作。
|
||||
|
||||
这只是编辑器的概述。我不是这方面的专家,但我希望这对所有初学者都有好处!
|
||||
|
||||
💬 你使用 Neovim 吗? 在下面的评论中分享你的经验。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-neovim/
|
||||
|
||||
作者:[Anuj Sharma][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/anuj/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://itsfoss.com/content/images/2023/03/linux-mega-packt.webp
|
||||
[2]: https://itsfoss.com/content/images/2023/03/goneovim.png
|
||||
[3]: https://neovim.io/?ref=itsfoss.com
|
||||
[4]: https://itsfoss.com/neovim-gui-editors/
|
||||
[5]: https://github.com/neovim/neovim?ref=itsfoss.com
|
||||
[6]: https://itsfoss.com/install-latest-vim-ubuntu/
|
||||
[7]: https://itsfoss.com/content/images/2023/01/software-center-neovim-snap.png
|
||||
[8]: https://github.com/neovim/neovim/releases/tag/stable?ref=itsfoss.com
|
||||
[9]: https://github.com/neovim/neovim/wiki/Installing-Neovim?ref=itsfoss.com#install-from-source
|
||||
[10]: https://itsfoss.com/content/images/2023/01/neovim-default-screen.png
|
||||
[11]: https://itsfoss.com/content/images/2023/01/neovim-fstab.png
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202304/01/173733iav3pvd88htv38vt.jpg
|
@ -0,0 +1,92 @@
|
||||
[#]: subject: "blendOS Aims to Replace All Linux Distributions"
|
||||
[#]: via: "https://news.itsfoss.com/blendos/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15684-1.html"
|
||||
|
||||
blendOS 的目标:取代所有的 Linux 发行版
|
||||
======
|
||||
|
||||
> Ubuntu Unity 的负责人提出了一个新的发行版,听起来像是每个人都可能想要关注的东西。
|
||||
|
||||
![blend os][1]
|
||||
|
||||
听起来太牵强了?
|
||||
|
||||
好吧,blendOS 把自己定位为发行版的终极杂拌。
|
||||
|
||||
blendOS 是 Rudra Saraswat 的一个新项目,他以基于 Ubuntu 的合成版而闻名,特别是 Ubuntu Unity(现在是官方的 [Ubuntu 风味版][3])。
|
||||
|
||||
我想说的是,这个项目有一个非常准确的名字来表达它想要实现的目标。
|
||||
|
||||
但是,blendOS 的目标是如何成为所有人的替代品?它到底是什么?
|
||||
|
||||
### blendOS 不只是又一个 Linux 发行版
|
||||
|
||||
![blendOS][4]
|
||||
|
||||
blendOS 是一个基于 Arch 的发行版,它支持每种类型的应用程序包。
|
||||
|
||||
如果你了解过 [carbonOS][5] 和 [Vanilla OS][6],你应该对这类发行版中的一些共同点有了了解。
|
||||
|
||||
其中之一是,**不可变性**,意思是,操作系统的核心/基础保持不变,给你带来增强的安全性,以及更简单和可靠的更新。
|
||||
|
||||
同样,blendOS 也有以下的关键亮点:
|
||||
|
||||
- 不可变操作系统
|
||||
- 支持多个软件包管理器,包括 Apt、DNF、Yum、Pacman 和 Yay
|
||||
- 支持多种桌面环境
|
||||
- Flathub 商店桌面应用
|
||||
|
||||
[blendOS][7] 使用 Jade GUI(来自 [Crystal Linux][8] 的安装程序)来提供一个无缝的安装体验。而且,Flathub 商店可以直接安装应用程序,而不是像人们想象的那样下载 Flatpakref文件。
|
||||
|
||||
为了使所有的发行版的软件包都能正常工作,blendOS 使用其软件包管理器 blend。
|
||||
|
||||
你仍然可以通过 Arch 容器在命令行使用 Pacman。
|
||||
|
||||
此外,它还支持,T2 Mac,即 2018 年后生产的英特尔 Mac。因此,如果你想在你已经拥有的设备上做实验,blendOS 应该可以使用。
|
||||
|
||||
> 🚧 截至目前,该项目还处于早期发展阶段。
|
||||
|
||||
预计一些直接的变化包括:
|
||||
|
||||
![][9]
|
||||
|
||||
- 用 Podman 代替 Distrobox 的实现
|
||||
- 一个新的 GUI 配置工具,支持管理覆盖层和容器
|
||||
|
||||
所以,是的,你现在看到的东西可能会有变化。然而,它仍然是听起来令人激动的东西。
|
||||
|
||||
你可以在其 [官方博客文章][10] 中阅读其计划中的变化,并在其 [GitHub 页面][11]中探索 blendOS。
|
||||
|
||||
> **[blendOS][7]**
|
||||
|
||||
你对 blendOS 有什么看法?它值得关注吗?请在评论中告诉我!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/blendos/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://news.itsfoss.com/content/images/size/w1304/2023/03/blendOS-first-look.png
|
||||
[2]: https://news.itsfoss.com/content/images/2023/03/linux-mega-packt.webp
|
||||
[3]: https://itsfoss.com/which-ubuntu-install/?ref=its-foss-news
|
||||
[4]: https://news.itsfoss.com/content/images/2023/03/blend-os.jpg
|
||||
[5]: https://news.itsfoss.com/carbonos/
|
||||
[6]: https://news.itsfoss.com/vanilla-os-debian-ubuntu/
|
||||
[7]: https://blendos.co/?ref=its-foss-news
|
||||
[8]: https://news.itsfoss.com/crystal-linux-dev/
|
||||
[9]: https://news.itsfoss.com/content/images/2023/03/blend-settings-containers.png
|
||||
[10]: https://blendos.co/future-of-blendos/?ref=its-foss-news
|
||||
[11]: https://github.com/blend-os?ref=its-foss-news
|
@ -0,0 +1,138 @@
|
||||
[#]: subject: "Create a ChatBot in Mattermost with Python"
|
||||
[#]: via: "https://opensource.com/article/23/3/chatbot-mattermost-python"
|
||||
[#]: author: "Dr. Michael J. Garbade https://opensource.com/users/drmjg"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15693-1.html"
|
||||
|
||||
使用 Python 在 Mattermost 中创建 ChatOps 聊天机器人
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 用一个简单的开源机器人在你的组织中实施 ChatOps。
|
||||
|
||||
ChatOps 是一种协作模型,它将人员、流程、工具和自动化连接到一个透明的工作流中。[Mattermost][1] 是一个开源、自托管的消息平台,使组织能够安全、有效和高效地进行通信。它是 Slack、Discord 和其他专有消息平台的绝佳 [开源替代品][2]。本文概述了在 Mattermost 上创建 ChatOps 机器人的步骤,包括必要的代码示例和解释。
|
||||
|
||||
### 先决条件
|
||||
|
||||
在开始之前,请确保你可以访问 Mattermost 服务器,[安装 Python][3],并 [使用 pip][4] 安装 Mattermost Python 驱动。
|
||||
|
||||
### 在 Mattermost 上创建一个机器人帐户
|
||||
|
||||
要创建机器人帐户,请访问 Mattermost 系统控制台,并添加具有适当访问权限的机器人帐户。获取机器人的用户名和密码以在 Python 脚本中使用。
|
||||
|
||||
### 设置 Mattermost Python 驱动
|
||||
|
||||
使用 `pip` 安装 Mattermost Python 驱动,并将其导入 Python 脚本。创建一个新的驱动实例并登录到 Mattermost 服务器。
|
||||
|
||||
### 在 Python 中创建 ChatOps 机器人
|
||||
|
||||
创建一个新的 Python 脚本,定义要导入的必要库,并使用 Mattermost 驱动的 API 实现机器人的功能。编写代码来处理消息、命令和其他事件,并使用 Mattermost 驱动的 API 方法向通道和用户发送消息和通知。最后,调试和测试 ChatOps 机器人。
|
||||
|
||||
### ChatOps 机器人代码示例
|
||||
|
||||
以下是响应用户消息的简单 ChatOps 机器人的示例 Python 代码:
|
||||
|
||||
```
|
||||
from mattermostdriver import Driver
|
||||
|
||||
bot_username = 'bot_username'
|
||||
bot_password = 'bot_password'
|
||||
server_url = 'https://your.mattermost.server.url'
|
||||
|
||||
def main():
|
||||
driver = Driver({'url': server_url, 'login_id': bot_username, 'password': bot_password, 'scheme': 'https'})
|
||||
driver.login()
|
||||
team = driver.teams.get_team_by_name('team_name')
|
||||
channel = driver.channels.get_channel_by_name(team['id'], 'channel_name')
|
||||
|
||||
@driver.on('message')
|
||||
def handle_message(post, **kwargs):
|
||||
if post['message'] == 'hello':
|
||||
driver.posts.create_post({
|
||||
'channel_id': post['channel_id'],
|
||||
'message': 'Hi there!'
|
||||
})
|
||||
|
||||
driver.init_websocket()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
```
|
||||
|
||||
### 添加功能
|
||||
|
||||
在 Mattermost 上创建基本的 ChatOps 机器人后,你可以添加更多功能来扩展其功能。以下是步骤:
|
||||
|
||||
- **确定要添加的功能**:在编写代码之前,你必须确定要添加到 ChatOps 机器人的功能。可以是从发送通知到与第三方工具集成的任何事情。
|
||||
- **编写代码**:确定要添加的功能后,就可以开始编写代码了。代码将取决于添加的功能,但你可以使用 Mattermost Python 驱动与 Mattermost API 交互并实现该功能。
|
||||
- **测试代码**:编写代码后,重要的是对其进行测试以确保其按预期工作。在将其部署到生产服务器之前,你可以在开发服务器或测试通道中测试代码。
|
||||
- **部署代码**:当你对其进行了测试并且它按预期工作,你就可以将其部署到你的生产服务器。遵循你组织的部署流程并确保新代码不会破坏任何现有功能。
|
||||
- **记录新功能**:记录你添加到 ChatOps 机器人的新功能非常重要。这将使其他团队成员更容易使用该机器人并了解其功能。
|
||||
|
||||
一个 ChatOps Bot 功能示例是与第三方工具集成并提供某些任务的状态更新。
|
||||
|
||||
```
|
||||
from mattermostdriver import Driver
|
||||
import requests
|
||||
|
||||
bot_username = 'bot_username'
|
||||
bot_password = 'bot_password'
|
||||
server_url = 'https://your.mattermost.server.url'
|
||||
|
||||
def main():
|
||||
driver = Driver({'url': server_url, 'login_id': bot_username, 'password': bot_password, 'scheme': 'https'})
|
||||
driver.login()
|
||||
team = driver.teams.get_team_by_name('team_name')
|
||||
channel = driver.channels.get_channel_by_name(team['id'], 'channel_name')
|
||||
|
||||
@driver.on('message')
|
||||
def handle_message(post, **kwargs):
|
||||
if post['message'] == 'status':
|
||||
# Make a request to the third-party tool API to get the status
|
||||
response = requests.get('https://api.thirdpartytool.com/status')
|
||||
if response.status_code == 200:
|
||||
status = response.json()['status']
|
||||
driver.posts.create_post({
|
||||
'channel_id': post['channel_id'],
|
||||
'message': f'The status is {status}'
|
||||
})
|
||||
else:
|
||||
driver.posts.create_post({
|
||||
'channel_id': post['channel_id'],
|
||||
'message': 'Failed to get status'
|
||||
})
|
||||
|
||||
driver.init_websocket()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
```
|
||||
|
||||
在此示例中,ChatOps 机器人监听命令 `status` 并向第三方工具 API 发出请求以获取当前状态。然后它会在发出命令的 Mattermost 频道中发布状态更新。这使团队成员无需离开聊天平台即可快速获取任务状态的更新。
|
||||
|
||||
### 开源 ChatOps
|
||||
|
||||
总之,在 Mattermost 上创建 ChatOps 机器人是一个简单的过程,可以为你组织的沟通和工作流程带来许多好处。本文提供了分步分解和代码示例,可帮助你开始创建你的机器人,甚至可以通过添加新功能对其进行自定义。现在你了解了基础知识,你可以进一步探索 ChatOps 和 Mattermost 以优化团队的协作和生产力。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/3/chatbot-mattermost-python
|
||||
|
||||
作者:[Dr. Michael J. Garbade][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/drmjg
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://mattermost.com/
|
||||
[2]: https://opensource.com/alternatives/slack
|
||||
[3]: https://opensource.com/article/17/10/python-101
|
||||
[4]: https://opensource.com/article/20/3/pip-linux-mac-windows
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202304/05/092837ab3y8zft3hhv02hr.jpg
|
@ -0,0 +1,189 @@
|
||||
[#]: subject: "Debian 12 Bookworm: Best New Features"
|
||||
[#]: via: "https://www.debugpoint.com/debian-12-features/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "robsean"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15694-1.html"
|
||||
|
||||
Debian 12 “Bookworm” 的新功能和改进
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 让我们给你总结一下即将发布的 Debian 12 “Bookworm” 的新功能和改进。
|
||||
|
||||
Debian 12 已经开发了几个月了,并且正在慢慢走向最终的发布版本。截止发稿时, 它当前正处于冻结状态下。这意味着预计不会有重大的软件包更改或改进。
|
||||
|
||||
这个发布版本带来一些新功能和改进,使其成为 Debian 爱好者期待的一个版本。在这篇文章中,我们将讨论 Debian 12 “Bookworm” 的最好的新功能,以及它们如何使用户受益。
|
||||
|
||||
让我们来看看。
|
||||
|
||||
![Debian 12 Bookworm GNOME Desktop][1]
|
||||
|
||||
### Debian 12 “Bookworm” 的新功能和改进
|
||||
|
||||
#### Linux 内核
|
||||
|
||||
这个发布版本采用了发布于 2022 年 12 月的 Linux 主线内核 6.1。从时间线上看,到目前为止,Debian 12 的内核版本号只比最新内核落后一个版本。因此,你将通过使用稳定的 Linux 内核 6.1 来获得最新的和最好的硬件支持。
|
||||
|
||||
这个内核的亮点功能包括:初步支持 Rust 框架、更新支持英特尔和 AMD 即将推出的 CPU/GPU 系列硬件、改善 Btrfs 和其它文件系统系统的性能等等。
|
||||
|
||||
如果你想要了解更多的话,我们已经有一篇关于 [内核 6.1 特性][2] 的专题文章。
|
||||
|
||||
#### 在安装程序中的非自由软件包
|
||||
|
||||
在 Debian 12 中出现了一个与 Debian 的 ISO 文件有关的重大更改。最初,Debian 就分别针对 “自由” 和 “非自由” 软件包提供了不同的 ISO 文件。专有的 “非自由” 软件包是单独的 ISO 文件的一部分。因此,如果你需要针对你的特殊硬件的驱动支持,那么你可以针对你的笔记本/台式机/服务器下载不同的 ISO 文件。
|
||||
|
||||
然而,这种体验使终端用户在选择恰当的 Debian 的 ISO 时感到迷惑。为此,Debian 团队去年发起一次社区投票,以选出如何处理 “非自由” 的最好的选项。
|
||||
|
||||
根据 [选出的结果][3] , 现在,基本的 ISO 文件现在包含 “自由” 和 “非自由” 的软件包。
|
||||
|
||||
那么,发生了什么变化?
|
||||
|
||||
在我们尝试现在官方的 Debian 的 ISO 文件时,你只需要选择一个包含所有东西的 ISO 文件 (DVD 大小的体积)。此外,也提供小型的网络安装的 ISO 文件,包含 “非自由” 固件。
|
||||
|
||||
你可以查看关于 Debian 的 ISO 文件的 [这篇指南][4] 。
|
||||
|
||||
#### GNOME 在默认情况下使用 Pipewire
|
||||
|
||||
如果你在 Debian Linux 中使用 GNOME 桌面环境,那么,给你带来一个好消息。
|
||||
|
||||
Debian 12 和 GNOME 桌面环境 [在默认情况下,使用 Pipewire 和 Wireplumber 管理器][5] 作为声音服务器,取代了 Pulseaudio 。现代化的 Pipewire 早就已经引入 Ubuntu 、Fedora 、Pop!_OS 等其它领先的发行版。
|
||||
|
||||
![Pipewire in Debian 12][6]
|
||||
|
||||
#### 新版本的 Apt 软件包管理器(2.6)
|
||||
|
||||
Debian 12 引入 Apt 软件包管理器的最新的版本。[Apt 2.6][7] 版本专门处理了这个版本中引入的非自由 ISO 镜像支持。这些更改包含:默认启用非自由固件,Apt 将显示非自由软件包的更新。
|
||||
|
||||
#### 桌面环境
|
||||
|
||||
在 Debian 12 中,除 GNMOE 桌面环境外,所有的主流桌面环境都是最新的。这是因为 [GNOME 44][8] 才刚刚发布,由于工作日程计划不一样,因此它没有进入 “Bookworm” 。Debian 12 已经处于硬冻结状态。
|
||||
|
||||
因此,在 Debian 12 中,你将得到 [GNOME 43][9] 版本,与最新的发布版本相比,它也没有落后多少。此外,如果你从 [Debian 11][10] 转换而来,那么,这将是一次重大的 GNOME 升级。
|
||||
|
||||
幸运的是,[KDE Plasma 5.27][11] 现在可以在这个发布版本中使用了。KDE Plasma 是 Plasma 5 的最终版本,并且在 Plasma 6 版本准备好之前,它可能会成为 LTS 。因此,它是一次重要的升级。KDE Plasma 维护人员成功地实现了这一目标。
|
||||
|
||||
另外,在 Debian 12 中的 [Xfce 4.18][12] 通过令人惊艳的 Thunar 的特色功能带来了更好的桌面体验。此外,在 Debian 12 中,LXQt 1.2 、MATE 1.26 和 LXDE 11 都是最新的版本。
|
||||
|
||||
这里有一份摘要:
|
||||
|
||||
- GNOME 43
|
||||
- KDE Plasma 5.27
|
||||
- LXDE 11
|
||||
- LXQt 1.2
|
||||
- MATE 1.26
|
||||
- Xfce 4.18
|
||||
|
||||
#### 核心模块和应用程序
|
||||
|
||||
大多数主要的应用程序都已经刷新版本。尤其是,Python 3.11 已经包含在 Debian 12 中,这将有助于帮助开发者和很多使用情况。此外,LibreOffice 7.4 和 Firefox 102.9 ESR 也是两个重要的更新。这里有一份关于主要应用程序和软件包升级的小列表:
|
||||
|
||||
- LibreOffice 7.4.4
|
||||
- Firefox 102.9 ESR
|
||||
- GIMP 2.10.32
|
||||
- OpenJDK 11.6
|
||||
- PHP 8.2
|
||||
- Python 3.11+
|
||||
- Samba 4.17
|
||||
|
||||
#### 杂项更新
|
||||
|
||||
- Debian 12 现在在双启动设置时可以检测到 Windows 11
|
||||
- 在 Debian 和 Cinnamon 桌面环境中,默认启用支持屏幕阅读器
|
||||
- 在 30 秒超时后,自动启动语音合成
|
||||
- 更容易地检测多路径设备
|
||||
- 支持多个 initrd 路径
|
||||
- 支持新的 ARM 和 RISC-V 设备
|
||||
- 放弃实验性的 DMRAID 支持
|
||||
|
||||
你可以 [在这里][13] 了解更多的变化。
|
||||
|
||||
#### 默认的主题和墙纸
|
||||
|
||||
在每一次发布版本中,Debian 都会从引入一些来自社区的令人惊叹的艺术作品。Debian 12 以 “<ruby>绿宝石<rt>Emerald</rt></ruby>” 作为默认的艺术作品主题。
|
||||
|
||||
“_经过抛光和凿刻,或在它们原始和纯天然的状态下,宝石可以有无限的形状。”_
|
||||
|
||||
通过 Emerald 主题,创建者希望将光线与矿物质以一种简洁至近乎空灵的设计结合在一起。
|
||||
|
||||
默认主题和横幅可以在安装程序、动画 Plymouth 、壁纸等所有的位置都可以看到。
|
||||
|
||||
这里是一些选自 [官方画廊][14] 的图片。
|
||||
|
||||
![Default wallpaper][15]
|
||||
|
||||
![Debian 12 Plymouth][16]
|
||||
|
||||
### 如何下载 Debian 12
|
||||
|
||||
**注意**: Debian 12 尚未发布稳定版本。因此,不要在正式工作中使用它,也不要从 Bullseye 升级到 “Bookworm” 。
|
||||
|
||||
如果你正在运行 Debian 11 “Bullseye” ,你可以通过任意的文本编辑器来打开 `/etc/apt/sources.list` ,并添加下面的命令行。务必验证镜像 URL ,并更改下面的命令行。
|
||||
|
||||
```
|
||||
deb http://http.us.debian.org/debian bookworm main non-free contrib
|
||||
deb http://security.debian.org/ bookworm/updates main contrib non-free
|
||||
deb http://http.us.debian.org/debian sid main non-free contrib
|
||||
```
|
||||
|
||||
在添加这些命令行后,刷新 `apt` 缓存:
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
接下来,运行下面的命令行来获取更新:
|
||||
|
||||
```
|
||||
sudo apt dist-upgrade
|
||||
```
|
||||
|
||||
下载全新的 ISO 文件,访问任意一个下面的链接。
|
||||
|
||||
> **[下载 Debian 12 (DVD) ISO – Alpha2][17]**
|
||||
|
||||
### 总结
|
||||
|
||||
总而言之,Debian 12 “Bookworm” 是一个令人印象深刻的版本,带来了一些新的特色功能和改善。从最新的桌面环境到新内核和更新的软件包,这个发布版本为新用户和有经验的 Debian 用户都提供了很多东西。
|
||||
|
||||
因为它专注于稳定性、安全性和开源原则,所以,对于那些寻求替换 Ubuntu 和通用操作系统的人来说,Debian 12 “Bookworm” 可能是最好的选择。
|
||||
|
||||
这个版本的最终版本预期在 2023 年第二季度发布。
|
||||
|
||||
> **[Debian 12 更改日志(有点过时了)][18]**
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/debian-12-features/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[robsean](https://github.com/robsean)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2023/03/Debian-12-Bookworm-GNOME-Desktop.jpg
|
||||
[2]: https://www.debugpoint.com/linux-kernel-6-1/
|
||||
[3]: https://lists.debian.org/debian-vote/2022/10/msg00000.html
|
||||
[4]: https://www.debugpoint.com/download-debian-iso/
|
||||
[5]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1020249
|
||||
[6]: https://www.debugpoint.com/wp-content/uploads/2023/03/Pipewire-in-Debian-12.jpg
|
||||
[7]: https://launchpad.net/ubuntu/+source/apt/+changelog
|
||||
[8]: https://www.debugpoint.com/gnome-44/
|
||||
[9]: https://www.debugpoint.com/gnome-43/
|
||||
[10]: https://www.debugpoint.com/debian-11-features/
|
||||
[11]: https://www.debugpoint.com/kde-plasma-5-27/
|
||||
[12]: https://www.debugpoint.com/xfce-4-18-review/
|
||||
[13]: https://lists.debian.org/debian-devel-announce/2022/09/msg00004.html
|
||||
[14]: https://wiki.debian.org/DebianArt/Themes/Emerald
|
||||
[15]: https://www.debugpoint.com/wp-content/uploads/2023/03/Default-wallpaper.jpg
|
||||
[16]: https://www.debugpoint.com/wp-content/uploads/2023/03/Debian-12-Plymouth.jpg
|
||||
[17]: https://cdimage.debian.org/cdimage/bookworm_di_alpha2/amd64/iso-dvd/
|
||||
[18]: https://www.debian.org/releases/bookworm/amd64/release-notes/ch-whats-new.en.html
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202304/05/112008tjogt4q224g49tj4.jpg
|
197
published/20230401.2 ⭐️ Write a cute program with Emojicode.md
Normal file
197
published/20230401.2 ⭐️ Write a cute program with Emojicode.md
Normal file
@ -0,0 +1,197 @@
|
||||
[#]: subject: "Write a cute program with Emojicode"
|
||||
[#]: via: "https://opensource.com/article/23/4/emojicode"
|
||||
[#]: author: "Jessica Cherry https://opensource.com/users/cherrybomb"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15699-1.html"
|
||||
|
||||
用 Emojicode 写一个可爱的程序
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 这种有趣的开源语言是学习编码真正的完美选择。
|
||||
|
||||
在这篇文章中,我将介绍一个最好的编码语言,学习如何制作任何东西!它叫做 Emojicode,是由 Theo Belaire 在 2014 年创建的,它是一种开源的编程语言,使用 emoji 字符来表示其语法。当用 Emojicode 开发时,表情符被用来创建变量、函数和控制结构。因为它是一种静态类型的语言,变量类型必须在使用前声明,但它也支持类和继承等面向对象的概念。这种语言可以在每个操作系统上运行,它是一种超级有趣的编码方式,特别是当你是一个非英语母语的人时。这很有帮助,因为象形表示可以把我们大家聚集在一起,让我们以类似数学的方式说同样的语言。
|
||||
|
||||
### 先决条件
|
||||
|
||||
在本教程中,我使用的是基于 Debian 的操作系统。我的工具可能与你的操作系统的要求不同。以下是我所使用的工具:
|
||||
|
||||
- [Geany][1],一个 Linux 下的开源 IDE。
|
||||
- IBus,它允许你挑选表情符并把它们放在你的编辑器中。我使用的界面被称为 **emoji picker**。
|
||||
- 基于 Debian 的 Linux。
|
||||
- 一个 C++ 编译器。我使用的是 `g++` 编译器。
|
||||
- [Emojicode][2]
|
||||
|
||||
我使用的是 Linux 操作系统,但你可以 [阅读文档][3] 了解在其他操作系统上使用它时可能需要采取的任何特殊步骤。
|
||||
|
||||
### 在 Linux 上安装 Emojicode
|
||||
|
||||
有几种方法可以在你的电脑上安装 Emojicode,但它们有一个很酷的 [神奇的安装页面][4],可以告诉你具体该怎么做。下面是我的做法:
|
||||
|
||||
```
|
||||
$ wget https://github.com/emojicode/emojicode/releases/download/v1.0-beta.2/Emojicode-1.0-beta.2-Linux-x86_64.tar.gz -O emojicode.tar.gz \
|
||||
&& tar -xzf emojicode.tar.gz && rm emojicode.tar.gz \
|
||||
&& cd Emojicode-1.0-beta.2-Linux-x86_64 && ./install.sh \
|
||||
&& cd .. && rm -r Emojicode-1.0-beta.2-Linux-x86_64
|
||||
```
|
||||
|
||||
Emojicode 的安装过程提供了有用的反馈。
|
||||
|
||||
![The emojicode installation procedure provides useful feedback along the way.][5]
|
||||
|
||||
现在,你已经安装好了,是时候开始编写代码了!
|
||||
|
||||
### 它是怎么运作的?
|
||||
|
||||
首先,所有 Emojicode 文件的扩展名都以文件名 `.🍇` 结尾,但因为你不能在一般的文件名中这样做,所以它被翻译成 `filename.emojic`。这里是最重要的语法元素:
|
||||
|
||||
- 把 `🏁` 放在一行的开头,表示要执行哪些代码块
|
||||
- 用 `🍇` 开始一个代码块
|
||||
- 用 `🍉` 来结束一个代码块
|
||||
- 想打印什么吗?就用 `😀 🔤 <string> 🔤 ❗`
|
||||
|
||||
还有很多其他的,所以这里有一些实际的例子。
|
||||
|
||||
### 打印一首俳句
|
||||
|
||||
首先,试着打印一首漂亮的俳句来玩玩吧! 在这个例子中,我将添加一行注释。看看你是否能识别它。
|
||||
|
||||
```
|
||||
🏁🍇
|
||||
💭 This is a single line comment for fun
|
||||
😀 🔤Emojicode is great,🔤 ❗
|
||||
😀 🔤Fun and expressive code,🔤 ❗
|
||||
😀 🔤no sadness, just joy.🔤 ❗
|
||||
🍉
|
||||
```
|
||||
|
||||
现在我们需要保存我们的代码,并通过我们的编译器运行它,使之成为一个漂亮的可执行文件:
|
||||
|
||||
```
|
||||
$ emojicodec haiku.emojic
|
||||
$ ls
|
||||
haiku haiku.emojic haiku.o
|
||||
```
|
||||
|
||||
正如你所看到的,代码已经被编译并生成了两个文件,其中一个是可执行的。运行 `haiku` 文件:
|
||||
|
||||
```
|
||||
$ ./haiku
|
||||
Emojicode is great,
|
||||
Fun and expressive code,
|
||||
no sadness, just joy.
|
||||
```
|
||||
|
||||
### 数学和变量操作
|
||||
|
||||
接下来,你要同时做几件事:一点点数学和变量的改变。首先,将一个变量赋值为 0:
|
||||
|
||||
```
|
||||
0 ➡️ 🖍🆕x
|
||||
```
|
||||
|
||||
你刚刚使用蜡笔(`🖍`)表情符、新建(`🆕`)表情符和变量名称创建了一个新变量,同时还将该变量赋值为 0。
|
||||
|
||||
接下来,用磁铁(`🧲`)表情符打印一行包括该变量的内容:
|
||||
|
||||
```
|
||||
😀 🔤The value is 🧲x🧲 🔤 ❗
|
||||
```
|
||||
|
||||
接下来,使用加号(`➕`)和箭头(`⬅️`)表情符改变变量:
|
||||
|
||||
```
|
||||
x ⬅️➕ 1
|
||||
```
|
||||
|
||||
然后打印另一行的值。如此这般,然后打印出最终的数值。如下:
|
||||
|
||||
```
|
||||
🏁 🍇
|
||||
|
||||
💭Updating a variable using math
|
||||
0 ➡️ 🖍🆕x
|
||||
😀 🔤The value is 🧲x🧲 🔤 ❗
|
||||
|
||||
x ⬅️➕ 1
|
||||
😀 🔤The value is 🧲x🧲 🔤 ❗
|
||||
|
||||
x ⬅️➕ 15
|
||||
😀 🔤The value is 🧲x🧲 🔤 ❗
|
||||
|
||||
x ⬅️➖ 9
|
||||
😀 🔤The value is 🧲x🧲 🔤 ❗
|
||||
|
||||
x ⬅️➗ 2
|
||||
😀 🔤The final value is 🧲x🧲 🔤 ❗
|
||||
🍉
|
||||
```
|
||||
|
||||
接下来,用 `emojicodec` 编译代码,然后用你的可执行代码来看看结果:
|
||||
|
||||
```
|
||||
$ emojicodec math.emojic
|
||||
$ ./math
|
||||
The value is 0
|
||||
The value is 1
|
||||
The value is 16
|
||||
The value is 7
|
||||
The final value is 3
|
||||
```
|
||||
|
||||
如你所见,作为变量打印出来的所有内容都已使用新数学进行了更新。你可以用许多数学表情符来进一步操作。下面是一些更多的运算符:
|
||||
|
||||
```
|
||||
🚮 is your modulo
|
||||
◀ Less than
|
||||
▶ Greater than
|
||||
◀🙌 less than or equal to
|
||||
▶🙌 greater than or equal to
|
||||
```
|
||||
|
||||
### Emojicode 的怪癖
|
||||
|
||||
当我在文档中来回查看时,我发现了一些有趣的怪癖。其中之一是,当从用户那里抓取输入时,由于一些已知的编译器问题,耳朵的肤色很重要。
|
||||
|
||||
获取用户输入的动作是这样的:
|
||||
|
||||
```
|
||||
🆕🔡▶️👂🏼❗️
|
||||
```
|
||||
|
||||
获取和分配用户输入的操作是这样的:
|
||||
|
||||
```
|
||||
🆕🔡▶️👂🏼❗️ ➡️ inputText
|
||||
```
|
||||
|
||||
我试图让它工作,我的编译器出现了一些问题,我发现了这个问题。你也可能会在这里和那里遇到一些小问题。如果你遇到了,请创建一个 [议题][6],这样它就有可能被修复。
|
||||
|
||||
### 没有技巧,只有很棒的代码
|
||||
|
||||
虽然我可以介绍更多内容,但我可以向你保证,这段令人惊叹的代码背后的文档非常丰富。尽管我写这篇文章只是为了赶上愚人节的乐趣,但我不得不承认这是有史以来最好的语言之一,因为它教会了你很多非常真实的编程概念。我恳切地建议把它作为一种有趣的方式来教你的一些朋友、孩子,或者是对编码感兴趣的同学。希望你度过了一个充满乐趣的愚人节!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/4/emojicode
|
||||
|
||||
作者:[Jessica Cherry][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/cherrybomb
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://github.com/geany/geany
|
||||
[2]: https://github.com/emojicode/emojicode
|
||||
[3]: https://www.emojicode.org/docs/
|
||||
[4]: https://www.emojicode.org/docs/guides/
|
||||
[5]: https://opensource.com/sites/default/files/2023-03/emoji.webp
|
||||
[6]: https://github.com/emojicode/emojicode/issues
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202304/07/141230yv2s53itmiw45ots.jpg
|
@ -0,0 +1,242 @@
|
||||
[#]: subject: "10 Tweaks to Supercharge Gedit as Code Editor"
|
||||
[#]: via: "https://itsfoss.com/gedit-tweaks/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15688-1.html"
|
||||
|
||||
将 Gedit 作为代码编辑器的 10 项增强调整
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> Gedit 是一个好的文本编辑器。用这些技巧、窍门和调整把它变成一个好的代码编辑器。
|
||||
|
||||
GNOME 可能已经抛弃了 Gedit 作为默认的文本编辑器,但它仍然是 Linux 老用户的最爱。
|
||||
|
||||
它主要是一个文本编辑器,但通过一些调整,它可以作为一个轻量级的代码编辑器使用。
|
||||
|
||||
是啊!为什么要用 VS Code 或其他专门的代码编辑器来编写 Bash 脚本或其他语言的简单程序?用 Gedit 也可以过一天。
|
||||
|
||||
我将在本文中分享一些我最喜欢的 Gedit 技巧和窍门。虽然大多数的调整对写代码是有益的,但有些对一般的文本写作也是有帮助的。
|
||||
|
||||
### 1、安装插件
|
||||
|
||||
可能个别人甚至不知道 Gedit 有强大的插件功能。你可以安装插件来获得额外的功能。
|
||||
|
||||
有两种类型的插件:
|
||||
|
||||
- 可以从编辑器菜单中访问的官方 Gedit 插件
|
||||
- 第三方插件,可以从项目网站上下载,并放入插件目录中(下面讨论)。
|
||||
|
||||
Gedit 插件可以放在 `/usr/share/gedit/plugins` 或 `~/.local/share/gedit/plugins` 目录下。
|
||||
|
||||
![][2]
|
||||
|
||||
你可以通过点击 “汉堡包” 菜单,然后打开 “<ruby>首选项<rt>Preferences</rt></ruby>” 窗口来访问可用和已安装的插件。
|
||||
|
||||
![][3]
|
||||
|
||||
首选项窗口有 “<ruby>插件<rt>Plugins</rt></ruby>” 标签,你可以看到所有可用的插件。你可以使用复选框来启用和禁用这些插件。
|
||||
|
||||
![][4]
|
||||
|
||||
### 2、在侧边栏中显示文件浏览器
|
||||
|
||||
如果你正在处理一个有多个文件和文件夹的项目,在侧边栏中用文件浏览器看到所有可用的文件是相当有用的。
|
||||
|
||||
进入 “首选项” -> “插件”,启用 “<ruby>文件浏览器面板<rt>File Browser Panel</rt></ruby>”。
|
||||
|
||||
![][5]
|
||||
|
||||
之后,点击右上角的汉堡包菜单,从菜单 “<ruby>查看<rt>View</rt></ruby>” -> “<ruby>侧面板<rt>Side Panel</rt></ruby>” 启用侧面板视图。
|
||||
|
||||
现在把侧面板视图改为文件浏览器,如果还没有的话。
|
||||
|
||||
![][6]
|
||||
|
||||
### 3、嵌入一个终端
|
||||
|
||||
是的!你可以在 Gedit 文本编辑器中直接嵌入一个终端。
|
||||
|
||||
这有什么意义呢?嗯,如果你正在写程序或脚本,嵌入终端可以帮助你运行脚本,并在编辑器中检查代码的变化。
|
||||
|
||||
![][7]
|
||||
|
||||
要得到这个,首先要安装这个插件(针对 Ubuntu):
|
||||
|
||||
```
|
||||
sudo apt install gedit-plugin-terminal
|
||||
```
|
||||
|
||||
一旦插件安装完毕,从 “首选项” -> “插件” 中启用它。
|
||||
|
||||
![][8]
|
||||
|
||||
嗯,从汉堡包菜单-> “查看”-> “<ruby>底部面板<rt>Bottom Panel</rt></ruby>” 中启用底部面板。
|
||||
|
||||
![][9]
|
||||
|
||||
### 4、Markdown 预览
|
||||
|
||||
喜欢 Markdown 吗?我也是!
|
||||
|
||||
有几个适用于 Linux 的 Markdown 编辑器,但你不必为了使用 Markdown 而去安装另一个应用程序。
|
||||
|
||||
在一个名为 “[Gedit Markdown Preview][10]” 的插件的帮助下,Gedit 完全有能力呈现 Markdown 代码。
|
||||
|
||||
Arch 用户可以在 AUR 中找到它,软件包为 `gedit-plugin-markdown_preview`。
|
||||
|
||||
其他 Linux 用户可以找到 [项目网页上的安装说明][11]。
|
||||
|
||||
一旦安装,在插件中启用它。你必须从汉堡包菜单 -> “查看”-> “侧面板” 中启用侧面板视图。
|
||||
|
||||
![][12]
|
||||
|
||||
有了这个,它就开始在侧面板或底部窗格中显示 Markdown 文本的渲染文本。
|
||||
|
||||
![][13]
|
||||
|
||||
### 5、创建代码片段
|
||||
|
||||
*好的码农编码,优秀码农复用。*
|
||||
|
||||
如果你发现自己重复使用同一段代码或文本,你可以将其保存为片段,并在需要时插入。这将为你节省一些时间(和挫折)。
|
||||
|
||||
先启用片段插件:
|
||||
|
||||
![][14]
|
||||
|
||||
现在你可以从汉堡包菜单-> “<ruby>管理片段<rt>Manage Snippets</rt></ruby>” 来访问片段。
|
||||
|
||||
![][15]
|
||||
|
||||
你会发现它已经有几个为各种编程语言添加的片段。
|
||||
|
||||
![][16]
|
||||
|
||||
你也可以通过点击左下角的 “+” 号将你的片段添加到所需的文件夹中。你也可以为片段指定一个快捷键,以便更快速地插入它们。
|
||||
|
||||
![][17]
|
||||
|
||||
例如,我为 [添加一个 Markdown 表格][18] 添加了一个新的片段,并为其分配了一个键盘快捷键和 TAB 触发器(如上图所示)。现在,如果我在 Markdown 文档中按 `CTRL + Alt + S`,就会添加一个表格。或者,输入 `table` 并按下 `TAB` 键也会添加 Markdown 表格。
|
||||
|
||||
> 💡 通常,片段被保存在 `/usr/share/gedit/plugins/snippet` 文件夹中作为 XML 文档,但我找不到新添加的片段被保存在哪里。
|
||||
|
||||
### 6、修复深色模式的问题
|
||||
|
||||
编码员喜欢深色模式。Gedit 遵守系统主题,如果你在操作系统层面切换到深色模式,它也会切换到深色模式。
|
||||
|
||||
一个主要的问题是,你无法阅读当前选定行的任何内容,因为文本和行的高亮部分都是白色的。
|
||||
|
||||
![][19]
|
||||
|
||||
这个问题没有解决办法。然而,一个变通的办法是,要么禁用当前行的高亮显示,要么使用不同的颜色方案。
|
||||
|
||||
进入 “首选项” -> “<ruby>字体和颜色<rt>Font & Colors</rt></ruby>”,然后选择像 Oblivion 这样的深色方案。这将稍微改变颜色方案,但至少你能看到高亮行的文字。
|
||||
|
||||
![][20]
|
||||
|
||||
### 7、快速高亮选中的文本
|
||||
|
||||
双击一个词,Gedit 就会高亮显示整个文档中出现的所有相同的词。
|
||||
|
||||
![][21]
|
||||
|
||||
虽然有一个官方插件,但这个功能默认是不启用的。
|
||||
|
||||
进入 “首选项” -> “插件”,启用 “<ruby>快速高亮<rt>Quick Highlight</rt></ruby>” 选项。
|
||||
|
||||
![][22]
|
||||
|
||||
### 8、显示行号
|
||||
|
||||
许多代码编辑器默认都会显示行号。当你看到 “第 X 行的语法错误 ” 时,它可以帮助你快速找到该行。
|
||||
|
||||
你可以通过进入 “首选项” -> “查看” -> “<ruby>显示行号来启用行号<rt>Display Line Numbers</rt></ruby>”:
|
||||
|
||||
![][23]
|
||||
|
||||
你也可以从底部启用或停用它。
|
||||
|
||||
![][24]
|
||||
|
||||
### 9、保存一个版本
|
||||
|
||||
如果你正在修改一个文件,也许建立一个备份副本会更好?Gedit 可以自动做到这一点。
|
||||
|
||||
在 “首选项” -> “<ruby>编辑器<rt>Editor</rt></ruby>” -> “<ruby>创建一个备份副本<rt>Create a Backup copy</rt></ruby>” 中启用这个功能。
|
||||
|
||||
![][25]
|
||||
|
||||
一个在原文件名称后面加上 `~` 符号的文件将作为备份文件出现。
|
||||
|
||||
![][26]
|
||||
|
||||
### 10、自动保存文件
|
||||
|
||||
既然我们在谈论版本和备份,那么 [在 Gedit 中启用自动保存][27] 怎么样?这样,如果你在处理一个文件时,忘记用 `Ctrl+S` 手动保存,修改的内容会自动保存。
|
||||
|
||||
> 🚧 这个功能对一个从未在磁盘上保存过的全新文档不起作用。
|
||||
|
||||
从 “偏好” -> “编辑器”,你可以启用 “<ruby>自动保存<rt>Autosave</rt></ruby>” 功能。默认情况下,它每 10 分钟自动保存一次,但你可以根据自己的喜好改变时间。
|
||||
|
||||
![][28]
|
||||
|
||||
还有一个第三方的 [smart-auto-save 扩展][29],可以在你停止输入时自动保存文档。
|
||||
|
||||
![][30]
|
||||
|
||||
### 知道更多的 Gedit 技巧吗?
|
||||
|
||||
使用任何软件的乐趣之一是发现它不那么明显的功能。
|
||||
|
||||
在这里,你最喜欢哪个 Gedit 的调整?你知道一个没有多少人知道的 Gedit 的秘籍吗?在评论中与我们分享吧?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/gedit-tweaks/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://itsfoss.com/content/images/2023/03/linux-mega-packt.webp
|
||||
[2]: https://itsfoss.com/content/images/2023/03/PLUGIN-INSTALL-gedit-plugin-saved-to-the-directory.png
|
||||
[3]: https://itsfoss.com/content/images/2023/03/ACCESS-PREFERENCES.png
|
||||
[4]: https://itsfoss.com/content/images/2023/03/PLUGIN-INSTALL-plugins-in-prefereneces.png
|
||||
[5]: https://itsfoss.com/content/images/2023/03/FILE-BROWSER-file-browser-plugin-in-preferences.png
|
||||
[6]: https://itsfoss.com/content/images/2023/03/FILE-BROWSER-file-browser-as-a-side-pane.png
|
||||
[7]: https://itsfoss.com/content/images/2023/03/TERMINAL-gedit-embedded-terminal.png
|
||||
[8]: https://itsfoss.com/content/images/2023/03/TERMINAL-embedded-terminal-plugin-in-plugins-tab.png
|
||||
[9]: https://itsfoss.com/content/images/2023/03/TERMINAL-enable-bottom-panel-for-embedded-terminal.png
|
||||
[10]: https://github.com/maoschanz/gedit-plugin-markdown_preview?ref=itsfoss.com
|
||||
[11]: https://github.com/maoschanz/gedit-plugin-markdown_preview?ref=itsfoss.com#installation
|
||||
[12]: https://itsfoss.com/content/images/2023/03/ENABLE-SIDE-PANEL.png
|
||||
[13]: https://itsfoss.com/content/images/2023/03/MARKDOWN-PREVIEW-markdown-preview.png
|
||||
[14]: https://itsfoss.com/content/images/2023/03/ENABLE-SNIPPET-PLUGLIN.png
|
||||
[15]: https://itsfoss.com/content/images/2023/03/ACCESS-MANAGE-SNIPPET.png
|
||||
[16]: https://itsfoss.com/content/images/2023/03/SNIPPET-pre-created-snippets-in-gedit-showing-cpp-main-snippet.png
|
||||
[17]: https://itsfoss.com/content/images/2023/03/adding-a-custom-markdown-table-snippet.png
|
||||
[18]: https://itsfoss.com/markdown-table/
|
||||
[19]: https://itsfoss.com/content/images/2023/03/DARK-MODE-ISSUE-text-not-visible-in-highlight-line.png
|
||||
[20]: https://itsfoss.com/content/images/2023/03/DARK-MODE-ISSUE-settting-a-new-clor-scheme-to-the-dark-mode-font-issue.png
|
||||
[21]: https://itsfoss.com/content/images/2023/03/QUICK-HIGHLIGHT-result.png
|
||||
[22]: https://itsfoss.com/content/images/2023/03/QUICK-HIGHLIGHT-already-available-plugin-no-external-needed.png
|
||||
[23]: https://itsfoss.com/content/images/2023/03/LINE-NUMBER-display-line-numbers-in-gedit.png
|
||||
[24]: https://itsfoss.com/content/images/2023/03/SHOW-LINE-NUMBERS.png
|
||||
[25]: https://itsfoss.com/content/images/2023/03/SAVE-BACKUP.png
|
||||
[26]: https://itsfoss.com/content/images/2023/03/VERSION-in-file-manager.png
|
||||
[27]: https://itsfoss.com/how-to-enable-auto-save-feature-in-gedit/
|
||||
[28]: https://itsfoss.com/content/images/2023/03/AUTO-SAVE-files-the-built-in-save-function-that-saves-the-document-after-some-time.png
|
||||
[29]: https://github.com/seanh/gedit-smart-autosave/?ref=itsfoss.com
|
||||
[30]: https://itsfoss.com/content/images/2023/03/AUTO-SAVE-Smart-auto-save.png
|
||||
[31]: https://itsfoss.com/flatpak-tips-tweaks/
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202304/03/163721ts31zsxhs1wuwp63.jpg
|
@ -1,68 +0,0 @@
|
||||
[#]: subject: "Scrcpy 2.0 Released with Audio Forwarding from Android to PC"
|
||||
[#]: via: "https://debugpointnews.com/scrcpy-2-0-release/"
|
||||
[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Scrcpy 2.0 Released with Audio Forwarding from Android to PC
|
||||
======
|
||||
|
||||
**A new release of Scrcpy 2.0 is here with the most requested feature of audio forwarding.**
|
||||
|
||||
Scrcpy, a free and open-source tool that allows users to control their Android devices from their computer. It has released its latest version, Scrcpy 2.0. With this newest update, users can now mirror their Android screens on not only their computer but also forward audio from their device to their computer.
|
||||
|
||||
![Scrcpy running - Image credit Reddit][1]
|
||||
|
||||
### Scrcpy 2.0: New features
|
||||
|
||||
Audio forwarding was the most requested feature of this great utility. The developer worked with various solutions earlier, such as USBaudio to bring in this feature. But none of the POCs was viable for significant use cases.
|
||||
|
||||
Things changed when Google introduced audio capture API in the Android 10 release on September 2019. With this new API, it’s now easier to implement this feature with several tweaks to control the latency of Audio from your Android device to your computer.
|
||||
|
||||
Furthermore, Scrcpy 2.0 also supports the option to choose video and audio codecs. The device screen can now be encoded in H.265, or even AV1 if your device supports AV1 encoding.
|
||||
|
||||
```
|
||||
scrcpy --audio-codec=opus --audio-bit-rate=16k
|
||||
scrcpy --audio-codec=aac --audio-bit-rate=16k
|
||||
```
|
||||
|
||||
In addition, you can also control the audio buffering via the command line to tweak it for your use case.
|
||||
|
||||
```
|
||||
scrcpy --video-codec=h265 --display-buffer=200 --audio-buffer=200
|
||||
```
|
||||
|
||||
### Android version support
|
||||
|
||||
This new feature works out-of-the-box for Android 12 or newer (all modern mobile phones). However, for Android 11, you must unlock the device screen while using audio forwarding.
|
||||
|
||||
Scrcpy is a powerful tool that can be used for various purposes, from gaming and multimedia playback to productivity and remote technical support. With its latest update, Scrcpy 2.0, the tool has become even more versatile and user-friendly, making it an excellent choice for anyone looking to mirror and control their Android device on their computer.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
You can learn more about this new version on the official announcement [page][2]. A download and installation instruction is present [here][3], if you want to try it out.
|
||||
|
||||
For Linux distributions, you can install them using the instructions present [here][4].
|
||||
|
||||
_Via [announcement][2]_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://debugpointnews.com/scrcpy-2-0-release/
|
||||
|
||||
作者:[arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://debugpointnews.com/author/dpicubegmail-com/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://debugpointnews.com/wp-content/uploads/2023/03/Scrcpy-running-Image-credit-Reddit.jpg
|
||||
[2]: https://blog.rom1v.com/2023/03/scrcpy-2-0-with-audio/
|
||||
[3]: https://github.com/Genymobile/scrcpy/blob/master/README.md#get-the-app
|
||||
[4]: https://github.com/Genymobile/scrcpy/blob/master/doc/linux.md
|
@ -1,69 +0,0 @@
|
||||
[#]: subject: "Mozilla Plans to Work On Open-Source AI to Develop Solutions like ChatGPT"
|
||||
[#]: via: "https://news.itsfoss.com/mozilla-open-source-ai/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Mozilla Plans to Work On Open-Source AI to Develop Solutions like ChatGPT
|
||||
======
|
||||
|
||||
Mozilla's getting into the A.I. game? I think we need more of this!
|
||||
|
||||
![mozilla AI][1]
|
||||
|
||||
[Mozilla][2] is a well-known name in the tech space for its privacy-focused endeavors and the Firefox web browser.
|
||||
|
||||
But, as we all know, the **biggest catch of 2023 has been A.I**. It has seen rapid growth across many sectors, with big tech betting heavily on it.
|
||||
|
||||
Microsoft, Google, and several others 🤯 Chatbots, search engine integration, content creation, graphics design, and what not.
|
||||
|
||||
And Mozilla doesn't want to miss out on it.
|
||||
|
||||
In a recent announcement, they revealed **plans to set up a new startup** and **gather a community** to build a trustworthy, independent, and open-source AI ecosystem.
|
||||
|
||||
Let's look at what we can expect.
|
||||
|
||||
❓ **What is happening?:** Mozilla has **committed $30M to kick-start a new startup** called [Mozilla.ai][3].
|
||||
|
||||
It aims to bring together people from different walks of life to collectively work on creating a trustworthy and independent AI ecosystem that will benefit everyone.
|
||||
|
||||
The first order of business will be to create **tools that make generative AI much safer and transparent** than what it is now, and to make 'people-centric' recommendation systems that don't serve skewed information.
|
||||
|
||||
This startup will be led by [Moez Draief][4] (_Managing Director of Mozilla)._The initial board members will be **Harvard's**[Karim Lakhani][5], Credo's [Navrina Singh][6], and Mozilla's [Mark Surman][7] (_Director of the Mozilla Foundation_).
|
||||
|
||||
**Why now?:** Obviously, the new wave of AI has created a lot of excitement and concerns ⚡
|
||||
|
||||
The current/upcoming wave of AI can potentially improve many people's lives, but only **if the technology is more human-focused**. Mozilla says this will only be possible when they put '_human agency and the interests of users at the cor_e' and prioritize transparency and accountability.
|
||||
|
||||
In contrast, the tech giants and cloud companies with significant resources are **scrambling to continue their dominance** over the market by doing things the usual way, with no special focus on improving transparency and moderation.
|
||||
|
||||
🙌 It is good to hear that the Mozilla Foundation is getting involved to develop open-source A.I. solutions that could challenge the likes of ChatGPT, Google Bard, and more.
|
||||
|
||||
Not to forget, there's another team working on making an open-source alternative to ChatGPT. And, yes, we need more of this t**o compete with the big tech clenching their claws in the consumer market with no community oversight**.
|
||||
|
||||
I suggest you go through the [announcement blog][8] to know more about Mozilla's AI plans if you are curious.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/mozilla-open-source-ai/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://news.itsfoss.com/content/images/size/w1304/2023/03/mozilla-ai-opensource.png
|
||||
[2]: https://www.mozilla.org/?ref=its-foss-news
|
||||
[3]: https://mozilla.ai/?ref=its-foss-news
|
||||
[4]: https://www.linkedin.com/in/moezdraief/?ref=its-foss-news
|
||||
[5]: https://www.linkedin.com/in/professorkl?ref=its-foss-news
|
||||
[6]: https://www.linkedin.com/in/navrina/?ref=its-foss-news
|
||||
[7]: https://ca.linkedin.com/in/msurman?ref=its-foss-news
|
||||
[8]: https://blog.mozilla.org/en/mozilla/introducing-mozilla-ai-investing-in-trustworthy-ai/?ref=its-foss-news
|
@ -1,94 +0,0 @@
|
||||
[#]: subject: "blendOS Aims to Replace All Linux Distributions"
|
||||
[#]: via: "https://news.itsfoss.com/blendos/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
blendOS Aims to Replace All Linux Distributions
|
||||
======
|
||||
|
||||
Ubuntu Unity's lead has come up with a new distro that sounds like something everyone might want to keep an eye on.
|
||||
|
||||
![blend os][1]
|
||||
|
||||
![][2]
|
||||
|
||||
Sounds too far-fetched?
|
||||
|
||||
Well, **blendOS** pitches itself to be the **ultimate distro-blend**.
|
||||
|
||||
blendOS is a new project by **Rudra Saraswat**, known for Ubuntu-based remixes, and Ubuntu Unity in particular (which is now an official [Ubuntu flavour][3]).
|
||||
|
||||
I would say the project has a pretty accurate name for what it wants to achieve.
|
||||
|
||||
_But, how does blendOS aim to be a replacement to all? What is it all about?_
|
||||
|
||||
### blendOS: Not Just Another Linux Distribution
|
||||
|
||||
![blendOS][4]
|
||||
|
||||
blendOS is an Arch-based distro which supports every type of app package.
|
||||
|
||||
If you have read about **[carbonOS][5]** and **[Vanilla O][6]**[S][6], you should have a good idea about some common points among such distros.
|
||||
|
||||
One of them being, **immutability**, meaning, the core/base of the operating system remains unchanged, giving you an enhanced security, and simpler, and reliable updates.
|
||||
|
||||
Similarly, blendOS has the following key highlights:
|
||||
|
||||
- Immutable operating system
|
||||
- Support for multiple package managers including **apt, dnf, yum, pacman, and yay**
|
||||
- Multiple desktop environment support
|
||||
- Flathub Store as a desktop app
|
||||
|
||||
[blendOS][7] uses Jade GUI (the installer from [Crystal Linux][8]) to provide a seamless installation experience. And, the Flathub store can directly install apps, and not download flatpakref files, as one would expect.
|
||||
|
||||
To make all distribution packages work, blendOS uses its package manager **blend.**
|
||||
|
||||
You can still use pacman from a shell through an Arch container.
|
||||
|
||||
Additionally, it supports, T2 macs, i.e., Intel Macs made after 2018. So, if you want to experiment on a device that you already have, blendOS should work with it.
|
||||
|
||||
> 🚧 As of now, the project is at its early stages of development.
|
||||
|
||||
Some immediate changes expected include:
|
||||
|
||||
![][9]
|
||||
|
||||
- Distrobox to be replaced with its implementation using Podman
|
||||
- A new GUI configuration tool, with support for managing overlays and containers
|
||||
|
||||
So, yes, what you see right now is subject to change. However, it is still something that sounds exciting.
|
||||
|
||||
You can read about its planned changes in its [official blog post][10] and explore blendOS on its [GitHub page][11].
|
||||
|
||||
[blendOS][7]
|
||||
|
||||
_💬 What do you think about blendOS? Is it worth keeping an eye out for? Let me know in the comments!_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/blendos/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://news.itsfoss.com/content/images/size/w1304/2023/03/blendOS-first-look.png
|
||||
[2]: https://news.itsfoss.com/content/images/2023/03/linux-mega-packt.webp
|
||||
[3]: https://itsfoss.com/which-ubuntu-install/?ref=its-foss-news
|
||||
[4]: https://news.itsfoss.com/content/images/2023/03/blend-os.jpg
|
||||
[5]: https://news.itsfoss.com/carbonos/
|
||||
[6]: https://news.itsfoss.com/vanilla-os-debian-ubuntu/
|
||||
[7]: https://blendos.co/?ref=its-foss-news
|
||||
[8]: https://news.itsfoss.com/crystal-linux-dev/
|
||||
[9]: https://news.itsfoss.com/content/images/2023/03/blend-settings-containers.png
|
||||
[10]: https://blendos.co/future-of-blendos/?ref=its-foss-news
|
||||
[11]: https://github.com/blend-os?ref=its-foss-news
|
@ -1,83 +0,0 @@
|
||||
[#]: subject: "Open-Source Model 'Dolly' Claims to be a Cheaper Alternative to ChatGPT"
|
||||
[#]: via: "https://news.itsfoss.com/open-source-model-dolly/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Open-Source Model 'Dolly' Claims to be a Cheaper Alternative to ChatGPT
|
||||
======
|
||||
|
||||
An affordable alternative to ChatGPT? And, open-source? Looks like we're joining the open-source race against ChatGPT.
|
||||
|
||||
![open source model dolly][1]
|
||||
|
||||
![][2]
|
||||
|
||||
Databricks is a software company that has established itself in a variety of sectors, with data warehousing, and AI-based solutions being their primary focus.
|
||||
|
||||
In recent times, we have seen the meteoric rise of ChatGPT, resulting in similar efforts from the likes of Meta, Google, and even Mozilla.
|
||||
|
||||
And now, Databricks is trying in their own way by open-sourcing its [large language model][3] (LLM) 'Dolly'.
|
||||
|
||||
Let's take a look at it.
|
||||
|
||||
**What is happening?:** In a recent announcement, Databricks introduced what they term as **'a cheap-to-build'** LLM that functions by using an existing open-source parameter [model][4] by [EleutherAI][5].
|
||||
|
||||
The model has been slightly tweaked to give Dolly instruction following capabilities such as brainstorming and text generation.
|
||||
|
||||
When you compare the **175 billion parameters** in GPT-3, Dolly's **6 billion parameters** might seem puny in comparison.
|
||||
|
||||
But, the folks over at Databricks were surprised when they saw that even with this much data, Dolly was **able to****exhibit many of the same capabilities as ChatGPT**.
|
||||
|
||||
Below is one of the examples they showcased:
|
||||
|
||||
![a screenshot of how dolly performs in an open question and answer scenario][6]
|
||||
|
||||
The original model used data from [Alpaca][7], the model built by Stanford using the [LLaMA][8] LLM by Meta as a base.
|
||||
|
||||
But, as you can see, the original model produced a very haphazard result, whereas Dolly, with its different model and tweaks, was able to produce a far usable answer.
|
||||
|
||||
> 📝 Fun Fact: The name was taken from the first cloned mammal, Dolly the sheep.
|
||||
|
||||
**Why now?:** According to Databricks, they think that **many companies would prefer to build their own model** rather than sending data to some centralized provider who has locked their model behind an API.
|
||||
|
||||
Many companies might not be comfortable handing over their most sensitive data to a third party, and then there are the various tradeoffs in terms of model quality, cost, and desired behavior.
|
||||
|
||||
**Do you want to check it out?**
|
||||
|
||||
Sure, but there's a catch.
|
||||
|
||||
You will have to **use their platform to use Dolly**, they have open-sourced a [Databricks notebook][9] that will help you build it on Databricks.
|
||||
|
||||
Moreover, if you want to get access to the trained weights, you will have to contact them. I am uncertain whether they will provide access to it for free, though.
|
||||
|
||||
In a nutshell, this move to open-source their model should be good for companies to help safeguard their data, save on operating costs, and more by enabling them to create their own model.
|
||||
|
||||
You can check out the[announcement blog][10] to learn more about the technical details and other plans for it.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/open-source-model-dolly/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://news.itsfoss.com/content/images/size/w1304/2023/03/opensource-ai-model-dolly.png
|
||||
[2]: https://news.itsfoss.com/content/images/2023/03/linux-mega-packt.webp
|
||||
[3]: https://en.wikipedia.org/wiki/Large_language_model?ref=its-foss-news
|
||||
[4]: https://huggingface.co/EleutherAI/gpt-j-6B?ref=its-foss-news
|
||||
[5]: https://www.eleuther.ai/?ref=its-foss-news
|
||||
[6]: https://news.itsfoss.com/content/images/2023/03/Dolly_AI.jpg
|
||||
[7]: https://crfm.stanford.edu/2023/03/13/alpaca.html?ref=its-foss-news
|
||||
[8]: https://ai.facebook.com/blog/large-language-model-llama-meta-ai/?ref=its-foss-news
|
||||
[9]: https://github.com/databrickslabs/dolly?ref=its-foss-news
|
||||
[10]: https://www.databricks.com/blog/2023/03/24/hello-dolly-democratizing-magic-chatgpt-open-models.html?ref=its-foss-news
|
@ -0,0 +1,111 @@
|
||||
[#]: subject: "Linux Lite 6.4 Gets Lighter With More Features like WebP Image Support"
|
||||
[#]: via: "https://news.itsfoss.com/linux-lite-6-4-released/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Linux Lite 6.4 Gets Lighter With More Features like WebP Image Support
|
||||
======
|
||||
|
||||
Linux Lite 6.4 is a neat upgrade with a couple of new changes!
|
||||
|
||||
![linux lite 6.4][1]
|
||||
|
||||
![][2]
|
||||
|
||||
Linux Lite is known for its lightweight and Windows-like layout that provides users with a familiar operating system experience.
|
||||
|
||||
The last major release, [Linux Lite 6.2][3] saw the inclusion of various user interface tweaks/bug fixes, and now another release is here that also has various improvements on offer.
|
||||
|
||||
Let me take you through the Linux Lite 6.4 release.
|
||||
|
||||
### 🆕 Linux Lite 6.4: What's New?
|
||||
|
||||
![a screenshot of the desktop on linux lite 6.4][4]
|
||||
|
||||
Based on **[Ubuntu 22.04.2 LTS][5]**, this release has some interesting new additions, here are the highlights that you should know about:
|
||||
|
||||
- **SystemD reporting via Lite System Report**
|
||||
- **ZSTD Compression**
|
||||
- **Better WebP Support**
|
||||
- **Updated Thunderbird**
|
||||
- **Xfce 4.18**
|
||||
|
||||
#### SystemD reporting via Lite System Report
|
||||
|
||||
![a screenshot of the systemd report on linux lite 6.4][6]
|
||||
|
||||
As you know that **systemd is one of the basic building blocks of a Linux system** that starts the boot procedure for the rest of the system.
|
||||
|
||||
Linux Lite 6.4 has bought about a dedicated reporting option for systemd errors. This will make it easy to pinpoint booting and general system issues via the Lite System Report tool.
|
||||
|
||||
#### ZSTD Compression
|
||||
|
||||
The complete Lite app suite (their in-house apps) has been repackaged using ZSTD compression for faster decompression and better compression, resulting in a **lighter storage footprint**.
|
||||
|
||||
For example: Now the Lite Themes app is **76.8 MB** instead of the more hefty **91.2 MB**.
|
||||
|
||||
Systems with slower processors will benefit a great deal due to the inclusion of this, resulting in significantly faster application update times.
|
||||
|
||||
#### Better WebP Support
|
||||
|
||||
![a screenshot of the webp thumbnail support on linux lite 6.4][7]
|
||||
|
||||
The Thunar file manager has been **updated to****4.16.10** and can now show thumbnails for WebP files correctly, instead of a generic placeholder image.
|
||||
|
||||
This should make it easy for you to go through your WebP files, without the need to open them one-by-one.
|
||||
|
||||
#### Updated Thunderbird
|
||||
|
||||
![a screenshot of thunderbird 102 running on linux lite 6.4][8]
|
||||
|
||||
Linux Lite 6.4 **features Thunderbird 102** with its redesigned icons, the central spaces' toolbar, new address book, import/export wizard, matrix chat support and more.
|
||||
|
||||
You can read more about it in our article to dive deeper.
|
||||
|
||||
#### 🛠️ Other Changes
|
||||
|
||||
Other than the above-mentioned, here are a few application suite updates that are worth mentioning:
|
||||
|
||||
- **Linux Kernel 5.15.0-69**
|
||||
- **Chrome 111.0**
|
||||
- **LibreOffice 7.4.6.2**
|
||||
- **VLC 3.0.16**
|
||||
- **Gimp 2.10.30**
|
||||
- **The latest [Papirus][9] icon theme set.**
|
||||
|
||||
If you are curious about the latest Xfce 4.18, you can check out our separate coverage to explore the details:
|
||||
|
||||
### 📥 Get Linux Lite 6.4
|
||||
|
||||
The ISO for Linux Lite 6.4 can be sourced from the [official website][10], or by clicking on the download button below.
|
||||
|
||||
[Linux Lite 6.4 (OSDN)][11]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/linux-lite-6-4-released/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://news.itsfoss.com/content/images/size/w1304/2023/04/linux-lite-6-4-released.jpg
|
||||
[2]: https://news.itsfoss.com/content/images/2023/03/linux-mega-packt.webp
|
||||
[3]: https://news.itsfoss.com/linux-lite-6-2-release/
|
||||
[4]: https://news.itsfoss.com/content/images/2023/04/Linux_Lite_6.4.png
|
||||
[5]: https://fridge.ubuntu.com/2023/02/24/ubuntu-22-04-2-lts-released/?ref=its-foss-news
|
||||
[6]: https://news.itsfoss.com/content/images/2023/04/Linux_Lite_6.4_2.png
|
||||
[7]: https://news.itsfoss.com/content/images/2023/04/Linux_Lite_6.4_3.png
|
||||
[8]: https://news.itsfoss.com/content/images/2023/04/Linux_Lite_6.4_4.png
|
||||
[9]: https://github.com/PapirusDevelopmentTeam/papirus-icon-theme?ref=its-foss-news
|
||||
[10]: https://www.linuxliteos.com/download.php?ref=its-foss-news
|
||||
[11]: https://osdn.net/projects/linuxlite/storage/6.4/?ref=its-foss-news
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://opensource.com/article/21/8/first-programming-language"
|
||||
[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "CanYellow
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
@ -1,100 +0,0 @@
|
||||
[#]: subject: "Open Source Software: Is There an Easy Path to Success?"
|
||||
[#]: via: "https://www.opensourceforu.com/2022/07/open-source-software-is-there-an-easy-path-to-success/"
|
||||
[#]: author: "Jules Graybill https://www.opensourceforu.com/author/jules-graybill/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "CanYellow"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Open Source Software: Is There an Easy Path to Success?
|
||||
======
|
||||
There’s so much that goes on behind the scenes while developing open source software. So how does one make an open source project successful? Is there a shortcut? This article indicates there isn’t one.
|
||||
|
||||
![team work working together][1]
|
||||
|
||||
Open source has become all the rage now. Many entrepreneurs are drawn to it by the allure of quick success. But the truth is, there is no easy path to such success. There is no one thing that you can do to get all of open source right.
|
||||
|
||||
In fact, a lot of the challenges that companies face early on are not technology challenges, but are people and cultural challenges.
|
||||
|
||||
There are many layers of open source that need to be worked on to build a project that can become a hit in the market. And maintaining that success is an ongoing process. But at the crux of it all lies finding the right answer to a very basic question: what exactly is open source?
|
||||
|
||||
### Open source is the code
|
||||
|
||||
For many new users who may not be fully aware of the layers that make open source, the answer is fairly simple: open source is software! And that is not wrong, of course, since that is how most of us are using it. But there’s just so much more to open source than merely being touted as software.
|
||||
|
||||
The essence of any open source project still remains the code. It is what makes the project special and useful for the user. When you’re working in open source, the code is just as much a part of the product as the software.
|
||||
|
||||
Developing a project from the ground up, or even creating a fork of an existing project, requires thousands and thousands of lines of code to be written, even while handling such a large and complex codebase. Especially in the case of creating a fork, care must be taken to remove any prior licences, marketing material, or anything that might not be useful for the user anymore. After all, it is the features of a project that attract its user base and what retains it. When end users are deciding whether to use open source software, they will read the source code, and what they see there should be something that builds their confidence.
|
||||
|
||||
### Open source is the community
|
||||
|
||||
How you engage with the community is also a part of the task of building a product. Building a community and maintaining a healthy relationship with it is one of the most crucial aspects of open source, but is also often the hardest for most leaders as there is very little one can do to control it. One can try to lay the foundation and can be supportive but, ultimately, it’s the people who decide whether they want to join a community.
|
||||
|
||||
It is important to maintain a level of transparency with the community and keep it in the loop. The community can get involved at any step that it wants to. It’s really important that you show most of your work to the community while you are doing it, apart from things that need to be done confidentially, like setting up security, signing certificates, branding, and so on. This helps in winning its trust because, in the end, it is the community that you are liable to, and it can make or break your project. This may make the project work a lot more deliberate, slower and exposed, but it works well in the end.
|
||||
|
||||
Making your work-in-progress so open can seem daunting, especially when you are worried about the repercussions of a delay in updates or having a bug. Yet, making the community members privy to your moves will not only help you build a trustful relationship with them, but also make them feel appreciated.
|
||||
|
||||
However, making your workflow public will also invite scrutiny from the community members, who will often have their opinions and offer you their feedback. Taking note of this feedback is important, because that is how you can make your open source project truly for them. They are the end users and their feedback will reflect how they see your project panning out for them in the long run, and ultimately, how successful and mainstream your software becomes.
|
||||
|
||||
As an example, when we are thinking about a new feature, we publish a request for comments at RFC. We get a lot of feedback, and we have to think hard about how we can incorporate it.
|
||||
|
||||
Since open source is a largely collaborative work, there will be initiatives by the community to offer their support in making the project the best version possible. Not all of it will work out. But as long you are listening, the community will feel involved.
|
||||
|
||||
Engaging with the community has its pitfalls too. There may be differences of opinion within the community, and also between the maintainer and the community, especially when it comes to the matter of governance. Governance is something which is really important for an open source project to have. That is why it is important to have clear documented governance practices, which also include the community.
|
||||
|
||||
Community governance is a tough, but essential, nut to crack. Delegation in itself requires a lot of trust. For a project with millions of lines of code, it can be cumbersome to find someone in the community who can meaningfully lead it. But open source projects often consist of smaller sub-projects, which are better left handled by someone from the community. This helps the community to be more closely involved too.
|
||||
|
||||
| - |
|
||||
| :- |
|
||||
| Building a community always has its highs and lows. Let me list some of the tricks that helped maintain a healthy balance between the community’s and my team’s vision.
|
||||
State your principle: Especially in the early stage of the open source project when the source code is still coming together and things are not exactly going perfectly, it is hard for somebody coming from outside to really understand why you are making the decisions that you are making. Communicating the principles on which you take actions helps you to be upfront about your thought process so that the community does not interpret things incorrectly.
|
||||
This practice is really helpful. It is also important to follow through and show that when you make a decision, it is guided by one of these principles.
|
||||
Decide how you are going to collaborate: This may be through channels like Discord, Slack, or simply emails. But if you try to use all of them, you will immediately diffuse the community. People will be communicating with each other all over the place. Choose one or two collaboration tools, and really invest in them for synchronised communication.
|
||||
Treasure the feedback: Listen to feedback from the community and act on it. Show tat you care about what the community says, even if it requires you to make tough decisions.
|
||||
Maintain a code of conduct: If you interact with a community, you need to define what is going to be acceptable conduct. Having that in place helps warn people in case they go out of line. You can avoid a lot of trouble if you can just define this early on.
|
||||
Think about how you will distribute your project: There may be instances when you may not be willing to make your project available to the public because you do not have a certain component in place, or you have features you may not want to make accessible to everyone. Creating distribution terms that suit your preference without compromising on what the user wants is key, so that people who want certain features can access these while those who can do without them also have the option to start using the project without having to compromise.
|
||||
Avoid polls as much as you can: This is because, often, certain members vote for an option that may not be what the majority goes with. This can create a sense of failure in these members and make them feel excluded from the project. Instead, try asking them what problems they would like to be solved, and then try to invent a solution that does not involve trade-offs. |
|
||||
|
||||
**State your principle:** Especially in the early stage of the open source project when the source code is still coming together and things are not exactly going perfectly, it is hard for somebody coming from outside to really understand why you are making the decisions that you are making. Communicating the principles on which you take actions helps you to be upfront about your thought process so that the community does not interpret things incorrectly.
|
||||
|
||||
This practice is really helpful. It is also important to follow through and show that when you make a decision, it is guided by one of these principles.
|
||||
|
||||
*Decide how you are going to collaborate:* This may be through channels like Discord, Slack, or simply emails. But if you try to use all of them, you will immediately diffuse the community. People will be communicating with each other all over the place. Choose one or two collaboration tools, and really invest in them for synchronised communication.
|
||||
|
||||
*Treasure the feedback:* Listen to feedback from the community and act on it. Show tat you care about what the community says, even if it requires you to make tough decisions.
|
||||
|
||||
**Maintain a code of conduct:** If you interact with a community, you need to define what is going to be acceptable conduct. Having that in place helps warn people in case they go out of line. You can avoid a lot of trouble if you can just define this early on.
|
||||
|
||||
*Think about how you will distribute your project:* There may be instances when you may not be willing to make your project available to the public because you do not have a certain component in place, or you have features you may not want to make accessible to everyone. Creating distribution terms that suit your preference without compromising on what the user wants is key, so that people who want certain features can access these while those who can do without them also have the option to start using the project without having to compromise.
|
||||
|
||||
*Avoid polls as much as you can:* This is because, often, certain members vote for an option that may not be what the majority goes with. This can create a sense of failure in these members and make them feel excluded from the project. Instead, try asking them what problems they would like to be solved, and then try to invent a solution that does not involve trade-offs.
|
||||
|
||||
### Open source is licensing
|
||||
|
||||
Open source is about giving your users autonomy over how they want to use your software, and licensing provides just that. What’s great about an open source licence is that regardless of what you as a maintainer do, all your end users and stakeholders can always maintain a certain set of forks, which are important forks.
|
||||
|
||||
Licensing gives people the option to take the project into a different direction if they deem it fit. They have the right to create a fork, which results in a lot of amazing software being developed. Maintainers have more responsibility to listen to their community members and to run the project in a way that works for them.
|
||||
|
||||
It’s advisable to make use of the many licences available instead of setting your own terms separately, simply because stakeholders and users are usually familiar with commonly used licences, so you do not have to waste time explaining them. This also helps you to focus your energy on the other parts of the project.
|
||||
|
||||
### Finally, open source is a movement
|
||||
|
||||
Open source involves many, many dimensions and people. Most importantly, it is about understanding what these people want and creating an environment that encourages collaboration and transparency. It is about building communities that help to build the open source project the way they want it to be. The more opportunity maintainers create to let them do that, the better the product is and the more successful it gets.
|
||||
|
||||
Open source is all of these things and the more expansive view you take, the better you can leverage it. Think about how you can excel in every dimension of open source because, at the end of the day, there is no easy path to open source success.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.opensourceforu.com/2022/07/open-source-software-is-there-an-easy-path-to-success/
|
||||
|
||||
作者:[Jules Graybill][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.opensourceforu.com/author/jules-graybill/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/07/team-work-working-together-1.jpg
|
@ -1,146 +0,0 @@
|
||||
[#]: subject: "Essential tips and tricks for your first tech job"
|
||||
[#]: via: "https://opensource.com/article/23/2/your-first-tech-job"
|
||||
[#]: author: "Fatima https://opensource.com/users/ftaj"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "XiaotingHuang22"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Essential tips and tricks for your first tech job
|
||||
======
|
||||
|
||||
First days at work are scary. I still recall many instances where I lay awake at night before my first day at work, having an internal meltdown over what would happen the next day. Starting a new job is uncharted territory for most people. Even if you're a veteran in the industry, there's no denying that there can be a part of you that's a bit terrified of what is to come.
|
||||
|
||||
Understandably, a lot is happening. There are new people to meet, new projects and technologies to understand, documentation to read, tutorials to sit through, and endless HR presentations and paperwork to fill out. This can be overwhelming and, coupled with the considerable degree of uncertainty and unknowns you're dealing with, can be quite anxiety-inducing.
|
||||
|
||||
Two reasons motivated me to write about this subject. The first one being that back when I was a student, most of the discussion revolved around getting a job in tech, and no one talked about what happened next. How do you excel in your new role? Now that I look back, I think I assumed that the hard part is getting the job, and whatever comes after, I could probably figure out myself.
|
||||
|
||||
Similarly, once I started working in the industry, most of the career-related content I came across was about how to go from one senior level to another. No one really talked about what to do in the middle. What about the interns and the junior engineers? How do they navigate their early careers?
|
||||
|
||||
After completing three years of full-time professional experience as a software engineer (and a couple of internships before), I reflected on my time. I put together a list of tips and tricks I've employed while settling into a new tech role. I wanted to look beyond just the first couple of months and prioritize helping achieve long-term success.
|
||||
|
||||
### Reflect on existing processes and documentation
|
||||
|
||||
Most new employees start by either having a ton of documentation thrown their way or none at all. Instead of being overwhelmed by either of these possibilities, you could view this as an opportunity.
|
||||
|
||||
Identify gaps in existing documentation and think about how you could improve it for the next engineer that gets onboarded. This not only shows initiative on your part but also demonstrates that you're committed to improving existing processes within your team.
|
||||
|
||||
I've seen both ends of the spectrum. I've been on teams with no documentation whatsoever. I've also been on teams that were very diligent with keeping their documentation up to date. Your path is pretty straightforward with the former, and you can work on creating that missing documentation. With the latter, you can always think of ways to improve what already exists. Sometimes, too much documentation in written form can also feel intimidating, especially for new employees. Some things might be better explained through other mediums, like video tutorials or screencasts.
|
||||
|
||||
### Ask questions
|
||||
|
||||
I encourage you to look into whether a buddy will be assigned to you when you're starting. This is a fairly common practice at companies. The purpose of a buddy is to help you as you are onboarded. I've found this incredibly helpful because it gives you someone to direct all your questions, and you don't have to run around trying to find the right person/team.
|
||||
|
||||
While asking questions should always be encouraged, it is also necessary to do your homework before you ask those questions, including:
|
||||
|
||||
- Do your research. This encompasses doing a web search, checking forums, and reading existing documentation. Use all the available tools at your disposal. However, it is essential to timebox yourself. You must balance doing your due diligence and keeping project deadlines and deliverables in mind.
|
||||
- Talk it out. As someone whose first language isn't English, I recommend talking things out loud before asking questions. In my experience, I've often found that, especially when I'm struggling with something difficult, I think in one language (probably my native language) and must explain it in another. This can be a bit challenging sometimes because doing that translation might not be straightforward.
|
||||
- Organize your thoughts. When struggling with something, it's very common to have many scrambled ideas that make sense to us but might not necessarily make sense to another person. I suggest sitting down, gathering your thoughts, writing them down, and talking through them out loud. This practice ensures that when you're explaining your thought process, it flows as intended, and the listener can follow your train of thought.
|
||||
|
||||
This approach is called the rubber duck technique, a common practice developers use while debugging. The concept is that sometimes explaining your problem to a third person can be very helpful in getting to the solution. This is also a testament to your excellent communication skills.
|
||||
|
||||
Respect people's time. Even if you're reaching out to someone like your buddy, be cognizant of the fact that they also have their day-to-day tasks to complete. Some things that I've tried out include the following:
|
||||
|
||||
- Write down my questions and then set aside some time with my mentor so I could talk to them.
|
||||
- Compile questions instead of repeatedly asking for help so your mentor can get to them when they have time.
|
||||
- Schedule a quick 15-20 min video chat, especially if you want to share your screen, which is a great way to showcase your findings.
|
||||
|
||||
I think these approaches are better because you get someone's undivided attention instead of bothering them every couple of minutes when their attention might be elsewhere.
|
||||
|
||||
### Deep dive into your projects
|
||||
|
||||
Even on teams with excellent documentation, starting your technical projects can be very daunting since multiple components are involved. Over time though, you will understand how your team does things. However, it can save you time and potential headaches to figure this out early on by keeping a handy list to refer to, including basic project setup, testing requirements, review and deployment processes, task tracking, and documentation.
|
||||
|
||||
If there's no documentation for the project you're starting on (a situation I have been in), see if you can identify the current or previous project owner and understand the basic project structure. This includes setting it up, deploying it, etc.
|
||||
|
||||
- Identify your team's preference in the IDE (integrated development environment). You're free to use the IDE of your choice, but using the same one as your team can help, especially when debugging, since the choice of IDE impacts debugging. Different IDEs offer varying degrees of debugging support.
|
||||
- Understand how to do debugging, and I don't just mean using print statements (not that there's anything wrong with that approach). Leverage your team's experience here!
|
||||
- Understand testing requirements. This might depend on the scope of your project and general team practices, but the earlier you figure this out, the more confident you'll be in the changes you push to production.
|
||||
- Visualize the deployment process. This process can vary by team, company, etc. Regardless of how informal or formal it may be, make sure you understand how your changes get deployed to production, what the deployment pipeline looks like, how to deploy changes safely, what to do in case of failed builds, how to rollback faulty changes, and how to test your changes in production.
|
||||
- Understand the ticketing process. Understand how to document tickets and the level of detail expected. You will see a lot of variation here. Some companies expected us to submit our tickets daily, showing our progress. Other companies might not require that level of documentation.
|
||||
|
||||
Given everything I just mentioned, a beneficial, all-in-one exercise you can do in the first couple of weeks is to shadow another engineer and do peer coding sessions. This allows you to observe the entire process, end to end, from the moment a ticket is assigned to an engineer to when it gets deployed to production.
|
||||
|
||||
The first couple weeks can also feel frustrating if you're not yet given an opportunity to get your hands dirty. To counter this, ask your manager to assign some starter tickets to you. These are usually minor tasks like code cleanup or adding unit tests. Still, they allow you to tinker with the codebase, which helps improve your understanding and gives you a sense of accomplishment, which is a very encouraging feeling in the early days of a new job.
|
||||
|
||||
### Speak up, especially when you're stuck
|
||||
|
||||
I want to stress the importance of communication when you're stuck. This happens, especially in the early months of a new job, and as frustrating as it can be, this is where your communication skills will shine.
|
||||
|
||||
- Be transparent about blockers and your progress. Even if it's something as trivial as permission issues (a fairly common blocker for new employees), ensure that your manager is aware.
|
||||
- Don't wait until the last day to report if something will be delayed. Delays in your project push many other things forward. Share necessary project delays well in advance, so your manager can share this with stakeholders.
|
||||
- Don't forget things like thoroughly testing your changes or documenting your code just because you're in a rush.
|
||||
|
||||
### Gain technical context
|
||||
|
||||
Gaining technical context is something I've personally struggled with, and I've actively worked on changing my approach in this area.
|
||||
|
||||
When I started as an intern, I would go in with a very focused mindset regarding what I wanted to learn. I'd have a laser-sharp focus on my project, but I'd completely turn a blind eye to everything else. Over the years, I realized that turning a blind eye to other or adjacent projects might not be the wisest decision.
|
||||
|
||||
First and foremost, it impacts your understanding of your work. I was naive to think I could be a good engineer if I focused exclusively on my project. That's just not true. You should take the time to understand other services with which your project might interact. You don't need to get into the nitty gritty, but developing a basic understanding goes a long way.
|
||||
|
||||
A common experience that new employees undergo is disconnecting from the rest of the company, which is a very natural feeling, especially at larger companies. I'm someone who develops a sense of exclusion very quickly, so when I moved to Yelp, a significantly larger company than my previous one, with projects of a much larger scale, I prioritized understanding the big picture. Not only did I work on developing an understanding of my project but also of other adjacent projects.
|
||||
|
||||
In my first few weeks at Yelp, I sat down with various engineers on my team and asked them to give me a bird's eye view of what I would be doing and the project's overarching goal. This approach was incredibly helpful because not only did I get varying degrees of explanations based on how senior the engineer was and how long they had been working on the project, but it also deepened my understanding of what I would be working on. I went into these meetings with the goal that my knowledge of the project should allow me to explain what I do to a stranger on the street. To this end, I asked my tech lead to clarify at what point my work came into the picture when a user opened the Yelp app and searched for something.
|
||||
|
||||
Architecture diagrams can also help in this scenario, especially when understanding how different services interact.
|
||||
|
||||
### Establish expectations
|
||||
|
||||
For the longest time, I thought that all I needed to do was my best and be a good employee. If I was doing work, meeting goals, and no one complained, that should be good enough, right? Wrong.
|
||||
|
||||
You must be strategic with your career. You can't just outsource it to people's goodwill and hope you'll get the desired results just because you're meeting expectations.
|
||||
|
||||
- Establish clear criteria the moment you start your new job. This varies by company, as some organizations have very well-defined measures while others might barely have any. If it's the latter, I suggest you sit down with your manager within the first couple of weeks and establish and unanimously agree on a criterion.
|
||||
- Make sure you thoroughly understand how you will be evaluated and what measures are used.
|
||||
|
||||
I remember walking out of my first evaluation very confused in my first full-time role. The whole conversation had been very vague and hand-wavy, and I had no clarity about my strengths, weaknesses, or even steps to improve.
|
||||
|
||||
At first, it was easy to attribute everything to my manager because the new employee in me thought this was their job, not mine. But over time, I realized that I couldn't just take a backseat as far as my performance evaluations were concerned. You can't just do good work and expect it to be enough. You have to actively take part in these conversations. You have to make sure that your effort and contributions are being noticed. From regularly contributing to technical design conversations to setting up socials for your team, ensure that your work is acknowledged.
|
||||
|
||||
Tying into establishing expectations is also the importance of actively seeking feedback. Don't wait until your formal performance evaluations every three or four months to find out how you're doing. Actively set up a feedback loop with your manager. Try to have regular conversations where you're seeking feedback, as scary as that may be.
|
||||
|
||||
### Navigate working in distributed teams
|
||||
|
||||
The workplace has evolved over the past two years, and working in remote and distributed teams is now the norm instead of a rarity. I've listed some tips to help you navigate working in distributed teams:
|
||||
|
||||
- When starting meetings, exchange pleasantries and ask people how their weekend/day has been. This helps break the ice and enables you to build a more personal connection with your team members, which goes beyond work.
|
||||
- Suggest an informal virtual gathering periodically for some casual chit-chat with the team.
|
||||
|
||||
- Establish core hours and set these on your calendar. These are a set of hours that your team will unanimously agree upon, and the understanding is that everyone should be online and responsive during these hours. This is also convenient because meetings only get scheduled within these hours, making it much easier to plan your day.
|
||||
- Be mindful of people's time zones and lunch hours.
|
||||
- In the virtual world, you need to make a greater effort to maintain social interactions, and little gestures can go a long way in helping make the work environment much friendlier. These include the following:
|
||||
|
||||
### Maintain a work-life balance
|
||||
|
||||
At the beginning of your career, it's easy to think that it's all about putting in those hours, especially given the 'hustle culture' narrative that we're fed 24/7 and the idea that a work-life balance is established in the later stages of our careers. This idea couldn't be further from the truth because a work-life balance isn't just magically going to occur for you. You need to actively and very diligently work on it.
|
||||
|
||||
The scary thing about not having a work-life balance is that it slowly creeps up on you. It starts with you checking emails after hours and then slowly makes its way to you, working over weekends and feeling perpetually exhausted.
|
||||
|
||||
**[ Related read [How I recognize and prevent burnout in open source][1] ]**
|
||||
|
||||
I've listed some tips to help you avoid this situation:
|
||||
|
||||
- Turn off/pause notifications and emails and set yourself to offline.
|
||||
- Do not work weekends. It starts with you working one weekend, and the next thing you know, you're working most weekends. Whatever it is, it can wait until Monday.
|
||||
- If you're an on-call engineer, understand your company's policies surrounding that. Some companies offer monetary compensation, while others may give time off in lieu. Use this time. Not using your benefits like PTO (paid time off) and wellness days really shortens your longevity at work.
|
||||
|
||||
### Wrap up
|
||||
|
||||
There's no doubt that starting a new job is stressful and difficult. I hope that these tips and tricks will make your first few months easier and set you up for great success with your new position. Remember to communicate, establish your career goals, take initiative, and use the company's tools effectively. I know you'll do great!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/2/your-first-tech-job
|
||||
|
||||
作者:[Fatima][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[XiaotingHuang22](https://github.com/XiaotingHuang22)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/ftaj
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://opensource.com/article/21/5/open-source-burnout
|
@ -0,0 +1,63 @@
|
||||
[#]: subject: "The open source way of raising a family"
|
||||
[#]: via: "https://opensource.com/article/23/3/open-source-family"
|
||||
[#]: author: "Ruth Netser https://opensource.com/users/rnetser1"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
The open source way of raising a family
|
||||
======
|
||||
|
||||
As a rebellious teenager in the 80s, "because I said so" was a phrase I heard all too often at home. I wasn't really a rebel. I just wanted to be heard and seen as a person starting to articulate their thoughts and emotions.
|
||||
|
||||
The feeling I had of not being heard or listened to led me to believe that it's important to raise kids who are not afraid to speak up, but who can also learn to adapt. Listening to them and collaborating with kids can also help them be creative and, eventually, allow them to be part of a successful organization.
|
||||
|
||||
### How children interpret information
|
||||
|
||||
I didn't intentionally encourage open behaviors for my children, nor did I actively tell my kids to speak up. Nevertheless, on my eldest son's first day of kindergarten, we were called by his teacher. She told us that when she went over the rules of not fighting, pushing, and so on with the class, my kid had raised his hand to tell her that his parents allowed him to dispute and debate all the time.
|
||||
|
||||
It was true. I let my boys express themselves and be heard. But my kid's words surprised me. Only then did I realize that while I'd been doing something right, the fact is that how my kids act shouldn't just be a reaction to the way we educate them. Nor should we leave it up to them to pick things from second-hand context. That day was a game changer for me, and practicing an open culture officially and proactively entered our home.
|
||||
|
||||
### Open for growth
|
||||
|
||||
When I was young, parents and elders were the knowledgeable ones.
|
||||
|
||||
As a kid, it was not always easy to get information. While I was encouraged to express an opinion, it was only up to the point where it was a normative and "easy to digest" one. Today, parents and teachers and kids all have the same means to access data. What you do with it is entirely up to you.
|
||||
|
||||
For example, when playing Scattergories in Hebrew, the word "virus" is normally the only animal starting with "V" that most people play. To gain more points, we decided to find additional animal names that qualified. In no time, we found not one but three new animals (my kid's teacher argued that a "wallaby" (spelled with a "V" in Hebrew) was not a real thing, but that's another story).
|
||||
|
||||
I teach my kids to read between the lines and never to accept things presented to them as "facts" without question. This allows them to practice critical thinking. It also allows them to question me, which leads us to open and transparent discussions.
|
||||
|
||||
Are these discussions easy? No. Do I always have the energy to conduct them? Absolutely not.
|
||||
|
||||
However, to help them practice the learn-to-listen "muscle," these conversations are a must.
|
||||
|
||||
Occasionally, we have to force ourselves to find time to focus our attention on our family. It takes time to build a robust and open culture, and as people change so does your family culture. You have to adapt and work to keep it alive. As leader of the pack, I have to provide my kids with a safe place, a place where they can openly share their ideas, a place where they feel belonging.
|
||||
|
||||
In a family, you have to collaborate and solve problems together. Listening to the different ideas and approaches to solving issues allows you to come up with creative (and yet not always to everyone's liking) solutions.
|
||||
|
||||
One issue in my home was the noise in the house when playing computer games. This happens mostly late at night and on the weekends. We sat down together and came up with an agreed-upon timeslot for noisy games. From then on, those who wanted to play knew when they could play, and those seeking some quiet time also knew when those times would happen. As kids grow up, the nature of the decisions and discussions change.
|
||||
|
||||
Does it mean that all decisions are shared with the kids? No. Does it mean that it's all roses? Absolutely not.
|
||||
|
||||
Encouraging kids to connect may end up with a broken vase for which no one seems to be accountable. It may lead to "because I said so" to pop in for a visit. However, having challenging yet inclusive conversations, encouraging innovative thinking, and including kids in decisions are ways of preparing them for adulthood. Hopefully, it'll make them better people, too (so far, this is working well, in my humble opinion.)
|
||||
|
||||
### Open family culture
|
||||
|
||||
Practicing open culture is not a one-time thing. It's a journey, and it's a mindset. I believe it provides both my kids and me the tools to be resilient, open-minded, tolerant, and inquisitive both inside the house and out. Start an open culture with those closest to you, and take it with you everywhere you go.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/3/open-source-family
|
||||
|
||||
作者:[Ruth Netser][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/rnetser1
|
||||
[b]: https://github.com/lkxed/
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://jao.io/blog/2021-01-11-an-even-better-video-wharf.html"
|
||||
[#]: author: "jao https://jao.io"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "Drwhooooo"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
@ -1,71 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Why programmers love Linux packaging)
|
||||
[#]: via: (https://opensource.com/article/21/2/linux-packaging)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Why programmers love Linux packaging
|
||||
======
|
||||
Programmers can distribute their software easily and consistently via
|
||||
Flatpaks, letting them focus on their passion: Programming.
|
||||
![Package wrapped with brown paper and red bow][1]
|
||||
|
||||
In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Today, I'll talk about what makes packaging for Linux ideal for programmers.
|
||||
|
||||
Programmers love to program. That probably seems like an obvious statement, but it's important to understand that developing software involves a lot more than just writing code. It includes compiling, documentation, source code management, install scripts, configuration defaults, support files, delivery format, and more. Getting from a blank screen to a deliverable software installer requires much more than just programming, but most programmers would rather program than package.
|
||||
|
||||
### What is packaging?
|
||||
|
||||
When food is sent to stores to be purchased, it is packaged. When buying directly from a farmer or from an eco-friendly bulk or bin store, the packaging is whatever container you've brought with you. When buying from a grocery store, packaging may be a cardboard box, plastic bag, a tin can, and so on.
|
||||
|
||||
When software is made available to computer users at large, it also must be packaged. Like food, there are several ways software can be packaged. Open source software can be left unpackaged because users, having access to the raw code, can compile and package it themselves. However, there are advantages to packages, so applications are commonly delivered in some format specific to the user's platform. And that's where the problems begin, because there's not just one format for software packages.
|
||||
|
||||
For the user, packages make it easy to install software because all the work is done by the system's installer. The software is extracted from its package and distributed to the appropriate places within the operating system. There's little opportunity for anything to go wrong.
|
||||
|
||||
For the software developer, however, packaging means that you have to learn how to create a package—and not just one package, but a unique package for every operating system you want your software to be installable on. To complicate matters, there are multiple packaging formats and options for each operating system, and sometimes even for the programming language being used.
|
||||
|
||||
### Packaging on Linux
|
||||
|
||||
Packaging options for Linux have traditionally seemed pretty overwhelming. Linux distributions derived from Fedora, such as Red Hat and CentOS, default to `.rpm` packages. Debian and Ubuntu (and similar) default to `.deb` packages. Other distributions may use one or the other, or neither, opting for a custom format. When asked, many Linux users say that ideally, a programmer won't package their software for Linux at all but instead rely on the package maintainers of each distribution to create the package. All software installed onto any Linux system ought to come from that distribution's official repository. However, it remains unclear how to get your software reliably packaged and included by one distribution, let alone all distributions.
|
||||
|
||||
### Flatpak for Linux
|
||||
|
||||
The Flatpak packaging system was introduced to unify and decentralize Linux as a delivery target for developers. With Flatpak, either a developer or anyone (a member of a Linux community, a different developer, a Flatpak team member, or anyone else) is free to package software. They can then submit the package to Flathub or choose to self-host the package and offer it to basically any Linux distribution. The Flatpak system is available to all Linux distributions, so targeting one is the same as targeting them all.
|
||||
|
||||
### How Flatpak technology works
|
||||
|
||||
The secret to Flatpak's universal appeal is a standard base. The Flatpak system allows developers to reference a common set of Software Developer Kit (SDK) modules. These are packaged and managed by the maintainers of the Flatpak system. The SDKs get pulled in as needed whenever you install a Flatpak, ensuring compatibility with your system. Any given SDK is only required once because the libraries it contains can be shared across any Flatpak calling for it.
|
||||
|
||||
If a developer requires a library not already included in an existing SDK, the developer can add that library in the Flatpak.
|
||||
|
||||
The results speak for themselves. Users may install hundreds of packages on any Linux distribution from one central repository, called [Flathub][2].
|
||||
|
||||
### How developers use Flatpaks
|
||||
|
||||
Flatpaks are designed to be reproducible, so the build process is easily integrated into a CI/CD workflow. A Flatpak is defined in a [YAML][3] or JSON manifest file. You can create your first Flatpak by following my [introductory article][4], and you can read the full documentation at [docs.flatpak.org][5].
|
||||
|
||||
### Linux makes it easy
|
||||
|
||||
Creating software on Linux is easy, and packaging it up for Linux is simple and automatable. If you're a programmer, Linux makes it easy for you to forget about packaging by targeting one system and integrating that into your build process.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/2/linux-packaging
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brown-package-red-bow.jpg?itok=oxZYQzH- (Package wrapped with brown paper and red bow)
|
||||
[2]: https://flatpak.org/setup/
|
||||
[3]: https://www.redhat.com/sysadmin/yaml-beginners
|
||||
[4]: https://opensource.com/article/19/10/how-build-flatpak-packaging
|
||||
[5]: https://docs.flatpak.org/en/latest/index.html
|
@ -2,7 +2,7 @@
|
||||
[#]: via: (https://opensource.com/article/21/6/program-c-freedos)
|
||||
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,223 +0,0 @@
|
||||
[#]: subject: "Write your first CI/CD pipeline in Kubernetes with Tekton"
|
||||
[#]: via: "https://opensource.com/article/21/11/cicd-pipeline-kubernetes-tekton"
|
||||
[#]: author: "Savita Ashture https://opensource.com/users/savita-ashture"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Write your first CI/CD pipeline in Kubernetes with Tekton
|
||||
======
|
||||
Tekton is a Kubernetes-native open source framework for creating
|
||||
continuous integration and continuous delivery (CI/CD) systems.
|
||||
![Plumbing tubes in many directions][1]
|
||||
|
||||
Tekton is a Kubernetes-native open source framework for creating continuous integration and continuous delivery (CI/CD) systems. It also helps to do end-to-end (build, test, deploy) application development across multiple cloud providers or on-premises systems by abstracting away the underlying implementation details.
|
||||
|
||||
### Introduction to Tekton
|
||||
|
||||
[Tekton][2], known initially as [Knative Build][3], later got restructured as its own open source project with its own [governance organization][4] and is now a [Linux Foundation][5] project. Tekton provides an in-cluster container image build and deployment workflow—in other words, it is a continuous integration (CI) and continuous delivery (CD) service. It consists of Tekton Pipelines and several supporting components, such as Tekton CLI, Triggers, and Catalog.
|
||||
|
||||
Tekton is a Kubernetes native application. It installs and runs as an extension on a Kubernetes cluster and comprises a set of Kubernetes Custom Resources that define the building blocks you can create and reuse for your pipelines. Because it's a K-native technology, Tekton is remarkably easy to scale. When you need to increase your workload, you can just add nodes to your cluster. It's also easy to customize because of its extensible design and thanks to a community repository of contributed components.
|
||||
|
||||
Tekton is ideal for developers who need CI/CD systems to do their work and platform engineers who build CI/CD systems for developers in their organization.
|
||||
|
||||
### Tekton components
|
||||
|
||||
Building CI/CD pipelines is a far-reaching endeavor, so Tekton provides tools for every step of the way. Here are the major components you get with Tekton:
|
||||
|
||||
* **Pipeline: **Pipeline defines a set of Kubernetes [Custom Resources][6] that act as building blocks you use to assemble your CI/CD pipelines.
|
||||
* **Triggers: **Triggers is a Kubernetes Custom Resource that allows you to create pipelines based on information extracted from event payloads. For example, you can trigger the instantiation and execution of a pipeline every time a merge request gets opened against a Git repository.
|
||||
* **CLI:** CLI provides a command-line interface called `tkn` that allows you to interact with Tekton from your terminal.
|
||||
* **Dashboard:** Dashboard is a web-based graphical interface for Tekton pipelines that displays information about the execution of your pipelines.
|
||||
* **Catalog:** Catalog is a repository of high-quality, community-contributed Tekton building blocks (tasks, pipelines, and so on) ready for use in your own pipelines.
|
||||
* **Hub:** Hub is a web-based graphical interface for accessing the Tekton catalog.
|
||||
* **Operator:** Operator is a Kubernetes [Operator pattern][7] that allows you to install, update, upgrade, and remove Tekton projects on a Kubernetes cluster.
|
||||
* **Chains: **Chains is a Kubernetes Custom Resource Definition (CRD) controller that allows you to manage your supply chain security in Tekton. It is currently a work-in-progress.
|
||||
* **Results: **Results aims to help users logically group CI/CD workload history and separate out long-term result storage away from the pipeline controller.
|
||||
|
||||
|
||||
|
||||
### Tekton terminology
|
||||
|
||||
![Tekton terminology][8]
|
||||
|
||||
(Source: [Tekton documentation][9])
|
||||
|
||||
* **Step:** A step is the most basic entity in a CI/CD workflow, such as running some unit tests for a Python web app or compiling a Java program. Tekton performs each step with a provided container image.
|
||||
|
||||
* **Task:** A task is a collection of steps in a specific order. Tekton runs a task in the form of a [Kubernetes pod][10], where each step becomes a running container in the pod.
|
||||
|
||||
* **Pipelines:** A pipeline is a collection of tasks in a specific order. Tekton collects all tasks, connects them in a directed acyclic graph (DAG), and executes the graph in sequence. In other words, it creates a number of Kubernetes pods and ensures that each pod completes running successfully as desired.
|
||||
|
||||
![Tekton pipelines][11]
|
||||
|
||||
(Source: [Tekton documentation][12])
|
||||
|
||||
* **PipelineRun: **A PipelineRun, as its name implies, is a specific execution of a pipeline.
|
||||
|
||||
* **TaskRun:** A TaskRun is a specific execution of a task. TaskRuns are also available when you choose to run a task outside a pipeline, with which you may view the specifics of each step execution in a task.
|
||||
|
||||
|
||||
|
||||
|
||||
### Create your own CI/CD pipeline
|
||||
|
||||
The easiest way to get started with Tekton is to write a simple pipeline of your own. If you use Kubernetes every day, you're probably comfortable with YAML, which is precisely how Tekton pipelines are defined. Here's an example of a simple pipeline that clones a code repository.
|
||||
|
||||
First, create a file called `task.yam`**l** and open it in your favorite text editor. This file defines the steps you want to perform. In this example, that's cloning a repository, so I've named the step clone. The file sets some environment variables and then provides a simple shell script to perform the clone.
|
||||
|
||||
Next comes the task. You can think of a step as a function that gets called by the task, and the task sets parameters and workspaces required for steps.
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: git-clone
|
||||
spec:
|
||||
workspaces:
|
||||
- name: output
|
||||
description: The git repo will be cloned onto the volume backing this Workspace.
|
||||
params:
|
||||
- name: url
|
||||
description: Repository URL to clone from.
|
||||
type: string
|
||||
- name: revision
|
||||
description: Revision to checkout. (branch, tag, sha, ref, etc...)
|
||||
type: string
|
||||
default: ""
|
||||
steps:
|
||||
- name: clone
|
||||
image: "gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:v0.21.0"
|
||||
env:
|
||||
- name: PARAM_URL
|
||||
value: $(params.url)
|
||||
- name: PARAM_REVISION
|
||||
value: $(params.revision)
|
||||
- name: WORKSPACE_OUTPUT_PATH
|
||||
value: $(workspaces.output.path)
|
||||
script: |
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
CHECKOUT_DIR="${WORKSPACE_OUTPUT_PATH}"
|
||||
|
||||
/ko-app/git-init \
|
||||
-url="${PARAM_URL}" \
|
||||
-revision="${PARAM_REVISION}" \
|
||||
-path="${CHECKOUT_DIR}"
|
||||
cd "${CHECKOUT_DIR}"
|
||||
EXIT_CODE="$?"
|
||||
if [ "${EXIT_CODE}" != 0 ] ; then
|
||||
exit "${EXIT_CODE}"
|
||||
fi
|
||||
# Verify clone is success by reading readme file.
|
||||
cat ${CHECKOUT_DIR}/README.md
|
||||
|
||||
```
|
||||
|
||||
Create a second file called `pipeline.yaml`, and open it in your favorite text editor. This file defines the pipeline by setting important parameters, such as a workspace where the task can be run and processed.
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Pipeline
|
||||
metadata:
|
||||
name: cat-branch-readme
|
||||
spec:
|
||||
params:
|
||||
- name: repo-url
|
||||
type: string
|
||||
description: The git repository URL to clone from.
|
||||
- name: branch-name
|
||||
type: string
|
||||
description: The git branch to clone.
|
||||
workspaces:
|
||||
- name: shared-data
|
||||
description: |
|
||||
This workspace will receive the cloned git repo and be passed
|
||||
to the next Task for the repo's README.md file to be read.
|
||||
tasks:
|
||||
- name: fetch-repo
|
||||
taskRef:
|
||||
name: git-clone
|
||||
workspaces:
|
||||
- name: output
|
||||
workspace: shared-data
|
||||
params:
|
||||
- name: url
|
||||
value: $(params.repo-url)
|
||||
- name: revision
|
||||
value: $(params.branch-name)
|
||||
|
||||
```
|
||||
|
||||
Finally, create a file called `pipelinerun.yaml` and open it in your favorite text editor. This file actually runs the pipeline. It invokes parameters defined in the pipeline (which, in turn, invokes the task defined by the task file.)
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: PipelineRun
|
||||
metadata:
|
||||
name: git-clone-checking-out-a-branch
|
||||
spec:
|
||||
pipelineRef:
|
||||
name: cat-branch-readme
|
||||
workspaces:
|
||||
- name: shared-data
|
||||
volumeClaimTemplate:
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
params:
|
||||
- name: repo-url
|
||||
value: <https://github.com/tektoncd/pipeline.git>
|
||||
- name: branch-name
|
||||
value: release-v0.12.x
|
||||
|
||||
```
|
||||
|
||||
The advantage of structuring your work in separate files is that the `git-clone` task is reusable for multiple pipelines.
|
||||
|
||||
For example, suppose you want to do end-to-end testing for a pipeline project. You can use the `git-clone`** **task to ensure that you have a fresh copy of the code you need to test.
|
||||
|
||||
### Wrap up
|
||||
|
||||
As long as you're familiar with Kubernetes, getting started with Tekton is as easy as adopting any other K-native application. It has plenty of tools to help you create pipelines and to interface with your pipelines. If you love automation, try Tekton!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/11/cicd-pipeline-kubernetes-tekton
|
||||
|
||||
作者:[Savita Ashture][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/savita-ashture
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions)
|
||||
[2]: https://github.com/tektoncd/pipeline
|
||||
[3]: https://github.com/knative/build
|
||||
[4]: https://cd.foundation/
|
||||
[5]: https://www.linuxfoundation.org/projects/
|
||||
[6]: https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/
|
||||
[7]: https://operatorhub.io/what-is-an-operator
|
||||
[8]: https://opensource.com/sites/default/files/uploads/tekto-terminology.png (Tekton terminology)
|
||||
[9]: https://tekton.dev/docs/concepts/concept-tasks-pipelines.png
|
||||
[10]: https://kubebyexample.com/en/concept/pods
|
||||
[11]: https://opensource.com/sites/default/files/uploads/tekton-pipelines.png (Tekton pipelines)
|
||||
[12]: https://tekton.dev/docs/concepts/concept-runs.png
|
@ -1,100 +0,0 @@
|
||||
[#]: subject: "5 open source alternatives to Microsoft Exchange"
|
||||
[#]: via: "https://opensource.com/article/21/11/open-source-alternatives-microsoft-exchange"
|
||||
[#]: author: "Heike Jurzik https://opensource.com/users/hej"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
5 open source alternatives to Microsoft Exchange
|
||||
======
|
||||
There is no need to settle for a proprietary solution. Try one of these
|
||||
Linux-based email and groupware services.
|
||||
![Working on a team, busy worklife][1]
|
||||
|
||||
For decades, Microsoft Exchange has ruled the market for email and groupware services. This top dog dominates the corporate world, and the omnipresent Outlook mail client has become the de facto standard for groupware. Since Exchange is closely integrated with Microsoft's Office products, users have access to a wide variety of productivity software and features, whether they're using a desktop or a mobile client.
|
||||
|
||||
However, many companies have concerns about storing their data in the Microsoft cloud. In this article, I look at some open source alternatives and their advantages. It's not just about becoming vendor-independent and reducing costs; it's about using software with open standards and a different level of security—for the groupware server itself and the operating system behind it.
|
||||
|
||||
All five alternatives in this article are Linux-based. While grommunio, Kopano, Nextcloud, ownCloud, and the OX App Suite vary widely in functionality and are therefore attractive to different types of enterprises, they all provide free editions with the option to purchase paid support and add-ons. All candidates can either run on-prem or in the cloud. On top of that, all vendors offer a SaaS solution for their software.
|
||||
|
||||
### grommunio
|
||||
|
||||
[grommunio][2], formerly known as grammm, is published under the AGPLv3 license. It is developed and supported by the Austrian company of the same name. Unlike Exchange, grommunio offers a mail server that's standards-compliant as well as a fully functional groupware solution with features like email, contacts, calendar, tasks, file sharing, and more. grommunio works with various open source and proprietary mail clients, like Windows Mail, Outlook, Android, Apple Mail/iOS, Thunderbird, etc., and supports both the older RPC over HTTP protocol and the Outlook standard protocol MAPI over HTTP. Also included: Exchange ActiveSync for mobile devices and various standard protocols like CalDAV (calendar), CardDAV (address book), IMAP, POP3, SMTP, and LDAP, as well as Active Directory (for syncing of user accounts).
|
||||
|
||||
External open source applications provide some features not supported by Microsoft's API or protocols. For example, the developers have integrated [Jitsi][3] (video and audio telephony), [Mattermost][4] (chat), and file sharing and syncing ([ownCloud][5]). grommunio is also equipped with basic mobile device management (MDM).
|
||||
|
||||
grommunio is designed for a very large number of users and—just like Exchange—supports database sharding (horizontal distribution of databases across multiple hosts). The flexible storage backend allows administrators to extend their setup by adding other servers or cloud accounts. grommunio uses a MySQL database for metadata only, while all "content" such as mail and groupware objects are stored in a per-user SQLite database. For more information on the underlying architecture, please have a look at the [manufacturer's website][6].
|
||||
|
||||
The Community edition is free of charge and includes all grommunio features for up to five user accounts.
|
||||
|
||||
### Kopano
|
||||
|
||||
[Kopano][7], from the German-Dutch software manufacturer Kopano, is also AGPLv3-licensed and based on the Zarafa software stack. Unlike its predecessor, Kopano doesn't aim to be a mere replacement for Exchange. Instead, it's a complete groupware solution and includes real-time communication in addition to the standard features of email, contacts, calendar, tasks, notes, and document editing. Kopano interacts with [many other platforms][8], applications, and services. Some of them can easily be integrated by plugins. For video conferencing, the Kopano team has developed its own open source solution based on WebRTC: Kopano Meet offers end-to-end encryption and is available for Windows, macOS, Linux, Android, and iOS.
|
||||
|
||||
Outlook clients are supported via ActiveSync (Z-Push library) or the [Kopano OL Extension][9] (KOE), which serves as an enhancement to the already included ActiveSync. Kopano offers a native web client (WebApp), a client for mobile devices (Mobility), and a desktop version (DeskApp) with support for Windows, Linux, and macOS. Connecting other clients is possible via IMAP, CalDAV, and CardDAV. All applications directly connecting to the Kopano Server use MAPI in SOAP (Simple Object Access Protocol).
|
||||
|
||||
Free community versions are available for Kopano Groupware and Kopano ONE (a special edition of the Kopano Groupware). Kopano Meet can be downloaded as an application or container.
|
||||
|
||||
### Nextcloud
|
||||
|
||||
[Nextcloud][10], with offices in Stuttgart and Berlin (Germany), is licensed under the AGPLv3. Like in ownCloud or Dropbox, users can access the software suite via their desktops (Windows, Linux, and macOS), web browsers, or native apps (Android and iOS). Since version 18, Nextcloud includes Nextcloud Talk (calls, chats, and web meetings) and Nextcloud Groupware (calendar, contacts, and mail) in addition to Nextcloud Files (file sync and share), and changed its name to Nextcloud Hub.
|
||||
|
||||
User and group administration happens via OpenID or LDAP. Various storage backends are supported, such as FTP, S3, and Dropbox. Nextcloud works with several database management systems, including PostgreSQL, MariaDB, SQLite, and Oracle Database. Admins can extend the functionality with more than 200 apps from the [Nextcloud app store][11]. Offerings include real-time communication, audio and video chat, task management, mail, and many more.
|
||||
|
||||
Nextcloud is completely free of charge. On top of that, the company offers a Nextcloud Enterprise build (pre-configured, optimized, and hardened for enterprise deployments).
|
||||
|
||||
### ownCloud
|
||||
|
||||
[ownCloud][12] is a file sync, share, and content collaboration software developed and maintained by ownCloud GmbH in Nuremberg, Germany. The core of the client-server software and many community apps are published under the AGPLv3. Several enterprise apps which extend the functionality are licensed under the ownCloud Commercial License (OCL).
|
||||
|
||||
ownCloud is mainly a content collaboration software, including online office document editing, calendar, contact synchronization, etc. Mobile clients are available for Android and iOS, and the desktop app integrates into the native file managers in Windows, macOS, and Linux. The Web interface allows access without installing dedicated client software. ownCloud supports WebDAV, CalDAV, and CardDAV. LDAP is included, but ownCloud also connects to other Identity Providers supporting the OpenID Connect authentication standard.
|
||||
|
||||
ownCloud offers integrations for Microsoft Office Online Server, Office 365, and Microsoft Teams. Plugins for Microsoft Outlook and eM Client are available. If necessary, the External Storage Feature connects to different storage providers, like Amazon S3, Dropbox, Microsoft SharePoint, Google Drive, Windows network drives (SMB), and FTP. The vendor also offers additional features for enterprise customers, like end-to-end encryption, ransomware and antivirus protection, etc. (see the [full list of features][13]).
|
||||
|
||||
The Community edition is free of charge and 100% open source.
|
||||
|
||||
### OX App Suite
|
||||
|
||||
[Open-Xchange][14] was founded in 2005 with headquarters in Olpe and Nuremberg, Germany. Today, OX has offices in various European countries, the USA, and Japan. The [OX App Suite][15] is a modular email, communication, and collaboration platform, mainly designed for telcos, hosting companies, and other providers delivering cloud-based services.
|
||||
|
||||
The backend is released under the GPLv2, the frontend (UI) under the AGPLv3. Users can access the app suite via their preferred browser (fully customizable portal) or a mobile app (Android and iOS). Alternatively, native clients (mobile devices and desktops) are available for OX Mail and OX Drive. Thanks to CardDAV and CalDAV extensions, Exchange Active Sync, and the OX Sync App for Android, synchronization of contacts, calendars, and tasks is possible.
|
||||
|
||||
OX App Suite contains apps for email, contacts, calendars, and tasks. Additional tools and extensions—some open source, some paid features—are available, including OX Documents (text documents, spreadsheets, presentations), OX Drive (manage, share, and synchronize files), OX Guard (encryption of emails and files), and more. For a complete list, please visit the OX website for [general terms and conditions][16].
|
||||
|
||||
A community edition with limited features is available at no charge.
|
||||
|
||||
### Open source email and groupware
|
||||
|
||||
Email and groupware services don't have to cost (lots of) money, and there is certainly no need to settle for a proprietary solution hosted on someone else's server. If you're not too keen on the administrative responsibilities, though, all five open source Exchange alternatives are available as SaaS solutions. Alternatively, all vendors offer professional tech support, and you can run the software on-premise—always in control, but never alone.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/11/open-source-alternatives-microsoft-exchange
|
||||
|
||||
作者:[Heike Jurzik][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/hej
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png?itok=6YtME4Hj (Working on a team, busy worklife)
|
||||
[2]: https://grommunio.com/
|
||||
[3]: https://opensource.com/article/20/5/open-source-video-conferencing
|
||||
[4]: https://opensource.com/article/20/7/mattermost
|
||||
[5]: https://opensource.com/article/21/7/owncloud-windows-files
|
||||
[6]: https://grommunio.com/features/architecture/
|
||||
[7]: https://kopano.com/
|
||||
[8]: https://kopano.com/products/interoperability/
|
||||
[9]: https://kb.kopano.io/display/WIKI/Setting+up+the+Kopano+OL+Extension
|
||||
[10]: https://nextcloud.com/
|
||||
[11]: https://apps.nextcloud.com/
|
||||
[12]: https://owncloud.com/
|
||||
[13]: https://owncloud.com/features/
|
||||
[14]: https://www.open-xchange.com/
|
||||
[15]: https://www.open-xchange.com/products/ox-app-suite/
|
||||
[16]: https://www.open-xchange.com/terms-and-conditions/
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://opensource.com/article/21/12/kdenlive-linux-creative-app"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "yjacks"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
@ -1,110 +0,0 @@
|
||||
[#]: subject: "Open source mind mapping with Draw.io"
|
||||
[#]: via: "https://opensource.com/article/21/12/open-source-mind-mapping-drawio"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "FYJNEVERFOLLOWS "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Open source mind mapping with Draw.io
|
||||
======
|
||||
Next time you need to brainstorm, organize ideas, or plan a project,
|
||||
start with Draw.io.
|
||||
![Looking at a map for career journey][1]
|
||||
|
||||
There's something special about maps. I remember opening the front book cover of JRR Tolkien's _The Hobbit_ when I was younger, staring at the hand-drawn map of Middle Earth, and feeling the wealth of possibility contained in the simple drawing. Aside from their obvious purpose of actually describing where things are in relation to other things, I think maps do a great job of expressing potential. You could step outside and take the road this way or that way, and if you do, just think of all the new and exciting things you'll be able to see.
|
||||
|
||||
Maps don't have to be literal to be valuable and full of possibility, though. Some maps describe a thought process, plan, algorithm, or even random ideas desperately trying to fit together in a potential work of art. Call them "mind maps" or "flowcharts" or "idea boards." They're easy to make with the open source [Draw.io][2] application.
|
||||
|
||||
### Install Draw.io
|
||||
|
||||
Draw.io is designed as an open source online app, so you can either use it as an online application, download the [desktop version][3], or [clone the Git repository][4] and host it on your own server.
|
||||
|
||||
### Mapping with Draw.io
|
||||
|
||||
When you first start Draw.io, you need to choose where you want to save your data. If you're hosting Draw.io yourself, your choices depend on which API keys you have access to. You can choose from several online storage services for the online public instance, depending on what you've got an account for. If you don't want to store your data on somebody else's server, you can also choose to save your work on a local drive. If you're unsure yet, you can click **Decide later** to continue into the app without choosing anything.
|
||||
|
||||
The Draw.io interface has a big workspace in the center, the main toolbar on the left, a toolbar along the top, and a properties panel on the right.
|
||||
|
||||
![Draw.io interface][5]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][6])
|
||||
|
||||
The workflow is simple:
|
||||
|
||||
1. Select a shape from the left toolbar.
|
||||
2. Edit the shape in the workspace.
|
||||
3. Add another shape, and connect them.
|
||||
|
||||
|
||||
|
||||
Repeat that process, and you've got a map.
|
||||
|
||||
![Draw.io example][7]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][6])
|
||||
|
||||
### Project planning
|
||||
|
||||
When you first take on a big task, you often have a pretty clear idea of your desired outcome. Say you want to start a community project to paint a mural. Your desired outcome is a mural. It's pretty easy to define, and you can more or less picture the results in your mind's eye.
|
||||
|
||||
Once you start moving toward your goal, however, you have to start figuring out the details. Where should the mural be painted? How do you get permission to paint on a public wall, anyway? What about paint? Is there a special kind of paint you ought to use? Will you apply the paint with brushes or airbrushes? What kind of specialized equipment do you need for painting? How many people and hours will it take to paint a mural? What about support services for the painters while they work? And what's the painting going to be about, anyway? A single idea can very quickly become overwhelming the closer you get to making it happen.
|
||||
|
||||
This doesn't just apply to painting murals, producing a play, or making a movie. It applies to nearly any non-trivial endeavor. And it's exactly what an application like Draw.io can help map out.
|
||||
|
||||
Here's how you can use Draw.io to create a project flowchart:
|
||||
|
||||
1. Start with a brainstorming session. No thoughts are too trivial or big. Make a box for every idea, and double-click the box in the Draw.io workspace to enter text.
|
||||
2. Once you have all the ideas you can possibly think of on your workspace, drag and drop them into related groups. The goal is to create little clouds, or clusters, of tasks that more or less go together because they're part of the same process.
|
||||
3. Once you've identified the clusters of related tasks, give those tasks a name. For instance, if you're painting a mural, then the tasks might be _approval_, _design_, _purchase_, _paint_, reflecting that you need to get permission from your local government first, then design the mural, then purchase the supplies, and finally paint the mural. Each task has component parts, but broadly you've now determined the workflow for your project.
|
||||
4. Connect the major tasks with arrows. Not all processes are entirely linear. For instance, after you've obtained permission from your city council, you might have to come back to them for final approval once you've designed what you intend to paint. That's normal. It's a loop, there's some back and forth, but eventually, you break out of the loop to proceed to the next stage.
|
||||
5. Armed with your flowchart, work through each task until you've reached your ultimate goal.
|
||||
|
||||
|
||||
|
||||
### Mind mapping
|
||||
|
||||
Mind maps tend to be less about progress and more about maintaining a certain state or putting many ideas into perspective. For instance, suppose you've decided to reduce the amount of waste in your life. You have some ideas about what you can do, but you want to organize and preserve your ideas, so you don't forget them.
|
||||
|
||||
Here's how you can use Draw.io to create a mind map:
|
||||
|
||||
1. Start with a brainstorming session. No thoughts are too trivial or big. Make a box for every idea, and double-click the box in the Draw.io workspace to enter text. You can also give boxes a background color by selecting the box and clicking a color swatch in the right properties panel.
|
||||
2. Arrange your ideas into groups or categories.
|
||||
3. Optionally, connect ideas with arrows that relate directly to one another.
|
||||
|
||||
|
||||
|
||||
![Draw.io waste reduction example][8]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][6])
|
||||
|
||||
### Saving your diagram
|
||||
|
||||
You can save your diagram as a PNG, JPG image, Draw.io XML, or plain XML file. If you save it as XML, you can open it again in Draw.io for further editing. An exported image is great for sharing with others.
|
||||
|
||||
### Use Draw.io
|
||||
|
||||
There are many great diagramming applications, but I don't make diagrams often, so having Draw.io available is convenient at a moment's notice. Its interface is simple and easy to use, and the results are clean and professional. Next time you need to brainstorm, organize ideas, or plan a project, start with Draw.io.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/12/open-source-mind-mapping-drawio
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[FYJNEVERFOLLOWS](https://github.com/FYJNEVERFOLLOWS)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/career_journey_road_gps_path_map_520.png?itok=PpL6jJgY (Looking at a map for career journey)
|
||||
[2]: http://draw.io
|
||||
[3]: https://github.com/jgraph/drawio-desktop
|
||||
[4]: https://github.com/jgraph/drawio
|
||||
[5]: https://opensource.com/sites/default/files/uploads/draw-io-ui.png (Draw.io interface)
|
||||
[6]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[7]: https://opensource.com/sites/default/files/uploads/draw-io-example.jpg (Draw.io example)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/draw-io-export.jpg (Draw.io waste reduction example)
|
@ -1,173 +0,0 @@
|
||||
[#]: subject: "OpenWrt, an open source alternative to firmware for home routers"
|
||||
[#]: via: "https://opensource.com/article/22/7/openwrt-open-source-firmware"
|
||||
[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
OpenWrt, an open source alternative to firmware for home routers
|
||||
======
|
||||
OpenWrt is a Linux-based, open source operating system targeting embedded network devices.
|
||||
|
||||
If you're reading this article from home, you are probably connected with a LTE/5G/DSL/WIFI router. Such devices are usually responsible to route packets between your local devices (smartphone, PC, TV, and so on) and provide access to the world wide web through a built-in modem. Your router at home has most likely a web-based interface for configuration purposes. Such interfaces are often oversimplified as they are made for casual users.
|
||||
|
||||
If you want more configuration options, but don't want to spend for a professional device you should take a look at an alternative firmware such as [OpenWrt][2].
|
||||
|
||||
### OpenWrt features
|
||||
|
||||
OpenWrt is a Linux-based, open source operating system targeting embedded network devices. It is mainly used as a replacement for the original firmware on home routers of all kinds. OpenWrt comes with all the useful features a good router should have like a DNS server ([dnsmasq][3]), Wifi access point and client functionality, PPP protocol for modem functionality and, unlike with the standard firmware, everything is fully configurable.
|
||||
|
||||
### LuCI Web Interface
|
||||
|
||||
OpenWrt can be configured remotely by command line (SSH) or using [LuCI][4], a GUI configuration interface. LuCI is a lightweight, extensible web GUI written in [Lua][5], which enables an exact configuration of your device. Besides configuration, LuCI provides a lot of additional information like real time graphs, system logs, and network diagnostics.
|
||||
|
||||
![LuCI web interface][6]
|
||||
|
||||
Image by: Stephan Avenwedde, [CC BY-SA][7]
|
||||
|
||||
There are some optional extensions available for LuCI to add even further configuration choices.
|
||||
|
||||
### Writeable file system
|
||||
|
||||
Another highlight is the writeable filesystem. While the stock firmware is usually read-only, OpenWrt comes with a writeable filesystem thanks to a clever solution that combines OverlayFS with SquashFS and JFFS2 filesystems to allow installation of packages to enhance functionality. Find more information about the file system architecture in the [OpenWrt documentation][8].
|
||||
|
||||
### Extensions
|
||||
|
||||
OpenWrt has an associated package manager, [opkg][9], which allows to install additional services. Some examples are an FTP server, a DLNA media server, an OpenVPN server, a Samba server to enable file sharing, or Asterisk (software to control telephone calls). Of course, some extensions require appropriate resources of the underlying hardware.
|
||||
|
||||
### Motivation
|
||||
|
||||
You might wonder why you should try to replace a router manufacture's firmware, risking irreparable damage to your device and loss of warranty. If your device works the way you want, then you probably shouldn’t. Never touch a running system! But if you want to enhance functionality, or if your device is lacking configuration options, then you should check whether OpenWrt could be a remedy.
|
||||
|
||||
In my case, I wanted a travel router which I can place on an appropriate position when I’m on a campsite in order to get a good connection to the local Wifi access point. The router should connect itself as an ordinary client and broadcasts it’s own access point for my devices. This allows me to configure all my devices to connect with the routers access points and I only have to change the routers client connection when I’m somewhere else. Moreover, on some campsites you only get an access code for one single device, which I can enhance with this setup.
|
||||
|
||||
As my travel router, I choose the TP-Link TL-WR902AC for the following reasons:
|
||||
|
||||
* Small
|
||||
* Two Wifi antennas
|
||||
* 5V power supply (USB)
|
||||
* Low power consumption
|
||||
* Cost effective (you get it for around $30)
|
||||
|
||||
To get an idea of the size, here it is next to a Raspberry Pi4:
|
||||
|
||||
![TP-Link TL-WR902AC next to a Raspberry Pi][10]
|
||||
|
||||
Image by: Stephan Avenwedde, [CC BY-SA 4.0][11]
|
||||
|
||||
Even though the router brings all hardware capabilities I demand, I relatively quickly found out that the default firmware don’t let me configure it the way I wanted. The router is mainly intended as an Wifi access point, which repeats an existing Wifi network or connects itself to the web over the onboard Ethernet interface. The default firmware is very limited for these use cases.
|
||||
|
||||
Fortunately, the router is capable of running OpenWrt, so I decided to replace the original firmware with it.
|
||||
|
||||
### Installation
|
||||
|
||||
When your LTE/5G/DSL/WIFI router meets the [minimum requirements][12], chances are high that it's possible to run OpenWrt on it. As the next step, you look in the [hardware table][13] and check whether your devices is listed as compatible, and which firmware package you have to choose. The page for the [TP-Link TL-WR902AC][14] also includes the installation instructions which describe how to flash the internal memory.
|
||||
|
||||
The process of flashing the firmware can vary between different devices, so I won’t go into detail on this. In a nutshell, I had to connect the device over a TFTP server on a network interface with a certain IP address, rename the OpenWrt firmware file and then boot up the device considering pressing the reset button.
|
||||
|
||||
### Configuration
|
||||
|
||||
Once flashing was successfully, your device should now boot up with the new firmware. It may take a bit longer now to boot up as OpenWrt comes with much more features compared to the default firmware.
|
||||
|
||||
OpenWrt acts as a DHCP server, so in order to begin with configuration, make a direct Ethernet connection between your PC and the router, and configure your PC’s Ethernet adapter as a DHCP client.
|
||||
|
||||
On Fedora Linux, to activate the DHCP client mode for your network adapter, first you have to find out the connection UUID by running:
|
||||
|
||||
```
|
||||
$ nmcli connection show
|
||||
NAME UUID TYPE DEVICE
|
||||
Wired Conn 1 7a96b...27a ethernet ens33
|
||||
virbr0 360a0...673 bridge virbr0
|
||||
testwifi 2e865...ee8 wifi --
|
||||
virbr0 bd487...227 bridge --
|
||||
Wired Conn 2 16b23...7ba ethernet --
|
||||
```
|
||||
|
||||
Pick the UUID for the connection you want to modify and then run:
|
||||
|
||||
```
|
||||
$ nmcli connection modify <UUID> ipv4.method auto
|
||||
```
|
||||
|
||||
You can find more information about these commands in the [Fedora Networking Wiki][15].
|
||||
|
||||
After you have a connection to your router, open a web browser and navigate to [http://openwrt/][16]. You should now see LuCI’s login manager:
|
||||
|
||||
![LuCI login][17]
|
||||
|
||||
Use **root** as the username, and leave the password field blank.
|
||||
|
||||
### Configuring Wifi and routing
|
||||
|
||||
To configure your Wifi antennas, click on the **Network** menu and select **Wireless**.
|
||||
|
||||
![LuCI wireless configuration][19]
|
||||
|
||||
On my device, the antenna **radio0** on top operates in 2.4 GHz mode and is connected to the local access point called *MOBILE-INTERNET*. The antenna **radio1** below operates at 5 GHz and has an associated access point with the SSID *OpenWrt_AV*. With a click of the **Edit**button, you can open the device configuration to decide whether the device belongs to the *LAN* or WWAN network. In my case, the access point *OpenWrt_AV* belongs to the LAN network and the client connection *MOBILE-INTERNET* belongs to the WWAN network.
|
||||
|
||||
![LuCI configuration screen][21]
|
||||
|
||||
Configured networks are listed under **Network**, in the **Interfaces** panel.
|
||||
|
||||
![Device list][23]
|
||||
|
||||
In order to get the functionality I want, network traffic must be routed between the LAN and the WWAN network. The routing can be configured in the **Firewall** section of the **Network** panel. I didn’t change anything here because, by default, the traffic is routed between the networks, and incoming packets (from WWAN to LAN) have to pass the firewall.
|
||||
|
||||
So all you need to know is whether an interface belongs to LAN or (W)WAN. This concept makes it relatively easy to configure, especially for beginners. You can find more information in [OpenWrt’s basic networking][25] guide.
|
||||
|
||||
### Captive portals
|
||||
|
||||
Public Wifi access points are often protected by a [captive portal][26] where you have to enter an access code or similar. Usually, such portals show up when you are first connected to the access point and try to open an arbitrary web page. This mechanism is realized by the access point's DNS server.
|
||||
|
||||
By default, OpenWrt has a security feature activated that prevents connected clients from a [DNS rebinding attack][27]. OpenWrt’s rebind protection also prevents captive portals from being forwarded to clients, so you must disable rebind protection so you can reach captive portals. This option is in the **DHCP and DNS** panel of the **Network** menu.
|
||||
|
||||
![Firewall settings][28]
|
||||
|
||||
### Try OpenWrt
|
||||
|
||||
Thanks to an upgrade to OpenWrt, I got a flexible travel router based on commodity hardware. OpenWrt makes your router fully configurable and extensible and, thanks to the well-made web GUI, it's also appropriate for beginners. There are even a few [select routers][30] that ship with OpenWrt already installed. You are also able to enhance your router's functionality with lots of [available packages][31]. For example, I’m using the [vsftp][32] FTP server to host some movies and TV series on a connected USB stick. Take a look at the [projects homepage][33], where you can find many reasons to switch to OpenWrt.
|
||||
|
||||
Image by: Stephan Avenwedde, [CC BY-SA 4.0][7]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/7/openwrt-open-source-firmware
|
||||
|
||||
作者:[Stephan Avenwedde][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/hansic99
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/lead-images/OSDC_Internet_Cables_520x292_0614_RD.png
|
||||
[2]: https://openwrt.org
|
||||
[3]: https://thekelleys.org.uk/dnsmasq/doc.html
|
||||
[4]: https://openwrt.org/docs/guide-user/luci/start
|
||||
[5]: https://opensource.com/article/20/2/lua-cheat-sheet
|
||||
[6]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_overview_c_0.png
|
||||
[7]: https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
[8]: https://openwrt.org/docs/techref/flash.layout
|
||||
[9]: https://openwrt.org/docs/guide-user/additional-software/opkg
|
||||
[10]: https://opensource.com/sites/default/files/2022-07/OpenWrt_Comparison_RaspberryPi.jpg
|
||||
[12]: https://openwrt.org/supported_devices
|
||||
[13]: https://openwrt.org/toh/start
|
||||
[14]: https://openwrt.org/toh/tp-link/tl-wr902ac_v3
|
||||
[15]: https://fedoraproject.org/wiki/Networking/CLI
|
||||
[16]: http://openwrt/
|
||||
[17]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_login_manager.png
|
||||
[19]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_wireless_section_c.webp
|
||||
[21]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_wifi_device_configuration.webp
|
||||
[23]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_network_devices_0.webp
|
||||
[25]: https://openwrt.org/docs/guide-user/base-system/basic-networking
|
||||
[26]: https://en.wikipedia.org/wiki/Captive_portal
|
||||
[27]: https://en.wikipedia.org/wiki/DNS_rebinding
|
||||
[28]: https://opensource.com/sites/default/files/2022-07/openwrt_luci_firewall_settings.webp
|
||||
[30]: https://opensource.com/article/22/1/turris-omnia-open-source-router
|
||||
[31]: https://openwrt.org/packages/table/start
|
||||
[32]: https://openwrt.org/docs/guide-user/services/nas/ftp.overview
|
||||
[33]: https://openwrt.org/reasons_to_use_openwrt
|
@ -1,295 +0,0 @@
|
||||
[#]: subject: "How to Install CRI-O (Container Runtime) on Ubuntu 22.04"
|
||||
[#]: via: "https://www.linuxtechi.com/install-crio-container-runtime-on-ubuntu/"
|
||||
[#]: author: "James Kiarie https://www.linuxtechi.com/author/james/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Install CRI-O (Container Runtime) on Ubuntu 22.04
|
||||
======
|
||||
|
||||
CRI-O is an opensource and lightweight container runtime for Kubernetes. It is an implementation of the Kubernetes Container Runtime Interface (CRI) using Open Container Initiative (OCI) compatible runtimes. It’s a perfect alternative to Docker when running Kubernetes.
|
||||
|
||||
In this guide, we will demonstrate how to install CRI-O on Ubuntu 22.04 LTS step by step.
|
||||
|
||||
##### Prerequisites
|
||||
|
||||
Before you start out, here is what you need:
|
||||
|
||||
- An instance of Ubuntu 22.04 with SSH access
|
||||
- A sudo user configured on the instance
|
||||
- Fast and stable internet connectivity
|
||||
|
||||
With that out of the way, let us get started out.
|
||||
|
||||
### Step 1: Update the system and Install dependencies
|
||||
|
||||
Right off the bat, log into your server instance and update the package lists as follows.
|
||||
|
||||
```
|
||||
$ sudo apt update
|
||||
```
|
||||
|
||||
Once the local package index has been updated, install the dependencies as follows.
|
||||
|
||||
```
|
||||
$ sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y
|
||||
```
|
||||
|
||||
### Step 2: Add CRI-O repository
|
||||
|
||||
To install CRI-O, we need to add or enable its repository on Ubuntu. But first, you need to define the variables based on the operating systems and the CRI-O version that you want to install.
|
||||
|
||||
As such, define the variables as shown below.
|
||||
|
||||
```
|
||||
$ export OS=xUbuntu_22.04
|
||||
$ export CRIO_VERSION=1.24
|
||||
```
|
||||
|
||||
Once that is done, run the following set of commands to add the CRI-O Kubic repository.
|
||||
|
||||
```
|
||||
$ echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /"| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
||||
$ echo "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$CRIO_VERSION/$OS/ /"|sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$CRIO_VERSION.list
|
||||
```
|
||||
|
||||
Thereafter, import the GPG key for the CRI-O repository
|
||||
|
||||
```
|
||||
$ curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$CRIO_VERSION/$OS/Release.key | sudo apt-key add -
|
||||
$ curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | sudo apt-key add -
|
||||
```
|
||||
|
||||
This yields the following output as shown below.
|
||||
|
||||
Once again update the package index to synchronize the system with the newly added CRI-O Kubic repositories.
|
||||
|
||||
```
|
||||
$ sudo apt update
|
||||
```
|
||||
|
||||
### Step 3: Install CRI-O On Ubuntu 22.04
|
||||
|
||||
With the repositories added, install CRI-O and the runtime client using the APT package manager.
|
||||
|
||||
```
|
||||
$ sudo apt install cri-o cri-o-runc -y
|
||||
```
|
||||
|
||||
Once installed, start and enable the CRI-O daemon.
|
||||
|
||||
```
|
||||
$ sudo systemctl start crio
|
||||
$ sudo systemctl enable crio
|
||||
```
|
||||
|
||||
Next, verify if the CRI-O service is running:
|
||||
|
||||
```
|
||||
$ sudo systemctl status crio
|
||||
```
|
||||
|
||||
You should get the following output which shows that the CRI-O service is running as expected.
|
||||
|
||||
### Step 4: Install CNI Plugins For CRI-O
|
||||
|
||||
Next, you need to install the CNI (Container Network Interface) as well as the CNI plugins. Keep in mind that the loopback and bridge configurations are enabled and sufficient for running pods using CRI-O.
|
||||
|
||||
Therefore, to install the CNI plugins, run the following command.
|
||||
|
||||
```
|
||||
$ sudo apt install containernetworking-plugins -y
|
||||
```
|
||||
|
||||
Once installed, edit the CRI-O configuration file
|
||||
|
||||
```
|
||||
$ sudo nano /etc/crio/crio.conf
|
||||
```
|
||||
|
||||
Uncomment network_dir & plugin_dirs section and also add ‘/usr/lib/cni/’ under plugin_dirs section.
|
||||
|
||||
Save the changes and exit the configuration file.
|
||||
|
||||
Next, restart the CRIO service.
|
||||
|
||||
```
|
||||
$ sudo systemctl restart crio
|
||||
```
|
||||
|
||||
### Step 5: Install CRI-O tools
|
||||
|
||||
In addition, you also need to install the cri-tools package which provides the crictl command-line utility which is used for interacting and managing containers and pods.
|
||||
|
||||
To do so, run the command:
|
||||
|
||||
```
|
||||
$ sudo apt install -y cri-tools
|
||||
```
|
||||
|
||||
Once installed, confirm the version of crictl and RunTimeVersion as follows.
|
||||
|
||||
```
|
||||
$ sudo crictl --runtime-endpoint unix:///var/run/crio/crio.sock version
|
||||
```
|
||||
|
||||
Be sure to also check if CRI-O is ready to deploy pods using the following command:
|
||||
|
||||
```
|
||||
$ sudo crictl info
|
||||
```
|
||||
|
||||
The crictl command provides an autocompletion feature that lets you autocomplete commands by pressing the TAB key. To enable command completion run the following command.
|
||||
|
||||
```
|
||||
$ sudo su -
|
||||
|
||||
# crictl completion > /etc/bash_completion.d/crictl
|
||||
```
|
||||
|
||||
Then reload the current bash session.
|
||||
|
||||
```
|
||||
# source ~/.bashrc
|
||||
```
|
||||
|
||||
To use the auto-completion feature, you will need to log out or start a new terminal session. Then simply type the crictl command and press the TABkey to view all the options.
|
||||
|
||||
```
|
||||
$ crictl
|
||||
```
|
||||
|
||||
### Step 6: Create a Pod using crictl utility
|
||||
|
||||
Up to this point, CRI-O is fully installed and configured and ready to spin up a pod. In this section, we will create an Apache web server inside a pod and confirm if it is serving requests.
|
||||
|
||||
First, we are going to set up a pod sandbox or an isolated environment using a pod configuration file as follows.
|
||||
|
||||
```
|
||||
$ sudo nano apache_sandbox.json
|
||||
```
|
||||
|
||||
We will then add the following configuration to the file.
|
||||
|
||||
```
|
||||
{
|
||||
"metadata": {
|
||||
"name": "apache-sandbox",
|
||||
"namespace": "default",
|
||||
"attempt": 1,
|
||||
"uid": "hdishd83djaidwnduwk28bcsb"
|
||||
},
|
||||
"linux": {
|
||||
},
|
||||
"log_directory": "/tmp"
|
||||
}
|
||||
```
|
||||
|
||||
Save and exit. Next create the pod using the following command. This prints out long alphanumeric number which is the pod ID.
|
||||
|
||||
```
|
||||
$ sudo crictl runp apache_sandbox.json
|
||||
```
|
||||
|
||||
To confirm that the pod has been created, run the command.
|
||||
|
||||
```
|
||||
$ sudo crictl pods
|
||||
```
|
||||
|
||||
To retrieve more information about the created pod, run the command:
|
||||
|
||||
```
|
||||
$ sudo crictl inspectp --output table 05ba2f0704f22
|
||||
```
|
||||
|
||||
This prints out the ID, Name, UID, Namespace, date of creation, internal pod IP among other details.
|
||||
|
||||
### Step 7: Create a container inside a pod
|
||||
|
||||
In section we are going to create an Apache web server container inside the pod. So, use the crictl utility to pull an Apache web server image from Docker Hub.
|
||||
|
||||
```
|
||||
$ sudo crictl pull httpd
|
||||
```
|
||||
|
||||
You can verify the image pulled as shown.
|
||||
|
||||
```
|
||||
$ sudo crictl images
|
||||
```
|
||||
|
||||
Next, we are going to define a container configuration file for the Apache web server.
|
||||
|
||||
```
|
||||
$ sudo nano container_apache.json
|
||||
```
|
||||
|
||||
Copy and paste the following code.
|
||||
|
||||
```
|
||||
{
|
||||
"metadata": {
|
||||
"name": "apache"
|
||||
},
|
||||
"image":{
|
||||
"image": "httpd"
|
||||
},
|
||||
"log_path":"apache.0.log",
|
||||
"linux": {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Save and exit the configuration file.
|
||||
|
||||
Finally, to attach the container to the sand box pod created earlier, run the command:
|
||||
|
||||
```
|
||||
$ sudo crictl create 05ba2f0704f22 container_apache.json apache_sandbox.json
|
||||
```
|
||||
|
||||
This outputs a large alphanumeric ID to the terminal.. Take note of this ID.
|
||||
|
||||
Finally, use the ID to start the Apache web server container as follows.
|
||||
|
||||
```
|
||||
$ sudo crictl start 37f4d26510965452aa918f04d629f5332a1cd398d4912298c796942e22f964a7
|
||||
```
|
||||
|
||||
To check the container status, run the command:
|
||||
|
||||
```
|
||||
$ sudo crictl ps
|
||||
```
|
||||
|
||||
To verify that the Apache web server is running, send a HTTP request to the web server using the curl command and the pod’s internal ID.
|
||||
|
||||
```
|
||||
$ curl -I 10.85.0.2
|
||||
```
|
||||
|
||||
The following output confirms that the web server is running.
|
||||
|
||||
##### Conclusion
|
||||
|
||||
That’s all from this, guide. We have successfully installed CRI-O on Ubuntu 22.04 and gone ahead to create a pod and container. Your comments and feedback are welcome.
|
||||
|
||||
Also Read: How to Install Docker on Ubuntu 22.04 / 20.04 LTS
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/install-crio-container-runtime-on-ubuntu/
|
||||
|
||||
作者:[James Kiarie][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linuxtechi.com/author/james/
|
||||
[b]: https://github.com/lkxed/
|
@ -1,285 +0,0 @@
|
||||
[#]: subject: "NixOS Series #5: How to set up home-manager on NixOS?"
|
||||
[#]: via: "https://itsfoss.com/home-manager-nixos/"
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
NixOS Series #5: How to set up home-manager on NixOS?
|
||||
======
|
||||
|
||||
Before publishing this, I explained how to [install and remove packages in NixOS][1] for a single-user system.
|
||||
|
||||
But if you are running multiple users, there is an excellent way to cater needs of every user separately.
|
||||
|
||||
And in this guide, I will walk you through how you can set up a home manager on NixOS and how it can be used to install packages.
|
||||
|
||||
If you are new here, some resources discussed in this series include:
|
||||
|
||||
- [Reasons to use nixOS][2]
|
||||
- [Installing NixOS on a virtual machine][3]
|
||||
- [Things to do after installing NixOS][4]
|
||||
|
||||
### Setup home-manager on NixOS
|
||||
|
||||
In this guide, I will walk you through 2 ways to set up a home manager:
|
||||
|
||||
- Standalone home manager (uses separate config file)
|
||||
- As a nix module (using it inside `configuration.nix` file)
|
||||
|
||||
So let's start with the standalone option.
|
||||
|
||||
#### Standalone installation of home-manager
|
||||
|
||||
If you are using a stable channel of NixOS, you can use the following command to configure the home manager:
|
||||
|
||||
```
|
||||
nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager
|
||||
```
|
||||
|
||||
While writing this guide, the stable release is `22.11`.
|
||||
|
||||
And **if you are on an unstable channel**, use the following:
|
||||
|
||||
```
|
||||
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
```
|
||||
|
||||
The following steps will remain the same whether you use stable or unstable.
|
||||
|
||||
Once done, update the channels:
|
||||
|
||||
```
|
||||
nix-channel --update
|
||||
```
|
||||
|
||||
And finally, use the following command to install the home manager:
|
||||
|
||||
```
|
||||
nix-shell '<home-manager>' -A install
|
||||
```
|
||||
|
||||
🛠️ While installing, it may throw the following error:
|
||||
|
||||
![building error while installing home manager][5]
|
||||
|
||||
Reboot your system and use the installation command again, and it will start the installation.
|
||||
|
||||
Once done, it will show the location of the standalone installation of the home manager:
|
||||
|
||||
![location of home manager in NixOS][6]
|
||||
|
||||
#### Installing home-manager as a NixOS module
|
||||
|
||||
⚠️
|
||||
|
||||
You will need sudo privileges if you choose to use the home manager as a NixOS module.
|
||||
|
||||
If you are on a stable channel (while writing, it is 22.11), you can use the following command to add the stable channel of the home manager:
|
||||
|
||||
```
|
||||
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager
|
||||
```
|
||||
|
||||
And **if you are using unstable or the master channel**, use the following:
|
||||
|
||||
```
|
||||
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
```
|
||||
|
||||
Once you are done adding a channel by using any of one command shown above, update the channel using the following:
|
||||
|
||||
```
|
||||
sudo nix-channel --update
|
||||
```
|
||||
|
||||
Next, open the `configuration.nix` file using:
|
||||
|
||||
```
|
||||
sudo nano /etc/nixos/configuration.nix
|
||||
```
|
||||
|
||||
And add the following line inside the `imports []`:
|
||||
|
||||
```
|
||||
<home-manager/nixos>
|
||||
```
|
||||
|
||||
![install home-manager as NixOS module][7]
|
||||
|
||||
Now, jump to the end of the line and add the following before `}`:
|
||||
|
||||
```
|
||||
home-manager.users.{username} = { pkgs, ... }: {
|
||||
home.packages = [ ];
|
||||
};
|
||||
```
|
||||
|
||||
![syantax for home-manager module in NixOS config file][8]
|
||||
|
||||
The above line was added to facilitate installing and removing packages I will show you next.
|
||||
|
||||
Now, [save changes and exit from the nano][9] text editor.
|
||||
|
||||
Next, rebuild the config and make a switch:
|
||||
|
||||
```
|
||||
sudo nixos-rebuild switch
|
||||
```
|
||||
|
||||
But if you are using stable release and use the above command, it will throw the error saying :
|
||||
|
||||
🛠️ **error: The option `home-manager.users.user.home.stateVersion' is used but not defined:**
|
||||
|
||||
![error: The option `home-manager.users.user.home.stateVersion' is used but not defined.][10]
|
||||
|
||||
To solve this issue, you will have to add the `home.stateVersion` in your home manager block.
|
||||
|
||||
While writing, I'm running 22.11, so the whole home manager block would look like this:
|
||||
|
||||
```
|
||||
home-manager.users.{username} = { pkgs, ... }: {
|
||||
home.stateVersion = "22.11";
|
||||
home.packages = [ ];
|
||||
};
|
||||
```
|
||||
|
||||
![how to solve The option `home-manager.users.user.home.stateVersion' is used but not defined.][11]
|
||||
|
||||
Save changes and exit from the nano text editor by pressing `Ctrl + O`, hitting enter and `Ctrl + X`.
|
||||
|
||||
Now, try to rebuild the config and make the switch again, and that should solve the issue.
|
||||
|
||||
### How to install packages using home-manager on NixOS
|
||||
|
||||
Now that you have home-manager installed, how to install packages with it:
|
||||
|
||||
#### Using a standalone install of Home-manager
|
||||
|
||||
First, open the configuration file by using the following:
|
||||
|
||||
```
|
||||
nano /home/$USER/.config/nixpkgs/home.nix
|
||||
```
|
||||
|
||||
Jump to the end of the line and add the following code block before `}`:
|
||||
|
||||
```
|
||||
home.packages = [];
|
||||
```
|
||||
|
||||
Now, all you have to do is write the package's name between those two braces.
|
||||
|
||||
For example, if I want to install **htop**, I will have to enter the following:
|
||||
|
||||
```
|
||||
home.packages = [pkgs.htop];
|
||||
```
|
||||
|
||||
Yes, you will have to usually append the name of the package with `pkgs.`
|
||||
|
||||
But if you want to get away with using `pkgs.` using every time you install a new package, change the syntax of the code block as shown:
|
||||
|
||||
```
|
||||
home.packages = with pkgs; [];
|
||||
```
|
||||
|
||||
And now, you are no longer required to use `pkgs.` for every installation:
|
||||
|
||||
```
|
||||
home.packages = with pkgs; [htop];
|
||||
```
|
||||
|
||||
For example, here, I wanted to install **htop, firefox, and LibreOffice** so my home block would look like this:
|
||||
|
||||
![install multiple packages using home-manager on NixOS][12]
|
||||
|
||||
Once you are done adding your favorite packages, save the config file and use the following command to install packages:
|
||||
|
||||
```
|
||||
home-manager switch
|
||||
```
|
||||
|
||||
#### Using the NixOS module
|
||||
|
||||
First, open the `configuration.nix` file using the following command:
|
||||
|
||||
```
|
||||
sudo nano /etc/nixos/configuration.nix
|
||||
```
|
||||
|
||||
In the configuration part, I've already added the home manager block, so all it is left is to add the name of the package inside `home.packages = [ ];` in the shown format:
|
||||
|
||||
```
|
||||
home.packages = [ pkgs.package_name ];
|
||||
```
|
||||
|
||||
💡
|
||||
|
||||
I've mentioned how you can get away with using
|
||||
|
||||
```
|
||||
pkgs.
|
||||
```
|
||||
|
||||
before the package name in the above section (installing packages on the standalone home manager).
|
||||
|
||||
For example, if I want to [install htop][13], Firefox, and LibreOffice, then I will add:
|
||||
|
||||
```
|
||||
pkgs.htop pkgs.firefox pkgs.libreoffice
|
||||
```
|
||||
|
||||
And my home manager block would look like this:
|
||||
|
||||
![install multiple packages in home-manager as a NixOS module][14]
|
||||
|
||||
Now, save changes and exit from the text editor.
|
||||
|
||||
Next, rebuild the config and make a switch using the following command:
|
||||
|
||||
```
|
||||
sudo nixos-rebuild switch
|
||||
```
|
||||
|
||||
That's it! The packages will be installed in no time.
|
||||
|
||||
### 'Tis the end
|
||||
|
||||
I think you should go with the standalone installation, as you are not required to use the superuser privileges. Also, having separate config files for separate users is quite convenient if you run a system with multiple users.
|
||||
|
||||
So unless you want one file for every purpose, I see no other reason to use the module option.
|
||||
|
||||
With this, I conclude the NixOS beginner series. I hope it gets you a good enough platform to get familiar with this unique Linux distribution.
|
||||
|
||||
💬 _How did you like the NixOS series? Is there something else we should cover for NixOS beginners? Please provide your valuable feedback._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/home-manager-nixos/
|
||||
|
||||
作者:[Sagar Sharma][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sagar/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://itsfoss.com/nixos-package-management/
|
||||
[2]: https://itsfoss.com/why-use-nixos/
|
||||
[3]: https://itsfoss.com/install-nixos-vm/
|
||||
[4]: https://itsfoss.com/things-to-do-after-installing-nixos/
|
||||
[5]: https://itsfoss.com/content/images/2023/02/building-error-while-installing-home-manager.png
|
||||
[6]: https://itsfoss.com/content/images/2023/02/location-of-home-manager-in-NixOS.png
|
||||
[7]: https://itsfoss.com/content/images/2023/02/install-home-manager-as-NixOS-module.png
|
||||
[8]: https://itsfoss.com/content/images/2023/02/syantax-for-home-manager-module-in-NixOS-config-file.png
|
||||
[9]: https://linuxhandbook.com/nano-save-exit/?ref=itsfoss.com
|
||||
[10]: https://itsfoss.com/content/images/2023/02/The-option--home-manager.users.user.home.stateVersion--is-used-but-not-defined..png
|
||||
[11]: https://itsfoss.com/content/images/2023/02/how-to-solve-The-option--home-manager.users.user.home.stateVersion--is-used-but-not-defined..png
|
||||
[12]: https://itsfoss.com/content/images/2023/02/install-multiple-packages-using-home-manager-on-NixOS.png
|
||||
[13]: https://itsfoss.com/use-htop/
|
||||
[14]: https://itsfoss.com/content/images/2023/02/install-multiple-packages-in-home-manager-as-a-NixOS-module.png
|
@ -1,102 +0,0 @@
|
||||
[#]: subject: "3 surprising things Linux sysadmins can do with systemd"
|
||||
[#]: via: "https://opensource.com/article/23/3/3-things-you-didnt-know-systemd-could-do"
|
||||
[#]: author: "Alan Smithee https://opensource.com/users/alansmithee"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
3 surprising things Linux sysadmins can do with systemd
|
||||
======
|
||||
|
||||
When it first started out, there was a lot of press about systemd and its ability to speed up boot time. That feature had a mostly-universal appeal (it's less important to those who don't reboot), so in many ways, that's the reputation it still has today. And while it's true that systemd is the thing that launches services in parallel during startup, there's a lot more to it than that. Here are three things you may not have realized systemd could do but should be taking advantage. Get more tips from our new downloadable eBook, **[A pragmatic guide to systemd][1]**.
|
||||
|
||||
### 1. Simplify Linux ps
|
||||
|
||||
If you've ever used the `ps` or even just the `top` command, then you know that your computer is running hundreds of processes at any given moment. Sometimes, that's exactly the kind of information you need in order to understand what your computer, or its users, are up to. Other times, all you really need is a general overview.
|
||||
|
||||
The `systemd-cgtop` command provides a simple view of your computer's load based on the cgroups (control groups) tasks have been arranged into. [Control groups][2] are important to modern Linux, and are essentially the support structures underneath containers and Kubernetes (which in turn are why the cloud scales the way it does), but also they're useful constructs on your home PC. For instance, from the output of `systemd-cgtop`, you can see the load of your user processes as opposed to system processes:
|
||||
|
||||
```
|
||||
Control Group Proc+ %CPU Memory Input/s Output/s
|
||||
/ 183 5.0 1.6G 0B 3.0M
|
||||
user.slice 4 2.8 1.1G 0B 174.7K
|
||||
user.slice/user-1000.slice 4 2.8 968.2M 0B 174.7K
|
||||
system.slice 65 2.2 1.5G 0B 2.8M
|
||||
```
|
||||
|
||||
You can also view just your userspace processes, or just your userspace processes and kernel threads.
|
||||
|
||||
This isn't a replacement for `top` or `ps` by any means, but it's an additional view into your system from a different and unique angle. And it can be vital when running containers, because containers use cgroups.
|
||||
|
||||
### 2. Linux cron
|
||||
|
||||
[Cron][3] is a classic component of Linux. When you want to schedule something to happen on a regular basis, you use cron. It's reliable and pretty well integrated into your system.
|
||||
|
||||
The problem is, cron doesn't understand that some computers get shut down. If you have a cronjob scheduled for midnight, but you turn your computer off at 23:59 every day, then your cronjob never runs. There's no facility for cron to detect that there was a missed job overnight.
|
||||
|
||||
As an answer to that problem, there's the excellent [anacron][4], but that's not quite as integrated as cron. There's a lot of setup you have to do to get anacron running.
|
||||
|
||||
A second alternative is systemd timers. Like cron, it's already built in and ready to go. You have to write a unit file, which is definitely more lines than a one-line crontab entry, but it's also pretty simple. For instance, here's a unit file to run an imaginary backup script 30 minutes after startup, but only once a day. This ensures that my computer gets backed up, and prevents it from trying to backup more than once daily.
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Backup
|
||||
Requires=myBackup.service
|
||||
|
||||
[Timer]
|
||||
OnBootSec=30min
|
||||
OnUnitActiveSec=1d
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
```
|
||||
|
||||
You can, of course, intervene and prompt a job to run with . Thanks to the `OnUnitActiveSec` directive, systemd doesn't attempt to run a job you've manually activated.
|
||||
|
||||
### 3. Run Linux containers
|
||||
|
||||
Containers make starting up a complex service really easy. You can run a [Mattermost][5] or Discourse server in mere minutes. The hard part, in some cases, is managing and monitoring the containers once you have them running. Podman makes it easy to manage them, but what do use to manage Podman? Well, [you can use systemd][6].
|
||||
|
||||
Podman has a built-in command to generate unit files so your containers can be managed and monitored by systemd:
|
||||
|
||||
```
|
||||
$ podman generate systemd --new --files --name example_pod
|
||||
```
|
||||
|
||||
All you have to do then is start the service:
|
||||
|
||||
```
|
||||
$ systemctl --user start pod-example_pod.service
|
||||
```
|
||||
|
||||
As with any other service on your computer, systemd ensures that your pod runs no matter what. It logs problems, which you can view with `journalctl` along with your other essential logs, and you can monitor its activity within cgroups using `systemd-cgtop`.
|
||||
|
||||
It's no [Kubernetes platform][7], but for one or two containers that you just want to have available on a reliable and predictable basis, Podman and systemd are an amazing pair.
|
||||
|
||||
### Download the systemd eBook
|
||||
|
||||
There's a lot more to systemd, and you can learn the basics, along with lots of useful and pragmatic tips, from author [David Both][8] in his new complimentary **[pragmatic guide to systemd][1]**.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/3/3-things-you-didnt-know-systemd-could-do
|
||||
|
||||
作者:[Alan Smithee][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/alansmithee
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://opensource.com/downloads/pragmatic-guide-systemd-linux
|
||||
[2]: https://www.redhat.com/sysadmin/cgroups-part-four?intcmp=7013a000002qLH8AAM
|
||||
[3]: https://opensource.com/article/17/11/how-use-cron-linux
|
||||
[4]: https://opensource.com/article/21/2/linux-automation
|
||||
[5]: https://opensource.com/education/16/3/mattermost-open-source-chat
|
||||
[6]: https://www.redhat.com/sysadmin/podman-run-pods-systemd-services?intcmp=7013a000002qLH8AAM
|
||||
[7]: https://www.redhat.com/en/technologies/cloud-computing/openshift/aws?intcmp=7013a000002qLH8AAM
|
||||
[8]: https://opensource.com/users/dboth
|
@ -1,61 +0,0 @@
|
||||
[#]: subject: "Open source tools for mind mapping"
|
||||
[#]: via: "https://opensource.com/article/23/3/open-source-mind-mapping"
|
||||
[#]: author: "Amrita https://opensource.com/users/amrita42"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Open source tools for mind mapping
|
||||
======
|
||||
|
||||
In today's world and social media, many people don't have the patience to read lengthy textual content. Visuals are a great way to capture your audience's attention span.
|
||||
|
||||
Did you know that research at 3M Corporation concluded that visuals are processed 60,000 times faster than text? Visuals are more impactful than words and enhance creative thinking and memory.
|
||||
|
||||
### A picture is worth a thousand words
|
||||
|
||||
I looked at some of the common [Git commands][1]. I used Git commands as the main topic; each sub-topic is a Git command syntax with a definition. For this, I used Wisemapping.
|
||||
|
||||
![A git command mind map][2]
|
||||
|
||||
Whether you knew what a [mind map][3] was before or not, now that you've seen a mind map, you can now understand the concept.. That's the power of visuals.
|
||||
|
||||
### How do you create a mind map?
|
||||
|
||||
- Start with the main topic and place it in the middle of your drawing board.
|
||||
- Create sub-topics and link them to the main topic.
|
||||
- You can add details to each sub-topic, such as definitions, examples, etc.
|
||||
|
||||
### 3 open source tools you can use to create a mind map
|
||||
|
||||
Take a look at these three open source tools to create a visual of your idea:
|
||||
|
||||
- [Wisemapping][4]
|
||||
- [Freeplane][5]
|
||||
- [Semantik][6]
|
||||
|
||||
Wikipedia defines a mind map as a diagram to visually organize information into a hierarchy, showing relationships among pieces of the whole. Mind mapping starts with a central theme and then builds relations. It is a visual way to structure thoughts and create impactful presentations.
|
||||
|
||||
You can use mind maps in your work. For example, I used a mind map to show a high-level overview of features planned for a project. With these excellent open source mind mapping applications, it's easy to get started visualizing your next project. Try mapping your mind with open source.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/3/open-source-mind-mapping
|
||||
|
||||
作者:[Amrita][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/amrita42
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://opensource.com/downloads/cheat-sheet-git
|
||||
[2]: https://opensource.com/sites/default/files/2023-03/mindmap.jpg
|
||||
[3]: https://opensource.com/article/21/12/open-source-mind-mapping-drawio
|
||||
[4]: https://www.wisemapping.com/
|
||||
[5]: https://opensource.com/article/19/1/productivity-tool-freeplane
|
||||
[6]: https://waf.io/semantik.html
|
@ -1,150 +0,0 @@
|
||||
[#]: subject: "How to Install and Use Neovim on Ubuntu and other Linux Distributions"
|
||||
[#]: via: "https://itsfoss.com/install-neovim/"
|
||||
[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Install and Use Neovim on Ubuntu and other Linux Distributions
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
You must have heard about the famous Vim text editor already. However, this article is about its fork, Neovim.
|
||||
|
||||
Vim is also a fork of vi which makes Neovim fork of a fork. So, you can end up using anything for some of its unique traits.
|
||||
|
||||
If you decide to use Neovim, let me help you get started with it on Ubuntu and other Linux distributions.
|
||||
|
||||
### Neovim: Overview
|
||||
|
||||
![][2]
|
||||
|
||||
[Neovim][3] is a project known for its simple maintenance and community contributions. Moreover, the development effort is distributed well between multiple developers.
|
||||
|
||||
For end-users, Neovim is much more extensible than one would expect. The aim of Neovim is to provide better applications of it without compromising the traditional capabilities of Vim.
|
||||
|
||||
With a [GUI for Neovim,][4] you can get an enhanced editing experience.
|
||||
|
||||
### Features of Neovim
|
||||
|
||||
While you can explore all about it on its official website and its [GitHub page][5]. Let me highlight some features:
|
||||
|
||||
- Modern Graphical Interfaces
|
||||
- API access from many language including (C/C++, C#, Go, Haskell, Java/Kotlin, JavaScript/Node.js, Lua, Perl, Python, Ruby, Rust to name a few)
|
||||
- Embedded, scriptable terminal emulator
|
||||
- Asynchronous job control
|
||||
- Shared data among multiple instances
|
||||
- XDG base directories support
|
||||
- Compatible with most Vim plugins, including Ruby and Python plugins
|
||||
|
||||
💡
|
||||
|
||||
We advise you to learn the usage of Vim and Neovim before you start using it.
|
||||
|
||||
### Installing Neovim on Ubuntu and Linux
|
||||
|
||||
Installing Neovim is simple due to its popularity. As Neovim is available in official repos of any distribution you pick.
|
||||
|
||||
We also have a guide to [install Vim on Linux][6], in case you want that.
|
||||
|
||||
To install Neovim on Ubuntu, just click on the Ubuntu Software icon in the dock. Then, search for Neovim. You can select the snap or the deb version as per your preference. However, the deb package version will be an outdated version of Neovim.
|
||||
|
||||
![neovim listed on ubuntu software center][7]
|
||||
|
||||
And, if you do not want the snap version, you can grab the latest deb file from the [Github releases page for Neovim][8]. If you look closer in the releases page, there is an Appimage file as well.
|
||||
|
||||
If you want to utilize the terminal instead of the GUI, here's what you can do:
|
||||
|
||||
For **Ubuntu and Debian** based distributions, enter the following command to install
|
||||
|
||||
```
|
||||
sudo apt install neovim
|
||||
```
|
||||
|
||||
For **Manjaro and Arch Linux**, use the below command to update your system and install Neovim
|
||||
|
||||
```
|
||||
sudo pacman -Syu neovim
|
||||
```
|
||||
|
||||
For **Fedora**, use the following command
|
||||
|
||||
```
|
||||
sudo dnf install -y neovim
|
||||
```
|
||||
|
||||
To install the **Flatpak**, you can use this command
|
||||
|
||||
```
|
||||
flatpak install flathub io.neovim.nvim
|
||||
```
|
||||
|
||||
Lastly, to install the **snap package** use the below command
|
||||
|
||||
```
|
||||
sudo snap install nvim --classic
|
||||
```
|
||||
|
||||
If you prefer building software from source, follow [the steps given on the project's Github page][9].
|
||||
|
||||
### How to use Neovim
|
||||
|
||||
To use Neovim after installation is complete, just launch it from the application menu by pressing the super key and typing the name "neovim" without quotes. This will open a terminal window with Neovim open.
|
||||
|
||||
![][10]
|
||||
|
||||
Or you can just open any Terminal Emulator of your choice and enter the following command
|
||||
|
||||
```
|
||||
nvim
|
||||
```
|
||||
|
||||
Yes, not "neovim" but just "**nvim**". For example, to edit _/etc/fstab_ enter the following command.
|
||||
|
||||
```
|
||||
sudo nvim /etc/fstab
|
||||
```
|
||||
|
||||
Now the fstab file will open as shown in the screenshot below.
|
||||
|
||||
![][11]
|
||||
|
||||
Don't worry if you cannot exit the editor; press **Shift+Z+Z**. For example, if this shortcut key confuses, use the keys you need to type "ZZ" (uppercase) without quotes in any text editor.
|
||||
|
||||
On that note, I should re-iterate that you need to learn Vim or Neovim and go through the documentation to efficiently make use of all its features.
|
||||
|
||||
### Conclusion
|
||||
|
||||
Installing and launching Neovim is pretty straightforward but learning it will require some keyboard grinding for sure.
|
||||
|
||||
This was just an overview of the editor. I am not an expert on this, but I hope this serves well for all the beginners out there!
|
||||
|
||||
💬 _Do you use Neovim? Share your experience on it in the comments below._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-neovim/
|
||||
|
||||
作者:[Anuj Sharma][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/anuj/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://itsfoss.com/content/images/2023/03/linux-mega-packt.webp
|
||||
[2]: https://itsfoss.com/content/images/2023/03/goneovim.png
|
||||
[3]: https://neovim.io/?ref=itsfoss.com
|
||||
[4]: https://itsfoss.com/neovim-gui-editors/
|
||||
[5]: https://github.com/neovim/neovim?ref=itsfoss.com
|
||||
[6]: https://itsfoss.com/install-latest-vim-ubuntu/
|
||||
[7]: https://itsfoss.com/content/images/2023/01/software-center-neovim-snap.png
|
||||
[8]: https://github.com/neovim/neovim/releases/tag/stable?ref=itsfoss.com
|
||||
[9]: https://github.com/neovim/neovim/wiki/Installing-Neovim?ref=itsfoss.com#install-from-source
|
||||
[10]: https://itsfoss.com/content/images/2023/01/neovim-default-screen.png
|
||||
[11]: https://itsfoss.com/content/images/2023/01/neovim-fstab.png
|
@ -1,114 +0,0 @@
|
||||
[#]: subject: "How to Install Kubernetes (K8s) Metrics Server Step by Step"
|
||||
[#]: via: "https://www.linuxtechi.com/how-to-install-kubernetes-metrics-server/"
|
||||
[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Install Kubernetes (K8s) Metrics Server Step by Step
|
||||
======
|
||||
|
||||
In this post, we will cover to how to install Kubernetes metrics server step by step.
|
||||
|
||||
The Kubernetes(k8s) Metrics Server is a component that collects and aggregates metrics data from various sources in the Kubernetes cluster, including nodes and pods. This data can be used to monitor and optimize resource utilization, identify potential issues, and improve the overall performance of your Kubernetes cluster.
|
||||
|
||||
Metrics Server collects resource utilization data such as CPU and memory usage for nodes and pods in the cluster. It provides an API endpoint that can be used to query this data and retrieve metrics for specific resources in the cluster.
|
||||
|
||||
##### Prerequisites
|
||||
|
||||
- A Kubernetes cluster (v1.21 or high) up and running.
|
||||
- kubectl command line tool installed and configured to interact to your Kubernetes cluster.
|
||||
- The ability to create and modify Kubernetes objects.
|
||||
|
||||
Without any further delay, let’s deep dive into the installation steps.
|
||||
|
||||
### Step 1) Download Metrics Server Manifest
|
||||
|
||||
The first step is to download the latest Metrics Server manifest file from the Kubernetes GitHub repository. Use below curl command to download yaml file,
|
||||
|
||||
```
|
||||
# curl -LO https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
|
||||
```
|
||||
|
||||
If you are planning to install metrics server in high availability mode then download following manifest file.
|
||||
|
||||
```
|
||||
# curl https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/high-availability-1.21+.yaml
|
||||
```
|
||||
|
||||
### Step 2) Modify Metrics Server Yaml File
|
||||
|
||||
Next, you need to modify the Metrics Server yaml file to set some configuration options,
|
||||
|
||||
```
|
||||
# vi components.yaml
|
||||
```
|
||||
|
||||
Find the args section under the container section, add the following line:
|
||||
|
||||
```
|
||||
- --kubelet-insecure-tls
|
||||
```
|
||||
|
||||
Under the spec section, add following parameter,
|
||||
|
||||
```
|
||||
hostNetwork: true
|
||||
```
|
||||
|
||||
Save and close the file.
|
||||
|
||||
### Step 3) Deploy Metrics Server
|
||||
|
||||
Now, we are all set to deploy metrics server, run following kubectl command,
|
||||
|
||||
```
|
||||
# kubectl apply -f components.yaml
|
||||
```
|
||||
|
||||
### Step 4) Verify Metrics Server Deployment
|
||||
|
||||
After deploying the Metrics Server, verify it’s status by checking the pods status which is running in the kube-system namespace,
|
||||
|
||||
```
|
||||
# kubectl get pods -n kube-system
|
||||
```
|
||||
|
||||
Output above confirms that metrics-server pod is up and running.
|
||||
|
||||
### Step 5) Test Metrics Server Installation
|
||||
|
||||
Finally, you can test the metrics server by running following kubectl command,
|
||||
|
||||
```
|
||||
# kubectl top nodes
|
||||
```
|
||||
|
||||
This command should display the resource utilization for each node in your cluster, including CPU and memory usage.
|
||||
|
||||
To view pods resource utilization of your current namespace or specific namespace, run
|
||||
|
||||
```
|
||||
# kubectl top pod
|
||||
# kubectl top pod -n kube-system
|
||||
```
|
||||
|
||||
That’s all from this post, I have hope you found it informative. Please do post your feedback and queries in below comments section.
|
||||
|
||||
Also Read: How to Install and Use Helm in Kubernetes
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/how-to-install-kubernetes-metrics-server/
|
||||
|
||||
作者:[Pradeep Kumar][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linuxtechi.com/author/pradeep/
|
||||
[b]: https://github.com/lkxed/
|
@ -1,80 +0,0 @@
|
||||
[#]: subject: "Use this open source accounting app to run your small business"
|
||||
[#]: via: "https://opensource.com/article/23/3/open-source-accounting-run-business"
|
||||
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Use this open source accounting app to run your small business
|
||||
======
|
||||
|
||||
[GnuCash][1] is a powerful and flexible accounting tool that can be used for small business invoicing and accounting. It has a number of features that make it particularly well-suited for this purpose, including the ability to track expenses and income, generate reports, and manage invoices. Additionally, GnuCash is free and open source, which makes it accessible to small businesses with limited resources. In this article, I discuss the features of GnuCash that make it easy for you to get started using it in your own small business.
|
||||
|
||||
I began using GnuCash a number of years ago for my personal finances but found it could also function as a useful tool for my small business too. I'd been using a proprietary solution for much of the life of my business. I grew tired of being forced to upgrade periodically to get access to my invoices and statements for my small business. Moving to GnuCash gave me the ability to integrate my small business accounting with my personal finances without sacrificing any features.
|
||||
|
||||
### Install GnuCash on Linux
|
||||
|
||||
You can install GnuCash from your software repository. On Debian, Elementary, and similar:
|
||||
|
||||
```
|
||||
$ sudo apt install gnucash
|
||||
```
|
||||
|
||||
On Fedora, CentOS, Mageia, and similar:
|
||||
|
||||
```
|
||||
$ sudo dnf install gnucash
|
||||
```
|
||||
|
||||
### GnuCash for business
|
||||
|
||||
GnuCash comes with an account setup wizard that can help you build a common business account configuration. To access it:
|
||||
|
||||
- Start GnuCash.
|
||||
- Click on the **File** menu and select **New File**.
|
||||
|
||||
Follow the GnuCash Assistant that appears on screen to create your new business account file.
|
||||
|
||||
The onscreen instructions guides you through the process of setting up your business. Click on **Next** in the top right corner of the **Assistant** window. You're prompted to enter a company name, address, contact information, and a company ID of your own choosing. You must also choose a default tax table and a date format.
|
||||
|
||||
The next screen prompts you to choose the currency, and there are a large number of currencies supported.
|
||||
|
||||
Then you're prompted to choose the accounts you want to create. Select the option to create **Business Accounts**. You can always customize the list of accounts, and GnuCash provides [copious documentation][2] to help you better customize it to your individual needs.
|
||||
|
||||
Complete the assistant, then click **Apply** in the top right-hand corner of the GnuCash **Assistant** window.
|
||||
|
||||
### Adding customers
|
||||
|
||||
The top menu of GnuCash has a menu item labeled **Business**. The first item on that menu is **Customers**, followed by **Customers Overview**. This is where you can view a list of all your customers.
|
||||
|
||||
The next item is **New Customer**. This is where you enter new customers. The dialog box provides a place for customer information, including billing information, shipping address, email address, telephone number, and more.
|
||||
|
||||
### Create an invoice
|
||||
|
||||
After adding a customer, you can begin the process of creating invoices. Click on the **Business** menu, select **Customer**, and then **New Invoice**.
|
||||
|
||||
Payment processing is easy too. This is located in the **Business** menu. Select **Customer**, and then **Process Payment**.
|
||||
|
||||
### You're in business
|
||||
|
||||
The **Business** menu also includes options for entering vendors and employees, should your business require that information. There's a menu item for sales tax and many other options to ensure you're compliant with local expectations.
|
||||
|
||||
With GnuCash, your data isn't stored in a proprietary format, so you can migrate to any other platform in the future if you need to. Open standards for data storage, especially when that data is a legal requirement, are important and allow you to have full possession of your business history. Using GnuCash puts you in control of your small business.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/3/open-source-accounting-run-business
|
||||
|
||||
作者:[Don Watkins][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/don-watkins
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://www.gnucash.org/
|
||||
[2]: https://www.gnucash.org/docs/v4/C/gnucash-guide/bus_setup.html
|
@ -1,133 +0,0 @@
|
||||
[#]: subject: "Create a ChatBot in Mattermost with Python"
|
||||
[#]: via: "https://opensource.com/article/23/3/chatbot-mattermost-python"
|
||||
[#]: author: "Dr. Michael J. Garbade https://opensource.com/users/drmjg"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Create a ChatBot in Mattermost with Python
|
||||
======
|
||||
|
||||
ChatOps is a collaboration model that connects people, processes, tools, and automation into a transparent workflow. [Mattermost][1] is an open source, self-hosted messaging platform that enables organizations to communicate securely, effectively, and efficiently. It's a great [open source alternative][2] to Slack, Discord, and other proprietary messaging platforms. This article outlines the steps to create a ChatOps bot on Mattermost, including the necessary code examples and explanations.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
Before starting, ensure that you have access to a Mattermost server, have [Python installed][3], and have installed the Mattermost Python driver [using pip][4].
|
||||
|
||||
### Create a bot account on Mattermost
|
||||
|
||||
To create a bot account, access the Mattermost System Console, and add a bot account with appropriate access permissions. Retrieve the bot's username and password for use in the Python script.
|
||||
|
||||
### Set up the Mattermost Python driver
|
||||
|
||||
Install the Mattermost Python driver using `pip`, and import it in the Python script. Create a new driver instance and log in to the Mattermost server.
|
||||
|
||||
### Create the ChatOps bot in Python
|
||||
|
||||
Create a new Python script, define the necessary libraries to be imported, and implement the bot's functionality using the Mattermost driver's API. Write code to handle messages, commands, and other events, and use the Mattermost driver's API methods to send messages and notifications to channels and users. Finally, debug and test the ChatOps bot.
|
||||
|
||||
### Example of ChatOps bot code
|
||||
|
||||
Here is an example Python code for a simple ChatOps bot that responds to a user's message:
|
||||
|
||||
```
|
||||
from mattermostdriver import Driver
|
||||
|
||||
bot_username = 'bot_username'
|
||||
bot_password = 'bot_password'
|
||||
server_url = 'https://your.mattermost.server.url'
|
||||
|
||||
def main():
|
||||
driver = Driver({'url': server_url, 'login_id': bot_username, 'password': bot_password, 'scheme': 'https'})
|
||||
driver.login()
|
||||
team = driver.teams.get_team_by_name('team_name')
|
||||
channel = driver.channels.get_channel_by_name(team['id'], 'channel_name')
|
||||
|
||||
@driver.on('message')
|
||||
def handle_message(post, **kwargs):
|
||||
if post['message'] == 'hello':
|
||||
driver.posts.create_post({
|
||||
'channel_id': post['channel_id'],
|
||||
'message': 'Hi there!'
|
||||
})
|
||||
|
||||
driver.init_websocket()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
```
|
||||
|
||||
### Add features
|
||||
|
||||
Once you've created a basic ChatOps bot on Mattermost, you can add more features to extend its functionality. Here are the steps:
|
||||
|
||||
- **Determine the feature you want to add**: Before writing the code, you must determine the feature to add to your ChatOps bot. This can be anything from sending notifications to integrating with third-party tools.
|
||||
- **Write the code**: Once you have determined the feature you want to add, you can start writing the code. The code will depend on the feature you add, but you can use the Mattermost Python driver to interact with the Mattermost API and implement the feature.
|
||||
- **Test the code**: After writing the code, it's important to test it to ensure that it works as expected. Before deploying it to your production server, you can test the code on a development server or in a test channel.
|
||||
- **Deploy the code**: Once you have tested it and it works as expected, you can deploy it to your production server. Follow your organization's deployment process and ensure the new code doesn't break any existing functionality.
|
||||
- **Document the new feature**: It's important to document the new feature you have added to your ChatOps bot. This will make it easier for other team members to use the bot and understand its capabilities.
|
||||
|
||||
One example of a ChatOps Bot feature could be integrating with a third-party tool and providing status updates on certain tasks.
|
||||
|
||||
```
|
||||
from mattermostdriver import Driver
|
||||
import requests
|
||||
|
||||
bot_username = 'bot_username'
|
||||
bot_password = 'bot_password'
|
||||
server_url = 'https://your.mattermost.server.url'
|
||||
|
||||
def main():
|
||||
driver = Driver({'url': server_url, 'login_id': bot_username, 'password': bot_password, 'scheme': 'https'})
|
||||
driver.login()
|
||||
team = driver.teams.get_team_by_name('team_name')
|
||||
channel = driver.channels.get_channel_by_name(team['id'], 'channel_name')
|
||||
|
||||
@driver.on('message')
|
||||
def handle_message(post, **kwargs):
|
||||
if post['message'] == 'status':
|
||||
# Make a request to the third-party tool API to get the status
|
||||
response = requests.get('https://api.thirdpartytool.com/status')
|
||||
if response.status_code == 200:
|
||||
status = response.json()['status']
|
||||
driver.posts.create_post({
|
||||
'channel_id': post['channel_id'],
|
||||
'message': f'The status is {status}'
|
||||
})
|
||||
else:
|
||||
driver.posts.create_post({
|
||||
'channel_id': post['channel_id'],
|
||||
'message': 'Failed to get status'
|
||||
})
|
||||
|
||||
driver.init_websocket()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
```
|
||||
|
||||
In this example, the ChatOps bot listens for the command "status" and makes a request to a third-party tool API to get the current status. It then posts the status update in the Mattermost channel where the command was issued. This allows team members to quickly get updates on the status of the task without having to leave the chat platform.
|
||||
|
||||
### Open source ChatOps
|
||||
|
||||
In summary, creating a ChatOps bot on Mattermost is a simple process that can bring numerous benefits to your organization's communication and workflow. This article has provided a step-by-step breakdown and code examples to help you get started on creating your bot and even customize it by adding new features. Now that you know the basics, you can further explore ChatOps and Mattermost to optimize your team's collaboration and productivity.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/3/chatbot-mattermost-python
|
||||
|
||||
作者:[Dr. Michael J. Garbade][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/drmjg
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://mattermost.com/
|
||||
[2]: https://opensource.com/alternatives/slack
|
||||
[3]: https://opensource.com/article/17/10/python-101
|
||||
[4]: https://opensource.com/article/20/3/pip-linux-mac-windows
|
@ -1,184 +0,0 @@
|
||||
[#]: subject: "Debian 12 Bookworm: Best New Features"
|
||||
[#]: via: "https://www.debugpoint.com/debian-12-features/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Debian 12 Bookworm: Best New Features
|
||||
======
|
||||
|
||||
**We give you a summary of the new features and enhancements of the Debian 12 Bookworm (upcoming) release.**
|
||||
|
||||
Debian 12 has been under development for a few months and slowly moving towards a final release. As of publishing this, it is currently under the hard freeze. That means no major package changes or enhancements are expected.
|
||||
|
||||
This release comes with several new features and improvements, making it an exciting release for Debian enthusiasts. In this article, we will discuss the best new features of Debian 12 Bookworm and how they can benefit users.
|
||||
|
||||
Let’s take a look.
|
||||
|
||||
![Debian 12 Bookworm GNOME Desktop][1]
|
||||
|
||||
### Debian 12 Bookworm: New Features
|
||||
|
||||
#### Linux Kernel
|
||||
|
||||
This release features Linux mainline Kernel 6.1, released in December 2022. Timeline-wise, Debian 12 is only one Kernel release behind as of now. Hence, you get the latest and greatest hardware support with stable Kernel 6.1.
|
||||
|
||||
Highlights features of this Kernel include initial Rust framework support, updates to Intel and AMD’s upcoming CPU/GPU line-ups, performance improvements of btrfs and other file systems and more.
|
||||
|
||||
We already have a dedicated article about [Kernel 6.1 f][2][e][2][atures][2] if you want to learn more.
|
||||
|
||||
#### Non-free packages in the installer
|
||||
|
||||
A critical change related to the Debian ISO files arrives in Debian 12. Since the beginning, Debian has provided different ISO files for “Free” and “non-free” packages. The proprietary “non-Free” packages are part of separate ISO files. Hence, if you need driver support for your special hardware, then you can download separate ISO files for your laptop/desktop/servers.
|
||||
|
||||
However, this experience makes it a little confusing for the end user to pick the correct Debian ISO. The Debian team launched a community voting last year to pick the best option to handle “non-free” packages.
|
||||
|
||||
As [per the results][3], the primary ISO files now contain both free and “non-free” ISO files.
|
||||
|
||||
So, what changed?
|
||||
|
||||
When you try to download official Debian ISO files, you only need to choose one ISO file (DVD size) containing everything. Furthermore, the small net-installation ISO is also present, including “non-free” firmware.
|
||||
|
||||
You can look at [this guide][4] regarding Debian ISO.
|
||||
|
||||
#### Pipewire by default for GNOME
|
||||
|
||||
If you use GNOME desktop in Debian Linux, then a piece of good news for you.
|
||||
|
||||
Debian 12 with GNOME desktop [making Pipewire and Wireplumber manager by default][5] sound server, replacing Pulseaudio. The modern Pipewire is already introduced in Ubuntu, Fedora, Pop!_OS and other leading distros.
|
||||
|
||||
![Pipewire in Debian 12][6]
|
||||
|
||||
#### A new version of Apt (2.6) package manager
|
||||
|
||||
Debian 12 is introducing the latest version of apt package manager version 2.6. [Apt 2.6][7] version specifically handles the non-free ISO image support introduced in this release. The changes include the non-free firmware will be enabled by default, and apt will show updates to the non-free packages.
|
||||
|
||||
#### Desktop environments
|
||||
|
||||
All the major desktop environments are now up to date in Debian 12, except GNOME. Because [GNOME 44][8] was released just a few days back, it won’t make it to Bookworm due to schedule conflicts. Debian 12 is already on hard freeze.
|
||||
|
||||
Hence, in Debian 12, you get the [GNOME 43][9]version which is not that far behind compared to the latest release. Furthermore, if you are shifting from [Debian 11][10], then it will be a huge GNOME upgrade.
|
||||
|
||||
Fortunately, [KDE Plasma 5.27][11] is now available in this release. KDE Plasma is the final Plasma 5 version and is likely to become LTS until Plasma 6 is ready. Hence, it was a significant upgrade. The KDE Plasma maintainers managed to pull this off.
|
||||
|
||||
In addition, [Xfce 4.18][12] in Debian 12 is bringing an improved desktop experience with stunning Thunar features. Also, LXQt 1.2, MATE 1.26 and LXDE 11 are the latest versions featured in Debian 12.
|
||||
|
||||
Here’s a summary:
|
||||
|
||||
- GNOME 43
|
||||
- KDE Plasma 5.27
|
||||
- LXDE 11
|
||||
- LXQt 1.2
|
||||
- MATE 1.26
|
||||
- Xfce 4.18
|
||||
|
||||
#### Core modules and applications
|
||||
|
||||
Most of the major applications are refreshed. Notably, Python 3.11 is included in Debian 12, which would help the developers and many use cases. In addition, LibreOffice 7.4 and Firefox 102.9 ESR are two noteworthy updates. Here’s a small list of key applications and package updates:
|
||||
|
||||
- LibreOffice 7.4.4
|
||||
- Firefox 102.9 ESR
|
||||
- GIMP 2.10.32
|
||||
- OpenJDK 11.6
|
||||
- PHP 8.2
|
||||
- Python 3.11+
|
||||
- Samba 4.17
|
||||
|
||||
#### Miscellaneous Updates
|
||||
|
||||
- Debian 12 now detects Windows 11 while using in a dual-boot setup.
|
||||
- Screen reader support is enabled by default for the Cinnamon desktop in Debian
|
||||
- Automatic launching of speech synthesis after 30 seconds timeout
|
||||
- Easier detection of multipath devices
|
||||
- Support for multiple initrd paths
|
||||
- Support for new ARM and RISC-V devices
|
||||
- Experimental DMRAID support is dropped
|
||||
|
||||
You can learn about additional changes [here][13].
|
||||
|
||||
#### Default theme and wallpapers
|
||||
|
||||
In every release, Debian introduces some stunning artwork from the community. Debian 12 default artwork themed as “Emerald”.
|
||||
|
||||
“_Elegantly polished and chiseled, or in their raw and natural state, gemstones can have an infinite number of shapes.”_
|
||||
|
||||
With the Emerald theme, the creator wanted to combine light and minerals in a clean, almost ethereal design.
|
||||
|
||||
The default theme and banners are visible across the installer, animated Plymouth, wallpaper and all the places.
|
||||
|
||||
Here are some of the images picked up from the [official gallery][14].
|
||||
|
||||
![Default wallpaper][15]
|
||||
|
||||
![Debian 12 Plymouth][16]
|
||||
|
||||
### How to Download Debian 12
|
||||
|
||||
**Note**: Debian 12 is not yet released as stable. So, try not to use it for serious work or upgrade to Bookworm from Bullseye.
|
||||
|
||||
If you are running Debian 11 bullseye, you can open the `/etc/apt/sources.list` via any text editor and add the following lines. Make sure to verify the mirror URL and change the following command.
|
||||
|
||||
```
|
||||
deb http://http.us.debian.org/debian bookworm main non-free contribdeb http://security.debian.org/ bookworm/updates main contrib non-freedeb http://http.us.debian.org/debian sid main non-free contrib
|
||||
```
|
||||
|
||||
After adding those, refresh the apt cache:
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
And then, run the following to get the update.
|
||||
|
||||
```
|
||||
sudo apt dist-upgrade
|
||||
```
|
||||
|
||||
For fresh ISO download, visit any of the below links.
|
||||
|
||||
[Download Debian 12 (DVD) ISO – Alpha2][17]
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
In conclusion, Debian 12 Bookworm is an impressive release that brings several new features and improvements. From the latest desktops to a new kernel and updated packages, this release has a lot to offer for both new and experienced Debian users.
|
||||
|
||||
With its focus on stability, security, and open-source principles, Debian 12 Bookworm can be the best choice for those seeking a reliable alternative to Ubuntu and a versatile operating system.
|
||||
|
||||
The final release of this version is expected by Q2 2023.
|
||||
|
||||
_[Debian 12 changelog][18] (a little outdated)_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/debian-12-features/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2023/03/Debian-12-Bookworm-GNOME-Desktop.jpg
|
||||
[2]: https://www.debugpoint.com/linux-kernel-6-1/
|
||||
[3]: https://lists.debian.org/debian-vote/2022/10/msg00000.html
|
||||
[4]: https://www.debugpoint.com/download-debian-iso/
|
||||
[5]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1020249
|
||||
[6]: https://www.debugpoint.com/wp-content/uploads/2023/03/Pipewire-in-Debian-12.jpg
|
||||
[7]: https://launchpad.net/ubuntu/+source/apt/+changelog
|
||||
[8]: https://www.debugpoint.com/gnome-44/
|
||||
[9]: https://www.debugpoint.com/gnome-43/
|
||||
[10]: https://www.debugpoint.com/debian-11-features/
|
||||
[11]: https://www.debugpoint.com/kde-plasma-5-27/
|
||||
[12]: https://www.debugpoint.com/xfce-4-18-review/
|
||||
[13]: https://lists.debian.org/debian-devel-announce/2022/09/msg00004.html
|
||||
[14]: https://wiki.debian.org/DebianArt/Themes/Emerald
|
||||
[15]: https://www.debugpoint.com/wp-content/uploads/2023/03/Default-wallpaper.jpg
|
||||
[16]: https://www.debugpoint.com/wp-content/uploads/2023/03/Debian-12-Plymouth.jpg
|
||||
[17]: https://cdimage.debian.org/cdimage/bookworm_di_alpha2/amd64/iso-dvd/
|
||||
[18]: https://www.debian.org/releases/bookworm/amd64/release-notes/ch-whats-new.en.html
|
@ -1,231 +0,0 @@
|
||||
[#]: subject: "Rust Basics Series #1: Create and Run Your First Rust Program"
|
||||
[#]: via: "https://itsfoss.com/rust-introduction/"
|
||||
[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Rust Basics Series #1: Create and Run Your First Rust Program
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
The Rust programming language is one of the fastest adopted systems programming languages by developers and tech companies. It is also voted as one of the **most loved programming languages** by developers who use it on a daily basis. Rust has [been getting this love for][2]**[seven consecutive years][2]** now!
|
||||
|
||||
It is so popular that there are now two big efforts being carried out in the Linux ecosystem:
|
||||
|
||||
- Inclusion of [Rust as a secondary programming language in the Linux kernel][3]
|
||||
- System76 is [writing their own desktop environment from scratch using Rust][4]
|
||||
|
||||
And that is just in the Linux ecosystem. Android's Bluetooth implementation [Gabeldorsche][5] is now written in Rust.
|
||||
|
||||
Do you see the rising popularity of Rust? You would probably like to learn coding in Rust.
|
||||
|
||||
### Why should you consider Rust over other programming languages?
|
||||
|
||||
Rust is a programming language that has an **extremely strict type system**. As a result, you are "forced" to not write bad code in the first place (well, usually).
|
||||
|
||||
The Rust programming language has the following "goals":
|
||||
|
||||
- **Speed**: Rust's binaries are as fast as C binaries, sometimes outpacing C++ binaries!
|
||||
- **Memory safety**: Rust has a huge emphasis on memory safety.
|
||||
- **Concurrency**: Focusing on memory safety eliminates a lot of race condition-like scenarios and helps you introduce concurrency in your program.
|
||||
|
||||
Following are a few errors mistakes one might make in languages like C/C++ (but not with Rust):
|
||||
|
||||
- Use after free
|
||||
- Double free
|
||||
- Accessing out-of-bound values
|
||||
- Using `NULL`
|
||||
- Inappropriate pointer arithmetic and/or access
|
||||
- Use of uninitialized variable(s)
|
||||
- Thread-unsafe multi-threading
|
||||
|
||||
Have a look at the issues caused by such issues at major corporations like [Apple][6], [Microsoft][7], [Google][8], [0day][9] etc,
|
||||
|
||||
Now that you know why one might want to choose the Rust programming language over any other one, let's start with the Rust language tutorial series!
|
||||
|
||||
### Intended audience
|
||||
|
||||
For the love of Rust, I am writing this series of Rust tutorials to help you get acquainted with the concept of Rust programming.
|
||||
|
||||
This tutorial series is intended for folks already familiar with programming languages like C and C++. I assume you know basic terms like _variables_, _functions_, _loops_, etc.
|
||||
|
||||
The only prerequisites that I ask from you are your time and some effort.
|
||||
|
||||
### Installing the Rust compiler
|
||||
|
||||
I would prefer that you have the [Rust compiler installed locally][10]. You can do so by running the following command:
|
||||
|
||||
```
|
||||
curl --proto '=https' --tlsv1.3 -sSf https://sh.rustup.rs | sh
|
||||
```
|
||||
|
||||
![Installing Rust on Ubuntu Linux][11]
|
||||
|
||||
Apart from the Rust Compiler, I also recommend installing a few more tools that will help you in the development process:
|
||||
|
||||
```
|
||||
rustup component add rust-src rust-analyzer rust-analysis
|
||||
```
|
||||
|
||||
💡
|
||||
|
||||
If you do not wish to install the Rust compiler, no worries. You can run the Rust code directly in your browser! Just head over to the
|
||||
|
||||
[Rust Playgrounds website][12]
|
||||
|
||||
and paste the code discussed here.
|
||||
|
||||
### Hello Rust!
|
||||
|
||||
Since Dennis Ritchie and Brian Kernighan introduced the C programming language with the "Hello world" program, it has become a custom in the UNIX world to do so with any new programming language you learn.
|
||||
|
||||
So let's write our Hello World program in Rust as well.
|
||||
|
||||
I will [create a project directory][13] called `learn-rust-its-foss` in my home directory. In there, I create another directory called `hello-world`. Inside that, I will create a `main.rs` file:
|
||||
|
||||
```
|
||||
// this code outputs the text
|
||||
// "Hello world!" to `stdout`
|
||||
|
||||
fn main() {
|
||||
println!("Hello world!");
|
||||
}
|
||||
```
|
||||
|
||||
📋
|
||||
|
||||
Just like C, C++ and Java source files have the extensions
|
||||
|
||||
```
|
||||
.c
|
||||
```
|
||||
|
||||
,
|
||||
|
||||
```
|
||||
.cpp
|
||||
```
|
||||
|
||||
and
|
||||
|
||||
```
|
||||
.java
|
||||
```
|
||||
|
||||
respectively, the Rust source files have the
|
||||
|
||||
```
|
||||
.rs
|
||||
```
|
||||
|
||||
file extension.
|
||||
|
||||
As a C/C++ programmer, you might have used [gcc on Linux][14], `clang` on macOS and MSVC on Windows. But to compile Rust code, the language creators themselves provide an official `rustc` compiler.
|
||||
|
||||
Running a Rust program is the same as [executing C/C++ program][15]. You compile the code to get the executable file and then run this executable to run the code.
|
||||
|
||||
```
|
||||
$ ls
|
||||
main.rs
|
||||
|
||||
$ rustc main.rs
|
||||
|
||||
$ ls
|
||||
main main.rs
|
||||
|
||||
$ ./main
|
||||
Hello world!
|
||||
```
|
||||
|
||||
Nice!
|
||||
|
||||
### Deciphering Rust code
|
||||
|
||||
Now that you wrote, compiled and ran your first ever Rust program, let's de-structure the "Hello world" code and understand each part.
|
||||
|
||||
```
|
||||
fn main() {
|
||||
}
|
||||
```
|
||||
|
||||
The `fn` keyword is used to declare a function in Rust. Following it, `main` is the name of this particular function that was declared. Like many compiled programming languages, the `main` is a special function used as your program's entry point.
|
||||
|
||||
Any code written inside the `main` function (between the curly brackets `{``}`) gets executed upon program start-up.
|
||||
|
||||
#### println macro
|
||||
|
||||
Inside the `main` function, there is one statement:
|
||||
|
||||
```
|
||||
println!("Hello world!");
|
||||
```
|
||||
|
||||
Like the C language's standard library has the `printf` function, Rust language's standard library has the `println`**macro**. A macro is similar to a function but it is distinguished by the **exclamation mark**. You'll learn about macros and functions later in this series.
|
||||
|
||||
The `println` macro takes in a format string and puts it to the program's output (in our case, that is terminal). Since I wish to output some text instead of a variable, I will enclose the text inside double quotes (`"`). Finally, I end this statement using a semi-colon to denote the end of the statement.
|
||||
|
||||
📋
|
||||
|
||||
Just know that anything that looks like a function call but has an exclamation mark (
|
||||
|
||||
```
|
||||
!
|
||||
```
|
||||
|
||||
) before the opening parentheses is a macro in the Rust programming language.
|
||||
|
||||
#### Comments
|
||||
|
||||
Rust follows the known commenting style of the C programming language. A single line comment starts with two forward slashes (`//`) and a multi-line comment is started by `/*` and ends with `*/`.
|
||||
|
||||
```
|
||||
// this is a multi-line comment
|
||||
// but nothing stops me to doing the same
|
||||
// on the second or third line too!
|
||||
|
||||
/*
|
||||
* this is a "true" mutli-line comment
|
||||
* because it is _fancy_
|
||||
*/
|
||||
```
|
||||
|
||||
### Conclusion
|
||||
|
||||
You just took the first step towards coding in Rust with the Hello World program.
|
||||
|
||||
As a practice, perhaps you can write and execute a Rust program that prints "Yes! I did Rust".
|
||||
|
||||
In the next part of the series, you'll learn to use variables in your Rust program. Stay tuned!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/rust-introduction/
|
||||
|
||||
作者:[Pratham Patel][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/pratham/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://itsfoss.com/content/images/2023/03/linux-mega-packt.webp
|
||||
[2]: https://survey.stackoverflow.co/2022/?ref=itsfoss.com#section-most-loved-dreaded-and-wanted-programming-scripting-and-markup-languages
|
||||
[3]: https://news.itsfoss.com/linux-kernel-6-1-release/?ref=itsfoss.com
|
||||
[4]: https://news.itsfoss.com/pop-os-cosmic-rust/?ref=itsfoss.com
|
||||
[5]: https://android.googlesource.com/platform//system/bt/+/83498aa554aea220fcff30b6310a0a7b4557969f/gd/rust/linux/stack/src/bluetooth.rs?ref=itsfoss.com
|
||||
[6]: https://langui.sh/2019/07/23/apple-memory-safety/?ref=itsfoss.com
|
||||
[7]: https://msrc-blog.microsoft.com/2019/07/18/we-need-a-safer-systems-programming-language/?ref=itsfoss.com
|
||||
[8]: https://security.googleblog.com/2019/05/queue-hardening-enhancements.html?ref=itsfoss.com
|
||||
[9]: https://docs.google.com/spreadsheets/d/1lkNJ0uQwbeC1ZTRrxdtuPLCIl7mlUreoKfSIgajnSyY/view?ref=itsfoss.com#gid=1190662839
|
||||
[10]: https://itsfoss.com/install-rust-cargo-ubuntu-linux/
|
||||
[11]: https://itsfoss.com/content/images/2023/03/install-rust.svg
|
||||
[12]: https://play.rust-lang.org/?ref=itsfoss.com
|
||||
[13]: https://itsfoss.com/make-directories/
|
||||
[14]: https://learnubuntu.com/install-gcc/?ref=itsfoss.com
|
||||
[15]: https://itsfoss.com/run-c-program-linux/
|
@ -0,0 +1,221 @@
|
||||
[#]: subject: "Linux Terminal Basics #7: Copy Files and Directories in Linux"
|
||||
[#]: via: "https://itsfoss.com/copy-files-directory-linux/"
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Linux Terminal Basics #7: Copy Files and Directories in Linux
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Copying files is one of the most basic yet crucial tasks you will be doing regularly.
|
||||
|
||||
Linux has a dedicated cp command for copying both files and directories (folders).
|
||||
|
||||
In this part of the Terminal Basics series, you'll learn to copy files and folders in the terminal.
|
||||
|
||||
> 📋 Just to recall, here's what you have learned so far in this Terminal Basics series:
|
||||
> - [Change directories][2]
|
||||
> - [Make new directories][3]
|
||||
> - [List directory contents][4]
|
||||
> - [Create files][5]
|
||||
> - [Reading files][6]
|
||||
> - [Removing files and directories][7]
|
||||
|
||||
Let's go on with the seventh chapter in the series.
|
||||
|
||||
### Copying files in Linux command line
|
||||
|
||||
Let me show you a few examples of copying files.
|
||||
|
||||
#### Copy a file to another directory
|
||||
|
||||
To copy one file to another directory, all you have to do is follow the given command syntax:
|
||||
|
||||
```
|
||||
cp Source_file Destination_directory
|
||||
```
|
||||
|
||||
For example, here, I have copied a file named `Hello.txt` to the directory named `Tux`:
|
||||
|
||||
![copy file to another directory in linux command line][8]
|
||||
|
||||
And as you can see, the file has successfully been copied to the Tux directory.
|
||||
|
||||
#### Copy the file but rename it
|
||||
|
||||
You can choose to rename the file while copying it. Just give a different name to the 'target file'.
|
||||
|
||||
```
|
||||
cp Source_file Renamed_file
|
||||
```
|
||||
|
||||
For reference, here, I have copied a file named `Hello.txt` to the same directory by renaming it to `Renamed_Hello.txt`:
|
||||
|
||||
![rename a file while copying in a same directory in linux terminal][9]
|
||||
|
||||
Why would you do that? Say, you have to edit a config file. A good practice is to make a backup of the config file in the same location before editing it. This way, you can revert to the old configuration if things don't go as planned.
|
||||
|
||||
#### Copy multiple files to another location
|
||||
|
||||
To copy multiple files to another directory, execute the command in the following fashion:
|
||||
|
||||
```
|
||||
cp File1 File2 File3 FileN Target_directory
|
||||
```
|
||||
|
||||
Here, I copy multiple files to a new location.
|
||||
|
||||
![copy multiple files using the cp command in linux][10]
|
||||
|
||||
> 📋 When you are copying multiple files, renaming them would not be possible with just the cp command.
|
||||
|
||||
#### Deal with duplicate files while copying
|
||||
|
||||
By default, the cp command will override the file if a file with the same name exists in the target directory.
|
||||
|
||||
To avoid overriding, you can use the `-n` option with the cp command, and it won't override the existing files:
|
||||
|
||||
```
|
||||
cp -n Source_File Destination_directory
|
||||
```
|
||||
|
||||
For example, here, I have tried to copy two files that were already there in my targeted directory and used `-v` option to showcase what is being done by the command:
|
||||
|
||||
```
|
||||
cp -n -v itsFOSS.txt LHB.txt LU.txt ~/Tux
|
||||
```
|
||||
|
||||
![how not to override files while copying in linux using the cp command][11]
|
||||
|
||||
#### Interactively copy files
|
||||
|
||||
But what about when you want to override some files, whereas some should be kept intact?
|
||||
|
||||
Well, you can use the cp command in the interactive mode using the `-i` option, and it will ask you each time whether the file should be overridden or not:
|
||||
|
||||
```
|
||||
cp -i Source_file Destination_directory
|
||||
```
|
||||
|
||||
![how to use cp command in interactive mode][12]
|
||||
|
||||
> 🖥️ Practice all the above-discussed examples yourself. You already know about creating files and folders so recreate everything.
|
||||
|
||||
### Copy directories in Linux command line
|
||||
|
||||
There is mkdir command to make new directories, rmdir to remove (empty) directories. But there is no cpdir command for copying directories.
|
||||
|
||||
You'll have to use the same cp command but with the recursive option `-r` to copy a directory with all its content to another location:
|
||||
|
||||
```
|
||||
cp -r Source_dir Target_dir
|
||||
```
|
||||
|
||||
For example, here, I have copied a directory named `IF` to `LHB`:
|
||||
|
||||
![how to copy a directory in linux command line][13]
|
||||
|
||||
But it copied the entire directory 🤨
|
||||
|
||||
So, what do you do when you only want to copy the directory's contents, not the directory itself?
|
||||
|
||||
Here's what you can do:
|
||||
|
||||
#### Copy only the contents of a directory (not the directory)
|
||||
|
||||
To copy only the contents of the directory, not the directory itself, you append `/.` at the end of the source directory's name:
|
||||
|
||||
```
|
||||
cp -r Source_directory/. Destination_directory
|
||||
```
|
||||
|
||||
Here, I want to copy the contents of a directory named `IF` which contains the following three files:
|
||||
|
||||
![check the file contents of directory using the tree command][14]
|
||||
|
||||
And I will execute the following command to copy the file contents of the `IF` directory to `LHB`:
|
||||
|
||||
```
|
||||
cp -r IF/. LHB
|
||||
```
|
||||
|
||||
![copy the file contents of directory not a directory itself in linux command line][15]
|
||||
|
||||
You can also use Source_directory/* here.
|
||||
|
||||
#### Copy multiple directories
|
||||
|
||||
To copy multiple directories, you will have to execute the command in the following way:
|
||||
|
||||
```
|
||||
cp -r Dir1 Dir2 Dir3 DirN Destiniation_directory
|
||||
```
|
||||
|
||||
For example, here, I have copied two directories named `IF` and `LU` to the `LHB`:
|
||||
|
||||
```
|
||||
cp -r IF LU ~/LHB
|
||||
```
|
||||
|
||||
![copy multiple directories using the cp command in linux command line][16]
|
||||
|
||||
You can do the same when you want to copy files from multiple directories but not the directory itself:
|
||||
|
||||
```
|
||||
cp -r Dir1/. Dir2/. Dir3/. DirN/. Destination_directory
|
||||
```
|
||||
|
||||
![copy files from multiple directories but not directories their self using the cp command][17]
|
||||
|
||||
> 🖥️ You can also rename the directories the same way you renamed files.
|
||||
|
||||
### Test your knowledge
|
||||
|
||||
Now, let's see how much you remember the lessons learned so far.
|
||||
|
||||
- Create a directory called copy_practice
|
||||
- Copy the file /etc/services to this newly created folder
|
||||
- Create a folder named secrets under this directory and copy files /etc/passwd and /etc/services in it
|
||||
- Copy the services file in copy_practice to the secrets folder but don't overwrite it
|
||||
- Copy the secrets folder to your home directory
|
||||
- Delete the secrets and copy_practice directories
|
||||
|
||||
That would give you some practice.
|
||||
|
||||
It's going well so far. You have learned quite a few things. In the next chapter, you'll see about moving files and folders with mv command.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/copy-files-directory-linux/
|
||||
|
||||
作者:[Sagar Sharma][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sagar/
|
||||
[b]: https://github.com/lkxed/
|
||||
[1]: https://itsfoss.com/content/images/2023/03/linux-mega-packt.webp
|
||||
[2]: https://itsfoss.com/change-directories/
|
||||
[3]: https://itsfoss.com/make-directories/
|
||||
[4]: https://itsfoss.com/list-directory-content/
|
||||
[5]: https://itsfoss.com/create-files/
|
||||
[6]: https://itsfoss.com/view-file-contents/
|
||||
[7]: https://itsfoss.com/delete-files-folders-linux/
|
||||
[8]: https://itsfoss.com/content/images/2023/02/copy-file-to-another-directory-in-linux-command-line.png
|
||||
[9]: https://itsfoss.com/content/images/2023/02/rename-a-file-while-copying-in-a-same-directory-in-linux-terminal.png
|
||||
[10]: https://itsfoss.com/content/images/2023/02/copy-multiple-files-using-the-cp-command-in-linux.png
|
||||
[11]: https://itsfoss.com/content/images/2023/02/how-not-to-override-files-while-copying-in-linux-using-the-cp-command.png
|
||||
[12]: https://itsfoss.com/content/images/2023/02/how-to-use-cp-command-in-interactive-mode.png
|
||||
[13]: https://itsfoss.com/content/images/2023/02/how-to-copy-a-directory-in-linux-command-line.png
|
||||
[14]: https://itsfoss.com/content/images/2023/02/check-the-file-contents-of-directory-using-the-tree-command.png
|
||||
[15]: https://itsfoss.com/content/images/2023/02/copy-the-file-contents-of-directory-not-a-directory-itself-in-linux-command-line.png
|
||||
[16]: https://itsfoss.com/content/images/2023/02/copy-multiple-directories-using-the-cp-command-in-linux-command-line.png
|
||||
[17]: https://itsfoss.com/content/images/2023/02/copy-files-from-multiple-directories-but-not-directories-their-self-using-the-cp-command.png
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user