mirror of
https://github.com/LCTT/TranslateProject.git
synced 2026-08-23 04:03:29 +08:00
24
README.md
24
README.md
@@ -15,30 +15,26 @@
|
||||
|
||||
LCTT 已经拥有几百名活跃成员,并欢迎更多的 Linux 志愿者加入我们的团队。
|
||||
|
||||

|
||||

|
||||
|
||||
LCTT 的组成
|
||||
-------------------------------
|
||||
|
||||
**选题**,负责选择合适的内容,并将原文转换为 markdown 格式,提交到 LCTT 的 [TranslateProject](https://github.com/LCTT/TranslateProject) 库中。
|
||||
|
||||
**译者**,负责从选题中选择内容进行翻译。
|
||||
|
||||
**校对**,负责将初译的文章进行文字润色、技术校对等工作。
|
||||
|
||||
**发布**,负责将校对后的文章,排版进行发布。
|
||||
- LCTT 官网: [https://linux.cn/lctt/](https://linux.cn/lctt/)
|
||||
- LCTT 状态: [https://lctt.github.io/](https://lctt.github.io/)
|
||||
|
||||
加入我们
|
||||
-------------------------------
|
||||
|
||||
请首先加入翻译组的 QQ 群,群号是:**198889102**,加群时请说明是“*志愿者*”。加入后记得修改您的群名片为您的 GitHub 的 ID。
|
||||
请首先加入翻译组的 QQ 群,群号是:**198889102**,加群时请说明是“*志愿者*”。
|
||||
|
||||
加入的成员,请先阅读 [WIKI 如何开始](https://github.com/LCTT/TranslateProject/wiki/01-如何开始)。
|
||||
加入的成员,请:
|
||||
|
||||
1. 修改你的 QQ 群名片为“译者-您的_GitHub_ID”。
|
||||
2. 阅读 [WIKI](http://lctt.github.io/wiki) 了解如何开始。
|
||||
3. 遇到不解之处,请在群内发问。
|
||||
|
||||
如何开始
|
||||
-------------------------------
|
||||
|
||||
请阅读 [WIKI](https://github.com/LCTT/TranslateProject/wiki)。如需要协助,请在群内发问。
|
||||
请阅读 [WIKI](http://lctt.github.io/wiki)。如需要协助,请在群内发问。
|
||||
|
||||
历史
|
||||
-------------------------------
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
TLDR 页:Linux 手册页的简化替代品
|
||||
==============
|
||||
|
||||
[][22]
|
||||
|
||||
在终端上使用各种命令执行重要任务是 Linux 桌面体验中不可或缺的一部分。Linux 这个开源操作系统拥有[丰富的命令][23],任何用户都无法全部记住所有这些命令。而使事情变得更复杂的是,每个命令都有自己的一组带来丰富的功能的选项。
|
||||
|
||||
为了解决这个问题,人们创建了<ruby>[手册页][12]<rt>man page</rt></ruby>,(手册 —— man 是 manual 的缩写)。首先,它是用英文写成的,包含了大量关于不同命令的深入信息。有时候,当你在寻找命令的基本信息时,它就会显得有点庞杂。为了解决这个问题,人们创建了[TLDR 页][13]。
|
||||
|
||||
### 什么是 TLDR 页?
|
||||
|
||||
TLDR 页的 GitHub 仓库将其描述为简化的、社区驱动的手册页集合。在实际示例的帮助下,努力让使用手册页的体验变得更简单。如果还不知道,TLDR 取自互联网的常见俚语:<ruby>太长没读<rt>Too Long Didn’t Read</rt></ruby>。
|
||||
|
||||
如果你想比较一下,让我们以 `tar` 命令为例。 通常,手册页的篇幅会超过 1000 行。`tar` 是一个归档实用程序,经常与 `bzip` 或 `gzip` 等压缩方法结合使用。看一下它的手册页:
|
||||
|
||||
[][14]
|
||||
|
||||
而另一方面,TLDR 页面让你只是浏览一下命令,看看它是如何工作的。 `tar` 的 TLDR 页面看起来像这样,并带有一些方便的例子 —— 你可以使用此实用程序完成的最常见任务:
|
||||
|
||||
[][15]
|
||||
|
||||
让我们再举一个例子,向你展示 TLDR 页面为 `apt` 提供的内容:
|
||||
|
||||
[][16]
|
||||
|
||||
如上,它向你展示了 TLDR 如何工作并使你的生活更轻松,下面让我们告诉你如何在基于 Linux 的操作系统上安装它。
|
||||
|
||||
### 如何在 Linux 上安装和使用 TLDR 页?
|
||||
|
||||
最成熟的 TLDR 客户端是基于 Node.js 的,你可以使用 NPM 包管理器轻松安装它。如果你的系统上没有 Node 和 NPM,请运行以下命令:
|
||||
|
||||
```
|
||||
sudo apt-get install nodejs
|
||||
sudo apt-get install npm
|
||||
```
|
||||
|
||||
如果你使用的是 Debian、Ubuntu 或 Ubuntu 衍生发行版以外的操作系统,你可以根据自己的情况使用`yum`、`dnf` 或 `pacman`包管理器。
|
||||
|
||||
现在,通过在终端中运行以下命令,在 Linux 机器上安装 TLDR 客户端:
|
||||
|
||||
```
|
||||
sudo npm install -g tldr
|
||||
```
|
||||
|
||||
一旦安装了此终端实用程序,最好在尝试之前更新其缓存。 为此,请运行以下命令:
|
||||
|
||||
```
|
||||
tldr --update
|
||||
```
|
||||
|
||||
执行此操作后,就可以阅读任何 Linux 命令的 TLDR 页面了。 为此,只需键入:
|
||||
|
||||
```
|
||||
tldr <commandname>
|
||||
```
|
||||
|
||||
[][17]
|
||||
|
||||
你还可以运行其[帮助命令](https://github.com/tldr-pages/tldr-node-client),以查看可与 TLDR 一起使用的各种参数,以获取所需输出。 像往常一样,这个帮助页面也附有例子。
|
||||
|
||||
### TLDR 的 web、Android 和 iOS 版本
|
||||
|
||||
你会惊喜地发现 TLDR 页不仅限于你的 Linux 桌面。 相反,它也可以在你的 Web 浏览器中使用,可以从任何计算机访问。
|
||||
|
||||
要使用 TLDR Web 版本,请访问 [tldr.ostera.io][18] 并执行所需的搜索操作。
|
||||
|
||||
或者,你也可以下载 [iOS][19] 和 [Android][20] 应用程序,并随时随地学习新命令。
|
||||
|
||||
[][21]
|
||||
|
||||
你觉得这个很酷的 Linux 终端技巧很有意思吗? 请尝试一下,让我们知道您的反馈。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fossbytes.com/tldr-pages-linux-man-pages-alternative/
|
||||
|
||||
作者:[Adarsh Verma][a]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://fossbytes.com/author/adarsh/
|
||||
[1]:https://fossbytes.com/watch-star-wars-command-prompt-via-telnet/
|
||||
[2]:https://fossbytes.com/use-stackoverflow-linux-terminal-mac/
|
||||
[3]:https://fossbytes.com/single-command-curl-wttr-terminal-weather-report/
|
||||
[4]:https://fossbytes.com/how-to-google-search-in-command-line-using-googler/
|
||||
[5]:https://fossbytes.com/check-bitcoin-cryptocurrency-prices-command-line-coinmon/
|
||||
[6]:https://fossbytes.com/review-torrench-download-torrents-using-terminal-linux/
|
||||
[7]:https://fossbytes.com/use-wikipedia-termnianl-wikit/
|
||||
[8]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Ffossbytes.com%2Ftldr-pages-linux-man-pages-alternative%2F
|
||||
[9]:https://twitter.com/intent/tweet?text=TLDR+pages%3A+Simplified+Alternative+To+Linux+Man+Pages&url=https%3A%2F%2Ffossbytes.com%2Ftldr-pages-linux-man-pages-alternative%2F&via=%40fossbytes14
|
||||
[10]:http://plus.google.com/share?url=https://fossbytes.com/tldr-pages-linux-man-pages-alternative/
|
||||
[11]:http://pinterest.com/pin/create/button/?url=https://fossbytes.com/tldr-pages-linux-man-pages-alternative/&media=https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-ubuntu.jpg
|
||||
[12]:https://fossbytes.com/linux-lexicon-man-pages-navigation/
|
||||
[13]:https://github.com/tldr-pages/tldr
|
||||
[14]:https://fossbytes.com/wp-content/uploads/2017/11/tar-man-page.jpg
|
||||
[15]:https://fossbytes.com/wp-content/uploads/2017/11/tar-tldr-page.jpg
|
||||
[16]:https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-of-apt.jpg
|
||||
[17]:https://fossbytes.com/wp-content/uploads/2017/11/tldr-kill-command.jpg
|
||||
[18]:https://tldr.ostera.io/
|
||||
[19]:https://itunes.apple.com/us/app/tldt-pages/id1071725095?ls=1&mt=8
|
||||
[20]:https://play.google.com/store/apps/details?id=io.github.hidroh.tldroid
|
||||
[21]:https://fossbytes.com/wp-content/uploads/2017/11/tldr-app-ios.jpg
|
||||
[22]:https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-ubuntu.jpg
|
||||
[23]:https://fossbytes.com/a-z-list-linux-command-line-reference/
|
||||
@@ -0,0 +1,114 @@
|
||||
迁移到 Linux:网络和系统设置
|
||||
======
|
||||
|
||||
> 这个系列我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到 Linux;这篇中我们涉及到 Linux 桌面系统上的一些常见设置。
|
||||
|
||||

|
||||
|
||||
在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到 Linux。如果你错过了以前的文章,可以从这访问:
|
||||
|
||||
- [第1部分 - 入门介绍][1]
|
||||
- [第2部分 - 磁盘、文件和文件系统][2]
|
||||
- [第3部分 - 图形操作环境][3]
|
||||
- [第4部分 - 命令行][4]
|
||||
- [第5部分 - 使用 sudo][5]
|
||||
- [第5部分 - 安装软件][6]
|
||||
|
||||
Linux 提供了一系列网络和系统设置。在你的桌面计算机上,Linux 允许您调整系统上的任何内容。大多数这些设置都出现在 `/etc` 目录下的纯文本文件中。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。
|
||||
|
||||
大多数设置都能够在“设置”程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。
|
||||
|
||||
### 连接互联网
|
||||
|
||||
在 Linux 中连接到互联网通常非常简单。如果您通过以太网电缆连接,Linux 通常会在插入电缆时或启动时(如果电缆已连接)获得 IP 地址并自动连接。
|
||||
|
||||
如果您使用无线网络,则在大多数发行版中都有一个菜单,可以在指示器面板中或在“设置”中(取决于您的发行版),您可以在其中选择无线网络的 SSID。如果网络受密码保护,它通常会提示您输入密码。然后连接,这个过程相当顺利。
|
||||
|
||||
在图形界面您可以通过进入设置来调整网络设置。通常称为“系统设置”或者是“设置”。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。
|
||||
|
||||
![Network Settings][8]
|
||||
|
||||
*图1: Gnome 桌面网络设置指示器图标。*
|
||||
|
||||
### 网络接口名称
|
||||
|
||||
在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 —— 或“以太网”和“无线网络”。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0 和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。
|
||||
|
||||
### 通过命令行进行网络管理
|
||||
|
||||
如果您希望更好地控制网络设置,或者如果您在没有图形桌面的情况下管理网络连接,则还可以从命令行管理网络。
|
||||
|
||||
请注意,用于在图形桌面中管理网络的最常用服务是“<ruby>网络管理器<rt>Network Manager</rt></ruby>”,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。
|
||||
|
||||
在图形环境中的更改设置与在网络管理器中很类似,您还可以使用名为 `nmtui` 的工具从命令行更改网络管理器设置。`nmtui` 工具提供了您在图形环境中找到的所有设置,但是是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图 2)。
|
||||
|
||||

|
||||
|
||||
*图 2:nmtui 界面*
|
||||
|
||||
在命令行上,有一个名为 `ifconfig` 的旧工具来管理网络,还有一个名为 `ip` 的新工具。在某些发行版中,`ifconfig` 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,`ifconfig` 仍可以使用。
|
||||
|
||||
以下是一些允许您显示和更改网络设置的命令:
|
||||
|
||||

|
||||
|
||||
### 进程和系统信息
|
||||
|
||||
在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能。
|
||||
|
||||
在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可用的图形工具。大多数所共有的工具是“系统监视器”和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。
|
||||
|
||||

|
||||
|
||||
*图 3:NetHogs 截图*
|
||||
|
||||
在这些工具中,你也可以查看系统全局网络流量(图 4)。
|
||||
|
||||
![System Monitor][11]
|
||||
|
||||
*图 4:Gnome System Monitor 的截图*
|
||||
|
||||
### 管理进程和系统使用
|
||||
|
||||
您还可以从命令行使用相当多的工具。使用 `ps` 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 `ps` 命令不会使用,可以使用命令 `info ps` 或者 `man ps` 获取帮助。
|
||||
|
||||
大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或 CPU 时间的进程。这种情况下有两个非常简单的命令,分别是 `top` 和 `htop` 命令(图 5)。
|
||||
|
||||

|
||||
|
||||
*图 5:top 截屏*
|
||||
|
||||
`top` 和 `htop` 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。
|
||||
|
||||
使用这两个命令时(`top` 和 `htop`),你可以输入 `?` 来获取使用帮助,输入 `q` 来退出程序。使用 `top` 命令你可以按 `k` 键然后输入进程 ID 来杀死某个进程。
|
||||
|
||||
使用 `htop` 命令时你可以使用 `↑` `↓` 键来将列表中的一条记录进行高亮显示,按下 `F9` 键会杀死进程(需要回车确认)。
|
||||
|
||||
本系列中提供的信息和工具将帮助您开始使用 Linux。 只需一点时间和耐心,您就会感到这非常舒服。
|
||||
|
||||
想学习更多 Linux 内容可访问免费的 [Linux 简介][12]课程,此课程来自 Linux 基金会和 edx。
|
||||
|
||||
------
|
||||
|
||||
via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system-settings
|
||||
|
||||
作者:[John Bonesio][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[ScarboroughCoral](https://github.com/ScarboroughCoral)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linux.com/users/johnbonesio
|
||||
[1]: https://linux.cn/article-9212-1.html
|
||||
[2]: https://linux.cn/article-9213-1.html
|
||||
[3]: https://linux.cn/article-9293-1.html
|
||||
[4]: https://linux.cn/article-9565-1.html
|
||||
[5]: https://linux.cn/article-9819-1.html
|
||||
[6]: https://linux.cn/article-9823-1.html
|
||||
[7]: https://www.linux.com/files/images/figure-1png-2
|
||||
[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings"
|
||||
[9]: https://www.linux.com/licenses/category/used-permission
|
||||
[10]: https://www.linux.com/files/images/figure-4png-1
|
||||
[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor"
|
||||
[12]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
||||
@@ -1,34 +1,36 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: subject: (How a university network assistant used Linux in the 90s)
|
||||
[#]: via: (https://opensource.com/article/18/5/my-linux-story-student)
|
||||
[#]: author: ([Alan Formy-Duva](https://opensource.com/users/alanfdoss)
|
||||
[#]: url: ( )
|
||||
[#]: url: (https://linux.cn/article-10359-1.html)
|
||||
|
||||
大学网络助理如何在 90 年代使用 Linux
|
||||
90 年代的大学网管如何使用 Linux
|
||||
======
|
||||
|
||||

|
||||
在 20 世纪 90 年代中期,我报名了计算机科学课。我大学的计算机科学系为学生提供了一台 SunOS 服务器,它是一个多用户、多任务的 Unix 系统。我们登录它并编写我们在学习的编程语言代码,例如 C、C++ 和 ADA。在那些日子里,在社交网络和 IM 出现之前,我们还使用该系统相互通信,发送电子邮件和使用诸如 `write` 和 `talk` 之类的程序。我们每个人被允许托管一个个人网站。我很高兴它能够完成我的作业并联系其他用户。
|
||||
|
||||
在上世纪 90 年代中期,我报名了计算机科学课。我大学的计算机科学系为学生提供了一台 SunOS 服务器,它是一个多用户、多任务的 Unix 系统。我们登录它并编写我们学习的编程语言代码,例如 C、C++ 和 ADA。在那时,在社交网络和 IM 出现之前,我们还使用该系统发送电子邮件和使用诸如 `write` 和 `talk` 之类的程序来相互通信。我们每个人被允许托管一个个人网站。我很高兴能够使用它完成我的作业并联系其他用户。
|
||||
|
||||
这是我第一次体验这种类型的操作环境,但我很快就了解了另一个可以做同样事情的操作系统:Linux。
|
||||
|
||||
当我还是一名学生的时候,我还在大学兼职工作。我的第一个职位是住房和住宅部 (H&R) 的网络安装人员。这包含将学生宿舍与校园网络连接起来。由于这是该大学的第一个宿舍网络服务,因此只有两幢楼和大约 75 名学生已经连接。
|
||||
那会我还是学生,我在大学找了份兼职工作。我的第一个职位是住房和住宅部(H&R)的网络安装人员。这工作涉及到将学生宿舍与校园网络连接起来。由于这是该大学的第一个宿舍网络服务,因此只有两幢楼和大约 75 名学生连上了网。
|
||||
|
||||
在我工作的第二年,该网络扩展到另外两幢楼。H&R 决定让该大学的信息技术办公室 (OIT) 管理这不断增长的业务。我进入 OIT 并开始担任 OIT 网络经理的学生助理。这就是我发现 Linux 的方式。我的新职责之一是管理防火墙系统,它为宿舍提供网络和互联网访问。
|
||||
在第二年,该网络扩展到另外两幢楼。H&R 决定让该大学的信息技术办公室(OIT)管理这不断增长的业务。我进入 OIT 并开始担任 OIT 网络经理的学生助理。这就是我发现 Linux 的方式。我的新职责之一是管理防火墙系统,它为宿舍提供网络和互联网访问。
|
||||
|
||||
每个学生都注册了他们硬件的 MAC 地址。注册学生可以连接到宿舍网络并获得 IP 地址及访问互联网。与大学使用的其他昂贵的 SunOS 和 VMS 服务器不同,这些防火墙使用运行着免费和开源 Linux 操作系统的低成本计算机。截至年底,该系统已注册近 500 名学生。
|
||||
每个学生都注册了他们硬件的 MAC 地址。注册的学生可以连接到宿舍网络并获得 IP 地址及访问互联网。与大学使用的其他昂贵的 SunOS 和 VMS 服务器不同,这些防火墙使用运行着自由开源的 Linux 操作系统的低成本计算机。截至年底,该系统已注册近 500 名学生。
|
||||
|
||||
![Red hat Linux install disks][1]
|
||||
|
||||
OIT 网络工作人员使用 Linux 运行 HTTP、FTP 和其他服务。他们还在个人桌面上使用 Linux。就在那时,我意识到我手上的计算机看起来和运行起来就像 CS 系昂贵的 SunOS 机器一样但没有高昂的成本。Linux 可以在商用 x86 硬件上运行,例如有 8 MB RAM 和 133Mhz Intel Pentium CPU 的 Dell Latitude。那对我来说是个卖点!我在从一个剩余的仓库中清理出来的机器上安装了 Red Hat Linux 5.2,并给了我的朋友登录帐户。
|
||||
OIT 网络工作人员使用 Linux 运行 HTTP、FTP 和其他服务。他们还在个人桌面上使用 Linux。就在那时,我意识到我手上的计算机看起来和运行起来就像 CS 系昂贵的 SunOS 机器一样,但没有高昂的成本。Linux 可以在商用 x86 硬件上运行,例如有 8 MB RAM 和 133Mhz Intel Pentium CPU 的 Dell Latitude。那对我来说是个卖点!我在从一个存货仓库中清理出来的机器上安装了 Red Hat Linux 5.2,并给了我的朋友登录帐户。
|
||||
|
||||
我使用我的新 Linux 服务器来托管我的网站并向我的朋友提供帐户,同时它还提供 CS 系服务器没有的图形功能。它使用了 X Windows 系统,我可以使用 Netscape Navigator 浏览网页,使用 [XMMS][2] 播放音乐,并尝试不同的窗口管理器。我也可以下载并编译其他开源软件并编写自己的代码。
|
||||
|
||||
我了解到 Linux 提供了一些非常先进的功能,其中许多功能比更主流的操作系统更方便或更优越。例如,许多操作系统尚未提供应用更新的简单方法。在 Linux 中,这很简单,感谢 [autoRPM][3],一个由 Kirk Bauer 编写的更新管理器,它向 root 用户每日发送邮件,其中包含可用的更新。它有一个直观的界面,用于审查和选择要安装的软件更新 - 这对于 90 年代中期来说非常了不起。
|
||||
我了解到 Linux 提供了一些非常先进的功能,其中许多功能比更主流的操作系统更方便或更优越。例如,许多操作系统尚未提供应用更新的简单方法。在 Linux 中,这很简单,感谢 [autoRPM][3],一个由 Kirk Bauer 编写的更新管理器,它向 root 用户每日发送邮件,其中包含可用的更新。它有一个直观的界面,用于审查和选择要安装的软件更新 —— 这对于 90 年代中期来说非常了不起。
|
||||
|
||||
Linux may not have been well-known back then, and it was often received with skepticism, but I was convinced it would survive. And survive it did!
|
||||
当时 Linux 可能并不为人所知,而且它经常受到怀疑,但我确信它会存活下来。而它确实生存下来了!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@@ -37,11 +39,11 @@ via: https://opensource.com/article/18/5/my-linux-story-student
|
||||
作者:[Alan Formy-Duval][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[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/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/alanfdoss
|
||||
[1]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/images/life-uploads/red_hat_linux_install_disks.png?itok=VSw6Cke9 (Red hat Linux install disks)
|
||||
[2]:http://www.xmms.org/
|
||||
[3]:http://www.ccp14.ac.uk/solution/linux/autorpm_redhat7_3.html
|
||||
[3]:http://www.ccp14.ac.uk/solution/linux/autorpm_redhat7_3.html
|
||||
@@ -0,0 +1,61 @@
|
||||
认识存储:块、文件和对象
|
||||
======
|
||||
> 今天产生的大量数据带来了新的存储挑战。在本文中了解各种存储类型以及它们的使用方式。
|
||||
|
||||

|
||||
|
||||
现在,对于那些创建或消费数据的公司来说,处理数量巨大的生成数据是个非常大的挑战。而对于那些解决存储相关问题的科技公司来说,也是一个挑战。
|
||||
|
||||
Red Hat 存储首席产品营销经理 Michael St. Jean 说,“数据每年呈几何级增长,而我们发现数据大量增长的主要原因是由于消费增长和为拓展价值而进行的产业转型,毫无疑问,物联网对数据增长的贡献很大,但对软件定义存储来说最重要的挑战是,如何处理用户场景相关的数据增长。“
|
||||
|
||||
任何挑战都意味着机遇。Azure 存储、介质和边缘计算总经理 Tad Brockway 说,“今天,新旧数据源产生的海量数据为我们满足客户在规模、性能、灵活性、治理方面急剧增长的需求提供了一个机遇。”
|
||||
|
||||
### 现代软件定义存储的三种类型
|
||||
|
||||
这里有三个不同类型的存储解决方案 —— 块、文件、和对象 —— 虽然它们每个都可以与其它的共同工作,但它们每个都有不同的用途。
|
||||
|
||||
块存储是数据存储的最古老形式,数据都存储在固定长度的块或多个块中。块存储适用于企业存储环境,并且通常使用光纤通道或 iSCSI 接口。根据 SUSE 的软件定义存储高级产品经理 Larry Morris 的说法,“块存储要求一个应用去映射存储设备上存储数据块的位置。”
|
||||
|
||||
块存储在存储区域网和软件定义存储系统中是虚拟的,它是处于一个共享的硬件基础设施上的抽象逻辑设备,其创建和存在于服务器、虚拟服务器、或运行在基于像 SCSI、SATA、SAS、FCP、FCoE、或 iSCSI 这样的协议的系统管理程序上。
|
||||
|
||||
St. Jean 说“块存储将单个的存储卷(如一个虚拟或云存储节点、或一个老式硬盘)分割成单独的被称为块的实体。”
|
||||
|
||||
每个块独立存在,并且能够用它自己的数据传输协议和操作系统格式化 —— 给用户完全的配置自主权。由于块存储系统并不负责像文件存储系统那样的文件查找职责,所以,块存储是一个非常快的存储系统。由于同时具备速度和配置灵活性,使得块存储非常适合原始服务器存储或富媒体数据库。
|
||||
|
||||
块存储适合于宿主机操作系统、应用程序、数据库、完整虚拟机和容器。传统上,块存储仅能够被独立的机器访问,或呈现给集群中的机器访问。
|
||||
|
||||
### 基于文件的存储
|
||||
|
||||
基于文件的存储使用一个文件系统去映射存储设备上数据的存储位置。这种技术在直连或网络附加存储系统应用领域中处于支配地位。它需要做两件事情:组织数据并呈现给用户。St. Jean 说,”使用文件存储时,数据在服务器侧的存储方式与客户端用户所看到的是完全相同的。这就允许用户通过一些唯一标识符(像文件名、位置、或 URL)去请求一个文件,使用特定的数据传输协议与存储系统沟通。
|
||||
|
||||
其结果就是一种能够从上到下进行浏览的分层的文件结构。文件存储处于块存储之上,允许用户去查看和访问文件、文件夹这样的数据,但是被限制访问处于这些文件和文件夹之下的数据块。
|
||||
|
||||
Brockway 解释说,“文件存储一般用于像 NFS 和 CIFS/SMB 这种很多服务器基于 IP 网络进行访问的共享文件系统上。访问控制通过用户和组的权限实现在文件、目录和导出级别上。基于文件的存储可用于被多个用户和机器、二进制应用程序、数据库、虚拟机所需要的文件的存储上,以及容器上。“
|
||||
|
||||
### 对象存储
|
||||
|
||||
对象存储是最新的数据存储形式,它为非结构化数据提供一个仓库,它将内容从索引中分离出来,并允许多个文件连接到一个对象上。一个对象就是与任何相关元数据配对的一个数据块,这些元数据提供对象中包含的字节的上下文(比如数据创建时间和数据大小等)。也就是说这两样东西 —— 数据和元数据 —— 构成了一个对象。
|
||||
|
||||
对象存储的一个好处是每个数据块都关联了一个唯一标识符。访问数据需要唯一标识符,并且不需要应用程序或用户知道数据的真实存储位置。对象数据是通过 API 来访问的。
|
||||
|
||||
St. Jean 说,“对象中存储的数据是没有压缩和加密的,对象本身被组织在对象存储(一个填满其它对象的中心库)中或容器(包含应用程序运行所需要的所有文件的一个包)中。与文件存储系统的层次结构相比,对象、对象存储和容器在本质上是平面的 —— 这使得它们在存储规模巨大时访问速度很快。”
|
||||
|
||||
对象存储可以扩展到很多 PB 字节大小,以适应巨大的数据集,因此它是图像、音频、视频、日志、备份、和分析服务所使用的数据存储的最佳选择。
|
||||
|
||||
### 结论
|
||||
|
||||
现在你已经知道了各种类型的存储以及它们的用处。后面我们将继续研究这个主题的更多内容,敬请关注。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/2018/9/know-your-storage-block-file-object
|
||||
|
||||
作者:[Swapnil Bhartiya][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[qhwdw](https://github.com/qhwdw)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linux.com/users/arnieswap
|
||||
[1]: https://events.linuxfoundation.org/events/elc-openiot-europe-2018/
|
||||
@@ -1,22 +1,24 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: subject: (A Free Guide for Setting Your Open Source Strategy)
|
||||
[#]: via: (https://www.linux.com/blog/2018/11/free-guide-setting-your-open-source-strategy)
|
||||
[#]: author: ([Amber Ankerholz](https://www.linux.com/users/aankerholz)
|
||||
[#]: url: ( )
|
||||
[#]: url: (https://linux.cn/article-10354-1.html)
|
||||
|
||||
制定开源战略的免费指南
|
||||
======
|
||||
|
||||
> 了解如何使用 TODO Group 的成熟实践,使您的组织的开源软件目标与您的业务目标保持一致。
|
||||
|
||||

|
||||
|
||||
大多数使用开源的公司都了解其商业价值,但他们可能缺乏战略性地实施开源计划和获得全部回报的工具。根据 [The New Stack][1] 最近的一项调查,“开源计划的三大好处是1)提高了对开源的认识,2)提高了开发周期的速度和灵活性,以及 3)更好的许可证合规性“。
|
||||
大多数使用开源的公司都了解其商业价值,但他们可能缺乏战略性地实施开源计划和获得全部回报的工具。根据 [The New Stack][1] 最近的一项调查,“开源计划的三大好处是 1)提高了对开源的认识,2)提高了开发周期的速度和灵活性,以及 3)更好的许可证合规性。”
|
||||
|
||||
运营开源计划办公点涉及创建策略来帮助你定义和实施你的方法,并衡量你的进度。由 Linux 基金会与 TODO 集团合作开发的[企业开源指南][2]基于多年的经验和实践提供了专业开源知识。
|
||||
运作一个开源计划办公室涉及到创建策略来帮助你定义和实施你的方法,并衡量你的进度。由 Linux 基金会与 TODO Group 合作开发的[企业开源指南][2]基于多年的经验和实践提供了专业开源知识。
|
||||
|
||||
最新的指南中,[设置开源战略][3]详细介绍了制定战略和确保成功之路的基本步骤。根据该指南,“你的开源战略将管理、参与和创建开源软件的计划与计划所服务的业务目标联系起来。这可以开辟许多机会并促进创新。“该指南涵盖以下主题:
|
||||
最新的指南中,[设置开源战略][3]详细介绍了制定战略和确保成功之路的基本步骤。根据该指南,“你的开源战略将管理、参与和创建开源软件的计划与计划所服务的业务目标联系起来。这可以开辟许多机会并促进创新。”该指南涵盖以下主题:
|
||||
|
||||
1. 为什么制定战略?
|
||||
2. 你的战略文件
|
||||
@@ -26,9 +28,7 @@
|
||||
6. 确定投资回报率
|
||||
7. 投资目标
|
||||
|
||||
|
||||
|
||||
这里关键的第一步是创建和记录你的开源策略,该策略将“帮助你最大限度地提高组织从开源中获得的利益。”同时,你详细的策略可以帮助你避免因错误而导致的困难,例如:选择错误的许可证或不正确地维护代码。根据指南,该文件还可以:
|
||||
这里关键的第一步是创建和将你的开源策略形成文字,该策略将“帮助你最大限度地提高组织从开源中获得的利益。”同时,你详细的策略可以帮助你避免因错误而导致的困难,例如:选择错误的许可证或不正确地维护代码。根据指南,该文件还可以:
|
||||
|
||||
* 让领导者感到兴奋并参与
|
||||
* 帮助在公司内获得支持
|
||||
@@ -37,15 +37,13 @@
|
||||
* 解释贵公司的开源方式和对其使用的支持
|
||||
* 明确贵公司在社区驱动的外部研发中投资的地方,以及贵公司将重点放在增值差异化的地方
|
||||
|
||||
Salesforce 的软件架构师兼本指南的撰稿人 Ian Varley 说:“在 Salesforce 内,我们有内部文件,我们将这些围绕开源战略指导和鼓励的文件分发给我们的工程团队。其中鼓励创建和使用开源,这让他们毫不含糊地知道公司的战略领导者完全支持它。此外,如果有某些我们不希望工程师使用的许可证或有其他开源指南,我们的内部文档需要明确。”
|
||||
|
||||
|
||||
Salesforce 的软件架构师兼指南的撰稿人 Ian Varley 说:“在 Salesforce 内,我们有内部文件,我们将这些围绕开源战略指导和鼓励的文件分发给我们的工程团队。其中鼓励创建和使用开源,这让他们毫不含糊地知道公司的战略领导者完全支持它。此外,如果有某些我们不希望工程师使用的许可证或有其他开源指南,我们的内部文档需要明确。“
|
||||
|
||||
开源计划有助于促进企业文化,使企业更高效,并且根据指南,强有力的战略文档可以“帮助你的团队了解开源计划背后的业务目标,确保更好的决策,并最大限度地降低风险“。
|
||||
开源计划有助于促进企业文化,使企业更高效,并且根据指南,强有力的战略文档可以“帮助你的团队了解开源计划背后的业务目标,确保更好的决策,并最大限度地降低风险。”
|
||||
|
||||
了解如何使用[设置开源策略][3]新指南中的提示和经过验证的实践,将管理和创建开源软件的目标与组织的业务目标保持一致。然后,查看所有 12 个[企业开源指南][2],了解有关使用开源获得成功的更多信息。
|
||||
|
||||
本文最初发表在 [Linux基金会][4]
|
||||
本文最初发表在 [Linux基金会][4]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@@ -54,7 +52,7 @@ via: https://www.linux.com/blog/2018/11/free-guide-setting-your-open-source-stra
|
||||
作者:[Amber Ankerholz][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/) 荣誉推出
|
||||
|
||||
@@ -63,4 +61,4 @@ via: https://www.linux.com/blog/2018/11/free-guide-setting-your-open-source-stra
|
||||
[1]: https://thenewstack.io/open-source-culture-starts-with-programs-and-policies/
|
||||
[2]: https://www.linuxfoundation.org/resources/open-source-guides/
|
||||
[3]: https://www.linuxfoundation.org/resources/open-source-guides/setting-an-open-source-strategy/
|
||||
[4]: https://www.linuxfoundation.org/blog/2018/11/a-free-guide-for-setting-your-open-source-strategy/
|
||||
[4]: https://www.linuxfoundation.org/blog/2018/11/a-free-guide-for-setting-your-open-source-strategy/
|
||||
@@ -1,38 +1,43 @@
|
||||
在 Linux 下交换 Ctrl 与 Caps Lock 键
|
||||
在 Linux 下交换 Ctrl 与大写锁定键
|
||||
======
|
||||
|
||||
Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示如何去做。
|
||||
> Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示如何去做。
|
||||
|
||||

|
||||
|
||||
对于许多使用计算机很多年的用户来说,自从第一批 PC 键盘从生产线上下线后不久,Ctrl 和 Caps Lock 键就已经在错误的位置上了。对我来说,这张 1995 年 Sun 工作站的老式键盘照片上的两个键的位置才是正确的。(原谅我放了一张模糊的图片,它是在昏暗的光线下使用 Minox 间谍相机拍摄的。)
|
||||
对于许多使用计算机很多年的用户来说,自从第一批 PC 键盘从生产线上下线后不久,Ctrl 和大写锁定键就已经在错误的位置上了。对我来说,这张 1995 年 Sun 工作站的老式键盘照片上的两个键的位置才是正确的。(原谅我放了一张模糊的图片,它是在昏暗的光线下使用 Minox 间谍相机拍摄的。)
|
||||
|
||||
感兴趣的话,可以读一下维基百科上对于 [Ctrl 键位置的历史][1] 的介绍。我不打算讨论将 Ctrl 键放在“a”旁边而不是 Shift 键下方的各种理由,不评论 Caps Lock 键的无用性,也没有打算与那些主张使用手掌根来触发 Ctrl 键的人争论,即使在一些笔记本电脑键盘上也不可能这样做,因为有的键会位于腕托以下。
|
||||

|
||||
|
||||
相反,我将假设我不是唯一喜欢把 Ctrl 键放在“a”旁边的人,并说明如何使用 Linux 自带的灵活性在各种桌面环境中交换 Ctrl 和 Caps Lock 键的位置。请注意,下面的演示可能只有有限的有效期,因为调整桌面设置的方法经常发生变化,但我希望这为你开了一个好头。
|
||||
感兴趣的话,可以读一下维基百科上对于 [Ctrl 键位置的历史][1] 的介绍。我不打算讨论将 Ctrl 键放在“a”旁边而不是 Shift 键下方的各种理由,也不评论大写锁定键的无用性,也没有打算与那些主张使用手掌根来触发 Ctrl 键的人争论,即使在一些笔记本电脑键盘上不可能这样做到,因为有的键会位于腕托以下。
|
||||
|
||||
相反,我将假设我不是唯一喜欢把 Ctrl 键放在“a”旁边的人,并说明如何使用 Linux 自带的灵活性在各种桌面环境中交换 Ctrl 和大写锁定键的位置。请注意,下面的演示可能只有有限的有效期,因为调整桌面设置的方法经常发生变化,但我希望这为你开了一个好头。
|
||||
|
||||
### GNOME 3
|
||||
|
||||
[GNOME 3][2] 桌面环境用户可以使用 [Tweaks][3] 工具交换 Caps Lock 和 Ctrl 键,如下所示。
|
||||
[GNOME 3][2] 桌面环境用户可以使用 [Tweaks][3] 工具交换大写锁定和 Ctrl 键,如下所示。
|
||||
|
||||

|
||||
|
||||
具体步骤如下:
|
||||
|
||||
1. 从你的 Linux 发行版的软件仓库安装 Tweaks 工具。
|
||||
2. 启动 Tweaks 程序。
|
||||
3. 从左侧菜单中选择“Keyboard & Mouse”。
|
||||
4. 单击“Additional Layout Options”。
|
||||
5. 在打开的窗口中单击“Ctrl position”,然后选择“Swap Ctrl and Caps Lock”。
|
||||
3. 从左侧菜单中选择 “Keyboard & Mouse”。
|
||||
4. 单击 “Additional Layout Options”。
|
||||
5. 在打开的窗口中单击 “Ctrl position”,然后选择 “Swap Ctrl and Caps Lock”。
|
||||
|
||||
完成!顺便说一句,你可以使用 Tweaks 工具做很多很酷的事情。例如,我将我的右 Ctrl 键设置为 Compose 键,这让我可以使用键盘快捷键打出各种字符,例如通过 `Compose+c+,`、`Compose+e+'`、`Compose+O+^` 以及 `Compose+n+~` 分别键入 ç、é、ô 和 ñ。
|
||||
完成!顺便说一句,你可以使用 Tweaks 工具做很多很酷的事情。例如,我将我的右 Ctrl 键设置为 Compose 键,这让我可以使用键盘快捷键打出各种字符,例如通过 `Compose+c+,`、`Compose+e+'`、`Compose+o+^` 以及 `Compose+n+~` 分别键入 ç、é、ô 和 ñ。(LCTT 译注:可参考 [Special characters listed by extended compose sequence](https://www.ibm.com/support/knowledgecenter/en/SSKTWP_9.0.0/com.ibm.notes900.help.doc/acc_spec_characters_r.html))
|
||||
|
||||
### KDE
|
||||
|
||||
我不使用 [KDE][4],但我的同事 Seth Kenlon 写的 [KDE tweaks that will change your life][5] 这篇文章的第 5 项演示了如何重新映射按键。
|
||||
我不使用 [KDE][4],但我的同事 Seth Kenlon 写的 [将改变你的生命的 KDE tweaks][5] 这篇文章的第 5 项演示了如何重新映射按键。
|
||||
|
||||
### Xfce
|
||||
|
||||
据我所知,[Xfce][6] 桌面环境没有一个方便的工具来管理这些(指交换按键)设置。 但是,`setxkbmap` 命令的 `ctrl:swapcaps` 选项可以帮助你完成交换按键的修改。这个修改包含两部分:
|
||||
|
||||
1. 弄清楚命令的用法;
|
||||
1. 弄清楚命令的用法;
|
||||
2. 找出调用命令的位置,以便在桌面启动时激活它。
|
||||
|
||||
第一部分非常简单,命令是:
|
||||
@@ -43,7 +48,7 @@ Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示
|
||||
|
||||
在终端窗口中执行此命令,以确保结果符合你的预期。
|
||||
|
||||
假设上述命令有效,应该在哪里调用此命令呢?这需要一些实验。一种可能是在用户主目录的 `.profile` 文件中;另一个可能是将命令添加到 Xfce 的自启动配置(在设置管理器中查找“Session and Startup”)里。
|
||||
假设上述命令有效,应该在哪里调用此命令呢?这需要一些实验。一种可能是在用户主目录的 `.profile` 文件中;另一个可能是将命令添加到 Xfce 的自启动配置(在设置管理器中查找 “Session and Startup”)里。
|
||||
|
||||
还有一种可能性是在文件 `/etc/default/keyboard` 中使用相同的选项,最终可能看起来像这样:
|
||||
|
||||
@@ -76,7 +81,7 @@ BACKSPACE="guess"
|
||||
|
||||
### 其他环境
|
||||
|
||||
最后,上面 StackExchange 的链接中提到的这一点值得强调--配置控制台与配置终端窗口不同;如前所述,后者是通过桌面管理器进行配置的。
|
||||
最后,上面 StackExchange 的链接中提到的这一点值得强调 —— 配置控制台与配置终端窗口不同;如前所述,后者是通过桌面管理器进行配置的。
|
||||
|
||||
`setxkbmap`、`xkeyboard-config`、`keyboard`、`console-setup` 和 `setupcon` 命令的手册都是有用的参考资料。或者,如果你不喜欢阅读手册,可以看一下 [这篇极好的文章][13]。
|
||||
|
||||
@@ -87,7 +92,7 @@ via: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keybo
|
||||
作者:[Chris Hermansen][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[jlztan](https://github.com/jlztan)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: subject: (SMPlayer in Linux: Features, Download and Installation)
|
||||
[#]: via: (https://itsfoss.com/smplayer/)
|
||||
[#]: author: (Aquil Roshan;Abhishek Prakash https://itsfoss.com/author/aquil/)
|
||||
[#]: url: ( )
|
||||
[#]: url: (https://linux.cn/article-10365-1.html)
|
||||
|
||||
Linux 中的 SMPlayer:功能,下载和安装
|
||||
SMPlayer:增强版的媒体播放器
|
||||
======
|
||||
|
||||
当你要播放视频时,你会在[全新安装的 Ubuntu][1],或其他许多发行版中,会注意到一个消息:
|
||||
|
||||
![][2]
|
||||
默认媒体播放器没有适合的编解码器
|
||||
|
||||
这意味着系统上没有安装播放媒体的[所需编解码器][3]。现在,由于某些版权问题,某些基于 Linux 的操作系统无法在安装介质中预先打包编解码器。但是它们能让你只需点击即可下载和安装编解码器,或者你可以安装拥有所有媒体编解码器的媒体播放器。了解一下 [SMPlayer][4]。
|
||||
*默认媒体播放器没有适合的编解码器*
|
||||
|
||||
这意味着系统上没有安装播放媒体的[所需编解码器][3]。现在,由于某些版权问题,某些基于 Linux 的操作系统无法在安装介质中预先打包编解码器。但是它们能让你只需点击即可下载和安装编解码器,或者你可以安装拥有所有媒体编解码器的媒体播放器。让我们了解一下 [SMPlayer][4]。
|
||||
|
||||
### 认识 SMPlayer:适用于 Linux 的更好的媒体播放器
|
||||
|
||||
SMPlayer 是一款免费的开源媒体播放器,它基于强大的 [MPlayer][5] 媒体引擎。SMPlayer 能够播放 avi、mp4、mkv、mpeg、mov、divx、h.264 以及其他任何主要媒体格式。锦上添花的是,它也可以播放 [YouTube][6] 视频,并且无广告。
|
||||
SMPlayer 是一款自由开源媒体播放器,它基于强大的 [MPlayer][5] 媒体引擎。SMPlayer 能够播放 avi、mp4、mkv、mpeg、mov、divx、h.264 以及其他任何主要媒体格式。锦上添花的是,它也可以播放 [YouTube][6] 视频,并且无广告。
|
||||
|
||||
![SMPlayer default interface][7]
|
||||
|
||||
SMPlayer 是一个完整的媒体解决方案。它是跨平台的,因此可在所有操作系统上使用。如果你是双启动,则可以将其安装在 Windows 和 Linux 操作系统上,以便在两个系统上获得统一的体验。它还支持带触摸的可变形笔记本。
|
||||
SMPlayer 是一个完整的媒体解决方案。它是跨平台的,因此可在所有操作系统上使用。如果你是双启动系统,则可以将其安装在 Windows 和 Linux 操作系统上,以便在两个系统上获得统一的体验。它还支持带触摸的可变形笔记本。
|
||||
|
||||
你也可以在 SMPlayer 上播放 YouTube。我知道每次复制粘贴视频 URL 并在外部播放器上播放是不切实际的。但是当你观看相对较长的视频时,SMPlayer 特别有用。SMPlayer 以相当好的质量播放 YouTube 视频,我觉得比在浏览器中播放得更好。通过在 SMPlayer 上播放较长的视频,你可以远离视频中间弹出的插播广告。
|
||||
|
||||
@@ -51,7 +52,7 @@ SMPlayer 应该可在所有主要 Linux 发行版的软件中心获取。你可
|
||||
sudo apt install smplayer
|
||||
```
|
||||
|
||||
或者,你可以在[这里][11]下载 Fedora、Arch Linux、OpenSUSE 和 Debian 的软件包
|
||||
或者,你可以在[这里][11]下载 Fedora、Arch Linux、OpenSUSE 和 Debian 的软件包。
|
||||
|
||||
### 总结
|
||||
|
||||
@@ -66,7 +67,7 @@ via: https://itsfoss.com/smplayer/
|
||||
作者:[Aquil Roshan;Abhishek Prakash][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/) 荣誉推出
|
||||
|
||||
@@ -83,4 +84,4 @@ via: https://itsfoss.com/smplayer/
|
||||
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-icon-packs.jpg?fit=800%2C450&ssl=1
|
||||
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-theme.jpg?fit=800%2C450&ssl=1
|
||||
[11]: https://software.opensuse.org/download.html?project=home%3Asmplayerdev&package=smplayer
|
||||
[12]: https://itsfoss.com/essential-linux-applications/
|
||||
[12]: https://itsfoss.com/essential-linux-applications/
|
||||
@@ -1,32 +1,34 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (jrglinux )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: translator: (jrglinux)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: subject: (Boxing yourself in on the Linux command line)
|
||||
[#]: via: (https://opensource.com/article/18/12/linux-toy-boxes)
|
||||
[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
|
||||
[#]: url: ( )
|
||||
[#]: url: (https://linux.cn/article-10352-1.html)
|
||||
|
||||
神奇的 Linux 命令行字符形状工具 boxes
|
||||
======
|
||||
本文将教你如何在 Linux 命令行终端中使用 boxes 工具绘制字符形状图形来包装你的文字让其更突出。
|
||||
|
||||
> 本文将教你如何在 Linux 命令行终端中使用 boxes 工具绘制字符形状图形来包装你的文字让其更突出。
|
||||
|
||||

|
||||
|
||||
现在正值假期,每个 Linux 终端用户都该得到一点礼物。无论你是庆祝圣诞节还是庆祝其他节日,或者什么节日也没有,都没有关系。我将在接下来的几周内介绍 24 个 Linux 命令行小玩具,供你把玩或者与朋友分享。让我们享受乐趣,让这个月过得快乐一点,因为对于北半球来说,这个月有点冷并且沉闷。
|
||||
|
||||
对于我要讲述的内容,可能你之前就有些了解。但是,我还是希望我们都有机会学到一些新的东西(我做了一点研究,确保可以分享 24 个小玩具)。
|
||||
|
||||
24 个 Linux 终端小玩具中的第一个是叫做 boxes 的小程序。为何从 boxes 说起呢?因为在没有它的情况下很难将所有其他命令礼物包装起来!
|
||||
24 个 Linux 终端小玩具中的第一个是叫做 `boxes` 的小程序。为何从 `boxes` 说起呢?因为在没有它的情况下很难将所有其他命令礼物包装起来!
|
||||
|
||||
在我的 Fedora 机器上,默认没有安装 boxes 程序,但它在我的普通仓库中可以获取到,所以用如下命令就可安装:
|
||||
在我的 Fedora 机器上,默认没有安装 `boxes` 程序,但它在我的普通仓库中可以获取到,所以用如下命令就可安装:
|
||||
|
||||
```
|
||||
$ sudo dnf install boxes -y
|
||||
```
|
||||
|
||||
如果你在使用其他 Linux 发行版,一般也都可以在默认仓库中找到 boxes。
|
||||
如果你在使用其他 Linux 发行版,一般也都可以在默认仓库中找到 `boxes`。
|
||||
|
||||
Boxes 是我真正希望在高中和大学计算机课程中就使用的实用程序,因为善意的老师要求我在每个源文件、函数、代码块等开头添加一些具体的评论信息。
|
||||
`boxes` 是我真正希望在高中和大学计算机课程中就使用的实用程序,因为善意的老师要求我在每个源文件、函数、代码块等开头添加一些特定外观的备注信息。
|
||||
|
||||
```
|
||||
/***************/
|
||||
@@ -34,7 +36,7 @@ Boxes 是我真正希望在高中和大学计算机课程中就使用的实用
|
||||
/***************/
|
||||
```
|
||||
|
||||
事实证明,一旦你需要在框内添加几行文字,并且格式化的将它们统一风格就会变得很乏味。而 boxes 是一个简单实用程序,它使用 ASCII 艺术风格的字符形状框来包围文本。其字符形状默认风格是源代码注释风格,但也提供了一些其他选项。
|
||||
事实证明,一旦你需要在框内添加几行文字,并且格式化的将它们统一风格就会变得很乏味。而 `boxes` 是一个简单实用程序,它使用 ASCII 艺术风格的字符形状框来包围文本。其字符形状默认风格是源代码注释风格,但也提供了一些其他选项。
|
||||
|
||||
它真的很容易使用。使用管道,便可以将一个简短问候语塞进字符形状盒子里。
|
||||
|
||||
@@ -86,7 +88,7 @@ echo "I am a dog" | boxes -d dog -a c
|
||||
'---------------------------------------'
|
||||
```
|
||||
|
||||
Boxes 程序提供了[很多选项][1] 用于填充、定位甚至处理正则表达式。你可以在其 [项目主页][2] 上了解更多有关 boxes 的信息,或者转到 [GitHub][3] 去下载源代码或者贡献你自己的盒子形状。说到此,如果你正在寻找贡献的好点子,我已经有了一个想法:为什么不贡献一个节日礼物盒子?
|
||||
`boxes` 程序提供了[很多选项][1] 用于填充、定位甚至处理正则表达式。你可以在其 [项目主页][2] 上了解更多有关 `boxes` 的信息,或者转到 [GitHub][3] 去下载源代码或者贡献你自己的盒子形状。说到此,如果你想给你的提交找个好点子,我已经有了一个想法:为什么不能是一个节日礼物盒子?
|
||||
|
||||
```
|
||||
_ _
|
||||
@@ -100,11 +102,11 @@ Boxes 程序提供了[很多选项][1] 用于填充、定位甚至处理正则
|
||||
|____________________|
|
||||
```
|
||||
|
||||
Boxes 是基于 GPLv2 许可证的开源项目。
|
||||
`boxes` 是基于 GPLv2 许可证的开源项目。
|
||||
|
||||
你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。即使要介绍的小玩具已经有 24 个了,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。
|
||||
你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。即使要介绍的小玩具已经有 24 个了,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。
|
||||
|
||||
你可以通过[ Drive a locomotive through your Linux terminal][4] 来查看明天会介绍的命令行小玩具。
|
||||
你可以通过 [Drive a locomotive through your Linux terminal][4] 来查看明天会介绍的命令行小玩具。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@@ -113,7 +115,7 @@ via: https://opensource.com/article/18/12/linux-toy-boxes
|
||||
作者:[Jason Baker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[jrg](https://github.com/jrglinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: subject: (Drive a locomotive through your Linux terminal)
|
||||
[#]: via: (https://opensource.com/article/18/12/linux-toy-sl)
|
||||
[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
|
||||
[#]: url: ( )
|
||||
[#]: url: (https://linux.cn/article-10357-1.html)
|
||||
|
||||
在 Linux 终端中开火车
|
||||
======
|
||||
使用 sl 命令,你可以让自己坐上火车,有一个有趣的命令行体验。
|
||||
|
||||
> 使用 sl 命令,你可以让自己驾驶火车,带来一个有趣的命令行体验。
|
||||
|
||||

|
||||
|
||||
现在是 12 月,每个 Linux 终端用户都值得这一年的奖励。因此, 我们将为你带来一个 Linux 命令行玩具的出现日历。什么是命令行玩具?它可能是一个游戏、一个小的无意义的打发时间的东西,或者为你在终端带来快乐的东西。
|
||||
现在是 12 月,每个 Linux 终端用户都值得这一年的奖励。因此,我们将为你带来一个 Linux 命令行玩具的日历。什么是命令行玩具?它可能是一个游戏、一个小的无意义的打发时间的东西,或者为你在终端带来快乐的东西。
|
||||
|
||||
今天的 Linux 命令行玩具是来自 Opensource.com 社区版主 [Ben Cotton][1] 的建议。Ben 建议 `sl`,它是蒸汽机车的简称。
|
||||
今天的 Linux 命令行玩具来自 Opensource.com 社区版主 [Ben Cotton][1] 的建议。Ben 建议 `sl`,它是<ruby>蒸汽机车<rt>steam locomotive</rt></ruby>的简称。
|
||||
|
||||
对于 Linux **ls** 命令来说,它也是一个常见的错误,而不是巧合。想要不再打错吗?尝试安装 **sl**。它可能已经在默认仓库中打包。对我而言,在 Fedora 中,这意味着安装起来很简单:
|
||||
而对于 Linux `ls` 命令来说,`sl` 也是一个常见的拼写错误,这并不是巧合(LCTT 译注:意即 `sl` 是专门用来设计提醒 `ls` 打错的)。想要不再打错吗?尝试安装 `sl`。它可能已经在默认仓库中打包。对我而言,在 Fedora 中,这意味着安装起来很简单:
|
||||
|
||||
```
|
||||
$ sudo dnf install sl -y
|
||||
```
|
||||
|
||||
现在,只需键入**sl** 即可测试。
|
||||
现在,只需键入 `sl` 即可测试。
|
||||
|
||||

|
||||
|
||||
你可能会像我一样注意到,**Ctrl+C** 不会让你的火车脱轨,所以你必须等待整列火车通过。这会让你知道打错了 **ls**!
|
||||
你可能会像我一样注意到,`Ctrl+C` 不会让你的火车脱轨,所以你必须等待整列火车通过。这会让你知道打错了 `ls`!
|
||||
|
||||
想查看 `sl` 源码?它已经在[在 GitHub 上][2]。
|
||||
|
||||
想查看 **sl** 源码?它已经在[在 GitHub 上][2]。
|
||||
`sl` 也是分享我个人关于开源许可证的见解的绝佳机会。虽然它的[许可证][3]“足够开源”能够打包到我的发行版,但技术上而言,它并不是 [OSI 批准][4]的许可证。在其版权行之后,许可证的内容很简单:
|
||||
|
||||
**sl** 也是分享关于开源许可的个人 PSA 的绝佳机会。虽然它的[许可证][3]“足够开源”以便为我的发行版打包,但技术上而言,它并不是 [OSI 批准][4]的许可证。在版权行之后,许可证的内容很简单:
|
||||
|
||||
```
|
||||
Everyone is permitted to do anything on this program including copying,
|
||||
modifying, and improving, unless you try to pretend that you wrote it.
|
||||
i.e., the above copyright notice has to appear in all copies.
|
||||
THE AUTHOR DISCLAIMS ANY RESPONSIBILITY WITH REGARD TO THIS SOFTWARE.
|
||||
```
|
||||
> 每个人都可以在这个程序上做任何事情,包括复制,修改和改进,除非你试图假装你写了它。
|
||||
>
|
||||
> 即,上述版权声明必须出现在所有副本中。
|
||||
>
|
||||
> 作者对本软件不承担任何责任。
|
||||
|
||||
遗憾的是,当你选择未经 OSI 批准的许可证时,你可能会意外地为你的用户带来额外的工作,因为他们必须要弄清楚你的许可证是否适用于他们的情况。他们的公司政策是否允许他们做贡献?甚至他们可以合法地使用该程序吗?许可证是否与他们希望与之集成的其他程序的许可证相匹配?
|
||||
|
||||
除非你是律师(也许,即使你是律师),否则在非标准许可证范围内选择可能会很棘手。因此,如果你仍在寻找新年的方案,为什么不把仅 OSI 批准的许可证作为你 2019 年新项目的选择呢。
|
||||
|
||||
这并不是对作者的不尊重。**sl** 仍然是一个很棒的小命令行玩具。
|
||||
这并不是对作者的不尊重。`sl` 仍然是一个很棒的小命令行玩具。
|
||||
|
||||
你有一个你认为我应该介绍的最喜欢的命令行玩具吗?这个系列的日历大部分已经完成,但我还剩下几个空余。请在下面的评论中告诉我,我会了解一下。如果有空间,我会尝试包含它。如果没有,但我得到了一些好的投稿,我会在最后做一些荣誉介绍。
|
||||
|
||||
@@ -57,7 +57,7 @@ via: https://opensource.com/article/18/12/linux-toy-sl
|
||||
作者:[Jason Baker][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/) 荣誉推出
|
||||
|
||||
@@ -67,4 +67,4 @@ via: https://opensource.com/article/18/12/linux-toy-sl
|
||||
[2]: https://github.com/mtoyoda/sl
|
||||
[3]: https://github.com/mtoyoda/sl/blob/master/LICENSE
|
||||
[4]: https://opensource.org/licenses
|
||||
[5]: https://opensource.com/article/18/12/linux-toy-boxes
|
||||
[5]: https://opensource.com/article/18/12/linux-toy-boxes
|
||||
@@ -0,0 +1,150 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-10362-1.html)
|
||||
[#]: subject: (Four Easy Ways to Search Or Find Files And Folders in Linux)
|
||||
[#]: via: (https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/)
|
||||
[#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/)
|
||||
|
||||
搜索 Linux 中的文件和文件夹的四种简单方法
|
||||
======
|
||||
|
||||
Linux 管理员一天都不能离开搜索文件,因为这是他们的日常活动。了解一些搜索的东西是不错的,因为这能帮助你在命令行服务器中工作。这些命令记忆起来不复杂,因为它们使用的是标准语法。
|
||||
|
||||
可以通过四个 Linux 命令啦执行此操作,每个命令都有自己独特的功能。
|
||||
|
||||
### 方法 1:使用 find 命令在 Linux 中搜索文件和文件夹
|
||||
|
||||
`find` 命令被广泛使用,并且是在 Linux 中搜索文件和文件夹的著名命令。它搜索当前目录中的给定文件,并根据搜索条件递归遍历其子目录。
|
||||
|
||||
它允许用户根据大小、名称、所有者、组、类型、权限、日期和其他条件执行所有类型的文件搜索。
|
||||
|
||||
运行以下命令以在系统中查找给定文件。
|
||||
|
||||
```
|
||||
# find / -iname "sshd_config"
|
||||
/etc/ssh/sshd_config
|
||||
```
|
||||
|
||||
运行以下命令以查找系统中的给定文件夹。要在 Linux 中搜索文件夹,我们需要使用 `-type` 参数。
|
||||
|
||||
```
|
||||
# find / -type d -iname "ssh"
|
||||
/usr/lib/ssh
|
||||
/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh
|
||||
/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh
|
||||
/etc/ssh
|
||||
```
|
||||
|
||||
使用通配符搜索系统上的所有文件。我们将搜索系统中所有以 `.config` 为扩展名的文件。
|
||||
|
||||
```
|
||||
# find / -name "*.config"
|
||||
/usr/lib/mono/gac/avahi-sharp/1.0.0.0__4d116c78973743f5/avahi-sharp.dll.config
|
||||
/usr/lib/mono/gac/avahi-ui-sharp/0.0.0.0__4d116c78973743f5/avahi-ui-sharp.dll.config
|
||||
/usr/lib/python2.7/config/Setup.config
|
||||
/usr/share/git/mw-to-git/t/test.config
|
||||
/var/lib/lightdm/.config
|
||||
/home/daygeek/.config
|
||||
/root/.config
|
||||
/etc/skel/.config
|
||||
```
|
||||
|
||||
使用以下命令格式在系统中查找空文件和文件夹。
|
||||
|
||||
```
|
||||
# find / -empty
|
||||
```
|
||||
|
||||
使用以下命令组合查找 Linux 上包含特定文本的所有文件。
|
||||
|
||||
```
|
||||
# find / -type f -exec grep "Port 22" '{}' \; -print
|
||||
# find / -type f -print | xargs grep "Port 22"
|
||||
# find / -type f | xargs grep 'Port 22'
|
||||
# find / -type f -exec grep -H 'Port 22' {} \;
|
||||
```
|
||||
|
||||
### 方法 2:使用 locate 命令在 Linux 中搜索文件和文件夹
|
||||
|
||||
`locate` 命令比 `find` 命令运行得更快,因为它使用 `updatedb` 数据库,而 `find` 命令在真实系统中搜索。
|
||||
|
||||
它使用数据库而不是搜索单个目录路径来获取给定文件。
|
||||
|
||||
`locate` 命令未在大多数发行版中预安装,因此,请使用你的包管理器进行安装。
|
||||
|
||||
数据库通过 cron 任务定期更新,但我们可以通过运行以下命令手动更新它。
|
||||
|
||||
```
|
||||
$ sudo updatedb
|
||||
```
|
||||
|
||||
只需运行以下命令即可列出给定的文件或文件夹。在 `locate` 命令中不需要指定特定选项来打印文件或文件夹。
|
||||
|
||||
在系统中搜索 `ssh` 文件夹。
|
||||
|
||||
```
|
||||
# locate --basename '\ssh'
|
||||
/etc/ssh
|
||||
/usr/bin/ssh
|
||||
/usr/lib/ssh
|
||||
/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh
|
||||
/usr/lib/go/src/cmd/go/testdata/failssh/ssh
|
||||
/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh
|
||||
```
|
||||
|
||||
在系统中搜索 `ssh_config` 文件。
|
||||
|
||||
```
|
||||
# locate --basename '\sshd_config'
|
||||
/etc/ssh/sshd_config
|
||||
```
|
||||
|
||||
### 方法 3:在 Linux 中搜索文件使用 which 命令
|
||||
|
||||
`which` 返回在终端输入命令时执行的可执行文件的完整路径。
|
||||
|
||||
当你想要为可执行文件创建桌面快捷方式或符号链接时,它非常有用。
|
||||
|
||||
`which` 命令搜索当前用户而不是所有用户的 `$PATH` 环境变量中列出的目录。我的意思是,当你登录自己的帐户时,你无法搜索 root 用户文件或目录。
|
||||
|
||||
运行以下命令以打印 `vim` 可执行文件的完整路径。
|
||||
|
||||
```
|
||||
# which vi
|
||||
/usr/bin/vi
|
||||
```
|
||||
|
||||
或者,它允许用户一次执行多个文件搜索。
|
||||
|
||||
```
|
||||
# which -a vi sudo
|
||||
/usr/bin/vi
|
||||
/bin/vi
|
||||
/usr/bin/sudo
|
||||
/bin/sudo
|
||||
```
|
||||
|
||||
### 方法 4:使用 whereis 命令在 Linux 中搜索文件
|
||||
|
||||
`whereis` 命令用于搜索给定命令的二进制、源码和手册页文件。
|
||||
|
||||
```
|
||||
# whereis vi
|
||||
vi: /usr/bin/vi /usr/share/man/man1/vi.1p.gz /usr/share/man/man1/vi.1.gz
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/
|
||||
|
||||
作者:[Prakash Subramanian][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://www.2daygeek.com/author/prakash/
|
||||
[b]: https://github.com/lujun9972
|
||||
@@ -1,22 +1,24 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: subject: (Bring some color to your Linux terminal with lolcat)
|
||||
[#]: via: (https://opensource.com/article/18/12/linux-toy-lolcat)
|
||||
[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
|
||||
[#]: url: ( )
|
||||
[#]: url: (https://linux.cn/article-10361-1.html)
|
||||
|
||||
使用 lolcat 为你的 Linux 终端带来一些颜色
|
||||
使用 lolcat 为你的 Linux 终端带来彩虹
|
||||
======
|
||||
使用这个简单的程序,你可以为所需的任何程序的输出添加彩色。
|
||||
|
||||
> 使用这个简单的工具,你可以为所需的任何程序的输出变成七彩。
|
||||
|
||||

|
||||
|
||||
今天是 Linux 命令行玩具日历的第五天。如果这是你第一次访问该系列,你可能会问自己,什么是命令行玩具。即使我不太确定,但一般来说,它可能是一个游戏,或任何简单的可以帮助你在终端玩得开心的东西。
|
||||
|
||||
很可能你们中的一些人之前已经看过我们日历中的各种选择,但我们希望每个人至少见到一件新事物。
|
||||
很可能你们中的一些人之前已经看过我们日历中的各种玩具,但我们希望每个人至少见到一件新事物。
|
||||
|
||||
今日的选择,**lolcat**,是我选择的第一个没有在我的 Linux 发行版中打包的程序,但它安装仍然很简单。它是一个 Ruby 程序,你应该可以使用下面的命令轻松地添加到系统中。
|
||||
今日的选择,`lolcat`,是我选择的第一个没有在我的 Linux 发行版中打包的程序,但它安装仍然很简单。它是一个 Ruby 程序,你应该可以使用下面的命令轻松地添加到系统中。
|
||||
|
||||
```
|
||||
$ gem install lolcat
|
||||
@@ -29,15 +31,18 @@ $ fortune | boxes -a c -d parchment | lolcat
|
||||
```
|
||||
|
||||
根据你的运气,你可能会看到这样:
|
||||
|
||||

|
||||
|
||||
你可以传递给 **lolcat** 一些参数而不必重复它们,我建议你访问 **lolcat** 的 [GitHub 页面][1] 或者在终端输入 **lolcat --help** 了解。但一般来说,它们能设置彩虹的传递和频率,以及我个人最喜欢的动画。谁不喜欢终端的彩色动画打印?让我们再试一次,用一个不同的边框(当然是以猫为主题)和一句在我的句子列表中的适合猫的句子。
|
||||
你可以传递给 `lolcat` 一些参数。这里不再赘述,我建议你访问 `lolcat` 的 [GitHub 页面][1] 或者在终端输入 `lolcat --help` 了解。但一般来说,它们能设置彩虹的传递和频率,以及我个人最喜欢的动画。谁不喜欢终端的彩色动画输出呢?让我们再试一次,用一个不同的边框(当然是以猫为主题)和一句在我的格言列表中的适合猫的句子。
|
||||
|
||||
```
|
||||
fortune -m "nine tails" | boxes -a c -d cat | lolcat -a
|
||||
```
|
||||
|
||||

|
||||
**lolcat** 是 BSD 许可下的开源软件。
|
||||
|
||||
`lolcat` 是一个 BSD 许可下的开源软件。
|
||||
|
||||
你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。
|
||||
|
||||
@@ -50,11 +55,11 @@ via: https://opensource.com/article/18/12/linux-toy-lolcat
|
||||
作者:[Jason Baker][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/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jason-baker
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://github.com/busyloop/lolcat
|
||||
[2]: https://opensource.com/article/18/12/linux-toy-cowsay
|
||||
[2]: https://opensource.com/article/18/12/linux-toy-cowsay
|
||||
@@ -1,101 +1,99 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( dianbanjiu )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: translator: (dianbanjiu)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-10353-1.html)
|
||||
[#]: subject: (5 Ways To Check Laptop Battery Status And Level From Linux Terminal)
|
||||
[#]: via: (https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
从 Linux 终端查看笔记本电池状态等级的 5 个方法
|
||||
从 Linux 终端查看笔记本电池状态和等级的 5 个方法
|
||||
======
|
||||
|
||||
我们可以轻松地通过图形化界面查看当前电量百分比、是否在充电以及当前电量还可以使用多长时间等电池状态,但是却无法查看电池健康度等相关信息。
|
||||
|
||||
在这篇文章就是为了解决这些问题。
|
||||
|
||||
在 Linux 上有很多实用工具可以用命令行进行使用。
|
||||
在 Linux 上有很多这样的实用工具,而且可以在命令行使用。
|
||||
|
||||
这篇文章今天就要探讨这个主题,我会尽我所能的覆盖尽可能多的信息。
|
||||
|
||||
每月检查一次你的电池健康度是一个很好的想法。它可以帮你检查你当前遇到的问题是否与电池或者充电相关。
|
||||
|
||||
同时,我们也可以查看电池模组名称、电源、出售商以及电池规格等。
|
||||
同时,我们也可以查看电池模组名称、电源、厂商以及电池规格等。
|
||||
|
||||
电源管理是在非活跃状态时关闭电源或者切换系统的组件到低耗模式的一种功能。
|
||||
电源管理是在不使用时关闭电源或者切换系统的组件到低耗模式的一种功能。
|
||||
|
||||
### 几种在 Linux 下检查电池状态的实用工具
|
||||
|
||||
* `upower`: upower 是一个提供了接口来罗列系统中电源的命令行工具。
|
||||
* `acpi`: acpi显示来自 /proc 或者 /sys 文件中的一些信息,例如电池状态或者热量信息
|
||||
* `batstat`: batstat 是一个为 Linux 打印电池状态的命令行工具。
|
||||
* `tlp`: TLP 可以为你带来更高级的电源管理,而无需修改任何配置。
|
||||
* `class file`: 这个文件系统是一个提供了内核数据结构接口的伪文件系统。
|
||||
|
||||
|
||||
* `upower`:是一个命令行工具,其提供了罗列系统中电源的接口。
|
||||
* `acpi`:显示来自 `/proc` 或者 `/sys` 文件系统中的一些信息,例如电池状态或者热量信息。
|
||||
* `batstat`:是一个为 Linux 打印电池状态的命令行工具。
|
||||
* `tlp`:可以为你带来更高级的电源管理,而无需修改任何配置。
|
||||
* `class file`:这个 sysfs 文件系统是一个提供了内核数据结构接口的伪文件系统。
|
||||
|
||||
### 如何使用 upower 命令检查笔记本电池状态
|
||||
|
||||
[upower][1] 是一个提供了接口来罗列系统中电源的命令行工具。它在你的电脑上可以控制不同操作的延迟,这可以为你节省很大一部分电量。
|
||||
[upower][1] 是一个命令行工具,其提供了罗列系统中电源的接口。它在你的电脑上可以控制不同操作的延迟,这可以为你节省很大一部分电量。
|
||||
|
||||
只需要在 Linux 中运行以下命令获取电池以及它所依赖的其他信息。
|
||||
|
||||
```
|
||||
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
|
||||
native-path: BAT0
|
||||
vendor: SMP
|
||||
model: L14M4P23
|
||||
serial: 756
|
||||
power supply: yes
|
||||
updated: Monday 03 December 2018 07:56:18 PM IST (95 seconds ago)
|
||||
has history: yes
|
||||
has statistics: yes
|
||||
battery
|
||||
present: yes
|
||||
rechargeable: yes
|
||||
state: discharging
|
||||
warning-level: none
|
||||
energy: 28.23 Wh
|
||||
energy-empty: 0 Wh
|
||||
energy-full: 52.26 Wh
|
||||
energy-full-design: 60 Wh
|
||||
energy-rate: 10.714 W
|
||||
voltage: 14.819 V
|
||||
time to empty: 2.6 hours
|
||||
percentage: 54%
|
||||
capacity: 87.1%
|
||||
technology: lithium-ion
|
||||
icon-name: 'battery-good-symbolic'
|
||||
History (charge):
|
||||
1543847178 54.000 discharging
|
||||
History (rate):
|
||||
1543847178 10.714 discharging
|
||||
native-path: BAT0
|
||||
vendor: SMP
|
||||
model: L14M4P23
|
||||
serial: 756
|
||||
power supply: yes
|
||||
updated: Monday 03 December 2018 07:56:18 PM IST (95 seconds ago)
|
||||
has history: yes
|
||||
has statistics: yes
|
||||
battery
|
||||
present: yes
|
||||
rechargeable: yes
|
||||
state: discharging
|
||||
warning-level: none
|
||||
energy: 28.23 Wh
|
||||
energy-empty: 0 Wh
|
||||
energy-full: 52.26 Wh
|
||||
energy-full-design: 60 Wh
|
||||
energy-rate: 10.714 W
|
||||
voltage: 14.819 V
|
||||
time to empty: 2.6 hours
|
||||
percentage: 54%
|
||||
capacity: 87.1%
|
||||
technology: lithium-ion
|
||||
icon-name: 'battery-good-symbolic'
|
||||
History (charge):
|
||||
1543847178 54.000 discharging
|
||||
History (rate):
|
||||
1543847178 10.714 discharging
|
||||
```
|
||||
|
||||
使用下面的格式检查电池的特定信息。
|
||||
|
||||
```
|
||||
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty"
|
||||
state: discharging
|
||||
time to empty: 2.1 hours
|
||||
percentage: 43%
|
||||
state: discharging
|
||||
time to empty: 2.1 hours
|
||||
percentage: 43%
|
||||
```
|
||||
|
||||
这个类似于上面的那个,但是充电线缆的插入就相当于一个令牌,这也就是为什么下面会显示正在充电状态的原因。
|
||||
这个类似于上面的那个,但是是在充电线缆的插入后运行,这也就是为什么下面会显示正在充电状态的原因。
|
||||
|
||||
```
|
||||
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty"
|
||||
state: charging
|
||||
percentage: 41%
|
||||
state: charging
|
||||
percentage: 41%
|
||||
```
|
||||
|
||||
### 如何使用 TLP 命令检查笔记本电池状态
|
||||
|
||||
TLP 是一个自由开源多功能的命令行工具,它可以优化笔记本电池而无需修改任何配置。
|
||||
TLP 是一个自由开源的多功能的命令行工具,它可以优化笔记本电池而无需修改任何配置。
|
||||
|
||||
TLP 可以为你的 Linux 带来更高级的电源管理,而无需理解任何技术细节。TLP 默认附带了一个已经为你的电池优化好的配置,所以你可以安装好后就不再管它了。尽管 TLP 是一个可以根据你的需求高度可定制的工具。
|
||||
|
||||
TLP 在绝大多数 Linux 发行版,例如 Arch、Debian、Fedora、Gentoo、openSUSE等的官方库中都可用。使用你的 Linux 发行版的包管理安装 TLP 即可。
|
||||
TLP 在绝大多数 Linux 发行版,例如 Arch、Debian、Fedora、Gentoo、openSUSE 等的官方库中都可用。使用你的 Linux 发行版的包管理安装 TLP 即可。
|
||||
|
||||
只需要在 Linux 中运行以下命令获取电池以及其他所依赖的信息。
|
||||
|
||||
@@ -104,17 +102,17 @@ $ sudo tlp-stat -b
|
||||
--- TLP 1.1 --------------------------------------------
|
||||
|
||||
+++ Battery Status
|
||||
/sys/class/power_supply/BAT0/manufacturer = SMP
|
||||
/sys/class/power_supply/BAT0/model_name = L14M4P23
|
||||
/sys/class/power_supply/BAT0/cycle_count = (not supported)
|
||||
/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh]
|
||||
/sys/class/power_supply/BAT0/energy_full = 52260 [mWh]
|
||||
/sys/class/power_supply/BAT0/energy_now = 21950 [mWh]
|
||||
/sys/class/power_supply/BAT0/power_now = 10923 [mW]
|
||||
/sys/class/power_supply/BAT0/status = Discharging
|
||||
/sys/class/power_supply/BAT0/manufacturer = SMP
|
||||
/sys/class/power_supply/BAT0/model_name = L14M4P23
|
||||
/sys/class/power_supply/BAT0/cycle_count = (not supported)
|
||||
/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh]
|
||||
/sys/class/power_supply/BAT0/energy_full = 52260 [mWh]
|
||||
/sys/class/power_supply/BAT0/energy_now = 21950 [mWh]
|
||||
/sys/class/power_supply/BAT0/power_now = 10923 [mW]
|
||||
/sys/class/power_supply/BAT0/status = Discharging
|
||||
|
||||
Charge = 42.0 [%]
|
||||
Capacity = 87.1 [%]
|
||||
Charge = 42.0 [%]
|
||||
Capacity = 87.1 [%]
|
||||
```
|
||||
|
||||
也可以查看其他的信息。
|
||||
@@ -124,24 +122,23 @@ $ sudo tlp-stat -s
|
||||
--- TLP 1.1 --------------------------------------------
|
||||
|
||||
+++ System Info
|
||||
System = LENOVO Lenovo ideapad Y700-15ISK 80NV
|
||||
BIOS = CDCN35WW
|
||||
Release = "Manjaro Linux"
|
||||
Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64
|
||||
/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b
|
||||
Init system = systemd
|
||||
Boot mode = BIOS (CSM, Legacy)
|
||||
System = LENOVO Lenovo ideapad Y700-15ISK 80NV
|
||||
BIOS = CDCN35WW
|
||||
Release = "Manjaro Linux"
|
||||
Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64
|
||||
/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b
|
||||
Init system = systemd
|
||||
Boot mode = BIOS (CSM, Legacy)
|
||||
|
||||
+++ TLP Status
|
||||
State = enabled
|
||||
Last run = 07:16:12 IST, 4362 sec(s) ago
|
||||
Mode = battery
|
||||
Power source = battery
|
||||
```
|
||||
State = enabled
|
||||
Last run = 07:16:12 IST, 4362 sec(s) ago
|
||||
Mode = battery
|
||||
Power source = battery```
|
||||
|
||||
### 如何使用 ACPI 命令检查电池状态
|
||||
|
||||
ACPI 代表高级配置和电源接口模块,它们是不同 ACPI 部件的内核模块。它们启用特殊的 ACPI 函数向 /proc 或者 /sys 中添加信息。这些信息可以通过事件或者其他监控程序的 acpid 进行解析。
|
||||
ACPI 代表<ruby>高级配置和电源接口<rt>Advanced Configuration and Power Interface</rt></ruby>模块,它们是不同 ACPI 部件的内核模块。它们启用特殊的 ACPI 函数向 `/proc` 或者 `/sys` 中添加信息。这些信息可以通过事件或者其他监控程序的 acpid 进行解析。
|
||||
|
||||
```
|
||||
$ acpi
|
||||
@@ -179,25 +176,25 @@ Cooling 11: Processor 0 of 10
|
||||
|
||||
### 如何使用 Batstat 命令查看笔记本电池状态
|
||||
|
||||
batstat 是一个在 Linux 终端打印电池信息的命令行工具。
|
||||
`batstat` 是一个在 Linux 终端打印电池信息的命令行工具。
|
||||
|
||||
```
|
||||
Status: Charging
|
||||
Max energy: 50.00 Wh
|
||||
Energy left: 24.50 Wh
|
||||
Power Consumption: 26.40 W
|
||||
Percentage left: 49.00%
|
||||
Average power Consumption: 0.00 W
|
||||
Time elapsed: 0: 0:12 since 49.00%
|
||||
= Time ======== Percent ============================================
|
||||
0: 0: 0 49.00%
|
||||
Status: Charging
|
||||
Max energy: 50.00 Wh
|
||||
Energy left: 24.50 Wh
|
||||
Power Consumption: 26.40 W
|
||||
Percentage left: 49.00%
|
||||
Average power Consumption: 0.00 W
|
||||
Time elapsed: 0: 0:12 since 49.00%
|
||||
= Time ======== Percent ============================================
|
||||
0: 0: 0 49.00%
|
||||
```
|
||||
|
||||
### 如何使用 sysfs 文件系统查看笔记本电池状态
|
||||
|
||||
sysfs 文件系统是一个提供了内核数据结构接口的伪文件系统。sysfs 下的文件提供有关设备、内核模块、文件系统和其他内核组件的信息。
|
||||
|
||||
sysfs 文件系统通常挂载在 /sys。通常来说,它会被系统自动挂载,但是也可以使用例如 `mount -t sysfs sysfs /sys` 命令进行手动挂载。
|
||||
sysfs 文件系统通常挂载在 `/sys`。通常来说,它会被系统自动挂载,但是也可以使用例如 `mount -t sysfs sysfs /sys` 命令进行手动挂载。
|
||||
|
||||
在 sysfs 文件系统中的很多文件都是只读的,但也有一些是可写的,允许更改内核变量。为了避免冗余,符号链接被大量用于连接文件系统数中的条目。
|
||||
|
||||
@@ -216,7 +213,7 @@ L14M4P23
|
||||
cat: /sys/class/power_supply/BAT0/power: Is a directory
|
||||
27656000
|
||||
1
|
||||
756
|
||||
756
|
||||
Charging
|
||||
cat: /sys/class/power_supply/BAT0/subsystem: Is a directory
|
||||
Li-ion
|
||||
@@ -236,7 +233,7 @@ POWER_SUPPLY_CAPACITY=51
|
||||
POWER_SUPPLY_CAPACITY_LEVEL=Normal
|
||||
POWER_SUPPLY_MODEL_NAME=L14M4P23
|
||||
POWER_SUPPLY_MANUFACTURER=SMP
|
||||
POWER_SUPPLY_SERIAL_NUMBER= 756
|
||||
POWER_SUPPLY_SERIAL_NUMBER= 756
|
||||
14800000
|
||||
15840000
|
||||
```
|
||||
@@ -248,7 +245,7 @@ via: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[dianbanjiu](https://github.com/dianbanjiu)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
114
published/20181210 How to get started in AI.md
Normal file
114
published/20181210 How to get started in AI.md
Normal file
@@ -0,0 +1,114 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (qhwdw)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-10356-1.html)
|
||||
[#]: subject: (How to get started in AI)
|
||||
[#]: via: (https://opensource.com/article/18/12/how-get-started-ai)
|
||||
[#]: author: (Gordon Haff https://opensource.com/users/ghaff)
|
||||
|
||||
学习人工智能如何入门
|
||||
======
|
||||
|
||||
> 在你开始从事人工智能之前,你需要先了解人类的智能。
|
||||
|
||||

|
||||
|
||||
我曾经问过别人、也被别人问过关于学习人工智能(AI)最好的方式是什么?我应该去阅读什么书?我应该去看什么视频?后面我将讲到这些,但是,考虑到人工智能涉及很多领域,我把这个问题分开来讲可能更好理解。
|
||||
|
||||
学习人工智能很重要的一点是区别开研究方面和应用方面。Google 的 Cassie Kozyrkov 在近日于伦敦举行的 O'Reilly 人工智能会议的一个演讲中 [描述了这个区别][1],并且这是一个很好的演讲。
|
||||
|
||||
人工智能研究在本质上是学术性的,在你能够获得人工智能的某些细节之前,需要大量的跨各类学科的数学知识。这部分的人工智能关注于算法和驱动人工智能发展的工具。比如,什么样的神经网络结构能够改善视觉识别的结果?我们如何使无监督学习成为更有用的方法?我们能否找到一个更好的方法,去理解深度学习流水线是如何得出答案的?
|
||||
|
||||
另一方面,人工智能应用更多是关于使用现有工具去获取有用的结果。开源在这里发挥了一个重要的作用,那就是免费提供了易于使用的、各种语言的软件。公有云提供商也致力于提供大量的机器学习、模型、以及数据集,这使得人工智能的入门比其它的要简单的多。
|
||||
|
||||
在这个问题上我想补充一点,那就是人工智能的从业者不应该将他们的工具视为神秘地输出答案的黑匣子。至少,他们应该去了解不同技术、模型、和数据采集方法的限制和潜在偏差。只是不需要去深入研究他们工具链中每个部分的理论基础。
|
||||
|
||||
虽然在日常工作中人工智能可能并不那么重要,但理解人工智能的大量的背景知识还是很有用的。人工智能已经超越了神经网络上深度学习的狭窄范围,目前神经网络上的强化学习和监督学习已经取得重要成就。例如,人工智能经常被视为是增强(而不是替代)人类判断和决策的一种方法。但是在机器和人类之间交换信息还有其自身的缺陷。
|
||||
|
||||
有了这些背景知识,下面是的一些研究领域和资源,你可能发现会很有用。
|
||||
|
||||
### 研究人工智能
|
||||
|
||||
在很多方面,用于人工智能研究的一个资源清单,可以反映出本科(甚至是研究生)的计算机科学项目都是专注于人工智能。最主要的区别是,你起草的教学大纲比起传统的大纲更关注于跨学科。
|
||||
|
||||
你的计算机科学和数学背景知识决定了你的起点。
|
||||
|
||||
如果你的计算机科学和数据背景知识很差或已经荒芜了,但你还希望能够深入了解人工智能的基本原理,那么从一些数学课程开始将会让你受益。MOOC 上像非盈利的 [edX][2] 平台和 [Coursera][3] 上都有许多可供你选择的课程(这两个平台都对认证收费,但 edX 上所有的课程,对旁听者是全免费的)。
|
||||
|
||||
典型的基础课程包括:
|
||||
|
||||
- [MIT 的微积分课程][22],从微分开始学习
|
||||
- [线性代数][23] (德克萨斯大学)
|
||||
- 概率与统计,比如 MIT 的 [概率 —— 不确定性与数据科学][24]
|
||||
|
||||
从一个研究的角度去深入人工智能,你可能需要深入所有的这些数据领域,甚至更多。但是上面的内容应该让您在深入研究机器学习和AI之前大致了解可能是最重要的研究分支。
|
||||
|
||||
除了 MOOC 之外,像 [MIT OpenCourseWare][4] 这样的资源也提供了大量的数学和计算机科学课程的大纲和各种支持材料。
|
||||
|
||||
有了这些基础,你就可以学习更专业的人工智能课程了。吴恩达从他在斯坦福大学时教的 “AI MOOC” 就是整个在线课程领域中最早流行起来的课程之一。今天,他的 [神经网络和深度学习][5] 也是 Coursera 深度学习专业的一部分。在 edX 上也有相关的一些项目,比如,哥伦比亚大学提供的一个 [人工智能 MicroMasters][6]。
|
||||
|
||||
除了课程之外,也可以在网上找到各种范例和其它学习材料。这些包括:
|
||||
|
||||
* [神经网络和深度学习][7]
|
||||
* MIT 出版的 Ian Goodfellow、Yoshua Bengio、Aaron Courville 的《[深度学习][8]》
|
||||
|
||||
### 应用人工智能
|
||||
|
||||
人工智能应用更关注于使用可用的工具,而不是去构建新工具。对一些底层的数学,尤其是统计学的了解仍然是非常有用的 —— 甚至可以说是必需的 —— 但对这些知识的了解程度不像研究人工智能的要求那么高。
|
||||
|
||||
在这里编程是核心技能。虽然可以使用不同的编程语言去做,但是一些库和工具集 —— 比如 Python 的 [PyTorch][9],依赖于 Python,所以这是一个应该掌握的好技能。尤其是,如果你有某种程度上的编程背景,MIT 的 [计算机科学入门和使用 Python 编程][10],它是基于 MIT 的 6.001 在校课程,是一个非常好的启蒙课程。如果你编程零基础,来自密歇根大学的 Charles Severance 的 [人人学编程(Python 使用入门)][11] 是个很好的开端,它不会像 MIT 的课程那样,把你一下子扔进代码的汪洋大海。
|
||||
|
||||
[R 编程语言][12] 也是一个应该增加到你的技能库中的很有用的技能。虽然它在机器学习(ML)中使用的很少,但它在其它数据科学任务中很常见,并且经常与人工智能/机器学习和数据科学的应用实践结合在一起。例如,与组织和清理数据相关的许多任务同样适用于您最终使用的任何分析技术。像哈佛的 [数据科学认证][13] 这样的一个 MOOC 系列就是一整套课程的一个例子,这些课程介绍了如何去很好地处理数据。
|
||||
|
||||
如果你从事人工智能方面的工作,那么你很可能会遇到的另一个开源软件库就是 [TensorFlow][14]。它最初是由 Google 人工智能团队中的 Google 大脑团队的研发工程师开发的。[Google 提供了许多教程][15] 让你通过高级 Keras API 去开始使用 TensorFlow。你既可以在 Google 云上也可以在本地运行 TensorFlow。
|
||||
|
||||
通常,大的公有云提供商都提供在线数据集和易于使用的机器学习服务。但是,在你开始去 “玩” 数据集和应用之前,你需要考虑清楚,一旦开始选定一个提供商,你将被它们 “锁定” 的程度。
|
||||
|
||||
你的探索学习项目所需的数据集可以从许多不同的源获得。除了公有云提供商之外,[Kaggle][16] 是另一个受欢迎的源,总体来看,它也是一个比较好的学习源。以数字形式提供的政府数据也越来越多了。美国联邦政府的 [Data.gov][17] 声称它提供超过 300,000 个数据集。各州和地方政府也发布从餐馆健康评级到狗的名字的所有数据。
|
||||
|
||||
### 研究和应用人工智能兼而有之
|
||||
|
||||
最后我想说明的一点是,人工智能不仅是与数学、编程、数据有关的一个宽泛主题。人工智能作为一个综合体涉及到了许多其它的领域,包括心理学、语言学、博弈论、运筹学和控制系统。确实,现在有一些人工智能研究者担心,由于处理能力和大数据的结合,使得该领域过于关注最近才变得强大和有趣的少数几个技术。在了解人类如何学习和推理方面,许多长期存在的问题仍未解决。不管怎样,对这些广泛存在的问题有一个了解,将更好地让你在更广泛的背景中评估人工智能。
|
||||
|
||||
我比较喜欢的其中一个示例是杜克大学的 [人类和自治实验室][18]。这个实验室的工作涉及人机协同所面临的各种挑战,比如,如果自动化设备失效,自动驾驶仪如何设计才能让那些[“洋红色的孩子“][19] 快速取得控制。有一个基础的大脑科学课程,比如 MIT 的 [心理学导论][20],它提供了关于人类智能和机器智能之间关系的一些很有用的内容。另一个类似的课程是,MIT 电子工程与计算机科学系已故教授 Marvin Minsky 的 [心灵的社会][21]。
|
||||
|
||||
关于学习人工智能,假如说有一个最重要的挑战,那它不是原材料和工具不易获得,因为它们有如此之多。我的目标并不是给你一个全面的指导,相反,而是指出了你可以去学习的不同路径,以及为你提供一些可能的起点。祝你学习愉快!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/12/how-get-started-ai
|
||||
|
||||
作者:[Gordon Haff][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[qhwdw](https://github.com/qhwdw)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/ghaff
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.youtube.com/watch?v=RLtI7r3QUyY
|
||||
[2]: https://www.edx.org/
|
||||
[3]: https://www.coursera.org/
|
||||
[4]: https://ocw.mit.edu/index.htm
|
||||
[5]: https://www.coursera.org/learn/neural-networks-deep-learning
|
||||
[6]: https://www.edx.org/micromasters/columbiax-artificial-intelligence
|
||||
[7]: http://neuralnetworksanddeeplearning.com/
|
||||
[8]: http://www.deeplearningbook.org/
|
||||
[9]: https://pytorch.org/
|
||||
[10]: https://www.edx.org/course/introduction-to-computer-science-and-programming-using-python
|
||||
[11]: https://www.coursera.org/learn/python
|
||||
[12]: https://www.r-project.org/about.html
|
||||
[13]: https://www.edx.org/professional-certificate/harvardx-data-science
|
||||
[14]: https://www.tensorflow.org/
|
||||
[15]: https://www.tensorflow.org/tutorials/
|
||||
[16]: https://www.kaggle.com/
|
||||
[17]: https://www.data.gov/
|
||||
[18]: https://hal.pratt.duke.edu/
|
||||
[19]: https://99percentinvisible.org/episode/children-of-the-magenta-automation-paradox-pt-1/
|
||||
[20]: https://ocw.mit.edu/courses/brain-and-cognitive-sciences/9-00sc-introduction-to-psychology-fall-2011/
|
||||
[21]: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-868j-the-society-of-mind-fall-2011/
|
||||
[22]: https://www.edx.org/course/calculus-1a-differentiation
|
||||
[23]: https://www.edx.org/course/linear-algebra-foundations-to-frontiers
|
||||
[24]: https://courses.edx.org/courses/course-v1:MITx+6.431x+3T2018/course/
|
||||
@@ -1,72 +0,0 @@
|
||||
Translating by wwhio
|
||||
|
||||
|
||||
The IBM 029 Card Punch
|
||||
======
|
||||
Lines of code longer than 80 characters drive me crazy. I appreciate that this is pedantic. I’ve seen people on the internet make good arguments for why the 80-character limit ought to be respected even on our modern Retina-display screens, but those arguments hardly justify the visceral hatred I feel for even that one protruding 81st character.
|
||||
|
||||
There was once a golden era in which it was basically impossible to go over the 80-character limit. The 80-character limit was a physical reality, because there was no 81st column for an 81st character to fit in. Any programmers attempting to name a function something horrendously long and awful would discover, in a moment of delicious, slow-dawning horror, that there literally isn’t room for their whole declaration.
|
||||
|
||||
This golden era was the era of punch card programming. By the 1960s, IBM’s punch cards had set the standard and the standard was that punch cards had 80 columns. The 80-column standard survived into the teletype and dumb terminal era and from there embedded itself into the nooks and crannies of our operating systems. Today, when you launch your terminal emulator and open a new window, odds are it will be 80 characters wide, even though we now have plenty of screen real estate and tend to favor longer identifiers over inscrutable nonsense like `iswcntrl()`.
|
||||
|
||||
If questions on Quora are any indication, many people have trouble imagining what it must have been like to program computers using punch cards. I will admit that for a long time I also didn’t understand how punch card programming could have worked, because it struck me as awfully labor-intensive to punch all those holes. This was a misunderstanding; programmers never punched holes in cards the same way a train conductor does. They had card punch machines (also known as key punches), which allowed them to punch holes in cards using a typewriter-style keyboard. And card punches were hardly new technology—they were around as early as the 1890s.
|
||||
|
||||
One of the most widely used card punch machines was the IBM 029. It is perhaps the best remembered card punch today.
|
||||
|
||||
![][1]
|
||||
|
||||
The IBM 029 was released in 1964 as part of IBM’s System/360 rollout. System/360 was a family of computing systems and peripherals that would go on to dominate the mainframe computing market in the late 1960s. Like many of the other System/360 machines, the 029 was big. This was an era when the distinction between computing machinery and furniture was blurry—the 029 was not something you put on a table but an entire table in itself. The 029 improved upon its predecessor, the 026, by supporting new characters like parentheses and by generally being quieter. It had cool electric blue highlights and was flat and angular whereas the 026 had a 1940s rounded, industrial look. Another of its big selling points was that it could automatically left-pad numeric fields with zeros, demonstrating that JavaScript programmers were not the first programmers too lazy to do their own left-padding.
|
||||
|
||||
But wait, you might say—IBM released a brand-new card punch in 1964? What about that photograph of the Unix gods at Bell Labs using teletype machines in, like, 1970? Weren’t card punching machines passé by the mid- to late-1960s? Well, it might surprise you to know that the 029 was available in IBM’s catalog until as late as 1984. In fact, most programmers programmed using punch cards until well into the 1970s. This doesn’t make much sense given that there were people using teletype machines during World War II. Indeed, the teletype is almost of the same vintage as the card punch. The limiting factor, it turns out, was not the availability of teletypes but the availability of computing time. What kept people from using teletypes was that teletypes assumed an interactive, “online” model of communication with the computer. Before Unix and the invention of timesharing operating systems, your interactive session with a computer would have stopped everyone else from using it, a delay potentially costing thousands of dollars. So programmers instead wrote their programs offline using card punch machines and then fed them into mainframe computers later as batch jobs. Punch cards had the added benefit of being a cheap data store in an era where cheap, reliable data storage was hard to come by. Your programs lived in stacks of cards on your shelves rather than in files on your hard drive.
|
||||
|
||||
So what was it actually like using an IBM 029 card punch? That’s hard to explain without first taking a look at the cards themselves. A typical punch card had 12 rows and 80 columns. The bottom nine rows were the digit rows, numbered one through nine. These rows had the appropriate digit printed in each column. The top three rows, called the “zone” rows, consisted of two blank rows and usually a zero row. Row 12 was at the very top of the card, followed by row 11, then rows zero through nine. This somewhat confusing ordering meant that the top edge of the card was called the 12 edge while the bottom was called the nine edge. A corner of each card was usually clipped to make it easier to keep a stack of cards all turned around the right way.
|
||||
|
||||
![][2]
|
||||
|
||||
When they were first invented, punch cards were meant to be punched with circular holes, but IBM eventually realized that they could fit more columns on a card if the holes were narrow rectangles. Different combinations of holes in a column represented different characters. For human convenience, card punches like the 029 would print each column’s character at the top of the card at the same time as punching the necessary holes. Digits were represented by one punched hole in the appropriate digit row. Alphabetical and symbolic characters were represented by a hole in a zone row and then a combination of one or two holes in the digit rows. The letter A, for example, was represented by a hole in the 12 zone row and another hole in the one row. This was an encoding of sorts, sometimes called the Hollerith code, after the original inventor of the punch card machine. The encoding allowed for only a relatively small character set; lowercase letters, for example, were not represented. Some clever engineer today might wonder why punch cards didn’t just use a binary encoding—after all, with 12 rows, you could encode over 4000 characters. The Hollerith code was used instead because it ensured that no more than three holes ever appeared in a single column. This preserved the structural integrity of the card. A binary encoding would have entailed so many holes that the card would have fallen apart.
|
||||
|
||||
Cards came in different flavors. By the 1960s, 80 columns was the standard, but those 80 columns could be used to represent different things. The basic punch card was unlabeled, but cards meant for COBOL programming, for example, divided the 80 columns into fields. On a COBOL card, the last eight columns were reserved for an identification number, which could be used to automatically sort a stack of cards if it were dropped (apparently a perennial hazard). Another column, column seven, could be used to indicate that the statement on this card was a continuation of a statement on a previous card. This meant that if you were truly desperate you could circumvent the 80-character limit, though whether a two-card statement counts as one long line or just two is unclear. FORTRAN cards were similar but had different fields. Universities often watermarked the punch cards handed out by their computing centers, while other kinds of designs were introduced for special occasions like the [1976 bicentennial][3].
|
||||
|
||||
Ultimately the cards had to be read and understood by a computer. IBM sold a System/360 peripheral called the IBM 2540 which could read up to 1000 cards per minute. The IBM 2540 ran electrical brushes across the surface of each card which made contact with a plate behind the cards wherever there was a hole. Once read, the System/360 family of computers represented the characters on each punch card using an 8-bit encoding called EBCDIC, which stood for Extended Binary Coded Decimal Interchange Code. EBCDIC was a proper binary encoding, but it still traced its roots back to the punch card via an earlier encoding called BCDIC, a 6-bit encoding which used the low four bits to represent a punch card’s digit rows and the high two bits to represent the zone rows. Punch card programmers would typically hand their cards to the actual computer operators, who would feed the cards into the IBM 2540 and then hand the printed results back to the programmer. The programmer usually didn’t see the computer at all.
|
||||
|
||||
What the programmer did see a lot of was the card punch. The 029 was not a computer, but that doesn’t mean that it wasn’t a complicated machine. The best way to understand what it was like using the 029 is to watch [this instructional video][4] made by the computing center at the University of Michigan in 1967. I’m going to do my best to summarize it here, but if you don’t watch the video you will miss out on all the wonderful clacking and whooshing.
|
||||
|
||||
The 029 was built around a U-shaped track that the punch cards traveled along. On the right-hand side, at the top of the U, was the card hopper, which you would typically load with a fresh stack of cards before using the machine. The IBM 029 worked primarily with 80-column cards, but the card hopper could accommodate smaller cards if needed. Your punch cards would start in the card hopper, travel along the line of the U, and then end up in the stacker, at the top of the U on the left-hand side. The cards would accumulate there in the order that you punched them.
|
||||
|
||||
To turn the machine on, you flipped a switch under the desk at about the height of your knees. You then pressed the “FEED” key twice to get cards loaded into the machine. The business part of the card track, the bottom of the U, was made up of three separate stations: On the right was a kind of waiting area, in the middle was the punching station, and on the left was the reading station. Pressing the “FEED” key twice loaded one card into the punching station and one card into the waiting area behind it. A column number indicator right above the punching station told you which column you were currently punching. With every keystroke, the machine would punch the requisite holes, print the appropriate character at the top of the card, and then advance the card through the punching station by one column. If you punched all 80 columns, the card would automatically be released to the reading station and a new card would be loaded into the punching station. If you wanted this to happen before you reached the 80th column, you could press the “REL” key (for “release”).
|
||||
|
||||
The printed characters made it easy to spot a mistake. But fixing a mistake, as the University of Michigan video warns, is not as easy as whiting out the printed character at the top of the card and writing in a new one. The holes are all that the computer will read. Nor is it as easy as backspacing one space and typing in a new character. The holes have already been punched in the column, after all, and cannot be unpunched. Punching more holes will only produce an invalid combination not associated with any character. The IBM 029 did have a backspace button that moved the punched card backward one column, but the button was placed on the face of the machine instead of on the keyboard. This was probably done to discourage its use, since backspacing was so seldom what the user actually wanted to do.
|
||||
|
||||
Instead, the only way to correct a mistake was scrap the incorrect card and punch a new one. This is where the reading station came in handy. Say you made a mistake in the 68th column of a card. To fix your mistake, you could carefully repunch the first 67 columns of a new card and then punch the correct character in the 68th column. Alternatively, you could release the incorrect card to the reading station, load a new card into the punching station, and hold down the “DUP” key (for duplicate) until the column number indicator reads 68. You could then correct your mistake by punching the correct character. The reading station and the “DUP” key together allowed IBM 029 operators to easily copy the contents of one card to the next. There were all sorts of reasons to do this, but correcting mistakes was the most common.
|
||||
|
||||
The “DUP” key allowed the 029’s operator to invoke the duplicate functionality manually. But the 029 could also duplicate automatically where necessary. This was particularly useful when punched cards were used to record data rather than programs. For example, you might be using each card to record information about a single undergraduate university student. On each card, you might have a field that contains the name of that student’s residence hall. Perhaps you find yourself entering data for all the students in one residence hall at one time. In that case, you’d want the 029 to automatically copy over the previous card’s residence hall field every time you reached the first column of the field.
|
||||
|
||||
Automated behavior like this could be programmed into the 029 by using the program drum. The drum sat upright in the middle of the U above the punching station. You programmed the 029 by punching holes in a card and wrapping that card around the program drum. The punched card allowed you to specify the automatic behavior you expected from the machine at each column of the card currently in the punching station. You could specify that a column should automatically be copied from the previous card, which is how an 029 operator might more quickly enter student records. You could also specify, say, that a particular field should contain numeric or alphabetic characters, or that a given field should be left blank and skipped altogether. The program drum made it much easier to punch schematized cards where certain column ranges had special meanings. There is another [“advanced” instructional video][5] produced by the University of Michigan that covers the program drum that is worth watching, provided, of course, that you have already mastered the basics.
|
||||
|
||||
Watching either of the University of Michigan videos today, what’s surprising is how easy the card punch is to operate. Correcting mistakes is tedious, but otherwise the machine seems to be less of an obstacle than I would have expected. Moving from one card to the next is so seamless that I can imagine COBOL or FORTRAN programmers forgetting that they are creating separate cards rather than one long continuous text file. On the other hand, it’s interesting to consider how card punches, even though they were only an input tool, probably limited how early programming languages evolved. Structured programming would eventually come along and encourage people to think of entire blocks of code as one unit, but I can see how punch card programming’s emphasis on each line made structured programming hard to conceive of. It’s no wonder that punch card programmers were not the ones that decided to enclose blocks with single curly braces entirely on their own lines. How wasteful that would have seemed!
|
||||
|
||||
So even though nobody programs using punch cards anymore, every programmer ought to [try it][6] at least once—if only to understand why COBOL and FORTRAN look the way they do, or how 80 characters somehow became everybody’s favorite character limit.
|
||||
|
||||
If you enjoyed this post, more like it come out every two weeks! Follow [@TwoBitHistory][7] on Twitter or subscribe to the [RSS feed][8] to make sure you know when a new post is out.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://twobithistory.org/2018/06/23/ibm-029-card-punch.html
|
||||
|
||||
作者:[Two-Bit History][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://twobithistory.org
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://twobithistory.org/images/ibm029_front.jpg
|
||||
[2]: https://twobithistory.org/images/card.png
|
||||
[3]: http://www.jkmscott.net/data/Punched%20card%20013.jpg
|
||||
[4]: https://www.youtube.com/watch?v=kaQmAybWn-w
|
||||
[5]: https://www.youtube.com/watch?v=SWD1PwNxpoU
|
||||
[6]: http://www.masswerk.at/keypunch/
|
||||
[7]: https://twitter.com/TwoBitHistory
|
||||
[8]: https://twobithistory.org/feed.xml
|
||||
@@ -0,0 +1,130 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (5 Things Influenza Taught Me About the Evolution of the Desktop Computer)
|
||||
[#]: via: (https://blog.dxmtechsupport.com.au/5-things-influenza-taught-me-about-the-evolution-of-the-desktop-computer/)
|
||||
[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/)
|
||||
|
||||
5 Things Influenza Taught Me About the Evolution of the Desktop Computer
|
||||
======
|
||||
|
||||
The flu took me completely out of action recently. It hit me pretty hard.
|
||||
|
||||
And, as tends to happen with these things, I ended up binge watching more TV and movies in two weeks hidden under a blanket than in 2 years as a member of wider society.
|
||||
|
||||
In the most delirious moments, the vicious conspiracy of fever and painkillers gave me no choice but to stick to bad 80s action movies.
|
||||
|
||||
When I was a little more lucid, though, I got really stuck into some documentaries around the early days of desktop computing: Computerphile episodes, Silicon Cowboys, Micro Men, Youtube interviews, all sorts of stuff.
|
||||
|
||||
Here are the big things that have stuck with me from it:
|
||||
|
||||
### The Modern Computing Industry was Almost Entirely Built by Young Hobbyists
|
||||
|
||||
There was an established computing industry in the 1970s – but these companies played very little direct role in what was to come.
|
||||
|
||||
Xerox’s Palo Alto Research Centre had an important role to play in developing desktop technologies – with absolutely zero intention of ever commercialising anything. The entire thing was funded entirely from Xerox’s publicity budget.
|
||||
|
||||
But for the most part, computers were sold to universities and enterprises. These were large, expensive machines guarded by a priesthood.
|
||||
|
||||
The smallest and most affordable machines in use here were minicomputers like the DEC PDP-11. “Mini” is, of course, a relative term. These were the size of several fridges and cost several years worth of the average wage.
|
||||
|
||||
So what if you wanted a computer of your own? Were you totally stranded? Not quite. You could always buy a bunch of chips and build and program the whole damn thing yourself.
|
||||
|
||||
This had become increasingly accessible, thanks to the development of the microprocessor, which condensed the separate components of a CPU into a single chip. As the homebrew computer scene grew, hobby electronics companies started offering kits.
|
||||
|
||||
It was out of this scene that desktop computing industry actually grew – both Apple and Acorn computers were founded by hobbyists. Their first commercial products evolved from what they’d built at home.
|
||||
|
||||
Businesses that catered to the electronics hobbyist market, like Tandy and Radio Shack, were also some of the earliest to enter the market.
|
||||
|
||||
### Things Changed More Radically from ’77 – ’87 than the Next 3 Decades Combined
|
||||
|
||||
The first desktop computers were a massive leap forward in terms of bringing computing to ordinary people, they were still fairly primitive. We’re talking beeps, monochrome graphics, and a 30 minute wait to load your software from cassette tape.
|
||||
|
||||
And the only way to steer it was from the command line. It’s definitely much more accessible than building and programming your own computer from scratch, but it’s still very much in nerd territory.
|
||||
|
||||
By 1987, you’ve got most of what we’re familiar with: point and click interfaces, full colour graphics, word processors, spreadsheets, desktop publishing, music production, 3D gaming. The floppy drives had made loading times insignificant – and some machines even had hard drives.
|
||||
|
||||
Your mum could use it.
|
||||
|
||||
Things still got invented after that. The internet has obviously been a game changer. Screens are completely different. And there are any number of new languages.
|
||||
|
||||
For the most part, though, desktop computers came together in a decade. Since then, we’ve just been making better and better versions of the same thing.
|
||||
|
||||
### Bill Gates Really Was Kind of a James Bond Villain
|
||||
|
||||
Back in the ’90s, it seemed a fairly ubiquitous part of computer geek culture that Bill Gates was kind of a dick. In magazines, on bulletin boards and the early internet, it was just taken for granted that Microsoft dominated the market not with a superior product but with sharp business practices.
|
||||
|
||||
I was too young to really know if that was true, but I was happy to go along with it. It turns out that there was actually plenty of truth in that. An MS-DOS PC was hardly the best computer of the 1980s.
|
||||
|
||||
The [Acorn Archimedes][1], for instance, had the world’s fastest processor in a desktop computer, many times faster than the 386, and an operating system so far ahead of its time that Microsoft shamelessly plagiarised it 8 years for Windows 95.
|
||||
|
||||
And the Motorola 68000 series of CPUs used in many machines such as the Apple Macintosh and Commodore Amiga was also faster, and were vastly better for input/output intensive work such as graphics and sound.
|
||||
|
||||
So how did Microsoft win?
|
||||
|
||||
Well they had a head start piggybacking with IBM, who very successfully marketed the PC as a general purpose business computer. At this point, the PC was already one of the first platforms that many software developers would write for.
|
||||
|
||||
Then, as what was then known as the “IBM clone” market began and grew, Bill Gates was very aggressive about getting MS-DOS onto as many machines as possible by licensing it on very generous terms to companies like Compaq and Amstrad. This was a short term sacrifice of profits in pursuit of market share. It also helped the PC to become the affordable choice for families.
|
||||
|
||||
As this market share grew, the PC became the more obvious platform to first release your software on. This created a snowball effect, where more software support made the PC the more obvious computer to buy, increasing market share and attracting more software development.
|
||||
|
||||
In the end, it didn’t matter how much better your computer was when all the programs ran on MS-DOS.
|
||||
|
||||
### That’s Actually Totally Awesome Though
|
||||
|
||||
On first glance, Gates looks like the consummate monopolist. Actually, he did a lot more open up access to new players and foster innovation and competition.
|
||||
|
||||
In the early days of desktop computing, every manufacturer more or less maintained its own proprietary platform, with its own hardware, operating system and software support. That meant if you wanted a certain kind of computer, there was one company who built it so you bought it from them.
|
||||
|
||||
By opening the PC market to new entrants, selling the operating systems to anyone who wanted them, and setting industry standards that anyone could build to, PC makers had to compete directly on price and performance.
|
||||
|
||||
Apple still have the old model of a closed, proprietary platform, and you’ll pay vastly more for an equivalent machine – or perhaps one whose specs haven’t improved in 3 years.
|
||||
|
||||
It was also great for software developers not to have to port their software across so many platforms. I had first hand experience of this growing up – when I was really young, there were more than a dozen computers scattered around the house, because Dad was running his software business from home, and when he needed to port a program to a new machine, he needed the machine. But by the time I was finishing primary school, it was just the mac and the PC.
|
||||
|
||||
Handling the compatibility problem, throwing Windows on top of it, and offering it on machines at all price points did so much to bring computing to ordinary people.
|
||||
|
||||
At this point, I’m pretty sure someone in the audience is saying “yeah, but we could have done that open source”. Look, I like Linux for what it’s good for, but let’s be real here. Linux doesn’t really have a GUI environment – it has dozens of them, each with different quirks to learn.
|
||||
|
||||
One thing that they all have in common though is that they’re not really proper operating system environments, more just nice little boxes to stick your web browser and word processor. The moment you need to install or configure anything, guess what? It’s terminal time. Which is rather excellent if you’re that way inclined, but realistically, that’s a small fraction of humanity.
|
||||
|
||||
If Bill Gates never came up with an everyman operating system that you could run on an affordable machine, would someone else have? Probably. But he’s the guy that actually did it.
|
||||
|
||||
### Sheer Conceit Will Make Fools of Even the Most Brilliant and Powerful
|
||||
|
||||
The deal that really made Microsoft is also the deal that eventually cost IBM their entire market share of the PC platform they created and of the desktop computer market as a whole.
|
||||
|
||||
IBM were in a hurry to bring their PC to market, they built almost all of it from off-the-shelf components. Bill Gates got the meeting to talk operating systems because his mother sat on a board with. IBM offered to buy the rights to the operating system, but Gates offered instead to license it.
|
||||
|
||||
There was really no reason that IBM had to take that deal. There was nothing all that special about MS-DOS. They could have bought a similar operating system from someone else. I mean, that’s exactly what Gates did: he went to another guy in Seattle, bought the rights to a rip off of CP/M that worked on the Intel 8086, and tweaked it a bit.
|
||||
|
||||
To be fair to IBM, in 1980, it wasn’t obvious yet how crucial it would be to hold a dominant operating system. That came later. At that point, the OS was kind of just a bit of code to run the hardware – a component. It was normal for every computer manufacturer to have its own . It was normal for developers to port their products across them.
|
||||
|
||||
But it’s also just weren’t inclined to take a skinny twenty-something seriously.
|
||||
|
||||
Compaq famously reverse engineered the BIOS, and other manufacturers followed them into the market. IBM now had competition, but were still considered the market leaders and standard setters – it was their platform and everyone else was a “clone”.
|
||||
|
||||
They were still cocky.
|
||||
|
||||
So when the 386, IBM decided they weren’t in any hurry to do anything with it. The logic was that they already held the manufacturing rights to the 286, so they might as well get as much value out of that as they could. This was crazy: the 386 was more than twice as fast at the same clock speed, and it could go to much higher clock speeds.
|
||||
|
||||
Compaq jumped on it. Suddenly IBM were the slowpokes in their own market.
|
||||
|
||||
Having totally lost all control and leadership in the PC market, they fought back with a new, totally proprietary platform: the PS/2. But it was way too late. The genie was out of the bottle. This was up against the same third party support issues working against everyone other company with a closed, proprietary platform. It didn’t last.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://blog.dxmtechsupport.com.au/5-things-influenza-taught-me-about-the-evolution-of-the-desktop-computer/
|
||||
|
||||
作者:[James Mawson][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://blog.dxmtechsupport.com.au/author/james-mawson/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://blog.dxmtechsupport.com.au/playing-badass-acorn-archimedes-games-on-a-raspberry-pi/
|
||||
@@ -1,3 +1,5 @@
|
||||
WangYueScream Tanslating
|
||||
---------------
|
||||
How to Install and Use FreeDOS on VirtualBox
|
||||
======
|
||||
This step-by-step guide shows you how to install FreeDOS on VirtualBox in Linux.
|
||||
|
||||
@@ -0,0 +1,344 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Linux on the Desktop: Are We Nearly There Yet?)
|
||||
[#]: via: (https://blog.dxmtechsupport.com.au/linux-on-the-desktop-are-we-nearly-there-yet/)
|
||||
[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/)
|
||||
|
||||
Linux on the Desktop: Are We Nearly There Yet?
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
The numbers are pretty stark: Linux might be the backbone of everything from embedded devices to mainframes and super computers. But it has just a 2% share of desktops and laptops.
|
||||
|
||||
It seems the only way to get most people to even touch it is to rip away everything you recognise as Linux to rebuild it as Android.
|
||||
|
||||
Until recently, I was in the 98%. I honestly wasn’t even conflicted. I used Linux most days both for work and for hobbies – but always in the cloud or on one of those handy little project boards that are everywhere now. For my daily driver, it was Windows all the way.
|
||||
|
||||
I guess what’s kept me with Windows so long is really that it’s just been good enough as a default option that I haven’t been prompted to even think about it. Which, to be fair, is a great quality in an operating system.
|
||||
|
||||
The last time I tried a dual boot Linux/Windows setup was about 15 years ago. I was using Unix at university, and was quite attracted to the idea of free and open source software, so I decided to give it a go.
|
||||
|
||||
This was back when, if you wanted to install Linux, you went to the newsagent and bought a magazine that had a CD-ROM on the front cover. I don’t exactly remember what distro it was – probably something like Slackware or Red Hat.
|
||||
|
||||
I got it running, poked around a bit and played some of the included games, which were relatively primitive but still quite a lot of fun. After that, I wasn’t sure what I was supposed to do with it. I never managed to connect it to the internet.
|
||||
|
||||
For a number of years, I had no say in my operating system: work was buying my computer for me. I was a junior developer at a small software company that wrote for Windows machines, so it made sense that it would be a Windows laptop. That was easy to arrange because that’s how they came anyway.
|
||||
|
||||
When I left this role to work for myself, I kept doing the laptop thing; they’re so convenient when you’re renting and it’s great to work outside on a lovely day. Whenever I bought a new one, it would come with Windows on it, which was great because that’s what I used.
|
||||
|
||||
I’ve managed to avoid most of the security headaches in Windows. I got a nasty rootkit about 7 years ago and it’s all been smooth sailing since.
|
||||
|
||||
### I Only Want the Command Line When I Want it
|
||||
|
||||
A big misgiving about Linux as a main OS is that it never really seemed like it was a total GUI operating system. Whatever desktop environment you used, it was just a nice little place to run your web browser, media player, and maybe an IDE or something. As soon as it’s time to install or configure anything, you opened a terminal window.
|
||||
|
||||
I’m okay with the command line – up to a point. You definitely want it for “nerd stuff” like server configuration or deploying a website.
|
||||
|
||||
But when I’m doing “normie stuff”, I’m like most people: I’d really rather just point and click. I want my mind to be on the actual task, not on what command I need to make it happen.
|
||||
|
||||
Using a Windows laptop felt like I could have the best of both worlds. Whenever I needed a bash shell, I’d just ssh into a Linux machine and do it from there.
|
||||
|
||||
Even when I started doing web tasks that required a bash shell on my local machine, that was no problem. Microsoft [had sorted one out for me][2] and it just worked.
|
||||
|
||||
In the end, what made me install [Ubuntu Studio][3] was not any intent of replacing Windows. I had just started messing around with Linux synthesizers on my home theatre rig and was curious to see what I could do with these on an x86 machine.
|
||||
|
||||
### Linux Very Quickly Became My Daily Driver
|
||||
|
||||
The first thing to really hit me was just how fast this is. It boots quick and programs just open. This makes it so much nicer as a place to get things done.
|
||||
|
||||
So it made sense to do my web browsing and word processing here as well. Booting back into the Windows partition for that would just be a drag.
|
||||
|
||||
I guess, up until this point, I’ve just taken it for granted as an immutable fact of life that laptops gradually slow down as they age and every few years it will be time for a new one. Every time Microsoft pushes out an update, it gets a little slower.
|
||||
|
||||
So it was that my cheap 4GB machine from 2015 felt like it was nearing the end. In my head, I was already pondering firewood and a longboat.
|
||||
|
||||
I suppose when you have a monopoly operating system, nudging your customers toward buying that new machine a little bit earlier might even help move a few more licenses.
|
||||
|
||||
I accepted that for a long time. I now thoroughly resent it.
|
||||
|
||||
I mean, given what I’m doing – web browsing, word processing, editing text files, opening ssh terminals, some very light image editing – I honestly reckon a 3 year old machine should be able to keep up. These are all tasks you could do in the 90s. It’s not like I’m playing the latest Battlefield while rendering the next Star Wars.
|
||||
|
||||
With Windows 10, my laptop was struggling with simple tasks. There seemed to be no way of avoiding the expense and hassle of getting a new one. After switching to Linux, I instead spent a pittance on another 4GB memory module for the spare slot.
|
||||
|
||||
I reckon I can at least get another year of use out of this machine now. This in itself has made changing worthwhile.
|
||||
|
||||
#### A Seamless Desktop Experience
|
||||
|
||||
Ubuntu studio comes with the [xfce][4] desktop. The default design is intuitive and beautifully styled with kind of a cyberpunk motif. I haven’t felt any desire to mess with the default theme, except to change the background image.
|
||||
|
||||
I love how simple the interface is. All your programs and settings are there in the menu where you might look for them. By comparison, the Windows 10 desktop seems to always grow more elaborate and crammed with obscurities.
|
||||
|
||||
I can’t really say how much of my enthusiasm for this desktop is the ease of use and how much is simply down to how much more snappy and responsive it is – you experience these things together.
|
||||
|
||||
#### A GUI You Can Set Your Watch to (Literally)
|
||||
|
||||
So far, it seems like you could actually do a lot with this without ever going near the command line. They’ve actually gotten it to a point where you don’t need to edit text files to connect to wi-fi or set your timezone.
|
||||
|
||||
I’d be lying if I said I wasn’t using the command line a bit more. But that’s only because an Ubuntu terminal window is also a great ssh client. For a couple of weeks I was using nano as my main text editor, but I decided that a mouse is actually pretty handy for navigating and selecting text.
|
||||
|
||||
For the great mass of people who aren’t that into nerd stuff, I don’t think you would need the terminal at all.
|
||||
|
||||
#### The Same Software, Only Better
|
||||
|
||||
One thing that I think will help open Linux up to a much larger audience is the graphical front end for the package manager. It’s honestly not much different to browsing apps on my Android phone.
|
||||
|
||||
I’ve found myself using both the graphical interface and the command line to install software. The graphical interface is great for browsing, while the command line makes it super simple when you already know what you want to install.
|
||||
|
||||
That’s just me though. Most people don’t know how to run a package manager from the command line because they’ve never had to learn. The good news for them is that they’re not obliged to – you can get by fine with just the graphical interface.
|
||||
|
||||
I guess it helps that I was already using so much open source software on Windows: [Firefox][5] for web browsing, [GIMP][6] to format images for web use, [OpenOffice][7] for word processing and the occasional spreadsheet. Moving to Linux has meant still using much the same software. I’ve switched from OpenOffice to [LibreOffice][8] and have barely noticed the difference.
|
||||
|
||||
Installing software from the repositories means that it’s actually easier than on Windows, because I’m not having to look up a bunch of websites. Closed source applications like [Dropbox][9] and [Slack][10] were no hassle to install and work the same as always.
|
||||
|
||||
Thanks to the package manager, updates and patches are now automated too. On Windows, Firefox knew to update itself, but other software expected you to download and install new versions manually, and I inevitably couldn’t be bothered
|
||||
|
||||
#### Smooth Operating System Updates
|
||||
|
||||
Every so often, when you boot Ubuntu Studio, there’s a little window that politely tells you that you have some updates to install. If you decide you want to install them right now, it will take a matter of minutes. You totally get on with other things in the meantime. Of course, if you absolutely need all your system resources, you’re not forced to run it at all until you’re ready.
|
||||
|
||||
It’s a nice change. Windows updates, by contrast, show up out of nowhere like a bank robber, yelling, waving an Uzi and marching you to a big blue update screen for as long as it has to take.
|
||||
|
||||
Having not booted into my Windows partition for about a month now, I’m dreading how much of it would have piled up and how long they will take to get through. And the longer I leave it, the worse it’s going to get. So maybe I’ll just never go back.
|
||||
|
||||
All in all, I’m very happy to now use Linux as my main OS. I could almost become a Linux evangelist.
|
||||
|
||||
Except for one thing:
|
||||
|
||||
### This Was an Absolute Pig to Install
|
||||
|
||||
I’m used to an easy install with Linux. You flash an SD card or buy a VPS, you’re up and running in minutes. Running a virtual machine on your own metal can take a little longer. But not a lot.
|
||||
|
||||
Installing Linux on a partition of my laptop was a Biblical effort. It took 6 days to get it to boot.
|
||||
|
||||
How could it take so long? Well, it starts with super slow download links: 7 to 13 hours for an image. Then there was the hardware support. Most time consuming of all were the mystery problems and all the time sunk trying to diagnose and fix them.
|
||||
|
||||
What had got me interested was playing around with a bit of audio. [KXStudio][11] and [AVLinux][12] seemed to be the popular choices. Both belong to the Ubuntu/Debian family, which is the style of Linux I know.
|
||||
|
||||
KXStudio booted fine from the USB stick. But it didn’t like my wireless adapter. The fix for this seemed to involve compiling something from github. This was a bother; I needed a working wireless adapter to connect to the internet.
|
||||
|
||||
I figured it might be possible to download either a binary or the source to my Windows partition so I could install it without an internet connection. But after much searching and no clear instructions, I was stuck.
|
||||
|
||||
So I downloaded AVLinux and flashed it to a USB stick. The installer connected to the internet fine, so I installed the damn thing, only to find that the partition wouldn’t boot and then neither would the USB stick. Also, I was locked out of the UEFI.
|
||||
|
||||
I did the only logical thing you can do when you brick your work machine: panic. Then I remembered that I had a live boot restoration utility on a USB stick stashed away somewhere for precisely this occasion.
|
||||
|
||||
I then tried Ubuntu Studio 18.10. The Live Boot worked fine and even connected to the internet. So I installed it. This seemed to go off without a hitch.
|
||||
|
||||
When I tried to boot into it though, I just got a blank screen. I spent a while trying various kernel parameters like “nomodeset”, but with no luck.
|
||||
|
||||
A helpful chap on Reddit recommended I try just bog standard Ubuntu, explaining to me that it’s easy enough to swap in a low-latency kernel once it’s installed.
|
||||
|
||||
So it was that I tried Ubuntu 18.04 and 18.10, then Ubuntu Studio 18.04.. then again and again, trying slightly different settings on the installer, all in vain.
|
||||
|
||||
Having made so many attempts and spent so much time trying to get these things to work, I was – reluctantly – having to face the possibility that perhaps a distribution based on Debian just wasn’t going to work on my machine.
|
||||
|
||||
#### Fedora Jam Worked First Time
|
||||
|
||||
I had no trouble installing this distribution. The installer was super simple and it just worked on my first try.
|
||||
|
||||
It didn’t boot much faster than Windows 10, but once you were in the desktop it was quite snappy and responsive.
|
||||
|
||||
Like Ubuntu Studio, this also has a graphical front end for the package manager. It doesn’t quite have the same smooth “app store” experience though. If you’re already familiar with command line package managers, it’s pretty easy, but I’m not sure how intuitive it would be for everyone else.
|
||||
|
||||
I quickly came to discover that Fedora doesn’t have anything like the kind of software library that Ubuntu and Debian has. Or at least, that’s how it was for the software I was interested. I know that it’s often still possible to install things that aren’t in the repositories – but we’re talking ease of use here. Having to compile it yourself is not an ease of use.
|
||||
|
||||
For web browsing and word processing, this was a great operating system. But when it came to tinkering with audio, I couldn’t even get [JACK][13] to start.
|
||||
|
||||
So, after a few days, it was time to move on.
|
||||
|
||||
All in all, even though I decided Fedora wasn’t really from me, I still rate it somewhat. There’s a very good workstation there for ordinary office work. And I can well believe the claims that it’s a great development environment – especially having the entire Red Hat ecosystem downstream of your OS.
|
||||
|
||||
Still, the hunt was back on. A friend told me how much he liked using [Linux Mint][14]. I’d heard of it before, but knew little about it. I was intrigued when my friend explained it was based on Ubuntu because I’d really missed those repositories. I decided to give it a go.
|
||||
|
||||
#### Linux Mint Was Excellent
|
||||
|
||||
As near as I can tell, Linux Mint is basically just Ubuntu with a few tweaks to make it really user friendly right out of the box.
|
||||
|
||||
The big one is the desktop environment Cinnamon. This is clearly very influenced by Windows XP – a fine OS to pay tribute to in my opinion. It’s probably even more beginner-friendly than the default desktop on Ubuntu Studio.
|
||||
|
||||
I liked Linux Mint and decided to install it. The fly in the ointment though was that the dreaded wireless adapter problem had reemerged. This was a showstopper for me earlier. But by this point I was willing to consider building a temporary wireless bridge from bits and pieces I had lying around so that I could have an internet connection to try to get the right driver.
|
||||
|
||||
I never got that far though. When I tried to, the installer kept aborting when it couldn’t install the boot loader. I tried it again and again and the same thing kept happening.
|
||||
|
||||
#### Back to Ubuntu Studio
|
||||
|
||||
I decided to go back to Ubuntu Studio 18.10. I’d at least gotten this to install before, even if it booted to a blank screen. I figured that there’d be some answer to this problem somewhere, if I only looked hard enough.
|
||||
|
||||
I went and installed it again, expecting to be faced with the same problem. But this time it just worked.
|
||||
|
||||
I’m pretty glad that it worked in the end. But I still have absolutely no idea what was going wrong or what I did differently to get it to work that one last time.
|
||||
|
||||
### Should it Really Be This Difficult Even for Nerds?
|
||||
|
||||
I admit it’s the other dudes in [DXM Tech Support team][15] who really know drivers and hardware. My own skills are mostly with web stuff.
|
||||
|
||||
But still, I’d like to think I can hold my own a bit. I wrote my first code at the age of 7, I’ve worked as a software developer before, I can use a bash shell a bit, and installing weird operating systems to play 30 year old video games is my idea of a fun Sunday afternoon.
|
||||
|
||||
And I reckon the things I was juggling a few things here that might be a bit beyond any kind of mass audience: things like kernel parameters, endlessly using Gparted and efibootmgr to clean up failed installs, or building my own wireless bridge.
|
||||
|
||||
Which is all just a longer way of saying that, while I’m not exactly Linus Torvalds, I can do a thing or two here and there with a computer.
|
||||
|
||||
But what if you actually are Linus Torvalds?
|
||||
|
||||
It turns out you also think the install is disgusting:
|
||||
|
||||
<https://www.youtube.com/embed/Lqzz3Zt0DbE?feature=oembed>
|
||||
|
||||
My favourite bit here is in the middle where the Debian fan approaches the microphone for what’s meant to be a question. It was totally within her power to just ask him what the difficulty was. Instead she completely dismisses his experience and tells him he should use her favourite Linux instead.
|
||||
|
||||
I doubt that she actually meant to be that much of a dick. It’d be more that she’s such a fan of the software that it’s difficult for her to see any complaint as a genuine area for improvement. For her, it has to be a user education problem.
|
||||
|
||||
You can literally have the whole damn thing named after you and still have to put up with that crap. No wonder he can be a bit cranky.
|
||||
|
||||
### It’s the Little Things Too
|
||||
|
||||
To install Linux, you have to first run all sorts of errands to prepare your machine.
|
||||
|
||||
You need the Windows 10 Disk Management tool to resize your C partition, delve into the UEFI to change some settings, install an image writer to burn the installer image to a USB stick, that sort of thing. Often you’re presented with multiple alternatives for each of these steps.
|
||||
|
||||
My suspicion is that each of these things feels so trivial to most Linux users that it just doesn’t occur to them that it’s a real point of friction for most people.
|
||||
|
||||
Using a different tool for each task is very much in keeping with the [UNIX Philosophy][16]: any one thing should do just one thing and do it well.
|
||||
|
||||
That’s actually excellent for anyone who uses a computer to build things. You have all these lego bricks that you can arrange however makes sense. You can totally just run a Python script, grep the most relevant bits, then make the output presentable by piping it to [cowsay][17].
|
||||
|
||||
But not everyone’s ready for cowsay. Joe Average has never even heard of UEFI or partitioning and he honestly shouldn’t have to.
|
||||
|
||||
So this might be the wrong place for a rigid application of the UNIX philosophy. It greatly adds to the number of steps and that’s always going to cut down on the number of people who make it to the end.
|
||||
|
||||
Even if you’ve always been amazing at computers, I think you can probably think of something else that once seemed too difficult. For me, that was cooking Indian recipes.
|
||||
|
||||
That’s been my favourite thing to eat ever since I was a kid. But every time I looked at a recipe, it was just line after line of ingredients I didn’t really understand. So I made do with the jars and recipe kits.
|
||||
|
||||
When I finally decided to actually give it a go, I realised the ingredients list was so long because of all the spices I’d never cooked with before. It turned out that the most difficult part of using them was bringing them home from the Indian grocers. Putting them in the pan added mere seconds to the actual cooking.
|
||||
|
||||
Pretty easy, right? And yet, until I knew that, it was enough to stop me even trying, literally for years.
|
||||
|
||||
That’s how this stuff works. Every unfamiliar step you add to a process brings people closer to thinking “hmm, that’s actually a bit too involved for me” – even if those extra steps are, individually, trivial.
|
||||
|
||||
Linux does this to potential new users every day.
|
||||
|
||||
The worst thing about adding this to the installation is that it’s all front loaded right at the start of someone’s decision to try Linux. If they don’t make it through the install, then none of the rest of it comes into play.
|
||||
|
||||
### What the Install Should Look Like
|
||||
|
||||
A big part of what sucks about an unsuccessful Linux install is the amount of time you spend and the number steps you take to reach a point of failure.
|
||||
|
||||
So what would be cool is a lightweight installation tool that began with a hardware scan to give you meaningful feedback on what’s supported, what’s unsupported, and what needs further attention.
|
||||
|
||||
Then, if it’s all good to go, it could download the live boot image, burn it to a USB stick, take care of the UEFI settings and so on. Then, when you decide you want to install it, it could also take care of defragmenting and resizing the C partition.
|
||||
|
||||
It’s a thought anyway.
|
||||
|
||||
### It’s Part of a Bigger Picture
|
||||
|
||||
Addressing the install nightmare won’t make anyone who wasn’t. It’s more about boosting the [conversion rate][18] of those already interested to actual users.
|
||||
|
||||
Off the top of my head, here are some of the other big things that stop people switching:
|
||||
|
||||
* **Gaming:** A lot of the people who are most comfortable tinkering with drivers and the UEFI became that way because they’re really into playing the latest games.
|
||||
|
||||
Linux is more than ok for casual gamers. For console gamers, like me, it’s an irrelevance. But if playing the best and latest games on PC is hugely important to you, there’s no contest which platform has the best library.
|
||||
|
||||
There is an interesting push by the guys behind Steam to turn this around. There’s really no reason why Linux couldn’t be a major platform for gaming – not everyone realises that [the world’s best-selling console runs FreeBSD][19], a close cousin of Linux.
|
||||
|
||||
But even if this starts to take off, it will be a while before hardcore gamers start moving away from Windows.
|
||||
|
||||
* **Business Realities:** The difficult installation matters much less in a professionally managed IT environment. But these are also the places where a need to preserve existing systems, configurations and procedures can complicate any change. Even just migrating from one version of Windows to another has pain points.
|
||||
|
||||
On top of this, the business owners and senior managers with the final say tend to be very busy and preoccupied with a dozen other challenges, and fairly reluctant to consider anything that seems weird and unfamiliar. This makes inertia hard to shift.
|
||||
|
||||
The IT staff who might lobby for such a move would be understandably wary of blame for any difficulties that arise with Linux, in a way they won’t be for difficulties with Windows.
|
||||
|
||||
* **Home Networking:** This is one spot where Windows still is much more user friendly. Your Windows machines are generally pretty good at detecting each other on the LAN and then appearing in Windows Explorer. From there it’s pretty easy to decide what to make public using a GUI interface.
|
||||
|
||||
To do the same thing on Linux, you’re installing servers for various protocols and configuring them from the command line or in a text editor. Which is actually a lot less difficult than it first looks if you’re willing to roll your sleeves up. But, if we’re talking about going mainstream, then realistically most people will be repelled by this at a glance.
|
||||
|
||||
Compared to the difficulty of the install, I think this is a relatively minor pain point. For the average home user, so long as they can run their software and connect to the internet, they’re pretty happy. And from what I’ve both seen and heard of DIY Windows networking jobs in the workplace, part of me thinks it’s a bad idea to democratise this too far.
|
||||
|
||||
But it’s fairly normal for home users to want to copy things across a network to, say, a home theatre machine and they should be able to.
|
||||
|
||||
* **Social Proof and Branding:** Properly covering all the social proof and branding problems Linux has with ordinary people would be a lengthy article in its own right.
|
||||
|
||||
The basic idea of [social proof][20] is that humans, as social animals, are highly influenced by what everyone. That’s a highly rational instinct in a paleolithic environment, where there is an obvious drawback to A/B testing all the things that might kill you. It also suits us in our modern world that throws vastly more decisions at us than anyone has the time or mental resources.
|
||||
|
||||
But being on the wrong side of it means you’re significantly penalised simply for not already being popular.
|
||||
|
||||
On top of this, to the extent that people are aware of Linux, it’s mostly as an operating system for a technical elite.
|
||||
|
||||
|
||||
|
||||
|
||||
If you think about it, the difficulty of the install feeds back into most of these. Definitely, a larger user base would make games developers care more about the platform. Hypothetically, big titles that are properly optimised for a lighter weight operating system might run better. This is a huge drawcard for hardcore gamers.
|
||||
|
||||
Because of the legacy system issues of even fairly small businesses, one easier path into the workplace would be to get the business owner while it’s still a one person show.
|
||||
|
||||
A large number of new businesses are started by parents of young children, who are often struggling to afford everything. And a great many freelancers and solo entrepreneurs go through feast and famine periods often enough that they’ve learned to be protective of their cash buffers.
|
||||
|
||||
These are all people who’d rather get a couple more years out of a machine than be made to buy a new one. It’s a good use case for Linux. So long as they can actually install it.
|
||||
|
||||
And creating social proof means building a visibly larger use base. That will happen easier if more interested new users can install successfully.
|
||||
|
||||
### Is it Time for a Branded Linux Machine?
|
||||
|
||||
The easiest installation is one that’s already done. So perhaps it’s time for off-the-shelf Linux desktops and laptops.
|
||||
|
||||
These exist already of course. Big PC makers like Dell have a Linux lineup, while some boutique outfits are exclusively Linux in their product offering.
|
||||
|
||||
I’m picturing something kinda different though: an officially branded consumer product by one of the more user friendly distributions, pitched not tech professionals but to a mass market audience. Something that could be reviewed next to Apple and Samsung products.
|
||||
|
||||
The desktop environment is ready for a broader audience. The software library is quite excellent for anyone with ordinary computing needs – and with a good graphical front end, it’s pretty easy to find and install software. And because Linux is so much gentler on hardware requirements, there’s some real scope to offer some solid bang for back here.
|
||||
|
||||
I expect most open source developers have had no experience of and even less interest in. So what they could do is license the brand and a subdomain on their website for a given time period to someone already in the business of making and selling computers.
|
||||
|
||||
For the sake of the brand, it’d be important to license this to someone you could trust to do a good job of building a decent machine. That would take care and attention, but I don’t think it’s impossible.
|
||||
|
||||
As well as providing a small income stream to developers, and growing the user base through direct sales, the ordinary publicity effort to promote these products would help make Linux visible as a thing that the mass market could use.
|
||||
|
||||
I’m just spitballin’ really. But if anyone likes this idea, they’re welcome to it.
|
||||
|
||||
### It’s More a Matter of When than If
|
||||
|
||||
Maybe it seems like I spent a lot of this article talking down Linux on the desktop. The wider truth though is that I’ve voted with my feet. If I don’t stick with Ubuntu Studio forever, it will be because I went to a different flavour of Linux.
|
||||
|
||||
I really don’t want to go back to Windows if I can avoid it.
|
||||
|
||||
There are certainly still big obstacles to bringing Linux to a wider audience. But I can’t see why they wouldn’t be overcome.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://blog.dxmtechsupport.com.au/linux-on-the-desktop-are-we-nearly-there-yet/
|
||||
|
||||
作者:[James Mawson][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://blog.dxmtechsupport.com.au/author/james-mawson/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://blog.dxmtechsupport.com.au/wp-content/uploads/2018/11/Ubuntu-Desktop-1024x576.png
|
||||
[2]: https://docs.microsoft.com/en-us/windows/wsl/about
|
||||
[3]: https://ubuntustudio.org/
|
||||
[4]: https://www.xfce.org/
|
||||
[5]: https://www.mozilla.org/en-US/firefox/
|
||||
[6]: https://www.gimp.org/
|
||||
[7]: https://www.openoffice.org/
|
||||
[8]: https://www.libreoffice.org/
|
||||
[9]: https://www.dropbox.com/
|
||||
[10]: https://slack.com/
|
||||
[11]: https://kxstudio.linuxaudio.org/
|
||||
[12]: http://www.bandshed.net/avlinux/
|
||||
[13]: http://jackaudio.org/
|
||||
[14]: https://linuxmint.com/
|
||||
[15]: https://dxmtechsupport.com.au/about
|
||||
[16]: https://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s06.html
|
||||
[17]: https://medium.com/@jasonrigden/cowsay-is-the-most-important-unix-like-command-ever-35abdbc22b7f
|
||||
[18]: https://www.wordstream.com/conversion-rate
|
||||
[19]: http://www.extremetech.com/gaming/159476-ps4-runs-orbis-os-a-modified-version-of-freebsd-thats-similar-to-linux
|
||||
[20]: https://conversionxl.com/blog/is-social-proof-really-that-important/
|
||||
@@ -1,117 +0,0 @@
|
||||
TLDR pages: Simplified Alternative To Linux Man Pages
|
||||
============================================================
|
||||
|
||||
[][22]
|
||||
|
||||
Working on the terminal and using various commands to carry out important tasks is an indispensable part of a Linux desktop experience. This open-source operating system possesses an [abundance of commands][23] that **makes** it impossible for any user to remember all of them. To make things more complex, each command has its own set of options to bring a wider set of functionality.
|
||||
|
||||
To solve this problem, [Man Pages][12], short for manual pages, were created. First written in English, it contains tons of in-depth information about different commands. Sometimes, when you’re looking for just basic information on a command, it can also become overwhelming. To solve this issue,[ TLDR pages][13] was created.
|
||||
|
||||
_Before going ahead and knowing more about it, don’t forget to check a few more terminal tricks:_
|
||||
|
||||
* _**[Watch Star Wars in terminal ][1]**_
|
||||
|
||||
* _**[Use StackOverflow in terminal][2]**_
|
||||
|
||||
* _**[Get Weather report in terminal][3]**_
|
||||
|
||||
* _**[Access Google through terminal][4]**_
|
||||
|
||||
* [**_Use Wikipedia from command line_**][7]
|
||||
|
||||
* _**[Check Cryptocurrency Prices From Terminal][5]**_
|
||||
|
||||
* _**[Search and download torrent in terminal][6]**_
|
||||
|
||||
### What are TLDR pages?
|
||||
|
||||
The GitHub page of TLDR pages for Linux/Unix describes it as a collection of simplified and community-driven man pages. It’s an effort to make the experience of using man pages simpler with the help of practical examples. For those who don’t know, TLDR is taken from common internet slang _ Too Long Didn’t Read_ .
|
||||
|
||||
In case you wish to compare, let’s take the example of tar command. The usual man page extends over 1,000 lines. It’s an archiving utility that’s often combined with a compression method like bzip or gzip. Take a look at its man page:
|
||||
|
||||
[][14] On the other hand, TLDR pages lets you simply take a glance at the command and see how it works. Tar’s TLDR page simply looks like this and comes with some handy examples of the most common tasks you can complete with this utility:
|
||||
|
||||
[][15] Let’s take another example and show you what TLDR pages has to offer when it comes to apt:
|
||||
|
||||
[][16] Having shown you how TLDR works and makes your life easier, let’s tell you how to install it on your Linux-based operating system.
|
||||
|
||||
### How to install and use TLDR pages on Linux?
|
||||
|
||||
The most mature TLDR client is based on Node.js and you can install it easily using NPM package manager. In case Node and NPM are not available on your system, run the following command:
|
||||
|
||||
```
|
||||
sudo apt-get install nodejs
|
||||
|
||||
sudo apt-get install npm
|
||||
```
|
||||
|
||||
In case you’re using an OS other than Debian, Ubuntu, or Ubuntu’s derivatives, you can use yum, dnf, or pacman package manager as per your convenience.
|
||||
|
||||
Now, by running the following command in terminal, install TLDR client on your Linux machine:
|
||||
|
||||
```
|
||||
sudo npm install -g tldr
|
||||
```
|
||||
|
||||
Once you’ve installed this terminal utility, it would be a good idea to update its cache before trying it out. To do so, run the following command:
|
||||
|
||||
```
|
||||
tldr --update
|
||||
```
|
||||
|
||||
After doing this, feel free to read the TLDR page of any Linux command. To do so, simply type:
|
||||
|
||||
```
|
||||
tldr <commandname>
|
||||
```
|
||||
|
||||
[][17]
|
||||
|
||||
You can also run the following help command to see all different parameters that can be used with TLDR to get the desired output. As usual, this help page is also accompanied with examples.
|
||||
|
||||
### TLDR web, Android, and iOS versions
|
||||
|
||||
You would be pleasantly surprised to know that TLDR pages isn’t limited to your Linux desktop. Instead, it can also be used in your web browser, which can be accessed from any machine.
|
||||
|
||||
To use TLDR web version, visit [tldr.ostera.io][18] and perform the required search operation.
|
||||
|
||||
Alternatively, you can also download the [iOS][19] and [Android][20] apps and keep learning new commands on the go.
|
||||
|
||||
[][21]
|
||||
|
||||
Did you find this cool Linux terminal trick interesting? Do give it a try and let us know your feedback.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fossbytes.com/tldr-pages-linux-man-pages-alternative/
|
||||
|
||||
作者:[Adarsh Verma ][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://fossbytes.com/author/adarsh/
|
||||
[1]:https://fossbytes.com/watch-star-wars-command-prompt-via-telnet/
|
||||
[2]:https://fossbytes.com/use-stackoverflow-linux-terminal-mac/
|
||||
[3]:https://fossbytes.com/single-command-curl-wttr-terminal-weather-report/
|
||||
[4]:https://fossbytes.com/how-to-google-search-in-command-line-using-googler/
|
||||
[5]:https://fossbytes.com/check-bitcoin-cryptocurrency-prices-command-line-coinmon/
|
||||
[6]:https://fossbytes.com/review-torrench-download-torrents-using-terminal-linux/
|
||||
[7]:https://fossbytes.com/use-wikipedia-termnianl-wikit/
|
||||
[8]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Ffossbytes.com%2Ftldr-pages-linux-man-pages-alternative%2F
|
||||
[9]:https://twitter.com/intent/tweet?text=TLDR+pages%3A+Simplified+Alternative+To+Linux+Man+Pages&url=https%3A%2F%2Ffossbytes.com%2Ftldr-pages-linux-man-pages-alternative%2F&via=%40fossbytes14
|
||||
[10]:http://plus.google.com/share?url=https://fossbytes.com/tldr-pages-linux-man-pages-alternative/
|
||||
[11]:http://pinterest.com/pin/create/button/?url=https://fossbytes.com/tldr-pages-linux-man-pages-alternative/&media=https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-ubuntu.jpg
|
||||
[12]:https://fossbytes.com/linux-lexicon-man-pages-navigation/
|
||||
[13]:https://github.com/tldr-pages/tldr
|
||||
[14]:https://fossbytes.com/wp-content/uploads/2017/11/tar-man-page.jpg
|
||||
[15]:https://fossbytes.com/wp-content/uploads/2017/11/tar-tldr-page.jpg
|
||||
[16]:https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-of-apt.jpg
|
||||
[17]:https://fossbytes.com/wp-content/uploads/2017/11/tldr-kill-command.jpg
|
||||
[18]:https://tldr.ostera.io/
|
||||
[19]:https://itunes.apple.com/us/app/tldt-pages/id1071725095?ls=1&mt=8
|
||||
[20]:https://play.google.com/store/apps/details?id=io.github.hidroh.tldroid
|
||||
[21]:https://fossbytes.com/wp-content/uploads/2017/11/tldr-app-ios.jpg
|
||||
[22]:https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-ubuntu.jpg
|
||||
[23]:https://fossbytes.com/a-z-list-linux-command-line-reference/
|
||||
@@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (jlztan)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers)
|
||||
|
||||
@@ -1,237 +0,0 @@
|
||||
translating by lixinyuxx
|
||||
|
||||
My personal Email setup - Notmuch, mbsync, postfix and dovecot
|
||||
======
|
||||
I've been using personal email setup for quite long and have not documented it anywhere. Recently when I changed my laptop (a post is pending about it) I got lost trying to recreate my local mail setup. So this post is a self documentation so that I don't have to struggle again to get it right.
|
||||
|
||||
### Server Side
|
||||
|
||||
I run my own mail server and I use postfix as SMTP server and Dovecot for the IMAP purpose. I'm not going into detail of setting those up as my setup was mostly done by using scripts created by Jonas for Redpill infrastructure. What redpill is?. (In jonas's own words)
|
||||
|
||||
> <jonas> Redpill is a concept - a way to setup Debian hosts to collaborate across organisations <jonas> I develop the concept, and use it for the first ever Redpill network-of-networks redpill.dk, involving my own network (jones.dk), my main client's network (homebase.dk), a network in Germany including Skolelinux Germany (free-owl.de), and Vasudev's network (copyninja.info)
|
||||
|
||||
Along with that I have a dovecot sieve filtering to classify on high level mails into various folders depending on from where they originate. All the rules live in the ~/dovecot.sieve file under every account which has a mail address.
|
||||
|
||||
Again I'm not going into detail of how to set these things up, as its not goal of my this post.
|
||||
|
||||
### On my Laptop
|
||||
|
||||
On my laptop I've following 4 parts setup
|
||||
|
||||
1. Mail syncing : Done using mbsync command
|
||||
2. Classification: Done using notmuch
|
||||
3. Reading: Done using notmuch-emacs
|
||||
4. Mail sending: Done using postfix running as relay server and SMTP client.
|
||||
|
||||
|
||||
|
||||
### Mail Syncing
|
||||
|
||||
Mail syncing is done using mbsync tool, I was previously user of offlineimap and recently switched to mbsync as I felt it more lighter and simpler to configure than offlineimap. mbsync command is provided by package isync.
|
||||
|
||||
Configuration file is ~/.mbsyncrc. Below is my sample content with some private things redacted.
|
||||
|
||||
```
|
||||
IMAPAccount copyninja
|
||||
Host imap.copyninja.info
|
||||
User vasudev
|
||||
PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg"
|
||||
SSLType IMAPS
|
||||
SSLVersion TLSv1.2
|
||||
CertificateFile /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
|
||||
IMAPAccount gmail-kamathvasudev
|
||||
Host imap.gmail.com
|
||||
User kamathvasudev@gmail.com
|
||||
PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg"
|
||||
SSLType IMAPS
|
||||
SSLVersion TLSv1.2
|
||||
CertificateFile /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
IMAPStore copyninja-remote
|
||||
Account copyninja
|
||||
|
||||
IMAPStore gmail-kamathvasudev-remote
|
||||
Account gmail-kamathvasudev
|
||||
|
||||
MaildirStore copyninja-local
|
||||
Path ~/Mail/vasudev-copyninja.info/
|
||||
Inbox ~/Mail/vasudev-copyninja.info/INBOX
|
||||
|
||||
MaildirStore gmail-kamathvasudev-local
|
||||
Path ~/Mail/Gmail-1/
|
||||
Inbox ~/Mail/Gmail-1/INBOX
|
||||
|
||||
Channel copyninja
|
||||
Master :copyninja-remote:
|
||||
Slave :copyninja-local:
|
||||
Patterns *
|
||||
Create Both
|
||||
SyncState *
|
||||
Sync All
|
||||
|
||||
Channel gmail-kamathvasudev
|
||||
Master :gmail-kamathvasudev-remote:
|
||||
Slave :gmail-kamathvasudev-local:
|
||||
# Exclude everything under the internal [Gmail] folder, except the interesting folders
|
||||
Patterns * ![Gmail]*
|
||||
Create Both
|
||||
SyncState *
|
||||
Sync All
|
||||
```
|
||||
|
||||
Explanation for some interesting part in above configuration. One is the PassCmd which allows you to provide shell command to obtain the password for the account. This avoids filling in the password in configuration file. I'm using symmetric encryption with gpg and storing password some where on my disk. Which is of course just safe guarded by Unix ACL.
|
||||
|
||||
I actually wanted to use my public key to encrypt the file but unlocking the file when script is run in background or via systemd looks difficult (or looked nearly impossible). If you have better suggestion I'm all ears :-).
|
||||
|
||||
Next instruction part is Patterns. This allows you to selectively sync mail from your mail server. This was really helpful for me to exclude all crappy [Gmail]/ folders.
|
||||
|
||||
### Mail Classification
|
||||
|
||||
Once mail is locally on your device, we need a way to read the mails easily in a mail reader. My original setup was serving synced Maildir using local dovecot instance and read it in Gnus. This setup was bit of a over kill with all server software setups but inability of Gnus to not cope well with Maildir format this was best way to do it. This setup also has a disadvantage, that is searching a mail quickly when you have huge pile of mail to go through. This is where notmuch comes into picture.
|
||||
|
||||
notmuch allows me to easily index through Gigabytes of my mail archives and get what I need very easily. I've created a small script which combines executing of mbsync and notmuch execution. I tag mails based on the Maildirs which are actually created on server side using dovecot sieve. Below is my full shell script which is doing task of syncing classification and deleting of spams.
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
MBSYNC=$(pgrep mbsync)
|
||||
NOTMUCH=$(pgrep notmuch)
|
||||
|
||||
if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then
|
||||
echo "Already running one instance of mail-sync. Exiting..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Deleting messages tagged as *deleted*"
|
||||
notmuch search --format=text0 --output=files tag:deleted |xargs -0 --no-run-if-empty rm -v
|
||||
|
||||
echo "Moving spam to Spam folder"
|
||||
notmuch search --format=text0 --output=files tag:Spam and \
|
||||
to:vasudev@copyninja.info | \
|
||||
xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur
|
||||
notmuch search --format=text0 --output=files tag:Spam and
|
||||
to:vasudev-debian@copyninja.info | \
|
||||
xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur
|
||||
|
||||
|
||||
MDIR="vasudev-copyninja.info vasudev-debian Gmail-1"
|
||||
mbsync -Va
|
||||
notmuch new
|
||||
|
||||
for mdir in $MDIR; do
|
||||
echo "Processing $mdir"
|
||||
for fdir in $(ls -d /home/vasudev/Mail/$mdir/*); do
|
||||
if [ $(basename $fdir) != "INBOX" ]; then
|
||||
echo "Tagging for $(basename $fdir)"
|
||||
notmuch tag +$(basename $fdir) -inbox -- folder:$mdir/$(basename $fdir)
|
||||
fi
|
||||
done
|
||||
done
|
||||
```
|
||||
|
||||
So before running mbsync I search for all mails tagged as deleted and delete them from system. Next I look for mails tagged as Spam on both my accounts and move it to Spam folder. Yeah you got it right these are mails escaping the spam filter and landing in my inbox and personally marked as Spam.
|
||||
|
||||
After running mbsync I tag mails based on their folder (searching string folder:). This allows me easily get contents of lets say a mailing list without remembering the list address.
|
||||
|
||||
### Reading Mails
|
||||
|
||||
Now that we have synced and classified mail its time to setup the reading part. I use notmuch-emacs interface to read the mails. I use Spacemacs flavor of emacs so I took some time to write down the a private layer which brings together all my keybindings and classification in one place and does not clutter my entire .spacemacs file. You can find the code for my private layer in [notmuch-emacs-layer repository][1]
|
||||
|
||||
### Sending Mails
|
||||
|
||||
Well its not sufficient that if we can read mails, we need to be able to reply to mail. And this was the slightly tricky part where I recently got lost and had to write this post so that I don't forget it again. (And of course don't have to refer some outdated posts on web).
|
||||
|
||||
My setup to send mails is using postfix as SMTP client with my own SMTP server as relayhost for it. The problem of relaying is it's not for the hosts with dynamic IP. There are couple of ways to allow hosts with dynamic IP to use relay servers, one is put the IP address from where mail will originate into my_network or second use SASL authentication.
|
||||
|
||||
My preferred way is use of SASL authentication. For this I first had to create a separate account one for each machine which is going to relay the mails to my main server. Idea is to not use my primary account for SASL authentication. (Originally I was using primary account, but Jonas gave this idea of account per road runner).
|
||||
```
|
||||
adduser <hostname>_relay
|
||||
|
||||
```
|
||||
|
||||
Here replace <hostname> with name of your laptop/desktop or whatever you are using. Now we need to adjust postfix to act as relaying server. So add following lines to postfix configuration
|
||||
```
|
||||
# SASL authentication
|
||||
smtp_sasl_auth_enable = yes
|
||||
smtp_tls_security_level = encrypt
|
||||
smtp_sasl_tls_security_options = noanonymous
|
||||
relayhost = [smtp.copyninja.info]:submission
|
||||
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
|
||||
```
|
||||
|
||||
So here relayhost is the server name which your postfix instance will be using to relay mails forward into internet. :submission part tells postfix to forward mail on to port 587 (secure). smtp_sasl_tls_security_options is set to disallow anonymous connection. This is must so that relay server trusts your mobile host and agrees to forward the mail for you.
|
||||
|
||||
/etc/postfix/sasl_passwd is the file where you need to store password for account to be used for SASL authentication with server. Put following content into it.
|
||||
```
|
||||
[smtp.example.com]:submission user:password
|
||||
|
||||
```
|
||||
|
||||
Replace smtp.example.com with your SMTP server name which you have put in relayhost configuration. Replace user with <hostname>_relay user you created and its password.
|
||||
|
||||
To secure the sasl_passwd file and create a hash of it for postfix use following command.
|
||||
```
|
||||
chown root:root /etc/postfix/sasl_passwd
|
||||
chmod 0600 /etc/postfix/sasl_passwd
|
||||
postmap /etc/postfix/sasl_passwd
|
||||
```
|
||||
|
||||
The last command will create /etc/postfix/sasl_passwd.db file which is hash of your file /etc/postfix/sasl_passwd with same owner and permission. Now reload the postfix and check if mail makes out of your system using mail command.
|
||||
|
||||
### Bonus Part
|
||||
|
||||
Well since I've a script created above bringing together mail syncing and classification. I went ahead and created a systemd timer to periodically sync mails in the background. In my case every 10 minutes. Below is mailsync.timer file.
|
||||
```
|
||||
[Unit]
|
||||
Description=Check Mail Every 10 minutes
|
||||
RefuseManualStart=no
|
||||
RefuseManualStop=no
|
||||
|
||||
[Timer]
|
||||
Persistent=false
|
||||
OnBootSec=5min
|
||||
OnUnitActiveSec=10min
|
||||
Unit=mailsync.service
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
```
|
||||
|
||||
Below is mailsync.service which is needed by mailsync.timer to execute our scripts.
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Check Mail
|
||||
RefuseManualStart=no
|
||||
RefuseManualStop=yes
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/bin/mail-sync
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
```
|
||||
|
||||
Put these files under /etc/systemd/user and run below command to enable them.
|
||||
```
|
||||
systemctl enable --user mailsync.timer
|
||||
systemctl enable --user mailsync.service
|
||||
systemctl start --user mailsync.timer
|
||||
```
|
||||
|
||||
So that's how I've sync and send mail from my system. I came to know about afew from Jonas Smedegaard who also proof read this post. So next step I will try to improve my notmuch configuration using afew and of course a post will follow after that :-).
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://copyninja.info/blog/email_setup.html
|
||||
|
||||
作者:[copyninja][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://copyninja.info
|
||||
[1]:https://source.copyninja.info/notmuch-emacs-layer.git/
|
||||
@@ -0,0 +1,209 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Streaming Australian TV Channels to a Raspberry Pi)
|
||||
[#]: via: (https://blog.dxmtechsupport.com.au/streaming-australian-tv-channels-to-a-raspberry-pi/)
|
||||
[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/)
|
||||
|
||||
Streaming Australian TV Channels to a Raspberry Pi
|
||||
======
|
||||
|
||||
If you’re anything like me, it’s been years since you’ve even thought about hooking an antenna to your television. With so much of the good stuff available by streaming and download, it’s easy go a very long time without even thinking about free-to-air TV.
|
||||
|
||||
But every now and again, something comes up – perhaps the cricket, news and current affairs shows, the FIFA World Cup – where the easiest thing would be to just chuck on the telly.
|
||||
|
||||
When I first started tinkering with the Raspberry Pi as a gaming and media centre platform, the standard advice for watching broadcast TV always seemed to involve an antenna and a USB TV tuner.
|
||||
|
||||
Which I guess is fine if you can be arsed.
|
||||
|
||||
But what if you utterly can’t?
|
||||
|
||||
What if you bitterly resent the idea of more clutter, more cords to add to the mess, more stuff to buy? What if every USB port is precious and jealously guarded for your keyboard, mouse, game controllers and removable storage? What if the wall port for your roof antenna is in a different room?
|
||||
|
||||
That’s all a bit of a hassle for a thing you might use only a few times a year.
|
||||
|
||||
In 2018, shouldn’t we just be able to stream free TV from the internet?
|
||||
|
||||
It turns out that, yes, we can access legal and high quality TV streams from any Australian IP using [Freeview][1]. And thanks to a cool Kodi Add-on by [Matt Huisman][2], it’s now really easy to access this service from a Raspberry Pi.
|
||||
|
||||
I’ve tested this to work on a Model 3 B+ running Retropie 4.4 and Kodi 17.6. But it should work similarly for other models and operating systems, so long as you’re using a reasonably up-to-date version of Kodi.
|
||||
|
||||
Let’s jump right in.
|
||||
|
||||
### If You Already Have Kodi Installed
|
||||
|
||||
If you’re already using your Raspberry Pi to watch movies and TV shows, there’s a good chance you’ve already installed Kodi.
|
||||
|
||||
Most Raspberry Pi operating systems intended for media centre use – such as OSMC or Xbian – come with Kodi installed by default.
|
||||
|
||||
It’s fairly easy to get running on other Linux operating systems, and you might have already installed it there too.
|
||||
|
||||
If your version of Kodi is more than a year or so old, it might be an idea to update it. The following instructions are written for the interface on Kodi 17 (Krypton).
|
||||
|
||||
You can do that by typing the following commands at the command line:
|
||||
|
||||
```
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade
|
||||
```
|
||||
|
||||
And now you can skip ahead to the next section.
|
||||
|
||||
### Installing Kodi
|
||||
|
||||
Installing Kodi on Retropie and other versions of Raspbian is fairly simple. Other Linux operating systems should be able to run it, perhaps with a bit of coaxing.
|
||||
|
||||
You will need to be connected to the internet to install it.
|
||||
|
||||
If you’re using something, such as Risc OS – you probably can’t install kodi. You will need to either swap in another SD card, or use a boot loader to boot into a media centre OS for your TV viewing.
|
||||
|
||||
#### Installing Kodi on Retropie
|
||||
|
||||
It’s really easy to install Kodi using the Retropie menu system.
|
||||
|
||||
Here’s how:
|
||||
|
||||
1. Navigate to the Retropie main screen – that’s that horizontal menu where you can scroll left and right through all your different consoles
|
||||
2. Select “Retropie”
|
||||
3. Select “Retropie setup”
|
||||
4. Select “Manage Packages”
|
||||
5. Select “Manage Optional Packages”
|
||||
6. Scroll down and select “Kodi”
|
||||
7. Select “Install from Binary”
|
||||
|
||||
|
||||
|
||||
This will take a minute or two to install. Once it’s installed, you can exit out of the Retropie Setup screen. When you next restart Retropie, you will see Kodi under the “Ports” section of the Retropie main screen.
|
||||
|
||||
#### Installing Kodi on Raspbian
|
||||
|
||||
If you’re running Raspbian without Retropie. But that’s okay, because it’s pretty easy to do it from the command line
|
||||
|
||||
Just type:
|
||||
|
||||
```
|
||||
sudo apt-get update
|
||||
sudo apt-get install kodi
|
||||
```
|
||||
|
||||
At this point you have a vanilla installation of Kodi. You can run it by typing:
|
||||
|
||||
```
|
||||
kodi
|
||||
```
|
||||
|
||||
It’s possible to delve a lot further into setting up Kodi from the command line. Check out [this guide][3] if you’re interested.
|
||||
|
||||
If not, what you’ve just installed will work just fine.
|
||||
|
||||
#### Installing Kodi on Other Versions of Linux
|
||||
|
||||
If you’re using a different flavour of Linux, such as Pidora or Arch Linux ARM, then the above might or might not work – I’m not really sure, because I don’t really use these operating systems.
|
||||
|
||||
If you get stuck, it might be worth a look at the [how-to guide][4] on the Kodi wiki.
|
||||
|
||||
#### Dual Booting a Media Centre OS
|
||||
|
||||
If your operating system of choice isn’t suitable for Kodi – or is just too confusing and difficult to figure out – it might be easiest to use a boot loader for multiple operating systems on the one SD card.
|
||||
|
||||
You can set this up using an OS installer like [PINN][5].
|
||||
|
||||
Using PINN, you can install a media centre OS like [OSMC][6] to use Kodi – it will be installed with the operating system – and then your preferred OS for your other uses.
|
||||
|
||||
It’s even possible to [move your existing OS over][7].
|
||||
|
||||
### Adding Australian TV Channels to Kodi
|
||||
|
||||
With Kodi installed and running, you’ve got a pretty good media player for the files on your network and hard drive.
|
||||
|
||||
But we need to install an add-on if we want to use it to chuck on the telly. This only takes a minute or so.
|
||||
|
||||
#### Installing Matt Huisman’s Kodi Repository
|
||||
|
||||
Ready? Let’s get started.
|
||||
|
||||
1. Open Kodi
|
||||
2. Click the cog icon at the top left to enter the settings
|
||||
3. Click “System Settings”
|
||||
4. Select “Add-ons”
|
||||
5. Make sure that “Unknown Sources” is enabled
|
||||
6. Right click anywhere on the screen to navigate back to the settings menu
|
||||
7. Click “File Manager”
|
||||
8. Click “Add Source”
|
||||
9. Double-click “Add Source”
|
||||
10. Select “<None>”
|
||||
11. Type in exactly **<http://k.mjh.nz>**
|
||||
12. Select “OK”
|
||||
13. Click the text input underneath the label “Enter a name for this media source.”
|
||||
14. Type in exactly **MJH**
|
||||
15. Click “OK”
|
||||
16. Right click twice anywhere on the screen to navigate back to the main menu
|
||||
17. Select “Add-ons”
|
||||
18. Click “My Add-ons”
|
||||
19. Click “..”
|
||||
20. Click “Install from zip file”
|
||||
21. Click “MJH”
|
||||
22. Select “repository.matthuisman.zip”
|
||||
|
||||
|
||||
|
||||
The repository is now installing.
|
||||
|
||||
If you get stuck with any of this, here’s a video from Matt that starts by installing the repository.
|
||||
|
||||
<https://www.youtube.com/embed/LWYg6WS1WoU?feature=oembed>
|
||||
|
||||
#### Installing the Freeview Australia Add-On
|
||||
|
||||
We’re nearly there! Just a few more steps.
|
||||
|
||||
1. Right click anywhere on the screen a couple of times to navigate back to the main menu
|
||||
2. Select “Add-ons”
|
||||
3. Click “My add-ons”
|
||||
4. Click “..”
|
||||
5. Click “Install from repository”
|
||||
6. Click “MattHuisman.nz Repository”
|
||||
7. Click “Video add-ons”
|
||||
8. Click “AU Freeview”
|
||||
9. Click “Install”
|
||||
|
||||
|
||||
|
||||
You can now have every free-to-air TV channel in your Add-ons main menu item.
|
||||
|
||||
### Watching TV
|
||||
|
||||
When you want to chuck the telly on, all you need to do is click “AU Freeview” in the Add-ons main menu item. This will give you a list of channels to browse through and select.
|
||||
|
||||
If you want, you can also add individual channels to your Favourites menu by right clicking them and selecting “Add to favourites”.
|
||||
|
||||
By default you will be watching Melbourne television. You can change the region by right clicking on “AU Freeview” and clicking “settings”.
|
||||
|
||||
When you first tune in, it sometimes jumps a bit for a few seconds, but after that it’s pretty smooth.
|
||||
|
||||
After spending a few minutes with this, you’ll quickly realise that free-to-air TV hasn’t improved in the years since you last looked at. Unfortunately, I don’t think there’s a fix for that.
|
||||
|
||||
But at least it’s there now for when you want it.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://blog.dxmtechsupport.com.au/streaming-australian-tv-channels-to-a-raspberry-pi/
|
||||
|
||||
作者:[James Mawson][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://blog.dxmtechsupport.com.au/author/james-mawson/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: http://www.freeview.com.au/
|
||||
[2]: https://www.matthuisman.nz/
|
||||
[3]: https://www.raspberrypi.org/forums/viewtopic.php?t=192499
|
||||
[4]: https://kodi.wiki/view/HOW-TO:Install_Kodi_for_Linux
|
||||
[5]: https://github.com/procount/pinn
|
||||
[6]: https://osmc.tv/
|
||||
[7]: https://github.com/procount/pinn/wiki/How-to-Create-a-Multi-Boot-SD-card-out-of-2-existing-OSes-using-PINN
|
||||
@@ -0,0 +1,539 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Playing Badass Acorn Archimedes Games on a Raspberry Pi)
|
||||
[#]: via: (https://blog.dxmtechsupport.com.au/playing-badass-acorn-archimedes-games-on-a-raspberry-pi/)
|
||||
[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/)
|
||||
|
||||
Playing Badass Acorn Archimedes Games on a Raspberry Pi
|
||||
======
|
||||
|
||||
![Cannon Fodder on the Raspberry Pi][1]
|
||||
|
||||
The Acorn Archimedes was an excellent machine and years ahead of its time.
|
||||
|
||||
Debuting in 1987, it featured a point and click graphic interface not so different to Windows 95, 32 bit processing, and enough 3D graphics power to portal you to a new decade.
|
||||
|
||||
These days, it’s best remembered for launching the Acorn RISC Machines processor. ARM processors went on to rule the world. You almost certainly keep one in your pocket.
|
||||
|
||||
What’s less well appreciated is that the Archimedes was rad for games. For a few years, it was the most powerful desktop in the world and developers were eager to show what they could do with it.
|
||||
|
||||
But with such power came a great price tag. The Archimedes was never going to be in as many homes to make as many memories as Sega or Nintendo.
|
||||
|
||||
But now, the Raspberry Pi’s ARM chip makes it cheap and easy to play these games on the same operating system and CPU architecture they were written for.
|
||||
|
||||
Even better, the rights holders to much of this machine’s gaming catalogue have been generous enough to allow hobbyists to legally download their work for free.
|
||||
|
||||
This is a cheap and easy project. In fact, if you already run a Raspberry Pi home theatre or retro gaming rig, all you really need is a spare SD card.
|
||||
|
||||
### Introduction
|
||||
|
||||
None of this will be on the exam, so if you already know the story of the Acorn Archimedes – or just want to get straight into gaming – feel free to skip ahead to the next section.
|
||||
|
||||
But if you’re wondering what we’re even talking about, here it is:
|
||||
|
||||
#### What on Earth is an Acorn Archimedes?
|
||||
|
||||
Me and Acorn computers go way back.
|
||||
|
||||
For the earliest part of my life that I can remember, Dad ran his business from home, writing timetabling software for schools. This was the early 80s, before the desktop computer market had been whittled down to Mac and PC. There were Amstrad CPCs, Sinclairs, Commodores, Ataris, TRSs, the list goes on.
|
||||
|
||||
They all had their operating systems and ran their own software. If you wanted to port your software over to a new platform, you had to buy it.
|
||||
|
||||
So, at a time when it was somewhat novel for a family to have even one computer, we had about a dozen, many of them already quite antique. There was a Microbee, an Apple IIc, an IBM XT, all sorts of stuff.
|
||||
|
||||
The ones Dad liked most though were the BBC machines by [Acorn Computers][2]. He had several. There was a Model B, a Master 128 and a Master Compact.
|
||||
|
||||
They were named that way because the British Broadcasting Corporation were developing a course to teach children how to program and they needed. Because of this educational focus, they’d found their way into a lot of schools – exactly the market he was selling to.
|
||||
|
||||
At some point, I figured out you could play games on these things. I was straight away hooked like it was crack. All I cared about was games games games. It must have taken me several years to figure out that computers had a different use, because I can vividly recall how annoyed I was to be starting school while Dad got to stay home and play games all day.
|
||||
|
||||
On my 7th birthday I got a second hand BBC Master Compact all of my own. This was probably as much to keep me away from his work computers as it was to introduce me to computing. I started learning to program in BASIC and Logo. I also played epic amounts of space shooters, 2D platformers and adventure games.
|
||||
|
||||
Being obsessed with these things, I tagged along to the local BBC Users Group. This was a monthly get-together where enthusiasts would discuss what was new, bring their machines to show off what they’re doing and engage in some casual software piracy. Back before internet forums and torrents, people did this in person.
|
||||
|
||||
This was where I first saw an Archimedes. I can’t really remember the exact year or the exact model – I just remember my jaw dropping to the floor at the 3D graphics and the 8 channel stereo sound. It would be about a decade before I saw anything similar on a gaming console.
|
||||
|
||||
<https://www.youtube.com/embed/CsqsX2Nlfeg?feature=oembed>
|
||||
|
||||
#### The Birth of a Legend
|
||||
|
||||
Looking back, this has very good claim to be the first modern desktop computer. It was a 32-bit machine, an interface that looks more like what we use today than anything built in the 1980s, a palette of 4096 colours, and more horsepower than a lot of people knew what to do with.
|
||||
|
||||
Now, don’t get me wrong: the 8-bit BBC machines were loads of fun and great for what they were – but what they were was fairly primitive. It was basically just a big box you typed commands on to make it beep and stuff. In theory it had 8 colours, but when you saw one in the wild it was usually hooked up to a monochrome screen and you didn’t feel like you were missing out on too much because of it.
|
||||
|
||||
In 1984, Apple launched their Macintosh, featuring the first Graphical User Interface available on the mass market. Acorn knew they’d need a point and click graphic interface to stay in the game. And they knew the aging MOS 6502 they’d used in all their machines so far was just not going to be the CPU of the future.
|
||||
|
||||
So, what to replace it with?
|
||||
|
||||
The Acorn engineers looked at the available processors and found that none of them could quite do what they want. They decided to build their own – and it would be radically different.
|
||||
|
||||
Up until that point, chip makers took a bit of a Swiss Army Knife approach to processor design – to compete, you added more and more useful stuff to the instruction set.
|
||||
|
||||
There was a certain logic to this – hardware could be mass produced, while good software engineers were expensive. It made sense to handle as much as possible in the hardware. For device manufacturers with bills to pay, it was a real selling point.
|
||||
|
||||
But this came at a cost – more and more complex instructions required more and more clock cycles to complete. Often there was a whole extra layer of processing to convert the complex machine code instructions into smaller instructions. As RAM became bigger and faster, CPUs were struggling to keep pace with the available memory bandwidth.
|
||||
|
||||
Acorn turned this idea on its head, with a stripped-back approach in the great British tradition of the [de Havilland Mosquito][3]: Every instruction could be completed in a single cycle.
|
||||
|
||||
While testing the prototype CPU, the engineers noticed something weird: they’d disconnected the power and yet the chip was running. What they’d built was so power-efficient that it kept running on residual power from nearby components.
|
||||
|
||||
It was also 25 times faster than the 6502 CPU they used in the old BBC machines. Even better, it was several times more powerful than the Motorola 68000 found in the Apple Macintosh, Atari ST and Commodore Amiga – and several time more powerful than the 386 in the new Compaq too.
|
||||
|
||||
With such radically new hardware, they needed a new operating system. What they come up with was Risc OS, and it was operated entirely through a graphic point-and-click desktop interface with a pinboard and an icon bar. This was pretty much Windows 95, 8 years before it happened.
|
||||
|
||||
In a single step, Acorn had gone from producing some perfectly serviceable 8-bit box that kids could learn to code one, to having the most powerful desktop computer in the world. I mean, it was technically possible to get something more powerful – but it would have been some kind of server or mainframe. As far as something that could sit on your desk, this was top of the pile.
|
||||
|
||||
It sold well in Acorn’s traditional education market in the UK. The sheer grunt also made it popular for certain power-hungry business tasks, like desktop publishing.
|
||||
|
||||
#### The Crucifixion
|
||||
|
||||
It wasn’t too long before Dad got an Archimedes – I can’t remember exactly which model. By this time, he’d moved his business out of home to an office. When school holidays rolled around, I’d sometimes have to spend the day at his work, where I had all the time in the world to fiddle around on it.
|
||||
|
||||
The software it came with was enough to keep a child entertained for a while. It came with a demo game called Lander – this was more about showing off the machine’s 3D graphics power than providing any lasting value. There was a card game, and also some drawing programs.
|
||||
|
||||
<https://www.youtube.com/embed/mFwpsb75omg?feature=oembed>
|
||||
|
||||
I played with the demo disc until I got bored – which I think was the most use that this particular machine ever got. For all the power under the hood, all the applications Dad used to actually run his business ran on DOS and Windows.
|
||||
|
||||
He’d spent more than $4000 in today’s money for the most sophisticated and advanced piece of computing technology for a mile in any direction and it just sat there.
|
||||
|
||||
He might have at least salvaged some beneficial utility out of it if he’d followed my advice of getting some games for it and letting me take it home.
|
||||
|
||||
He never got around to writing any software on it. The Archimedes was apparently a big hit with British schools, but never really got popular enough with his Australian customer base to be worth coding for.
|
||||
|
||||
Which I guess is kind of sums up where it all ultimately went wrong for the Acorn desktop.
|
||||
|
||||
As the 80s wore on to the ’90s, Compaq reverse engineered the BIOS on the IBM PC to release their own fully compatible PC, and big players like Amstrad left their proprietary platforms to produce their own compatible MS-DOS machines. It was also became increasingly easy for just about anyone with a slight technical bunt to build their own PC-compatible clone from off-the-shelf parts – and to upgrade old PCs with new hard drives, sound cards, and the latest 386 and 486 processors.
|
||||
|
||||
Small, independent computer shops and other local businesses started building their owns PCs and hardware manufacturers competed to sell parts to them. This was a computing platform that could serve all price points.
|
||||
|
||||
With so much of the user base now on MS-DOS, software developers followed. Which only reinforced the idea that this was the obvious system to buy, which in turn reinforced that it was the system to code for.
|
||||
|
||||
The days when just any computer maker could make a go of it with their own proprietary hardware and operating system had passed. Third-party support was everything. It didn’t actually matter how good your technology was if nothing would run on it. Even Apple nearly went to the wall.
|
||||
|
||||
Acorn hung on through the 90s, and there was even a successor to the Archimedes called the [RiscPC][4]. But while the technology itself was again very good, these things were relatively marginal affairs in the marketplace. The era of the Acorn desktop had passed.
|
||||
|
||||
#### The Resurrection
|
||||
|
||||
It was definitely good for our family business when the market consolidated to Mac and PC. We didn’t need to maintain so many versions of the same software.
|
||||
|
||||
But the Acorn machines had so much sentimental value. We both liked them and were sad to see them go. I’ve never been that into sport, but watching them slowly disappear might have been a bit like watching your football team lose match after match before finally going broke.
|
||||
|
||||
We totally had no idea that they were, very quietly, on a path to total domination.
|
||||
|
||||
The ARM was originally only built to go in the Archimedes. But it turned out that having a massively powerful processor with a simple instruction set and very little heat emission was useful for all sorts of stuff: DVD players, set top boxes, photocopiers, televisions, vending machines, home and small business routers, you name it.
|
||||
|
||||
The ARM’s low power consumption made it especially useful for portable devices like PDAs, digital cameras, GPS navigators and – eventually – tablets and smartphones. Intel tried to compete in the smartphone market, but was [eventually forced to admit that this technology was just better for phones][5].
|
||||
|
||||
So in the end, Dad’s old BBC machines went on to conquer the world.
|
||||
|
||||
### The Acorn Archimedes as a Gaming Platform
|
||||
|
||||
While Microsoft operating systems were ultimately to become the only real choice for the serious desktop gamer, for a while the Archimedes was the most powerful desktop computer in the world. This attracted a lot of games developers, eager to show what they could do with it.
|
||||
|
||||
This would have been about more than just selling to a well moneyed section of the desktop computer market that was clearly quite willing to throw cash at shiny things. It would have been a chance to make your reputation in the industry with a flagship product that just wasn’t possible on lesser hardware.
|
||||
|
||||
So it is that you see Star Fighter 3000, Chocks Away and Zarch all charting new territory in what was possible on a desktop computer.
|
||||
|
||||
But while the 3D graphics power was this system’s headline feature, the late 80s and early 90s were really the era of Sonic and Mario: the heyday of 2D platform games. Here, the Archimedes also excels, with offerings like Mad Professor Mariarti, Bug Hunter, F.R.E.D. and Hamsters, all of which are massively playable, have vibrant graphics and a boatload of personality.
|
||||
|
||||
As you dig further into the library, you also find a few games that show that not every developer really knew what to do with this machine. Some games – like Repton 3 – are just old BBC micro games given the most meagre of facelifts.
|
||||
|
||||
Many of the games in the Archimedes catalogue you’ll recognise from other platforms: Populous, Lemmings, James Pond, Battle Chess, the list goes on.
|
||||
|
||||
Here, the massive hardware advantage of the Archimedes means that it usually had the best version of the game to play. You’re not getting a whole new game here: but it’s noticeably smoother graphics and gameplay, especially compared to the console releases.
|
||||
|
||||
All in all, the Archimedes never had a catalogue as expansive as MS-DOS, the Commodore Amiga, or the Sega and Nintendo consoles. But there are enough truly excellent games to make it worth an SD card.
|
||||
|
||||
### Configuring Your Raspberry Pi
|
||||
|
||||
This is a bit different to other retro gaming options on the Raspberry Pi – we’re not running an emulator. The ARM chip in the Pi is a direct descendant of the one in the Archimedes, and there’s an [open source version of Risc OS][6] we can install on it.
|
||||
|
||||
For the most hardcore retro gaming purist, nothing less than using the hardware will do. For everyone else, using the same operating system from back in the day to load up your games means that your retro gaming rig becomes just that little bit more of a time machine.
|
||||
|
||||
But even with all these similarities, there’s still going to be a few things that change in 30 years of computing.
|
||||
|
||||
The most visible difference is that our Raspberry Pi doesn’t come with an internal 3.5″ floppy disk drive. You might be able to hook up a USB one, but most of us don’t have this lying around and don’t really want one. So we’re going to need a different way to boot floppy images.
|
||||
|
||||
The more major difference is how much RAM the operating system is written to handle. The earliest versions of Risc OS made efficient use of the ARM’s 32-bit register by using 26 bits for the memory address and the remaining 6 bits for status flags. A 26-bit scheme gives you enough addressing space for up to 64 megabytes of RAM.
|
||||
|
||||
When this was first devised, the fact that an Archimedes came with a whole megabyte of RAM was considered incredibly luxurious by the standards of the day. By contrast, the first Commodore Amiga had 256kb of RAM. The Sega Mega Drive had 72kb.
|
||||
|
||||
But as time wore on, and later versions of Risc OS moved to a 32-bit addressing scheme. This is what we have on our Raspberry Pi. A few games have been [recompiled to run on 32 bit addressing][7], but most have not.
|
||||
|
||||
The Archimedes also used different display drivers for different screens. These days, our GPU can handle all of this for us. We just need to install a patch to get that working.
|
||||
|
||||
There are free utilities you can download to handle all of these things.
|
||||
|
||||
#### Hardware Requirements
|
||||
|
||||
I’ve tested this to work with a Raspberry Pi Model 3 B, but I expect that any Pi from the Model A onwards should manage this. The ARM processor on the slowest Pi is a great many times more powerful than the on the fastest Archimedes.
|
||||
|
||||
The lack of ports on a Raspberry Pi Zero means it’s probably not the most convenient choice, but if you can navigate around this, then it should be powerful enough.
|
||||
|
||||
In addition to the board, you’ll need something to put it in, a micro SD card, a USB SD card adapter, a power supply, a screen with an HDMI input, a USB keyboard and a 3 button mouse – a clickable scroll wheel works fine for your middle button.
|
||||
|
||||
If you already have a Raspberry Pi home theatre or retro gaming rig, then you’ve already got all this, so all you really need is a new micro SD card to swap in for Risc OS.
|
||||
|
||||
#### Installing Risc OS Open
|
||||
|
||||
When I first wrote this guide, Risc OS wasn’t an available option for the Raspberry Pi 3 on the NOOBS and PINN installers. That meant you had to download the image from the [Risc OS Open downloads page][8] and burn it to a new micro SD card.
|
||||
|
||||
You can still do this if you like, and if you can’t connect your Raspberry Pi to the internet via Wi-Fi or Ethernet then that’s still your best option. If you’re not sure how to write an image to an SD card, here’s some good guides for [Windows][9] and for [Mac][10].
|
||||
|
||||
For everyone else, now that Risc OS is available in the [NOOBS installer][11] again, I recommend using that. What’s really cool about NOOBS is that it makes it super simple to dual boot with something like [Retropie][12] or [Recalbox][13] for the ultimate all-in-one retro gaming device.
|
||||
|
||||
Risc OS is as an extremely good option for a dual boot machine because it only uses a few gigabytes – a small fraction of even the smallest SD cards around these days. This leaves most of it available for other operating systems and saves you having to swap cards, which can be a right pain if you have to unscrew the case. The games themselves vary from about 300kb to about 5 megabytes at the very largest, so don’t worry about that.
|
||||
|
||||
This image requires a card with at least 2 gigabytes, which for what we’re doing is plenty. Don’t worry about tracking down the largest SD card you can find. The operating system is extremely lightweight and the games themselves vary from about 300kb to about 5 megabytes at the very largest. Even a very small card offers enough space for hundreds of games – more than you will ever play.
|
||||
|
||||
If you’re unsure how to use the NOOBS installer, please [click here for instructions][14].
|
||||
|
||||
#### Navigating Risc OS
|
||||
|
||||
Compared to your first Linux experience, using Risc OS for the first time is, in my opinion, far more gentle. This is in large part thanks to a graphical interface that’s both fairly intuitive and actually very useful for configuring things.
|
||||
|
||||
The command line is there if you want it, but we won’t need it just to play some games. You can kind of tell that this was first built with a mass-market audience in mind.
|
||||
|
||||
So let’s jump right in.
|
||||
|
||||
Insert your card into your Pi, hook it up to your screen, keyboard, mouse and power supply. It shouldn’t take all that long before you’re at the desktop.
|
||||
|
||||
###### The Risc OS Mouse
|
||||
|
||||
Risc OS uses a three button mouse.
|
||||
|
||||
You use the left button – or “Select” button – in much the same way as you’re already used to: one click to select icons and a double click to open folders and execute programs.
|
||||
|
||||
The middle button – ie, your scroll wheel – is used to open menus in much the same way as the right mouse button is used in Windows. We’ll be using this a lot.
|
||||
|
||||
The right button – or “Adjust” button – has behaviours that vary between applications.
|
||||
|
||||
###### Browsing Directories
|
||||
|
||||
Ok, so let’s start taking a look around. At the bottom of the screen you’ll see an icon bar. In the bottom left are icons for storage devices.
|
||||
|
||||
Click once with the left mouse button on the SD card and a window will open to show you what’s on it. You can take a look inside the directories by double clicking.
|
||||
|
||||
###### The Pling
|
||||
|
||||
As you start to browse Risc OS, you’ll notice that a lot of what you see inside the directories has exclamation marks at the beginning. This is said out aloud as a “pling”, and it’s used to mark an application that you can execute.
|
||||
|
||||
One of the quirks of Risc OS is that these executables aren’t really files – they’re directories. If you hold shift while double clicking, you can open them and start looking inside, same as any other directory – but be careful with this, it’s a good way to break stuff.
|
||||
|
||||
Risc OS comes with some applications installed – including a web browser called !NetSurf. We’ll be using that soon to download our games and some small utilities we need to get them running.
|
||||
|
||||
###### Creating Directories
|
||||
|
||||
Risc OS comes with a basic directory structure, but you’ll probably want to create some new ones to put your floppy images and .zip files.
|
||||
|
||||
To do this, click with the middle button inside the folder where you want to place your new directory. This will open up a menu. Move your mouse over the arrow next to “New Directory” and a prompt will open where you can name it and press OK.
|
||||
|
||||
###### Copying Files and Directories
|
||||
|
||||
To copy a file or directory somewhere else, just drag and drop it with the left mouse button to the new location.
|
||||
|
||||
###### Forcing Applications to Quit
|
||||
|
||||
Sometimes, if you haven’t configured something right, if you’ve downloaded something that just doesn’t work, or if you plain forgot to look up the controls in the manual, you might find yourself stuck inside an application that has a blank screen or isn’t responding.
|
||||
|
||||
Here, you can press Ctrl-Shift-F12 to quit back to the desktop.
|
||||
|
||||
###### Shutting Down and Rebooting
|
||||
|
||||
If you want to power down or reboot your Pi, just click the middle button on the raspberry icon in the bottom right corner and select “Shutdown”. This will give you an option to reboot the Pi or you can just remove the power cable.
|
||||
|
||||
#### Connecting to the Internet
|
||||
|
||||
Okay, so I’ve got good news and bad news. I’ll get the bad news right out of the way first:
|
||||
|
||||
Risc OS Open doesn’t yet support wireless networking through either the onboard wireless or a wireless dongle in the USB port. It’s on the [to-do list][15].
|
||||
|
||||
In the meantime, if you can a way to connect to the internet through the Ethernet port, it makes the rest of this project a lot easier. If you were going to use an Ethernet cable anyway, this will be no big deal. And if you have a wireless bridge handy, you can just use that.
|
||||
|
||||
If you don’t have a wireless bridge, but do have a second Raspberry Pi board lying around (hey, who doesn’t these days :p), you can [set it up as a wireless bridge][16]. This is what I did and it’s actually pretty easy if you just follow the steps.
|
||||
|
||||
Another option might be to set up a temporary tinkering area next to your router so that you can plug straight in to get everything in configured.
|
||||
|
||||
Ok, so what’s the good news?
|
||||
|
||||
It’s this: once you’ve got the internet in your front hole, the rest is rather easy. In fact, the only bit that’s not done for your is configuring name servers.
|
||||
|
||||
So let’s get to it.
|
||||
|
||||
Double-click on !Configure, click once on Network, click on Internet and then on Host Names. Then enter the IPs of your name servers in the name server fields. If you’re not sure what IP to put in here, just use Google’s publicly available name servers – 8.8.8.8 and 8.8.4.4.
|
||||
|
||||
When you click Set, it will ask you if you want to reboot. Click yes.
|
||||
|
||||
Now double-click on !NetSurf. You’ll see the logo is now added to the bottom right corner. Click on this to open a new browser window.
|
||||
|
||||
Compared to Chrome, Firefox, et al, !NetSurf is a primitive web browser. I do not recommend it as a daily driver. But to download Risc OS software directly to the Pi, it’s actually pretty damn convenient.
|
||||
|
||||
###### Short Link to This Guide
|
||||
|
||||
As you go through the rest of this guide, it’s going to get annoying copying by hand all the URLs you’ll want to visit.
|
||||
|
||||
To save you this trouble, type bit.do/riscpi into the browser bar to load this page. With this loaded, you can follow the links.
|
||||
|
||||
###### If You’re Still Getting Host Name Error Messages
|
||||
|
||||
One little quirk of Risc OS is that it seems to check for name servers as part of the boot process. If it doesn’t find them then, it assumes they’re not there for the rest of the session.
|
||||
|
||||
This means that if you connect your Pi to the internet when it’s already booted, you will get an error message when you try to browse the internet with !NetSurf.
|
||||
|
||||
To fix this, just double check that your wireless bridge is switched on or that your Pi is plugged into the router, reboot, and the OS should find the name servers.
|
||||
|
||||
###### If You Can’t Connect to the Internet
|
||||
|
||||
If this is all too hard and you absolutely can’t connect to the internet, there’s always sneakernet – downloading files to another machine and then transferring by USB stick.
|
||||
|
||||
This is what I tried at first; It does work, but I found it terribly annoying.
|
||||
|
||||
One frustration is that using a Windows 10 machine to download Risc OS software seems to strip out the filetype information – even when you aren’t unzipping the archives. It’s not that difficult to repair this, it’s just tedious when you have to do it all the time.
|
||||
|
||||
The other problem is that running USB sticks from computer to computer all the time just got a bit old.
|
||||
|
||||
Still, if you have to do it, it’s an option.
|
||||
|
||||
#### Unzipping Compressed Files
|
||||
|
||||
Most of the files we’ll be downloading will come in .zip format – this is a good thing, because it preserves the file type information. But we’ll need a way to uncompress these files.
|
||||
|
||||
For this we’ll use a program called !SparkFS. This is proprietary software, but you can download a read-only version for free. This will let us extract files from .zip archives.
|
||||
|
||||
To download and install !SparkFS, click [this link][17] and follow the instructions. You want the version of this software for machines with more than 2MB of RAM.
|
||||
|
||||
#### Installing ADFFS and Anymode
|
||||
|
||||
Now we need to install ADFFS, a floppy disk imaging program written by Jon Abbot of the [Archimedes Software Preservation Project][18].
|
||||
|
||||
This gives us a virtual floppy drive we can use to boot floppy images. It also takes care of the 26 bit memory addressing issues.
|
||||
|
||||
To get your copy, browse to the [ADFFS subforum][19] and click the thread for the latest public release – at the time of writing that’s 2.64.
|
||||
|
||||
Download the .zip file, open it and then drag and drop !ADFFS to somewhere on your SD card where it’s conveniently accessible – we’ll be using it a lot.
|
||||
|
||||
###### Configuring Boot Scripts
|
||||
|
||||
For ADFFS to work properly, we’re going to need to add a little boot script.
|
||||
|
||||
Follow these instructions carefully – if you do the wrong thing here you can really mess up your OS, or even brick your Pi.
|
||||
|
||||
###### Creating !Boot.Loader.CMDLINE/TXT
|
||||
|
||||
Remember how I showed you that you could open up applications as directories by holding down shift when you double-click? We can also do this to get inside the Risc OS boot process. We’ll need to do this now to add our boot script.
|
||||
|
||||
Start by left clicking once on the SD card icon on the icon bar, then hold down shift and double-click !Boot with your left mouse button. Then double click the folder labeled Loader to open it. This is where we’re going to put our script.
|
||||
|
||||
To write our script, click Apps on the icon bar, then double-click !StrongEd. Now click on the fist icon that appeared on the bottom right of the icon bar to open a text editor window, and type:
|
||||
|
||||
```
|
||||
disable_mode_changes
|
||||
```
|
||||
|
||||
Computers are fussy so take a moment to double-check your spelling.
|
||||
|
||||
To save this file, click the middle button on the text editor and hover your cursor over the arrow next to Save. Then delete the existing text in the Name field and replace it with:
|
||||
|
||||
```
|
||||
CMDLINE/TXT
|
||||
```
|
||||
|
||||
Now, see that button marked Save? It’s a trap! Instead, drag and drop the pen and paper icon to the Loader folder.
|
||||
|
||||
We’re now finished with this folder, so you can close it and also close the text editor.
|
||||
|
||||
###### Installing Anymode
|
||||
|
||||
Now we need to install the Anymode module. This is to make the screen modes on our software play nice with our GPU and HDMI output.
|
||||
|
||||
Download Anymode from [here,][20] copy the .zip file to somewhere temporary and open it.
|
||||
|
||||
Now go back to the root directory on your SD card, double-click on !Boot again, then open the folders marked Choices, Boot and Predesk.
|
||||
|
||||
Then use your left mouse button to drag and drop the Anymode module from your .zip file to the Predesk folder.
|
||||
|
||||
#### Configuring USB Joysticks and Gamepads
|
||||
|
||||
Over at the Archimedes Software Preservation Project, there’s a [USB joystick driver][21] in development.
|
||||
|
||||
This module is still in alpha testing, and you’ll need to use the command line to configure it, but it’s there if you’d like to give it a try.
|
||||
|
||||
If you can’t get this working, don’t worry too much. It was actually pretty normal back in the day for people either to not have a joystick, or not to be able to get it to work. So pretty much every game can be played with keyboard and mouse.
|
||||
|
||||
I’ll be updating this section as this project develops.
|
||||
|
||||
#### Setting File Types
|
||||
|
||||
Risc OS uses an [ADFS][22] filesystem, different to anything used on Windows or Linux.
|
||||
|
||||
Instead of using a filename extension, ADFS files have a “file type” associated with them to show what. When these files pass through a different operating system, this information can get stripped from the file.
|
||||
|
||||
In theory, if we don’t open our .zip archives until it reaches our Risc OS machine, the file type should be preserved. Usually this works, but sometimes you unzip the archive and find files with no file type attached. You’ll be able to tell when this has happened because you’ll be faced with a green icon labeled “data”.
|
||||
|
||||
Fortunately, this is pretty easy to fix.
|
||||
|
||||
Just click on the file with your middle button. A menu will appear.
|
||||
|
||||
The second item on this menu will include the name of the file and it will have an arrow next to it. Hover your cursor over the arrow and a second menu will appear.
|
||||
|
||||
Near the bottom of this menu will be an option marked “Set Type”, and it will also have an arrow next to it. Hover your cursor over this arrow and a field will appear where you can enter the file type.
|
||||
|
||||
To set the file type on a floppy image, type:
|
||||
|
||||
```
|
||||
&FCE
|
||||
```
|
||||
|
||||
[Click here for more file type codes.][23]
|
||||
|
||||
### Finding, Loading and Playing Games
|
||||
|
||||
The best start looking for floppy images is in the [Games subforum][24] at the Archimedes Software Preservation Project.
|
||||
|
||||
There’s also a [Risc OS downloads section at Acorn Arcade][25].
|
||||
|
||||
There are definitely other websites that host Archimedes games, but I have no idea how legal these copies are.
|
||||
|
||||
###### Booting and Switching Floppy Disc Images
|
||||
|
||||
Some games might have specific instructions for how to boot the floppy. If so, then follow them.
|
||||
|
||||
Generally, though, you drag and drop the image file to, then click on it with the middle button and press “boot floppy”. Your game should start straight away.
|
||||
|
||||
Many of the games use more than one floppy disc. To play these, boot disc 1. When you’re asked to switch floppy discs, press control and shift and the function key corresponding to the disc you want to change to.
|
||||
|
||||
### Which Games Should You Play?
|
||||
|
||||
This is a matter of opinion really and everyone’s taste differs.
|
||||
|
||||
Still, if you’re wondering what to try, here are my recommendations.
|
||||
|
||||
This is still a work in progress. I’ll be adding more games as I find what I like.
|
||||
|
||||
#### Cannon Fodder
|
||||
|
||||
<https://www.youtube.com/embed/qgfIAjJ5w8Y?feature=oembed>
|
||||
|
||||
This is a top-down action/strategy game that’s extremely playable and wickedly funny.
|
||||
|
||||
You control a team of soldiers indirectly by clicking on areas of the screen to tell them where to move and who to kill. Everyone dies with a single shot.
|
||||
|
||||
At the start your enemies are all very easy to beat but the game progresses in difficulty. As you go, you’ll need to start dividing your team up into squads to command separately.
|
||||
|
||||
I used to play this on the Mega Drive back in the day, but it’s so much more playable with an actual mouse.
|
||||
|
||||
[Click here to get Cannon Fodder.][26]
|
||||
|
||||
#### Star Fighter 3000
|
||||
|
||||
<https://www.youtube.com/embed/omnpVCsDmng?feature=oembed>
|
||||
|
||||
This is a 3D space shooter that really laid down the gauntlet for what the Archimedes could do.
|
||||
|
||||
You fly around and blast stuff with lasers and missiles. It’s pretty awesome. It’s kind of a forerunner to Terminal Velocity, if you ever played that.
|
||||
|
||||
It was later ported to the 3D0, Sega Saturn and Playstation, but they could never render the 3D graphics to the same distance.
|
||||
|
||||
[Click here to get Star Fighter 3000.][27]
|
||||
|
||||
You want the download marked “Star Fighter 3000 version 3.20”. This one doesn’t use a floppy image, so don’t use ADFFS to run this file. Just double click the program and go.
|
||||
|
||||
#### Aggressor
|
||||
|
||||
<https://www.youtube.com/embed/kFinTfqs-nU?feature=oembed>
|
||||
|
||||
This is a side-scrolling run-and-gun where you have unlimited ammo and a whole lot of aliens and robots to kill. Badass.
|
||||
|
||||
#### Bug Hunter
|
||||
|
||||
<https://www.youtube.com/embed/TFNF0voQce4?feature=oembed>
|
||||
|
||||
This is a really unique puzzle/platform game – you’re a robot with sticky legs who can walk up and down walls and across the ceiling, and your job is to squash bugs by dropping objects lying around.
|
||||
|
||||
Which is harder than it sounds, because you can easily get yourself into situations where you dropped something in the wrong place, making it impossible to complete your objective, so your only way out is to initiate your self destruct sequence in futility and shame. Which I guess is kinda rather dark, if you dwell on it.
|
||||
|
||||
It’s fun though.
|
||||
|
||||
[Click here to get Bug Hunter.][28]
|
||||
|
||||
#### Mad Professor Mariarti
|
||||
|
||||
<https://www.youtube.com/embed/pQMv-CqktLQ?feature=oembed>
|
||||
|
||||
This is a platformer where you’re a mad scientist who shoots spanners and other weapons at bad guys. It has good music and gameplay and an immersive puzzle element as well.
|
||||
|
||||
[Click here to get Mad Professor Mariarti.][29]
|
||||
|
||||
#### Chuckie Egg
|
||||
|
||||
Ok, now we’re getting really retro.
|
||||
|
||||
Strictly speaking, this doesn’t really belong in this list, because it’s not even an Archimedes game – it’s an old BBC Micro game that I played the hell out of back in the day that some nice chap has ported to Risc OS.
|
||||
|
||||
But there’s a version that runs and it’s awesome so you should play it.
|
||||
|
||||
Basically you’re just this guy who goes around stealing eggs. That’s it. That’s all you do.
|
||||
|
||||
It’s absolutely amazing.
|
||||
|
||||
If you’ve never played it, you really should check it out.
|
||||
|
||||
You can [get Chuckie Egg here][30].
|
||||
|
||||
This isn’t a floppy image, so you don’t need ADFFS to run it. Just double click on the program and go.
|
||||
|
||||
### Over to You
|
||||
|
||||
Got any favourite Acorn Archimedes games?
|
||||
|
||||
Got any tips for getting them running on the Pi?
|
||||
|
||||
Please let me know in the comments section 🙂
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://blog.dxmtechsupport.com.au/playing-badass-acorn-archimedes-games-on-a-raspberry-pi/
|
||||
|
||||
作者:[James Mawson][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://blog.dxmtechsupport.com.au/author/james-mawson/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://blog.dxmtechsupport.com.au/wp-content/uploads/2018/06/cannonfodder-1024x768.jpg
|
||||
[2]: http://www.computinghistory.org.uk/det/897/Acorn-Computers/
|
||||
[3]: http://davetrott.co.uk/2017/03/strategy-is-sacrifice/
|
||||
[4]: http://www.old-computers.com/museum/computer.asp?c=1015
|
||||
[5]: https://www.theverge.com/2016/8/16/12507568/intel-arm-mobile-chips-licensing-deal-idf-2016
|
||||
[6]: https://www.riscosopen.org/content/
|
||||
[7]: https://www.riscosopen.org/wiki/documentation/show/ARMv6%2Fv7%20software%20compatibility%20list#games
|
||||
[8]: https://www.riscosopen.org/content/downloads/raspberry-pi
|
||||
[9]: http://www.raspberry-projects.com/pi/pi-operating-systems/win32diskimager
|
||||
[10]: http://osxdaily.com/2018/01/11/write-img-to-sd-card-mac-etcher/
|
||||
[11]: https://www.raspberrypi.org/downloads/noobs/
|
||||
[12]: https://retropie.org.uk/
|
||||
[13]: https://www.recalbox.com/
|
||||
[14]: https://www.raspberrypi.org/documentation/installation/noobs.md
|
||||
[15]: https://www.riscosopen.org/wiki/documentation/show/RISC%20OS%20Roadmap
|
||||
[16]: https://pimylifeup.com/raspberry-pi-wifi-bridge/
|
||||
[17]: http://www.riscos.com/ftp_space/generic/sparkfs/index.htm
|
||||
[18]: https://forums.jaspp.org.uk/forum/index.php
|
||||
[19]: https://forums.jaspp.org.uk/forum/viewforum.php?f=14&sid=d0f037e95c560144f3910503b776aef5
|
||||
[20]: http://www.pi-star.co.uk/anymode/
|
||||
[21]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=8&t=396
|
||||
[22]: https://en.wikipedia.org/wiki/Advanced_Disc_Filing_System
|
||||
[23]: https://www.riscosopen.org/wiki/documentation/show/File%20Types
|
||||
[24]: https://forums.jaspp.org.uk/forum/viewforum.php?f=25
|
||||
[25]: http://www.acornarcade.com/downloads/
|
||||
[26]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=25&t=188
|
||||
[27]: http://starfighter.acornarcade.com/
|
||||
[28]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=25&t=330
|
||||
[29]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=25&t=148
|
||||
[30]: http://homepages.paradise.net.nz/mjfoot/riscos.htm
|
||||
@@ -1,155 +0,0 @@
|
||||
Translating by MjSeven
|
||||
|
||||
Users, Groups, and Other Linux Beasts
|
||||
======
|
||||
|
||||

|
||||
|
||||
Having reached this stage, [after seeing how to manipulate folders/directories][1], but before flinging ourselves headlong into fiddling with files, we have to brush up on the matter of _permissions_ , _users_ and _groups_. Luckily, [there is already an excellent and comprehensive tutorial on this site that covers permissions][2], so you should go and read that right now. In a nutshell: you use permissions to establish who can do stuff to files and directories and what they can do with each file and directory -- read from it, write to it, move it, erase it, etc.
|
||||
|
||||
To try everything this tutorial covers, you'll need to create a new user on your system. Let's be practical and make a user for anybody who needs to borrow your computer, that is, what we call a _guest account_.
|
||||
|
||||
**WARNING:** _Creating and especially deleting users, along with home directories, can seriously damage your system if, for example, you remove your own user and files by mistake. You may want to practice on another machine which is not your main work machine or on a virtual machine. Regardless of whether you want to play it safe, or not, it is always a good idea to back up your stuff frequently, check the backups have worked correctly, and save yourself a lot of gnashing of teeth later on._
|
||||
|
||||
### A New User
|
||||
|
||||
You can create a new user with the `useradd` command. Run `useradd` with superuser/root privileges, that is using `sudo` or `su`, depending on your system, you can do:
|
||||
```
|
||||
sudo useradd -m guest
|
||||
|
||||
```
|
||||
|
||||
... and input your password. Or do:
|
||||
```
|
||||
su -c "useradd -m guest"
|
||||
|
||||
```
|
||||
|
||||
... and input the password of root/the superuser.
|
||||
|
||||
( _For the sake of brevity, we'll assume from now on that you get superuser/root privileges by using`sudo`_ ).
|
||||
|
||||
By including the `-m` argument, `useradd` will create a home directory for the new user. You can see its contents by listing _/home/guest_.
|
||||
|
||||
Next you can set up a password for the new user with
|
||||
```
|
||||
sudo passwd guest
|
||||
|
||||
```
|
||||
|
||||
Or you could also use `adduser`, which is interactive and asks you a bunch of questions, including what shell you want to assign the user (yes, there are more than one), where you want their home directory to be, what groups you want them to belong to (more about that in a second) and so on. At the end of running `adduser`, you get to set the password. Note that `adduser` is not installed by default on many distributions, while `useradd` is.
|
||||
|
||||
Incidentally, you can get rid of a user with `userdel`:
|
||||
```
|
||||
sudo userdel -r guest
|
||||
|
||||
```
|
||||
|
||||
With the `-r` option, `userdel` not only removes the _guest_ user, but also deletes their home directory and removes their entry in the mailing spool, if they had one.
|
||||
|
||||
### Skeletons at Home
|
||||
|
||||
Talking of users' home directories, depending on what distro you're on, you may have noticed that when you use the `-m` option, `useradd` populates a user's directory with subdirectories for music, documents, and whatnot as well as an assortment of hidden files. To see everything in you guest's home directory run `sudo ls -la /home/guest`.
|
||||
|
||||
What goes into a new user's directory is determined by a skeleton directory which is usually _/etc/skel_. Sometimes it may be a different directory, though. To check which directory is being used, run:
|
||||
```
|
||||
useradd -D
|
||||
GROUP=100
|
||||
HOME=/home
|
||||
INACTIVE=-1
|
||||
EXPIRE=
|
||||
SHELL=/bin/bash
|
||||
SKEL=/etc/skel
|
||||
CREATE_MAIL_SPOOL=no
|
||||
|
||||
```
|
||||
|
||||
This gives you some extra interesting information, but what you're interested in right now is the `SKEL=/etc/skel` line. In this case, and as is customary, it is pointing to _/etc/skel/_.
|
||||
|
||||
As everything is customizable in Linux, you can, of course, change what gets put into a newly created user directory. Try this: Create a new directory in _/etc/skel/_ :
|
||||
```
|
||||
sudo mkdir /etc/skel/Documents
|
||||
|
||||
```
|
||||
|
||||
And create a file containing a welcome text and copy it over:
|
||||
```
|
||||
sudo cp welcome.txt /etc/skel/Documents
|
||||
|
||||
```
|
||||
|
||||
Now delete the guest account:
|
||||
```
|
||||
sudo userdel -r guest
|
||||
|
||||
```
|
||||
|
||||
And create it again:
|
||||
```
|
||||
sudo useradd -m guest
|
||||
|
||||
```
|
||||
|
||||
Hey presto! Your _Documents/_ directory and _welcome.txt_ file magically appear in the guest's home directory.
|
||||
|
||||
You can also modify other things when you create a user by editing _/etc/default/useradd_. Mine looks like this:
|
||||
```
|
||||
GROUP=users
|
||||
HOME=/home
|
||||
INACTIVE=-1
|
||||
EXPIRE=
|
||||
SHELL=/bin/bash
|
||||
SKEL=/etc/skel
|
||||
CREATE_MAIL_SPOOL=no
|
||||
|
||||
```
|
||||
|
||||
Most of these options are self-explanatory, but let's take a closer look at the `GROUP` option.
|
||||
|
||||
### Herd Mentality
|
||||
|
||||
Instead of assigning permissions and privileges to users one by one, Linux and other Unix-like operating systems rely on _groups_. A group is a what you imagine it to be: a bunch of users that are related in some way. On your system you may have a group of users that are allowed to use the printer. They would belong to the _lp_ (for " _line printer_ ") group. The members of the _wheel_ group were traditionally the only ones who could become superuser/root by using _su_. The _network_ group of users can bring up and power down the network. And so on and so forth.
|
||||
|
||||
Different distributions have different groups and groups with the same or similar names have different privileges also depending on the distribution you are using. So don't be surprised if what you read in the prior paragraph doesn't match what is going on in your system.
|
||||
|
||||
Either way, to see which groups are on your system you can use:
|
||||
```
|
||||
getent group
|
||||
|
||||
```
|
||||
|
||||
The `getent` command lists the contents of some of the system's databases.
|
||||
|
||||
To find out which groups your current user belongs to, try:
|
||||
```
|
||||
groups
|
||||
|
||||
```
|
||||
|
||||
When you create a new user with `useradd`, unless you specify otherwise, the user will only belong to one group: their own. A _guest_ user will belong to a _guest_ group and the group gives the user the power to administer their own stuff and that is about it.
|
||||
|
||||
You can create new groups and then add users to them at will with the `groupadd` command:
|
||||
```
|
||||
sudo groupadd photos
|
||||
|
||||
```
|
||||
|
||||
will create the _photos_ group, for example. Next time, we’ll use this to build a shared directory all members of the group can read from and write to, and we'll learn even more about permissions and privileges. Stay tuned!
|
||||
|
||||
Learn more about Linux through the free ["Introduction to Linux" ][3]course from The Linux Foundation and edX.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts
|
||||
|
||||
作者:[Paul Brown][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/bro66
|
||||
[1]:https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux
|
||||
[2]:https://www.linux.com/learn/understanding-linux-file-permissions
|
||||
[3]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
||||
@@ -0,0 +1,142 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (11 Uses for a Raspberry Pi Around the Office)
|
||||
[#]: via: (https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/)
|
||||
[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/)
|
||||
|
||||
11 Uses for a Raspberry Pi Around the Office
|
||||
======
|
||||
|
||||
Look, I know what you’re thinking: a Raspberry Pi is really just for tinkering, prototyping and hobby use. It’s not actually meant for running a business on.
|
||||
|
||||
And it’s definitely true that this computer’s relatively low processing power, corruptible SD card, lack of battery backup and the DIY nature of the support means it’s not going to be a viable replacement for a [professionally installed and configured business server][1] for your most mission-critical operations any time soon.
|
||||
|
||||
But the board is affordable, incredibly frugal with power, small enough to fit just about anywhere and endlessly flexible – it’s actually a pretty great way to handle some basic tasks around the office.
|
||||
|
||||
And, even better, there’s a whole world of people out there who have done these projects before and are happy to share how they did it.
|
||||
|
||||
### DNS Server
|
||||
|
||||
Every time you type a website address or click a link in your browser, it needs to convert the domain name into a numeric IP address before it can show you anything.
|
||||
|
||||
Normally this means a request to a DNS server somewhere on the internet – but you can speed up your browsing by handling this locally.
|
||||
|
||||
You can also assign your own subdomains for local access to machines around the office.
|
||||
|
||||
[Here’s how to get this working.][2]
|
||||
|
||||
### Toilet Occupied Sign
|
||||
|
||||
Ever get queues at the loos?
|
||||
|
||||
That’s annoying for those left waiting and the time spent dealing with it is a drain on your whole office’s productivity.
|
||||
|
||||
I guess you could always hang those signs they have on airplanes all through your office.
|
||||
|
||||
[Occu-pi][3] is a much simpler solution, using a magnetic switch and a Raspberry Pi to tell when the bolt is closed and update a Slack channel as to when it’s in use – meaning that the whole office can tell at a glance of their computer or mobile device whether there’s a cubicle free.
|
||||
|
||||
### Honeypot Trap for Hackers
|
||||
|
||||
It should scare most business owners just a little bit that their first clue that a hacker’s breached the network is when something goes badly wrong.
|
||||
|
||||
That’s where it can help to have a honeypot: a computer that serves no purpose except to sit on your network with certain ports open to masquerade as a juicy target to hackers.
|
||||
|
||||
Security researchers often deploy honeypots on the exterior of a network, to collect data on what attackers are doing.
|
||||
|
||||
But for the average small business, these are more usefully deployed in the interior, to serve as kind of a tripwire. Because no ordinary user has any real reason to want to connect to the honeypot, any login attempts that occur are a very good indicator that mischief is afoot.
|
||||
|
||||
This can provide early warning of outsider intrusion, and of trusted insiders up to no good.
|
||||
|
||||
In larger, client/server networks, it might be more practical to run something like this as a virtual machine. But in small-office/home-office situations with a peer-to-peer network running on a wireless router, something like [HoneyPi][4] is a great little burglar alarm.
|
||||
|
||||
### Print Server
|
||||
|
||||
Network-attached printers are so much more convenient.
|
||||
|
||||
But it can be expensive to replace all your printers- especially if you’re otherwise happy with them.
|
||||
|
||||
It might make a lot more sense to [set up a Raspberry Pi as a print server][5].
|
||||
|
||||
### Network Attached Storage
|
||||
|
||||
Turning simple hard drives into network attached storage was one of the earliest practical uses for a Raspberry Pi, and it’s still one of the best.
|
||||
|
||||
[Here’s how to create a NAS with your Raspberry Pi.][6]
|
||||
|
||||
### Ticketing Server
|
||||
|
||||
Looking for a way to manage the support tickets for your help desk on a shoestring budget?
|
||||
|
||||
There’s a totally open source ticketing program called osTicket that you can install on your Pi, and it’s even available as [a ready-to-go SD card image][7].
|
||||
|
||||
### Digital Signage
|
||||
|
||||
Whether it’s for events, advertising, a menu, or something else entirely, a lot of businesses need a way to display digital signage – and the Pi’s affordability and frugal electricity needs make it a very attractive choice.
|
||||
|
||||
[There are a wealth of options to choose from here.][8]
|
||||
|
||||
### Directories and Kiosks
|
||||
|
||||
[FullPageOS][9] is a Linux distribution based on Raspbian that boots straight into a full screen version of Chromium – ideal for shopping directoriers, library catalogues and so on.
|
||||
|
||||
### Basic Intranet Web Server
|
||||
|
||||
For hosting a public-facing website, you’re really much better off just getting a hosting account. A Raspberry Pi is not really built to serve any real volume of web traffic.
|
||||
|
||||
But for small offices, it can host an internal business wiki or basic company intranet. It can also work as a sandbox environment for experimenting with code and server configurations.
|
||||
|
||||
[Here’s how to get Apache, MySQL and PHP running on a Pi.][10]
|
||||
|
||||
### Penetration Tester
|
||||
|
||||
Kali Linux is an operating system built specifically to probe networks for security vulnerabilities. By installing it on a Pi, you’ve got a super portable penetration tester with more than 600 tools included.
|
||||
|
||||
[You can find a torrent link for the Raspberry Pi image here.][11]
|
||||
|
||||
Be absolutely scrupulous to only use this on your own network or networks you’ve got permission to perform a security audit on – using this to hack other networks is a serious crime.
|
||||
|
||||
### VPN Server
|
||||
|
||||
When you’re out on the road, relying on public wireless internet, you’ve not really any say in who else might be on the network, snooping on all your traffic. That’s why it can be reassuring to encrypt everything with a VPN connection.
|
||||
|
||||
There are any number of commercial VPN services you can subscribe to – and you can install your own in the cloud – but by running one from your office, you can also access the local network from anywhere.
|
||||
|
||||
For light use – say, the occasional bit of business travel – a Raspberry Pi is a great, power-efficient way to set up a VPN server. (It’s also worth checking first that your router doesn’t offer this functionality already – very many do.)
|
||||
|
||||
[Here’s how to install OpenVPN on a Raspberry Pi.][12]
|
||||
|
||||
### Wireless Coffee Machine
|
||||
|
||||
Ahh, ambrosia: sweet nectar of the gods and the backbone of all productive enterprise.
|
||||
|
||||
So why not [hack the office coffee machine into a smart coffee machine][13] for precision temperature control and wireless network connectivity?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/
|
||||
|
||||
作者:[James Mawson][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://blog.dxmtechsupport.com.au/author/james-mawson/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://dxmtechsupport.com.au/server-configuration
|
||||
[2]: https://www.1and1.com/digitalguide/server/configuration/how-to-make-your-raspberry-pi-into-a-dns-server/
|
||||
[3]: https://blog.usejournal.com/occu-pi-the-bathroom-of-the-future-ed69b84e21d5
|
||||
[4]: https://trustfoundry.net/honeypi-easy-honeypot-raspberry-pi/
|
||||
[5]: https://opensource.com/article/18/3/print-server-raspberry-pi
|
||||
[6]: https://howtoraspberrypi.com/create-a-nas-with-your-raspberry-pi-and-samba/
|
||||
[7]: https://everyday-tech.com/a-raspberry-pi-ticketing-system-image-with-osticket/
|
||||
[8]: https://blog.capterra.com/7-free-and-open-source-digital-signage-software-options-for-your-next-event/
|
||||
[9]: https://github.com/guysoft/FullPageOS
|
||||
[10]: https://maker.pro/raspberry-pi/projects/raspberry-pi-web-server
|
||||
[11]: https://www.offensive-security.com/kali-linux-arm-images/
|
||||
[12]: https://medium.freecodecamp.org/running-your-own-openvpn-server-on-a-raspberry-pi-8b78043ccdea
|
||||
[13]: https://www.techradar.com/au/how-to/how-to-build-your-own-smart-coffee-machine
|
||||
@@ -1,3 +1,5 @@
|
||||
translating by cycoe
|
||||
cycoe 翻译中
|
||||
9 flowchart and diagramming tools for Linux
|
||||
======
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
translating---geekpi
|
||||
|
||||
Dbxfs – Mount Dropbox Folder Locally As Virtual File System In Linux
|
||||
======
|
||||
|
||||
|
||||
@@ -1,138 +0,0 @@
|
||||
[Translating by ChiZelin]
|
||||
3 best practices for continuous integration and deployment
|
||||
======
|
||||
Learn about automating, using a Git repository, and parameterizing Jenkins pipelines.
|
||||

|
||||
|
||||
The article covers three key topics: automating CI/CD configuration, using a Git repository for common CI/CD artifacts, and parameterizing Jenkins pipelines.
|
||||
|
||||
### Terminology
|
||||
|
||||
First things first; let's define a few terms. **CI/CD** is a practice that allows teams to quickly and automatically test, package, and deploy their applications. It is often achieved by leveraging a server called **[Jenkins][1]** , which serves as the CI/CD orchestrator. Jenkins listens to specific inputs (often a Git hook following a code check-in) and, when triggered, kicks off a pipeline.
|
||||
|
||||
A **pipeline** consists of code written by development and/or operations teams that instructs Jenkins which actions to take during the CI/CD process. This pipeline is often something like "build my code, then test my code, and if those tests pass, deploy my application to the next highest environment (usually a development, test, or production environment)." Organizations often have more complex pipelines, incorporating tools such as artifact repositories and code analyzers, but this provides a high-level example.
|
||||
|
||||
Now that we understand the key terminology, let's dive into some best practices.
|
||||
|
||||
### 1\. Automation is key
|
||||
|
||||
To run CI/CD on a PaaS, you need the proper infrastructure to be configured on the cluster. In this example, I will use [OpenShift][2].
|
||||
|
||||
"Hello, World" implementations of this are quite simple to achieve. Simply run **oc new-app jenkins- <persistent/ephemeral>** and voilà, you have a running Jenkins server ready to go. Uses in the enterprise, however, are much more complex. In addition to the Jenkins server, admins will often need to deploy a code analysis tool such as SonarQube and an artifact repository such as Nexus. They will then have to create pipelines to perform CI/CD and Jenkins slaves to reduce the load on the master. Most of these entities are backed by OpenShift resources that need to be created to deploy the desired CI/CD infrastructure.
|
||||
|
||||
Eventually, the manual steps required to deploy your CI/CD components may need to be replicated, and you might not be the person to perform those steps. To ensure the outcome is produced quickly, error-free, and exactly as it was before, an automation method should be incorporated in the way your infrastructure is created. This can be an Ansible playbook, a Bash script, or any other way you would like to automate the deployment of CI/CD infrastructure. I have used [Ansible][3] and the [OpenShift-Applier][4] role to automate my implementations. You may find these tools valuable, or you may find something else that works better for you and your organization. Either way, you'll find that automation significantly reduces the workload required to recreate CI/CD components.
|
||||
|
||||
#### Configuring the Jenkins master
|
||||
|
||||
Outside of general "automation," I'd like to single out the Jenkins master and talk about a few ways admins can take advantage of OpenShift to automate Jenkins configuration. The Jenkins image from the [Red Hat Container Catalog][5] comes packaged with the [OpenShift-Sync plugin][6] installed. In the [video][7], we discuss how this plugin can be used to create Jenkins pipelines and slaves.
|
||||
|
||||
To create a Jenkins pipeline, create an OpenShift BuildConfig similar to this:
|
||||
|
||||
```
|
||||
apiVersion: v1
|
||||
kind: BuildConfig
|
||||
...
|
||||
spec:
|
||||
source:
|
||||
git:
|
||||
ref: master
|
||||
uri: <repository-uri>
|
||||
...
|
||||
strategy:
|
||||
jenkinsPipelineStrategy:
|
||||
jenkinsfilePath: Jenkinsfile
|
||||
type: JenkinsPipeline
|
||||
```
|
||||
|
||||
The OpenShift-Sync plugin will notice that a BuildConfig with the strategy **jenkinsPipelineStrategy** has been created and will convert it into a Jenkins pipeline, pulling from the Jenkinsfile specified by the Git source. An inline Jenkinsfile can also be used instead of pulling from one from a Git repository. See the [documentation][8] for more information.
|
||||
|
||||
To create a Jenkins slave, create an OpenShift ImageStream that starts with the following definition:
|
||||
|
||||
```
|
||||
apiVersion: v1
|
||||
kind: ImageStream
|
||||
metadata:
|
||||
annotations:
|
||||
slave-label: jenkins-slave
|
||||
labels:
|
||||
role: jenkins-slave
|
||||
…
|
||||
```
|
||||
|
||||
Notice the metadata defined in this ImageStream. The OpenShift-Sync plugin will convert any ImageStream with the label **role: jenkins-slave** into a Jenkins slave. The Jenkins slave will be named after the value from the **slave-label** annotation.
|
||||
|
||||
ImageStreams work just fine for simple Jenkins slave configurations, but some teams will find it necessary to configure nitty-gritty details such as resource limits, readiness and liveness probes, and instance caps. This is where ConfigMaps come into play:
|
||||
|
||||
```
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
labels:
|
||||
role: jenkins-slave
|
||||
...
|
||||
data:
|
||||
template1: |-
|
||||
<Kubernetes pod template>
|
||||
```
|
||||
|
||||
Notice that the **role: jenkins-slave** label is still required to convert the ConfigMap into a Jenkins slave. The **Kubernetes pod template** consists of a lengthy bit of XML that will configure every detail to your organization's liking. To view this XML, as well as more information on converting ImageStreams and ConfigMaps into Jenkins slaves, see the [documentation][9].
|
||||
|
||||
Notice with the three examples shown above that none of the operations required an administrator to make manual changes to the Jenkins console. By using OpenShift resources, Jenkins can be configured in a way that is easily automated.
|
||||
|
||||
### 2\. Sharing is caring
|
||||
|
||||
The second best practice is maintaining a Git repository of common CI/CD artifacts. The main idea is to prevent teams from reinventing the wheel. Imagine your team needs to perform a blue/green deployment to an OpenShift environment as part of the pipeline's CD phase. The members of your team responsible for writing the pipeline may not be OpenShift experts, nor may they have the bandwidth to write this functionality from scratch. Luckily, somebody has already written a function that incorporates that functionality in a common CI/CD repository, so your team can use that function instead of spending time writing one.
|
||||
|
||||
To take this a step further, your organization may decide to maintain entire pipelines. You may find that teams are writing pipelines with similar functionality. It would be more efficient for those teams to use a parameterized pipeline from a common repository as opposed to writing their own from scratch.
|
||||
|
||||
### 3\. Less is more
|
||||
|
||||
As I hinted in the previous section, the third and final best practice is to parameterize your CI/CD pipelines. Parameterization will prevent an over-abundance of pipelines, making your CI/CD system easier to maintain. Imagine I have multiple regions where I can deploy my application. Without parameterization, I would need a separate pipeline for each region.
|
||||
|
||||
To parameterize a pipeline written as an OpenShift build config, add the **env** stanza to the configuration:
|
||||
|
||||
```
|
||||
...
|
||||
spec:
|
||||
...
|
||||
strategy:
|
||||
jenkinsPipelineStrategy:
|
||||
env:
|
||||
- name: REGION
|
||||
value: US-West
|
||||
jenkinsfilePath: Jenkinsfile
|
||||
type: JenkinsPipeline
|
||||
```
|
||||
|
||||
With this configuration, I can pass the **REGION** parameter the pipeline to deploy my application to the specified region.
|
||||
|
||||
The [video][7] provides a more substantial case where parameterization is a must. Some organizations decide to split up their CI/CD pipelines into separate CI and CD pipelines, usually, because there is some sort of approval process that happens before deployment. Imagine I have four images and three different environments to deploy to. Without parameterization, I would need 12 CD pipelines to allow all deployment possibilities. This can get out of hand very quickly. To make maintenance of the CD pipeline easier, organizations would find it better to parameterize the image and environment to allow one pipeline to perform the work of many.
|
||||
|
||||
### Summary
|
||||
|
||||
CI/CD at the enterprise level tends to become more complex than many organizations anticipate. Luckily, with Jenkins, there are many ways to seamlessly provide automation of your setup. Maintaining a Git repository of common CI/CD artifacts will also ease the effort, as teams can pull from maintained dependencies instead of writing their own from scratch. Finally, parameterization of your CI/CD pipelines will reduce the number of pipelines that will have to be maintained.
|
||||
|
||||
If you've found other practices you can't do without, please share them in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/11/best-practices-cicd
|
||||
|
||||
作者:[Austin Dewey][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/adewey
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://jenkins.io/
|
||||
[2]: https://www.openshift.com/
|
||||
[3]: https://docs.ansible.com/
|
||||
[4]: https://github.com/redhat-cop/openshift-applier
|
||||
[5]: https://access.redhat.com/containers/?tab=overview#/registry.access.redhat.com/openshift3/jenkins-2-rhel7
|
||||
[6]: https://github.com/openshift/jenkins-sync-plugin
|
||||
[7]: https://www.youtube.com/watch?v=zlL7AFWqzfw
|
||||
[8]: https://docs.openshift.com/container-platform/3.11/dev_guide/dev_tutorials/openshift_pipeline.html#the-pipeline-build-config
|
||||
[9]: https://docs.openshift.com/container-platform/3.11/using_images/other_images/jenkins.html#configuring-the-jenkins-kubernetes-plug-in
|
||||
@@ -1,153 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Four Easy Ways to Search Or Find Files And Folders in Linux)
|
||||
[#]: via: (https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/)
|
||||
[#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/)
|
||||
|
||||
Four Easy Ways to Search Or Find Files And Folders in Linux
|
||||
======
|
||||
|
||||
Linux admins can’t able to leave a day without performing a file search as this one of the activity for their routine.
|
||||
|
||||
It’s good to know all the file search stuffs because it would help you in many ways when you are working on headless server.
|
||||
|
||||
These commands are not complicate to remember because these are using a standard syntax.
|
||||
|
||||
This can be performed through Four Linux commands and each command has their own unique feature.
|
||||
|
||||
### Method-1: Search Files And Folders in Linux Using find Command
|
||||
|
||||
Find command is widely used and very famous command to search files and folders in Linux. It searches given files in the current directory and recursively through its sub-directories based on the search criteria.
|
||||
|
||||
It allow users to perform all kind of file searches based on the criteria lie by size, name, owner, group, type, permissions, date, and other criteria.
|
||||
|
||||
Run the following command to find a given file in system.
|
||||
|
||||
```
|
||||
# find / -iname "sshd_config"
|
||||
/etc/ssh/sshd_config
|
||||
```
|
||||
|
||||
Run the following command to find a given folder in system. To search a folder in Linux we need to use `-type` parameter.
|
||||
|
||||
```
|
||||
# find / -type d -iname "ssh"
|
||||
/usr/lib/ssh
|
||||
/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh
|
||||
/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh
|
||||
/etc/ssh
|
||||
```
|
||||
|
||||
Use wildcard option to search set of files on your system. We are going to search all files available in the system with `.config` extension.
|
||||
|
||||
```
|
||||
# find / -name "*.config"
|
||||
/usr/lib/mono/gac/avahi-sharp/1.0.0.0__4d116c78973743f5/avahi-sharp.dll.config
|
||||
/usr/lib/mono/gac/avahi-ui-sharp/0.0.0.0__4d116c78973743f5/avahi-ui-sharp.dll.config
|
||||
/usr/lib/python2.7/config/Setup.config
|
||||
/usr/share/git/mw-to-git/t/test.config
|
||||
/var/lib/lightdm/.config
|
||||
/home/daygeek/.config
|
||||
/root/.config
|
||||
/etc/skel/.config
|
||||
```
|
||||
|
||||
Use the following command format to find an empty files and folders in system.
|
||||
|
||||
```
|
||||
# find / -empty
|
||||
```
|
||||
|
||||
Use the following command combination to find all files containing specific text on Linux.
|
||||
|
||||
```
|
||||
# find / -type f -exec grep "Port 22" '{}' \; -print
|
||||
# find / -type f -print | xargs grep "Port 22"
|
||||
# find / -type f | xargs grep 'Port 22'
|
||||
# find / -type f -exec grep -H 'Port 22' {} \;
|
||||
```
|
||||
|
||||
### Method-2: Search Files And Folders in Linux Using locate command
|
||||
|
||||
locate command works faster than the find command because it uses updatedb database, whereas the find command searches in the real system.
|
||||
|
||||
It uses a database rather than hunting individual directory paths to get a given file.
|
||||
|
||||
locate command doesn’t pre-installed in most of the distributions so, use your distribution package manager to install it.
|
||||
|
||||
The database is updated regularly through cron, however we can manually update it by running the following command.
|
||||
|
||||
```
|
||||
$ sudo updatedb
|
||||
```
|
||||
|
||||
Simply run the following command to list the given file or folder. There is no specific options need to be specified in locate command to print file or folder.
|
||||
|
||||
To search `ssh` folder in system.
|
||||
|
||||
```
|
||||
# locate --basename '\ssh'
|
||||
/etc/ssh
|
||||
/usr/bin/ssh
|
||||
/usr/lib/ssh
|
||||
/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh
|
||||
/usr/lib/go/src/cmd/go/testdata/failssh/ssh
|
||||
/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh
|
||||
```
|
||||
|
||||
To search `ssh_config` file in system.
|
||||
|
||||
```
|
||||
# locate --basename '\sshd_config'
|
||||
/etc/ssh/sshd_config
|
||||
```
|
||||
|
||||
### Method-3: Search Files in Linux Using which command
|
||||
|
||||
TThe which command returns the full path of the executable that would have been executed when the command had been entered in terminal.
|
||||
|
||||
It’s very useful when you want to create a desktop shortcut or symbolic link for executable files.
|
||||
|
||||
Which command searches the directories listed in the current user’s PATH environment variable not for all the users. I mean, when you are logged in your own account and you can’t able to search for root user file or directory.
|
||||
|
||||
Run the following command to print the full path of the vim executable file location.
|
||||
|
||||
```
|
||||
# which vi
|
||||
/usr/bin/vi
|
||||
```
|
||||
|
||||
Alternatively, it’s allowing user to perform multiple file search in one shot.
|
||||
|
||||
```
|
||||
# which -a vi sudo
|
||||
/usr/bin/vi
|
||||
/bin/vi
|
||||
/usr/bin/sudo
|
||||
/bin/sudo
|
||||
```
|
||||
|
||||
### Method-4: Search Files in Linux Using whereis command
|
||||
|
||||
The whereis command used to search the binary, source, and man page files for a given command.
|
||||
|
||||
```
|
||||
# whereis vi
|
||||
vi: /usr/bin/vi /usr/share/man/man1/vi.1p.gz /usr/share/man/man1/vi.1.gz
|
||||
```
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/
|
||||
|
||||
作者:[Prakash Subramanian][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/prakash/
|
||||
[b]: https://github.com/lujun9972
|
||||
@@ -1,78 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It)
|
||||
[#]: via: (https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/)
|
||||
[#]: author: (SK https://www.ostechnix.com/author/sk/)
|
||||
[#]: url: ( )
|
||||
|
||||
How To Fix Broken Ubuntu OS Without Reinstalling It
|
||||
======
|
||||
|
||||

|
||||
|
||||
Today, I was upgrading my Ubuntu 18.04 LTS system. Unfortunately, the power has gone in mid-way and the system powered off while updating Ubuntu OS. When the power is back, I boot the system again. Right after entering the password at the login screen, it’s gone blank and didn’t respond. Keyboard and mouse also didn’t work. All I see is just a blank screen! Thankfully, It’s just a test machine and there were no important data in it. I can simply wipe off the entire OS and install it again. But, I don’t want to do that. Since I have nothing to lose, I just wanted to repair my broken Ubuntu system without reinstalling it completely and it worked!!! If you ever find yourself in a situation like mine, don’t panic. This brief tutorial describes how to easily fix broken Ubuntu OS without losing data and without reinstalling it completely.
|
||||
|
||||
### Fix Broken Ubuntu OS
|
||||
|
||||
First of all, try to login with live cd and **backup your data** in an external drive. Just in case, if this method didn’t work, you can still have your data and reinstall everything!
|
||||
|
||||
At the login screen, press **CTRL+ALT+F1** to switch to **tty1**. You can learn more about switching between TTYs [**here**][1].
|
||||
|
||||
Now, type the following commands one by one to fix the broken Ubuntu Linux.
|
||||
|
||||
```
|
||||
$ sudo rm /var/lib/apt/lists/lock
|
||||
|
||||
$ sudo rm /var/lib/dpkg/lock
|
||||
|
||||
$ sudo rm /var/lib/dpkg/lock-frontend
|
||||
|
||||
$ sudo dpkg --configure -a
|
||||
|
||||
$ sudo apt clean
|
||||
|
||||
$ sudo apt update --fix-missing
|
||||
|
||||
$ sudo apt install -f
|
||||
|
||||
$ sudo dpkg --configure -a
|
||||
|
||||
$ sudo apt upgrade
|
||||
|
||||
$ sudo apt dist-upgrade
|
||||
```
|
||||
|
||||
Finally, reboot the system using command:
|
||||
|
||||
```
|
||||
$ sudo reboot
|
||||
```
|
||||
|
||||
You can now be able to login to your Ubuntu system as usual.
|
||||
|
||||
After I followed these steps, all of my data in Ubuntu 18.04 test system was there and everything is the same as I left it. This method may not work for everyone. However, this small tip worked for me and saved a couple minutes from reinstalling. If you know any other better way, please let me know in the comment section. I will add them in this guide as well.
|
||||
|
||||
And, that’s all for now. Hope this was useful.
|
||||
|
||||
More good stuffs to come. Stay tuned!
|
||||
|
||||
Cheers!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/
|
||||
|
||||
作者:[SK][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.ostechnix.com/author/sk/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/
|
||||
@@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (qhwdw)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to get started in AI)
|
||||
[#]: via: (https://opensource.com/article/18/12/how-get-started-ai)
|
||||
[#]: author: (Gordon Haff https://opensource.com/users/ghaff)
|
||||
|
||||
How to get started in AI
|
||||
======
|
||||
Before you can begin working in artificial intelligence, you need to acquire some human intelligence.
|
||||

|
||||
|
||||
I've both asked and been asked about the best way to learn more about artificial intelligence (AI). What should I read? What should I watch? I'll get to that. But, first, it's useful to break down this question, given that AI covers a lot of territory.
|
||||
|
||||
One important distinction to draw is between the research side of AI and the applied side. Cassie Kozyrkov of Google [drew this distinction][1] in a talk at the recent O'Reilly Artificial Intelligence Conference in London, and it's a good one.
|
||||
|
||||
Research AI is rather academic in nature and requires a heavy dose of math across a variety of disciplines before you even get to those parts that are specific to AI. This aspect of AI focuses on the algorithms and tools that drive the state of AI forward. For example, what neural network structures might improve vision recognition results? How might we make unsupervised learning a more generally useful approach? Can we find ways to understand better how deep learning pipelines come up with the answers they do?
|
||||
|
||||
Applied AI, on the other hand, is more about using existing tools to obtain useful results. Open source has played a big role here in providing free and often easy-to-use software in a variety of languages. Public cloud providers have also devoted a lot of attention to providing machine learning services, models, and datasets that make the onramp to getting started with AI much simpler than it would be otherwise.
|
||||
|
||||
I'll add at this point that applied AI practitioners shouldn't treat their tools as some sort of black box that spits out answers for mysterious reasons. At a minimum, they need to understand the limits and potential biases of different techniques, models, and data collection approaches. It's just that they don't necessarily need to delve deeply into all the theory underpinning every part of their toolchain.
|
||||
|
||||
Although it's probably less important for working in AI on a day-to-day basis, it's also useful to understand the broader context of AI. It goes beyond the narrow scope of deep learning on neural networks that have been so important to the gains made in reinforcement learning and supervised learning to date. For example, AI is often viewed as a way to augment (rather than replace) human judgment and decisions. But the handoff between machine and human has its own pitfalls.
|
||||
|
||||
With that background, here are some study areas and resources you may find useful.
|
||||
|
||||
### Research AI
|
||||
|
||||
In a lot of respects, a list of resources for research AI mirror those in an undergraduate (or even graduate) computer science program that's focused on AI. The main difference is that the syllabus you draw up may be more interdisciplinary than more traditionally focused university curricula.
|
||||
|
||||
Where you start will depend on your computer science and math background.
|
||||
|
||||
If it's minimal or rusty, but you still want to develop a deep understanding of AI fundamentals, you'll benefit from taking some math courses to start. There are many options on massive online open courses (MOOCs) like the nonprofit [edX][2] platform and [Coursera][3]. (Both platforms charge for certifications, but edX makes all the content available for free to people just auditing the course.)
|
||||
|
||||
Typical foundational courses could include:
|
||||
|
||||
+ [MIT's Calculus courses][22], starting with differentiation
|
||||
+ [Linear Algebra][23] (University of Texas)
|
||||
+ Probability and statistics, such as MIT's [Probability—The Science of Uncertainty and Data][24]
|
||||
|
||||
|
||||
To get deeper into AI from a research perspective, you'll probably want to get into all these areas of mathematics and more. But the above should give you an idea of the general branches of study that are probably most important before delving into machine learning and AI proper.
|
||||
|
||||
In addition to MOOCs, resources such as [MIT OpenCourseWare][4] provide the syllabus and various supporting materials for a wide range of mathematics and computer science courses.
|
||||
|
||||
With the foundations in place, you can move onto more specialized courses in AI proper. Andrew Ng's AI MOOC, from when he was teaching at Stanford, was one of the early courses to popularize the whole online course space. Today, his [Neural Networks and Deep Learning][5] is part of the Deep Learning specialization at Coursera. There are corresponding programs on edX. For example, Columbia offers an [Artificial Intelligence MicroMasters][6].
|
||||
|
||||
In addition to courses, a variety of textbooks and other learning material are also available online. These include:
|
||||
|
||||
* [Neural Networks and Deep Learning][7]
|
||||
* [Deep Learning][8] from MIT Press by Ian Goodfellow and Yoshua Bengio and Aaron Courville
|
||||
|
||||
### Applied AI
|
||||
|
||||
Applied AI is much more focused on using available tools than building new ones. Some appreciation of the mathematical underpinnings, especially statistics, is still useful—arguably even necessary—but you won't be majoring in that aspect of AI to the same degree you would in a research mode.
|
||||
|
||||
Programming is a core skill here. While different programming languages can come into play, a lot of libraries and toolsets—such as [PyTorch][9]—rely on Python, so that's a good skill to have. Especially if you have some level of programming background, MIT's [Introduction to Computer Science and Programming Using Python][10], based on its on-campus 6.001 course, is a good primer. If you're truly new to programming, Charles Severance's [Programming for Everybody (Getting Started with Python)][11] from the University of Michigan doesn't toss you into the deep end of the pool the way the MIT course does.
|
||||
|
||||
[The R programming language][12] is also a useful skill to add to your toolbox. While it's less used in machine learning (ML) per se, it's common for a variety of other data science tasks, and applied AI/ML and data science often blend in practice. For example, many tasks associated with organizing and cleaning data apply equally whatever analysis techniques you'll eventually use. A MOOC sequence like Harvard's [Data Science certificate][13] is an example of a set of courses that provide a good introduction to working with data.
|
||||
|
||||
Another open source software library you're likely to encounter if you do any work with AI is [TensorFlow][14]. It was originally developed by researchers and engineers from the Google Brain team within Google's AI organization. [Google offers a variety of tutorials][15] to get started with TensorFlow using the high-level Keras API. You can run TensorFlow locally as well as online in Google Cloud.
|
||||
|
||||
In general, all of the big public cloud providers offer online datasets and ML services that can be an easy way to get started. However, especially as you move beyond "play" datasets and applications, you need to start thinking seriously about the degree to which you want to be locked into a single provider.
|
||||
|
||||
Datasets for your exploratory learning projects are available from many different sources. In addition to the public cloud providers, [Kaggle][16] is another popular source and also a good learning resource more broadly. Government data is also increasingly available in digital form. The US Federal Government's [Data.gov][17] claims over 300,000 datasets. State and local governments also publish data on everything from restaurant health ratings to dogs' names.
|
||||
|
||||
### Miscellany
|
||||
|
||||
I'll close by noting that AI is a broad topic that isn't just about math, programming, and data. AI as a whole touches many other fields, including cognitive psychology, linguistics, game theory, operations research, and control systems. Indeed, a concern among at least some AI researchers today is that the field has become too fixated on a small number of techniques that have become powerful and interesting only quite recently because of the intersection of processing power and big data. Many longstanding problems in understanding how humans learn and reason remain largely unsolved. Developing at least some appreciation for these broader problem spaces will better enable you to place AI within a broader context.
|
||||
|
||||
One of my favorite examples is the [Humans and Autonomy Lab][18] at Duke. The work in this lab touches on all the challenges of humans working with machines, such as how autopilots can create ["Children of the Magenta"][19] who are unable to take control quickly if the automation fails. A basic brain-science course, such as MIT's [Introduction to Psychology][20], provides some useful context for the relationship between human intelligence and machine intelligence. Another course in a similar vein, but taught by the late Marvin Minsky from MIT's Electrical Engineering and Computer Science department, is [The Society of Mind][21].
|
||||
|
||||
If there's one key challenge to learning about AI, it's not that raw materials and tools aren't readily available. It's that there are so many of them. My objective hasn't been to give you a comprehensive set of pointers. Rather, it's been to both point out the different paths you can take and provide you with some possible starting points. Happy learning!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/12/how-get-started-ai
|
||||
|
||||
作者:[Gordon Haff][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/ghaff
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.youtube.com/watch?v=RLtI7r3QUyY
|
||||
[2]: https://www.edx.org/
|
||||
[3]: https://www.coursera.org/
|
||||
[4]: https://ocw.mit.edu/index.htm
|
||||
[5]: https://www.coursera.org/learn/neural-networks-deep-learning
|
||||
[6]: https://www.edx.org/micromasters/columbiax-artificial-intelligence
|
||||
[7]: http://neuralnetworksanddeeplearning.com/
|
||||
[8]: http://www.deeplearningbook.org/
|
||||
[9]: https://pytorch.org/
|
||||
[10]: https://www.edx.org/course/introduction-to-computer-science-and-programming-using-python
|
||||
[11]: https://www.coursera.org/learn/python
|
||||
[12]: https://www.r-project.org/about.html
|
||||
[13]: https://www.edx.org/professional-certificate/harvardx-data-science
|
||||
[14]: https://www.tensorflow.org/
|
||||
[15]: https://www.tensorflow.org/tutorials/
|
||||
[16]: https://www.kaggle.com/
|
||||
[17]: https://www.data.gov/
|
||||
[18]: https://hal.pratt.duke.edu/
|
||||
[19]: https://99percentinvisible.org/episode/children-of-the-magenta-automation-paradox-pt-1/
|
||||
[20]: https://ocw.mit.edu/courses/brain-and-cognitive-sciences/9-00sc-introduction-to-psychology-fall-2011/
|
||||
[21]: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-868j-the-society-of-mind-fall-2011/
|
||||
[22]: https://www.edx.org/course/calculus-1a-differentiation
|
||||
[23]: https://www.edx.org/course/linear-algebra-foundations-to-frontiers
|
||||
[24]: https://courses.edx.org/courses/course-v1:MITx+6.431x+3T2018/course/
|
||||
@@ -1,111 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Install Putty on Ubuntu and Other Linux Distributions)
|
||||
[#]: via: (https://itsfoss.com/putty-linux/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
How to Install Putty on Ubuntu and Other Linux Distributions
|
||||
======
|
||||
|
||||
If I am not wrong, [Putty][1] is perhaps the most popular SSH client for Windows.
|
||||
|
||||
In IT companies, the development environment is usually on a remote Linux system while the developers use Windows as their local system. Putty is used for connecting to the remote Linux system from the Windows machine.
|
||||
|
||||
Putty is not limited to Windows only. You can also use this open source software on Linux and macOS.
|
||||
|
||||
But wait! Why would you use a separate SSH client on Linux when you already have the ‘real’ Linux terminal with you? There are several reasons why you would want to use Putty on Linux.
|
||||
|
||||
* You have used Putty for so long on Windows that you are more comfortable with it.
|
||||
* You find it difficult to manually edit SSH config file to save the various SSH sessions. You prefer Putty’s graphical way of storing SSH connection.
|
||||
* You want to debug by connecting to raw sockets and serial ports.
|
||||
|
||||
|
||||
|
||||
Whatever may be the reason, if you want to use Putty on Ubuntu or any other Linux, you can certainly do so. Let me show you how to do that.
|
||||
|
||||
### Installing Putty on Ubuntu Linux
|
||||
|
||||
![Installing Putty on Linux][2]
|
||||
|
||||
The good news for the Ubuntu users is that Putty is available in the universe repository of Ubuntu.
|
||||
|
||||
To install Putty on Ubuntu, you should first make sure that the universe repository is enabled.
|
||||
|
||||
```
|
||||
sudo add-apt-repository universe
|
||||
```
|
||||
|
||||
Once you have the universe repository enabled, you should update Ubuntu with this command:
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
After this, you can install Putty with this command:
|
||||
|
||||
```
|
||||
sudo apt install putty
|
||||
```
|
||||
|
||||
Once installed, you can start Putty by finding it in the menu.
|
||||
|
||||
As you can see in the screenshot below, the Linux version of Putty looks the same as the Windows version. That’s a relief because you won’t have to fiddle around trying to find your way through a new and changed settings.
|
||||
|
||||
![Putty in Linux][3]
|
||||
|
||||
When you enter the remote system’s [hostname][4] or IP address and connect to it, Putty will utilize the already saved SSH keys in your home directory.
|
||||
|
||||
![Using Putty in Ubuntu Linux][5]
|
||||
|
||||
### Installing Putty on other Linux distributions
|
||||
|
||||
[Putty is available for Debian][6] so you just need to use apt-get or aptitude for installing it.
|
||||
|
||||
```
|
||||
sudo apt-get install putty
|
||||
```
|
||||
|
||||
Putty is also available for Fedora/Red Hat and can be installed using the default package manager.
|
||||
|
||||
```
|
||||
sudo dnf install putty
|
||||
```
|
||||
|
||||
You can also easily install Putty in Arch Linux based distributions.
|
||||
|
||||
```
|
||||
sudo pacman -S putty
|
||||
```
|
||||
|
||||
Remember that Putty is an open source software. You can also install it via source code if you really want to. You can get the source code of Putty from the link below.
|
||||
|
||||
[Download Putty Source Code][8]
|
||||
|
||||
I would always prefer the native Linux terminal over an SSH client like Putty. I feel more at home with the GNOME terminal or [Terminator][7]. However, it’s up to an individual’s choice to use the default terminal or Putty in Linux
|
||||
|
||||
What do you use for managing multiple SSH connections on Linux?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/putty-linux/
|
||||
|
||||
作者:[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://www.putty.org/
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/Putty-linux.png?resize=800%2C450&ssl=1
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu.jpeg?resize=800%2C503&ssl=1
|
||||
[4]: https://itsfoss.com/change-hostname-ubuntu/
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu-1.jpeg?resize=800%2C430&ssl=1
|
||||
[6]: https://packages.debian.org/jessie/putty
|
||||
[7]: https://launchpad.net/terminator
|
||||
[8]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
|
||||
@@ -1,133 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Aliases: DIY Shell Commands)
|
||||
[#]: via: (https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands)
|
||||
[#]: author: (Paul Brown https://www.linux.com/users/bro66)
|
||||
|
||||
Aliases: DIY Shell Commands
|
||||
======
|
||||
|
||||

|
||||
|
||||
Aliases, in the context of the Linux shell, are **commands you build yourself** by packing them with combinations of other instructions that are too long or too hard to remember.
|
||||
|
||||
You create an alias by using the word `alias`, then the name of the command you want to create, an equal sign (`=`), and then the Bash command(s) you want your alias to run. For example, `ls` in its base form does not colorize its output, making it difficult to distinguish between directories, files, and links. You can build a new command that shows colors by making an alias like this:
|
||||
|
||||
```
|
||||
alias lc='ls --color=auto'
|
||||
```
|
||||
|
||||
where `lc` is the name you have picked for your new command. When creating aliases, be sure to check that the name you picked isn't already in use, or you may override an existing command. In this case, `lc` stands for "list (with) color". Notice there is no space in front of or behind the `=`. Finally, you have the regular Bash command(s) you want to run when `lc` is executed. In this case, the `ls` command with the `--color` option.
|
||||
|
||||
After defining your alias, every time you type `lc`, the contents of the current directory will be shown in color.
|
||||
|
||||
But, you may think, "my `ls` command already lists files in different colors!" That is because most Linux distros come with some aliases already set up for you.
|
||||
|
||||
### Aliases you (probably) already have
|
||||
|
||||
Indeed, you can use the `alias` instruction without any options to see what aliases you already have. These will vary by distro, but some typical preset aliases are:
|
||||
|
||||
* `alias ls='ls --color=auto'`: You already saw this one above. The `auto` modifier of the `--color` option tells `ls` to use color when standard output is connected to a terminal. That is, the output of `ls` is going to show up in a terminal window or a text screen, instead of, say, being piped to a file. Other alternatives for `--color` are `always` and `never`.
|
||||
* `alias cp='cp -i'`: The `-i` option stands for _interactive_. Sometimes, when you use `cp` you may inadvertently overwrite an existing file. By using the `-i`, `cp` will ask you before clobbering anything.
|
||||
* `alias free='free -m'`: Using `-m` with `free`you can see how much free memory you have and how much your applications are using in megabytes instead of the default bytes. This makes the output of `free` easier to read for a human.
|
||||
|
||||
|
||||
|
||||
There may be more (or less, or even none), but regardless of what your distribution comes with, you can always use the base form (vs. the aliased form) of a command with the `\` modifier. For example:
|
||||
|
||||
```
|
||||
\free
|
||||
```
|
||||
|
||||
will execute `free` without the `-m` option, and
|
||||
|
||||
```
|
||||
\ls
|
||||
```
|
||||
|
||||
will execute `ls` without the `--color=auto` option.
|
||||
|
||||
If you want to get rid or modify the preset aliases forever, note that they live in the global _.bashrc_ file which hangs out in [our old haunt, the _/etc/skel_ directory][1].
|
||||
|
||||
### Aliases for muscle memory
|
||||
|
||||
Distro designers try their best to predict which aliases are going to be useful for you. But every user is different and comes from a different background. If you are new to GNU+Linux, it may be because you are coming from another system, and the basic commands vary from shell to shell. If you come from a Windows/MS-DOS background, you may want to define an alias like
|
||||
|
||||
```
|
||||
alias dir='ls'
|
||||
```
|
||||
|
||||
to list files or directories.
|
||||
|
||||
Likewise,
|
||||
|
||||
```
|
||||
alias copy='cp'
|
||||
alias move='mv'
|
||||
```
|
||||
|
||||
may also come in handy, at least until you get used to Linux's new lexicon.
|
||||
|
||||
The other problem occurs when mistakes become ingrained in your muscle memory, so you always mistype some words the same way. I, for instance, have great difficulty typing _admnis-_... _adminsi-_... _A-D-M-I-N-I-S-T-R-A-T-I-ON_ ( _phew!_ ) at speed. That is why some users create aliases like
|
||||
|
||||
```
|
||||
alias sl='ls'
|
||||
```
|
||||
|
||||
and
|
||||
|
||||
```
|
||||
alias gerp='echo "You did it *again*!"; grep'
|
||||
```
|
||||
|
||||
Although we haven't formally introduced `grep` yet, in its most basic form, it looks for a string of characters in a file or a set of files. It's one of those commands that you will tend to use A LOT once you get to grips with it, as those ingrained mistyping habits that force you to type the instruction twice every time get annoying really quickly.
|
||||
|
||||
Another thing to note in the `gerp` example is that it is not a single instruction, but two. The first one (`echo "You did it *again*!"`) prints out a message reminding you that you misspelled the grep command, then there is a semicolon (`;`) that separates one instruction from the other. Finally, you've got the second command (`grep`) that does the actual grepping.
|
||||
|
||||
Using `gerp` on my system to search for the lines containing the word " _alias_ " in _/etc/skel/.bashrc_ , the output looks like this:
|
||||
|
||||
```
|
||||
$ gerp -R alias /etc/skel/.bashrc
|
||||
You did it *again*!
|
||||
alias ls='ls --color=auto'
|
||||
alias grep='grep --colour=auto'
|
||||
alias egrep='egrep --colour=auto'
|
||||
alias fgrep='fgrep --colour=auto'
|
||||
alias cp="cp -i"
|
||||
alias df='df -h'
|
||||
alias free='free -m'
|
||||
alias np='nano -w PKGBUILD'
|
||||
alias more=less
|
||||
shopt -s expand_aliases
|
||||
```
|
||||
|
||||
Running commands sequentially as part of an alias, or, even better, chaining commands so that one command can use the results coughed up by another, is getting us perilously close to Bash scripting. This has been in the making of this series for quite some time, and we'll start covering it in the very next article.
|
||||
|
||||
For the time being, if you want to get rid of an alias you temporarily set up in a running terminal, use the `unalias` command:
|
||||
|
||||
```
|
||||
unalias gerp
|
||||
```
|
||||
|
||||
If you want to make your aliases permanent, you can drop them into the _.bashrc_ file you have in your home directory. This is the same thing we did with custom environment variables in [last week's article][2].
|
||||
|
||||
See you next time!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands
|
||||
|
||||
作者:[Paul Brown][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.linux.com/users/bro66
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts
|
||||
[2]: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise
|
||||
@@ -1,54 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Patch into The Matrix at the Linux command line)
|
||||
[#]: via: (https://opensource.com/article/18/12/linux-toy-cmatrix)
|
||||
[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
|
||||
|
||||
Patch into The Matrix at the Linux command line
|
||||
======
|
||||
Recreate the classic look and feel of everyone's favorite 1990s sci-fi movie code scroller with cmatrix.
|
||||

|
||||
|
||||
You've found your way to today's entry from the Linux command-line toys advent calendar. If this is your first visit to the series, you might be wondering what a command-line toy even is? It's anything that's an entertaining diversion at the terminal, be it a game, a fun utility, or a simple distraction.
|
||||
|
||||
Some of these are classics, and some are completely new (at least to me), but I hope all of you find something you enjoy in this series.
|
||||
|
||||
As we come to the close of another year, it's a good time for looking back, and looking forward. What will 2019 hold for you? What does it mean to be 2019?
|
||||
|
||||
I'm reminded that 2019 will mark the twentieth anniversary of one of my favorite science fiction movies from my teenage years, that at the time had me thinking a lot about what the future would hold: [The Matrix][1]. For a computer nerd kid like me, it was the ultimate story of a computer programmer rising up and becoming an action hero in a virtual universe by tapping into the power of his mind.
|
||||
|
||||
At the time, there was no movie that seemed more futuristic to me; both in the story itself, and in the mesmerizing special effects. Realizing that it was filmed over twenty years ago doesn't change that in my mind.
|
||||
|
||||
Bringing it back to our command-line toy for today, let's recreate the downward flowing code of the Matrix at our terminal with **cmatrix**. **cmatrix** was an easy install for me, packaged for Fedora, so installing it took simply:
|
||||
|
||||
```
|
||||
$ dnf install cmatrix
|
||||
```
|
||||
|
||||
Then, just type **cmatrix **at your terminal to run.
|
||||

|
||||
You can find the source code for **** **cmatrix** [on GitHub][2] under a GPL license.
|
||||
|
||||
Do you have a favorite command-line toy that you think I ought to include? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
|
||||
|
||||
Check out yesterday's toy, [Winterize your Bash prompt in Linux][3], and check back tomorrow for another!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/12/linux-toy-cmatrix
|
||||
|
||||
作者:[Jason Baker][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/jason-baker
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://en.wikipedia.org/wiki/The_Matrix
|
||||
[2]: https://github.com/abishekvashok/cmatrix
|
||||
[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt
|
||||
71
translated/talk/20180623 The IBM 029 Card Punch.md
Normal file
71
translated/talk/20180623 The IBM 029 Card Punch.md
Normal file
@@ -0,0 +1,71 @@
|
||||
IBM 029 型打孔机
|
||||
======
|
||||
我知道这很学院派,可一行超过 80 个字符的代码还是让我抓狂。我也在网上见过不少人认为即在现代视网膜屏幕下也应当采用行长度为 80 个字符的标准,可他们都不理解我对破坏这一标准的怒火,就算 1 个字符也不行。
|
||||
|
||||
在这一标准的黄金时期,一行代码的长度几乎不会超过 80 个字符的限制。在那时,这一限制是物理的,没有第 81 列用于存放第 81 个字符。每一个试图把函数名起的又长又臭的程序员都会在短暂的愉悦后迎来更多的麻烦,而这仅仅时因为没有足够的空间放下整个函数的声明。
|
||||
|
||||
这一黄金时期也是打孔卡编程时期。在 20 世纪 60 年代, IBM 打孔卡的特性,也就是打孔卡的长度为 80 个字符成为了打孔卡的标准。这一标准在后来的电传打字机和哑终端时期得以延续,并逐渐成为操作系统中隐藏的细节。时至今日,即使我们用上了更大、更好的屏幕,偏向于使用更长的标识符而不是类似 `iswcntrl()` 这样令人难以猜测的函数名,可当你打开新的终端模拟器窗口时,默认的宽度依然是 80 个字符。
|
||||
|
||||
从 Quora 上的很多问题中可以发现,很多人并不能想象如何使用打孔卡给计算机编程。我承认,在很长的一段时间里我也不能理解卡编程成是如何工作的,因为这让我想到有很多劳工不停的给这些打孔卡打孔。当然,这是一个误解,程序员不需要亲自给打孔卡打孔,就像是火车调度员不用亲自扳道岔。程序员们有打孔机(也被称为<ruby>键控打孔机<rt>key punches</rt></ruby>),这让他们可以使用打字机式的键盘给打孔卡打孔。这样的设备在 19 世纪 90 年代时就已经不是什么新技术了。
|
||||
|
||||
那时,最为广泛使用的打孔机之一便是 IBM 029 型打孔机。就算在今天,它也许是最棒的打孔机。
|
||||
|
||||
![][1]
|
||||
|
||||
IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件发售的。 System/360 是计算系统与外设所组成的一个系列,在 20 世纪 60 年代晚期,它几乎垄断了整个大型计算机市场。就像其它 System/360 外设一样, 029 型打孔机也是个大块头。那时,计算机和家具的界限还很模糊,但 029 型打孔机可不是那种会占领你的整张桌子的机器。它改进自 026 型打孔机,增加了新的字符支持,如括号,总体上也更加安静。与前辈 026 型所展出 20 世纪 40 年代的圆形按钮与工业化的样貌相比, 029 型的按键方正扁平、功能按键还有酷炫的蓝色高亮提示。它的另一个重要买点是它能够在<ruby>数字区<rt>numeric fields</rt></ruby>左侧自动的填充 0 ,这证明了 JavaScript 程序员不是第一批懒得自己做<ruby>左填充<rt>left-padding</rt></ruby>的程序员。
|
||||
(译者注:这项功能需要额外的 4 张 [<ruby>标准模块系统卡<rt>SMS card</rt></ruby>](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)才能使用。例如设置数字区域长度为 6 列时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch))
|
||||
|
||||
等等!你说的是 IBM 在 1964 年发布了全新的打孔机?你知道那张在贝尔实验室拍摄的 Unix 之父正在使用电传打字机的照片吗?那是哪一年的来着?1970?打孔机不是应该在 20 世纪 60 年代中期到晚期时就过时了吗?是的,你也许会奇怪,为什么直到 1984 年, IBM 的产品目录中才出现 029 型打孔机的身影。事实上,直到 20 世纪 70 年代,大多数程序员仍然在使用打孔卡编程。其实二战期间就已经有人在用电传打字机了,可那时并没能普及。客观的讲,电传打字机几乎和打孔卡一样古老。也许和你想象的恰恰相反,并不是电传打字机本身限制了他的普及,而是计算时间。人们拒绝使用电传打字机的原因是,它是可交互的,它和计算机使用<ruby>“在线”的传输方式<rt>"online" mode of communication</rt></ruby>。在以 Unix 为代表的分时操作系统被发明前,你和电脑的交互会被任何人的使用而打断,而这一点延迟通常意味着几千美元的损失。所以程序员们普遍选择离线地使用打孔机编程,再将打孔卡放入大型计算机中,作为<ruby>批任务<rt>batch job</rt></ruby>执行。在那时,还没有即廉价又可靠的存储设备,可打孔卡的廉价优势已经足够让他成为那时最流行的数据存储方式了。那时的程序是书架上一落的打孔卡而不是硬盘里的一堆文件。
|
||||
|
||||
那么实际使用 IBM 029 型打孔机是个什么样子呢?这很难向没有实际看过打孔卡的人解释。一张打孔卡通常有12行80列。打孔卡下面是从 1 到 9 的<ruby>数字行<rt>digit rows</rt></ruby>,打孔卡上的每一列都有这些行所对应的数字。最上面的三行是<ruby>空间行<rt>"zone" rows</rt></ruby>,通常由两行空白行和一行 0 行组成。第 12 行是打孔卡最顶层的行,接下来是 11 行,随后是从数字 0 到 9 所在的行。这个有点让人感到困惑的顺序的原因是打孔卡的上边缘被称为<ruby>12 边<rt>12 edge</rt></ruby>、下边缘被称为 <ruby>9 边<rt>9 edge</rt></ruby>。那时,为了让打孔卡便于整理,常常会剪去打孔卡的一个角。
|
||||
|
||||
![][2]
|
||||
(译者注:可参考[EBCDIC 编码](https://zh.wikipedia.org/wiki/EBCDIC))
|
||||
|
||||
在打孔卡发明之初,孔洞的形状是圆形的,但是 IBM 最终意识到如果使用窄长方形作为孔洞,一张卡就可以放下更多的列了。每一列中孔洞的不同组合就可以表达不同的字符。像 029 型这样的拥有人性化设计的打孔机除了完成本质的打孔任务外,还会在打孔卡最上方打印出每一列所对应的字符。输入是数字就在对应的数字行上打孔。输入的是字母或符号就用一个在空间列的孔和一或俩个在数字列的孔的组合表示,例如字母 A 就用一个在第 12 空间行的空和一个数字 1 所在行的孔表示。这是一种顺序编码,在第一台打孔机被发明后,也叫 Hollerith 编码。这种编码只能表示相对较小的一套字符集,小写字母就没有包含在这套字符集中,但它的优势在于保留了打孔卡的结构强度。如果直接使用二进制编码,打孔卡可能会因为孔洞过于密集而断裂。
|
||||
|
||||
打孔卡也有不同。在 20 世纪 60 年代,80 列虽然是标准,但表达的方式不一定相同。基础打孔卡是无标注的,但用于 COBOL 编程的打孔卡会把最后的 8 列保留,供标识数保存使用。这一标识数可以在打孔卡被打乱 (例如一叠打孔卡掉在地上了) 后用于自动排序。此外,第 7 列被用于表示本张打孔卡上的是否是上一张打孔卡一起构成一条语句。也就是说当你真的对 80 字符的限制感到绝望的时候,还可以用两张卡甚至更多的卡拼接成一条长语句。用于 FORTRAN 编程的打孔卡和 COBOL 打孔卡类似,但是定义的列不同。大学里使用的打孔卡通常会由其计算机中心加上水印,其他的设计则会在如 [1976 年美国独立 200 周年][3] 的特殊场合才会加入。
|
||||
|
||||
最终,这些打孔卡都要被计算机读取和计算。 IBM 出售的 System/360 大型计算机的外设 IBM 2540 可以以每分钟 1000 张打孔卡的速度读取这些卡片。IBM 2540 使用电刷扫过每张打孔卡,电刷通过孔洞就可以接触到卡片后面的金属板完成一次读取。一旦读取完毕, System/360 大型计算机就会把每张打孔卡上的数据使用一种定长的 8 位编码保存,这种编码是<ruby>扩展的二进制十数交换码<rt>Extended Binary Coded Decimal Interchange Code</rt></ruby>,简写为 EBCDIC 编码。它的源自于早期打孔卡所使用的 BCDIDC 编码,这一 6 位编码使用低 4 位表示数字行,高 2 位表示空间行。程序员们在打孔卡上编写玩程序后,会把卡片们交给计算机操作员,操作员们会把这些卡片放入 IBM 2540 ,再把打印结果交给程序员。那时的程序员大多都没有见过计算机长什么样。
|
||||
|
||||
程序员们真正能见到的是很多打孔机。 029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由<ruby>密歇根大学<rt>University of Michigan</rt></ruby>在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。
|
||||
|
||||
029 型打孔机的结构围绕着一个打孔卡穿过机器的 U 形轨道开始。使用打孔机时,右手边也就是 U 形轨道的右侧顶部是<ruby>进卡卡槽<rt>hopper</rt></ruby>,使用前通常在里面放入一叠未使用的打孔卡。虽然 029 型打孔机主要使用 80 列打孔卡,但在需要的情况下也可以使用更小号的打孔卡。在打孔机的使用过程中,打孔卡离开轨道右上端的进卡卡槽,顺着 U 形轨道移动并最终进入左上端的<ruby>出卡卡槽<rt>stacker</rt></ruby>。这一流程可以保证出卡卡槽中的打孔卡按打孔时的先后顺序排列。
|
||||
|
||||
029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “<ruby>装入<rt>FEED</rt></ruby>” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “<ruby>释放<rt>REL (for release)</rt></ruby>” 键完成上面的操作。
|
||||
|
||||
在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被<ruby>复原<rt>unpunched</rt></ruby>,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。 IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。
|
||||
|
||||
实际上,只有废弃错误的打孔卡再在新的打孔卡上重新打孔这一种修正错误的方式。这就是阅读区的用武之处了。当你发现打孔卡上的第 68 列出错时,你需要在新的打孔卡上小心的给前 67 列打孔,然后给第 68 列打上正确的字母。另一种操作方式是把带有错误信息的打孔卡放在阅读区,同时在打孔操作区载入一张新的打孔卡,然后按下 “<ruby>重复<rt>DUP (for duplicate)</rt></ruby>” 按键直到列数指示器显示 68 列。这时按下正确的字符来修正错误。阅读区和重复按键使得 029 型打孔机很容易复制打孔卡上的内容。当然,这一功能的使用可能有各种各样的原因,但改错是最常见的。
|
||||
|
||||
“重复”按键允许 029 型打孔机的操作员手动调用重复的函数。但是 029 型打孔机还可以设置为自动重复。当用于记录数据而不是编程时,这项功能十分有效。举个例子,当用打孔卡来记录大学生的信息时,每张卡片上都需要输入学生的宿舍楼的名字,如果发现所输入信息的学生都在同一栋楼,就可以使用 029 型打孔机的自动重复功能来完成宿舍楼名称的填写。
|
||||
|
||||
像这样的自动化操作可以通过打孔卡给 029 型打孔机编程控制。安装打孔卡的<ruby>圆柱形装置<rt>drum</rt></ruby>就在 U 形轨道中间部分的右上角。通过使用 029 型在打孔卡上写下程序,然后把打孔卡的装入圆柱形装置,再将其安装到打孔机内后,就完成了一次给 029 型打孔机的编程任务。用户可以通过这种方式对打孔卡的每一列都按需要定义不同的自动化操作。029 型打孔机允许指定某些列重复上一张打孔卡相同位置的字符,这就是它能更快的输入学生信息的理由。它还允许指定某些列只能输入数字或者字母,指定特定的列为空或者到某一列时就直接跳过一整张打孔卡。这样的可编程特性使它在输入拥有固定格式的数据时效率很高。密歇根大学制作的[进阶教学视频][5]包括了给 029 型打孔机编程的过程,如果你已经掌握了它的基础操作,就快去看看吧。
|
||||
|
||||
这会儿,无论你是否看了密歇根大学制作的视频,都会感叹打孔机的操作之简便。虽然修正错误的过程很乏味,但除此之外,操作一台打孔机并不像想象的那样复杂。我甚至可以想象打孔卡之间的无缝切换让 COBOL 和 FORTRAN 程序员忘记了他们的程序是打在不同的打孔卡上而不是写在一个连续的文本文件内。另一方面,思考一下打孔机是如何影响编程语言的发展也是很有趣的,虽然它仅仅是一台输入设备。结构化编程最终会出现并鼓励程序员把整个代码块视为一个整体,但可以想象打孔卡程序员们强调每一行的作用且难以认同结构化编程的场景。同时你能够理解他们为什么不把代码块闭合所使用的括号放在单独的一行,只是因为这样会浪费打孔卡。
|
||||
|
||||
现在,虽然没有人再使用打孔卡编程了,每个程序员都该试试[这个][6],哪怕一次也好。或许你因此能够更好的理解 COBOL 和 FORTRAN 的历史,或许你就能体会到为什么每个人把 80 个字符作为长度限制的标注。
|
||||
|
||||
喜欢吗?这里每两周都会发表一篇这样的文章。请在推特上关注我们 [@TwoBitHistory][7] 或者订阅我们的 [RSS][8],这样你就能在第一时间收到新文章的通知。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://twobithistory.org/2018/06/23/ibm-029-card-punch.html
|
||||
|
||||
作者:[Two-Bit History][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wwhio](https://github.com/wwhio)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://twobithistory.org
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://twobithistory.org/images/ibm029_front.jpg
|
||||
[2]: https://twobithistory.org/images/card.png
|
||||
[3]: http://www.jkmscott.net/data/Punched%20card%20013.jpg
|
||||
[4]: https://www.youtube.com/watch?v=kaQmAybWn-w
|
||||
[5]: https://www.youtube.com/watch?v=SWD1PwNxpoU
|
||||
[6]: http://www.masswerk.at/keypunch/
|
||||
[7]: https://twitter.com/TwoBitHistory
|
||||
[8]: https://twobithistory.org/feed.xml
|
||||
@@ -0,0 +1,235 @@
|
||||
我的个人电子邮件系统 - Notmuch, mbsync,postfix and dovecot
|
||||
======
|
||||
我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷茫了。所以这篇文章是一个自己的文档, 这样我就不用费劲就能修正过来。
|
||||
|
||||
### 服务器端
|
||||
|
||||
我运行自己的邮件服务器, 并使用 Postfix 作为 SMTP 服务器和用 Dovecot 实现 IMAP 。我不打算详细介绍如何配置这些设置, 因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill ?(用 Jonas 自己的话说)
|
||||
|
||||
> <jonas> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式<jonas> 我延申了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info)
|
||||
|
||||
除此之外, 我还有一个 dovecot sieve 过滤, 根据邮件的来源, 对高级邮件进行分类, 并将其分类到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 ~/dovecot.sieve文件中。
|
||||
|
||||
再次, 我不详细介绍如何设置这些东西, 因为这不是我这个帖子的目标。
|
||||
|
||||
### 在我的笔记本电脑上
|
||||
|
||||
在我的笔记本电脑上,我已经按照4个部分设置
|
||||
|
||||
1. 邮件同步: 使用 mbsync 命令完成
|
||||
2. 分类: 使用 notmuch 完成
|
||||
3. 阅读: 使用 notmuch-emacs 完成
|
||||
4. 邮件发送: 使用作为转接服务器和 SMTP 客户端运行的 postfix 完成。
|
||||
|
||||
|
||||
|
||||
### 邮件同步
|
||||
|
||||
邮件同步是使用 mbsync 工具完成的, 我以前是 OfflineIMAP 的用户,最近切换到 mbsync,因为我觉得它比 OfflineIMAP 的配置更轻,更简单。命令是由包 isync 提供的。
|
||||
|
||||
配置文件是 ~/.mbsyncrc. 下面是我的例子与一些个人设置。
|
||||
|
||||
```
|
||||
IMAPAccount copyninja
|
||||
Host imap.copyninja.info
|
||||
User vasudev
|
||||
PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg"
|
||||
SSLType IMAPS
|
||||
SSLVersion TLSv1.2
|
||||
CertificateFile /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
|
||||
IMAPAccount gmail-kamathvasudev
|
||||
Host imap.gmail.com
|
||||
User kamathvasudev@gmail.com
|
||||
PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg"
|
||||
SSLType IMAPS
|
||||
SSLVersion TLSv1.2
|
||||
CertificateFile /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
IMAPStore copyninja-remote
|
||||
Account copyninja
|
||||
|
||||
IMAPStore gmail-kamathvasudev-remote
|
||||
Account gmail-kamathvasudev
|
||||
|
||||
MaildirStore copyninja-local
|
||||
Path ~/Mail/vasudev-copyninja.info/
|
||||
Inbox ~/Mail/vasudev-copyninja.info/INBOX
|
||||
|
||||
MaildirStore gmail-kamathvasudev-local
|
||||
Path ~/Mail/Gmail-1/
|
||||
Inbox ~/Mail/Gmail-1/INBOX
|
||||
|
||||
Channel copyninja
|
||||
Master :copyninja-remote:
|
||||
Slave :copyninja-local:
|
||||
Patterns *
|
||||
Create Both
|
||||
SyncState *
|
||||
Sync All
|
||||
|
||||
Channel gmail-kamathvasudev
|
||||
Master :gmail-kamathvasudev-remote:
|
||||
Slave :gmail-kamathvasudev-local:
|
||||
# Exclude everything under the internal [Gmail] folder, except the interesting folders
|
||||
Patterns * ![Gmail]*
|
||||
Create Both
|
||||
SyncState *
|
||||
Sync All
|
||||
```
|
||||
|
||||
对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许你提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我在我磁盘上的一些地方使用对称加密 gpg 和存储密码。这当然是由 Unix ACL 保护安全。
|
||||
|
||||
实际上, 我想使用我的公钥加密文件, 但当脚本在后台或通过 systemd 运行时, 解锁文件看起来很困难 (或看起来几乎不可能)。如果你有更好的建议, 我洗耳恭听:-)。
|
||||
|
||||
下一个指令部分是模式。这使你可以有选择地同步来自邮件服务器的邮件。这对我来说真的很有帮助, 可以排除所有的垃圾 [Gmail]/ folders.
|
||||
|
||||
### 邮件分类
|
||||
|
||||
一旦邮件在你本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置相比于设置所有服务器软件是有点大题小作, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。
|
||||
|
||||
不多的情况下我想很容易索引通过千兆字节的邮件档案, 并得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
MBSYNC=$(pgrep mbsync)
|
||||
NOTMUCH=$(pgrep notmuch)
|
||||
|
||||
if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then
|
||||
echo "Already running one instance of mail-sync. Exiting..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Deleting messages tagged as *deleted*"
|
||||
notmuch search --format=text0 --output=files tag:deleted |xargs -0 --no-run-if-empty rm -v
|
||||
|
||||
echo "Moving spam to Spam folder"
|
||||
notmuch search --format=text0 --output=files tag:Spam and \
|
||||
to:vasudev@copyninja.info | \
|
||||
xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur
|
||||
notmuch search --format=text0 --output=files tag:Spam and
|
||||
to:vasudev-debian@copyninja.info | \
|
||||
xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur
|
||||
|
||||
|
||||
MDIR="vasudev-copyninja.info vasudev-debian Gmail-1"
|
||||
mbsync -Va
|
||||
notmuch new
|
||||
|
||||
for mdir in $MDIR; do
|
||||
echo "Processing $mdir"
|
||||
for fdir in $(ls -d /home/vasudev/Mail/$mdir/*); do
|
||||
if [ $(basename $fdir) != "INBOX" ]; then
|
||||
echo "Tagging for $(basename $fdir)"
|
||||
notmuch tag +$(basename $fdir) -inbox -- folder:$mdir/$(basename $fdir)
|
||||
fi
|
||||
done
|
||||
done
|
||||
```
|
||||
|
||||
因此, 在运行 mbsync 之前, 我搜索所有标记为已删除的邮件, 并将其从系统中删除。接下来, 我在我的帐户上查找标记为 "垃圾邮件" 的邮件, 并将其移动到垃圾邮件文件夹。你做的对,这些邮件逃脱垃圾邮件过滤器进到我的 inbox ,并被我亲自标记为垃圾邮件。
|
||||
|
||||
运行 mbsync 后, 我基于他们的文件夹标记邮件 (搜索字符串文件夹:)。这让我可以很容易地得到一个邮件列表的内容, 而不需要记住列表地址。
|
||||
|
||||
### 阅读邮件
|
||||
|
||||
现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层(private layer),它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。你可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。
|
||||
|
||||
### 发送邮件
|
||||
|
||||
如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是最近是我感到迷茫的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。
|
||||
|
||||
我的设置发送邮件使用 postfix 作为 SMTP 客户端与我自己的 SMTP 服务器作为它的转接主机。转接的问题是, 它不是具有动态 IP 的主机。有几种方法可以允许具有动态 ip 的主机使用转接服务器, 一种是将邮件从其中发源于 my_network 或第二个使用 SASL 身份验证的 IP 地址。
|
||||
|
||||
我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法)
|
||||
```
|
||||
adduser <hostname>_relay
|
||||
|
||||
```
|
||||
|
||||
这里替换 <hostname> 与你的笔记本电脑的名称或任何你正在使用的设备。现在我们需要调整 postfix , 作为转接服务器。因此, 在 postfix 配置中添加以下行
|
||||
```
|
||||
# SASL authentication
|
||||
smtp_sasl_auth_enable = yes
|
||||
smtp_tls_security_level = encrypt
|
||||
smtp_sasl_tls_security_options = noanonymous
|
||||
relayhost = [smtp.copyninja.info]:submission
|
||||
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
|
||||
```
|
||||
|
||||
因此, 这里的 relayhost 是你的 postfix 实例将用于邮件转发到互联网的服务器名称。submission 的部分 postfix 将邮件转发到端口 587 (安全)。smtp_sasl_tls_security_options 设置为不允许匿名连接。这必须使转接服务器信任你的移动主机, 并同意为你转发邮件。
|
||||
|
||||
/etc/postfix/sasl__asswd 是你需要存储用于服务器 SASL 身份验证的帐户密码的文件。将以下内容放入其中。
|
||||
```
|
||||
[smtp.example.com]:submission user:password
|
||||
|
||||
```
|
||||
|
||||
用你的 SMTP 服务器名称替换 smtp.example.com ,你已输入的 relayhost 认证。 用你创建的用户及其密码替换 user with <hostname>_relay 。
|
||||
|
||||
若要保护 sasl_passwd 文件, 并创建它的 hash(哈希) 进行 postfix 使用以下命令。
|
||||
```
|
||||
chown root:root /etc/postfix/sasl_passwd
|
||||
chmod 0600 /etc/postfix/sasl_passwd
|
||||
postmap /etc/postfix/sasl_passwd
|
||||
```
|
||||
|
||||
最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是你的文件的 hash /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从你的系统中取出。
|
||||
|
||||
### Bonus 的部分
|
||||
|
||||
好吧, 因为我有一个脚本创建以上结合了邮件的同步和分类。我继续创建了一个 systemd 计时器, 以定期同步后台的邮件。就我而言, 每10分钟一次。下面是 mailsync.timer 文件。
|
||||
```
|
||||
[Unit]
|
||||
Description=Check Mail Every 10 minutes
|
||||
RefuseManualStart=no
|
||||
RefuseManualStop=no
|
||||
|
||||
[Timer]
|
||||
Persistent=false
|
||||
OnBootSec=5min
|
||||
OnUnitActiveSec=10min
|
||||
Unit=mailsync.service
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
```
|
||||
|
||||
下面是 mailsync. 服务, 这是邮件同步计时器执行我们的脚本所需要的。
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Check Mail
|
||||
RefuseManualStart=no
|
||||
RefuseManualStop=yes
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/bin/mail-sync
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
```
|
||||
|
||||
将这些文件置于 /etc/systemd/user 目录下并运行以下代码去开启它们
|
||||
```
|
||||
systemctl enable --user mailsync.timer
|
||||
systemctl enable --user mailsync.service
|
||||
systemctl start --user mailsync.timer
|
||||
```
|
||||
|
||||
这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew ,他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://copyninja.info/blog/email_setup.html
|
||||
|
||||
作者:[copyninja][a]
|
||||
译者:[lixinyuxx](https://github.com/lixinyuxx)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://copyninja.info
|
||||
[1]:https://source.copyninja.info/notmuch-emacs-layer.git/
|
||||
@@ -1,128 +0,0 @@
|
||||
# 迁移到 Linux 工作环境: 网络和系统设置
|
||||
|
||||

|
||||
|
||||
在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到Linux。如果你错过了以前的文章,可以从这访问:
|
||||
|
||||
[Part 1 - 基本介绍][1]
|
||||
|
||||
[Part 2 - 磁盘、文件和文件系统][2]
|
||||
|
||||
[Part 3 - 图形界面环境][3]
|
||||
|
||||
[Part 4 - 命令行][4]
|
||||
|
||||
[Part 5 - 使用 sudo 命令][5]
|
||||
|
||||
[Part 6 - 软件安装][6]
|
||||
|
||||
Linux 提供了一系列网络和系统设置。在桌面上,Linux允许您调整系统上的任何内容。大多数这些设置都在/ etc目录下的纯文本文件中公开。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。
|
||||
|
||||
|
||||
|
||||
大多数设置都能够在设置程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。
|
||||
|
||||
|
||||
|
||||
### 连接因特网
|
||||
|
||||
在Linux中连接到Internet通常非常简单。如果您通过以太网电缆连接,Linux通常会在插入电缆时或启动时获得IP地址并自动连接(如果电缆已连接)。
|
||||
|
||||
如果您使用无线,则在大多数发行版中都有一个菜单,可以在指示器面板中或在设置中(取决于您的发行版),您可以在其中选择无线网络的SSID。如果网络受密码保护,它通常会提示您输入密码。 然后连接,这个过程相当顺利。
|
||||
|
||||
在图形界面您可以通过进入设置来调整网络设置。通常称为系统设置或者是设置。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。
|
||||
|
||||
![Network Settings][8]
|
||||
|
||||
图1: Gnome 桌面网络设置指示器图标.
|
||||
|
||||
[经许可使用][9]
|
||||
|
||||
### 网络接口名称
|
||||
|
||||
在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 - 或以太网和无线。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。
|
||||
|
||||
### 通过命令行进行网络管理
|
||||
|
||||
如果您希望更好地控制网络设置,或者如果您在没有图形桌面的情况下管理网络连接,则还可以从命令行管理网络。
|
||||
|
||||
请注意,用于在图形桌面中管理网络的最常用服务是网络管理器,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。
|
||||
|
||||
更改图形环境中的设置很可能与网络管理器交互,您还可以使用名为nmtui的工具从命令行更改网络管理器设置。nmtui工具提供了您在图形环境中找到的所有设置,但是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图2)。
|
||||
|
||||

|
||||
|
||||
图 2:nmtui 界面
|
||||
|
||||
[经许可使用][9]
|
||||
|
||||
在命令行上,有一个名为 ifconfig 的旧工具来管理网络,还有一个名为 ip 的新工具。在某些发行版中,ifconfig 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,ifconfig 仍可以使用。
|
||||
|
||||
以下是一些允许您显示和更改网络设置的命令:
|
||||
|
||||

|
||||
|
||||
[经许可使用][9]
|
||||
|
||||
### 进程和系统信息
|
||||
|
||||
在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能.。
|
||||
|
||||
在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可以使用的图形工具。大多数所共有的工具是 System Monitor 和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。
|
||||
|
||||

|
||||
|
||||
图 3:NetHogs 截图
|
||||
|
||||
[经许可使用][9]
|
||||
|
||||
在这些工具中,你也可以查看系统全局网络流量(图 4)。
|
||||
|
||||
![System Monitor][11]
|
||||
|
||||
图4: Gnome System Monitor 的截图
|
||||
|
||||
[经许可使用][9]
|
||||
|
||||
### 管理进程和系统使用
|
||||
|
||||
您还可以从命令行使用相当多的工具。使用 ps 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 ps 命令不会使用可以使用命令 info ps 或者 man ps。
|
||||
|
||||
大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或CPU时间的进程。这种情况下有两个非常简单的命令,分别是 top 和 htop 命令(图 5)。
|
||||
|
||||

|
||||
|
||||
top 和 htop 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。
|
||||
|
||||
使用两个命令时 (top and htop),你可以输入 ”?“ 来获取使用帮助,输入 ”q“ 来退出程序。使用 top 命令你可以按”k“键然后输入进程 ID 来杀死某个进程。
|
||||
|
||||
使用 htop 命令时你可以使用 ↑↓ 键来将列表中的一条记录进行高亮显示,按下 F9 键会杀死进程(需要回车确认)。
|
||||
|
||||
本系列中提供的信息和工具将帮助您开始使用 Linux。 只需一点时间和耐心,您就会感到这非常舒服。
|
||||
|
||||
想学习更多 Linux 内容可访问免费的 ["Linux 简介" ][12]课程,此课程来自 Linux 基金会和 edx.
|
||||
|
||||
------
|
||||
|
||||
via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system-settings
|
||||
|
||||
作者:[John Bonesio][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[ScarboroughCoral](https://github.com/ScarboroughCoral)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linux.com/users/johnbonesio
|
||||
[1]: https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction
|
||||
[2]: https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems
|
||||
[3]: https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments
|
||||
[4]: https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line
|
||||
[5]: https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo
|
||||
[6]: https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software
|
||||
[7]: https://www.linux.com/files/images/figure-1png-2
|
||||
[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings"
|
||||
[9]: https://www.linux.com/licenses/category/used-permission
|
||||
[10]: https://www.linux.com/files/images/figure-4png-1
|
||||
[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor"
|
||||
[12]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
||||
@@ -0,0 +1,139 @@
|
||||
用户,组和其他 Linux 用户
|
||||
======
|
||||
|
||||

|
||||
|
||||
到这个阶段,[在看到如何操作目录或文件夹之后][1],但在让自己一头扎进文件之前,我们必须重新审视 _权限_, _users_ 和 _group_。幸运的是,[有一个网站上已经有了一个优秀而全面的教程,包括了权限][2],所以你应该去立刻阅读它。简而言之,你使用权限来确定谁可以对文件和目录执行操作,以及他们可以对每个文件和目录执行什么操作 -- 从中读取,写入,擦除等等。
|
||||
|
||||
要尝试本教程涵盖的所有内容,你需要在系统上创建新用户。让我们实践起来,为每一个需要借用你电脑的人创建一个用户,我们称之为 _guest 账户_。
|
||||
|
||||
**警告:** _例如,如果你错误地删除了自己的用户和目录,那么创建,特别是删除用户以及主目录会严重损坏系统。你可能不想在你日常的工作机中练习,那么请在另一台机器或者虚拟机上练习。无论你是否想要安全地练习,经常备份你的东西总是一个好主意。检查备份是否正常工作,为你自己以后避免很多咬牙切齿的事情。_
|
||||
|
||||
### 一个新用户
|
||||
|
||||
你可以使用 `useradd` 命令来创建一个新用户。使用超级用户或 root 权限运行 `useradd`,即使用 `sudo` 或 `su`,这具体取决于你的系统,你可以:
|
||||
```
|
||||
sudo useradd -m guest
|
||||
```
|
||||
|
||||
然后输入你的密码。或者也可以这样:
|
||||
```
|
||||
su -c "useradd -m guest"
|
||||
```
|
||||
|
||||
然后输入 root 或超级用户的密码。
|
||||
|
||||
(_为了简洁起见,我们将从现在开始假设你使用 `sudo` 获得超级用户或 root 权限。_)
|
||||
|
||||
通过使用 `-m` 参数,`useradd` 将为新用户创建一个主目录。你可以通过列出 _/home/guest_ 来查看其内容。
|
||||
|
||||
然后你可以使用以下命令来为新用户设置密码:
|
||||
```
|
||||
sudo passwd guest
|
||||
```
|
||||
|
||||
或者你也可以使用 `adduser`,这是一个交互式的命令,它会询问你一些问题,包括你要为用户分配的 shell(是的,不止一个),你希望其主目录在哪里,你希望他们属于哪些组(有关这点稍后会讲到)等等。在运行 `adduser` 结束时,你可以设置密码。注意,默认情况下,在许多发行版中都没有安装 `adduser`,但安装了 `useradd`。
|
||||
|
||||
顺便说一下,你可以使用 `userdel` 来移除一个用户:
|
||||
```
|
||||
sudo userdel -r guest
|
||||
```
|
||||
|
||||
使用 `-r` 选项,`userdel` 不仅删除了 _guest_ 用户,还删除了他们的主目录和邮件中的条目(如果有的话)。
|
||||
|
||||
### home 中的内容
|
||||
|
||||
谈到用户的主目录,它依赖于你所使用的发行版。你可能已经注意到,当你使用 `-m` 选项时,`useradd` 使用子目录填充用户的目录,包括音乐,文档和诸如此类的内容以及各种各样的隐藏文件。要查看 guest 主目录中的所有内容,运行 `sudo ls -la /home/guest`。
|
||||
|
||||
进入新用户目录的内容通常是由 _/etc/skel_ 架构目录确定的。有时它可能是一个不同的目录。要检查正在使用的目录,运行:
|
||||
```
|
||||
useradd -D
|
||||
GROUP=100
|
||||
HOME=/home
|
||||
INACTIVE=-1
|
||||
EXPIRE=
|
||||
SHELL=/bin/bash
|
||||
SKEL=/etc/skel
|
||||
CREATE_MAIL_SPOOL=no
|
||||
```
|
||||
|
||||
这给你一些额外的有趣信息,但你现在感兴趣的是 `SKEL=/etc/skel` 这一行,在这种情况下,按照惯例,它指向 _/etc/skel/_。
|
||||
|
||||
由于 Linux 中的所有东西都是可定制的,因此你可以更改那些放入新创建的用户目录的内容。试试这样做:在 _/etc/skel/_ 中创建一个新目录:
|
||||
```
|
||||
sudo mkdir /etc/skel/Documents
|
||||
```
|
||||
|
||||
然后创建一个包含欢迎消息的文件,并将其复制过来:
|
||||
```
|
||||
sudo cp welcome.txt /etc/skel/Documents
|
||||
```
|
||||
|
||||
现在删除 guest 账户:
|
||||
```
|
||||
sudo userdel -r guest
|
||||
```
|
||||
|
||||
再次创建:
|
||||
```
|
||||
sudo useradd -m guest
|
||||
```
|
||||
|
||||
嘿 presto!(to 校正:这个 presto 是什么?)你的 _Documents/_ 目录和 _welcome.txt_ 文件神奇地出现在了 guest 的主目录中。
|
||||
|
||||
你还可以在创建用户时通过编辑 _/etc/default/useradd_ 来修改其他内容。我的看起来像这样:
|
||||
```
|
||||
GROUP=users
|
||||
HOME=/home
|
||||
INACTIVE=-1
|
||||
EXPIRE=
|
||||
SHELL=/bin/bash
|
||||
SKEL=/etc/skel
|
||||
CREATE_MAIL_SPOOL=no
|
||||
```
|
||||
|
||||
这些选项大多数都是不言自明的,但让我们仔细看看 `GROUP` 选项。
|
||||
|
||||
### 群组心态
|
||||
|
||||
Linux 和其他类 Unix 操作系统依赖于 _groups_,而不是逐个为用户分配权限和特权。一个组就是你想象的那样:一群在某种程度上相关的用户。在你的系统上可能有一组允许使用打印机的用户,他们属于 _lp_(即 "_line printer_")组。传统上 _wheel_ 组的成员是唯一可以通过使用 _su_ 成为超级用户或 root 的成员。_network_ 用户组可以启动或关闭网络。还有许多诸如此类的。
|
||||
|
||||
不同的发行版有不同的组,具有相同或相似名称的组具有不同的权限,这也取决于你使用的发行版。因此,如果你在前一段中读到的内容与你系统中的内容不匹配,不要感到惊讶。
|
||||
|
||||
不管怎样g,要查看系统中有哪些组,你可以使用:
|
||||
```
|
||||
getent group
|
||||
```
|
||||
|
||||
`getent` 命令列出了某些系统数据库的内容。
|
||||
|
||||
要查找当前用户所属的组,尝试:
|
||||
```
|
||||
groups
|
||||
```
|
||||
|
||||
当你使用 `useradd` 创建新用户时,除非你另行指定,否则用户讲只属于一个组:他们自己。一个 _guest_ 用户属于 _guest_ 组。组使用户有权管理自己的东西,仅此而已。
|
||||
|
||||
你可以使用 `groupadd` 命令创建新组,然后添加用户:
|
||||
```
|
||||
sudo groupadd photos
|
||||
```
|
||||
|
||||
例如,这将创建 _photos_ 组。下一次,我们将使用它来构建一个共享目录,该组的所有成员都可以读取和写入,我们将更多地了解权限和特权。敬请关注!
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts
|
||||
|
||||
作者:[Paul Brown][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[MjSeven](https://github.com/MjSeven)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/bro66
|
||||
[1]:https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux
|
||||
[2]:https://www.linux.com/learn/understanding-linux-file-permissions
|
||||
[3]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
||||
@@ -1,60 +0,0 @@
|
||||
认识存储:块、文件和对象
|
||||
======
|
||||
|
||||

|
||||
|
||||
现在,对于那些创建或消费数据的公司来说,处理生成的数量巨大的数据是个非常大的挑战。而对于那些解决存储相关问题的科技公司来说,也是一个挑战。
|
||||
|
||||
Red Hat 存储首席产品营销经理 Michael St. Jean 说,“数据每年呈几何级增长,而我们发现数据大量增长的主要原因是由于消费增长和为拓展价值而进行的产业转型,毫无疑问,物联网对数据增长的贡献很大,但对软件定义存储来说最重要的挑战是,如何处理用户场景相关的数据增长。“
|
||||
|
||||
任何挑战都意味着机遇。Azure 存储、介质和边缘总经理 Tad Brockway 说,“今天,新旧数据源产生的海量数据为我们满足客户在规模、性能、灵活性、治理方面急剧增长的需求提供了一个机遇。”
|
||||
|
||||
### 现代软件定义存储的三种类型
|
||||
|
||||
这里有三个不同类型的存储解决方案 — 块、文件、和对象 — 虽然它们每个都可以与其它的共同工作,但它们每个都有不同的用途。
|
||||
|
||||
块存储是数据存储的最古老形式,数据都存储在固定长度的块或多个块中。块存储适用于企业存储环境,并且通常使用光纤通道或 iSCSI 接口。根据 SUSE 软件定义存储高级产品经理 Larry Morris 的说法,“块存储要求一个应用去映射存储设备上存储数据块的位置”。
|
||||
|
||||
块存储在存储区域网和软件定义存储系统中是虚拟的,它是处于一个共享的硬件基础设施上的抽象逻辑设备,它创建和存在于服务器、虚拟服务器、或运行在基于像 SCSI、SATA、SAS、FCP、FCoE、或 iSCSI 这样的协议的系统管理程序上。
|
||||
|
||||
St. Jean 说“块存储将单个的存储卷(像一个虚拟或云存储节点、或一个老式硬盘)分割成单独的被称为块的实体。“
|
||||
|
||||
每个块独立存在,并且能够用它自己的数据传输协议和操作系统格式化 — 给用户完全的配置自主权。由于块存储系统并不负责像文件存储系统那样的文件查找职责,所以,块存储是一个非常快的存储系统。由于同时具备速度和配置灵活性,使得块存储非常适合原始服务器存储或富媒体数据库。
|
||||
|
||||
块存储适合于宿主机操作系统、应用程序、数据库、完整虚拟机和容器。传统上,块存储仅能够被独立的机器、或集群中呈现出的机器访问。
|
||||
|
||||
### 基于文件的存储
|
||||
|
||||
基于文件的存储使用一个文件系统去映射存储设备上数据的存储位置。这种技术在直接或网络附加存储系统应用领域中处于支配地位。它需要做两件事情:组织数据并呈现给用户。 St. Jean 说,”使用文件存储时,数据在服务器侧的排列格式与客户端用户所看到的是完全相同的。这就允许用户通过一些唯一标识符(像文件名、位置、或 URL)去请求一个文件,使用特定的数据传输协议与存储系统沟通。
|
||||
|
||||
最终成为了一种能够从上到下进行浏览的分层的文件结构。文件存储处于块存储之上,允许用户去查看和访问文件、文件夹这样的数据,但是限制访问处于这些文件和文件夹之下的数据块。
|
||||
|
||||
Brockway 解释说,“文件存储一般用于像 NFS 和 CIFS/SMB 这种很多服务器基于 IP 网络进行访问的共享文件系统上。访问控制通过用户和组的权限实现在文件、目录、和导出级别上。基于文件的存储可用于被多个用户和机器、二进制应用程序、数据库、虚拟机所需要的文件的存储上,以及容器上。“
|
||||
|
||||
### 对象存储
|
||||
|
||||
对象存储是最新的数据存储形式,它为非结构化数据提供一个库,它将内容从索引中分离出来,并允许多个文件连接到一个对象上。一个对象就是与任何相关元数据配对的一个数据块,这些元数据提供对象中包含的字节的上下文(比如数据创建时间和数据大小等)。也就是说这两样东西 — 数据和元数据 — 构成了一个对象。
|
||||
|
||||
对象存储的一个好处是每个数据块都关联了一个唯一标识符。访问数据需要唯一标识符,并且不需要应用程序或用户知道数据的真实存储位置。对象数据是通过 API 来访问的。
|
||||
|
||||
St. Jean 说,“对象中存储的数据是没有压缩和加密的,对象本身被安排在对象存储(一个填满其它对象的中心库)中或容器(包含应用程序运行所需要的所有文件的一个包)中。与文件存储系统的层次结构相比,对象、对象存储和容器在本质上是平面的 — 这使得它们在存储规模巨大时访问速度很快。”
|
||||
|
||||
对象存储可以扩展到很多 PB 字节大小,以适应巨大的数据集,因此它是图像、音频、视频、日志、备份、和分析服务所使用的数据存储的最佳选择。
|
||||
|
||||
### 结论
|
||||
|
||||
现在你已经知道了各种类型的存储以及它们的用处。后面我们将继续研究这个主题的更多内容,敬请关注。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/2018/9/know-your-storage-block-file-object
|
||||
|
||||
作者:[Swapnil Bhartiya][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[qhwdw](https://github.com/qhwdw)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linux.com/users/arnieswap
|
||||
[1]: https://events.linuxfoundation.org/events/elc-openiot-europe-2018/
|
||||
@@ -0,0 +1,137 @@
|
||||
持续集成与部署的3个最佳实践
|
||||
======
|
||||
了解自动化,使用 Git 存储库以及参数化 Jenkins 管道。
|
||||

|
||||
|
||||
本文涵盖了三个关键主题:自动化 CI/CD 配置、使用 Git 存储库处理常见的 CI/CD 工件、参数化 Jenkins 管道。
|
||||
|
||||
### 术语
|
||||
|
||||
首先,我们定义一些术语。**CI/CD** 是允许团队快速自动化测试、打包、部署其应用程序的实践。它通常通过利用名为 **[Jenkins][1]** 的服务器来实现,该服务器充当 CI/CD 协调器。Jenkins 侦听特定输入(通常是代码签入后的 Git hook),并在触发时启动管道。
|
||||
|
||||
**pipeline** 由开发和/或运营团队编写的代码组成,这些代码指导 Jenkins 在 CI/CD 过程中采取哪些操作。这个流水线通常类似于“构建我的代码,然后测试我的代码,如果这些测试通过,则把我的应用程序部署到下一个最高环境(通常是开发、测试或生产环境)”。组织通常具有更复杂的流水线,并入了诸如工件存储库和代码分析器之类的工具,但是这提供了一个高级示例。
|
||||
|
||||
现在我们了解了关键术语,让我们深入研究一些最佳实践。
|
||||
|
||||
### 1\. 自动化是关键
|
||||
|
||||
要在 PaaS 上运行 CI/CD,需要在集群上配置适当的基础设施。在这个例子中,我将使用 [OpenShift][2]。
|
||||
|
||||
"Hello, World" 的实现很容易实现。简单地运行 **oc new-app jenkins- <persistent/ephemeral>** 和 voilà, 你已经准备好运行 Jenkins 服务器了。然而,在企业中的使用要复杂得多。除了 Jenkins 服务器之外,管理员通常还需要部署代码分析工具(如 SonarQube)和构件库(如 Nexus)。然后,它们必须创建管道来执行 CI/CD 和 Jenkins 从服务器,以减少主服务器的负载。这些实体中的大多数都由 OpenShift 资源支持,需要创建这些资源来部署所需的 CI/CD 基础设施。
|
||||
|
||||
最后,部署 CI/CD 组件所需要的手动步骤可能是需要被重复的,并且你可能不想成为执行那些重复步骤的人。为了确保结果能够像以前一样快速、无错误和准确地产生,应该在创建基础设施的方式中结合自动化方法。这可以是一个 Ansible 剧本、一个 Bash 脚本,或者任何您希望自动化 CI/CD 基础设施部署的其他方式。我已经使用 [Ansible][3] 和 [OpenShift-Applier][4] 角色来自动化我的实现。您可能会发现这些工具很有价值,或者您可能会发现其他一些对您和组织更有效的工具。无论哪种方式,您都将发现自动化显著地减少了重新创建 CI/CD 组件所需的工作量。
|
||||
|
||||
#### 配置Jenkins主服务器
|
||||
|
||||
除了一般的“自动化”之外,我想单独介绍一下 Jenkins 主服务器,并讨论管理员如何利用 OpenShift 来自动化配置 Jenkins。来自 [Red Hat Container Catalog][5] 的 Jenkins 映像已经安装了 [OpenShift-Sync plugin][6]。在 [视频][7] 中,我们将讨论如何使用这个插件来创建 Jenkins 管道和从设备。
|
||||
|
||||
要创建 Jenkins 流水线,请创建一个类似于下面的 OpenShift BuildConfig:
|
||||
|
||||
```
|
||||
apiVersion: v1
|
||||
kind: BuildConfig
|
||||
...
|
||||
spec:
|
||||
source:
|
||||
git:
|
||||
ref: master
|
||||
uri: <repository-uri>
|
||||
...
|
||||
strategy:
|
||||
jenkinsPipelineStrategy:
|
||||
jenkinsfilePath: Jenkinsfile
|
||||
type: JenkinsPipeline
|
||||
```
|
||||
|
||||
OpenShift-Sync 插件将注意到已经创建了带有 **jenkinsPipelineStrategy** 策略的 BuildConfig,并将其转换为 Jenkins 管道,从 Git 源指定的 Jenkins 文件中提取。也可以使用内联 Jenkinsfile,而不是从 Git 存储库中提取。有关更多信息,请参阅[文档][8]。
|
||||
|
||||
要创建 Jenkins 从站,请创建一个 OpenShift ImageStream,它从以下定义开始:
|
||||
|
||||
```
|
||||
apiVersion: v1
|
||||
kind: ImageStream
|
||||
metadata:
|
||||
annotations:
|
||||
slave-label: jenkins-slave
|
||||
labels:
|
||||
role: jenkins-slave
|
||||
…
|
||||
```
|
||||
|
||||
注意在这个 ImageStream 中定义的元数据。OpenShift-Sync 插件将把带有标签 **role: jenkins-slave** 的任何ImageStream 转换为 Jenkins 从站。Jenkins 从站将以 **slave-label** 注释中的值命名。
|
||||
|
||||
ImageStreams 对于简单的 Jenkins 从属配置工作得很好,但是一些团队会发现有必要配置一些细节详情,比如资源限制、准备就绪和活动性探测,以及实例帽。这就是 ConfigMap 发挥作用的地方:
|
||||
|
||||
```
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
labels:
|
||||
role: jenkins-slave
|
||||
...
|
||||
data:
|
||||
template1: |-
|
||||
<Kubernetes pod template>
|
||||
```
|
||||
|
||||
注意,仍然需要角色:jenkins-slave 标签来将 ConfigMap 转换为 Jenkins slave。Kubernetes pod 模板由一长段 XML 组成,它将根据组织的喜好配置每个细节。要查看此 XML,以及有关将 ImageStreams 和 ConfigMaps 转换为 Jenkins 从属的更多信息,请参阅[文档][9]。
|
||||
|
||||
请注意上面所示的三个示例,其中没有一个操作需要管理员对 Jenkins 控制台进行手动更改。通过使用 OpenShift 资源,可以简单的自动化方式配置 Jenkins。
|
||||
|
||||
### 2\. 分享就是关心
|
||||
|
||||
第二个最佳实践是维护一个公共 CI/CD 工件的 Git 存储库。主要思想是防止团队重新发明轮子。假设您的团队需要执行到 OpenShift 环境的蓝色/绿色部署,作为管道 CD 阶段的一部分。负责编写流水线的团队成员可能不是 OpenShift 专家,也不可能具有从头开始编写此功能的能力。幸运的是,有人已经编写了一个将此功能合并到一个公共 CI/CD 存储库中的函数,因此您的团队可以使用该函数而不是花时间编写一个函数。
|
||||
|
||||
为了更进一步,您的组织可能决定维护整个管道。您可能会发现团队正在编写具有相似功能的流水线。对于那些团队来说,使用来自公共存储库的参数化管道要比从头开始编写自己的管道更有效。
|
||||
|
||||
### 3\. 少即是多
|
||||
|
||||
正如我在前一节中提到的,第三个也是最后一个最佳实践是参数化您的 CI/CD 管道。参数化将防止过多的管道,使您的 CI/CD 系统更容易维护。假设我有多个区域可以部署应用程序。如果没有参数化,我需要为每个区域设置单独的管道。
|
||||
|
||||
要参数化作为 OpenShift 构建配置编写的管道,请将 **env** 节添加到配置:
|
||||
|
||||
```
|
||||
...
|
||||
spec:
|
||||
...
|
||||
strategy:
|
||||
jenkinsPipelineStrategy:
|
||||
env:
|
||||
- name: REGION
|
||||
value: US-West
|
||||
jenkinsfilePath: Jenkinsfile
|
||||
type: JenkinsPipeline
|
||||
```
|
||||
|
||||
使用此配置,我可以传递 **REGION** 参数管道以将我的应用程序部署到指定区域。
|
||||
|
||||
这有一个[视频][7]提供了一个更实质性的情况,其中参数化是必须的。一些组织决定把他们的 CI/CD 管道分割成单独的 CI 和 CD 管道,通常是因为在部署之前有一些审批过程。假设我有四个映像和三个不同的环境要部署。如果没有参数化,我需要12个 CD 管道来允许所有部署可能性。这会很快失去控制。为了使 CD 流水线的维护更容易,组织会发现将映像和环境参数化以便允许一个流水线执行多个流水线的工作会更好。
|
||||
|
||||
### 总结
|
||||
|
||||
企业级的 CI/CD 往往比许多组织预期的更加复杂。幸运的是,对于 Jenkins,有很多方法可以无缝地提供设置的自动化。维护一个公共 CI/CD 工件的 Git 存储库也会减轻工作量,因为团队可以从维护的依赖项中提取而不是从头开始编写自己的依赖项。最后,CI/CD 管道的参数化将减少必须维护的管道的数量。
|
||||
|
||||
如果您找到了其他不可或缺的做法,请在评论中分享。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/11/best-practices-cicd
|
||||
|
||||
作者:[Austin Dewey][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[ChiZelin](https://github.com/ChiZelin)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/adewey
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://jenkins.io/
|
||||
[2]: https://www.openshift.com/
|
||||
[3]: https://docs.ansible.com/
|
||||
[4]: https://github.com/redhat-cop/openshift-applier
|
||||
[5]: https://access.redhat.com/containers/?tab=overview#/registry.access.redhat.com/openshift3/jenkins-2-rhel7
|
||||
[6]: https://github.com/openshift/jenkins-sync-plugin
|
||||
[7]: https://www.youtube.com/watch?v=zlL7AFWqzfw
|
||||
[8]: https://docs.openshift.com/container-platform/3.11/dev_guide/dev_tutorials/openshift_pipeline.html#the-pipeline-build-config
|
||||
[9]: https://docs.openshift.com/container-platform/3.11/using_images/other_images/jenkins.html#configuring-the-jenkins-kubernetes-plug-in
|
||||
@@ -0,0 +1,78 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It)
|
||||
[#]: via: (https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/)
|
||||
[#]: author: (SK https://www.ostechnix.com/author/sk/)
|
||||
[#]: url: ( )
|
||||
|
||||
如何不重装修复损坏的 Ubuntu 系统
|
||||
======
|
||||
|
||||

|
||||
|
||||
今天,我在升级我的 Ubuntu 18.04 LTS 系统。不幸的是,在更新 Ubuntu 时中途断电,系统关机。电源恢复后,我再次启动系统。在登录页面输入密码后,它变成空白并且没有响应。键盘和鼠标也没有作用。我只看到一个空白的屏幕!值得庆幸的是,它只是一台测试机,并且没有重要的数据。我可以直接擦除整个系统然后重新安装。但是,我不想这样做。由于我没有什么可失去的,我只是想不重装修复我损坏的 Ubuntu 系统,并且我成功了!如果你发现自己处于像我这样的境地,不要惊慌。这个简短的教程描述了如何在不丢失数据的情况下轻松修复损坏的 Ubuntu 系统,而无需重新安装。
|
||||
|
||||
### 修复损坏的 Ubuntu 系统
|
||||
|
||||
首先,尝试使用 live cd 登录并**在外部驱动器中备份数据**。以防这个方法没用,你仍然可以获取数据并重新安装系统!
|
||||
|
||||
在登录页上,按下 **CTRL+ALT+F1** 切换到 **tty1**。你可以在[**此处**][1]了解有关在 TTY 之间切换的更多信息。
|
||||
|
||||
现在,逐个输入以下命令来修复损坏的 Ubuntu Linux。
|
||||
|
||||
```
|
||||
$ sudo rm /var/lib/apt/lists/lock
|
||||
|
||||
$ sudo rm /var/lib/dpkg/lock
|
||||
|
||||
$ sudo rm /var/lib/dpkg/lock-frontend
|
||||
|
||||
$ sudo dpkg --configure -a
|
||||
|
||||
$ sudo apt clean
|
||||
|
||||
$ sudo apt update --fix-missing
|
||||
|
||||
$ sudo apt install -f
|
||||
|
||||
$ sudo dpkg --configure -a
|
||||
|
||||
$ sudo apt upgrade
|
||||
|
||||
$ sudo apt dist-upgrade
|
||||
```
|
||||
|
||||
最后,使用命令重启系统:
|
||||
|
||||
```
|
||||
$ sudo reboot
|
||||
```
|
||||
|
||||
你现在可以像往常一样登录到你的 Ubuntu 系统。
|
||||
|
||||
我做完这些步骤后,我 Ubuntu 18.04 测试系统中的所有数据都还在,一切都之前的一样。此方法可能不适用于所有人。但是,这个小小的贴士对我有用,并且比重装节省了一些时间。如果你了解其他更好的方法,请在评论区告诉我。我也会在本指南中添加它们。
|
||||
|
||||
这是这些了。希望这篇文章有用。
|
||||
|
||||
还有更多好东西。敬请关注!
|
||||
|
||||
干杯!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/
|
||||
|
||||
作者:[SK][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://www.ostechnix.com/author/sk/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/
|
||||
@@ -0,0 +1,111 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Install Putty on Ubuntu and Other Linux Distributions)
|
||||
[#]: via: (https://itsfoss.com/putty-linux/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
如何在 Ubuntu 和其他 Linux 发行版上安装 Putty
|
||||
======
|
||||
|
||||
如果我没错,[Putty][1] 可能是 Windows 最受欢迎的 SSH 客户端。
|
||||
|
||||
I在 IT 公司中,开发环境通常在远程 Linux 系统上,而开发人员则使用 Windows 作为本地系统。Putty 用于从 Windows 机器连接到远程 Linux 系统。
|
||||
|
||||
Putty 不仅限于 Windows。你也可以在 Linux 和 macOS 上使用此开源软件。
|
||||
|
||||
但是等等!当你已经拥有“真正的” Linux 终端时,为什么要在 Linux 上使用单独的 SSH 客户端?这有几个想在 Linux 上使用 Putty 的原因。
|
||||
|
||||
* 你在 Windows 上使用 Putty 已经很久了,你觉得它更舒服。
|
||||
* 你发现很难手动编辑 SSH 配置文件以保存各种 SSH 会话。你更喜欢 Putty 图形化保存 SSH 连接的方式。
|
||||
* 你想通过连接到原始套接字和串口进行调试。
|
||||
|
||||
|
||||
|
||||
无论是什么原因,如果你想在 Ubuntu 或任何其他 Linux 上使用 Putty,你当然可以这样做。让我告诉你如何做到。
|
||||
|
||||
### 在 Ubuntu Linux 上安装 Putty
|
||||
|
||||
![Installing Putty on Linux][2]
|
||||
|
||||
对于 Ubuntu 用户来说,好消息是 Putty 可以在 Ubuntu 的 universe 仓库中找到。
|
||||
|
||||
要在 Ubuntu上安装 Putty,首先应确保已启用 universe 仓库。
|
||||
|
||||
```
|
||||
sudo add-apt-repository universe
|
||||
```
|
||||
|
||||
启用 universe 存储库后,应使用以下命令更新 Ubuntu:
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
之后,你可以使用以下命令安装 Putty:
|
||||
|
||||
```
|
||||
sudo apt install putty
|
||||
```
|
||||
|
||||
安装后,你可以在菜单中找到它来启动 Putty。
|
||||
|
||||
正如你在下面的截图中看到的,Putty 的 Linux 版本看起来与 Windows 版本相同。这让你松了一口气, 因为你不必再尝试新的设置。
|
||||
|
||||
![Putty in Linux][3]
|
||||
|
||||
当你输入远程系统的[主机名][4]或 IP 地址并连接到它时,Putty 将使用你主目录中已保存的 SSH 密钥。
|
||||
|
||||
![Using Putty in Ubuntu Linux][5]
|
||||
|
||||
### 在其他 Linux 发行版上安装 Putty
|
||||
|
||||
[Putty 可用于 Debian][6],所以你只需要使用 apt-get 或 aptitude 来安装它。
|
||||
|
||||
```
|
||||
sudo apt-get install putty
|
||||
```
|
||||
|
||||
Putty 也适用于 Fedora/Red Hat,并可以使用默认的包管理器进行安装。
|
||||
|
||||
```
|
||||
sudo dnf install putty
|
||||
```
|
||||
|
||||
你还可以在基于 Arch Linux 的发行版中轻松安装 Putty。
|
||||
|
||||
```
|
||||
sudo pacman -S putty
|
||||
```
|
||||
|
||||
请记住,Putty 是一款开源软件。如果你真的想要,你也可以通过源代码安装它。你可以从下面的链接获取 Putty 的源代码。
|
||||
|
||||
[下载 Putty 源代码][8]
|
||||
|
||||
我一直喜欢原生 Linux 终端而不是像 Putty 这样的 SSH 客户端。我觉得 GNOME 终端或 [Terminator][7] 更有家的感觉。但是,在 Linux 中使用默认终端或 Putty 是个人选择。
|
||||
|
||||
你在 Linux 上管理多个 SSH 连接时使用了什么?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/putty-linux/
|
||||
|
||||
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.putty.org/
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/Putty-linux.png?resize=800%2C450&ssl=1
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu.jpeg?resize=800%2C503&ssl=1
|
||||
[4]: https://itsfoss.com/change-hostname-ubuntu/
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu-1.jpeg?resize=800%2C430&ssl=1
|
||||
[6]: https://packages.debian.org/jessie/putty
|
||||
[7]: https://launchpad.net/terminator
|
||||
[8]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
|
||||
123
translated/tech/20181212 Aliases- DIY Shell Commands.md
Normal file
123
translated/tech/20181212 Aliases- DIY Shell Commands.md
Normal file
@@ -0,0 +1,123 @@
|
||||
命令别名:定义自己的命令
|
||||
======
|
||||
|
||||

|
||||
|
||||
<ruby>命令别名<rt>Alias</rt></ruby>在 Linux shell 中指的是将一些太长或者太难记的多个命令组合起来,成为一个由用户自定义构建的命令。
|
||||
|
||||
可以通过 `alias` 命令来创建命令别名。在 `alias` 后面跟上想要创建的别名名称、一个等号(`=`),以及希望使用这个别名来执行的命令,这样一个命令别名就创建好了。举个例子,`ls` 命令在默认情况下是不会对输出的内容进行着色的,这样就不能让用户一眼分辨出目录、文件和连接了。对此,可以创建这样一个命令别名,在输出目录内容的时候为输出内容着色:
|
||||
|
||||
```
|
||||
alias lc='ls --color=auto'
|
||||
```
|
||||
|
||||
其中 `lc` 是自定义的命令别名,代表“list with color”的意思。在创建命令别名的时候,需要先确认使用的别名是不是已经有对应的命令了,如果有的话,原本的命令就会被覆盖掉了。注意,定义命令别名的时候,`=` 两端是没有空格的。当运行 `lc` 的时候,就相当于执行了 `ls --color` 命令。
|
||||
|
||||
此后,执行 `lc` 列出目录内容的时候,就会输出带有着色的内容了。
|
||||
|
||||
你可能会发现你在执行 `ls` 的时候,本来就是输出带有着色的内容。那是因为大部分 Linux 发行版都已经将 `ls` 设定为带有着色的命令别名了。
|
||||
|
||||
### 可以直接使用的命令别名
|
||||
|
||||
实际上,执行不带任何内容的 `alias` 命令就可以看到当前已经设定的所有命令别名。对于不同的发行版,包含的命令别名不尽相同,但普遍都会有以下这些命令别名:
|
||||
|
||||
* `alias ls='ls --color=auto'`:这个命令别名在前面已经提到过了。`--color=auto` 参数会让 `ls` 命令在通过标准输出在终端中显示内容时进行着色,而其它情况(例如通过管道输出到文件)下则不进行着色。`--color` 这个参数还可以设置为 `always` 或`never`。
|
||||
* `alias cp='cp -i'`:`-i` 参数代表“<ruby>交互<rt>interactive</rt></ruby>”。在使用 `cp` 命令复制文件的时候,可能会无意中覆盖现有的文件,在使用了 `-i` 参数之后,`cp` 命令会在一些关键操作前向用户发出询问。
|
||||
* `alias free='free -m'`:在 `free` 命令后面加上 `-m` 参数,就可以将输出的内存信息以 MiB 这个更方面阅读和计算的单位输出,而不是默认的 Byte 单位。
|
||||
|
||||
|
||||
|
||||
你使用的发行版自带的命令别名可能多多少少和上面有些差别。但你都可以在命令前面加上 `\` 修饰符来使用命令的最基本形式。例如:
|
||||
|
||||
```
|
||||
\free
|
||||
```
|
||||
|
||||
就是直接执行 `free`,而不是 `free -m`。还有:
|
||||
|
||||
```
|
||||
\ls
|
||||
```
|
||||
|
||||
执行的就是不带有`--color=auto` 参数的 `ls`。
|
||||
|
||||
如果想要持久地保存命令别名,可以在 `.bashrc` 文件中进行修改。
|
||||
|
||||
### 使用命令别名纠正错误
|
||||
|
||||
各种发行版的设计者都会尽量设置用户可能需要用到的命令别名。但是不同的用户的习惯各不相同,一些用户可能刚从其它操作系统迁移到 Linux,而不同操作系统的基本命令又因 shell 而异。因此,对于刚从 Windows/MS-DOS 系统迁移到 Linux 系统的用户,不妨使用
|
||||
|
||||
```
|
||||
alias dir='ls'
|
||||
```
|
||||
|
||||
这个命令别名来列出目录内容。
|
||||
|
||||
类似地,
|
||||
|
||||
```
|
||||
alias copy='cp'
|
||||
alias move='mv'
|
||||
```
|
||||
|
||||
也可以在尚未完全熟悉 Linux 的时候用得顺手。
|
||||
|
||||
还有一种情况,就是在经常出现输入错误的场合中做出容错,例如 Administration 这个单词就很难快速正确地输入,因此很多用户都会设置
|
||||
|
||||
```
|
||||
alias sl='ls'
|
||||
```
|
||||
|
||||
以及
|
||||
|
||||
```
|
||||
alias gerp='echo "You did it *again*!"; grep'
|
||||
```
|
||||
|
||||
`grep` 命令最基本的用途就是在文件中查找字符串,在熟悉这个命令之后,它一定是最常用的命令之一,因此输入错误导致不得不重输命令就很令人抓狂。
|
||||
|
||||
在上面 `gerp` 的例子中,包含的不只是一条命令,而是两条。第一条命令 `echo "You did it *again*!"` 输出了一条提醒用户拼写错误的消息,然后使用分号(`;`)把两条命令隔开,再往后才是 `grep` 这一条正确的命令。
|
||||
|
||||
在我的系统上使用 `gerp` 来搜索 `/etc/skel/.bashrc` 中包含“alias”这个单词的行,就会输出以下内容:
|
||||
|
||||
```
|
||||
$ gerp -R alias /etc/skel/.bashrc
|
||||
You did it *again*!
|
||||
alias ls='ls --color=auto'
|
||||
alias grep='grep --colour=auto'
|
||||
alias egrep='egrep --colour=auto'
|
||||
alias fgrep='fgrep --colour=auto'
|
||||
alias cp="cp -i"
|
||||
alias df='df -h'
|
||||
alias free='free -m'
|
||||
alias np='nano -w PKGBUILD'
|
||||
alias more=less
|
||||
shopt -s expand_aliases
|
||||
```
|
||||
|
||||
在命令别名中以固定的顺序执行多个命令,甚至更进一步,把多个命令串连起来,让后面的命令可以使用到前面的命令的执行结果。这样的做法已经非常接近 bash 脚本了。这篇文章已经接近尾声,我们将在下一篇文章中详细介绍。
|
||||
|
||||
如果想要删除在终端中临时设置的别名,可以使用 `unalias` 命令。
|
||||
|
||||
```
|
||||
unalias gerp
|
||||
```
|
||||
|
||||
如果想要持久保存命令别名,可以将命令别名放在用户主目录的 `.bashrc` 文件中,具体的方法在[上一篇文章][2]中已经介绍过。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands
|
||||
|
||||
作者:[Paul Brown][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[HankChow](https://github.com/HankChow)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linux.com/users/bro66
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts
|
||||
[2]: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Patch into The Matrix at the Linux command line)
|
||||
[#]: via: (https://opensource.com/article/18/12/linux-toy-cmatrix)
|
||||
[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
|
||||
|
||||
在命令行中步入黑客帝国
|
||||
======
|
||||
使用 cmatrix 重建每个人最喜欢的 20 世纪 90 年代科幻电影中滚动代码的经典外观。
|
||||

|
||||
|
||||
你发现了今天的命令行玩具日历。如果这是你第一次访问该系列,你可能想知道什么是命令行玩具?它可以是在命令行中任何可以娱乐的东西,可以是一个游戏,一个有趣的工具,或者一个消遣的东西。
|
||||
|
||||
其中一些是经典,有些是全新的(至少对我而言),但我希望你们所有人都能在这个系列中找到你喜欢的东西。
|
||||
|
||||
在我们在接近下一年的时候,现在是回顾和期待的好时机。2019 年会为你带来什么?2019 年意味着什么?
|
||||
|
||||
我想起 2019 年将是我青少年时期最喜欢的科幻电影之一[黑客帝国][1]的二十周年纪念日,它当时让我思考了未来将会发生什么。对于像我这样的痴迷计算机小孩来说,这是一个电脑程序员通过利用自己思维的力量崛起并成为虚拟宇宙中的动作英雄的终极故事。
|
||||
|
||||
当时,没有一部电影对我来说似乎更具未来感。无论是故事本身,还是迷人的特效。即使意识到它是在二十多年前拍摄的也并没有改变我的想法。
|
||||
|
||||
今天将它带回我们的命令行玩具,让我们在终端用 **cmatrix** 重建黑客帝国中那向下滚动的代码流。 **cmatrix** 对我来说很容易安装,它在 Fedora 中被打包了,所以安装它只需:
|
||||
|
||||
```
|
||||
$ dnf install cmatrix
|
||||
```
|
||||
|
||||
接着,只需在你的终端输入 **cmatrix** 即可运行。
|
||||

|
||||
你可以在 [GitHub][2] 上找到使用 GPL 许可的 **cmatrix** 的源代码。
|
||||
|
||||
你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。评论留言让我知道,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。
|
||||
|
||||
了解一下昨天的玩具,[在 Linux 中让 Bash 提示符变得像冬天][2],还有记得明天再来!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/12/linux-toy-cmatrix
|
||||
|
||||
作者:[Jason Baker][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://opensource.com/users/jason-baker
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://en.wikipedia.org/wiki/The_Matrix
|
||||
[2]: https://github.com/abishekvashok/cmatrix
|
||||
[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt
|
||||
Reference in New Issue
Block a user