mirror of
https://github.com/LCTT/TranslateProject.git
synced 2026-08-26 04:13:30 +08:00
104
published/20190823 The Linux kernel- Top 5 innovations.md
Normal file
104
published/20190823 The Linux kernel- Top 5 innovations.md
Normal file
@@ -0,0 +1,104 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (heguangzhi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11368-1.html)
|
||||
[#]: subject: (The Linux kernel: Top 5 innovations)
|
||||
[#]: via: (https://opensource.com/article/19/8/linux-kernel-top-5-innovations)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Linux 内核的五大创新
|
||||
======
|
||||
|
||||
> 想知道什么是 Linux 内核上真正的(不是那种时髦的)创新吗?
|
||||
|
||||

|
||||
|
||||
在科技行业,*创新*这个词几乎和*革命*一样到处泛滥,所以很难将那些夸张的东西与真正令人振奋的东西区分开来。Linux 内核被称为创新,但它又被称为现代计算中最大的奇迹,一个微观世界中的庞然大物。
|
||||
|
||||
撇开营销和模式不谈,Linux 可以说是开源世界中最受欢迎的内核,它在近 30 年的生命时光当中引入了一些真正的规则改变者。
|
||||
|
||||
### Cgroups(2.6.24)
|
||||
|
||||
早在 2007 年,Paul Menage 和 Rohit Seth 就在内核中添加了深奥的[控制组(cgroups)][2]功能(cgroups 的当前实现是由 Tejun Heo 重写的)。这种新技术最初被用作一种方法,从本质上来说,是为了确保一组特定任务的服务质量。
|
||||
|
||||
例如,你可以为与你的 WEB 服务相关联的所有任务创建一个控制组定义(cgroup),为例行备份创建另一个 cgroup ,再为一般操作系统需求创建另一个 cgroup。然后,你可以控制每个组的资源百分比,这样你的操作系统和 WEB 服务就可以获得大部分系统资源,而你的备份进程可以访问剩余的资源。
|
||||
|
||||
然而,cgroups 如今变得这么著名是因其作为驱动云技术的角色:容器。事实上,cgroups 最初被命名为[进程容器][3]。当它们被 [LXC][4]、[CoreOS][5] 和 Docker 等项目采用时,这并不奇怪。
|
||||
|
||||
就像闸门打开后一样,“容器” 一词就像成为了 Linux 的同义词一样,微服务风格的基于云的“应用”概念很快成为了规范。如今,已经很难摆脱 cgroups 了,它们是如此普遍。每一个大规模的基础设施(如果你运行 Linux 的话,可能还有你的笔记本电脑)都以一种合理的方式使用了 cgroups,这使得你的计算体验比以往任何时候都更加易于管理和灵活。
|
||||
|
||||
例如,你可能已经在电脑上安装了 [Flathub][6] 或 [Flatpak][7],或者你已经在工作中使用 [Kubernetes][8] 和/或 [OpenShift][9]。不管怎样,如果“容器”这个术语对你来说仍然模糊不清,则可以 [通过 Linux 容器从背后][10]获得对容器的实际理解。
|
||||
|
||||
### LKMM(4.17)
|
||||
|
||||
2018 年,Jade Alglave、Alan Stern、Andrea Parri、Luc Maranget、Paul McKenney 以及其他几个人的辛勤工作的成果被合并到主线 Linux 内核中,以提供正式的内存模型。Linux 内核内存[一致性]模型(LKMM)子系统是一套描述 Linux 内存一致性模型的工具,同时也产生用于测试的用例(特别命名为 klitmus)。
|
||||
|
||||
随着系统在物理设计上变得越来越复杂(增加了更多的中央处理器内核,高速缓存和内存增长,等等),它们就越难知道哪个中央处理器需要哪个地址空间,以及何时需要。例如,如果 CPU0 需要将数据写入内存中的共享变量,并且 CPU1 需要读取该值,那么 CPU0 必须在 CPU1 尝试读取之前写入。类似地,如果值是以一种顺序方式写入内存的,那么期望它们也以同样的顺序被读取,而不管哪个或哪些 CPU 正在读取。
|
||||
|
||||
即使在单个处理器上,内存管理也需要特定的任务顺序。像 `x = y` 这样的简单操作需要处理器从内存中加载 `y` 的值,然后将该值存储在 `x` 中。在处理器从内存中读取值之前,是不能将存储在 `y` 中的值放入 `x` 变量的。此外还有地址依赖:`x[n] = 6` 要求在处理器能够存储值 `6` 之前加载 `n`。
|
||||
|
||||
LKMM 可以帮助识别和跟踪代码中的这些内存模式。它部分是通过一个名为 `herd` 的工具来实现的,该工具(以逻辑公式的形式)定义了内存模型施加的约束,然后列举了与这些约束一致性的所有可能的结果。
|
||||
|
||||
### 低延迟补丁(2.6.38)
|
||||
|
||||
很久以前,在 2011 年之前,如果你想[在 Linux 上进行多媒体工作][11],你必须得有一个低延迟内核。这主要适用于[录音][12]时添加了许多实时效果(如对着麦克风唱歌和添加混音,以及在耳机中无延迟地听到你的声音)。有些发行版,如 [Ubuntu Studio][13],可靠地提供了这样一个内核,所以实际上这没有什么障碍,这只不过是当艺术家选择发行版时的一个重要提醒。
|
||||
|
||||
然而,如果你没有使用 Ubuntu Studio,或者你需要在你的发行版提供之前更新你的内核,你必须跳转到 rt-patches 网页,下载内核补丁,将它们应用到你的内核源代码,编译,然后手动安装。
|
||||
|
||||
后来,随着内核版本 2.6.38 的发布,这个过程结束了。Linux 内核突然像变魔术一样默认内置了低延迟代码(根据基准测试,延迟至少降低了 10 倍)。不再需要下载补丁,不用编译。一切都很顺利,这都是因为 Mike Galbraith 编写了一个 200 行的小补丁。
|
||||
|
||||
对于全世界的开源多媒体艺术家来说,这是一个规则改变者。从 2011 年开始事情变得如此美好,到 2016 年我自己做了一个挑战,[在树莓派 v1(型号 B)上建造一个数字音频工作站(DAW)][14],结果发现它运行得出奇地好。
|
||||
|
||||
### RCU(2.5)
|
||||
|
||||
RCU,即<ruby>读-拷贝-更新<rt>Read-Copy-Update</rt></ruby>,是计算机科学中定义的一个系统,它允许多个处理器线程从共享内存中读取数据。它通过延迟更新但也将它们标记为已更新来做到这一点,以确保数据读取为最新内容。实际上,这意味着读取与更新同时发生。
|
||||
|
||||
典型的 RCU 循环有点像这样:
|
||||
|
||||
1. 删除指向数据的指针,以防止其他读操作引用它。
|
||||
2. 等待读操作完成它们的关键处理。
|
||||
3. 回收内存空间。
|
||||
|
||||
将更新阶段划分为删除和回收阶段意味着更新程序会立即执行删除,同时推迟回收直到所有活动读取完成(通过阻止它们或注册一个回调以便在完成时调用)。
|
||||
|
||||
虽然 RCU 的概念不是为 Linux 内核发明的,但它在 Linux 中的实现是该技术的一个定义性的例子。
|
||||
|
||||
### 合作(0.01)
|
||||
|
||||
对于 Linux 内核创新的问题的最终答案永远是协作。你可以说这是一个好时机,也可以称之为技术优势,称之为黑客能力,或者仅仅称之为开源,但 Linux 内核及其支持的许多项目是协作与合作的光辉范例。
|
||||
|
||||
它远远超出了内核范畴。各行各业的人都对开源做出了贡献,可以说都是因为 Linux 内核。Linux 曾经是,现在仍然是[自由软件][15]的主要力量,激励人们把他们的代码、艺术、想法或者仅仅是他们自己带到一个全球化的、有生产力的、多样化的人类社区中。
|
||||
|
||||
### 你最喜欢的创新是什么?
|
||||
|
||||
这个列表偏向于我自己的兴趣:容器、非统一内存访问(NUMA)和多媒体。无疑,列表中肯定缺少你最喜欢的内核创新。在评论中告诉我。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/8/linux-kernel-top-5-innovations
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[heguangzhi](https://github.com/heguangzhi)
|
||||
校对:[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/linux_penguin_green.png?itok=ENdVzW22 (Penguin with green background)
|
||||
[2]: https://en.wikipedia.org/wiki/Cgroups
|
||||
[3]: https://lkml.org/lkml/2006/10/20/251
|
||||
[4]: https://linuxcontainers.org
|
||||
[5]: https://coreos.com/
|
||||
[6]: http://flathub.org
|
||||
[7]: http://flatpak.org
|
||||
[8]: http://kubernetes.io
|
||||
[9]: https://www.redhat.com/sysadmin/learn-openshift-minishift
|
||||
[10]: https://opensource.com/article/18/11/behind-scenes-linux-containers
|
||||
[11]: http://slackermedia.info
|
||||
[12]: https://opensource.com/article/17/6/qtractor-audio
|
||||
[13]: http://ubuntustudio.org
|
||||
[14]: https://opensource.com/life/16/3/make-music-raspberry-pi-milkytracker
|
||||
[15]: http://fsf.org
|
||||
@@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (qfzy1233)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11359-1.html)
|
||||
[#]: subject: (How to Change Themes in Linux Mint)
|
||||
[#]: via: (https://itsfoss.com/install-themes-linux-mint/)
|
||||
[#]: author: (It's FOSS Community https://itsfoss.com/author/itsfoss/)
|
||||
@@ -10,9 +10,11 @@
|
||||
如何在 Linux Mint 中更换主题
|
||||
======
|
||||
|
||||
自始至终,使用 Cinnamon 桌面环境的 Linux Mint 都是一种卓越的体验。这也是[为何我喜爱 Linux Mint ][1]的主要原因之一。
|
||||

|
||||
|
||||
自从 Mint 的开发团队 [开始更为严肃的对待设计][2], “桌面主题” 应用便成为了更换新主题,图标,按钮样式,窗口边框以及鼠标指针的重要方式,当然你也可以直接通过它安装新的主题。感兴趣么? 让我们开始吧。
|
||||
一直以来,使用 Cinnamon 桌面环境的 Linux Mint 都是一种卓越的体验。这也是[为何我喜爱 Linux Mint][1]的主要原因之一。
|
||||
|
||||
自从 Mint 的开发团队[开始更为严肃的对待设计][2], “桌面主题” 应用便成为了更换新主题、图标、按钮样式、窗口边框以及鼠标指针的重要方式,当然你也可以直接通过它安装新的主题。感兴趣么?让我们开始吧。
|
||||
|
||||
### 如何在 Linux Mint 中更换主题
|
||||
|
||||
@@ -20,70 +22,62 @@
|
||||
|
||||
![Theme Applet provides an easy way of installing and changing themes][3]
|
||||
|
||||
在应用中中有一个“添加/删除”按钮,非常简单,不是么?而且,点击它,我们可以看到Cinnamon Spices( Cinnamon 的官方插件库)的主题按流行程度排序。
|
||||
在应用中有一个“添加/删除”按钮,非常简单吧。点击它,我们可以看到按流行程度排序的 Cinnamon Spices(Cinnamon 的官方插件库)的主题。
|
||||
|
||||
![Installing new themes in Linux Mint Cinnamon][4]
|
||||
|
||||
要安装主题,你所要做的就是点击你喜欢的一个,然后等待它下载。之后,主题将在应用第一页的“Desktop”选项中显示可用。只需双击已安装的主题之一就可以开始使用它。
|
||||
要安装主题,你所要做的就是点击你喜欢的主题,然后等待它下载。之后,主题将在应用第一页的“Desktop”选项中显示可用。只需双击已安装的主题之一就可以开始使用它。
|
||||
|
||||
![Changing themes in Linux Mint Cinnamon][5]
|
||||
|
||||
下面是默认的 Linux Mint 外观:
|
||||
下面是默认的 Linux Mint 外观:
|
||||
|
||||
![Linux Mint Default Theme][6]
|
||||
|
||||
这是在我更换主题之后:
|
||||
这是在我更换主题之后:
|
||||
|
||||
![Linux Mint with Carta Theme][7]
|
||||
|
||||
所有的主题都可以在 Cinnamon Spices 网站上获得更多的信息和更大的截图,这样你就可以更好地了解你的系统的外观。
|
||||
|
||||
[浏览 Cinnamon 主题][8]
|
||||
- [浏览 Cinnamon 主题][8]
|
||||
|
||||
### 在 Linux Mint 中安装第三方主题
|
||||
|
||||
_“我在另一个网站上看到了这个优异的主题,但 Cinnamon Spices 网站上没有……”_
|
||||
> “我在另一个网站上看到了这个优异的主题,但 Cinnamon Spices 网站上没有……”
|
||||
|
||||
Cinnamon Spices 集成了许多优秀的主题,但你仍然会发现,你看到的主题并没有被 Cinnamon Spices 官方网站收录。
|
||||
Cinnamon Spices 集成了许多优秀的主题,但你仍然会发现,你看到的主题并没有被 Cinnamon Spices 官方网站收录。
|
||||
|
||||
这时你可能会想:如果有别的办法就好了,对么?你可能会认为有(我的意思是……当然啦)。首先,我们可以在其他网站上找到一些很酷的主题。
|
||||
这时你可能会想:如果有别的办法就好了,对么?你可能会认为有(我的意思是……当然啦)。首先,我们可以在其他网站上找到一些很酷的主题。
|
||||
|
||||
我推荐你去 Cinnamon 浏览主题。如果你喜欢什么,就下载吧。
|
||||
我推荐你去 Cinnamon Look 浏览一下那儿的主题。如果你喜欢什么,就下载吧。
|
||||
|
||||
[在 Cinnamon 外观中获取更多主题][9]
|
||||
- [在 Cinnamon Look 中获取更多主题][9]
|
||||
|
||||
下载了首选主题之后,你现在将得到一个压缩文件,其中包含安装所需的所有内容。提取它并保存到 ~/.themes. 迷糊么? “~” 代表了你的 home 文件夹的对应路径: /home/{YOURUSER}/.themes.
|
||||
下载了首选主题之后,你现在将得到一个压缩文件,其中包含安装所需的所有内容。提取它并保存到 `~/.themes`。迷糊么? `~` 代表了你的家目录的对应路径:`/home/{YOURUSER}/.themes`。
|
||||
|
||||
[][10]
|
||||
然后跳转到你的家目录。按 `Ctrl+H` 来[显示 Linux 中的隐藏文件][11]。如果没有看到 `.themes` 文件夹,创建一个新文件夹并命名为 `.themes`。记住,文件夹名称开头的点很重要。
|
||||
|
||||
建议在登录 Ubuntu 16.04 时读取“启动会话失败”的修复程序。
|
||||
|
||||
然后跳转到你的主目录。按Ctrl+H[显示Linux中的隐藏文件][11]。如果没有看到.themes文件夹,创建一个新文件夹并命名为.themes。记住,文件夹名称开头的点很重要。
|
||||
|
||||
将提取的主题文件夹从下载目录复制到你的 home 中的.themes文件夹。
|
||||
将提取的主题文件夹从下载目录复制到你的家目录中的 `.themes` 文件夹中。
|
||||
|
||||
最后,在上面提到的应用中查找已安装的主题。
|
||||
|
||||
注记
|
||||
> 注记
|
||||
>
|
||||
> 请记住,主题必须是 Cinnamon 相对应的,即使它是一个从 GNOME 复刻的系统也不行,并不是所有的 GNOME 主题都适用于 Cinnamon。
|
||||
|
||||
请记住,主题必须是 Cinnamon 相对应的,即使它是一个从 GNOME 复刻的系统也不行,并不是所有的 GNOME 主题都适用于 Cinnamon 。
|
||||
改变主题是 Cinnamon 定制工作的一部分。你还可以[通过更改图标来更改 Linux Mint 的外观][12]。
|
||||
|
||||
改变主题是 Cinnamon 定制的一部分。你还可以[通过更改图标来更改 Linux Mint 的外观][12]。
|
||||
|
||||
我希望你现在已经知道如何在 Linux Mint 中更改主题了。快去选取你喜欢的主题吧?
|
||||
|
||||
### João Gondim
|
||||
|
||||
来自巴西的Linux爱好者。
|
||||
我希望你现在已经知道如何在 Linux Mint 中更改主题了。快去选取你喜欢的主题吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-themes-linux-mint/
|
||||
|
||||
作者:[It's FOSS Community][a]
|
||||
作者:[It's FOSS][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[qfzy1233](https://github.com/qfzy1233)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11362-1.html)
|
||||
[#]: subject: (Bash Script to Send a Mail About New User Account Creation)
|
||||
[#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-user-creation-send-email/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
@@ -10,37 +10,27 @@
|
||||
用 Bash 脚本发送新用户帐户创建的邮件
|
||||
======
|
||||
|
||||
出于某些原因,你可能需要跟踪 Linux 上的新用户创建信息。
|
||||

|
||||
|
||||
同时,你可能需要通过邮件发送详细信息。
|
||||
|
||||
这或许是审计目标的一部分,或者安全团队出于跟踪目的可能希望对此进行监控。
|
||||
出于某些原因,你可能需要跟踪 Linux 上的新用户创建信息。同时,你可能需要通过邮件发送详细信息。这或许是审计目标的一部分,或者安全团队出于跟踪目的可能希望对此进行监控。
|
||||
|
||||
我们可以通过其他方式进行此操作,正如我们在上一篇文章中已经描述的那样。
|
||||
|
||||
* **[在系统中创建新用户帐户时发送邮件的 Bash 脚本][1]**
|
||||
* [在系统中创建新用户帐户时发送邮件的 Bash 脚本][1]
|
||||
|
||||
|
||||
|
||||
Linux 有许多开源监控工具可以使用。
|
||||
|
||||
但我不认为他们有办法跟踪新用户创建过程,并在发生时提醒管理员。
|
||||
Linux 有许多开源监控工具可以使用。但我不认为他们有办法跟踪新用户创建过程,并在发生时提醒管理员。
|
||||
|
||||
那么我们怎样才能做到这一点?
|
||||
|
||||
我们可以编写自己的 Bash 脚本来实现这一目标。
|
||||
|
||||
我们过去写过许多有用的 shell 脚本。如果你想了解,请进入下面的链接。
|
||||
|
||||
* **[如何使用 shell 脚本自动化日常活动?][2]**
|
||||
|
||||
我们可以编写自己的 Bash 脚本来实现这一目标。我们过去写过许多有用的 shell 脚本。如果你想了解,请进入下面的链接。
|
||||
|
||||
* [如何使用 shell 脚本自动化日常活动?][2]
|
||||
|
||||
### 这个脚本做了什么?
|
||||
|
||||
这将每天两次(一天的开始和结束)备份 “/etc/passwd” 文件,这将使你能够获取指定日期的新用户创建详细信息。
|
||||
这将每天两次(一天的开始和结束)备份 `/etc/passwd` 文件,这将使你能够获取指定日期的新用户创建详细信息。
|
||||
|
||||
我们需要添加以下两个 cron 任务来复制 “/etc/passwd” 文件。
|
||||
我们需要添加以下两个 cron 任务来复制 `/etc/passwd` 文件。
|
||||
|
||||
```
|
||||
# crontab -e
|
||||
@@ -49,7 +39,7 @@ Linux 有许多开源监控工具可以使用。
|
||||
59 23 * * * cp /etc/passwd /opt/scripts/passwd-end-$(date +"%Y-%m-%d")
|
||||
```
|
||||
|
||||
它使用 “difference” 命令来检测文件之间的差异,如果发现与昨日有任何差异,脚本将向指定 email 发送新用户详细信息。
|
||||
它使用 `diff` 命令来检测文件之间的差异,如果发现与昨日有任何差异,脚本将向指定 email 发送新用户详细信息。
|
||||
|
||||
我们不用经常运行此脚本,因为用户创建不经常发生。但是,我们计划每天运行一次此脚本。
|
||||
|
||||
@@ -66,21 +56,21 @@ mv /opt/scripts/passwd-end-$(date --date='yesterday' '+%Y-%m-%d') /opt/scripts/p
|
||||
ucount=$(diff /opt/scripts/passwd-start /opt/scripts/passwd-end | grep ">" | cut -d":" -f6 | cut -d"/" -f3 | wc -l)
|
||||
if [ $ucount -gt 0 ]
|
||||
then
|
||||
SUBJECT="ATTENTION: New User Account is created on server : `date --date='yesterday' '+%b %e'`"
|
||||
MESSAGE="/tmp/new-user-logs.txt"
|
||||
TO="[email protected]"
|
||||
echo "Hostname: `hostname`" >> $MESSAGE
|
||||
echo -e "\n" >> $MESSAGE
|
||||
echo "The New User Details are below." >> $MESSAGE
|
||||
echo "+------------------------------+" >> $MESSAGE
|
||||
diff /opt/scripts/passwd-start /opt/scripts/passwd-end | grep ">" | cut -d":" -f6 | cut -d"/" -f3 >> $MESSAGE
|
||||
echo "+------------------------------+" >> $MESSAGE
|
||||
mail -s "$SUBJECT" "$TO" < $MESSAGE
|
||||
rm $MESSAGE
|
||||
fi
|
||||
SUBJECT="ATTENTION: New User Account is created on server : `date --date='yesterday' '+%b %e'`"
|
||||
MESSAGE="/tmp/new-user-logs.txt"
|
||||
TO="2daygeek@gmail.com"
|
||||
echo "Hostname: `hostname`" >> $MESSAGE
|
||||
echo -e "\n" >> $MESSAGE
|
||||
echo "The New User Details are below." >> $MESSAGE
|
||||
echo "+------------------------------+" >> $MESSAGE
|
||||
diff /opt/scripts/passwd-start /opt/scripts/passwd-end | grep ">" | cut -d":" -f6 | cut -d"/" -f3 >> $MESSAGE
|
||||
echo "+------------------------------+" >> $MESSAGE
|
||||
mail -s "$SUBJECT" "$TO" < $MESSAGE
|
||||
rm $MESSAGE
|
||||
fi
|
||||
```
|
||||
|
||||
给 “new-user-detail.sh” 文件添加可执行权限。
|
||||
给 `new-user-detail.sh` 文件添加可执行权限。
|
||||
|
||||
```
|
||||
$ chmod +x /opt/scripts/new-user-detail.sh
|
||||
@@ -116,7 +106,7 @@ via: https://www.2daygeek.com/linux-shell-script-to-monitor-user-creation-send-e
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][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/) 荣誉推出
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11364-1.html)
|
||||
[#]: subject: (An introduction to Virtual Machine Manager)
|
||||
[#]: via: (https://opensource.com/article/19/9/introduction-virtual-machine-manager)
|
||||
[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss)
|
||||
|
||||
虚拟机管理器(Virtual Machine Manager)简介
|
||||
======
|
||||
|
||||
> virt-manager 为 Linux 虚拟化提供了全方位的选择。
|
||||
|
||||

|
||||
|
||||
在我关于 [GNOME Boxes][3] 的[系列文章][2]中,我已经解释了 Linux 用户如何能够在他们的桌面上快速启动虚拟机。当你只需要简单的配置时,Box 可以轻而易举地创建虚拟机。
|
||||
|
||||
但是,如果你需要在虚拟机中配置更多详细信息,那么你就需要一个工具,为磁盘、网卡(NIC)和其他硬件提供全面的选项。这时就需要 [虚拟机管理器(Virtual Machine Manager)][4](virt-manager)了。如果在应用菜单中没有看到它,你可以从包管理器或命令行安装它:
|
||||
|
||||
* 在 Fedora 上:`sudo dnf install virt-manager`
|
||||
* 在 Ubuntu 上:`sudo apt install virt-manager`
|
||||
|
||||
安装完成后,你可以从应用菜单或在命令行中输入 `virt-manager` 启动。
|
||||
|
||||
![Virtual Machine Manager's main screen][5]
|
||||
|
||||
为了演示如何使用 virt-manager 创建虚拟机,我将设置一个 Red Hat Enterprise Linux 8 虚拟机。
|
||||
|
||||
首先,单击 “<ruby>文件<rt>File</rt></ruby>” 然后点击 “<ruby>新建虚拟机<rt>New Virtual Machine</rt></ruby>”。Virt-manager 的开发者已经标记好了每一步(例如,“<ruby>第 1 步,共 5 步<rt>Step 1 of 5</rt></ruby>”)来使其变得简单。单击 “<ruby>本地安装介质<rt>Local install media</rt></ruby>” 和 “<ruby>下一步<rt>Forward</rt></ruby>”。
|
||||
|
||||
![Step 1 virtual machine creation][6]
|
||||
|
||||
在下个页面中,选择要安装的操作系统的 ISO 文件。(RHEL 8 镜像位于我的下载目录中。)Virt-manager 自动检测操作系统。
|
||||
|
||||
![Step 2 Choose the ISO File][7]
|
||||
|
||||
在步骤 3 中,你可以指定虚拟机的内存和 CPU。默认值为内存 1,024MB 和一个 CPU。
|
||||
|
||||
![Step 3 Set CPU and Memory][8]
|
||||
|
||||
我想给 RHEL 充足的配置来运行,我使用的硬件配置也充足,所以我将它们(分别)增加到 4,096MB 和两个 CPU。
|
||||
|
||||
下一步为虚拟机配置存储。默认设置是 10GB 硬盘。(我保留此设置,但你可以根据需要进行调整。)你还可以选择现有磁盘镜像或在自定义位置创建一个磁盘镜像。
|
||||
|
||||
![Step 4 Configure VM Storage][9]
|
||||
|
||||
步骤 5 是命名虚拟机并单击“<ruby>完成<rt>Finish</rt></ruby>”。这相当于创建了一台虚拟机,也就是 GNOME Boxes 中的一个 Box。虽然技术上讲是最后一步,但你有几个选择(如下面的截图所示)。由于 virt-manager 的优点是能够自定义虚拟机,因此在单击“<ruby>完成<rt>Finish</rt></ruby>”之前,我将选中“<ruby>在安装前定制配置<rt>Customize configuration before install</rt></ruby>”的复选框。
|
||||
|
||||
因为我选择了自定义配置,virt-manager 打开了一个有一组设备和设置的页面。这里是重点!
|
||||
|
||||
这里你也可以命名该虚拟机。在左侧列表中,你可以查看各个方面的详细信息,例如 CPU、内存、磁盘、控制器和许多其他项目。例如,我可以单击 “CPU” 来验证我在步骤 3 中所做的更改。
|
||||
|
||||
![Changing the CPU count][10]
|
||||
|
||||
我也可以确认我设置的内存量。
|
||||
|
||||
当虚拟机作为服务器运行时,我通常会禁用或删除声卡。为此,请选择 “<ruby>声卡<rt>Sound</rt></ruby>” 并单击 “<ruby>移除<rt>Remove</rt></ruby>” 或右键单击 “<ruby>声卡<rt>Sound</rt></ruby>” 并选择 “<ruby>移除硬件<rt>Remove Hardware</rt></ruby>”。
|
||||
|
||||
你还可以使用底部的 “<ruby>添加硬件<rt>Add Hardware</rt></ruby>” 按钮添加硬件。这会打开 “<ruby>添加新的虚拟硬件<rt>Add New Virtual Hardware</rt></ruby>” 页面,你可以在其中添加其他存储设备、内存、声卡等。这就像可以访问一个库存充足的(虚拟)计算机硬件仓库。
|
||||
|
||||
![The Add New Hardware screen][11]
|
||||
|
||||
对 VM 配置感到满意后,单击 “<ruby>开始安装<rt>Begin Installation</rt></ruby>”,系统将启动并开始从 ISO 安装指定的操作系统。
|
||||
|
||||
![Begin installing the OS][12]
|
||||
|
||||
完成后,它会重新启动,你的新虚拟机就可以使用了。
|
||||
|
||||
![Red Hat Enterprise Linux 8 running in VMM][13]
|
||||
|
||||
Virtual Machine Manager 是桌面 Linux 用户的强大工具。它是开源的,是专有和封闭虚拟化产品的绝佳替代品。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/introduction-virtual-machine-manager
|
||||
|
||||
作者:[Alan Formy-Duval][a]
|
||||
选题:[lujun9972][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/alanfdoss
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming)
|
||||
[2]: https://opensource.com/sitewide-search?search_api_views_fulltext=GNOME%20Box
|
||||
[3]: https://wiki.gnome.org/Apps/Boxes
|
||||
[4]: https://virt-manager.org/
|
||||
[5]: https://opensource.com/sites/default/files/1-vmm_main_0.png (Virtual Machine Manager's main screen)
|
||||
[6]: https://opensource.com/sites/default/files/2-vmm_step1_0.png (Step 1 virtual machine creation)
|
||||
[7]: https://opensource.com/sites/default/files/3-vmm_step2.png (Step 2 Choose the ISO File)
|
||||
[8]: https://opensource.com/sites/default/files/4-vmm_step3default.png (Step 3 Set CPU and Memory)
|
||||
[9]: https://opensource.com/sites/default/files/6-vmm_step4.png (Step 4 Configure VM Storage)
|
||||
[10]: https://opensource.com/sites/default/files/9-vmm_customizecpu.png (Changing the CPU count)
|
||||
[11]: https://opensource.com/sites/default/files/11-vmm_addnewhardware.png (The Add New Hardware screen)
|
||||
[12]: https://opensource.com/sites/default/files/12-vmm_rhelbegininstall.png
|
||||
[13]: https://opensource.com/sites/default/files/13-vmm_rhelinstalled_0.png (Red Hat Enterprise Linux 8 running in VMM)
|
||||
@@ -0,0 +1,346 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (asche910)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11367-1.html)
|
||||
[#]: subject: (How to Find and Replace a String in File Using the sed Command in Linux)
|
||||
[#]: via: (https://www.2daygeek.com/linux-sed-to-find-and-replace-string-in-files/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
使用 sed 命令查找和替换文件中的字符串的 16 个示例
|
||||
======
|
||||
|
||||

|
||||
|
||||
当你在使用文本文件时,很可能需要查找和替换文件中的字符串。`sed` 命令主要用于替换一个文件中的文本。在 Linux 中这可以通过使用 `sed` 命令和 `awk` 命令来完成。
|
||||
|
||||
在本教程中,我们将告诉你使用 `sed` 命令如何做到这一点,然后讨论讨论 `awk` 命令相关的。
|
||||
|
||||
### sed 命令是什么
|
||||
|
||||
`sed` 命令表示 Stream Editor(流编辑器),用来在 Linux 上执行基本的文本操作。它可以执行各种功能,如搜索、查找、修改、插入或删除文件。
|
||||
|
||||
此外,它也可以执行复杂的正则表达式匹配。
|
||||
|
||||
它可用于以下目的:
|
||||
|
||||
* 查找和替换匹配给定的格式的内容。
|
||||
* 在指定行查找和替换匹配给定的格式的内容。
|
||||
* 在所有行查找和替换匹配给定的格式的内容。
|
||||
* 搜索并同时替换两种不同的模式。
|
||||
|
||||
本文列出的十五个例子可以帮助你掌握 `sed` 命令。
|
||||
|
||||
如果要使用 `sed` 命令删除文件中的行,去下面的文章。
|
||||
|
||||
注意:由于这是一篇演示文章,我们使用不带 `-i` 选项的 `sed` 命令,该选项会在 Linux 终端中删除行并打印文件内容。
|
||||
|
||||
但是,在实际环境中如果你想删除源文件中的行,使用带 `-i` 选项的 `sed` 命令。
|
||||
|
||||
常见的 `sed` 替换字符串的语法。
|
||||
|
||||
```
|
||||
sed -i 's/Search_String/Replacement_String/g' Input_File
|
||||
```
|
||||
|
||||
首先我们需要了解 `sed` 语法来做到这一点。请参阅有关的细节。
|
||||
|
||||
* `sed`:这是一个 Linux 命令。
|
||||
* `-i`:这是 `sed` 命令的一个选项,它有什么作用?默认情况下,`sed` 打印结果到标准输出。当你使用 `sed` 添加这个选项时,那么它会在适当的位置修改文件。当你添加一个后缀(比如,`-i.bak`)时,就会创建原始文件的备份。
|
||||
* `s`:字母 `s` 是一个替换命令。
|
||||
* `Search_String`:搜索一个给定的字符串或正则表达式。
|
||||
* `Replacement_String`:替换的字符串。
|
||||
* `g`:全局替换标志。默认情况下,`sed` 命令替换每一行第一次出现的模式,它不会替换行中的其他的匹配结果。但是,提供了该替换标志时,所有匹配都将被替换。
|
||||
* `/`:分界符。
|
||||
* `Input_File`:要执行操作的文件名。
|
||||
|
||||
让我们来看看文件中用sed命令来搜索和转换文本的一些常用例子。
|
||||
|
||||
我们已经创建了用于演示的以下文件。
|
||||
|
||||
```
|
||||
# cat sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 1) 如何查找和替换一行中“第一次”模式匹配
|
||||
|
||||
下面的 `sed` 命令用 `linux` 替换文件中的 `unix`。这仅仅改变了每一行模式的第一个实例。
|
||||
|
||||
```
|
||||
# sed 's/unix/linux/' sed-test.txt
|
||||
|
||||
1 Unix linux unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxlinux UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 2) 如何查找和替换每一行中“第 N 次”出现的模式
|
||||
|
||||
在行中使用`/1`、`/2`……`/n` 等标志来代替相应的匹配。
|
||||
|
||||
下面的 `sed` 命令在一行中用 `linux` 来替换 `unix` 模式的第二个实例。
|
||||
|
||||
```
|
||||
# sed 's/unix/linux/2' sed-test.txt
|
||||
|
||||
1 Unix unix linux 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 3) 如何搜索和替换一行中所有的模式实例
|
||||
|
||||
下面的 `sed` 命令用 `linux` 替换 `unix` 格式的所有实例,因为 `g` 是一个全局替换标志。
|
||||
|
||||
```
|
||||
# sed 's/unix/linux/g' sed-test.txt
|
||||
|
||||
1 Unix linux linux 23
|
||||
2 linux Linux 34
|
||||
3 linuxlinux UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 4) 如何查找和替换一行中从“第 N 个”开始的所有匹配的模式实例
|
||||
|
||||
下面的 `sed` 命令在一行中替换从模式的“第 N 个”开始的匹配实例。
|
||||
|
||||
```
|
||||
# sed 's/unix/linux/2g' sed-test.txt
|
||||
|
||||
1 Unix unix linux 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 5) 在特定的行号搜索和替换模式
|
||||
|
||||
你可以替换特定行号中的字符串。下面的 `sed` 命令用 `linux` 仅替换第三行的 `unix` 模式。
|
||||
|
||||
```
|
||||
# sed '3 s/unix/linux/' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxlinux UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 6) 在特定范围行号间搜索和替换模式
|
||||
|
||||
你可以指定行号的范围,以替换字符串。
|
||||
|
||||
下面的 `sed` 命令在 1 到 3 行间用 `linux` 替换 `Unix` 模式。
|
||||
|
||||
```
|
||||
# sed '1,3 s/unix/linux/' sed-test.txt
|
||||
|
||||
1 Unix linux unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxlinux UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 7) 如何查找和修改最后一行的模式
|
||||
|
||||
下面的 sed 命令允许你只在最后一行替换匹配的字符串。
|
||||
|
||||
下面的 `sed` 命令只在最后一行用 `Unix` 替换 `Linux` 模式。
|
||||
|
||||
```
|
||||
# sed '$ s/Linux/Unix/' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Unix is free and opensource operating system
|
||||
```
|
||||
|
||||
### 8) 在一行中如何只查找和替换正确的模式匹配
|
||||
|
||||
你可能已经注意到,子串 `linuxunix` 被替换为在第 6 个示例中的 `linuxlinux`。如果你只想更改正确的匹配词,在搜索串的两端用这个边界符 `\b`。
|
||||
|
||||
```
|
||||
# sed '1,3 s/\bunix\b/linux/' sed-test.txt
|
||||
|
||||
1 Unix linux unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 9) 如何以不区分大小写来搜索与替换模式
|
||||
|
||||
大家都知道,Linux 是区分大小写的。为了与不区分大小写的模式匹配,使用 `I` 标志。
|
||||
|
||||
```
|
||||
# sed 's/unix/linux/gI' sed-test.txt
|
||||
|
||||
1 linux linux linux 23
|
||||
2 linux Linux 34
|
||||
3 linuxlinux linuxLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 10) 如何查找和替换包含分隔符的字符串
|
||||
|
||||
当你搜索和替换含分隔符的字符串时,我们需要用反斜杠 `\` 来取消转义。
|
||||
|
||||
在这个例子中,我们将用 `/usr/bin/fish` 来替换 `/bin/bash`。
|
||||
|
||||
```
|
||||
# sed 's/\/bin\/bash/\/usr\/bin\/fish/g' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /usr/bin/fish CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
上述 `sed` 命令按预期工作,但它看起来来很糟糕。 为了简化,大部分的人会用竖线 `|` 作为正则表达式的定位符。 所以,我建议你用它。
|
||||
|
||||
```
|
||||
# sed 's|/bin/bash|/usr/bin/fish/|g' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /usr/bin/fish/ CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 11) 如何以给定的模式来查找和替换数字
|
||||
|
||||
类似地,数字可以用模式来代替。下面的 `sed` 命令以 `[0-9]` 替换所有数字为 `number`。
|
||||
|
||||
```
|
||||
# sed 's/[0-9]/number/g' sed-test.txt
|
||||
|
||||
number Unix unix unix numbernumber
|
||||
number linux Linux numbernumber
|
||||
number linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 12) 如何用模式仅查找和替换两个数字
|
||||
|
||||
如果你想用模式来代替两位数字,使用下面的 `sed` 命令。
|
||||
|
||||
```
|
||||
# sed 's/\b[0-9]\{2\}\b/number/g' sed-test.txt
|
||||
|
||||
1 Unix unix unix number
|
||||
2 linux Linux number
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 13) 如何用 sed 命令仅打印被替换的行
|
||||
|
||||
如果你想显示仅更改的行,使用下面的 `sed` 命令。
|
||||
|
||||
* `p` - 它在终端上输出替换的行两次。
|
||||
* `-n` - 它抑制由 `p` 标志所产生的重复行。
|
||||
|
||||
```
|
||||
# sed -n 's/Unix/Linux/p' sed-test.txt
|
||||
|
||||
1 Linux unix unix 23
|
||||
3 linuxunix LinuxLinux
|
||||
```
|
||||
|
||||
### 14) 如何同时运行多个 sed 命令
|
||||
|
||||
以下 `sed` 命令同时检测和置换两个不同的模式。
|
||||
|
||||
下面的 `sed` 命令搜索 `linuxunix` 和 `CentOS` 模式,用 `LINUXUNIX` 和 `RHEL8` 一次性更换它们。
|
||||
|
||||
```
|
||||
# sed -e 's/linuxunix/LINUXUNIX/g' -e 's/CentOS/RHEL8/g' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 LINUXUNIX UnixLinux
|
||||
linux /bin/bash RHEL8 Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
下面的 `sed` 命令搜索替换两个不同的模式,并一次性替换为一个字符串。
|
||||
|
||||
以下 `sed` 的命令搜索 `linuxunix` 和 `CentOS` 模式,用 `Fedora30` 替换它们。
|
||||
|
||||
```
|
||||
# sed -e 's/\(linuxunix\|CentOS\)/Fedora30/g' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 Fedora30 UnixLinux
|
||||
linux /bin/bash Fedora30 Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 15) 如果给定的模式匹配,如何查找和替换整个行
|
||||
|
||||
如果模式匹配,可以使用 `sed` 命令用新行来代替整行。这可以通过使用 `c` 标志来完成。
|
||||
|
||||
```
|
||||
# sed '/OS/ c\
|
||||
New Line
|
||||
' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
New Line
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 16) 如何搜索和替换相匹配的模式行
|
||||
|
||||
在 `sed` 命令中你可以为行指定适合的模式。在匹配该模式的情况下,`sed` 命令搜索要被替换的字符串。
|
||||
|
||||
下面的 `sed` 命令首先查找具有 `OS` 模式的行,然后用 `ArchLinux` 替换单词 `Linux`。
|
||||
|
||||
```
|
||||
# sed '/OS/ s/Linux/ArchLinux/' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS ArchLinux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/linux-sed-to-find-and-replace-string-in-files/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[Asche910](https://github.com/asche910)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
@@ -0,0 +1,139 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Morisun029)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11360-1.html)
|
||||
[#]: subject: (How to Check Linux Mint Version Number & Codename)
|
||||
[#]: via: (https://itsfoss.com/check-linux-mint-version/)
|
||||
[#]: author: (Sergiu https://itsfoss.com/author/sergiu/)
|
||||
|
||||
如何查看 Linux Mint 版本号和代号
|
||||
======
|
||||
|
||||
Linux Mint 每两年发布一次主版本(如 Mint 19),每六个月左右发布一次次版本(如 Mint 19.1、19.2 等)。 你可以自己升级 Linux Mint 版本,而次版本也会自动更新。
|
||||
|
||||
在所有这些版本中,你可能想知道你正在使用的是哪个版本。了解 Linux Mint 版本号可以帮助你确定某个特定软件是否适用于你的系统,或者检查你的系统是否已达到使用寿命。
|
||||
|
||||
你可能需要 Linux Mint 版本号有多种原因,你也有多种方法可以获取此信息。让我向你展示用图形和命令行的方式获取 Mint 版本信息。
|
||||
|
||||
* [使用命令行查看 Linux Mint 版本信息][1]
|
||||
* [使用 GUI(图形用户界面)查看 Linux Mint 版本信息][2]
|
||||
|
||||
### 使用终端查看 Linux Mint 版本号的方法
|
||||
|
||||
![][3]
|
||||
|
||||
我将介绍几种使用非常简单的命令查看 Linux Mint 版本号和代号的方法。 你可以从 “菜单” 中打开终端,或按 `CTRL+ALT+T`(默认热键)打开。
|
||||
|
||||
本文中的最后两个命令还会输出你当前的 Linux Mint 版本所基于的 Ubuntu 版本。
|
||||
|
||||
#### 1、/etc/issue
|
||||
|
||||
从最简单的 CLI 方法开始,你可以打印出 `/etc/issue` 的内容来检查你的版本号和代号:
|
||||
|
||||
```
|
||||
[email protected]:~$ cat /etc/issue
|
||||
Linux Mint 19.2 Tina \n \l
|
||||
```
|
||||
|
||||
#### 2、hostnamectl
|
||||
|
||||
![hostnamectl][4]
|
||||
|
||||
这一个命令(`hostnamectl`)打印的信息几乎与“系统信息”中的信息相同。 你可以看到你的操作系统(带有版本号)以及你的内核版本。
|
||||
|
||||
#### 3、lsb_release
|
||||
|
||||
`lsb_release` 是一个非常简单的 Linux 实用程序,用于查看有关你的发行版本的基本信息:
|
||||
|
||||
```
|
||||
[email protected]:~$ lsb_release -a
|
||||
No LSB modules are available.
|
||||
Distributor ID: LinuxMint
|
||||
Description: Linux Mint 19.2 Tina
|
||||
Release: 19.2
|
||||
Codename: tina
|
||||
```
|
||||
|
||||
**注:** 我使用 `–a` 标签打印所有参数, 但你也可以使用 `-s` 作为简写格式,`-d` 用于描述等 (用 `man lsb_release` 查看所有选项)
|
||||
|
||||
#### 4、/etc/linuxmint/info
|
||||
|
||||
![/etc/linuxmint/info][5]
|
||||
|
||||
这不是命令,而是 Linux Mint 系统上的文件。只需使用 `cat` 命令将其内容打印到终端,然后查看你的版本号和代号。
|
||||
|
||||
#### 5、使用 /etc/os-release 命令也可以获取到 Ubuntu 代号
|
||||
|
||||
![/etc/os-release][7]
|
||||
|
||||
Linux Mint 基于 Ubuntu。每个 Linux Mint 版本都基于不同的 Ubuntu 版本。了解你的 Linux Mint 版本所基于的 Ubuntu 版本有助你在必须要使用 Ubuntu 版本号的情况下使用(比如你需要在 [Linux Mint 中安装最新的 Virtual Box][8]添加仓库时)。
|
||||
|
||||
`os-release` 则是另一个类似于 `info` 的文件,向你展示 Linux Mint 所基于的 Ubuntu 版本代号。
|
||||
|
||||
#### 6、使用 /etc/upstream-release/lsb-release 只获取 Ubuntu 的基本信息
|
||||
|
||||
如果你只想要查看有关 Ubuntu 的基本信息,请输出 `/etc/upstream-release/lsb-release`:
|
||||
|
||||
```
|
||||
[email protected]:~$ cat /etc/upstream-release/lsb-release
|
||||
DISTRIB_ID=Ubuntu
|
||||
DISTRIB_RELEASE=18.04
|
||||
DISTRIB_CODENAME=bionic
|
||||
DISTRIB_DESCRIPTION="Ubuntu 18.04 LTS"
|
||||
```
|
||||
|
||||
特别提示:[你可以使用 uname 命令查看 Linux 内核版本][9]。
|
||||
|
||||
```
|
||||
[email protected]:~$ uname -r
|
||||
4.15.0-54-generic
|
||||
```
|
||||
|
||||
**注:** `-r` 代表 release,你可以使用 `man uname` 查看其他信息。
|
||||
|
||||
### 使用 GUI 查看 Linux Mint 版本信息
|
||||
|
||||
如果你对终端和命令行不满意,可以使用图形方法。如你所料,这个非常明了。
|
||||
|
||||
打开“菜单” (左下角),然后转到“偏好设置 > 系统信息”:
|
||||
|
||||
![Linux Mint 菜单][10]
|
||||
|
||||
或者,在菜单中,你可以搜索“System Info”:
|
||||
|
||||
![Menu Search System Info][11]
|
||||
|
||||
在这里,你可以看到你的操作系统(包括版本号),内核和桌面环境的版本号:
|
||||
|
||||
![System Info][12]
|
||||
|
||||
### 总结
|
||||
|
||||
我已经介绍了一些不同的方法,用这些方法你可以快速查看你正在使用的 Linux Mint 的版本和代号(以及所基于的 Ubuntu 版本和内核)。我希望这个初学者教程对你有所帮助。请在评论中告诉我们你最喜欢哪个方法!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/check-linux-mint-version/
|
||||
|
||||
作者:[Sergiu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[Morisun029](https://github.com/Morisun029)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sergiu/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: tmp.pL5Hg3N6Qt#terminal
|
||||
[2]: tmp.pL5Hg3N6Qt#GUI
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/09/check-linux-mint-version.png?ssl=1
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/09/hostnamectl.jpg?ssl=1
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/09/linuxmint_info.jpg?ssl=1
|
||||
[6]: https://itsfoss.com/rid-google-chrome-icons-dock-elementary-os-freya/
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/os_release.jpg?ssl=1
|
||||
[8]: https://itsfoss.com/install-virtualbox-ubuntu/
|
||||
[9]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/
|
||||
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/09/linux_mint_menu.jpg?ssl=1
|
||||
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/menu_search_system_info.jpg?ssl=1
|
||||
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/system_info.png?ssl=1
|
||||
@@ -0,0 +1,146 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (name1e5s)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11358-1.html)
|
||||
[#]: subject: (Amid Epstein Controversy, Richard Stallman is Forced to Resign as FSF President)
|
||||
[#]: via: (https://itsfoss.com/richard-stallman-controversy/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
Richard Stallman 被迫辞去 FSF 主席的职务
|
||||
======
|
||||
|
||||
> Richard Stallman,自由软件基金会的创建者以及主席,已经辞去主席及董事会职务。此前,因为 Stallman 对于爱泼斯坦事件中的受害者的观点,一小撮活动家以及媒体人发起了清除 Stallman 的运动。这份声明就是在这些活动后发生的。阅读全文以获得更多信息。
|
||||
|
||||
![][1]
|
||||
|
||||
### Stallman 事件的背景概述
|
||||
|
||||
如果你不知道这次事件发生的前因后果,请看本段的详细信息。
|
||||
|
||||
[Richard Stallman][2],66岁,是就职于 [MIT][3] 的计算机科学家。他最著名的成就就是在 1983 年发起了[自由软件运动][4]。他也开发了 GNU 项目旗下的部分软件,比如 GCC 和 Emacs。受自由软件运动影响选择使用 GPL 开源协议的项目不计其数。Linux 是其中最出名的项目之一。
|
||||
|
||||
[Jeffrey Epstein][5](爱泼斯坦),美国亿万富翁,金融大佬。其涉嫌为社会上流精英提供性交易服务(其中有未成年少女)而被指控成为性犯罪者。在受审期间,爱泼斯坦在监狱中自杀身亡。
|
||||
|
||||
[Marvin Lee Minsky][6],MIT 知名计算机科学家。他在 MIT 建立了人工智能实验室。2016 年,88 岁的 Minsky 逝世。在 Minsky 逝世后,一位名为 Misky 的爱泼斯坦事件受害者声称其在未成年时曾被“诱导”到爱泼斯坦的私人岛屿,与之发生性关系。
|
||||
|
||||
但是这些与 Richard Stallman 有什么关系?这要从 Stallman 发给 MIT 计算机科学与人工智能实验室(CSAIL)的学生以及附属机构就爱泼斯坦的捐款提出抗议的邮件列表的邮件说起。邮件全文翻译如下:
|
||||
|
||||
> 周五事件的公告对 Marvin Minsky 来说是不公正的。
|
||||
>
|
||||
> “已故的人工智能 ‘先锋’ Marvin Minsky (被控告侵害了爱泼斯坦事件的受害者之一\[2])”
|
||||
>
|
||||
> 不公正之处在于 “<ruby>侵害<rt>assulting</rt></ruby>” 这个用语。“<ruby>性侵犯<rt>sexual assault</rt></ruby>” 这个用语非常的糢糊,夸大了指控的严重性:宣称某人做了 X 但误导别人,让别人觉得这个人做了 Y,Y 远远比 X 严重。
|
||||
>
|
||||
> 上面引用的指控显然就是夸大。报导声称 Minksy 与爱泼斯坦的<ruby>女眷<rt>harem</rt></ruby>之一发生了性关系(详见 <https://www.theverge.com/2019/8/9/20798900/marvin-minsky-jeffrey-epstein-sex-trafficking-island-court-records-unsealed>)。我们假设这是真的(我找不到理由不相信)。
|
||||
>
|
||||
> “<ruby>侵害<rt>assulting</rt></ruby>” 这个词,意味着他使用了某种暴力。但那篇报道并没有提到这个,只说了他们发生了性关系。
|
||||
>
|
||||
> 我们可以想像很多种情况,但最合理的情况是,她在 Marvin 面前表现的像是完全自愿的。假设她是被爱泼斯坦强迫的,那爱泼斯坦有充足的理由让她对大多数人守口如瓶。
|
||||
>
|
||||
> 从各种的指控夸大事例中,我总结出,在指控时使用“<ruby>性侵犯<rt>sexual assault</rt></ruby>”是绝对错误的。
|
||||
>
|
||||
> 无论你想要批判什么行为,你都应该使用特定的词汇来描述,以此避免批判的本质的道德模糊性。
|
||||
|
||||
### “清除 Stallman” 的呼吁
|
||||
|
||||
‘爱泼斯坦’在美国是颇具争议的‘话题’。Stallman 对该敏感事件做出如此鲁莽的 “知识陈述” 不会有好结果,事实也是如此。
|
||||
|
||||
一位机器人学工程师从她的朋友那里收到了转发的邮件并发起了一个[清除 Stallman 的活动][7]。她要的不是澄清或者道歉,她只想要清除斯托曼,就算这意味着 “将 MIT 夷为平地” 也在所不惜。
|
||||
|
||||
> 是,至少 Stallman 没有被控强奸任何人。但这就是我们的最高标准吗?这所声望极高的学院坚持的标准就是这样的吗?如果这是麻省理工学院想要捍卫的、想要代表的标准的话,还不如把这破学校夷为平地…
|
||||
>
|
||||
> 如果有必要的话,就把所有人都清除出去,之后从废墟中建立出更好的秩序。
|
||||
>
|
||||
> —— Salem,发起“清除 Stallman“运动的机器人学专业学生
|
||||
|
||||
Salem 的声讨最初没有被主流媒体重视。但它还是被反对软件行业内的精英崇拜以及性别偏见的积极分子发现了。
|
||||
|
||||
> [#epstein][8] [#MIT][9] 嗨 记者没有回复我我很生气就自己写了这么个故事。作为 MIT 的校友我还真是高兴啊🙃 <https://t.co/D4V5L5NzPA>
|
||||
>
|
||||
> — SZJG (@selamjie) [September 12, 2019][10]
|
||||
|
||||
.
|
||||
|
||||
> 是不是对于性侵儿童的 “杰出混蛋” 我们也可以辩护说 “万一这是你情我愿的” <https://t.co/gSYPJ3WOfp>
|
||||
>
|
||||
> — Tracy Chou 👩🏻💻 (@triketora) [September 13, 2019][11]
|
||||
|
||||
.
|
||||
|
||||
> 多年来我就一直发推说 Richard "RMS" Stallman 这人有多恶心 —— 恋童癖、厌女症、还残障歧视
|
||||
>
|
||||
> 不可避免的是,每次我这样做,都会有老哥检查我的数据来源,然后说 “这都是几年前的事了!他现在变了!”
|
||||
>
|
||||
> 变个屁。 <https://t.co/ti2SrlKObp>
|
||||
>
|
||||
> — Sarah Mei (@sarahmei) [September 12, 2019][12]
|
||||
|
||||
下面是 Sage Sharp 开头的一篇关于 Stallman 的行为如何对科技人员产生负面影响的帖子:
|
||||
|
||||
> 👇大家说下 Richard Stallman 对科技从业者的影响吧,尤其是女性。 [例如: 强奸、乱伦、残障歧视、性交易]
|
||||
>
|
||||
> [@fsf][13] 有必要永久禁止 Richard Stallman 担任自由软件基金会董事会主席。
|
||||
>
|
||||
> — Sage Sharp (@\_sagesharp\_) [September 16, 2019][14]
|
||||
|
||||
Stallman 一直以来也不是一个圣人。他粗暴,不合时宜、多年来一直在开带有性别歧视的笑话。你可以在[这里][15]和[这里][16]读到。
|
||||
|
||||
很快这个消息就被 [The Vice][17]、[每日野兽][18],[未来主义][19]等大媒体采访。他们把 Stallman 描绘成爱泼斯坦的捍卫者。在强烈的抗议声中,[GNOME 执行董事威胁要结束 GNOME 和 FSF 之间的关系][20]。
|
||||
|
||||
最后,Stallman 先是从 MIT 辞职,现在又从 [自由软件基金会][21] 辞职。
|
||||
|
||||
![][22]
|
||||
|
||||
### 危险的特权?
|
||||
|
||||
我们见识到了,把一个人从他创建并为之工作了三十多年的组织中驱逐出去仅仅需要五天。这甚至还是在 Stallman 没有参与性交易丑闻的情况下。
|
||||
|
||||
其中一些 “活动家” 过去也曾[针对过 Linux 的作者 Linus Torvalds][23]。Linux 基金会背后的管理层预见到了科技行业激进主义的增长趋势,因此他们制定了[适用于 Linux 内核开发的行为准则][24]并[强制 Torvalds 接受培训以改善他的行为][25]。如果他们没有采取纠正措施,可能 Torvalds 也已经被批倒批臭了。
|
||||
|
||||
忽视技术支持者的鲁莽行为和性别歧视是不可接受的,但是对于那些遇到不同意某种流行观点的人就进行声讨,施以私刑也是不道德的做法。我不支持 Stallman 和他过去的言论,但我也不能接受他以这种方式(被迫?)辞职。
|
||||
|
||||
Techrights 对此有一些有趣的评论,你可以在[这里][26]和[这里][27]看到。
|
||||
|
||||
*你对此事有何看法?请文明分享你的观点和意见。过激评论将不会公布。*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/richard-stallman-controversy/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[name1e5s](https://github.com/name1e5s)
|
||||
校对:[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/lujun9972
|
||||
[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/stallman-conroversy.png?w=800&ssl=1
|
||||
[2]: https://en.wikipedia.org/wiki/Richard_Stallman
|
||||
[3]: https://en.wikipedia.org/wiki/Massachusetts_Institute_of_Technology
|
||||
[4]: https://en.wikipedia.org/wiki/Free_software_movement
|
||||
[5]: https://en.wikipedia.org/wiki/Jeffrey_Epstein
|
||||
[6]: https://en.wikipedia.org/wiki/Marvin_Minsky
|
||||
[7]: https://medium.com/@selamie/remove-richard-stallman-fec6ec210794
|
||||
[8]: https://twitter.com/hashtag/epstein?src=hash&ref_src=twsrc%5Etfw
|
||||
[9]: https://twitter.com/hashtag/MIT?src=hash&ref_src=twsrc%5Etfw
|
||||
[10]: https://twitter.com/selamjie/status/1172244207978897408?ref_src=twsrc%5Etfw
|
||||
[11]: https://twitter.com/triketora/status/1172443389536555009?ref_src=twsrc%5Etfw
|
||||
[12]: https://twitter.com/sarahmei/status/1172283772428906496?ref_src=twsrc%5Etfw
|
||||
[13]: https://twitter.com/fsf?ref_src=twsrc%5Etfw
|
||||
[14]: https://twitter.com/_sagesharp_/status/1173637138413318144?ref_src=twsrc%5Etfw
|
||||
[15]: https://geekfeminism.wikia.org/wiki/Richard_Stallman
|
||||
[16]: https://medium.com/@selamie/remove-richard-stallman-appendix-a-a7e41e784f88
|
||||
[17]: https://www.vice.com/en_us/article/9ke3ke/famed-computer-scientist-richard-stallman-described-epstein-victims-as-entirely-willing
|
||||
[18]: https://www.thedailybeast.com/famed-mit-computer-scientist-richard-stallman-defends-epstein-victims-were-entirely-willing
|
||||
[19]: https://futurism.com/richard-stallman-epstein-scandal
|
||||
[20]: https://blog.halon.org.uk/2019/09/gnome-foundation-relationship-gnu-fsf/
|
||||
[21]: https://www.fsf.org/news/richard-m-stallman-resigns
|
||||
[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/richard-stallman.png?resize=800%2C94&ssl=1
|
||||
[23]: https://www.newyorker.com/science/elements/after-years-of-abusive-e-mails-the-creator-of-linux-steps-aside
|
||||
[24]: https://itsfoss.com/linux-code-of-conduct/
|
||||
[25]: https://itsfoss.com/torvalds-takes-a-break-from-linux/
|
||||
[26]: http://techrights.org/2019/09/15/media-attention-has-been-shifted/
|
||||
[27]: http://techrights.org/2019/09/16/stallman-removed/
|
||||
@@ -0,0 +1,64 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11366-1.html)
|
||||
[#]: subject: (Oracle Unleashes World’s Fastest Database Machine ‘Exadata X8M’)
|
||||
[#]: via: (https://opensourceforu.com/2019/09/oracle-unleashes-worlds-fastest-database-machine-exadata-x8m/)
|
||||
[#]: author: (Longjam Dineshwori https://opensourceforu.com/author/dineshwori-longjam/)
|
||||
|
||||
Oracle 发布全球最快的数据库机器 Exadata X8M
|
||||
======
|
||||
|
||||
> Exadata X8M 是第一台具有集成持久内存和 RoCE 的数据库机器。Oracle 还宣布推出 Oracle 零数据丢失恢复设备 X8M(ZDLRA)。
|
||||
|
||||

|
||||
|
||||
Oracle 发布了新的 Exadata 数据库机器 X8M,旨在为数据库基础架构市场树立新的标杆。
|
||||
|
||||
Exadata X8M 结合了英特尔 Optane DC 持久存储器和通过融合以太网(RoCE)的 100 千兆的远程直接内存访问(RDMA)来消除存储瓶颈,并显著提高性能,其适用于最苛刻的工作负载,如在线事务处理(OLTP)、分析、物联网、欺诈检测和高频交易。
|
||||
|
||||
“借助 Exadata X8M,我们可以提供内存级的性能,同时为 OLTP 和分析提供共享存储的所有优势,”Oracle 任务关键型数据库技术执行副总裁 Juan Loaiza 说。
|
||||
|
||||
“使用对共享持久存储器的直接数据库访问将响应时间减少一个数量级,可加速每个 OLTP 应用程序,它是需要实时访问大量数据的应用程序的游戏规则改变者,例如欺诈检测和个性化购物,”官方补充。
|
||||
|
||||
### 它有什么独特之处?
|
||||
|
||||
Oracle Exadata X8M 使用 RDMA 让数据库直接访问智能存储服务器中的持久内存,从而绕过整个操作系统、IO 和网络软件堆栈。这导致更低的延迟和更高的吞吐量。使用 RDMA 绕过软件堆栈还可以释放存储服务器上的 CPU 资源,以执行更多智能扫描查询来支持分析工作负载。
|
||||
|
||||
### 更少的存储瓶颈
|
||||
|
||||
“高性能 OLTP 应用需要高的每秒输入/输出操作(IOPS)和低延迟。直接数据库访问共享持久性内存可将SQL 读取的峰值性能提升至 1600 万 IOPS,比行业领先的 Exadata X8 高出 2.5 倍,“Oracle 在一份声明中表示。
|
||||
|
||||
此外,Exadata X8M 通过使远程 IO 延迟低于 19 微秒,大大减少了关键数据库 IO 的延迟 —— 这比 Exadata X8 快 10 倍以上。即使对于每秒需要数百万 IO 的工作负载,也可实现这些超低延迟。
|
||||
|
||||
### 比 AWS 和 Azure 更高效
|
||||
|
||||
该公司声称,与 Oracle 最快的 Amazon RDS 存储相比,Exadata X8M 的延迟降低了 50 倍,IOPS 提高了 200 倍,容量提高了 15 倍。
|
||||
|
||||
与 Azure SQL 数据库服务存储相比,Exadata X8M 的延迟降低了 100 倍,IOPS 提高了 150 倍,容量提高了 300 倍。
|
||||
|
||||
据 Oracle 称,单机架 Exadata X8M 可提供高达 2 倍的 OLTP 读取 IOPS,3 倍的吞吐量和比具有持久性内存的共享存储系统(如 Dell EMC PowerMax 8000 的单机架)低 5 倍的延迟。
|
||||
|
||||
“通过同时支持更快的 OLTP 查询和更高的分析工作负载吞吐量,Exadata X8M 是融合混合工作负载环境以降低 IT 成本和复杂性的理想平台,”该公司说。
|
||||
|
||||
### Oracle 零数据丢失恢复设备 X8
|
||||
|
||||
Oracle 当天还宣布推出 Oracle 零数据丢失恢复设备 X8M(ZDLRA),它使用新的 100Gb RoCE,用于计算和存储服务器之间的高吞吐量内部数据传输。
|
||||
|
||||
Exadata 和 ZDLRA 客户现在可以在 RoCE 或基于 InfiniBand 的工程系统之间进行选择,以在其架构部署中实现最佳灵活性。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensourceforu.com/2019/09/oracle-unleashes-worlds-fastest-database-machine-exadata-x8m/
|
||||
|
||||
作者:[Longjam Dineshwori][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://opensourceforu.com/author/dineshwori-longjam/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/02/Oracle-Cloud.jpg?resize=350%2C212&ssl=1
|
||||
@@ -1,57 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Dell EMC updates PowerMax storage systems)
|
||||
[#]: via: (https://www.networkworld.com/article/3438325/dell-emc-updates-powermax-storage-systems.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
Dell EMC updates PowerMax storage systems
|
||||
======
|
||||
Dell EMC's new PowerMax enterprise storage systems add support for Intel Optane drives and NVMe over Fabric.
|
||||
Getty Images/Dell EMC
|
||||
|
||||
Dell EMC has updated its PowerMax line of enterprise storage systems to offer Intel’s Optane persistent storage and NVMe-over-Fabric, both of which will give the PowerMax a big boost in performance.
|
||||
|
||||
Last year, Dell launched the PowerMax line with high-performance storage, specifically targeting industries that need very low latency and high resiliency, such as banking, healthcare, and cloud service providers.
|
||||
|
||||
The company claims the new PowerMax is the first-to-market with dual port Intel Optane SSDs and the use of storage-class memory (SCM) as persistent storage. The Optane is a new type of non-volatile storage that sits between SSDs and memory. It has the persistence of a SSD but almost the speed of a DRAM. Optane storage also has a ridiculous price tag. For example, a 512 GB stick costs nearly $8,000.
|
||||
|
||||
**[ Read also: [Mass data fragmentation requires a storage rethink][1] | Get regularly scheduled insights: [Sign up for Network World newsletters][2] ]**
|
||||
|
||||
The other big change is support for NVMe-oF, which allows SSDs to talk directly to each other via Fibre Channel rather than making multiple hops through the network. PowerMax already supports NVMe SSDs, but this update adds end-to-end NVMe support.
|
||||
|
||||
The coupling of NVMe and Intel Optane on dual port gives the new PowerMax systems up to 15 million IOPS, a 50% improvement over the previous generation released just one year ago, with up to 50% better response times and twice the bandwidth. Response time is under 100 microseconds.
|
||||
|
||||
In addition, the new Dell EMC PowerMax systems are validated for Dell Technologies Cloud, an architecture designed to bridge multi-cloud deployments. Dell offers connections between private clouds and Amazon Web Services (AWS), Microsoft Azure, and Google Cloud.
|
||||
|
||||
PowerMax comes with a built-in machine learning engine for predictive analytics and pattern recognition to automatically place data on the correct media type, SCM or Flash, based on its I/O profile. PowerMax analyzes and forecasts 40 million data sets in real time, driving 6 billion decisions per day.
|
||||
|
||||
It also has several important software integrations. The first is VMware’s vRealize Orchestrator (vRO) plug-in, which allows customers to develop end-to-end automation routines, including provisioning, data protection, and host operations.
|
||||
|
||||
Second, it has pre-built Red Hat Ansible modules to allow customers to create Playbooks for storage provisioning, snapshots, and data management workflows for consistent and automated operations. These modules are available on GitHub now.
|
||||
|
||||
Finally, there is a container storage interface (CSI) plugin that provisions and manages storage for workloads running on Kubernetes. The CSI plugin, available now on GitHub, extends PowerMax's performance and data services to a growing number of applications built on a micro-services-based architecture.
|
||||
|
||||
The new PowerMax systems and PowerBricks will be available Monday, Sept.16.
|
||||
|
||||
Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3438325/dell-emc-updates-powermax-storage-systems.html
|
||||
|
||||
作者:[Andy Patrizio][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://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/article/3323580/mass-data-fragmentation-requires-a-storage-rethink.html
|
||||
[2]: https://www.networkworld.com/newsletters/signup.html
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
||||
@@ -1,145 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (name1e5s )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Amid Epstein Controversy, Richard Stallman is Forced to Resign as FSF President)
|
||||
[#]: via: (https://itsfoss.com/richard-stallman-controversy/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
Amid Epstein Controversy, Richard Stallman is Forced to Resign as FSF President
|
||||
======
|
||||
|
||||
_**Richard Stallman, founder and president of the Free Software Foundation, has resigned as the president and from its board of directors. The announcement has come after a relentless campaign by a few activists and media person to remove Stallman for his views on the Epstein victims. Read more to get the details.**_
|
||||
|
||||
![][1]
|
||||
|
||||
### A little background to the Stallman controversy
|
||||
|
||||
If you are not aware of the context, let me provide some details.
|
||||
|
||||
[Richard Stallman][2], a 66 years old computer scientist at [MIT][3], is best known for founding the [free software movement][4] in 1983. He also developed several software like GCC, Emacs under the GNU project. The free software movement inspired a number of projects to choose the open source GPL license. Linux is one of those projects.
|
||||
|
||||
[Jeffrey Epstein][5] was a billionaire American financier. He was convicted as a sex offender for running an escort service (included underage girls) for the rich and elites in his social service. He committed suicide in his prison cell while still being tried for sex trafficking charges.
|
||||
|
||||
[Marvin Lee Minsky][6] was an eminent computer scientist at MIT. He founded the Artificial Intelligence lab at MIT. He died at the age of 88 in 2016. After his death, an Epstein victim named Misky as one of the people she was “directed to have sex” with on Jeffrey Epstein’s private island while she was a minor.
|
||||
|
||||
So what all this has to do with Richard Stallman? It all started with an email Stallman sent to MIT Computer Science and Artificial Intelligence Laboratory (CSAIL) mailing list over proposed protest by MIT students and affiliates regarding Jeffrey Epstein’s donation (to MIT’s AI lab).
|
||||
|
||||
The announcement of the Friday event does an injustice to Marvin Minsky:
|
||||
|
||||
“deceased AI ‘pioneer’ Marvin Minsky (who is accused of assaulting
|
||||
one of Epstein’s victims [2])”
|
||||
|
||||
The injustice is in the word “assaulting”. The term “sexual assault” is so vague and slippery that it facilitates accusation inflation: taking claims that someone did X and leading people to think of it as Y, which is much worse than X.
|
||||
|
||||
The accusation quoted is a clear example of inflation. The reference reports the claim that Minsky had sex with one of Epstein’s harem. (See <https://www.theverge.com/2019/8/9/20798900/marvin-minsky-jeffrey-epstein-sex-trafficking-island-court-records-unsealed>.)
|
||||
Let’s presume that was true (I see no reason to disbelieve it).
|
||||
|
||||
The word “assaulting” presumes that he applied force or violence, in some unspecified way, but the article itself says no such thing.
|
||||
Only that they had sex.
|
||||
|
||||
We can imagine many scenarios, but the most plausible scenario is that she presented herself to him as entirely willing. Assuming she was being coerced by Epstein, he would have had every reason to tell her to conceal that from most of his associates.
|
||||
|
||||
I’ve concluded from various examples of accusation inflation that it is absolutely wrong to use the term “sexual assault” in an accusation.
|
||||
|
||||
Whatever conduct you want to criticize, you should describe it with a specific term that avoids moral vagueness about the nature of the criticism.
|
||||
|
||||
### The call for removing Stallman
|
||||
|
||||
‘Epstein’ is an extremely controversial ‘topic’ in the USA. Stallman’s reckless ‘intellectual discourse’ on a sensitive matter like this would not have gone well and it didn’t go well.
|
||||
|
||||
A robotics engineer received this forwarded email from her friend and started a [campaign to remove Stallman][7]. She didn’t want a clarification or apology. All she wanted was to remove Stallman even if it means ‘burning MIT to the ground’.
|
||||
|
||||
> At least Richard Stallman is not accused of raping anyone. But is that our highest standard? The standard that this prestigious institution holds itself to? If this is what MIT wants to defend; if this is what MIT wants to stand for, then, yes, burn it to the ground…
|
||||
>
|
||||
> …Remove everyone, if we must, and let something much better be built from the ashes.
|
||||
>
|
||||
> Salem, Robotics student who started Remove Stallman campaign
|
||||
|
||||
Salem’s rant was initially ignored by mainstream digital media. But it was picked by activists who fight against meritocracy and gender bias in the software industry.
|
||||
|
||||
> [#epstein][8] [#MIT][9] Hi I'm angry and reporters didn't respond to me so i wrote this story myself. its such a fun time to be an mit alumn right now🙃 <https://t.co/D4V5L5NzPA>
|
||||
>
|
||||
> — SZJG (@selamjie) [September 12, 2019][10]
|
||||
|
||||
> are we done with "brilliant jerks" defending child sexual exploitation with "maybe it was consensual" <https://t.co/gSYPJ3WOfp>
|
||||
>
|
||||
> — Tracy Chou 👩🏻💻 (@triketora) [September 13, 2019][11]
|
||||
|
||||
> I've tweeted for many years about how awful Richard "RMS" Stallman is – the pedophilia, the ableism, the misogyny.
|
||||
>
|
||||
> Inevitably, each time I do, dudes examine my receipts & then say "all those incidents are from years ago! he's changed now!"
|
||||
>
|
||||
> NOPE. <https://t.co/ti2SrlKObp>
|
||||
>
|
||||
> — Sarah Mei (@sarahmei) [September 12, 2019][12]
|
||||
|
||||
A Twitter thread by Sage Sharp on how Stallman’s behavior negatively impact people in tech:
|
||||
|
||||
> 👇Thread about the impact of Richard Stallman on marginalized groups in tech, especially women. [CW: rape, incest, ableism, sex trafficking]
|
||||
>
|
||||
> The [@fsf][13] needs to permanently remove Richard Stallman from being President and Chair of the Free Software Foundation Board of Directors.
|
||||
>
|
||||
> — Sage Sharp (@_sagesharp_) [September 16, 2019][14]
|
||||
|
||||
It’s not that Stallman is a saint. His crude, insensitive and sexist jokes have been doing the rounds for years. You can read about it [here][15] and [here][16].
|
||||
|
||||
Soon the news was picked by the big media houses like [The Vice][17], [The Daily Beast][18], [Futurism][19] etc. They painted Stallman as a defender of Jeffrey Epstein. Amidst the outcry, [executive director of GNOME threatened to end the relationship between GNOME and FSF][20].
|
||||
|
||||
Eventually, Stallman resigned first from MIT and now [from Free Software Foundation][21].
|
||||
|
||||
![][22]
|
||||
|
||||
### A dangerous precedence?
|
||||
|
||||
All it took five days of activism to remove a person from an organization he created and worked for more than thirty years. And this is when Stallman wasn’t even remotely involved in the sex trafficking scandal.
|
||||
|
||||
Some of these ‘activists’ have also targeted [Linux creator Linus Torvalds in the past][23]. The management behind the Linux Foundation foresaw the growing trend of activism in the tech industry and hence they put up a [code of conduct for Linux kernel development][24] in place and forced [Torvalds to undergo training to improve his behavior][25]. If they had not taken the corrective step, probably Torvalds would have been a goner by now.
|
||||
|
||||
Ignoring reckless and sexist behavior of tech stalwarts is not acceptable but neither is the mob mentality of lynching anyone who disagrees with a certain popular view. I don’t agree with Stallman and his past remarks but I am also not happy that he has been (forced to?) resign in this manner.
|
||||
|
||||
Techrights has some interesting take on it that you can read [here][26] and [here][27].
|
||||
|
||||
_**What do you think of the entire episode? Please share your views and opinion but in a civilized manner. Abusive comments will not be published. Arguments and discussion must be civil.**_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/richard-stallman-controversy/
|
||||
|
||||
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/stallman-conroversy.png?ssl=1
|
||||
[2]: https://en.wikipedia.org/wiki/Richard_Stallman
|
||||
[3]: https://en.wikipedia.org/wiki/Massachusetts_Institute_of_Technology
|
||||
[4]: https://en.wikipedia.org/wiki/Free_software_movement
|
||||
[5]: https://en.wikipedia.org/wiki/Jeffrey_Epstein
|
||||
[6]: https://en.wikipedia.org/wiki/Marvin_Minsky
|
||||
[7]: https://medium.com/@selamie/remove-richard-stallman-fec6ec210794
|
||||
[8]: https://twitter.com/hashtag/epstein?src=hash&ref_src=twsrc%5Etfw
|
||||
[9]: https://twitter.com/hashtag/MIT?src=hash&ref_src=twsrc%5Etfw
|
||||
[10]: https://twitter.com/selamjie/status/1172244207978897408?ref_src=twsrc%5Etfw
|
||||
[11]: https://twitter.com/triketora/status/1172443389536555009?ref_src=twsrc%5Etfw
|
||||
[12]: https://twitter.com/sarahmei/status/1172283772428906496?ref_src=twsrc%5Etfw
|
||||
[13]: https://twitter.com/fsf?ref_src=twsrc%5Etfw
|
||||
[14]: https://twitter.com/_sagesharp_/status/1173637138413318144?ref_src=twsrc%5Etfw
|
||||
[15]: https://geekfeminism.wikia.org/wiki/Richard_Stallman
|
||||
[16]: https://medium.com/@selamie/remove-richard-stallman-appendix-a-a7e41e784f88
|
||||
[17]: https://www.vice.com/en_us/article/9ke3ke/famed-computer-scientist-richard-stallman-described-epstein-victims-as-entirely-willing
|
||||
[18]: https://www.thedailybeast.com/famed-mit-computer-scientist-richard-stallman-defends-epstein-victims-were-entirely-willing
|
||||
[19]: https://futurism.com/richard-stallman-epstein-scandal
|
||||
[20]: https://blog.halon.org.uk/2019/09/gnome-foundation-relationship-gnu-fsf/
|
||||
[21]: https://www.fsf.org/news/richard-m-stallman-resigns
|
||||
[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/richard-stallman.png?resize=800%2C94&ssl=1
|
||||
[23]: https://www.newyorker.com/science/elements/after-years-of-abusive-e-mails-the-creator-of-linux-steps-aside
|
||||
[24]: https://itsfoss.com/linux-code-of-conduct/
|
||||
[25]: https://itsfoss.com/torvalds-takes-a-break-from-linux/
|
||||
[26]: http://techrights.org/2019/09/15/media-attention-has-been-shifted/
|
||||
[27]: http://techrights.org/2019/09/16/stallman-removed/
|
||||
@@ -0,0 +1,107 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Election fraud: Is there an open source solution?)
|
||||
[#]: via: (https://opensource.com/article/19/9/voting-fraud-open-source-solution)
|
||||
[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyashttps://opensource.com/users/mbrownhttps://opensource.com/users/luis-ibanezhttps://opensource.com/users/jhibbets)
|
||||
|
||||
Election fraud: Is there an open source solution?
|
||||
======
|
||||
The Trust The Vote project is developing open source technology to help
|
||||
keep elections honest.
|
||||
![Team checklist][1]
|
||||
|
||||
Can open source technology help keep our elections honest? With its [Trust The Vote Project][2], the [Open Source Election Technology (OSET) Institute][3] is working on making that a reality for elections in the United States and around the world.
|
||||
|
||||
The project is developing an open, adaptable, flexible, full-featured, and innovative elections technology platform called [ElectOS][4]. It will support all aspects of elections administration and voting, including creating, marking, casting, and counting ballots and managing all back-office functions. The software is freely available under an Open Source Initiative (OSI)-recognized public license for adoption, adaptation, and deployment by anyone, including elections jurisdictions directly or, more commonly, commercial vendors or systems integrators.
|
||||
|
||||
With elections coming under more and more scrutiny due to vulnerable designs, aging machinery, hacking, foreign influence, and human incompetence, the OSET Institute is working on technology that will help ensure that every vote is counted as it was cast.
|
||||
|
||||
### Mississippi churning
|
||||
|
||||
The Mississippi Republican gubernatorial primary in August 2019 was called into question when a voting machine malfunctioned, denying a vote for candidate Bill Waller as the machine changed it to his opponent, Tate Reeves. The incident was [caught on camera][5].
|
||||
|
||||
"Around 40 states have voting machines that are a decade old or older," J. Alex Halderman, a computer science professor at the University of Michigan, tells [Politifact][6]. "There are reports of machines misbehaving in this manner after almost every election." That's rather alarming. Can open source be a solution to this problem?
|
||||
|
||||
The OSET Institute was founded in January 2007 by venture capital advisers who are alumni of Apple, Mozilla, Netscape, and Sun Microsystems. It is a non-partisan, non-profit 501(c)3 organization that researches and designs public technology—open source technology—for use in the US and around the world.
|
||||
|
||||
"For a long time, there have been systemic problems—market malformation and dysfunction—in the election industry. Due to market dynamics and industry performance issues, there has been no commercial incentive to make the investment in the necessary research and development to produce the kind of high-assurance, mission-critical systems for verifiable and accurate elections," says Gregory Miller, co-founder and COO of the OSET Institute.
|
||||
|
||||
Reflecting back to the 2000 presidential election between Vice President Al Gore and Texas Governor George W. Bush, Miller says: "Nobody was thinking about digital attacks during the ['chadfest' of Florida][7] and even as recently as 2007." Miller adds that one of the most important aspects of public technology is that it must be entirely trustworthy.
|
||||
|
||||
### Essential election technologies
|
||||
|
||||
Most voting systems in use are based around proprietary, black-box hardware and software built on 1990s technology—Windows 2000 or older. Some newer machines are running Windows 7—which is scheduled to lose maintenance and support in January 2020.
|
||||
|
||||
Miller says there are two crucial parts of the election process: the election administration systems and the voting systems.
|
||||
|
||||
* Election administration systems in the back office are responsible for elections setup, administration, and operation, especially casting and counting ballots; voter registration; ballot design, layout, and distribution; poll-book configuration; ballot-marking device configuration; and election results reporting and analytics.
|
||||
* Voting systems are simply the ballot marking, casting, and counting components.
|
||||
|
||||
|
||||
|
||||
The most important element of the system is the bridge between the voting systems in polling places and the back-office administration systems. This behind-the-scenes process aggregates vote tallies into tabulations to determine the results.
|
||||
|
||||
The key device—and arguably the Achilles Heel of the entire ecosystem—is the election management system (EMS), which is the connection between election administration and the voting systems. The EMS machine is a back-office element but also a component of the voting system. Because the EMS software typically resides on a desktop machine used for a variety of government functions that serve citizens, it is the element most vulnerable to attacks.
|
||||
|
||||
Despite the vote-changing problem in the Mississippi primary, Miller warns, "the vulnerability of attack is not to the voting machinery in the polling place but to the tabulation component of the back-office EMS or other vital configuration tools, including the configuration of poll books (those stacks of papers, binders, or … apps that check a voter in to cast a ballot). As a result, attackers need only to find a highly contentious swing state precinct to be disruptive."
|
||||
|
||||
### Code causes change
|
||||
|
||||
Because voting security vulnerabilities are largely software-based, "code causes change," Miller declares. But, there are barriers to getting this done in time for the next US presidential election in November 2020. Foremost is the fact that there is little time left for OSET's team of 12 full-time people to finish the core voting platform and create separate EMS and voting system components, all based on a non-black box, non-proprietary model that uses public, open source technology with off-the-shelf hardware.
|
||||
|
||||
However, there is a lot more to do in addition to developing code for off-the-shelf hardware. OSET is developing new open data standards with NIST and the Elections Assistance Commission (EAC). A new component-based certification process must be invented, and new design guidelines must be issued.
|
||||
|
||||
Meanwhile, service contracts that last for decades or more are protecting legacy vendors and making migration to new systems a challenge. Miller explains, "there are three primary vendors that control 85% of voting systems in the US and 70% globally; with the barriers to entry that exist, it will take a finished system to display the opportunity for change."
|
||||
|
||||
Getting there with open code is a process too. Miller says, "there is a very closely managed code-commit process, and the work faces far more scrutiny than an open source operating system, web server, or [content management system]. So, we are implementing a dual-sandbox model where one allows for wide-ranging, free-wheeling development and contributions. The other is the controlled environment that must pass security muster with the federal government in order for states to feel confident that the actual code for production systems is verifiable, accurate, secure, and transparent. We'll use a process for [passing] code across a review membrane that enables work in the less secure environment to be committed to the production environment. It's a process still in design."
|
||||
|
||||
The licenses are a bit complex: for governments or vendors that have regulatory issues with procuring and deploying commercial systems comprised of open source software, commercial hardware, and professional services, OSET offers the OSET Public License (OPL), an OSI-approved open source license based on the Mozilla Public License. For other research, development, and non-commercial use, or commercial use where certain procurement regulations are not an issue, the code is available under the GPL 2.0 license.
|
||||
|
||||
Of OSET's activities, Miller says, "85% is code development—a democracy software foundry. Another 10% is cybersecurity advisory for election administrators, and the final 5% of OSET's activity is public policy work (we are informers, not influencers in legislation). As a 501(c)3, we can not—and do not—perform lobbying, but a portion of our mission is education. So, our work remains steadfastly nonpartisan and philanthropically funded by grant-making organizations and the public.
|
||||
|
||||
Explains Miller: "We have a fairly straightforward charter: to build a trustworthy codebase that can exist on an inherently untrustworthy hardware base. Certain types of election administration apps and services can live in the cloud, while the voting system—a marriage of that software layer and hardware, federally certified to be deployed—must be built up from a hardened Linux kernel. So, a portion of our R&D lies in the arenas of trusted boot with hardware attestation and other important security architectures such as computer-assisted code randomization and so forth."
|
||||
|
||||
### Work with the code
|
||||
|
||||
There are two levels of access for people who want to work with the OSET Institute's Trust the Vote code. One is to contact the project to request access to certain code to advance development efforts; all legitimate requests will be honored, but the code is not yet accessible in the public domain. The other access point is to the extensive work that the OSET Institute has done for third-party voter registration systems, such as Rock The Vote. That source code is publicly available [online][8].
|
||||
|
||||
One component of this is [RockyOVR][9] for online voter registration services (it is operated by the OSET Institute and Rock The Vote with support from AWS). Another is [Grommet][10], an Android-native mobile app used by voter registration drives. [Siggy][11] and [VoteReady][12] are prototypes for new voter services under development that will be announced soon.
|
||||
|
||||
The OSET Institute is continually on the lookout for talented volunteers to advance the project. Top needs include system architecture and engineering and software development for both cloud-based and offline applications. These are not entry-level projects or positions, and in some cases, they require advanced skills in BIOS and firmware development; operating system internals; device drivers; and more.
|
||||
|
||||
All developers at the OSET Institute start as volunteers, and the best are moved into contract and staff positions, as project funding allows, in a meritocratic process. The Institute is based in Palo Alto, Calif., but operations are distributed and virtual with offices and centers of development excellence in Arlington, Va.; Boston; Mountain View, Calif.; Portland, Ore.; San Francisco; and the University of Edinburgh, Scotland.
|
||||
|
||||
The Open Election Data Initiative wants to give access to election data for a true picture of an...
|
||||
|
||||
The pernicious effects of closed proprietary software reaches its peak of damaging the general...
|
||||
|
||||
One of the ways Obama won the 2012 election was with technology. It wasn’t the only way, but...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/voting-fraud-open-source-solution
|
||||
|
||||
作者:[Jeff Macharyas][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/jeffmacharyashttps://opensource.com/users/mbrownhttps://opensource.com/users/luis-ibanezhttps://opensource.com/users/jhibbets
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist)
|
||||
[2]: https://trustthevote.org/
|
||||
[3]: https://www.osetfoundation.org/
|
||||
[4]: https://bit.ly/EOSt1
|
||||
[5]: https://twitter.com/STaylorRayburn/status/1166347828152680449
|
||||
[6]: https://www.politifact.com/truth-o-meter/article/2019/aug/29/viral-video-voting-machine-malfunction-mississippi/
|
||||
[7]: https://en.wikipedia.org/wiki/2000_United_States_presidential_election_in_Florida
|
||||
[8]: https://github.com/TrustTheVote-Project
|
||||
[9]: https://github.com/TrustTheVote-Project/Rocky-OVR
|
||||
[10]: https://github.com/TrustTheVote-Project/Grommet
|
||||
[11]: https://github.com/TrustTheVote-Project/Siggy
|
||||
[12]: https://github.com/TrustTheVote-Project/VoteReady
|
||||
@@ -0,0 +1,143 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (runningwater)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (The Protocols That Help Things to Communicate Over the Internet)
|
||||
[#]: via: (https://opensourceforu.com/2019/09/the-protocols-that-help-things-to-communicate-over-the-internet/)
|
||||
[#]: author: (Sapna Panchal https://opensourceforu.com/author/sapna-panchal/)
|
||||
|
||||
The Protocols That Help Things to Communicate Over the Internet
|
||||
======
|
||||
|
||||
[![][1]][2]
|
||||
|
||||
_The Internet of Things is a system of connected, interrelated objects. These objects transmit data to servers for processing and, in turn, receive messages from the servers. These messages are sent and received using different protocols. This article discusses some of the protocols related to the IoT._
|
||||
|
||||
The Internet of Things (IoT) is beginning to pervade more and more aspects of our lives. Everyone, everywhere is using the Internet of Things. Using the Internet, connected things are used to collect information, convey/send information back, or do both. IoT is an architecture that is a combination of available technologies. It helps to make our daily lives more pleasant and convenient.
|
||||
|
||||
![Figure 1: IoT architecture][3]
|
||||
|
||||
![Figure 2: Messaging Queuing Telemetry protocol][4]
|
||||
|
||||
**IoT architecture**
|
||||
Basically, IoT architecture has four components. In this article, we will explore each component to understand the architecture better.
|
||||
|
||||
* **Sensors:** These are present everywhere. They help to collect data from any location and then share it to the IoT gateway. As an example, sensors sense the temperature at different locations, which helps to gauge the weather conditions. And this information is shared or passed to the IoT gateway. This is a basic example of how the IoT operates.
|
||||
* **IoT gateway:** Once the information is collected from the sensors, it is passed on to the gateway. The gateway is a mediator between sensor nodes and the World Wide Web. So basically, it processes the data that is collected from sensor nodes and then transmits this to the Internet infrastructure.
|
||||
* **Cloud server:** Once data is transmitted through the gateway, it is stored and processed in the cloud server.
|
||||
* **Mobile app:** Using a mobile application, the user can view and access the data processed in the cloud server.
|
||||
|
||||
|
||||
|
||||
This is the basic idea of the IoT and its architecture, along with the components. We now move on to the basic ideas behind different IoT protocols.
|
||||
|
||||
**IoT protocols**
|
||||
As mentioned earlier, connected things are used to collect information, convey/send information back, or do both, using the Internet. This is the fundamental basis of the IoT. To convey/send information, we need a protocol, which is a set of procedures that is used to transmit the data between electronic devices.
|
||||
Essentially, we have two types of IoT protocols — the IoT network protocols and the IoT data protocols. This article discusses the IoT data protocols.
|
||||
|
||||
![Figure 3: Advance Message Queuing Protocol][5]
|
||||
|
||||
![Figure 4: CoAP][6]
|
||||
|
||||
**MQTT**
|
||||
The Messaging Queuing Telemetry Transmit (MQTT) protocol was primarily designed for low bandwidth networks, but is very popular today as an IoT protocol. It is used to exchange data between clients and the server. It is a lightweight messaging protocol.
|
||||
|
||||
This protocol has many advantages:
|
||||
|
||||
* It is small in size and has low power usage.
|
||||
* It is a lightweight protocol.
|
||||
* It is based on low network usage.
|
||||
* It works entirely in real-time.
|
||||
|
||||
|
||||
|
||||
Considering all the above reasons, MQTT emerges as the perfect IoT data protocol.
|
||||
|
||||
**How MQTT works:** MQTT is based on a client-server relationship. The server manages the requests that come from different clients and sends the required information to clients. MQTT is based on two operations.
|
||||
i) _Publish:_ When the client sends data to the MQTT broker, this operation is known as ‘Publish’.
|
||||
ii) _Subscribe:_ When the client receives data from the broker, this operation is known as‘Subscribe’.
|
||||
|
||||
The MQTT broker is the mediator that handles these operations, primarily taking messages and delivering them to the application or client.
|
||||
|
||||
Let’s look at the example of a device temperature sensor, which sends readings to the MQTT broker, and then information is delivered to desktop or mobile applications. As stated earlier, ‘Publish’ means sending readings to the MQTT broker and ‘Subscribe’ means delivering the information to the desktop/mobile application.
|
||||
|
||||
**AMQP**
|
||||
Advanced Message Queuing Protocol is a peer-to-peer protocol, where one peer plays the role of the client application and the other peer plays the role of the delivery service or broker. It is the combination of hard and fast components that basically routes and saves messages within the delivery service or broker carrier.
|
||||
|
||||
The benefits of AMQP are:
|
||||
|
||||
* It helps to send messages without them getting missed out.
|
||||
* It helps to guarantee a ‘one-time only’ and secured delivery.
|
||||
* It provides a secure connection.
|
||||
* It always supports acknowledgments for message delivery or failure.
|
||||
|
||||
|
||||
|
||||
**How AMQP works and its architecture:** The AMQP architecture is made up of the following parts.
|
||||
|
||||
_**Exchange**_ – Messages that come from the publisher are accepted by Exchange, which routes them to the message queue.
|
||||
|
||||
_**Message queue**_ – This is the combination of multiple queues and is helpful for processing the messages.
|
||||
|
||||
_**Binding**_ – This helps to maintain the connectivity between Exchange and the message queue.
|
||||
The combination of Exchange and the message queues is known as the broker or AMQP broker.
|
||||
|
||||
![Figure 5: Constrained Application Protocol architecture][7]
|
||||
|
||||
**Constrained Application Protocol (CoAP)**
|
||||
This was initially used as a machine-to-machine (M2M) protocol, and later began to be used as an IoT protocol. It is a Web transfer protocol that is used with constrained nodes and constrained networks. CoAP uses the RESTful architecture, just like the HTTP protocol.
|
||||
The advantages CoAP offers are:
|
||||
|
||||
* It works as a REST model for small devices.
|
||||
* As this is like HTTP, it’s easy for developers to work on.
|
||||
* It is a one-to-one protocol for transferring information between the client and server, directly.
|
||||
* It is very simple to parse.
|
||||
|
||||
|
||||
|
||||
**How CoAP works and its architecture:** From Figure 4, we can understand that CoAP is the combination of ‘Request/Response and Message’. We can also say it has two layers – ‘Request/Response’and ‘Message’.
|
||||
Figure 5 clearly explains that CoAP architecture is based on the client server relationship, where…
|
||||
|
||||
* The client sends requests to the server.
|
||||
* The server receives requests from the client and responds to them.
|
||||
|
||||
|
||||
|
||||
**Extensible Messaging and Presence Protocol (XMPP)**
|
||||
This protocol is used to exchange messages in real-time. It is used not only to communicate with others, but also to get information on the status of the user (away, offline, active). This protocol is widely used in real life, like in WhatsApp.
|
||||
The Extensible Messaging and Presence Protocol should be used because:
|
||||
|
||||
* It is free, open and easy to understand. Hence, it is very popular.
|
||||
* It has secured authentication, is extensible and flexible.
|
||||
|
||||
|
||||
|
||||
![Figure 6: Extensible Messaging and Presence Protocol][8]
|
||||
|
||||
**How XMPP works and its architecture:** In the XMPP architecture, each client has a unique name associated with it and communicates to other clients via the XMPP server. The XMPP client has either the same domain or a different one.
|
||||
|
||||
In Figure 6, the XMPP client belongs to the same domain in which one XMPP client sends the information to the XMPP server. The server translates it and conveys the information to another client.
|
||||
Basically, this protocol is the backbone that provides universal connectivity between different endpoint protocols.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensourceforu.com/2019/09/the-protocols-that-help-things-to-communicate-over-the-internet/
|
||||
|
||||
作者:[Sapna Panchal][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[runningwater](https://github.com/runningwater)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensourceforu.com/author/sapna-panchal/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Internet-of-things-illustration.jpg?resize=696%2C439&ssl=1 (Internet of things illustration)
|
||||
[2]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Internet-of-things-illustration.jpg?fit=1125%2C710&ssl=1
|
||||
[3]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-1-IoT-architecture.jpg?resize=350%2C133&ssl=1
|
||||
[4]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-2-Messaging-Queuing-Telemetry-Transmit-protocol.jpg?resize=350%2C206&ssl=1
|
||||
[5]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-3-Advance-Message-Queuing-Protocol.jpg?resize=350%2C160&ssl=1
|
||||
[6]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-4-CoAP.jpg?resize=350%2C84&ssl=1
|
||||
[7]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-5-Constrained-Application-Protocol-architecture.jpg?resize=350%2C224&ssl=1
|
||||
[8]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-6-Extensible-Messaging-and-Presence-Protocol.jpg?resize=350%2C46&ssl=1
|
||||
@@ -0,0 +1,79 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (The community-led renaissance of open source)
|
||||
[#]: via: (https://opensource.com/article/19/9/community-led-renaissance)
|
||||
[#]: author: (Donald Fischer https://opensource.com/users/dff)
|
||||
|
||||
The community-led renaissance of open source
|
||||
======
|
||||
Moving beyond the scarcity mindset of "open core."
|
||||
![shapes of people symbols][1]
|
||||
|
||||
With few commercial participants, early free software and open source communities were, by definition, community-led. Software was designed and created organically by communities of users in response to their needs and inspiration. The results, to a degree nobody predicted, were often magical.
|
||||
|
||||
However, there were some missing pieces that prevented this magic from being unleashed at greater scale. As professional developers in larger organizations began to depend on open source software for key functions, they started looking for the same kinds of commercial support they were used to having for the proprietary software they purchased from companies like Microsoft, Oracle, and SAP. Someone to be accountable for fixing a new security vulnerability in a timely manner, or providing basic intellectual property assurances such as license verification and indemnification, or just delivering the everyday maintenance necessary to keep the software in good working order.
|
||||
|
||||
First-generation open source businesses like Red Hat emerged to respond to these needs. They combined the best of both worlds: the flexibility and control of raw open source with the commercial support that enterprises depend on. These new open source businesses found their opportunity by _adding_ the missing—but necessary—commercial services to community-led open source projects. These services would be costly for organizations to provide on their own and potentially even more costly to do without. One early leader of that era, Cygnus Solutions, even adopted the counter-intuitive tagline "Making free software affordable."
|
||||
|
||||
But back then, it was always overwhelmingly clear: The commercial vendors were in service of the community, filling in around the edges to enable commercial applications. The community was the star, and the companies were the supporting cast.
|
||||
|
||||
### The dark ages of open core
|
||||
|
||||
With the success of the original commercial open source companies like Red Hat, investment dollars flowed toward startups looking to harness the newfound commercial power of open source.
|
||||
|
||||
Unfortunately, by and large, this generation of open source companies drew the wrong lessons from first-generation players like Red Hat.
|
||||
|
||||
Witnessing the powerful combination of community-created technology with vendor-provided commercial capabilities, this new breed of company concluded that the vendors were the stars of the show, not the community.
|
||||
|
||||
This marked a turning point for open source.
|
||||
|
||||
In this vendor-centric view of the world, it was imagined that a single organization could generate the insights and set the roadmap for open source technologies. This drove a pervasive new belief that open source communities primarily represented a capital-efficient marketing channel rather than a new form of internet-enabled co-creation.
|
||||
|
||||
These companies approached open source with a scarcity mindset. Instead of investing in community-led projects to unlock the potential of the crowd, they created vendor-dominated projects, released demo versions under open source licenses, and directed the bulk of their resources to companion proprietary technology that they withheld as paid-only, closed-source products. By reverting to some of [the worst aspects of traditional proprietary software][2]—like uncertain licensing terms, unclear support horizons, and unknowable cost—these businesses crowded out the best aspects of open source.
|
||||
|
||||
As so often happens, this misreading of the open source model took on a new life when it was assigned an innocent-sounding brand name: "open core."
|
||||
|
||||
The open core dog chased its tail into an escalating flurry of blog posts, pitch decks, and even dedicated open core conferences. In its worst moments, leading players in this movement even [sought to redefine the very meaning of the words open source][3].
|
||||
|
||||
In the worldview of open core, the vendors are at the center of the universe, and open source users are just a commodity to be exploited.
|
||||
|
||||
### A community-led renaissance to restore balance
|
||||
|
||||
While business interests whipped themselves into a frenzy around open core, the community of creators at the heart of open source just kept on building. While a handful of high-profile companies occupied the industry headlines, thousands of individual creators and teams kept on building software, one pull request at a time.
|
||||
|
||||
It added up. Today, the modern application development platform isn't from a single vendor, or even a collection of vendors. It's the union of thousands of discrete open source packages—implemented in languages like JavaScript, Python, PHP, Ruby, Java, Go, .NET, Rust, R, and many others. Each element built for its own purpose, but together creating a beautiful tapestry that has become the foundation of all modern applications.
|
||||
|
||||
In some cases, the creators behind these projects are assisted by organizations that arose naturally from the communities, like Ruby Together, the Apache Software Foundation, and the Python Software Foundation. But by and large, these creators are self-supported, making time in the margins of their day jobs and central pursuits to collaborate on the software that makes their work possible while collectively building a huge commons of open source software that's available for any individual or organization to use.
|
||||
|
||||
But now, there's an emerging way for open source maintainers to participate in the value they create, which isn't about withholding value, but instead is about [creating _additional_ value][4].
|
||||
|
||||
In a revival and expansion of the principles that drove the first generation of community-led open source commercial players, creators are now coming together in a new form of collaboration. Rather than withholding software under a different license, they're partnering with each other to provide [the same kinds of professional assurances][5] that companies such as Red Hat discovered were necessary back in the day, but for the thousands of discrete components that make up the modern development platform.
|
||||
|
||||
Today's generation of entrepreneurial open source creators is leaving behind the scarcity mindset that bore open core and its brethren. Instead, they're advancing an optimistic, additive, and still practical model that [adds missing commercial value][6] on top of raw open source.
|
||||
|
||||
And by emulating first-generation open source companies, these creators are rediscovering a wide-open opportunity for value creation that benefits everyone. As commercial organizations engage with managed open source services sourced directly from the creators themselves, there's an immediate clarity in the alignment of interests between producers and consumers.
|
||||
|
||||
The result? The end of the scarcity-mindset dark ages of open core, and a renaissance of technology driven by a new class of thriving, independent, full-time open source creators.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/community-led-renaissance
|
||||
|
||||
作者:[Donald Fischer][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/dff
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Open%20Pharma.png?itok=GP7zqNZE (shapes of people symbols)
|
||||
[2]: https://blog.tidelift.com/the-closed-source-sustainability-crisis
|
||||
[3]: https://opensource.com/article/19/4/fauxpen-source-bad-business
|
||||
[4]: https://www.techrepublic.com/article/the-key-to-open-source-sustainability-is-good-old-fashioned-self-interest/
|
||||
[5]: https://tidelift.com/subscription/video/what-is-managed-open-source
|
||||
[6]: https://blog.tidelift.com/what-is-managed-open-source
|
||||
@@ -1,173 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (2018: Year in review)
|
||||
[#]: via: (https://jvns.ca/blog/2018/12/23/2018--year-in-review/)
|
||||
[#]: author: (Julia Evans https://jvns.ca/)
|
||||
|
||||
2018: Year in review
|
||||
======
|
||||
|
||||
I wrote these in [2015][1] and [2016][2] and [2017][3] and it’s always interesting to look back at them, so here’s a summary of what went on in my side projects in 2018.
|
||||
|
||||
### ruby profiler!
|
||||
|
||||
At the beginning of this year I wrote [rbspy][4] (docs: <https://rbspy.github.io/>). It inspired a Python version called [py-spy][5] and a PHP profiler called [phpspy][6], both of which are excellent. I think py-spy in particular is [probably _better_][7] than rbspy which makes me really happy.
|
||||
|
||||
Writing a program that does something innovative (`top` for your Ruby program’s functions!) and inspiring other people to make amazing new tools is something I’m really proud of.
|
||||
|
||||
### started a side business!
|
||||
|
||||
A very surprising thing that happened in 2018 is that I started a business! This is the website: <https://wizardzines.com/>, and I sell programming zines.
|
||||
|
||||
It’s been astonishingly successful (it definitely made me enough money that I could have lived on just the revenue from the business this year), and I’m really grateful to everyone’s who’s supported that work. I hope the zines have helped you. I always thought that it was impossible to make anywhere near as much money teaching people useful things as I can as a software developer, and now I think that’s not true. I don’t think that I’d _want_ to make that switch (I like working as a programmer!), but now I actually think that if I was serious about it and was interested in working on my business skills, I could probably make it work.
|
||||
|
||||
I don’t really know what’s next, but I plan to write at least one zine next year. I learned a few things about business this year, mainly from:
|
||||
|
||||
* [stephanie hurlburt’s twitter][8]
|
||||
* [amy hoy][9]
|
||||
* the book [growing a business by paul hawken][10]
|
||||
* seeing what joel hooks is doing with [egghead.io][11]
|
||||
* a little from [indie hackers][12]
|
||||
|
||||
|
||||
|
||||
I used to think that sales / marketing had to be gross, but reading some of these business books made me think that it’s actually possible to run a business by being honest & just building good things.
|
||||
|
||||
### work!
|
||||
|
||||
this is mostly about side projects, but a few things about work:
|
||||
|
||||
* I still have the same manager ([jay][13]). He’s been really great to work with. The [help! i have a manager!][14] zine is secretly largely things I learned from working with him.
|
||||
* my team made some big networking infrastructure changes and it went pretty well. I learned a lot about proxies/TLS and a little bit about C++.
|
||||
* I mentored another intern, and the intern I mentored last year joined us full time!
|
||||
|
||||
|
||||
|
||||
When I go back to work I’m going to switch to working on something COMPLETELY DIFFERENT (writing code that sends messages to banks!) for 3 months. It’s a lot closer to the company’s core business, and I think it’ll be neat to learn more about how financial infastracture works.
|
||||
|
||||
I struggled a bit with understanding/defining my job this year. I wrote [What’s a senior engineer’s job?][15] about that, but I have not yet reached enlightenment.
|
||||
|
||||
### talks!
|
||||
|
||||
I gave 4 talks in 2018:
|
||||
|
||||
* [So you want to be a wizard][16] at StarCon
|
||||
* [Building a Ruby profiler][17] at the Recurse Center’s localhost series
|
||||
* [Build Impossible Programs][18] in May at Deconstruct.
|
||||
* [High Reliability Infrastructure Migrations][19] at Kubecon. I’m pretty happy about this talk because I’ve wanted to give a good talk about what I do at work for a long time and I think I finally succeeded. Previously when I gave talks about my work I think I fell into the trap of just describing what we do (“we do X Y Z” … “okay, so what?“). With this one, I think I was able to actually say things that were useful to other people.
|
||||
|
||||
|
||||
|
||||
In past years I’ve mostly given talks which can mostly be summarized “here are some cool tools” and “here is how to learn hard things”. This year I changed focus to giving talks about the actual work I do – there were two talks about building a Ruby profiler, and one about what I do at work (I spend a lot of time on infrastructure migrations!)
|
||||
|
||||
I’m not sure whether if I’ll give any talks in 2019. I travelled more than I wanted to in 2018, and to stay sane I ended up having to cancel on a talk I was planning to give with relatively short notice which wasn’t good.
|
||||
|
||||
### podcasts!
|
||||
|
||||
I also experimented a bit with a new format: the podcast! These were basically all really fun! They don’t take that long (about 2 hours total?).
|
||||
|
||||
* [Software Engineering Daily][20], on rbspy and how to use a profiler
|
||||
* [FLOSS weekly][21], again about rbspy. They told me I’m the guest that asked _them_ the most questions, which I took as a compliment :)
|
||||
* [CodeNewbie][22] on computer networking & how the Internet works
|
||||
* [Hanselminutes with Scott Hanselman][23] on writing zines / teaching / learning
|
||||
* [egghead.io][24], on making zines & running a business
|
||||
|
||||
|
||||
|
||||
what I learned about doing podcasts:
|
||||
|
||||
* It’s really important to give the hosts a list of good questions to ask, and to be prepared to give good answers to those questions! I’m not a super polished podcast guest.
|
||||
* you need a good microphone. At least one of these people told me I actually couldn’t be on their podcast unless I had a good enough microphone, so I bought a [medium fancy microphone][25]. It wasn’t too expensive and it’s nice to have a better quality microphone! Maybe I will use it more to record audio/video at some point!
|
||||
|
||||
|
||||
|
||||
### !!Con
|
||||
|
||||
I co-organized [!!Con][26] for the 4th time – I ran sponsorships. It’s always such a delight and the speakers are so great.
|
||||
|
||||
!!Con is expanding [to the west coast in 2019][27] – I’m not directly involved with that but it’s going to be amazing.
|
||||
|
||||
### blog posts!
|
||||
|
||||
I apparently wrote 54 blog posts in 2018. A couple of my favourites are [What’s a senior engineer’s job?][15] , [How to teach yourself hard things][28], and [batch editing files with ed][29].
|
||||
|
||||
There were basically 4 themes in blogging for 2018:
|
||||
|
||||
* progress on the rbspy project while I was working on it ([this category][30])
|
||||
* computer networking / infrastructure engineering (basically all I did at work this year was networking, though I didn’t write about it as much as I might have)
|
||||
* musings about zines / business / developer education, for instance [why sell zines?][31] and [who pays to educate developers?][32]
|
||||
* a few of the usual “how do you learn things” / “how do you succeed at your job” posts as I figure things about about that, for instance [working remotely, 4 years in][33]
|
||||
|
||||
|
||||
|
||||
### a tiny inclusion project: a guide to performance reviews
|
||||
|
||||
[Last year][3] in addition to my actual job, I did a couple of projects at work towards helping make sure the performance/promotion process works well for folks – i collaborated with the amazing [karla][34] on the idea of a “brag document”, and redid our engineering levels.
|
||||
|
||||
This year, in the same vein, I wrote a document called the “Unofficial guide to the performance reviews”. A lot of folks said it helped them but probably it’s too early to celebrate. I think explaining to folks how the performance review process actually works and how to approach it is really valuable and I might try to publish a more general version here at some point.
|
||||
|
||||
I like that I work at a place where it’s possible/encouraged to do projects like this. I spend a relatively small amount of time on them (maybe I spent 15 hours on this one?) but it feels good to be able to make tiny steps towards building a better workplace from time to time. It’s really hard to judge the results though!
|
||||
|
||||
### conclusions?
|
||||
|
||||
some things that worked in 2018:
|
||||
|
||||
* setting [boundaries][15] around what my job is
|
||||
* doing open source work while being paid for it
|
||||
* starting a side business
|
||||
* doing small inclusion projects at work
|
||||
* writing zines is very time consuming but I feel happy about the time I spent on that
|
||||
* blogging is always great
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://jvns.ca/blog/2018/12/23/2018--year-in-review/
|
||||
|
||||
作者:[Julia Evans][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://jvns.ca/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://jvns.ca/blog/2015/12/26/2015-year-in-review/
|
||||
[2]: https://jvns.ca/blog/2016/12/21/2016--year-in-review/
|
||||
[3]: https://jvns.ca/blog/2017/12/31/2017--year-in-review/
|
||||
[4]: https://github.com/rbspy/rbspy
|
||||
[5]: https://github.com/benfred/py-spy
|
||||
[6]: https://github.com/adsr/phpspy/
|
||||
[7]: https://jvns.ca/blog/2018/09/08/an-awesome-new-python-profiler--py-spy-/
|
||||
[8]: https://twitter.com/sehurlburt
|
||||
[9]: https://stackingthebricks.com/
|
||||
[10]: https://www.amazon.com/Growing-Business-Paul-Hawken/dp/0671671642
|
||||
[11]: https://egghead.io/
|
||||
[12]: https://www.indiehackers.com/
|
||||
[13]: https://twitter.com/jshirley
|
||||
[14]: https://wizardzines.com/zines/manager/
|
||||
[15]: https://jvns.ca/blog/senior-engineer/
|
||||
[16]: https://www.youtube.com/watch?v=FBMC9bm-KuU
|
||||
[17]: https://jvns.ca/blog/2018/04/16/rbspy-talk/
|
||||
[18]: https://www.deconstructconf.com/2018/julia-evans-build-impossible-programs
|
||||
[19]: https://www.youtube.com/watch?v=obB2IvCv-K0
|
||||
[20]: https://softwareengineeringdaily.com/2018/06/05/profilers-with-julia-evans/
|
||||
[21]: https://twit.tv/shows/floss-weekly/episodes/487
|
||||
[22]: https://www.codenewbie.org/podcast/how-does-the-internet-work
|
||||
[23]: https://hanselminutes.com/643/learning-how-to-be-a-wizard-programmer-with-julia-evans
|
||||
[24]: https://player.fm/series/eggheadio-developer-chats-1728019/exploring-concepts-and-teaching-using-focused-zines-with-julia-evans
|
||||
[25]: https://www.amazon.com/gp/product/B000EOPQ7E/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B000EOPQ7E&linkCode=as2&tag=diabeticbooks&linkId=ZBZBIVR4EB7V6JFL
|
||||
[26]: http://bangbangcon.com
|
||||
[27]: http://bangbangcon.com/west/
|
||||
[28]: https://jvns.ca/blog/2018/09/01/learning-skills-you-can-practice/
|
||||
[29]: https://jvns.ca/blog/2018/05/11/batch-editing-files-with-ed/
|
||||
[30]: https://jvns.ca/categories/ruby-profiler/
|
||||
[31]: https://jvns.ca/blog/2018/09/23/why-sell-zines/
|
||||
[32]: https://jvns.ca/blog/2018/09/01/who-pays-to-educate-developers-/
|
||||
[33]: https://jvns.ca/blog/2018/02/18/working-remotely--4-years-in/
|
||||
[34]: https://karla.io/
|
||||
@@ -1,235 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (laingke)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Create an online store with this Java-based framework)
|
||||
[#]: via: (https://opensource.com/article/19/1/scipio-erp)
|
||||
[#]: author: (Paul Piper https://opensource.com/users/madppiper)
|
||||
|
||||
Create an online store with this Java-based framework
|
||||
======
|
||||
Scipio ERP comes with a large range of applications and functionality.
|
||||

|
||||
|
||||
So you want to sell products or services online, but either can't find a fitting software or think customization would be too costly? [Scipio ERP][1] may just be what you are looking for.
|
||||
|
||||
Scipio ERP is a Java-based open source e-commerce framework that comes with a large range of applications and functionality. The project was forked from [Apache OFBiz][2] in 2014 with a clear focus on better customization and a more modern appeal. The e-commerce component is quite extensive and works in a multi-store setup, internationally, and with a wide range of product configurations, and it's also compatible with modern HTML frameworks. The software also provides standard applications for many other business cases, such as accounting, warehouse management, or sales force automation. It's all highly standardized and therefore easy to customize, which is great if you are looking for more than a virtual cart.
|
||||
|
||||
The system makes it very easy to keep up with modern web standards, too. All screens are constructed using the system's "[templating toolkit][3]," an easy-to-learn macro set that separates HTML from all applications. Because of it, every application is already standardized to the core. Sounds confusing? It really isn't—it all looks a lot like HTML, but you write a lot less of it.
|
||||
|
||||
### Initial setup
|
||||
|
||||
Before you get started, make sure you have Java 1.8 (or greater) SDK and a Git client installed. Got it? Great! Next, check out the master branch from GitHub:
|
||||
|
||||
```
|
||||
git clone https://github.com/ilscipio/scipio-erp.git
|
||||
cd scipio-erp
|
||||
git checkout master
|
||||
```
|
||||
|
||||
To set up the system, simply run **./install.sh** and select either option from the command line. Throughout development, it is best to stick to an **installation for development** (Option 1), which will also install a range of demo data. For professional installations, you can modify the initial config data ("seed data") so it will automatically set up the company and catalog data for you. By default, the system will run with an internal database, but it [can also be configured][4] with a wide range of relational databases such as PostgreSQL and MariaDB.
|
||||
|
||||
![Setup wizard][6]
|
||||
|
||||
Follow the setup wizard to complete your initial configuration,
|
||||
|
||||
Start the system with **./start.sh** and head over to **<https://localhost:8443/setup/>** to complete the configuration. If you installed with demo data, you can log in with username **admin** and password **scipio**. During the setup wizard, you can set up a company profile, accounting, a warehouse, your product catalog, your online store, and additional user profiles. Keep the website entries on the product store configuration screen for now. The system allows you to run multiple webstores with different underlying code; unless you want to do that, it is easiest to stick to the defaults.
|
||||
|
||||
Congratulations, you just installed Scipio ERP! Play around with the screens for a minute or two to get a feel for the functionality.
|
||||
|
||||
### Shortcuts
|
||||
|
||||
Before you jump into the customization, here are a few handy commands that will help you along the way:
|
||||
|
||||
* Create a shop-override: **./ant create-component-shop-override**
|
||||
* Create a new component: **./ant create-component**
|
||||
* Create a new theme component: **./ant create-theme**
|
||||
* Create admin user: **./ant create-admin-user-login**
|
||||
* Various other utility functions: **./ant -p**
|
||||
* Utility to install & update add-ons: **./git-addons help**
|
||||
|
||||
|
||||
|
||||
Also, make a mental note of the following locations:
|
||||
|
||||
* Scripts to run Scipio as a service: **/tools/scripts/**
|
||||
* Log output directory: **/runtime/logs**
|
||||
* Admin application: **<https://localhost:8443/admin/>**
|
||||
* E-commerce application: **<https://localhost:8443/shop/>**
|
||||
|
||||
|
||||
|
||||
Last, Scipio ERP structures all code in the following five major directories:
|
||||
|
||||
* Framework: framework-related sources, the application server, generic screens, and configurations
|
||||
* Applications: core applications
|
||||
* Addons: third-party extensions
|
||||
* Themes: modifies the look and feel
|
||||
* Hot-deploy: your own components
|
||||
|
||||
|
||||
|
||||
Aside from a few configurations, you will be working within the hot-deploy and themes directories.
|
||||
|
||||
### Webstore customizations
|
||||
|
||||
To really make the system your own, start thinking about [components][7]. Components are a modular approach to override, extend, and add to the system. Think of components as self-contained web modules that capture information on databases ([entity][8]), functions ([services][9]), screens ([views][10]), [events and actions][11], and web applications. Thanks to components, you can add your own code while remaining compatible with the original sources.
|
||||
|
||||
Run **./ant create-component-shop-override** and follow the steps to create your webstore component. A new directory will be created inside of the hot-deploy directory, which extends and overrides the original e-commerce application.
|
||||
|
||||
![component directory structure][13]
|
||||
|
||||
A typical component directory structure.
|
||||
|
||||
Your component will have the following directory structure:
|
||||
|
||||
* config: configurations
|
||||
* data: seed data
|
||||
* entitydef: database table definitions
|
||||
* script: Groovy script location
|
||||
* servicedef: service definitions
|
||||
* src: Java classes
|
||||
* webapp: your web application
|
||||
* widget: screen definitions
|
||||
|
||||
|
||||
|
||||
Additionally, the **ivy.xml** file allows you to add Maven libraries to the build process and the **ofbiz-component.xml** file defines the overall component and web application structure. Apart from the obvious, you will also find a **controller.xml** file inside the web apps' **WEB-INF** directory. This allows you to define request entries and connect them to events and screens. For screens alone, you can also use the built-in CMS functionality, but stick to the core mechanics first. Familiarize yourself with **/applications/shop/** before introducing changes.
|
||||
|
||||
#### Adding custom screens
|
||||
|
||||
Remember the [templating toolkit][3]? You will find it used on every screen. Think of it as a set of easy-to-learn macros that structure all content. Here's an example:
|
||||
|
||||
```
|
||||
<@section title="Title">
|
||||
<@heading id="slider">Slider</@heading>
|
||||
<@row>
|
||||
<@cell columns=6>
|
||||
<@slider id="" class="" controls=true indicator=true>
|
||||
<@slide link="#" image="https://placehold.it/800x300">Just some content…</@slide>
|
||||
<@slide title="This is a title" link="#" image="https://placehold.it/800x300"></@slide>
|
||||
</@slider>
|
||||
</@cell>
|
||||
<@cell columns=6>Second column</@cell>
|
||||
</@row>
|
||||
</@section>
|
||||
```
|
||||
|
||||
Not too difficult, right? Meanwhile, themes contain the HTML definitions and styles. This hands the power over to your front-end developers, who can define the output of each macro and otherwise stick to their own build tools for development.
|
||||
|
||||
Let's give it a quick try. First, define a request on your own webstore. You will modify the code for this. A built-in CMS is also available at **<https://localhost:8443/cms/>** , which allows you to create new templates and screens in a much more efficient way. It is fully compatible with the templating toolkit and comes with example templates that can be adopted to your preferences. But since we are trying to understand the system here, let's go with the more complicated way first.
|
||||
|
||||
Open the **[controller.xml][14]** file inside of your shop's webapp directory. The controller keeps track of request events and performs actions accordingly. The following will create a new request under **/shop/test** :
|
||||
|
||||
```
|
||||
<!-- Request Mappings -->
|
||||
<request-map uri="test">
|
||||
<security https="true" auth="false"/>
|
||||
<response name="success" type="view" value="test"/>
|
||||
</request-map>
|
||||
```
|
||||
|
||||
You can define multiple responses and, if you want, you could use an event or a service call inside the request to determine which response you may want to use. I opted for a response of type "view." A view is a rendered response; other types are request-redirects, forwards, and alike. The system comes with various renderers and allows you to determine the output later; to do so, add the following:
|
||||
|
||||
```
|
||||
<!-- View Mappings -->
|
||||
<view-map name="test" type="screen" page="component://mycomponent/widget/CommonScreens.xml#test"/>
|
||||
```
|
||||
|
||||
Replace **my-component** with your own component name. Then you can define your very first screen by adding the following inside the tags within the **widget/CommonScreens.xml** file:
|
||||
|
||||
```
|
||||
<screen name="test">
|
||||
<section>
|
||||
<actions>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="CommonShopAppDecorator" location="component://shop/widget/CommonScreens.xml">
|
||||
<decorator-section name="body">
|
||||
<platform-specific><html><html-template location="component://mycomponent/webapp/mycomponent/test/test.ftl"/></html></platform-specific>
|
||||
</decorator-section>
|
||||
</decorator-screen>
|
||||
</widgets>
|
||||
</section>
|
||||
</screen>
|
||||
```
|
||||
|
||||
Screens are actually quite modular and consist of multiple elements ([widgets, actions, and decorators][15]). For the sake of simplicity, leave this as it is for now, and complete the new webpage by adding your very first templating toolkit file. For that, create a new **webapp/mycomponent/test/test.ftl** file and add the following:
|
||||
|
||||
```
|
||||
<@alert type="info">Success!</@alert>
|
||||
```
|
||||
|
||||
![Custom screen][17]
|
||||
|
||||
A custom screen.
|
||||
|
||||
Open **<https://localhost:8443/shop/control/test/>** and marvel at your own accomplishments.
|
||||
|
||||
#### Custom themes
|
||||
|
||||
Modify the look and feel of the shop by creating your very own theme. All themes can be found as components inside of the themes folder. Run **./ant create-theme** to add your own.
|
||||
|
||||
![theme component layout][19]
|
||||
|
||||
A typical theme component layout.
|
||||
|
||||
Here's a list of the most important directories and files:
|
||||
|
||||
* Theme configuration: **data/*ThemeData.xml**
|
||||
* Theme-specific wrapping HTML: **includes/*.ftl**
|
||||
* Templating Toolkit HTML definition: **includes/themeTemplate.ftl**
|
||||
* CSS class definition: **includes/themeStyles.ftl**
|
||||
* CSS framework: **webapp/theme-title/***
|
||||
|
||||
|
||||
|
||||
Take a quick look at the Metro theme in the toolkit; it uses the Foundation CSS framework and makes use of all the things above. Afterwards, set up your own theme inside your newly constructed **webapp/theme-title** directory and start developing. The Foundation-shop theme is a very simple shop-specific theme implementation that you can use as a basis for your own work.
|
||||
|
||||
Voila! You have set up your own online store and are ready to customize!
|
||||
|
||||
![Finished Scipio ERP shop][21]
|
||||
|
||||
A finished shop based on Scipio ERP.
|
||||
|
||||
### What's next?
|
||||
|
||||
Scipio ERP is a powerful framework that simplifies the development of complex e-commerce applications. For a more complete understanding, check out the project [documentation][7], try the [online demo][22], or [join the community][23].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/1/scipio-erp
|
||||
|
||||
作者:[Paul Piper][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/madppiper
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.scipioerp.com
|
||||
[2]: https://ofbiz.apache.org/
|
||||
[3]: https://www.scipioerp.com/community/developer/freemarker-macros/
|
||||
[4]: https://www.scipioerp.com/community/developer/installation-configuration/configuration/#database-configuration
|
||||
[5]: /file/419711
|
||||
[6]: https://opensource.com/sites/default/files/uploads/setup_step5_sm.jpg (Setup wizard)
|
||||
[7]: https://www.scipioerp.com/community/developer/architecture/components/
|
||||
[8]: https://www.scipioerp.com/community/developer/entities/
|
||||
[9]: https://www.scipioerp.com/community/developer/services/
|
||||
[10]: https://www.scipioerp.com/community/developer/views-requests/
|
||||
[11]: https://www.scipioerp.com/community/developer/events-actions/
|
||||
[12]: /file/419716
|
||||
[13]: https://opensource.com/sites/default/files/uploads/component_structure.jpg (component directory structure)
|
||||
[14]: https://www.scipioerp.com/community/developer/views-requests/request-controller/
|
||||
[15]: https://www.scipioerp.com/community/developer/views-requests/screen-widgets-decorators/
|
||||
[16]: /file/419721
|
||||
[17]: https://opensource.com/sites/default/files/uploads/success_screen_sm.jpg (Custom screen)
|
||||
[18]: /file/419726
|
||||
[19]: https://opensource.com/sites/default/files/uploads/theme_structure.jpg (theme component layout)
|
||||
[20]: /file/419731
|
||||
[21]: https://opensource.com/sites/default/files/uploads/finished_shop_1_sm.jpg (Finished Scipio ERP shop)
|
||||
[22]: https://www.scipioerp.com/demo/
|
||||
[23]: https://forum.scipioerp.com/
|
||||
@@ -1,144 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (!!Con 2019: submit a talk!)
|
||||
[#]: via: (https://jvns.ca/blog/2019/02/16/--con-2019--submit-a-talk-/)
|
||||
[#]: author: (Julia Evans https://jvns.ca/)
|
||||
|
||||
!!Con 2019: submit a talk!
|
||||
======
|
||||
|
||||
As some of you might know, for the last 5 years I’ve been one of the organizers for a conferences called [!!Con][1]. This year it’s going to be held on **May 11-12 in NYC**.
|
||||
|
||||
The submission deadline is **Sunday, March 3** and you can [submit a talk here][2].
|
||||
|
||||
(we also expanded to the west coast this year: [!!Con West][3] is next week!! I’m not on the !!Con West team since I live on the east coast but they’re doing amazing work, I have a ticket, and I’m so excited for there to be more !!Con in the world)
|
||||
|
||||
### !!Con is about the joy, excitement, and surprise of computing
|
||||
|
||||
Computers are AMAZING. You can make programs that seem like magic, computer science has all kind of fun and surprising tidbits, there are all kinds of ways to make really cool art with computers, the systems that we use every day (like DNS!) are often super fascinating, and sometimes our computers do REALLY STRANGE THINGS and it’s very fun to figure out why.
|
||||
|
||||
!!Con is about getting together for 2 days to share what we all love about computing. The only rule of !!Con talks is that the talk has to have an exclamation mark in the title :)
|
||||
|
||||
We originally considered calling !!Con ExclamationMarkCon but that was too unwieldy so we went with !!Con :).
|
||||
|
||||
### !!Con is inclusive
|
||||
|
||||
The other big thing about !!Con is that we think computing should include everyone. To make !!Con a space where everyone can participate, we
|
||||
|
||||
* have open captioning for all talks (so that people who can’t hear well can read the text of the talk as it’s happening). This turns out to be great for LOTS of people – if you just weren’t paying attention for a second, you can look at the live transcript to see what you missed!
|
||||
* pay our speakers & pay for speaker travel
|
||||
* have a code of conduct (of course)
|
||||
* use the RC [social rules][4]
|
||||
* make sure our washrooms work for people of all genders
|
||||
* let people specify on their badges if they don’t want photos taken of them
|
||||
* do a lot of active outreach to make sure our set of speakers is diverse
|
||||
|
||||
|
||||
|
||||
### past !!Con talks
|
||||
|
||||
I think maybe the easiest way to explain !!Con if you haven’t been is through the talk titles! Here are a few arbitrarily chosen talks from past !!Cons:
|
||||
|
||||
* [Four Fake Filesystems!][5]
|
||||
* [Islamic Geometry: Hankin’s Polygons in Contact Algorithm!!!][6]
|
||||
* [Don’t know about you, but I’m feeling like SHA-2!: Checksumming with Taylor Swift][7]
|
||||
* [MissingNo., my favourite Pokémon!][8]
|
||||
* [Music! Programming! Arduino! (Or: Building Electronic Musical Interfaces to Create Awesome)][9]
|
||||
* [How I Code and Use a Computer at 1,000 WPM!!][10]
|
||||
* [The emoji that Killed Chrome!!][11]
|
||||
* [We built a map to aggregate real-time flood data in under two days!][12]
|
||||
* [PUSH THE BUTTON! 🔴 Designing a fun game where the only input is a BIG RED BUTTON! 🔴 !!!][13]
|
||||
* [Serious programming with jq?! A practical and purely functional programming language!][14]
|
||||
* [I wrote to a dead address in a deleted PDF and now I know where all the airplanes are!!][15]
|
||||
* [Making Mushrooms Glow!][16]
|
||||
* [HDR Photography in Microsoft Excel?!][17]
|
||||
* [DHCP: IT’S MOSTLY YELLING!!][18]
|
||||
* [Lossy text compression, for some reason?!][19]
|
||||
* [Plants are Recursive!!: Using L-Systems to Generate Realistic Weeds][20]
|
||||
|
||||
|
||||
|
||||
If you want to see more (or get an idea of what !!Con talk descriptions usually look like), here’s every past year of the conference:
|
||||
|
||||
* 2018: [talk descriptions][21] and [recordings][22]
|
||||
* 2017: [talk descriptions][23] and [recordings][24]
|
||||
* 2016: [talk descriptions][25] and [recordings][26]
|
||||
* 2015: [talk descriptions][27] and [recordings][28]
|
||||
* 2014: [talk descriptions][29] and [recordings][30]
|
||||
|
||||
|
||||
|
||||
### this year you can also submit a play / song / performance!
|
||||
|
||||
One difference from previous !!Cons is that if you want submit a non-talk-talk to !!Con this year (like a play!), you can! I’m very excited to see what people come up with. For more of that see [Expanding the !!Con aesthetic][31].
|
||||
|
||||
### all talks are reviewed anonymously
|
||||
|
||||
One big choice that we’ve made is to review all talks anonymously. This means that we’ll review your talk the same way whether you’ve never given a talk before or if you’re an internationally recognized public speaker. I love this because many of our best talks are from first time speakers or people who I’d never heard of before, and I think anonymous review makes it easier to find great people who aren’t well known.
|
||||
|
||||
### writing a good outline is important
|
||||
|
||||
We can’t rely on someone’s reputation to determine if they’ll give a good talk, but we do need a way to see that people have a plan for how to present their material in an engaging way. So we ask everyone to give a somewhat detailed outline explaining how they’ll spend their 10 minutes. Some people do it minute-by-minute and some people just say “I’ll explain X, then Y, then Z, then W”.
|
||||
|
||||
Lindsey Kuper wrote some good advice about writing a clear !!Con outline here which has some examples of really good outlines [which you can see here][32].
|
||||
|
||||
### We’re looking for sponsors
|
||||
|
||||
!!Con is pay-what-you-can (if you can’t afford a $300 conference ticket, we’re the conference for you!). Because of that, we rely on our incredible sponsors (companies who want to build an inclusive future for tech with us!) to help make up the difference so that we can pay our speakers for their amazing work, pay for speaker travel, have open captioning, and everything else that makes !!Con the amazing conference it is.
|
||||
|
||||
If you love !!Con, a huge way you can help support the conference is to ask your company to sponsor us! Here’s our [sponsorship page][33] and you can email me at [[email protected]][34] if you’re interested.
|
||||
|
||||
### hope to see you there ❤
|
||||
|
||||
I’ve met so many fantastic people through !!Con, and it brings me a lot of joy every year. The thing that makes !!Con great is all the amazing people who come to share what they’re excited about every year, and I hope you’ll be one of them.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://jvns.ca/blog/2019/02/16/--con-2019--submit-a-talk-/
|
||||
|
||||
作者:[Julia Evans][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://jvns.ca/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: http://bangbangcon.com
|
||||
[2]: http://bangbangcon.com/give-a-talk.html
|
||||
[3]: http://bangbangcon.com/west/
|
||||
[4]: https://www.recurse.com/social-rules
|
||||
[5]: https://youtube.com/watch?v=pfHpDDXJQVg
|
||||
[6]: https://youtube.com/watch?v=ld4gpQnaziU
|
||||
[7]: https://youtube.com/watch?v=1QgamEwwPro
|
||||
[8]: https://youtube.com/watch?v=yX7tDROZUt8
|
||||
[9]: https://youtube.com/watch?v=67Y-wH0FJFg
|
||||
[10]: https://youtube.com/watch?v=G1r55efei5c
|
||||
[11]: https://youtube.com/watch?v=UE-fJjMasec
|
||||
[12]: https://youtube.com/watch?v=hfatYo2J8gY
|
||||
[13]: https://youtube.com/watch?v=KqEc2Ek4GzA
|
||||
[14]: https://youtube.com/watch?v=PS_9pyIASvQ
|
||||
[15]: https://youtube.com/watch?v=FhVob_sRqQk
|
||||
[16]: https://youtube.com/watch?v=T75FvUDirNM
|
||||
[17]: https://youtube.com/watch?v=bkQJdaGGVM8
|
||||
[18]: https://youtube.com/watch?v=enRY9jd0IJw
|
||||
[19]: https://youtube.com/watch?v=meovx9OqWJc
|
||||
[20]: https://youtube.com/watch?v=0eXg4B1feOY
|
||||
[21]: http://bangbangcon.com/2018/speakers.html
|
||||
[22]: http://bangbangcon.com/2018/recordings.html
|
||||
[23]: http://bangbangcon.com/2017/speakers.html
|
||||
[24]: http://bangbangcon.com/2017/recordings.html
|
||||
[25]: http://bangbangcon.com/2016/speakers.html
|
||||
[26]: http://bangbangcon.com/2016/recordings.html
|
||||
[27]: http://bangbangcon.com/2015/speakers.html
|
||||
[28]: http://bangbangcon.com/2015/recordings.html
|
||||
[29]: http://bangbangcon.com/2014/speakers.html
|
||||
[30]: http://bangbangcon.com/2014/recordings.html
|
||||
[31]: https://organicdonut.com/2019/01/expanding-the-con-aesthetic/
|
||||
[32]: http://composition.al/blog/2017/06/30/how-to-write-a-timeline-for-a-bangbangcon-talk-proposal/
|
||||
[33]: http://bangbangcon.com/sponsors
|
||||
[34]: https://jvns.ca/cdn-cgi/l/email-protection
|
||||
@@ -1,69 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to put an HTML page on the internet)
|
||||
[#]: via: (https://jvns.ca/blog/2019/09/06/how-to-put-an-html-page-on-the-internet/)
|
||||
[#]: author: (Julia Evans https://jvns.ca/)
|
||||
|
||||
How to put an HTML page on the internet
|
||||
======
|
||||
|
||||
One thing I love about the internet is that it’s SO EASY to put static HTML websites on the internet. Someone asked me today how to do it, so I thought I’d write down how really quickly!
|
||||
|
||||
### just an HTML page
|
||||
|
||||
All of my sites are just static HTML and CSS. My web design skills are relatively minimal (<https://wizardzines.com> is the most complicated site I’ve developed on my own), so keeping all my internet sites relatively simple means that I have some hope of being able to make changes / fix things without spending a billion hours on it.
|
||||
|
||||
So we’re going to take as minimal of an approach as possible in this blog post – just one HTML page.
|
||||
|
||||
### the HTML page
|
||||
|
||||
The website we’re going to put on the internet is just one file, called `index.html`. You can find it at <https://github.com/jvns/website-example>, which is a Github repository with exactly one file in it.
|
||||
|
||||
The HTML file has some CSS in it to make it look a little less boring, which is partly copied from <https://example.com>.
|
||||
|
||||
### how to put the HTML page on the internet
|
||||
|
||||
Here are the steps:
|
||||
|
||||
1. sign up for a [Neocities][1] account
|
||||
2. copy the index.html into the index.html in your neocities site
|
||||
3. done
|
||||
|
||||
|
||||
|
||||
The index.html page above is on the internet at [julia-example-website.neocities.com][2], if you view source you’ll see that it’s the same HTML as in the github repo.
|
||||
|
||||
I think this is probably the simplest way to put an HTML page on the internet (and it’s a throwback to Geocities, which is how I made my first website in 2003) :). I also like that Neocities (like [glitch][3], which I also love) is about experimentation and learning and having fun..
|
||||
|
||||
### other options
|
||||
|
||||
This is definitely not the only easy way – Github pages and Gitlab pages and Netlify will all automatically publish a site when you push to a Git repository, and they’re all very easy to use (just connect them to your github repository and you’re done). I personally use the Git repository approach because not having things in Git makes me nervous – I like to know what changes to my website I’m actually pushing. But I think if you just want to put an HTML site on the internet for the first time and play around with HTML/CSS, Neocities is a really nice way to do it.
|
||||
|
||||
If you want to actually use your website for a Real Thing and not just to play around you probably want to buy a domain and link it to your website so that you can change hosting providers in the future, but that is a bit less simple.
|
||||
|
||||
### this is a good possible jumping off point for learning HTML
|
||||
|
||||
If you are a person who is comfortable editing files in a Git repository but wants to practice HTML/CSS, I think this is a fun way to put a website on the internet and play around! I really like the simplicity of it – there’s literally just one file, so there’s no fancy extra magic to get in the way of understanding what’s going on.
|
||||
|
||||
There are also a bunch of ways to complicate/extend this, like this blog is actually generated with [Hugo][4] which generates a bunch of HTML files which then go on the internet, but it’s always nice to start with the basics.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://jvns.ca/blog/2019/09/06/how-to-put-an-html-page-on-the-internet/
|
||||
|
||||
作者:[Julia Evans][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://jvns.ca/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://neocities.org/
|
||||
[2]: https://julia-example-website.neocities.org/
|
||||
[3]: https://glitch.com
|
||||
[4]: https://gohugo.io/
|
||||
@@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (qfzy1233)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (An introduction to Virtual Machine Manager)
|
||||
[#]: via: (https://opensource.com/article/19/9/introduction-virtual-machine-manager)
|
||||
[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdosshttps://opensource.com/users/alanfdosshttps://opensource.com/users/bgamrathttps://opensource.com/users/marcobravo)
|
||||
|
||||
An introduction to Virtual Machine Manager
|
||||
======
|
||||
Virt-manager provides a full range of options for spinning up virtual
|
||||
machines on Linux.
|
||||
![A person programming][1]
|
||||
|
||||
In my [series][2] about [GNOME Boxes][3], I explained how Linux users can quickly spin up virtual machines on their desktop without much fuss. Boxes is ideal for creating virtual machines in a pinch when a simple configuration is all you need.
|
||||
|
||||
But if you need to configure more detail in your virtual machine, you need a tool that provides a full range of options for disks, network interface cards (NICs), and other hardware. This is where [Virtual Machine Manager][4] (virt-manager) comes in. If you don't see it in your applications menu, you can install it from your package manager or via the command line:
|
||||
|
||||
* On Fedora: **sudo dnf install virt-manager**
|
||||
* On Ubuntu: **sudo apt install virt-manager**
|
||||
|
||||
|
||||
|
||||
Once it's installed, you can launch it from its application menu icon or from the command line by entering **virt-manager**.
|
||||
|
||||
![Virtual Machine Manager's main screen][5]
|
||||
|
||||
To demonstrate how to create a virtual machine using virt-manager, I'll go through the steps to set one up for Red Hat Enterprise Linux 8.
|
||||
|
||||
To start, click **File** then **New Virtual Machine**. Virt-manager's developers have thoughtfully titled each step of the process (e.g., Step 1 of 5) to make it easy. Click **Local install media** and **Forward**.
|
||||
|
||||
![Step 1 virtual machine creation][6]
|
||||
|
||||
On the next screen, browse to select the ISO file for the operating system you want to install. (My RHEL 8 image is located in my Downloads directory.) Virt-manager automatically detects the operating system.
|
||||
|
||||
![Step 2 Choose the ISO File][7]
|
||||
|
||||
In Step 3, you can specify the virtual machine's memory and CPU. The defaults are 1,024MB memory and one CPU.
|
||||
|
||||
![Step 3 Set CPU and Memory][8]
|
||||
|
||||
I want to give RHEL ample room to run—and the hardware I'm using can accommodate it—so I'll increase them (respectively) to 4,096MB and two CPUs.
|
||||
|
||||
The next step configures storage for the virtual machine; the default setting is a 10GB disk image. (I'll keep this setting, but you can adjust it for your needs.) You can also choose an existing disk image or create one in a custom location.
|
||||
|
||||
![Step 4 Configure VM Storage][9]
|
||||
|
||||
Step 5 is the place to name your virtual machine and click Finish. This is equivalent to creating a virtual machine or a Box in GNOME Boxes. While it's technically the last step, you have several options (as you can see in the screenshot below). Since the advantage of virt-manager is the ability to customize a virtual machine, I'll check the box labeled **Customize configuration before install** before I click **Finish**.
|
||||
|
||||
Since I chose to customize the configuration, virt-manager opens a screen displaying a bunch of devices and settings. This is the fun part!
|
||||
|
||||
Here you have another chance to name the virtual machine. In the list on the left, you can view details on various aspects, such as CPU, memory, disks, controllers, and many other items. For example, I can click on **CPUs** to verify the change I made in Step 3.
|
||||
|
||||
![Changing the CPU count][10]
|
||||
|
||||
I can also confirm the amount of memory I set.
|
||||
|
||||
When installing a VM to run as a server, I usually disable or remove its sound capability. To do so, select **Sound** and click **Remove** or right-click on **Sound** and choose **Remove Hardware**.
|
||||
|
||||
You can also add hardware with the **Add Hardware** button at the bottom. This brings up the **Add New Virtual Hardware** screen where you can add additional storage devices, memory, sound, etc. It's like having access to a very well-stocked (if virtual) computer hardware warehouse.
|
||||
|
||||
![The Add New Hardware screen][11]
|
||||
|
||||
Once you are happy with your VM configuration, click **Begin Installation**, and the system will boot and begin installing your specified operating system from the ISO.
|
||||
|
||||
![Begin installing the OS][12]
|
||||
|
||||
Once it completes, it reboots, and your new VM is ready for use.
|
||||
|
||||
![Red Hat Enterprise Linux 8 running in VMM][13]
|
||||
|
||||
Virtual Machine Manager is a powerful tool for desktop Linux users. It is open source and an excellent alternative to proprietary and closed virtualization products.
|
||||
|
||||
Learn how Vagrant and Ansible can be used to provision virtual machines for web development.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/introduction-virtual-machine-manager
|
||||
|
||||
作者:[Alan Formy-Duval][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/alanfdosshttps://opensource.com/users/alanfdosshttps://opensource.com/users/bgamrathttps://opensource.com/users/marcobravo
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming)
|
||||
[2]: https://opensource.com/sitewide-search?search_api_views_fulltext=GNOME%20Box
|
||||
[3]: https://wiki.gnome.org/Apps/Boxes
|
||||
[4]: https://virt-manager.org/
|
||||
[5]: https://opensource.com/sites/default/files/1-vmm_main_0.png (Virtual Machine Manager's main screen)
|
||||
[6]: https://opensource.com/sites/default/files/2-vmm_step1_0.png (Step 1 virtual machine creation)
|
||||
[7]: https://opensource.com/sites/default/files/3-vmm_step2.png (Step 2 Choose the ISO File)
|
||||
[8]: https://opensource.com/sites/default/files/4-vmm_step3default.png (Step 3 Set CPU and Memory)
|
||||
[9]: https://opensource.com/sites/default/files/6-vmm_step4.png (Step 4 Configure VM Storage)
|
||||
[10]: https://opensource.com/sites/default/files/9-vmm_customizecpu.png (Changing the CPU count)
|
||||
[11]: https://opensource.com/sites/default/files/11-vmm_addnewhardware.png (The Add New Hardware screen)
|
||||
[12]: https://opensource.com/sites/default/files/12-vmm_rhelbegininstall.png
|
||||
[13]: https://opensource.com/sites/default/files/13-vmm_rhelinstalled_0.png (Red Hat Enterprise Linux 8 running in VMM)
|
||||
@@ -1,352 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Find and Replace a String in File Using the sed Command in Linux)
|
||||
[#]: via: (https://www.2daygeek.com/linux-sed-to-find-and-replace-string-in-files/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
How to Find and Replace a String in File Using the sed Command in Linux
|
||||
======
|
||||
|
||||
When you are working on text files you may need to find and replace a string in the file.
|
||||
|
||||
Sed command is mostly used to replace the text in a file.
|
||||
|
||||
This can be done using the sed command and awk command in Linux.
|
||||
|
||||
In this tutorial, we will show you how to do this using the sed command and then show about the awk command.
|
||||
|
||||
### What is sed Command
|
||||
|
||||
Sed command stands for Stream Editor, It is used to perform basic text manipulation in Linux. It could perform various functions such as search, find, modify, insert or delete files.
|
||||
|
||||
Also, it’s performing complex regular expression pattern matching.
|
||||
|
||||
It can be used for the following purpose.
|
||||
|
||||
* To find and replace matches with a given format.
|
||||
* To find and replace specific lines that match a given format.
|
||||
* To find and replace the entire line that matches the given format.
|
||||
* To search and replace two different patterns simultaneously.
|
||||
|
||||
|
||||
|
||||
The fifteen examples listed in this article will help you to master in the sed command.
|
||||
|
||||
If you want to remove a line from a file using the Sed command, go to the following article.
|
||||
|
||||
**`Note:`** Since this is a demonstration article, we use the sed command without the `-i` option, which removes lines and prints the contents of the file in the Linux terminal.
|
||||
|
||||
But if you want to remove lines from the source file in the real environment, use the `-i` option with the sed command.
|
||||
|
||||
Common Syntax for sed to replace a string.
|
||||
|
||||
```
|
||||
sed -i 's/Search_String/Replacement_String/g' Input_File
|
||||
```
|
||||
|
||||
First we need to understand sed syntax to do this. See details about it.
|
||||
|
||||
* `sed:` It’s a Linux command.
|
||||
* `-i:` It’s one of the option for sed and what it does? By default sed print the results to the standard output. When you add this option with sed then it will edit files in place. A backup of the original file will be created when you add a suffix (For ex, -i.bak
|
||||
* `s:` The s is the substitute command.
|
||||
* `Search_String:` To search a given string or regular expression.
|
||||
* `Replacement_String:` The replacement string.
|
||||
* `g:` Global replacement flag. By default, the sed command replaces the first occurrence of the pattern in each line and it won’t replace the other occurrence in the line. But, all occurrences will be replaced when the replacement flag is provided
|
||||
* `/` Delimiter character.
|
||||
* `Input_File:` The filename that you want to perform the action.
|
||||
|
||||
|
||||
|
||||
Let us look at some examples of commonly used with sed command to search and convert text in files.
|
||||
|
||||
We have created the below file for demonstration purposes.
|
||||
|
||||
```
|
||||
# cat sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 1) How to Find and Replace the “first” Event of the Pattern on a Line
|
||||
|
||||
The below sed command replaces the word **unix** with **linux** in the file. This only changes the first instance of the pattern on each line.
|
||||
|
||||
```
|
||||
# sed 's/unix/linux/' sed-test.txt
|
||||
|
||||
1 Unix linux unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxlinux UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 2) How to Find and Replace the “Nth” Occurrence of the Pattern on a Line
|
||||
|
||||
Use the /1,/2,../n flags to replace the corresponding occurrence of a pattern in a line.
|
||||
|
||||
The below sed command replaces the second instance of the “unix” pattern with “linux” in a line.
|
||||
|
||||
```
|
||||
# sed 's/unix/linux/2' sed-test.txt
|
||||
|
||||
1 Unix unix linux 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 3) How to Search and Replace all Instances of the Pattern in a Line
|
||||
|
||||
The below sed command replaces all instances of the “unix” format with “Linux” on the line because “g” means a global replacement.
|
||||
|
||||
```
|
||||
# sed 's/unix/linux/g' sed-test.txt
|
||||
|
||||
1 Unix linux linux 23
|
||||
2 linux Linux 34
|
||||
3 linuxlinux UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 4) How to Find and Replace the Pattern for all Instances in a Line from the “Nth” Event
|
||||
|
||||
The below sed command replaces all the patterns from the “Nth” instance of a pattern in a line.
|
||||
|
||||
```
|
||||
# sed 's/unix/linux/2g' sed-test.txt
|
||||
|
||||
1 Unix unix linux 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 5) Search and Replace the pattern on a specific line number
|
||||
|
||||
You can able to replace the string on a specific line number. The below sed command replaces the pattern “unix” with “linux” only on the 3rd line.
|
||||
|
||||
```
|
||||
# sed '3 s/unix/linux/' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxlinux UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 6) How to Find and Replace Pattern in a Range of Lines
|
||||
|
||||
You can specify the range of line numbers to replace the string.
|
||||
|
||||
The below sed command replaces the “Unix” pattern with “Linux” with lines 1 through 3.
|
||||
|
||||
```
|
||||
# sed '1,3 s/unix/linux/' sed-test.txt
|
||||
|
||||
1 Unix linux unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxlinux UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 7) How to Find and Change the pattern in the Last Line
|
||||
|
||||
The below sed command allows you to replace the matching string only in the last line.
|
||||
|
||||
The below sed command replaces the “Linux” pattern with “Unix” only on the last line.
|
||||
|
||||
```
|
||||
# sed '$ s/Linux/Unix/' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Unix is free and opensource operating system
|
||||
```
|
||||
|
||||
### 8) How to Find and Replace the Pattern with only Right Word in a Line
|
||||
|
||||
As you might have noticed, the substring “linuxunix” is replaced with “linuxlinux” in the 6th example. If you want to replace only the right matching word, use the word-boundary expression “\b” on both ends of the search string.
|
||||
|
||||
```
|
||||
# sed '1,3 s/\bunix\b/linux/' sed-test.txt
|
||||
|
||||
1 Unix linux unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 9) How to Search and Replaces the pattern with case insensitive
|
||||
|
||||
Everyone knows that Linux is case sensitive. To make the pattern match with case insensitive, use the I flag.
|
||||
|
||||
```
|
||||
# sed 's/unix/linux/gI' sed-test.txt
|
||||
|
||||
1 linux linux linux 23
|
||||
2 linux Linux 34
|
||||
3 linuxlinux linuxLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 10) How to Find and Replace a String that Contains the Delimiter Character
|
||||
|
||||
When you search and replace for a string with the delimiter character, we need to use the backslash “\” to escape the slash.
|
||||
|
||||
In this example, we are going to replaces the “/bin/bash” with “/usr/bin/fish”.
|
||||
|
||||
```
|
||||
# sed 's/\/bin\/bash/\/usr\/bin\/fish/g' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /usr/bin/fish CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
The above sed command works as expected, but it looks bad. To simplify this, most of the people will use the vertical bar “|”. So, I advise you to go with it.
|
||||
|
||||
```
|
||||
# sed 's|/bin/bash|/usr/bin/fish/|g' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /usr/bin/fish/ CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 11) How to Find and Replaces Digits with a Given Pattern
|
||||
|
||||
Similarly, digits can be replaced with pattern. The below sed command replaces all digits with “[0-9]” “number” pattern.
|
||||
|
||||
```
|
||||
# sed 's/[0-9]/number/g' sed-test.txt
|
||||
|
||||
number Unix unix unix numbernumber
|
||||
number linux Linux numbernumber
|
||||
number linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 12) How to Find and Replace only two Digit Numbers with Pattern
|
||||
|
||||
If you want to replace the two digit numbers with the pattern, use the sed command below.
|
||||
|
||||
```
|
||||
# sed 's/\b[0-9]\{2\}\b/number/g' sed-test.txt
|
||||
|
||||
1 Unix unix unix number
|
||||
2 linux Linux number
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 13) How to Print only Replaced Lines with the sed Command
|
||||
|
||||
If you want to display only the changed lines, use the below sed command.
|
||||
|
||||
* p – It prints the replaced line twice on the terminal.
|
||||
* n – It suppresses the duplicate rows generated by the “p” flag.
|
||||
|
||||
|
||||
|
||||
```
|
||||
# sed -n 's/Unix/Linux/p' sed-test.txt
|
||||
|
||||
1 Linux unix unix 23
|
||||
3 linuxunix LinuxLinux
|
||||
```
|
||||
|
||||
### 14) How to Run Multiple sed Commands at Once
|
||||
|
||||
The following sed command detect and replaces two different patterns simultaneously.
|
||||
|
||||
The below sed command searches for “linuxunix” and “CentOS” pattern, replacing them with “LINUXUNIX” and “RHEL8” at a time.
|
||||
|
||||
```
|
||||
# sed -e 's/linuxunix/LINUXUNIX/g' -e 's/CentOS/RHEL8/g' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 LINUXUNIX UnixLinux
|
||||
linux /bin/bash RHEL8 Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
The following sed command search for two different patterns and replaces them with one string at a time.
|
||||
|
||||
The below sed command searches for “linuxunix” and “CentOS” pattern, replacing them with “Fedora30” at a time.
|
||||
|
||||
```
|
||||
# sed -e 's/\(linuxunix\|CentOS\)/Fedora30/g' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 Fedora30 UnixLinux
|
||||
linux /bin/bash Fedora30 Linux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 15) How to Find and Replace the Entire Line if the Given Pattern Matches
|
||||
|
||||
If the pattern matches, you can use the sed command to replace the entire line with the new line. This can be done using the “C” flag.
|
||||
|
||||
```
|
||||
# sed '/OS/ c New Line' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
New Line
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
|
||||
### 16) How to Search and Replace lines that Matches a Pattern
|
||||
|
||||
You can specify a pattern for the sed command to fit on a line. In the event of pattern matching, the sed command searches for the string to be replaced.
|
||||
|
||||
The below sed command first looks for lines that have the “OS” pattern, then replaces the word “Linux” with “ArchLinux”.
|
||||
|
||||
```
|
||||
# sed '/OS/ s/Linux/ArchLinux/' sed-test.txt
|
||||
|
||||
1 Unix unix unix 23
|
||||
2 linux Linux 34
|
||||
3 linuxunix UnixLinux
|
||||
linux /bin/bash CentOS ArchLinux OS
|
||||
Linux is free and opensource operating system
|
||||
```
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/linux-sed-to-find-and-replace-string-in-files/
|
||||
|
||||
作者:[Magesh Maruthamuthu][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://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
@@ -1,63 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Taking a year to explain computer things)
|
||||
[#]: via: (https://jvns.ca/blog/2019/09/13/a-year-explaining-computer-things/)
|
||||
[#]: author: (Julia Evans https://jvns.ca/)
|
||||
|
||||
Taking a year to explain computer things
|
||||
======
|
||||
|
||||
I’ve been working on explaining computer things I’m learning on this blog for 6 years. I wrote one of my first posts, [what does a shell even do?][1] on Sept 30, 2013. Since then, I’ve written 11 zines, 370,000 words on this blog, and given 20 or so talks. So it seems like I like explaining things a lot.
|
||||
|
||||
### tl;dr: I’m going to work on explaining computer things for a year
|
||||
|
||||
Here’s the exciting news: I left my job a month ago and my plan is to spend the next year working on explaining computer things!
|
||||
|
||||
As for why I’m doing this – I was talking through some reasons with my friend Mat last night and he said “well, sometimes there are things you just feel compelled to do”. I think that’s all there is to it :)
|
||||
|
||||
### what does “explain computer things” mean?
|
||||
|
||||
I’m planning to:
|
||||
|
||||
1. write some more zines (maybe I can write 10 zines in a year? we’ll see! I want to tackle both general-interest and slightly more niche topics, we’ll see what happens).
|
||||
2. work on some more interactive ways to learn things. I learn things best by trying things out and breaking them, so I want to see if I can facilitate that a little bit for other people. I started a project around this in May which has been on the backburner for a bit but which I’m excited about. Hopefully I’ll release it soon and then you can try it out and tell me what you think!
|
||||
|
||||
|
||||
|
||||
I say “a year” because I think I have at least a year’s worth of ideas and I can’t predict how I’ll feel after doing this for a year.
|
||||
|
||||
### how: run a business
|
||||
|
||||
I started a corporation almost exactly a year ago, and I’m planning to keep running my explaining-things efforts as a business. This business has been making more than I made in my first programming job (that is, definitely enough money to live on!), which has been really surprising and great (thank you!).
|
||||
|
||||
some parameters of the business:
|
||||
|
||||
* I’m not planning to hire employees or anything, it’ll just be me and some (awesome) freelancers. The biggest change I have in mind is that I’m hoping to find a freelance editor to help me with editing.
|
||||
* I also don’t have any specific plans for world domination or to work 80-hour weeks. I’m just going to make zines & things that explain computer concepts and sell them on the internet, like I’ve been doing.
|
||||
* No commissions or consulting work, just building ideas I have
|
||||
|
||||
|
||||
|
||||
It’s been pretty interesting to learn more about running a small business and so far I like it more than I thought I would. (except for taxes, which I like exactly as much as I thought I would)
|
||||
|
||||
### that’s all!
|
||||
|
||||
I’m excited to keep making explanations of computer things and to have more time to do it. This blog might change a bit away from “here’s what I’m learning at work these days” and towards “here are attempts at explaining things that I mostly already know”. It’ll be different! We’ll see how it goes!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://jvns.ca/blog/2019/09/13/a-year-explaining-computer-things/
|
||||
|
||||
作者:[Julia Evans][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://jvns.ca/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://jvns.ca/blog/2013/09/30/hacker-school-day-2-what-does-a-shell-even-do/
|
||||
@@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
210
sources/tech/20190918 Adding themes and plugins to Zsh.md
Normal file
210
sources/tech/20190918 Adding themes and plugins to Zsh.md
Normal file
@@ -0,0 +1,210 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (amwps290 )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Adding themes and plugins to Zsh)
|
||||
[#]: via: (https://opensource.com/article/19/9/adding-plugins-zsh)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/sethhttps://opensource.com/users/sethhttps://opensource.com/users/sethhttps://opensource.com/users/seth)
|
||||
|
||||
Adding themes and plugins to Zsh
|
||||
======
|
||||
Expand Z-shell's capabilities with themes and plugins installed with Oh
|
||||
My Zsh.
|
||||
![Someone wearing a hardhat and carrying code ][1]
|
||||
|
||||
In my [previous article][2], I explained how to get started with [Z-shell][2] (Zsh). For some users, the most exciting thing about Zsh is its ability to adopt new themes. It's so easy to theme Zsh both because of the active community designing visuals for the shell and also because of the [Oh My Zsh][3] project, which makes it trivial to install them.
|
||||
|
||||
Theming is one of those changes you notice immediately, so if you don't feel like you changed shells when you installed Zsh, you'll definitely feel it once you've adopted one of the 100+ themes bundled with Oh My Zsh. There's a lot more to Oh My Zsh than just pretty themes, though; there are also hundreds of plugins that add features to your Z-shell environment.
|
||||
|
||||
### Installing Oh My Zsh
|
||||
|
||||
The [ohmyz.sh][3] website encourages you to install the framework by running a script over the internet from your computer. While the Oh My Zsh project is almost certainly trustworthy, it's generally ill-advised to blindly run scripts on your system. If you want to run the install script, you can download it, read it, and run it after you're satisfied you understand what it's doing.
|
||||
|
||||
If you download the script and read it, you may notice that installation is only a three-step process:
|
||||
|
||||
#### 1\. Clone oh-my-zsh
|
||||
|
||||
First, clone the oh-my-zsh repository into a directory called **~/.oh-my-zsh**:
|
||||
|
||||
|
||||
```
|
||||
`% git clone http://github.com/robbyrussell/oh-my-zsh ~/.oh-my-zsh`
|
||||
```
|
||||
|
||||
#### 2\. Switch the config file
|
||||
|
||||
Next, back up your existing **.zshrc** file and move the default one from the oh-my-zsh install into its place. You can do this in one command using the **-b** (backup) option for **mv**, as long as your version of the **mv** command includes that option:
|
||||
|
||||
|
||||
```
|
||||
% mv -b \
|
||||
~/.oh-my-zsh/templates/zshrc.zsh-template \
|
||||
~/.zshrc
|
||||
```
|
||||
|
||||
#### 3\. Edit the config
|
||||
|
||||
By default, Oh My Zsh's configuration is pretty bland, so you might want to reintegrate your custom **~/.zshrc** into the **.oh-my-zsh** config. To do that, append your old config to the end of the new one using the [cat command][4]:
|
||||
|
||||
|
||||
```
|
||||
`% cat ~/.zshrc~ >> ~/.zshrc`
|
||||
```
|
||||
|
||||
To see the default configuration and learn about some of the options it provides, open **~/.zshrc** in your favorite text editor. The file is well-commented, so it's a great way to get a good idea of what's possible.
|
||||
|
||||
For instance, you can change the location of your **.oh-my-zsh** directory. At installation, it resides at the base of your home directory, but modern Linux convention, as defined by the [Free Desktop][5] specification, is to place directories that extend the functionality of applications in the **~/.local/share** directory. You can change it in **~/.zshrc** by editing the line:
|
||||
|
||||
|
||||
```
|
||||
# Path to your oh-my-zsh installation.
|
||||
export ZSH=$HOME/.local/share/oh-my-zsh
|
||||
```
|
||||
|
||||
then moving the directory to that location:
|
||||
|
||||
|
||||
```
|
||||
% mv ~/.oh-my-zsh \
|
||||
$HOME/.local/share/oh-my-zsh
|
||||
```
|
||||
|
||||
If you're using MacOS, the specification is less clear, but arguably the most appropriate place for the directory is **$HOME/Library/Application\ Support**.
|
||||
|
||||
### Relaunching Zsh
|
||||
|
||||
After editing the config, you have to relaunch your shell. Before you do that, make sure you've finished any in-progress config changes; for instance, don't change the path of **.oh-my-zsh** then forget to move the directory to its new location. If you don't want to relaunch your shell, you can **source** the config file, just as you can with Bash:
|
||||
|
||||
|
||||
```
|
||||
% source ~/.zshrc
|
||||
➜ .oh-my-zsh git:(master) ✗
|
||||
```
|
||||
|
||||
You can ignore any warnings about missing update files; they will be resolved upon relaunch.
|
||||
|
||||
### Changing your theme
|
||||
|
||||
Installing Oh My Zsh sets your Z-shell theme to **robbyrussell**, a theme by the project's maintainer. This theme's changes are minimal, mostly involving the color of your prompt.
|
||||
|
||||
To view all the available themes, list the contents of the **.oh-my-zsh** theme directory:
|
||||
|
||||
|
||||
```
|
||||
➜ .oh-my-zsh git:(master) ✗ ls \
|
||||
~/.local/share/oh-my-zsh/themes
|
||||
3den.zsh-theme
|
||||
adben.zsh-theme
|
||||
af-magic.zsh-theme
|
||||
afowler.zsh-theme
|
||||
agnoster.zsh-theme
|
||||
[...]
|
||||
```
|
||||
|
||||
To see screenshots of themes before trying them, visit the Oh My Zsh [wiki][6]. For even more themes, visit the [External themes][7] wiki page.
|
||||
|
||||
Most themes are simple to set up and use. Just change the value of the theme name in **.zshrc** and reload the config:
|
||||
|
||||
|
||||
```
|
||||
➜ ~ sed -i \
|
||||
's/_THEME=\"robbyrussel\"/_THEME=\"linuxonly\"/g' \
|
||||
~/.zshrc
|
||||
➜ ~ source ~/.zshrc
|
||||
seth@darkstar:pts/0->/home/skenlon (0) ➜
|
||||
```
|
||||
|
||||
Other themes require extra configuration. For example, to use the **agnoster** theme, you must first install the Powerline font. This is an open source font, and it's probably in your software repository if you're running Linux. Install it with:
|
||||
|
||||
|
||||
```
|
||||
`➜ ~ sudo dnf install powerline-fonts`
|
||||
```
|
||||
|
||||
Set your theme in the config:
|
||||
|
||||
|
||||
```
|
||||
➜ ~ sed -i \
|
||||
's/_THEME=\"linuxonly\"/_THEME=\"agnoster\"/g' \
|
||||
~/.zshrc
|
||||
```
|
||||
|
||||
and then relaunch (a simple **source** won't work). Upon relaunch, you will see the new theme:
|
||||
|
||||
![agnoster theme][8]
|
||||
|
||||
### Installing plugins
|
||||
|
||||
Over 200 plugins ship with Oh My Zsh, and you can see them by looking in **.oh-my-zsh/plugins**. Each plugin directory has a README file explaining what the plugin does.
|
||||
|
||||
Some plugins are relatively simple. For instance, the **dnf**, **ubuntu**, **brew**, and **macports** plugins are collections of aliases to simplify interactions with the DNF, Apt, Homebrew, and MacPorts package managers.
|
||||
|
||||
Others are more complex. The **git** plugin, active by default, detects when you're working in a [Git repository][9] and updates your shell prompt so that it lists the current branch and even indicates whether there are unmerged changes.
|
||||
|
||||
To activate a plugin, add it to the plugin setting in **~/.zshrc**. For example, to add the **dnf** and **pass** plugins, open **~/.zshrc** in your favorite text editor:
|
||||
|
||||
|
||||
```
|
||||
`plugins=(git dnf pass)`
|
||||
```
|
||||
|
||||
Save your changes and reload your Zsh session:
|
||||
|
||||
|
||||
```
|
||||
`% source ~/.zshrc`
|
||||
```
|
||||
|
||||
The plugins are now active. You can test the **dnf** plugin by using one of the aliases it provides:
|
||||
|
||||
|
||||
```
|
||||
% dnfs fop
|
||||
====== Name Exactly Matched: fop ======
|
||||
fop.noarch : XSL-driven print formatter
|
||||
```
|
||||
|
||||
Different plugins do different things, so you may want to install only one or two at a time to help you learn the new capabilities of your shell.
|
||||
|
||||
#### Cheating
|
||||
|
||||
Some Oh My Zsh plugins are pretty generic. If you look at a plugin that claims to be a Z-shell plugin and the code is also compatible with Bash, then you can use it in your Bash shell. Some plugins require Z-shell-specific functions, so this won't work with all of them. But you can load plugins like **dnf**, **ubuntu**, **[firewalld][10]**, and others into a Bash shell by using **source** to load the plugin of your choice. For example:
|
||||
|
||||
|
||||
```
|
||||
if [ -d $HOME/.local/share/oh-my-zsh/plugins ]; then
|
||||
source $HOME/.local/share/oh-my-zsh/plugins/dnf/dnf.plugin.zsh
|
||||
fi
|
||||
```
|
||||
|
||||
### To Z or not to Z
|
||||
|
||||
Z-shell is a powerful shell both for its built-in features and the plugins contributed by its passionate community. Whether you use it as your primary shell or just as a shell you visit on weekends or holidays, you owe it to yourself to try it out.
|
||||
|
||||
What are your favorite Z-shell themes and plugins? Tell us in the comments!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/adding-plugins-zsh
|
||||
|
||||
作者:[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/sethhttps://opensource.com/users/sethhttps://opensource.com/users/sethhttps://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/build_structure_tech_program_code_construction.png?itok=nVsiLuag (Someone wearing a hardhat and carrying code )
|
||||
[2]: https://opensource.com/article/19/9/getting-started-zsh
|
||||
[3]: https://ohmyz.sh/
|
||||
[4]: https://opensource.com/article/19/2/getting-started-cat-command
|
||||
[5]: http://freedesktop.org
|
||||
[6]: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
|
||||
[7]: https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes
|
||||
[8]: https://opensource.com/sites/default/files/uploads/zsh-agnoster.jpg (agnoster theme)
|
||||
[9]: https://opensource.com/resources/what-is-git
|
||||
[10]: https://opensource.com/article/19/7/make-linux-stronger-firewalls
|
||||
@@ -0,0 +1,114 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to remove carriage returns from text files on Linux)
|
||||
[#]: via: (https://www.networkworld.com/article/3438857/how-to-remove-carriage-returns-from-text-files-on-linux.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
How to remove carriage returns from text files on Linux
|
||||
======
|
||||
When carriage returns (also referred to as Ctrl+M's) get on your nerves, don't fret. There are several easy ways to show them the door.
|
||||
[Kim Siever][1]
|
||||
|
||||
Carriage returns go back a long way – as far back as typewriters on which a mechanism or a lever swung the carriage that held a sheet of paper to the right so that suddenly letters were being typed on the left again. They have persevered in text files on Windows, but were never used on Linux systems. This incompatibility sometimes causes problems when you’re trying to process files on Linux that were created on Windows, but it's an issue that is very easily resolved.
|
||||
|
||||
The carriage return, also referred to as **Ctrl+M**, character would show up as an octal 15 if you were looking at the file with an **od** octal dump) command. The characters **CRLF** are often used to represent the carriage return and linefeed sequence that ends lines on Windows text files. Those who like to gaze at octal dumps will spot the **\r \n**. Linux text files, by comparison, end with just linefeeds.
|
||||
|
||||
**[ Two-Minute Linux Tips: [Learn how to master a host of Linux commands in these 2-minute video tutorials][2] ]**
|
||||
|
||||
Here's a sample of **od** output with the lines containing the **CRLF** characters in both octal and character form highlighted.
|
||||
|
||||
```
|
||||
$ od -bc testfile.txt
|
||||
0000000 124 150 151 163 040 151 163 040 141 040 164 145 163 164 040 146
|
||||
T h i s i s a t e s t f
|
||||
0000020 151 154 145 040 146 162 157 155 040 127 151 156 144 157 167 163
|
||||
i l e f r o m W i n d o w s
|
||||
0000040 056 015 012 111 164 047 163 040 144 151 146 146 145 162 145 156 <==
|
||||
. \r \n I t ' s d i f f e r e n <==
|
||||
0000060 164 040 164 150 141 156 040 141 040 125 156 151 170 040 164 145
|
||||
t t h a n a U n i x t e
|
||||
0000100 170 164 040 146 151 154 145 015 012 167 157 165 154 144 040 142 <==
|
||||
x t f i l e \r \n w o u l d b <==
|
||||
```
|
||||
|
||||
While these characters don’t represent a huge problem, they can sometimes interfere when you want to parse the text files in some way and don’t want to have to code around their presence or absence.
|
||||
|
||||
### 3 ways to remove carriage return characters from text files
|
||||
|
||||
Fortunately, there are several ways to easily remove carriage return characters. Here are three options:
|
||||
|
||||
#### dos2unix
|
||||
|
||||
You might need to go through the trouble of installing it, but **dos2unix** is probably the easiest way to turn Windows text files into Unix/Linux text files. One command with one argument, and you’re done. No second file name is required. The file will be changed in place.
|
||||
|
||||
```
|
||||
$ dos2unix testfile.txt
|
||||
dos2unix: converting file testfile.txt to Unix format...
|
||||
```
|
||||
|
||||
You should see the file length decrease, depending on how many lines it contains. A file with 100 lines would likely shrink by 99 characters, since only the last line will not end with the **CRLF** characters.
|
||||
|
||||
Before:
|
||||
|
||||
```
|
||||
-rw-rw-r-- 1 shs shs 121 Sep 14 19:11 testfile.txt
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```
|
||||
-rw-rw-r-- 1 shs shs 118 Sep 14 19:12 testfile.txt
|
||||
```
|
||||
|
||||
If you need to convert a large collection of files, don't fix them one at a time. Instead, put them all in a directory by themselves and run a command like this:
|
||||
|
||||
```
|
||||
$ find . -type f -exec dos2unix {} \;
|
||||
```
|
||||
|
||||
In this command, we use find to locate regular files and then run the **dos2unix** command to convert them one at a time. The {} in the command is replaced by the filename. You should be sitting in the directory with the files when you run it. This command could damage other types of files, such as those that contain octal 15 characters in some context other than a text file (e.g., bytes in an image file).
|
||||
|
||||
#### sed
|
||||
|
||||
You can also use **sed**, the stream editor, to remove carriage returns. You will, however, have to supply a second file name. Here’s an example:
|
||||
|
||||
```
|
||||
$ sed -e “s/^M//” before.txt > after.txt
|
||||
```
|
||||
|
||||
One important thing to note is that you DON’T type what that command appears to be. You must enter **^M** by typing **Ctrl+V** followed by **Ctrl+M**. The “s” is the substitute command. The slashes separate the text we’re looking for (the Ctrl+M) and the text (nothing in this case) that we’re replacing it with.
|
||||
|
||||
#### vi
|
||||
|
||||
You can even remove carriage return (**Ctrl+M**) characters with **vi**, although this assumes you’re not running through hundreds of files and are maybe making some other changes, as well. You would type “**:**” to go to the command line and then type the string shown below. As with **sed**, the **^M** portion of this command requires typing **Ctrl+V** to get the **^** and then **Ctrl+M** to insert the **M**. The **%s** is a substitute operation, the slashes again separate the characters we want to remove and the text (nothing) we want to replace it with. The “**g**” (global) means to do this on every line in the file.
|
||||
|
||||
```
|
||||
:%s/^M//g
|
||||
```
|
||||
|
||||
#### Wrap-up
|
||||
|
||||
The **dos2unix** command is probably the easiest to remember and most reliable way to remove carriage returns from text files. Other options are a little trickier to use, but they provide the same basic function.
|
||||
|
||||
Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3438857/how-to-remove-carriage-returns-from-text-files-on-linux.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][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://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.flickr.com/photos/kmsiever/5895380540/in/photolist-9YXnf5-cNmpxq-2KEvib-rfecPZ-9snnkJ-2KAcDR-dTxzKW-6WdgaG-6H5i46-2KzTZX-7cnSw7-e3bUdi-a9meh9-Zm3pD-xiFhs-9Hz6YM-ar4DEx-4PXAhw-9wR4jC-cihLcs-asRFJc-9ueXvG-aoWwHq-atwL3T-ai89xS-dgnntH-5en8Te-dMUDd9-aSQVn-dyZqij-cg4SeS-abygkg-f2umXt-Xk129E-4YAeNn-abB6Hb-9313Wk-f9Tot-92Yfva-2KA7Sv-awSCtG-2KDPzb-eoPN6w-FE9oi-5VhaNf-eoQgx7-eoQogA-9ZWoYU-7dTGdG-5B1aSS
|
||||
[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
||||
@@ -0,0 +1,235 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (laingke)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Create an online store with this Java-based framework)
|
||||
[#]: via: (https://opensource.com/article/19/1/scipio-erp)
|
||||
[#]: author: (Paul Piper https://opensource.com/users/madppiper)
|
||||
|
||||
使用这个 Java 框架创建一个在线商店
|
||||
======
|
||||
Scipio ERP 具有广泛的应用程序和功能。
|
||||

|
||||
|
||||
所以,你想在网上销售产品或服务,但要么找不到合适的软件,要么认为定制成本太高? [Scipio ERP][1] 也许正是你想要的。
|
||||
|
||||
Scipio ERP 是一个基于 Java 的开放源码电子商务框架,具有广泛的应用程序和功能。这个项目在 2014 年从 [Apache OFBiz][2] fork 而来,侧重于更好的定制和更现代的吸引力。这个电子商务组件应用非常广泛,可以在多商店安装中工作,同时完成国际化,并具有广泛的产品配置,而且它还兼容现代 HTML 框架。该软件还为许多其他业务案例提供标准应用程序,例如会计,仓库管理或销售人员自动化。它都是高度标准化的,因此易于定制,如果您想要的不仅仅是一个虚拟购物车,这是非常棒的。
|
||||
|
||||
该系统也使得跟上现代 web 标准变得非常容易。所有界面都是使用系统的“[模板工具包][3]”构建的,这是一个易于学习的宏集,可以将 HTML 与所有应用程序分开。正因为如此,每个应用程序都已经标准化到核心。听起来令人困惑?它真的不是——它看起来很像 HTML,但你写的内容少了很多。
|
||||
|
||||
### 初始安装
|
||||
|
||||
在您开始之前,请确保您已经安装了 Java 1.8(或更高版本)的 SDK 以及一个 Git 客户端。完成了?太棒了!接下来,切换到 Github 上的主分支:
|
||||
|
||||
```
|
||||
git clone https://github.com/ilscipio/scipio-erp.git
|
||||
cd scipio-erp
|
||||
git checkout master
|
||||
```
|
||||
|
||||
要安装系统,只需要运行 **./install.sh** 并从命令行中选择任一选项。在开发过程中,最好一直使用 **installation for development** (选项 1),它还将安装一系列演示数据。对于专业安装,您可以修改初始配置数据(“种子数据”),以便自动为您设置公司和目录数据。默认情况下,系统将使用内部数据库运行,但是它[也可以配置][4]使用各种关系数据库,比如 PostgreSQL 和 MariaDB 等。
|
||||
|
||||
![安装向导][6]
|
||||
|
||||
按照安装向导完成初始配置,
|
||||
|
||||
通过命令 **./start.sh** 启动系统然后打开链接 **<https://localhost:8443/setup/>** 完成配置。如果您安装了演示数据, 您可以使用用户名 **admin** 和密码 **scipio** 进行登录。在安装向导中,您可以设置公司简介、会计、仓库、产品目录、在线商店和额外的用户配置信息。暂时在产品商店配置界面上跳过网站实体的配置。系统允许您使用不同的底层代码运行多个在线商店;除非您想这样做,一直选择默认值是最简单的。
|
||||
|
||||
祝贺您,您刚刚安装了 Scipio ERP!在界面上操作一两分钟,感受一下它的功能。
|
||||
|
||||
### 捷径
|
||||
|
||||
在您进入自定义之前,这里有一些方便的命令可以帮助您:
|
||||
|
||||
* 创建一个 shop-override:**./ant create-component-shop-override**
|
||||
* 创建一个新组件:**./ant create-component**
|
||||
* 创建一个新主题组件:**./ant create-theme**
|
||||
* 创建管理员用户:**./ant create-admin-user-login**
|
||||
* 各种其他实用功能:**./ant -p**
|
||||
* 用于安装和更新插件的实用程序:**./git-addons help**
|
||||
|
||||
|
||||
|
||||
另外,请记下以下位置:
|
||||
|
||||
* 将 Scipio 作为服务运行的脚本:**/tools/scripts/**
|
||||
* 日志输出目录:**/runtime/logs**
|
||||
* 管理应用程序:**<https://localhost:8443/admin/>**
|
||||
* 电子商务应用程序:**<https://localhost:8443/shop/>**
|
||||
|
||||
|
||||
|
||||
最后,Scipio ERP 在以下五个主要目录中构建了所有代码:
|
||||
|
||||
* Framework: 框架相关的源,应用程序服务器,通用界面和配置
|
||||
* Applications: 核心应用程序
|
||||
* Addons: 第三方扩展
|
||||
* Themes: 修改界面外观
|
||||
* Hot-deploy: 您自己的组件
|
||||
|
||||
|
||||
|
||||
除了一些配置,您将在 hot-deploy 和 themes 目录中工作。
|
||||
|
||||
### 在线商店定制
|
||||
|
||||
要真正使系统成为您自己的系统,请开始考虑使用[组件][7]。组件是一种模块化方法,可以覆盖,扩展和添加到系统中。您可以将组件视为可以捕获有关数据库([实体][8]),功能([服务][9]),界面([视图][10]),[事件和操作][11]和 Web 应用程序信息的独立 Web 模块。由于组件功能,您可以添加自己的代码,同时保持与原始源兼容。
|
||||
|
||||
运行命令 **./ant create-component-shop-override** 并按照步骤创建您的在线商店组件。该操作将会在 hot-deploy 目录内创建一个新目录,该目录将扩展并覆盖原始的电子商务应用程序。
|
||||
|
||||
![组件目录结构][13]
|
||||
|
||||
一个典型的组件目录结构。
|
||||
|
||||
您的组件将具有以下目录结构:
|
||||
|
||||
* config: 配置
|
||||
* data: 种子数据
|
||||
* entitydef: 数据库表定义
|
||||
* script: Groovy 脚本的位置
|
||||
* servicedef: 服务定义
|
||||
* src: Java 类
|
||||
* webapp: 您的 web 应用程序
|
||||
* widget: 界面定义
|
||||
|
||||
|
||||
|
||||
此外,**ivy.xml** 文件允许您将 Maven 库添加到构建过程中,**ofbiz-component.xml** 文件定义整个组件和 Web 应用程序结构。除了一些在当前目录所能够看到的,您还可以在 Web 应用程序的 **WEB-INF** 目录中找到 **controller.xml** 文件。这允许您定义请求实体并将它们连接到事件和界面。仅对于界面来说,您还可以使用内置的 CMS 功能,但优先要坚持使用核心机制。在引入更改之前,请熟悉**/applications/shop/**。
|
||||
|
||||
#### 添加自定义界面
|
||||
|
||||
还记得[模板工具包][3]吗?您会发现它在每个界面都有使用到。您可以将其视为一组易于学习的宏,它用来构建所有内容。下面是一个例子:
|
||||
|
||||
```
|
||||
<@section title="Title">
|
||||
<@heading id="slider">Slider</@heading>
|
||||
<@row>
|
||||
<@cell columns=6>
|
||||
<@slider id="" class="" controls=true indicator=true>
|
||||
<@slide link="#" image="https://placehold.it/800x300">Just some content…</@slide>
|
||||
<@slide title="This is a title" link="#" image="https://placehold.it/800x300"></@slide>
|
||||
</@slider>
|
||||
</@cell>
|
||||
<@cell columns=6>Second column</@cell>
|
||||
</@row>
|
||||
</@section>
|
||||
```
|
||||
|
||||
不是很难,对吧?同时,主题包含 HTML 定义和样式。这将权力交给您的前端开发人员,他们可以定义每个宏的输出,并坚持使用自己的构建工具进行开发。
|
||||
|
||||
我们快点试试吧。首先,在您自己的在线商店上定义一个请求。您将修改此代码。一个内置的 CMS 系统也可以通过 **<https://localhost:8443/cms/>** 进行访问,它允许您以更有效的方式创建新模板和界面。它与模板工具包完全兼容,并附带可根据您的喜好采用的示例模板。但是既然我们试图在这里理解系统,那么首先让我们采用更复杂的方法。
|
||||
|
||||
打开您商店 webapp 目录中的 **[controller.xml][14]** 文件。Controller 跟踪请求事件并相应地执行操作。下面的操作将会在 **/shop/test** 下创建一个新的请求:
|
||||
|
||||
```
|
||||
<!-- Request Mappings -->
|
||||
<request-map uri="test">
|
||||
<security https="true" auth="false"/>
|
||||
<response name="success" type="view" value="test"/>
|
||||
</request-map>
|
||||
```
|
||||
|
||||
您可以定义多个响应,如果需要,可以在请求中使用事件或服务调用来确定您可能要使用的响应。我选择了“视图”类型的响应。视图是渲染的响应; 其他类型是请求重定向,转发等。系统附带各种渲染器,可让您稍后确定输出; 为此,请添加以下内容:
|
||||
|
||||
```
|
||||
<!-- View Mappings -->
|
||||
<view-map name="test" type="screen" page="component://mycomponent/widget/CommonScreens.xml#test"/>
|
||||
```
|
||||
|
||||
用您自己的组件名称替换 **my-component**。然后,您可以通过在 **widget/CommonScreens.xml** 文件的标签内添加以下内容来定义您的第一个界面:
|
||||
|
||||
```
|
||||
<screen name="test">
|
||||
<section>
|
||||
<actions>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="CommonShopAppDecorator" location="component://shop/widget/CommonScreens.xml">
|
||||
<decorator-section name="body">
|
||||
<platform-specific><html><html-template location="component://mycomponent/webapp/mycomponent/test/test.ftl"/></html></platform-specific>
|
||||
</decorator-section>
|
||||
</decorator-screen>
|
||||
</widgets>
|
||||
</section>
|
||||
</screen>
|
||||
```
|
||||
|
||||
商店界面实际上非常模块化,由多个元素组成([小部件,动作和装饰器][15])。为简单起见,请暂时保留原样,并通过添加第一个模板工具包文件来完成新网页。为此,创建一个新的 **webapp/mycomponent/test/test.ftl** 文件并添加以下内容:
|
||||
|
||||
```
|
||||
<@alert type="info">Success!</@alert>
|
||||
```
|
||||
|
||||
![自定义的界面][17]
|
||||
|
||||
一个自定义的界面。
|
||||
|
||||
打开 **<https://localhost:8443/shop/control/test/>** 并惊叹于你自己的成就。
|
||||
|
||||
#### 自定义主题
|
||||
|
||||
通过创建自己的主题来修改商店的界面外观。所有主题都可以作为组件在themes文件夹中找到。运行命令 **./ant create-theme** 来创建您自己的主题。
|
||||
|
||||
![主题组件布局][19]
|
||||
|
||||
一个典型的主题组件布局。
|
||||
|
||||
以下是最重要的目录和文件列表:
|
||||
|
||||
* 主题配置:**data/\*ThemeData.xml**
|
||||
* 特定主题封装的HTML:**includes/\*.ftl**
|
||||
* 模板工具包HTML定义:**includes/themeTemplate.ftl**
|
||||
* CSS 类定义:**includes/themeStyles.ftl**
|
||||
* CSS 框架: **webapp/theme-title/**
|
||||
|
||||
|
||||
|
||||
快速浏览工具包中的 Metro 主题;它使用 Foundation CSS 框架并且充分利用了这个框架。然后,然后,在新构建的 **webapp/theme-title** 目录中设置自己的主题并开始开发。Foundation-shop 主题是一个非常简单的特定于商店的主题实现,您可以将其用作您自己工作的基础。
|
||||
|
||||
瞧!您已经建立了自己的在线商店,准备个性化定制吧!
|
||||
|
||||
![搭建完成的 Scipio ERP 在线商店][21]
|
||||
|
||||
一个搭建完成的基于 Scipio ERP的在线商店。
|
||||
|
||||
### 接下来是什么?
|
||||
|
||||
Scipio ERP 是一个功能强大的框架,可简化复杂的电子商务应用程序的开发。为了更完整的理解,请查看项目[文档][7],尝试[在线演示][22],或者[加入社区][23].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/1/scipio-erp
|
||||
|
||||
作者:[Paul Piper][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[laingke](https://github.com/laingke)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/madppiper
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.scipioerp.com
|
||||
[2]: https://ofbiz.apache.org/
|
||||
[3]: https://www.scipioerp.com/community/developer/freemarker-macros/
|
||||
[4]: https://www.scipioerp.com/community/developer/installation-configuration/configuration/#database-configuration
|
||||
[5]: /file/419711
|
||||
[6]: https://opensource.com/sites/default/files/uploads/setup_step5_sm.jpg (Setup wizard)
|
||||
[7]: https://www.scipioerp.com/community/developer/architecture/components/
|
||||
[8]: https://www.scipioerp.com/community/developer/entities/
|
||||
[9]: https://www.scipioerp.com/community/developer/services/
|
||||
[10]: https://www.scipioerp.com/community/developer/views-requests/
|
||||
[11]: https://www.scipioerp.com/community/developer/events-actions/
|
||||
[12]: /file/419716
|
||||
[13]: https://opensource.com/sites/default/files/uploads/component_structure.jpg (component directory structure)
|
||||
[14]: https://www.scipioerp.com/community/developer/views-requests/request-controller/
|
||||
[15]: https://www.scipioerp.com/community/developer/views-requests/screen-widgets-decorators/
|
||||
[16]: /file/419721
|
||||
[17]: https://opensource.com/sites/default/files/uploads/success_screen_sm.jpg (Custom screen)
|
||||
[18]: /file/419726
|
||||
[19]: https://opensource.com/sites/default/files/uploads/theme_structure.jpg (theme component layout)
|
||||
[20]: /file/419731
|
||||
[21]: https://opensource.com/sites/default/files/uploads/finished_shop_1_sm.jpg (Finished Scipio ERP shop)
|
||||
[22]: https://www.scipioerp.com/demo/
|
||||
[23]: https://forum.scipioerp.com/
|
||||
@@ -1,108 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (heguangzhi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (The Linux kernel: Top 5 innovations)
|
||||
[#]: via: (https://opensource.com/article/19/8/linux-kernel-top-5-innovations)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/sethhttps://opensource.com/users/mhaydenhttps://opensource.com/users/mralexjuarez)
|
||||
|
||||
The Linux kernel: Top 5 innovations
|
||||
======
|
||||
Linux 内核:五大创新
|
||||
======
|
||||
|
||||
想知道什么是真正的(不是那种时髦的)在 Linux 内核上的创新吗?请继续阅读。
|
||||
![绿色背景的企鹅][1]
|
||||
|
||||
_创新_ 这个词在科技行业的传播几乎和 _革命_ 一样多,所以很难区分那些夸张和真正令人振奋的东西。Linux 内核被称为创新的,但它又被称为现代计算中最大的黑客,一个微观世界中的庞然大物。
|
||||
|
||||
撇开市场和模式不谈,Linux 可以说是开源世界中最受欢迎的内核,它在近30年的生命周期中引入了一些真正的游戏改变者。
|
||||
|
||||
### Cgroups (2.6.24)
|
||||
|
||||
早在2007年,Paul Menage 和 Rohit Seth 就在内核中添加了深奥的[_control groups_ (cgroups)][2]功能(cgroups 的当前实现是由 Tejun Heo 重写的。)这种新技术最初被用作一种方法,从本质上来说,是为了确保一组特定任务的服务质量。
|
||||
|
||||
例如,您为与您的 WEB 服务相关联的所有任务创建一个控制组定义 ( cgroup ),为常规备份创建另一个 cgroup ,为一般操作系统需求创建另一个cgroup。然后,您可以控制每个组的资源百分比,这样您的操作系统和 WEB 服务就可以获得大部分系统资源,而您的备份进程可以访问剩余的资源。
|
||||
|
||||
然而,cgroups 最著名的是它作为今天驱动云技术的角色:容器。事实上,cgroups 最初被命名为[进程容器][3]。当它们被 [LXC][4],[CoreOS][5]和 Docker 等项目采用时,这并不奇怪。
|
||||
|
||||
就像闸门打开后一样,“ _容器_ ”一词恰好成为了 Linux 的同义词,微服务风格的基于云的“应用”概念很快成为了规范。如今,很难脱离 cgroups ,他们是如此普遍。每一个大规模的基础设施(可能还有你的笔记本电脑,如果你运行 Linux 的话)都以一种有意思的方式使用了 cgroups ,使你的计算体验比以往任何时候都更加易于管理和灵活。
|
||||
|
||||
例如,您可能已经在电脑上安装了[Flathub][6]或[Flatpak][7],或者您已经在工作中使用[Kubernetes][8]和/或[OpenShift][9]。不管怎样,如果“容器”这个术语对你来说仍然模糊不清,你可以在[ Linux 容器背后的应用场景][10] 获得对容器的实际理解。
|
||||
|
||||
### LKMM (4.17)
|
||||
|
||||
2018年,Jade Alglave, Alan Stern, Andrea Parri, Luc Maranget, Paul McKenney, 和其他几个人的辛勤工作的成果被合并到主线 Linux 内核中,以提供正式的内存模型。Linux 内核内存[一致性]模型(LKMM)子系统是一套描述Linux 内存一致性模型的工具,同时也产生测试用例。
|
||||
|
||||
|
||||
随着系统在物理设计上变得越来越复杂(增加了更多的中央处理器内核,高速缓存和内存增加,等等),它们就越难知道哪个中央处理器需要哪个地址空间,以及何时需要。例如,如果 CPU0 需要将数据写入内存中的共享变量,并且 CPU1 需要读取该值,那么 CPU0 必须在 CPU1 尝试读取之前写入。类似地,如果值是以一种顺序写入内存的,那么期望它们也以同样的顺序被读取,而不管哪个或哪些 CPU 正在读取。
|
||||
|
||||
即使在单个处理器上,内存管理也需要特定的顺序。像 **x = y** 这样的简单操作需要处理器从内存中加载 **y** 的值,然后将该值存储在 **x** 中。在处理器从内存中读取值之前,是不能将存储在 **y** 中的值放入 **x** 变量的。还有地址依赖:**x[n] = 6** 要求在处理器能够存储值6之前加载 **n** 。
|
||||
|
||||
LKMM 帮助识别和跟踪代码中的这些内存模式。这部分是通过一个名为 **herd** 的工具来实现的,该工具定义了内存模型施加的约束(以逻辑公式的形式),然后列举了与这些约束一致性的所有可能的结果。
|
||||
|
||||
### 低延迟补丁 (2.6.38)
|
||||
|
||||
|
||||
很久以前,在2011年之前的日子里,如果你想在 Linux进行 多媒体工作 [multimedia work on Linux][11] ,您必须获得一个低延迟内核。这主要适用于[录音/audio recording][12],同时添加了许多实时效果(如对着麦克风唱歌和添加混音,以及在耳机中无延迟地听到您的声音)。有些发行版,如[Ubuntu Studio][13],可靠地提供了这样一个内核,所以实际上这没有什么障碍,当艺术家选择发行版本时,只是作为一个重要提醒。
|
||||
|
||||
然而,如果您没有使用 Ubuntu Studio ,或者您需要在分发之前更新您的内核,您必须跳转到 rt-patches 网页,下载内核补丁,将它们应用到您的内核源代码,编译,然后手动安装。
|
||||
|
||||
然后,随着内核版本2.6.38的发布,这个过程结束了。默认情况下,Linux 内核突然像变魔术一样内置了低延迟代码(根据基准测试,延迟至少降低了10倍)。不再下载补丁,不用编译。一切都很顺利,这都是因为 Mike Galbraith 编写了一个200行的小补丁。
|
||||
|
||||
对于全世界的开源多媒体艺术家来说,这是一个游戏规则的改变。从2011年开始到2016年事情变得如此美好,我向自己做了一个挑战,要求[在树莓派v1(型号B)上建造一个数字音频工作站(DAW)][14],结果发现它运行得出奇地好。
|
||||
|
||||
### RCU (2.5)
|
||||
|
||||
RCU,或称读-拷贝-更新,是计算机科学中定义的一个系统,它允许多个处理器线程从共享内存中读取数据。它通过推迟更新来做到这一点,但也将它们标记为已更新,以确保数据读取为最新内容。实际上,这意味着读取与更新同时发生。
|
||||
|
||||
|
||||
典型的 RCU 循环有点像这样:
|
||||
|
||||
1. 删除指向数据的指针,以防止其他读操作引用它。
|
||||
2. 等待读完成他们的关键处理。
|
||||
3. 回收内存空间。
|
||||
|
||||
将更新阶段划分为删除和回收阶段意味着更新程序会立即执行删除,同时推迟回收直到所有活动读取完成(通过阻止它们或注册一个回调以便在完成时调用)。
|
||||
|
||||
虽然读-拷贝-更新的概念不是为 Linux 内核发明的,但它在 Linux 中的实现是该技术的一个定义性的例子。
|
||||
|
||||
### 合作 (0.01)
|
||||
|
||||
对于 Linux 内核创新的问题,最重要的是协作,最终答案也是。称之为好时机,称之为技术优势,称之为黑客能力,或者仅仅称之为开源,但 Linux 内核及其支持的许多项目是协作与合作的光辉范例。
|
||||
|
||||
它远远超出了内核范畴。各行各业的人都对开源做出了贡献,可以说是因为 Linux 内核。Linux 曾经是,现在仍然是 [自由软件][15]的主要力量,激励人们把他们的代码、艺术、想法或者仅仅是他们自己带到一个全球化的、有生产力的、多样化的人类社区中。
|
||||
|
||||
### 你最喜欢的创新是什么?
|
||||
|
||||
这个列表偏向于我自己的兴趣:容器、非统一内存访问(NUMA)和多媒体。我肯定把你最喜欢的内核创新从列表中去掉了。在评论中告诉我!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/8/linux-kernel-top-5-innovations
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[heguangzhi](https://github.com/heguangzhi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sethhttps://opensource.com/users/mhaydenhttps://opensource.com/users/mralexjuarez
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22 (Penguin with green background)
|
||||
[2]: https://en.wikipedia.org/wiki/Cgroups
|
||||
[3]: https://lkml.org/lkml/2006/10/20/251
|
||||
[4]: https://linuxcontainers.org
|
||||
[5]: https://coreos.com/
|
||||
[6]: http://flathub.org
|
||||
[7]: http://flatpak.org
|
||||
[8]: http://kubernetes.io
|
||||
[9]: https://www.redhat.com/sysadmin/learn-openshift-minishift
|
||||
[10]: https://opensource.com/article/18/11/behind-scenes-linux-containers
|
||||
[11]: http://slackermedia.info
|
||||
[12]: https://opensource.com/article/17/6/qtractor-audio
|
||||
[13]: http://ubuntustudio.org
|
||||
[14]: https://opensource.com/life/16/3/make-music-raspberry-pi-milkytracker
|
||||
[15]: http://fsf.org
|
||||
@@ -0,0 +1,70 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to put an HTML page on the internet)
|
||||
[#]: via: (https://jvns.ca/blog/2019/09/06/how-to-put-an-html-page-on-the-internet/)
|
||||
[#]: author: (Julia Evans https://jvns.ca/)
|
||||
|
||||
如何在互联网放置 HTML 页面
|
||||
======
|
||||
|
||||
我喜欢互联网的一点是在互联网放置静态页面是如此简单。今天有人问我该怎么做,所以我想我会快速地写下来!
|
||||
|
||||
### 只是一个 HTML 页面
|
||||
|
||||
我的所有网站都只是静态 HTML 和 CSS。我的网页设计技巧相对不高(<https://wizardzines.com>是我自己开发的最复杂的网站),因此保持我所有的网站相对简单意味着我可以做一些改变/修复,而不会花费大量时间。
|
||||
|
||||
因此,我们将在此文章中采用尽可能简单的方式 - 只需一个 HTML 页面。
|
||||
|
||||
### HTML 页面
|
||||
|
||||
我们要放在互联网上的网站只是一个名为 `index.html` 的文件。你可以在 <https://github.com/jvns/website-example> 找到它,它是一个 Github 仓库,其中只包含一个文件。
|
||||
|
||||
HTML 文件中包含一些 CSS,使其看起来不那么无聊,部分复制自< https://example.com>。
|
||||
|
||||
### 如何将 HTML 页面放在互联网上
|
||||
|
||||
有以下几步:
|
||||
|
||||
1. 注册 [Neocities][1] 帐户
|
||||
2. 将 index.html 复制到你自己 neocities 站点的 index.html 中
|
||||
3. 完成
|
||||
|
||||
|
||||
|
||||
上面的 index.html 页面位于 [julia-example-website.neocities.com][2] 中,如果你查看源代码,你将看到它与 github 仓库中的 HTML 相同。
|
||||
|
||||
我认为这可能是将 HTML 页面放在互联网上的最简单的方法(这是一次回归 Geocities,它是我在 2003 年制作我的第一个网站的方式):)。我也喜欢 Neocities (像 [glitch][3],我也喜欢)它能实验、学习,并有乐趣。
|
||||
|
||||
### 其他选择
|
||||
|
||||
这绝不是唯一简单的方式 - 在你推送 Git 仓库时,Github pages 和 Gitlab pages 以及 Netlify 都将会自动发布站点,并且它们都非常易于使用(只需将它们连接到你的 github 仓库即可)。我个人使用 Git 仓库的方式,因为 Git 没有东西让我感到紧张 - 我想知道我实际推送的页面发生了什么更改。但我想你如果第一次只想将 HTML/CSS 制作的站点放到互联网上,那么 Neocities 就是一个非常好的方法。
|
||||
|
||||
|
||||
如果你不只是玩,而是要将网站用于真实用途,那么你或许会需要买一个域名,以便你将来可以更改托管服务提供商,但这有点不那么简单。
|
||||
|
||||
### 这是学习 HTML 的一个很好的起点
|
||||
|
||||
如果你熟悉在 Git 中编辑文件,同时想练习 HTML/CSS 的话,我认为将它放在网站中是一个有趣的方式!我真的很喜欢它的简单性 - 实际上这只有一个文件,所以没有其他花哨的东西需要去理解。
|
||||
|
||||
还有很多方法可以复杂化/扩展它,比如这个博客实际上是用 [Hugo][4] 生成的,它生成了一堆 HTML 文件并放在网络中,但从基础开始总是不错的。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://jvns.ca/blog/2019/09/06/how-to-put-an-html-page-on-the-internet/
|
||||
|
||||
作者:[Julia Evans][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://jvns.ca/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://neocities.org/
|
||||
[2]: https://julia-example-website.neocities.org/
|
||||
[3]: https://glitch.com
|
||||
[4]: https://gohugo.io/
|
||||
@@ -7,31 +7,29 @@
|
||||
[#]: via: (https://fedoramagazine.org/how-to-set-up-a-tftp-server-on-fedora/)
|
||||
[#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/)
|
||||
|
||||
How to set up a TFTP server on Fedora
|
||||
如何在 Fedora 上建立一个 TFTP 服务器
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
**TFTP**, or Trivial File Transfer Protocol, allows users to transfer files between systems using the [UDP protocol][2]. By default, it uses UDP port 69. The TFTP protocol is extensively used to support remote booting of diskless devices. So, setting up a TFTP server on your own local network can be an interesting way to do [Fedora installations][3], or other diskless operations.
|
||||
**TFTP** 即简单文本传输协议,允许用户通过 [UDP][2] 协议在系统之间传输文件。默认情况下,协议使用的是 UDP 的 69 号端口。TFTP 协议广泛用于无盘设备的远程启动。因此,在你的本地网络建立一个 TFTP 服务器,这样你就可以进行 [Fedora 的安装][3]和其他无盘设备的一些操作,这将非常有趣。
|
||||
|
||||
TFTP can only read and write files to or from a remote system. It doesn’t have the capability to list files or make any changes on the remote server. There are also no provisions for user authentication. Because of security implications and the lack of advanced features, TFTP is generally only used on a local area network (LAN).
|
||||
TFTP 仅仅能够从远端系统读取数据或者向远端系统写入数据。但它并没有列出远端服务器上文件的能力,同时也没有修改远端服务器的能力(译者注:感觉和前一句话矛盾)。用户身份验证也没有规定。 由于安全隐患和缺乏高级功能,TFTP 通常仅用于局域网(LAN)。
|
||||
|
||||
### TFTP server installation
|
||||
### 安装 TFTP 服务器
|
||||
|
||||
The first thing you will need to do is install the TFTP client and server packages:
|
||||
首先你要做的事就是安装 TFTP 客户端和 TFTP 服务器:
|
||||
|
||||
```
|
||||
dnf install tftp-server tftp -y
|
||||
```
|
||||
|
||||
This creates a _tftp_ service and socket file for [systemd][4] under _/usr/lib/systemd/system_.
|
||||
|
||||
上述的这条命令会为 [systemd][4] 在 _/usr/lib/systemd/system_ 目录下创建 _tftp.service_ 和 _tftp.socket_ 文件。
|
||||
```
|
||||
/usr/lib/systemd/system/tftp.service
|
||||
/usr/lib/systemd/system/tftp.socket
|
||||
```
|
||||
|
||||
Next, copy and rename these files to _/etc/systemd/system_:
|
||||
接下来,将这两个文件复制到 _/etc/systemd/system_ 目录下,并重新命名。
|
||||
|
||||
```
|
||||
cp /usr/lib/systemd/system/tftp.service /etc/systemd/system/tftp-server.service
|
||||
@@ -39,9 +37,9 @@ cp /usr/lib/systemd/system/tftp.service /etc/systemd/system/tftp-server.service
|
||||
cp /usr/lib/systemd/system/tftp.socket /etc/systemd/system/tftp-server.socket
|
||||
```
|
||||
|
||||
### Making local changes
|
||||
### 修改文件
|
||||
|
||||
You need to edit these files from the new location after you’ve copied and renamed them, to add some additional parameters. Here is what the _tftp-server.service_ file initially looks like:
|
||||
当你把这些文件复制和重命名后,你就可以去添加一些额外的参数,下面是 _tftp-server.service_ 刚开始的样子:
|
||||
|
||||
```
|
||||
[Unit]
|
||||
@@ -57,40 +55,36 @@ StandardInput=socket
|
||||
Also=tftp.socket
|
||||
```
|
||||
|
||||
Make the following changes to the _[Unit]_ section:
|
||||
在 _[Unit]_ 部分添加如下内容:
|
||||
|
||||
```
|
||||
Requires=tftp-server.socket
|
||||
```
|
||||
|
||||
Make the following changes to the _ExecStart_ line:
|
||||
修改 _[ExecStart]_ 行:
|
||||
|
||||
```
|
||||
ExecStart=/usr/sbin/in.tftpd -c -p -s /var/lib/tftpboot
|
||||
```
|
||||
|
||||
Here are what the options mean:
|
||||
下面是这些选项的意思:
|
||||
|
||||
* The _**-c**_ option allows new files to be created.
|
||||
* The _**-p**_ option is used to have no additional permissions checks performed above the normal system-provided access controls.
|
||||
* The _**-s**_ option is recommended for security as well as compatibility with some boot ROMs which cannot be easily made to include a directory name in its request.
|
||||
* _**-c**_ 选项允许创建新的文件
|
||||
* _**-p**_ 选项用于指明在正常系统提供的权限检查之上没有其他额外的权限检查
|
||||
* _**-s**_ 建议使用该选项以确保安全性以及与某些引导 ROM 的兼容性,这些引导 ROM 在其请求中不容易包含目录名。
|
||||
|
||||
默认的上传和下载位置位于 _/var/lib/tftpboot_。
|
||||
|
||||
|
||||
The default upload/download location for transferring the files is _/var/lib/tftpboot_.
|
||||
|
||||
Next, make the following changes to the _[Install]_ section:
|
||||
|
||||
下一步,修改 _[Install}_ 部分的内容
|
||||
```
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Also=tftp-server.socket
|
||||
```
|
||||
|
||||
Don’t forget to save your changes!
|
||||
|
||||
Here is the completed _/etc/systemd/system/tftp-server.service_ file:
|
||||
不要忘记保存你的修改。
|
||||
|
||||
下面是 _/etc/systemd/system/tftp-server.service_ 文件的完整内容:
|
||||
```
|
||||
[Unit]
|
||||
Description=Tftp Server
|
||||
@@ -106,42 +100,41 @@ WantedBy=multi-user.target
|
||||
Also=tftp-server.socket
|
||||
```
|
||||
|
||||
### Starting the TFTP server
|
||||
### 启动 TFTP 服务器
|
||||
|
||||
Reload the systemd daemon:
|
||||
重新启动 systemd 守护进程:
|
||||
|
||||
```
|
||||
systemctl daemon-reload
|
||||
```
|
||||
|
||||
Now start and enable the server:
|
||||
|
||||
启动服务器:
|
||||
```
|
||||
systemctl enable --now tftp-server
|
||||
```
|
||||
|
||||
To change the permissions of the TFTP server to allow upload and download functionality, use this command. Note TFTP is an inherently insecure protocol, so this may not be advised on a network you share with other people.
|
||||
|
||||
要更改 TFTP 服务器允许上传和下载的权限,请使用此命令。注意 TFTP 是一种固有的不安全协议,因此不建议你在于其他人共享的网络上这样做。
|
||||
```
|
||||
chmod 777 /var/lib/tftpboot
|
||||
```
|
||||
|
||||
Configure your firewall to allow TFTP traffic:
|
||||
配置防火墙让 TFTP 能够使用:
|
||||
|
||||
```
|
||||
firewall-cmd --add-service=tftp --perm
|
||||
firewall-cmd --reload
|
||||
```
|
||||
|
||||
### Client Configuration
|
||||
### 客户端配置
|
||||
|
||||
Install the TFTP client:
|
||||
|
||||
安装 TFTP 客户端
|
||||
|
||||
```
|
||||
yum install tftp -y
|
||||
```
|
||||
|
||||
Run the _tftp_ command to connect to the TFTP server. Here is an example that enables the verbose option:
|
||||
运行 _tftp_ 命令连接服务器。下面是一个启用详细信息选项的例子:
|
||||
|
||||
```
|
||||
[client@thinclient:~ ]$ tftp 192.168.1.164
|
||||
@@ -154,7 +147,7 @@ tftp> quit
|
||||
[client@thinclient:~ ]$
|
||||
```
|
||||
|
||||
Remember, TFTP does not have the ability to list file names. So you’ll need to know the file name before running the _get_ command to download any files.
|
||||
记住,因为 TFTP 没有列出服务器上文件的能力,因此,在你使用 _get_ 命令之前需要知道文件的具体名称。
|
||||
|
||||
* * *
|
||||
|
||||
@@ -166,7 +159,7 @@ via: https://fedoramagazine.org/how-to-set-up-a-tftp-server-on-fedora/
|
||||
|
||||
作者:[Curt Warfield][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[amwps290](https://github.com/amwps290)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
@@ -1,159 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Morisun029)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Check Linux Mint Version Number & Codename)
|
||||
[#]: via: (https://itsfoss.com/check-linux-mint-version/)
|
||||
[#]: author: (Sergiu https://itsfoss.com/author/sergiu/)
|
||||
|
||||
如何查看 Linux Mint 版本号和代号
|
||||
======
|
||||
|
||||
|
||||
Linux Mint 每两年发布一次主版本(如 Mint 19),每六个月左右发布一次次版本(如 Mint 19.1,19.2等)。 你可以自己升级 Linux Mint 版本,次版本也会自动更新。
|
||||
|
||||
|
||||
在所有这些版本中,你可能想知道你正在使用的是哪个版本。 了解 Linux Mint 版本号可以帮助你确定某个特定软件是否适用于你的系统,或者检查你的系统是否已达到使用寿命。
|
||||
|
||||
你可能需要 Linux Mint 版本号有多种原因,你也有多种方法可以获取此信息。
|
||||
让我向你展示用图形和命令行的方式获取 Mint 版本信息。
|
||||
|
||||
|
||||
* [使用命令行查看 Linux Mint 版本信息][1]
|
||||
* [使用GUI(图形用户界面)查看 Linux Mint 版本信息][2]
|
||||
|
||||
|
||||
|
||||
### 使用终端查看 Linux Mint 版本号的方法
|
||||
|
||||
![][3]
|
||||
|
||||
我将介绍几种使用非常简单的命令查看 Linux Mint 版本号和代号的方法。 你可以从 **菜单** 中打开**终端** ,或按**CTRL+ALT+T** (默认热键)打开。
|
||||
|
||||
|
||||
本文中的 **最后两个命令** 还会输出你当前的 Linux Mint 版本所基于的 **Ubuntu 版本**。
|
||||
|
||||
|
||||
#### 1\. /etc/issue
|
||||
|
||||
|
||||
从最简单的 CLI 方法开始,你可以打印出 **/etc/issue** 的内容来检查你的 **版本号** 和 **代号** :
|
||||
|
||||
|
||||
```
|
||||
[email protected]:~$ cat /etc/issue
|
||||
Linux Mint 19.2 Tina \n \l
|
||||
```
|
||||
|
||||
#### 2\. hostnamectl
|
||||
|
||||
![hostnamectl][4]
|
||||
|
||||
|
||||
这一个命令(**hostnamectl**)打印的信息几乎与 **系统信息** 中的信息相同。 你可以看到你的 **操作系统**(带有**版本号**)以及你的 **内核版本**。3.
|
||||
|
||||
#### 3\. lsb_release
|
||||
|
||||
**lsb_release** 是一个非常简单的Linux实用程序,用于查看有关你的发行版本的基本信息:
|
||||
|
||||
```
|
||||
[email protected]:~$ lsb_release -a
|
||||
No LSB modules are available.
|
||||
Distributor ID: LinuxMint
|
||||
Description: Linux Mint 19.2 Tina
|
||||
Release: 19.2
|
||||
Codename: tina
|
||||
```
|
||||
|
||||
**注:** *我使用 **–***_**a**_ _标签打印所有参数, 但你也可以使用 **-s** 作为简写格式, **-d** 用于描述等 (检查所有标签的 **man lsb_release** )._
|
||||
|
||||
|
||||
#### 4\. /etc/linuxmint/info
|
||||
|
||||
![/etc/linuxmint/info][5]
|
||||
|
||||
This isn’t a command, but rather a file on any Linux Mint install. Simply use cat command to print it’s contents to your terminal and see your **Release Number** and **Codename**.
|
||||
这不是命令,而是所有Linux Mint 安装上的文件。 只需使用 cat 命令将其内容打印到终端,然后查看你的**版本号** 和**代号** 。
|
||||
|
||||
[][6]
|
||||
|
||||
建议阅读避免在 ELemetary OS Freya 中出现两个 Chrome 图标[快速提示]
|
||||
|
||||
#### 5\. 使用 /etc/os-release 命令也可以获取到 Ubuntu 代号
|
||||
|
||||
![/etc/os-release][7]
|
||||
|
||||
|
||||
Linux Mint 基于 Ubuntu。 每个 Linux Mint 版本都基于不同的 Ubuntu 版本。了解 Linux Mint 版本所基于的 Ubuntu 版本有助你在必须要使用 Ubuntu 版本号的情况下使用-在你需要在 [Linux Mint 中安装最新的Virtual Box][8]. 添加仓库时。
|
||||
|
||||
os-release 则是另一个类似于**info**的文件,向你展示 Linux Mint 所基于的 Ubuntu 版本代号。
|
||||
|
||||
|
||||
#### 6\. 使用 /etc/upstream-release/lsb-release 只能获取到 Ubuntu 的基本信息
|
||||
|
||||
|
||||
如果你只想要查看有关 **Ubuntu** 的基本信息,请输出 **/etc/upstream-release/lsb-release**:
|
||||
|
||||
```
|
||||
[email protected]:~$ cat /etc/upstream-release/lsb-release
|
||||
DISTRIB_ID=Ubuntu
|
||||
DISTRIB_RELEASE=18.04
|
||||
DISTRIB_CODENAME=bionic
|
||||
DISTRIB_DESCRIPTION="Ubuntu 18.04 LTS"
|
||||
```
|
||||
|
||||
特别提示: [你可以使用 **uname** 命令查看 Linux 内核版本][9]:
|
||||
|
||||
```
|
||||
[email protected]:~$ uname -r
|
||||
4.15.0-54-generic
|
||||
```
|
||||
|
||||
**注:** _**-r** 代表 **release**, 你可以使用 **man uname** 查看其他信息。
|
||||
|
||||
### 使用 GUI 查看 Linux Mint 版本信息
|
||||
|
||||
如果你对终端和命令行不满意,可以使用图形方法。如你所料,这个非常明了。
|
||||
|
||||
打开 **Menu** (左下角), 然后转到 **Preferences > System Info**:
|
||||
|
||||
![Linux Mint 菜单][10]
|
||||
|
||||
或者,在菜单中,你可以搜索 **System Info**:
|
||||
|
||||
![Menu Search System Info][11]
|
||||
|
||||
在这里,你可以看到你的操作系统(包括版本号),内核和 DE 的版本号:
|
||||
|
||||
![System Info][12]
|
||||
|
||||
**总结**
|
||||
|
||||
我已经介绍了一些不同的方法,用这些方法你可以快速查看你正在使用的 Linux Mint 的版本和代号(以及所基于的Ubuntu 版本和内核)。 我希望这个初学者教程对你有所帮助。请在评论中告诉我们你最喜欢哪个方法!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/check-linux-mint-version/
|
||||
|
||||
作者:[Sergiu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[Morisun029](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sergiu/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: tmp.pL5Hg3N6Qt#terminal
|
||||
[2]: tmp.pL5Hg3N6Qt#GUI
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/09/check-linux-mint-version.png?ssl=1
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/09/hostnamectl.jpg?ssl=1
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/09/linuxmint_info.jpg?ssl=1
|
||||
[6]: https://itsfoss.com/rid-google-chrome-icons-dock-elementary-os-freya/
|
||||
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/os_release.jpg?ssl=1
|
||||
[8]: https://itsfoss.com/install-virtualbox-ubuntu/
|
||||
[9]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/
|
||||
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/09/linux_mint_menu.jpg?ssl=1
|
||||
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/menu_search_system_info.jpg?ssl=1
|
||||
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/system_info.png?ssl=1
|
||||
Reference in New Issue
Block a user