mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
merge
This commit is contained in:
parent
24a4740c24
commit
5bc638a8f1
@ -3,18 +3,20 @@
|
||||
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (CanYellow)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-15423-1.html)
|
||||
|
||||
开源软件安全吗?
|
||||
======
|
||||
|
||||
作为一个偏爱 [Linux桌面发行版][1] 并鼓励使用开源软件的人,你可能期待就标题中提出的问题得到一个响亮的**肯定**回答。
|
||||
![][0]
|
||||
|
||||
然而,我并不打算仅限于讨论开源软件的优点。让我们一起探索更多的内容吧!
|
||||
作为一个偏爱 [在桌面电脑上使用 Linux][1],并鼓励使用开源软件的人,你可能期待就标题中提出的问题得到一个响亮的**肯定**回答。
|
||||
|
||||
本文,我计划分享我关于开源软件是否安全的思考以及哪些事情与开源软件的安全性相关。
|
||||
然而,我并不打算仅限于讨论开源软件的优点。让我们一起探索更多观点!
|
||||
|
||||
在本文,我计划分享我关于开源软件是否安全的思考,以及哪些事情与开源软件的安全性相关。
|
||||
|
||||
### 为什么你需要关注开源软件是否安全?
|
||||
|
||||
@ -22,123 +24,119 @@
|
||||
|
||||
举个例子,大多数专有软件工具依赖于某种形式的开源库来保证其正常工作。
|
||||
|
||||
此外,各种规模的公司(包括 Google、Microsoft 和 Facebook )依赖开源软件或者以某种途径向开源社区贡献资源是有原因的。
|
||||
此外,各种规模的公司(包括谷歌、微软和 Facebook)依赖开源软件或者以某种途径向开源社区贡献资源是有原因的。
|
||||
|
||||
因此,开源软件的安全性是有必要了解的。
|
||||
|
||||
### 有关开源软件安全性的谣言
|
||||
### 有关开源软件安全性的迷思
|
||||
|
||||
![][3]
|
||||
|
||||
虽然有多种理由证明开源软件在安全性方面的缺陷,然而其中一些实际毫无意义。
|
||||
|
||||
#### 任何人都可以查看 & 恶意利用开源软件代码
|
||||
#### 任何人都可以查看并恶意利用开源软件代码
|
||||
|
||||
是的,开源软件代码对于任何人都是可访问的。但是你可以查看代码并不意味着你可以利用它。
|
||||
|
||||
**不现实**
|
||||
**不现实。**
|
||||
|
||||
即使任何人都可以克隆(或者拷贝)该软件,原始软件也不能轻易地被修改使用。
|
||||
即使任何人都可以复刻(或者拷贝)该软件,原始软件也不能轻易地被修改使用。
|
||||
|
||||
通常,项目维护人员(或者维护团队)管理代码仓库并且接受来自贡献者的提交。开源软件代码在接受之前被审查。没有人可以像那样劫持代码。
|
||||
通常,项目维护人员(或者维护团队)管理代码仓库,并且接受来自贡献者的提交。开源软件代码在接受之前会被审查。没有人可以就这样劫持代码。
|
||||
|
||||
**不论是开源软件还是闭源软件,攻击者都需要付出努力来利用软件中的代码漏洞或者添加恶意代码**
|
||||
**不论是开源软件还是闭源软件,攻击者都需要付出努力来利用软件中的代码漏洞或者添加恶意代码。**
|
||||
|
||||
#### 失去专用资源,安全性无从谈起
|
||||
#### 没有专职团队,安全性无从谈起
|
||||
|
||||
很多人相信如果开源软件没有专职人员或者专职团队,维护软件安全性是困难的。
|
||||
|
||||
恰恰相反,由于各种个样类型的贡献者的加入与离开,开源软件获得了来自更大范围的开发者的更多关注。
|
||||
恰恰相反,由于各种各样类型的贡献者的加入与离开,开源软件获得了来自更大范围的开发者的更多关注。
|
||||
|
||||
他们可能比由专用软件所聘用的少数开发者更能够发现安全问题。
|
||||
他们可能比由专有软件所聘用的少数开发者更能够发现安全问题。
|
||||
|
||||
一些来自 Mozilla 等同类公司的项目拥有自己的专职团队来高效处理安全问题。同样的,大部分成功的开源项目拥有大量的资源用于保障安全性。
|
||||
|
||||
因此,开源软件的生态系统是安全性的组合包。即使没有专职资源,开源项目也可以得到来自各类贡献者的帮助,他们中的一些很大程度上是有利可图的,这有助于他们投入更多的精力。
|
||||
因此,开源软件的生态系统是安全性的组合包。即使没有专职团队,开源项目也可以得到来自各类贡献者的帮助,他们中的一些很大程度上是有利可图的,这有助于他们投入更多的精力。
|
||||
|
||||
### 开源软件是安全的,以下是原因
|
||||
|
||||
![][3]
|
||||
![][5]
|
||||
|
||||
既然我们已经解决了有关开源软件安全性的谣言,让我重点展示一下开源软件是如何处理安全问题的。
|
||||
既然我们已经澄清了这些有关开源软件安全性的迷思,让我重点展示一下开源软件是如何处理安全问题的。
|
||||
|
||||
换句话说,开源软件在安全性上的优势。
|
||||
|
||||
请不要忘记,开源软件的优势也是 [ Linux 比 Windows 更好][4]的一些原因。
|
||||
请不要忘记,开源软件的优势也是 [Linux 比 Windows 更好][4] 的一些原因。
|
||||
|
||||
#### 更多的眼晴关注开源软件代码
|
||||
|
||||
不像专有软件,代码访问仅不限于少数开发者。
|
||||
不像专有软件,(对开源软件的)代码访问并不局限于少数几个开发者。
|
||||
|
||||
一些开源项目甚至可能拥有数以万记的开发者查看代码、审查它们并标记和修复其中的安全性问题。
|
||||
一些开源项目甚至可能拥有数以万记的开发者可以查看代码、审查它们并标记和修复其中的安全性问题。
|
||||
|
||||
这给予了开源项目拥有**快速识别问题并尽快修复它们的能力**的相比闭源软件的优势。
|
||||
相比闭源软件,这给予了开源项目拥有**快速识别问题并尽快修复它们的能力**的优势。
|
||||
|
||||
不仅仅限于拥有更多的开发者,企业通常也会参与他们所使用的开源项目。当他们这样做的时候,他们也会查阅代码并审查它们。
|
||||
|
||||
这提供了外部审查的另一条途径,而这可能有助于提升开源软件的安全性。
|
||||
这提供了另一条外部审查的途径,而这可能有助于提升开源软件的安全性。
|
||||
|
||||
反之,就闭源软件而言,有限人数的开发者可能并不能找出所有种类的安全问题。而且他们可能需要花费更长的时间来一一修复发现的问题。
|
||||
反之,就闭源软件而言,数量有限的开发者可能并不能找出所有种类的安全问题。而且他们可能需要花费更长的时间来一一修复发现的问题。
|
||||
|
||||
#### 社区决定安全问题的优先级
|
||||
|
||||
闭源软件的开发者可能在处理什么问题和什么时候解决问题等方面有某些限制或者优先等级。
|
||||
|
||||
而如果是开源项目,贡献者社区可以自行决定优先级并自行安排他们想解决的问题以及决定合适修复问题。你不需要依赖于供应商的决定或者按照他们的指示来解决一个安全问题。
|
||||
而如果是开源项目,贡献者社区可以自行决定优先级,并自行安排他们想解决的问题以及决定合适修复问题。你不需要依赖于供应商的决定或者按照他们的指示来解决一个安全问题。
|
||||
|
||||
着手处理和修复安全问题的决定在开源软件项目中更加透明和灵活。因此,它可以被证明是更有效的,并为你带来以下三个益处:
|
||||
着手处理和修复安全问题的决策在开源软件项目中更加透明和灵活。因此,它可以被证明是更有效的,并为你带来以下三个益处:
|
||||
|
||||
* **透明度**
|
||||
* **不依赖供应商**
|
||||
* **更快的安全更新**
|
||||
* 透明度
|
||||
* 不依赖供应商
|
||||
* 更快的安全更新
|
||||
|
||||
### 开源软件不是刀枪不入的,以下是原因
|
||||
### 开源软件不是防弹的,以下是原因
|
||||
|
||||
![][3]
|
||||
![][6]
|
||||
|
||||
虽然有开源软件可能在安全性上具有优势的案例,然而仍有一些因素影响它。
|
||||
虽然在某些情况下,开源软件可能在安全性上具有优势,然而仍有一些因素影响它。
|
||||
|
||||
承认这些问题的存在是很重要的,据此,企业或者个人可以就一款开源软件的安全情况做出更好的决定。
|
||||
承认这些问题的存在是很重要的,据此,企业或者个人可以就开源软件的安全情况做出更好的决定。
|
||||
|
||||
#### 并无足够的眼睛来审查代码和不确定性
|
||||
|
||||
即使开源软件代码可以由全世界的开发者自由访问,**项目没有足够的贡献者/开发者彻底审查开源代码**的可能性仍然存在。
|
||||
即使开源软件代码可以被全世界的开发者自由访问,**项目没有足够的贡献者/开发者彻底审查开源代码**的可能性仍然存在。
|
||||
|
||||
既如此,我们不能对经同行审查的开源软件抱有极高的信心,因为它恰好缺失了这一点。
|
||||
既如此,我们不能对开源软件的同行审查抱有极高的信心,因为它恰好缺失了这一点。
|
||||
|
||||
开源软件可能“声称”拥有最高的安全性因为它们是开源的。在没有足够的开发者致力于该项目时,这是一种误导。
|
||||
|
||||
同样,我们也无从得知有多少开发者在查看/检查代码以及代码走查在多大程度上进行。
|
||||
同样,我们也无从得知有多少开发者在查看/检查代码,也不知道代码的检查进行到什么程度了。
|
||||
|
||||
举例而言,心脏出血漏洞([Heartbleed][T1])是在其在广泛使用项目—— **OpenSSL** ——中引入了2年以后才被发现的。
|
||||
举例而言,<ruby>[心脏出血漏洞][T1]<rt>Heartbleed</rt></ruby> 是在一个被广泛使用的项目(OpenSSL)中引入了 2 年以后才被发现的。
|
||||
|
||||
#### 软件责任与义务
|
||||
#### 软件责任与问责
|
||||
|
||||
对于个人用户这可能并不重要,但是**开源项目通常并无任何保证**。
|
||||
|
||||
因此,如果一家公司使用它,它们必须自行承担任何由该软件使用造成的数据丢失与损坏。
|
||||
|
||||
这告诉你没有什么是100%安全和没有漏洞的。无论有多少眼睛聚焦在代码上或者贡献者的技术多么精湛,总会存在某种形式的风险,可能是安全风险可能是数据丢失。
|
||||
这告诉你,没有什么是 100% 安全和没有漏洞的。无论有多少眼睛聚焦在代码上或者贡献者的技术多么精湛,总会存在某种形式的风险,无论是安全风险还是数据丢失。
|
||||
|
||||
这告诉我们一个现实:开源软件并非刀枪不入。
|
||||
这告诉我们一个现实:开源软件并非防弹的。
|
||||
|
||||
### 开源软件有其更高安全性的优势,但是...
|
||||
|
||||
就安全性而言没有什么优胜者。不论是闭源还是开源,当涉及安全问题时都适用同一套原则。
|
||||
|
||||
有很多外部因素可以印象软件安全性,而**其中很多都不是来源相关的**。
|
||||
有很多外部因素可以影响软件安全性,而**其中很多因素并不依赖于源代码**。
|
||||
|
||||
代码必须被以某种形式监控以保证安全。
|
||||
必须以某种形式监控代码,以保证安全。
|
||||
|
||||
是的,**开源道路提供了闭源软件所不具备的优势**,但是这并不意味着开源软件是刀枪不入的。
|
||||
是的,**开源道路提供了闭源软件所不具备的优势**,但是这并不意味着开源软件是防弹的。
|
||||
|
||||
_你对开源软件安全状况有何思考?_ _你又是否认为开源软件比专有软件解决方案更好呢?_
|
||||
_你对开源软件安全状况有何思考?你又是否认为开源软件比专有软件解决方案更好呢?_
|
||||
|
||||
提前感谢您在下面的评论中提出的宝贵意见。
|
||||
|
||||
#### 大型科技网站坐拥百万收入,而 It's FOSS 拥有每一个你!
|
||||
|
||||
如果你喜欢我们在 It's FOSS 中所做的工作,请您考虑捐赠以支持我们的独立出版物。你的支持将有助于我们继续发布有关 Linux 桌面版以及开源软件的内容。
|
||||
提前感谢你在下面的评论中提出的宝贵意见。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -147,7 +145,7 @@ via: https://news.itsfoss.com/open-source-software-security/
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[CanYellow](https://github.com/CanYellow)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
@ -155,7 +153,10 @@ via: https://news.itsfoss.com/open-source-software-security/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://news.itsfoss.com/linux-foundation-linux-desktop/
|
||||
[2]: https://itsfoss.com/what-is-linux-distribution/
|
||||
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
|
||||
[3]: https://news.itsfoss.com/content/images/wordpress/2021/07/hacker-exploit-illustration.png
|
||||
[4]: https://itsfoss.com/linux-better-than-windows/
|
||||
[5]: https://news.itsfoss.com/content/images/wordpress/2021/07/open-source-security-illustration.png
|
||||
[6]: https://news.itsfoss.com/content/images/wordpress/2021/07/open-source-security-issue.jpg
|
||||
|
||||
[T1]: https://www.cve.org/CVERecord?id=CVE-2014-0160
|
||||
[0]: https://news.itsfoss.com/content/images/size/w2000/wordpress/2021/07/open-source-security.jpg
|
275
published/20211012 Create a timer on Linux.md
Normal file
275
published/20211012 Create a timer on Linux.md
Normal file
@ -0,0 +1,275 @@
|
||||
[#]: subject: "Create a timer on Linux"
|
||||
[#]: via: "https://opensource.com/article/21/10/linux-timers"
|
||||
[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "FigaroCao"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15427-1.html"
|
||||
|
||||
在 Linux 中创建定时器
|
||||
======
|
||||
|
||||
> 这是一个演示如何创建 POSIX 兼容的间隔定时器的教程。
|
||||
|
||||
![][0]
|
||||
|
||||
对开发人员来说,定时某些事件是一项常见任务。定时器的常见场景是看门狗、任务的循环执行,或在特定时间安排事件。在这篇文章中,我将演示如何使用 [timer_create(...)][2] 创建一个 POSIX 兼容的间隔定时器。
|
||||
|
||||
你可以从 [GitHub][3] 下载下面样例的源代码。
|
||||
|
||||
### 准备 Qt Creator
|
||||
|
||||
我使用 [Qt Creator][4] 作为该样例的 IDE。为了在 Qt Creator 运行和调试样例代码,请克隆 [GitHub][3] 上的仓库,打开 Qt Creator,在 “<ruby>文件<rt>File</rt></ruby> -> <ruby>打开文件或项目……<rt>Open File or Project...</rt></ruby>” 并选择 “CMakeLists.txt”:
|
||||
|
||||
![Qt Creator open project][5]
|
||||
|
||||
*在 Qt Creator 中打开项目*
|
||||
|
||||
选择工具链之后,点击 “<ruby>配置项目<rt>Configure Project</rt></ruby>”。这个项目包括三个独立的样例(我们在这篇文章中将只会用到其中的两个)。使用绿色标记出来的菜单,可以在每个样例的配置之间切换,并为每个样例激活在终端运行 “<ruby>在终端中运行<rt>Run in terminal</rt></ruby>”(用黄色标记)。当前用于构建和调试的活动示例可以通过左下角的“<ruby>调试<rt>Debug</rt></ruby>” 按钮进行选择(参见下面的橙色标记)。
|
||||
|
||||
![Project configuration][6]
|
||||
|
||||
*项目配置*
|
||||
|
||||
### 线程定时器
|
||||
|
||||
让我们看看 `simple_threading_timer.c` 样例。这是最简单的一个。它展示了一个调用了超时函数 `expired` 的间隔定时器是如何被创建的。在每次过期时,都会创建一个新的线程,在其中调用函数 `expired`:
|
||||
|
||||
```
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
void expired(union sigval timer_data);
|
||||
|
||||
pid_t gettid(void);
|
||||
|
||||
struct t_eventData{
|
||||
int myData;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
int res = 0;
|
||||
timer_t timerId = 0;
|
||||
|
||||
struct t_eventData eventData = { .myData = 0 };
|
||||
|
||||
/* sigevent 指定了过期时要执行的操作 */
|
||||
struct sigevent sev = { 0 };
|
||||
|
||||
/* 指定启动延时时间和间隔时间
|
||||
* it_value和it_interval 不能为零 */
|
||||
|
||||
struct itimerspec its = { .it_value.tv_sec = 1,
|
||||
.it_value.tv_nsec = 0,
|
||||
.it_interval.tv_sec = 1,
|
||||
.it_interval.tv_nsec = 0
|
||||
};
|
||||
|
||||
printf("Simple Threading Timer - thread-id: %d\n", gettid());
|
||||
|
||||
sev.sigev_notify = SIGEV_THREAD;
|
||||
sev.sigev_notify_function = &expired;
|
||||
sev.sigev_value.sival_ptr = &eventData;
|
||||
|
||||
/* 创建定时器 */
|
||||
res = timer_create(CLOCK_REALTIME, &sev, &timerId);
|
||||
|
||||
if (res != 0){
|
||||
fprintf(stderr, "Error timer_create: %s\n", strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* 启动定时器 */
|
||||
res = timer_settime(timerId, 0, &its, NULL);
|
||||
|
||||
if (res != 0){
|
||||
fprintf(stderr, "Error timer_settime: %s\n", strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
printf("Press ETNER Key to Exit\n");
|
||||
while(getchar()!='\n'){}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void expired(union sigval timer_data){
|
||||
struct t_eventData *data = timer_data.sival_ptr;
|
||||
printf("Timer fired %d - thread-id: %d\n", ++data->myData, gettid());
|
||||
}
|
||||
```
|
||||
|
||||
这种方法的优点是在代码和简单调试方面用量小。缺点是由于到期时创建新线程而增加额外的开销,因此行为不太确定。
|
||||
|
||||
### 中断信号定时器
|
||||
|
||||
超时定时器通知的另一种可能性是基于 [内核信号][12]。内核不是在每次定时器过期时创建一个新线程,而是向进程发送一个信号,进程被中断,并调用相应的信号处理程序。
|
||||
|
||||
由于接收信号时的默认操作是终止进程(参考 [signal][13] 手册页),我们必须要提前设置好 Qt Creator,以便进行正确的调试。
|
||||
|
||||
当被调试对象接收到一个信号时,Qt Creator 的默认行为是:
|
||||
|
||||
* 中断执行并切换到调试器上下文。
|
||||
* 显示一个弹出窗口,通知用户接收到信号。
|
||||
|
||||
这两种操作都不需要,因为信号的接收是我们应用程序的一部分。
|
||||
|
||||
Qt Creator 在后台使用 GDB。为了防止 GDB 在进程接收到信号时停止执行,进入 “<ruby>工具<rt>Tools</rt></ruby> -> <ruby>选项<rt>Options</rt></ruby>” 菜单,选择 “<ruby>调试器<rt>Debugger</rt></ruby>”,并导航到 “<ruby>本地变量和表达式<rt>Locals & Expressions</rt></ruby>”。添加下面的表达式到 “<ruby>定制调试助手<rt>Debugging Helper Customization</rt></ruby>”:
|
||||
|
||||
```
|
||||
handle SIG34 nostop pass
|
||||
```
|
||||
|
||||
![Signal no stop with error][14]
|
||||
|
||||
*Sig 34 时不停止*
|
||||
|
||||
你可以在 [GDB 文档][15] 中找到更多关于 GDB 信号处理的信息。
|
||||
|
||||
接下来,当我们在信号处理程序中停止时,我们要抑制每次接收到信号时通知我们的弹出窗口:
|
||||
|
||||
![Signal 34 pop up box][16]
|
||||
|
||||
*Signal 34 弹出窗口*
|
||||
|
||||
为此,导航到 “GDB” 标签并取消勾选标记的复选框:
|
||||
|
||||
![Timer signal windows][17]
|
||||
|
||||
*定时器信号窗口*
|
||||
|
||||
现在你可以正确的调试 `signal_interrupt_timer`。真正的信号定时器的实施会更复杂一些:
|
||||
|
||||
```
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
static void handler(int sig, siginfo_t *si, void *uc);
|
||||
pid_t gettid(void);
|
||||
|
||||
struct t_eventData{
|
||||
int myData;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
int res = 0;
|
||||
timer_t timerId = 0;
|
||||
|
||||
struct sigevent sev = { 0 };
|
||||
struct t_eventData eventData = { .myData = 0 };
|
||||
|
||||
/* 指定收到信号时的操作 */
|
||||
struct sigaction sa = { 0 };
|
||||
|
||||
/* 指定启动延时的时间和间隔时间 */
|
||||
struct itimerspec its = { .it_value.tv_sec = 1,
|
||||
.it_value.tv_nsec = 0,
|
||||
.it_interval.tv_sec = 1,
|
||||
.it_interval.tv_nsec = 0
|
||||
};
|
||||
|
||||
printf("Signal Interrupt Timer - thread-id: %d\n", gettid());
|
||||
|
||||
sev.sigev_notify = SIGEV_SIGNAL; // Linux-specific
|
||||
sev.sigev_signo = SIGRTMIN;
|
||||
sev.sigev_value.sival_ptr = &eventData;
|
||||
|
||||
/* 创建定时器 */
|
||||
res = timer_create(CLOCK_REALTIME, &sev, &timerId);
|
||||
|
||||
if ( res != 0){
|
||||
fprintf(stderr, "Error timer_create: %s\n", strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* 指定信号和处理程序 */
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sa.sa_sigaction = handler;
|
||||
|
||||
/* 初始化信号 */
|
||||
sigemptyset(&sa.sa_mask);
|
||||
|
||||
printf("Establishing handler for signal %d\n", SIGRTMIN);
|
||||
|
||||
/* 注册信号处理程序 */
|
||||
if (sigaction(SIGRTMIN, &sa, NULL) == -1){
|
||||
fprintf(stderr, "Error sigaction: %s\n", strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* 启动定时器 */
|
||||
res = timer_settime(timerId, 0, &its, NULL);
|
||||
|
||||
if ( res != 0){
|
||||
fprintf(stderr, "Error timer_settime: %s\n", strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
printf("Press ENTER to Exit\n");
|
||||
while(getchar()!='\n'){}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
handler(int sig, siginfo_t *si, void *uc)
|
||||
{
|
||||
UNUSED(sig);
|
||||
UNUSED(uc);
|
||||
struct t_eventData *data = (struct t_eventData *) si->_sifields._rt.si_sigval.sival_ptr;
|
||||
printf("Timer fired %d - thread-id: %d\n", ++data->myData, gettid());
|
||||
}
|
||||
```
|
||||
|
||||
与线程定时器相比,我们必须初始化信号并注册一个信号处理程序。这种方法性能更好,因为它不会导致创建额外的线程。因此,信号处理程序的执行也更加确定。缺点显然是正确调试需要额外的配置工作。
|
||||
|
||||
### 总结
|
||||
|
||||
本文中描述的两种方法都是接近内核的定时器的实现。不过,即使 [timer_create(...)][2] 函数是 POSIX 规范的一部分,由于数据结构的细微差别,也不可能在 FreeBSD 系统上编译样例代码。除了这个缺点之外,这种实现还为通用计时应用程序提供了细粒度控制。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/10/linux-timers
|
||||
|
||||
作者:[Stephan Avenwedde][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[FigaroCao](https://github.com/FigaroCao)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/hansic99
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist)
|
||||
[2]: https://linux.die.net/man/2/timer_create
|
||||
[3]: https://github.com/hANSIc99/posix_timers
|
||||
[4]: https://www.qt.io/product/development-tools
|
||||
[5]: https://opensource.com/sites/default/files/posix_timers_open_project_0.png
|
||||
[6]: https://opensource.com/sites/default/files/posix_timers_project_configuration_2.png
|
||||
[7]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html
|
||||
[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html
|
||||
[9]: http://www.opengroup.org/onlinepubs/009695399/functions/strerror.html
|
||||
[10]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html
|
||||
[11]: http://www.opengroup.org/onlinepubs/009695399/functions/getchar.html
|
||||
[12]: https://man7.org/linux/man-pages/man3/signal.3p.html
|
||||
[13]: https://linux.die.net/man/7/signal
|
||||
[14]: https://opensource.com/sites/default/files/posix_timers_sig34_nostop_pass.png
|
||||
[15]: https://sourceware.org/gdb/onlinedocs/gdb/Signals.html
|
||||
[16]: https://opensource.com/sites/default/files/posix_timers_sig34_pop_up_2.png
|
||||
[17]: https://opensource.com/sites/default/files/posix_timers_signal_windows.png
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202301/09/150238f1d60cmvssr9d0js.jpg
|
@ -0,0 +1,190 @@
|
||||
[#]: subject: "7 Reasons Why Cinnamon is a Fantastic (Yet Underrated) Linux Desktop Environment"
|
||||
[#]: via: "https://itsfoss.com/why-cinnamon/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15450-1.html"
|
||||
|
||||
Cinnamon 是一个被低估的神奇 Linux 桌面环境
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> Linux Mint 是我最喜欢的发行版之一,其旗舰版的默认 Cinnamon 桌面是我如此喜欢它的原因。
|
||||
|
||||
Cinnamon 桌面提供的用户体验可能并不炫目花哨。但是,用户有充分的理由喜欢这个桌面环境,并可以轻松地用它来完成工作。
|
||||
|
||||
在日复一日工作中,我们想要的是,一个能按预期工作且不造成妨碍的用户界面。
|
||||
|
||||
我认为 Cinnamon 桌面做对了几件事,可以给你带来了令人兴奋的体验。让我在这里介绍其中一些。
|
||||
|
||||
> 如果你还不知道,Cinnamon 桌面是由 Linux Mint 的创建者 Clement Lefebvre 于 2011 年创建的 GNOME 3 复刻版,并经过多年的改进。
|
||||
|
||||
### 1、熟悉的用户界面
|
||||
|
||||
![Linux Mint 21][1]
|
||||
|
||||
构建 Cinnamon 的主要目的是为了保持 GNOME 2 的桌面风格。
|
||||
|
||||
而这就是为什么与最流行的消费级桌面操作系统 Windows 相比,你会看到一个熟悉的桌面布局。
|
||||
|
||||
当然,随着时间的推移,Windows 11 已经进化了它的通常布局。但是,访问开始菜单、任务栏、托盘中的系统图标和几个窗口装饰使其易于掌握。
|
||||
|
||||
无论你是 Windows 用户还是 macOS 用户,Cinnamon 的桌面布局都不应该让你感到有什么挑战。
|
||||
|
||||
![Linux Mint 欢迎屏幕][2]
|
||||
|
||||
为了进一步帮助你,Linux Mint 的 “欢迎屏幕” 为你迅速提供了各种信息。
|
||||
|
||||
### 2、轻量级
|
||||
|
||||
为了获得舒适的 Cinnamon 桌面体验(通常使用 Linux Mint),有以下最低系统要求:
|
||||
|
||||
- 4GB 内存
|
||||
- 100 GB 的磁盘空间
|
||||
- 1024×768 分辨率的屏幕
|
||||
|
||||
在现代计算时代,这些规格应该适合几乎所有人。所以,你不必担心需要一个疯狂的内存或磁盘空间来运行由 Cinnamon 驱动的 Linux 发行版。
|
||||
|
||||
当然,你可以尝试 [在 Ubuntu 上安装 Cinnamon 桌面][3]。
|
||||
|
||||
但是,在本文中,我们认为 Linux Mint 是理想的使用案例。
|
||||
|
||||
### 3、快速的性能而不牺牲用户体验
|
||||
|
||||
当我们想到一个轻量级的桌面环境时,我们通常会想象一个注重性能的、平淡无奇的用户界面。
|
||||
|
||||
![Linux Mint 首选项][4]
|
||||
|
||||
在 Cinnamon 桌面上,情况并非如此。它确实包括了各种细微的动画和特色的图标/主题,即使不是最好的,其外观也相当现代。
|
||||
|
||||
它以极简的方式让你看起来很赏心悦目。
|
||||
|
||||
通常情况下,我很喜欢漂亮的用户界面,但我仍然可以接受 Linux Mint 的简单直接的用户体验,并在双显示器设置(1440p + 1080p)上运行它。
|
||||
|
||||
它可能不是 Linux Mint Cinnamon 版最好的双显示器体验(对我来说,第二个屏幕上没有停靠区和面板),但需要改进地方不多。
|
||||
|
||||
### 4、默认的自定义选项
|
||||
|
||||
你可能已经知道,在提供开箱即用的定制能力方面,KDE 可能是最棒的。
|
||||
|
||||
如果你对这种方式感到好奇,我们有超级有用的指南:
|
||||
|
||||
- [KDE 定制指南][5]
|
||||
- [如何正确地给 KDE Plasma 定制主题(深度指南)][6]
|
||||
- [最佳的 KDE Plasma 华丽主题][7]
|
||||
|
||||
但是,对于许多用户来说,这有些过于复杂了。
|
||||
|
||||
我认为 Linux Mint 给出了适量的额外控制/定制,你也可以在它的欢迎屏幕上了解到这些。
|
||||
|
||||
![Cinnamon 主题定制][8]
|
||||
|
||||
一些你可以轻松定制的元素包括:
|
||||
|
||||
- 桌面颜色(强调色)
|
||||
- 浅色/深色主题切换
|
||||
- 面板布局
|
||||
- 图标、按钮和鼠标指针
|
||||
|
||||
你可以前往系统设置,并导航到 “主题”,找到必要的调整项。
|
||||
|
||||
推荐阅读:
|
||||
|
||||
> **[在 Linux 上定制 Cinnamon 桌面的 7 种方法][9]**
|
||||
|
||||
### 5、为你的体验增色的官方附加组件
|
||||
|
||||
![Cinnamon 桌面部件][10]
|
||||
|
||||
Linux Mint 支持各种插件来增强你的体验。这些都是 [Cinnamon 调味品][11] 产品的一部分。它们包括:
|
||||
|
||||
- 主题
|
||||
- 扩展程序
|
||||
- <ruby>小程序<rt>Applet</rt></ruby>
|
||||
- <ruby>桌面组件<rt>Desklet</rt></ruby>
|
||||
|
||||
小程序和桌面组件是小型程序,你可以分别在面板(靠近系统托盘)和桌面上添加。
|
||||
|
||||
![小程序][12]
|
||||
|
||||
你可以管理系统默认的小程序,也可以从官方软件库下载更多的小程序。
|
||||
|
||||
![小程序][13]
|
||||
|
||||
同样,你可以从可用的默认程序中添加桌面组件,或者从软件库中获得新的。
|
||||
|
||||
![桌面组件][14]
|
||||
|
||||
大量有价值的实用程序可以用来监控系统资源、检查天气,以及更多。
|
||||
|
||||
此外,你还可以访问社区构建的各种主题,可以很容易地给你一个你一直想要的外观。
|
||||
|
||||
![Cinnamon 主题][15]
|
||||
|
||||
通过补充上述所有的 “调味品”,你可以使用扩展来使面板透明,在桌面上添加水印,启用窗口平铺,并添加一些令人兴奋的窗口动画。
|
||||
|
||||
![Linux Mint 扩展][16]
|
||||
|
||||
### 6、兼容和无缝的用户体验
|
||||
|
||||
为什么我再次强调用户体验?
|
||||
|
||||
Cinnamon 桌面最棒的地方在于它以尊重和支持所有功能的方式发展。
|
||||
|
||||
例如,如果你想安装一个你在 KDE Plasma 上喜欢使用的应用程序,它在这里也应该以同样的方式工作。Cinnamon 桌面没有什么特别之处,会破坏这种体验。
|
||||
|
||||
![GNOME 账户应用][17]
|
||||
|
||||
同样地,该桌面增加了一些试图与其他桌面环境的服务共存的功能。例如,支持使用 GNOME 在线账户的日历事件。
|
||||
|
||||
### 7、面板定制
|
||||
|
||||
![Linux Mint 面板][18]
|
||||
|
||||
停靠区、任务栏或面板是用户界面的一个组成部分。
|
||||
|
||||
是的,其他的桌面环境也允许你在某种程度上同样定制这些。但在 Cinnamon 中,你可以得到大量的控制权来调整它。
|
||||
|
||||
我认为你可以得到一个用户想要的所有基本选项。
|
||||
|
||||
### 总结
|
||||
|
||||
GNOME 和 KDE Plasma 是流行的桌面环境。然而,Cinnamon 在提供最佳用户体验的基本部分上并不逊色。
|
||||
|
||||
你对 Cinnamon 桌面环境有什么看法?你更喜欢用 Linux Mint 来尝试它吗?在下面的评论部分分享你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/why-cinnamon/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://itsfoss.com/content/images/wordpress/2022/11/linux-mint-21-full.jpg
|
||||
[2]: https://itsfoss.com/content/images/wordpress/2022/11/linux-mint-welcome.png
|
||||
[3]: https://itsfoss.com/install-cinnamon-on-ubuntu/
|
||||
[4]: https://itsfoss.com/content/images/wordpress/2022/11/linux-mint-perf.png
|
||||
[5]: https://itsfoss.com/kde-customization/
|
||||
[6]: https://itsfoss.com/properly-theme-kde-plasma/
|
||||
[7]: https://itsfoss.com/best-kde-plasma-themes/
|
||||
[8]: https://itsfoss.com/content/images/wordpress/2022/11/cinnamon-theme-customize.png
|
||||
[9]: https://itsfoss.com/customize-cinnamon-desktop/
|
||||
[10]: https://itsfoss.com/content/images/wordpress/2022/11/cinnamon-desklet.png
|
||||
[11]: https://cinnamon-spices.linuxmint.com
|
||||
[12]: https://itsfoss.com/content/images/wordpress/2022/11/applet-cinnamon.png
|
||||
[13]: https://itsfoss.com/content/images/wordpress/2022/11/applets-cinnamon.png
|
||||
[14]: https://itsfoss.com/content/images/wordpress/2022/11/desklet-cinnamon.png
|
||||
[15]: https://itsfoss.com/content/images/wordpress/2022/11/cinnamon-theme.png
|
||||
[16]: https://itsfoss.com/content/images/wordpress/2022/11/linux-mint-extensions.png
|
||||
[17]: https://itsfoss.com/content/images/wordpress/2022/11/gnome-accounts-cinnamon.png
|
||||
[18]: https://itsfoss.com/content/images/wordpress/2022/11/linux-mint-panel.png
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202301/16/164642rr27xxt3zo72t7vl.jpg
|
@ -0,0 +1,143 @@
|
||||
[#]: subject: "5 NeoVim GUI Editors You Could Try If You are Not a Total Terminal Junkie"
|
||||
[#]: via: "https://itsfoss.com/neovim-gui-editors/"
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15455-1.html"
|
||||
|
||||
你可以尝试的 5 个 NeoVim GUI 编辑器
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
Vim 很不错,但 NeoVim 更新一些,甚至更棒。Vim 和 NeoVim 都是基于终端的文本编辑器,具有类似的功能。
|
||||
|
||||
如果你是一个习惯于使用 [像 VS Code 这样的 GUI 文本编辑器][1] 的人,并且希望拥有 NeoVim 提供的类似功能,你应该了解一下这些 GUI 编辑器。
|
||||
|
||||
虽然我知道你可以把 NeoVim 作为你目前的文本编辑器的插件,但直接使用 NeoVim 工作要比管理插件更有效和方便。
|
||||
|
||||
在选择 NeoVim 的 GUI 时,有一些不同的选择,我把一些最好的 GUI 列在下面:
|
||||
|
||||
### 1、Neovide
|
||||
|
||||
![neovide][2]
|
||||
|
||||
主要特点:
|
||||
|
||||
- 动画光标
|
||||
- 平滑滚动
|
||||
- 动画窗口
|
||||
- 模糊的浮动窗口
|
||||
- 支持表情符号
|
||||
|
||||
[Neovide][3] 旨在成为一个简单的 NeoVim GUI。
|
||||
|
||||
虽然你不会看到很多图形元素,它只是增加了一些诸如动画之类的 GUI 功能。它使用了一个叫 Skulpin 的库来渲染动画。
|
||||
|
||||
而我在使用 Neovide 时最喜欢的地方是它拥有一个动画光标和平滑滚动。你看一看这个就明白了:
|
||||
|
||||
![][3a]
|
||||
|
||||
看起来很酷。对吗?
|
||||
|
||||
### 2、Neovim Qt
|
||||
|
||||
![neovim Qt][4]
|
||||
|
||||
主要特点:
|
||||
|
||||
- 悬停功能
|
||||
- 多个 GUI 标签
|
||||
- 自动制表符补完
|
||||
- 跨平台支持
|
||||
|
||||
顾名思义,[Neovim Qt][5] 是用 Qt5 库构建的,你会经常看到它在 KDE 中使用。它没有太多花哨的东西,只是增加了一些额外的 GUI 功能,如多个标签,自动制表符补完等。
|
||||
|
||||
因此,如果你已经在使用 Qt5 库,并希望为 NeoVim 提供一个精简的 GUI,它将工作的很好,并为你省去一些依赖安装。
|
||||
|
||||
推荐:
|
||||
|
||||
> **[Vim vs Nano:你应该选择哪个?][6]**
|
||||
|
||||
### 3、Uivonim
|
||||
|
||||
![uivonim][7]
|
||||
|
||||
主要特点:
|
||||
|
||||
- WebGL GPU 渲染和多线程
|
||||
- 支持 VSCode 扩展
|
||||
- Nyancat(经典猫咪动画的 ANSI 文本程序)
|
||||
- 悬停和代码动作
|
||||
|
||||
[Uivonim][8] 是 Veonim(一个建立在 VSCode 插件和 NeoVim 上的简单 IDE)的复刻版,采用 Electron 框架编写,如果你从 VSCode 转换过来,它是一个完美的选择。
|
||||
|
||||
而 Uivonim 的唯一目标是提供丰富的 NeoVim 体验,支持 NeoVim 的最新功能,包括浮动窗口、内置 LSP 等等。你不需要依赖 VSCode 扩展来获得这些功能。
|
||||
|
||||
### 4、FVim
|
||||
|
||||
![fvim][9]
|
||||
|
||||
主要特点:
|
||||
|
||||
- 脱离窗口(使用 `Ctrl+w`,`GE`)
|
||||
- 自定义弹出式菜单条目图标
|
||||
- 支持 HiDPI
|
||||
- GPU 加速
|
||||
|
||||
[FVim][10] 是一个用 F# + Avalonia 构建的 NeoVim 的跨平台 GUI,带有一些突破性的功能,如高性能渲染(在 4K 显示器上支持 60FPS)。
|
||||
|
||||
而我经常使用脱离窗口的功能,因为我更喜欢为不同的文本文件设置独立的窗口。另外,如果你是一个资深的远程用户,FVim 也不会让你失望。
|
||||
|
||||
### 5、Goneovim
|
||||
|
||||
![goneovim][11]
|
||||
|
||||
主要特点:
|
||||
|
||||
- 支持一个带有 Bash 和 Zsh 的终端
|
||||
- 迷你地图
|
||||
- 动画光标
|
||||
- HiDPI 缩放
|
||||
- 外部浮动窗口
|
||||
|
||||
顾名思义,[Goneovim][12] 是用 Go 语言编写的,是 Gonvim 的一个复刻品。它提供了足够的 GUI 功能来完成你的工作,如动画光标、像素级滚动等。
|
||||
|
||||
而且它在让你获得基本的文本编辑功能方面也并不差,比如对文本文件的拖放支持。
|
||||
|
||||
### 总结
|
||||
|
||||
这是我对 NeoVim 的图形用户界面的一些好的选择,我希望你能找到你想要的东西。
|
||||
|
||||
如果我错过了任何你喜欢的东西,请在评论中告诉我。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/neovim-gui-editors/
|
||||
|
||||
作者:[Sagar Sharma][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sagar/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/
|
||||
[2]: https://itsfoss.com/content/images/wordpress/2022/11/neovide.png
|
||||
[3]: https://neovide.dev/index.html
|
||||
[3a]: https://itsfoss.com/content/images/wordpress/2022/11/neovide.gif
|
||||
[4]: https://itsfoss.com/content/images/wordpress/2022/11/neovim-qt.png
|
||||
[5]: https://github.com/equalsraf/neovim-qt
|
||||
[6]: https://itsfoss.com/vim-vs-nano/
|
||||
[7]: https://itsfoss.com/content/images/wordpress/2022/11/uivonim.png
|
||||
[8]: https://github.com/smolck/uivonim
|
||||
[9]: https://itsfoss.com/content/images/wordpress/2022/11/fvim-1.png
|
||||
[10]: https://github.com/yatli/fvim
|
||||
[11]: https://itsfoss.com/content/images/wordpress/2022/11/goneovim-1.png
|
||||
[12]: https://github.com/akiyosi/goneovim
|
||||
[13]: https://itsfoss.com/install-latest-vim-ubuntu/
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202301/18/160357g9mrmohow8wm68iw.jpg
|
@ -0,0 +1,132 @@
|
||||
[#]: subject: "lnav: Advanced Log File Viewer for Linux Desktops and Servers"
|
||||
[#]: via: "https://www.debugpoint.com/advanced-log-file-viewer-lnav-ubuntu-linux/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15454-1.html"
|
||||
|
||||
lnav: 用于 Linux 的高级日志文件浏览器
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 如果你想调试或排除任何问题,你需要一个像 lnav 这样的高级日志文件查看器。它在任何 Linux 系统的终端都能创造奇迹。
|
||||
|
||||
### lnav: 日志文件查看器
|
||||
|
||||
`lnav` 可以即时解压缩所有的压缩日志文件,并将它们合并在一起进行漂亮的显示。显示是根据错误/警告的类型进行解析和格式化的,这有助于快速浏览成千上万的日志,特别是在服务器中。
|
||||
|
||||
在分析日志的时候,时间戳是非常重要的。所以 `lnav` 会根据时间戳合并多个日志,这对追踪系统问题很有帮助。
|
||||
|
||||
大多数重要的日志文件格式检测都是内置的,包括如下:
|
||||
|
||||
- <ruby>通用网络访问日志<rt>Common Web Access Log</rt></ruby>格式
|
||||
- CUPS page_log
|
||||
- Syslog
|
||||
- Glog
|
||||
- VMware ESXi/vCenter 日志
|
||||
- dpkg.log
|
||||
- uwsgi
|
||||
- “通用”:任何以时间戳开头的信息
|
||||
- Strace
|
||||
- sudo
|
||||
- GZIP、BZIP
|
||||
|
||||
这还不是全部,`lnav` 还能实现以下功能,使其成为 Linux 系统的重要应用:
|
||||
|
||||
- 根据正则表达式过滤消息
|
||||
- 错误日志的时间轴视图
|
||||
- 漂亮的打印视图,这有助于重新格式化
|
||||
- 使用 SQL 查询日志
|
||||
- 在搜索时,日志会实时更新
|
||||
- 通过正则表达式高亮显示语法(比如你想在整个日志中找出一个 IP 地址)
|
||||
- 显示的日志中任何单词的 Tab 补全!!
|
||||
|
||||
![lnav 在 ubuntu 中运行][1]
|
||||
|
||||
要查看上述功能的截图和了解更多信息,请访问 [本页面][2] 。
|
||||
|
||||
### 如何安装
|
||||
|
||||
这个程序在 Ubuntu、Debian 的官方仓库中可以找到。使用以下命令安装它。
|
||||
|
||||
```
|
||||
sudo apt install lnav
|
||||
```
|
||||
|
||||
而对于 Fedora、RHEL 用户,使用下面的命令:
|
||||
|
||||
```
|
||||
sudo dnf install lnav
|
||||
```
|
||||
|
||||
另外,开发者还提供了一个离线的独立可执行文件,你不需要安装。你可以从 [GitHub 发布页][3] 下载压缩包,然后按以下方式执行:
|
||||
|
||||
```
|
||||
./lnav
|
||||
```
|
||||
|
||||
**注意**:它也可用于 macOS,你可以在上述 GitHub 页面找到。
|
||||
|
||||
### lnav: 如何使用(基础)
|
||||
|
||||
简单的命令语法是:
|
||||
|
||||
```
|
||||
lnav [options] [logfile1 logfile2 …]
|
||||
```
|
||||
|
||||
如果你直接运行 `lnav` 命令,它会显示你系统中的所有日志(`/var/log/messages` 和 `/var/log/syslog`)
|
||||
|
||||
```
|
||||
lnav
|
||||
```
|
||||
|
||||
要查看任何特定的日志文件,在命令行中输入:
|
||||
|
||||
```
|
||||
lnav /var/log/syslog
|
||||
```
|
||||
|
||||
使用 `-t` 参数在你的日志输出中添加时间戳:
|
||||
|
||||
```
|
||||
lnav -t /var/log/syslog
|
||||
```
|
||||
|
||||
以下是 `lnav` 的一些关键开关:
|
||||
|
||||
- `-d file`:将调试信息写入给定的文件。
|
||||
- `-a`:加载所有最新的日志文件类型。
|
||||
- `-r`:也加载较早的轮转的日志文件。
|
||||
- `-t`:在标准输入中读入的数据行上预加时间戳。
|
||||
- `-w file`:将标准输入的内容写入该文件。
|
||||
- `-c cmd`:在文件加载后执行命令。
|
||||
- `-f path`:执行给定文件中的命令。
|
||||
- `-n`:不使用 curses UI 运行(无头模式)。
|
||||
|
||||
![lnav 在 Ubuntu 22.04 中运行][4]
|
||||
|
||||
要进一步阅读和探索,请访问 [官方文档][5]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/advanced-log-file-viewer-lnav-ubuntu-linux/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2016/11/lnav-Running-in-Ubutu.png
|
||||
[2]: http://lnav.org/features/
|
||||
[3]: https://github.com/tstack/lnav/releases/
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2016/11/lnav-running-in-Ubuntu-22.04.jpg
|
||||
[5]: https://docs.lnav.org/en/latest/intro.html
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202301/18/101616eio2v80m1v34ol2o.jpg
|
@ -3,30 +3,32 @@
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15421-1.html"
|
||||
|
||||
什么是 Firefox ESR?如何在 Ubuntu 中安装它?
|
||||
======
|
||||
|
||||
Ubuntu 的 snap 版本你不喜欢?不喜欢每一次 Firefox 的发布都要不断地改变东西?如果你重视稳定性而不是功能,你可以试试 Firefox ESR 版本。
|
||||
![][0]
|
||||
|
||||
Ubuntu 的 Snap 版本你不喜欢?不喜欢每一次 Firefox 的发布都要不断地改变东西?如果你重视稳定性而不是功能,你可以试试 Firefox ESR 版本。
|
||||
|
||||
### 什么是 Firefox ESR?
|
||||
|
||||
Firefox ESR 是 Firefox 的特别版,它不一定像普通版那样每月都有新功能,但它能提供稳定和安全的浏览体验。这适用于企业、组织和机构,在这些地方,稳定性和核心功能比闪亮的新功能更重要。
|
||||
|
||||
把 Firefox ESR 看作是 Linux 发行版的长期稳定版本。他们不一定得到全新的功能,但他们会得到定期的安全和维护更新。这给了用户一个熟悉和稳定的环境。
|
||||
可以把 Firefox ESR 看作是 Linux 发行版的长期稳定版本。它们不一定得到全新的功能,但它们会得到定期的安全和维护更新。这给了用户一个熟悉和稳定的环境。
|
||||
|
||||
#### 你为什么要关心 Firefox ESR?
|
||||
|
||||
Firefox 几乎每个月都会发布一个新版本。它包含安全和功能更新。
|
||||
|
||||
但有些人可能不喜欢功能的加入和删除。如果在更新之后,你一直想知道某些设置到哪里去了,或者不喜欢与以前不同的东西,Firefox ESR可能值得一试。
|
||||
但有些人可能不喜欢各种功能的加入和删除。如果在更新之后,你一直想知道某些设置到哪里去了,或者不喜欢与以前不同的东西,Firefox ESR 可能值得一试。
|
||||
|
||||
基本上,如果你更看重稳定性而不是新功能,那么 Firefox ESR 就适合你。这也是与 Debian 相同的 Firefox 版本,Debian 以其是市场上最稳定的发行版之一而闻名。
|
||||
基本上,如果你更看重稳定性而不是新功能,那么 Firefox ESR 就适合你。这也是 Debian 中携带的 Firefox 版本,Debian 以其是市场上最稳定的发行版之一而闻名。
|
||||
|
||||
让我告诉你如何在 Ubuntu 上获得 Firefox ESR。**_你可以同时安装 Firefox 和 Firefox-ESR 两个版本。它们的标识没有视觉上的区别,所以你必须注意你打开的是哪个火狐版本。_**
|
||||
让我告诉你如何在 Ubuntu 上获得 Firefox ESR。**你可以同时安装 Firefox 和 Firefox-ESR 两个版本。它们的标识没有视觉上的区别,所以你必须注意你打开的是哪个火狐版本。**
|
||||
|
||||
### 在 Ubuntu 中安装 Firefox ESR
|
||||
|
||||
@ -43,7 +45,7 @@ Firefox-ESR 在 Ubuntu 的默认仓库中是不可用的,所以你可以使用
|
||||
|
||||
PPA 只不过是一个由个别技术人员或开发者维护的仓库,拥有默认仓库所没有的东西。
|
||||
|
||||
如果你想了解更多关于 PPA 的信息,我建议你查看我们的其他指南,其中解释了[如何在 Linux 上使用 PPA][1]。
|
||||
如果你想了解更多关于 PPA 的信息,我建议你查看我们的其他指南,其中解释了 [如何在 Linux 上使用 PPA][1]。
|
||||
|
||||
打开你的终端,使用给定的命令来添加 Firefox-ESR 的 PPA:
|
||||
|
||||
@ -75,7 +77,7 @@ firefox-esr -v
|
||||
|
||||
![check installed version of firefox esr in ubuntu][3]
|
||||
|
||||
##### 从 Ubuntu 卸载 Firefox-ESR
|
||||
如何从 Ubuntu 卸载 Firefox-ESR?
|
||||
|
||||
如果 ESR 对你的工作来说感觉太过时了,或者由于其他原因你想从你的系统中删除它,你可以按照以下步骤删除 Firefox-ESR 包和仓库。
|
||||
|
||||
@ -85,7 +87,7 @@ firefox-esr -v
|
||||
sudo apt remove firefox-esr
|
||||
```
|
||||
|
||||
现在,你可以使用给定的命令来[从 Ubuntu 删除 PPA][4]:
|
||||
现在,你可以使用给定的命令来 [从 Ubuntu 删除 PPA][4]:
|
||||
|
||||
```
|
||||
sudo add-apt-repository --remove ppa:mozillateam/ppa
|
||||
@ -95,9 +97,9 @@ sudo add-apt-repository --remove ppa:mozillateam/ppa
|
||||
|
||||
#### 方法 2:使用 Snap 安装 Firefox-ESR
|
||||
|
||||
不管你爱不爱它,Snaps 在 Ubuntu 上是预先配置好的,我发现使用 Snaps 是安装软件包的一个很好的方法,特别是当你想避免从源码构建它们或使用 PPA 时。
|
||||
不管你爱不爱它,Snap 在 Ubuntu 上是预先配置好的,我发现使用 Snap 是安装软件包的一个很好的方法,特别是当你想避免从源码构建它们或使用 PPA 时。
|
||||
|
||||
使用 Snaps 安装 Firefox-ESR,你需要做的就是使用给定的命令:
|
||||
使用 Snap 安装 Firefox-ESR,你需要做的就是使用给定的命令:
|
||||
|
||||
```
|
||||
sudo snap install firefox --channel=esr/stable
|
||||
@ -105,7 +107,7 @@ sudo snap install firefox --channel=esr/stable
|
||||
|
||||
![install firefox esr using snaps in ubuntu][5]
|
||||
|
||||
##### 删除 Firefox-ESR Snap
|
||||
如何删除 Firefox-ESR Snap?
|
||||
|
||||
要删除 Firefox-ESR(snap 包),请使用 [snap remove 命令][6]:
|
||||
|
||||
@ -128,15 +130,16 @@ via: https://itsfoss.com/firefox-esr-ubuntu/
|
||||
作者:[Sagar Sharma][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sagar/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://itsfoss.com/ppa-guide/
|
||||
[2]: https://itsfoss.com/wp-content/uploads/2022/11/add-firefox-esr-repository-in-ubuntu.png
|
||||
[3]: https://itsfoss.com/wp-content/uploads/2022/11/check-installed-version-of-firefox-esr-in-ubuntu.png
|
||||
[2]: https://itsfoss.com/content/images/wordpress/2022/11/add-firefox-esr-repository-in-ubuntu.png
|
||||
[3]: https://itsfoss.com/content/images/wordpress/2022/11/check-installed-version-of-firefox-esr-in-ubuntu.png
|
||||
[4]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/
|
||||
[5]: https://itsfoss.com/wp-content/uploads/2022/11/install-firefox-esr-using-snaps-in-ubuntu.png
|
||||
[5]: https://itsfoss.com/content/images/wordpress/2022/11/install-firefox-esr-using-snaps-in-ubuntu.png
|
||||
[6]: https://itsfoss.com/remove-snap/
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202301/07/165704ojar9wfkvptwop0w.jpg
|
@ -0,0 +1,188 @@
|
||||
[#]: subject: "Top 5 Live Streaming Applications for Ubuntu and Other Linux [2022 Edition]"
|
||||
[#]: via: "https://www.debugpoint.com/live-streaming-applications-linux-2022/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15443-1.html"
|
||||
|
||||
适用于 Linux 的五大流媒体直播应用
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 本文列出了 Linux 上的五大流媒体直播应用,包括了它们的功能、亮点、下载详情和对比。
|
||||
|
||||
现在是为你的业务纳入在线视频内容的最佳时机。为什么?因为研究表明,全球在线视频市场正以每年约 20% 的速度增长。
|
||||
|
||||
而且,由于开发者们提供的一些优秀软件,任何人都可以轻松地创建视频内容,并在 YouTube 和 Twitch 等几个流行的平台上传播。如果你仔细想想,你会发现如今你在网上观看的视频内容比基于文本的内容更多。
|
||||
|
||||
因此,在这篇文章中,我们将列出一些适用于 Ubuntu 和其他 Linux 的免费软件,这些软件很容易用于为你和你的企业创建超级有趣的流媒体内容。
|
||||
|
||||
### Linux 的五大流媒体直播应用
|
||||
|
||||
#### OBS Studio
|
||||
|
||||
本列表中的第一个免费应用程序是 OBS Studio(即 Open Broadcaster Software)。它是一个具有屏幕广播功能的流媒体直播应用程序,可用于 Linux、Windows 和 macOS。
|
||||
|
||||
出于几个原因,OBS Studio 是这个名单上最好的一个。它内置了编码,支持 RTMP 广播、多源、网络摄像头、绿屏、捕捉卡和你的应用程序窗口。
|
||||
|
||||
其用户界面相当简单明了,功能丰富。你可以从第三方开发的插件中获得帮助,以扩展其功能,例如,在直播时将 Twitter 上的实时推文混入你的流媒体。不过,OBS 不支持多比特率流媒体。
|
||||
|
||||
![OBS Studio - 适用于Linux的直播应用程序][1]
|
||||
|
||||
如何安装:
|
||||
|
||||
OBS Studio 可以在所有 Linux 发行版的官方软件库中找到。详细的安装说明见下面的链接。
|
||||
|
||||
> **[下载 OBS Studio][2]**
|
||||
|
||||
更多信息:
|
||||
|
||||
- [主页][3]
|
||||
- [文档][4]
|
||||
|
||||
#### VokoscreenNG
|
||||
|
||||
我们将在这个列表中介绍的第二个应用程序是 VokoscreenNG。它复刻了已停止的 Vokoscreen 项目。这个新的应用程序完全用 Qt 和 GStreamer 库编写。它可以记录你的屏幕,并接受多个音频源和视频源。VokoscreenNG 的工具箱也相当引人注目。它包括一个放大镜、计时器、系统托盘插件,可以简化你的工作流程。
|
||||
|
||||
它可以免费用于 Linux 和 Windows。
|
||||
|
||||
![vokoscreenNG - 适用于Linux的流媒体直播应用程序][5]
|
||||
|
||||
如何安装:
|
||||
|
||||
你可以从下面的链接下载用于 Linux 系统的压缩可执行文件。下载后,将其解压,然后执行二进制文件来启动该应用程序。
|
||||
|
||||
记住,这个应用程序需要在你的 Linux 系统中安装 X11、PulseAudio 和 GStreamer 插件才能工作。如果你使用的是带有 Wayland 和 Pipewire 声音服务器的现代 Linux 系统(例如 Fedora),这个应用程序可能无法工作。
|
||||
|
||||
> **[下载 VokoscreenNG][6]**
|
||||
|
||||
更多信息:
|
||||
|
||||
- [主页][7]
|
||||
|
||||
#### Restreamer
|
||||
|
||||
Restreamer 应用程序可以让你直接在你的网站上直播视频和截屏,而无需任何流媒体服务商。也可以用这个应用程序使用流行的流媒体解决方案,如 YouTube、Twitch等。
|
||||
|
||||
这个应用程序功能丰富,有一个不错的功能列表。下面是对其功能的快速介绍:
|
||||
|
||||
- 支持 H.264 流媒体
|
||||
- 内置 HTML5 视频播放
|
||||
- 可用于 Linux、macOS、Windows 和 Docker 镜像
|
||||
- 支持你自己的网站和 YouTube、Twitchm、Facebook、Vimeo、Wowza 等。
|
||||
- 支持多个视频源:[网络摄像机][8]、USB 摄像机或任何 H.2645 流媒体
|
||||
- 编码和音频源支持
|
||||
- 支持 JPEG 形式的定期快照
|
||||
- 通过 JSON HTTP API 访问流状态,以便进行额外的编程
|
||||
|
||||
![Restreamer][9]
|
||||
|
||||
如何安装:
|
||||
|
||||
安装 Restreamer 有点麻烦,因为它是通过 Docker 镜像发布的。你可以在下面的链接中找到在 Linux、Windows 和 MacOS 安装的说明。
|
||||
|
||||
> **[下载 Restreamer][10]**
|
||||
|
||||
更多信息:
|
||||
|
||||
- [主页][11]
|
||||
- [文档][12]
|
||||
- [源代码][13]
|
||||
|
||||
#### ffscreencast
|
||||
|
||||
ffscreencast 是一个使用 ffmpeg 库的命令行流媒体应用程序。它利用了 ffmpeg 的强大功能,并作为它的一个封装器。尽管它是以命令行的形式出现的,但你可以直接通过终端使用其强大的功能,如多源和录音设备。它也支持多种显示设置。你还可以在你的桌面截屏上叠加你的摄像机画面。
|
||||
|
||||
如何安装:
|
||||
|
||||
要安装这个应用程序,你需要克隆它的 Git 代码库,然后将其内容复制到 `/bin`目录,以便全局执行 `ffscreencast` 命令。
|
||||
|
||||
```
|
||||
git clone https://github.com/cytopia/ffscreencast
|
||||
cd ffscreencastsudo
|
||||
cp bin/ffscreencast /usr/local/bin
|
||||
```
|
||||
|
||||
你可以在终端用 `ffscreencast` 命令来运行这个应用程序。
|
||||
|
||||
> **[源代码和主页][15]**
|
||||
|
||||
#### Open Streaming Platform
|
||||
|
||||
本列表中的最后一个应用是 Open Streaming Platform(OSP),这是一个开源的 RTMP 流媒体软件,可以作为 YouTube LIVE、Twitch.tv 等的自托管替代品。
|
||||
|
||||
![Open Streaming Platform][14]
|
||||
|
||||
如果使用得当,这个应用程序功能丰富且强大。因为它有以下的基本功能:
|
||||
|
||||
- 从 Open Broadcast Software(OBS)等输入源进行 RTMP 直播。
|
||||
- 每个用户有多个频道,允许一个用户同时广播多个流,而不需要多个账户。
|
||||
- 视频流记录和按需播放。
|
||||
- 手动上传来源于 OSP 之外的 MP4 视频。
|
||||
- 视频剪辑,为值得注意的时刻创建更短的视频。
|
||||
- 频道所有者的实时聊天管理(禁止/解禁)。
|
||||
- 管理员控制的自适应流媒体。
|
||||
- 受保护的频道,只允许你想要的观众访问。
|
||||
- 实时频道,当流媒体没有直播时,继续聊天和闲逛。
|
||||
- Webhooks:通过完全可定制的 HTTP 请求将 OSP 连接到其他服务,这可以传递信息。
|
||||
- 将你的流媒体或视频直接嵌入到另一个网页中,很容易。
|
||||
- 通过 Facebook 或 Twitter 快速分享频道或视频。
|
||||
- 能够将用户界面定制为你自己的个人外观的主题
|
||||
|
||||
如何安装:
|
||||
|
||||
要安装 Open Streaming Platform,请按照以下页面的详细说明进行。
|
||||
|
||||
> **[下载 Open Streaming Platform][16]**
|
||||
|
||||
更多信息:
|
||||
|
||||
- [主页][17]
|
||||
- [源代码][18]
|
||||
- [文档][19]
|
||||
|
||||
### 总结
|
||||
|
||||
可用于 Linux 的自由开源的流媒体应用程序不多。然而,有几个商业性的流媒体应用程序,它们可能会给你更多的选择、质量和支持。但正如我所说,它们可能要花费你一些钱。所以,如果你是流媒体世界的新手,你可能想从上面列出的用于 Linux 系统的免费流媒体应用程序开始。我希望这篇文章能给你一些想法,让你根据自己的需要使用,并让你开始使用。
|
||||
|
||||
请在下面的评论栏里告诉我你最喜欢的流媒体软件。
|
||||
|
||||
加油。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/live-streaming-applications-linux-2022/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2022/02/OBS-Studio.jpg
|
||||
[2]: https://obsproject.com/wiki/install-instructions#linux
|
||||
[3]: https://obsproject.com/
|
||||
[4]: https://obsproject.com/wiki/Home
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2022/02/vokoscreenNG.jpg
|
||||
[6]: https://linuxecke.volkoh.de/vokoscreen/vokoscreen-download.html
|
||||
[7]: https://linuxecke.volkoh.de/vokoscreen/vokoscreen.html
|
||||
[8]: https://www.debugpoint.com/2018/08/onvifviewer-internet-camera-viewer-for-linux/
|
||||
[9]: https://www.debugpoint.com/wp-content/uploads/2022/02/Restreamer.jpg
|
||||
[10]: https://datarhei.github.io/restreamer/docs/installation-index.html
|
||||
[11]: https://datarhei.github.io/restreamer/
|
||||
[12]: https://datarhei.github.io/restreamer/docs/index.html
|
||||
[13]: https://github.com/datarhei/restreamer
|
||||
[14]: https://www.debugpoint.com/wp-content/uploads/2022/02/Open-Streaming-Platform-2048x1026.jpg
|
||||
[15]: https://github.com/cytopia/ffscreencast
|
||||
[16]: https://wiki.openstreamingplatform.com/Install/Standard
|
||||
[17]: https://openstreamingplatform.com/
|
||||
[18]: https://gitlab.com/Deamos/flask-nginx-rtmp-manager
|
||||
[19]: https://wiki.openstreamingplatform.com/
|
||||
[20]: https://www.debugpoint.com/how-to-create-ubuntu-linux-os-bootable-usb-in-windows/
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202301/14/172408h1rpephh9hutsrkd.jpg
|
@ -0,0 +1,224 @@
|
||||
[#]: subject: "oh my zsh and powerlevel10k: A Match Made in Heaven"
|
||||
[#]: via: "https://www.debugpoint.com/oh-my-zsh-powerlevel10k/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15432-1.html"
|
||||
|
||||
Oh My Zsh 和 Powerlevel10k:天作之合
|
||||
======
|
||||
|
||||
> 这是一篇快速而简单的指南,用 Oh My Zsh 和 Powerlevel10k 主题改造你的 Zsh 终端 Shell,使其在 Ubuntu 和其他 Linux 发行版中看起来很酷。
|
||||
|
||||
![][1]
|
||||
|
||||
大多数 Linux 发行版中的默认 Shell 是 Bash。Bash 是一个可靠的和传统的工具。然而,它缺乏一些自定义功能,比如漂亮的颜色、光标支持等等。
|
||||
|
||||
你可以使用另一个 Shell,即 Zsh 来得到更多的设置调整,并帮助你扩展你的 Bash Shell 体验。
|
||||
|
||||
这个简单的指南解释了如何安装 Zsh、Oh My Zsh 并应用 Powerlevel10k 主题。
|
||||
|
||||
### Oh My Zsh 和 Powerlevel10k 安装和配置指南
|
||||
|
||||
#### 1、安装 Zsh 和改变 Shell
|
||||
|
||||
打开一个终端,使用以下适用于你的发行版的命令安装 Zsh。
|
||||
|
||||
Ubuntu、Debian、Linux Mint 和所有相关的发行版:
|
||||
|
||||
```
|
||||
sudo apt install zsh
|
||||
```
|
||||
|
||||
Fedora:
|
||||
|
||||
```
|
||||
sudo dnf install zsh
|
||||
```
|
||||
|
||||
Arch:
|
||||
|
||||
```
|
||||
pacman -S zsh
|
||||
```
|
||||
|
||||
安装完成后,找出 Zsh 的安装路径:
|
||||
|
||||
```
|
||||
whereis zsh
|
||||
```
|
||||
|
||||
然后使用当前用户的 Zsh 可执行路径改变 Shell。
|
||||
|
||||
```
|
||||
chsh -s /usr/bin/zsh <用户名 >
|
||||
```
|
||||
|
||||
![改变当前用户的 Shell][2]
|
||||
|
||||
关闭并再次打开终端。然后你应该看到 Zsh 的首次设置。选择选项 2。它将用一个默认的主题改变你的 Shell 提示符的外观,如下图所示:
|
||||
|
||||
![Zsh 的首次设置][3]
|
||||
|
||||
#### 2、安装 Oh My Zsh
|
||||
|
||||
Oh My Zsh 是一套可以进一步定制 Zsh 的脚本。
|
||||
|
||||
首先,我们将从 GitHub 上下载 Oh My Zsh 脚本来安装它。如果你有 `wget` 和 `git` 软件包,那就最好了。如果还没有安装,请使用以下命令 [安装 wget][4] & git:
|
||||
|
||||
```
|
||||
sudo apt install wget
|
||||
sudo apt install git
|
||||
```
|
||||
|
||||
然后用下面的命令安装 Oh My Zsh:
|
||||
|
||||
```
|
||||
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
```
|
||||
|
||||
然后你应该看到 Oh My Zsh 及默认主题 Robbyrussell 应用到了你的终端。
|
||||
|
||||
![安装 Oh My Zsh 和默认主题][5]
|
||||
|
||||
Oh My Zsh 还附带了其他的主题,你可以 [使用这篇指南][6] 安装它们。然而,在本教程中,我将谈论一个特定的主题,即 Powerlevel10k。
|
||||
|
||||
#### 3、为 Oh My Zsh 安装 Powerlevel10k 主题
|
||||
|
||||
打开终端,运行以下命令,从 GitHub 上克隆 Powerlevel10k 代码库,并将文件放到 Oh My Zsh 的配置文件夹中。
|
||||
|
||||
```
|
||||
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
|
||||
```
|
||||
|
||||
用文本编辑器打开 `~/.zshrc` 文件,将 `ZSH_THEME` 变量设为 `"powerlevel10k/powerlevel10k"`。
|
||||
|
||||
```
|
||||
cd ~
|
||||
```
|
||||
|
||||
```
|
||||
nano .zshrc
|
||||
```
|
||||
|
||||
默认情况下,它应该是 Robbyrussell。删除 `”robbyrussell"`,添加下面的 `"powerlevel10k/powerlevel10k"`。
|
||||
|
||||
更改后,你的 `~/.zshrc` 文件应该是这样的:
|
||||
|
||||
```
|
||||
ZSH_THEME="powerlevel10k/powerlevel10k”
|
||||
```
|
||||
|
||||
保存并关闭该文件(`CTRL+O`、回车和 `CTRL+X`)。
|
||||
|
||||
![改变 Oh My Zsh 主题为 Powerlevel10k][7]
|
||||
|
||||
重新启动你的终端,启动首次向导来设置 Powerlevel10k 主题。
|
||||
|
||||
#### 4、Powerleve10k 的首次设置
|
||||
|
||||
安装后启动终端时,Powerlevel10k 会提示你各种问题以了解你的 Linux 发行版设置。所以,根据你的需要按下键,按照你的口味来定制你的终端。下面是一些问题的例子截图,可以给你一些启发。
|
||||
|
||||
![Powerlevel10k - wizard1][8]
|
||||
|
||||
![Powerlevel10k - wizard2][9]
|
||||
|
||||
最后,你可以保存文件,享受你的终端的新面貌。
|
||||
|
||||
![应用 Powerlevel10k Zsh 主题设置后][10]
|
||||
|
||||
如果你想再次重启配置向导,运行以下程序。你可以随心所欲地做,次数不限。
|
||||
|
||||
```
|
||||
p10k configure
|
||||
```
|
||||
|
||||
基本设置就这样结束了。如果你想了解更多,请继续阅读。
|
||||
|
||||
### 更多配置(高级用法)
|
||||
|
||||
#### 5、安装 Dracula GNOME 终端主题
|
||||
|
||||
如果你使用的是带有原生终端应用的 GNOME 桌面,你可以试试令人惊叹的 Drakula 主题。要做到这一点,打开一个终端,运行下面的命令来下载该主题:
|
||||
|
||||
```
|
||||
git clone https://github.com/dracula/gnome-terminalcd gnome-terminal
|
||||
```
|
||||
|
||||
打开 GNOME “终端”应用,进入偏好设置。通过点击 “+” 添加一个新的配置文件,并命名为 “drakula”。然后进入颜色标签,取消勾选 “<ruby>使用系统主题的颜色<rt>use colors from system theme</rt></ruby>” 选项。
|
||||
|
||||
![为终端创建一个新的配置文件][11]
|
||||
|
||||
回到终端,运行以下程序。当出现提示时,选择你刚才创建的配置文件名称,如上所述。
|
||||
|
||||
```
|
||||
./install.sh
|
||||
```
|
||||
|
||||
![为 GNOME “终端”应用 Drakula 主题][12]
|
||||
|
||||
一旦安装完成,回到偏好设置中,将 Drakula 配置文件标记为默认。
|
||||
|
||||
#### 6、Zsh 的自动补完和语法高亮
|
||||
|
||||
你可能想试试由社区开发的两个可用于 Zsh 的插件。它们是 zsh-autosuggestions 和 zsh-syntax-highlighting。
|
||||
|
||||
打开终端,运行以下程序,下载 zsh-autosuggestions,并将其放在插件文件夹中:
|
||||
|
||||
```
|
||||
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
|
||||
```
|
||||
|
||||
同样地,为语法高亮插件运行以下程序:
|
||||
|
||||
```
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
|
||||
```
|
||||
|
||||
通过文本编辑器打开 `~/.zshrc`文件(使用以下命令),并找到 `plugins=(git)` 一行。并将其替换为以下内容:
|
||||
|
||||
```
|
||||
nano ~/.zshrc
|
||||
```
|
||||
|
||||
```
|
||||
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
|
||||
```
|
||||
|
||||
使用 `CTRL+O`、回车和 `CTRL+X` 保存并关闭该文件。
|
||||
|
||||
关闭并打开你的终端。现在,你应该可以使用自动建议和语法高亮了。
|
||||
|
||||
### 总结
|
||||
|
||||
这样就好了!你现在应该已经在你的系统上安装了 Oh My Zsh 和 Powerlevel10k 主题。你可以根据自己的需要,进一步定制 Powerlevel10k 主题的外观和行为。
|
||||
|
||||
干杯。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/oh-my-zsh-powerlevel10k/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2022/12/ohp10k.jpg
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2022/12/change-the-shell-for-the-current-user.jpg
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2022/12/first-time-setup-for-zsh.jpg
|
||||
[4]: https://www.debugpoint.com/wget-not-found-error/
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2022/12/Install-oh-my-zsh-and-default-theme.jpg
|
||||
[6]: https://www.debugpoint.com/install-use-zsh/
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2022/12/change-oh-my-zsh-theme-to-powerlevel10k.jpg
|
||||
[8]: https://www.debugpoint.com/wp-content/uploads/2022/12/powerlevel10k-wizard1.jpg
|
||||
[9]: https://www.debugpoint.com/wp-content/uploads/2022/12/powerlevel10k-wizard-2.jpg
|
||||
[10]: https://www.debugpoint.com/wp-content/uploads/2022/12/After-applying-settings-in-powerlevel10k-zsh-theme.jpg
|
||||
[11]: https://www.debugpoint.com/wp-content/uploads/2022/12/create-a-new-profile-for-terminal.jpg
|
||||
[12]: https://www.debugpoint.com/wp-content/uploads/2022/12/applying-the-drakula-theme-for-gnome-terminal.jpg
|
@ -3,14 +3,14 @@
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15426-1.html"
|
||||
|
||||
Google、Alexa 和 Siri 的开源替代品 Home Assistant 平台
|
||||
Home Assistant:谷歌助理、Alexa 和 Siri 的开源替代品
|
||||
======
|
||||
|
||||
一个开源助手可以取代谷歌、Alexa 和 Siri?
|
||||
> 一个开源助手可以取代谷歌助理、Alexa 和 Siri?
|
||||
|
||||
![An Open-Source Alternative to Google, Alexa, and Siri in Works for Home Assistant Platform][1]
|
||||
|
||||
@ -20,13 +20,13 @@ Google、Alexa 和 Siri 的开源替代品 Home Assistant 平台
|
||||
|
||||
> 💡 该公司由 Home Assistant 的创始人 [Paulus Schoutsen][3] 领导。
|
||||
|
||||
在上周的[博客][4]中,Paulus 宣布了**一个新的开源项目,旨在提供一个没有主动互联网连接的语音助手**或任何其他大型科技语音助手。
|
||||
在上周的 [博客][4] 中,Paulus 宣布了**一个新的开源项目,旨在提供一个没有主动互联网连接的语音助手**,也无需任何其他大型科技公司的语音助手。
|
||||
|
||||
这是_一个对 Google、Alexa 和 Siri 的开源挑战者?_ 😲
|
||||
这是 _一个对谷歌助理、Alexa 和 Siri 的开源挑战者?_ 😲
|
||||
|
||||
让我们看看这到底是怎么回事。
|
||||
|
||||
**它是什么?:**这将是 Home Assistant 应用的一部分,将提供在本地运行语音命令的能力,以控制连接的智能设备。
|
||||
**它是什么?** 这将是 Home Assistant 应用的一部分,将提供在本地运行语音命令的能力,以控制连接的智能设备。
|
||||
|
||||
Paulus 还断言,他们最重要的优先事项是支持不同的语言,他说:
|
||||
|
||||
@ -40,7 +40,7 @@ Paulus 还断言,他们最重要的优先事项是支持不同的语言,他
|
||||
|
||||
_为什么要重新发明已经存在的东西?最好是在它的基础上进行改进。_
|
||||
|
||||
**可以期待什么?:**最初,语音助手将不能做你可能期待的事情。因此,像进行网络搜索、打电话、玩语音游戏等,都是不可能的。
|
||||
**可以期待什么?** 最初,这个语音助手做不到做你可能期待的事情。因此,像进行网络搜索、打电话、玩语音游戏等,都是不可能的。
|
||||
|
||||
它所关注的反而是**语音助手应该有的基本功能**。这样做是为了确保他们面前的工作是可控的。
|
||||
|
||||
@ -48,9 +48,9 @@ _为什么要重新发明已经存在的东西?最好是在它的基础上进
|
||||
|
||||
在目前的状态下,Home Assistant 在其用户界面上支持 62 种不同的语言。他们计划用他们的语音助手增加对所有这些语言的支持。
|
||||
|
||||
**何时期待?:**他们已经开始了这方面的工作,为每种语言建立一个[意图匹配句子集合][7]。
|
||||
**何时期待?** 他们已经开始了这方面的工作,为每种语言建立一个 [意图匹配句子集合][7]。
|
||||
|
||||
这意味着社区可以通过将智能设备的命令改编成各自的母语来为语音助手的发展做出贡献。
|
||||
这意味着社区可以通过将智能设备的命令改编成各自的母语,来为语音助手的发展做出贡献。
|
||||
|
||||
他们的目标是在 **2023** 年的某个时候发布,并提到这将是“_语音年_”。
|
||||
|
||||
@ -65,7 +65,7 @@ via: https://news.itsfoss.com/open-source-assistant/
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
116
published/20230102.0 ⭐️ How to read and write files in Rust.md
Normal file
116
published/20230102.0 ⭐️ How to read and write files in Rust.md
Normal file
@ -0,0 +1,116 @@
|
||||
[#]: subject: "How to read and write files in Rust"
|
||||
[#]: via: "https://opensource.com/article/23/1/read-write-files-rust"
|
||||
[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15442-1.html"
|
||||
|
||||
如何在 Rust 中读取和写入文件
|
||||
======
|
||||
|
||||
> 跟随这个演示,学习如何在 Rust 中使用文件系统模块。
|
||||
|
||||
![][0]
|
||||
|
||||
知道如何读写文件对各种用途都很有用。在 Rust 中,这项任务是通过标准库中的文件系统模块([std::fs][1])完成的。在这篇文章中,我将向你介绍如何使用这个模块。
|
||||
|
||||
为了演示这项任务,我准备了一些示例代码,也可以在 [GitHub][2] 上找到。
|
||||
|
||||
### 准备工作
|
||||
|
||||
在使用 Rust 时,失败的函数会返回 [Result][3] 类型。尤其是文件系统模块会返回专门的类型 [std::io::Result<T, Error>][4]。有了这些知识,你可以从 `main()` 函数中返回相同的类型:
|
||||
|
||||
```
|
||||
fn main() -> std::io::Result<()> {
|
||||
/* ...code comes here... */
|
||||
```
|
||||
|
||||
### Rust 文件写入
|
||||
|
||||
在 Rust 中执行文件的 I/O 操作是相对容易的。写入文件可以简化为一行:
|
||||
|
||||
```
|
||||
use std::fs;
|
||||
fs::write("favorite_websites.txt", b"opensource.com")?;
|
||||
Ok(())
|
||||
```
|
||||
|
||||
使用错误传播操作符 `(?)`,错误信息被传递到调用函数中,随后可以处理错误。由于 `main()` 是调用栈中唯一的其他函数,如果写操作失败,错误信息将被传递到控制台输出。
|
||||
|
||||
[fs::write][5] 函数的语法是非常先进的。第一个参数是文件路径,它必须是 [std::path::Path][6] 类型。第二个参数是内容,它实际上是一个字节切片(`[u8]`)。Rust 将传递的参数转换为正确的类型。幸运的是,这些类型基本上是下面的例子中所处理的唯一类型。
|
||||
|
||||
使用文件描述符类型 [std::fs::File][7] 可以实现对写操作更简洁的访问:
|
||||
|
||||
```
|
||||
let mut file = fs::File::create("favorite_websites.txt")?;
|
||||
file.write_all(b"opensource.com\n")?;
|
||||
Ok(())
|
||||
```
|
||||
|
||||
由于文件类型实现了 [Write][8] 特性,所以可以使用相关的方法来写入文件。然而,`create` 方法可以覆盖一个已经存在的文件。
|
||||
|
||||
为了获得对文件描述符的更多控制,必须使用 [std::fs::OpenOptions][9] 类型。这提供了类似于其他语言中的打开模式:
|
||||
|
||||
```
|
||||
let mut file = fs::OpenOptions::new()
|
||||
.append(true)
|
||||
.open("favorite_websites.txt")?;
|
||||
|
||||
file.write_all(b"sourceforge.net\n")?;
|
||||
```
|
||||
|
||||
### Rust 文件读取
|
||||
|
||||
适用于写的东西也适用于读。读取也可以通过简单的一行代码来完成:
|
||||
|
||||
```
|
||||
let websites = fs::read_to_string("favorite_websites.txt")?;
|
||||
```
|
||||
|
||||
以上一行读取文件的内容并返回一个字符串。除了读取字符串,还有 [std::fs::read][10] 函数,如果文件包含二进制数据,该函数会将数据读成一个字节向量。
|
||||
|
||||
下一个例子显示了如何将文件的内容读入内存,随后逐行打印到控制台:
|
||||
|
||||
```
|
||||
let file = fs::File::open("favorite_websites.txt")?;
|
||||
let lines = io::BufReader::new(file).lines();
|
||||
|
||||
for line in lines {
|
||||
if let Ok(_line) = line {
|
||||
println!(">>> {}", _line);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 总结
|
||||
|
||||
如果你已经熟悉了其他编程语言,你可能已经注意到没有 `close-` 函数(或类似的)来释放文件句柄。在 Rust 中,当相关变量超出作用域,文件句柄就会被释放。为了定义关闭行为,可以在文件表示的周围应用作用域 `({ })`。我建议你熟悉 [Read][11] 和 [Write][8] 特性,因为你可以在许多其他类型中找到这个特性的实现。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/1/read-write-files-rust
|
||||
|
||||
作者:[Stephan Avenwedde][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/hansic99
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://doc.rust-lang.org/std/fs/
|
||||
[2]: https://github.com/hANSIc99/rust_file_io
|
||||
[3]: https://doc.rust-lang.org/std/result/enum.Result.html
|
||||
[4]: https://doc.rust-lang.org/std/io/type.Result.html
|
||||
[5]: https://doc.rust-lang.org/std/fs/fn.write.html
|
||||
[6]: https://doc.rust-lang.org/std/path/struct.Path.html
|
||||
[7]: https://doc.rust-lang.org/std/fs/struct.File.html
|
||||
[8]: https://doc.rust-lang.org/std/io/trait.Write.html
|
||||
[9]: https://doc.rust-lang.org/std/fs/struct.OpenOptions.html#
|
||||
[10]: https://doc.rust-lang.org/std/fs/fn.read.html
|
||||
[11]: https://doc.rust-lang.org/std/io/trait.Read.html
|
||||
[0]: https://opensource.com/sites/default/files/lead-images/rust_programming_crab_sea.png
|
@ -0,0 +1,137 @@
|
||||
[#]: subject: "who Command in Linux: Explanation with Examples"
|
||||
[#]: via: "https://www.debugpoint.com/who-command-linux/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15430-1.html"
|
||||
|
||||
who 命令的解释与示例
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 这里是一个关于理解 Linux 中 who 命令的初学者指南,并带有几个例子。
|
||||
|
||||
这篇文章是 [Linux 命令][1]学习系列的一部分。
|
||||
|
||||
### who 命令
|
||||
|
||||
Linux 中的 `who` 命令用于显示当前登录到系统中的用户的信息。它显示用户的登录名,用户登录的终端,用户登录的时间,以及远程主机名(如果有)。
|
||||
|
||||
#### 语法
|
||||
|
||||
下面是 `who` 命令的基本语法:
|
||||
|
||||
```
|
||||
who [OPTION]... [ FILE | ARG1 ARG2 ]
|
||||
```
|
||||
|
||||
### 各种 who 命令和开关的例子
|
||||
|
||||
默认情况下,`who` 读取文件 `/var/run/utmp`,其中包含当前登录的用户的信息。如果没有指定选项,它会显示每个用户的登录名、终端和登录时间。
|
||||
|
||||
```
|
||||
who
|
||||
```
|
||||
|
||||
它给出了以下输出。你可以看到它显示了登录名是 `debugpoint`,终端 ID `tty2` 和登录的日期和时间。
|
||||
|
||||
```
|
||||
debugpoint tty2 2023-01-01 11:22 (tty2)
|
||||
```
|
||||
|
||||
![who 命令 - 默认示例][2]
|
||||
|
||||
然而,如果你在虚拟机中运行上述命令,你应该看到同样的情况,但终端 ID 将是 x11 服务器的显示名称,即 `:0`。
|
||||
|
||||
```
|
||||
❯ who
|
||||
debugpoint :0 2023-01-01 23:36 (:0)
|
||||
```
|
||||
|
||||
要显示当前用户的用户名和信息,使用下面的方法:
|
||||
|
||||
```
|
||||
whoami
|
||||
```
|
||||
|
||||
使用 `-b` 选项查看最后一次系统启动时间:
|
||||
|
||||
```
|
||||
❯ who -b
|
||||
system boot 2023-01-01 23:36
|
||||
```
|
||||
|
||||
显示当前系统中登录的用户数:
|
||||
|
||||
```
|
||||
❯ who -q
|
||||
debugpoint
|
||||
users=1
|
||||
```
|
||||
|
||||
所有上述命令与 `-H` 选项配对时,你会有一个更好的含标题行的信息,如下所示:
|
||||
|
||||
```
|
||||
who -H
|
||||
|
||||
NAME LINE TIME COMMENT
|
||||
debugpoint tty2 2023-01-01 11:22 (tty2)
|
||||
```
|
||||
|
||||
如果你想在 Linux 中显示与 `who` 命令有关的所有信息,请使用选项 `-a`:
|
||||
|
||||
```
|
||||
who -aH
|
||||
|
||||
NAME LINE TIME IDLE PID COMMENT EXIT
|
||||
system boot 2023-01-01 11:19
|
||||
run-level 5 2023-01-01 11:19
|
||||
debugpoint + tty2 2023-01-01 11:22 13:26 2042 (tty2)
|
||||
```
|
||||
|
||||
像往常一样,你可以使用下面的重定向将 `who` 命令的输出保存到任何文件:
|
||||
|
||||
```
|
||||
who > user_details.txt
|
||||
```
|
||||
|
||||
#### who 命令选项的例子总结
|
||||
|
||||
下面是一些 `who` 命令的例子和它们的解释:
|
||||
|
||||
下面是一些可以与 `who` 命令一起使用的选项:
|
||||
|
||||
- `-a`: 显示每个用户的主机名、登录时间和进程
|
||||
- `-b`: 显示上次系统启动的时间
|
||||
- `-d`: 显示死进程(已终止但未从 utmp 文件中删除的进程)
|
||||
- `-H`: 显示标题行
|
||||
- `-l`: 显示长格式的登录进程
|
||||
- `-m`: 只显示在 `ARG1 ARG2` 指定的终端上登录的用户的名字和行。
|
||||
- `-q`: 显示已登录用户的数量
|
||||
- `-u`: 显示拥有未脱离进程的用户的信息
|
||||
- `-w`: 显示已经登录的用户信息,格式与 utmp 文件相同
|
||||
|
||||
### 总结
|
||||
|
||||
我希望这篇文章能够帮助你了解 `who` 命令及其基本原理。你也可以阅读 [who 手册页][3]来了解更多。如果你有任何问题,请告诉我。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/who-command-linux/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/category/linux-commands
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2023/01/who-command-default-example.jpg
|
||||
[3]: https://man7.org/linux/man-pages/man1/who.1.html
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202301/10/130213zb6odhv8gl8cvxvo.jpg
|
@ -0,0 +1,147 @@
|
||||
[#]: subject: "Whereis Command in Linux and BSD with Examples"
|
||||
[#]: via: "https://www.debugpoint.com/whereis-command-linux/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15446-1.html"
|
||||
|
||||
whereis 命令的解释与示例
|
||||
======
|
||||
|
||||
> 这是一份关于如何理解 Linux 和 BSD 中 `whereis` 命令的初学者指南,还包括几个例子。
|
||||
|
||||
![][1]
|
||||
|
||||
这篇文章是 [Linux 命令][2] 学习系列的一部分。
|
||||
|
||||
### whereis 命令
|
||||
|
||||
`whereis` 命令是一个命令行程序,可以帮助你找出任何二进制可执行文件、源文件或手册页的路径或位置。
|
||||
|
||||
在告诉你如何使用 `whereis` 命令之前,让我们先看看其语法。
|
||||
|
||||
### 语法
|
||||
|
||||
以下是 whereis 命令的语法:
|
||||
|
||||
```
|
||||
whereis [OPTIONS] FILE_NAME
|
||||
```
|
||||
|
||||
`whereis` 命令的参数是你要搜索的程序名或文件名。该参数是必须的。
|
||||
|
||||
默认情况下,它在环境变量(如 `HOME`、`USER`、`SHELL` 等)中定义的路径中搜索程序。
|
||||
|
||||
让我们看下一些例子。
|
||||
|
||||
### Linux 和 BSD 中 whereis 命令的例子
|
||||
|
||||
下面是 `whereis` 命令的一个简单例子,我试图搜索 `firefox`。在下面的输出中,你可以看到包含 `firefox` 文件或可执行文件的路径列表。
|
||||
|
||||
```
|
||||
$ whereis firefox
|
||||
|
||||
firefox: /usr/bin/firefox /usr/lib64/firefox /etc/firefox /usr/share/man/man1/firefox.1.gz
|
||||
```
|
||||
|
||||
![Linux 中 whereis 命令的简单例子][3]
|
||||
|
||||
带有选项 `-l` 的命令会显示其搜索的路径列表。比如:
|
||||
|
||||
```
|
||||
$ whereis -l
|
||||
|
||||
bin: /usr/bin
|
||||
bin: /usr/sbin
|
||||
bin: /usr/lib
|
||||
bin: /usr/lib64
|
||||
bin: /etc
|
||||
bin: /usr/games
|
||||
bin: /usr/local/bin
|
||||
bin: /usr/local/sbin
|
||||
bin: /usr/local/etc
|
||||
bin: /usr/local/lib
|
||||
bin: /usr/local/games
|
||||
```
|
||||
|
||||
如果 `whereis` 命令没有找到任何东西,它只显示参数的名称。例如,如果我在 Linux 中搜索 `nano`,它没有安装,它的输出如下:
|
||||
|
||||
```
|
||||
$ whereis nano
|
||||
```
|
||||
|
||||
```
|
||||
nano:
|
||||
```
|
||||
|
||||
如果你想搜索更多的参数,你可以随时添加多个参数。例如,下面的命令同时搜索 `bash` 和 `nano`,输出结果是这样的:
|
||||
|
||||
```
|
||||
$ whereis bash nano
|
||||
|
||||
bash: /usr/bin/bash /usr/share/man/man1/bash.1.gz /usr/share/info/bash.info.gz
|
||||
nano: /usr/bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz
|
||||
```
|
||||
|
||||
你也可以使用 `-b` 选项搜索特定的文件类型,比如二进制文件。下面的命令只告诉你 `nano` 的二进制路径。
|
||||
|
||||
```
|
||||
$ whereis -b nano
|
||||
|
||||
nano: /usr/bin/nano /usr/share/nano
|
||||
```
|
||||
|
||||
同样,`-s` 选项可以搜索源文件,而 `-m` 选项可以搜索手册页。
|
||||
|
||||
```
|
||||
$ whereis -m nano
|
||||
|
||||
nano: /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz
|
||||
```
|
||||
|
||||
你也可以结合上面的选项来进行更广泛的搜索。例如,下面的命令可以搜索 `nano` 和 `firefox` 的二进制、手册页;而对于 `bash`,只搜索手册页。
|
||||
|
||||
```
|
||||
$ whereis -bm nano firefox -m bash
|
||||
|
||||
nano: /usr/bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz
|
||||
firefox-m:
|
||||
bash: /usr/bin/bash /usr/share/man/man1/bash.1.gz /usr/share/info/bash.info.gz
|
||||
```
|
||||
|
||||
下面是选项的摘要:
|
||||
|
||||
| 选项 | 描述 |
|
||||
| :- | :- |
|
||||
| `-b` | 只搜索二进制文件。|
|
||||
| `-m` | 只搜索手册页部分。|
|
||||
| `-s` | 只搜索源码。|
|
||||
| `-u` | 搜索不寻常的条目。如果一个文件没有所要求的每种类型的条目,就被称为不寻常。因此,`whereis -m -u *` 会查询当前目录中没有文档的那些文件。|
|
||||
| `-B` | 改变或限制 `whereis` 搜索二进制文件的地方。|
|
||||
| `-M` | 更改或限制 `whereis` 搜索手册的位置。|
|
||||
| `-S` | 更改或以其他方式限制 `whereis` 搜索源码的位置。|
|
||||
| `-f` | 终止上一个目录列表并指示文件名的开始,并且必须在使用任何 `-B`、`-M` 或 `-S` 选项时使用。|
|
||||
|
||||
### 总结
|
||||
|
||||
我希望这篇文章能够帮助你理解 `whereis` 命令及其基本原理。你也可以阅读 [whereis 手册页][4] 来了解更多。如果你有任何问题,请告诉我。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/whereis-command-linux/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2023/01/whereis-head.jpg
|
||||
[2]: https://www.debugpoint.com/category/linux-commands
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2023/01/Simple-example-of-whereis-command-in-Linux.jpg
|
||||
[4]: https://linux.die.net/man/1/whereis
|
@ -0,0 +1,97 @@
|
||||
[#]: subject: "Budgie's Upcoming 10.7 Release Promises These 3 Key Improvements for Linux Users"
|
||||
[#]: via: "https://news.itsfoss.com/budgie-10-7-features/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15424-1.html"
|
||||
|
||||
Budgie 10.7 即将带来 3 项关键改进
|
||||
======
|
||||
|
||||
> Budgie 10.7 有很多有价值的改进。请看本文。
|
||||
|
||||
![][1]
|
||||
|
||||
Budgie 是一个旨在将杂乱无章降到最低,为用户提供一个干净/简约的体验的桌面环境。
|
||||
|
||||
早在 2022 年 1 月,Solus 的前联合负责人 Joshua Strobl [离开了 Solus][2],从事 [SerpentOS][3] 的开发,但他还继续参与 Budgie 的开发。
|
||||
|
||||
因此,他将该项目复刻到一个新的代码仓库,并成立了 [Buddies Of Budgie][4] 组织。三个月后,他们发布了 **Budgie 10.6**。
|
||||
|
||||
这是一个很不错的版本,即使不是很特别。
|
||||
|
||||
展望未来,他们发布了 2023 年的计划,其中包括发布 **Budgie 10.7**。
|
||||
|
||||
[Joshua Strobl][5] 在博文中也提到了更多计划内容:
|
||||
|
||||
> 至少,它应该是一个很好的基础,并为 Budgie 桌面今年的发展方向提供一个清晰的蓝图:Budgie 10.x 将会增加新的功能、QoL 改进和修复。Budgie 11 的开发工作也将起步。
|
||||
|
||||
### Budgie 10.7 可以期待什么?
|
||||
|
||||
Budgie 10.7 的开发工作自去年以来一直在进行。它本应在 2022 年发布,但需要更多的时间来提供一个完美的体验。
|
||||
|
||||
已经完成了很多工作,但其中一些值得注意的三个变化是:
|
||||
|
||||
- 对 Budgie 菜单的更新
|
||||
- 新的 Budgie 屏幕截图工具
|
||||
- 对 Budgie 运行对话框的改进
|
||||
|
||||
#### 对 Budgie 菜单的更新
|
||||
|
||||
![Budgie 10.7 菜单][6]
|
||||
|
||||
在这个版本中,Budgie 菜单将得到一些改进,例如。
|
||||
|
||||
- 一个新的电源菜单,包含所有常用的选项,如**暂停、休眠、注销和关闭电源**。
|
||||
- 更新的个人用户菜单可以快速访问 XDG 目录。这将让你直接打开文件管理器窗口进入主页、文档、音乐等文件夹。
|
||||
- 快速访问 Budgie 控制中心和桌面设置。
|
||||
- 能够从菜单本身显示各种桌面设置。
|
||||
|
||||
#### Budgie 屏幕截图工具
|
||||
|
||||
![Budgie 10.7 屏幕截图工具][7]
|
||||
|
||||
终于,你不再需要下载另一个工具来在 Budgie 上进行截图;从 10.7 开始,它将具有一个原生的屏幕截图应用程序。
|
||||
|
||||
它将支持对屏幕、窗口的捕捉,甚至是进行选区捕捉。
|
||||
|
||||
#### 对 Budgie 运行对话框的改进
|
||||
|
||||
![Budgie 10.7 运行对话框][8]
|
||||
|
||||
Budgie 运行对话框将获得许多改进,例如:
|
||||
|
||||
- 一个新的应用程序索引器将被用于 Budgie 菜单,以寻找和分类应用程序。它应该能提供一个 “可预测的模糊搜索体验”。
|
||||
- 根据显示器的工作区域改进对话框的大小计算。
|
||||
- 更好的应用程序名称和描述的标签样式。
|
||||
|
||||
### 发布和未来计划
|
||||
|
||||
根据他们的 [公告][9],他们打算在 2023 年第一季度的某个时候发布 Budgie 10.7。他们还没有确定一个具体的日期。
|
||||
|
||||
并计划在不久之后发布带有错误修复的 10.7.1 版本,然后在 2023 年第二季度发布 Budgie 10.8。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/budgie-10-7-features/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/budgie-10-7-release.png
|
||||
[2]: https://news.itsfoss.com/solus-co-lead-resign-budgie-serpent/
|
||||
[3]: https://serpentos.com
|
||||
[4]: https://blog.buddiesofbudgie.org
|
||||
[5]: https://joshuastrobl.com
|
||||
[6]: https://news.itsfoss.com/content/images/2023/01/Budgie_10.7_Preview_Menu.jpg
|
||||
[7]: https://news.itsfoss.com/content/images/2023/01/Budgie_10.7_Preview_SS.png
|
||||
[8]: https://news.itsfoss.com/content/images/2023/01/Budgie_10.7_Preview_Run.jpg
|
||||
[9]: https://blog.buddiesofbudgie.org/state-of-the-budgie-2022/
|
@ -0,0 +1,111 @@
|
||||
[#]: subject: "Learn w Command in Linux & BSD with Examples"
|
||||
[#]: via: "https://www.debugpoint.com/w-command-linux-examples/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15437-1.html"
|
||||
|
||||
w 命令的解释与示例
|
||||
======
|
||||
|
||||
> 下面是一份关于理解 Linux 和 BSD 中的 w 命令的初学者指南,并附有几个例子。
|
||||
|
||||
![][0]
|
||||
|
||||
这篇文章是 [Linux 命令][2]学习系列的一部分。
|
||||
|
||||
### w 命令
|
||||
|
||||
`w` 命令是 Linux 中的一个工具,它显示当前登录到系统中的用户及其进程的信息。它显示谁已登录,以及他们正在做什么活动。这意味着它可以显示他们在系统中运行什么进程。
|
||||
|
||||
### 语法
|
||||
|
||||
下面是 `w` 命令的基本语法:
|
||||
|
||||
```
|
||||
w [options] [username]
|
||||
```
|
||||
|
||||
`w` 命令接受一个可选的选项列表,然后是一个可选的用户名。如果指定了用户名,`w` 将只显示该用户拥有的进程信息。
|
||||
|
||||
### w 命令的例子及其用法
|
||||
|
||||
下面是一些使用 `w` 命令的例子。
|
||||
|
||||
当你只用 `w` 运行它时,它显示以下输出:
|
||||
|
||||
```
|
||||
$ w
|
||||
21:45:07 up 1 day, 12:48, 1 user, load average: 1.05, 0.85, 0.56
|
||||
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
|
||||
debugpoi tty2 Thu08 36:48m 0.03s 0.03s /usr/libexec/gnome-session-binary
|
||||
```
|
||||
|
||||
![Linux 中 w 命令的基本输出][3]
|
||||
|
||||
解释:`USER` 列给出了用户名,然后是终端号、登录日期时间、空闲时间、CPU 使用率,以及用户正在执行的进程。
|
||||
|
||||
- `USER` - 在你的 Linux 或 BSD 系统中登录的用户名称。
|
||||
- `TTY` - 当前会话的终端标识符号。
|
||||
- `FROM` - 用户的主机名或 IP 地址。
|
||||
- `LOGIN@` - 用户登录的时间。它有时会根据你的系统设置显示日期。
|
||||
- `IDLE` - 用户与终端交互后的空闲时间。
|
||||
- `JCPU` - 该会话的所有用户进程使用的 CPU 时间。
|
||||
- `PCPU` - 该用户的进程(在 `WHAT` 字段中提到)使用的时间。
|
||||
- `WHAT` - 当前带参数的进程。
|
||||
|
||||
下面是 `w` 命令的另一个例子,有两个用户在虚拟机环境中登录。正如你所看到的,显示了两个用户名与当前运行的带有进程参数的独立进程。
|
||||
|
||||
![演示多用户环境的 w 命令输出][4]
|
||||
|
||||
让我们看一下这个命令的一些选项。
|
||||
|
||||
要停止显示标题,使用 `-h` 选项。它与 `--no-header` 开关相同。
|
||||
|
||||
```
|
||||
$ w -h
|
||||
```
|
||||
|
||||
`-f` 选项可以在输出中切换 `FROM` 字段的可见性。
|
||||
|
||||
```
|
||||
$ w -f
|
||||
```
|
||||
|
||||
使用 `-s` 选项打印一个简短的输出,不包括 `JCPU`、`PCPU` 和 `LOGIN@` 信息。
|
||||
|
||||
```
|
||||
$ w -s
|
||||
```
|
||||
|
||||
要显示一个特定用户(例如,`debugpoint`)拥有的所有进程的列表:
|
||||
|
||||
```
|
||||
$ w debugpoint
|
||||
```
|
||||
|
||||
### 结束语
|
||||
|
||||
我希望这篇文章能帮助你了解 `w` 命令及其基本原理。你也可以阅读 [w 手册页][5] 来了解更多。如果你有任何问题,请告诉我。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/w-command-linux-examples/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2023/01/whead.jpg
|
||||
[2]: https://www.debugpoint.com/category/linux-commands
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2023/01/a-basic-outout-of-w-command-in-Linux.jpg
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2023/01/w-command-output-for-a-demo-multi-user-environment.jpg
|
||||
[5]: https://linux.die.net/man/1/w
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202301/12/100901f1rnn4zu2u12ligr.jpg
|
@ -0,0 +1,183 @@
|
||||
[#]: subject: "Learn the Ada programming language by writing a simple game"
|
||||
[#]: via: "https://opensource.com/article/23/1/learn-ada-simple-game"
|
||||
[#]: author: "Moshe Zadka https://opensource.com/users/moshez"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15440-1.html"
|
||||
|
||||
通过编写“猜数字”游戏来学习 Ada 编程语言
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 这个 "猜数字 "游戏是学习新编程语言的一个很好的入门程序,因为它以一种相当直接的方式锻炼了几个常见的编程概念。
|
||||
|
||||
当你想 [学习一种新的编程语言][1] 时,把注意力放在编程语言的共同点上是很好的:
|
||||
|
||||
- 变量
|
||||
- 表达式
|
||||
- 语句
|
||||
|
||||
这些概念是大多数编程语言的基础。一旦你理解了它们,你就可以开始琢磨其他的东西了。因为编程语言通常有相似之处,一旦你知道一种语言,你就可以通过了解其差异来学习另一种语言的基础知识。
|
||||
|
||||
学习新语言的一个好方法是用一个标准程序进行练习。这使你能够专注于语言,而不是程序的逻辑。在这个系列文章中,我使用了一个“猜数字”的程序,在这个程序中,计算机在 1 到 100 之间挑选一个数字,并要求你猜出来。程序循环进行,直到你猜对数字为止。
|
||||
|
||||
这个程序锻炼了编程语言中的几个概念:
|
||||
|
||||
- 变量
|
||||
- 输入
|
||||
- 输出
|
||||
- 条件判断
|
||||
- 循环
|
||||
|
||||
这是一个学习新的编程语言的很好的实践实验。
|
||||
|
||||
### 安装 Ada
|
||||
|
||||
[Ada 编程语言][2] 是一种独特的、高度结构化的语言,有专门一群开发者使用它。Ada 的工具链是 GNU Ada 开发环境,多被称为 GNAT。
|
||||
|
||||
你可以使用你的发行版的包管理器在 Linux 上安装 GNAT。在 Fedora、CentOS 或类似系统上:
|
||||
|
||||
```
|
||||
$ sudo dnf install gcc-gnat
|
||||
```
|
||||
|
||||
在 Debian、Linux Mint 及衍生版上:
|
||||
|
||||
```
|
||||
$ sudo apt install gnat
|
||||
```
|
||||
|
||||
在 macOS 和 Windows 上,你可以从 [Adacore 网站][3] 下载一个安装程序(从下拉菜单中选择你的平台)。
|
||||
|
||||
### 在 Ada 中猜数字
|
||||
|
||||
创建一个名为 `game.adb` 的文件。
|
||||
|
||||
这个程序使用的两个内置 Ada 库:`Text_IO` 和 `Numerics.Discrete_Random`:
|
||||
|
||||
```
|
||||
with Ada.Text_IO;
|
||||
use Ada.Text_IO;
|
||||
with Ada.Numerics.Discrete_Random;
|
||||
```
|
||||
|
||||
#### 过程头
|
||||
|
||||
<ruby>过程<rt>procedure</rt></ruby> 的名称必须与文件的名称一致。第一部分是定义变量。
|
||||
|
||||
注意,`discrete_random` 是专门针对特定范围的。在这里,允许数字范围:
|
||||
|
||||
```
|
||||
procedure Game is
|
||||
type randRange is range 1..100;
|
||||
package Rand_Int is new ada.numerics.discrete_random(randRange);
|
||||
use Rand_Int;
|
||||
gen : Generator;
|
||||
num : randRange;
|
||||
incorrect: Boolean := True;
|
||||
guess: randRange;
|
||||
```
|
||||
|
||||
#### 过程逻辑
|
||||
|
||||
该逻辑从 `reset(gen)` 开始。这将初始化随机数发生器,确保每次运行程序时,用 `random(gen)` 初始化的数字将是不同的。
|
||||
|
||||
下一步是运行循环:
|
||||
|
||||
- 输出猜测的指令
|
||||
- 读取该行
|
||||
- 将其转换为 `randRange`。
|
||||
- 将其与数字进行核对
|
||||
|
||||
如果数字匹配,`incorrect` 被设置为 `False`,导致循环的下一次迭代退出。
|
||||
|
||||
最后,程序在退出前会打印出对猜测正确性的确认:
|
||||
|
||||
```
|
||||
begin
|
||||
reset(gen);
|
||||
num := random(gen);
|
||||
while incorrect loop
|
||||
Put_Line ("Guess a number between 1 and 100");
|
||||
declare
|
||||
guess_str : String := Get_Line (Current_Input);
|
||||
begin
|
||||
guess := randRange'Value (guess_str);
|
||||
end;
|
||||
if guess < num then
|
||||
Put_line("Too low");
|
||||
elsif guess > num then
|
||||
Put_line("Too high");
|
||||
else
|
||||
incorrect := False;
|
||||
end if;
|
||||
end loop;
|
||||
Put_line("That's right");
|
||||
end Game;
|
||||
```
|
||||
|
||||
### 编译程序
|
||||
|
||||
编译 Ada 程序的最简单方法是使用 `gnatmake`:
|
||||
|
||||
```
|
||||
$ gnatmake game.adb
|
||||
aarch64-linux-gnu-gcc-10 -c game.adb
|
||||
aarch64-linux-gnu-gnatbind-10 -x game.ali
|
||||
aarch64-linux-gnu-gnatlink-10 game.ali
|
||||
```
|
||||
|
||||
这将生成一个名为 `game` 的二进制文件。
|
||||
|
||||
### 运行程序
|
||||
|
||||
程序的每次运行都会有一些不同。这是一个例子:
|
||||
|
||||
```
|
||||
$ ./game
|
||||
Guess a number between 1 and 100
|
||||
50
|
||||
Too low
|
||||
Guess a number between 1 and 100
|
||||
75
|
||||
Too low
|
||||
Guess a number between 1 and 100
|
||||
82
|
||||
Too low
|
||||
Guess a number between 1 and 100
|
||||
90
|
||||
Too high
|
||||
Guess a number between 1 and 100
|
||||
87
|
||||
Too low
|
||||
Guess a number between 1 and 100
|
||||
88
|
||||
That's right
|
||||
```
|
||||
|
||||
### 学习 Ada
|
||||
|
||||
这个“猜数字”游戏是学习新的编程语言的一个很好的入门程序,因为它以一种相当直接的方式锻炼了几个常见的编程概念。通过在不同的编程语言中实现这个简单的游戏,你可以展示这些语言的一些核心概念,并比较它们的细节。
|
||||
|
||||
你有喜欢的编程语言吗?你会如何用它来写“猜数字”的游戏?请关注本系列文章,看看你可能感兴趣的其他编程语言的例子吧!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/1/learn-ada-simple-game
|
||||
|
||||
作者:[Moshe Zadka][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/moshez
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/article/20/10/learn-any-programming-language
|
||||
[2]: https://opensource.com/article/21/10/learn-ada-2021
|
||||
[3]: https://www.adacore.com/download/more
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202301/13/173929sbddkk6fbd67uu5v.jpg
|
@ -0,0 +1,92 @@
|
||||
[#]: subject: "OBS Studio 29 Release Has Little in Store For Linux"
|
||||
[#]: via: "https://news.itsfoss.com/obs-studio-29-release/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15439-1.html"
|
||||
|
||||
OBS Studio 29 发布,但对 Linux 用户来说变化不大
|
||||
======
|
||||
|
||||
> OBS Studio 29 是一个令人兴奋的版本,在所有平台上都有关键的改进。
|
||||
|
||||
![][1]
|
||||
|
||||
[OBS Studio][2] 是最受欢迎的开源屏幕录制和流媒体软件之一。
|
||||
|
||||
许多 Linux 用户和内容创作者都在使用它,它有一套相当不错的工具和功能,可以让你录制和串流内容。
|
||||
|
||||
它的上一个主要版本发布于 2022 年 9 月,它带来了对苹果芯片的原生支持、更新了用户界面、改进了颜色支持等等。
|
||||
|
||||
它的下一个版本,即 v29,似乎有点意思,但对 Linux 用户来说变化不大 😞
|
||||
|
||||
### OBS Studio 29 的新变化
|
||||
|
||||
![OBS Studio 29][3]
|
||||
|
||||
这个版本有大量的改进和修复;其中一些亮点包括:
|
||||
|
||||
- 对 Linux 的媒体键支持
|
||||
- 新的音频过滤器
|
||||
- 改进的英伟达视频和音频过滤器
|
||||
- 更好的编码器支持
|
||||
- 各种修复和改进
|
||||
|
||||
**媒体键支持:** 你终于可以用键盘上的媒体键来控制 Linux 上的 OBS 的播放或音量了。
|
||||
|
||||
**新的音频过滤器:** OBS Studio 29 具有两个新的音频滤波器,一个向上压缩滤波器和一个 3 波段均衡器滤波器。
|
||||
|
||||
**改进的英伟达视频和音频过滤器:** 对这些过滤器进行了各种改进。
|
||||
|
||||
增加了一个新的屏蔽刷新滑块,同时支持时间处理,这应该是为了提供更好的屏蔽质量。
|
||||
|
||||
**更好的编码器支持:**,OBS Studio 29 对几个编码器的支持得到了改善,例如:
|
||||
|
||||
- Windows 上的用于 AMD [RX7000 系列][4] 的 AV1 编码器。
|
||||
- Windows 上的用于英特尔 [Arc GPU][5] 的 AV1 编码器。
|
||||
- Windows 上的英特尔 HEVC 编码器。
|
||||
- macOS 上的原生 HEVC 和 ProRes 编码器。
|
||||
|
||||
> 📋 注意,这些编码器只支持 Windows 或 macOS。可悲的是,他们少了对 Linux 的支持。我们希望在 OBS Studio 的未来版本中加入这些功能。
|
||||
|
||||
**各种修复和改进:** 除了上面列出的那些,OBS Studio 29 还有很多其他的变化,例如:
|
||||
|
||||
- Websockets 5.1.0
|
||||
- 回放缓冲区的内存限制现在被限制在已安装的系统内存的 75%,而不是固定在 8GB。
|
||||
- 支持对 SRT 和 RIST 输出的加密和认证。
|
||||
- 能够检查和/或静音个别的浏览器底座。
|
||||
- 在视频捕获的情况下,支持更高的刷新率。
|
||||
|
||||
关于更多的技术细节,你可以查看 [官方发布说明][6]。
|
||||
|
||||
### 下载 OBS Studio 29
|
||||
|
||||
要获得最新的 OBS Studio 29,你可以使用 [Flatpak][7],这是推荐的方法。
|
||||
|
||||
你也可以看看其官方下载页面中提到的其他安装方法。
|
||||
|
||||
> **[OBS Studio 29][8]**
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/obs-studio-29-release/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/obs-studio-29-release.png
|
||||
[2]: https://obsproject.com
|
||||
[3]: https://news.itsfoss.com/content/images/2023/01/OBS_Studio_29.png
|
||||
[4]: https://en.wikipedia.org/wiki/Radeon_RX_7000_series
|
||||
[5]: https://www.intel.in/content/www/in/en/products/details/discrete-gpus/arc.html
|
||||
[6]: https://github.com/obsproject/obs-studio/releases/tag/29.0.0
|
||||
[7]: https://flathub.org/apps/details/com.obsproject.Studio
|
||||
[8]: https://obsproject.com/download
|
233
published/20230110.0 ⭐️⭐️ A guide to strings in MySQL.md
Normal file
233
published/20230110.0 ⭐️⭐️ A guide to strings in MySQL.md
Normal file
@ -0,0 +1,233 @@
|
||||
[#]: subject: "A guide to strings in MySQL"
|
||||
[#]: via: "https://opensource.com/article/23/1/strings-mysql"
|
||||
[#]: author: "Hunter Coleman https://opensource.com/users/hunterc"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15434-1.html"
|
||||
|
||||
MySQL 字符串指南
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 了解 MySQL 如何存储和显示你的字符串变量,以便你能更好地控制你的数据。
|
||||
|
||||
字符串是你在 MySQL 中使用的最常见的数据类型之一。许多用户在他们的数据库中插入和读取字符串,而没有认真地了解过它们。本文旨在让你深入了解 MySQL 如何存储和显示你的字符串变量,以便你能更好地控制你的数据。
|
||||
|
||||
你可以把字符串分成两类:二进制和非二进制。你可能在大多数时候想到的是非二进制字符串。非二进制字符串有字符集和排序的不同。另一方面,二进制字符串存储诸如 MP3 文件或图像等东西。即使你在二进制字符串中存储了一个词,比如“歌曲”,它的存储方式也与非二进制字符串不同。
|
||||
|
||||
我将重点讨论非二进制字符串。MySQL 中的所有非二进制字符串都与字符集和排序相关。字符串的字符集控制哪些字符可以存储在字符串中,而它的排序方式控制当你显示字符串时如何排序。
|
||||
|
||||
### 字符集
|
||||
|
||||
要查看你系统中的字符集,请运行以下命令:
|
||||
|
||||
```
|
||||
SHOW CHARACTER SET;
|
||||
```
|
||||
|
||||
这个命令将输出四列数据,包括字符集:
|
||||
|
||||
- 名称
|
||||
- 简要描述
|
||||
- 默认的排序方式
|
||||
- 字符集中每个字符的最大尺寸
|
||||
|
||||
MySQL 过去默认为 `latin1` 字符集,但自 8.0 版以来,默认为 `utf8mb4`。现在的默认排序方式是 `utf8mb4_0900_ai_ci`。`ai` 表示该排序对音调不敏感( `á` = `a`),而 `ci` 则指定它对大小写不敏感(`a` = `A`)。
|
||||
|
||||
不同的字符集将其字符存储在内存中不同大小的块中。例如,从上面的命令可以看出,存储在 `utf8mb4` 的字符被存储在 1 到 4 个字节大小的内存中。如果你想看看一个字符串是否包含多字节的字符,你可以使用 `CHAR_LENGTH()` 和 `LENGTH()` 函数。`CHAR_LENGTH()` 显示一个字符串包含多少个字符,而 `LENGTH()` 显示一个字符串有多少个字节,根据字符集的不同,它可能与一个字符串的字符长度相同,也可能不相同。下面是一个例子:
|
||||
|
||||
```
|
||||
SET @a = CONVERT('data' USING latin1);
|
||||
|
||||
SELECT LENGTH(@a), CHAR_LENGTH(@a);
|
||||
|
||||
+------------+-----------------+
|
||||
| LENGTH(@a) | CHAR_LENGTH(@a) |
|
||||
+------------+-----------------+
|
||||
| 4 | 4 |
|
||||
+------------+-----------------+
|
||||
```
|
||||
|
||||
这个例子表明,`latin1` 字符集以单字节为单位存储字符。其他字符集,如 `utf16`,允许多字节的字符:
|
||||
|
||||
```
|
||||
SET @b = CONVERT('data' USING utf16);
|
||||
|
||||
SELECT LENGTH(@b), CHAR_LENGTH(@b);
|
||||
|
||||
+------------+------------------+
|
||||
| LENGTH(@b) | CHAR_LENGTH(@b) |
|
||||
+------------+------------------+
|
||||
| 8 | 4 |
|
||||
+------------+------------------+
|
||||
```
|
||||
|
||||
### 排序
|
||||
|
||||
当你运行带有 `ORDER BY` 子句的 SQL 语句时,字符串排序方式将决定值的显示方式。你对排序方式的选择是由你选择的字符集决定的。当你运行上面的 `SHOW CHARACTER SET` 命令时,你看到了每个字符集的默认排序方式。你可以很容易地看到某个特定字符集的所有排序方式。例如,如果你想查看 `utf8mb4` 字符集允许哪些排序,请运行:
|
||||
|
||||
```
|
||||
SHOW COLLATION LIKE 'utf8mb4%';
|
||||
```
|
||||
|
||||
排序方式可以是不区分大小写的,也可以是区分大小写的,或者是二进制的。让我们建立一个简单的表,向其中插入一些值,然后用不同的排序方式查看数据,看看输出结果有什么不同:
|
||||
|
||||
```
|
||||
CREATE TABLE sample (s CHAR(5));
|
||||
|
||||
INSERT INTO sample (s) VALUES
|
||||
('AAAAA'), ('ccccc'), ('bbbbb'), ('BBBBB'), ('aaaaa'), ('CCCCC');
|
||||
|
||||
SELECT * FROM sample;
|
||||
|
||||
+-----------+
|
||||
| s |
|
||||
+-----------+
|
||||
| AAAAA |
|
||||
| ccccc |
|
||||
| bbbbb |
|
||||
| BBBBB |
|
||||
| aaaaa |
|
||||
| CCCCC |
|
||||
+-----------+
|
||||
```
|
||||
|
||||
在不区分大小写的情况下,你的数据会按字母顺序返回,但不能保证大写的单词会排在小写的单词之前,如下图所示:
|
||||
|
||||
```
|
||||
SELECT * FROM sample ORDER BY s COLLATE utf8mb4_turkish_ci;
|
||||
|
||||
+-----------+
|
||||
| s |
|
||||
+-----------+
|
||||
| AAAAA |
|
||||
| aaaaa |
|
||||
| bbbbb |
|
||||
| BBBBB |
|
||||
| ccccc |
|
||||
| CCCCC |
|
||||
+-----------+
|
||||
```
|
||||
|
||||
另一方面,当 MySQL 运行大小写敏感的搜索时,每个字母的小写将排在大写之前:
|
||||
|
||||
```
|
||||
SELECT * FROM sample ORDER BY s COLLATE utf8mb4_0900_as_cs;
|
||||
|
||||
+-----------+
|
||||
| s |
|
||||
+-----------+
|
||||
| aaaaa |
|
||||
| AAAAA |
|
||||
| bbbbb |
|
||||
| BBBBB |
|
||||
| ccccc |
|
||||
| CCCCC |
|
||||
+-----------+
|
||||
```
|
||||
|
||||
而按二进制排序方式将返回所有大写的值,然后再返回小写的值:
|
||||
|
||||
```
|
||||
SELECT * FROM sample ORDER BY s COLLATE utf8mb4_0900_bin;
|
||||
|
||||
+-----------+
|
||||
| s |
|
||||
+-----------+
|
||||
| AAAAA |
|
||||
| ccccc |
|
||||
| bbbbb |
|
||||
| BBBBB |
|
||||
| aaaaa |
|
||||
| CCCCC |
|
||||
+-----------+
|
||||
```
|
||||
|
||||
如果你想知道一个字符串使用哪种字符集和排序,你可以使用被恰当命名的 `charset` 和 `collation` 函数。运行 MySQL 8.0 或更高版本的服务器将默认使用 `utf8mb4` 字符集和 `utf8mb4_0900_ai_ci` 排序:
|
||||
|
||||
```
|
||||
SELECT charset('data');
|
||||
|
||||
+-------------------+
|
||||
| charset('data') |
|
||||
+-------------------+
|
||||
| utf8mb4 |
|
||||
+-------------------+
|
||||
|
||||
SELECT collation('data');
|
||||
|
||||
+--------------------+
|
||||
| collation('data') |
|
||||
+--------------------+
|
||||
| utf8mb4_0900_ai_ci |
|
||||
+--------------------+
|
||||
```
|
||||
|
||||
你可以使用 `SET NAMES` 命令来改变所使用的字符集或排序方式。
|
||||
|
||||
要从 `utf8mb4` 字符集改为 `utf16`,运行这个命令:
|
||||
|
||||
```
|
||||
SET NAMES 'utf16';
|
||||
```
|
||||
|
||||
如果你想选择默认以外的排序方式,你可以在 `SET NAMES` 命令中添加一个 `COLLATE` 子句。
|
||||
|
||||
例如,假设你的数据库存储西班牙语的单词。MySQL 的默认排序(`utf8mb4_0900_ai_ci`)将 `ch` 和 `ll` 视为两个不同的字符,并将它们排序。但在西班牙语中,`ch` 和 `ll` 是单独的字母,所以如果你想让它们按正确的顺序排序(分别排在 `c` 和 `l` 之后),你需要使用不同的排序。一个选择是使用 `utf8mb4_spanish2_ci` 排序方式:
|
||||
|
||||
```
|
||||
SET NAMES 'utf8mb4' COLLATE 'utf8mb4_spanish2_ci';
|
||||
```
|
||||
|
||||
### 储存字符串
|
||||
|
||||
MySQL 允许你为你的字符串值选择不同的数据类型。(甚至比其他流行的数据库,如 PostgreSQL 和 MongoDB 更多。)
|
||||
|
||||
下面是 MySQL 的二进制字符串数据类型的列表、它们的非二进制对应物,以及它们的最大长度:
|
||||
|
||||
- `binary`:`char`(255)
|
||||
- `varbinary`:`varchar`(65,535)
|
||||
- `tinyblob`:`tinytext`(255)
|
||||
- `blob`:`text`(65,535)
|
||||
- `mediumblob`:`mediumtext`(16,777,215)
|
||||
- `longblob`:`longtext`(4,294,967,295)
|
||||
|
||||
要记住的一件重要事情是,与被存储在可变长度的字段中的 `varbinary`、`varchar`、`text` 和 `blob` 类型不同(也就是说,只使用需要的空间),MySQL 将二进制(`binary`)和字符(`char`)类型存储在固定长度的字段。因此,像 `char(20)` 或 `binary(20)` 这样的值将总是占用 20 个字节,即使你在其中存储了少于 20 个字符。对于二进制类型,MySQL用 ASCII NUL 值(`0x00`)填充这些值,对于 字符类型,用空格填充。
|
||||
|
||||
在选择数据类型时要考虑的另一件事是,你是否希望在字符串后面的空格被保留或剥离。在显示数据时,MySQL 会从以字符数据类型存储的数据中剥离空格,但不会剥离 `varchar` 的空格。
|
||||
|
||||
```
|
||||
CREATE TABLE sample2 (s1 CHAR(10), s2 VARCHAR(10));
|
||||
|
||||
INSERT INTO sample2 (s1, s2) VALUES ('cat ', 'cat ');
|
||||
|
||||
SELECT s1, s2, CHAR_LENGTH(s1), CHAR_LENGTH(s2) FROM sample2;
|
||||
|
||||
+---------+---------+-----------------------------------+
|
||||
| s1 | s2 | CHAR_LENGTH(s1) | CHAR_LENGTH(s2) |
|
||||
+---------+---------+-----------------------------------+
|
||||
| cat | cat | 3 | 10 |
|
||||
+---------+---------+-----------------------------------+
|
||||
```
|
||||
|
||||
### 总结
|
||||
|
||||
字符串是数据库中最常用的数据类型之一,而 MySQL 仍然是当今最流行的数据库系统之一。我希望你能从这篇文章中学到一些新的东西,并能用你的新知识来提高你的数据库技能。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/1/strings-mysql
|
||||
|
||||
作者:[Hunter Coleman][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/hunterc
|
||||
[b]: https://github.com/lkxed
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202301/11/161410lh9944zpgjgmgs8t.jpg
|
@ -0,0 +1,78 @@
|
||||
[#]: subject: "Wow! CoolerMaster's MasterPlus Software to Go Open Source!"
|
||||
[#]: via: "https://news.itsfoss.com/coolermaster-open-source-software/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15433-1.html"
|
||||
|
||||
酷冷至尊(CoolerMaster)的 MasterPlus 软件即将开源
|
||||
======
|
||||
|
||||
> MasterPlus 将被彻底改造并推出开源版本?听起来不错!
|
||||
|
||||
![][1]
|
||||
|
||||
大多数游戏/外设软件套装要么是专有的,要么是没有对 Linux 的官方支持。
|
||||
|
||||
因此,我们必须不断寻找开源工具来配置我们的硬件以获得原生功能。
|
||||
|
||||
像 [Piper][2]、[OpenRGB][3]、[Solaar][4] 等在这些情况下都很有用。
|
||||
|
||||
但是,有时候,即使是这些也是不够的。
|
||||
|
||||
幸运的是,[酷冷至尊(CoolerMaster)][5] 已经决定发布其 [MasterPlus][6] 软件的开源版本,旨在为其散热器和第三方的散热器提供服务。
|
||||
|
||||
**虽然这并不能保证它可以用在 Linux 系统上,但我们绝对可以期待它。**
|
||||
|
||||
此举也应该鼓励雷蛇和罗技这样公司考虑制作精简过的开源工具。
|
||||
|
||||
让我们看看酷冷至尊打算怎么做。
|
||||
|
||||
### MasterPlus 开源版本:我们目前所知的情况
|
||||
|
||||
![酷冷至尊 Masterplus 改版][7]
|
||||
|
||||
**酷冷至尊在最近的 [CES 2023][8] 活动中透露了他们计划发布新的 MasterPlus 开源版本**。感谢来自 [Boring Text Reviews][9] 的 Albert 让我们注意到了这一点。
|
||||
|
||||
**预期会有什么?** 对 MasterPlus 软件进行了全面的重新设计,有一个 API 插件系统,允许非酷冷至尊散热器与之整合。
|
||||
|
||||
他们已经澄清,酷冷至尊的独有功能不能配合其他散热器一起工作。因此,诸如检测 AIO 散热器的泄漏或计算 PSU 的效率等,都不能对第三方产品进行跟踪。
|
||||
|
||||
相反,该应用程序将只支持读取基本的性能信息,如温度和风扇速度,并能够配置 ARGB 设备。
|
||||
|
||||
如果你问我,**这总比没有好。** 而且,如果你的系统碰巧使用了酷冷至尊的组件,这对你来说是一个令人兴奋的消息!
|
||||
|
||||
酷冷至尊还展示了 API 系统的潜在应用,让它与一个照片应用程序挂钩,用它来控制集成在电脑机箱侧面的辅助显示器。
|
||||
|
||||
此外,他们还介绍了其软件的全面云整合。但遗憾的是,这部分不会开源。
|
||||
|
||||
**什么时候?** 我们还没有 MasterPlus 开源的具体发布日期。
|
||||
|
||||
但是,如果让我猜,2023 年的某个时候是最好的选择。
|
||||
|
||||
💬 _即使该工具没有被确认可以在 Linux 上工作,对开源工具来说也是一个好的开始,不是吗?你怎么看?_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/coolermaster-open-source-software/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/coolermaster-masterplus-goes-opensource.png
|
||||
[2]: https://github.com/libratbag/piper
|
||||
[3]: https://openrgb.org
|
||||
[4]: https://github.com/pwr-Solaar/Solaar
|
||||
[5]: https://www.coolermaster.com
|
||||
[6]: https://masterplus.coolermaster.com
|
||||
[7]: https://news.itsfoss.com/content/images/2023/01/CoolerMaster_MasterPlus_Revamp-1.png
|
||||
[8]: https://www.ces.tech
|
||||
[9]: https://boringtextreviews.com/exclusive-say-goodbye-to-bloated-closed-source-software-coolermaster-to-release-new-open-source-version-of-its-software-with-api-integration-and-it-can-work-with-other-coolers-too
|
@ -0,0 +1,77 @@
|
||||
[#]: subject: "Linux is All Set to Disable Microsoft's RNDIS Drivers"
|
||||
[#]: via: "https://news.itsfoss.com/linux-disable-microsoft-rndis/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15452-1.html"
|
||||
|
||||
Linux 已准备好禁用微软的 RNDIS 驱动程序,但是……
|
||||
======
|
||||
|
||||
> Linux 内核将不再支持 RNDIS 驱动程序。这是一个好的举措吗?这对你意味着什么?在这里了解一下。
|
||||
|
||||
![Linux 已经准备好禁用微软的 RNDIS 驱动程序][1]
|
||||
|
||||
微软的 RNDIS 协议(即 <ruby>远程网络驱动接口规范<rt>Remote Network Driver Interface Specification</rt></ruby> 的简称),是一个专有的 USB 协议,用于计算机上的虚拟以太网功能。
|
||||
|
||||
这方面最常见的使用情况是通过连接到电脑上的 USB,使用手机的移动网络连接互联网,也称为 <ruby>[系连][2]<rt>Tethering</rt></ruby>。
|
||||
|
||||
尽管它主要在 Windows 上工作,但它成为 Linux 内核的一部分已经有一段时间了。
|
||||
|
||||
但这种情况很快就会改变。
|
||||
|
||||
### 向 RNDIS 协议说再见?
|
||||
|
||||
![][3]
|
||||
|
||||
**发生了什么?** 周一,[Greg Kroah-Hartman][4] 创建了 [usb.git rndis-removal][5] 分支,其中他提到禁用 Linux 上所有 RNDIS 协议驱动程序的实现。
|
||||
|
||||
在该提交中他提到:
|
||||
|
||||
> 微软的 RNDIS 协议按照设计是不安全的,在任何连接不信任的主机或设备的系统上使用它都是脆弱的。因为该协议不可能变得安全,所以只要禁用所有的 RNDIS 驱动,就可以防止任何人再使用它们。Windows 只在 XP 和更新一些的系统中需要用它,比这更早的 Windows 系统可以使用正常的 USB 类协议来代替,没有这些问题。
|
||||
|
||||
正如最初由 [Phoronix][6] 报道的那样,一旦这个协议在 Kconfig 选项中被标记为 “损坏”,它将再保留一段时间,最终从内核中删除。
|
||||
|
||||
但是**为什么呢?**
|
||||
|
||||
众所周知,RNDIS 在 Windows 之外的平台上的实现是一团糟,并带来了相当多的安全风险。此外,RNDIS 并不像以前那样广泛使用了,它带来的安全风险可能是作出这一决定的主要原因之一。
|
||||
|
||||
**这对目前的用户有影响吗?你应该担心吗?**
|
||||
|
||||
如果我们看一下对这一即将到来的变化的 [Reddit 讨论][7],我们会发现许多用户仍然很担心**这是否会破坏大家的 USB 连接**。
|
||||
|
||||
考虑到许多安卓手机仍然使用 RNDIS 而不是 CDC NCM(一种较新的协议),用户似乎对这一举措感到困惑 😕;不只是用户,一位 [谷歌的内核网络开发人员][8] 也提出了这个议题,但我们还没有看到对此的回应。
|
||||
|
||||
**但不是每个人都使用主线 Linux 内核?如果你不想受到这种变化的影响,你是否应该坚持使用 LTS 版本的内核?**
|
||||
|
||||
此外,用户希望更清楚地了解这是否会影响到所有人。
|
||||
|
||||
但是,从目前来看,Greg 可能并没有给出更多的细节来说服一些相关用户。
|
||||
|
||||
🤔 当然,我们不是 Linux 内核维护者。所以,最好等这个提交通过时,我希望 Linux 内核维护者能比我们知道更多的信息。
|
||||
|
||||
💭 你对这个计划中的 Linux 内核的变化有什么看法?请在下面的评论中分享你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/linux-disable-microsoft-rndis/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/linux-to-disable-ms-network-drivers.png
|
||||
[2]: https://en.wikipedia.org/wiki/Tethering
|
||||
[3]: https://news.itsfoss.com/content/images/2023/01/kernel-patch-rndis.jpg
|
||||
[4]: https://twitter.com/gregkh
|
||||
[5]: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=rndis-removal&id=5eb127bb9741c1480aff95ffa4e1bd4cd9b5b16d
|
||||
[6]: https://www.phoronix.com/news/Linux-Disabling-RNDIS-Drivers
|
||||
[7]: https://www.reddit.com/r/linux/comments/108avzx/linux_preparing_to_disable_drivers_for_microsofts/
|
||||
[8]: https://lkml.org/lkml/2022/11/23/1502
|
@ -0,0 +1,59 @@
|
||||
[#]: subject: "Ubuntu 23.04 Lunar Lobster Wallpaper Competition is Now Open"
|
||||
[#]: via: "https://debugpointnews.com/ubuntu-23-04-wallpaper-competition/"
|
||||
[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15448-1.html"
|
||||
|
||||
Ubuntu 23.04 “月球龙虾” 壁纸比赛开始了
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
> 喜欢数字绘画或摄影?这个壁纸比赛可以让你的照片出现在 Ubuntu 23.04 的官方版本中。
|
||||
|
||||
### Ubuntu 23.04 的壁纸比赛
|
||||
|
||||
Ubuntu 23.04 “<ruby>月球龙虾<rt>Lunar Lobster</rt></ruby>” 版本将于 2023 年 4 月发布。按照时间表,在即将到来的 BETA 版本之前,官方壁纸比赛现在已经开始。
|
||||
|
||||
按照官方的指导方针,你必须拥有你所发布的图片的权利,而且必须是原创。可以说,不应该考虑人工智能生成的图像。
|
||||
|
||||
此外,你提交的图片应该至少有 3840x2160px 的尺寸,文件大小不应超过 10MB。文件格式以 SVG 和 WebP 为佳。然而,标准格式如 PNG 和 JPG 也可以接受。
|
||||
|
||||
此外,你的图片不应该有任何水印、标志或文字,如 “Lunar Lobster” 或 “Ubuntu”。你可以在 [这里][2] 阅读详细的指导原则。
|
||||
|
||||
最后,你的壁纸可以以官方吉祥物 —— “月球” 和 “龙虾” 为特色。
|
||||
|
||||
提交截止日期为 2023 年 2 月 6 日,最终获胜者将在 2023 年 2 月 18 日社区投票后公布。
|
||||
|
||||
![早期提交的 Ubuntu 23.04 官方壁纸之一][3]
|
||||
|
||||
### 如何提交?
|
||||
|
||||
前往官方 Discourse 论坛的帖子下提交你的作品。请务必提到你的名字和 Twitter,如果被选中的话,可以得到 Ubuntu 团队的致谢。
|
||||
|
||||
> **[提交壁纸][4]**
|
||||
|
||||
戴上你的创意帽子,提交所有那些很酷的壁纸吧!
|
||||
|
||||
_图片来源:各自的作者_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://debugpointnews.com/ubuntu-23-04-wallpaper-competition/
|
||||
|
||||
作者:[arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://debugpointnews.com/author/dpicubegmail-com/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://debugpointnews.com/wp-content/uploads/2023/01/wall2304head.jpg
|
||||
[2]: https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/blob/main/README.md
|
||||
[3]: https://debugpointnews.com/wp-content/uploads/2023/01/One-of-the-early-submission-for-Ubuntu-23.04-official-wallpaper.jpg
|
||||
[4]: https://discourse.ubuntu.com/t/lunar-lobster-23-04-wallpaper-competition/33132
|
@ -0,0 +1,144 @@
|
||||
[#]: subject: "Discourse 3.0 is an Amazing Release With Much-Needed Feature Additions"
|
||||
[#]: via: "https://news.itsfoss.com/discourse-3-0-release/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15449-1.html"
|
||||
|
||||
Discourse 3.0 发布,增加了很多需要的功能
|
||||
======
|
||||
|
||||
> 开源论坛软件 Discourse 有了一个新的重大版本升级!让我们看看有什么新东西。
|
||||
|
||||
![][1]
|
||||
|
||||
Discourse 是一个开源的论坛平台,以其丰富的功能和第三方集成而闻名。
|
||||
|
||||
它也是 [最好的开源论坛软件][2] 之一,你可以部署在你的 Linux 服务器上来建立一个社区。
|
||||
|
||||
现在,我们来看看 Discourse 的最新版本。
|
||||
|
||||
在 [Discourse 2.0][4] 发布已近五年之后,**Discourse 3.0 终于来了**。
|
||||
|
||||
这个版本包含了大量的新功能和改进,让我带你看看:
|
||||
|
||||
### 🆕 Discourse 3.0 的新变化
|
||||
|
||||
![Discourse 3.0][5]
|
||||
|
||||
Discourse 3.0 提供了很多东西,其中一些值得注意的亮点包括:
|
||||
|
||||
- 新的设置向导
|
||||
- 用户状态
|
||||
- 通知菜单
|
||||
- 新的侧边栏
|
||||
- 实时聊天
|
||||
- 用户提示
|
||||
|
||||
#### 新的设置向导
|
||||
|
||||
![新的设置向导][6]
|
||||
|
||||
Discourse 现在有一个新的设置向导,可以让你快速配置一些最重要的选项。
|
||||
|
||||
因此,像将社区设置为私人、仅邀请、需要批准等选项在论坛设置的初始阶段就会显示出来。
|
||||
|
||||
#### 用户状态
|
||||
|
||||
![Discourse 用户状态][7]
|
||||
|
||||
与现在大多数社区平台的做法类似,Discourse 现在也支持设置用户状态。
|
||||
|
||||
用户可以设置一个自定义的表情符号和文字,在整个平台上显示在他们的头像附近,无论是帖子、聊天还是用户卡中。
|
||||
|
||||
#### 通知菜单
|
||||
|
||||
![Discourse 通知][8]
|
||||
|
||||
这终于实现了。
|
||||
|
||||
Discourse 现在有一个专门的通知菜单,让你更容易跟踪你在论坛上的活动。
|
||||
|
||||
#### 新的侧边栏
|
||||
|
||||
![Discourse 侧边栏][9]
|
||||
|
||||
这是的另一项你可能会喜欢的用户体验改进。
|
||||
|
||||
你现在可以在新的侧边栏上添加聊天频道、标签和类别,以方便访问你想追踪的东西。
|
||||
|
||||
论坛的管理员也可以为游客和新成员设置一个默认的侧边栏配置;这样,每个人都可以对论坛提供的内容有一个很好的展望。
|
||||
|
||||
#### 实时聊天
|
||||
|
||||
![Discourse 实时聊天][10]
|
||||
|
||||
Discourse 现在支持实时聊天;频道管理员可以选择创建一个非正式的讨论、展示,甚至是备忘录的空间,如果这对他们有用的话。
|
||||
|
||||
Discourse 的产品经理 Rishabh Nambiar 提到:
|
||||
|
||||
> 我们的目标是,当对话在快节奏的聊天和慢节奏的讨论之间转换时,赋予社区以综合的体验。
|
||||
>
|
||||
> 当想法被激发出来,在一个更容易被发现的地方,聊天信息可以被引用到话题中,讨论可以随着时间的推移而继续,并允许不同时间和地点的人以后加入进来。
|
||||
|
||||
#### 用户提示
|
||||
|
||||
![Discourse 用户提示][11]
|
||||
|
||||
这个功能对不熟悉 Discourse 的新用户很有帮助。
|
||||
|
||||
当用户第一次使用某个特定的功能时,他们会得到与 Discourse 的功能相关的提示。
|
||||
|
||||
#### 🛠️ 其他变化和改进
|
||||
|
||||
上面提到的并不是这次发布的 Discourse 的全部变化,下面是其他一些亮点:
|
||||
|
||||
- 改造了标签系统。
|
||||
- 改进了搜索界面。
|
||||
- 更新了开源工具。
|
||||
- 改进了错误页面。
|
||||
- 新的闪屏。
|
||||
- 改进了页面加载动画。
|
||||
- 更快的图像预加载。
|
||||
|
||||
如果你想深入了解这个版本的技术细节,请查阅 [发行说明][12]。
|
||||
|
||||
### 📥 获取 Discourse 3.0
|
||||
|
||||
如果你使用的是 [Discourse 的托管计划][13],你一定已经收到了 3.0 的更新,你所要做的就是通过你的管理设置启用新功能。
|
||||
|
||||
如果你是自我托管,你必须通过点击管理仪表板上的“更新”按钮手动更新你的实例。
|
||||
|
||||
对于新用户,请在他们的官方网站上探索更多关于 Discourse 的信息。
|
||||
|
||||
> **[Discourse][14]**
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/discourse-3-0-release/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/discourse-3-0-release.png
|
||||
[2]: https://itsfoss.com/open-source-forum-software/
|
||||
[3]: https://itsfoss.community
|
||||
[4]: https://blog.discourse.org/2018/05/discourse-2-0-released/
|
||||
[5]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0.jpg
|
||||
[6]: https://news.itsfoss.com/content/images/2023/01/discourse-member-exp-1.png
|
||||
[7]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0_User_Status.jpg
|
||||
[8]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0_Notifications-1.jpg
|
||||
[9]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0_Sidebar-1.jpg
|
||||
[10]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0_Chat.jpg
|
||||
[11]: https://news.itsfoss.com/content/images/2023/01/Discourse_3.0_User_Tips.jpg
|
||||
[12]: https://meta.discourse.org/t/discourse-version-3-0/
|
||||
[13]: https://www.discourse.org/pricing
|
||||
[14]: https://www.discourse.org
|
@ -0,0 +1,98 @@
|
||||
[#]: subject: "Mastodon's Growth Continues, Medium Joins in With its New Community Platform"
|
||||
[#]: via: "https://news.itsfoss.com/medium-mastodon/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15445-1.html"
|
||||
|
||||
Mastodon 继续增长,Medium 的新社区平台也加入了
|
||||
======
|
||||
|
||||
> Mastodon 的又一次胜利!Medium 为其用户推出了一个 Mastodon 实例。
|
||||
|
||||
![][1]
|
||||
|
||||
Mastodon 在最近一段时间的增长是巨大的;越来越多的人正在转向这个 Twitter 的替代品。
|
||||
|
||||
如果你不熟悉 Mastodon,它是目前 [最好的主流社交媒体替代品][2] 之一,有可能成为 Twitter 的替代品,它是 **完全开源和去中心化的**。
|
||||
|
||||
随着 Twitter 的不断发生变化和去年埃隆·马斯克对它的收购,更多的用户开始对 Mastodon 这个平台产生了浓厚的兴趣。
|
||||
|
||||
Vivaldi [最近推出了][3] 其由 Mastodon 驱动的社区,[Mozilla 基金会][4] 也在考虑类似的东西。
|
||||
|
||||
现在,[Medium][5] 已经向前迈出了一步,推出了它们的 Mastodon 实例。
|
||||
|
||||
### Medium 启动了一个由 Mastodon 驱动的社区
|
||||
|
||||
在 [最近的公告][6] 中,Medium 在 [me.dm][7] 推出了其 Mastodon 实例,专注于 “帮助他们的作者、出版物和读者在 <ruby>联盟宇宙<rt>Fediverse</rt></ruby> 中找到一个家”。
|
||||
|
||||
该网站(即 Mastodon 实例)旨在成为 Medium 的用户的专属空间。
|
||||
|
||||
![][8]
|
||||
|
||||
换句话说,它将成为 Medium 用户的专属社交网络平台。
|
||||
|
||||
有了这个网络平台,他们也可以开始进行 500 字以内的短文写作了。
|
||||
|
||||
Medium 的 CEO 提到:
|
||||
|
||||
> 相比之下,Mastodon 主要是为 500 字以内的短文写作服务的。用一个不太双关的说法:今天,我们正在借助 Mastodon 上的实例(me.dm)将我们用于发表长文的 Medium 扩展到短文 medium(小写 m)。除了更简短的形式外,Mastodon 还带来了围绕联盟概念的重要创新。
|
||||
|
||||
因此,看起来 Medium 正在试水和尝试新的东西。
|
||||
|
||||
对于那些喜欢一目了然的内容而不是冗长信息的用户来说,可能是一件好事。
|
||||
|
||||
如果操作得当,这对他们来说会有很好的效果。
|
||||
|
||||
**那么,你怎样才能加入 Medium 的 Mastodon 平台?
|
||||
|
||||
> 💡 你看,最初,**只有选定的作者和出版物** 才能进入这个 Mastodon 实例。现有的 Medium 用户可以尝试发送一个 [注册请求][9],但要经过他们的批准。
|
||||
|
||||
因此,如果你发送一个注册请求,你得等待批准。
|
||||
|
||||
他们还计划作为付费会员的额外服务来邀请作家和读者。
|
||||
|
||||
他们已经在为他们的 Mastodon 实例开发一个 “用 Medium 注册” 的选项,这应该是为了让你更容易开始使用。
|
||||
|
||||
关于这一点,他们提到:
|
||||
|
||||
> 有这么多的 Mastodon 实例可供选择,我们计划让 me.dm 一开始就有几个重要的好处:可靠的基础设施和审核,一个短域名让你更容易分享你的用户名,为新用户提供更好的入门培训,以及一个有趣的本地信息源。
|
||||
|
||||
### 去中心化和开源平台的步伐加快了
|
||||
|
||||
去中心化的平台正在变得比人们十年前预期的更加流行。
|
||||
|
||||
最大的促成因素是大型科技公司越来越多的不稳定的变化和决定,迫使用户不断调整他们在社交媒体平台上的互动方式和理由。
|
||||
|
||||
有了开源和去中心化的平台,用户得到了透明度,更多的数据控制,以及更多的自由。
|
||||
|
||||
我们可能没有想到,Mastodon 作为一个平台,逐渐成为各种组织的社区建设的一个重要组成部分。因此,我们非常期待在不久的将来看到更多变化。
|
||||
|
||||
💭 欢迎在下面的评论中分享你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/medium-mastodon/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/medium-embraces-mastodon.png
|
||||
[2]: https://itsfoss.com/mainstream-social-media-alternaives/
|
||||
[3]: https://news.itsfoss.com/vivaldi-mastodon-integration/
|
||||
[4]: https://blog.mozilla.org/en/mozilla/mozilla-launch-fediverse-instance-social-media-alternative/
|
||||
[5]: https://medium.com
|
||||
[6]: https://blog.medium.com/medium-embraces-mastodon-19dcb873eb11
|
||||
[7]: https://me.dm/
|
||||
[8]: https://news.itsfoss.com/content/images/2023/01/medium-mastodon.jpg
|
||||
[9]: https://me.dm/auth/sign_up
|
||||
[10]: https://unlocator.com/favicon.ico
|
||||
[11]: https://unlocator.com/wp-content/uploads/2019/05/unlocatoricon.jpg
|
@ -1,133 +0,0 @@
|
||||
[#]: subject: "EndeavourOS 'Cassini' Releases With New Features and Linux Kernel 6.0"
|
||||
[#]: via: "https://news.itsfoss.com/endeavouros-cassini/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
EndeavourOS 'Cassini' Releases With New Features and Linux Kernel 6.0
|
||||
======
|
||||
|
||||
EndeavourOS's latest update has arrived!
|
||||
|
||||
![EndeavourOS 'Cassini' Releases With New Features and Linux Kernel 6.0][1]
|
||||
|
||||
EndeavourOS is a popular Arch-based Linux distribution that aims to make the Arch experience easy.
|
||||
|
||||
Code-named 'Cassini', it signifies a new phase in EndeavourOS's development that aims to make the OS better than its previous iterations.
|
||||
|
||||
Similar to a [previous release][2], this release is also named after one of NASA's [projects][3].
|
||||
|
||||
Let's see what makes this release so unique.
|
||||
|
||||
Unlocator Smart DNSRemove geographic blocks from streaming services using Unlocator Smart DNS. Simple to use and with a full free trial included.![][4]Unlocator![][5]
|
||||
|
||||
### 🆕 EndeavourOS 'Cassini': What's New?
|
||||
|
||||
![endeavouros cassini][6]
|
||||
|
||||
The 'Cassini' release packs plenty of improvements, some of the noteworthy highlights include:
|
||||
|
||||
- **Improved ARM Support**
|
||||
- **Linux Kernel 6.0**
|
||||
- **Various User Interface Updates**
|
||||
- **Updated Software Packages**
|
||||
|
||||
#### Improved ARM Support
|
||||
|
||||
![endeavouros cassini arm][7]
|
||||
|
||||
EndeavourOS now features support for the [Pinebook Pro][8].
|
||||
|
||||
This was made possible by including the new 'linux-eos-arm' kernel that comes with the 'amdgpu' driver for supporting generic ARM devices.
|
||||
|
||||
The developers also added that:
|
||||
|
||||
> We’ve leveraged existing work and PKGBUIDs of both Manjaro ARM and archlinuxarm-pbp projects to create our Pinebook Pro images and would like to thank them for their continuing work in supporting PineBook Pro for Arch Linux ARM platform.
|
||||
|
||||
Furthermore, EndeavourOS also has enhanced support for ARM devices like the [Phytiuim D2000][9], [Raspberry Pi][10], and [Odroid N2+][11].
|
||||
|
||||
#### 🎨 Various User Interface Updates
|
||||
|
||||
![endeavouros cassini budgie][12]
|
||||
|
||||
With this release, EndeavourOS has received quite a few user interface tweaks; some of the highlights include:
|
||||
|
||||
- The 'Discover' icon was replaced with a 'Konsole' icon on KDE Plasma.
|
||||
- [Qogir theme][13] is being used for icons in Cinnamon and Budgie.
|
||||
- In the case of GNOME, the wallpaper follows night and day theme like the Console.
|
||||
- The default wallpaper is now set by the 'settings' package instead of 'welcome'.
|
||||
- A load of cleanup work for Calamares.
|
||||
|
||||
#### Linux Kernel 6.0
|
||||
|
||||
EndeavourOS 'Cassini' features Linux Kernel 6.0.12.arch1-1, which enables it to have enhanced support for [OpenRISC][14] and [LoongArch][15] architectures.
|
||||
|
||||
Alongside that, there is a noticeable uplift in performance for AMD EPYC, Ryzen Threadripper, and Intel Xeon Ice Lake chips.
|
||||
|
||||
You can go through our coverage for more details:
|
||||
|
||||
#### Updated Software Packages
|
||||
|
||||
This release also features a lot of updated software, including:
|
||||
|
||||
- Calamares 3.3.0-alpha3
|
||||
- Firefox 108.0.1-1
|
||||
- Mesa 22.3.1-1
|
||||
- Xorg-Server 21.1.5-1
|
||||
- nvidia-dkms 525.60.11-1
|
||||
- Grub 2:2.06.r403.g7259d55ff-1
|
||||
|
||||
#### 🛠️ Other Changes
|
||||
|
||||
There were also a few other changes that I want to mention, such as:
|
||||
|
||||
- [dracut][16] has replaced [mkinitcpio][17] to handle the installation process.
|
||||
- You can now choose not to install a bootloader.
|
||||
- You have two bootloader options to pick from, [systemd-boot][18] and [Grub][19].
|
||||
- The Grub submenu is now enabled by default.
|
||||
- gedit and GNOME terminal have been replaced by [gnome-text-editor][20] and [GNOME Console][21].
|
||||
|
||||
### 📥 Download EndeavourOS Cassini
|
||||
|
||||
You can find the latest release on the [official website][22] from one of the available mirrors.
|
||||
|
||||
_💬 What do you think of this release? Was it worth the wait?_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/endeavouros-cassini/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/content/images/size/w2000/2022/12/endeavour-os-cassini-release.png
|
||||
[2]: https://news.itsfoss.com/endeavouros-artemis-release/
|
||||
[3]: https://solarsystem.nasa.gov/missions/cassini/overview/
|
||||
[4]: https://unlocator.com/favicon.ico
|
||||
[5]: https://unlocator.com/wp-content/uploads/2019/05/unlocatoricon.jpg
|
||||
[6]: https://news.itsfoss.com/content/images/2022/12/EndeavourOS-Cassini.jpg
|
||||
[7]: https://news.itsfoss.com/content/images/2022/12/EndeavourOS-Cassini_ARM.png
|
||||
[8]: https://itsfoss.com/pinebook-pro/
|
||||
[9]: https://phytium.com.cn/en/article/721
|
||||
[10]: https://www.raspberrypi.org
|
||||
[11]: https://www.hardkernel.com/shop/odroid-n2-with-4gbyte-ram-2/
|
||||
[12]: https://news.itsfoss.com/content/images/2022/12/EndeavourOS-Cassini_2-1.jpg
|
||||
[13]: https://github.com/vinceliuice/Qogir-theme
|
||||
[14]: https://openrisc.io
|
||||
[15]: https://en.wikipedia.org/wiki/Loongson
|
||||
[16]: https://dracut.wiki.kernel.org/index.php/Main_Page
|
||||
[17]: https://wiki.archlinux.org/title/mkinitcpio
|
||||
[18]: https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/
|
||||
[19]: https://www.gnu.org/software/grub/
|
||||
[20]: https://itsfoss.com/gnome-text-editor/
|
||||
[21]: https://gitlab.gnome.org/GNOME/console
|
||||
[22]: https://endeavouros.com/latest-release/
|
@ -1,74 +0,0 @@
|
||||
[#]: subject: "Tails 5.8 Arrives with Official Wayland Support"
|
||||
[#]: via: "https://debugpointnews.com/tails-5-8-release/"
|
||||
[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Tails 5.8 Arrives with Official Wayland Support
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
**A sizable update arrives in Tails 5.8, bringing Wayland support, newly redesigned persistence storage and more.**
|
||||
|
||||
Tails, aka The Amnesic Incognito Live System, is a [privacy-focussed Linux Distribution][2] which uses the Tor network to protect you while browsing the web. Tails are based on Debian stable branch and come with many goodies such as an IRC client, Tor browser, email clients, and messengers to help you roam around on the web anonymously.
|
||||
|
||||
![Tails 5.8 desktop][3]
|
||||
|
||||
### What’s New in Tails 5.8 Release
|
||||
|
||||
At a high level, Tails 5.8 includes significant redesigns of existing features, improved usability, and strengthened security. Also, bringing modern tech aligns with the changing times and needs of the hour.
|
||||
|
||||
The persistence storage module gets a complete redesign in this release. In the new version of Persistent Storage, you no longer have to restart after creating a Persistent Storage or activating a new feature. You can also change the password for your Persistent Storage from within the application. Additionally, you can now create a Persistent Storage directly from the Welcome Screen if you don’t already have one. The Persistent Storage had not been updated much since its initial release in 2012 due to challenges in modifying and improving the code.
|
||||
|
||||
The Tails team has also replaced the deprecated X.Org display system with Wayland. While you may not notice any visual changes, Wayland provides increased security for Tails by making it harder for a compromised application to compromise or misuse other applications.
|
||||
|
||||
![Browse internet securely using Tails 5.8][4]
|
||||
|
||||
For example, since Tails 4.8, the Unsafe Browser has been disabled by default due to a security vulnerability that could reveal your IP address and deanonymize you through the use of an invisible Unsafe Browser. Wayland addresses this vulnerability and makes it safe to enable the Unsafe Browser by default again. However, if desired, you can still disable the Unsafe Browser from the Welcome Screen.
|
||||
|
||||
In addition to addressing security concerns, Wayland also introduces new features that were previously not supported in the Unsafe Browser, including sound, file uploads and downloads, alternative input methods for non-Latin languages such as Chinese, and accessibility features like the screen reader and virtual keyboard.
|
||||
|
||||
The Tails team has also made it easier to enter new Tor bridges by allowing you to scan a QR code. You can obtain a QR code by sending an empty email to [bridges@torproject.org][5] from a Gmail or Riseup email address or by visiting [https://bridges.torproject.org/][6] and printing the QR code on paper.
|
||||
|
||||
Furthermore, the entire Debian stable base is bumped up to the latest version, including pre-loaded apps.
|
||||
|
||||
A complete changelog is available [here][7] if you want to dive deeper into the changes.
|
||||
|
||||
### Download and upgrade
|
||||
|
||||
If you are already running a prior version of the Tails 5.0 series, you should automatically get this update once you boot up Tails from the USB stick.
|
||||
|
||||
In addition, if you want to install Tails 5.8 fresh, grab the ISO files from the below links:
|
||||
|
||||
- [For USB sticks (USB image)][8]
|
||||
- [For DVDs and virtual machines (ISO image)][9]
|
||||
|
||||
Via [release announcement][10].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://debugpointnews.com/tails-5-8-release/
|
||||
|
||||
作者:[arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://debugpointnews.com/author/dpicubegmail-com/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://debugpointnews.com/wp-content/uploads/2022/12/tails58head.jpg
|
||||
[2]: https://www.debugpoint.com/privacy-linux-distributions-2022/
|
||||
[3]: https://debugpointnews.com/wp-content/uploads/2022/12/Tails-5.8-desktop.jpg
|
||||
[4]: https://debugpointnews.com/wp-content/uploads/2022/12/Browse-internet-securely-using-Tails-5.8.jpg
|
||||
[5]: https://debugpointnews.commailto:bridges@torproject.org
|
||||
[6]: https://bridges.torproject.org/
|
||||
[7]: https://gitlab.tails.boum.org/tails/tails/-/blob/master/debian/changelog
|
||||
[8]: https://tails.boum.org/install/download/index.en.html
|
||||
[9]: https://tails.boum.org/install/download-iso/index.en.html
|
||||
[10]: https://tails.boum.org/news/version_5.8/index.en.html
|
@ -1,100 +0,0 @@
|
||||
[#]: subject: "Pinta 2.1 Release Introduces WebP Support. But You Can't Use It Yet Unfortunately"
|
||||
[#]: via: "https://news.itsfoss.com/pinta-2-1-release/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Pinta 2.1 Release Introduces WebP Support. But You Can't Use It Yet Unfortunately
|
||||
======
|
||||
|
||||
Pinta 2.1 comes with WebP support and various other useful improvements.
|
||||
|
||||
![Pinta 2.1 Release Introduces WebP Support. But You Can't Use It Yet Unfortunately][1]
|
||||
|
||||
Pinta is a free and open-source drawing app for Linux that offers a ton of features in a relatively small package.
|
||||
|
||||
It is one of the [best Linux tools for digital artists][2] available.
|
||||
|
||||
Its last major release was in January 2022, introducing improved Hi DPI support, GTK 3 port, and [more][3].
|
||||
|
||||
Marking 2023's first release, Pinta 2.1 promises to offer even further refinements.
|
||||
|
||||
**Notice the new Pinta icon in the image above? Well, that's one of the changes.**
|
||||
|
||||
Let's see how this release pans out.
|
||||
|
||||
### 🆕 What's New in Pinta 2.1?
|
||||
|
||||
![pinta 2.1][4]
|
||||
|
||||
[Pinta 2.1][5] is offering plenty of new improvements; some notable ones include:
|
||||
|
||||
- **WebP Support**
|
||||
- **Improved .ora Support**
|
||||
- **Enhanced Handles**
|
||||
- **Dark Mode**
|
||||
- **Improved File Dialog**
|
||||
- **Various Bug Fixes and Changes**
|
||||
|
||||
**WebP Support:** Pinta finally has support for WebP files, but it does not come out of the box. For Linux users, the [webp-pixbuf-loader][6]**dependency is required to enable WebP support.**
|
||||
|
||||
> 📋 Unfortunately, WebP support is not included in the Flatpak and Snap builds of Pinta 2.1. Even if you have that library installed on your system. So, you probably have to build it from the source or use WebP files on Windows/macOS only.
|
||||
|
||||
**Improved .ora Support:** With Pinta 2.1, hidden layers are now round-tripped properly for .ora files.
|
||||
|
||||
Furthermore, when you save a .ora file, a flattened image is now included in the archive.
|
||||
|
||||
It is like this because it is required by the spec to accommodate the viewer software.
|
||||
|
||||
**Enhanced Handles:** The selection move and shape control point handles are now more intuitive, especially when working on zoomed-in or small images.
|
||||
|
||||
**Dark Mode:** Pinta has finally received full support for dark mode across the app; all icons, toolbars, dialogs, etc., are now in high-res SVG format.
|
||||
|
||||
**Improved File Dialog:** The file dialog now uses MIME types on Linux, allowing valid image files with unknown extensions to be included in the image file filter.
|
||||
|
||||
**Various Bug Fixes and Changes:** Apart from the changes I listed above, here are some that are also worth mentioning:
|
||||
|
||||
- Upgraded to .NET 7.
|
||||
- New '**Transparency Mode**' in Gradient Tool.
|
||||
- Standard GTK about dialog.
|
||||
- The gradient tool now updates properly while drawing transparent colors.
|
||||
- The new screenshot command now uses the XDG portal.
|
||||
|
||||
If you want to go deep into the technical details of the release, head to its [release notes][7].
|
||||
|
||||
### 📥 Download Pinta 2.1
|
||||
|
||||
Pinta 2.1 is available in the [Snap store][8], as well as on [Flathub][9]. The repositories include an outdated back, so you can safely ignore it.
|
||||
|
||||
You can also try building it from the [source code][10] and explore other download options for Windows/macOS.
|
||||
|
||||
[Download Pinta 2.1][11]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/pinta-2-1-release/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/content/images/size/w2000/2023/01/pinta-2-1-release.png
|
||||
[2]: https://itsfoss.com/best-linux-graphic-design-software/
|
||||
[3]: https://news.itsfoss.com/pinta-2-0-release/
|
||||
[4]: https://news.itsfoss.com/content/images/2023/01/Pinta_2.1.png
|
||||
[5]: https://www.pinta-project.com
|
||||
[6]: https://github.com/aruiz/webp-pixbuf-loader/
|
||||
[7]: https://github.com/PintaProject/Pinta/releases/tag/2.1
|
||||
[8]: https://snapcraft.io/pinta
|
||||
[9]: https://flathub.org/apps/details/com.github.PintaProject.Pinta
|
||||
[10]: https://github.com/PintaProject/Pinta
|
||||
[11]: https://www.pinta-project.com/releases/
|
||||
|
@ -1,235 +0,0 @@
|
||||
[#]: subject: "Codecademy vs. The BBC Micro"
|
||||
[#]: via: "https://twobithistory.org/2019/03/31/bbc-micro.html"
|
||||
[#]: author: "Two-Bit History https://twobithistory.org"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "CanYellow"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
[Codecademy][T1] 比之 [The BBC Micro][T2]
|
||||
======
|
||||
|
||||
TD
|
||||
Codecademy vs. The BBC Micro
|
||||
======
|
||||
|
||||
20世纪70年代末期,计算机突然成为了某种普罗大众能够买回家的商品;而此前的几十年间,它一直只是听命于企业霸主的神秘而笨重的机器。这是多么吸引人,少数狂热的爱好者注意到了并争相购买了属于自己的计算机。对更多的人而言,微形计算机的到来引发了对未来的无助焦虑。同时期的杂志上的一则广告承诺一台家用计算机将“让您的孩子在学校享有不公平的优势”。广告中展示了一位打着领带,身着时髦的西装外套的男孩子急切地举手回答问题,在他身后,他的显得不那么聪明的同学们闷闷不乐地望着他。这则广告以及其它与之类似的广告表明世界正在疾速改变,而如果你不立即学习如何使用这些令人生畏的新设备之一,你和你的家人就会被时代所抛弃。
|
||||
|
||||
DN
|
||||
In the late 1970s, the computer, which for decades had been a mysterious, hulking machine that only did the bidding of corporate overlords, suddenly became something the average person could buy and take home. An enthusiastic minority saw how great this was and rushed to get a computer of their own. For many more people, the arrival of the microcomputer triggered helpless anxiety about the future. An ad from a magazine at the time promised that a home computer would “give your child an unfair advantage in school.” It showed a boy in a smart blazer and tie eagerly raising his hand to answer a question, while behind him his dim-witted classmates look on sullenly. The ad and others like it implied that the world was changing quickly and, if you did not immediately learn how to use one of these intimidating new devices, you and your family would be left behind.
|
||||
|
||||
在英国,这些焦虑转化为政府高层对国家竞争力的担忧。从各种意义上,20世纪70年代对英国来说都是平平无奇的十年。通胀与失业率高企。与此同时,一系列的罢工让伦敦陷于一次又一次的停电中。一篇1979年的政府报告焦虑没有跟上计算机技术浪潮将“为我们糟糕的工业表现平添又一个影响因素”[1][1]。英国似乎已经在计算机技术的角逐中落后了——所有的大型的计算机公司都是美国的,而集成电路则在日本和中国台湾制造。
|
||||
|
||||
DN
|
||||
In the UK, this anxiety metastasized into concern at the highest levels of government about the competitiveness of the nation. The 1970s had been, on the whole, an underwhelming decade for Great Britain. Both inflation and unemployment had been high. Meanwhile, a series of strikes put London through blackout after blackout. A government report from 1979 fretted that a failure to keep up with trends in computing technology would “add another factor to our poor industrial performance.”[1][1] The country already seemed to be behind in the computing arena—all the great computer companies were American, while integrated circuits were being assembled in Japan and Taiwan.
|
||||
|
||||
BBC(英国广播公司)——由政府建立的公共服务广播公司——作出了一个大胆的举动,决定通过帮助英国人战胜他们对计算机的反感来解决英国的国家竞争力问题。BBC 发起了 [_计算机认知计划 (Computer Literacy Project)_][T3],该计划包括多个教育方向的努力:几部电视系列片,一些相关书籍,一张支持团队网络以及一款名为 BBC Micro 的特别定制的微型计算机。该项目是如此成功以致于到1983年[ BYTE 杂志][T4]的一名编辑写道:“与美国相比,有更多的英国人对微型计算机感兴趣。”[2][2] 这名编辑惊讶于英国的第五届个人电脑世界展 (the Fifth Personal Computer World Show) 比当年的西海岸电脑展的人数更多。超过六分之一的英国人观看了由 _计算机认知计划_ 制作的第一部电视系列片的一集并最终售出了150万台 BBC Micro 微型计算机。[3][3]
|
||||
|
||||
DN
|
||||
In an audacious move, the BBC, a public service broadcaster funded by the government, decided that it would solve Britain’s national competitiveness problems by helping Britons everywhere overcome their aversion to computers. It launched the _Computer Literacy Project_, a multi-pronged educational effort that involved several TV series, a few books, a network of support groups, and a specially built microcomputer known as the BBC Micro. The project was so successful that, by 1983, an editor for BYTE Magazine wrote, “compared to the US, proportionally more of Britain’s population is interested in microcomputers.”[2][2] The editor marveled that there were more people at the Fifth Personal Computer World Show in the UK than had been to that year’s West Coast Computer Faire. Over a sixth of Great Britain watched an episode in the first series produced for the _Computer Literacy Project_ and 1.5 million BBC Micros were ultimately sold.[3][3]
|
||||
|
||||
去年,一份包括了由 _计算机认知计划_ 出版的所有材料与制作的每一部电视系列片的[档案][4]发布在了互联网上。我抱着极大的兴趣观看这些电视系列片并试图想象在20世纪80年代早期学习电脑计算是什么图景。不过我发现更有兴趣的是时年是如何教授电脑计算的。今天,我们仍然担心技术发展使人们落伍。富有的科技企业家与政府花费大量的资金试图教孩子们“编程”。我们拥有诸如 Codecademy 这样的通过新技术的运用进行交互式编程教学的网站。我们可能假定这种方式比80年代的呆板的电视系列片更高效,不过真的是这样吗?
|
||||
|
||||
DN
|
||||
[An archive][4] containing every TV series produced and all the materials published for the _Computer Literacy Project_ was put on the web last year. I’ve had a huge amount of fun watching the TV series and trying to imagine what it would have been like to learn about computing in the early 1980s. But what’s turned out to be more interesting is how computing was _taught_. Today, we still worry about technology leaving people behind. Wealthy tech entrepreneurs and governments spend lots of money trying to teach kids “to code.” We have websites like Codecademy that make use of new technologies to teach coding interactively. One would assume that this approach is more effective than a goofy ’80s TV series. But is it?
|
||||
|
||||
### 计算机认知计划 ([Computer Literacy Project][T3])
|
||||
|
||||
DN
|
||||
### The Computer Literacy Project
|
||||
|
||||
微型计算机革命始于1975年 [Altair 8800][5] 的发布。两年后,Apple II,TRS-80 以及 Commodore PET 都相继发布。全新的计算机的销量爆发式增长。1978年,BBC 在一部名为《芯片来了》(["Now the Chips Are Down"][T5])(译者注:对于非英国区域的读者,可以在[这里][T6]观看该纪录片) 的纪录片中探讨了这种新的机器必将带来的剧烈的社会变革。
|
||||
|
||||
DN
|
||||
The microcomputer revolution began in 1975 with the release of [the Altair 8800][5]. Only two years later, the Apple II, TRS-80, and Commodore PET had all been released. Sales of the new computers exploded. In 1978, the BBC explored the dramatic societal changes these new machines were sure to bring in a documentary called “Now the Chips Are Down.”
|
||||
|
||||
该纪录片充满担忧。在前5分钟内,解说员提到这种微电子器件将“彻底改变我们的生活方式”。随着诡异的合成音乐的播放以及屏幕上绿色的电脉冲在放大后的芯片上起舞,解说员进一步说这种芯片“正是日本放弃造船业的原因,也将成为我们的孩子们长大后失业的原因”。纪录片继续探讨了机器人如何用于汽车自动化组装以及欧洲的手表工业如何在与美国的电子表工业竞争中败下阵来。它斥责了英国政府在应对未来的大规模失业的准备上做得不够。
|
||||
|
||||
DN
|
||||
The documentary was alarming. Within the first five minutes, the narrator explains that microelectronics will “totally revolutionize our way of life.” As eerie synthesizer music plays, and green pulses of electricity dance around a magnified microprocessor on screen, the narrator argues that the new chips are why “Japan is abandoning its ship building, and why our children will grow up without jobs to go to.” The documentary goes on to explore how robots are being used to automate car assembly and how the European watch industry has lost out to digital watch manufacturers in the United States. It castigates the British government for not doing more to prepare the country for a future of mass unemployment.
|
||||
|
||||
该纪录片据信可能在英国议会上展示过。[4][6] 包括工业署和人力服务委员会在内的一些政府代表开始有兴趣尝试提高英国公众对计算机的认识。人力服务委员会为来自 BBC 的教育部门的一个团队到日本、美国以及其他国家的实地考察提供了资助。该研究团队完成了一份历数微电子技术在工业制造、人力关系与办公室工作等领域最终将意味着哪些方面的重大改变的研究报告。70年代末,BBC 决定制作一部帮助普通英国人“学习如何使用和控制计算机,避免产生被计算机支配的感受”的十集电视系列片[5][7] 。这一努力最终成为了一个与_成人扫盲计划(Adult Literacy Project)_相似的多媒体项目。_成人扫盲计划(Adult Literacy Project)_是 BBC 此前进行的一项涉及电视系列片以及辅助课程的帮助两百万人提高他们的阅读能力的项目。
|
||||
|
||||
DN
|
||||
The documentary was supposedly shown to the British Cabinet.[4][6] Several government agencies, including the Department of Industry and the Manpower Services Commission, became interested in trying to raise awareness about computers among the British public. The Manpower Services Commission provided funds for a team from the BBC’s education division to travel to Japan, the United States, and other countries on a fact-finding trip. This research team produced a report that cataloged the ways in which microelectronics would indeed mean major changes for industrial manufacturing, labor relations, and office work. In late 1979, it was decided that the BBC should make a ten-part TV series that would help regular Britons “learn how to use and control computers and not feel dominated by them.”[5][7] The project eventually became a multimedia endeavor similar to the _Adult Literacy Project_, an earlier BBC undertaking involving both a TV series and supplemental courses that helped two million people improve their reading.
|
||||
|
||||
_计算机认知计划_ 背后的制作方热衷于以“实操”示例为特色的电视系列片。这样如果观众拥有一台微型计算机在家里,他们就可以亲自动手尝试。这些例子不得不都是基于 BASIC 语言的,因为这是在几乎所有的微型计算机上都使用的编程语言 (实际是整个交互界面(shell))。但是制作方面临一个棘手的问题:微型计算机制造商均拥有他们自己的 BASIC 方言,因此不论他们选择哪一种方言,他们都不可避免地疏远大部分的观众。唯一切实可行的方案是创造一种全新的 BASIC 方言——BBC BASIC——以及与之配合使用的微型计算机。英国公众就可以购买这种全新的微型计算机并依照示例操作而不需要担心软硬件上的差异带来的问题。
|
||||
|
||||
DN
|
||||
The producers behind the _Computer Literacy Project_ were keen for the TV series to feature “hands-on” examples that viewers could try on their own if they had a microcomputer at home. These examples would have to be in BASIC, since that was the language (really the entire shell) used on almost all microcomputers. But the producers faced a thorny problem: Microcomputer manufacturers all had their own dialects of BASIC, so no matter which dialect they picked, they would inevitably alienate some large fraction of their audience. The only real solution was to create a new BASIC—BBC BASIC—and a microcomputer to go along with it. Members of the British public would be able to buy the new microcomputer and follow along without worrying about differences in software or hardware.
|
||||
|
||||
BBC 的制作人与节目主持人并不具备自行制造微型计算机的能力,因此他们汇总了一份他们预期的计算机的规范并邀请英国的微型计算机公司推出满足该规范要求的新机器。这份规范要求一种相对更强劲的计算机,因为 BBC 的制作方认为相应的设备应当能够运行真实有用的应用程序。_计算机认知计划_的技术顾问也是如此建议:如果必须要教授全体国人一种 BASIC 方言的话,那么最好选择表现良好的(他们可能没有完全那样说,不过我认为这就是他们的真实想法)。BBS BASIC 通过允许递归调用与局部变量将弥补一些 BASIC 语言的常见缺点。[6][8]
|
||||
|
||||
DN
|
||||
The TV producers and presenters at the BBC were not capable of building a microcomputer on their own. So they put together a specification for the computer they had in mind and invited British microcomputer companies to propose a new machine that met the requirements. The specification called for a relatively powerful computer because the BBC producers felt that the machine should be able to run real, useful applications. Technical consultants for the _Computer Literacy Project_ also suggested that, if it had to be a BASIC dialect that was going to be taught to the entire nation, then it had better be a good one. (They may not have phrased it exactly that way, but I bet that’s what they were thinking.) BBC BASIC would make up for some of BASIC’s usual shortcomings by allowing for recursion and local variables.[6][8]
|
||||
|
||||
BBC 最终决定由坐落于剑桥的 Acorn Computers 公司(中文网络译名:艾康电脑)制造 BBC Micro 计算机。在选择 Acorn 公司的时候,BBC 并未考虑来自经营 Sinclair Research 公司的 [Clive Sinclair][T7] 的申请,Sinclair Research 公司凭借 Sinclair ZX80 微型计算机的推出在1980年将微型计算机的大众市场引入了英国。Sinclair 公司的新产品,ZX81,虽然更便宜但是性能不足以满足 BBC 的要求。Acorn 的新型的内部称为 Proton 原型计算机更加昂贵但是性能更好,更具备扩展性,BBC 对此印象深刻。该型号的计算机从未作为 Proton 进行营销与销售,Acorn 公司代之以 BBC Micro 的名称在1981年12月发布。BBC Micro 又被亲切地称为“The Beeb”,你可以以235英磅的价格购得其16k内存的版本或者以335英磅的价格获得其32k内存的版本。
|
||||
|
||||
DN
|
||||
The BBC eventually decided that a Cambridge-based company called Acorn Computers would make the BBC Micro. In choosing Acorn, the BBC passed over a proposal from Clive Sinclair, who ran a company called Sinclair Research. Sinclair Research had brought mass-market microcomputing to the UK in 1980 with the Sinclair ZX80. Sinclair’s new computer, the ZX81, was cheap but not powerful enough for the BBC’s purposes. Acorn’s new prototype computer, known internally as the Proton, would be more expensive but more powerful and expandable. The BBC was impressed. The Proton was never marketed or sold as the Proton because it was instead released in December 1981 as the BBC Micro, also affectionately called “The Beeb.” You could get a 16k version for £235 and a 32k version for £335.
|
||||
|
||||
1980年,Acorn 是英国计算机工业的失败者,但是 BBC Micro 成就了 Acorn 公司的传统。时至今日,世界范围内最流行的微处理器指令集是 ARM 架构,“ARM”如今表示“先进 RISC 架构设备(Advanced RISC Machine)”,然而最初它代表的是“Acorn RISC 架构设备(Acorn RISC Machine)”。ARM 架构背后的 ARM 公司(ARM Holding)就是 Acorn 公司在1990年之后的延续。
|
||||
|
||||
DN
|
||||
In 1980, Acorn was an underdog in the British computing industry. But the BBC Micro helped establish the company’s legacy. Today, the world’s most popular microprocessor instruction set is the ARM architecture. “ARM” now stands for “Advanced RISC Machine,” but originally it stood for “Acorn RISC Machine.” ARM Holdings, the company behind the architecture, was spun out from Acorn in 1990.
|
||||
|
||||
![Picture of the BBC Micro.][9] _BBC Micro 的一幅拙劣图片,我摄于美国加州山景城(Mountain View)的计算机历史博物馆(Computer History Museum)_
|
||||
|
||||
DN
|
||||
![Picture of the BBC Micro.][9] _A bad picture of a BBC Micro, taken by me at the Computer History Museum
|
||||
in Mountain View, California._
|
||||
|
||||
### 名为“计算机程序(The Computer Programme)”的电视系列片
|
||||
|
||||
DN
|
||||
### The Computer Programme
|
||||
|
||||
十几个不同的电视系列片最终作为_计算机认知计划_的一部分创作出来。第一部作品是一部名为_计算机程序(The Computer Programme)_的十集电视系列片。该系列片在1982年初播出了十周。一百万人每周晚上收看该节目,另有25万人收看该节目在每周日与周一下午的重播。
|
||||
|
||||
DN
|
||||
A dozen different TV series were eventually produced as part of the _Computer Literacy Project_, but the first of them was a ten-part series known as _The Computer Programme_. The series was broadcast over ten weeks at the beginning of 1982. A million people watched each week-night broadcast of the show; a quarter million watched the reruns on Sunday and Monday afternoon.
|
||||
|
||||
这一电视节目有两名主持人,Chris Serle 和 Ian McNaught-Davis。Serle 扮演初学者,而 McNaught-Davis 扮演具有大型计算机编程职业经验的专家,这是一个启发性的配置。该节目造就了[略显尴尬的过渡][10]——Serle 经常直接从与 McNaught-Davis 的对话中过渡到面向镜头的边走边说的讲述,此时你不禁会疑惑 McNaught-Davis 是否还站在画面之外。不过这意味着 Serle 可以表达观众肯定会有的关注。他可能会惊恐地看着满屏的 BASIC 语言并提出类似“这些美元符号是什么意思”的问题。在节目中的某些时刻,Serle 与 McNaught-Davis 会坐在电脑前进行事实上的结对编程。McNaught-Davis 会在不同的地方留下一些线索,而 Serle 则试图将它们弄清楚。如果这一节目仅仅由一个无所不知的讲述者主持,它将更难以理解。
|
||||
|
||||
DN
|
||||
The show was hosted by two presenters, Chris Serle and Ian McNaught-Davis. Serle plays the neophyte while McNaught-Davis, who had professional experience programming mainframe computers, plays the expert. This was an inspired setup. It made for [awkward transitions][10]—Serle often goes directly from a conversation with McNaught-Davis to a bit of walk-and-talk narration delivered to the camera, and you can’t help but wonder whether McNaught-Davis is still standing there out of frame or what. But it meant that Serle could voice the concerns that the audience would surely have. He can look intimidated by a screenful of BASIC and can ask questions like, “What do all these dollar signs mean?” At several points during the show, Serle and McNaught-Davis sit down in front of a computer and essentially pair program, with McNaught-Davis providing hints here and there while Serle tries to figure it out. It would have been much less relatable if the show had been presented by a single, all-knowing narrator.
|
||||
|
||||
该节目也在努力展示计算在普通人生活中的实际应用。到80年代早期,家庭电脑已经开始与小孩子和电子游戏联系在一起。_计算机认知计划_ 的制作方试图避免采访“令人印象深刻的有能力的年轻人”,因为这可能会“加剧老年观众的焦虑”,而该节目正是试图吸引这一人群对计算感兴趣[7][11]。在该系列的第一集中,该节目的“现场”记者 Gill Nevill 采访了一名购买了一台 Commodore PET 电脑用于辅助管理她的糖果店的女性。这名名叫 Phyllis 的女性受访者看上去大约60多岁,她在使用 PET 完成她的会计工作上不存在任何问题,甚至开始使用 PET 为其他企业做计算工作,这听上去像是一个有前途的自由职业的开端。Phyllis 说她并不介意电脑工作逐步取代她的糖果店生意,因为她更喜欢电脑工作。画面接着变成了对一名青少年的采访,他介绍了他是如何修改 _[Breakout][T8]_ 这款电子游戏以使之运行更快并更具挑战性,不过这几乎鼓舞不了任何人。另一方面,如果人群中的 Phyllis 也会使用电脑,那么你当然也可以。
|
||||
|
||||
DN
|
||||
The show also made an effort to demonstrate the many practical applications of computing in the lives of regular people. By the early 1980s, the home computer had already begun to be associated with young boys and video games. The producers behind _The Computer Programme_ sought to avoid interviewing “impressively competent youngsters,” as that was likely “to increase the anxieties of older viewers,” a demographic that the show was trying to attract to computing.[7][11] In the first episode of the series, Gill Nevill, the show’s “on location” reporter, interviews a woman that has bought a Commodore PET to help manage her sweet shop. The woman (her name is Phyllis) looks to be 60-something years old, yet she has no trouble using the computer to do her accounting and has even started using her PET to do computer work for other businesses, which sounds like the beginning of a promising freelance career. Phyllis says that she wouldn’t mind if the computer work grew to replace her sweet shop business since she enjoys the computer work more. This interview could instead have been an interview with a teenager about how he had modified _Breakout_ to be faster and more challenging. But that would have been encouraging to almost nobody. On the other hand, if Phyllis, of all people, can use a computer, then surely you can too.
|
||||
|
||||
虽然该节目的特色是大量的 BASIC 编程,不过它实际想要教给观众的是计算机通常是如何工作的。该节目通过类比的方法解释了其中的一般原则。在第二集中有一个关于[Jacquard][T9]织机(译注:中文网络译为雅卡尔提布机)的讨论。Jacquard 织机实现了两件事。其一,它揭示了计算机并不仅仅基于过去发明的神秘技术——计算的一些基本原则可以上溯到两百年前,就跟你可以在纸上打孔来控制纺织机的想法一样简单。其二,经线与纬线的交织用于解释选择二进制(即纬线是从上方还是下方穿过经线)是如何在重复了一次又一次之后足以产生巨大变化的。当然,节目接下来继续讨论信息是如何使用二进制存储的。
|
||||
|
||||
DN
|
||||
While the show features lots of BASIC programming, what it really wants to teach its audience is how computing works in general. The show explains these general principles with analogies. In the second episode, there is an extended discussion of the Jacquard loom, which accomplishes two things. First, it illustrates that computers are not based only on magical technology invented yesterday—some of the foundational principles of computing go back two hundred years and are about as simple as the idea that you can punch holes in card to control a weaving machine. Second, the interlacing of warp and weft threads is used to demonstrate how a binary choice (does the weft thread go above or below the warp thread?) is enough, when repeated over and over, to produce enormous variation. This segues, of course, into a discussion of how information can be stored using binary digits.
|
||||
|
||||
在该节目中接下来是有关一件能够播放在一卷长长的分段的打孔卡片上编码的音乐的蒸汽风琴。这个类比用以解释 BASIC 中的子程序。Serle 与 McNaught-Davis 将整卷的打孔卡片摊开在工作室的地板上,然后指出看上去像是重复的副歌的分段。McNaught-Davis 解释说,如果你将这些重复的卡片分段剪下而插入一个回到第一次播放副歌的分段的指令,这就是子程序。这是一个绝妙的解释并将可能在听众的脑海中久久挥之不去。
|
||||
|
||||
DN
|
||||
Later in the show there is a section about a steam organ that plays music encoded in a long, segmented roll of punched card. This time the analogy is used to explain subroutines in BASIC. Serle and McNaught-Davis lay out the whole roll of punched card on the floor in the studio, then point out the segments where it looks like a refrain is being repeated. McNaught-Davis explains that a subroutine is what you would get if you cut out those repeated segments of card and somehow added an instruction to go back to the original segment that played the refrain for the first time. This is a brilliant explanation and probably one that stuck around in people’s minds for a long time afterward.
|
||||
|
||||
我仅仅摘录了一些例子,不过我认为总的来看该节目尤为擅长通过解释计算机实现功能所依赖的原则使计算机不再神秘。这一节目本可以致力于 BASIC 教学,不过它并没有这样做。这被证明是一个相当明智的选择。在1983年写就的一篇回忆文章中,_计算机认知计划_的总制作人 John Radcliffe 如是写道:
|
||||
|
||||
DN
|
||||
I’ve picked out only a few examples, but I think in general the show excels at demystifying computers by explaining the principles that computers rely on to function. The show could instead have focused on teaching BASIC, but it did not. This, it turns out, was very much a conscious choice. In a retrospective written in 1983, John Radcliffe, the executive producer of the _Computer Literacy Project_, wrote the following:
|
||||
|
||||
> 如果计算机将如我们所相信的那样重要,对这一主题的真正理解对每个人都很重要,可能会几乎与文字读写能力同等重要。不管是在我们这里还是在美国,在计算机认知的主要路线上的早期思路均集中于编程上。然而随着我们思想的发展,我们意识到“亲自”体验在个人计算机上的价值,我们开始降低对编程的重视,而更多的强调广泛的理解,将微型计算机与大型计算机联系起来,鼓励人们获取一系列应用程序与高级语言的经验,并将这些经验同现实世界中的工业与商业活动中的经验联系起来…… 我们相信一旦人们掌握了这些原则,简单地说,它们将可以进一步深入该主题。
|
||||
|
||||
DN
|
||||
> If computers were going to be as important as we believed, some genuine understanding of this new subject would be important for everyone, almost as important perhaps as the capacity to read and write. Early ideas, both here and in America, had concentrated on programming as the main route to computer literacy. However, as our thinking progressed, although we recognized the value of “hands-on” experience on personal micros, we began to place less emphasis on programming and more on wider understanding, on relating micros to larger machines, encouraging people to gain experience with a range of applications programs and high-level languages, and relating these to experience in the real world of industry and commerce…. Our belief was that once people had grasped these principles, at their simplest, they would be able to move further forward into the subject.
|
||||
|
||||
接下来, Radcliffe writes 又以类似的方式写道:
|
||||
|
||||
DN
|
||||
Later, Radcliffe writes, in a similar vein:
|
||||
|
||||
> 围绕着这一电视系列片的主要阐释目标有很多的争论。一个思想流派认为在使用微型计算机上的实用细节上给予建议对本项目而言尤为重要。但我们已经有了结论,如果这一电视系列片能够拥有可持续性的教育价值,它必须成为一条通过解释计算原则来进入真实的计算世界的路径。这必须通过对微型计算机的室内演示,通过类比方式解释其中的原则,真实生活中的实际应用的影片展示这三者的结合实现。不仅仅是微型计算机,小型机以及大型机也将被展示。
|
||||
|
||||
DN
|
||||
> There had been much debate about the main explanatory thrust of the series. One school of thought had argued that it was particularly important for the programmes to give advice on the practical details of learning to use a micro. But we had concluded that if the series was to have any sustained educational value, it had to be a way into the real world of computing, through an explanation of computing principles. This would need to be achieved by a combination of studio demonstration on micros, explanation of principles by analogy, and illustration on film of real-life examples of practical applications. Not only micros, but mini computers and mainframes would be shown.
|
||||
|
||||
我喜爱这一系列片,尤其是其中关于小型机与大型机的部分。_计算机认知计划_ 背后的制作方旨在帮助英国找准定位:计算身处何处又去向何方?计算机现在能做什么,未来又能做什么?学习一些 BASIC 语言是回答这些问题的一个部分,但是仅仅理解 BASIC 语言似乎是不足以使人们认知计算机的。
|
||||
|
||||
DN
|
||||
I love this, particularly the part about mini-computers and mainframes. The producers behind _The Computer Programme_ aimed to help Britons get situated: Where had computing been, and where was it going? What can computers do now, and what might they do in the future? Learning some BASIC was part of answering those questions, but knowing BASIC alone was not seen as enough to make someone computer literate.
|
||||
|
||||
### 今天的计算机认知
|
||||
|
||||
DN
|
||||
### Computer Literacy Today
|
||||
|
||||
如果你现在搜索“学习编程”,你看到的排在第一的是指向 Codecademy 网站的链接。
|
||||
If you google “learn to code,” the first result you see is a link to Codecademy’s website. If there is a modern equivalent to the _Computer Literacy Project_, something with the same reach and similar aims, then it is Codecademy.
|
||||
|
||||
“Learn to code” is Codecademy’s tagline. I don’t think I’m the first person to point this out—in fact, I probably read this somewhere and I’m now ripping it off—but there’s something revealing about using the word “code” instead of “program.” It suggests that the important thing you are learning is how to decode the code, how to look at a screen’s worth of Python and not have your eyes glaze over. I can understand why to the average person this seems like the main hurdle to becoming a professional programmer. Professional programmers spend all day looking at computer monitors covered in gobbledygook, so, if I want to become a professional programmer, I better make sure I can decipher the gobbledygook. But dealing with syntax is not the most challenging part of being a programmer, and it quickly becomes almost irrelevant in the face of much bigger obstacles. Also, armed only with knowledge of a programming language’s syntax, you may be able to _read_ code but you won’t be able to _write_ code to solve a novel problem.
|
||||
|
||||
I recently went through Codecademy’s “Code Foundations” course, which is the course that the site recommends you take if you are interested in programming (as opposed to web development or data science) and have never done any programming before. There are a few lessons in there about the history of computer science, but they are perfunctory and poorly researched. (Thank heavens for [this noble internet vigilante][12], who pointed out a particularly egregious error.) The main focus of the course is teaching you about the common structural elements of programming languages: variables, functions, control flow, loops. In other words, the course focuses on what you would need to know to start seeing patterns in the gobbledygook.
|
||||
|
||||
To be fair to Codecademy, they offer other courses that look meatier. But even courses such as their “Computer Science Path” course focus almost exclusively on programming and concepts that can be represented in programs. One might argue that this is the whole point—Codecademy’s main feature is that it gives you little interactive programming lessons with automated feedback. There also just isn’t enough room to cover more because there is only so much you can stuff into somebody’s brain in a little automated lesson. But the producers at the BBC tasked with kicking off the _Computer Literacy Project_ also had this problem; they recognized that they were limited by their medium and that “the amount of learning that would take place as a result of the television programmes themselves would be limited.”[8][13] With similar constraints on the volume of information they could convey, they chose to emphasize general principles over learning BASIC. Couldn’t Codecademy replace a lesson or two with an interactive visualization of a Jacquard loom weaving together warp and weft threads?
|
||||
|
||||
I’m banging the drum for “general principles” loudly now, so let me just explain what I think they are and why they are important. There’s a book by J. Clark Scott about computers called _But How Do It Know?_ The title comes from the anecdote that opens the book. A salesman is explaining to a group of people that a thermos can keep hot food hot and cold food cold. A member of the audience, astounded by this new invention, asks, “But how do it know?” The joke of course is that the thermos is not perceiving the temperature of the food and then making a decision—the thermos is just constructed so that cold food inevitably stays cold and hot food inevitably stays hot. People anthropomorphize computers in the same way, believing that computers are digital brains that somehow “choose” to do one thing or another based on the code they are fed. But learning a few things about how computers work, even at a rudimentary level, takes the homunculus out of the machine. That’s why the Jacquard loom is such a good go-to illustration. It may at first seem like an incredible device. It reads punch cards and somehow “knows” to weave the right pattern! The reality is mundane: Each row of holes corresponds to a thread, and where there is a hole in that row the corresponding thread gets lifted. Understanding this may not help you do anything new with computers, but it will give you the confidence that you are not dealing with something magical. We should impart this sense of confidence to beginners as soon as we can.
|
||||
|
||||
Alas, it’s possible that the real problem is that nobody wants to learn about the Jacquard loom. Judging by how Codecademy emphasizes the professional applications of what it teaches, many people probably start using Codecademy because they believe it will help them “level up” their careers. They believe, not unreasonably, that the primary challenge will be understanding the gobbledygook, so they want to “learn to code.” And they want to do it as quickly as possible, in the hour or two they have each night between dinner and collapsing into bed. Codecademy, which after all is a business, gives these people what they are looking for—not some roundabout explanation involving a machine invented in the 18th century.
|
||||
|
||||
The _Computer Literacy Project_, on the other hand, is what a bunch of producers and civil servants at the BBC thought would be the best way to educate the nation about computing. I admit that it is a bit elitist to suggest we should laud this group of people for teaching the masses what they were incapable of seeking out on their own. But I can’t help but think they got it right. Lots of people first learned about computing using a BBC Micro, and many of these people went on to become successful software developers or game designers. [As I’ve written before][14], I suspect learning about computing at a time when computers were relatively simple was a huge advantage. But perhaps another advantage these people had is shows like _The Computer Programme_, which strove to teach not just programming but also how and why computers can run programs at all. After watching _The Computer Programme_, you may not understand all the gobbledygook on a computer screen, but you don’t really need to because you know that, whatever the “code” looks like, the computer is always doing the same basic thing. After a course or two on Codecademy, you understand some flavors of gobbledygook, but to you a computer is just a magical machine that somehow turns gobbledygook into running software. That isn’t computer literacy.
|
||||
|
||||
_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][15] on Twitter or subscribe to the [RSS feed][16] to make sure you know when a new post is out._
|
||||
|
||||
_Previously on TwoBitHistory…_
|
||||
|
||||
> FINALLY some new damn content, amirite?
|
||||
>
|
||||
> Wanted to write an article about how Simula bought us object-oriented programming. It did that, but early Simula also flirted with a different vision for how OOP would work. Wrote about that instead!<https://t.co/AYIWRRceI6>
|
||||
>
|
||||
> — TwoBitHistory (@TwoBitHistory) [February 1, 2019][17]
|
||||
|
||||
1. Robert Albury and David Allen, Microelectronics, report (1979). [↩︎][18]
|
||||
|
||||
2. Gregg Williams, “Microcomputing, British Style”, Byte Magazine, 40, January 1983, accessed on March 31, 2019, <https://archive.org/stream/byte-magazine-1983-01/1983_01_BYTE_08-01_Looking_Ahead#page/n41/mode/2up>. [↩︎][19]
|
||||
|
||||
3. John Radcliffe, “Toward Computer Literacy,” Computer Literacy Project Achive, 42, accessed March 31, 2019, [https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards Computer Literacy.pdf][20]. [↩︎][21]
|
||||
|
||||
4. David Allen, “About the Computer Literacy Project,” Computer Literacy Project Archive, accessed March 31, 2019, <https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/history>. [↩︎][22]
|
||||
|
||||
5. ibid. [↩︎][23]
|
||||
|
||||
6. Williams, 51. [↩︎][24]
|
||||
|
||||
7. Radcliffe, 11. [↩︎][25]
|
||||
|
||||
8. Radcliffe, 5. [↩︎][26]
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://twobithistory.org/2019/03/31/bbc-micro.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]: tmp.zNBs2lK4Ca#fn:1
|
||||
[2]: tmp.zNBs2lK4Ca#fn:2
|
||||
[3]: tmp.zNBs2lK4Ca#fn:3
|
||||
[4]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/
|
||||
[5]: https://twobithistory.org/2018/07/22/dawn-of-the-microcomputer.html
|
||||
[6]: tmp.zNBs2lK4Ca#fn:4
|
||||
[7]: tmp.zNBs2lK4Ca#fn:5
|
||||
[8]: tmp.zNBs2lK4Ca#fn:6
|
||||
[9]: https://twobithistory.org/images/beeb.jpg
|
||||
[10]: https://twitter.com/TwoBitHistory/status/1112372000742404098
|
||||
[11]: tmp.zNBs2lK4Ca#fn:7
|
||||
[12]: https://twitter.com/TwoBitHistory/status/1111305774939234304
|
||||
[13]: tmp.zNBs2lK4Ca#fn:8
|
||||
[14]: https://twobithistory.org/2018/09/02/learning-basic.html
|
||||
[15]: https://twitter.com/TwoBitHistory
|
||||
[16]: https://twobithistory.org/feed.xml
|
||||
[17]: https://twitter.com/TwoBitHistory/status/1091148050221944832?ref_src=twsrc%5Etfw
|
||||
[18]: tmp.zNBs2lK4Ca#fnref:1
|
||||
[19]: tmp.zNBs2lK4Ca#fnref:2
|
||||
[20]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards%20Computer%20Literacy.pdf
|
||||
[21]: tmp.zNBs2lK4Ca#fnref:3
|
||||
[22]: tmp.zNBs2lK4Ca#fnref:4
|
||||
[23]: tmp.zNBs2lK4Ca#fnref:5
|
||||
[24]: tmp.zNBs2lK4Ca#fnref:6
|
||||
[25]: tmp.zNBs2lK4Ca#fnref:7
|
||||
[26]: tmp.zNBs2lK4Ca#fnref:8
|
||||
|
||||
[T1]: https://www.codecademy.com/
|
||||
[T2]: https://bbcmicro.computer/
|
||||
[T3]: https://clp.bbcrewind.co.uk/history
|
||||
[T4]: https://archive.org/details/byte-magazine?tab=about
|
||||
[T5]: https://www.bbc.co.uk/iplayer/episode/p01z4rrj/horizon-19771978-now-the-chips-are-down
|
||||
[T6]: https://archive.org/details/BBCHorizon19771978NowTheChipsAreDown
|
||||
[T7]: https://en.wikipedia.org/wiki/Sinclair_Research
|
||||
[T8]: https://en.wikipedia.org/wiki/Breakout_(video_game)
|
||||
[T9]: https://www.scienceandindustrymuseum.org.uk/objects-and-stories/jacquard-loom
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (Drwhooooo)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://opensource.com/article/21/3/rtos-embedded-development"
|
||||
[#]: author: "Alan Smithee https://opensource.com/users/alansmithee"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "cool-summer-021"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
@ -1,277 +0,0 @@
|
||||
[#]: subject: "Create a timer on Linux"
|
||||
[#]: via: "https://opensource.com/article/21/10/linux-timers"
|
||||
[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "FigaroCao"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Create a timer on Linux
|
||||
======
|
||||
A tutorial showing how to create a POSIX-compliant interval timer.
|
||||
![Team checklist][1]
|
||||
|
||||
The timing of certain events is a common task for a developer. Common scenarios for timers are watchdogs, cyclic execution of tasks, or scheduling events for a specific time. In this article, I show how to create a POSIX-compliant interval timer using [timer_create(...)][2].
|
||||
|
||||
You can download the source code for the following examples from [GitHub][3].
|
||||
|
||||
### Prepare Qt Creator
|
||||
|
||||
I used [Qt Creator][4] as the IDE for this example. To run and debug the example code in Qt Creator, clone the [GitHub][3] repository, open Qt Creator, and go to **File -> Open File or Project...** and choose the **CMakeLists.txt**:
|
||||
|
||||
![Qt Creator open project][5]
|
||||
|
||||
Open a project in Qt Creator (CC-BY-SA 4.0)
|
||||
|
||||
After selecting the toolchain, click on **Configure Project**. The project contains three independent examples (we will only cover two of them in this article). With the green-marked menu, switch between the configurations for each example and activate **Run in terminal** for each of them (see the yellow mark below). The currently active example for building and debugging can be selected over the **Debug** button on the bottom left corner (see the orange mark below):
|
||||
|
||||
![Project configuration][6]
|
||||
|
||||
Project configuration (CC-BY-SA 4.0)
|
||||
|
||||
### Threading timer
|
||||
|
||||
Let's take a look at the _simple_threading_timer.c_ example. This is the simplest one: It shows how an interval timer is created, which calls the function **expired** on expiration. On each expiration, a new thread is created in which the function **expiration** is called.
|
||||
|
||||
|
||||
```
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
void expired(union sigval timer_data);
|
||||
|
||||
pid_t gettid(void);
|
||||
|
||||
struct t_eventData{
|
||||
int myData;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
int res = 0;
|
||||
timer_t timerId = 0;
|
||||
|
||||
struct t_eventData eventData = { .myData = 0 };
|
||||
|
||||
/* sigevent specifies behaviour on expiration */
|
||||
struct sigevent sev = { 0 };
|
||||
|
||||
/* specify start delay and interval
|
||||
* it_value and it_interval must not be zero */
|
||||
|
||||
struct itimerspec its = { .it_value.tv_sec = 1,
|
||||
.it_value.tv_nsec = 0,
|
||||
.it_interval.tv_sec = 1,
|
||||
.it_interval.tv_nsec = 0
|
||||
};
|
||||
|
||||
[printf][7]("Simple Threading Timer - thread-id: %d\n", gettid());
|
||||
|
||||
sev.sigev_notify = SIGEV_THREAD;
|
||||
sev.sigev_notify_function = &expired;
|
||||
sev.sigev_value.sival_ptr = &eventData;
|
||||
|
||||
/* create timer */
|
||||
res = timer_create(CLOCK_REALTIME, &sev, &timerId);
|
||||
|
||||
if (res != 0){
|
||||
[fprintf][8](stderr, "Error timer_create: %s\n", [strerror][9](errno));
|
||||
[exit][10](-1);
|
||||
}
|
||||
|
||||
/* start timer */
|
||||
res = timer_settime(timerId, 0, &its, NULL);
|
||||
|
||||
if (res != 0){
|
||||
[fprintf][8](stderr, "Error timer_settime: %s\n", [strerror][9](errno));
|
||||
[exit][10](-1);
|
||||
}
|
||||
|
||||
[printf][7]("Press ETNER Key to Exit\n");
|
||||
while([getchar][11]()!='\n'){}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void expired(union sigval timer_data){
|
||||
struct t_eventData *data = timer_data.sival_ptr;
|
||||
[printf][7]("Timer fired %d - thread-id: %d\n", ++data->myData, gettid());
|
||||
}
|
||||
```
|
||||
|
||||
The advantage of this approach is its small footprint, in terms of code and simple debugging. The disadvantage is the additional overhead due to the creation of a new thread on expiration and, consequently, the less deterministic behavior.
|
||||
|
||||
### Interrupt Signal Timer
|
||||
|
||||
Another possibility to be notified by an expired timer is based on a [kernel signal][12]. Instead of creating a new thread each time the timer expires, the kernel sends a signal to the process, the process is interrupted, and the corresponding signal handler is called.
|
||||
|
||||
As the default action when receiving a signal is to terminate the process (see [signal][13] man page), we have to prepare Qt Creator in advance so that properly debugging is possible.
|
||||
|
||||
The default behavior of Qt Creator when the debuggee receives a signal is:
|
||||
|
||||
* Interrupt execution and switch to the debugger context.
|
||||
* Display a pop-up window that notifies the user about the reception of a signal.
|
||||
|
||||
|
||||
|
||||
Both actions are not wanted as the reception of a signal is part of our application.
|
||||
|
||||
Qt Creator uses GDB in the background. In order to prevent GDB from stopping the execution when the process receives a signal, go to **Tools** -> **Options**, select **Debugger**, and navigate to **Locals & Expressions**. Add the following expression to _Debugging Helper Customization_:
|
||||
|
||||
|
||||
```
|
||||
`handle SIG34 nostop pass`
|
||||
```
|
||||
|
||||
![Signal no stop with error][14]
|
||||
|
||||
Sig 34 no stop with error (CC-BY-SA 4.0)
|
||||
|
||||
You can find more information about GDB signal handling in the [GDB documentation][15].
|
||||
|
||||
Next, we want to suppress the pop-up window that notifies us every time a signal is received when we stop in the signal handler:
|
||||
|
||||
![Signal 34 pop up box][16]
|
||||
|
||||
Signal 34 pop-up box (CC-BY-SA 4.0)
|
||||
|
||||
To do so, navigate to the tab **GDB** and uncheck the marked checkbox:
|
||||
|
||||
![Timer signal windows][17]
|
||||
|
||||
Timer signal windows (CC-BY-SA 4.0)
|
||||
|
||||
Now you can properly debug the _signal_interrupt_timer_. The actual implementation of the signal timer is a bit more complex:
|
||||
|
||||
|
||||
```
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
static void handler(int sig, siginfo_t *si, void *uc);
|
||||
pid_t gettid(void);
|
||||
|
||||
struct t_eventData{
|
||||
int myData;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
int res = 0;
|
||||
timer_t timerId = 0;
|
||||
|
||||
struct sigevent sev = { 0 };
|
||||
struct t_eventData eventData = { .myData = 0 };
|
||||
|
||||
/* specifies the action when receiving a signal */
|
||||
struct sigaction sa = { 0 };
|
||||
|
||||
/* specify start delay and interval */
|
||||
struct itimerspec its = { .it_value.tv_sec = 1,
|
||||
.it_value.tv_nsec = 0,
|
||||
.it_interval.tv_sec = 1,
|
||||
.it_interval.tv_nsec = 0
|
||||
};
|
||||
|
||||
[printf][7]("Signal Interrupt Timer - thread-id: %d\n", gettid());
|
||||
|
||||
sev.sigev_notify = SIGEV_SIGNAL; // Linux-specific
|
||||
sev.sigev_signo = SIGRTMIN;
|
||||
sev.sigev_value.sival_ptr = &eventData;
|
||||
|
||||
/* create timer */
|
||||
res = timer_create(CLOCK_REALTIME, &sev, &timerId);
|
||||
|
||||
if ( res != 0){
|
||||
[fprintf][8](stderr, "Error timer_create: %s\n", [strerror][9](errno));
|
||||
[exit][10](-1);
|
||||
}
|
||||
|
||||
/* specifz signal and handler */
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sa.sa_sigaction = handler;
|
||||
|
||||
/* Initialize signal */
|
||||
sigemptyset(&sa.sa_mask);
|
||||
|
||||
[printf][7]("Establishing handler for signal %d\n", SIGRTMIN);
|
||||
|
||||
/* Register signal handler */
|
||||
if (sigaction(SIGRTMIN, &sa, NULL) == -1){
|
||||
[fprintf][8](stderr, "Error sigaction: %s\n", [strerror][9](errno));
|
||||
[exit][10](-1);
|
||||
}
|
||||
|
||||
/* start timer */
|
||||
res = timer_settime(timerId, 0, &its, NULL);
|
||||
|
||||
if ( res != 0){
|
||||
[fprintf][8](stderr, "Error timer_settime: %s\n", [strerror][9](errno));
|
||||
[exit][10](-1);
|
||||
}
|
||||
|
||||
[printf][7]("Press ENTER to Exit\n");
|
||||
while([getchar][11]()!='\n'){}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
handler(int sig, siginfo_t *si, void *uc)
|
||||
{
|
||||
UNUSED(sig);
|
||||
UNUSED(uc);
|
||||
struct t_eventData *data = (struct t_eventData *) si->_sifields._rt.si_sigval.sival_ptr;
|
||||
[printf][7]("Timer fired %d - thread-id: %d\n", ++data->myData, gettid());
|
||||
}
|
||||
```
|
||||
|
||||
In contrast to the threading timer, we have to initialize the signal and register a signal handler. This approach is more performant as it won't cause the creation of additional threads. For this reason, the execution of the signal handler is also more deterministic. The drawback is clearly the extra configuration effort to debug this properly.
|
||||
|
||||
### Summary
|
||||
|
||||
Both methods described in this article are close-to-the-kernel implementations of timers. Even if the [timer_create(...)][2] function is part of the POSIX specification, it is not possible to compile the sample code on a FreeBSD system due to small differences in data structures. Besides this drawback, such an implementation gives you fine-grained control for general-purpose timing applications.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/10/linux-timers
|
||||
|
||||
作者:[Stephan Avenwedde][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/hansic99
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist)
|
||||
[2]: https://linux.die.net/man/2/timer_create
|
||||
[3]: https://github.com/hANSIc99/posix_timers
|
||||
[4]: https://www.qt.io/product/development-tools
|
||||
[5]: https://opensource.com/sites/default/files/posix_timers_open_project_0.png
|
||||
[6]: https://opensource.com/sites/default/files/posix_timers_project_configuration_2.png
|
||||
[7]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html
|
||||
[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html
|
||||
[9]: http://www.opengroup.org/onlinepubs/009695399/functions/strerror.html
|
||||
[10]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html
|
||||
[11]: http://www.opengroup.org/onlinepubs/009695399/functions/getchar.html
|
||||
[12]: https://man7.org/linux/man-pages/man3/signal.3p.html
|
||||
[13]: https://linux.die.net/man/7/signal
|
||||
[14]: https://opensource.com/sites/default/files/posix_timers_sig34_nostop_pass.png
|
||||
[15]: https://sourceware.org/gdb/onlinedocs/gdb/Signals.html
|
||||
[16]: https://opensource.com/sites/default/files/posix_timers_sig34_pop_up_2.png
|
||||
[17]: https://opensource.com/sites/default/files/posix_timers_signal_windows.png
|
@ -1,185 +0,0 @@
|
||||
[#]: subject: "7 Reasons Why Cinnamon is a Fantastic (Yet Underrated) Linux Desktop Environment"
|
||||
[#]: via: "https://itsfoss.com/why-cinnamon/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
7 Reasons Why Cinnamon is a Fantastic (Yet Underrated) Linux Desktop Environment
|
||||
======
|
||||
|
||||
Linux Mint is one of my favorite distributions. The flagship (or default) Cinnamon desktop is why I like it so much.
|
||||
|
||||
The user experience offered by Cinnamon desktop may not be mind-blowing or fancy. But, the desktop environment provides enough reasons for users to like it and easily work with it to get things done.
|
||||
|
||||
At the end of the day, that’s what we want. A user interface that works as expected and does not get in the way.
|
||||
|
||||
I think Cinnamon desktop does a few things right to give you an exciting experience. Let me mention some of those here.
|
||||
|
||||
**If you did not know**, the Cinnamon desktop is a fork of the GNOME 3 created in **2011** by **Clement Lefebvre** (Linux Mint creator) with enhancements over the years.
|
||||
|
||||
### 1. Familiar User Interface
|
||||
|
||||
![linux mint 21 full][1]
|
||||
|
||||
The primary objective of building Cinnamon was to keep the GNOME 2 desktop style alive.
|
||||
|
||||
And that is why you get a familiar desktop layout compared to the most popular consumer desktop operating system, i.e., Windows.
|
||||
|
||||
Of course, Windows 11 has evolved its usual layout with time. But, accessing a start menu, a taskbar, system icons in the tray, and a couple of window decorations make it easy to grasp.
|
||||
|
||||
Whether you are a Windows user or a macOS user, the Cinnamon desktop layout should not feel challenging at all.
|
||||
|
||||
![linux mint welcome][2]
|
||||
|
||||
To help you further, the “**Welcome Screen**” in Linux Mint provides you with all the information quickly.
|
||||
|
||||
### 2. Lightweight
|
||||
|
||||
To get a comfortable experience with Cinnamon desktop (usually with Linux Mint), you have the following system requirements:
|
||||
|
||||
- 4 GB RAM
|
||||
- 100 GB of disk space
|
||||
- 1024×768 resolution screen
|
||||
|
||||
In the modern computing age, these specifications should suit almost everyone. So, you do not have to worry about needing an insane amount of memory or disk space to run a Linux distro powered by Cinnamon.
|
||||
|
||||
Of course, you can try [installing Cinnamon desktop on Ubuntu][3].
|
||||
|
||||
But, for this article, we consider Linux Mint as the ideal use case.
|
||||
|
||||
### 3. Fast Performance Without Sacrificing User Experience
|
||||
|
||||
When we think about a lightweight desktop environment—we usually imagine a bland user interface that focuses on performance.
|
||||
|
||||
![linux mint perf][4]
|
||||
|
||||
With Cinnamon desktop, that is not the case. It does include subtle animations and features icons/themes that make up for a modern look, if not the best.
|
||||
|
||||
It looks pleasing to the eyes with a minimal approach.
|
||||
|
||||
Typically, I am a sucker for pretty user interfaces, but I can still live with Linux Mint’s straightforward user experience running it on a dual-monitor setup (**1440p + 1080p**).
|
||||
|
||||
It may not be the best dual-monitor experience with Linux Mint Cinnamon edition (no dock/panel on the second screen for me). So, there is little room for improvement.
|
||||
|
||||
### 4. Default Customization Options
|
||||
|
||||
You might already know that KDE is probably the king when it comes to giving the ability to customize out-of-the-box.
|
||||
|
||||
We have super useful guides if you are curious about going that way:
|
||||
|
||||
- [KDE Customization Guide][5]
|
||||
- [How to Properly Theme KDE Plasma [In-depth Guide]][6]
|
||||
- [Best Gorgeous KDE Plasma Themes][7]
|
||||
|
||||
But, for many users, it is **overwhelming**.
|
||||
|
||||
I think Linux Mint gives the right amount of extra controls/customizations, which you also learn on its **Welcome Screen**.
|
||||
|
||||
![cinnamon theme customize][8]
|
||||
|
||||
Some of the elements that you can easily customize include:
|
||||
|
||||
- Desktop color (accent)
|
||||
- Light/Dark theme toggle
|
||||
- Panel layout
|
||||
- Icons, buttons, and mouse pointer.
|
||||
|
||||
You can head to the system settings and navigate to “Themes” to find the essential tweaks.
|
||||
|
||||
**Recommended Read:**[7 Ways to Customize Cinnamon Desktop on Linux][9]
|
||||
|
||||
### 5. Official Add-ons to Spice Up Your Experience
|
||||
|
||||
![cinnamon desklet][10]
|
||||
|
||||
Linux Mint supports various add-ons to enhance your experience. These are all part of its [Cinnamon Spices][11] offering. They include:
|
||||
|
||||
- Themes
|
||||
- Extensions
|
||||
- Applets
|
||||
- Desklets
|
||||
|
||||
Applets and Desklets are tiny programs that you can add on top of the panel (near the system tray) and the desktop, respectively.
|
||||
|
||||
![applet cinnamon][12]
|
||||
|
||||
You can manage system default applets or download more from the official repositories:
|
||||
|
||||
![applets cinnamon][13]
|
||||
|
||||
Similarly, you can add a Desklet from the available defaults or get a new one from the repositories.
|
||||
|
||||
![desklet cinnamon][14]
|
||||
|
||||
Plenty of valuable utilities to monitor system resources, check the weather, and more.
|
||||
|
||||
In addition, you get access to various themes built by the community that could easily give you a look you always wanted.
|
||||
|
||||
![cinnamon theme][15]
|
||||
|
||||
To complement all the above spices, you can use extensions to make the panel transparent, add a watermark to your desktop, enable windows tiling, and add some exciting window animations.
|
||||
|
||||
![linux mint extensions][16]
|
||||
|
||||
### 6. Compatible and Seamless User Experience
|
||||
|
||||
Why do I highlight the user experience again?
|
||||
|
||||
The best part about Cinnamon desktop is that it evolves in a way that respects and supports all functionalities.
|
||||
|
||||
For instance, if you want to install an app you enjoyed using on KDE Plasma, it should work the same way here. There’s nothing special with Cinnamon desktop that would break the experience.
|
||||
|
||||
![gnome accounts cinnamon][17]
|
||||
|
||||
Similarly, the desktop adds features that try to co-exist with services from other desktop environments. For instance, calendar events support using GNOME Online Accounts.
|
||||
|
||||
### 7. Panel Customization
|
||||
|
||||
![linux mint panel][18]
|
||||
|
||||
The dock, taskbar, or panel comprises an integral part of the user interface.
|
||||
|
||||
Yes, other desktop environments allow you to customize the same to some extent. With Cinnamon, you get a good amount of control to tweak it.
|
||||
|
||||
I think you get all the essential options a user would want.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
GNOME and KDE Plasma are popular desktop environments. However, Cinnamon is not far off on essential parts to provide an optimal user experience.
|
||||
|
||||
_What do you think of the Cinnamon desktop environment? Do you prefer to try it with Linux Mint? Share your thoughts in the comments section below._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/why-cinnamon/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://itsfoss.com/wp-content/uploads/2022/11/linux-mint-21-full.jpg
|
||||
[2]: https://itsfoss.com/wp-content/uploads/2022/11/linux-mint-welcome.png
|
||||
[3]: https://itsfoss.com/install-cinnamon-on-ubuntu/
|
||||
[4]: https://itsfoss.com/wp-content/uploads/2022/11/linux-mint-perf.png
|
||||
[5]: https://itsfoss.com/kde-customization/
|
||||
[6]: https://itsfoss.com/properly-theme-kde-plasma/
|
||||
[7]: https://itsfoss.com/best-kde-plasma-themes/
|
||||
[8]: https://itsfoss.com/wp-content/uploads/2022/11/cinnamon-theme-customize.png
|
||||
[9]: https://itsfoss.com/customize-cinnamon-desktop/
|
||||
[10]: https://itsfoss.com/wp-content/uploads/2022/11/cinnamon-desklet.png
|
||||
[11]: https://cinnamon-spices.linuxmint.com
|
||||
[12]: https://itsfoss.com/wp-content/uploads/2022/11/applet-cinnamon.png
|
||||
[13]: https://itsfoss.com/wp-content/uploads/2022/11/applets-cinnamon.png
|
||||
[14]: https://itsfoss.com/wp-content/uploads/2022/11/desklet-cinnamon.png
|
||||
[15]: https://itsfoss.com/wp-content/uploads/2022/11/cinnamon-theme.png
|
||||
[16]: https://itsfoss.com/wp-content/uploads/2022/11/linux-mint-extensions.png
|
||||
[17]: https://itsfoss.com/wp-content/uploads/2022/11/gnome-accounts-cinnamon.png
|
||||
[18]: https://itsfoss.com/wp-content/uploads/2022/11/linux-mint-panel.png
|
@ -1,139 +0,0 @@
|
||||
[#]: subject: "5 NeoVim GUI Editors You Could Try If You are Not a Total Terminal Junkie"
|
||||
[#]: via: "https://itsfoss.com/neovim-gui-editors/"
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
5 NeoVim GUI Editors You Could Try If You are Not a Total Terminal Junkie
|
||||
======
|
||||
|
||||
Vim is awesome. NeoVim is newer and even more awesome. Both Vim and NeoVim are terminal-based text editors with similar features.
|
||||
|
||||
If you are someone who is accustomed to using [GUI text editors like VS Code][1] and wish to have the similar functionality that NeoVim provides, you should explore GUI options.
|
||||
|
||||
Although I know you can use NeoVim as an add-on for your current text editor, working directly with NeoVim is much more effective and convenient for managing plugins.
|
||||
|
||||
There are a few different options available when choosing a NeoVim GUI, and I have put together a list of some of the best ones below.
|
||||
|
||||
### 1. Neovide
|
||||
|
||||
![neovide][2]
|
||||
|
||||
**Key Features:**
|
||||
|
||||
- Animated cursor
|
||||
- Smooth scrolling
|
||||
- Animated windows
|
||||
- Blurred floating windows
|
||||
- Emoji support
|
||||
|
||||
[Neovide][3] aims to be a no-nonsense graphical user interface for NeoVim.
|
||||
|
||||
While you won’t see many graphical elements, it only adds some GUI features, such as animations, using a library called Skulpin to render animations.
|
||||
|
||||
And my favorite part of using Neovide is having an animated cursor and smooth scrolling. I mean, have a look at this:
|
||||
|
||||
Looks cool. Right?
|
||||
|
||||
### 2. Neovim Qt
|
||||
|
||||
![neovim qt][4]
|
||||
|
||||
**Key Features:**
|
||||
|
||||
- Hover features
|
||||
- Multiple GUI tabs
|
||||
- Auto tab completion
|
||||
- Cross-platform support
|
||||
|
||||
As the name suggests, [Neovim Qt][5] is built with the Qt5 library, which you’ll often see being used by KDE. Nothing too fancy, adds some additional GUI features like multiple tabs, auto-tab completion, and more.
|
||||
|
||||
So if you are already using Qt5 libraries and want a minimal GUI for NeoVim, this would work like a charm and save you some dependencies.
|
||||
|
||||
**Recommended:**[Vim vs Nano: What Should You Choose?][6]
|
||||
|
||||
### 3. Uivonim
|
||||
|
||||
![uivonim][7]
|
||||
|
||||
**Key Features:**
|
||||
|
||||
- WebGL GPU rendering and multithreading
|
||||
- Support for VSCode extensions
|
||||
- Nyancat (ANSI-text program for classic cat animation)
|
||||
- Hover and code actions
|
||||
|
||||
[Uivonim][8] is a fork of Veonim (A simple IDE built on VSCode plugins and NeoVim) written in electron, making it the perfect choice if you switch from VSCode.
|
||||
|
||||
And the only goal of uivonim is to provide a rich NeoVim experience that supports the latest features of NeoVim, including floating windows, built-in LSP, and more. You do not need to rely on VSCode extensions to get these features.
|
||||
|
||||
[Uivonim][8]
|
||||
|
||||
### 4. FVim
|
||||
|
||||
![fvim][9]
|
||||
|
||||
**Key Features:**
|
||||
|
||||
- Detach windows (using `Ctrl+w and GE`).
|
||||
- Custom popup menu entry icons.
|
||||
- HiDPI support.
|
||||
- GPU acceleration.
|
||||
|
||||
[FVim][10] is a cross-platform GUI for NeoVim built with F# + Avalonia that comes with some groundbreaking features such as high-performance rendering (60FPS on 4K display).
|
||||
|
||||
And I often use the detach window feature as I prefer to have separate windows for different text files. Also, if you are an advanced remote user, FVim won’t let you down either.
|
||||
|
||||
### 5. Goneovim
|
||||
|
||||
![goneovim][11]
|
||||
|
||||
**Key Features:**
|
||||
|
||||
- Support for a terminal with bash and zsh
|
||||
- Minimap
|
||||
- Animated cursor
|
||||
- High DPI scaling
|
||||
- External float window
|
||||
|
||||
As its name suggests, [Goneovim][12] is written in GO and is a fork of Gonvim. And offers enough GUI features to get your job done such as an animated cursor, pixel scrolling, and more.
|
||||
|
||||
And it does not compromise on getting you basic text editing features, such as drag-and-drop support for text files.
|
||||
|
||||
**Useful Read**: [How to Install Latest Vim on Ubuntu Linux][13]
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
This was my take on what are some good options when it comes to GUI for NeoVim and I hope you found what you were looking for.
|
||||
|
||||
If I missed any of your favorites, let me know your thoughts in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/neovim-gui-editors/
|
||||
|
||||
作者:[Sagar Sharma][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sagar/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/
|
||||
[2]: https://itsfoss.com/wp-content/uploads/2022/11/neovide.png
|
||||
[3]: https://neovide.dev/index.html
|
||||
[4]: https://itsfoss.com/wp-content/uploads/2022/11/neovim-qt.png
|
||||
[5]: https://github.com/equalsraf/neovim-qt
|
||||
[6]: https://itsfoss.com/vim-vs-nano/
|
||||
[7]: https://itsfoss.com/wp-content/uploads/2022/11/uivonim.png
|
||||
[8]: https://github.com/smolck/uivonim
|
||||
[9]: https://itsfoss.com/wp-content/uploads/2022/11/fvim-1.png
|
||||
[10]: https://github.com/yatli/fvim
|
||||
[11]: https://itsfoss.com/wp-content/uploads/2022/11/goneovim-1.png
|
||||
[12]: https://github.com/akiyosi/goneovim
|
||||
[13]: https://itsfoss.com/install-latest-vim-ubuntu/
|
@ -1,127 +0,0 @@
|
||||
[#]: subject: "lnav: Advanced Log File Viewer for Linux Desktops and Servers"
|
||||
[#]: via: "https://www.debugpoint.com/advanced-log-file-viewer-lnav-ubuntu-linux/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
lnav: Advanced Log File Viewer for Linux Desktops and Servers
|
||||
======
|
||||
|
||||
**If you want to debug or troubleshoot any issues, you need an advanced log file viewer like lnav – which works wonders in the terminal for any Linux system.**
|
||||
|
||||
### lnav: Log file viewer
|
||||
|
||||
lnav can unzip all the compressed log files on the fly and merge them together for a nice display. The display is parsed and formatted based on the types of errors/warnings – this helps to quickly glance through the thousands of logs, especially in servers.
|
||||
|
||||
While analysing the logs, timestamps are very important. So lnav merges multiple logs based on timestamps, which is very helpful for tracking down system issues.
|
||||
|
||||
Most of the important log file format detection is built-in; see below:
|
||||
|
||||
- Common Web Access Log format
|
||||
- CUPS page_log
|
||||
- Syslog
|
||||
- Glog
|
||||
- VMware ESXi/vCenter Logs
|
||||
- dpkg.log
|
||||
- uwsgi
|
||||
- “Generic” – Any message that starts with a timestamp
|
||||
- Strace
|
||||
- sudo
|
||||
- GZIP, BZIP
|
||||
|
||||
That is not all; lnav is also capable of the below features, making it an important app for Linux systems.
|
||||
|
||||
- Filter messages based on regular expression
|
||||
- A timeline view of errors
|
||||
- Pretty-Print view- helps to reformat
|
||||
- Query Log using SQL
|
||||
- A log is updated in real-time while being searched.
|
||||
- Syntax highlight via regular expression (say you want to find out an IP address in the entire log)
|
||||
- Tab completion of any word from the log which is displayed !!
|
||||
|
||||
![lnav-running-in-ubutu][1]
|
||||
|
||||
To view the screenshots of the above features and learn more, visit [this page.][2]
|
||||
|
||||
### How to Install
|
||||
|
||||
This program is available in official Ubuntu, Debian repo. Install it using the following command.
|
||||
|
||||
```
|
||||
sudo apt install lnav
|
||||
```
|
||||
|
||||
And for Fedora, RHEL users, use the below command:
|
||||
|
||||
```
|
||||
sudo dnf install lnav
|
||||
```
|
||||
|
||||
Also the developers provides an offline standalone executable which you don’t need to install. You can download the zip from the [GitHub release page][3] and execute as:
|
||||
|
||||
```
|
||||
./lnav
|
||||
```
|
||||
|
||||
**Note**: It’s also available for macOS which you can find in the above GitHub page.
|
||||
|
||||
### lnav: How to use (Basics)
|
||||
|
||||
The simple command syntax is:
|
||||
|
||||
```
|
||||
lnav [options] [logfile1 logfile2 …]
|
||||
```
|
||||
|
||||
If you run just lnav from the command, it shows all the logs from your system (/var/log/messages and /var/log/syslog)
|
||||
|
||||
```
|
||||
lnav
|
||||
```
|
||||
|
||||
To view any specific log file, provide it via the command line:
|
||||
|
||||
```
|
||||
lnav /var/log/syslog
|
||||
```
|
||||
|
||||
Add timestamp in your log output using -t parameter
|
||||
|
||||
```
|
||||
lnav -t /var/log/syslog
|
||||
```
|
||||
|
||||
Here are some of the key switches of lnav
|
||||
|
||||
```
|
||||
-d file Write debug messages to the given file.-a Load all of the most recent log file types.-r Load older rotated log files as well.-t Prepend timestamps to the lines of data being read inon the standard input.-w file Write the contents of the standard input to this file.-c cmd Execute a command after the files have been loaded.-f path Execute the commands in the given file.-n Run without the curses UI. (headless mode)
|
||||
```
|
||||
|
||||
![lnav running in Ubuntu 22.04][4]
|
||||
|
||||
For further reading and exploration, visit the [official documentation][5].
|
||||
|
||||
[Next:How to Make LibreOffice Look Like Microsoft Office][6]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/advanced-log-file-viewer-lnav-ubuntu-linux/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2016/11/lnav-Running-in-Ubutu.png
|
||||
[2]: http://lnav.org/features/
|
||||
[3]: https://github.com/tstack/lnav/releases/
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2016/11/lnav-running-in-Ubuntu-22.04.jpg
|
||||
[5]: https://docs.lnav.org/en/latest/intro.html
|
||||
[6]: https://www.debugpoint.com/libreoffice-like-microsoft-office/
|
@ -1,185 +0,0 @@
|
||||
[#]: subject: "Top 5 Live Streaming Applications for Ubuntu and Other Linux [2022 Edition]"
|
||||
[#]: via: "https://www.debugpoint.com/live-streaming-applications-linux-2022/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Top 5 Live Streaming Applications for Ubuntu and Other Linux [2022 Edition]
|
||||
======
|
||||
|
||||
**This post lists the top five live streaming applications for Ubuntu Linux with features, highlights, download details, and comparison.**
|
||||
|
||||
It is the best time to incorporate online video content for your business. Why? Because research suggests that the global online video market is growing at a rate of ~20% per year.
|
||||
|
||||
And thanks to some excellent software from developers, it has become easy for anyone to create video content and stream them over several popular platforms such as YouTube and Twitch. If you think about it, you see you are consuming more video content today while online than text-based content.
|
||||
|
||||
So, in this post, we will list out some of the free software for Ubuntu and other Linux primarily that are easy to use for creating super interesting live streaming content for you and your businesses.
|
||||
|
||||
### Top 5 Live Streaming Applications for Linux in 2022
|
||||
|
||||
#### OBS Studio
|
||||
|
||||
The first free application in this list is OBS Studio (also known as Open Broadcaster Software). It is a live streaming application with screencasting capabilities available for Linux, Windows and macOS.
|
||||
|
||||
OBS Studio is the best one on this list because several reasons. The encoding is built-in, and it supports RTMP broadcasting, multiple sources, webcams, green-screen, capture cards and your application windows.
|
||||
|
||||
The user interface is reasonably straightforward and feature-rich. You can get help from third-party developed plugins to extend their functionalities, such as – mixing live tweets from Twitter on your streaming media while live streaming. However, OBS does not support multi-bitrate streaming.
|
||||
|
||||
![OBS Studio - Live Streaming Applications for Linux][1]
|
||||
|
||||
**How to Install**
|
||||
|
||||
OBS Studio is available in all Linux Distribution’s official repositories. Detailed instruction for installations is present in the below link.
|
||||
|
||||
[Download OBS Studio][2]
|
||||
|
||||
More Information
|
||||
|
||||
- [Home Page][3]
|
||||
- [Documentation][4]
|
||||
|
||||
#### VokoscreenNG
|
||||
|
||||
The second application we would feature in this list is VokoscreenNG. It is a fork of the discontinued Vokoscreen project. The new application is entirely written in Qt with the GStreamer library. It can record your screen and accept multiple audio and video sources. VokoscreenNG’s toolbox is also quite impressive. It includes a magnifying glass, timer, system tray plugins that ease up your workflow.
|
||||
|
||||
It is available for Linux and Windows for free.
|
||||
|
||||
![vokoscreenNG - Live Streaming Applications for Linux][5]
|
||||
|
||||
**How to Install**
|
||||
|
||||
You can download the compressed executable from the below link for Linux systems. Once downloaded, extract them. Then execute the binary to launch the application.
|
||||
|
||||
Remember, this application requires X11, PulseAudio and GStreamer plugins installed in your Linux system to work. If you use a modern Linux system with Wayland and Pipewire sound server (e.g. Fedora), this application may not work.
|
||||
|
||||
[Download VokoscreenNG][6]
|
||||
|
||||
**More Information**
|
||||
|
||||
- [Home page][7]
|
||||
|
||||
#### Restreamer
|
||||
|
||||
The Restreamer application lets you live stream videos and screencasts directly to your website without any streaming provider. It is also possible to use popular streaming solutions, such as YouTube, Twitch, etc., with this application.
|
||||
|
||||
This application is feature-rich and comes with a fair list of features. Here’s a quick peek at its features:
|
||||
|
||||
- H.264 streaming support
|
||||
- Built-in HTML5 video play
|
||||
- Available for Linux, macOS, Windows and as Docker images
|
||||
- Supports your own website plus YouTube, Twitchm, Facebook, Vimeo, Wowza and more
|
||||
- Multiple video source support – [IP Camera][8], USB Cameram or any H.2645 streams
|
||||
- Encoding and Audio source support
|
||||
- Snapshots as form of JPEG support in regular interval
|
||||
- Access stream status via JSON HTTP API for additional programming
|
||||
|
||||
![Restreamer][9]
|
||||
|
||||
**How to Install**
|
||||
|
||||
The installation of Restreamer is a little tricky because it’s distributed via Docker images. You can find the instructions to install Linux, Windows, and macOS on the below link.
|
||||
|
||||
[Download Restreamer][10]
|
||||
|
||||
**More Information**
|
||||
|
||||
- [Home Page][11]
|
||||
- [Documentation][12]
|
||||
- [Source Code][13]
|
||||
|
||||
#### ffscreencast
|
||||
|
||||
The ffscreencast is a command-line streaming application that uses the ffmpeg library. It leverages the power of ffmpeg and acts as a wrapper for it. Although it is available as a command line, you can use its powerful features, such as multiple sources and recordings devices, directly via the terminal. It supports multiple display setups as well. You can also overlay your camera feed on top of your desktop screencast.
|
||||
|
||||
![Open Streaming Platform - - Live Streaming Applications for Linux][14]
|
||||
|
||||
**How to Install**
|
||||
|
||||
To install this application, you need to clone the git repo and then copy the contents to /bin directory for the global execution of the `ffscreencast` command.
|
||||
|
||||
```
|
||||
git clone https://github.com/cytopia/ffscreencastcd ffscreencastsudo cp bin/ffscreencast /usr/local/bin
|
||||
```
|
||||
|
||||
You can run this application with `ffscreencast` command from the terminal.
|
||||
|
||||
[Source code & Home page][15]
|
||||
|
||||
#### Open Streaming platforms
|
||||
|
||||
The final application in this list is Open Streaming Platform (OSP), an open-source RTMP streamer software that can act as a self-hosted alternative to YouTube LIVE, Twitch.tv, etc.
|
||||
|
||||
This application is feature-rich and powerful when used correctly. Because of the below essential features:
|
||||
|
||||
- RTMP Streaming from an input source like Open Broadcast Software (OBS).
|
||||
- Multiple Channels per User, allowing a single user to broadcast multiple streams simultaneously without needing multiple accounts.
|
||||
- Video Stream Recording and On-Demand Playback.
|
||||
- Manual Video Uploading of MP4s that are sourced outside of OSP
|
||||
- Video Clipping – Create Shorter Videos of Notable Moments
|
||||
- Real-Time Chat Moderation by Channel Owners (Banning/Unbanning)
|
||||
- Admin-Controlled Adaptive Streaming
|
||||
- Protected Channels – Allow Access only to the audience you want.
|
||||
- Live Channels – Keep chatting and hang out when a stream isn’t on
|
||||
- Webhooks – Connect OSP to other services via fully customizable HTTP requests, which will pass information
|
||||
- Embed your stream or video directly into another web page easily
|
||||
- Share channels or videos via Facebook or Twitter quickly
|
||||
- Ability to Customize the UI as a Theme for your own personal look
|
||||
|
||||
**How to Install**
|
||||
|
||||
To install the Open Streaming Platform, follow the below page for detailed instructions.
|
||||
|
||||
[Download Open Streaming Platform][16]
|
||||
|
||||
**More Information**
|
||||
|
||||
- [Home Page][17]
|
||||
- [Source Code][18]
|
||||
- [Documentation][19]
|
||||
|
||||
### Closing Notes
|
||||
|
||||
There are very few free and open-source live streaming applications available for Linux. However, several commercial live streaming applications are available, which may give you more options, quality, and support. But as I said, they may cost you some bucks. So, if you are new to the streaming world, you may want to get started with the above-listed free live streaming applications in Ubuntu or other Linux systems. I hope this article gives you ideas about which to use based on your need and get you started.
|
||||
|
||||
Let me know your favourite live streaming software in the comment box below.
|
||||
|
||||
Cheers.
|
||||
|
||||
[Next:How to Create Ubuntu, Linux OS Bootable USB in Windows][20]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/live-streaming-applications-linux-2022/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2022/02/OBS-Studio.jpg
|
||||
[2]: https://obsproject.com/wiki/install-instructions#linux
|
||||
[3]: https://obsproject.com/
|
||||
[4]: https://obsproject.com/wiki/Home
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2022/02/vokoscreenNG.jpg
|
||||
[6]: https://linuxecke.volkoh.de/vokoscreen/vokoscreen-download.html
|
||||
[7]: https://linuxecke.volkoh.de/vokoscreen/vokoscreen.html
|
||||
[8]: https://www.debugpoint.com/2018/08/onvifviewer-internet-camera-viewer-for-linux/
|
||||
[9]: https://www.debugpoint.com/wp-content/uploads/2022/02/Restreamer.jpg
|
||||
[10]: https://datarhei.github.io/restreamer/docs/installation-index.html
|
||||
[11]: https://datarhei.github.io/restreamer/
|
||||
[12]: https://datarhei.github.io/restreamer/docs/index.html
|
||||
[13]: https://github.com/datarhei/restreamer
|
||||
[14]: https://www.debugpoint.com/wp-content/uploads/2022/02/Open-Streaming-Platform-2048x1026.jpg
|
||||
[15]: https://github.com/cytopia/ffscreencast
|
||||
[16]: https://wiki.openstreamingplatform.com/Install/Standard
|
||||
[17]: https://openstreamingplatform.com/
|
||||
[18]: https://gitlab.com/Deamos/flask-nginx-rtmp-manager
|
||||
[19]: https://wiki.openstreamingplatform.com/
|
||||
[20]: https://www.debugpoint.com/how-to-create-ubuntu-linux-os-bootable-usb-in-windows/
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://news.itsfoss.com/new-distros-2023/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "Cubik65536"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
@ -216,7 +216,7 @@ via: https://news.itsfoss.com/new-distros-2023/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[Cubik65536](https://github.com/Cubik65536)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,222 +0,0 @@
|
||||
[#]: subject: "oh my zsh and powerlevel10k: A Match Made in Heaven"
|
||||
[#]: via: "https://www.debugpoint.com/oh-my-zsh-powerlevel10k/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
oh my zsh and powerlevel10k: A Match Made in Heaven
|
||||
======
|
||||
|
||||
**A quick and simple guide to transforming your zsh terminal shell with oh my zsh and powerlevel10k theme to make it look cool in Ubuntu and other Linux distros.**
|
||||
|
||||
![][1]
|
||||
|
||||
The default shell in most of the Linux distributions is bash. Bash is solid and a legacy utility. However, it lacks some customizations, such as nice colours, cursor support, etc.
|
||||
|
||||
You can use another shell, zsh to enjoy additional tweaks and help you to extend your Bash shell experience.
|
||||
|
||||
This crisp guide explains how to install zsh, oh my zsh and apply the powerlevel10k theme.
|
||||
|
||||
### oh my zsh and powerlevel10k: Installation and configuration guide
|
||||
|
||||
#### 1. Installing zsh and changing the shell
|
||||
|
||||
Open a terminal and install zsh using the following command applicable to your distribution.
|
||||
|
||||
**_Ubuntu, Debian, Linux Mint and all related distro_**
|
||||
|
||||
```
|
||||
sudo apt install zsh
|
||||
```
|
||||
|
||||
_**Fedora**_
|
||||
|
||||
```
|
||||
sudo dnf install zsh
|
||||
```
|
||||
|
||||
**_Arch_**
|
||||
|
||||
```
|
||||
pacman -S zsh
|
||||
```
|
||||
|
||||
After installation is complete, find out the zsh install path
|
||||
|
||||
```
|
||||
whereis zsh
|
||||
```
|
||||
|
||||
Then change the shell using the zsh executable path for the current user.
|
||||
|
||||
```
|
||||
chsh -s /usr/bin/zsh <username>
|
||||
```
|
||||
|
||||
![change the shell for the current user][2]
|
||||
|
||||
Close and open the terminal again. And you should see the first-time setup for zsh. Select option 2. And it will change the look of your shell prompt with a default theme, as shown below.
|
||||
|
||||
![first time setup for zsh][3]
|
||||
|
||||
#### 2. Install oh my zsh
|
||||
|
||||
The oh my zsh is a set of scripts to customize zsh further.
|
||||
|
||||
Firstly, we will install oh my zsh script by downloading it from GitHub. It would be best if you had wget and git package for that. [Install wget][4] & git using the following command if it’s not installed.
|
||||
|
||||
```
|
||||
sudo apt install wget
|
||||
sudo apt install git
|
||||
```
|
||||
|
||||
Then install oh my zsh using the following command.
|
||||
|
||||
```
|
||||
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
```
|
||||
|
||||
And you should see the oh my zsh theme is applied with a default theme robbyrussell to your terminal.
|
||||
|
||||
![Install oh my zsh and default theme][5]
|
||||
|
||||
The Oh my zsh also comes with additional themes, and you can install them [using this guide][6]. However, in this tutorial, I will talk about a specific theme, i.e. powerlevel10k.
|
||||
|
||||
#### 3. Install powerlevel10k theme for oh my zsh
|
||||
|
||||
Open a terminal and run the following command to clone powerlevel10k repo from GitHub and put the files in the config folder of oh my zsh.
|
||||
|
||||
```
|
||||
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
|
||||
```
|
||||
|
||||
Open the `~/.zshrc` file in a text editor and set the `ZSH_THEME` variable to `"powerlevel10k/powerlevel10k"`.
|
||||
|
||||
```
|
||||
cd ~
|
||||
```
|
||||
|
||||
```
|
||||
nano .zshrc
|
||||
```
|
||||
|
||||
By default, it should be robbyrussell. Remove “robbyrussell” and add the below `"powerlevel10k/powerlevel10k"`.
|
||||
|
||||
Your `~/.zshrc` file should look something like this after the change:
|
||||
|
||||
`ZSH_THEME="powerlevel10k/powerlevel10k"`
|
||||
|
||||
Save and close the file (CTRL+O, ENTER and CTRL+X).
|
||||
|
||||
![change oh my zsh theme to powerlevel10k][7]
|
||||
|
||||
Restart your terminal to launch the first-time wizard to set up the powerlevel10k theme.
|
||||
|
||||
#### 4. First time set up for powerleve10k
|
||||
|
||||
When you launch the terminal after the installation, the powerlevel10k prompts you with various questions to understand your Linux distro setup. So, press the key as per your need to customize your terminal as per your taste. Some example screenshots of questions are below to give you some idea.
|
||||
|
||||
![powerlevel10k - wizard1][8]
|
||||
|
||||
![powerlevel10k - wizard 2][9]
|
||||
|
||||
And finally, you can save the file to enjoy the new look of your terminal.
|
||||
|
||||
![After applying settings in powerlevel10k zsh theme][10]
|
||||
|
||||
If you want to restart the configuration wizard again, run the following. You can do it as many times as you want.
|
||||
|
||||
```
|
||||
p10k configure
|
||||
```
|
||||
|
||||
This concludes the basic setup. If you want more, follow along.
|
||||
|
||||
### More configuration (advanced usage)
|
||||
|
||||
#### 5. Installing dracula GNOME Terminal theme
|
||||
|
||||
If you are using GNOME desktop with the native terminal, you can try the stunning drakula theme. To do that, open a terminal and run the following command to download the theme.
|
||||
|
||||
```
|
||||
git clone https://github.com/dracula/gnome-terminalcd gnome-terminal
|
||||
```
|
||||
|
||||
Open GNOME Terminal and go to preferences. Add a new profile by clicking on the [+] and name it “drakula”. Then go to colours tab and uncheck ‘use colors from system theme’ option.
|
||||
|
||||
![create a new profile for terminal][11]
|
||||
|
||||
Go back to the terminal and run the following. When prompted, select the profile name which you just created as above.
|
||||
|
||||
```
|
||||
./install.sh
|
||||
```
|
||||
|
||||
![applying the drakula theme for gnome terminal][12]
|
||||
|
||||
Once the installation is complete, go back to preferences and mark the drakula profile as default.
|
||||
|
||||
#### 6. Autocomplete and syntax highlighting for zsh
|
||||
|
||||
There are two community-developed plugins available for zsh, which you may want to try out. They are zsh-autosuggestions and zsh-syntax-highlighting.
|
||||
|
||||
Open a terminal and run the following to download zsh-autosuggestions and put it inside the plugin folder.
|
||||
|
||||
```
|
||||
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
|
||||
```
|
||||
|
||||
Similarly, run the following for the syntax highlighting plugin.
|
||||
|
||||
```
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
|
||||
```
|
||||
|
||||
Open the ~/.zshrc file via a text editor (use the following command), and find the plugins=(git) line. And replace it with the following:
|
||||
|
||||
```
|
||||
nano ~/.zshrc
|
||||
```
|
||||
|
||||
```
|
||||
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
|
||||
```
|
||||
|
||||
Save & close the file using CTRL+O, ENTER and CTRL+X.
|
||||
|
||||
Close and open your terminal; now, you should be able to use the auto-suggestions and syntax highlighting.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
That’s it! You should now have “Oh My Zsh” and the Powerlevel10k theme installed on your system. You can customize the appearance and behaviour of the Powerlevel10k theme by customizing further as per your need.
|
||||
|
||||
Cheers.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/oh-my-zsh-powerlevel10k/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2022/12/ohp10k.jpg
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2022/12/change-the-shell-for-the-current-user.jpg
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2022/12/first-time-setup-for-zsh.jpg
|
||||
[4]: https://www.debugpoint.com/wget-not-found-error/
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2022/12/Install-oh-my-zsh-and-default-theme.jpg
|
||||
[6]: https://www.debugpoint.com/install-use-zsh/
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2022/12/change-oh-my-zsh-theme-to-powerlevel10k.jpg
|
||||
[8]: https://www.debugpoint.com/wp-content/uploads/2022/12/powerlevel10k-wizard1.jpg
|
||||
[9]: https://www.debugpoint.com/wp-content/uploads/2022/12/powerlevel10k-wizard-2.jpg
|
||||
[10]: https://www.debugpoint.com/wp-content/uploads/2022/12/After-applying-settings-in-powerlevel10k-zsh-theme.jpg
|
||||
[11]: https://www.debugpoint.com/wp-content/uploads/2022/12/create-a-new-profile-for-terminal.jpg
|
||||
[12]: https://www.debugpoint.com/wp-content/uploads/2022/12/applying-the-drakula-theme-for-gnome-terminal.jpg
|
@ -1,110 +0,0 @@
|
||||
[#]: subject: "How to read and write files in Rust"
|
||||
[#]: via: "https://opensource.com/article/23/1/read-write-files-rust"
|
||||
[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to read and write files in Rust
|
||||
======
|
||||
|
||||
Knowing how to read and write files can be useful for various purposes. In Rust, this task is done using the file system module ([std::fs][1]) in the standard library. In this article, I'll give you an overview on how to use this module.
|
||||
|
||||
To demonstrate this task, I prepared example code which is also available on [GitHub][2].
|
||||
|
||||
### Preparation
|
||||
|
||||
When using Rust, a function that fails returns the [Result][3] type. The file system module in particular returns the specialized type [std::io::Result<T, Error>][4]. With this knowledge, you can return the same type from the `main()` function:
|
||||
|
||||
```
|
||||
fn main() -> std::io::Result<()> {
|
||||
/* ...code comes here... */
|
||||
```
|
||||
|
||||
### Writing Rust files
|
||||
|
||||
Performing file I/O-operations in Rust is relatively easy. Writing to a file can be simplified to one line:
|
||||
|
||||
```
|
||||
use std::fs;
|
||||
fs::write("favorite_websites.txt", b"opensource.com")?;
|
||||
Ok(())
|
||||
```
|
||||
|
||||
Using the error propagation operator `(?)`, the error information gets passed on to the calling function where the error can subsequently be handled. As `main()` is the only other function in the call stack, the error information gets passed on to the console output in case the write operation failed.
|
||||
|
||||
The syntax of the [fs::write][5] function is quite forward. The first argument is the file path, which must be the type [std::path::Path][6]. The second argument is the content, which is actually a slice of bytes (`[u8]`). Rust converts the arguments passed into the correct type. Luckily, these types are basically the only types dealt with in the following examples.
|
||||
|
||||
A more concise access of the write operation can be achieved using the file descriptor type [std::fs::File][7]:
|
||||
|
||||
```
|
||||
let mut file = fs::File::create("favorite_websites.txt")?;
|
||||
file.write_all(b"opensource.com\n")?;
|
||||
Ok(())
|
||||
```
|
||||
|
||||
As the file type implements the [Write][8] trait, it is possible to use the associated methods to write to the file. However, the `create` method can overwrite an already existing file.
|
||||
|
||||
To get even more control of the file descriptor, the type [std::fs::OpenOptions][9] must be used. This provides opening modes similar to the ones in other languages:
|
||||
|
||||
```
|
||||
let mut file = fs::OpenOptions::new()
|
||||
.append(true)
|
||||
.open("favorite_websites.txt")?;
|
||||
|
||||
file.write_all(b"sourceforge.net\n")?;
|
||||
```
|
||||
|
||||
### Reading Rust files
|
||||
|
||||
What applies to writing also applies to reading. Reading can also be done with a simple one-line of code:
|
||||
|
||||
```
|
||||
let websites = fs::read_to_string("favorite_websites.txt")?;
|
||||
```
|
||||
|
||||
The above line reads the content of the file and returns a string. In addition to reading a string, there is also the [std::fs::read][10] function which reads the data into a vector of bytes if the file contains binary data.
|
||||
|
||||
The next example shows how to read the content of the file into memory and subsequently print it line by line to a console:
|
||||
|
||||
```
|
||||
let file = fs::File::open("favorite_websites.txt")?;
|
||||
let lines = io::BufReader::new(file).lines();
|
||||
|
||||
for line in lines {
|
||||
if let Ok(_line) = line {
|
||||
println!(">>> {}", _line);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Summary
|
||||
|
||||
If you are already familiar with other programming languages, you may have noticed that there is `no close-`function (or something similar) that releases the file handle. In Rust, the file handle is released as soon as the related variable goes out of scope. To define the closing behavior, a scope `({ })` around the file representation can be applied. I recommend that you get familiar with [Read][11] and [Write][8] trait as you can find this trait implemented in many other types.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/1/read-write-files-rust
|
||||
|
||||
作者:[Stephan Avenwedde][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/hansic99
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://doc.rust-lang.org/std/fs/
|
||||
[2]: https://github.com/hANSIc99/rust_file_io
|
||||
[3]: https://doc.rust-lang.org/std/result/enum.Result.html
|
||||
[4]: https://doc.rust-lang.org/std/io/type.Result.html
|
||||
[5]: https://doc.rust-lang.org/std/fs/fn.write.html
|
||||
[6]: https://doc.rust-lang.org/std/path/struct.Path.html
|
||||
[7]: https://doc.rust-lang.org/std/fs/struct.File.html
|
||||
[8]: https://doc.rust-lang.org/std/io/trait.Write.html
|
||||
[9]: https://doc.rust-lang.org/std/fs/struct.OpenOptions.html#
|
||||
[10]: https://doc.rust-lang.org/std/fs/fn.read.html
|
||||
[11]: https://doc.rust-lang.org/std/io/trait.Read.html
|
@ -1,138 +0,0 @@
|
||||
[#]: subject: "who Command in Linux: Explanation with Examples"
|
||||
[#]: via: "https://www.debugpoint.com/who-command-linux/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
who Command in Linux: Explanation with Examples
|
||||
======
|
||||
|
||||
**Here’s a beginner’s guide on understanding who command in Linux with several examples.**
|
||||
|
||||
_This article is part of the [Linux command][1] learning series._
|
||||
|
||||
### who command
|
||||
|
||||
The “who” command in Linux is used to display information about users who are currently logged in to the system. It shows the user’s login name, the terminal from which the user is logged in, the time at which the user logged in, and the remote hostname (if applicable).
|
||||
|
||||
#### Syntax
|
||||
|
||||
Here is the basic syntax for the “who” command:
|
||||
|
||||
```
|
||||
who [OPTION]... [ FILE | ARG1 ARG2 ]
|
||||
```
|
||||
|
||||
### Example of various who command and switches
|
||||
|
||||
By default, “who” reads the file `/var/run/utmp`, which contains information about users who are currently logged in. If no options are specified, it displays each user’s login name, terminal, and time of login.
|
||||
|
||||
```
|
||||
who
|
||||
```
|
||||
|
||||
It gives the following output. As you can see it shows the login name=debugpoint, terminal id tty2 and the date and time of the login.
|
||||
|
||||
```
|
||||
debugpoint tty2 2023-01-01 11:22 (tty2)
|
||||
```
|
||||
|
||||
![who command - default example][2]
|
||||
|
||||
However, if you run the above command in a guest virtual machine, you should see the same but the terminal id would be the x11 server display name i.e. :0.
|
||||
|
||||
```
|
||||
❯ whodebugpoint :0 2023-01-01 23:36 (:0)
|
||||
```
|
||||
|
||||
To show the username of the current user and information, use below:
|
||||
|
||||
```
|
||||
whoami
|
||||
```
|
||||
|
||||
View the last system boot time using the -b option:
|
||||
|
||||
```
|
||||
❯ who -bsystem boot 2023-01-01 23:36
|
||||
```
|
||||
|
||||
Display the count of users logged in the current system:
|
||||
|
||||
```
|
||||
❯ who -qdebugpointusers=1
|
||||
```
|
||||
|
||||
All the above command when paired with -H option, you get a better info with a header line, like below:
|
||||
|
||||
```
|
||||
who -H
|
||||
|
||||
NAME LINE TIME COMMENT
|
||||
debugpoint tty2 2023-01-01 11:22 (tty2)
|
||||
```
|
||||
|
||||
If you want to display all the information related to who command in Linux, use the option -a:
|
||||
|
||||
```
|
||||
who -aH
|
||||
|
||||
NAME LINE TIME IDLE PID COMMENT EXIT
|
||||
system boot 2023-01-01 11:19
|
||||
run-level 5 2023-01-01 11:19
|
||||
debugpoint + tty2 2023-01-01 11:22 13:26 2042 (tty2)
|
||||
```
|
||||
|
||||
As always, you can save the output of the who command to any file using the redirect as below:
|
||||
|
||||
```
|
||||
who > user_details.txt
|
||||
```
|
||||
|
||||
#### Example summary of who command options
|
||||
|
||||
Here are some who command examples and their explanation:
|
||||
|
||||
Here are some options that can be used with the “who” command:
|
||||
|
||||
- `-a`: Display the hostname, time of login, and processes for each user
|
||||
- `-b`: Display the time of the last system boot
|
||||
- `-d`: Display dead processes (processes that have terminated but have not been removed from the utmp file)
|
||||
- `-H`: Display a header line
|
||||
- `-l`: Display login processes in long format
|
||||
- `-m`: Display only the name and line of the user who is logged in on the terminal specified by `ARG1 ARG2`
|
||||
- `-q`: Display a count of logged in users
|
||||
- `-u`: Display information about users who have processes that are not detached
|
||||
- `-w`: Display information about users who are logged in, in the same format as the utmp file
|
||||
|
||||
### Closing Notes
|
||||
|
||||
I hope this article helps you to understand who command and its basics. You can also read the [who man pages][3] to learn more. Let me know if you have any questions.
|
||||
|
||||
**This article is part of the [Linux command][1] learning series**.
|
||||
|
||||
[Next:How to Force Auto Dark Mode in Chrome and Chromium][4]
|
||||
|
||||
[_Using Mastodon? Follow us at floss.social/@debugpoint_][5]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/who-command-linux/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/category/linux-commands
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2023/01/who-command-default-example.jpg
|
||||
[3]: https://man7.org/linux/man-pages/man1/who.1.html
|
||||
[4]: https://www.debugpoint.com/chrome-dark-mode/
|
||||
[5]: https://floss.social/@debugpoint
|
@ -1,106 +0,0 @@
|
||||
[#]: subject: "Colorblind Filters: GNOME Extension to help Colorblind Users"
|
||||
[#]: via: "https://www.debugpoint.com/colorblind-filters-gnome-extension/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Colorblind Filters: GNOME Extension to help Colorblind Users
|
||||
======
|
||||
|
||||
**A nice GNOME Extension – Colorblind Filters, brings many options for color-blind users.**
|
||||
|
||||
Accessibility is a critical aspect of computing and operating systems. It includes well-managed settings for vision impairment, color blind and many other health symptoms. Popular Linux desktop environments such as GNOME and KDE Plasma feature accessibility settings to help all those scenarios.
|
||||
|
||||
Thanks to the GNOME Extensions ecosystem, a huge number of specialised extensions are available to aid those users. One of the extensions I came across is [“Colorblind Filters”][1].
|
||||
|
||||
### Colorblind Filters – GNOME Extension
|
||||
|
||||
As per Wikipedia, _“Colour blindness usually involves the inability to distinguish between shades of red and green. There is no treatment for inherited colour blindness. If colour blindness is caused by another condition, treating the underlying cause can help.”_.
|
||||
|
||||
So, it’s important that you have options to tweak settings on your Linux desktop.
|
||||
|
||||
#### Set up extensions and flatpak
|
||||
|
||||
First, make sure you have Flatpak and GNOME Extensions enabled. And the Extensions manager is installed. You may refer to this detailed guide on how to [set up flatpak][2] & enable [GNOME extensions][3], Or run the following commands (for Ubuntu, Linux Mint, etc.) from the terminal.
|
||||
|
||||
```
|
||||
sudo apt install flatpaksudo apt install gnome-software-plugin-flatpakflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakreporeboot
|
||||
```
|
||||
|
||||
Fedora users, use the below commands.
|
||||
|
||||
```
|
||||
sudo dnf install flatpaksudo dnf install gnome-software-plugin-flatpakflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakreporeboot
|
||||
```
|
||||
|
||||
Once done, install the Extension Manager:
|
||||
|
||||
```
|
||||
flatpak install com.mattjakeman.ExtensionManager
|
||||
```
|
||||
|
||||
#### Install the Extension
|
||||
|
||||
Open the extension manager from the application menu. Search for “colorblind”. And install the extension (see the below image).
|
||||
|
||||
![Install the extension][4]
|
||||
|
||||
After installation, you can see a small eye icon on the system tray. You can click on it to enable the pre-defined color filters.
|
||||
|
||||
![Colorblind Filters extension tray icon][5]
|
||||
|
||||
Right-click on the eye icon for more settings. This extension brings all the necessary customizations for colorblind collections, simulations and additional options. The following options are currently available:
|
||||
|
||||
- Protanopia
|
||||
- Deuteranopia
|
||||
- Tritanopia
|
||||
|
||||
- Corrections & Simulations (with high contrast)
|
||||
|
||||
- Channel mixer for GBR and BRG
|
||||
- Lightness inversion
|
||||
- Color Inversion
|
||||
|
||||
- Additional tweaks
|
||||
|
||||
![Colorblind Filters - options][6]
|
||||
|
||||
Use the one that suits you best for your eye.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
I think Apple’s macOS and iOS have implemented better accessibility than Windows or Linux. However, Linux Desktops are not far behind with these apps and extensions. Also, there are specialized Linux distributions such as “[Accessible Coconut][7]“, which has been built for specialized needs.
|
||||
|
||||
I hope Colorblind gnome extension helps you with your day-to-day usage of Linux and GNOME desktops.
|
||||
|
||||
Cheers.
|
||||
|
||||
[Next:Top 10 Linux Distributions for Windows Users in 2023][8]
|
||||
|
||||
[_Using Mastodon? Follow us at floss.social/@debugpoint_][9]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/colorblind-filters-gnome-extension/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://extensions.gnome.org/extension/5589/colorblind-filters/
|
||||
[2]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/
|
||||
[3]: https://www.debugpoint.com/how-to-install-and-use-gnome-shell-extensions-in-ubuntu/
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2023/01/Install-the-extension.jpg
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Colorblind-Filters-extension-tray-icon.gif
|
||||
[6]: https://www.debugpoint.com/wp-content/uploads/2023/01/Colorblind-Filters-options.jpg
|
||||
[7]: https://www.debugpoint.com/accessible-coconut-linux-visually-impaired/
|
||||
[8]: https://www.debugpoint.com/best-linux-distributions-windows/
|
||||
[9]: https://floss.social/@debugpoint
|
@ -1,152 +0,0 @@
|
||||
[#]: subject: "Whereis Command in Linux and BSD with Examples"
|
||||
[#]: via: "https://www.debugpoint.com/whereis-command-linux/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Whereis Command in Linux and BSD with Examples
|
||||
======
|
||||
|
||||
**Here’s a beginner’s guide on understanding whereis command in Linux & BSD with several examples.**
|
||||
|
||||
![][1]
|
||||
|
||||
_This article is part of the [Linux command][2] learning series._
|
||||
|
||||
### whereis command
|
||||
|
||||
The `whereis` command is a command line program that helps you to find out the path or location of any binary executable, source file or manual page.
|
||||
|
||||
Before we show you how to use `whereis` command, let’s look at the syntax.
|
||||
|
||||
### Syntax
|
||||
|
||||
Here’s the syntax for whereis command:
|
||||
|
||||
```
|
||||
whereis [OPTIONS] FILE_NAME
|
||||
```
|
||||
|
||||
The argument of whereis command is the program name or file name you want to search. The argument is mandatory.
|
||||
|
||||
By default, it searches for the program in the path defined in environment variables such as HOME, USER, SHELL, etc.
|
||||
|
||||
Let’s take a look at some examples.
|
||||
|
||||
### Examples of whereis command in Linux and BSD
|
||||
|
||||
A simple example of whereis command is below where I am trying to search firefox. In the output below, you can see the list of paths containing firefox files or executables displayed.
|
||||
|
||||
```
|
||||
$ whereis firefox
|
||||
|
||||
firefox: /usr/bin/firefox /usr/lib64/firefox /etc/firefox /usr/share/man/man1/firefox.1.gz
|
||||
```
|
||||
|
||||
![Simple example of whereis command in Linux][3]
|
||||
|
||||
The command with option -l displays the list of paths where it searches. For example:
|
||||
|
||||
```
|
||||
$ whereis -l
|
||||
|
||||
bin: /usr/bin
|
||||
bin: /usr/sbin
|
||||
bin: /usr/lib
|
||||
bin: /usr/lib64
|
||||
bin: /etc
|
||||
bin: /usr/games
|
||||
bin: /usr/local/bin
|
||||
bin: /usr/local/sbin
|
||||
bin: /usr/local/etc
|
||||
bin: /usr/local/lib
|
||||
bin: /usr/local/games
|
||||
```
|
||||
|
||||
If the whereis command doesn’t find anything, it only shows the argument’s name. For example, if I search nano in Linux where is it not installed, it outputs the following:
|
||||
|
||||
```
|
||||
$ whereis nano
|
||||
```
|
||||
|
||||
```
|
||||
nano:
|
||||
```
|
||||
|
||||
You can always add multiple arguments if you want to search for more. For example below command searches for both bash and nano, and this is the output:
|
||||
|
||||
```
|
||||
$ whereis bash nano
|
||||
|
||||
bash: /usr/bin/bash /usr/share/man/man1/bash.1.gz /usr/share/info/bash.info.gz
|
||||
nano: /usr/bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz
|
||||
```
|
||||
|
||||
You can also search for specific file types, such as binaries, using -b option. The following command only tells you the binary paths of nano.
|
||||
|
||||
```
|
||||
$ whereis -b nano
|
||||
|
||||
nano: /usr/bin/nano /usr/share/nano
|
||||
```
|
||||
|
||||
Similarly, the -s option searches for source files, and the -m option searches for manual pages.
|
||||
|
||||
```
|
||||
$ whereis -m nano
|
||||
|
||||
nano: /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz
|
||||
```
|
||||
|
||||
You can also combine the above options for a more extensive search. For example, the following command searches for nano and firefox binary, manual pages and for bash, only manual pages.
|
||||
|
||||
```
|
||||
$ whereis -bm nano firefox -m bash
|
||||
|
||||
nano: /usr/bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz
|
||||
firefox-m:
|
||||
bash: /usr/bin/bash /usr/share/man/man1/bash.1.gz /usr/share/info/bash.info.gz
|
||||
```
|
||||
|
||||
Here’s a summary of the options:
|
||||
|
||||
| Option | Description |
|
||||
| :- | :- |
|
||||
| **-b** | Search only for binaries. |
|
||||
| **-m** | Search only for manual sections. |
|
||||
| **-s** | Search only for sources. |
|
||||
| **-u** | Search for unusual entries. A file is said to be unusual if it does not have one entry of each requested type. Thus ‘whereis -m -u *’ asks for those files in the current directory which have no documentation. |
|
||||
| **-B** | Change or otherwise limit the places where whereis searches for binaries. |
|
||||
| **-M** | Change or otherwise limit the places where whereis searches for manual sections. |
|
||||
| **-S** | Change or otherwise limit the places where whereis searches for sources. |
|
||||
| **-f** | Terminate the last directory list and signals the start of file names, and must be used when any of the -B, -M, or -S options are used. |
|
||||
|
||||
### Closing Notes
|
||||
|
||||
I hope this article helps you to understand whereis command and its basics. You can also read the[whereis man pages][4] to learn more. Let me know if you have any questions.
|
||||
|
||||
**This article is part of the [Linux command][2] learning series**.
|
||||
|
||||
[_Using Mastodon? Follow us at floss.social/@debugpoint_][5]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/whereis-command-linux/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2023/01/whereis-head.jpg
|
||||
[2]: https://www.debugpoint.com/category/linux-commands
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2023/01/Simple-example-of-whereis-command-in-Linux.jpg
|
||||
[4]: https://linux.die.net/man/1/whereis
|
||||
[5]: https://floss.social/@debugpoint
|
@ -1,101 +0,0 @@
|
||||
[#]: subject: "6 tips for building an effective DevOps culture"
|
||||
[#]: via: "https://opensource.com/article/23/1/tips-effective-devops-culture"
|
||||
[#]: author: "Yauhen Zaremba https://opensource.com/users/yauhen-zaremba"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
6 tips for building an effective DevOps culture
|
||||
======
|
||||
|
||||
Why would you want to build a [DevOps][1] culture? There are many benefits to the streamlined collaboration of the development and operations teams. A major goal is efficiency: Increasing the speed of new software deployments and reducing idle time for workers. Fostering trust between colleagues can improve employee satisfaction, produce new innovations, and positively impact profitability.
|
||||
|
||||
[DevOps][2] is a broad philosophy with a range of interpretations. In other words, you can visit 40 companies and find 40,000 different ideas about using DevOps effectively in the workplace. This diversity of opinion is actually a good thing–so many perspectives are useful for building stronger teams. This guide will look at the top tips for encouraging better collaboration between colleagues within a DevOps culture.
|
||||
|
||||
Each section offers a different aspect of DevOps culture and looks at ways to introduce it into your workforce.
|
||||
|
||||
![DevOps includes collaboration, workflow, infosec, and iteration.][3]
|
||||
|
||||
### Continuous development of processes
|
||||
|
||||
This core tenet of DevOps culture sets it apart from many other types of workplace ethos. The DevOps philosophy says that it is essential to make mistakes because it shows you are trying out new ideas.
|
||||
|
||||
The heart of DevOps culture is a commitment to evolving creativity. Practically, that means not yelling at your direct reports when test results show that things were better before they changed it. It means recognizing that progress is not linear and success is never a straight line.
|
||||
|
||||
DevOps expert [Gene Kim][4] advocates for risk-taking and experimentation. This implies letting your team work on unusual tasks to find new insights.
|
||||
|
||||
Should your organization be profit-driven? Can you allow your teams to try something new? I'm talking about something other than unrelated passion projects. Continuous process development means being open to upgrading present methods. Great sales leaders appreciate that results matter more than presenteeism, so it is always crucial to focus on how teams are working rather than how much.
|
||||
|
||||
### Readily give feedback and actively seek it
|
||||
|
||||
Increased trust between individuals is another key feature of a thriving DevOps culture. Whether your staff is learning how to build affiliate network contacts or trying to design their next [UX][5] survey, everyone should be open to feedback on their work. But this will never happen until your teammates respect each other's opinions and trust that feedback is given in a spirit of good intention.
|
||||
|
||||
This culture may sound impossible to cultivate; indeed, some companies will struggle to achieve this more than others. Granted, a large part of the success of giving and receiving feedback depends on the personalities of your employees. It is possible to screen for this during the recruitment process.
|
||||
|
||||
Before you expect staff to readily offer feedback to colleagues and seek it in the first place, you should lead by example. Members of the C-suite should be modeling this behavior, openly asking members of the company to pose probing questions about their strategic decisions, and providing balanced feedback.
|
||||
|
||||
![DevOps is the intersection of development, quality assurance, and operations][6]
|
||||
|
||||
### Always look for improvements
|
||||
|
||||
Building on increased intellectual trust between colleagues, your team should look for ways to improve its work. The nature of DevOps means the software development team will be producing deployments more rapidly than with traditional approaches.
|
||||
|
||||
However, this culture of openness to improvement can positively impact departments beyond development and operations. Ask yourself what other areas of your business could do with a burst of optimism.
|
||||
|
||||
Be on the lookout for training and upskilling opportunities. Even if a training course is less salient than advertised, the chance to network with industry professionals and build contacts for the future can only enhance the diversity of ideas within your organization.
|
||||
|
||||
### Save ideas for later development
|
||||
|
||||
Part of your DevOps toolchain should be a heavily used account on [Git][7]. You can use Git as a common repository for scripts produced during software development and other related projects. Known as "version control," Git allows programmers to save iterations of their work and reuse or improve the work of others.
|
||||
|
||||
You're aiming for the ability to keep hold of good ideas for future use. A certain pathway did not work out for specific reasons. However, just because that set of ideas was wrong for the time it was conceived does not mean it can never become helpful in the future.
|
||||
|
||||
As the entire focus of DevOps rests on end-to-end ownership of software in production, saving iterations of developments truly supports this principle. You want to see an improved focus on and commitment to the software testing project at hand.
|
||||
|
||||
A simple way to incorporate this is to request that developers include ideas for future work in the developer contract and final project report. Make sure tech services managers know they should ask for examples of side-branching ideas that cropped up during the build. The more minds aware of these little innovations, the more likely someone will remember one when needed.
|
||||
|
||||
### Sit close together (physically or virtually)
|
||||
|
||||
The goal is to share a common understanding of one another's job roles and how they interrelate. You can achieve this in a few simple ways, summarized by three words: Sit close together. Invite other teams to your meetings and share user feedback reports in their entirety. Have lunch together, plan virtual happy hours together, and generally make sure your colleagues are in close proximity. About 90% of teams with a mature DevOps protocol report a clear understanding of their responsibilities to other teams compared to only about 46% of workers in immature DevOps teams.
|
||||
|
||||
Although it can be tempting to form cliques with like-minded folk and only hang out with staff hired to carry out the same tasks as you, this is terrible for the business as a whole. Whether you like it or not, all humans are multi-faceted and capable of contributing their unique talents to a whole host of scenarios.
|
||||
|
||||
The idea of closer collaboration is to honor the ability of anyone to suggest improvements to the products or work processes going on around them. If you only ever sit at a distance from the other departments within the company, you will miss countless opportunities to share intelligent ideas. After all, you often learn best in the free flow of ideas during a conversation.
|
||||
|
||||
### Commit to automation
|
||||
|
||||
You should be looking to automate mundane and repetitive tasks in the name of efficiency and process acceleration. Every industry has boring–and quite frankly, silly–exercises carried out daily or weekly.
|
||||
|
||||
Whether this is manually copying data from one page to another or typing out audio transcripts by hand, staff at every level should insist that machines take on such burdens where possible. The reality is automation technology advances every single year, and operational processes should, too. [Automation testing][8] is so crucial to DevOps that it is the second principle of the CALMS framework (the "C" of which stands for "culture").
|
||||
|
||||
How can you make this happen? Invite staff to openly express which aspects of their job they feel could be automated and then–here is the crucial part–support the facilities needed to automate them. That might mean a $600 annual subscription to a software program, a complete enterprise application modernization, or two days of developers' time to build a new tool to use in-house.
|
||||
|
||||
Either way, you should assess the benefits of automation and consider how much time you could save for everyone. DevOps statistics continually indicate just how much better off modern companies are by integrating these beneficial principles year after year.
|
||||
|
||||
### Explore new ways of working successfully
|
||||
|
||||
A culture shift doesn't happen overnight. The sooner you start, though, the sooner you see results. In my experience, people embrace change when it's a genuine improvement on what has gone before. DevOps provides a framework for such improvements. Whether you're just getting started with DevOps in your organization or simply want to improve your existing culture, consider the above points and how they relate to your organization's future.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/1/tips-effective-devops-culture
|
||||
|
||||
作者:[Yauhen Zaremba][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/yauhen-zaremba
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/resources/devops
|
||||
[2]: https://opensource.com/article/22/2/devops-documentation-maturity
|
||||
[3]: https://opensource.com/sites/default/files/2022-12/devop.png
|
||||
[4]: https://enterprisersproject.com/user/gene-kim
|
||||
[5]: https://opensource.com/article/22/7/awesome-ux-cli-application
|
||||
[6]: https://opensource.com/sites/default/files/2022-12/devop-venn.png
|
||||
[7]: https://opensource.com/article/22/11/git-concepts
|
||||
[8]: https://opensource.com/article/20/7/open-source-test-automation-frameworks
|
@ -0,0 +1,123 @@
|
||||
[#]: subject: "Use time-series data to power your edge projects with open source tools"
|
||||
[#]: via: "https://opensource.com/article/23/1/time-series-data-edge-open-source-tools"
|
||||
[#]: author: "Zoe Steinkamp https://opensource.com/users/zoesteinkamp"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Use time-series data to power your edge projects with open source tools
|
||||
======
|
||||
|
||||
Gathering data as it changes over the passage of time is known as time-series data. Today, it has become a part of every industry and ecosystem. It is a large part of the growing IoT sector and will become a larger part of everyday people's lives. But time-series data and its requirements are hard to work with. This is because there are no tools that are purpose-built to work with time-series data. In this article, I go into detail about those problems and how InfluxData has been working to solve them for the past 10 years.
|
||||
|
||||
### InfluxData
|
||||
|
||||
InfluxData is an open source time-series database platform. You may know about the company through [InfluxDB][1], but you may not have known that it specialized in time-series databases. This is significant, because when managing time-series data, you deal with two issues — storage lifecycle and queries.
|
||||
|
||||
When it comes to storage lifecycle, it's common for developers to initially collect and analyze highly detailed data. But developers want to store smaller, downsampled datasets that describe trends without taking up as much storage space.
|
||||
|
||||
When querying a database, you don't want to query your data based on IDs. You want to query based on time ranges. One of the most common things to do with time-series data is to summarize it over a large period of time. This kind of query is slow when storing data in a typical relational database that uses rows and columns to describe the relationships of different data points. A database designed to process time-series data can handle queries exponentially faster. InfluxDB has its own built-in querying language: Flux. This is specifically built to query on time-series data sets.
|
||||
|
||||
![Image of how Telegraf works.][2]
|
||||
|
||||
### Data acquisition
|
||||
|
||||
Data acquisition and data manipulation come out of the box with some awesome tools. InfluxData has over 12 client libraries that allow you to write and query data in the coding language of your choice. This is a great tool for custom use cases. The open source ingest agent, Telegraf, includes over 300 input and output plugins. If you're a developer, you can contribute your own plugin, as well.
|
||||
|
||||
InfluxDB can also accept a CSV upload for small historical data sets, as well as batch imports for large data sets.
|
||||
|
||||
```
|
||||
import math
|
||||
bicycles3 = from(bucket: "smartcity")
|
||||
|> range(start:2021-03-01T00:00:00z, stop: 2021-04-01T00:00:00z)
|
||||
|> filter(fn: (r) => r._measurement == "city_IoT")
|
||||
|> filter(fn: (r) => r._field == "counter")
|
||||
|> filter(fn: (r) => r.source == "bicycle")
|
||||
|> filter(fn: (r) => r.neighborhood_id == "3")
|
||||
|> aggregateWindow(every: 1h, fn: mean, createEmpty:false)
|
||||
bicycles4 = from(bucket: "smartcity")
|
||||
|> range(start:2021-03-01T00:00:00z, stop: 2021-04-01T00:00:00z)
|
||||
|> filter(fn: (r) => r._measurement == "city_IoT")
|
||||
|> filter(fn: (r) => r._field == "counter")
|
||||
|> filter(fn: (r) => r.source == "bicycle")
|
||||
|> filter(fn: (r) => r.neighborhood_id == "4")
|
||||
|> aggregateWindow(every: 1h, fn: mean, createEmpty:false)join(tables: {neighborhood_3: bicycles3, neighborhood_4: bicycles4}, on ["_time"], method: "inner")
|
||||
|> keep(columns: ["_time", "_value_neighborhood_3","_value_neighborhood_4"])
|
||||
|> map(fn: (r) => ({
|
||||
r with
|
||||
difference_value : math.abs(x: (r._value_neighborhood_3 - r._value_neighborhood_4))
|
||||
}))
|
||||
```
|
||||
|
||||
### Flux
|
||||
|
||||
Flux is our internal querying language built from the ground up to handle time-series data. It's also the underlying powerhouse for a few of our tools, including tasks, alerts, and notifications. To dissect the flux query from above, you need to define a few things. For starters, a "bucket" is what we call a database. You configure your buckets and then add your data stream into them. The query calls the smartcity bucket, with the range of a specific day (a 24-hour period to be exact.) You can get all the data from the bucket, but most users include a data range. That's the most basic flux query you can do.
|
||||
|
||||
Next, I add filters, which filter the data down to something more exact and manageable. For example, I filter for the count of bicycles in the neighborhood assigned to the id of 3. From there, I use aggregateWindow to get the mean for every hour. That means I expect to receive a table with 24 columns, one for every hour in the range. I do this exact same query for neighborhood 4 as well. Finally, I join the two tables and get the differences between bike usage in these two neighborhoods.
|
||||
|
||||
This is great if you want to know what hours are high-traffic hours. Obviously, this is just a small example of the power of flux queries. But it gives a great example of some of the tools flux comes with. I also have a large amount of data analysis and statistics functions. But for that, I suggest checking out the Flux documentation.
|
||||
|
||||
```
|
||||
import "influxdata/influxdb/tasks"
|
||||
option task = {name: PB_downsample, every: 1h, offset: 10s}
|
||||
from(bucket: "plantbuddy")
|
||||
|>range(start: tasks.lastSuccess(orTime: -task.every))
|
||||
|>filter(fn: (r) => r["_measurement"] == "sensor_data")
|
||||
|>aggregateWindow(every: 10m, fn:last, createEmpty:false)
|
||||
|>yield(name: "last")
|
||||
|>to(bucket: "downsampled")
|
||||
```
|
||||
|
||||
### Tasks
|
||||
|
||||
An InfluxDB task is a scheduled Flux script that takes a stream of input data and modifies or analyzes it in some way. It then stores the modified data in a new bucket or performs other actions. Storing a smaller data set into a new bucket is called "downsampling," and it's a core feature of the database, and a core part of the time-series data lifecycle.
|
||||
|
||||
You can see in the current task example that I've downsampled the data. I'm getting the last value for every 10-minute increment and storing that value in the downsampled bucket. The original data set might have had thousands of data points in those 10 minutes, but now the downsampled bucket only has 60 new values. One thing to note is that I'm also using the last success function in range. This tells InfluxDB to run this task from the last time it ran successfully, just in case it has failed for the past 2 hours, in which case it can go back three hours in time to the last successful run. This is great for built-in error handling.
|
||||
|
||||
![Image of the checks and alerts notification system.][3]
|
||||
|
||||
### Checks and alerts
|
||||
|
||||
InfluxDB includes an alerting or checks and notification system. This system is very straightforward. You start with a check that looks at the data periodically for anomalies that you've defined. Normally, this is defined with thresholds. For example, any temperature value under 32° F gets assigned a value of `WARN`, and anything above 32° F gets assigned a value of `OK`, and anything below 0° F gets a value of `CRITICAL`. From there, your check can run as often as you deem necessary. There is a recorded history of your checks and the current status of each. You are not required to set up a notification when it's not needed. You can just reference your alert history as needed.
|
||||
|
||||
Many people choose to set up their notifications. For that, you need to define a notification endpoint. For example, a chat application could make an HTTP call to receive your notifications. Then you define when you would like to receive notifications, for example you can have checks run every hour. You can run notifications every 24 hours. You can have your notification respond to a change in the value, for example `WARN` to `CRITICAL`, or when a value is `CRITICAL`, regardless of it changing from `OK` to `WARN`. This is a highly customizable system. The Flux code that's created from this system can also be edited.
|
||||
|
||||
![Image of the new Edge feature.][4]
|
||||
|
||||
### Edge
|
||||
|
||||
To wrap up, I'd like to bring all the core features together, including a very special new feature that's recently been released. Edge to cloud is a very powerful tool that allows you to run the open source InfluxDB and locally store your data in case of connectivity issues. When connectivity is repaired, it streams the data to the InfluxData cloud platform.
|
||||
|
||||
This is significant for edge devices and important data where any loss of data is detrimental. You define that you want a bucket to be replicated to the cloud, and then that bucket has a disk-backed queue to store the data locally. Then you define what your cloud bucket should replicate into. The data is stored locally until connected to the cloud.
|
||||
|
||||
### InfluxDB and the IoT Edge
|
||||
|
||||
Suppose you have a project where you want to [monitor the health of household plants][5] using IoT sensors attached to the plant. The project is set up using your laptop as the edge device. When your laptop is closed or otherwise off, it stores the data locally, and then streams it to my cloud bucket when reconnected.
|
||||
|
||||
![Image showing how Plant buddy works.][6]
|
||||
|
||||
One thing to notice is that this downsamples data on the local device before storing it in the replication bucket. Your plant's sensors provide a data point for every second. But it condenses the data to be an average of one minute so you have less data to store. In the cloud account, you might add some alerts and notifications that let you know when the plant's moisture is below a certain level and needs to be watered. There could also be visuals you could use on a website to tell users about their plants' health.
|
||||
|
||||
Databases are the backbone of many applications. Working with time-stamped data in a time series database platform like InfluxDB saves developers time, and gives them access to a wide range of tools and services. The maintainers of InfluxDB love seeing what people are building within our open source community, so connect with us and share your projects and code with others!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/1/time-series-data-edge-open-source-tools
|
||||
|
||||
作者:[Zoe Steinkamp][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/zoesteinkamp
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/article/17/8/influxdb-time-series-database-stack
|
||||
[2]: https://opensource.com/sites/default/files/2022-12/Telegraf.png
|
||||
[3]: https://opensource.com/sites/default/files/2022-12/TimeSeriesChecks%26Alerts.png
|
||||
[4]: https://opensource.com/sites/default/files/2022-12/TimSeriesEdge.png
|
||||
[5]: https://opensource.com/article/22/5/plant-care
|
||||
[6]: https://opensource.com/sites/default/files/2022-12/TimeSeriesplantbuddy.png
|
@ -0,0 +1,149 @@
|
||||
[#]: subject: "Use this open source API gateway to scale your API"
|
||||
[#]: via: "https://opensource.com/article/23/1/api-gateway-apache-apisix"
|
||||
[#]: author: "Bobur Umurzokov https://opensource.com/users/iambobur"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Use this open source API gateway to scale your API
|
||||
======
|
||||
|
||||
An API gateway is a single point of entry for incoming calls to an [application programming interface (API)][1]. The gateway aggregates the services being requested and then returns the appropriate response. To make your API gateway effective, it's vital for you to design a reliable, efficient, and simple API. This is an architectural puzzle, but it's one you can solve as long as you understand the most important components.
|
||||
|
||||
### API-Led approach
|
||||
|
||||
An API-Led approach puts an API at the heart of communication between applications and the business capabilities they need to access in order to consistently deliver seamless functionality across all digital channels. **API-Led connectivity** refers to the technique of using a reusable and well-designed API to link data and applications.
|
||||
|
||||
### API-Led architecture
|
||||
|
||||
API-Led architecture is an architectural approach that looks at the best ways of reusing an API. API-Led architecture addresses things like:
|
||||
|
||||
- Protecting an API from unauthorized access.
|
||||
- Ensuring that consuming applications can always find the right API endpoint.
|
||||
- Throttling or limiting the number of calls made to an API to ensure continuous availability.
|
||||
- Supporting continuous integration, testing, lifecycle management, monitoring, operations, and so on.
|
||||
- Preventing error propagation across the stack.
|
||||
- Real-time monitoring of an API with rich analytics and insight.
|
||||
- Implementing scalable and flexible business capabilities (for example, supporting a [microservice][2] architecture.)
|
||||
|
||||
### API resource routing
|
||||
|
||||
Implementing an API gateway as the single entry point to all services means that API consumers only have to be aware of one URL. It becomes the API gateway's responsibility to route traffic to the corresponding service endpoints, and to enforce policies.
|
||||
|
||||
![Image depicting the API routing traffic.][3]
|
||||
|
||||
This reduces complexity on the API consumer side because the client applications don't need to consume functionality from multiple HTTP endpoints. There's alsono need to implement a separate layer for authentication, authorization, throttling, and rate limiting for each service. Most API gateways, like the open source [Apache APISIX][4] project, already have these core features built in.
|
||||
|
||||
### API content-based routing
|
||||
|
||||
A content-based routing mechanism also uses an API gateway to route calls based on the content of a request. For example, a request might be routed based on the HTTP header or message body instead of just its target URI.
|
||||
|
||||
Consider a scenario when database sharding is applied in order to distribute the load across multiple database instances. This technique is typically applied when the overall number of records stored is huge and a single instance struggles to manage the load.
|
||||
|
||||
A better solution is to spread records across multiple database instances. Then you implement multiple services, one for each unique datastore, and adopt an API gateway as the only entry point to all services. You can then configure your API gateway to route calls to the corresponding service based on a key obtained either from the HTTP header or the payload.
|
||||
|
||||
![Image of the API gateway exposing a single customer.][5]
|
||||
|
||||
In the above diagram, an API gateway is exposing a single `/customers` resource for multiple customer services, each with a different data store.
|
||||
|
||||
### API geo-routing
|
||||
|
||||
An API geo-routing solution routes an API call to the nearest API gateway based on its origin. In order to prevent latency issues due to distance (for example, a consuming application from Asia calling an API located in North America), you can deploy an API gateway in multiple regions across the world. You can use a different subdomain for each API gateway in each region, letting the consuming application determine the nearest gateway based on application logic. Then, an API gateway provides internal load balancing to make sure that incoming requests are distributed across available instances.
|
||||
|
||||
![Image of a DNS traffic management system.][6]
|
||||
|
||||
It's common to use a DNS traffic management service and an API gateway to resolve each subdomain against the region's load balancer to target the nearest gateway.
|
||||
|
||||
### API aggregator
|
||||
|
||||
This technique performs operations (for example, queries) against multiple services, and returns the result to the client service with a single HTTP response. Instead of having a client application make several calls to multiple APIs, an API aggregator uses an API gateway to do this on behalf of the consumer on the server side.
|
||||
|
||||
Suppose you have a mobile app that makes multiple calls to different APIs. This increases complexity in the client-side code, it causes over-utilization of network resources, and produces a poor user experience due to increased latency. An API gateway can accept all information required as input, and can request authentication and validation, and understand the data structures from each API it interacts with. It's also capable of transforming the response payloads so they can be sent back to the mobile app as a uniform payload needed for the consumer.
|
||||
|
||||
![Image of an API gateway.][7]
|
||||
|
||||
### API centralized authentication
|
||||
|
||||
In this design, an API gateway acts as a centralized authentication gateway. As an authenticator, an API gateway looks for access credentials in the HTTP header (such as a bearer token.) It then implements business logic that validates those credentials with an identity provider.
|
||||
|
||||
![Image of a tree showing API gateway's centralized authentication.][8]
|
||||
|
||||
Centralized authentication with an API gateway can solve many problems. It completely offloads user management from an application, improving performance by responding quickly to authentication requests received from client applications. Apache APISIX offers a [variety of plugins][9] to enable different methods of API gateway authentication.
|
||||
|
||||
![Image showing Apache ASPISIS and various plugins.][10]
|
||||
|
||||
### API format conversion
|
||||
|
||||
API format conversion is the ability to convert payloads from one format to another over the same transport. For example, you can transfer from XML/SOAP over HTTPS to JSON over HTTPS, and back again. An API gateway offers capabilities in support of a [REST API][11] and can do payload conversions and transport conversions. For instance, a gateway can convert from a message queue telemetry transport (MQTT) over TCP (a very popular transport in IoT) to JSON over HTTPS.
|
||||
|
||||
![Image depicting APISIX transfers.][12]
|
||||
|
||||
Apache APISIX is able to receive an HTTP request, transcode it, and then forward it to a gRPC service. It gets the response and returns it back to the client in HTTP format by means of its [gRPC Transcode][13] plug-in.
|
||||
|
||||
### API observability
|
||||
|
||||
By now, you know that an API gateway offers a central control point for incoming traffic to a variety of destinations. But it can also be a central point for observation, because it's uniquely qualified to monitor all traffic moving between the client and service networks. You can adjust an API gateway so that the data (structured logs, metrics, and traces) can be collected for use with specialized monitoring tools**.**
|
||||
|
||||
Apache APISIX provides [pre-built connectors][14] so you can integrate with external monitoring tools. You can leverage these connectors to collect log data from your API gateway to further derive useful metrics and gain complete visibility into how your services are being used. You can also manage the performance and security of your API in your environment.
|
||||
|
||||
### API caching
|
||||
|
||||
API caching is usually implemented inside the API gateway. It can reduce the number of calls made to your endpoint, and also improve the latency of requests to your API by caching a response from upstream. If the API gateway cache has a fresh copy of the requested resource, it uses that copy to satisfy the request directly instead of making a request to the endpoint. If the cached data is not found, the request travels to the intended upstream services.
|
||||
|
||||
![Image depicting how the API gateway cache functions.][15]
|
||||
|
||||
### API fault handling
|
||||
|
||||
API services may fail due to any number of reasons. In such scenarios, your API service must be resilient enough to deal with predictable failures. You also want to ensure that any resilience mechanisms you have in place work properly. This includes error handling code, circuit breakers, health checks, fallbacks, redundancy, and so on. Modern API gateways support all the most common error-handling features, including automatic retries and timeouts.
|
||||
|
||||
![Image depicting some of the many mechanisms that the modern API Gatway can support.][16]
|
||||
|
||||
An API gateway acts as an orchestrator that can use a status report to decide how to manage traffic, send load balances to a healthy node, and can fail fast. It can also alert you when something goes wrong. An API gateway also ensures that routing and other network-level components work together successfully to deliver a request to the API process. It helps you detect a problem in the early stage, and to fix issues. A fault injection mechanism (like the one Apache APISIX uses) at the API gateway level can be used to test the resiliency of an application or microservices API against various forms of failures.
|
||||
|
||||
### API versioning
|
||||
|
||||
This refers to having the ability to define and run multiple concurrent versions of an API. This is particularly important, because an API evolves over time. Having the ability to manage concurrent versions of an API enables API consumers to incrementally switch to newer versions of an API. This means older versions can be deprecated and ultimately retired. This is important because an API, just like any other software application, should be able to evolve either in support of new features or in response to bug fixes.
|
||||
|
||||
![Image of using the API Gateway to implement API versioning.][17]
|
||||
|
||||
You can use an API gateway to implement API versioning. The versioning can be a header, query parameter, or path.
|
||||
|
||||
### Gateway to APISIX
|
||||
|
||||
If you want to scale your API services, you need an API gateway. The Apache APISIX project provides essential features for a robust entrypoint, and its benefits are clear. It aligns with an API-Led architecture, and is likely to transform the way your clients interact with your hosted services.
|
||||
|
||||
_This article has been adapted and republished from the [Apache APISIX blog][18] with the author's permission._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/1/api-gateway-apache-apisix
|
||||
|
||||
作者:[Bobur Umurzokov][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/iambobur
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.redhat.com/en/topics/api/what-are-application-programming-interfaces
|
||||
[2]: https://www.redhat.com/en/topics/microservices/what-are-microservices?intcmp=7013a000002qLH8AAM
|
||||
[3]: https://opensource.com/sites/default/files/2022-12/API.routing.traffic.png
|
||||
[4]: https://apisix.apache.org/docs/apisix/terminology/api-gateway/
|
||||
[5]: https://opensource.com/sites/default/files/2022-12/API%20gateway%20%20exposing%20a%20singlecustomer.png
|
||||
[6]: https://opensource.com/sites/default/files/2022-12/DNS-traffic%20management%20.png
|
||||
[7]: https://opensource.com/sites/default/files/2022-12/API-gateway.png
|
||||
[8]: https://opensource.com/sites/default/files/2022-12/Apigateway.centralized.png
|
||||
[9]: https://apisix.apache.org/docs/apisix/plugins/openid-connect/
|
||||
[10]: https://opensource.com/sites/default/files/2022-12/Apache.ASPISISplugins.png
|
||||
[11]: https://www.redhat.com/en/topics/api/what-is-a-rest-api?intcmp=7013a000002qLH8AAM
|
||||
[12]: https://opensource.com/sites/default/files/2022-12/APISIX.transfers.png
|
||||
[13]: https://apisix.apache.org/docs/apisix/plugins/grpc-transcode/
|
||||
[14]: https://apisix.apache.org/docs/apisix/plugins/prometheus/
|
||||
[15]: https://opensource.com/sites/default/files/2022-12/APIgatewaycache.png
|
||||
[16]: https://opensource.com/sites/default/files/2022-12/ModernAPIGatways.png
|
||||
[17]: https://opensource.com/sites/default/files/2022-12/API.gateway.version.png
|
||||
[18]: https://apisix.apache.org/blog/2022/10/27/ten-use-cases-api-gateway/
|
187
sources/tech/20230110.3 ⭐️⭐️ How to use methods in Java.md
Normal file
187
sources/tech/20230110.3 ⭐️⭐️ How to use methods in Java.md
Normal file
@ -0,0 +1,187 @@
|
||||
[#]: subject: "How to use methods in Java"
|
||||
[#]: via: "https://opensource.com/article/23/1/java-methods"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to use methods in Java
|
||||
======
|
||||
|
||||
A method in Java (called a "function" in many other programming languages) is a portion of code that's been grouped together and labeled for reuse. Methods are useful because they allow you to perform the same action or series of actions without rewriting the same code, which not only means less work for you, it means less code to maintain and debug when something goes wrong.
|
||||
|
||||
A method exists within a class, so the standard Java boilerplate code applies:
|
||||
|
||||
```
|
||||
package com.opensource.example;
|
||||
|
||||
public class Example {
|
||||
// code here
|
||||
}
|
||||
```
|
||||
|
||||
A package definition isn't strictly necessary in a simple one-file application like this, but it's a good habit to get into, and most IDEs enforce it.
|
||||
|
||||
By default, Java looks for a `main` method to run in a class. Methods can be made public or private, and static or non-static, but the main method must be public and static for the Java compiler to recognize and utilize it. When a method is public, it's able to be executed from outside the class. To call the `Example` class upon start of the program, its `main` method must be accessible, so set it to `public`.
|
||||
|
||||
Here's a simple demonstration of two methods: one `main` method that gets executed by default when the `Example` class is invoked, and one `report` method that accepts input from `main` and performs a simple action.
|
||||
|
||||
To mimic arbitrary data input, I use an if-then statement that chooses between two strings, based on when you happen to start the application. In other words, the `main` method first sets up some data (in real life, this data could be from user input, or from some other method elsewhere in the application), and then "calls" the `report` method, providing the processed data as input:
|
||||
|
||||
```
|
||||
package com.opensource.example;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
// generate some data
|
||||
long myTime = System.currentTimeMillis();
|
||||
String weather;
|
||||
|
||||
if ( myTime%2 == 0 ) {
|
||||
weather = "party";
|
||||
} else {
|
||||
weather = "apocalypse";
|
||||
}
|
||||
|
||||
// call the other method
|
||||
report(weather);
|
||||
}
|
||||
|
||||
private static void report(String day) {
|
||||
System.out.printf("Welcome to the zombie %s\n", day);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Run the code:
|
||||
|
||||
```
|
||||
$ java ./Example.java
|
||||
Welcome to the zombie apocalypse
|
||||
$ java ./Example.java
|
||||
Welcome to the zombie party
|
||||
```
|
||||
|
||||
Notice that there are two different results from the same `report` method. In this simple demonstration, of course, there's no need for a second method. The same result could have been generated from the if-then statement that mimics the data generation. But when a method performs a complex task, like resizing an image into a thumbnail and then generating a widget on screen using that resized image, then the "expense" of an additional component makes a lot of sense.
|
||||
|
||||
### When to use a Java method
|
||||
|
||||
It can be difficult to know when to use a method and when to just send data into a [Java Stream][1] or loop. If you're faced with that decision, the answer is usually to use a method. Here's why:
|
||||
|
||||
- Methods are cheap. They don't add processing overhead to your code.
|
||||
- Methods reduce the line count of your code.
|
||||
- Methods are specific. It's usually easier to find a method called `resizeImage` than it is to find code that's hidden in a loop somewhere in the function that loads images from the drive.
|
||||
- Methods are reusable. When you first write a method, you may _think_ it's only useful for one task within your application. As your application grows, however, you may find yourself using a method you thought you were "done" with.
|
||||
|
||||
### Functional vs. object-oriented programming
|
||||
|
||||
Functional programming utilizes methods as the primary construct for performing tasks. You create a method that accepts one kind of data, processes that data, and outputs new data. String lots of methods together, and you have a dynamic and capable application. Programming languages like C and [Lua][2] are examples of this style of coding.
|
||||
|
||||
The other way to think of accomplishing tasks with code is the object-oriented model, which Java uses. In object-oriented programming, methods are components of a template. Instead of sending data from method to method, you create objects with the option to alter them through the use of their methods.
|
||||
|
||||
Here's the same simple zombie apocalypse demo program from an object-oriented perspective. In the functional approach, I used one method to generate data and another to perform an action with that data. The object-oriented equivalent is to have a class that represents a work unit. This example application presents a message-of-the-day to the user, announcing that the day brings either a zombie party or a zombie apocalypse. It makes sense to program a "day" object, and then to query that day to learn about its characteristics. As an excuse to demonstrate different aspects of object-oriented construction, the new sample application will also count how many zombies have shown up to the party (or apocalypse).
|
||||
|
||||
Java uses one file for each class, so the first file to create is `Day.java`, which serves as the Day object:
|
||||
|
||||
```
|
||||
package com.opensource.example;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
// Class
|
||||
public class Day {
|
||||
public static String weather;
|
||||
public int count;
|
||||
|
||||
// Constructor
|
||||
public Day() {
|
||||
long myTime = System.currentTimeMillis();
|
||||
|
||||
if ( myTime%2 == 0 ) {
|
||||
weather = "paradise";
|
||||
} else {
|
||||
weather = "apocalypse";
|
||||
}
|
||||
}
|
||||
|
||||
// Methods
|
||||
public String report() {
|
||||
return weather;
|
||||
}
|
||||
|
||||
public int counter() {
|
||||
Random rand = new Random();
|
||||
count = count + rand.nextInt(100);
|
||||
|
||||
return(count);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In the `Class` section, two fields are created: `weather` and `count`. Weather is static. Over the course of a day (in this imaginary situation), weather doesn't change. It's either a party or an apocalypse, and it lasts all day. The number of zombies, however, increases over the course of a day.
|
||||
|
||||
In the `Constructor` section, the day's weather is determined. It's done as a [constructor][3] because it's meant to only happen once, when the class is initially invoked.
|
||||
|
||||
In the `Methods` section, the `report` method only returns the weather report as determined and set by the constructor. The `counter` method, however, generates a random number and adds it to the current zombie count.
|
||||
|
||||
This class, in other words, does three very different things:
|
||||
|
||||
- Represents a "day" as defined by the application.
|
||||
- Sets an unchanging weather report for the day.
|
||||
- Sets an ever-increasing zombie count for the day.
|
||||
|
||||
To put all of this to use, create a second file:
|
||||
|
||||
```
|
||||
package com.opensource.example;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
Day myDay = new Day();
|
||||
String foo = myDay.report();
|
||||
String bar = myDay.report();
|
||||
|
||||
System.out.printf("Welcome to a zombie %s\n", foo);
|
||||
System.out.printf("Welcome to a zombie %s\n", bar);
|
||||
System.out.printf("There are %d zombies out today.\n", myDay.counter());
|
||||
System.out.printf("UPDATE: %d zombies. ", myDay.counter());
|
||||
System.out.printf("UPDATE: %d zombies. ", myDay.counter());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Because there are now two files, it's easiest to use a Java IDE to run the code, but if you don't want to use an IDE, you can create your own [JAR file][4]. Run the code to see the results:
|
||||
|
||||
```
|
||||
Welcome to a zombie apocalypse
|
||||
Welcome to a zombie apocalypse
|
||||
There are 35 zombies out today.
|
||||
UPDATE: 67 zombies. UPDATE: 149 zombies.
|
||||
```
|
||||
|
||||
The "weather" stays the same regardless of how many times the `report` method is called, but the number of zombies on the loose increases the more you call the `counter` method.
|
||||
|
||||
### Java methods
|
||||
|
||||
Methods (or functions) are important constructs in programming. In Java, you can use them either as part of a single class for functional-style coding, or you can use them across classes for object-oriented code. Both styles of coding are different perspectives on solving the same problem, so there's no right or wrong decision. Through trial and error, and after a little experience, you learn which one suits a particular problem best.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/1/java-methods
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/article/20/1/javastream
|
||||
[2]: https://opensource.com/article/22/11/lua-worth-learning
|
||||
[3]: https://opensource.com/article/19/6/what-java-constructor
|
||||
[4]: https://opensource.com/article/21/8/fastjar
|
||||
|
@ -0,0 +1,241 @@
|
||||
[#]: subject: "Install Ubuntu on Windows Using VirtualBox [Complete Guide]"
|
||||
[#]: via: "https://www.debugpoint.com/install-ubuntu-windows-virtualbox/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Install Ubuntu on Windows Using VirtualBox [Complete Guide]
|
||||
======
|
||||
|
||||
**This tutorial will guide you through the easiest steps to install an Ubuntu desktop on Windows using Oracle VirtualBox.**
|
||||
|
||||
[VirtualBox][1] is a popular virtualization software by Oracle which is available for Linux, mac and Windows systems. It is flexible and brings many features to take advantage of your virtualization. It’s the best and easy way to experience Ubuntu in Windows without installing it. However, I strongly recommend installing Ubuntu physically as a dual-boot to enjoy its advantage.
|
||||
|
||||
The steps outlined below assume that you are installing Ubuntu for the first time in Windows. Hence the steps are a little descriptive and a bit lengthy. Furthermore, the following steps should work for Windows 10 and Windows 11 as host machines.
|
||||
|
||||
### Contents
|
||||
|
||||
- [Pre-requisite][2]
|
||||
- [Download Ubuntu ISO and VirtualBox set-up files][3]
|
||||
- [Install VirtualBox on Windows (Host)][4]
|
||||
- [Install Ubuntu (Guest) on VirtualBox][5]
|
||||
- [Guest addition installation and tips][6]
|
||||
|
||||
### What you’ll need
|
||||
|
||||
- A PC with internet access
|
||||
- Ubuntu Linux ISO image file for installation
|
||||
- Windows system with VirtualBox installed
|
||||
|
||||
### Install Ubuntu on Windows Using VirtualBox
|
||||
|
||||
#### Download and install the necessary items
|
||||
|
||||
- Download the Ubuntu Linux desktop ISO image file from the following link.
|
||||
|
||||
[Download Ubuntu Desktop][7]
|
||||
|
||||
- Also, download the Oracle VirtualBox installer from the official website below.
|
||||
|
||||
[Download VirtualBox][8]
|
||||
|
||||
![Download location for VirtualBox for Windows][9]
|
||||
|
||||
#### How to install and configure VirtualBox
|
||||
|
||||
VirtualBox in Windows requires Microsoft Visual C++ 2019 Redistributable package. And you have to install it first. Download the package (under X64 architecture) from the below link:
|
||||
|
||||
[Download][10]
|
||||
|
||||
![Download the dependency for VirtualBox][11]
|
||||
|
||||
![Install the dependency for VirtualBox][12]
|
||||
|
||||
- After the above installation is complete, download the latest Python package from the below link. Python bindings are also a dependency for VirtualBox installation on Windows.
|
||||
|
||||
[Download Python for Windows][13]
|
||||
|
||||
- Then, launch the VirtualBox installation and follow the onscreen instructions to install it.
|
||||
- After installation, restart your Windows system again.
|
||||
|
||||
#### Set up a virtual machine for Ubuntu
|
||||
|
||||
- Launch VirtualBox from the start menu.
|
||||
|
||||
![Select VirtualBox from start menu][14]
|
||||
|
||||
- On the VirtualBox window toolbar, click **New**.
|
||||
- On the **Create VirtualBox** window, give the name of your virtual machine. It can be any name which identifies this version of Ubuntu.
|
||||
- Keep the **Folder Name** unchanged. This is the path where the virtual machine file will be created.
|
||||
- In the ISO Image field, browse the Ubuntu ISO file you downloaded.
|
||||
- And select the Unattended installation. If you un-select this, a [default user id (vboxuser) and password][15] will be created in your virtual machine. Let’s not follow it for now.
|
||||
|
||||
![Click on New][16]
|
||||
|
||||
![Select the ISO file][17]
|
||||
|
||||
- Click on Hardware and select the RAM you want for your virtual box. A thumb rule is that your VM’s RAM size should be less than your physical RAM in the host system. I would recommend using 2 GB to 4 GB for a virtual machine for an 8 GB RAM system. For 4 GB RAM, use the slider (or type in) to make it 4096 MB (i.e. 4*1024).
|
||||
- Choose processor as 2 or 4.
|
||||
- Click on the Hard Disk section, and keep the file location unchanged.
|
||||
- Give a minimum of 20GB to 25GB for Ubuntu installation.
|
||||
- The hard disk file type value keeps as VDI (VirtualBox Disk Image)
|
||||
- Do not select the pre-allocate full size.
|
||||
- And finally, click on Finish.
|
||||
|
||||
![Select Hardware][18]
|
||||
|
||||
![Select Hard Disk][19]
|
||||
|
||||
- You should see a new entry at the left panel of VirtualBox with an Ubuntu 22.04 entry (the name which you gave above).
|
||||
- Select the entry and click on Start to boot into the virtual machine
|
||||
|
||||
![Boot Ubuntu in VirtualBox][20]
|
||||
|
||||
#### Install Ubuntu using VirtualBox
|
||||
|
||||
- After a successful boot, you should see the following screen, which shows various options for installing Ubuntu. Select **Try or install Ubuntu**.
|
||||
- In the Welcome screen, click on **Try Ubuntu**. And after a few moments, you should see the following Ubuntu LIVE desktop. If you want to change the resolution, right-click on the desktop and select Display settings. And change the resolution to 1400×900.
|
||||
- On the desktop, double-click on “**Install Ubuntu**…”.
|
||||
|
||||
![Select Try Ubuntu][21]
|
||||
|
||||
![Ubuntu LIVE desktop][22]
|
||||
|
||||
- In the next set of screens, select Language and Keyboard Layout as your needs.
|
||||
- The Install screen provides you with the type of installation you need. Select Normal Installation, and select both options under Other options.
|
||||
- Since you are installing in the virtual disk space, i.e. which is just a file, you can safely choose the “Erase disk and install Ubuntu” option.
|
||||
- Hit Install Now and Continue.
|
||||
|
||||
![Select Language][23]
|
||||
|
||||
![Select Keybaord Layout][24]
|
||||
|
||||
![Select install options][25]
|
||||
|
||||
![Installation Type][26]
|
||||
|
||||
![Write changes to disk][27]
|
||||
|
||||
- Then select region, add name, user and password. This will be your user id and password to log on to Ubuntu after installation.
|
||||
- Hit continue to start the installation. Wait until it finishes.
|
||||
|
||||
![User account creation][28]
|
||||
|
||||
![Ubuntu Installation is complete][29]
|
||||
|
||||
Click on Restart Now after the installation is complete. Wait for a few seconds and you should see a login screen. Use the user id and password to log in. And you should see Ubuntu desktop is running inside VirtualBox as VM in Windows.
|
||||
|
||||
![Log on to Ubuntu][30]
|
||||
|
||||
![Ubuntu running in Windows using Virtualbox][31]
|
||||
|
||||
### Post-install configuration and tips (optional)
|
||||
|
||||
#### Install Guest Additions
|
||||
|
||||
After the successful installation, you should install the **VirtualBox guest additions** for Windows Host and Ubuntu Guest. The guest addition is a set of packages you need to install inside the guest VM (i.e. Ubuntu) to enable **shared folders, bi-directional copy/paste, automatic resolution change,** and many such features.
|
||||
|
||||
To install it, boot into Ubuntu. From the VirtualBox menu, select `Devices > Insert Guest Additions CD Image`. The necessary packages will be mounted inside Ubuntu.
|
||||
|
||||
![Select Guest addition from the menu][32]
|
||||
|
||||
Open the file manager and open the mounted folder as shown below. And then right-click > select `open in terminal`.
|
||||
|
||||
Then run the following command:
|
||||
|
||||
```
|
||||
sudo ./VBoxLinuxAdditions.run
|
||||
```
|
||||
|
||||
![Open the mounted disc and select option with terminal][33]
|
||||
|
||||
![VirtualBox guest addition install for Windows host][34]
|
||||
|
||||
After the above command is complete, restart Ubuntu VM.
|
||||
|
||||
#### Enable Copy and paste between Windows and Ubuntu
|
||||
|
||||
- To enable the copy and paste between Windows and Ubuntu systems, select `Devices > Shared Clipboard > Bi-directional` from the menu.
|
||||
|
||||
![Enable clipboard sharing][35]
|
||||
|
||||
#### Shutting down Ubuntu VM
|
||||
|
||||
- Ideally, you should shut down a VM from its own power off menu. However, you can also shut down from the main VirtualBox window. Right-click on the VM name and select `Close > Poweroff`.
|
||||
|
||||
![Poweroff Virtual machine][36]
|
||||
|
||||
#### How to delete Ubuntu and remove all data
|
||||
|
||||
- If you want to delete the Virtual machine entirely (.e.g. Ubuntu) and its data, select `Remove` and `delete all files`.
|
||||
|
||||
![Select remove to delete a VM][37]
|
||||
|
||||
![Select the delete options][38]
|
||||
|
||||
### Close notes
|
||||
|
||||
In this tutorial, you learned the easiest way to install Ubuntu on Windows (10 or 11) using VirtualBox. Also, you learned several post-install basic steps to configure the Ubuntu VM. You can use the above steps for any other Linux distributions in VirtualBox.
|
||||
|
||||
Feel free to comment below if you have any problems or questions.
|
||||
|
||||
[Next:How to Install Python on Windows [Beginner’s Guide]][39]
|
||||
|
||||
[_Using Mastodon? Follow us at floss.social/@debugpoint_][40]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/install-ubuntu-windows-virtualbox/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/tag/virtualbox
|
||||
[2]: https://www.debugpoint.com#presteps
|
||||
[3]: https://www.debugpoint.com#download-items
|
||||
[4]: https://www.debugpoint.com#install-virtualbox
|
||||
[5]: https://www.debugpoint.com#install-ubuntu
|
||||
[6]: https://www.debugpoint.com#post-install-steps
|
||||
[7]: https://ubuntu.com/download/desktop
|
||||
[8]: https://www.virtualbox.org/wiki/Downloads
|
||||
[9]: https://www.debugpoint.com/wp-content/uploads/2023/01/Download-location-for-VirtualBox-for-Windows.jpg
|
||||
[10]: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170
|
||||
[11]: https://www.debugpoint.com/wp-content/uploads/2023/01/Download-the-dependency-for-VirtualBox.jpg
|
||||
[12]: https://www.debugpoint.com/wp-content/uploads/2023/01/Install-the-dependency-for-VirtualBox.jpg
|
||||
[13]: https://www.python.org/downloads/windows/
|
||||
[14]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-VirtualBox-from-start-menu.jpg
|
||||
[15]: https://www.debugpoint.com/virtualbox-id-password/
|
||||
[16]: https://www.debugpoint.com/wp-content/uploads/2023/01/Click-on-New.jpg
|
||||
[17]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-the-ISO-file.jpg
|
||||
[18]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-Hardware.jpg
|
||||
[19]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-Hard-Disk.jpg
|
||||
[20]: https://www.debugpoint.com/wp-content/uploads/2023/01/Boot-Ubuntu-in-VirtualBox.jpg
|
||||
[21]: https://www.debugpoint.com/wp-content/uploads/2023/01/1-Select-Try-Ubuntu.jpg
|
||||
[22]: https://www.debugpoint.com/wp-content/uploads/2023/01/2-Ubuntu-LIVE-desktop-1.jpg
|
||||
[23]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-Language.jpg
|
||||
[24]: https://www.debugpoint.com/wp-content/uploads/2023/01/4-Select-Keybaord-Layout.jpg
|
||||
[25]: https://www.debugpoint.com/wp-content/uploads/2023/01/5-Select-install-options.jpg
|
||||
[26]: https://www.debugpoint.com/wp-content/uploads/2023/01/6-Installation-Type.jpg
|
||||
[27]: https://www.debugpoint.com/wp-content/uploads/2023/01/7-Write-changes-to-disk.jpg
|
||||
[28]: https://www.debugpoint.com/wp-content/uploads/2023/01/8-User-account-creation.jpg
|
||||
[29]: https://www.debugpoint.com/wp-content/uploads/2023/01/10-Ubuntu-Installation-is-complete.jpg
|
||||
[30]: https://www.debugpoint.com/wp-content/uploads/2023/01/11-Log-on-to-Ubuntu.jpg
|
||||
[31]: https://www.debugpoint.com/wp-content/uploads/2023/01/12-Ubuntu-running-in-Windows-using-Virtualbox-2048x1280.jpg
|
||||
[32]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-Guest-addition-from-the-menu.jpg
|
||||
[33]: https://www.debugpoint.com/wp-content/uploads/2023/01/Open-the-mounted-disc-and-select-option-with-terminal.jpg
|
||||
[34]: https://www.debugpoint.com/wp-content/uploads/2023/01/VirtualBox-guest-addition-install-for-Windows-host.jpg
|
||||
[35]: https://www.debugpoint.com/wp-content/uploads/2023/01/Enable-clipboard-sharing.jpg
|
||||
[36]: https://www.debugpoint.com/wp-content/uploads/2023/01/Poweroff-Virtual-machine.jpg
|
||||
[37]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-remove-to-delete-a-VM.jpg
|
||||
[38]: https://www.debugpoint.com/wp-content/uploads/2023/01/Select-the-delete-options.jpg
|
||||
[39]: https://www.debugpoint.com/install-python-windows/
|
||||
[40]: https://floss.social/@debugpoint
|
@ -0,0 +1,147 @@
|
||||
[#]: subject: "How to Install Python on Windows [Beginner’s Guide]"
|
||||
[#]: via: "https://www.debugpoint.com/install-python-windows/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Install Python on Windows [Beginner’s Guide]
|
||||
======
|
||||
|
||||
**This simple guide demonstrates how to download and install Python on Windows.**
|
||||
|
||||
This article is tested with the latest Python 3.11 stable version.
|
||||
|
||||
Before you learn how to install Python on Windows, you might want to check how you can [install it easily][1] on Linux distributions such as Ubuntu. It’s better to try Python in Linux if you are planning to be a developer. That being said, you might want to check [how to install Linux (such as Ubuntu) alongside Windows][2].
|
||||
|
||||
Python is a popular general-purpose programming language which becomes the developer’s choice in the past decade. And its popularity is increasing every day. it is widely used for web development, complex systems, data science, machine learning and all areas of science.
|
||||
|
||||
There are two versions of Python that you may come across. Python2 is currently out of support. And the Python3 series is the ongoing support release.
|
||||
|
||||
### Check whether Python is installed
|
||||
|
||||
Before you install it on Windows, you should check whether it is already installed. In general, it should not be installed, unlike in Ubuntu (and other Linux distributions), where Python comes pre-installed.
|
||||
|
||||
From the start menu, open “command prompt”.
|
||||
|
||||
And type the following:
|
||||
|
||||
```
|
||||
python --version
|
||||
```
|
||||
|
||||
If Python is available, it will show you a message with the version details.
|
||||
|
||||
### Download and Install Python
|
||||
|
||||
Open the below official Python download page.
|
||||
|
||||
[Download Python][3]
|
||||
|
||||
![How to locate Python set up][4]
|
||||
|
||||
At the top, you should see the current stable version. Click on the download link. If you are looking for any specific version, scroll down on this page and download the specific version under the label “Python releases by version number:”.
|
||||
|
||||
After downloading, go to the Downloads folder and run the setup.
|
||||
|
||||
Follow the on-screen instructions to install it.
|
||||
|
||||
![Install Python step 1][5]
|
||||
|
||||
![Install Python step 2][6]
|
||||
|
||||
After installation is complete, verify the Python version.
|
||||
|
||||
### Verify Python Version
|
||||
|
||||
From the start menu, open “command prompt” and run the following command.
|
||||
|
||||
```
|
||||
python --version
|
||||
```
|
||||
|
||||
![Python version on Windows][7]
|
||||
|
||||
You should see your system’s currently installed version of the Python package. Alternatively, you can also run below to get a Python interactive shell.
|
||||
|
||||
```
|
||||
python
|
||||
```
|
||||
|
||||
You can exit the shell using CTRL+Z and Enter.
|
||||
|
||||
### Check PATH Variables
|
||||
|
||||
You should check the system variable PATH with the Python executable location. This should be updated automatically using the installer.
|
||||
|
||||
From the start menu, search “system variables” and open it.
|
||||
|
||||
![Open Environment variable Settings][8]
|
||||
|
||||
In the System Properties Dialog, click on `Advanced > Environment Variables`. Under the user variables section against the Path variable, check whether the Python installed location is present. Refer to the below image for a guideline.
|
||||
|
||||
If you see all the path is present, you are all set to run your Python project.
|
||||
|
||||
![Check Python Environment PATH Values in Windows][9]
|
||||
|
||||
### Create and run your first Python program
|
||||
|
||||
For an additional step, here’s how you can code & run your first Python program. You should ideally use any [recommended Python editor][10] to write your program.
|
||||
|
||||
Here’s a simple program which outputs the text “debugpoint.com” in the console.
|
||||
|
||||
```
|
||||
# Sample Python program
|
||||
print("debugpoint.com")
|
||||
```
|
||||
|
||||
Save the file with any name. Here I have saved it as “hello.py” in E drive. The .py is the extension of Python source codes.
|
||||
|
||||
To run this program, open a command prompt and execute below inside E drive.
|
||||
|
||||
```
|
||||
python hello.py
|
||||
```
|
||||
|
||||
**Output:**
|
||||
|
||||
![Running a simple Python program in Windows][11]
|
||||
|
||||
### Closing Notes
|
||||
|
||||
I hope this simple beginner’s guide helps you to install Python in Windows, verify the installation and run your first program.
|
||||
|
||||
Please let me know if you run into issues in the comment box below.
|
||||
|
||||
[Next:Share Folder Between Guest and Host in virt-manager (KVM/Qemu/libvirt)][12]
|
||||
|
||||
[_Using Mastodon? Follow us at floss.social/@debugpoint_][13]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/install-python-windows/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/install-python-3-11-ubuntu/
|
||||
[2]: https://www.debugpoint.com/complete-guide-how-dual-boot-ubuntu-windows/
|
||||
[3]: https://www.python.org/downloads/
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2023/01/How-to-locate-Python-set-up.jpg
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Install-Python-step-1.jpg
|
||||
[6]: https://www.debugpoint.com/wp-content/uploads/2023/01/Install-Python-step-2.jpg
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2023/01/Python-version-on-Windows.jpg
|
||||
[8]: https://www.debugpoint.com/wp-content/uploads/2023/01/Open-Environment-variable-Settings.jpg
|
||||
[9]: https://www.debugpoint.com/wp-content/uploads/2023/01/Check-Python-Environment-PATH-Values-in-Windows.jpg
|
||||
[10]: https://www.debugpoint.com/5-best-python-ide-code-editor/
|
||||
[11]: https://www.debugpoint.com/wp-content/uploads/2023/01/Running-a-simple-Python-program-in-Windows.jpg
|
||||
[12]: https://www.debugpoint.com/share-folder-virt-manager/
|
||||
[13]: https://floss.social/@debugpoint
|
@ -0,0 +1,110 @@
|
||||
[#]: subject: "Share Folder Between Guest and Host in virt-manager (KVM/Qemu/libvirt)"
|
||||
[#]: via: "https://www.debugpoint.com/share-folder-virt-manager/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Share Folder Between Guest and Host in virt-manager (KVM/Qemu/libvirt)
|
||||
======
|
||||
|
||||
**In this guide, you will learn how to share a folder between host and guest in virt-manager using KVM, QEMU and libvirt.**
|
||||
|
||||
The [virt-manager][1] application or package uses the [libvirt][2] library to provide virtual machine management services. It has a desktop interface that helps to create, delete, and manage multiple virtual machines.
|
||||
|
||||
The virt-manager desktop interface and its components provide flexible virtual machine management services for various personal and business use cases. it is a free and open-source application primarily used for KVM virtual machines. However, it can also support other hypervisors such as Xen and LXC.
|
||||
|
||||
In the earlier article, I explained [how to create a virtual machine using virt-manager][3]. This article covers how you can seamlessly access files and folders between guest and host virtual machines.
|
||||
|
||||
### A note about virtiofs
|
||||
|
||||
The sharing files and folders are powered by the libvirt shared file system called virtiofs. It provides all the features and parameters to access the directory tree on the host machine. Since most of the virt-manager virtual machine configurations are translated to XML, the share files/folders can also be specified by the XML file.
|
||||
|
||||
### Share folder in virt-manager
|
||||
|
||||
- First, make sure your guest virtual machine is powered off. From the virt-manager GUI, select the virtual machine and click on Open to pull up the console settings.
|
||||
|
||||
![Open the settings][4]
|
||||
|
||||
- Click on the icon which says show virtual hardware details in the toolbar. And then click on **Memory** on the left panel.
|
||||
- Select the option “**Enable shared memory**“. Click Apply.
|
||||
|
||||
![Enable the shared memory option][5]
|
||||
|
||||
- And then click “Add hardware” at the bottom.
|
||||
|
||||
![Click on add hardware][6]
|
||||
|
||||
- Select **File system** from the left panel in the add new hardware window.
|
||||
- Then select **Driver=virtiofs** in the details tab. Click on `browse > browse local` and **select the host path** you want to access inside the guest VM.
|
||||
- In the target path, mention any name you want. It’s just a file tag which will be used during mount.
|
||||
- So, if I want to access the Pictures/Screenshots folder (`/home/debugpoint/Pictures/Screenshots`), sample settings could be the following:
|
||||
|
||||
![Add a new file system hardware][7]
|
||||
|
||||
The XML settings are below for the above configuration. You can find it in the XML tab.
|
||||
|
||||
```
|
||||
<filesystem type="mount" accessmode="passthrough">
|
||||
<driver type="virtiofs"/>
|
||||
<binary path="/usr/libexec/virtiofsd"/>
|
||||
<source dir="/home/debugpoint/Pictures/Screenshots"/>
|
||||
<target dir="mount_tag_pictures"/>
|
||||
<alias name="fs1"/>
|
||||
<address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
|
||||
</filesystem>
|
||||
```
|
||||
|
||||
Click on Finish. In the main virt-manager window, right-click on the VM and click Run to start the virtual machine. Make sure to click on the “show the graphical console” (monitor icon in the toolbar – if the VM is not showing.
|
||||
|
||||
In the guest machine, create a folder where you want to mount the host folder. For this example, I have used /mnt/pictures.
|
||||
|
||||
```
|
||||
sudo mkdir /mnt/pictures
|
||||
```
|
||||
|
||||
And finally, mount the host folder using the tag you created in the above step to this new folder. Use the following command to do that from the terminal. Ensure to change the tag and folder name in the below command as your system.
|
||||
|
||||
```
|
||||
sudo mount -t virtiofs mount_tag_pictures /mnt/pictures
|
||||
```
|
||||
|
||||
Now you can browse the folders and add/delete items seamlessly in virt-manager between host and guest.
|
||||
|
||||
![Access host files from virt-manager guest][8]
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
I hope this solution helps you to access host files and folders from the guest machine. Remember, your user Id, which is used to launch the virt-manager app, should have the same access to the host folder.
|
||||
|
||||
If you run into any errors, the above guide helped you drop a note below.
|
||||
|
||||
_[Reference][9]_
|
||||
|
||||
[_Using Mastodon? Follow us at floss.social/@debugpoint_][10]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/share-folder-virt-manager/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://virt-manager.org/
|
||||
[2]: https://libvirt.org/manpages/libvirtd.html
|
||||
[3]: https://www.debugpoint.com/virt-manager/
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2023/01/Open-the-settings.jpg
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Enable-the-shared-memory-option.jpg
|
||||
[6]: https://www.debugpoint.com/wp-content/uploads/2023/01/Click-on-add-hardware.jpg
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2023/01/Add-a-new-file-system-hardware.jpg
|
||||
[8]: https://www.debugpoint.com/wp-content/uploads/2023/01/Access-host-files-from-virt-manager-guest.jpg
|
||||
[9]: https://libvirt.org/kbase/virtiofs.html
|
||||
[10]: https://floss.social/@debugpoint
|
151
sources/tech/20230114.0 ⭐️ A 4-minute guide to Java loops.md
Normal file
151
sources/tech/20230114.0 ⭐️ A 4-minute guide to Java loops.md
Normal file
@ -0,0 +1,151 @@
|
||||
[#]: subject: "A 4-minute guide to Java loops"
|
||||
[#]: via: "https://opensource.com/article/23/1/java-loops"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
A 4-minute guide to Java loops
|
||||
======
|
||||
|
||||
A while loop performs a set of tasks for as long as some predefined condition is true. This is considered a control structure that directs the flow of a program. It's a way for you to tell your code what to do by defining a condition that it can test, and take action based on what it finds. The two kinds of while loops in Java are while and do while.
|
||||
|
||||
### Java while loop
|
||||
|
||||
A while loop is meant to iterate over data until some condition is satisfied. To create a while loop, you provide a condition that can be tested, followed by the code you want to run. Java has several built-in test functions, the simplest of which are mathematical operators (`<`, `>`, `==`, and so on):
|
||||
|
||||
```
|
||||
package com.opensource.example;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
|
||||
int count = 0;
|
||||
while (count < 5) {
|
||||
System.out.printf("%d ", count);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In this simple example, the condition is that the variable `count` is less than 5. Because `count` is instantiated at 0, and then incremented by 1 in the code within the while loop, the program iterates a total of 5 times:
|
||||
|
||||
```
|
||||
$ java ./while.java
|
||||
0 1 2 3 4
|
||||
```
|
||||
|
||||
Before it can iterate a sixth time, the condition is no longer true, so the loop ends.
|
||||
|
||||
The conditional statement for a while loop is vital. Getting it wrong could mean that your loop never executes. For instance, suppose you had set `count == 5` as the condition:
|
||||
|
||||
```
|
||||
while (count == 5) {
|
||||
System.out.printf("%d ", count);
|
||||
count++;
|
||||
```
|
||||
|
||||
When you run the code, it builds and runs successfully, but nothing happens:
|
||||
|
||||
```
|
||||
$ java ./while.java
|
||||
$
|
||||
```
|
||||
|
||||
The loop has been skipped because `count` was set to 0, and it's still 0 at the moment the while loop is first encountered. The loop never has a reason to start and `count` is never incremented.
|
||||
|
||||
The reverse of this is when a condition starts as true and can never be false, this results in an infinite loop.
|
||||
|
||||
### Java do while loop
|
||||
|
||||
Similar to the while loop, a do while loop tests for the conditional at the end, not the beginning, of each iteration. With this, the code in your loop runs at least once because there's no gateway to entry, only a gateway to exit:
|
||||
|
||||
```
|
||||
package com.opensource.example;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
|
||||
int count = 9;
|
||||
do {
|
||||
System.out.printf("%d ", count);
|
||||
count++;
|
||||
} while(count == 5);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In this sample code, `count` is set to 9. The condition for the loop to repeat is that `count` is equal to 5. But 9 isn't equal to 5. That check isn't performed until the end of the first iteration, though:
|
||||
|
||||
```
|
||||
$ java ./do.java
|
||||
9
|
||||
```
|
||||
|
||||
### Java infinite loops
|
||||
|
||||
An infinite loop, as its name suggests, never ends. Sometimes they're created by mistake, but an infinite loop does have a valid use case. Sometimes you want a process to continue indefinitely (that's functionally infinite because you can't guarantee when you need it to stop), and so you might set your condition to something impossible to meet.
|
||||
|
||||
Suppose you've written an application that counts the number of zombies remaining in your neighborhood during a zombie apocalypse. To simulate uncertainty over how many loops are required to get to 0 zombies, my demo code retrieves a timestamp from the operating system and sets the value of the counter (`c`) to some number derived from that timestamp. Because this is a simple example and you don't really want to get trapped in an infinite loop, this code counts down to zero and uses the `break` function to force the loop to end:
|
||||
|
||||
```
|
||||
package com.opensource.example;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
|
||||
long myTime = System.currentTimeMillis();
|
||||
|
||||
int c;
|
||||
|
||||
if ( myTime%2 == 0 ) {
|
||||
c = 128;
|
||||
} else {
|
||||
c = 1024;
|
||||
}
|
||||
|
||||
while(true) {
|
||||
System.out.printf("%d Zombies\n", c);
|
||||
|
||||
// break for convenience
|
||||
if ( c <= 0 ) { break; }
|
||||
c--;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You may have to run it a few times to trigger a different total number of zombies, but sometimes your program iterates 128 times and other times 1,024 times:
|
||||
|
||||
```
|
||||
$ java ./zcount.java
|
||||
1024 Zombies
|
||||
1023 Zombies
|
||||
[...]
|
||||
0 Zombies
|
||||
```
|
||||
|
||||
Can you tell why the loops end at 0 and not at -1?
|
||||
|
||||
### Java loops
|
||||
|
||||
Loops give you control over the flow of your program's execution. Iteration is common in programming, and whether you use a while loop, a do while loop, or an infinite loop, understanding how loops work is vital.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/1/java-loops
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lkxed
|
||||
|
||||
|
146
translated/talk/20190331 Codecademy vs. The BBC Micro.md
Normal file
146
translated/talk/20190331 Codecademy vs. The BBC Micro.md
Normal file
@ -0,0 +1,146 @@
|
||||
[#]: subject: "Codecademy vs. The BBC Micro"
|
||||
[#]: via: "https://twobithistory.org/2019/03/31/bbc-micro.html"
|
||||
[#]: author: "Two-Bit History https://twobithistory.org"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "CanYellow"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
[BBC Micro][T2] 比之 [Codecademy][T1]
|
||||
======
|
||||
|
||||
20世纪70年代末期,计算机突然成为了某种普罗大众能够买回家的商品;而此前的几十年间,它一直只是听命于企业霸主的神秘而笨重的机器。少数狂热的爱好者注意到了这是多么吸引人并争相购买了属于自己的计算机。对更多的人而言,微形计算机的到来引发了对未来的无助焦虑。同时期的杂志上的一则广告承诺一台家用计算机将“让您的孩子在学校享有不公平的优势”。广告中展示了一位打着领带,身着时髦的西装外套的男孩子急切地举手回答问题,在他身后,他的显得不那么聪明的同学们闷闷不乐地望着他。这则广告以及其它与之类似的广告表明世界正在疾速改变,而如果你不立即学习如何使用这些令人生畏的新设备之一,你和你的家人就会被时代所抛弃。
|
||||
|
||||
在英国,这些焦虑转化为政府高层对国家竞争力的担忧。从各种意义上,20世纪70年代对英国来说都是平平无奇的十年,通胀与失业率高企。与此同时,一系列的罢工让伦敦陷于一次又一次的停电中。一篇1979年的政府报告焦虑:没有跟上计算机技术浪潮将“为我们糟糕的工业表现平添又一个影响因素”[1][1]。英国似乎已经在计算机技术的角逐中落后了——所有的大型的计算机公司都是美国的,而集成电路则在日本和中国台湾制造。
|
||||
|
||||
BBC(英国广播公司)——由政府建立的公共服务广播公司——作出了一个大胆的举动,决定通过帮助英国人战胜他们对计算机的反感来解决英国的国家竞争力问题。BBC 发起了 [_Computer Literacy Project(计算机认知计划)_][T3],该计划包括多个教育方向的努力:几部电视系列片,一些相关书籍,一张支持团队网络以及一款名为 BBC Micro 的特别定制的微型计算机。该项目是如此成功以致于到1983年[ BYTE 杂志][T4]的一名编辑写道:“与美国相比,有更多的英国人对微型计算机感兴趣。”[2][2] 这名编辑惊讶于英国的 Fifth Personal Computer World Show(第五届个人电脑世界展) 比当年的西海岸电脑展的人数更多。超过六分之一的英国人观看了由 _Computer Literacy Project_ 制作的第一部电视系列片的一集并最终售出了150万台 BBC Micro 微型计算机。[3][3]
|
||||
|
||||
去年,一份包括了由 _Computer Literacy Project_ 出版的所有材料与制作的每一部电视系列片的[档案][4]发布在了互联网上。我抱着极大的兴趣观看这些电视系列片并试图想象在20世纪80年代早期学习电脑使用是什么图景。不过我发现更有兴趣的是时年是如何教授电脑使用的。今天,我们仍然担心技术发展使人们落伍。富有的科技企业家与政府花费大量的资金试图教孩子们“编程”。我们拥有诸如 Codecademy 这样的通过新技术的运用进行交互式编程教学的网站。我们可能假定这种方式比80年代的呆板的电视系列片更高效,不过真的是这样吗?
|
||||
|
||||
### [Computer Literacy Project][T3] (计算机认知计划)
|
||||
|
||||
微型计算机革命始于1975年 [Altair 8800][5] 的发布。两年后,Apple II,TRS-80 以及 Commodore PET 都相继发布。全新的计算机的销量爆发式增长。1978年,BBC 在一部名为["Now the Chips Are Down"][T5](《芯片来了》)(译者注:对于非英国区域的读者,可以在[这里][T6]观看该纪录片) 的纪录片中探讨了这种新的机器必将带来的剧烈的社会变革。
|
||||
|
||||
该纪录片充满担忧。在前5分钟内,解说员提到这种微电子器件将“彻底改变我们的生活方式”。随着诡异的合成音乐的播放以及屏幕上绿色的电脉冲在放大后的芯片上起舞,解说员进一步说这种芯片“正是日本放弃造船业的原因,也将成为我们的孩子们长大后失业的原因”。纪录片继续探讨了机器人如何用于汽车自动化组装以及欧洲的手表工业如何在与美国的电子表工业竞争中败下阵来。它斥责了英国政府在应对未来的大规模失业的准备上做得不够。
|
||||
|
||||
该纪录片据信可能在英国议会上展示过。[4][6] 包括工业署和人力服务委员会在内的一些政府代表开始有兴趣尝试提高英国公众对计算机的认识。人力服务委员会为来自 BBC 的教育部门的一个团队到日本、美国以及其他国家的实地考察提供了资助。该研究团队完成了一份历数微电子技术在工业制造、人力关系与办公室工作等领域最终将意味着哪些方面的重大改变的研究报告。70年代末,BBC 决定制作一部帮助普通英国人“学习如何使用和控制计算机,避免产生被计算机支配的感受”的十集电视系列片[5][7] 。这一努力最终成为了一个与_Adult Literacy Project_(成人扫盲计划)相似的多媒体项目。_Adult Literacy Project_是 BBC 此前进行的一项涉及电视系列片以及辅助课程的帮助两百万人提高他们的阅读能力的项目。
|
||||
|
||||
_Computer Literacy Project_ 背后的制作方热衷于以“实操”示例为特色的电视系列片。这样如果观众拥有一台微型计算机在家里,他们就可以亲自动手尝试。这些例子不得不都是基于 BASIC 语言的,因为这是在几乎所有的微型计算机上都使用的编程语言 (实际是整个交互界面(shell))。但是制作方面临一个棘手的问题:微型计算机制造商均拥有他们自己的 BASIC 方言,因此不论他们选择哪一种方言,他们都不可避免地疏远大部分的观众。唯一切实可行的方案是创造一种全新的 BASIC 方言——BBC BASIC——以及与之配合使用的微型计算机。英国公众就可以购买这种全新的微型计算机并依照示例操作而不需要担心软硬件上的差异带来的问题。
|
||||
|
||||
BBC 的制作人与节目主持人并不具备自行制造微型计算机的能力,因此他们汇总了一份他们预期的计算机的规范并邀请英国的微型计算机公司推出满足该规范要求的新机器。这份规范要求一种相对更强劲的计算机,因为 BBC 的制作方认为相应的设备应当能够运行真实有用的应用程序。_Computer Literacy Project_的技术顾问也是如此建议:如果必须要教授全体国人一种 BASIC 方言的话,那么最好选择表现良好的(他们可能没有完全那样说,不过我认为这就是他们的真实想法)。BBS BASIC 通过允许递归调用与局部变量弥补了一些 BASIC 语言的常见缺点。[6][8]
|
||||
|
||||
BBC 最终决定由坐落于剑桥的 Acorn Computers 公司(中文网络译名:艾康电脑)制造 BBC Micro 计算机。在选择 Acorn 公司的时候,BBC 并未考虑来自经营 Sinclair Research 公司的 [Clive Sinclair][T7] 的申请,Sinclair Research 公司凭借 Sinclair ZX80 微型计算机的推出在1980年将微型计算机的大众市场引入了英国。Sinclair 公司的新产品,ZX81,虽然更便宜但是性能不足以满足 BBC 的要求。Acorn 的新型的内部称为 Proton 原型计算机更加昂贵但是性能更好,更具备扩展性,BBC 对此印象深刻。该型号的计算机从未作为 Proton 进行营销与销售,Acorn 公司代之以 BBC Micro 的名称在1981年12月发布。BBC Micro 又被亲切地称为“The Beeb”,你可以以235英磅的价格购得其16k内存的版本或者以335英磅的价格获得其32k内存的版本。
|
||||
|
||||
1980年,Acorn 是英国计算机工业的失败者,但是 BBC Micro 成就了 Acorn 公司的传统。时至今日,世界范围内最流行的微处理器指令集是 ARM 架构,“ARM”如今表示“Advanced RISC Machine”(先进 RISC 架构设备),然而最初它代表的是“Acorn RISC Machine”(Acorn RISC 架构设备)。ARM 架构背后的 ARM Holding(ARM 公司) 就是 Acorn 公司在1990年之后的延续。
|
||||
|
||||
![Picture of the BBC Micro.][9] _BBC Micro 的一幅拙劣图片,我摄于美国加州山景城(Mountain View)的计算机历史博物馆(Computer History Museum)_
|
||||
|
||||
|
||||
### 名为“The Computer Programme”(计算机程序)的电视系列片
|
||||
|
||||
十几个不同的电视系列片最终作为_Computer Literacy Project_的一部分创作出来。第一部作品是一部名为 _The Computer Programme_(计算机程序) 的十集电视系列片。该系列片在1982年初播出了十周。一百万人每周晚上收看该节目,另有25万人收看该节目在每周日与周一下午的重播。
|
||||
|
||||
这一电视节目有两名主持人,Chris Serle 和 Ian McNaught-Davis。Serle 扮演初学者,而 McNaught-Davis 扮演具有大型计算机编程职业经验的专家,这是一个启发性的配置。该节目造就了[略显尴尬的过渡][10]——Serle 经常直接从与 McNaught-Davis 的对话中过渡到面向镜头的边走边说的讲述,此时你不禁会疑惑 McNaught-Davis 是否还站在画面之外。不过这意味着 Serle 可以表达观众肯定会有的关注。他可能会惊恐地看着满屏的 BASIC 语言并提出类似“这些美元符号是什么意思”的问题。在节目中的某些时刻,Serle 与 McNaught-Davis 会坐在电脑前进行事实上的结对编程。McNaught-Davis 会在不同的地方留下一些线索,而 Serle 则试图将它们弄清楚。如果这一节目仅仅由一个无所不知的讲述者主持,它将更难以理解。
|
||||
|
||||
该节目也在努力展示计算在普通人生活中的实际应用。到80年代早期,家庭电脑已经开始与小孩子和电子游戏联系在一起。_Computer Literacy Project_ 的制作方试图避免采访“令人印象深刻的有能力的年轻人”,因为这可能会“加剧老年观众的焦虑”,而该节目正是试图吸引这一人群对计算感兴趣[7][11]。在该系列的第一集中,该节目的“现场”记者 Gill Nevill 采访了一名购买了一台 Commodore PET 电脑用于辅助管理她的糖果店的女性。这名名叫 Phyllis 的女性受访者看上去大约60多岁,她在使用 PET 完成她的会计工作上不存在任何问题,甚至开始使用 PET 为其他企业做计算工作,这听上去像是一个有前途的自由职业的开端。Phyllis 说她并不介意电脑工作逐步取代她的糖果店生意,因为她更喜欢电脑工作。画面接着变成了对一名青少年的采访,他介绍了他是如何修改 _[Breakout][T8]_ 这款电子游戏以使之运行更快并更具挑战性,不过这几乎鼓舞不了任何人。另一方面,如果人群中的 Phyllis 也会使用电脑,那么你当然也可以。
|
||||
|
||||
虽然该节目的特色是大量的 BASIC 编程,不过它实际想要教给观众的是计算机通常是如何工作的。该节目通过类比的方法解释了其中的一般原则。在第二集中有一个关于[Jacquard][T9]织机(译注:中文网络译为雅卡尔提布机)的讨论。Jacquard 织机实现了两件事。其一,它揭示了计算机并不仅仅基于过去发明的神秘技术——计算的一些基本原则可以上溯到两百年前,就跟你可以在纸上打孔来控制纺织机的想法一样简单。其二,经线与纬线的交织用于解释选择二进制(即纬线是从上方还是下方穿过经线)是如何在重复了一次又一次之后足以产生巨大变化的。当然,节目接下来继续讨论信息是如何使用二进制存储的。
|
||||
|
||||
在该节目中接下来是有关一件能够播放在一卷长长的分段的打孔卡片上编码的音乐的蒸汽风琴的小节。这个类比用以解释 BASIC 中的子程序。Serle 与 McNaught-Davis 将整卷的打孔卡片摊开在工作室的地板上,然后指出看上去像是重复的副歌的分段。McNaught-Davis 解释说,如果你将这些重复的卡片分段剪下而插入一个回到第一次播放副歌的分段的指令,这就是子程序。这是一个绝妙的解释并将可能在听众的脑海中久久挥之不去。
|
||||
|
||||
我仅仅摘录了一些例子,不过我认为总的来看该节目尤为擅长通过解释计算机实现功能所依赖的原则使计算机不再神秘。这一节目本可以致力于 BASIC 教学,不过它并没有这样做。这被证明是一个相当明智的选择。在1983年写就的一篇回忆文章中,_Computer Literacy Project_的总制作人 John Radcliffe 如是写道:
|
||||
|
||||
> 如果计算机将如我们所相信的那样重要,对这一主题的真正理解对每个人都很重要,可能会几乎与文字读写能力同等重要。不管是在我们这里还是在美国,在计算机认知的主要路线上的早期思路均集中于编程上。然而随着我们思想的发展,我们意识到“亲自”体验在个人计算机上的价值,我们开始降低对编程的重视,而更多的强调广泛的理解,将微型计算机与大型计算机联系起来,鼓励人们获取一系列应用程序与高级语言的经验,并将这些经验同现实世界中的工业与商业活动中的经验联系起来…… 我们相信一旦人们掌握了这些原则,简单地说,它们将可以进一步深入该主题。
|
||||
|
||||
接下来, Radcliffe writes 又以类似的方式写道:
|
||||
|
||||
> 围绕着这一电视系列片的主要阐释目标有很多的争论。一个思想流派认为在使用微型计算机上的实用细节上给予建议对本项目而言尤为重要。但我们已经有了结论,如果这一电视系列片能够拥有可持续性的教育价值,它必须成为一条通过解释计算原则来进入真实的计算世界的路径。这必须通过对微型计算机的室内演示,通过类比方式解释其中的原则,真实生活中的实际应用的影片展示这三者的结合实现。不仅仅是微型计算机,小型机以及大型机也将被展示。
|
||||
|
||||
我喜爱这一系列片,尤其是其中关于小型机与大型机的部分。_Computer Literacy Project_ 背后的制作方旨在帮助英国找准定位:计算身处何处又去向何方?计算机现在能做什么,未来又能做什么?学习一些 BASIC 语言是回答这些问题的一个部分,但是仅仅理解 BASIC 语言似乎是不足以使人们认知计算机的。
|
||||
|
||||
### 今天的计算机认知
|
||||
|
||||
如果你现在搜索“学习编程”,你看到的排在第一的是指向 Codecademy 网站的链接。如果要说存在一个“计算机认知计划”的现代替代品——存在相同的影响与目标,那就是 Codecademy。
|
||||
|
||||
对于普通人而言“Learn to code”(学习编程)是 Codecademy 的口号。我认为我不是第一个指出这一点的人——事实上我曾经在某个地方见到过这一点,只是现在拿来用而已。但是这里使用的是“code”(代码)而非“编程”,这说明了一些问题。这表明你学习的重要内容是如何读懂代码,如何阅读满屏的 Python 代码的价值而不是目光呆滞、不知所云。我能够理解为什么对于普通人而言这似乎是成为专业程序员的主要障碍。专业程序员整日盯着布满编程术语的电脑屏幕,如果我想要成为一个专业程序员,我最好确保我能够理解这些术语。但是理解语法并不是成为程序员的最大的挑战。面对更多更大的障碍,它很快将变成微不足道的。仅仅以掌握一门编程语言的语法为目标,你可能能够 _阅读_ 代码但是无法做到 _编写_ 代码解决全新的问题。
|
||||
|
||||
我最近浏览了 Codecademy 的 “Code Foundations”(编程基础) 课程。如果你对编程感兴趣(而不是网页开发或者数据科学)并且没有任何编程经验,这是 Codecademy 推荐你学习的课程。里面有几节关于计算机科学史的课时,不过都是流于表面而没有深入研究。(感谢上帝,一位高尚的互联网秩序义务维护者指出了其中存在的一个特别恶劣的错误)。该课程的主要目的是教授你编程语言的通用结构要素:变量、函数、控制流、循环等。换句话说,该课程聚焦于为了开始理解编程术语中的模式你所需要知道的内容。
|
||||
|
||||
公平地看,Codecademy 也提供其他内容深入的课程。但是即使是如 “Computer Science Path”(计算机科学之路) 这样的课程也几乎只仅仅专注于编程以及程序中表达的概念。有人可能会反驳说这就是重点—— Codecademy 的主要特点就是提供给你一些交互式的带有自动反馈的编程课程。在有限的自动化课程中能够灌输给学员的内容只有这么多,因此学员的脑海里也没有更多的空间容纳更多其他的内容。但是负责启动 _Computer Literacy Project_ 的 BBC 的制作人也面临同样的问题。他们意识到受限于他们的传播媒介,“通过电视节目所能获得的学习内容的容量也是受限的”[8][13]。虽然在他们所能传达的信息总量上存在相似的限制,但是 BBC 的制作人选择强调在学习 BASIC 语言上的一般原则。Codecademy 就不能将其中一两节交互式可视化的课时替换为编织经线与纬线的 Jacquard 织机的案例吗?
|
||||
|
||||
我一直在大声鼓吹“一般原则”,因此让我再解释下我认为的一般原则是什么以及为什么它们如此重要。J. Clark Scott 出了一本有关计算机的书,书名为 _But How Do It Know?_(但是它怎么知道)。这个书名来自书的序言里的一则笑话:一个店员向人群推销保温瓶,说保温瓶可以让热食始终是热的,冷食始终是冷的。一名听众对这个新发明感到惊讶,问道,但是它怎么知道(根据你给它的食物类型的不同选择做相应的事情呢)?笑点在于保温瓶当然不能感知食物的温度然后据此做出决定——保温瓶仅仅制作成保证冷食必然保持冷的,热食必然保持热的就可以了。人们也以(笑话中的那个听众)一样的方式看待计算机,相信计算机就是能够基于提供给它们的代码“选择”做一件事或者另一件事的数字大脑。但是了解一些有关计算机如何工作的知识,哪怕是很初级水平的理解,也能让(人们理解中的)计算机摆脱(做判断的)侏儒。这就是为什么 Jacquard 织机是一个很好的有助理解的例子。一开始它似乎是一种难以置信的设备,它读取打孔卡片,然后以某种方式“知道”编织正确的样式。现实是显而易见的:每一行孔都对应一根线,而一行中有孔的地方对应着提起的线。理解了这些虽然不会有助于你用电脑完成新的事情,但是将使你自信于你不是在跟某些神秘事物打交道。我们应当尽快将这种自信的感受传授给初学者。
|
||||
|
||||
唉,真实存在的问题是可能没有人想要了解 Jacquard 织机。根据 Codecademy 如何强调他们教授的专业应用来判断,很多人开始使用 Codecademy 可能是因为他们相信这有助于“提升”他们的职业生涯。他们没有来由地相信首要的问题是理解编程的专业术语,因此他们才想要 “Learn to code”。他们想要在他们所拥用的每天晚上晚餐与就寝之间的一两个小时里尽快做这件事。Codecademy 毕竟只是一门投其所好的生意而非一些有关18世纪就发明了的机器的间接说明。
|
||||
|
||||
另一方面,_Computer Literacy Project_ 是供职于 BBC 的一群制作人与公务员所认为的将电脑使用教给国民的最好的方式。我承认因为这一群人教会大众他们无法以己之力所能求得的事物而赞美这一群人的建议多少有点精英主义。但我情不自禁认为他们做对了。许多人使用 BBC Micro 第一次学会了使用电脑,他们中的很多人进而成为了成功的软件开发者或游戏设计师。[正如我曾经所言][14],我怀疑在计算机已经变得相对简单的时代里学习使用电脑是一个巨大的优势。不过或许这群人所拥有的另一个优势在于有像 _The Computer Programme_ 这样的尽己所能不仅仅教授编程而且教授计算机是为什么又是如何运行程序的节目。在看完 _The Computer Programme_ 之后,你可能并不能理解电脑屏幕上的所有编程术语,但是实际上你并不需要,因为你知道无论“代码”是什么样子,计算机总是在重复做基础的事情。在完成了 Codecademy 上的一到两个课程之后,你可能理解了编程术语的一些味道,但是对你来说一台电脑仍然只是一台能够以某种方式将编程术语转化为运行的软件的魔法机器。这并不是计算机认知。
|
||||
|
||||
|
||||
1. Robert Albury and David Allen, Microelectronics, report (1979). [↩︎][18]
|
||||
|
||||
2. Gregg Williams, “Microcomputing, British Style”, Byte Magazine, 40, January 1983, accessed on March 31, 2019, <https://archive.org/stream/byte-magazine-1983-01/1983_01_BYTE_08-01_Looking_Ahead#page/n41/mode/2up>. [↩︎][19]
|
||||
|
||||
3. John Radcliffe, “Toward Computer Literacy,” Computer Literacy Project Achive, 42, accessed March 31, 2019, [https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards Computer Literacy.pdf][20]. [↩︎][21]
|
||||
|
||||
4. David Allen, “About the Computer Literacy Project,” Computer Literacy Project Archive, accessed March 31, 2019, <https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/history>. [↩︎][22]
|
||||
|
||||
5. ibid. [↩︎][23]
|
||||
|
||||
6. Williams, 51. [↩︎][24]
|
||||
|
||||
7. Radcliffe, 11. [↩︎][25]
|
||||
|
||||
8. Radcliffe, 5. [↩︎][26]
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://twobithistory.org/2019/03/31/bbc-micro.html
|
||||
|
||||
作者:[Two-Bit History][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[CanYellow](https://github.com/CanYellow)
|
||||
校对:[校对者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]: tmp.zNBs2lK4Ca#fn:1
|
||||
[2]: tmp.zNBs2lK4Ca#fn:2
|
||||
[3]: tmp.zNBs2lK4Ca#fn:3
|
||||
[4]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/
|
||||
[5]: https://twobithistory.org/2018/07/22/dawn-of-the-microcomputer.html
|
||||
[6]: tmp.zNBs2lK4Ca#fn:4
|
||||
[7]: tmp.zNBs2lK4Ca#fn:5
|
||||
[8]: tmp.zNBs2lK4Ca#fn:6
|
||||
[9]: https://twobithistory.org/images/beeb.jpg
|
||||
[10]: https://twitter.com/TwoBitHistory/status/1112372000742404098
|
||||
[11]: tmp.zNBs2lK4Ca#fn:7
|
||||
[12]: https://twitter.com/TwoBitHistory/status/1111305774939234304
|
||||
[13]: tmp.zNBs2lK4Ca#fn:8
|
||||
[14]: https://twobithistory.org/2018/09/02/learning-basic.html
|
||||
[15]: https://twitter.com/TwoBitHistory
|
||||
[16]: https://twobithistory.org/feed.xml
|
||||
[17]: https://twitter.com/TwoBitHistory/status/1091148050221944832?ref_src=twsrc%5Etfw
|
||||
[18]: tmp.zNBs2lK4Ca#fnref:1
|
||||
[19]: tmp.zNBs2lK4Ca#fnref:2
|
||||
[20]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards%20Computer%20Literacy.pdf
|
||||
[21]: tmp.zNBs2lK4Ca#fnref:3
|
||||
[22]: tmp.zNBs2lK4Ca#fnref:4
|
||||
[23]: tmp.zNBs2lK4Ca#fnref:5
|
||||
[24]: tmp.zNBs2lK4Ca#fnref:6
|
||||
[25]: tmp.zNBs2lK4Ca#fnref:7
|
||||
[26]: tmp.zNBs2lK4Ca#fnref:8
|
||||
|
||||
[T1]: https://www.codecademy.com/
|
||||
[T2]: https://bbcmicro.computer/
|
||||
[T3]: https://clp.bbcrewind.co.uk/history
|
||||
[T4]: https://archive.org/details/byte-magazine?tab=about
|
||||
[T5]: https://www.bbc.co.uk/iplayer/episode/p01z4rrj/horizon-19771978-now-the-chips-are-down
|
||||
[T6]: https://archive.org/details/BBCHorizon19771978NowTheChipsAreDown
|
||||
[T7]: https://en.wikipedia.org/wiki/Sinclair_Research
|
||||
[T8]: https://en.wikipedia.org/wiki/Breakout_(video_game)
|
||||
[T9]: https://www.scienceandindustrymuseum.org.uk/objects-and-stories/jacquard-loom
|
@ -0,0 +1,101 @@
|
||||
[#]: subject: "Colorblind Filters: GNOME Extension to help Colorblind Users"
|
||||
[#]: via: "https://www.debugpoint.com/colorblind-filters-gnome-extension/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Colorblind Filters:帮助色盲用户的 GNOME 扩展
|
||||
======
|
||||
|
||||
**一个不错的 GNOME 扩展:Colorblind Filters,它为色盲用户带来了许多选项。**
|
||||
|
||||
无障碍是计算和操作系统的一个重要方面。它包括对视力障碍、色盲和许多其他健康症状的管理设置。流行的 Linux 桌面环境,如 GNOME 和 KDE Plasma,具有无障碍设置,以帮助所有这些情况。
|
||||
|
||||
感谢 GNOME 扩展生态系统,有大量的专门扩展可以帮助这些用户。我遇到的其中一个扩展是[“Colorblind Filters”][1]。
|
||||
|
||||
|
||||
### Colorblind Filters – GNOME 扩展
|
||||
|
||||
根据维基百科,_"色盲通常涉及无法区分红色和绿色的深浅。遗传性色盲症没有治疗方法。如果色盲是由其他疾病引起的,治疗潜在的原因会有帮助。"_。
|
||||
|
||||
因此,你有选项来调整你的 Linux 桌面上的设置是很重要的。
|
||||
|
||||
#### 设置扩展程序和 Flatpak
|
||||
|
||||
首先,确保你已经启用了 Flatpak 和 GNOME 扩展。并且安装了扩展管理器。你可以参考这个关于如何[设置 flatpak][2]和启用 [GNOME 扩展][3]的详细指南,或者从终端运行以下命令(对于 Ubuntu、Linux Mint 等)。
|
||||
|
||||
```
|
||||
sudo apt install flatpaksudo apt install gnome-software-plugin-flatpakflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakreporeboot
|
||||
```
|
||||
|
||||
对于 Fedora 用户,使用以下命令。
|
||||
|
||||
```
|
||||
sudo dnf install flatpaksudo dnf install gnome-software-plugin-flatpakflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakreporeboot
|
||||
```
|
||||
|
||||
完成后,安装扩展管理器:
|
||||
|
||||
```
|
||||
flatpak install com.mattjakeman.ExtensionManager
|
||||
```
|
||||
|
||||
#### 安装扩展
|
||||
|
||||
从应用菜单中打开扩展管理器。搜索 “colorblind”。并安装该扩展(见下图)。
|
||||
|
||||
![安装扩展][4]
|
||||
|
||||
安装后,你可以在系统托盘上看到一个小眼睛图标。你可以点击它来启用预定义的颜色过滤器。
|
||||
|
||||
![Colorblind Filters 扩展托盘图标][5]
|
||||
|
||||
右键点击眼睛图标以获得更多设置。这个扩展带来了色盲收集、模拟和额外选项的所有必要定制。目前有以下选项:
|
||||
|
||||
- 红色盲
|
||||
- 绿色盲
|
||||
- 蓝黄色盲
|
||||
|
||||
- 纠正和模拟(具有高对比度)
|
||||
|
||||
- GBR 和 BRG 的通道混合器
|
||||
- 亮度反转
|
||||
- 颜色反转
|
||||
|
||||
- 额外的调整
|
||||
|
||||
![Colorblind Filters - 选项][6]
|
||||
|
||||
使用最适合你的眼睛的那个。
|
||||
|
||||
### 总结
|
||||
|
||||
我认为苹果的 macOS 和 iOS 已经实现了比 Windows 或 Linux 更好的无障碍。然而,Linux 桌面在这些应用和扩展方面也不落后。另外,还有一些专门的 Linux 发行版,如“[Accessible Coconut][7]”,它是为专门的需求而建立的。
|
||||
|
||||
我希望 Colorblind gnome 扩展对你日常使用 Linux 和 GNOME 桌面有帮助。
|
||||
|
||||
干杯。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/colorblind-filters-gnome-extension/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://extensions.gnome.org/extension/5589/colorblind-filters/
|
||||
[2]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/
|
||||
[3]: https://www.debugpoint.com/how-to-install-and-use-gnome-shell-extensions-in-ubuntu/
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2023/01/Install-the-extension.jpg
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Colorblind-Filters-extension-tray-icon.gif
|
||||
[6]: https://www.debugpoint.com/wp-content/uploads/2023/01/Colorblind-Filters-options.jpg
|
||||
[7]: https://www.debugpoint.com/accessible-coconut-linux-visually-impaired/
|
@ -0,0 +1,102 @@
|
||||
[#]: subject: "6 tips for building an effective DevOps culture"
|
||||
[#]: via: "https://opensource.com/article/23/1/tips-effective-devops-culture"
|
||||
[#]: author: "Yauhen Zaremba https://opensource.com/users/yauhen-zaremba"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "lxbwolf"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
构建高效的 DevOps 文化的 6 个技巧
|
||||
======
|
||||
|
||||
你为什么要构建 [DevOps][1] 文化?开发和运营团队的精简协作有很多好处。效率是首要目标:提高新软件部署的速度,减少等待的时间。培养同事之间的信任可以提升员工的满意度,激发新的创新,并对盈利能力产生积极的影响。
|
||||
|
||||
[DevOps][2] 是一个很广泛的范畴,大家的理解也见仁见智。每个公司对于如何实行 DevOps 也各不相同。这种意见的多样性实际上是一件好事--这么多的观点对于建立更强大的团队是很有用的。本指南将探讨在 DevOps 文化中鼓励同事之间更好地合作的最高技巧。
|
||||
|
||||
下面每个部分从不同的视角介绍 DevOps 文化,并争取将它引入你的工作中去。
|
||||
|
||||
![DevOps includes collaboration, workflow, infosec, and iteration.][3]
|
||||
|
||||
### 流程的持续开发
|
||||
|
||||
DevOps 文化的这一核心原则使它与许多其他类型的工作区别开来。DevOps 哲学说,犯错是有积极意义的,因为这表明你在尝试新的想法。
|
||||
|
||||
DevOps 文化的核心是不停地创造。实际上,这意味着当测试结果显示事情由于你的改动而变坏时,不要懊恼。我们要认识到,进化的过程不是线性的,通往成功的道路也从来不是一条直线。
|
||||
|
||||
DevOps 专家[Gene Kim][4] 主张勇于承担风险和进行实验。鼓励你的团队尝试不寻常的任务,以得到新的领悟。
|
||||
|
||||
你的组织应该以利润为导向吗?你能允许你的团队尝试一些新东西(非指个人兴趣项目)吗?持续的流程开发意味着对升级目前的方法持开放态度。优秀的销售领导懂得,结果比出勤率更重要,因此,关注团队的工作方式而不是工作量的多少始终是关键。
|
||||
|
||||
### 随时提供反馈并积极寻求反馈
|
||||
|
||||
成员之间增加信任是蓬勃发展的 DevOps 文化的另一个关键特征。无论你的员工是在学习如何建立联盟网络联系,还是试图设计他们的下一个 [UX][5] 调查,每个人都应该对他们工作的反馈持开放态度。但是,除非你的团队成员尊重彼此的意见,并相信反馈是本着善意的精神提出的,否则这永远不会发生。
|
||||
|
||||
这种文化听起来可能是很难培养的;事实上,一些公司会比其他公司更努力地实现这一点。诚然,给予和接受反馈的成功很大程度上取决于员工的个性。在招聘过程中,也可以对此进行筛选。
|
||||
|
||||
在你期望员工随时向同事提供反馈并主动寻求反馈之前,你应该以身作则。高管应该以身作则,公开要求公司成员对其战略决策提出探究性问题,并提供相应的反馈。
|
||||
|
||||
![DevOps is the intersection of development, quality assurance, and operations][6]
|
||||
|
||||
### 不断改进
|
||||
|
||||
在同事之间增加智力信任的基础上,你的团队应该寻找方法来改善其工作。DevOps 的性质意味着软件开发团队将比传统方法更迅速地进行部署。
|
||||
|
||||
这种开放的改进文化可以对开发和运维以外的部门产生积极的影响。你也可以自己去探索,企业还有哪些领域会受到积极的影响。
|
||||
|
||||
留意培训和提高技能的机会。即使一个培训课程没有广告上说的那么突出,但有机会与行业专家建立联系,并与未来建立联系,这可以提高你的组织内的思想多样性。
|
||||
|
||||
### 为以后的开发保存当前的想法
|
||||
|
||||
频繁使用的 [Git][7] 账户应该是你的 DevOps 工具链的一部分。你可以用 Git 作为软件开发和其他相关项目中产生的脚本的共同仓库。Git 作为 "版本控制" 工具而被熟知,Git 允许程序员保存他们工作的迭代、复用或改进其他人的工作。
|
||||
|
||||
你的目标是有能力保留好的想法供将来使用。某个方法由于某种原因没有成功。然而,那套想法在当时是错误的,并不意味着它在未来永远无法成为有用的东西。
|
||||
|
||||
由于 DevOps 的整个重点在于生产环境中的软件的端到端所有权,因此保存开发的迭代真正支持这一原则。你希望看到对手头的软件测试项目的持续关注和投入。
|
||||
|
||||
一个简单的方法是要求开发者在开发者合同和最终项目报告中包含对未来工作的想法。确保技术服务经理知道他们应该要求提供在建设过程中出现的旁门左道的想法的例子。意识到这些小创新的人越多,在需要的时候就越有可能有人记住一个。
|
||||
|
||||
### 坐在一起(物理上或逻辑上)
|
||||
|
||||
目标是对彼此的工作角色以及它们之间的相互关系有一个共同的理解。你可以通过几个简单的方法实现这一目标,用一句话概括:坐在一起。邀请其他团队参加你们的会议,完整地分享用户反馈报告。一起吃午饭,一起计划虚拟的快乐时光,一般来说,要确保你的同事都在一起。大约 90% 的拥有成熟的 DevOps 协议的团队报告说,他们清楚地了解自己对其他团队的责任,而在不成熟的 DevOps 团队中,只有大约 46% 的工作者清楚地了解自己的责任。
|
||||
|
||||
虽然与志同道合的人结成小团体,只与被雇来执行与你相同任务的员工一起玩耍是很诱人的,但这对整个企业来说是很糟糕的。无论你喜欢与否,所有的人都是多面手,能够在一系列的情况下贡献自己的独特才能。
|
||||
|
||||
密切协作的想法是尊重任何人对其周围正在进行的产品或工作流程提出改进建议的能力。如果你与公司内的其他部门保持一定的距离,你将会错过无数次分享智慧想法的机会。毕竟,你往往在交流中学习得最好。
|
||||
|
||||
### 致力于自动化
|
||||
|
||||
你应该以提高效率和加速流程的方式,将单调的和重复的任务变为自动化。每个行业都有无聊的--说得直白一点,愚蠢的--每天或每周都要进行的工作。
|
||||
|
||||
无论是手工将数据从一页复制到另一页,还是手工打出音频记录,每个级别的工作人员都应该坚持让机器在可能的情况下承担这些负担。现实是自动化技术每年都在进步,操作流程也应该如此。[自动化测试][8] 对 DevOps 非常关键,它是 CALMS 框架的第二个原则(其中的 “C”代表“文化”)。
|
||||
|
||||
你怎样才能实现这一点?邀请员工公开表达他们认为工作的哪些方面可以自动化,然后--这里是关键的部分--支持实现自动化所需的设施。这可能意味着每年花 600 美元订阅一个软件程序、一套完整的企业应用现代化解决方案或开发人员的两天时间来建立一个新的工具在内部使用。
|
||||
|
||||
|
||||
无论哪种方式,你都应该评估自动化的好处,考虑你可以为每个人节省多少时间。DevOps 的统计数据不断表明,现代公司通过整合这些有益的原则,年复一年地得到了很大的改善。
|
||||
|
||||
### 探索成功的新工作方式
|
||||
|
||||
文化转变不会在一夜之间发生。不过,你越早开始,就越早看到结果。根据我的经验,当变化是对以前的真正改进时,人们会接受它。DevOps 为这种改进提供了一个框架。无论你是刚刚在你的组织中开始使用 DevOps,还是仅仅想改善你现有的文化,请考虑以上几点以及它们与你组织的未来的关系。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/23/1/tips-effective-devops-culture
|
||||
|
||||
作者:[Yauhen Zaremba][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/yauhen-zaremba
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/resources/devops
|
||||
[2]: https://opensource.com/article/22/2/devops-documentation-maturity
|
||||
[3]: https://opensource.com/sites/default/files/2022-12/devop.png
|
||||
[4]: https://enterprisersproject.com/user/gene-kim
|
||||
[5]: https://opensource.com/article/22/7/awesome-ux-cli-application
|
||||
[6]: https://opensource.com/sites/default/files/2022-12/devop-venn.png
|
||||
[7]: https://opensource.com/article/22/11/git-concepts
|
||||
[8]: https://opensource.com/article/20/7/open-source-test-automation-frameworks
|
@ -0,0 +1,69 @@
|
||||
[#]: subject: "Wordbook: Offline English Dictionary App for GNOME"
|
||||
[#]: via: "https://www.debugpoint.com/wordbook-offline-dictionary/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Wordbook:适用于 GNOME 的离线英语词典应用
|
||||
======
|
||||
|
||||
**遇见 Wordbook – 一个 GNOME 桌面的离线词典应用。**
|
||||
|
||||
我们大多在谷歌、DDG 或其他搜索引擎上搜索单词信息,如含义、同义词、反义词等。
|
||||
|
||||
由于今天几乎每个人都有一个连接互联网的手机,在谷歌上搜索可能更容易。
|
||||
|
||||
但对于离线使用,在没有互联网连接的情况下,你可以尝试 [Wordbook][1]。
|
||||
|
||||
### Wordbook:离线词典应用
|
||||
|
||||
这个应用在本质上是非常基本的。但以它的能力完成了它的工作。Wordbook 目前支持一个英译英字典。在其核心部分,它使用 [Open English WordNet 数据库][2]进行定义。Open English Wordnet 是 [Princeton Wordnet项目][3] 的一个开源分叉。
|
||||
|
||||
Wordbook 应用还可以使用 [eSpeak][4] – 一个免费和开源的语音合成器来发音。
|
||||
|
||||
![Wordbook - 英译英词典应用][5]
|
||||
|
||||
然而,在第一次运行时,它需要一次性上网,以下载离线数据。就这些了。其他值得注意的功能包括实时搜索、双击搜索和带有 HTML 标记的自定义定义。
|
||||
|
||||
Wordbook是一个 [GNOME 应用][6],使用现代 GTK4 和 libadwaita 构建。因此,它与 GNOME 桌面的浅色和深色主题整合得很好。你也可以使用 Wordbook 的随机单词功能来学习新单词以增加你的词汇量。
|
||||
|
||||
### 安装
|
||||
|
||||
你可以很容易地从 Flathub 将其作为 Flatpak 应用安装。为 Flatpak 和 Flathub 设置你的系统,然后从终端使用以下命令安装它:
|
||||
|
||||
```
|
||||
flatpak install com.github.fushinari.Wordbook
|
||||
```
|
||||
|
||||
安装后,你可以在应用菜单中找到它。
|
||||
|
||||
### 结束语
|
||||
|
||||
我希望你在学校或商业工作中使用这个小小的应用。如果你在写论文和较长的段落,离线特性是很方便的。
|
||||
|
||||
你知道其他Linux的离线字典吗?请在评论栏里告诉我们。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/wordbook-offline-dictionary/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://github.com/fushinari/Wordbook
|
||||
[2]: https://github.com/globalwordnet/english-wordnet
|
||||
[3]: https://wordnet.princeton.edu/
|
||||
[4]: https://espeak.sourceforge.net/
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2023/01/Wordbook-English-to-English-Dictionary-App.jpg
|
||||
[6]: https://www.debugpoint.com/tag/gnome-app
|
||||
[7]: https://www.debugpoint.com/install-ubuntu-windows-virtualbox/
|
||||
[8]: https://floss.social/@debugpoint
|
Loading…
Reference in New Issue
Block a user