mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-21 02:10:11 +08:00
commit
3eec2adf36
104
published/20200112 What I learned going from prison to Python.md
Normal file
104
published/20200112 What I learned going from prison to Python.md
Normal file
@ -0,0 +1,104 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (heguangzhi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11893-1.html)
|
||||
[#]: subject: (What I learned going from prison to Python)
|
||||
[#]: via: (https://opensource.com/article/20/1/prison-to-python)
|
||||
[#]: author: (Shadeed "Sha" Wallace-Stepter https://opensource.com/users/shastepter)
|
||||
|
||||
从监狱到 Python
|
||||
======
|
||||
|
||||
> 入狱后,开源编程是如何提供机会的。
|
||||
|
||||
![书架上的编程书籍][1]
|
||||
|
||||
不到一年前,我还在圣昆廷州立监狱服刑,我是无期徒刑。
|
||||
|
||||
我高三的时候,我抢劫了一个人并向他开了枪。现在,我经过一段时间才意识到并承认自己做错了,这是在经历了陪审团审判并看到我的行为带来的恶果后,我知道需要改变自己,我也确实做到了。尽管我对我的行为表示懊悔,但我毕竟开枪打了一个人,并差点杀了他。做这样的事是有后果的,这是理所当然的。所以在我 18 岁的时候,我被判了终身监禁。
|
||||
|
||||
监狱是一个非常可怕的地方;我是不推荐你去的。但是我必须去,所以我去了。我不告诉你具体的细节,但你可以放心,这是一个没有太多动机去改变的地方,许多人在这里养成的坏习惯比他们过去在别处养成的更多。
|
||||
|
||||
我是幸运儿之一。当我在服刑的时候,发生了一些不同寻常的事情。我开始想象自己出狱后的的未来,虽然在这之前,我还是已经在那里度过了我整个成年生活。
|
||||
|
||||
现在你想想:我是黑人,只受过高中教育。我没有工作经历,如果我离开监狱,在被释放前,我还是一个被定罪的重罪犯。当每个雇主看到我的简历,都不会有“我需要雇用这个人”想法,我认为是正常的。
|
||||
|
||||
我不知道我的选择是什么,但我已经下定决心了。我需要做些活下去的事情,并且这和我入狱前的生活一点也不像。
|
||||
|
||||
### Python 之路
|
||||
|
||||
最终,我被关在了圣昆廷州立监狱,我不知道我为何幸运地被关在那里。圣昆廷提供了几个自助和教育编程项目。这些[改造机会][2]帮助囚犯使他们拥有在获释后避免再次犯罪的技能。
|
||||
|
||||
作为其中一个编程项目的一部分,2017 年我通过圣昆廷媒体项目认识了[杰西卡·麦凯拉][3]。杰西卡是编程语言 [Python][4] 的爱好者,她开始向我推荐 Python 有多棒,以及它是刚起步的人学习的完美语言。这就是故事变得比小说更精彩的地方。
|
||||
|
||||
> 感谢 [@northbaypython][5] 让 [@ShaStepter][6] 和我重复 [@pycon][7] 的主题演讲,让他们被录制下来。我很荣幸与大家分享:
|
||||
>
|
||||
> 从监狱到 Pythone: https://t.co/rcumoAgZHm
|
||||
>
|
||||
> 大规模裁员:如果我们不雇佣被判重罪的人,谁会呢? https://t.co/fENDUFdxfX
|
||||
>
|
||||
> [pic.Twitter.com/kpjo8d3ul6][8]
|
||||
>
|
||||
> —杰西卡·麦凯拉(@jessicamckellar)[2019 年 11 月 5 日][9]
|
||||
|
||||
杰西卡向我介绍了一些 Python 视频教程,这些教程是她为一家名叫 [O’Reilly Media][10] 的公司做的,课程是在线的,如果我能接触到它们,那该有多好呀。不幸的是,在监狱里上网是不可能的。但是,我遇到了一个叫 Tim O’Reilly 的人,他最近刚来到圣昆廷。在他访问之后,Tim 从他的公司 O’Reilly Media 公司向监狱的编程班捐赠了大量内容。最终,我拿到了一款平板电脑,上面有杰西卡的 Python 教程,并学会了如何使用这些 Python 教程进行编码。
|
||||
|
||||
真是难以置信。背景和生活与我完全不同的陌生人把这些联系在一起,让我学会了编码。
|
||||
|
||||
### 对 Python 社区的热爱
|
||||
|
||||
在这之后,我开始经常和杰西卡见面,她开始告诉我关于开源社区的情况。我了解到,从根本上说,开源社区就是关于伙伴关系和协作的社区。之所以如此有效,是因为没有人被排除在外。
|
||||
|
||||
对我来说,一个努力寻找自己定位的人,我所看到的是一种非常基本的爱——通过合作和接受的爱,通过接触的爱,通过包容的爱。我渴望成为其中的一部分。所以我继续学习 Python,不幸的是,我无法获得更多的教程,但是我能够从开源社区收集的大量书面知识中获益。我读一切提到 Python 的东西,从平装本到晦涩难懂的杂志文章,我使用平板电脑来解决我读到的 Python 问题。
|
||||
|
||||
我对 Python 和编程的热情不是我的许多同龄人所共有的。除了监狱编程课上的极少数人之外,我认识的其他人都没有提到过编程;一般囚犯都不知道。我认为这是因为有过监禁经历的人无法接触编程,尤其是如果你是有色人种。
|
||||
|
||||
### 监狱外的 Python 生活
|
||||
|
||||
然而,在 2018 年 8 月 17 日,我得到了生命中的惊喜。时任州长的杰里·布朗将我 27 年的刑期减刑,在服刑将近 19 年后,我被释放出狱了。
|
||||
|
||||
但现实情况是,这也是为什么我认为编程和开源社区如此有价值。我是一名 37 岁的黑人罪犯,没有工作经历,刚刚在监狱服刑 18 年。我有犯罪史,并且现存偏见导致没有多少职业适合我。但是编程是少数例外之一。
|
||||
|
||||
现在,监禁后重返社会的人们迫切需要包容,但当谈及工作场所的多样性以及对多样性的需求时,你真的听不到这个群体被提及或包容。
|
||||
|
||||
> 还有什么:
|
||||
>
|
||||
> 1、背景调查:询问他们在你的公司是如何使用的。
|
||||
>
|
||||
> 2、初级角色:删除虚假的、不必要的先决条件,这些条件将排除有记录的合格人员。
|
||||
>
|
||||
> 3、积极拓展:与当地再就业项目合作,创建招聘渠道。
|
||||
>
|
||||
> [pic.twitter.com/WnzdEUTuxr][11]
|
||||
>
|
||||
> —杰西卡·麦凯拉(@jessicamckellar)[2019 年 5 月 12 日][12]
|
||||
|
||||
|
||||
因此,我想谦卑地挑战开源社区的所有程序员和成员,让他们围绕包容和多样性展开思考。今天,我自豪地站在你们面前,代表一个大多数人都没有想到的群体——以前被监禁的人。但是我们存在,我们渴望证明我们的价值,最重要的是,我们期待被接受。当我们重返社会时,许多挑战等待着我们,我请求你们允许我们有机会展示我们的价值。欢迎我们,接受我们,最重要的是,包容我们。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/1/prison-to-python
|
||||
|
||||
作者:[Shadeed "Sha" Wallace-Stepter][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[heguangzhi](https://github.com/heguangzhi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/shastepter
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_programming_languages.jpg?itok=KJcdnXM2 (Programming books on a shelf)
|
||||
[2]: https://www.dailycal.org/2019/02/27/san-quentin-rehabilitation-programs-offer-inmates-education-a-voice/
|
||||
[3]: https://twitter.com/jessicamckellar?lang=en
|
||||
[4]: https://www.python.org/
|
||||
[5]: https://twitter.com/northbaypython?ref_src=twsrc%5Etfw
|
||||
[6]: https://twitter.com/ShaStepter?ref_src=twsrc%5Etfw
|
||||
[7]: https://twitter.com/pycon?ref_src=twsrc%5Etfw
|
||||
[8]: https://t.co/Kpjo8d3ul6
|
||||
[9]: https://twitter.com/jessicamckellar/status/1191601209917837312?ref_src=twsrc%5Etfw
|
||||
[10]: http://shop.oreilly.com/product/110000448.do
|
||||
[11]: https://t.co/WnzdEUTuxr
|
||||
[12]: https://twitter.com/jessicamckellar/status/1127640222504636416?ref_src=twsrc%5Etfw
|
@ -1,20 +1,22 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (HankChow)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11899-1.html)
|
||||
[#]: subject: (How to stop typosquatting attacks)
|
||||
[#]: via: (https://opensource.com/article/20/1/stop-typosquatting-attacks)
|
||||
[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta)
|
||||
|
||||
如何防范误植攻击
|
||||
======
|
||||
|
||||
> <ruby>误植<rt>Typosquatting</rt></ruby>是一种引诱用户将敏感数据泄露给不法分子的方式,针对这种攻击方式,我们很有必要了解如何保护我们的组织、我们的开源项目以及我们自己。
|
||||
|
||||
![Gears above purple clouds][1]
|
||||
|
||||
除了常规手段以外,不法分子还会利用社会工程的方式,试图让安全意识较弱的人泄露私人信息或是有价值的证书。很多[网络钓鱼骗局][2]的实质都是攻击者伪装成信誉良好的公司或组织,然后借此大规模分发病毒或恶意软件。
|
||||
除了常规手段以外,网络罪犯还会利用社会工程的方式,试图让安全意识较弱的人泄露私人信息或是有价值的证书。很多[网络钓鱼骗局][2]的实质都是攻击者伪装成信誉良好的公司或组织,然后借此大规模传播病毒或恶意软件。
|
||||
|
||||
[误植][3]就是其中一个常用的手法。它是一种社会工程学的攻击方式,通过使用一些合法网站的错误拼写 URL 以引诱用户访问恶意网站,这样的做法既使真正的原网站遭受声誉上的损害,又诱使用户向这些恶意网站提交个人敏感信息。因此,网站的管理人员和用户双方都应该意识到这个问题带来的风险,并采取措施加以保护。
|
||||
<ruby>[误植][3]<rt>Typosquatting</rt></ruby>就是其中一个常用的手法。它是一种社会工程学的攻击方式,通过使用一些合法网站的错误拼写的 URL 以引诱用户访问恶意网站,这样的做法既使真正的原网站遭受声誉上的损害,又诱使用户向这些恶意网站提交个人敏感信息。因此,网站的管理人员和用户双方都应该意识到这个问题带来的风险,并采取措施加以保护。
|
||||
|
||||
一些由广大开发者在公共代码库中维护的开源软件通常都被认为具有安全上的优势,但当面临社会工程学攻击或恶意软件植入时,开源软件也需要注意以免受到伤害。
|
||||
|
||||
@ -22,9 +24,9 @@
|
||||
|
||||
### 什么是误植?
|
||||
|
||||
误植是一种具体的网络犯罪手段,其背后通常是一个网络钓鱼骗局。不法分子首先会购买注册域名,而他们注册的域名通常是一个常用网站的错误拼写形式,例如在正确拼写的基础上添加一个额外的元音字母,又或者是将字母“i”替换成字母“l”。对于同一个正常域名,不法分子通常会注册数十个拼写错误的变体域名。
|
||||
误植是一种非常特殊的网络犯罪形式,其背后通常是一个更大的网络钓鱼骗局。不法分子首先会购买和注册域名,而他们注册的域名通常是一个常用网站的错误拼写形式,例如在正确拼写的基础上添加一个额外的元音字母,又或者是将字母“i”替换成字母“l”。对于同一个正常域名,不法分子通常会注册数十个拼写错误的变体域名。
|
||||
|
||||
用户一旦访问这样的域名,不法分子的目的就已经成功了一半。为此,他们会通过电子邮件的方式,诱导用户访问这样的伪造域名。伪造域名指向的页面中,通常都带有一个简单的登录界面,还会附上被模仿的网站的 logo,尽可能让用户认为自己访问的是正确的网站。
|
||||
用户一旦访问这样的域名,不法分子的目的就已经成功了一半。为此,他们会通过电子邮件的方式,诱导用户访问这样的伪造域名。伪造域名指向的页面中,通常都带有一个简单的登录界面,还会附上熟悉的被模仿网站的徽标,尽可能让用户认为自己访问的是真实的网站。
|
||||
|
||||
如果用户没有识破这一个骗局,在页面中提交了诸如银行卡号、用户名、密码等敏感信息,这些数据就会被不法分子所完全掌控。进一步来看,如果这个用户在其它网站也使用了相同的用户名和密码,那就有同样受到波及的风险。受害者最终可能会面临身份被盗、信用记录被破坏等危险。
|
||||
|
||||
@ -34,11 +36,11 @@
|
||||
|
||||
在几年之前就发生过[一起案件][4],很多健康保险客户收到了一封指向 we11point.com 的钓鱼电子邮件,其中 URL 里正确的字母“l”被换成了数字“1”,从而导致一批用户成为了这一次攻击的受害者。
|
||||
|
||||
最初,特定国家的顶级域名是不允许随意注册的。但后来国际域名规则中放开这一限制之后,又兴起了一波新的误植攻击。例如最常见的一种手法就是注册一个与 .com 域名类似的 .om 域名,一旦在输入 URL 时不慎遗漏了字母 c 就会给不法分子带来可乘之机。
|
||||
最初,与特定国家/地区相关的顶级域名是不允许随意注册的。但后来国际域名规则中放开这一限制之后,又兴起了一波新的误植攻击。例如最常见的一种手法就是注册一个与 .com 域名类似的 .om 域名,一旦在输入 URL 时不慎遗漏了字母 c 就会给不法分子带来可乘之机。
|
||||
|
||||
### 网站如何防范误植攻击
|
||||
|
||||
对于一个公司来说,最好的策略就是永远比误植攻击采取早一手的行动。
|
||||
对于一个公司来说,最好的策略就是永远比误植攻击采取早一步的行动。
|
||||
|
||||
也就是说,在注册域名的时候,不仅要注册自己商标名称的域名,最好还要同时注册可能由于拼写错误产生的其它域名。当然,没有太大必要把可能导致错误的所有顶级域名都注册掉,但至少要把可能导致错误的一些一级域名抢注下来。
|
||||
|
||||
@ -46,7 +48,7 @@
|
||||
|
||||
你可以使用类似 [DNS Twist][5] 的开源工具来扫描公司正在使用的域名,它可以确定是否有相似的域名已被注册,从而暴露潜在的误植攻击。DNS Twist 可以在 Linux 系统上通过一系列的 shell 命令来运行。
|
||||
|
||||
还有一些网络提供商会将防护误植攻击作为他们网络产品的一部分。这就相当于一层额外的保护,如果用户不慎输入了带有拼写错误的 URL,就会被提示该页面已经被阻止并重定向到正确的域名。
|
||||
还有一些网络提供商(ISP)会将防护误植攻击作为他们网络产品的一部分。这就相当于一层额外的保护,如果用户不慎输入了带有拼写错误的 URL,就会被提示该页面已经被阻止并重定向到正确的域名。
|
||||
|
||||
如果你是系统管理员,还可以考虑运行一个自建的 [DNS 服务器][6],以便通过黑名单的机制禁止对某些域名的访问。
|
||||
|
||||
@ -58,29 +60,27 @@
|
||||
|
||||
因为开源项目的源代码是公开的,所以其中大部分项目都会进行安全和渗透测试。但错误是不可能完全避免的,如果你参与了开源项目,还是有需要注意的地方。
|
||||
|
||||
当你收到一个不明来源的<ruby>合并请求<rt>Merge Request</rt></ruby>或补丁时,必须在合并之前仔细检查,尤其是相关代码涉及到网络层面的时候。一定要进行严格的检查和测试,以确保没有恶意代码混入正常的代码当中。
|
||||
当你收到一个不明来源的<ruby>合并请求<rt>Merge Request</rt></ruby>或补丁时,必须在合并之前仔细检查,尤其是相关代码涉及到网络层面的时候。不要屈服于只测试构建的诱惑; 一定要进行严格的检查和测试,以确保没有恶意代码混入正常的代码当中。
|
||||
|
||||
同时,还要严格按照正确的方法使用域名,避免不法分子创建仿冒的下载站点并提供带有恶意代码的软件。可以通过如下所示的方法使用数字签名来确保你的软件没有被篡改:
|
||||
|
||||
|
||||
```
|
||||
gpg --armor --detach-sig \
|
||||
\--output advent-gnome.sig \
|
||||
example-0.0.1.tar.xz
|
||||
--output advent-gnome.sig \
|
||||
example-0.0.1.tar.xz
|
||||
```
|
||||
|
||||
同时给出你提供的文件的校验和:
|
||||
|
||||
|
||||
```
|
||||
`sha256sum example-0.0.1.tar.xz > example-0.0.1.txt`
|
||||
sha256sum example-0.0.1.tar.xz > example-0.0.1.txt
|
||||
```
|
||||
|
||||
无论你的用户会不会去用上这些安全措施,你也应该提供这些必要的信息。因为只要有那么一个人留意到签名有异样,就能为你敲响警钟。
|
||||
|
||||
### 总结
|
||||
|
||||
人类犯错在所难免。世界上数百万人输入同一个,总会有人出现拼写的错误。不法分子也正是抓住了这个漏洞才得以实施误植攻击。
|
||||
人类犯错在所难免。世界上数百万人输入同一个网址时,总会有人出现拼写的错误。不法分子也正是抓住了这个漏洞才得以实施误植攻击。
|
||||
|
||||
用抢注域名的方式去完全根治误植攻击也是不太现实的,我们更应该关注这种攻击的传播方式以减轻它对我们的影响。最好的保护就是和用户之间建立信任,并积极检测误植攻击的潜在风险。作为开源社区,我们更应该团结起来一起应对误植攻击。
|
||||
|
||||
@ -91,7 +91,7 @@ via: https://opensource.com/article/20/1/stop-typosquatting-attacks
|
||||
作者:[Sam Bocetta][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[HankChow](https://github.com/HankChow)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,30 +1,30 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11892-1.html)
|
||||
[#]: subject: (Run multiple consoles at once with this open source window environment)
|
||||
[#]: via: (https://opensource.com/article/20/1/multiple-consoles-twin)
|
||||
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney)
|
||||
|
||||
使用此开源窗口环境一次运行多个控制台
|
||||
使用开源窗口环境 twin 一次运行多个控制台
|
||||
======
|
||||
|
||||
> 在我们的 20 个使用开源提升生产力的系列的第十四篇文章中用 twin 模拟了老式的 DESQview 体验。
|
||||
|
||||
![Digital creative of a browser on the internet][1]
|
||||

|
||||
|
||||
去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。
|
||||
|
||||
### 通过 twin 克服“一个屏幕,一个应用程序”的限制
|
||||
|
||||
还有人记得 [DESQview][2] 吗?我们在 Windows、Linux 和 MacOS 中理所当然地可以在屏幕上同时运行多个程序,而它赋予了 DOS 同样的功能。在我运营拨号 BBS 服务的初期,DESQview 是必需的,它使我能够使 BBS 在后台运行,同时在前台进行其他操作。例如,当有人拨打电话时,我可能正在开发新功能或设置新的外部程序而不会影响他们的体验。后来,在我早期支持的时候,我可以同时运行我的工作电子邮件([MHS 上的 DaVinci 电子邮件] [3])、支持票证系统和其他 DOS 程序。这是令人吃惊的!
|
||||
还有人记得 [DESQview][2] 吗?我们在 Windows、Linux 和 MacOS 中理所当然地可以在屏幕上同时运行多个程序,而 DESQview 赋予了 DOS 同样的功能。在我运营拨号 BBS 服务的初期,DESQview 是必需的,它使我能够让 BBS 在后台运行,同时在前台进行其他操作。例如,当有人拨打电话时,我可能正在开发新功能或设置新的外部程序而不会影响他们的体验。后来,在我早期做支持工作的时候,我可以同时运行我的工作电子邮件([MHS 上的 DaVinci 电子邮件][3])、支持单据系统和其他 DOS 程序。这是令人吃惊的!
|
||||
|
||||
![twin][4]
|
||||
|
||||
从那时起,运行多个控制台应用程序的功能已经发展了很多。但是 [tmux][5] 和 [Screen][6] 等应用仍然遵循“一个屏幕,一个应用”的显示方式。好吧,是的,tmux 具有屏幕拆分和窗格,但是不像 DESQview 那样具有将窗口“浮动”在其他窗口上的功能,就我个人而言,我怀念那个功能。
|
||||
|
||||
让我们来看看 [twin][7](文本模式窗口环境)。我认为,这个相对年轻的项目是 DESQview 的精神继任者。它支持控制台和图形环境,并具有与会话脱离和重新接驳的功能。设置起来并是那么容易,但是它可以在大多数现代操作系统上运行。
|
||||
让我们来看看 [twin][7](文本模式窗口环境)。我认为,这个相对年轻的项目是 DESQview 的精神继任者。它支持控制台和图形环境,并具有与会话脱离和重新接驳的功能。设置起来并不是那么容易,但是它可以在大多数现代操作系统上运行。
|
||||
|
||||
Twin 是从源代码安装的(现在是这样)。但是首先,你需要安装所需的开发库。库名称将因操作系统而异。 以下示例显示了在我的 Ubuntu 19.10 系统中的情况。一旦安装了依赖库,请从 Git 中检出 twin 源代码,并运行 `./configure` 和 `make`,它们应自动检测所有内容并构建 twin:
|
||||
|
||||
@ -37,11 +37,11 @@ make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
注意:如果要在 MacOS 或 BSD 上进行编译,则需要在运行 `make` 之前在文件 `include/Tw/autoconf.h` 和 `include/twautoconf.h` 中注释掉 `#define socklen_t int`。这应该在 [twin #57][9] 解决了。
|
||||
注意:如果要在 MacOS 或 BSD 上进行编译,则需要在运行 `make` 之前在文件 `include/Tw/autoconf.h` 和 `include/twautoconf.h` 中注释掉 `#define socklen_t int`。这个问题应该在 [twin #57][9] 解决了。
|
||||
|
||||
![twin text mode][10]
|
||||
|
||||
第一次调用 twin 是一个挑战。你需要通过 `--hw` 参数告诉它正在使用哪种显示。例如,要启动文本模式的 twin,请输入 `twin --hw=tty,TERM=linux`。这里 `TERM` 变量指定替代了你当前 Shell 中终端变量。要启动图形版本,运行 `twin --hw=X@$DISPLAY`。在 Linux 上,twin 一般都“可以正常工作”,而在 MacOS 上,Twin 基本是只能在终端上使用。
|
||||
第一次调用 twin 是一个挑战。你需要通过 `--hw` 参数告诉它正在使用哪种显示。例如,要启动文本模式的 twin,请输入 `twin --hw=tty,TERM=linux`。这里指定的 `TERM` 变量替代了你当前 Shell 中终端变量。要启动图形版本,运行 `twin --hw=X@$DISPLAY`。在 Linux 上,twin 一般都“可以正常工作”,而在 MacOS 上,Twin 基本是只能在终端上使用。
|
||||
|
||||
*真正*的乐趣是可以通过 `twattach` 和 `twdisplay` 命令接驳到正在运行的会话的功能。它们使你可以接驳到其他正在运行的 twin 会话。例如,在 Mac 上,我可以运行以下命令以接驳到演示机器上运行的 twin 会话:
|
||||
|
||||
@ -51,7 +51,7 @@ twdisplay --twin@20days2020.local:0 --hw=tty,TERM=linux
|
||||
|
||||
![remote twin session][11]
|
||||
|
||||
通过多做一些工作,你还可以将其用作登录外壳,以代替控制台上的 [getty][12]。这需要 gdm 鼠标守护程序、twdm 应用程序(包括)和一些额外的配置。在使用 systemd 的系统上,首先安装并启用 gdm(如果尚未安装),然后使用 `systemctl` 为控制台创建一个替代(我使用 tty6)。这些命令必须以 root 用户身份运行;在 Ubuntu 上,它们看起来像这样:
|
||||
通过多做一些工作,你还可以将其用作登录外壳,以代替控制台上的 [getty][12]。这需要 gdm 鼠标守护程序、twdm 应用程序(包括)和一些额外的配置。在使用 systemd 的系统上,首先安装并启用 gdm(如果尚未安装),然后使用 `systemctl` 为控制台(我使用 tty6)创建一个覆盖。这些命令必须以 root 用户身份运行;在 Ubuntu 上,它们看起来像这样:
|
||||
|
||||
```
|
||||
apt install gdm
|
||||
@ -60,7 +60,7 @@ systemctl start gdm
|
||||
systemctl edit getty@tty6
|
||||
```
|
||||
|
||||
`systemctl edit getty@tty6` 命令将打开一个名为 `override.conf` 的空文件。它可以定义 systemd 服务设置以覆盖 6 号控制台的默认设置。将内容更新为:
|
||||
`systemctl edit getty@tty6` 命令将打开一个名为 `override.conf` 的空文件。它可以定义 systemd 服务设置以覆盖 tty6 的默认设置。将内容更新为:
|
||||
|
||||
```
|
||||
[service]
|
||||
@ -70,7 +70,7 @@ StandardInput=tty
|
||||
StandardOutput=tty
|
||||
```
|
||||
|
||||
现在,重新加载 systemd 并重新启动 tty6 以获得 twin 登录提示:
|
||||
现在,重新加载 systemd 并重新启动 tty6 以获得 twin 登录提示界面:
|
||||
|
||||
```
|
||||
systemctl daemon-reload
|
||||
@ -81,7 +81,7 @@ systemctl restart getty@tty6
|
||||
|
||||
这将为登录的用户启动一个 twin 会话。我不建议在多用户系统中使用此会话,但是对于个人桌面来说,这是很酷的。并且,通过使用 `twattach` 和 `twdisplay`,你可以从本地 GUI 或远程桌面访问该会话。
|
||||
|
||||
我认为 twin 真是太酷了。它还有一些细节不够好,但是基本功能都已经有了,并且有一些非常好的文档。另外,它也使我可以在现代操作系统上稍解 DESQview 式的体验的渴望。我希望随着时间的推移它会有所改进,希望你和我一样喜欢它。
|
||||
我认为 twin 真是太酷了。它还有一些细节不够完善,但是基本功能都已经有了,并且有一些非常好的文档。另外,它也使我可以在现代操作系统上稍解对 DESQview 式的体验的渴望。我希望随着时间的推移它会有所改进,希望你和我一样喜欢它。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -90,7 +90,7 @@ via: https://opensource.com/article/20/1/multiple-consoles-twin
|
||||
作者:[Kevin Sonney][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,117 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11900-1.html)
|
||||
[#]: subject: (Use tmux to create the console of your dreams)
|
||||
[#]: via: (https://opensource.com/article/20/1/tmux-console)
|
||||
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney)
|
||||
|
||||
使用 tmux 创建你的梦想主控台
|
||||
======
|
||||
|
||||
> 使用 tmux 可以做很多事情,尤其是在将 tmuxinator 添加到其中时。在我们的二十篇系列文章的第十五期中查看它们,以在 2020 年实现开源生产力的提高。
|
||||
|
||||

|
||||
|
||||
去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。
|
||||
|
||||
### 使用 tmux 和 tmuxinator 全部放到主控台上
|
||||
|
||||
到目前为止,在本系列文章中,我已经撰写了有关单个应用程序和工具的文章。从今天开始,我将把它们放在一起进行全面设置以简化操作。让我们从命令行开始。为什么使用命令行?简而言之,在命令行上工作可以使我能够从运行 SSH 的任何位置访问许多这些工具和功能。我可以 SSH 进入我的一台个人计算机,并在工作计算机上运行与我的个人计算机上所使用的相同设置。我要使用的主要工具是 [tmux][2]。
|
||||
|
||||
大多数人都只使用了 tmux 非常基础的功能,比如说在远程服务器上打开 tmux,然后启动进程,也许还会打开第二个会话以查看日志文件或调试信息,然后断开连接并在稍后返回。但是其实你可以使用 tmux 做很多工作。
|
||||
|
||||
![tmux][3]
|
||||
|
||||
首先,如果你有一个已有的 tmux 配置文件,请对其进行备份。tmux 的配置文件是 `~/.tmux.conf`。将其移动到另一个目录,例如 `~/tmp`。现在,用 Git 克隆 [Oh My Tmux][4] 项目。从该克隆目录中将 `.tmux.conf` 符号链接到你的家目录,并复制该克隆目录中的 `.tmux.conf.local` 文件到家目录中以进行调整:
|
||||
|
||||
```
|
||||
cd ~
|
||||
mkdir ~/tmp
|
||||
mv ~/.tmux.conf ~/tmp/
|
||||
git clone https://github.com/gpakosz/.tmux.git
|
||||
ln -s ~/.tmux/.tmux.conf ./
|
||||
cp ~/.tmux/.tmux.conf.local ./
|
||||
```
|
||||
|
||||
`.tmux.conf.local` 文件包含了本地设置和覆盖的设置。例如,我稍微更改了默认颜色,然后启用了 [Powerline][5] 分隔线。下面的代码段仅显示了我更改过的内容:
|
||||
|
||||
```
|
||||
tmux_conf_theme_24b_colour=true
|
||||
tmux_conf_theme_focused_pane_bg='default'
|
||||
tmux_conf_theme_pane_border_style=fat
|
||||
tmux_conf_theme_left_separator_main='\uE0B0'
|
||||
tmux_conf_theme_left_separator_sub='\uE0B1'
|
||||
tmux_conf_theme_right_separator_main='\uE0B2'
|
||||
tmux_conf_theme_right_separator_sub='\uE0B3'
|
||||
#tmux_conf_battery_bar_symbol_full='◼'
|
||||
#tmux_conf_battery_bar_symbol_empty='◻'
|
||||
tmux_conf_battery_bar_symbol_full='♥'
|
||||
tmux_conf_battery_bar_symbol_empty='·'
|
||||
tmux_conf_copy_to_os_clipboard=true
|
||||
set -g mouse on
|
||||
```
|
||||
|
||||
请注意,你不需要安装 Powerline,你只需要支持 Powerline 符号的字体即可。我在与控制台相关的所有内容中几乎都使用 [Hack Nerd Font][6],因为它易于阅读并且具有许多有用的额外符号。你还会注意到,我打开了操作系统剪贴板支持和鼠标支持。
|
||||
|
||||
现在,当 tmux 启动时,底部的状态栏会以吸引人的颜色提供更多信息。`Ctrl` + `b` 仍然是输入命令的 “引导” 键,但其他一些进行了更改。现在水平拆分(顶部/底部)窗格为 `Ctrl` + `b` + `-`,垂直拆分为 `Ctrl` + `b` + `_`。启用鼠标模式后,你可以单击以在窗格之间切换,并拖动分隔线以调整其大小。打开新窗口仍然是 `Ctrl` + `b` + `n`,你现在可以单击底部栏上的窗口名称在它们之间进行切换。同样,`Ctrl` + `b` + `e` 将打开 `.tmux.conf.local` 文件以进行编辑。退出编辑器时,tmux 将重新加载配置,而不会重新加载其他任何内容。这很有用。
|
||||
|
||||
到目前为止,我仅对功能和视觉显示进行了一些简单的更改,并增加了鼠标支持。现在,我将它设置为以一种有意义的方式启动我想要的应用程序,而不必每次都重新定位和调整它们的大小。为此,我将使用 [tmuxinator][7]。tmuxinator 是 tmux 的启动器,它允许你指定和管理布局以及使用 YAML 文件自动启动应用程序。要使用它,请启动 tmux 并创建要在其中运行程序的窗格。然后,使用 `Ctrl` + `b` + `n` 打开一个新窗口,并执行 `tmux list-windows`。你将获得有关布局的详细信息。
|
||||
|
||||
![tmux layout information][8]
|
||||
|
||||
请注意上面代码中的第一行,我在其中设置了四个窗格,每个窗格中都有一个应用程序。保存运行时的输出以供以后使用。现在,运行 `tmuxinator new 20days` 以创建名为 “20days” 的布局。这将显示一个带有默认布局文件的文本编辑器。它包含很多有用的内容,我建议你阅读所有选项。首先输入上方的布局信息以及所需的应用程序:
|
||||
|
||||
```
|
||||
# /Users/ksonney/.config/tmuxinator/20days.yml
|
||||
name: 20days
|
||||
root: ~/
|
||||
windows:
|
||||
- mail:
|
||||
layout: d9da,208x60,0,0[208x26,0,0{104x26,0,0,0,103x26,105,0,5},208x33,0,27{104x33,0,27,1,103x33,105,27,4}]] @0
|
||||
panes:
|
||||
- alot
|
||||
- abook
|
||||
- ikhal
|
||||
- todo.sh ls +20days
|
||||
```
|
||||
|
||||
注意空格缩进!与 Python 代码一样,空格和缩进关系到文件的解释方式。保存该文件,然后运行 `tmuxinator 20days`。你应该会得到四个窗格,分别是 [alot][9] 邮件程序、[abook][10]、ikhal(交互式 [khal][11] 的快捷方式)以及 [todo.txt][12] 中带有 “+20days” 标签的任何内容。
|
||||
|
||||
![sample layout launched by tmuxinator][13]
|
||||
|
||||
你还会注意到,底部栏上的窗口标记为 “Mail”。你可以单击该名称(以及其他命名的窗口)以跳到该视图。漂亮吧?我在同一个文件中还设置了名为 “Social” 的第二个窗口,包括 [Tuir][14]、[Newsboat][15]、连接到 [BitlBee][16] 的 IRC 客户端和 [Rainbow Stream][17]。
|
||||
|
||||
tmux 是我跟踪所有事情的生产力动力之源,有了 tmuxinator,我不必在不断调整大小、放置和启动我的应用程序上费心。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/1/tmux-console
|
||||
|
||||
作者:[Kevin Sonney][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/ksonney
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer)
|
||||
[2]: https://github.com/tmux/tmux
|
||||
[3]: https://opensource.com/sites/default/files/uploads/productivity_15-1.png (tumux)
|
||||
[4]: https://github.com/gpakosz/.tmux
|
||||
[5]: https://github.com/powerline/powerline
|
||||
[6]: https://www.nerdfonts.com/
|
||||
[7]: https://github.com/tmuxinator/tmuxinator
|
||||
[8]: https://opensource.com/sites/default/files/uploads/productivity_15-2.png (tmux layout information)
|
||||
[9]: https://opensource.com/article/20/1/organize-email-notmuch
|
||||
[10]: https://opensource.com/article/20/1/sync-contacts-locally
|
||||
[11]: https://opensource.com/article/20/1/open-source-calendar
|
||||
[12]: https://opensource.com/article/20/1/open-source-to-do-list
|
||||
[13]: https://opensource.com/sites/default/files/uploads/productivity_15-3.png (sample layout launched by tmuxinator)
|
||||
[14]: https://opensource.com/article/20/1/open-source-reddit-client
|
||||
[15]: https://opensource.com/article/20/1/open-source-rss-feed-reader
|
||||
[16]: https://opensource.com/article/20/1/open-source-chat-tool
|
||||
[17]: https://opensource.com/article/20/1/tweet-terminal-rainbow-stream
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11896-1.html)
|
||||
[#]: subject: (Joplin: The True Open Source Evernote Alternative)
|
||||
[#]: via: (https://itsfoss.com/joplin/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
@ -10,53 +10,50 @@
|
||||
Joplin:真正的 Evernote 开源替代品
|
||||
======
|
||||
|
||||
_**简介:Joplin 是一个开源笔记记录和待办应用。你可以将笔记组织到笔记本中并标记它们。Joplin 还提供网络剪贴板来保存来自互联网的文章。**_
|
||||
|
||||
> Joplin 是一个开源笔记记录和待办应用。你可以将笔记组织到笔记本中并标记它们。Joplin 还提供网络剪贴板来保存来自互联网的文章。
|
||||
|
||||
### Joplin:开源笔记管理器
|
||||
|
||||
![][1]
|
||||
![][4]
|
||||
|
||||
如果你喜欢[Evernote][2],那么你不会不太适应开源软件 [Joplin][3]。
|
||||
如果你喜欢 [Evernote][2],那么你不会不太适应这个开源软件 [Joplin][3]。
|
||||
|
||||
Joplin 是一个优秀的开源笔记应用,拥有丰富的功能。你可以记笔记、写待办事项并且通过和 Dropbox 和 NextCloud 等云服务链接来跨设备同步笔记。同步通过端到端加密保护。
|
||||
Joplin 是一个优秀的开源笔记应用,拥有丰富的功能。你可以记笔记、记录待办事项并且通过和 Dropbox 和 NextCloud 等云服务链接来跨设备同步笔记。同步过程通过端到端加密保护。
|
||||
|
||||
Joplin 还有一个 Web 剪贴板,能让你将网页另存为笔记。网络剪贴板可用于 Firefox 和 Chrome/Chromium 浏览器。
|
||||
Joplin 还有一个 Web 剪贴板,能让你将网页另存为笔记。这个网络剪贴板可用于 Firefox 和 Chrome/Chromium 浏览器。
|
||||
|
||||
Joplin 可以导入 enex 格式的 Evernote 文件, 这让从 Evernote 切换变得容易。
|
||||
Joplin 可以导入 enex 格式的 Evernote 文件,这让从 Evernote 切换变得容易。
|
||||
|
||||
因为自己保存数据,你可以用 Joplin 格式或者原始格式导出所有文件。
|
||||
因为数据自行保存,所以你可以用 Joplin 格式或者原始格式导出所有文件。
|
||||
|
||||
### Joplin 的功能
|
||||
|
||||
![][4]
|
||||
![][1]
|
||||
|
||||
以下是 Joplin 的所有功能列表:
|
||||
|
||||
* 将笔记保存到笔记本和子笔记本中,以便更好地组织
|
||||
* 创建待办事项清单
|
||||
* 可以标记和搜索笔记
|
||||
* 离线优先,因此即使没有互联网连接,所有数据始终在设备上可用
|
||||
* Markdown 笔记支持图片、数学符号和复选框
|
||||
* 支持附件
|
||||
* 可在桌面、移动设备和终端(CLI)使用
|
||||
* 可在 Firefox 和 Chrome 使用[网页剪切板][5]
|
||||
* 端到端加密
|
||||
* 保留笔记历史
|
||||
* 根据名称、时间等对笔记进行排序
|
||||
* 可与 [Nextcloud][7]、Dropbox、WebDAV 和 OneDrive 等各种[云服务][6]同步
|
||||
* 从 Evernote 导入文件
|
||||
* 导出 JEX 文件(Joplin 导出格式)和原始文件
|
||||
* 支持笔记、待办事项、标签和笔记本
|
||||
* 任意跳转功能
|
||||
* 支持移动设备和桌面应用通知
|
||||
* 地理位置支持
|
||||
* 支持多种语言
|
||||
* 外部编辑器支持:在 Joplin 中一键用你最喜欢的编辑器打开笔记
|
||||
|
||||
* 将笔记保存到笔记本和子笔记本中,以便更好地组织
|
||||
* 创建待办事项清单
|
||||
* 笔记可以被标记和搜索
|
||||
* 离线优先,因此即使没有互联网连接,所有数据始终在设备上可用
|
||||
* Markdown 笔记支持图片、数学符号和复选框
|
||||
* 支持附件
|
||||
* 应用可在桌面、移动设备和终端(CLI)使用
|
||||
* 可在 Firefox 和 Chrome 使用[网页剪切板][5]
|
||||
* 端到端加密
|
||||
* 保留笔记历史
|
||||
* 根据名称,时间等对笔记进行排序
|
||||
* 与 [Nextcloud][7]、Dropbox、WebDAV 和 OneDrive 等各种[云服务][6]同步
|
||||
* 从 Evernote 导入文件
|
||||
* 导出 JEX 文件(Joplin 导出格式)和原始文件。
|
||||
* 支持笔记、待办事项、标签和笔记本。
|
||||
* 任意跳转功能。
|
||||
* 支持移动设备和桌面应用通知。
|
||||
* 地理位置支持。
|
||||
* 支持多种语言
|
||||
* 外部编辑器支持–在 Joplin 中一键用你最喜欢的编辑器打开笔记。
|
||||
|
||||
|
||||
### Installing Joplin on Linux and other platforms
|
||||
### 在 Linux 和其它平台上安装 Joplin
|
||||
|
||||
![][10]
|
||||
|
||||
@ -64,23 +61,23 @@ Joplin 可以导入 enex 格式的 Evernote 文件, 这让从 Evernote 切换
|
||||
|
||||
在 Linux 中,你可以获取 Joplin 的 [AppImage][14] 文件,并作为可执行文件运行。你需要为下载的文件授予执行权限。
|
||||
|
||||
[Download Joplin][15]
|
||||
- [下载 Joplin][15]
|
||||
|
||||
### 体验 Joplin
|
||||
|
||||
Joplin 中的笔记使用 markdown,但你不需要了解它。编辑器的顶部面板能让你以图形方式选择项目符号、标题、图像、链接等。
|
||||
Joplin 中的笔记使用 Markdown,但你不需要了解它。编辑器的顶部面板能让你以图形方式选择项目符号、标题、图像、链接等。
|
||||
|
||||
虽然 Joplin 提供了许多有趣的功能,但你需要自己去尝试。例如,默认情况下未启用 Web 剪切板,我需要发现如何打开它。
|
||||
|
||||
你需要从桌面应用启用剪切板。在顶部菜单中,进入 “Tools->Options”。你可以在此处找到 Web 剪切板选项:
|
||||
你需要从桌面应用启用剪切板。在顶部菜单中,进入 “Tools->Options”。你可以在此处找到 Web 剪切板选项:
|
||||
|
||||
![Enable Web Clipper from the desktop application first][16]
|
||||
|
||||
它的 Web 剪切板不如 Evernote 的 Web 剪切板聪明,后者可以以图形方式剪辑网页文章的一部分。但是,它也足够了。
|
||||
它的 Web 剪切板不如 Evernote 的 Web 剪切板聪明,后者可以以图形方式剪辑网页文章的一部分。但是,也足够了。
|
||||
|
||||
这是一个在积极开发中的开源软件,我希望它随着时间的推移得到更多的改进。
|
||||
这是一个在活跃开发中的开源软件,我希望它随着时间的推移得到更多的改进。
|
||||
|
||||
**总结**
|
||||
### 总结
|
||||
|
||||
如果你正在寻找一个不错的拥有 Web 剪切板的笔记应用,你可以试试 Joplin。如果你喜欢它,并将继续使用,尝试通过捐赠或改进代码和文档来帮助 Joplin 开发。我以 FOSS 的名义[捐赠][17]了 25 欧。
|
||||
|
||||
@ -93,7 +90,7 @@ via: https://itsfoss.com/joplin/
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,83 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (qianmingtian)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11902-1.html)
|
||||
[#]: subject: (Give an old MacBook new life with Linux)
|
||||
[#]: via: (https://opensource.com/article/20/2/macbook-linux-elementary)
|
||||
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
|
||||
|
||||
用 Linux 让旧 MacBook 焕发新生
|
||||
======
|
||||
|
||||
> Elementary OS 的最新版本 Hera 是一个令人印象深刻的平台,它可以让过时的 MacBook 得以重生。
|
||||
|
||||

|
||||
|
||||
当我安装苹果的 [MacOS Mojave][2] 时,它使我以前可靠的 MacBook Air 慢得像爬一样。我的计算机发售于 2015 年,具有 4 GB 内存、i5 处理器和 Broadcom 4360 无线卡,但是对于我的日常使用来说,Mojava 有点过分了,它不能和 [GnuCash][3] 一起工作,这激起了我重返 Linux 的欲望。我很高兴能重返,但是我深感遗憾的是,我的这台出色的 MacBook 被闲置了。
|
||||
|
||||
我在 MacBook Air 上尝试了几种 Linux 发行版,但总会有缺陷。有时是无线网卡;还有一次,它缺少对触摸板的支持。看了一些不错的评论后,我决定尝试 [Elementary OS][4] 5.0(Juno)。我用 USB [制作了启动盘][5],并将其插入 MacBook Air 。我来到了一个<ruby>现场<rt>live</rt></ruby>桌面,并且操作系统识别出了我的 Broadcom 无线芯片组 —— 我认为这可能行得通!
|
||||
|
||||
我喜欢在 Elementary OS 中看到的内容。它的 [Pantheon][6] 桌面真的很棒,并且其外观和使用起来的感觉对 Apple 用户来说很熟悉 —— 它的显示屏底部有一个扩展坞,并带有一些指向常用应用程序的图标。我对我之前期待的预览感到满意,所以我决定安装它,然后我的无线设备消失了。真的很令人失望。我真的很喜欢 Elementary OS ,但是没有无线网络是不行的。
|
||||
|
||||
时间快进到 2019 年 12 月,当我在 [Linux4Everyone][7] 播客上听到有关 Elementary 最新版本 v.5.1(Hera) 使 MacBook 复活的评论时,我决定用 Hera 再试一次。我下载了 ISO ,创建了可启动驱动器,将其插入电脑,这次操作系统识别了我的无线网卡。我可以在上面工作了。
|
||||
|
||||
![运行 Hera 的 MacBook Air][8]
|
||||
|
||||
我非常高兴我轻巧又功能强大的 MacBook Air 通过 Linux 焕然一新。我一直在更详细地研究 Elementary OS,我可以告诉你我印象深刻的东西。
|
||||
|
||||
### Elementary OS 的功能
|
||||
|
||||
根据 [Elementary 的博客][9],“新设计的登录和锁定屏幕问候语看起来更清晰、效果更好,并且修复了以前问候语中报告的许多问题,包括输入焦点问题,HiDPI 问题和更好的本地化。Hera 的新设计是为了响应来自 Juno 的用户反馈,并启用了一些不错的新功能。”
|
||||
|
||||
“不错的新功能”是在轻描淡写 —— Elementary OS 拥有我见过的最佳设计的 Linux 用户界面之一。默认情况下,系统上的“系统设置”图标位于扩展坞上。更改设置很容易,很快我就按照自己的喜好配置了系统。我需要的文字大小比默认值大,辅助功能是易于使用的,允许我设置大文字和高对比度。我还可以使用较大的图标和其他选项来调整扩展坞。
|
||||
|
||||
![Elementary OS 的设置界面][10]
|
||||
|
||||
按下 Mac 的 Command 键将弹出一个键盘快捷键列表,这对新用户非常有帮助。
|
||||
|
||||
![Elementary OS 的键盘快捷键][11]
|
||||
|
||||
Elementary OS 附带的 [Epiphany][12] Web 浏览器,我发现它非常易于使用。它与 Chrome、Chromium 或 Firefox 略有不同,但它已经绰绰有余。
|
||||
|
||||
对于注重安全的用户(我们应该都是),Elementary OS 的安全和隐私设置提供了多个选项,包括防火墙、历史记录、锁定,临时和垃圾文件的自动删除以及用于位置服务开/关的开关。
|
||||
|
||||
![Elementary OS 的隐私与安全][13]
|
||||
|
||||
### 有关 Elementray OS 的更多信息
|
||||
|
||||
Elementary OS 最初于 2011 年发布,其最新版本 Hera 于 2019 年 12 月 3 日发布。 Elementary 的联合创始人兼 CXO 的 [Cassidy James Blaede][14] 是操作系统的 UX 架构师。 Cassidy 喜欢使用开放技术来设计和构建有用、可用和令人愉悦的数字产品。
|
||||
|
||||
Elementary OS 具有出色的用户[文档][15],其代码(在 GPL 3.0 下许可)可在 [GitHub][16] 上获得。Elementary OS 鼓励参与该项目,因此请务必伸出援手并[加入社区][17]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/macbook-linux-elementary
|
||||
|
||||
作者:[Don Watkins][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[qianmingtian][c]
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/don-watkins
|
||||
[b]: https://github.com/lujun9972
|
||||
[c]: https://github.com/qianmingtian
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_cafe_brew_laptop_desktop.jpg?itok=G-n1o1-o (Coffee and laptop)
|
||||
[2]: https://en.wikipedia.org/wiki/MacOS_Mojave
|
||||
[3]: https://www.gnucash.org/
|
||||
[4]: https://elementary.io/
|
||||
[5]: https://opensource.com/life/14/10/test-drive-linux-nothing-flash-drive
|
||||
[6]: https://opensource.com/article/19/12/pantheon-linux-desktop
|
||||
[7]: https://www.linux4everyone.com/20-macbook-pro-elementary-os
|
||||
[8]: https://opensource.com/sites/default/files/uploads/macbookair_hera.png (MacBook Air with Hera)
|
||||
[9]: https://blog.elementary.io/introducing-elementary-os-5-1-hera/
|
||||
[10]: https://opensource.com/sites/default/files/uploads/elementaryos_settings.png (Elementary OS's Settings screen)
|
||||
[11]: https://opensource.com/sites/default/files/uploads/elementaryos_keyboardshortcuts.png (Elementary OS's Keyboard shortcuts)
|
||||
[12]: https://en.wikipedia.org/wiki/GNOME_Web
|
||||
[13]: https://opensource.com/sites/default/files/uploads/elementaryos_privacy-security.png (Elementary OS's Privacy and Security screen)
|
||||
[14]: https://github.com/cassidyjames
|
||||
[15]: https://elementary.io/docs/learning-the-basics#learning-the-basics
|
||||
[16]: https://github.com/elementary
|
||||
[17]: https://elementary.io/get-involved
|
@ -1,31 +1,31 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11895-1.html)
|
||||
[#]: subject: (Getting started with GnuCash)
|
||||
[#]: via: (https://opensource.com/article/20/2/gnucash)
|
||||
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
|
||||
|
||||
开始使用 GnuCash
|
||||
======
|
||||
使用 GnuCash 管理你的个人或小型企业会计。
|
||||
![A dollar sign in a network][1]
|
||||
|
||||
在过去的四年里,我一直在用 [GnuCash][2] 来管理我的个人财务,我对此非常满意。这个开源 (GPL v3) 项目自 1998 年首次发布以来一直成长和改进,2019 年 12 月发布的最新版本 3.8 增加了许多改进和 bug 修复。
|
||||
> 使用 GnuCash 管理你的个人或小型企业会计。
|
||||
|
||||

|
||||
|
||||
在过去的四年里,我一直在用 [GnuCash][2] 来管理我的个人财务,我对此非常满意。这个开源(GPL v3)项目自 1998 年首次发布以来一直成长和改进,2019 年 12 月发布的最新版本 3.8 增加了许多改进和 bug 修复。
|
||||
|
||||
GnuCash 可在 Windows、MacOS 和 Linux 中使用。它实现了一个复式记账系统,并可以导入各种流行的开放和专有文件格式,包括 QIF、QFX、OFX、CSV 等。这使得从其他财务应用转换(包括 Quicken)而来很容易,它是为取代这些而出现的。
|
||||
|
||||
借助 GnuCash,你可以跟踪个人财务状况以及小型企业会计和开票。它没有一个集成的工资系统。根据文档,你可以在 GnuCash 中跟踪工资支出,但你必须在软件外部计算税金和扣减。
|
||||
借助 GnuCash,你可以跟踪个人财务状况以及小型企业会计和开票。它没有集成的工资系统。根据文档,你可以在 GnuCash 中跟踪工资支出,但你必须在该软件外计算税金和扣减。
|
||||
|
||||
### 安装
|
||||
|
||||
要在 Linux 上安装 GnuCash:
|
||||
|
||||
* 在 Red Hat、CentOS 或 Fedora 中: **$ sudo dnf install gnucash**
|
||||
* 在 Debian、Ubuntu 或 Pop_OS 中: **$ sudo apt install gnucash**
|
||||
|
||||
|
||||
* 在 Red Hat、CentOS 或 Fedora 中: `$ sudo dnf install gnucash`
|
||||
* 在 Debian、Ubuntu 或 Pop_OS 中: `$ sudo apt install gnucash`
|
||||
|
||||
你也可以从 [Flathub][3] 安装它,我在运行 Elementary OS 的笔记本上使用它。(本文中的所有截图都来自此次安装)。
|
||||
|
||||
@ -37,7 +37,7 @@ GnuCash 可在 Windows、MacOS 和 Linux 中使用。它实现了一个复式记
|
||||
|
||||
#### 个人账户
|
||||
|
||||
如果你选择第一个选项(正如我所做的那样),GnuCash 会打开一个页面给你向导。它收集初始数据并设置账户首选项,例如账户类型和名称、商业数据(例如,税号)和首选货币。
|
||||
如果你选择第一个选项(正如我所做的那样),GnuCash 会打开一个页面帮你起步。它收集初始数据并设置账户首选项,例如账户类型和名称、商业数据(例如,税号)和首选货币。
|
||||
|
||||
![GnuCash new account setup][5]
|
||||
|
||||
@ -49,7 +49,7 @@ GnuCash 支持个人银行账户、商业账户、汽车贷款、CD 和货币市
|
||||
|
||||
#### 开票
|
||||
|
||||
GnuCash 还支持小型企业功能,包括客户、供应商和开票。要创建发票,请在 **Business ->Invoice** 中输入数据。
|
||||
GnuCash 还支持小型企业功能,包括客户、供应商和开票。要创建发票,请在 “Business -> Invoice” 中输入数据。
|
||||
|
||||
![GnuCash create invoice][7]
|
||||
|
||||
@ -63,7 +63,7 @@ GnuCash 还支持小型企业功能,包括客户、供应商和开票。要创
|
||||
|
||||
![GnuCash help][9]
|
||||
|
||||
项目的网站包含许多有用的信息的链接,例如 GnuCash [功能][10]的概述。GnuCash 还提供了[详细的文档][11],可供下载和离线阅读,它还有一个 [wiki][12],为用户和开发人员提供了有用的信息。
|
||||
该项目的网站包含许多有用的信息的链接,例如 GnuCash [功能][10]的概述。GnuCash 还提供了[详细的文档][11],可供下载和离线阅读,它还有一个 [wiki][12],为用户和开发人员提供了有用的信息。
|
||||
|
||||
你可以在项目的 [GitHub][13] 仓库中找到其他文件和文档。GnuCash 项目由志愿者驱动。如果你想参与,请查看项目的 wiki 上的 [Getting involved][14] 部分。
|
||||
|
||||
@ -73,8 +73,8 @@ via: https://opensource.com/article/20/2/gnucash
|
||||
|
||||
作者:[Don Watkins][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi]](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
218
published/20200206 3 ways to use PostgreSQL commands.md
Normal file
218
published/20200206 3 ways to use PostgreSQL commands.md
Normal file
@ -0,0 +1,218 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Morisun029)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11904-1.html)
|
||||
[#]: subject: (3 ways to use PostgreSQL commands)
|
||||
[#]: via: (https://opensource.com/article/20/2/postgresql-commands)
|
||||
[#]: author: (Greg Pittman https://opensource.com/users/greg-p)
|
||||
|
||||
3 种使用 PostgreSQL 命令的方式
|
||||
======
|
||||
|
||||
> 无论你需要的东西简单(如一个购物清单)亦或复杂(如色卡生成器) ,PostgreSQL 命令都能使它变得容易起来。
|
||||
|
||||

|
||||
|
||||
在 [PostgreSQL 入门][2]一文中, 我解释了如何安装、设置和开始使用这个开源数据库软件。不过,使用 [PostgreSQL][3] 中的命令可以做更多事情。
|
||||
|
||||
例如,我使用 Postgres 来跟踪我的杂货店购物清单。我的大多数杂货店购物是在家里进行的,而且每周进行一次大批量的采购。我去几个不同的地方购买清单上的东西,因为每家商店都提供特定的选品或质量,亦或更好的价格。最初,我制作了一个 HTML 表单页面来管理我的购物清单,但这样无法保存我的输入内容。因此,在想到要购买的物品时我必须马上列出全部清单,然后到采购时我常常会忘记一些我需要或想要的东西。
|
||||
|
||||
相反,使用 PostgreSQL,当我想到需要的物品时,我可以随时输入,并在购物前打印出来。你也可以这样做。
|
||||
|
||||
### 创建一个简单的购物清单
|
||||
|
||||
首先,输入 `psql` 命令进入数据库,然后用下面的命令创建一个表:
|
||||
|
||||
```
|
||||
Create table groc (item varchar(20), comment varchar(10));
|
||||
```
|
||||
|
||||
输入如下命令在清单中加入商品:
|
||||
|
||||
```
|
||||
insert into groc values ('milk', 'K');
|
||||
insert into groc values ('bananas', 'KW');
|
||||
```
|
||||
|
||||
括号中有两个信息(逗号隔开):前面是你需要买的东西,后面字母代表你要购买的地点以及哪些东西是你每周通常都要买的(`W`)。
|
||||
|
||||
因为 `psql` 有历史记录,你可以按向上键在括号内编辑信息,而无需输入商品的整行信息。
|
||||
|
||||
在输入一小部分商品后,输入下面命令来检查前面的输入内容。
|
||||
|
||||
```
|
||||
Select * from groc order by comment;
|
||||
|
||||
item | comment
|
||||
----------------+---------
|
||||
ground coffee | H
|
||||
butter | K
|
||||
chips | K
|
||||
steak | K
|
||||
milk | K
|
||||
bananas | KW
|
||||
raisin bran | KW
|
||||
raclette | L
|
||||
goat cheese | L
|
||||
onion | P
|
||||
oranges | P
|
||||
potatoes | P
|
||||
spinach | PW
|
||||
broccoli | PW
|
||||
asparagus | PW
|
||||
cucumber | PW
|
||||
sugarsnap peas | PW
|
||||
salmon | S
|
||||
(18 rows)
|
||||
```
|
||||
|
||||
此命令按 `comment` 列对结果进行排序,以便按购买地点对商品进行分组,从而使你的购物更加方便。
|
||||
|
||||
使用 `W` 来指明你每周要买的东西,当你要清除表单为下周的列表做准备时,你可以将每周的商品保留在购物清单上。输入:
|
||||
|
||||
```
|
||||
delete from groc where comment not like '%W';
|
||||
```
|
||||
|
||||
注意,在 PostgreSQL 中 `%` 表示通配符(而非星号)。所以,要保存输入内容,需要输入:
|
||||
|
||||
```
|
||||
delete from groc where item like 'goat%';
|
||||
```
|
||||
|
||||
不能使用 `item = 'goat%'`,这样没用。
|
||||
|
||||
在购物时,用以下命令输出清单并打印或发送到你的手机:
|
||||
|
||||
```
|
||||
\o groclist.txt
|
||||
select * from groc order by comment;
|
||||
\o
|
||||
```
|
||||
|
||||
最后一个命令 `\o` 后面没有任何内容,将重置输出到命令行。否则,所有的输出会继续输出到你创建的杂货店购物文件 `groclist.txt` 中。
|
||||
|
||||
### 分析复杂的表
|
||||
|
||||
这个逐项列表对于数据量小的表来说没有问题,但是对于数据量大的表呢?几年前,我帮 [FreieFarbe.de][4] 的团队从 HLC 调色板中创建一个自由色的色样册。事实上,任何能想象到的打印色都可按色调、亮度、浓度(饱和度)来规定。最终结果是 [HLC Color Atlas][5],下面是我们如何实现的。
|
||||
|
||||
该团队向我发送了具有颜色规范的文件,因此我可以编写可与 Scribus 配合使用的 Python 脚本,以轻松生成色样册。一个例子像这样开始:
|
||||
|
||||
```
|
||||
HLC, C, M, Y, K
|
||||
H010_L15_C010, 0.5, 49.1, 0.1, 84.5
|
||||
H010_L15_C020, 0.0, 79.7, 15.1, 78.9
|
||||
H010_L25_C010, 6.1, 38.3, 0.0, 72.5
|
||||
H010_L25_C020, 0.0, 61.8, 10.6, 67.9
|
||||
H010_L25_C030, 0.0, 79.5, 18.5, 62.7
|
||||
H010_L25_C040, 0.4, 94.2, 17.3, 56.5
|
||||
H010_L25_C050, 0.0, 100.0, 15.1, 50.6
|
||||
H010_L35_C010, 6.1, 32.1, 0.0, 61.8
|
||||
H010_L35_C020, 0.0, 51.7, 8.4, 57.5
|
||||
H010_L35_C030, 0.0, 68.5, 17.1, 52.5
|
||||
H010_L35_C040, 0.0, 81.2, 22.0, 46.2
|
||||
H010_L35_C050, 0.0, 91.9, 20.4, 39.3
|
||||
H010_L35_C060, 0.1, 100.0, 17.3, 31.5
|
||||
H010_L45_C010, 4.3, 27.4, 0.1, 51.3
|
||||
```
|
||||
|
||||
这与原始数据相比,稍有修改,原始数据用制表符分隔。我将其转换成 CSV 格式(用逗号分割值),我更喜欢其与 Python 一起使用(CSV 文也很有用,因为它可轻松导入到电子表格程序中)。
|
||||
|
||||
在每一行中,第一项是颜色名称,其后是其 C、M、Y 和 K 颜色值。 该文件包含 1,793 种颜色,我想要一种分析信息的方法,以了解这些值的范围。这就是 PostgreSQL 发挥作用的地方。我不想手动输入所有数据 —— 我认为输入过程中我不可能不出错,而且令人头痛。幸运的是,PostgreSQL 为此提供了一个命令。
|
||||
|
||||
首先用以下命令创建数据库:
|
||||
|
||||
```
|
||||
Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);
|
||||
```
|
||||
|
||||
然后通过以下命令引入数据:
|
||||
|
||||
```
|
||||
\copy hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);
|
||||
```
|
||||
|
||||
开头有反斜杠,是因为使用纯 `copy` 命令的权限仅限于 root 用户和 Postgres 的超级用户。在括号中,`header` 表示第一行包含标题,应忽略,`CSV` 表示文件格式为 CSV。请注意,在此方法中,颜色名称不需要用括号括起来。
|
||||
|
||||
如果操作成功,会看到 `COPY NNNN`,其中 N 表示插入到表中的行数。
|
||||
|
||||
最后,可以用下列命令查询:
|
||||
|
||||
```
|
||||
select * from hlc_cmyk;
|
||||
|
||||
color | c | m | y | k
|
||||
---------------+-------+-------+-------+------
|
||||
H010_L15_C010 | 0.5 | 49.1 | 0.1 | 84.5
|
||||
H010_L15_C020 | 0.0 | 79.7 | 15.1 | 78.9
|
||||
H010_L25_C010 | 6.1 | 38.3 | 0.0 | 72.5
|
||||
H010_L25_C020 | 0.0 | 61.8 | 10.6 | 67.9
|
||||
H010_L25_C030 | 0.0 | 79.5 | 18.5 | 62.7
|
||||
H010_L25_C040 | 0.4 | 94.2 | 17.3 | 56.5
|
||||
H010_L25_C050 | 0.0 | 100.0 | 15.1 | 50.6
|
||||
H010_L35_C010 | 6.1 | 32.1 | 0.0 | 61.8
|
||||
H010_L35_C020 | 0.0 | 51.7 | 8.4 | 57.5
|
||||
H010_L35_C030 | 0.0 | 68.5 | 17.1 | 52.5
|
||||
```
|
||||
|
||||
|
||||
所有的 1,793 行数据都是这样的。回想起来,我不能说此查询对于 HLC 和 Scribus 任务是绝对必要的,但是它减轻了我对该项目的一些担忧。
|
||||
|
||||
为了生成 HLC 色谱,我使用 Scribus 为色板页面中的 13,000 多种颜色自动创建了颜色图表。
|
||||
|
||||
我可以使用 `copy` 命令输出数据:
|
||||
|
||||
```
|
||||
\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);
|
||||
```
|
||||
|
||||
我还可以使用 `where` 子句根据某些值来限制输出。
|
||||
|
||||
例如,以下命令将仅发送以 `H10` 开头的色调值。
|
||||
|
||||
```
|
||||
\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';
|
||||
```
|
||||
|
||||
### 备份或传输数据库或表
|
||||
|
||||
我在此要提到的最后一个命令是 `pg_dump`,它用于备份 PostgreSQL 数据库,并在 `psql` 控制台之外运行。 例如:
|
||||
|
||||
```
|
||||
pg_dump gregp -t hlc_cmyk > hlc.out
|
||||
pg_dump gregp > dball.out
|
||||
```
|
||||
|
||||
第一行是导出 `hlc_cmyk` 表及其结构。第二行将转储 `gregp` 数据库中的所有表。这对于备份或传输数据库或表非常有用。
|
||||
|
||||
要将数据库或表传输到另一台电脑(查看 [PostgreSQL 入门][2]那篇文章获取详细信息),首先在要转入的电脑上创建一个数据库,然后执行相反的操作。
|
||||
|
||||
```
|
||||
psql -d gregp -f dball.out
|
||||
```
|
||||
|
||||
一步创建所有表并输入数据。
|
||||
|
||||
### 总结
|
||||
|
||||
在本文中,我们了解了如何使用 `WHERE` 参数限制操作,以及如何使用 PostgreSQL 通配符 `%`。我们还了解了如何将大批量数据加载到表中,然后将部分或全部表数据输出到文件,甚至是将整个数据库及其所有单个表输出。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/postgresql-commands
|
||||
|
||||
作者:[Greg Pittman][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[Morisun029](https://github.com/Morisun029)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/greg-p
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos)
|
||||
[2]: https://linux.cn/article-11593-1.html
|
||||
[3]: https://www.postgresql.org/
|
||||
[4]: http://freiefarbe.de
|
||||
[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/
|
@ -0,0 +1,112 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chai-yuan)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11897-1.html)
|
||||
[#]: subject: (Connect Fedora to your Android phone with GSConnect)
|
||||
[#]: via: (https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/)
|
||||
[#]: author: (Lokesh Krishna https://fedoramagazine.org/author/lowkeyskywalker/)
|
||||
|
||||
使用 GSConnect 将 Android 手机连接到 Fedora 系统
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
苹果和微软公司都不同程度的提供了桌面产品与移动设备集成。Fedora 提供了类似甚至更高集成度的工具——GSConnect。它可以让你将安卓手机和你的 Fedora 桌面配对并使用。请继续阅读,以了解更多关于它的情况以及它是如何工作的信息。
|
||||
|
||||
### GSConnect 是什么?
|
||||
|
||||
GSConnect 是针对 GNOME 桌面定制的 KDE Connect 程序。KDE Connect 可以使你的设备能够互相通信。但是,在 Fedora 默认的 GNOME 桌面上安装它需要安装大量的 KDE 依赖。
|
||||
|
||||
GSConnect 是一个 KDE Connect 的完整实现,其以 GNOME shell 的拓展形式出现。安装后,GSConnect 允许你执行以下操作及更多:
|
||||
|
||||
* 在计算机上接收电话通知并回复信息
|
||||
* 用手机操纵你的桌面
|
||||
* 在不同设备之间分享文件与链接
|
||||
* 在计算机上查看手机电量
|
||||
* 让手机响铃以便你能找到它
|
||||
|
||||
### 设置 GSConnect 扩展
|
||||
|
||||
设置 GSConnect 需要安装两个组件:计算机上的 GSConnect 扩展和 Android 设备上的 KDE Connect 应用。
|
||||
|
||||
首先,从 GNOME Shell 扩展网站上安装 [GSConnect][2] 扩展。(Fedora Magazine 有一篇关于[如何安装 GNOME Shell 扩展][3]的文章,可以帮助你完成这一步。)
|
||||
|
||||
KDE Connect 应用程序可以在 Google 的 [Play 商店][4]上找到。它也可以在 FOSS Android 应用程序库 [F-Droid][5] 上找到。
|
||||
|
||||
一旦安装了这两个组件,就可以配对两个设备。安装扩展后它在你的系统菜单中显示为“<ruby>移动设备<rt>Mobile Devices</rt></ruby>”。单击它会出现一个下拉菜单,你可以从中访问“<ruby>移动设置<rt>Mobile Settings</rt></ruby>”。
|
||||
|
||||
![][6]
|
||||
|
||||
你可以在这里用 GSConnect 查看并管理已配对的设备。进入此界面后,需要在 Android 设备上启动应用程序。
|
||||
|
||||
你可以在任意一台设备上进行配对初始化,在这里我们从 Android 设备连接到计算机。点击应用程序上的“刷新”,只要两个设备都在同一个无线网络环境中,你的 Android 设备便可以搜索到你的计算机。现在可以向桌面发送配对请求,并在桌面上接受配对请求以完成配对。
|
||||
|
||||
![][7]
|
||||
|
||||
### 使用 GSConnect
|
||||
|
||||
配对后,你将需要在 Android 设备授予权限,才能使用 GSConnect 上提供的许多功能。单击设备列表中的已配对设备,便可以查看所有可用功能,并根据你的偏好和需要启用或禁用它们。
|
||||
|
||||
![][8]
|
||||
|
||||
请记住,你还需要在这个 Android 应用程序中授予相应的权限才能使用这些功能。启用权限后,你现在可以访问桌面上的移动联系人,获得消息通知并回复消息,甚至同步桌面和 Android 设备的剪贴板。
|
||||
|
||||
### 将你的浏览器与“文件”应用集成
|
||||
|
||||
GSConnect 允许你直接从计算机上的文件资源管理器的关联菜单向 Android 设备发送文件。
|
||||
|
||||
在 Fedora 的默认 GNOME 桌面上,你需要安装 `nautilus-python` 依赖包,以便在关联菜单中显示配对的设备。安装此命令非常简单,只需要在你的首选终端运行以下命令:
|
||||
|
||||
```
|
||||
$ sudo dnf install nautilus-python
|
||||
```
|
||||
|
||||
完成后,将在“<ruby>文件<rt>Files</rt></ruby>”应用的关联菜单中显示“<ruby>发送到移动设备<rt>Send to Mobile Device</rt></ruby>”选项。
|
||||
|
||||
![][9]
|
||||
|
||||
同样,为你的浏览器安装相应的 WebExtension,无论是 [Firefox][10] 还是 [Chrome][11] 浏览器,都可以将链接发送到你的 Android 设备。你可以选择直接发送链接以在浏览器中直接打开,或将其作为短信息发送。
|
||||
|
||||
### 运行命令
|
||||
|
||||
GSConnect 允许你定义命令,然后可以从远程设备在计算机上运行这些命令。这使得你可以远程截屏,或者从你的 Android 设备锁定和解锁你的桌面。
|
||||
|
||||
![][12]
|
||||
|
||||
要使用此功能,可以使用标准的 shell 命令和 GSConnect 提供的 CLI。该项目的 GitHub 存储库(CLI Scripting)中提供了有关此操作的文档。
|
||||
|
||||
[KDE UserBase Wiki][13] 有一个命令示例列表。这些例子包括控制桌面的亮度和音量、锁定鼠标和键盘,甚至更改桌面主题。其中一些命令是针对 KDE Plasma 设计的,需要进行修改才能在 GNOME 桌面上运行。
|
||||
|
||||
### 探索并享受乐趣
|
||||
|
||||
GSConnect 使我们能够享受到极大的便利和舒适。深入研究首选项,查看你可以做的所有事情,灵活的使用这些命令功能发挥创意,并在下面的评论中自由分享你解锁的新方式。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/
|
||||
|
||||
作者:[Lokesh Krishna][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[chai-yuan](https://github.com/chai-yuan)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/lowkeyskywalker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2019/12/gsconnect-816x345.jpg
|
||||
[2]: https://extensions.gnome.org/extension/1319/gsconnect/
|
||||
[3]: https://fedoramagazine.org/install-gnome-shell-extension/
|
||||
[4]: https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp
|
||||
[5]: https://f-droid.org/en/packages/org.kde.kdeconnect_tp/
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2020/01/within-the-menu-1024x576.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2020/01/pair-request-1024x576.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2020/01/permissions-1024x576.png
|
||||
[9]: https://fedoramagazine.org/wp-content/uploads/2020/01/send-to-mobile-2-1024x576.png
|
||||
[10]: https://addons.mozilla.org/en-US/firefox/addon/gsconnect/
|
||||
[11]: https://chrome.google.com/webstore/detail/gsconnect/jfnifeihccihocjbfcfhicmmgpjicaec
|
||||
[12]: https://fedoramagazine.org/wp-content/uploads/2020/01/commands-1024x576.png
|
||||
[13]: https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands
|
||||
[14]: https://unsplash.com/@pathum_danthanarayana?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[15]: https://unsplash.com/s/photos/android?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11903-1.html)
|
||||
[#]: subject: (How to Change the Default Terminal in Ubuntu)
|
||||
[#]: via: (https://itsfoss.com/change-default-terminal-ubuntu/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
@ -10,15 +10,13 @@
|
||||
如何在 Ubuntu 中更改默认终端
|
||||
======
|
||||
|
||||
终端是 Linux 系统的关键部分。它能让你通过 shell 访问 Linux 系统。Linux 上有多个终端应用(技术上称为终端仿真器)。
|
||||
<ruby>终端<rt>Terminal</rt></ruby>是 Linux 系统的关键部分。它能让你通过 shell 访问 Linux 系统。Linux 上有多个终端应用(技术上称为终端仿真器)。
|
||||
|
||||
大多数[桌面环境][1]都有自己的终端实现。它们的外观可能有所不同,并且可能有不同的快捷键。
|
||||
|
||||
例如,[Guake 终端][2]对高级用户非常有用,它提供了一些可能无法在发行版默认终端中使用的功能。
|
||||
大多数[桌面环境][1]都有自己的终端实现。它们的外观可能有所不同,并且可能有不同的快捷键。例如,[Guake 终端][2]对高级用户非常有用,它提供了一些可能无法在发行版默认终端中使用的功能。
|
||||
|
||||
你可以在系统上安装其他终端,并将其设为默认,并能通过[快捷键 Ctrl+Alt+T][3] 打开。
|
||||
|
||||
现在的问题来了,如何在 Ubuntu 中更改默认终端。它没有遵循[更改 Ubuntu 中的默认应用][4]的标准方式,要怎么做?
|
||||
现在问题来了,如何在 Ubuntu 中更改默认终端。它没有遵循[更改 Ubuntu 中的默认应用][4]的标准方式,要怎么做?
|
||||
|
||||
### 更改 Ubuntu 中的默认终端
|
||||
|
||||
@ -35,7 +33,7 @@ sudo update-alternatives --config x-terminal-emulator
|
||||
它将显示系统上存在的所有可作为默认值的终端仿真器。当前的默认终端标有星号。
|
||||
|
||||
```
|
||||
[email protected]:~$ sudo update-alternatives --config x-terminal-emulator
|
||||
abhishek@nuc:~$ sudo update-alternatives --config x-terminal-emulator
|
||||
There are 2 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator).
|
||||
|
||||
Selection Path Priority Status
|
||||
@ -54,13 +52,13 @@ Press <enter> to keep the current choice[*], or type selection number: 1
|
||||
update-alternatives: using /usr/bin/gnome-terminal.wrapper to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in manual mode
|
||||
```
|
||||
|
||||
##### 自动模式 vs 手动模式
|
||||
|
||||
你可能已经在 update-alternatives 命令的输出中注意到了自动模式和手动模式。
|
||||
|
||||
如果选择自动模式,那么在安装或删除软件包时,系统可能会自动决定默认应用。该决定受优先级数字的影响(如上一节中的命令输出所示)。
|
||||
|
||||
假设你的系统上安装了 5 个终端仿真器,并删除了默认的仿真器。现在,你的系统将检查哪些仿真器处于自动模式。如果有多个,它将选择优先级最高的一个作为默认仿真器。
|
||||
> **自动模式 vs 手动模式**
|
||||
>
|
||||
> 你可能已经在 `update-alternatives` 命令的输出中注意到了自动模式和手动模式。
|
||||
>
|
||||
> 如果选择自动模式,那么在安装或删除软件包时,系统可能会自动决定默认应用。该决定受优先级数字的影响(如上一节中的命令输出所示)。
|
||||
>
|
||||
> 假设你的系统上安装了 5 个终端仿真器,并删除了默认的仿真器。现在,你的系统将检查哪些仿真器处于自动模式。如果有多个,它将选择优先级最高的一个作为默认仿真器。
|
||||
|
||||
我希望你觉得这个小技巧有用。随时欢迎提出问题和建议。
|
||||
|
||||
@ -71,7 +69,7 @@ via: https://itsfoss.com/change-default-terminal-ubuntu/
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
67
sources/talk/20200212 A SASE Crash Course.md
Normal file
67
sources/talk/20200212 A SASE Crash Course.md
Normal file
@ -0,0 +1,67 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (A SASE Crash Course)
|
||||
[#]: via: (https://www.networkworld.com/article/3526455/a-sase-crash-course.html)
|
||||
[#]: author: (Cato Networks https://www.networkworld.com/author/Matt-Conran/)
|
||||
|
||||
A SASE Crash Course
|
||||
======
|
||||
Get up to speed fast on the Secure Access Service Edge, an emerging converged networking and security category that Gartner has labelled transformational.
|
||||
peshkov
|
||||
|
||||
2020! What could better motivate you to push ahead with your resolutions and organization’s digital transformation than a new year AND a new decade. As you put together your digital strategy, check out a new transformation-empowering (and transformational) technology category Gartner coined the [Secure Access Service Edge][1] or SASE (pronounced “Sassy”). SASE converges wide area networking and identity-based security into a cloud service targeted directly to your branch offices, mobile users, cloud services, and even IoT devices, wherever they happen to be. The result: consistently high WAN performance, security, productivity, agility, and flexibility across the global, mobile, cloud-enabled enterprise.
|
||||
|
||||
To jumpstart your research into one of the few networking categories Gartner has labelled “transformational,” we’ve put together a very workable SASE crash course and reading list. Each lesson helps you dig a little deeper into SASE, so you can develop a good grasp of its components and transformational potential.
|
||||
|
||||
**Lesson 1: SASE as Defined by Gartner**
|
||||
|
||||
So, what is SASE exactly and why should you care? SASE was coined by [Gartner][2] analysts Neil McDonald and Joe Skorupa in a [July 29, 2019 Networking Hype Cycle][3] [Market Trends Report, How to Win as WAN Edge and Security Converge into the Secure Access Service Edge][4] and an August 30, 2019 [Gartner][2] report, The Future of Network Security is in the Cloud. If you don’t have access to these reports, Cato quotes the highlights of the former word for word in this short blog: [The Secure Access Service Edge (SASE), as Described in Gartner’s Hype Cycle for Enterprise Networking, 2019][5]. It’s a great place to get started on exactly what Gartner has to say about SASE and its drivers, likely development, and place in the digitally transforming enterprise. There are also some valuable links to more information on SASE and exactly how the Cato cloud fits into the SASE trend.
|
||||
|
||||
**Lesson 2: What SASE _Is_ and What It _Isn’t_**
|
||||
|
||||
After Gartner piques your interest, get some valuable insight from Cato in this blog: [The Secure Access Service Edge (SASE): Here’s Where Your Digital Business Network Starts][6]. Here you can learn why convergence of wide area networking and security is absolutely vital for the agile, digitally transforming enterprise and why legacy data center-centric solutions can’t deliver any more in a world of user mobility and the cloud. This blog breaks down the four essential attributes of SASE—identity driven, cloud native, support for all edges, and globally distributed—in detail. It also explains why SASE is _not_ anything like telco-managed services and summarizes how Cato delivers SASE effectively.
|
||||
|
||||
**Lesson 3: How Cato Delivers SASE**
|
||||
|
||||
Sometimes visual/audio-based learning can bring things into better focus than straight text, and few people are better at explaining WAN and security concepts than Yishay Yovel, Cato Network’s Chief Marketing Officer. In this short, 17-minute video presentation, [Intro to SASE by Yishay][7], Yishay digs into Gartner’s take on SASE, why WAN and security need to converge, and why SASE is one of only three (out of 29) Networking Hype Cycle categories that Gartner has labeled “transformational.” Yishay gets into a lot of nitty-gritty SASE details and offers valuable perspective on how Cato Networks delivers a complete cloud-native SASE software stack that supports all edges and is identity-driven, scalable, flexible, and easy to deploy and manage. Yishay also explains clearly why some of the other WAN and security solutions out there don’t fulfill some essential requirements of SASE, such as processing traffic close to the source. For visual learners, there are also some great architectural diagrams.
|
||||
|
||||
**Lesson 4: Gartner Webinar Breaks Down SASE and its Implications**
|
||||
|
||||
You’ve heard it from Yishay, now hear it from Gartner’s VP Distinguished Analyst Neil MacDonald _and_ Yishay in this 37-minute [Gartner Webinar: Is SASE the Future of SD-WAN and Network Security][8]? MacDonald explains SASE elements and drivers in depth, why SASE belongs in the cloud, how enterprises will adopt SASE, and how organizations should evaluate SASE offerings. There’s some good detail here on how SASE works in different contexts and scenarios, such as a mobile employee connecting to Salesforce securely from the airport, a contractor accessing a Web application from an unmanaged device, and even wind turbines collecting and aggregating data and sending it to the cloud for processing. Neil digs into core SASE requirements and recommends additional services and some other useful options. Yishay then takes over with why Cato is the world’s first true SASE platform.
|
||||
|
||||
**Lesson 5: The White Paper**
|
||||
|
||||
But wait, there’s more. Here’s a clear and concise white paper from Cato, [The Network for the Digital Business Starts with the Secure Access Service Edge][9]. This is a good piece to give out to the other digital transformation stakeholders in your business if you want them to get up to speed on SASE fast. It’s a quick read that explains why the digital, mobile, cloud-enabled business needs a new converged network/security model. It also covers the four elements of SASE, core SASE capabilities, SASE benefits, and clear examples of what SASE _isn’t_ and why. It describes the features that make Cato one of the most comprehensive SASE offerings on the market. It’s a clear, concise presentation broken into short paragraphs and bullet points to provide a fast introduction to SASE and the Cato Cloud.
|
||||
|
||||
**Lesson 6: Icing on the Cake: The Short and Sweet Video**
|
||||
|
||||
[SASE (Secure Access Service Edge)][10] is a short YouTube video to go along with the white paper, combining perspective and information from Gartner and Cato on why you need SASE simplicity for your digital transforming business.
|
||||
|
||||
We hope you have a happy, healthy, transforming New Year. To accelerate your organization’s digital transformation over the next decade, get up to speed on SASE with these useful blogs, videos, and white papers and find out how SASE can help you make that transformation happen quickly and more easily.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3526455/a-sase-crash-course.html
|
||||
|
||||
作者:[Cato Networks][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Matt-Conran/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: http://www.catonetworks.com/sase?utm_source=idg
|
||||
[2]: https://en.wikipedia.org/wiki/Gartner
|
||||
[3]: https://www.gartner.com/en/documents/3947237
|
||||
[4]: https://www.gartner.com/en/documents/3953690/market-trends-how-to-win-as-wan-edge-and-security-conver
|
||||
[5]: https://www.catonetworks.com/blog/the-secure-access-service-edge-sase-as-described-in-gartners-hype-cycle-for-enterprise-networking-2019/
|
||||
[6]: https://www.catonetworks.com/blog/the-secure-access-service-edge-sase?utm_source=idg
|
||||
[7]: https://catonetworks.wistia.com/medias/kn86smj7q4
|
||||
[8]: https://go.catonetworks.com/VOD-REG-Gartner-SASE?utm_source=idg
|
||||
[9]: https://go.catonetworks.com/The-Network-Starts-with-SASE?utm_source=idg
|
||||
[10]: https://www.youtube.com/watch?v=gLN4NUbjml8
|
@ -0,0 +1,63 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Server sales projected to decline 10% due to coronavirus)
|
||||
[#]: via: (https://www.networkworld.com/article/3526605/server-sales-projected-to-decline-10-due-to-coronavirus.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
Server sales projected to decline 10% due to coronavirus
|
||||
======
|
||||
Demand isn’t tapering off, but China is grinding to a halt under the strain of the pandemic.
|
||||
Writerfantast / Getty Images
|
||||
|
||||
Global server sales had been projected to grow by 1.2% compared to the most recent quarter, but the chaos wrought by the coronavirus in China will cause sales to decline 9.8% sequentially, according to DigiTimes Research.
|
||||
|
||||
DigiTimes is an IT publication based in Taiwan. Its proximity to Taiwanese and Chinese vendors gives it some good sources, but it can also be way off target. However, the signs are piling up that coronavirus is causing some real mayhem.
|
||||
|
||||
For example, DigiTimes also [reported][1] that less than 20% of Chinese factory employees would return to work after an extended Lunar New Year break due to the coronavirus outbreak, and that many components plants in China have decided not to restart production until February 25.
|
||||
|
||||
**[ Now read: [What is quantum computing (and why enterprises should care)][2] ]**
|
||||
|
||||
The Lunar New Year was January 25, so that means Chinese factories have been idle for a month. That’s a lot of supply not being answered, and DigiTimes notes that server demand from large data centers remained strong in the first quarter of 2020.
|
||||
|
||||
Facebook in particular is interested in buying high-density models from white box vendors like Wiwynn and Quanta Computer, but due to the outbreak, these orders, which were originally scheduled for shipment this quarter, have been postponed.
|
||||
|
||||
So it’s not like an economic crash is causing sales to go off a cliff like in 2008. Demand is there, but China can’t make the product right now. This year was expected to be a good year for the server vendors, with all of them projecting sales increases over last year. AMD is ramping up Epyc production, and Intel is expected to release its next-generation “Ice Lake” Xeon platform in the third or the fourth quarter of 2020.
|
||||
|
||||
The good news here is that Wuhan isn’t a major tech manufacturing hub. It does have five display fabs, both LCD and OLED, but so does Shanhai. However, Wuhan has the most advanced display fabs, producing flexible OLEDs, and has the largest capacity, according to David Hsieh, senior director, displays, at Omdia.
|
||||
|
||||
**[ [Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][3] ]**
|
||||
|
||||
Vladimir Galabov, principal analyst for data-center compute in Omdia’s cloud and data-center research practice, also expects to see server shipments impacted by the coronavirus driving a prolonged holiday period in China.
|
||||
|
||||
“I think the majority of the hit will be in the Chinese market,” he said. “This does impact server shipments globally as China represents about 30% of server shipments worldwide. So, I expect the quarterly decline to be more significant than the seasonal 10%. I expect that China will have a 5% additional downward impact on the growth.”
|
||||
|
||||
He added that Q4 of 2019 did significantly overachieve his expectations due to cloud service providers making massive purchases. Omdia expected servers shipped in 2019 to be flat compared to 2018 based on data from 1Q19-3Q19. Instead, it was up 2% to 3% for the year, thanks to the fourth-quarter spurt.
|
||||
|
||||
And servers aren’t the only products taking a hit. DigiTimes says that should the outbreak of the coronavirus last until June, sales of smartphones in the country would be slashed by about 30%, from a projected 400 million units to 280 million units in 2020.
|
||||
|
||||
Also, Mobile World Congress in Barcelona is cancelled due to concerns about the global coronavirus outbreak. The [official cancellation][4] came after a number of big-name companies, including Intel, Cisco, Amazon, Sony, NTT Docomo LG, ZTE, Nvidia, and Ericsson, bowed out of various events that were set for the show.
|
||||
|
||||
Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3526605/server-sales-projected-to-decline-10-due-to-coronavirus.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.digitimes.com/news/a20200210VL202.html
|
||||
[2]: https://www.networkworld.com/article/3275367/what-s-quantum-computing-and-why-enterprises-need-to-care.html
|
||||
[3]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11
|
||||
[4]: https://www.mwcbarcelona.com/attend/safety-security/gsma-statement-on-mwc-2020/
|
||||
[5]: https://www.facebook.com/NetworkWorld/
|
||||
[6]: https://www.linkedin.com/company/network-world
|
83
sources/talk/20200214 Linux is our love language.md
Normal file
83
sources/talk/20200214 Linux is our love language.md
Normal file
@ -0,0 +1,83 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Linux is our love language)
|
||||
[#]: via: (https://opensource.com/article/20/2/linux-love-language)
|
||||
[#]: author: (Christopher Cherry https://opensource.com/users/chcherry)
|
||||
|
||||
Linux is our love language
|
||||
======
|
||||
When a wife teaches a husband some new tech skills, they both learn a
|
||||
lot more than they expect.
|
||||
![Red heart with text "you are not alone"][1]
|
||||
|
||||
2019 was a year of learning in the Cherry household. I am a senior software engineer who set out to learn new skills and, along the way, I taught my husband, Chris. By teaching him some of the things I learned and asking him to work through my technology walkthrough articles, I helped Chris learn new skills that enabled him to pivot his career deeper into the technology field. And I learned new ways to make my walkthroughs and training materials more accessible for readers to digest.
|
||||
|
||||
In this article, we talk about what we learned individually and from each other, then we explore what it means for their future.
|
||||
|
||||
### Questions for the student
|
||||
|
||||
**Jess:** Chris, what made you want to learn more about my field?
|
||||
|
||||
**Chris:** It was primarily to further my career. Being in network engineering has shown me that being an expert only on networks is not as valuable as it once was, and I have to know a little bit of everything. Since the network is often blamed for outages or application challenges these days, I wanted to understand more from a developer's perspective on writing applications so I could see how they depend on the network as a resource.
|
||||
|
||||
**Jess:** What did I teach you first, and what did you learn from it?
|
||||
|
||||
**Chris:** It all started with installing Linux for the first time, then adding [Ansible][2]. Each Linux distribution I worked with was easy enough to install, as long as the hardware was compatible, but compatibility wasn't always clear. That meant sometimes I learned first-hand how to troubleshoot Linux within the first five minutes of running an installation (and I liked it). Ansible gave me a reason to learn Linux package managers to install the software. Once it was installed, I quickly learned how package management handles dependencies as I looked at the files that yum installed, so Ansible, which is written in Python, can run on my system. From there, I started to install all kinds of applications with Ansible.
|
||||
|
||||
**Jessica:** Do you like the way I taught you?
|
||||
|
||||
**Chris:** We had our struggles at first, until we ironed out how I like to learn and how you should present the best way for me to learn. In the beginning, it was hard to follow what you meant. For instance, when you said things like "a Docker container," I had no reference to what you were talking about. Early on, the response was, "well, it's a container," which meant nothing to me at the time. Once I got you to explain it in more detail, it became a lot more fun to learn.
|
||||
|
||||
**Jess:** To be fair, this was a big lesson for me as well. I hadn't trained anyone with less knowledge on this technology than me before you, so you helped me realize that I needed to be clearer with my explanations. Thanks for that.
|
||||
|
||||
How did you feel about testing my articles, the ones where I had you run through the steps?
|
||||
|
||||
**Chris:** Personally, I thought it would be easy, and boy, was I wrong. One of the main things I learned from these, like your [introduction to Vagrant][3], was how each Linux distribution varies more than I realized. The operating system (OS) changes how you set it up, the requirements to run, and the specific commands. It seems like a lot more variability than there is with the network gear I've worked on. So I started to pay a lot more attention to the instructions and whether they were written for my OS or another one (and how difficult it can be to know sometimes). I seemed to break a lot of things along the way.
|
||||
|
||||
**Jess:** I break stuff all day, so different paths for different problems are daily occurrences for me.
|
||||
|
||||
### Questions for the teacher
|
||||
|
||||
**Chris:** Jess, would you change anything with the way you taught me so far?
|
||||
|
||||
**Jess:** I'd have liked to make you read more, as I do. Learning new technology has me churning through books. I read a book and a half, if not two books, a week, and that's with spending one hour in the morning and one hour before bed every day. I also pick one project to run through for two weeks for about an hour a day to reinforce the book skills. And that's in addition to the tech articles I read for the first hour of my day while taking in an immense amount of coffee. When I think about your goal to grow your career, I think books are an important element alongside the great blog posts and articles we talk about. I feel my reading regiment has kept me up to speed, and if you did the same, you would catch up to me pretty quickly.
|
||||
|
||||
**Chris:** So did the student teach the teacher in any way?
|
||||
|
||||
**Jess:** I learned a great deal about being patient from you. For instance, after walking through an installation of Ansible, I asked what you wanted to do next. Your first answer was, "I don't know," which was hard for me because I want you to learn what you want to learn. So I changed my approach, and now we talk more about what you want to achieve before walking through installing anything. When we moved on to the Vagrant article we worked on together, I created it with an end goal in mind, so we had something to achieve right away.
|
||||
|
||||
This actually made a massive change in how I do training at work. Now I ask more questions on how people learn and work hand-in-hand more often than I did before. I am more likely to sit and go through and make sure someone understands what I'm saying and what we're doing. I wasn't really before.
|
||||
|
||||
### What we learned together
|
||||
|
||||
As a couple, we both grew from collaborating on technology over the last year.
|
||||
|
||||
**Chris:** I'm blown away at how much I learned. Over the course of a year, I understand new operating systems, how to use an API, web application deployment with Ansible, and standing up virtual machines with Vagrant. I also learned how documentation makes life better, so it's worth the time it takes to write some. In this field of work, however, behavior isn't always documented, so I've learned to be ready to work through tough issues and document how I fix them.
|
||||
|
||||
**Jess:** Beyond what I learned from teaching you, I've focused on learning a good deal about Kubernetes in cloud environments. That includes deployment strategies, the complexity of the Kubernetes API, building my own containers, and securing these environments. I've also saved time to dabble: toying around with serverless code, AI models, Python, and graphically displaying heat maps. It's been a good year.
|
||||
|
||||
What's next for us? It's yet to be seen, but I can assure you that we're going to share it here on Opensource.com.
|
||||
|
||||
**Who did you mentor in 2019, or who are you mentoring in 2020? Tell us about it in the comments.**
|
||||
|
||||
I can see the brightness of curiosity in my six year old niece Shuchi's eyes when she explores a...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/linux-love-language
|
||||
|
||||
作者:[Christopher Cherry][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/chcherry
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/red-love-heart-alone-stone-path.jpg?itok=O3q1nEVz (Red heart with text "you are not alone")
|
||||
[2]: https://opensource.com/resources/what-ansible
|
||||
[3]: https://opensource.com/resources/vagrant
|
@ -0,0 +1,115 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (3 steps for product marketing your open source project)
|
||||
[#]: via: (https://opensource.com/article/20/2/product-marketing-open-source-project)
|
||||
[#]: author: (Kevin Xu https://opensource.com/users/kevin-xu)
|
||||
|
||||
3 steps for product marketing your open source project
|
||||
======
|
||||
Marketing an open source project is mainly about education, and
|
||||
traditional marketing techniques do not apply.
|
||||
![People meeting][1]
|
||||
|
||||
I frequently get questions from open source project creators or new founders of commercial open source software (COSS) companies about the best way to market their product. Implicit in that inquiry lies more foundational questions: "What the hell is product marketing? How much time should I spend on it?"
|
||||
|
||||
This article aims to share some knowledge and specific action items to help open source creators understand product marketing as a concept and how to bootstrap it on their own until a project reaches the next level of traction.
|
||||
|
||||
### What is product marketing?
|
||||
|
||||
Product marketing for COSS is materially different from product marketing for proprietary software and from general marketing practices like ads, lead generation, sponsorships, booths at conferences and trade shows, etc. Because the source code is open for all to see and the project's evolutionary history is completely transparent, you need to articulate—from a technical level to a technical audience—how and why your project works.
|
||||
|
||||
Using the word "marketing" in this context is, in fact, misleading. It's really about product _education_. Your role is more like a coach, mentor, or teaching assistant in a computer science class or a code bootcamp than a "marketing person."
|
||||
|
||||
Proprietary software products rarely need this level of technical education because no one can see the source code anyway. Therefore, these companies focus on educating their audience about the product's business value, not its technical advantages.
|
||||
|
||||
To build a successful open source project (and any commercial product that may be derived from it), you must educate your audience on _both_ its technical details and business value.
|
||||
|
||||
While this may sound like extra work, it's an advantage inherent to COSS because so much buying power for technology products is shifting to developers. They care deeply about technical details and want to see and understand the source code. Being able to learn, appreciate, and have confidence in a project's technical design, architecture, and future roadmap are key to its adoption.
|
||||
|
||||
Also, developers often treat open source technology as a way to scratch their technical itch and stay sharp in a fast-moving technology landscape. It's an audience that yearns for education, above all.
|
||||
|
||||
Being able to speak to an audience that has these goals and desires is what product marketing and education in the COSS context is all about.
|
||||
|
||||
### How to bootstrap product marketing
|
||||
|
||||
So you (or maybe one or two other engineers) are laboring away to create your open source project, likely in the evening after your day job or on the weekends. How do you bootstrap some effective product marketing on your own?
|
||||
|
||||
I recommend a three-step process to yield the best return for your time:
|
||||
|
||||
1. Peruse online forums
|
||||
2. Write content
|
||||
3. Do in-person meetups
|
||||
|
||||
|
||||
|
||||
#### Online forums
|
||||
|
||||
Rummaging through forums—from general ones like HackerNews and Reddit to ones like Discourse or Slack channels geared to projects that are closely related to what you are building—is a great way to figure out what questions developers have in your space. Starting with this step is less about inserting your project into the discussion and more about gathering ideas on what you should focus on when putting together educational materials about your project.
|
||||
|
||||
Effectively, what you are doing is akin to "listening to your customer."
|
||||
|
||||
Let's be honest; you already spend a lot of time on these forums anyway. The only change is one of mindset, not behavior: Have more focus, jot ideas down actively, practice absorbing critiques (you may see threads critical of your project), and develop some intuition about what developers are thinking about.
|
||||
|
||||
This step assumes you don't already have an active community where developers are asking questions directly. The long-term goal is to build your own community, and good product marketing directly helps with this.
|
||||
|
||||
#### Write
|
||||
|
||||
Now that you have gathered some ideas, it's time to produce some content. Compared to formats like videos and podcasts, _writing_ is the highest-leveraged medium. It has the best long-tail benefits, is most suited for ongoing reference material, and can be most easily repackaged into other mediums. Another factor: open source has a global audience, many of whom might speak English as a second (third, or fourth) language, and written content is easily consumable at a person's own pace.
|
||||
|
||||
Focus your writing on three categories that answer three fundamental questions:
|
||||
|
||||
* What problem does your project solve? In other words: _Why should it exist?_
|
||||
* How is the project architected, and why is it done that way? _Is this a technically well-designed solution that has potential, thus worth investing time in?_
|
||||
* How do I get a taste of it? _How quickly can I get some value out of it?_ This is crucial to reducing your time-to-value metric to the shortest amount possible. For more on this topic, please read my article [_A framework for building products from open source projects_][2].
|
||||
|
||||
|
||||
|
||||
A smart way to begin is by writing three blog posts, each addressing one of the three points. The posts should be canonical to your specific project so that repackaging them into different formats (e.g., slide decks, Quora answers, Twitter threads, podcast interviews, etc.) for different channels should be straightforward.
|
||||
|
||||
After you publish the posts, work the materials into your GitHub, GitLab, Bitbucket, or other repository along with the project's documentation. This is important because your public repo will likely be the face of your project for a long time, even if also you have a dedicated website. A repo with strong educational content will go a long way in building your social proof in the form of stars, forks, and downloads and may even yield some contributions.
|
||||
|
||||
One note on writing: Be patient! Your words likely won't go viral overnight (unless you are a celebrity developer). But if the material is educational, useful, and accessible (no need for fancy language), it will draw attention to your project in time. You do your part, and let Google's SEO algorithm do its part.
|
||||
|
||||
#### In-person meetups
|
||||
|
||||
With a few posts out in the wild, the next step is to find an in-person meetup where you can give a presentation about your project using your writing as foundational material to build a compelling talk.
|
||||
|
||||
You may wonder: "Why? Isn't doing something in-person the biggest time suck? I'd rather code!"
|
||||
|
||||
True. You are not wrong. I recommend this step _specifically_ at this moment, not earlier or later, because you'll get feedback on your output more quickly than what the internet can give. Comments and feedback on your posts will trickle in, but giving a talk at a meetup, taking questions, and chatting with attendees afterward over pizza is valuable and immediate.
|
||||
|
||||
The goal is not to shamelessly pitch your project (reminder: you are an educator, not a marketer), but to listen for the kinds of questions you get when you put your project (and yourself) out there. Another benefit is that it gives you practice delivering presentations, which will become important as your project grows, and you need to present in higher-stakes situations, including large conferences, demos with prospective users, etc.
|
||||
|
||||
I know this may not be practical if you don't live in a tech hub where meetups are aplenty. You may want to look for groups that are open to doing virtual meetups via video or work this into your existing travel plans. (But don't fly across the world to talk at one meetup.)
|
||||
|
||||
In-person meetups can feel scary. Public speaking is not for everyone, and it's a legitimate source of fear. My main tips: Just think of yourself as free entertainment, lower your expectations, don't overthink it, and offer yourself up to meetup organizers proactively because they will love you! Having been both a presenter and a meetup organizer, I know developer-focused meetups are very hungry for good technical education.
|
||||
|
||||
### Final words
|
||||
|
||||
There's a lot more nuance, strategy, and sheer work to effective product marketing, but I hope this post gives you enough guidance and specific action items to bootstrap it. Ultimately, you should still spend the bulk of your time building your technology. And if you have some revenue or funding, it's worth hiring someone who has deep expertise in product marketing, even as a part-time adviser.
|
||||
|
||||
Frankly, product marketing talent is hard to find. You need someone with both the technical chops and curiosity to learn about your project on a deep level and the communication skills to compellingly tell the world about it.
|
||||
|
||||
* * *
|
||||
|
||||
_This article originally appeared on [COSS Media][3] and is republished with permission._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/product-marketing-open-source-project
|
||||
|
||||
作者:[Kevin Xu][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/kevin-xu
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_team_community_group.png?itok=Nc_lTsUK (People meeting)
|
||||
[2]: https://opensource.com/article/19/11/products-open-source-projects
|
||||
[3]: https://coss.media/open-source-creator-product-marketing/
|
@ -0,0 +1,128 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (The Background Story of AppImage [Interview])
|
||||
[#]: via: (https://itsfoss.com/appimage-interview/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
The Background Story of AppImage [Interview]
|
||||
======
|
||||
|
||||
As a Linux user, you might have come across [AppImages][1]. This is a portable packaging format that allows you to run an application on any Linux distribution.
|
||||
|
||||
[Using AppImage][2] is really simple. You just need to give it execute permission and double click to run it, like the .exe files in Windows. This solves a major problem in Linux as different kind of distributions have different kind of packaging formats. You cannot [install .deb files][3] (of Debian/Ubuntu) on [Fedora][4] and vice versa.
|
||||
|
||||
We talked to Simon, the developer of AppImage, about how and why he created this project. Read some of the interesting background story and insights Simon shares about AppImage.
|
||||
|
||||
### Interacting with Simon Peter, the creator of AppImage
|
||||
|
||||
![][5]
|
||||
|
||||
_**It’s FOSS: Few people know about the person behind AppImage. How about sharing a little background information about yourself?**_
|
||||
|
||||
**Simon:** Hi, I’m Simon Peter, based near Frankfurt in Germany. My background is in Economics and Business Administration, but I’ve always been a tinkerer and hacker in my free time, and been working in tech ever since I graduated.
|
||||
|
||||
AppImage, though, is strictly a hobby which I enjoy working on in my spare time. I do a lot of my AppImage work while I’m on a train going from here to there. Somehow I seem to be on the move all the time. Professionally, I work in the product management of a large telecommunications company.
|
||||
|
||||
_**It’s FOSS: Why did you create AppImage?**_
|
||||
|
||||
**Simon:** The first computer I could get my hands on was a [Macintosh][6] in the late 80s. For me, this is the benchmark when it comes to simplicity and usability. When I started to experiment with Linux on the desktop, I always wished it was as elegant and simple to operate and gave me as much flexibility as the early Macs.
|
||||
|
||||
When I tried Linux for the first time in the late 90s, I had to go through a cumbersome process formatting and partitioning hard disks, installing stuff – it took a lot of time and was really cumbersome. A couple of years later, I tried out a Linux Live CD-ROM. It was a complete game changer. You popped in the CD, booted the computer, and everything just worked, right out of the box. No installation, no configuration. The system was always in factory-new state whenever you rebooted the machine. Exactly how I liked it.
|
||||
|
||||
There was only one downside: You could not install additional applications on a read-only CD. Packages always insisted on writing in /usr, where the Live CD was not writeable. Thus, I asked myself: Why can’t I just put applications wherever I want, like on a USB drive or a network share, as I am used from the Mac? How cool would it be if every application was just one single file that I could put wherever I want? And thus the idea for AppImage was born (back then under the name of “klik”).
|
||||
|
||||
Turns out that over time Live systems have become more capable, but I still like the simplicity and freedom that comes with the “one app = one file” idea. For example, I want to be in control of where stuff resides on my hard disks. I want to decide what to update or not to update and when. For most tasks I need a stable, rarely-changing operating system with the latest applications. To this day all I ever run are Live systems, because the operating system “just works” out of the box without any installation or configuration on my side, and every time I reboot the machine I have a “factory new”, known-good state.
|
||||
|
||||
_**It’s FOSS: What challenges did you face in the past and what challenges are you facing right now?**_
|
||||
|
||||
**Simon:** People told me that the idea was nuts, and I had no clue how “things are done on Linux”. Just about when I was beginning to give in, I came across a video of [Linus Torvalds][7] of all people who I noticed was complaining about many of the same things that I always had felt were too complicated when it came to distributing applications for Linux. While I was watching his rant, I also noticed, hey, AppImage actually solves many of those issues. Some time later, Linus came across AppImage, and he apparently liked the idea. That made me think, maybe it’s not that stupid an idea as people had made me believe all the time up to that point.
|
||||
|
||||
Today, people tend to mention AppImage as “one of the new package formats” together with [Snap][8] and [Flatpak][9]. I think that’s comparing apples to oranges. Not only is AppImage not “new” (it’s been around since well over a decade by now), but also it has very different objectives and design principles than the other systems. AppImage is all about single-file application bundles that can be “managed” by nothing else than a web browser and a file manager. It’s meant for “mere morals”, end users, not system administrators. It needs no package manager, it needs no root rights, it needs nothing to be installed on the system. It gives complete freedom to application developers and users.
|
||||
|
||||
_**It’s FOSS: AppImage is a “universal packaging system” and there you compete with Snap (backed by Ubuntu) and Flatpak (backed by Fedora). How do you plan to ‘fight’ against these big corporates?**_
|
||||
|
||||
**Simon:** See? That’s what I mean. AppImage plays in an entirely different playing field.
|
||||
|
||||
AppImage wants to be what exe files or PortableApps are for Windows and what apps inside dmg files are on the Mac – but better.
|
||||
|
||||
Besides, Snap (backed by [Canonical][10]) does not work out-of-the-box on Fedora, and Flatpak (backed by [Red Hat][11]) does not work out-of-the-box on Ubuntu. AppImages can run on either system, and many more, without the need to install anything.
|
||||
|
||||
_**It’s FOSS: How do you see the adoption of AppImage? Are you happy with its growth?**_
|
||||
|
||||
**Simon:** As of early 2020, there are now around 1,000 official AppImages made by the respective application authors that are passing my compatibility tests and can run on the oldest still-supported Ubuntu LTS release, and hundreds more are being worked on as we speak. “Household name” applications like Inkscape, Kdenlive, KDevelop, LibreOffice, PrusaSlicer, Scribus, Slic3r, Ultimaker Cura (too many to name them all) are being distributed in AppImage format. This makes me very happy and I am always excited when I read about a new version being released on Twitter, and then am able to download and run the AppImage instantly, without having to wait for my Linux distribution to carry that new version, and without having to throw away the old (known-good) version just because I want to try out the new (bleeding edge) one.
|
||||
|
||||
The adoption of AppImage is especially strong for nightly and continuous builds. This is because the “one app = one file” concept of AppImage lends itself especially well to try-out software, where you keep multiple versions around for testing purposes, and never have to install anything into the running system. Worst thing that can happen with AppImage is that an application does not launch. In that case, file a bug, delete the file, done. Worst thing that can happen with distribution packages: complete system breakage…
|
||||
|
||||
_**It’s FOSS: One major issue with AppImage is that not all the developers provide an easy way of updating the AppImage versions. Any suggestions for handling it?**_
|
||||
|
||||
**Simon:** AppImage has this concept of “binary delta updates”. Think of it as “diff for applications”. A new version of an application comes out, you download only the parts that have changed, and apply them to the old version. As a result, you get both the old and the new version and can keep them in parallel until you have determined that you don’t need the old version any longer, and throw it away.
|
||||
|
||||
In general, I don’t want to enforce anything with AppImage. Application authors are at liberty to control the whole experience. Up to now, application authors have to do some setup work to make AppImages with this update capability. That being said, I am convinced that if we make it easy enough for developers to get working binary delta updates “for free”, then many will offer them. To this end, I am currently working on a new set of tools written in Go that will set up updates almost automatically, and I hope this will significantly increase the percentage of AppImages that come with this capability.
|
||||
|
||||
_**It’s FOSS: [Nitrux][12] is one of the rare distributions that relies heavily on AppImage. Or there any other such distributions? What can be done make AppImage more popular?**_
|
||||
|
||||
**Simon:** Linux distributions traditionally have thought of themselves as more than just the base operating system itself – they also wanted to control application distribution. Now, as Apple and Microsoft are trying to get more control over application distribution on their desktop platforms, the trend is slowly reversing in Linux land where people are slowly beginning to understand that distributions could be much more polished if they focused on the base operating system and left the packaging of applications to the application authors.
|
||||
|
||||
To make AppImage more popular, I think users and application authors should continue to spread the word that upstream-provided AppImages are in many cases working better than distribution packages. With AppImage, you get a software stack where the application author had a chance to cherry-pick which versions of libraries work together, test and tune both functionality and performance. Who is surprised that the result tends to work better than a “random” combination of whatever versions happened to be in a Linux distribution at a certain, random point in time when a distribution release was put together?
|
||||
|
||||
[Desktop environments][13] could greatly increase usability, not only for AppImages, but also for any other kind of “side-loaded” applications that are not being installed. Just see how a desktop environments handles double-clicking on an executable file that is missing the executable bit. Some are doing a great job in this regard, like [Deepin Linux][14]. Stuff tends to “just work” there as it should.
|
||||
|
||||
Finally, I am currently working on a new set of tools written in Go which I hope will greatly simplify, and make yet more enjoyable, the production and consumption of AppImages. My goal here is to make things less complex for users, remove the need for configuration, make things “just work”, like on the early Macintoshes. Are there any Go developers out here interested to join the effort?
|
||||
|
||||
_**It’s FOSS: I can see there is a website that lists available AppImage applications. Do you have plans to integrate it with other software managers on Linux or create a software manager for AppImage?**_
|
||||
|
||||
**Simon:** [appimage.github.io][15] lists AppImages that have passed my compatibility tests on the oldest still-supported Ubuntu LTS release. Projects creating app stores or software managers are free to use this data. Myself, I am not much interested in those things as I always download AppImages right from the respective project’s download pages. My typical AppImage discovery goes like this:
|
||||
|
||||
1. Read on Twitter that PrusaSlicer has this cool new feature
|
||||
2. Go to the PrusaSlicer GitHub project and read the release notes there
|
||||
3. While there, download the AppImage and have it running a few seconds later
|
||||
|
||||
|
||||
|
||||
So for me personally, I have no need for app centers and app stores, but if people like them, they are free to put AppImages in there. I just never felt the need…
|
||||
|
||||
_**It’s FOSS: What plans do you have for AppImage in future (new features that you plan to add)?**_
|
||||
|
||||
**Simon:** Simplify things even more, remove configuration options, make things “just work”. Reduce the number of GitHub projects needed to get the core AppImage experience for producing and consuming AppImages, including aspects like binary delta updates, sandboxing, etc. Improve usability.
|
||||
|
||||
_**It’s FOSS: Does AppImage project makes money? What kind of support (if any) do you seek from the end users?**_
|
||||
|
||||
**Simon:** No, AppImage makes no money whatsoever.
|
||||
|
||||
I’ll just request the readers to spread the word. Tell your favorite application’s authors that you’d like to see an AppImage, and why.
|
||||
|
||||
* * *
|
||||
|
||||
Team It’s FOSS congratulates Simon for his hard work. Please feel free to convey any message and queries to him in the comment section.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/appimage-interview/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://appimage.org/
|
||||
[2]: https://itsfoss.com/use-appimage-linux/
|
||||
[3]: https://itsfoss.com/install-deb-files-ubuntu/
|
||||
[4]: https://getfedora.org/
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/appimage_simon_interview.jpg?ssl=1
|
||||
[6]: https://en.wikipedia.org/wiki/Macintosh
|
||||
[7]: https://itsfoss.com/linus-torvalds-facts/
|
||||
[8]: https://itsfoss.com/install-snap-linux/
|
||||
[9]: https://flatpak.org/
|
||||
[10]: https://canonical.com/
|
||||
[11]: https://www.redhat.com/en
|
||||
[12]: https://itsfoss.com/nitrux-linux-overview/
|
||||
[13]: https://itsfoss.com/best-linux-desktop-environments/
|
||||
[14]: https://www.deepin.org/en/
|
||||
[15]: https://appimage.github.io/
|
@ -0,0 +1,95 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Minicomputers and The Soul of a New Machine)
|
||||
[#]: via: (https://opensource.com/article/20/2/minicomputers-and-soul-new-machine)
|
||||
[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg)
|
||||
|
||||
Minicomputers and The Soul of a New Machine
|
||||
======
|
||||
The new season of Command Line Heroes begins with a story of increases
|
||||
in memory, company politics, and a forgotten technology at the heart of
|
||||
our computing history.
|
||||
![Command Line Heroes season 4 episode 1 covers the rise of minicomputers][1]
|
||||
|
||||
The [Command Line Heroes podcast][2] is back, and this season it covers the machines that run all the programming languages [I covered last season][3]. As the podcast staff puts it:
|
||||
|
||||
"This season, we'll look at what happens when idealistic teams come together to build visionary machines. Machines made with leaps of faith and a lot of hard, often unrecognized, work in basements and stifling cubicles. Machines that brought teams together and changed us as a society in ways we could only dream of."
|
||||
|
||||
This first episode looks at the non-fiction book (and engineering classic), [_The Soul of a New Machine_][4], to look at a critical moment in computing history. It covers the transition from large, hulking mainframes to the intermediate step of the minicomputer, which will eventually lead us to the PC revolution that we're still living in the wake of.
|
||||
|
||||
### The rise of minicomputers
|
||||
|
||||
One of the most important machines on the path to modern machines, most of us have since forgotten: the minicomputer.
|
||||
|
||||
It was a crucial link in the evolution from mainframe to PC (aka microcomputer). It was also extremely important in the development of software that would fuel the PC revolution, chiefly the operating system. The PDP-7 and PDP-11—on which [UNIX was developed][5]—were examples of minicomputers. So was the machine at the heart of _The Soul of the New Machine_.
|
||||
|
||||
This episode takes us back to this important time in computing and explores this forgotten machine—both in terms of its hardware and software.
|
||||
|
||||
From 1963 to 1977, minicomputers were 12 to 16-bit machines from computing giants DEC ([PDP][6]) and rival upstart [Data General][7] ([Nova][8], [Eclipse][9]). But in October 1977, DEC unveiled the VAX 11/780, a 32-bit CPU built from transistor-transistor logic with a five megahertz cycle-time and 2 megabytes of memory. The VAX launched DEC [into second place][10] in the largest computer company in the world.
|
||||
|
||||
The jump from a 12-bit to a 32-bit CPU is a jump from 4,096 bytes to 4,294,967,296 bytes of data. That increase massively increased the potential for software to do complex tasks while drastically shrinking the size of the computer. And with a 32-bit CPU, the VAX was nearly as powerful as an IBM/360 mainframe—but much smaller and much, much less expensive.
|
||||
|
||||
[The episode][11] goes into the drama that unfolds as teams within Data General race to have the most marketable minicomputer while working through company politics and strong personalities.
|
||||
|
||||
### Revisiting _The Soul of a New Machine_
|
||||
|
||||
_The Soul of a New Machine_ was written in 1981 by Tracy Kidder, and chronicles a small group of engineers at the now-former tech company, Data General, as they attempt to compete with a rival internal group and create a 32-bit minicomputer as a skunkworks project known as "Eagle." For those okay with spoilers, the computer would eventually be known as the [Eclipse MV/8000][12].
|
||||
|
||||
Earlier this year, [Jessie Frazelle][13], of Docker, Go, and Kubernetes fame, and [Bryan Cantrill][14], known for [DTrace][15], Joyent, and many other technologies, publicly wrote about reading the non-fiction classic. As it's written, Cantrill mentioned the book to Frazelle, who read it and then wrote an enthusiastic [blog post][16] about the book. As Frazelle put it:
|
||||
|
||||
"Personally, I look back on the golden age of computers as the time when people were building the first personal computers in their garage. There is a certain whimsy of that time fueled with a mix of hard work and passion for building something crazy with a very small team. In today's age, at large companies, most engineers take jobs where they work on one teeny aspect of a machine or website or app. Sometimes they are not even aware of the larger goal or vision but just their own little world.
|
||||
|
||||
In the book, a small team built an entire machine… The team wasn't driven by power or greed, but by accomplishment and self-fulfillment. They put a part of themselves in the machine, therefore, producing a machine with a soul…The team was made up of programmers with the utmost expertise and experience and also with new programmers."
|
||||
|
||||
Inspired by Frazelle's reaction, Cantrill re-read it and wrote [a blog article][17] about it and writes this beautiful note:
|
||||
|
||||
"…_The Soul of a New Machine_ serves to remind us that the soul of what we build is, above all, shared — that we do not endeavor alone but rather with a group of like-minded individuals."
|
||||
|
||||
Frazelle's and Cantrill's reading of the book and blog [sparked a wave of people][18] exploring and talking about this text. While it remains on my book list, this dialogue-by-book-review is at the heart of the CLH season 4 as it explores the entire machine.
|
||||
|
||||
### Why did the minicomputer go the way of the Neanderthal?
|
||||
|
||||
As we all know, minicomputers are not a popular purchase in today's technology market. Minicomputers ended up being great technology for timesharing. The irony is that they unwittingly sealed their own fate. The Internet, which started off as ARPANET, was basically a new kind of timesharing. They were so good at timesharing that at one point, the DEC PDP 11 accounted for over 30% of the nodes on ARPANET. Minicomputers were powering their own demise.*
|
||||
|
||||
Minicomputers paved the way for smaller computers and for more and more people to have access to these powerful, society-changing machines. But I'm getting ahead of myself. Keep listening to the [new season of Command Line Heroes][2] to continue the story of machines in computing history.
|
||||
|
||||
* * *
|
||||
|
||||
What's your minicomputer story? I'd love to read them in the comments.
|
||||
|
||||
(There were, of course, other factors leading to the end of this era. Minicomputers were fighting at the low end of the market with the rise of microcomputers, while Unix systems continued to push into the midrange market. The rise of the Internet was perhaps its final blow.)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/minicomputers-and-soul-new-machine
|
||||
|
||||
作者:[Matthew Broberg][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/mbbroberg
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command-line-heroes-minicomputers-s4-e1.png?itok=FRaff5i6 (Command Line Heroes season 4 episode 1 covers the rise of minicomputers)
|
||||
[2]: https://www.redhat.com/en/command-line-heroes
|
||||
[3]: https://opensource.com/article/19/6/command-line-heroes-python
|
||||
[4]: https://en.wikipedia.org/wiki/The_Soul_of_a_New_Machine
|
||||
[5]: https://opensource.com/19/9/command-line-heroes-bash
|
||||
[6]: https://en.wikipedia.org/wiki/PDP
|
||||
[7]: https://en.wikipedia.org/wiki/Data_General
|
||||
[8]: https://en.wikipedia.org/wiki/Data_General_Nova
|
||||
[9]: https://en.wikipedia.org/wiki/Data_General_Eclipse
|
||||
[10]: http://www.old-computers.com/history/detail.asp?n=20&t=3
|
||||
[11]: https://www.redhat.com/en/command-line-heroes/season-4/minicomputers
|
||||
[12]: https://en.wikipedia.org/wiki/Data_General_Eclipse_MV/8000
|
||||
[13]: https://twitter.com/jessfraz?lang=en
|
||||
[14]: https://en.wikipedia.org/wiki/Bryan_Cantrill
|
||||
[15]: https://en.wikipedia.org/wiki/DTrace
|
||||
[16]: https://blog.jessfraz.com/post/new-golden-age-of-building-with-soul/
|
||||
[17]: http://dtrace.org/blogs/bmc/2019/02/10/reflecting-on-the-soul-of-a-new-machine/
|
||||
[18]: https://twitter.com/search?q=jessfraz%20soul%20new%20machine&src=typed_query&f=live
|
@ -0,0 +1,99 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Building a community of practice in 5 steps)
|
||||
[#]: via: (https://opensource.com/article/20/2/building-community-practice-5-steps)
|
||||
[#]: author: (Tracy Buckner https://opensource.com/users/tracyb)
|
||||
|
||||
Building a community of practice in 5 steps
|
||||
======
|
||||
A community of practice can kickstart innovation in your organization.
|
||||
Here's how to build one—and ensure it thrives.
|
||||
![Blocks for building][1]
|
||||
|
||||
In the [first part of this series][2], we defined community as a fundamental principle in open organizations, where people often define their roles, responsibilities, and affiliations through shared interests and passions, [not title, role, or position on an organizational chart][3]. Then, in the [second part of the series][4], we explored the many benefits communities of practice bring to open organizations—including fostering learning, encouraging collaboration, and offering an opportunity for creative problem-solving and innovation.
|
||||
|
||||
Now you know you'd like to _start_ a community of practice, but you may still be unsure _where_ to start. This article will help define your roadmap and build a plan for a successful community of practice—in five simple steps (summarized in Figure 1).
|
||||
|
||||
![][5]
|
||||
|
||||
### Step 1: Obtain executive sponsorship
|
||||
|
||||
While having a community manager focused on the day-to-day execution of community matters is important, an executive sponsor is also integral to the success of the community of practice. Typically, an executive sponsor will shoulder higher-level responsibilities, such as focusing on strategy and creating conditions for success (rather than implementation).
|
||||
|
||||
An executive sponsor can help ensure the community's goals are aligned with the overall strategy of the organization. This person can also communicate those goals and gather support for the community from other senior executives (potentially instrumental in securing financial support and resources for the community!).
|
||||
|
||||
Finding the right sponsor is important for the success of the program. An executive leader committed to fostering open culture, transparency, and collaboration will be very successful. Alternatively, you may wish to tap an executive focused on finding new ways to grow and reskill high-potential employees.
|
||||
|
||||
### Step 2: Determine mission and goals
|
||||
|
||||
Once you've established a vision for the community, you'll need to develop its mission statement. This is critical to your success because the mission begins explaining _how you'll achieve that vision_. Primarily, your community's mission should be to share knowledge, promote learning in a particular area, and align that work with organizational strategy. However, the mission statement may also include references to the audience that the community will serve.
|
||||
|
||||
Here's one example mission statement:
|
||||
|
||||
> _To identify and address needs within the cloud infrastructure space in support of the organization’s mission of defining the next generation of open hybrid cloud._
|
||||
|
||||
After articulating a mission like this, you'll need to set specific goals for achieving it. The goals can be long- or short-term, but in either case, you'll need to provide a clear roadmap explaining to community members what the community is trying to achieve.
|
||||
|
||||
### Step 3: Build a core team
|
||||
|
||||
Building a core team is essential to the success of a community. In a typical community of practice—or "CoP," for short—you'll notice four main roles:
|
||||
|
||||
* CoP program manager
|
||||
* CoP manager
|
||||
* Core team members
|
||||
* Members
|
||||
|
||||
|
||||
|
||||
The **CoP program manager** is the face of the community. This person is primarily responsible for supporting the managers and core teams by resolving questions, issues, and concerns. The program manager also guides new communities and evangelizes the communities of practice program inside the organization.
|
||||
|
||||
The **CoP manager** determines community strategy based on business and community needs. This person makes the latest news, content, and events available to community members and ensures that the CoP remains focused on its goals. This person also schedules regular meetings for members and shares other events that may be of interest to them.
|
||||
|
||||
The **CoP core team** is responsible for managing community collateral and best practices to meet the community's goals. The core team supports CoP manager(s) and assists with preparing and leading community meetings.
|
||||
|
||||
**Members** of a community attend meetings, share relevant content and best practices, and support the core team and manager(s) in reaching community goals.
|
||||
|
||||
### Step 4: Promote knowledge management
|
||||
|
||||
Communities of practice produce information—and members must be able to easily access and share that information. So it's important to develop a knowledge-management system for storing that information in a way that keeps it relevant and timely.
|
||||
|
||||
Communities of practice produce information—and members must be able to easily access and share that information. So it's important to develop a knowledge-management system for storing that information in a way that keeps it relevant and timely.
|
||||
|
||||
Over time, your community of practice will likely generate a lot of content. Some of that content may be duplicated, outdated or simply no longer relevant to the community. So it's important to periodically conduct a ROT Analysis of the content validating that the content is not **R**edundant, **O**utdated, or **T**rivial. Consider conducting a ROT analysis every six months or so, in order to keep the content fresh and relevant.
|
||||
|
||||
A number of different content management tools can assist with maintaining and displaying the content for community members. Some organizations use an intranet, while others prefer more robust content management such as [AO Docs][6] or [Drupal][7].
|
||||
|
||||
### Step 5: Engage in regular communication
|
||||
|
||||
The secret to success in maintaining a community of practice is regular communication and collaboration. Communities that speak with each other frequently and share knowledge, ideas, and best practices are most likely to remain intact. CoP managers should schedule regular meetings, meet-ups, and content creation sessions to ensure that members are engaged in the community. It is recommended to have at least a monthly meeting to maintain communication with the community members.
|
||||
|
||||
Chat/messaging apps are also a great tool for facilitating regular communication in communities of practice. These apps offer teams across the globe the ability to communicate in real-time, removing some collaboration boundaries. Members can pose questions and receive answers immediately, without the delay of sending and receiving emails. And should the questions arise again, most messaging apps also provide an easy search mechanism that can help members discover answers.
|
||||
|
||||
### Building your community
|
||||
|
||||
Remember: A community of practice is a cost-effective way to foster learning, encourage collaboration, and promote innovation in an organization. In [_The Open Organization_][8], Jim Whitehurst argues that "the beauty of an open organization is that it is not about pedaling harder, but about tapping into new sources of power both inside and outside to keep pace with all the fast-moving changes in your environment." Building communities of practice are the perfect way to do just that: stop pedaling harder and to tap into new sources of power within your organization.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/building-community-practice-5-steps
|
||||
|
||||
作者:[Tracy Buckner][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/tracyb
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/blocks_building.png?itok=eMOT-ire (Blocks for building)
|
||||
[2]: https://opensource.com/open-organization/19/11/what-is-community-practice
|
||||
[3]: https://opensource.com/open-organization/resources/open-org-definition
|
||||
[4]: https://opensource.com/open-organization/20/1/why-build-community-of-practice
|
||||
[5]: https://opensource.com/sites/default/files/resize/images/open-org/comm_practice_5_steps-700x440.png
|
||||
[6]: https://www.aodocs.com/
|
||||
[7]: https://www.drupal.org/
|
||||
[8]: https://opensource.com/open-organization/resources/what-open-organization
|
@ -1,197 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (mengxinayan)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to structure a multi-file C program: Part 1)
|
||||
[#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-1)
|
||||
[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions)
|
||||
|
||||
How to structure a multi-file C program: Part 1
|
||||
======
|
||||
Grab your favorite beverage, editor, and compiler, crank up some tunes,
|
||||
and start structuring a C program composed of multiple files.
|
||||
![Programming keyboard.][1]
|
||||
|
||||
It has often been said that the art of computer programming is part managing complexity and part naming things. I contend that this is largely true with the addition of "and sometimes it requires drawing boxes."
|
||||
|
||||
In this article, I'll name some things and manage some complexity while writing a small C program that is loosely based on the program structure I discussed in "[How to write a good C main function][2]"—but different. This one will do something. Grab your favorite beverage, editor, and compiler, crank up some tunes, and let's write a mildly interesting C program together.
|
||||
|
||||
### Philosophy of a good Unix program
|
||||
|
||||
The first thing to know about this C program is that it's a [Unix][3] command-line tool. This means that it runs on (or can be ported to) operating systems that provide a Unix C runtime environment. When Unix was invented at Bell Labs, it was imbued from the beginning with a [design philosophy][4]. In my own words: _programs do one thing, do it well, and act on files_. While it makes sense to do one thing and do it well, the part about "acting on files" seems a little out of place.
|
||||
|
||||
It turns out that the Unix abstraction of a "file" is very powerful. A Unix file is a stream of bytes that ends with an end-of-file (EOF) marker. That's it. Any other structure in a file is imposed by the application and not the operating system. The operating system provides system calls that allow a program to perform a set of standard operations on files: open, read, write, seek, and close (there are others, but those are the biggies). Standardizing access to files allows different programs to share a common abstraction and work together even when different people implement them in different programming languages.
|
||||
|
||||
Having a shared file interface makes it possible to build programs that are _composable_. The output of one program can be the input of another program. The Unix family of operating systems provides three files by default whenever a program is executed: standard in (**stdin**), standard out (**stdout**), and standard error (**stderr**). Two of these files are opened in write-only mode: **stdout** and **stderr**, while **stdin** is opened read-only. We see this in action whenever we use file redirection in a command shell like Bash:
|
||||
|
||||
|
||||
```
|
||||
`$ ls | grep foo | sed -e 's/bar/baz/g' > ack`
|
||||
```
|
||||
|
||||
This construction can be described briefly as: the output of **ls** is written to stdout, which is redirected to the stdin of **grep**, whose stdout is redirected to **sed**, whose stdout is redirected to write to a file called **ack** in the current directory.
|
||||
|
||||
We want our program to play well in this ecosystem of equally flexible and awesome programs, so let's write a program that reads and writes files.
|
||||
|
||||
### MeowMeow: A stream encoder/decoder concept
|
||||
|
||||
When I was a dewy-eyed kid studying computer science in the <mumbles>s, there were a plethora of encoding schemes. Some of them were for compressing files, some were for packaging files together, and others had no purpose but to be excruciatingly silly. An example of the last is the [MooMoo encoding scheme][5].
|
||||
|
||||
To give our program a purpose, I'll update this concept for the [2000s][6] and implement a concept called MeowMeow encoding (since the internet loves cats). The basic idea here is to take files and encode each nibble (half of a byte) with the text "meow." A lower-case letter indicates a zero, and an upper-case indicates a one. Yes, it will balloon the size of a file since we are trading 4 bits for 32 bits. Yes, it's pointless. But imagine the surprise on someone's face when this happens:
|
||||
|
||||
|
||||
```
|
||||
$ cat /home/your_sibling/.super_secret_journal_of_my_innermost_thoughts
|
||||
MeOWmeOWmeowMEoW...
|
||||
```
|
||||
|
||||
This is going to be awesome.
|
||||
|
||||
### Implementation, finally
|
||||
|
||||
The full source for this can be found on [GitHub][7], but I'll talk through my thought process while writing it. The object is to illustrate how to structure a C program composed of multiple files.
|
||||
|
||||
Having already established that I want to write a program that encodes and decodes files in MeowMeow format, I fired up a shell and issued the following commands:
|
||||
|
||||
|
||||
```
|
||||
$ mkdir meowmeow
|
||||
$ cd meowmeow
|
||||
$ git init
|
||||
$ touch Makefile # recipes for compiling the program
|
||||
$ touch main.c # handles command-line options
|
||||
$ touch main.h # "global" constants and definitions
|
||||
$ touch mmencode.c # implements encoding a MeowMeow file
|
||||
$ touch mmencode.h # describes the encoding API
|
||||
$ touch mmdecode.c # implements decoding a MeowMeow file
|
||||
$ touch mmdecode.h # describes the decoding API
|
||||
$ touch table.h # defines encoding lookup table values
|
||||
$ touch .gitignore # names in this file are ignored by git
|
||||
$ git add .
|
||||
$ git commit -m "initial commit of empty files"
|
||||
```
|
||||
|
||||
In short, I created a directory full of empty files and committed them to git.
|
||||
|
||||
Even though the files are empty, you can infer the purpose of each from its name. Just in case you can't, I annotated each **touch** with a brief description.
|
||||
|
||||
Usually, a program starts as a single, simple **main.c** file, with only two or three functions that solve the problem. And then the programmer rashly shows that program to a friend or her boss, and suddenly the number of functions in the file balloons to support all the new "features" and "requirements" that pop up. The first rule of "Program Club" is don't talk about "Program Club." The second rule is to minimize the number of functions in one file.
|
||||
|
||||
To be honest, the C compiler does not care one little bit if every function in your program is in one file. But we don't write programs for computers or compilers; we write them for other people (who are sometimes us). I know that is probably a surprise, but it's true. A program embodies a set of algorithms that solve a problem with a computer, and it's important that people understand it when the parameters of the problem change in unanticipated ways. People will have to modify the program, and they will curse your name if you have all 2,049 functions in one file.
|
||||
|
||||
So we good and true programmers break functions out, grouping similar functions into separate files. Here I've got files **main.c**, **mmencode.c**, and **mmdecode.c**. For small programs like this, it may seem like overkill. But small programs rarely stay small, so planning for expansion is a "Good Idea."
|
||||
|
||||
But what about those **.h** files? I'll explain them in general terms later, but in brief, those are called _header_ files, and they can contain C language type definitions and C preprocessor directives. Header files should _not_ have any functions in them. You can think of headers as a definition of the application programming interface (API) offered by the **.c** flavored file that is used by other **.c** files.
|
||||
|
||||
### But what the heck is a Makefile?
|
||||
|
||||
I know all you cool kids are using the "Ultra CodeShredder 3000" integrated development environment to write the next blockbuster app, and building your project consists of mashing on Ctrl-Meta-Shift-Alt-Super-B. But back in my day (and also today), lots of useful work got done by C programs built with Makefiles. A Makefile is a text file that contains recipes for working with files, and programmers use it to automate building their program binaries from source (and other stuff too!).
|
||||
|
||||
Take, for instance, this little gem:
|
||||
|
||||
|
||||
```
|
||||
00 # Makefile
|
||||
01 TARGET= my_sweet_program
|
||||
02 $(TARGET): main.c
|
||||
03 cc -o my_sweet_program main.c
|
||||
```
|
||||
|
||||
Text after an octothorpe/pound/hash is a comment, like in line 00.
|
||||
|
||||
Line 01 is a variable assignment where the variable **TARGET** takes on the string value **my_sweet_program**. By convention, OK, my preference, all Makefile variables are capitalized and use underscores to separate words.
|
||||
|
||||
Line 02 consists of the name of the file that the recipe creates and the files it depends on. In this case, the target is **my_sweet_program**, ****and the dependency is **main.c**.
|
||||
|
||||
The final line, 03, is indented with a tab and not four spaces. This is the command that will be executed to create the target. In this case, we call **cc** the C compiler frontend to compile and link **my_sweet_program**.
|
||||
|
||||
Using a Makefile is simple:
|
||||
|
||||
|
||||
```
|
||||
$ make
|
||||
cc -o my_sweet_program main.c
|
||||
$ ls
|
||||
Makefile main.c my_sweet_program
|
||||
```
|
||||
|
||||
The [Makefile][8] that will build our MeowMeow encoder/decoder is considerably more sophisticated than this example, but the basic structure is the same. I'll break it down Barney-style in another article.
|
||||
|
||||
### Form follows function
|
||||
|
||||
My idea here is to write a program that reads a file, transforms it, and writes the transformed data to another file. The following fabricated command-line interaction is how I imagine using the program:
|
||||
|
||||
|
||||
```
|
||||
$ meow < clear.txt > clear.meow
|
||||
$ unmeow < clear.meow > meow.tx
|
||||
$ diff clear.txt meow.tx
|
||||
$
|
||||
```
|
||||
|
||||
We need to write code to handle command-line parsing and managing the input and output streams. We need a function to encode a stream and write it to another stream. And finally, we need a function to decode a stream and write it to another stream. Wait a second, I've only been talking about writing one program, but in the example above, I invoke two commands: **meow** and **unmeow**? I know you are probably thinking that this is getting complex as heck.
|
||||
|
||||
### Minor sidetrack: argv[0] and the ln command
|
||||
|
||||
If you recall, the signature of a C main function is:
|
||||
|
||||
|
||||
```
|
||||
`int main(int argc, char *argv[])`
|
||||
```
|
||||
|
||||
where **argc** is the number of command-line arguments, and **argv** is a list of character pointers (strings). The value of **argv[0]** is the path of the file containing the program being executed. Many Unix utility programs with complementary functions (e.g., compress and uncompress) look like two programs, but in fact, they are one program with two names in the filesystem. The two-name trick is accomplished by creating a filesystem "link" using the **ln** command.
|
||||
|
||||
An example from **/usr/bin** on my laptop is:
|
||||
|
||||
|
||||
```
|
||||
$ ls -li /usr/bin/git*
|
||||
3376 -rwxr-xr-x. 113 root root 1.5M Aug 30 2018 /usr/bin/git
|
||||
3376 -rwxr-xr-x. 113 root root 1.5M Aug 30 2018 /usr/bin/git-receive-pack
|
||||
...
|
||||
```
|
||||
|
||||
Here **git** and **git-receive-pack** are the same file with different names. We can tell it's the same file because they have the same inode number (the first column). An inode is a feature of the Unix filesystem and is super outside the scope of this article.
|
||||
|
||||
Good and/or lazy programmers can use this feature of the Unix filesystem to write less code but double the number of programs they deliver. First, we write a program that changes its behavior based on the value of **argv[0]**, then we make sure to create links with the names that cause the behavior.
|
||||
|
||||
In our Makefile, the **unmeow** link is created using this recipe:
|
||||
|
||||
|
||||
```
|
||||
# Makefile
|
||||
...
|
||||
$(DECODER): $(ENCODER)
|
||||
$(LN) -f $< $@
|
||||
...
|
||||
```
|
||||
|
||||
I tend to parameterize everything in my Makefiles, rarely using a "bare" string. I group all the definitions at the top of the Makefile, which makes it easy to find and change them. This makes a big difference when you are trying to port software to a new platform and you need to change all your rules to use **xcc** instead of **cc**.
|
||||
|
||||
The recipe should appear relatively straightforward except for the two built-in variables **$@** and **$<**. The first is a shortcut for the target of the recipe; in this case, **$(DECODER)**. (I remember this because the at-sign looks like a target to me.) The second, **$<** is the rule dependency; in this case, it resolves to **$(ENCODER)**.
|
||||
|
||||
Things are getting complex for sure, but it's managed.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/structure-multi-file-c-part-1
|
||||
|
||||
作者:[Erik O'Shaughnessy][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[萌新阿岩](https://github.com/mengxinayan)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (Programming keyboard.)
|
||||
[2]: https://opensource.com/article/19/5/how-write-good-c-main-function
|
||||
[3]: https://en.wikipedia.org/wiki/Unix
|
||||
[4]: http://harmful.cat-v.org/cat-v/
|
||||
[5]: http://www.jabberwocky.com/software/moomooencode.html
|
||||
[6]: https://giphy.com/gifs/nyan-cat-sIIhZliB2McAo
|
||||
[7]: https://github.com/JnyJny/meowmeow
|
||||
[8]: https://github.com/JnyJny/meowmeow/blob/master/Makefile
|
@ -1,110 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Screenshot your Linux system configuration with Bash tools)
|
||||
[#]: via: (https://opensource.com/article/20/1/screenfetch-neofetch)
|
||||
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
|
||||
|
||||
Screenshot your Linux system configuration with Bash tools
|
||||
======
|
||||
ScreenFetch and Neofetch make it easy to share your Linux environment
|
||||
with others.
|
||||
![metrics and data shown on a computer screen][1]
|
||||
|
||||
There are many reasons you might want to share your Linux configuration with other people. You might be looking for help troubleshooting a problem on your system, or maybe you're so proud of the environment you've created that you want to showcase it to fellow open source enthusiasts.
|
||||
|
||||
You could get some of that information with a **cat /proc/cpuinfo** or **lscpu** command at the Bash prompt. But if you want to share more details, such as your operating system, kernel, uptime, shell environment, screen resolution, etc., you have two great tools to choose: screenFetch and Neofetch.
|
||||
|
||||
### ScreenFetch
|
||||
|
||||
[ScreenFetch][2] is a Bash command-line utility that can produce a very nice screenshot of your system configuration and uptime. It is an easy way to share your system's configuration with others in a colorful way.
|
||||
|
||||
It's simple to install screenFetch for many Linux distributions.
|
||||
|
||||
On Fedora, enter:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install screenfetch`
|
||||
```
|
||||
|
||||
On Ubuntu, enter:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install screenfetch`
|
||||
```
|
||||
|
||||
For other operating systems, including FreeBSD, MacOS, and more, consult the screenFetch wiki's [installation page][3]. Once screenFetch is installed, it can produce a detailed and colorful screenshot like this:
|
||||
|
||||
![screenFetch][4]
|
||||
|
||||
ScreenFetch also provides various command-line options to fine-tune your results. For example, **screenfetch -v** returns verbose output that presents each option line-by-line along with the display shown above.
|
||||
|
||||
And **screenfetch -n** eliminates the operating system icon when it displays your system information.
|
||||
|
||||
![screenfetch -n option][5]
|
||||
|
||||
Other options include **screenfetch -N**, which strips all color from the output; **screenfetch -t**, which truncates the output depending on the size of the terminal; and **screenFetch -E**, which suppresses errors.
|
||||
|
||||
Be sure to check the man page on your system for other options. ScreenFetch is open source under the GPLv3, and you can learn more about the project in its [GitHub repository][6].
|
||||
|
||||
### Neofetch
|
||||
|
||||
[Neofetch][7] is another tool to create a screenshot with your system information. It is written in Bash 3.2 and is open source under the [MIT License][8].
|
||||
|
||||
According to the project's website, "Neofetch supports almost 150 different operating systems. From Linux to Windows, all the way to more obscure operating systems like Minix, AIX, and Haiku."
|
||||
|
||||
![Neofetch][9]
|
||||
|
||||
The project maintains a wiki with excellent [installation documentation][10] for a variety of distributions and operating systems.
|
||||
|
||||
If you are on Fedora, RHEL, or CentOS, you can install Neofetch at the Bash prompt with:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install neofetch`
|
||||
```
|
||||
|
||||
On Ubuntu 17.10 and greater, you can use:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install neofetch`
|
||||
```
|
||||
|
||||
On its first run, Neofetch writes a **~/.config/neofetch/config.conf** file to your home directory (**.config/config.conf**), which enables you to [customize and control][11] every aspect of Neofetch's output. For example, you can configure Neofetch to use the image, ASCII file, or wallpaper of your choice—or nothing at all. The config.conf file also makes it easy to share your customization with others.
|
||||
|
||||
If Neofetch doesn't support your operating system or provide all the options you are looking for, be sure to open up an issue in the project's [GitHub repo][12].
|
||||
|
||||
### Conclusion
|
||||
|
||||
No matter why you want to share your system configuration, screenFetch or Neofetch should enable you to do so. Do you know of another open source tool that provides this functionality on Linux? Please share your favorite in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/1/screenfetch-neofetch
|
||||
|
||||
作者:[Don Watkins][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/don-watkins
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen)
|
||||
[2]: https://github.com/KittyKatt/screenFetch
|
||||
[3]: https://github.com/KittyKatt/screenFetch/wiki/Installation
|
||||
[4]: https://opensource.com/sites/default/files/uploads/screenfetch.png (screenFetch)
|
||||
[5]: https://opensource.com/sites/default/files/uploads/screenfetch-n.png (screenfetch -n option)
|
||||
[6]: http://github.com/KittyKatt/screenFetch
|
||||
[7]: https://github.com/dylanaraps/neofetch
|
||||
[8]: https://github.com/dylanaraps/neofetch/blob/master/LICENSE.md
|
||||
[9]: https://opensource.com/sites/default/files/uploads/neofetch.png (Neofetch)
|
||||
[10]: https://github.com/dylanaraps/neofetch/wiki/Installation
|
||||
[11]: https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
|
||||
[12]: https://github.com/dylanaraps/neofetch/issues
|
@ -1,120 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Use tmux to create the console of your dreams)
|
||||
[#]: via: (https://opensource.com/article/20/1/tmux-console)
|
||||
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney)
|
||||
|
||||
Use tmux to create the console of your dreams
|
||||
======
|
||||
You can do a lot with tmux, especially when you add tmuxinator to the
|
||||
mix. Check them out in the fifteenth in our series on 20 ways to be more
|
||||
productive with open source in 2020.
|
||||
![Person drinking a hat drink at the computer][1]
|
||||
|
||||
Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using.
|
||||
|
||||
### Do it all on the console with tmux and tmuxinator
|
||||
|
||||
In this series so far, I've written about individual apps and tools. Starting today, I'll put them together into comprehensive setups to streamline things. Starting at the command line. Why the command line? Simply put, working at the command line allows me to access a lot of these tools and functions from anywhere I can run SSH. I can SSH into one of my personal machines and run the same setup on my work machine as I use on my personal one. And the primary tool I'm going to use for that is [tmux][2].
|
||||
|
||||
Most people use tmux for very basic functions, such as opening it on a remote server then starting a process, maybe opening a second session to watch log files or debug information, then disconnecting and coming back later. But you can do so much work with tmux.
|
||||
|
||||
![tmux][3]
|
||||
|
||||
First things first—if you have an existing tmux configuration file, back it up. The configuration file for tmux is **~/.tmux.conf**. Move it to another directory, like **~/tmp**. Now, clone the [Oh My Tmux][4] project with Git. Link to **.tmux.conf** from that and copy in the **.tmux.conf.local** file to make adjustments:
|
||||
|
||||
|
||||
```
|
||||
cd ~
|
||||
mkdir ~/tmp
|
||||
mv ~/.tmux.conf ~/tmp/
|
||||
git clone <https://github.com/gpakosz/.tmux.git>
|
||||
ln -s ~/.tmux/.tmux.conf ./
|
||||
cp ~/.tmux.conf.local ./
|
||||
```
|
||||
|
||||
The **.tmux.conf.local** file contains local settings and overrides. For example, I changed the default colors a bit and turned on the [Powerline][5] dividers. This snippet shows only the things I changed:
|
||||
|
||||
|
||||
```
|
||||
tmux_conf_theme_24b_colour=true
|
||||
tmux_conf_theme_focused_pane_bg='default'
|
||||
tmux_conf_theme_pane_border_style=fat
|
||||
tmux_conf_theme_left_separator_main='\uE0B0'
|
||||
tmux_conf_theme_left_separator_sub='\uE0B1'
|
||||
tmux_conf_theme_right_separator_main='\uE0B2'
|
||||
tmux_conf_theme_right_separator_sub='\uE0B3'
|
||||
#tmux_conf_battery_bar_symbol_full='◼'
|
||||
#tmux_conf_battery_bar_symbol_empty='◻'
|
||||
tmux_conf_battery_bar_symbol_full='♥'
|
||||
tmux_conf_battery_bar_symbol_empty='·'
|
||||
tmux_conf_copy_to_os_clipboard=true
|
||||
set -g mouse on
|
||||
```
|
||||
|
||||
Note that you do not need to have Powerline installed—you just need a font that supports the Powerline symbols. I use [Hack Nerd Font][6] for almost everything console-related since it is easy for me to read and has many, many useful extra symbols. You'll also note that I turn on operating system clipboard support and mouse support.
|
||||
|
||||
Now, when tmux starts up, the status bar at the bottom provides a bit more information—and in exciting colors. **Ctrl**+**b** is still the "leader" key for entering commands, but some others have changed. Splitting panes horizontally (top/bottom) is now **Ctrl**+**b**+**-** and vertically is now **Ctrl**+**b**+**_**. With mouse mode turned on, you can click to switch between the panes and drag the dividers to resize them. Opening a new window is still **Ctrl**+**b**+**n**, and you can now click on the window name on the bottom bar to switch between them. Also, **Ctrl**+**b**+**e** will open up the **.tmux.conf.local** file for editing. When you exit the editor, tmux will reload the configuration without reloading anything else. Very useful.
|
||||
|
||||
So far, I've only made some simple changes to functionality and visual display and added mouse support. Now I'll set it up to launch the apps I want in a way that makes sense and without having to reposition and resize them every time. For that, I'll use [tmuxinator][7]. Tmuxinator is a launcher for tmux that allows you to specify and manage layouts and autostart applications with a YAML file. To use it, start tmux and create panes with the things you want running in them. Then, open a new window with **Ctrl**+**b**+**n**, and execute **tmux list-windows**. You will get detailed information about the layout.
|
||||
|
||||
![tmux layout information][8]
|
||||
|
||||
Note the first line in the code above where I set up four panes with an application in each one.** **Save the output from when you run it for later. Now, run **tmuxinator new 20days** to create a layout named **20days**. This will bring up a text editor with the default layout file. It has a lot of useful stuff in it, and I encourage you to read up on all the options. Start by putting in the layout information above and what apps you want where:
|
||||
|
||||
|
||||
```
|
||||
# /Users/ksonney/.config/tmuxinator/20days.yml
|
||||
name: 20days
|
||||
root: ~/
|
||||
windows:
|
||||
- mail:
|
||||
layout: d9da,208x60,0,0[208x26,0,0{104x26,0,0,0,103x26,105,0,5},208x33,0,27{104x33,0,27,1,103x33,105,27,4}]] @0
|
||||
panes:
|
||||
- alot
|
||||
- abook
|
||||
- ikhal
|
||||
- todo.sh ls +20days
|
||||
```
|
||||
|
||||
Be careful with the spaces! Like Python code, the spaces and indentation matter to how the file is interpreted. Save the file and then run **tmuxinator 20days**. You should get four panes with the [alot][9] mail program, [abook][10], ikhal (a shortcut to [khal][11] interactive), and anything in [todo.txt][12] with the tag **+20days**.
|
||||
|
||||
![sample layout launched by tmuxinator][13]
|
||||
|
||||
You'll also notice that the window on the bottom bar is labeled Mail. You can click on the name (along with other named windows) to jump to that view. Nifty, right? I set up a second window named Social with [Tuir][14], [Newsboat][15], an IRC client connected to [BitlBee][16], and [Rainbow Stream][17] in the same file.
|
||||
|
||||
Tmux is my productivity powerhouse for keeping track of all the things, and with tmuxinator, I don't have to worry about constantly resizing, placing, and launching my applications.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/1/tmux-console
|
||||
|
||||
作者:[Kevin Sonney][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/ksonney
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer)
|
||||
[2]: https://github.com/tmux/tmux
|
||||
[3]: https://opensource.com/sites/default/files/uploads/productivity_15-1.png (tumux)
|
||||
[4]: https://github.com/gpakosz/.tmux
|
||||
[5]: https://github.com/powerline/powerline
|
||||
[6]: https://www.nerdfonts.com/
|
||||
[7]: https://github.com/tmuxinator/tmuxinator
|
||||
[8]: https://opensource.com/sites/default/files/uploads/productivity_15-2.png (tmux layout information)
|
||||
[9]: https://opensource.com/article/20/1/organize-email-notmuch
|
||||
[10]: https://opensource.com/article/20/1/sync-contacts-locally
|
||||
[11]: https://opensource.com/article/20/1/open-source-calendar
|
||||
[12]: https://opensource.com/article/20/1/open-source-to-do-list
|
||||
[13]: https://opensource.com/sites/default/files/uploads/productivity_15-3.png (sample layout launched by tmuxinator)
|
||||
[14]: https://opensource.com/article/20/1/open-source-reddit-client
|
||||
[15]: https://opensource.com/article/20/1/open-source-rss-feed-reader
|
||||
[16]: https://opensource.com/article/20/1/open-source-chat-tool
|
||||
[17]: https://opensource.com/article/20/1/tweet-terminal-rainbow-stream
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,169 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( guevaraya)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Troubleshoot Kubernetes with the power of tmux and kubectl)
|
||||
[#]: via: (https://opensource.com/article/20/2/kubernetes-tmux-kubectl)
|
||||
[#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakar)
|
||||
|
||||
Troubleshoot Kubernetes with the power of tmux and kubectl
|
||||
======
|
||||
A kubectl plugin that uses tmux to make troubleshooting Kubernetes much
|
||||
simpler.
|
||||
![Woman sitting in front of her laptop][1]
|
||||
|
||||
[Kubernetes][2] is a thriving open source container orchestration platform that offers scalability, high availability, robustness, and resiliency for applications. One of its many features is support for running custom scripts or binaries through its primary client binary, [kubectl][3]. Kubectl is very powerful and allows users to do anything with it that they could do directly on a Kubernetes cluster.
|
||||
|
||||
### Troubleshooting Kubernetes with aliases
|
||||
|
||||
Anyone who uses Kubernetes for container orchestration is aware of its features—as well as the complexity it brings because of its design. For example, there is an urgent need to simplify troubleshooting in Kubernetes with something that is quicker and has little need for manual intervention (except in critical situations).
|
||||
|
||||
There are many scenarios to consider when it comes to troubleshooting functionality. In one scenario, you know what you need to run, but the command's syntax—even when it can run as a single command—is excessively complex, or it may need one or two inputs to work.
|
||||
|
||||
For example, if you frequently need to jump into a running container in the System namespace, you may find yourself repeatedly writing:
|
||||
|
||||
|
||||
```
|
||||
`kubectl --namespace=kube-system exec -i -t <your-pod-name>`
|
||||
```
|
||||
|
||||
To simplify troubleshooting, you could use command-line aliases of these commands. For example, you could add the following to your dotfiles (.bashrc or .zshrc):
|
||||
|
||||
|
||||
```
|
||||
`alias ksysex='kubectl --namespace=kube-system exec -i -t'`
|
||||
```
|
||||
|
||||
This is one of many examples from a [repository of common Kubernetes aliases][4] that shows one way to simplify functions in kubectl. For something simple like this scenario, an alias is sufficient.
|
||||
|
||||
### Switching to a kubectl plugin
|
||||
|
||||
A more complex troubleshooting scenario involves the need to run many commands, one after the other, to investigate an environment and come to a conclusion. Aliases alone are not sufficient for this use
|
||||
|
||||
case; you need repeatable logic and correlations between the many parts of your Kubernetes deployment. What you really need is automation to deliver the desired output in less time.
|
||||
|
||||
Consider 10 to 20—or even 50 to 100—namespaces holding different microservices on your cluster. What would be helpful for you to start troubleshooting this scenario?
|
||||
|
||||
* You would need something that can quickly tell which pod in which namespace is throwing errors.
|
||||
* You would need something that can watch logs of all the pods in a namespace.
|
||||
* You might also need to watch logs of certain pods in a specific namespace that have shown errors.
|
||||
|
||||
|
||||
|
||||
Any solution that covers these points would be very useful in investigating production issues as well as during development and testing cycles.
|
||||
|
||||
To create something more powerful than a simple alias, you can use [kubectl plugins][5]. Plugins are like standalone scripts written in any scripting language but are designed to extend the functionality of your main command when serving as a Kubernetes admin.
|
||||
|
||||
To create a plugin, you must use the proper syntax of **kubectl-<your-plugin-name>** to copy the script to one of the exported pathways in your **$PATH** and give it executable permissions (**chmod +x**).
|
||||
|
||||
After creating a plugin and moving it into your path, you can run it immediately. For example, I have kubectl-krawl and kubectl-kmux in my path:
|
||||
|
||||
|
||||
```
|
||||
$ kubectl plugin list
|
||||
The following compatible plugins are available:
|
||||
|
||||
/usr/local/bin/kubectl-krawl
|
||||
/usr/local/bin/kubectl-kmux
|
||||
|
||||
$ kubectl kmux
|
||||
```
|
||||
|
||||
Now let's explore what this looks like when you power Kubernetes with tmux.
|
||||
|
||||
### Harnessing the power of tmux
|
||||
|
||||
[Tmux][6] is a very powerful tool that many sysadmins and ops teams rely on to troubleshoot issues related to ease of operability—from splitting windows into panes for running parallel debugging on multiple machines to monitoring logs. One of its major advantages is that it can be used on the command line or in automation scripts.
|
||||
|
||||
I created [a kubectl plugin][7] that uses tmux to make troubleshooting much simpler. I will use annotations to walk through the logic behind the plugin (and leave it for you to go through the plugin's full code):
|
||||
|
||||
|
||||
```
|
||||
#NAMESPACE is namespace to monitor.
|
||||
#POD is pod name
|
||||
#Containers is container names
|
||||
|
||||
# initialize a counter n to count the number of loop counts, later be used by tmux to split panes.
|
||||
n=0;
|
||||
|
||||
# start a loop on a list of pod and containers
|
||||
while IFS=' ' read -r POD CONTAINERS
|
||||
do
|
||||
|
||||
# tmux create the new window for each pod
|
||||
tmux neww $COMMAND -n $POD 2>/dev/null
|
||||
|
||||
# start a loop for all containers inside a running pod
|
||||
for CONTAINER in ${CONTAINERS//,/ }
|
||||
do
|
||||
|
||||
if [ x$POD = x -o x$CONTAINER = x ]; then
|
||||
# if any of the values is null, exit.
|
||||
warn "Looks like there is a problem getting pods data."
|
||||
break
|
||||
fi
|
||||
|
||||
# set the command to execute
|
||||
COMMAND=”kubectl logs -f $POD -c $CONTAINER -n $NAMESPACE”
|
||||
# check tmux session
|
||||
if tmux has-session -t <session name> 2>/dev/null;
|
||||
then
|
||||
<set session exists>
|
||||
else
|
||||
<create session>
|
||||
fi
|
||||
|
||||
# split planes in the current window for each containers
|
||||
tmux selectp -t $n \; \
|
||||
splitw $COMMAND \; \
|
||||
select-layout tiled \;
|
||||
|
||||
# end loop for containers
|
||||
done
|
||||
|
||||
# rename the window to identify by pod name
|
||||
tmux renamew $POD 2>/dev/null
|
||||
|
||||
# increment the counter
|
||||
((n+=1))
|
||||
|
||||
# end loop for pods
|
||||
done< <(<fetch list of pod and containers from kubernetes cluster>)
|
||||
|
||||
# finally select the window and attach session
|
||||
tmux selectw -t <session name>:1 \; \
|
||||
attach-session -t <session name>\;
|
||||
```
|
||||
|
||||
After the plugin script runs, it will produce output similar to the image below. Each pod has its own window, and each container (if there is more than one) is split by the panes in its pod window, streaming logs as they arrive. The beauty of tmux can be seen below; with the proper configuration, you can even see which window has activity going on (see the white tabs).
|
||||
|
||||
![Output of kmux plugin][8]
|
||||
|
||||
### Conclusion
|
||||
|
||||
Aliases are always helpful for simple troubleshooting in Kubernetes environments. When the environment gets more complex, a kubectl plugin is a powerful option for using more advanced scripting. There are no limits on which programming language you can use to write kubectl plugins. The only requirements are that the naming convention in the path is executable, and it doesn't have the same name as an existing kubectl command.
|
||||
|
||||
To read the complete code or try the plugins I created, check my [kube-plugins-github][7] repository. Issues and pull requests are welcome.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/kubernetes-tmux-kubectl
|
||||
|
||||
作者:[Abhishek Tamrakar][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/tamrakar
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_4.png?itok=VGZO8CxT (Woman sitting in front of her laptop)
|
||||
[2]: https://opensource.com/resources/what-is-kubernetes
|
||||
[3]: https://kubernetes.io/docs/reference/kubectl/overview/
|
||||
[4]: https://github.com/ahmetb/kubectl-aliases/blob/master/.kubectl_aliases
|
||||
[5]: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/
|
||||
[6]: https://opensource.com/article/19/6/tmux-terminal-joy
|
||||
[7]: https://github.com/abhiTamrakar/kube-plugins
|
||||
[8]: https://opensource.com/sites/default/files/uploads/kmux-output.png (Output of kmux plugin)
|
@ -1,230 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Morisun029)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (3 ways to use PostgreSQL commands)
|
||||
[#]: via: (https://opensource.com/article/20/2/postgresql-commands)
|
||||
[#]: author: (Greg Pittman https://opensource.com/users/greg-p)
|
||||
|
||||
3 ways to use PostgreSQL commands
|
||||
======
|
||||
Whether you need something simple, like a shopping list, or complex,
|
||||
like a color swatch generator, PostgreSQL commands make it easy.
|
||||
![Team checklist and to dos][1]
|
||||
|
||||
In _[Getting started with PostgreSQL][2]_, I explained how to install, set up, and begin using the open source database software. But there's a lot more you can do with commands in [PostgreSQL][3].
|
||||
|
||||
For example, I use Postgres to keep track of my grocery shopping list. I do most of the grocery shopping in our home, and the bulk of it happens once a week. I go to several places to buy the things on my list because each store offers a particular selection or quality or maybe a better price. Initially, I made an HTML form page to manage my shopping list, but it couldn't save my entries. So, I had to wait to make my list all at once, and by then I usually forgot some items we need or I want.
|
||||
|
||||
Instead, with PostgreSQL, I can enter bits when I think of them as the week goes on and print out the whole thing right before I go shopping. Here's how you can do that, too.
|
||||
|
||||
### Create a simple shopping list
|
||||
|
||||
First, enter the database with the **psql **command, then create a table for your list with:
|
||||
|
||||
|
||||
```
|
||||
`Create table groc (item varchar(20), comment varchar(10));`
|
||||
```
|
||||
|
||||
Type commands like the following to add items to your list:
|
||||
|
||||
|
||||
```
|
||||
insert into groc values ('milk', 'K');
|
||||
insert into groc values ('bananas', 'KW');
|
||||
```
|
||||
|
||||
There are two pieces of information (separated by a comma) inside the parentheses: the item you want to buy and letters indicating where you want to buy it and whether it's something you usually buy every week (W).
|
||||
|
||||
Since **psql** has a history, you can press the Up arrow and edit the data between the parentheses instead of having to type the whole line for each item.
|
||||
|
||||
After entering a handful of items, check what you've entered with:
|
||||
|
||||
|
||||
```
|
||||
Select * from groc order by comment;
|
||||
|
||||
item | comment
|
||||
\----------------+---------
|
||||
ground coffee | H
|
||||
butter | K
|
||||
chips | K
|
||||
steak | K
|
||||
milk | K
|
||||
bananas | KW
|
||||
raisin bran | KW
|
||||
raclette | L
|
||||
goat cheese | L
|
||||
onion | P
|
||||
oranges | P
|
||||
potatoes | P
|
||||
spinach | PW
|
||||
broccoli | PW
|
||||
asparagus | PW
|
||||
cucumber | PW
|
||||
sugarsnap peas | PW
|
||||
salmon | S
|
||||
(18 rows)
|
||||
```
|
||||
|
||||
This command orders the results by the _comment_ column so that the items are grouped by where you buy them to make it easier to shop.
|
||||
|
||||
By using a W to indicate your weekly purchases, you can keep your weekly items on the list when you clear out the table to prepare for the next week's list. To so that, enter:
|
||||
|
||||
|
||||
```
|
||||
`delete from groc where comment not like '%W';`
|
||||
```
|
||||
|
||||
Notice that in PostgreSQL, **%** is the wildcard character (instead of an asterisk). So, to save typing, you might type:
|
||||
|
||||
|
||||
```
|
||||
`delete from groc where item like 'goat%';`
|
||||
```
|
||||
|
||||
You can't use **item = 'goat%'**; it won't work.
|
||||
|
||||
When you're ready to shop, output your list to print it or send it to your phone with:
|
||||
|
||||
|
||||
```
|
||||
\o groclist.txt
|
||||
select * from groc order by comment;
|
||||
\o
|
||||
```
|
||||
|
||||
The last command, **\o**, with nothing afterward, resets the output to the command line. Otherwise, all output will continue to go to the groc file you created.
|
||||
|
||||
### Analyze complex tables
|
||||
|
||||
This item-by-item entry may be okay for short tables, but what about really big ones? A couple of years ago, I was helping the team at [FreieFarbe.de][4] to create a swatchbook of the free colors (freieFarbe means "free colors" in German) from its HLC color palette, where virtually any imaginable print color can be specified by its hue, luminosity (brightness), and chroma (saturation). The result was the [HLC Color Atlas][5], and here's how we did it.
|
||||
|
||||
The team sent me files with color specifications so I could write Python scripts that would work with Scribus to generate the swatchbooks of color patches easily. One example started like:
|
||||
|
||||
|
||||
```
|
||||
HLC, C, M, Y, K
|
||||
H010_L15_C010, 0.5, 49.1, 0.1, 84.5
|
||||
H010_L15_C020, 0.0, 79.7, 15.1, 78.9
|
||||
H010_L25_C010, 6.1, 38.3, 0.0, 72.5
|
||||
H010_L25_C020, 0.0, 61.8, 10.6, 67.9
|
||||
H010_L25_C030, 0.0, 79.5, 18.5, 62.7
|
||||
H010_L25_C040, 0.4, 94.2, 17.3, 56.5
|
||||
H010_L25_C050, 0.0, 100.0, 15.1, 50.6
|
||||
H010_L35_C010, 6.1, 32.1, 0.0, 61.8
|
||||
H010_L35_C020, 0.0, 51.7, 8.4, 57.5
|
||||
H010_L35_C030, 0.0, 68.5, 17.1, 52.5
|
||||
H010_L35_C040, 0.0, 81.2, 22.0, 46.2
|
||||
H010_L35_C050, 0.0, 91.9, 20.4, 39.3
|
||||
H010_L35_C060, 0.1, 100.0, 17.3, 31.5
|
||||
H010_L45_C010, 4.3, 27.4, 0.1, 51.3
|
||||
```
|
||||
|
||||
This is slightly modified from the original, which separated the data with tabs. I transformed it into a CSV (comma-separated value) file, which I prefer to use with Python. (CSV files are also very useful because they can be imported easily into a spreadsheet program.)
|
||||
|
||||
In each line, the first item is the color name, and it's followed by its C, M, Y, and K color values. The file consisted of 1,793 colors, and I wanted a way to analyze the information to get a sense of the range of values. This is where PostgreSQL comes into play. I did not want to enter all of this data manually—I don't think I could without errors (and headaches). Fortunately, PostgreSQL has a command for this.
|
||||
|
||||
My first step was to create the database with:
|
||||
|
||||
|
||||
```
|
||||
`Create table hlc_cmyk (color varchar(40), c decimal, m decimal, y decimal, k decimal);`
|
||||
```
|
||||
|
||||
Then I brought in the data with:
|
||||
|
||||
|
||||
```
|
||||
`\copy hlc_cmyk from '/home/gregp/HLC_Atlas_CMYK_SampleData.csv' with (header, format CSV);`
|
||||
```
|
||||
|
||||
The backslash at the beginning is there because using the plain **copy** command is restricted to root and the Postgres superuser. In the parentheses, **header** means the first line contains headings and should be ignored, and **CSV** means the file format is CSV. Note that parentheses are not required around the color name in this method.
|
||||
|
||||
If the operation is successful, I see a message that says **COPY NNNN**, where the N's refer to the number of rows inserted into the table.
|
||||
|
||||
Finally, I can query the table with:
|
||||
|
||||
|
||||
```
|
||||
select * from hlc_cmyk;
|
||||
|
||||
color | c | m | y | k
|
||||
\---------------+-------+-------+-------+------
|
||||
H010_L15_C010 | 0.5 | 49.1 | 0.1 | 84.5
|
||||
H010_L15_C020 | 0.0 | 79.7 | 15.1 | 78.9
|
||||
H010_L25_C010 | 6.1 | 38.3 | 0.0 | 72.5
|
||||
H010_L25_C020 | 0.0 | 61.8 | 10.6 | 67.9
|
||||
H010_L25_C030 | 0.0 | 79.5 | 18.5 | 62.7
|
||||
H010_L25_C040 | 0.4 | 94.2 | 17.3 | 56.5
|
||||
H010_L25_C050 | 0.0 | 100.0 | 15.1 | 50.6
|
||||
H010_L35_C010 | 6.1 | 32.1 | 0.0 | 61.8
|
||||
H010_L35_C020 | 0.0 | 51.7 | 8.4 | 57.5
|
||||
H010_L35_C030 | 0.0 | 68.5 | 17.1 | 52.5
|
||||
```
|
||||
|
||||
It goes on like this for all 1,793 rows of data. In retrospect, I can't say that this query was absolutely necessary for the HLC and Scribus task, but it allayed some of my anxieties about the project.
|
||||
|
||||
To generate the HLC Color Atlas, I automated creating the color charts with Scribus for the 13,000+ colors in those pages of color swatches.
|
||||
|
||||
I could have used the **copy** command to output my data:
|
||||
|
||||
|
||||
```
|
||||
`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV);`
|
||||
```
|
||||
|
||||
I also could restrict the output according to certain values with a **where** clause.
|
||||
|
||||
For example, the following command will only send the table values for the hues that begin with H10.
|
||||
|
||||
|
||||
```
|
||||
`\copy hlc_cmyk to '/home/gregp/hlc_cmyk_backup.csv' with (header, format CSV) where color like 'H10%';`
|
||||
```
|
||||
|
||||
### Back up or transfer a database or table
|
||||
|
||||
The final command I will mention here is **pg_dump**, which is used to back up a PostgreSQL database and runs outside of the **psql** console. For example:
|
||||
|
||||
|
||||
```
|
||||
pg_dump gregp -t hlc_cmyk > hlc.out
|
||||
pg_dump gregp > dball.out
|
||||
```
|
||||
|
||||
The first line exports the **hlc_cmyk** table along with its structure. The second line dumps all the tables inside the **gregp** database. This is very useful for backing up or transferring a database or tables.
|
||||
|
||||
To transfer a database or table to another computer, first, create a database on the other computer (see my "[getting started][2]" article for details), then do the reverse process:
|
||||
|
||||
|
||||
```
|
||||
`psql -d gregp -f dball.out`
|
||||
```
|
||||
|
||||
This creates all the tables and enters the data in one step.
|
||||
|
||||
### Conclusion
|
||||
|
||||
In this article, we have seen how to use the **WHERE** parameter to restrict operations, along with the use of the PostgreSQL wildcard character **%**. We've also seen how to load a large amount of data into a table, then output some or all of the table data to a file, or even your entire database with all its individual tables.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/postgresql-commands
|
||||
|
||||
作者:[Greg Pittman][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/greg-p
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos)
|
||||
[2]: https://opensource.com/article/19/11/getting-started-postgresql
|
||||
[3]: https://www.postgresql.org/
|
||||
[4]: http://freiefarbe.de
|
||||
[5]: https://www.freiefarbe.de/en/thema-farbe/hlc-colour-atlas/
|
@ -1,118 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Customize your internet with an open source search engine)
|
||||
[#]: via: (https://opensource.com/article/20/2/open-source-search-engine)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Customize your internet with an open source search engine
|
||||
======
|
||||
Get started with YaCy, an open source, P2P web indexer.
|
||||
![Person using a laptop][1]
|
||||
|
||||
A long time ago, the internet was small enough to be indexed by a few people who gathered the names and locations of all websites and listed them each by topic on a page or in a printed book. As the World Wide Web network grew, the "web rings" convention developed, in which sites with a similar theme or topic or sensibility banded together to form a circular path to each member. A visitor to any site in the ring could click a button to proceed to the next or previous site in the ring to discover new sites relevant to their interest.
|
||||
|
||||
Then for a while, it seemed the internet outgrew itself. Everyone was online, there was a lot of redundancy and spam, and there was no way to find anything. Yahoo and AOL and CompuServe and similar services had unique approaches, but it wasn't until Google came along that the modern model took hold. According to Google, the internet was meant to be indexed, sorted, and ranked through a search engine.
|
||||
|
||||
### Why choose an open source alternative?
|
||||
|
||||
Search engines like Google and DuckDuckGo are demonstrably effective. You may have reached this site through a search engine. While there's a debate to be had about content falling through the cracks because a host chooses not to follow best practices for search engine optimization, the modern solution for managing the wealth of culture and knowledge and frivolity that is the internet is relentless indexing.
|
||||
|
||||
But maybe you prefer not to use Google or DuckDuckGo because of privacy concerns or because you're looking to contribute to an effort to make the internet more independent. If that appeals to you, then consider participating in [YaCy][2], the peer-to-peer internet indexer and search engine.
|
||||
|
||||
### Install YaCy
|
||||
|
||||
To install and try YaCy, first ensure you have Java installed. If you're on Linux, you can follow the instructions in my [_How to install Java on Linux_][3] article. If you're on Windows or MacOS, obtain an installer from [AdoptOpenJDK.net][4].
|
||||
|
||||
Once you have Java installed, [download the installer][5] for your platform.
|
||||
|
||||
If you're on Linux, unarchive the tarball and move it to the **/opt** directory:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo tar --extract --file yacy_*z --directory /opt`
|
||||
```
|
||||
|
||||
Start YaCy according to instructions for the installer you downloaded.
|
||||
|
||||
On Linux, start YaCy running in the background:
|
||||
|
||||
|
||||
```
|
||||
`$ /opt/startYACY.sh &`
|
||||
```
|
||||
|
||||
In a web browser, navigate to **localhost:8090** and search.
|
||||
|
||||
![YaCy start page][6]
|
||||
|
||||
### Add YaCy to your URL bar
|
||||
|
||||
If you're using the Firefox web browser, you can make YaCy your default search engine in the Awesome Bar (that's Mozilla's name for the URL field) with just a few clicks.
|
||||
|
||||
First, make the dedicated search bar visible in the Firefox toolbar, if it's not already (you don't have to keep the search bar visible; you only need it active long enough to add a custom search engine). The search bar is available in the hamburger menu in the upper-right corner of Firefox in the **Customize** menu. Once the search bar is visible in your Firefox toolbar, navigate to **localhost:8090**, and click the magnifying glass icon in the Firefox search bar you just added. Click the option to add YaCy to your Firefox search engines.
|
||||
|
||||
![Adding YaCy to Firefox][7]
|
||||
|
||||
Once this is done, you can mark it as your default in Firefox preferences, or just use it selectively in searches performed in the Firefox search bar. If you set it as your default search engine, then you may have no need for the dedicated search bar because the default engine is also used by the Awesome Bar, so you can remove it from your toolbar.
|
||||
|
||||
### How to a P2P search engine works
|
||||
|
||||
YaCy is an open source and distributed search engine. It's written in [Java][8], so it runs on any platform, and it performs web crawls, indexing, and searching. It's a peer-to-peer (P2P) network, so every user running YaCy joins in the effort to track the internet as it changes from day to day. Of course, no single user possesses a full index of the entire internet because that would take a data center to house, but the index is distributed and redundant across all YaCy users. It's a lot like BitTorrent (as it uses distributed hash tables, or DHT, to reference index entries), except the data you're sharing is a matrix of words and URL associations. By mixing the results returned by the hash tables, no one can tell who has searched for what words, so all searches are functionally anonymous. It's an effective system for unbiased, ad-free, untracked, and anonymous searches, and you can join in just by using it.
|
||||
|
||||
### Search engines and algorithms
|
||||
|
||||
The act of indexing the internet refers to separating a web page into the singular words on it, then associating the page's URL with each word. Searching for one or more words in a search engine fetches all URLs associated with the query. That's one thing the YaCy client does while running.
|
||||
|
||||
The other thing the client does is provide a search interface for your browser. Instead of navigating to Google when you want to search, you can point your web browser to **localhost:8090** to search YaCy. You may even be able to add it to your browser's search bar (depending on your browser's extensibility), so you can search from the URL bar.
|
||||
|
||||
### Firewall settings for YaCy
|
||||
|
||||
When you first start using YaCy, it's probably running in "junior" mode. This means that the sites your client crawls are available only to you because no other YaCy client can reach your index entries. To join the P2P experience, you must open port 8090 in your router's firewall and possibly your software firewall if you're running one. This is called "senior" mode.
|
||||
|
||||
If you're on Linux, you can find out more about your computer's firewall in [_Make Linux stronger with firewalls_][9]. On other platforms, refer to your operating system's documentation.
|
||||
|
||||
A firewall is almost always active on the router provided by your internet service provider (ISP), and there are far too many varieties of them to document accurately here. Most routers provide the option to "poke a hole" in your firewall because many popular networked games require two-way traffic.
|
||||
|
||||
If you know how to log into your router (it's often either 192.168.0.1 or 10.1.0.1, but can vary depending on the manufacturer's settings), then log in and look for a configuration panel controlling the _firewall_ or _port forwarding_ or _applications_.
|
||||
|
||||
Once you find the preferences for your router's firewall, add port 8090 to the whitelist. For example:
|
||||
|
||||
![Adding YaCy to an ISP router][10]
|
||||
|
||||
If your router is doing port forwarding, then you must forward the incoming traffic to your computer's IP address, using the same port. For example:
|
||||
|
||||
![Adding YaCy to an ISP router][11]
|
||||
|
||||
If you can't adjust your firewall settings for any reason, that's OK. YaCy will continue to run and operate as a client of the P2P search network in junior mode.
|
||||
|
||||
### An internet of your own
|
||||
|
||||
There's much more you can do with the YaCy search engine than just search passively. You can force crawls of underrepresented websites, you can request the network crawl a site, you can choose to use YaCy for just on-premises searches, and much more. You have better control over what _your_ internet looks like. The more senior users there are, the more sites indexed. The more sites indexed, the better the experience for all users. Join in!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/open-source-search-engine
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
|
||||
[2]: https://yacy.net/
|
||||
[3]: https://opensource.com/article/19/11/install-java-linux
|
||||
[4]: https://adoptopenjdk.net/releases.html
|
||||
[5]: https://yacy.net/download_installation/
|
||||
[6]: https://opensource.com/sites/default/files/uploads/yacy-startpage.jpg (YaCy start page)
|
||||
[7]: https://opensource.com/sites/default/files/uploads/yacy-add-firefox.jpg (Adding YaCy to Firefox)
|
||||
[8]: https://opensource.com/resources/java
|
||||
[9]: https://opensource.com/article/19/7/make-linux-stronger-firewalls
|
||||
[10]: https://opensource.com/sites/default/files/uploads/router-add-app.jpg (Adding YaCy to an ISP router)
|
||||
[11]: https://opensource.com/sites/default/files/uploads/router-add-app1.jpg (Adding YaCy to an ISP router)
|
@ -1,98 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What is WireGuard? Why Linux Users Going Crazy Over it?)
|
||||
[#]: via: (https://itsfoss.com/wireguard/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
What is WireGuard? Why Linux Users Going Crazy Over it?
|
||||
======
|
||||
|
||||
From normal Linux users to Linux creator [Linus Torvalds][1], everyone is in awe of WireGuard. What is WireGuard and what makes it so special?
|
||||
|
||||
### What is WireGuard?
|
||||
|
||||
![][2]
|
||||
|
||||
[WireGuard][3] is an easy to configure, fast, and secure open source [VPN][4] that utilizes state-of-the-art cryptography. It’s aim is to provide a faster, simpler and leaner general purpose VPN that can be easily deployed on low-end devices like Raspberry Pi to high-end servers.
|
||||
|
||||
Most of the other solutions like [IPsec][5] and OpenVPN were developed decades ago. Security researcher and kernel developer Jason Donenfeld realized that they were slow and difficult to configure and manage properly.
|
||||
|
||||
This made him create a new open source VPN protocol and solution which is faster, secure easier to deploy and manage.
|
||||
|
||||
WireGuard was originally developed for Linux but it is now available for Windows, macOS, BSD, iOS and Android. It is still under heavy development.
|
||||
|
||||
### Why is WireGuard so popular?
|
||||
|
||||
![][6]
|
||||
|
||||
Apart from being a cross-platform, one of the biggest plus point for WireGuard is the ease of deployment. Configuring and deploying WireGuard is as easy as configuring and using SSH.
|
||||
|
||||
Look at [WireGuard set up guide][7]. You install WireGuard, generate public and private keys (like SSH), set up firewall rules and start the service. Now compare it to the [OpenVPN set up guide][8]. There are way too many things to do here.
|
||||
|
||||
Another good thing about WireGuard is that it has a lean codebase with just 4000 lines of code. Compare it to 100,000 lines of code of [OpenVPN][9] (another popular open source VPN). It is clearly easier to debug WireGuard.
|
||||
|
||||
Don’t go by its simplicity. WireGuard supports all the state-of-the-art cryptography like like the [Noise protocol framework][10], [Curve25519][11], [ChaCha20][12], [Poly1305][13], [BLAKE2][14], [SipHash24][15], [HKDF][16], and secure trusted constructions.
|
||||
|
||||
Since WireGuard runs in the [kernel space][17], it provides secure networking at a high speed.
|
||||
|
||||
These are some of the reasons why WireGuard has become increasingly popular. Linux creator Linus Torvalds loves WireGuard so much that he is merging it in the [Linux Kernel 5.6][18]:
|
||||
|
||||
> Can I just once again state my love for it and hope it gets merged soon? Maybe the code isn’t perfect, but I’ve skimmed it, and compared to the horrors that are OpenVPN and IPSec, it’s a work of art.
|
||||
>
|
||||
> Linus Torvalds
|
||||
|
||||
### If WireGuard is already available, then what’s the fuss about including it in Linux kernel?
|
||||
|
||||
This could be confusing to new Linux users. You know that you can install and configure a WireGuard VPN server on Linux but then you also read the news that Linux Kernel 5.6 is going to include WireGuard. Let me explain it to you.
|
||||
|
||||
At present, you can install WireGuard on Linux as a [kernel module][19]. Regular applications like VLC, GIMP etc are installed on top of the Linux kernel (in [user space][20]), not inside it.
|
||||
|
||||
When you install WireGuard as a kernel module, you are basically modifying the Linux kernel on your own and add some code to it. Starting kernel 5.6, you won’t need manually add the kernel module. It will be included in the kernel by default.
|
||||
|
||||
The inclusion of WireGuard in Kernel 5.6 will most likely [extend the adoption of WireGuard and thus change the current VPN scene][21].
|
||||
|
||||
**Conclusion**
|
||||
|
||||
WireGuard is gaining popularity for the good reasons. Some of the popular [privacy focused VPNs][22] like [Mullvad VPN][23] are already using WireGuard and the adoption is likely to grow in the near future.
|
||||
|
||||
I hope you have a slightly better understanding of WireGuard. Your feedback is welcome, as always.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/wireguard/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/linus-torvalds-facts/
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/wireguard.png?ssl=1
|
||||
[3]: https://www.wireguard.com/
|
||||
[4]: https://en.wikipedia.org/wiki/Virtual_private_network
|
||||
[5]: https://en.wikipedia.org/wiki/IPsec
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/wireguard-logo.png?ssl=1
|
||||
[7]: https://www.linode.com/docs/networking/vpn/set-up-wireguard-vpn-on-ubuntu/
|
||||
[8]: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04
|
||||
[9]: https://openvpn.net/
|
||||
[10]: https://noiseprotocol.org/
|
||||
[11]: https://cr.yp.to/ecdh.html
|
||||
[12]: https://cr.yp.to/chacha.html
|
||||
[13]: https://cr.yp.to/mac.html
|
||||
[14]: https://blake2.net/
|
||||
[15]: https://131002.net/siphash/
|
||||
[16]: https://eprint.iacr.org/2010/264
|
||||
[17]: http://www.linfo.org/kernel_space.html
|
||||
[18]: https://itsfoss.com/linux-kernel-5-6/
|
||||
[19]: https://wiki.archlinux.org/index.php/Kernel_module
|
||||
[20]: http://www.linfo.org/user_space.html
|
||||
[21]: https://www.zdnet.com/article/vpns-will-change-forever-with-the-arrival-of-wireguard-into-linux/
|
||||
[22]: https://itsfoss.com/best-vpn-linux/
|
||||
[23]: https://mullvad.net/en/
|
@ -1,118 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chai-yuan)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Playing Music on your Fedora Terminal with MPD and ncmpcpp)
|
||||
[#]: via: (https://fedoramagazine.org/playing-music-on-your-fedora-terminal-with-mpd-and-ncmpcpp/)
|
||||
[#]: author: (Carmine Zaccagnino https://fedoramagazine.org/author/carzacc/)
|
||||
|
||||
Playing Music on your Fedora Terminal with MPD and ncmpcpp
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
MPD, as the name implies, is a Music Playing Daemon. It can play music but, being a daemon, any piece of software can interface with it and play sounds, including some CLI clients.
|
||||
|
||||
One of them is called _ncmpcpp_, which is an improvement over the pre-existing _ncmpc_ tool. The name change doesn’t have much to do with the language they’re written in: they’re both C++, but _ncmpcpp_ is called that because it’s the _NCurses Music Playing Client_ _Plus Plus_.
|
||||
|
||||
### Installing MPD and ncmpcpp
|
||||
|
||||
The _ncmpmpcc_ client can be installed from the official Fedora repositories with DNF directly with
|
||||
|
||||
```
|
||||
$ sudo dnf install ncmpcpp
|
||||
```
|
||||
|
||||
On the other hand, MPD has to be installed from the RPMFusion _free_ repositories, which you can enable, [as per the official installation instructions][2], by running
|
||||
|
||||
```
|
||||
$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
|
||||
```
|
||||
|
||||
and then you can install MPD by running
|
||||
|
||||
```
|
||||
$ sudo dnf install mpd
|
||||
```
|
||||
|
||||
### Configuring and Starting MPD
|
||||
|
||||
The most painless way to set up MPD is to run it as a regular user. The default is to run it as the dedicated _mpd_ user, but that causes all sorts of issues with permissions.
|
||||
|
||||
Before we can run it, we need to create a local config file that will allow it to run as a regular user.
|
||||
|
||||
To do that, create a subdirectory called _mpd_ in _~/.config_:
|
||||
|
||||
```
|
||||
$ mkdir ~/.config/mpd
|
||||
```
|
||||
|
||||
copy the default config file into this directory:
|
||||
|
||||
```
|
||||
$ cp /etc/mpd.conf ~/.config/mpd
|
||||
```
|
||||
|
||||
and then edit it with a text editor like _vim_, _nano_ or _gedit_:
|
||||
|
||||
```
|
||||
$ nano ~/.config/mpd/mpd.conf
|
||||
```
|
||||
|
||||
I recommend you read through all of it to check if there’s anything you need to do, but for most setups you can delete everything and just leave the following:
|
||||
|
||||
```
|
||||
db_file "~/.config/mpd/mpd.db"
|
||||
log_file "syslog"
|
||||
```
|
||||
|
||||
At this point you should be able to just run
|
||||
|
||||
```
|
||||
$ mpd
|
||||
```
|
||||
|
||||
with no errors, which will start the MPD daemon in the background.
|
||||
|
||||
### Using ncmpcpp
|
||||
|
||||
Simply run
|
||||
|
||||
```
|
||||
$ ncmpcpp
|
||||
```
|
||||
|
||||
and you’ll see a ncurses-powered graphical user interface in your terminal.
|
||||
|
||||
Press _4_ and you should see your local music library, be able to change the selection using the arrow keys and press _Enter_ to play a song.
|
||||
|
||||
Doing this multiple times will create a _playlist_, which allows you to move to the next track using the _>_ button (not the right arrow, the _>_ closing angle bracket character) and go back to the previous track with _<_. The + and – buttons increase and decrease volume. The _Q_ button quits ncmpcpp but it doesn’t stop the music. You can play and pause with _P_.
|
||||
|
||||
You can see the current playlist by pressing the _1_ button (this is the default view). From this view you can press _i_ to look at the information (tags) about the current song. You can change the tags of the currently playing (or paused) song by pressing _6_.
|
||||
|
||||
Pressing the \ button will add (or remove) an informative panel at the top of the view. In the top left, you should see something that looks like this:
|
||||
|
||||
```
|
||||
[------]
|
||||
```
|
||||
|
||||
Pressing the _r_, _z_, _y_, _R_, _x_ buttons will respectively toggle the _repeat_, _random_, _single_, _consume_ and _crossfade_ playback modes and will replace one of the _–_ characters in that little indicator to the initial of the selected mode.
|
||||
|
||||
Pressing the _F1_ button will display some help text, which contains a list of keybindings, so there’s no need to write a complete list here. So now go on, be geeky, and play all your music from your terminal!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/playing-music-on-your-fedora-terminal-with-mpd-and-ncmpcpp/
|
||||
|
||||
作者:[Carmine Zaccagnino][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://fedoramagazine.org/author/carzacc/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/play_music_mpd-816x346.png
|
||||
[2]: https://rpmfusion.org/Configuration
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,100 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (HankChow)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Top hacks for the YaCy open source search engine)
|
||||
[#]: via: (https://opensource.com/article/20/2/yacy-search-engine-hacks)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Top hacks for the YaCy open source search engine
|
||||
======
|
||||
Rather than adapting to someone else's vision, customize you search
|
||||
engine for the internet you want with YaCY.
|
||||
![Browser of things][1]
|
||||
|
||||
In my article about [getting started with YaCy][2], I explained how to install and start using the [YaCy][3] peer-to-peer search engine. One of the most exciting things about YaCy, however, is the fact that it's a local client. Each user owns and operates a node in a globally distributed search engine infrastructure, which means each user is in full control of how they navigate and experience the World Wide Web.
|
||||
|
||||
For instance, Google used to provide the URL google.com/linux as a shortcut to filter searches for Linux-related topics. It was a small feature that many people found useful, but [topical shortcuts were dropped][4] in 2011.
|
||||
|
||||
YaCy makes it possible to customize your search experience.
|
||||
|
||||
### Customize YaCy
|
||||
|
||||
Once you've installed YaCy, navigate to your search page at **localhost:8090**. To customize your search engine, click the **Administration** button in the top-right corner (it may be concealed in a menu icon on small screens).
|
||||
|
||||
The admin panel allows you to configure how YaCy uses your system resources and how it interacts with other YaCy clients.
|
||||
|
||||
![YaCy profile selector][5]
|
||||
|
||||
For instance, to configure an alternative port and set RAM and disk usage, use the **First steps** menu in the sidebar. To monitor YaCy activity, use the **Monitoring** panel. Most features are discoverable by clicking through the panels, but here are some of my favorites.
|
||||
|
||||
### Search appliance
|
||||
|
||||
Several companies have offered [intranet search appliances][6], but with YaCy, you can implement it for free. Whether you want to search through your own data or to implement a search system for local file shares at your business, you can choose to run YaCy as an internal indexer for files accessible over HTTP, FTP, and SMB (Samba). People in your local network can use your personalized instance of YaCy to find shared files, and none of the data is shared with users outside your network.
|
||||
|
||||
### Network configuration
|
||||
|
||||
YaCy favors isolation and privacy by default. You can adjust how you connect to the peer-to-peer network in the **Network Configuration** panel, which is revealed by clicking the link located at the top of the **Use Case & Account** configuration screen.
|
||||
|
||||
![YaCy network configuration][7]
|
||||
|
||||
### Crawl a site
|
||||
|
||||
Peer-to-peer indexing is user-driven. There's no mega-corporation initiating searches on every accessible page on the internet, so a site isn't indexed until someone deliberately crawls it with YaCy.
|
||||
|
||||
The YaCy client provides two options to help you help crawl the web: you can perform a manual crawl, and you can make YaCy available for suggested crawls.
|
||||
|
||||
![YaCy advanced crawler][8]
|
||||
|
||||
#### Start a manual crawling job
|
||||
|
||||
A manual crawl is when you enter the URL of a site you want to index and start a YaCy crawl job. To do this, click the **Advanced Crawler** link in the **Production** sidebar. Enter one or more URLs, then scroll to the bottom of the page and enable the **Do remote indexing** option. This enables your client to broadcast the URLs it is indexing, so clients that have opted to accept requests can help you perform the crawl.
|
||||
|
||||
To start the crawl, click the **Start New Crawl Job** button at the bottom of the page. I use this method to index sites I use frequently or find useful.
|
||||
|
||||
Once the crawl job starts, YaCy indexes the URLs you enter and stores the index on your local machine. As long as you are running in senior mode (meaning your firewall permits incoming and outgoing traffic on port 8090), your index is available to YaCy users all over the globe.
|
||||
|
||||
#### Join in on a crawl
|
||||
|
||||
While some very dedicated YaCy senior users may crawl the internet compulsively, there are a _lot_ of sites out there in the world. It might seem impossible to match the resources of popular spiders and bots, but because YaCy has so many users, they can band together as a community to index more of the internet than any one user could do alone. If you activate YaCy to broadcast requests for site crawls, participating clients can work together to crawl sites you might not otherwise think to crawl manually.
|
||||
|
||||
To configure your client to accept jobs from others, click the **Advanced Crawler** link in the left sidebar menu. In the **Advanced Crawler** panel, click the **Remote Crawling** link under the **Network Harvesting** heading at the top of the page. Enable remote crawls by placing a tick in the checkbox next to the **Load** setting.
|
||||
|
||||
![YaCy remote crawling][9]
|
||||
|
||||
### YaCy monitoring and more
|
||||
|
||||
YaCy is a surprisingly robust search engine, providing you with the opportunity to theme and refine your experience in nearly any way you could want. You can monitor the activity of your YaCy client in the **Monitoring** panel, so you can get an idea of how many people are benefiting from the work of the YaCy community and also see what kind of activity it's generating for your computer and network.
|
||||
|
||||
![YaCy monitoring screen][10]
|
||||
|
||||
### Search engines make a difference
|
||||
|
||||
The more time you spend with the Administration screen, the more fun it becomes to ponder how the search engine you use can change your perspective. Your experience of the internet is shaped by the results you get back for even the simplest of queries. You might notice, in fact, how different one person's "internet" is from another person's when you talk to computer users from a different industry. For some people, the web is littered with ads and promoted searches and suffers from the tunnel vision of learned responses to queries. For instance, if someone consistently searches for answers about X, most commercial search engines will give weight to query responses that concern X. That's a useful feature on the one hand, but it occludes answers that require Y, even though that might be the better solution for a specific task.
|
||||
|
||||
As in real life, stepping outside a manufactured view of the world can be healthy and enlightening. Try YaCy, and see what you discover.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/yacy-search-engine-hacks
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things)
|
||||
[2]: https://opensource.com/article/20/2/open-source-search-engine
|
||||
[3]: https://yacy.net/
|
||||
[4]: https://www.linuxquestions.org/questions/linux-news-59/is-there-no-more-linux-google-884306/
|
||||
[5]: https://opensource.com/sites/default/files/uploads/yacy-profiles.jpg (YaCy profile selector)
|
||||
[6]: https://en.wikipedia.org/wiki/Vivisimo
|
||||
[7]: https://opensource.com/sites/default/files/uploads/yacy-network-config.jpg (YaCy network configuration)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/yacy-advanced-crawler.jpg (YaCy advanced crawler)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/yacy-remote-crawl-accept.jpg (YaCy remote crawling)
|
||||
[10]: https://opensource.com/sites/default/files/uploads/yacy-monitor.jpg (YaCy monitoring screen)
|
@ -1,104 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Dino is a Modern Looking Open Source XMPP Client)
|
||||
[#]: via: (https://itsfoss.com/dino-xmpp-client/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Dino is a Modern Looking Open Source XMPP Client
|
||||
======
|
||||
|
||||
_**Brief: Dino is a relatively new open-source XMPP client that tries to offer a good user experience while encouraging privacy-focused users to utilize XMPP for messaging.**_
|
||||
|
||||
### Dino: An Open Source XMPP Client
|
||||
|
||||
![][1]
|
||||
|
||||
[XMPP][2] (Extensible Messaging Presence Protocol) is a decentralized model of network to facilitate instant messaging and collaboration. Decentralize means there is no central server that has access to your data. The communication is directly between the end-points.
|
||||
|
||||
Some of us might call it an “old school” tech probably because the XMPP clients usually have a very bad user experience or simply just because it takes time to get used to (or set it up).
|
||||
|
||||
That’s when [Dino][3] comes to the rescue as a modern XMPP client to provide a clean and snappy user experience without compromising your privacy.
|
||||
|
||||
### The User Experience
|
||||
|
||||
![][4]
|
||||
|
||||
Dino does try to improve the user experience as an XMPP client but it is worth noting that the look and feel of it will depend on your Linux distribution to some extent. Your icon theme or the gnome theme might make it look better or worse for your personal experience.
|
||||
|
||||
Technically, the user interface is quite simple and easy to use. So, I suggest you take a look at some of the [best icon themes][5] and [GNOME themes][6] for Ubuntu to tweak the look of Dino.
|
||||
|
||||
### Features of Dino
|
||||
|
||||
![Dino Screenshot][7]
|
||||
|
||||
You can expect to use Dino as an alternative to Slack, [Signal][8] or [Wire][9] for your business or personal usage.
|
||||
|
||||
It offers all of the essential features you would need in a messaging application, let us take a look at a list of things that you can expect from it:
|
||||
|
||||
* Decentralized Communication
|
||||
* Public XMPP Servers supported if you cannot setup your own server
|
||||
* Similar to UI to other popular messengers – so it’s easy to use
|
||||
* Image & File sharing
|
||||
* Multiple accounts supported
|
||||
* Advanced message search
|
||||
* [OpenPGP][10] & [OMEMO][11] encryption supported
|
||||
* Lightweight native desktop application
|
||||
|
||||
|
||||
|
||||
### Installing Dino on Linux
|
||||
|
||||
You may or may not find it listed in your software center. Dino does provide ready to use binaries for Debian (deb) and Fedora (rpm) based distributions.
|
||||
|
||||
**For Ubuntu:**
|
||||
|
||||
Dino is available in the universe repository on Ubuntu and you can install it using this command:
|
||||
|
||||
```
|
||||
sudo apt install dino-im
|
||||
```
|
||||
|
||||
Similarly, you can find packages for other Linux distributions on their [GitHub distribution packages page][12].
|
||||
|
||||
If you want the latest and greatest, you can also find both **.deb** and .**rpm** files for Dino to install on your Linux distribution (nightly builds) from [OpenSUSE’s software webpage][13].
|
||||
|
||||
In either case, head to their [GitHub page][14] or click on the link below to visit the official site.
|
||||
|
||||
[Download Dino][3]
|
||||
|
||||
**Wrapping Up**
|
||||
|
||||
It works quite well without any issues (at the time of writing this and quick testing it). I’ll try exploring more about it and hopefully cover more XMPP-centric articles to encourage users to use XMPP clients and servers for communication.
|
||||
|
||||
What do you think about Dino? Would you recommend another open-source XMPP client that’s potentially better than Dino? Let me know your thoughts in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/dino-xmpp-client/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-main.png?ssl=1
|
||||
[2]: https://xmpp.org/about/
|
||||
[3]: https://dino.im/
|
||||
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-xmpp-client.jpg?ssl=1
|
||||
[5]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/
|
||||
[6]: https://itsfoss.com/best-gtk-themes/
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-screenshot.png?ssl=1
|
||||
[8]: https://itsfoss.com/signal-messaging-app/
|
||||
[9]: https://itsfoss.com/wire-messaging-linux/
|
||||
[10]: https://www.openpgp.org/
|
||||
[11]: https://en.wikipedia.org/wiki/OMEMO
|
||||
[12]: https://github.com/dino/dino/wiki/Distribution-Packages
|
||||
[13]: https://software.opensuse.org/download.html?project=network:messaging:xmpp:dino&package=dino
|
||||
[14]: https://github.com/dino/dino
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,200 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Digging up IP addresses with the Linux dig command)
|
||||
[#]: via: (https://www.networkworld.com/article/3527430/digging-up-ip-addresses-with-the-dig-command.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
Digging up IP addresses with the Linux dig command
|
||||
======
|
||||
The dig command is extremely versatile both for retrieving information from domain name servers and for troubleshooting.
|
||||
Thinkstock
|
||||
|
||||
Not unlike **nslookup** in function, but with a lot more options, the **dig** command provides information that name servers manage and can be very useful for troubleshooting problems. It’s both simple to use and has lots of useful options.
|
||||
|
||||
The name “dig” stands for “domain information groper” since domain groping is basically what it does. The amount of information that it provides depends on a series of options that you can use to tailor its output to your needs. Dig can provide a lot of detail or be surprisingly terse.
|
||||
|
||||
[[Get regularly scheduled insights by signing up for Network World newsletters.]][1]
|
||||
|
||||
### Just the IP, please
|
||||
|
||||
To get _just_ the IP address for a system, add the **+short** option to your dig command like this:
|
||||
|
||||
```
|
||||
$ dig facebook.com +short
|
||||
31.13.66.35
|
||||
```
|
||||
|
||||
Don't be surprised, however, if some domains are tied to multiple IP addresses to make the sites they support more reliable.
|
||||
|
||||
```
|
||||
$ dig networkworld.com +short
|
||||
151.101.2.165
|
||||
151.101.66.165
|
||||
151.101.130.165
|
||||
151.101.194.165
|
||||
```
|
||||
|
||||
Also, don't be surprised if the order of the IP addresses changes from one query to the next. This is a side effect of load balancing.
|
||||
|
||||
```
|
||||
$ dig networkworld.com +short
|
||||
151.101.130.165
|
||||
151.101.194.165
|
||||
151.101.2.165
|
||||
151.101.66.165
|
||||
```
|
||||
|
||||
### Standard dig output
|
||||
|
||||
The standard dig display provides details on dig itself along with the response from the name server.
|
||||
|
||||
```
|
||||
$ dig networkworld.com
|
||||
|
||||
; <<>> DiG 9.11.5-P4-5.1ubuntu2.1-Ubuntu <<>*gt; networkworld.com
|
||||
;; global options: +cmd
|
||||
;; Got answer:
|
||||
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39932
|
||||
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1
|
||||
|
||||
;; OPT PSEUDOSECTION:
|
||||
; EDNS: version: 0, flags:; udp: 65494
|
||||
;; QUESTION SECTION:
|
||||
;networkworld.com. IN A
|
||||
|
||||
;; ANSWER SECTION:
|
||||
networkworld.com. 300 IN A 151.101.194.165
|
||||
networkworld.com. 300 IN A 151.101.130.165
|
||||
networkworld.com. 300 IN A 151.101.66.165
|
||||
networkworld.com. 300 IN A 151.101.2.165
|
||||
|
||||
;; Query time: 108 msec
|
||||
;; SERVER: 127.0.0.53#53(127.0.0.53)
|
||||
;; WHEN: Thu Feb 13 13:49:53 EST 2020
|
||||
;; MSG SIZE rcvd: 109
|
||||
```
|
||||
|
||||
Since name servers generally cache collected data for a while, the query time shown at the bottom of dig output might sometimes might say "0 msec":
|
||||
|
||||
[][2]
|
||||
|
||||
```
|
||||
;; Query time: 0 msec <==
|
||||
;; SERVER: 127.0.0.53#53(127.0.0.53)
|
||||
;; WHEN: Thu Feb 13 15:30:09 EST 2020
|
||||
;; MSG SIZE rcvd: 109
|
||||
```
|
||||
|
||||
### Who you gonna ask?
|
||||
|
||||
By default, dig will refer to your **/etc/resolv.conf** file to determine what name server to query, but you can refer queries to other DNS servers by adding an **@** option.
|
||||
|
||||
In the example below, for example, the query is being sent to Google's name server (i.e., 8.8.8.8).
|
||||
|
||||
```
|
||||
$ dig @8.8.8.8 networkworld.com
|
||||
|
||||
; <<>> DiG 9.11.5-P4-5.1ubuntu2.1-Ubuntu <<>> @8.8.8.8 networkworld.com
|
||||
; (1 server found)
|
||||
;; global options: +cmd
|
||||
;; Got answer:
|
||||
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21163
|
||||
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1
|
||||
|
||||
;; OPT PSEUDOSECTION:
|
||||
; EDNS: version: 0, flags:; udp: 512
|
||||
;; QUESTION SECTION:
|
||||
;networkworld.com. IN A
|
||||
|
||||
;; ANSWER SECTION:
|
||||
networkworld.com. 299 IN A 151.101.130.165
|
||||
networkworld.com. 299 IN A 151.101.66.165
|
||||
networkworld.com. 299 IN A 151.101.194.165
|
||||
networkworld.com. 299 IN A 151.101.2.165
|
||||
|
||||
;; Query time: 48 msec
|
||||
;; SERVER: 8.8.8.8#53(8.8.8.8)
|
||||
;; WHEN: Thu Feb 13 14:26:14 EST 2020
|
||||
;; MSG SIZE rcvd: 109
|
||||
```
|
||||
|
||||
To determine what version of dig you’re using, use the **-v** option. You should see something like this:
|
||||
|
||||
```
|
||||
$ dig -v
|
||||
DiG 9.11.5-P4-5.1ubuntu2.1-Ubuntu
|
||||
```
|
||||
|
||||
or this:
|
||||
|
||||
```
|
||||
$ dig -v
|
||||
DiG 9.11.4-P2-RedHat-9.11.4-22.P2.el8
|
||||
```
|
||||
|
||||
To get just the answer portion of this response, you can omit name server details, but still get the answer you're looking for by using both a **+noall** (don't show everything) and a **+answer** (but show the answer section) like this:
|
||||
|
||||
```
|
||||
$ dig networkworld.com +noall +answer
|
||||
|
||||
; <<>> DiG 9.11.5-P4-5.1ubuntu2.1-Ubuntu <<>> networkworld.com +noall +answer
|
||||
;; global options: +cmd
|
||||
networkworld.com. 300 IN A 151.101.194.165
|
||||
networkworld.com. 300 IN A 151.101.130.165
|
||||
networkworld.com. 300 IN A 151.101.66.165
|
||||
networkworld.com. 300 IN A 151.101.2.165
|
||||
```
|
||||
|
||||
### Looking up a batch of systems
|
||||
|
||||
If you want to dig for a series of domain names, you can list the domain names in a file and then use a command like this one to have dig run through the list and provide the information.
|
||||
|
||||
```
|
||||
$ dig +noall +answer -f domains
|
||||
networkworld.com. 300 IN A 151.101.66.165
|
||||
networkworld.com. 300 IN A 151.101.2.165
|
||||
networkworld.com. 300 IN A 151.101.130.165
|
||||
networkworld.com. 300 IN A 151.101.194.165
|
||||
world.std.com. 77972 IN A 192.74.137.5
|
||||
uushenandoah.org. 1982 IN A 162.241.24.209
|
||||
amazon.com. 18 IN A 176.32.103.205
|
||||
amazon.com. 18 IN A 176.32.98.166
|
||||
amazon.com. 18 IN A 205.251.242.103
|
||||
```
|
||||
|
||||
You could add +short to the command above but, with some sites having multiple IP addresses, this might not be very useful. To cut down on the detail but be sure that you can tell which IP belongs to which domain, you could instead pass the output to **awk** to display just the first and last columns of data:
|
||||
|
||||
```
|
||||
$ dig +noall +answer -f domains | awk '{print $1,$NF}'
|
||||
networkworld.com. 151.101.66.165
|
||||
networkworld.com. 151.101.130.165
|
||||
networkworld.com. 151.101.194.165
|
||||
networkworld.com. 151.101.2.165
|
||||
world.std.com. 192.74.137.5
|
||||
amazon.com. 176.32.98.166
|
||||
amazon.com. 205.251.242.103
|
||||
amazon.com. 176.32.103.205
|
||||
```
|
||||
|
||||
Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3527430/digging-up-ip-addresses-with-the-dig-command.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/newsletters/signup.html
|
||||
[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,270 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to restore a single-core computer with Linux)
|
||||
[#]: via: (https://opensource.com/article/20/2/restore-old-computer-linux)
|
||||
[#]: author: (Howard Fosdick https://opensource.com/users/howtech)
|
||||
|
||||
How to restore a single-core computer with Linux
|
||||
======
|
||||
Let's have some geeky fun refurbishing your prehistoric Pentium with
|
||||
Linux and open source.
|
||||
![Two animated computers waving one missing an arm][1]
|
||||
|
||||
In a [previous article][2], I explained how I refurbish old dual-core computers ranging from roughly five to 15 years old. Properly restored, these machines can host a fully capable lightweight Linux distribution like [Mint/Xfce][3], [Xubuntu][4], or [Lubuntu][5] and perform everyday tasks. But what if you have a really old computer gathering dust in your attic or basement? Like a Pentium 4 desktop or Pentium M laptop? Yikes! Can you even do anything with a relic like that?
|
||||
|
||||
### Why restore a relic?
|
||||
|
||||
For starters, you might learn a bit about hardware and open source software by refurbishing it. And you could have some fun along the way. Whether you can make much use of it depends on your expectations.
|
||||
|
||||
A single-core computer can perform well for a specific purpose. For example, my friend created a dandy retro gaming box (like I describe below) that runs hundreds of Linux and old Windows and DOS games. His kids love it!
|
||||
|
||||
Another friend uses his Pentium 4 for running design spreadsheets in his workshop. He finds it convenient to have a dedicated machine tucked into a corner of his shop. He likes that he doesn't have to worry about heat or dust ruining an expensive modern computer.
|
||||
|
||||
My romance author acquaintance employs her Pentium M as a "novelist's workstation" lodged in her cozy attic hideaway. The laptop functions as her private word processor.
|
||||
|
||||
I've used old computers to teach beginners how to build and repair hardware. Old equipment makes the best testbed because it's expendable. If someone makes a mistake and fries a board, it doesn't much matter. (Contrast this to how you would feel if you wrecked your main computer!)
|
||||
|
||||
The web suggests many [other potential uses][6] for old Pentiums: security cam monitors, network-attached storage (NAS) servers, [SETI][7] boxes, torrent servers, anonymous [Tails][8] servers, Bitcoin miners, programming workstations, thin clients, terminal emulators, routers, file servers, and more. To me, many of these applications sound more like fun projects than practical uses for single-core computers. That doesn't mean they aren't worth your while; it's just that you want to be clear-eyed about any project you take on.
|
||||
|
||||
By current standards, P-4s and Ms are terribly [weak processors][9]. For example, using them for web surfing is problematic because webpage size and programming complexity have [grown exponentially][10]. And the open web is closing—increasingly, sites won't allow you access unless you let them run all those ads that can overwhelm old processors. (I'll discuss web surfing performance tricks later in this article.) Another shortcoming of old computers is their energy consumption. Better electricity-to-performance ratios often make newer computers more sensible. This especially true when a [tablet or smartphone][11] can fulfill your needs.
|
||||
|
||||
Nevertheless, you can still have fun and learn a lot by tinkering with an old P-4 or M. They're great educational tools, they're expendable, and they can be useful in dedicated roles. Best of all, you can get them for free. I'll tell you how.
|
||||
|
||||
Still reading? Okay, let's have some geeky fun refurbishing your prehistoric Pentium.
|
||||
|
||||
### Understand hardware evolution
|
||||
|
||||
As a quick level-set, here are the common names for the P-4 and M class processors and their rough dates of manufacture:
|
||||
|
||||
**Desktops (2000-2008)**
|
||||
|
||||
* Pentium 4
|
||||
* Pentium 4 HT (Hyper-Threading)
|
||||
* Pentium 4 EE (Extreme Edition)
|
||||
|
||||
|
||||
|
||||
**Desktops (2005-2008)**
|
||||
|
||||
* Pentium D (early dual-core)
|
||||
|
||||
|
||||
|
||||
**Mobile (2002-2008)**
|
||||
|
||||
* Pentium M
|
||||
* Pentium 4-M
|
||||
* Mobile Pentium 4
|
||||
* Mobile Pentium 4 HT
|
||||
|
||||
|
||||
|
||||
Sources: Wikipedia (for the [P-4][12], [P-M][13], and [processor][14] lists), [CPU World,][15] [Revolvy][16].
|
||||
|
||||
Machines hosting these processors typically use either DDR2 or DDR memory. Dual-core processors entered the market in 2005 and displaced single-core CPUs within a few years. I'll assume you have some version of what's in the above table. Or you might have an equivalent [AMD][17] or [Celeron][18] processor from the same era.
|
||||
|
||||
The big draw of this old hardware is that you can get it for free. People consider it junk. They'll be only too glad to give you their castoffs. If you don't have a machine on hand, just ask your friends or family. Or drop by the local recycling center. Unless they have strict rules, they'll be happy to give you this old equipment. You can even advertise on [Craigslist][19], [Freecycle,][20] or [other reuse websites][21].
|
||||
|
||||
**A quick tip:** Grab more than one machine. With old hardware, you often need to cannibalize parts from several computers to build one good working one.
|
||||
|
||||
### Prepare the hardware
|
||||
|
||||
Before you can use your old computer, you must refurbish it. The steps to fixing it up are:
|
||||
|
||||
1. Clean it
|
||||
2. Identify what hardware you have
|
||||
3. Verify the hardware works
|
||||
|
||||
|
||||
|
||||
Start by opening up the box and cleaning out the dirt. Dust causes the heat that kills electronics. A can of compressed air helps.
|
||||
|
||||
Always keep yourself grounded when touching things so that you don't harm the electronics. And don't rub anything with a cleaning rag! Even a shock you can't feel can damage computer circuitry.
|
||||
|
||||
While you've got the box open, learn everything you can about your hardware. Write it all down, so you remember it later:
|
||||
|
||||
* Count the open memory slots, if any. Is the RAM DDR or DDR2 (or something else)?
|
||||
* Read the hard drive label to learn its capacity and age. (It'll probably be an old IDE drive. You can identify IDE drives by their wide connector ribbons.)
|
||||
* Check the optical drive label to see what kinds of discs it reads and/or writes, at what speed, and to what standard(s).
|
||||
* Note other peripherals, add-in cards, or anything unusual.
|
||||
|
||||
|
||||
|
||||
Close and boot the machine into its boot-time [BIOS][22] panels. [This list][23] tells you what program function (PF) key to press to access those startup panels for your specific computer. Now you can complete your hardware identification by rounding out the details on your processor, memory, video memory, and more.
|
||||
|
||||
### Verify the hardware
|
||||
|
||||
Once you know what you've got, verify that it all works. Test:
|
||||
|
||||
* Memory
|
||||
* Disk
|
||||
* Motherboard
|
||||
* Peripherals (optical drive, USB ports, sound, etc.)
|
||||
|
||||
|
||||
|
||||
Run any diagnostic tests in the computer's boot or BIOS panels. Free resource kits like [Hiren's BootCD][24] or the [Ultimate Boot CD][25] can round out your testing with any diagnostics your boot panels lack. These kits offer dozens of testing programs: all are free, but not all are open source. You can boot them off a live USB or DVD so that you don't have to install anything on the computer.
|
||||
|
||||
Be sure to run the "extended" or long tests for the memory and disk drive. Run tests overnight if you have to. Do this job right! If you miss a problem now, it could cause you big headaches later.
|
||||
|
||||
If you find a problem, refer to my _[Quick guide to fixing hardware][26]_ to solve common issues.
|
||||
|
||||
### Essential hardware upgrades
|
||||
|
||||
You'll want to make two key hardware upgrades. First, increase memory to the computer's maximum. (You can find the maximum for your computer with a quick web search for its specs.) The practical minimum to run many lightweight Linux distros is 1GB RAM; 2GB or more is ideal. While the maximum allowable memory varies by the machine, the great majority of these computers will upgrade to at least 2GB.
|
||||
|
||||
Second—if the desktop doesn't already have one—add a video card. This offloads graphics processing from the motherboard to the video card and increases the computer's video memory. Bumping up the VRAM from 32 or 64MB to 256GB or more greatly increases the range of applications an old computer can run. Especially if you want to run games.
|
||||
|
||||
Be sure the video card fits your computer's [video slot][27] (AGP, PCI, or PCI-Express) and has the right [cable connector][28] (VGA or DVI). You can issue a couple of [Linux line commands][29] to see how much VRAM your system has, or look in the BIOS boot panels.
|
||||
|
||||
These two simple upgrade hacks—increasing memory and video power—take a marginal machine and make it _way_ more functional. Your goal is to build the most powerful P-4 or M ever. That way, you can squeeze the most performance from this aging design.
|
||||
|
||||
The good news is that with the old computers we're talking about, you can get any parts you need for free. Just cannibalize them from other discarded PC's.
|
||||
|
||||
### Select the software
|
||||
|
||||
Choosing the right software for a P-4 or M is critical. [Don't][30] use an [unsupported][31] Windows version just because it's already on the PC; malware might plague you if you do. A fresh install is mandatory.
|
||||
|
||||
Open source software is the way to go. [Many][32] Linux [distributions][33] are specifically designed for older computers. And with Linux, you can install, move, copy, and clone the operating system and its apps at will. This makes your job easier: You won't run into activation or licensing issues, and it's all free.
|
||||
|
||||
Which distribution should you pick? Assuming you have at least 2GB of memory, start your search by trying a _lightweight distribution_—these feature resource-stingy [desktop environments][34]. Xfce or LXQt are excellent desktop environment choices. Products that [consume more resources][35] or produce fancier graphics—like Unity, GNOME, KDE, MATE, and Cinnamon—won't perform well.
|
||||
|
||||
The lightweight Linux distros I've enjoyed success with are Mint/Xfce, Xubuntu, and Lubuntu. The first two use Xfce while Lubuntu employs LXQt. You can find [many other][36] excellent candidate distros beyond these three choices that I can vouch for.
|
||||
|
||||
Be sure to download the 32-bit versions of the operating systems; 64-bit versions don't make much sense unless a computer has at least 4GB of memory.
|
||||
|
||||
The lightweight Linux distros I've cited offer friendly menus and feature huge software repositories backed by active forums. They'll enable your old computer to do everything it's capable of. However, they won't run on every computer from the P-4 era. If one of these products runs on your computer and you like it, great! You've found your distro.
|
||||
|
||||
If your computer doesn't perform well with these selections, won't boot, or you have less than 2GB of memory, try an _ultralight distribution_. Ultralights reduce resource use by replacing desktop environments with [window managers][37] like Fluxbox, FLWM, IceWM, JWM, or Openbox. Window managers use fewer resources than desktop environments. The trade-off is that they're less flexible. As an example, you may have to dip into code to alter your desktop or taskbar icons.
|
||||
|
||||
My go-to ultralight distro is [Puppy Linux][38]. It comes in several variants that run well on Pentium 4's and M's with only 1GB of memory. Puppy's big draw is that it has versions designed specifically for older computers. This means you'll avoid the hassles you might run into with other distros. For example, Puppy versions run on old CPUs that don't support features like PAE or SSE3. They'll even help you run an older kernel or obsolete bootstrap program if your hardware requires it.
|
||||
|
||||
And Puppy runs _fast_ on limited-resource computers! It optimizes performance by loading the operating system entirely into memory to avoid slow disk access. It bundles a full range of apps that have been carefully selected to use minimal hardware resources.
|
||||
|
||||
Puppy is also user-friendly. Even a naive end user can use its simple menus and attractive desktop. But be advised—it takes expertise to install and configure the product. You might have to spend some time on Puppy's [forum][39] to get oriented. The forum is especially useful because many who post there work with old computers.
|
||||
|
||||
A fun alternative to Puppy is [Tiny Core][40] Linux. With Tiny Core, you install only the software components you want. So you build up your environment from the absolute minimum. This takes time but results in a lean, mean system. Tiny Core is perfect for creating a dedicated server. It's a great learning tool, too, so check out its [free eBook][41].
|
||||
|
||||
If you want a quick, no-hassles install, you might try [antiX][42]. It's Debian-based, offers a selection of lightweight interfaces, and runs well on machines with only a gigabyte of memory. I've had excellent results installing antiX on a variety of old PCs.
|
||||
|
||||
_**Caution:**_ Many distros casually claim that they run on "old computers" when they really mean that they run on _limited-resource computers_. There's a big difference. Old computers sometimes do not support all the CPU features required by newer operating systems. Avoid problems by selecting a Linux proven to run on your hardware.
|
||||
|
||||
Don't know if a distro will run on your box? Save yourself some time by posting a message on the distro's forum and asking for responses from folks using hardware like yours. You should receive some success stories. If nobody can say they've done what you're trying to do, I'd avoid that product.
|
||||
|
||||
### How to use your refurbished computer
|
||||
|
||||
Will you be happy using your restored PC? It depends on what you expect.
|
||||
|
||||
People who use aging systems learn to leverage minimal resources. For example, they run resource-stingy programs like GNOME Office in place of LibreOffice. They forgo CPU-intense programs like emulators, graphics-heavy apps, video processing, and virtual machine hosting. They focus on one task at a time and don't expect much concurrency. And they know how to manage machine resources proactively.
|
||||
|
||||
Old hardware can perform well in dedicated situations. Earlier, I mentioned my friends who use their old computers for design spreadsheets and as a writer's workbench. And I wrote this article on my personal retro box—a Dell GX280 desktop with a Pentium 4 at 3.2GHz, with 2GB DDR-2 RAM and two 40GB IDE disks, dual-booting Puppy and antiX.
|
||||
|
||||
#### Create a retro game box
|
||||
|
||||
You can also create a fantastic retro game box. First, install an appropriate distro. Then install [Wine][43], a program designed to run Windows software on Linux. Now you'll be able to run nearly all your old Windows XP, ME/98/95, and 3.1 games. [DOSBox][44] supports tons more [free DOS games][45]. And Linux offers over a thousand more.
|
||||
|
||||
I've enjoyed nostalgic fun on a P-4 running antiX and all the old games I remember from years ago. Just be sure you've maxed out system memory and added a good video card for the best results.
|
||||
|
||||
#### Access the web
|
||||
|
||||
The big challenge with old computers is web surfing. [This study][46] claims that average website size has increased 100% over a three-year period, while [this article][47] tells how bloated news sites have become. Videos, animation, images, trackers, ad requests—they all make websites slower than just a few years ago.
|
||||
|
||||
Worse, websites increasingly refuse you access unless you allow them to run their ads. This is a problem because the ads can overwhelm old CPUs. In fact, for most websites, the resources required to run ads and trackers are _way_ greater than that required for the actual website content.
|
||||
|
||||
Here are the performance tricks you need to know if you web surf with an older computer:
|
||||
|
||||
* Run the fastest, lightest browser possible. Chrome, Firefox, and Opera are probably the top mainstream offerings.
|
||||
* Try alternative [minimalist browsers][48] to see if they can meet your needs: [Dillo][49], [NetSurf][50], [Dooble][51], [Lynx][52], [Links][53], or others.
|
||||
* Actively manage your browser.
|
||||
* Don't open many browser tabs.
|
||||
* Manually start and stop processing in specific tabs.
|
||||
* Block ads and trackers:
|
||||
* Offload this chore to your virtual private network (VPN) if at all possible.
|
||||
* Otherwise, use a browser extension.
|
||||
* Don't slow down your browser by installing add-ons or extensions beyond the minimum required.
|
||||
* Disable autoplay for videos and Flash.
|
||||
* Toggle JavaScript off and on.
|
||||
* Ensure the browser renders text before graphics.
|
||||
* Don't run background tasks while web surfing.
|
||||
* Manually clear cookies to avoid page-access limits on some websites.
|
||||
* Linux means you don't have to run real-time anti-malware (which consumes a CPU core on many Windows PCs).
|
||||
|
||||
|
||||
|
||||
Employing some of these tricks, I happily use refurbished dual-core computers for all my web surfing. But with today's internet, I find single-core processors inadequate for anything beyond the occasional web lookup. In other words, they're acceptable for _web access_ but insufficient for _web surfing_. That's just my opinion. Yours may vary depending on your expectations and the nature of your web activity.
|
||||
|
||||
### Enjoy free educational fun
|
||||
|
||||
However you use your refurbished P-4 or M, you'll know a lot more about computer hardware and open source software than when you started. It won't cost you a penny, and you'll have some fun along the way!
|
||||
|
||||
Please share your own refurbishing experiences in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/restore-old-computer-linux
|
||||
|
||||
作者:[Howard Fosdick][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/howtech
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_other11x_cc.png?itok=I_kCDYj0 (Two animated computers waving one missing an arm)
|
||||
[2]: http://opensource.com/article/19/7/how-make-old-computer-useful-again
|
||||
[3]: http://linuxmint.com/
|
||||
[4]: https://xubuntu.org/
|
||||
[5]: http://lubuntu.me/
|
||||
[6]: http://www.google.com/search?q=uses+for+a+pentium+IV
|
||||
[7]: https://en.wikipedia.org/wiki/Search_for_extraterrestrial_intelligence
|
||||
[8]: https://en.wikipedia.org/wiki/Tails_(operating_system)
|
||||
[9]: http://www.cpubenchmark.net/low_end_cpus.html
|
||||
[10]: http://www.digitaltrends.com/web/internet-is-getting-slower/
|
||||
[11]: https://www.forbes.com/sites/christopherhelman/2013/09/07/how-much-energy-does-your-iphone-and-other-devices-use-and-what-to-do-about-it/#ba4918e2f702
|
||||
[12]: https://en.wikipedia.org/wiki/Pentium_4
|
||||
[13]: https://en.wikipedia.org/wiki/Pentium_M
|
||||
[14]: https://en.wikipedia.org/wiki/List_of_Intel_Pentium_4_microprocessors
|
||||
[15]: http://www.cpu-world.com/CPUs/Pentium_4/index.html
|
||||
[16]: https://www.revolvy.com/page/List-of-Intel-Pentium-4-microprocessors?cr=1
|
||||
[17]: https://en.wikipedia.org/wiki/List_of_AMD_microprocessors
|
||||
[18]: https://en.wikipedia.org/wiki/Celeron
|
||||
[19]: https://www.craigslist.org/about/sites
|
||||
[20]: https://www.freecycle.org/
|
||||
[21]: https://alternativeto.net/software/freecycle/
|
||||
[22]: http://en.wikipedia.org/wiki/BIOS
|
||||
[23]: http://www.disk-image.com/faq-bootmenu.htm
|
||||
[24]: http://www.hirensbootcd.org/download/
|
||||
[25]: http://www.ultimatebootcd.com/
|
||||
[26]: http://www.rexxinfo.org/Quick_Guide/Quick_Guide_To_Fixing_Computer_Hardware
|
||||
[27]: http://www.playtool.com/pages/vidslots/slots.html
|
||||
[28]: https://silentpc.com/articles/video-connectors
|
||||
[29]: https://www.cyberciti.biz/faq/howto-find-linux-vga-video-card-ram/
|
||||
[30]: https://fusetg.com/dangers-running-unsupported-operating-system/
|
||||
[31]: http://home.bt.com/tech-gadgets/computing/windows-7/windows-7-support-end-11364081315419
|
||||
[32]: https://itsfoss.com/lightweight-linux-beginners/
|
||||
[33]: https://fossbytes.com/best-lightweight-linux-distros/
|
||||
[34]: https://en.wikipedia.org/wiki/Desktop_environment
|
||||
[35]: http://www.phoronix.com/scan.php?page=article&item=ubu-1704-desktops&num=3
|
||||
[36]: https://www.google.com/search?ei=TfIoXtG5OYmytAbl04z4Cw&q=best+lightweight+linux+distros+for+old+computers&oq=best+lightweight+linux+distros+for+old&gs_l=psy-ab.1.0.0i22i30l8j0i333.6806.8527..10541...2.2..0.159.1119.2j8......0....1..gws-wiz.......0i71j0.a6LTmaIXan0
|
||||
[37]: https://en.wikipedia.org/wiki/X_window_manager
|
||||
[38]: http://puppylinux.com/
|
||||
[39]: http://murga-linux.com/puppy/
|
||||
[40]: http://tinycorelinux.net/
|
||||
[41]: http://tinycorelinux.net/book.html
|
||||
[42]: http://antixlinux.com/
|
||||
[43]: https://www.winehq.org/
|
||||
[44]: https://en.wikipedia.org/wiki/DOSBox
|
||||
[45]: https://www.dosgamesarchive.com/
|
||||
[46]: https://www.digitaltrends.com/web/internet-is-getting-slower/
|
||||
[47]: https://www.forbes.com/sites/kalevleetaru/2016/02/06/why-the-web-is-so-slow-and-what-it-tells-us-about-the-future-of-online-journalism/#34475c2072f4
|
||||
[48]: http://en.wikipedia.org/wiki/Comparison_of_lightweight_web_browsers
|
||||
[49]: http://www.dillo.org/
|
||||
[50]: http://www.netsurf-browser.org/
|
||||
[51]: http://textbrowser.github.io/dooble/
|
||||
[52]: http://lynx.browser.org/
|
||||
[53]: http://en.wikipedia.org/wiki/Links_%28web_browser%29
|
@ -0,0 +1,110 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to set up your own fast, private open source mesh network)
|
||||
[#]: via: (https://opensource.com/article/20/2/mesh-network-freemesh)
|
||||
[#]: author: (Spencer Thomason https://opensource.com/users/spencerthomason)
|
||||
|
||||
How to set up your own fast, private open source mesh network
|
||||
======
|
||||
FreeMesh is an affordable, performant, privacy-respecting mesh system
|
||||
that installs in less than 10 minutes.
|
||||
![people on top of a connected globe][1]
|
||||
|
||||
The [FreeMesh][2] system promises to bring fully open source mesh networking to the masses. I recently had a chance to test it; it installed quickly, and the performance was great—especially for the price.
|
||||
|
||||
### Why mesh and open source?
|
||||
|
||||
The reason to use open source is simple: privacy. With FreeMesh, your data is your own. It doesn't track or collect data. Don't trust it? You can easily check—it's open source, after all! With some other popular mesh solutions, say those provided by very large tech conglomerates, would you trust them with your data?
|
||||
|
||||
Another important factor: updates. FreeMesh says it is committed to pushing out security and performance updates regularly. What about 10 years from now? With an open source solution, you are free to update the product for as long as you want.
|
||||
|
||||
So why mesh? In a mesh network, multiple wireless routers work together to broadcast a single, very large wireless network. Each router in a mesh network intelligently communicates with the other(s) to provide the best "path" for your data. The following images from FreeMesh's website highlight the difference between using a single wireless router and a mesh network. The red network represents a single wireless router, and the green is a mesh network.
|
||||
|
||||
![Single-router network][3] | ![Mesh network][4]
|
||||
---|---
|
||||
|
||||
### Get the equipment
|
||||
|
||||
To get started with FreeMesh, [order a kit][5]. Two kits are available: standard and 4G LTE.
|
||||
|
||||
The 4G LTE kit, as the name suggests, supports cellular data connections. This feature is a rarity in the consumer networking space, and it will be _very_ useful to some folks. You can set up a portable mesh network anywhere with power and cell service with full fast-failover capability.
|
||||
|
||||
The FreeMesh kits come with a primary router and two nodes. The router and nodes use 802.11ac, 802.11r, and 802.11s standards. The included firmware runs a customized version of [OpenWrt][6], a Linux distro for embedded devices.
|
||||
|
||||
The FreeMesh router has some really good specs:
|
||||
|
||||
* **CPU:** Dual-core 880MHz MediaTek MT7621AT (two cores/four threads!)
|
||||
* **RAM:** DDR3 512MB
|
||||
* **Interfaces:** 1x GbE WAN, 4x GbE LAN, 1x USB 2.0 ports, 1x microSD card slot, 1x SIM slot
|
||||
* **Antenna:** 2x 5dBi 2.4GHz, 2x 5dBi 5GHz, 2x 3dBi 3G/4G (built-in)
|
||||
* **4G LTE modem:** LTE category 4 module, 150Mbps downlink and 50Mbps uplink
|
||||
|
||||
|
||||
|
||||
### Setup
|
||||
|
||||
Setup is easy, and FreeMesh's [README][7] offers simple instructions and diagrams. Start by setting up the primary router first. Then follow these simple steps:
|
||||
|
||||
1. Connect the first node (blue WAN port) to the primary router (yellow LAN port).
|
||||
![FreeMesh setup step 1][8]
|
||||
2. Wait about 30 to 60 seconds. The node will flash its LEDs when the setup is complete.
|
||||
![FreeMesh setup step 2][9]
|
||||
3. Move the node to another location.
|
||||
|
||||
|
||||
|
||||
That's it! There is no manual setup required for the nodes; you simply plug them into the primary router, and it does the rest. You can add more nodes the same way; just repeat the steps above.
|
||||
|
||||
### Features
|
||||
|
||||
Out of the box, FreeMesh runs a combination of OpenWRT and LuCI. It has all the features you'd expect from a router. Want to install new features or packages? SSH in and start hacking!
|
||||
|
||||
![Real-time load on FreeMesh network][10]
|
||||
|
||||
![Overview of FreeMesh network][11]
|
||||
|
||||
![OpenWrt status report][12]
|
||||
|
||||
### Performance
|
||||
|
||||
After setting up the FreeMesh system, I moved the nodes to various places around my house. I used [iPerf][13] to test the bandwidth and was getting around 150Mbps. WiFi can be affected by any number of environmental variables, so your mileage may vary. Distance between the nodes and the primary router also plays a large factor in bandwidth.
|
||||
|
||||
However, the real advantage of a mesh network isn't its top-end speed but much better average speed across a space. Even at the far reaches of my home, I was still able to stream videos and work without interruption. I was even able to work in my backyard. I simply repositioned one of the nodes in front of a window before heading outside.
|
||||
|
||||
### Conclusion
|
||||
|
||||
FreeMesh is really compelling; it offers performance, privacy, and price, all in a simple, open source package.
|
||||
|
||||
In my experience, setup is a breeze, and it is more than fast enough. The range is excellent and far exceeds any single-router setup. You are free to hack and customize your FreeMesh setup, but I didn't feel the need to. It has everything I need out of the box.
|
||||
|
||||
If you are looking for an affordable, performant, privacy-respecting mesh system that installs in less than 10 minutes, you might want to consider FreeMesh.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/mesh-network-freemesh
|
||||
|
||||
作者:[Spencer Thomason][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/spencerthomason
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-networking.png?itok=fHmulI9p (people on top of a connected globe)
|
||||
[2]: https://freemeshwireless.com/
|
||||
[3]: https://opensource.com/sites/default/files/uploads/singlerouternetwork.png (Single-router network)
|
||||
[4]: https://opensource.com/sites/default/files/uploads/meshnetwork.png (Mesh network)
|
||||
[5]: https://freemeshwireless.com/#pricing
|
||||
[6]: https://openwrt.org/
|
||||
[7]: https://gitlab.com/slthomason/freemesh/-/blob/master/README.md
|
||||
[8]: https://opensource.com/sites/default/files/uploads/connecttorouter.png (FreeMesh setup step 1)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/setupcomplete.png (FreeMesh setup step 2)
|
||||
[10]: https://opensource.com/sites/default/files/uploads/freemeshrealtimeload.png (Real-time load on FreeMesh network)
|
||||
[11]: https://opensource.com/sites/default/files/uploads/freemeshwirelessoverview.png (Overview of FreeMesh network)
|
||||
[12]: https://opensource.com/sites/default/files/uploads/openwrt.png (OpenWrt status report)
|
||||
[13]: https://opensource.com/article/20/1/internet-speed-tests
|
@ -0,0 +1,89 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (PHP Development on Fedora with Eclipse)
|
||||
[#]: via: (https://fedoramagazine.org/php-development-on-fedora-with-eclipse/)
|
||||
[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/)
|
||||
|
||||
PHP Development on Fedora with Eclipse
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
[Eclipse][2] is a full-featured free and open source IDE developed by the Eclipse Foundation. It has been around since 2001. You can write anything from C/C++ and Java to PHP, Python, HTML, JavaScript, Kotlin, and more in this IDE.
|
||||
|
||||
### Installation
|
||||
|
||||
The software is available from Fedora’s official repository. To install it, invoke:
|
||||
|
||||
```
|
||||
sudo dnf install eclipse
|
||||
```
|
||||
|
||||
This will install the base IDE and Eclipse platform, which enables you to develop Java applications. In order to add PHP development support to the IDE, run this command:
|
||||
|
||||
```
|
||||
sudo dnf install eclipse-pdt
|
||||
```
|
||||
|
||||
This will install PHP development tools like PHP project wizard, PHP server configurations, composer support, etc.
|
||||
|
||||
### Features
|
||||
|
||||
This IDE has many features that make PHP development easier. For example, it has a comprehensive project wizard (where you can configure many options for your new projects). It also has built-in features like composer support, debugging support, a browser,a terminal, and more.
|
||||
|
||||
### Sample project
|
||||
|
||||
Now that the IDE is installed, let’s create a simple PHP project. Go to _File →New → Project_. From the resulting dialog, select _PHP project_. Enter a name for your project. There are some other options you might want to change, like changing the project’s default location, enabling JavaScript, and changing PHP version. See the following screenshot.
|
||||
|
||||
![Create A New PHP Project in Eclipse][3]
|
||||
|
||||
You can click the _Finish_ button to create the project or press _Next_ to configure other options like adding include and build paths. You don’t need to change those in most cases.
|
||||
|
||||
Once the project is created, right click on the project folder and select _New → PHP File_ to add a new PHP file to the project. For this tutorial I named it _index.php_, the conventionally-recognized default file in every PHP project.
|
||||
|
||||
![][4]
|
||||
|
||||
Then add the your code to the new file.
|
||||
|
||||
![Demo PHP code][5]
|
||||
|
||||
In the example above, I used CSS, JavaScript, and PHP tags on the same page mainly to show that the IDE is capable of supporting all of them together.
|
||||
|
||||
Once your page is ready, you can see the result output by moving the file to your web server document root or by creating a development PHP server in the project directory.
|
||||
|
||||
Thanks to the built-in terminal in Eclipse, we can launch a PHP development server right from within the IDE. Simply click the terminal icon on the toolbar (![Terminal Icon][6]) and click _OK_. In the new terminal, change to the project directory and run the following command:
|
||||
|
||||
```
|
||||
php -S localhost:8080 -t . index.php
|
||||
```
|
||||
|
||||
![Terminal output][7]
|
||||
|
||||
Now, open a browser and head over to <http://localhost:8080>. If everything has been done correctly per instructions and your code is error-free, you will see the output of your PHP script in the browser.
|
||||
|
||||
![PHP output in Fedora][8]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/php-development-on-fedora-with-eclipse/
|
||||
|
||||
作者:[Mehdi Haghgoo][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://fedoramagazine.org/author/powergame/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/php-eclipse-816x346.png
|
||||
[2]: https://projects.eclipse.org/projects/eclipse
|
||||
[3]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-01-58-39.png
|
||||
[4]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-02-02-05-1024x576.png
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2020/02/code-1024x916.png
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-03-50-05.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2020/02/terminal-1024x239.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2020/02/output.png
|
@ -0,0 +1,69 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Automating unit tests in test-driven development)
|
||||
[#]: via: (https://opensource.com/article/20/2/automate-unit-tests)
|
||||
[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic)
|
||||
|
||||
Automating unit tests in test-driven development
|
||||
======
|
||||
What unit tests have in common with carpentry.
|
||||
![gears and lightbulb to represent innovation][1]
|
||||
|
||||
DevOps is a software engineering discipline focused on minimizing the lead time to achieve a desired business impact. While business stakeholders and sponsors have ideas on how to optimize business operations, those ideas need to be validated in the field. This means business automation (i.e., software products) must be placed in front of end users and paying customers. Only then will the business confirm whether the initial idea for improvement was fruitful or not.
|
||||
|
||||
Software engineering is a budding discipline, and it can get difficult to ship products that are defect-free. For that reason, DevOps resorts to maximizing automation. Any repeatable chore, such as testing implemented changes to the source code, should be automated by DevOps engineers.
|
||||
|
||||
This article looks at how to automate unit tests. These tests are focused on what I like to call "programming in the small." Much more important test automation (the so-called "programming in the large") must use a different discipline—integration testing. But that's a topic for another article.
|
||||
|
||||
### What is a unit?
|
||||
|
||||
When I'm teaching approaches to unit testing, often, my students cannot clearly determine what a testable unit is. Which is to say, the granularity of the processing is not always clear.
|
||||
|
||||
I like to point out that the easiest way to spot a valid unit is to think of it as a _unit of behavior_. For example (albeit a trivial one), when an authenticated customer begins online shopping, the unit of behavior is a cart that has zero items in it. Once we all agree that an empty shopping cart has zero items in it, we can focus on automating the unit test that will ensure that such a shopping cart always returns zero items.
|
||||
|
||||
### What is not a unit?
|
||||
|
||||
Any processing that involves more than a single behavior should not be viewed as a unit. For example, if shopping cart processing results in tallying up the number of items in the cart AND calculating the order total AND calculating sales tax AND calculating the suggested shipping method, that behavior is not a good candidate for unit testing. Such behavior is a good candidate for integration testing.
|
||||
|
||||
### When to write a unit test
|
||||
|
||||
There is a lot of debate about when to write a unit test. Received wisdom states that once the code has been written, it is a good idea to write automated scripts that will assert whether the implemented unit of behavior delivers functionality as expected. Not only does such a unit test (or a few unit tests) document the expected behavior, the collection of all unit tests ensures that future changes will not degrade quality. If a future change adversely affects the already implemented behavior, one or more unit tests will complain, which will alert developers that regression has occurred.
|
||||
|
||||
There is another way to look at software engineering. It is based on the traditional adage "measure twice, cut once." In that light, writing code before writing tests would be equivalent to cutting a part of some product (say, a chair leg) and measuring it only after it's cut. If the craftsperson doing the cutting is very skilled, that approach may work (kind of). But more likely than not, the chair legs cut this way would end up with unequal lengths. So, it is advisable to measure before cutting. What that means for the practice of software engineering is that the measurements are expressed in the unit tests. Once we measure the required values, we create a blueprint (a unit test). That blueprint is then used to guide the cutting of the code.
|
||||
|
||||
Common sense would suggest that it is more reasonable to measure first and, only then, do the cutting. According to that line of reasoning, writing unit tests before writing code is a recommended way to do proper software engineering. Technically speaking, this "measure twice, cut once" approach is called a "test-first" approach. The opposite approach, where we write the code first, is called "test-later." The test-first approach is the approach advocated by [test-driven development][2] (TDD) methodology. Writing tests later is called test-later development (TLD).
|
||||
|
||||
### Why is TLD harmful?
|
||||
|
||||
Cutting before measuring is not recommended. Even the most talented craftspeople will eventually make mistakes by cutting without doing so. A lack of measurement will eventually catch up with even the most experienced of us as we continue in our craft. So it's best to produce a blueprint (i.e., measurements) before cutting.
|
||||
|
||||
But that's not the only reason why the TLD approach is considered harmful. When we write code, we're simultaneously considering two separate concerns: the expected behavior of the code and the optimal structure of the code. These two concerns are very dissimilar. That fact makes it very challenging to do a proper job satisfying the expectations regarding both the desired behavior and the optimal (or at the very least, decent) code structure.
|
||||
|
||||
The TDD approach solves this conundrum by focusing undivided attention first on the expected desired behavior. We start by writing the unit test. In that test, we focus on _what_ we expect to happen. At this point, we don't care, in the least, _how_ the expected behavior is going to materialize.
|
||||
|
||||
Once we're done describing the _what_ (i.e., what manifest behavior are we expecting from the unit we are about to build?), we watch that expectation fail. It fails because the code that is concerned with _how_ the expected behavior is going to happen hasn't materialized yet. Now we are compelled to write the code that's going to take care of the _how_.
|
||||
|
||||
After we write the code responsible for how, we run the unit test(s) and see if the code we just wrote fulfills the expected behavior. If it does, we're done. Time to move on to fulfilling the next expectation. If it doesn't, we continue transforming the code until it succeeds in passing the test.
|
||||
|
||||
If we choose not to do TDD, but write code first and later write the unit test, we miss the opportunity to separate _what_ from _how_. In other words, we write the code while simultaneously taking care of what we expect the code to do _and_ how to structure the code to do it correctly.
|
||||
|
||||
As such, writing unit tests after we write code is considered harmful.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/automate-unit-tests
|
||||
|
||||
作者:[Alex Bunardzic][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/alex-bunardzic
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation)
|
||||
[2]: https://opensource.com/article/20/1/test-driven-development
|
@ -0,0 +1,133 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Create web user interfaces with Qt WebAssembly instead of JavaScript)
|
||||
[#]: via: (https://opensource.com/article/20/2/wasm-python-webassembly)
|
||||
[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99)
|
||||
|
||||
Create web user interfaces with Qt WebAssembly instead of JavaScript
|
||||
======
|
||||
Get hands-on with Wasm, PyQt, and Qt WebAssembly.
|
||||
![Digital creative of a browser on the internet][1]
|
||||
|
||||
When I first heard about [WebAssembly][2] and the possibility of creating web user interfaces with Qt, just like I would in ordinary C++, I decided to take a deeper look at the technology.
|
||||
|
||||
My open source project [Pythonic][3] is completely Python-based (PyQt), and I use C++ at work; therefore, this minimal, straightforward WebAssembly tutorial uses Python on the backend and C++ Qt WebAssembly for the frontend. It is aimed at programmers who, like me, are not familiar with web development.
|
||||
|
||||
![Header Qt C++ frontend][4]
|
||||
|
||||
### TL;DR
|
||||
|
||||
|
||||
```
|
||||
git clone <https://github.com/hANSIc99/wasm\_qt\_example>
|
||||
|
||||
cd wasm_qt_example
|
||||
|
||||
python mysite.py
|
||||
```
|
||||
|
||||
Then visit <http://127.0.0.1:7000> with your favorite browser.
|
||||
|
||||
### What is WebAssembly?
|
||||
|
||||
WebAssembly (often shortened to Wasm) is designed primarily to execute portable binary code in web applications to achieve high-execution performance. It is intended to coexist with JavaScript, and both frameworks are executed in the same sandbox. [Recent performance benchmarks][5] showed that WebAssembly executes roughly 10–40% faster, depending on the browser, and given its novelty, we can still expect improvements. The downside of this great execution performance is its widespread adoption as the preferred malware language. Crypto miners especially benefit from its performance and harder detection of evidence due to its binary format.
|
||||
|
||||
### Toolchain
|
||||
|
||||
There is a [getting started guide][6] on the Qt wiki. I recommend sticking exactly to the steps and versions mentioned in this guide. You may need to select your Qt version carefully, as different versions have different features (such as multi-threading), with improvements happening with each release.
|
||||
|
||||
To get executable WebAssembly code, simply pass your Qt C++ application through [Emscripten][7]. Emscripten provides the complete toolchain, and the build script couldn't be simpler:
|
||||
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
source ~/emsdk/emsdk_env.sh
|
||||
~/Qt/5.13.1/wasm_32/bin/qmake
|
||||
make
|
||||
```
|
||||
|
||||
Building takes roughly 10 times longer than with a standard C++ compiler like Clang or g++. The build script will output the following files:
|
||||
|
||||
* WASM_Client.js
|
||||
* WASM_Client.wasm
|
||||
* qtlogo.svg
|
||||
* qtloader.js
|
||||
* WASM_Client.html
|
||||
* Makefile (intermediate)
|
||||
|
||||
|
||||
|
||||
The versions on my (Fedora 30) build system are:
|
||||
|
||||
* emsdk: 1.38.27
|
||||
* Qt: 5.13.1
|
||||
|
||||
|
||||
|
||||
### Frontend
|
||||
|
||||
The frontend provides some functionalities based on [WebSocket][8].
|
||||
|
||||
![Qt-made frontend in browser][9]
|
||||
|
||||
* **Send message to server:** Send a simple string message to the server with a WebSocket. You could have done this also with a simple HTTP POST request.
|
||||
* **Start/stop timer:** Create a WebSocket and start a timer on the server to send messages to the client at a regular interval.
|
||||
* **Upload file:** Upload a file to the server, where the file is saved to the home directory (**~/**) of the user who runs the server.
|
||||
|
||||
|
||||
|
||||
If you adapt the code and face a compiling error like this:
|
||||
|
||||
|
||||
```
|
||||
error: static_assert failed due to
|
||||
requirement ‘bool(-1 == 1)’ “Required feature http for file
|
||||
../../Qt/5.13.1/wasm_32/include/QtNetwork/qhttpmultipart.h not available.”
|
||||
QT_REQUIRE_CONFIG(http);
|
||||
```
|
||||
|
||||
it means that the requested feature is not available for Qt Wasm.
|
||||
|
||||
### Backend
|
||||
|
||||
The server work is done by [Eventlet][10]. I chose Eventlet because it is lightweight and easy to use. Eventlet provides WebSocket functionality and supports threading.
|
||||
|
||||
![Decorated functions for WebSocket handling][11]
|
||||
|
||||
Inside the repository under **mysite/template**, there is a symbolic link to **WASM_Client.html** in the root path. The static content under **mysite/static** is also linked to the root path of the repository. If you adapt the code and do a recompile, you just have to restart Eventlet to update the content to the client.
|
||||
|
||||
Eventlet uses the Web Server Gateway Interface for Python (WSGI). The functions that provide the specific functionality are extended with decorators.
|
||||
|
||||
Please note that this is an absolute minimum server implementation. It doesn't implement any multi-user capabilities — every client is able to start/stop the timer, even for other clients.
|
||||
|
||||
### Conclusion
|
||||
|
||||
Take this example code as a starting point to get familiar with WebAssembly without wasting time on minor issues. I don't make any claims for completeness nor best-practice integration. I walked through a long learning curve until I got it running to my satisfaction, and I hope this gives you a brief look into this promising technology.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/wasm-python-webassembly
|
||||
|
||||
作者:[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/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
|
||||
[2]: https://webassembly.org/
|
||||
[3]: https://github.com/hANSIc99/Pythonic
|
||||
[4]: https://opensource.com/sites/default/files/uploads/cpp_qt.png (Header Qt C++ frontend)
|
||||
[5]: https://pspdfkit.com/blog/2018/a-real-world-webassembly-benchmark/
|
||||
[6]: https://wiki.qt.io/Qt_for_WebAssembly#Getting_Started
|
||||
[7]: https://emscripten.org/docs/introducing_emscripten/index.html
|
||||
[8]: https://en.wikipedia.org/wiki/WebSocket
|
||||
[9]: https://opensource.com/sites/default/files/uploads/wasm_frontend.png (Qt-made frontend in browser)
|
||||
[10]: https://eventlet.net/
|
||||
[11]: https://opensource.com/sites/default/files/uploads/python_backend.png (Decorated functions for WebSocket handling)
|
132
sources/tech/20200217 How to get MongoDB Server on Fedora.md
Normal file
132
sources/tech/20200217 How to get MongoDB Server on Fedora.md
Normal file
@ -0,0 +1,132 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to get MongoDB Server on Fedora)
|
||||
[#]: via: (https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/)
|
||||
[#]: author: (Honza Horak https://fedoramagazine.org/author/hhorak/)
|
||||
|
||||
How to get MongoDB Server on Fedora
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Mongo (from “humongous”) is a high-performance, open source, schema-free document-oriented database, which is one of the most favorite so-called [NoSQL][2] databases. It uses JSON as a document format, and it is designed to be scalable and replicable across multiple server nodes.
|
||||
|
||||
### Story about license change
|
||||
|
||||
It’s been more than a year when the upstream MongoDB decided to change the license of the Server code. The previous license was GNU Affero General Public License v3 (AGPLv3). However, upstream wrote a new license designed to make companies running MongoDB as a service contribute back to the community. The new license is called Server Side Public License (SSPLv1) and more about this step and its rationale can be found at [MongoDB SSPL FAQ][3].
|
||||
|
||||
Fedora has always included only free (as in “freedom”) software. When SSPL was released, Fedora [determined][4] that it is not a free software license in this meaning. All versions of MongoDB released before the license change date (October 2018) could be potentially kept in Fedora, but never updating the packages in the future would bring security issues. Hence the Fedora community decided to [remove the MongoDB server][5] entirely, starting Fedora 30.
|
||||
|
||||
### What options are left to developers?
|
||||
|
||||
Well, alternatives exist, for example PostgreSQL also supports JSON in the recent versions, and it can be used in cases when MongoDB cannot be used any more. With JSONB type, indexing works very well in PostgreSQL with performance comparable with MongoDB, and even without any compromises from ACID.
|
||||
|
||||
The technical reasons that a developer may have chosen MongoDB did not change with the license, so many still want to use it. What is important to realize is that the SSPL license was only changed to the MongoDB server. There are other projects that MongoDB upstream develops, like MongoDB tools, C and C++ client libraries and connectors for various dynamic languages, that are used on the client side (in applications that want to communicate with the server over the network). Since the license is kept free (Apache License mostly) for those packages, they are staying in Fedora repositories, so users can use them for the application development.
|
||||
|
||||
The only change is really the server package itself, which was removed entirely from Fedora repos. Let’s see what a Fedora user can do to get the non-free packages.
|
||||
|
||||
### How to install MongoDB server from the upstream
|
||||
|
||||
When Fedora users want to install a MongoDB server, they need to approach MongoDB upstream directly. However, the upstream does not ship RPM packages for Fedora itself. Instead, the MongoDB server is either available as the source tarball, that users need to compile themselves (which requires some developer knowledge), or Fedora user can use some compatible packages. From the compatible options, the best choice is the RHEL-8 RPMs at this point. The following steps describe, how to install them and how to start the daemon.
|
||||
|
||||
#### 1\. Create a repository with upstream RPMs (RHEL-8 builds)
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
$ sudo cat > /etc/yum.repos.d/mongodb.repo &lt;&lt;EOF
|
||||
[mongodb-upstream]
|
||||
name=MongoDB Upstream Repository
|
||||
baseurl=<https://repo.mongodb.org/yum/redhat/8Server/mongodb-org/4.2/x86\_64/>
|
||||
gpgcheck=1
|
||||
enabled=1
|
||||
gpgkey=<https://www.mongodb.org/static/pgp/server-4.2.asc>
|
||||
EOF
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
#### 2\. Install the meta-package, that pulls the server and tools packages
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
$ sudo dnf install mongodb-org
|
||||
&lt;snipped>
|
||||
Installed:
|
||||
mongodb-org-4.2.3-1.el8.x86_64 mongodb-org-mongos-4.2.3-1.el8.x86_64
|
||||
mongodb-org-server-4.2.3-1.el8.x86_64 mongodb-org-shell-4.2.3-1.el8.x86_64
|
||||
mongodb-org-tools-4.2.3-1.el8.x86_64
|
||||
|
||||
Complete!
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
#### 3\. Start the MongoDB daemon
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
$ sudo systemctl status mongod
|
||||
● mongod.service - MongoDB Database Server
|
||||
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
|
||||
Active: active (running) since Sat 2020-02-08 12:33:45 EST; 2s ago
|
||||
Docs: <https://docs.mongodb.org/manual>
|
||||
Process: 15768 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
|
||||
Process: 15769 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
|
||||
Process: 15770 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
|
||||
Process: 15771 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS)
|
||||
Main PID: 15773 (mongod)
|
||||
Memory: 70.4M
|
||||
CPU: 611ms
|
||||
CGroup: /system.slice/mongod.service
|
||||
└─15773 /usr/bin/mongod -f /etc/mongod.conf
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
#### 4\. Verify that the server runs by connecting to it from the mongo shell
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
$ mongo
|
||||
MongoDB shell version v4.2.3
|
||||
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&amp;gssapiServiceName=mongodb
|
||||
Implicit session: session { "id" : UUID("20b6e61f-c7cc-4e9b-a25e-5e306d60482f") }
|
||||
MongoDB server version: 4.2.3
|
||||
Welcome to the MongoDB shell.
|
||||
For interactive help, type "help".
|
||||
For more comprehensive documentation, see
|
||||
<http://docs.mongodb.org/>
|
||||
\---
|
||||
|
||||
> _
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
That’s all. As you see, the RHEL-8 packages are pretty compatible and it should stay that way for as long as the Fedora packages remain compatible with what’s in RHEL-8. Just be careful that you comply with the SSPLv1 license in your use.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/
|
||||
|
||||
作者:[Honza Horak][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://fedoramagazine.org/author/hhorak/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/mongodb-816x348.png
|
||||
[2]: https://en.wikipedia.org/wiki/NoSQL
|
||||
[3]: https://www.mongodb.com/licensing/server-side-public-license/faq
|
||||
[4]: https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/thread/IQIOBOGWJ247JGKX2WD6N27TZNZZNM6C/
|
||||
[5]: https://fedoraproject.org/wiki/Changes/MongoDB_Removal
|
177
sources/tech/20200217 How to install Vim plugins.md
Normal file
177
sources/tech/20200217 How to install Vim plugins.md
Normal file
@ -0,0 +1,177 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to install Vim plugins)
|
||||
[#]: via: (https://opensource.com/article/20/2/how-install-vim-plugins)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
How to install Vim plugins
|
||||
======
|
||||
Whether you install them manually or with a package manager, plugins can
|
||||
help you create the perfect Vim for your workflow.
|
||||
![Team checklist and to dos][1]
|
||||
|
||||
While [Vim][2] is fast and efficient, by default, it is but a mere text editor. At least, that's what it would be without plugins, which build upon Vim and add extra features to make it so much more than just a window for typing text. With the right mix of plugins, you can take control of your life and forge your own unique Vim experience. You can [customize your theme][3], and you can add syntax highlighting, code linting, version trackers, and much much more.
|
||||
|
||||
### How to install Vim plugins
|
||||
|
||||
Vim is extensible through plugins, but for a long time, there was no official method for installing them. As of the Vim 8.x series, however, there's a structure around how plugins are intended to be installed and loaded. You may encounter old instructions online or in project README files, but as long as you're running Vim 8 or greater, you should install according to Vim's [official plugin install method][4] or with a Vim package manager. You can use a package manager regardless of what version you run (including releases older than 8.x), which makes the install process easier than maintaining updates yourself.
|
||||
|
||||
Both the manual and automated methods are worth knowing, so keep reading to learn about both.
|
||||
|
||||
### Install plugins manually (Vim 8 and above)
|
||||
|
||||
A Vim package is a directory containing one or more plugins. By default, your Vim settings are contained in **~/.vim**, so that's where Vim looks for plugins when you launch it. (The examples below use the generic name **vendor** to indicate that the plugins are obtained from an entity that is not you.)
|
||||
|
||||
When you start Vim, it first processes your **.vimrc** file, and then it scans all directories in **~/.vim** for plugins contained in **pack/*/start**.
|
||||
|
||||
By default, your **~/.vim** directory (if you even have one) has no such file structure, so set that up with:
|
||||
|
||||
|
||||
```
|
||||
`$ mkdir -p ~/.vim/pack/vendor/start`
|
||||
```
|
||||
|
||||
Now you can place Vim plugins in **~/.vim/pack/vendor/start**, and they'll automatically load when you launch Vim.
|
||||
|
||||
For example, try installing [NERDTree][5], a text-based file manager for Vim. First, use Git to clone a snapshot of the NERDTree repository:
|
||||
|
||||
|
||||
```
|
||||
$ git clone --depth 1 \
|
||||
<https://github.com/preservim/nerdtree.git> \
|
||||
~/.vim/pack/vendor/start/nerdtree
|
||||
```
|
||||
|
||||
Launch Vim or gvim, and type this command:
|
||||
|
||||
|
||||
```
|
||||
`:NERDTree`
|
||||
```
|
||||
|
||||
A file tree will open along the left side of your Vim window.
|
||||
|
||||
![NERDTree plugin][6]
|
||||
|
||||
If you don't want a plugin to load automatically every time you launch Vim, you can create an **opt** directory within your **~/.vim/pack/vendor** directory:
|
||||
|
||||
|
||||
```
|
||||
`$ mkdir ~/.vim/pack/vendor/opt`
|
||||
```
|
||||
|
||||
Any plugins installed into **opt** are available to Vim but not loaded into memory until you add them to a session with the **packadd** command, e.g., for an imaginary plugin called foo:
|
||||
|
||||
|
||||
```
|
||||
`:packadd foo`
|
||||
```
|
||||
|
||||
Officially, Vim recommends that each plugin project gets its own directory within **~/.vim/pack**. For example, if you were to install the NERDTree plugin and the imaginary foo plugin, you would create this structure:
|
||||
|
||||
|
||||
```
|
||||
$ mkdir -p ~/.vim/pack/NERDTree/start/
|
||||
$ git clone --depth 1 \
|
||||
<https://github.com/preservim/nerdtree.git> \
|
||||
~/.vim/pack/NERDTree/start/NERDTree
|
||||
$ mkdir -p ~/.vim/pack/foo/start/
|
||||
$ git clone --depth 1 \
|
||||
<https://notabug.org/foo/foo.git> \
|
||||
~/.vim/pack/foo/start/foo
|
||||
```
|
||||
|
||||
Whether that's convenient is up to you.
|
||||
|
||||
### Using a Vim package manager (any Vim version)
|
||||
|
||||
Since Vim series 8, package managers have become less useful, but some users still prefer them because of their ability to auto-update several plugins. There are several package managers to choose from, and they're each different, but [vim-plug][7] has some great features and the best documentation of them all, which makes it easy to start with and to explore in depth later.
|
||||
|
||||
#### Installing plugins with vim-plug
|
||||
|
||||
Install vim-plug so that it auto-loads at launch with:
|
||||
|
||||
|
||||
```
|
||||
$ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
||||
<https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim>
|
||||
```
|
||||
|
||||
Create a **~/.vimrc** file (if you don't have one already), and enter this text:
|
||||
|
||||
|
||||
```
|
||||
call plug#begin()
|
||||
Plug 'preservim/NERDTree'
|
||||
call plug#end()
|
||||
```
|
||||
|
||||
Each time you want to install a plugin, you must enter the name and location of the plugin between the **plug#begin()** and **plug#end** lines. (The NERDTree file manager is used above as an example.) If the plugin you want isn't hosted on GitHub, then you can provide the full URL instead of just the GitHub username and project ID. You can even "install" local plugins outside of your **~/.vim** directory.
|
||||
|
||||
Finally, start Vim and prompt vim-plug to install the plugins listed in **~/.vimrc**:
|
||||
|
||||
|
||||
```
|
||||
`:PlugInstall`
|
||||
```
|
||||
|
||||
Wait for the plugins to be downloaded.
|
||||
|
||||
#### Update plugins with vim-plug
|
||||
|
||||
Editing **~/.vimrc** and issuing a command to do the installation probably doesn't seem like much of a savings over the manual install process, but the real benefit to vim-plug is in updates. To update all installed plugins, issue this Vim command:
|
||||
|
||||
|
||||
```
|
||||
`:PlugUpdate`
|
||||
```
|
||||
|
||||
If you don't want to update all plugins, you can update any subset by adding the plugin's name:
|
||||
|
||||
|
||||
```
|
||||
`:PlugUpdate NERDTree`
|
||||
```
|
||||
|
||||
#### Restore plugins
|
||||
|
||||
Another vim-plug benefit is its export and recovery function. As any Vim user knows, the way Vim works is often unique to each user—in part because of plugins. Once you get the right blend of plugins installed and configured, the last thing you want is to lose track of them.
|
||||
|
||||
Vim-plug has this command to generate a script for restoring all current plugins:
|
||||
|
||||
|
||||
```
|
||||
`:PlugSnapshot ~/vim-plug.list`
|
||||
```
|
||||
|
||||
There are many other functions for vim-plug, so refer to its [project page][7] for the full documentation.
|
||||
|
||||
### Create the perfect Vim
|
||||
|
||||
When you spend all day in a program, you want every little detail to serve you the best it possibly can. Get to know Vim and its many plugins until you build the perfect application for what you do.
|
||||
|
||||
Got a favorite Vim plugin? Tell us all about it in the comments!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/how-install-vim-plugins
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos)
|
||||
[2]: https://www.vim.org/
|
||||
[3]: https://opensource.com/article/19/12/colors-themes-vim
|
||||
[4]: https://github.com/vim/vim/blob/03c3bd9fd094c1aede2e8fe3ad8fd25b9f033053/runtime/doc/repeat.txt#L515
|
||||
[5]: https://github.com/preservim/nerdtree
|
||||
[6]: https://opensource.com/sites/default/files/uploads/vim-nerdtree.jpg (NERDTree plugin)
|
||||
[7]: https://github.com/junegunn/vim-plug
|
@ -0,0 +1,69 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (10 Grafana features you need to know for effective monitoring)
|
||||
[#]: via: (https://opensource.com/article/20/2/grafana-features)
|
||||
[#]: author: (Daniel Lee https://opensource.com/users/daniellee)
|
||||
|
||||
10 Grafana features you need to know for effective monitoring
|
||||
======
|
||||
Learn how to make the most of this open source dashboard tool.
|
||||
![metrics and data shown on a computer screen][1]
|
||||
|
||||
The [Grafana][2] project [started in 2013][3] when [Torkel Ödegaard][4] decided to fork Kibana and turn it into a time-series and graph-focused dashboarding tool. His guiding vision: to make everything look more clean and elegant, with fewer things distracting you from the data.
|
||||
|
||||
More than 500,000 active installations later, Grafana dashboards are ubiquitous and instantly recognizable. (Even during a [SpaceX launch][5]!)
|
||||
|
||||
Whether you're a recent adopter or an experienced power user, you may not be familiar with all of the features that [Grafana Labs][6]—the company formed to accelerate the adoption of the Grafana project and to build a sustainable business around it—and the Grafana community at large have developed over the past 6+ years.
|
||||
|
||||
Here's a look at some of the most impactful:
|
||||
|
||||
1. **Dashboard templating**: One of the key features in Grafana, templating allows you to create dashboards that can be reused for lots of different use cases. Values aren't hard-coded with these templates, so for instance, if you have a production server and a test server, you can use the same dashboard for both. Templating allows you to drill down into your data, say, from all data to North America data, down to Texas data, and beyond. You can also share these dashboards across teams within your organization—or if you create a great dashboard template for a popular data source, you can contribute it to the whole community to customize and use.
|
||||
2. **Provisioning**: While it's easy to click, drag, and drop to create a single dashboard, power users in need of many dashboards will want to automate the setup with a script. You can script anything in Grafana. For example, if you're spinning up a new Kubernetes cluster, you can also spin up a Grafana automatically with a script that would have the right server, IP address, and data sources preset and locked. It's also a way of getting control over a lot of dashboards.
|
||||
3. **Annotations:** This feature, which shows up as a graph marker in Grafana, is useful for correlating data in case something goes wrong. You can create the annotations manually—just control-click on a graph and input some text—or you can fetch data from any data source. (Check out how Wikimedia uses annotations on its [public Grafana dashboard][7], and here is [another example][8] from the OpenHAB community.) A good example is if you automatically create annotations around releases, and a few hours after a new release, you start seeing a lot of errors, then you can go back to your annotation and correlate whether the errors started at the same time as the release. This automation can be achieved using the Grafana HTTP API (see examples [here][9] and [here][10]). Many of Grafana's largest customers use the HTTP API for a variety of tasks, particularly setting up databases and adding users. It's an alternative to provisioning for automation, and you can do more with it. For instance, the team at DigitalOcean used the API to integrate a [snapshot feature for reviewing dashboards][11].
|
||||
4. **Kiosk mode and playlists:** If you want to display your Grafana dashboards on a TV monitor, you can use the playlist feature to pick the dashboards that you or your team need to look at through the course of the day and have them cycle through on the screen. The [kiosk mode][12] hides all the user interface elements that you don't need in view-only mode. Helpful hint: The [Grafana Kiosk][13] utility handles logging in, switching to kiosk mode, and opening a playlist—eliminating the pain of logging in on a TV that has no keyboard.
|
||||
5. **Custom plugins:** Plugins allow you to extend Grafana with integrations with other tools, different visualizations, and more. Some of the most popular in the community are [Worldmap Panel][14] (for visualizing data on top of a map), [Zabbix][15] (an integration with Zabbix metrics), and [Influx Admin Panel][16] (which offers other functionality like creating databases or adding users). But they're only the tip of the iceberg. Just by writing a bit of code, you can get anything that produces a timestamp and a value visualized in Grafana. Plus, Grafana Enterprise customers have access to more plugins for integrations with Splunk, Datadog, New Relic, and others.
|
||||
6. **Alerting and alert hooks:** If you're using Grafana alerting, you can have alerts sent through a number of different notifiers, including PagerDuty, SMS, email, or Slack. Alert hooks allow you to create different notifiers with a bit of code if you prefer some other channels of communication.
|
||||
7. **Permissions and teams**: When organizations have one Grafana and multiple teams, they often want the ability to both keep things separate and share dashboards. Early on, the default in Grafana was that everybody could see everyone else's dashboards, and that was it. Later, Grafana introduced multi-tenant mode, in which you can switch organizations but can't share dashboards. Some people were using huge hacks to enable both, so Grafana decided to officially create an easier way to do this. Now you can create a team of users and then set permissions on folders, dashboards, and down to the data source level if you're using Grafana Enterprise.
|
||||
8. **SQL data sources:** Grafana's native support for SQL helps you turn anything—not just metrics—in an SQL database into metric data that you can graph. Power users are using SQL data sources to do a whole bunch of interesting things, like creating business dashboards that "make sense for your boss's boss," as the team at Percona put it. Check out their [presentation at GrafanaCon][17].
|
||||
9. **Monitoring your monitoring**: If you're serious about monitoring and you want to monitor your own monitoring, Grafana has its own Prometheus HTTP endpoint that Prometheus can scrape. It's quite simple to get dashboards and statics. There's also an enterprise version in development that will offer Google Analytics-style easy access to data, such as how much CPU your Grafana is using or how long alerting is taking.
|
||||
10. **Authentication**: Grafana supports different authentication styles, such as LDAP and OAuth, and allows you to map users to organizations. In Grafana Enterprise, you can also map users to teams: If your company has its own authentication system, Grafana allows you to map the teams in your internal systems to teams in Grafana. That way, you can automatically give people access to the dashboards designated for their teams.
|
||||
|
||||
|
||||
|
||||
Want to take a deeper dive? Join the [Grafana community][18], check out the [how-to section][19], and share what you think.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/grafana-features
|
||||
|
||||
作者:[Daniel Lee][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/daniellee
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen)
|
||||
[2]: https://github.com/grafana/grafana
|
||||
[3]: https://grafana.com/blog/2019/09/03/the-mostly-complete-history-of-grafana-ux/
|
||||
[4]: https://grafana.com/author/torkel
|
||||
[5]: https://youtu.be/ANv5UfZsvZQ?t=29
|
||||
[6]: https://grafana.com/
|
||||
[7]: https://grafana.wikimedia.org/d/000000143/navigation-timing?orgId=1&refresh=5m
|
||||
[8]: https://community.openhab.org/t/howto-create-annotations-in-grafana-via-rules/48929
|
||||
[9]: https://docs.microsoft.com/en-us/azure/devops/service-hooks/services/grafana?view=azure-devops
|
||||
[10]: https://medium.com/contentsquare-engineering-blog/from-events-to-grafana-annotation-f35aafe8bd3d
|
||||
[11]: https://youtu.be/kV3Ua6guynI
|
||||
[12]: https://play.grafana.org/d/vmie2cmWz/bar-gauge?orgId=1&refresh=10s&kiosk
|
||||
[13]: https://github.com/grafana/grafana-kiosk
|
||||
[14]: https://grafana.com/grafana/plugins/grafana-worldmap-panel
|
||||
[15]: https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app
|
||||
[16]: https://grafana.com/grafana/plugins/natel-influx-admin-panel
|
||||
[17]: https://www.youtube.com/watch?v=-xlchgoqkqY
|
||||
[18]: https://community.grafana.com/
|
||||
[19]: https://community.grafana.com/c/howto/6
|
124
sources/tech/20200218 Getting started with OpenTaxSolver.md
Normal file
124
sources/tech/20200218 Getting started with OpenTaxSolver.md
Normal file
@ -0,0 +1,124 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Getting started with OpenTaxSolver)
|
||||
[#]: via: (https://opensource.com/article/20/2/do-your-taxes-open-source-way)
|
||||
[#]: author: (Jessica Cherry https://opensource.com/users/jrepka)
|
||||
|
||||
Getting started with OpenTaxSolver
|
||||
======
|
||||
If you're a United States citizen, learn how to do your own state tax
|
||||
returns with OpenTaxSolver.
|
||||
![A document flying away][1]
|
||||
|
||||
OpenTaxSolver is an open source application for US taxpayers to calculate their state and federal income tax returns. Before I get into the software, I want to share some of the information I learned when researching this article. I spent about five hours a day for a week looking into open source options for doing your taxes, and I learned about a lot more than just tax software.
|
||||
|
||||
The Internal Revenue Service's (IRS's) [Use of federal tax information (FTI) in open source software][2] webpage offers a large amount of information, and it's especially relevant to anyone who may want to start their own open source tax software project. To hit the finer points:
|
||||
|
||||
* Federal tax information (FTI) can be used in any open source software
|
||||
* Software creators mush follow all security laws and compliance requirements
|
||||
* Any such software must be supported either by a vendor or a community
|
||||
* The software must be approved by the federal government
|
||||
|
||||
|
||||
|
||||
One other reason researching this topic was rather difficult (but ultimately rewarding) is that, by federal law, the major tax software companies are required to provide their services for free to any person earning under $69,000 per year. About 70% of Americans fit into this category, and if you are one of them, you can check the IRS's [Free File][3] webpage for links to free filing software from well-known companies. (The IRS reminds you that "you are responsible for determining your eligibility for one of the Free File Online offers.")
|
||||
|
||||
Please share this information broadly—knowledge is power, and not everyone can (or wants to) use open source software to do their taxes for reasons including:
|
||||
|
||||
* Lack of computer or software access
|
||||
* Low computer competence
|
||||
* Age or disability
|
||||
* Discomfort with doing taxes
|
||||
|
||||
|
||||
|
||||
If you don't fall into any of these categories and want to do your taxes the open source way, continue reading to learn about OpenTaxSolver.
|
||||
|
||||
### About OpenTaxSolver
|
||||
|
||||
[OpenTaxSolver][4] is meant to be used with the IRS's [tax booklet][5], which is published yearly. This booklet provides detailed information for doing your taxes, such as rules around tax credits and write-offs.
|
||||
|
||||
OpenTaxSolver cuts down on tax calculations when you fill out your tax forms and simplifies the hardest part of doing your taxes: the math. You still have to fill in your data and turn the paperwork in, but using the software means you can do it in about half of the time. Since OpenTaxSolver is running in beta, you have to double-check all of your number entries and information against the official IRS tax booklet after you use the software.
|
||||
|
||||
### Download and install OpenTaxSolver
|
||||
|
||||
First, [download the software][6]. There are versions for Linux, Windows, and macOS. If you're using one of the latter two, refer to the download page for installation instructions. I'm using my go-to operating system, Ubuntu Linux, which I installed by:
|
||||
|
||||
1. Downloading the TGZ file from the website
|
||||
2. Extracting it to my desktop (but you can choose any location on your computer)
|
||||
3. Clicking on **Run_taxsolve_GUI**
|
||||
|
||||
|
||||
|
||||
![OpenTaxSolver installation][7]
|
||||
|
||||
### Enter your tax data
|
||||
|
||||
I'll walk through this example using random numbers (for obvious reasons). This walkthrough will explain how do federal taxes with OpenTaxSolver, but if you have to pay state taxes, do that before you begin your federal return.
|
||||
|
||||
To do the common Federal 1040 tax return, select **US 1040**, click **Start New Return**, and start answering some basic questions about your tax situation. For this example, I selected the following itemized deductions: mortgage interest, donations, and some random itemizable write-offs. If you don't know what these are or what may apply to you, head over to the IRS website or google "itemizable write-offs."
|
||||
|
||||
Next, begin entering the data from your tax documents.
|
||||
|
||||
![OpenTaxSolver][8]
|
||||
|
||||
![OpenTaxSolver][9]
|
||||
|
||||
After you finish entering all your data and filling out the entire form, save it by clicking the **Save** button, and then click **Compute Tax** on the bottom of the screen.
|
||||
|
||||
![OpenTaxSolver][10]
|
||||
|
||||
### Check your return and file your taxes
|
||||
|
||||
If you made any mistakes (such as mistyping something or putting an incorrect value in any field), it will show an error on the bottom of the preview after the computation finishes.
|
||||
|
||||
![OpenTaxSolver preview][11]
|
||||
|
||||
The preview also reports your marginal tax rate and what percentage of your income you are paying in taxes.
|
||||
|
||||
![OpenTaxSolver preview][12]
|
||||
|
||||
After you review the information in the preview, make any corrections, and finish your return, click **Fill-out PDF Forms**, and it will provide printable tax forms with all of your information filled in.
|
||||
|
||||
![Tax return][13]
|
||||
|
||||
If you entered your name, address, and social security number when entering your data, all of that information will also appear in the right places on the form. Double-check everything, print it, and mail your tax return to the IRS.
|
||||
|
||||
### Final notes
|
||||
|
||||
OpenTaxSolver gives you the opportunity to file your own federal and state taxes. As always, with any federal related tax information (or federal anything, for that matter), always double-check and use due diligence. I found this software very useful for expanding my knowledge about my taxes.
|
||||
|
||||
The OpenTaxSolver website includes a request for contributors, so if you want to start contributing to an open source project that helps everyone, this is one I'd definitely suggest.
|
||||
|
||||
And if you're someone who likes to wait until the last minute to pay your taxes, this [clock][14] tells you how much time you have until your taxes are due.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/do-your-taxes-open-source-way
|
||||
|
||||
作者:[Jessica Cherry][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/jrepka
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_odf_1109ay.png?itok=4CqrPAjt (A document flying away)
|
||||
[2]: https://www.irs.gov/privacy-disclosure/use-of-federal-tax-information-fti-in-open-source-software
|
||||
[3]: https://apps.irs.gov/app/freeFile/
|
||||
[4]: http://opentaxsolver.sourceforge.net/index.html
|
||||
[5]: https://www.irs.gov/pub/irs-pdf/i1040gi.pdf
|
||||
[6]: http://opentaxsolver.sourceforge.net/download2019.html?button=+Download+OTS+
|
||||
[7]: https://opensource.com/sites/default/files/uploads/tax2.png (OpenTaxSolver installation)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/tax1.png (OpenTaxSolver)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/tax7.png (OpenTaxSolver)
|
||||
[10]: https://opensource.com/sites/default/files/uploads/tax6.png (OpenTaxSolver)
|
||||
[11]: https://opensource.com/sites/default/files/uploads/tax3.png (OpenTaxSolver preview)
|
||||
[12]: https://opensource.com/sites/default/files/uploads/tax4.png (OpenTaxSolver preview)
|
||||
[13]: https://opensource.com/sites/default/files/uploads/tax5.png (Tax return)
|
||||
[14]: https://countdown.onlineclock.net/countdowns/taxes/
|
229
sources/tech/20200218 How to embed Twine stories in WordPress.md
Normal file
229
sources/tech/20200218 How to embed Twine stories in WordPress.md
Normal file
@ -0,0 +1,229 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to embed Twine stories in WordPress)
|
||||
[#]: via: (https://opensource.com/article/20/2/embed-twine-wordpress)
|
||||
[#]: author: (Roman Lukš https://opensource.com/users/romanluks)
|
||||
|
||||
How to embed Twine stories in WordPress
|
||||
======
|
||||
Share your Twine 2 interactive stories on your WordPress site with the
|
||||
Embed Twine plugin.
|
||||
![Person drinking a hat drink at the computer][1]
|
||||
|
||||
From the very beginning, I wanted the "About me" page on my WordPress website [romanluks.eu][2] to be interactive.
|
||||
|
||||
At first, I experimented with Dart, a programming language developed by Google that transcompiles into JavaScript. I killed the project when I realized I was making a game instead of an "About me" page.
|
||||
|
||||
A bit later, I discovered [Twine][3], an open source tool for creating interactive stories. It reminded me of the gamebooks I loved as a kid. It's so easy to create interconnected pieces of text in Twine, and it's ideal for the interview-like format I was aiming for. Because Twine publishes directly to HTML, you can do a lot of interesting things with it—including creating [interactive fiction][4] and [adventure games][5] or publishing stories on a blog or website.
|
||||
|
||||
### Early struggles
|
||||
|
||||
I created my "About me" page in Twine and tried to paste it into my WordPress page.
|
||||
|
||||
"No, can do," said WordPress and Twine.
|
||||
|
||||
You see, a Twine story exported from Twine is just a webpage (i.e., a file in HTML format). However, it not only includes HTML but JavaScript code, as well. And somehow it doesn't work when you simply try to copy-paste the contents. I tried copy-pasting just the body of the Twine story page without success.
|
||||
|
||||
I thought, "I guess I need to add that JavaScript code separately," and I tried custom fields.
|
||||
|
||||
Nope.
|
||||
|
||||
I took a break from my investigation. I just uploaded my "About me" Twine story via FTP and linked to it from my website's menu. People could visit it and interact with the story, however, there was no menu, and it didn't feel like a part of my website. I had made a trap for myself. It made me realize I really _really_ wanted my "About me" included directly on my website.
|
||||
|
||||
### DIY embed
|
||||
|
||||
I took a stab at the problem and came up with [this solution][6].
|
||||
|
||||
It worked. It wasn't perfect, but it worked.
|
||||
|
||||
But it wasn't _perfect_. Is there a better way? There is bound to be a better way…
|
||||
|
||||
It cost me a couple of pulled hairs, but I managed to get a [responsive iframe and autoscroll][7].
|
||||
|
||||
It was way better. I was proud of myself and shared it on [Reddit][8].
|
||||
|
||||
### The road to Embed Twine
|
||||
|
||||
Suddenly, an idea! What if, instead of following my tutorial, people could use a WordPress plugin?
|
||||
|
||||
They would only have to give the plugin a Twine story, and it would take care of the rest. Hassle-free. No need to copy-paste any JavaScript code.
|
||||
|
||||
Wouldn't that be glorious?!?
|
||||
|
||||
I had no idea how WordPress plugins work. I only knew they are written in PHP. A while back, I had part-time work as a PHP developer, and I remembered the basics.
|
||||
|
||||
### Containers and WordPress
|
||||
|
||||
I mentioned my idea to a friend, and he suggested I could use containers as my WordPress development environment.
|
||||
|
||||
In the past, I'd always used [XAMPP][9], but I wanted to try containers for a while.
|
||||
|
||||
No problem, I thought! I'll learn containers while I learn how to make a WordPress plugin and revive my PHP skills. That should be sufficiently stimulating.
|
||||
|
||||
And it was.
|
||||
|
||||
I can't recall how many times I stopped, removed, and rebuilt my containers. I had to use the command line. And the file permissions are painful.
|
||||
|
||||
Oh boy! It was like playing a game that you enjoy playing even though it makes you fairly angry. It was challenging but rewarding.
|
||||
|
||||
I found out that it's very easy to create a simple WordPress plugin:
|
||||
|
||||
* Write the source code
|
||||
* Save it in the WP plugin directory
|
||||
* Test it
|
||||
* Repeat
|
||||
|
||||
|
||||
|
||||
Containers make it easy to use a specific environment and are easy to clean up when you screw up and need to start over.
|
||||
|
||||
Using Git saved me from accidentally wiping out my entire codebase. I used [Sourcetree][10] as my Git user interface. Initially, I wrote my code in [Notepad++][11], but when I divided my code into multiple files, I switched to [Atom][12]. It's such a cool editor for geeks. Using it feels like the code writes itself.
|
||||
|
||||
### Intermission
|
||||
|
||||
So what do we know so far?
|
||||
|
||||
* I wanted an interactive "About me" page
|
||||
* I created an "About me" story in Twine
|
||||
* Twine exports webpages (as HTML files with JavaScript included)
|
||||
* WP plugins are easy to make
|
||||
* Containers are awesome
|
||||
|
||||
|
||||
|
||||
### Embed Twine is born
|
||||
|
||||
I wanted an easy way to embed Twine stories into WordPress. So, I used the power of software development, fooled around with containers, wrote a bit of PHP code, and published the result as a WordPress plugin called [Embed Twine][13].
|
||||
|
||||
### Install the plugin
|
||||
|
||||
1. Upload the plugin [files][14] to the **/wp-content/plugins/plugin-name** directory, or install the plugin through the WordPress Plugins screen.
|
||||
2. Activate the plugin through the Plugins screen in WordPress.
|
||||
|
||||
|
||||
|
||||
### Use the plugin
|
||||
|
||||
After you've installed the Embed Twine plugin and created a Twine 2 story, embed it in your WordPress site:
|
||||
|
||||
1. Export your Twine 2 story into an HTML file.
|
||||
2. Upload it via the plugin's interface.
|
||||
3. Insert the shortcode into the page or post.
|
||||
4. Enjoy your embedded story.
|
||||
|
||||
|
||||
|
||||
The plugin also provides autoscroll functionality to make it easy for users to navigate through your stories.
|
||||
|
||||
### Configure the plugin
|
||||
|
||||
The plugin is configurable via shortcode parameters. To use the shortcode, simply put **[embed_twine]** into your post.
|
||||
|
||||
You can use additional parameters in the format **[embed_twine story="Story" aheight=112 autoscroll=true ascroll=100]** as follows:
|
||||
|
||||
* **story:** Specify the story name (the filename without an extension).
|
||||
* If the story parameter is omitted, it defaults to "Story." This means there is no need to use this parameter if your Twine filename is Story.html.
|
||||
* If you upload a Twine story called MyFooBar.html, use the shortcode: **[embed_twine story="MyFooBar"]**.
|
||||
* **aheight:** Use this parameter to adjust the iframe's height. You might need to tweak **aheight** to get rid of an iframe scrollbar. The default value is 112; this value is added to the iframe height and used to set the iframe's **style.height**.
|
||||
* **autoscroll:** Autoscroll is enabled by default. You can turn it off with shortcode parameter **[embed_twine autoscroll=false]**.
|
||||
* **ascroll:** Use this to adjust the default position for autoscroll. The default value is 100; this value is subtracted from the iframe's top position and fed into JavaScript method **window.scrollTo()**.
|
||||
|
||||
|
||||
|
||||
### Known bugs
|
||||
|
||||
Currently, Twine passages that include images might report their height incorrectly, and the scrollbar might show up for these passages. Tweak the shortcode parameter **aheight** to get rid of them.
|
||||
|
||||
### The script
|
||||
|
||||
|
||||
```
|
||||
1 <?php
|
||||
2
|
||||
3 /**
|
||||
4 * Plugin Name: Embed Twine
|
||||
5 * Description: Insert Twine stories into WordPress
|
||||
6 * Version: 0.0.6
|
||||
7 * Author: Roman Luks
|
||||
8 * Author URI: <https://romanluks.eu/>
|
||||
9 * License: GPLv2 or later
|
||||
10 */
|
||||
11
|
||||
12 require_once('include/embed-twine-load-file.php');
|
||||
13 require_once('include/embed-twine-parent-page.php');
|
||||
14 require_once('include/embed-twine-process-story.php');
|
||||
15
|
||||
16 // Add plugin to WP menu
|
||||
17 function embed_twine_customplugin_menu() {
|
||||
18
|
||||
19 add_menu_page("Embed Twine", "Embed Twine","manage_options", __FILE__, "embed_twine_uploadfile");
|
||||
20 }
|
||||
21
|
||||
22 add_action("admin_menu", "embed_twine_customplugin_menu");
|
||||
23
|
||||
24 function embed_twine_uploadfile(){
|
||||
25 include "include/embed-twine-upload-file.php";
|
||||
26 }
|
||||
27
|
||||
28 // Add shortcode
|
||||
29 function embed_twine_shortcodes_init()
|
||||
30 {
|
||||
31 function embed_twine_shortcode($atts = [], $content = null)
|
||||
32 {
|
||||
33 // Attributes
|
||||
34 $atts = shortcode_atts(
|
||||
35 [array][15](
|
||||
36 'story' => 'Story',
|
||||
37 'aheight' => 112, //adjust for style.height (30) and margins of tw-story (2x41)
|
||||
38 'autoscroll' => true, //autoscroll enabled by default
|
||||
39 'ascroll' => 100, //adjust for autoscroll
|
||||
40 ),
|
||||
41 $atts,
|
||||
42 'embed_twine'
|
||||
43 );
|
||||
44
|
||||
45 $content = embed_twine_buildParentPage($atts['story'], $atts['aheight'], $atts['autoscroll'], $atts['ascroll']);
|
||||
46
|
||||
47 return $content;
|
||||
48 }
|
||||
49 add_shortcode('embed_twine', 'embed_twine_shortcode');
|
||||
50 }
|
||||
51 add_action('init', 'embed_twine_shortcodes_init');
|
||||
```
|
||||
|
||||
* * *
|
||||
|
||||
_This article is adapted from [Roman Luks' blog][16] and [Embed Twine][13] page on WordPress plugins._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/embed-twine-wordpress
|
||||
|
||||
作者:[Roman Lukš][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/romanluks
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer)
|
||||
[2]: https://romanluks.eu/
|
||||
[3]: https://twinery.org/
|
||||
[4]: https://opensource.com/article/18/7/twine-vs-renpy-interactive-fiction
|
||||
[5]: https://opensource.com/article/18/2/twine-gaming
|
||||
[6]: https://romanluks.eu/blog/how-to-embed-twine-on-your-wordpress-website/
|
||||
[7]: https://romanluks.eu/blog/how-to-embed-twine-on-your-wordpress-website-with-responsive-iframe-and-autoscroll/
|
||||
[8]: https://www.reddit.com/r/twinegames/comments/dtln4z/how_to_embed_twine_on_your_wordpress_website_with/
|
||||
[9]: https://en.wikipedia.org/wiki/XAMPP
|
||||
[10]: https://www.sourcetreeapp.com/
|
||||
[11]: https://notepad-plus-plus.org/
|
||||
[12]: https://atom.io/
|
||||
[13]: https://wordpress.org/plugins/embed-twine/
|
||||
[14]: https://plugins.trac.wordpress.org/browser/embed-twine/
|
||||
[15]: http://www.php.net/array
|
||||
[16]: https://romanluks.eu/blog/embed-twine-wordpress-plugin/
|
@ -0,0 +1,168 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Basic Vim Commands You Need to Know to Work in Vim Editor)
|
||||
[#]: via: (https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
Basic Vim Commands You Need to Know to Work in Vim Editor
|
||||
======
|
||||
|
||||
If you are a system administrator or developer, you may need to edit a file while working on the Linux terminal.
|
||||
|
||||
There are several file editors on Linux, and how to choose the right one for your needs.
|
||||
|
||||
I would like to recommend Vim editor.
|
||||
|
||||
### You may ask, why?
|
||||
|
||||
You may spend more time in the editor to modify an existing file than writing new text.
|
||||
|
||||
In this case, Vim Keyboard shortcuts allow you to efficiently meet your needs.
|
||||
|
||||
The following articles may help you learn about file and directory manipulation.
|
||||
|
||||
* [**L**][1]**[inux Basic – Linux and Unix Commands for File and Directory Manipulation][1]**
|
||||
* **[10 Methods to View Different File Formats in Linux][2]**
|
||||
|
||||
|
||||
|
||||
### What’s vim?
|
||||
|
||||
Vim is one of the most popular and powerful text editor that widely used by Linux administrators and developers.
|
||||
|
||||
It’s highly configurable text editor which enables efficient text editing. This is an updated version of the vi editor, which is already installed on most Unix systems.
|
||||
|
||||
Vim is often called a “programmer’s editor,” but it is not limited to it, and is suitable for all types of text editing.
|
||||
|
||||
It comes with many features like multi level undo, multi windows and buffers, syntax highlighting, command line editing, file name completion, visual selection.
|
||||
|
||||
You can easily obtain online help with the “:help” command.
|
||||
|
||||
### Understanding Vim Modes
|
||||
|
||||
Vim has two modes, the details are below:
|
||||
|
||||
**Command Mode:** When you launch Vim Editor, you will default to Command Mode. You can move around the file, and modify some parts of the text, cut, copy, and paste parts of the text and issue commands to do more (press ESC for Command Mode).
|
||||
|
||||
**Insert Mode:** The nsert mode is used to type text in a given given document (Press i for insert mode).
|
||||
|
||||
### How do I know which Vim mode I am on?
|
||||
|
||||
If you are in insert mode, you will see **“INSERT”** at the bottom of the editor. If nothing is shown, or if it shows the file name at the bottom of the editor, you are in “Command Mode”.
|
||||
|
||||
### Cursor Movement in Normal Mode
|
||||
|
||||
These Vim keyboard shortcuts allow you to move your cursor around a file in different ways.
|
||||
|
||||
* `G` – Go to the last line of the file
|
||||
* `gg` – Go to the first line of the file
|
||||
* `$` – Go to the end of line.
|
||||
* `0` (zero) – Go to the beginning of line.
|
||||
|
||||
|
||||
* `w` – Jump by start of words
|
||||
* `W` – Jump by words (spaces separate words)
|
||||
* `b` – Jump backward by words
|
||||
* `B` – Jump backward by words (spaces separate words)
|
||||
|
||||
|
||||
* `PgDn` Key – Move down page-wise
|
||||
* `PgUp` Key – Move up page-wise
|
||||
* `Ctrl+d` – Move half-page down
|
||||
* `Ctrl+u` – Move half-page up
|
||||
|
||||
|
||||
|
||||
### Insert mode – insert a text
|
||||
|
||||
These vim keyboard shortcuts allows you to insert a cursor in varies position based on your needs.
|
||||
|
||||
* `i` – Insert before the cursor
|
||||
* `a` – Insert after the cursor
|
||||
* `I` – Insert at the beginning of the line, this is useful when you are in the middle of the line.
|
||||
* `A` – Insert at the end of the line
|
||||
* `o` – Open a new line below the current line
|
||||
* `O` – Append a new line above the current line
|
||||
* `ea` – Insert at the end of the word
|
||||
|
||||
|
||||
|
||||
### Copy, Paste and Delete a Line
|
||||
|
||||
* `yy` – yank (copy) a line
|
||||
* `p/P` – Paste after cursor/ put before cursor
|
||||
* `dd` – delete a line
|
||||
* `dw` – delete the word
|
||||
|
||||
|
||||
|
||||
### Search and Replace Pattern in Vim
|
||||
|
||||
* `/pattern` – To search a given pattern
|
||||
* `?pattern` – To search backward a given pattern
|
||||
* `n` – To repeat search
|
||||
* `N` – To repeat backward search
|
||||
|
||||
|
||||
* `:%s/old-pattern/new-pattern/g` – Replace all old formats with the new format across the file.
|
||||
* `:s/old-pattern/new-pattern/g` – Replace all old formats with the new format in the current line.
|
||||
* `:%s/old-pattern/new-pattern/gc` – Replace all old formats with the new format across the file with confirmations.
|
||||
|
||||
|
||||
|
||||
### How do I go to a particular line in Vim Editor
|
||||
|
||||
You can do this in two ways, depending on your need. If you don’t know the line number I suggest you go with the first method.
|
||||
|
||||
Add line number by opening a file and running the command below.
|
||||
|
||||
```
|
||||
:set number
|
||||
```
|
||||
|
||||
Once you have set the line number, press **“: n”** to go to the corresponding line number. For example, if you want to go to **line 15**, enter.
|
||||
|
||||
```
|
||||
:15
|
||||
```
|
||||
|
||||
If you already know the line number, use the following method to go directly to the corresponding line. For example, if you want to move to line 20, enter the command below.
|
||||
|
||||
```
|
||||
$ vim +20 [File_Name]
|
||||
```
|
||||
|
||||
### Undo/Redo/Repeat Operation
|
||||
|
||||
* `u` – Undo the changes
|
||||
* `Ctrl+r` – Redo the changes
|
||||
* `.` – Repeat last command
|
||||
|
||||
|
||||
|
||||
### Saving and Exiting Vim
|
||||
|
||||
* `:w` – Save the changes but don’t exit
|
||||
* `:wq` – Write and quit
|
||||
* `:q!` – Force quit
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.2daygeek.com/linux-basic-commands-file-directory-manipulation/
|
||||
[2]: https://www.2daygeek.com/unix-linux-command-to-view-file/
|
@ -0,0 +1,182 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Here Are The Most Beautiful Linux Distributions in 2020)
|
||||
[#]: via: (https://itsfoss.com/beautiful-linux-distributions/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Here Are The Most Beautiful Linux Distributions in 2020
|
||||
======
|
||||
|
||||
It’s a no-brainer that there’s a Linux distribution for every user – no matter what they prefer or what they want to do.
|
||||
|
||||
Starting out with Linux? You can go with the [Linux distributions for beginners][1]. Switching from Windows? You have [Windows-like Linux distributions][2]. Have an old computer? You can [use lightweight Linux distros][3].
|
||||
|
||||
In this list, I’m going to focus only on the most beautiful Linux distros out there.
|
||||
|
||||
### Top 7 Most Beautiful Linux Distributions
|
||||
|
||||
![][4]
|
||||
|
||||
Wait! Is there a thing called a beautiful Linux distribution? Is it not redundant considering the fact that you can customize the looks of any distribution and make it look better with [themes][5] and [icons][6]?
|
||||
|
||||
You are right about that. But here, I am talking about the distributions that look great without any tweaks and customization effort from the user’s end. These distros provide a seamless, pleasant desktop experience right out of the box.
|
||||
|
||||
**Note:** _The list is in no particular order of ranking._
|
||||
|
||||
#### 1\. elementary OS
|
||||
|
||||
![][7]
|
||||
|
||||
elementary OS is one of the most beautiful Linux distros out there. It leans on a macOS-ish look while providing a great user experience for Linux users. If you’re already comfortable macOS – you will have no problem using the elementary OS.
|
||||
|
||||
Also, elementary OS is based on Ubuntu – so you can easily find plenty of applications to get things done.
|
||||
|
||||
Not just limited to the look and feel – but the elementary OS is always hard at work to introduce meaningful changes. So, you can expect the user experience to improve with every update you get.
|
||||
|
||||
[elementary OS][8]
|
||||
|
||||
#### 2\. Deepin
|
||||
|
||||
![][9]
|
||||
|
||||
Deepin is yet another beautiful Linux distro originally based on Debian’s stable branch. The animations (look and feel) could be too overwhelming for some – but it looks pretty.
|
||||
|
||||
It features its own Deepin Desktop Environment that involves a mix of essential features for the best user experience possible. It may not exactly resemble the UI of any other distribution but it’s quite easy to get used to.
|
||||
|
||||
My personal attention would go to the control center and the color scheme featured in Deepin OS. You can give it a try – it’s worth taking a look.
|
||||
|
||||
[Deepin][10]
|
||||
|
||||
#### 3\. Pop!_OS
|
||||
|
||||
![][11]
|
||||
|
||||
Pop!_OS manages to offer a great UI on top of Ubuntu while offering a pure [GNOME][12] experience.
|
||||
|
||||
It also happens to be my personal favorite which I utilize as my primary desktop OS. Pop!_OS isn’t flashy – nor involves any fancy animations. However, they’ve managed to get things right by having a perfect combo of icon/themes – while polishing the user experience from a technical point of view.
|
||||
|
||||
I don’t want to initiate a [Ubuntu vs Pop OS][13] debate but if you’re used to Ubuntu, Pop!_OS can be a great alternative for potentially better user experience.
|
||||
|
||||
[Pop!_OS][14]
|
||||
|
||||
#### 4\. Manjaro Linux
|
||||
|
||||
![][15]
|
||||
|
||||
Manjaro Linux is an [Arch][16]-based Linux distribution. While [installing Arch Linux][17] is a slightly complicated job, Manjaro provides an easier and smoother Arch experience.
|
||||
|
||||
It offers a variety of [desktop environment editions][18] to choose from while downloading. No matter what you choose, you still get enough options to customize the look and feel or the layout.
|
||||
|
||||
To me, it looks quite fantastic for an Arch-based distribution that works out of the box – you can give it a try!
|
||||
|
||||
[Manjaro Linux][19]
|
||||
|
||||
#### 5\. KDE Neon
|
||||
|
||||
![][20]
|
||||
|
||||
[KDE Neon][21] is for the users who want a simplified approach to the design language but still get a great user experience.
|
||||
|
||||
It is a lightweight Linux distro which is based on Ubuntu. As the name suggests, it features the KDE Plasma desktop and looks absolutely beautiful.
|
||||
|
||||
KDE Neon gives you the latest and greatest KDE Plasma desktop and KDE applications. Unlike [Kubuntu][22] or other KDE-based distributions, you don’t have to wait for months to get the new [KDE software][23].
|
||||
|
||||
You get a lot of customization options built-in with the KDE desktop – so feel free to try it out!
|
||||
|
||||
[KDE Neon][24]
|
||||
|
||||
#### 6\. Zorin OS
|
||||
|
||||
![][25]
|
||||
|
||||
Without a doubt, Zorin OS is an impressive Linux distro that manages to provide a good user experience – even with its lite edition.
|
||||
|
||||
You can try either the full version or the lite edition (with [Xfce desktop][26]). The UI is tailored for Windows and macOS users to get used to. While based on Ubuntu, it provides a great user experience with what it has to offer.
|
||||
|
||||
If you start like its user interface – you can also try [Zorin Grid][27] to manage multiple computers running Zorin OS at your workplace/home. With the ultimate edition, you can also control the layout of your desktop (as shown in the image above).
|
||||
|
||||
[Zorin OS][28]
|
||||
|
||||
#### 7\. Nitrux OS
|
||||
|
||||
![][29]
|
||||
|
||||
[Nitrux OS][30] is a unique take on a Linux distribution which is somewhat based on Ubuntu – but not completely.
|
||||
|
||||
It focuses on providing a good user experience to the users who are looking for a unique design language with a fresh take on a Linux distro. It uses Nomad desktop which is based on KDE.
|
||||
|
||||
Nitrux encourages to use of [AppImage][31] for applications. But you can also use Arch Linux’s pacman package manager in Nitrux which is based on Ubuntu. Awesome, isn’t it?
|
||||
|
||||
Even if it’s not the perfect OS to have installed (yet), it sure looks pretty and good enough for most of the basic tasks. You can also know more about it when you read our [interview with Nitrux’s founder][32].
|
||||
|
||||
Here’s a slightly old video of Nitrux but it still looks good:
|
||||
|
||||
[Nitrux OS][33]
|
||||
|
||||
#### Bonus: eXtern OS (in ‘stagnated’ development)
|
||||
|
||||
![][34]
|
||||
|
||||
If you want to try an experimental Linux distro, extern OS is going to be beautiful.
|
||||
|
||||
It isn’t actively maintained and should not be used for production systems. Yet, it provides unique user experience (thought not polished enough).
|
||||
|
||||
Just for the sake of trying a good-looking Linux distro, you can give it a try to experience it.
|
||||
|
||||
[eXtern OS][35]
|
||||
|
||||
**Wrapping Up**
|
||||
|
||||
Now, as the saying goes, beauty lies in the eyes of the beholder. So this list of beautiful Linux distributions is from my point of view. Feel free to disagree (politely of course) and mention your favorites.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/beautiful-linux-distributions/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/best-linux-beginners/
|
||||
[2]: https://itsfoss.com/windows-like-linux-distributions/
|
||||
[3]: https://itsfoss.com/lightweight-linux-beginners/
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/beautiful-linux-distros.png?ssl=1
|
||||
[5]: https://itsfoss.com/best-gtk-themes/
|
||||
[6]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/
|
||||
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/elementary-os-hera.png?ssl=1
|
||||
[8]: https://elementary.io/
|
||||
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/deepin-screenshot.jpg?ssl=1
|
||||
[10]: https://www.deepin.org/en/
|
||||
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/pop-os-stock.jpg?ssl=1
|
||||
[12]: https://www.gnome.org/
|
||||
[13]: https://itsfoss.com/pop-os-vs-ubuntu/
|
||||
[14]: https://system76.com/pop
|
||||
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/manjaro_kde.jpg?ssl=1
|
||||
[16]: https://en.wikipedia.org/wiki/Arch
|
||||
[17]: https://itsfoss.com/install-arch-linux/
|
||||
[18]: https://itsfoss.com/best-linux-desktop-environments/
|
||||
[19]: https://manjaro.org/download/
|
||||
[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-neon-screenshot.jpg?ssl=1
|
||||
[21]: https://itsfoss.com/kde-neon-unveiled/
|
||||
[22]: https://kubuntu.org/
|
||||
[23]: https://kde.org/
|
||||
[24]: https://neon.kde.org/
|
||||
[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/11/zorin-lite-ultimate-appearance.jpg?ssl=1
|
||||
[26]: https://www.xfce.org/
|
||||
[27]: https://itsfoss.com/zorin-grid/
|
||||
[28]: https://zorinos.com/
|
||||
[29]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/nitrux-screenshot.jpg?ssl=1
|
||||
[30]: https://itsfoss.com/nitrux-linux-overview/
|
||||
[31]: https://itsfoss.com/use-appimage-linux/
|
||||
[32]: https://itsfoss.com/nitrux-linux/
|
||||
[33]: https://nxos.org/
|
||||
[34]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/extern-os.png?ssl=1
|
||||
[35]: https://externos.io/
|
@ -0,0 +1,135 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Install Latest Git Version on Ubuntu)
|
||||
[#]: via: (https://itsfoss.com/install-git-ubuntu/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
How to Install Latest Git Version on Ubuntu
|
||||
======
|
||||
|
||||
Installing Git on Ubuntu is very easy. It is available in the [main repository of Ubuntu][1] and you can install it [using the apt command][2] like this:
|
||||
|
||||
```
|
||||
sudo apt install git
|
||||
```
|
||||
|
||||
Easy? Isn’t it?
|
||||
|
||||
There is only a slight little problem (which might not be a problem at all) and that is the version of [Git][3] it installs.
|
||||
|
||||
On an LTS system, the software stability is of upmost importance this is why Ubuntu 18.04 and other distributions often provide older but stable version of a software that is well tested with the distribution release.
|
||||
|
||||
This is why when you check the Git version, you’ll see that it installs a version which is older than the [current Git version available on Git project’s website][4]:
|
||||
|
||||
```
|
||||
[email protected]:~$ git --version
|
||||
git version 2.17.1
|
||||
```
|
||||
|
||||
At the time of writing this tutorial, the version available on its website is 2.25. So how do you install the latest Git on Ubuntu then?
|
||||
|
||||
### Install latest Git on Ubuntu-based Linux distributions
|
||||
|
||||
![][5]
|
||||
|
||||
One way would be to [install from source code][6]. That cool, old school method is not everyone’s cup of tea. Thankfully, there is a [PPA available from Ubuntu Git Maintainers team][7] that you can use to easily install the latest stable Git version.
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:git-core/ppa
|
||||
sudo apt update
|
||||
sudo apt install git
|
||||
```
|
||||
|
||||
Even if you had installed Git using apt previously, it will get updated to the latest stable version.
|
||||
|
||||
```
|
||||
[email protected]:~$ git --version
|
||||
git version 2.25.0
|
||||
```
|
||||
|
||||
The beauty of [using PPA][8] is that if there is a new stable version of Git released, you’ll get it with the system updates. [Just update Ubuntu][9] to get the latest Git stable version.
|
||||
|
||||
Trivia
|
||||
|
||||
Did you know that Git version control system was created by none other than [Linux creator Linus Torvalds][10]?
|
||||
|
||||
### Configure Git [Recommended for developers]
|
||||
|
||||
If you have installed Git for development purposes, you’ll soon start cloning repos, make your changes and commit your change.
|
||||
|
||||
If you try to commit your code, you may see a ‘Please tell me who you are’ error like this:
|
||||
|
||||
```
|
||||
[email protected]:~/compress-pdf$ git commit -m "update readme"
|
||||
|
||||
*** Please tell me who you are.
|
||||
|
||||
Run
|
||||
|
||||
git config --global user.email "[email protected]"
|
||||
git config --global user.name "Your Name"
|
||||
|
||||
to set your account's default identity.
|
||||
Omit --global to set the identity only in this repository.
|
||||
|
||||
fatal: unable to auto-detect email address (got '[email protected](none)')
|
||||
```
|
||||
|
||||
This is because you haven’t configured Git with your personal information which is mandatory.
|
||||
|
||||
As the error already hints, you can set up global Git configuration like this:
|
||||
|
||||
```
|
||||
git config --global user.name "Your Name"
|
||||
git config --global user.email "[email protected]"
|
||||
```
|
||||
|
||||
You can check the Git configuration with this command:
|
||||
|
||||
```
|
||||
git config --list
|
||||
```
|
||||
|
||||
It should show an output like this:
|
||||
|
||||
```
|
||||
[email protected]
|
||||
user.name=abhishek
|
||||
```
|
||||
|
||||
This configuration is stored in ~/.gitconfig file. You may also change it manually to change the configuration.
|
||||
|
||||
* * *
|
||||
|
||||
**In the end…**
|
||||
|
||||
I hope this quick little tutorial helped you to install Git on Ubuntu. With the PPA, you easily get the latest Git version.
|
||||
|
||||
If you have any questions or suggestions, please feel free to ask in the comment section. A quick ‘thank you’ is also welcomed :)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-git-ubuntu/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/ubuntu-repositories/
|
||||
[2]: https://itsfoss.com/apt-command-guide/
|
||||
[3]: https://git-scm.com/
|
||||
[4]: https://git-scm.com/downloads
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/install_git_ubuntu.png?ssl=1
|
||||
[6]: https://itsfoss.com/install-software-from-source-code/
|
||||
[7]: https://launchpad.net/~git-core/+archive/ubuntu/ppa
|
||||
[8]: https://itsfoss.com/ppa-guide/
|
||||
[9]: https://itsfoss.com/update-ubuntu/
|
||||
[10]: https://itsfoss.com/linus-torvalds-facts/
|
@ -0,0 +1,110 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Waterfox: Firefox Fork With Legacy Add-ons Options)
|
||||
[#]: via: (https://itsfoss.com/waterfox-browser/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Waterfox: Firefox Fork With Legacy Add-ons Options
|
||||
======
|
||||
|
||||
_**Brief: In this week’s open source software highlight, we take a look at a Firefox-based browser that supports legacy extensions that Firefox no longer supports while potentially providing fast user experience.**_
|
||||
|
||||
When it comes to web browsers, Google Chrome leads the market share. [Mozilla Firefox is there still providing hopes for a mainstream web browser that respects your privacy][1].
|
||||
|
||||
Firefox has improved a lot lately and one of the side-effects of the improvements is removal of add-ons. If your favorite add-on disappeared in last few months/years, you have a good new in the form of Witerfox.
|
||||
|
||||
Attention!
|
||||
|
||||
It’s been brought to our notice that Waterfox has been acquired by System1. This company also acquired privacy focused search engine Startpage.
|
||||
While System1 claims that they are providing privacy focused products because ‘there is a demand’, we cannot vouch for their claim.
|
||||
In other words, it’s up to you to trust System1 and Waterfox.
|
||||
|
||||
### Waterfox: A Firefox-based Browser
|
||||
|
||||
![Waterfox Classic][2]
|
||||
|
||||
[Waterfox][3] is a useful open-source browser built on top of Firefox that focuses on privacy and supports legacy extensions. It doesn’t pitch itself as a privacy-paranoid browser but it does respect the basics.
|
||||
|
||||
You get two separate Waterfox browser versions. The current edition aims to provide a modern experience and the classic version focuses to support [NPAPI plugins][4] and [bootstrap extensions][5].
|
||||
|
||||
![Waterfox Classic][6]
|
||||
|
||||
If you do not need to utilize bootstrap extensions but rely on [WebExtensions][7], Waterfox Current is the one you should go for.
|
||||
|
||||
And, if you need to set up a browser that needs NPAPI plugins or bootstrap extensions extensively, Waterfox Classic version will be suitable for you.
|
||||
|
||||
So, if you like Firefox, but want to try something different on the same line, this is a Firefox alternative for the job.
|
||||
|
||||
### Features of Waterfox
|
||||
|
||||
![Waterfox Current][8]
|
||||
|
||||
Of course, technically, you should be able to do a lot of things that Mozilla Firefox supports.
|
||||
|
||||
So, I’ll just highlight all the important features of Waterfox in a list here.
|
||||
|
||||
* Supports NPAPI Plugins
|
||||
* Supports Bootstrap Extensions
|
||||
* Offers separate editions for legacy extension support and modern WebExtension support.
|
||||
* Cross-platform support (Windows, Linux, and macOS)
|
||||
* Theme customization
|
||||
* Archived Add-ons supported
|
||||
|
||||
|
||||
|
||||
### Installing Waterfox on Ubuntu/Linux
|
||||
|
||||
Unlike other popular browsers, you don’t get a package to install. So, you will have to download the archived package from its [official download page][9].
|
||||
|
||||
![][10]
|
||||
|
||||
Depending on what edition (Current/Classic) you want – just download the file, which will be **.tar.bz2** extension file.
|
||||
|
||||
Once downloaded, simply extract the file.
|
||||
|
||||
Next, head on to the extracted folder and look for the “**Waterfox**” file. You can simply double-click on it to run start up the browser.
|
||||
|
||||
If that doesn’t work, you can utilize the terminal and navigate to the extracted **Waterfox** folder. Once there, you can simply run it with a single command. Here’s how it looks like:
|
||||
|
||||
```
|
||||
cd waterfox-classic
|
||||
./waterfox
|
||||
```
|
||||
|
||||
In either case, you can also head to its [GitHub page][11] and explore more options to get it installed on your system.
|
||||
|
||||
[Download Waterfox][3]
|
||||
|
||||
**Wrapping up**
|
||||
|
||||
I fired it up on my Pop!_OS 19.10 installation and it worked really well for me. Though I don’t think I could switch from Firefox to Waterfox because I am not using any legacy add-on. It could still be an impressive option for certain users.
|
||||
|
||||
You could give it a try and let me know your thoughts in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/waterfox-browser/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/why-firefox/
|
||||
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-classic.png?fit=800%2C423&ssl=1
|
||||
[3]: https://www.waterfox.net/
|
||||
[4]: https://en.wikipedia.org/wiki/NPAPI
|
||||
[5]: https://wiki.mozilla.org/Extension_Manager:Bootstrapped_Extensions
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-classic-screenshot.jpg?ssl=1
|
||||
[7]: https://wiki.mozilla.org/WebExtensions
|
||||
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-screenshot.jpg?ssl=1
|
||||
[9]: https://www.waterfox.net/download/
|
||||
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/waterfox-download-page.jpg?ssl=1
|
||||
[11]: https://github.com/MrAlex94/Waterfox
|
@ -0,0 +1,189 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (mengxinayan)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to structure a multi-file C program: Part 1)
|
||||
[#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-1)
|
||||
[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions)
|
||||
|
||||
如何组织构建多文件 C 语言程序:第一部分
|
||||
======
|
||||
|
||||
准备好你喜欢的饮料,编辑器和编译器,放一些音乐,然后开始构建一个由多个文件组成的 C 语言程序。
|
||||
![Programming keyboard.][1]
|
||||
|
||||
大家常说计算机编程的艺术是管理复杂性和命名某些事物中的一部分。此外,我认为“有时需要添加绘图”是很正确的。
|
||||
|
||||
在这篇文章里,我会在编写一个小型 C 程序时命名一些东西同时管理一些复杂性。程序的结构基于我所在 “[如何写一个好的 C 语言 main 函数][2]” 文中讨论的。但是,这次做一些不同的事。准备好你喜欢的饮料,编辑器和编译器,放一些音乐,让我们一起编写一个有趣的 C 语言程序。
|
||||
|
||||
### 好的 Unix 程序中的哲学
|
||||
|
||||
首先你要知道这个 C 程序是一个 [Unix][3] 命令行工具。这意味着它运行在那些提供(或者可被移植) Unix C 运行环境的操作系统中。当 Unix 在贝尔实验室被发明后,它从一开始便充满了 [设计哲学][4]。用我的话来说:程序只做一件事,并做好它,然后对文件进行一些操作。虽然只做一件事并做好它是有意义的,但是“对文件进行一些操作”在这儿有一点儿不合适。
|
||||
|
||||
“文件” 在 Unix 中的抽象非常强大。一个 Unix 文件是以 end-of-file (EOF) 标志为结尾的字节流。文件中其他结构均由应用添加而非操作系统。操作系统提供了系统调用,使得程序能够对文件执行标准操作:打开,读取,写入,寻找和关闭(还有其他,但那是庞大的额外内容)。对于文件的标准化访问使得不同人用不同语言编写的程序能共用相同的抽象同时一起工作。
|
||||
|
||||
具有共享文件接口可以构建 _可组合的_ 的程序。一个程序的输出可以作为另一个程序的输入。Unix 系操作系统默认为每个运行中程序提供了三个文件:标准输入(`stdin`),标准输出(`stdout`),和标准错误(`stderr`)。其中两个文件是只写的:`stdout` 和 `stderr`。而 `stdin` 是只读的。当我们在常见的 Shell 比如 Bash 中使用文件重定向时,可以看到其效果。
|
||||
|
||||
```
|
||||
`$ ls | grep foo | sed -e 's/bar/baz/g' > ack`
|
||||
```
|
||||
|
||||
这条指令可以被简要地描述为:`ls` 的结果被写入标准输出,它重定向到 `grep` 的标准输入,`grep` 的标准输出重定向到 `sed`的标准输入,`sed` 的标准输出重定向到当前目录下文件名为 `ack` 的文件中。
|
||||
|
||||
我们希望我们的程序在系统中灵活而又出色,因此让我们编写一个可以读写文件的程序。
|
||||
|
||||
### MeowMeow: 流编码器/解码器概念
|
||||
|
||||
当我还是一个孩子在 ltmumblesgts 里学习计算机科学时,有许多编码方案。他们中的有些用于压缩文件,有些用于打包文件,另一些毫无用处因此显得十分愚蠢。列举一个最后一种情况例子:[MooMoo 编码方式][5]。
|
||||
|
||||
为了给我们程序一个目的,我将在 [2000s][6] 更新该概念并且完成一个名为 “MeowMeow” 的编码方式(因为在互联网上大家都喜欢猫)。这里的基本的想法获取文件并且使用文本 “meow” 对每半个字节进行编码。小写字母代表 0,大写字母代表 1。因为它会将 4 比特替换为 32 比特,因此会扩大文件的大小。这毫无实际意义。但想象一下人们看到经过这样编码后的结果。
|
||||
|
||||
```
|
||||
$ cat /home/your_sibling/.super_secret_journal_of_my_innermost_thoughts
|
||||
MeOWmeOWmeowMEoW...
|
||||
```
|
||||
|
||||
这非常棒。
|
||||
|
||||
### 最后完成
|
||||
|
||||
完整的源代码可以在 [GitHub][7] 上面找到,但是我会写下我在编写程序时的思考。目的是说明如何组织构建多文件 C 语言程序。
|
||||
|
||||
当我已经确定要编写一个 MeowMeow 编码和解码的程序时,我在 Shell 中执行了以下的命令 :
|
||||
|
||||
```
|
||||
$ mkdir meowmeow
|
||||
$ cd meowmeow
|
||||
$ git init
|
||||
$ touch Makefile # recipes for compiling the program
|
||||
$ touch main.c # handles command-line options
|
||||
$ touch main.h # "global" constants and definitions
|
||||
$ touch mmencode.c # implements encoding a MeowMeow file
|
||||
$ touch mmencode.h # describes the encoding API
|
||||
$ touch mmdecode.c # implements decoding a MeowMeow file
|
||||
$ touch mmdecode.h # describes the decoding API
|
||||
$ touch table.h # defines encoding lookup table values
|
||||
$ touch .gitignore # names in this file are ignored by git
|
||||
$ git add .
|
||||
$ git commit -m "initial commit of empty files"
|
||||
```
|
||||
|
||||
简单的说,我创建了一个空文件并且使用 git 提交。
|
||||
In short, I created a directory full of empty files and committed them to git.
|
||||
|
||||
即使文件中没有内容,你依旧可以从它的文件名推断功能。为了避免万一你无法理解,我在每条 `touch` 命令后面进行了简单描述。
|
||||
|
||||
通常,一个程序从一个简单 `main.c` 文件开始,只需要两三个函数便可以解决问题。然后程序员便可以向自己的朋友或者老板展示该程序,同时突然显示了文件提示框支持所有新的“功能”和“需求”。“程序俱乐部”的第一条规则便是不谈论“程序俱乐部”。第二条规则是最小化单个文件的功能。
|
||||
|
||||
坦率地说,C 编译器并不关心程序中的所有函数是否都在一个文件中。但是我们并不是为计算机或编译器写程序,我们是为其他人(有时也包括我们)而去写程序的。我知道这有些奇怪,但这就是事实。程序是计算机解决问题所采用的一系列算法,保证人们可以理解它们是非常重要的,即使问题的参数发生了意料之外的变化。当在人们修改程序时,发现一个文件中有 2049 函数时会诅咒你的。
|
||||
|
||||
因此,好的程序员会将函数分隔开,将相似的函数分组到不同的文件中。这里我用了三个文件 `main.c`,`mmencode.c` 和 `mmdecode.c`。对于这样的小程序,也许看起来有些过头了。但是小程序很难保证一直小下去,因此计划拓展是一个好主意。
|
||||
|
||||
但是那些 `.h` 文件呢?我会在后面解释一般的术语,简单地说,它们被称为头文件,同时它们可以包含 C 语言类型 和 C 预处理指令。头文件中不应该包含任何函数。你可以认为头文件和对应 `.c` 文件提供了用户编程接口(API)的定义,以便其他 `.c` 文件使用。
|
||||
|
||||
### 但是 Makefile 是什么呢?
|
||||
|
||||
我知道所有的酷小孩都使用 “Ultra CodeShredder 3000” 集成开发环境来编写下一个轰动一时的应用,同时构建你的项目包括在 Ctrl-Meta-Shift-Alt-Super-B 上进行混搭。但是回到今天,使用 Makefile 文件可以帮助做很多有用的工作在构建 C 程序时。Makefile 是一个包含如何处理文件的方式的文本文件,程序员可以使用其自动地从源代码构建二进制程序(包括其他东西!)
|
||||
|
||||
以下面这个小程序为例:
|
||||
|
||||
```
|
||||
00 # Makefile
|
||||
01 TARGET= my_sweet_program
|
||||
02 $(TARGET): main.c
|
||||
03 cc -o my_sweet_program main.c
|
||||
```
|
||||
|
||||
‘#’ 符号后面的文本是注释,例如 00 行
|
||||
|
||||
01 行是一个变量赋值,将 `TARGET` 变量赋值为字符串 `my_sweet_program`。按照惯例我的习惯是,所有 Makefile 变量均使用大写字母并用下划线分隔单词。
|
||||
|
||||
02 行包含要创建的文件名和其依赖的文件。在本例中,构建目标是 `my_sweet_program`,其依赖是 `main.c`。
|
||||
|
||||
03 行是最后一行使用了一个制表符号(tab)而不是四个空格。这是将执行创建目标的命令。在本例中,我们使用 C 编译器前端 `cc` 以编译链接到 `my_sweet_program`。
|
||||
|
||||
使用 Makefile 是非常简单的。
|
||||
|
||||
```
|
||||
$ make
|
||||
cc -o my_sweet_program main.c
|
||||
$ ls
|
||||
Makefile main.c my_sweet_program
|
||||
```
|
||||
|
||||
将构建我们 MeowMeow 编码和解码器的 [Makefile][8] 比上面的例子要复杂,但其基本结构是相同的。我将在另一篇文章中将其分解为 Barney 风格。
|
||||
|
||||
### 形式伴随着功能
|
||||
|
||||
我的想法是程序从一个文件中读取,转换它,并将转换后的结果存储到另一个文件中。以下是我想象使用程序命令行交互时的情况:
|
||||
|
||||
```
|
||||
$ meow < clear.txt > clear.meow
|
||||
$ unmeow < clear.meow > meow.tx
|
||||
$ diff clear.txt meow.tx
|
||||
$
|
||||
```
|
||||
|
||||
我们需要编写命令行解析和处理输入/输出流的代码。我们需要一个函数对流进行编码并将结果写到另一个流中。最后,我们需要一个函数对流进行解码并将结果写到另一个流中。等一下,我们在讨论如何写一个程序,但是在上面的例子中,我调用了两个指令:`meow` 和 `unmeow`?我知道你可能会认为这会导致越变越复杂。
|
||||
|
||||
### 次要内容:argv[0] 和 ln 指令
|
||||
|
||||
回想一下,C 语言 main 函数的结构如下:
|
||||
|
||||
```
|
||||
`int main(int argc, char *argv[])`
|
||||
```
|
||||
|
||||
其中 `argc` 是命令行参数数量,`argv` 是字符指针列表(字符串)。`argv[0]` 是正在运行中的文件的路径。在 Unix 系统中许多互补功能的程序(比如:压缩和解压缩)看起来像两个命令,但事实上,它们在文件系统中是拥有两个名称的一个程序。使用 `ln` 命令通过创建文件系统链接来实现两个名称的功能。
|
||||
|
||||
一个在我笔记本中 `/usr/bin` 的例子如下:
|
||||
|
||||
```
|
||||
$ ls -li /usr/bin/git*
|
||||
3376 -rwxr-xr-x. 113 root root 1.5M Aug 30 2018 /usr/bin/git
|
||||
3376 -rwxr-xr-x. 113 root root 1.5M Aug 30 2018 /usr/bin/git-receive-pack
|
||||
...
|
||||
```
|
||||
|
||||
这里 `git` 和 `git-receive-pack` 是同一个文件但是拥有不同的名字。我们说它们是相同的文件因为它们具有相同的 inode 值(第一列)。inode 是一个 Unix 文件系统的特点,其超越了本文的内容。
|
||||
|
||||
优秀或懒惰的程序可以通过 Unix 文件系统此特点已达到写更少的代码但是交付双倍的程序。首先,我们编写一个基于其 `argv[0]` 的值而作出相应改变的程序,然后我们确保为该行为的名称创建链接。
|
||||
|
||||
在我们的 Makefile 中,`unmeow` 链接通过以下的方式来创建:
|
||||
|
||||
```
|
||||
# Makefile
|
||||
...
|
||||
$(DECODER): $(ENCODER)
|
||||
$(LN) -f $< $@
|
||||
...
|
||||
```
|
||||
|
||||
我喜欢在 Makefile 中将所有内容参数化,很少使用 “裸” 字符串。我将所有的定义都放置在 Makefile 文件顶部,以便可以简单地找到并改变它们。当您尝试将程序移植到新的平台上时,需要将 `cc` 改变为 `xcc`时,这会产生很大影响。
|
||||
|
||||
除了两个内置变量 `$@` 和 `$<` 之外,其余的变量显得很简单的。第一个便是创建目标的快捷方式,在本例中,`$(DECODER)` (我记忆它因为它看起来像一个目标)。第二个,`$<` 是规则依赖项,在本例中,它解析为 `$(ENCODER)`。
|
||||
|
||||
事情当然在变得复杂,但是它易于管理。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/structure-multi-file-c-part-1
|
||||
|
||||
作者:[Erik O'Shaughnessy][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[萌新阿岩](https://github.com/mengxinayan)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (Programming keyboard.)
|
||||
[2]: https://opensource.com/article/19/5/how-write-good-c-main-function
|
||||
[3]: https://en.wikipedia.org/wiki/Unix
|
||||
[4]: http://harmful.cat-v.org/cat-v/
|
||||
[5]: http://www.jabberwocky.com/software/moomooencode.html
|
||||
[6]: https://giphy.com/gifs/nyan-cat-sIIhZliB2McAo
|
||||
[7]: https://github.com/JnyJny/meowmeow
|
||||
[8]: https://github.com/JnyJny/meowmeow/blob/master/Makefile
|
@ -1,102 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (heguangzhi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What I learned going from prison to Python)
|
||||
[#]: via: (https://opensource.com/article/20/1/prison-to-python)
|
||||
[#]: author: (Shadeed "Sha" Wallace-Stepter https://opensource.com/users/shastepter)
|
||||
|
||||
我在监狱从 Python 中学到了什么
|
||||
======
|
||||
|
||||
开源编程是如何在入监狱中提供机会的![书架上的编程书籍][1]
|
||||
|
||||
不到一年前,我还在圣昆廷州立监狱服刑,我是无期徒刑。
|
||||
|
||||
我高三的时候,我抢劫了一个人并向他开了枪。现在,我经过一段时间才意识到并承认自己做错了,这是在经历了陪审团审判并看到我的行为带来的恶果后,我知道需要改变自己,我也确实做到了。尽管我对我的行为表示懊悔,但我毕竟开枪打了一个人,并差点杀了他。做这样的事是有后果的,这是理所当然的。所以在我18岁的时候,我被判了终身监禁。
|
||||
|
||||
监狱是一个非常可怕的地方;我是也不向你推荐的。但是我必须去,所以我去了。我不告诉你具体的细节,但你可以放心,这是一个不可能有太多想法的的地方,许多人在这里养成的坏习惯比他们过去在别处养成的更多。
|
||||
|
||||
我是幸运儿。当我在服刑的时候,发生了一些不同的事情。我开始想象自己出狱后的的未来,虽然在这之前,我还是已经度过了我所有的成年生活。
|
||||
|
||||
现在你想想:我是黑人,只受过高中教育。我没有工作经历,如果我离开监狱,在被释放前,我还是一个被定罪的重罪犯。当每个雇主看到我的简历,都不会有“我需要雇用这个人”
|
||||
想法,我认为是正常的。
|
||||
|
||||
我不知道我的选择是什么,但我已经下定决心了。我需要做些活下去的事情,并且这和我入狱前的生活一点也不像。
|
||||
|
||||
### Python 之路
|
||||
|
||||
最终,我被关在了圣昆廷州立监狱,我不知道我在那里有多幸运。圣昆廷提供了几个自助教育编程项目。这些[改造机会][2]帮助囚犯使他们拥有在获释后避免再次犯罪的技能。
|
||||
|
||||
作为其中一个编程项目的一部分,2017年我通过圣昆廷媒体项目认识了[杰西卡·麦凯拉]。杰西卡是编程语言[Pythone][4]的爱好者,她开始向我推荐 Python 有多棒,以及它是刚起步的人学习的完美语言。这就是故事变得比小说更精彩的地方。
|
||||
|
||||
|
||||
> 感谢[@northbaypython][5]让[@ShaStepter][6]和我重复[@pycon][7]的主题演讲,让他们被录制下来。我很荣幸与大家分享:
|
||||
>
|
||||
> 从监狱到 Pythone: https://t.co/rcumoAgZHm
|
||||
>
|
||||
> 大规模裁员:如果我们不雇佣被判重罪的人,谁会呢? https://t.co/fENDUFdxfX [pic.Twitter.com/kpjo8d3ul6][8]
|
||||
>
|
||||
> —杰西卡·麦凯拉(@ jessicamckellar)[2019年11月5日][9]
|
||||
|
||||
杰西卡告诉我一些 Python 视频教程,这些教程是她为一家名叫[O’Reilly Media][10]的公司做的,课程是在线的,如果我能接触到它们,那该有多好呀。不幸的是,在监狱里上网是不可能的。但是,我遇到了一个叫 Tim O’Reilly 的人,他最近刚来到圣昆廷。在他访问之后,Tim 从他的公司 O’Reilly Media 公司向监狱的编程班捐赠了大量内容。最终,我拿到了一款平板电脑,上面有杰西卡的 Python 教程,并学会了如何使用这些Python教程进行编码。
|
||||
|
||||
真是难以置信。背景和生活与我完全不同的陌生人把这些联系在一起,让我学会了编码。
|
||||
|
||||
|
||||
### 对 Python 社区的热爱
|
||||
|
||||
在这之后,我开始经常和杰西卡见面,她开始告诉我关于开源社区的情况。从根本上说,开源社区就是关于伙伴关系和协作的社区。因为没有人被排除在外,所以效果很好。
|
||||
|
||||
对我来说,一个努力寻找我自己的定位的人,我所看到的是一种非常基本的爱——通过合作和接受的爱,通过接触的爱,通过包容的爱。我渴望成为其中的一部分。所以我继续学习Python,不幸的是,我无法获得更多的教程,但是我能够从开源社区编译的大量书面知识中获益。我读过任何提到 Python 的东西,从平装本到晦涩难懂的杂志文章,我使用平板电脑来解决我读到的 Python 问题。
|
||||
|
||||
我对 Python 和编程的热情不是我的许多同龄人所共有的。除了监狱编程课上的极少数人之外,我认识的其他人都没有提到过编程;一般囚犯都不知道。我认为这是因为有过监禁经历的人无法接触编程,尤其是如果你是有色人种。
|
||||
`
|
||||
### 监狱外的 Python 生活
|
||||
|
||||
然而,在2018年8月17日,我得到了生命中的惊喜。杰里·布朗州长将我27年的刑期减为无期徒刑,在服刑近19年后,我被释放出狱了。
|
||||
|
||||
但现实情况是,这也是为什么我认为编程和开源社区如此有价值。我是一名37岁的黑人罪犯,没有工作经历,刚刚在监狱服刑18年。我有犯罪史,并且现存偏见导致没有多少职业适合我。但是编程是少数例外之一。
|
||||
|
||||
监禁后重返社会的人们迫切需要包容,但当谈话转向工作场所的多样性以及对多样性的需求时,你真的听不到这个群体被提及或包容。
|
||||
|
||||
|
||||
> 还有什么:
|
||||
>
|
||||
> 1\. 背景调查:询问他们在你的公司是如何使用的。
|
||||
>
|
||||
> 2\. 初级角色:删除虚假的、不必要的先决条件,这些条件将排除有记录的合格人员。
|
||||
>
|
||||
> 3\. 积极拓展:与当地再就业项目合作,创建招聘渠道。[11]
|
||||
>
|
||||
> —杰西卡·麦凯拉(@ jessicamckellar)[2019年5月12日][12]
|
||||
|
||||
|
||||
因此,我想谦卑地挑战开源社区的所有程序员和成员,让他们围绕包容和多样性展开思考。今天,我自豪地站在你们面前,代表一个大多数人都没有想到的群体——以前被监禁的人。但是我们存在,我们渴望证明我们的价值,最重要的是,我们期待被接受。当我们重返社会时,许多挑战等待着我们,我请求你们允许我们有机会展示我们的价值。欢迎我们,接受我们,最重要的是,包容我们。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/1/prison-to-python
|
||||
|
||||
作者:[Shadeed "Sha" Wallace-Stepter][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[heguangzhi](https://github.com/heguangzhi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/shastepter
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_programming_languages.jpg?itok=KJcdnXM2 (Programming books on a shelf)
|
||||
[2]: https://www.dailycal.org/2019/02/27/san-quentin-rehabilitation-programs-offer-inmates-education-a-voice/
|
||||
[3]: https://twitter.com/jessicamckellar?lang=en
|
||||
[4]: https://www.python.org/
|
||||
[5]: https://twitter.com/northbaypython?ref_src=twsrc%5Etfw
|
||||
[6]: https://twitter.com/ShaStepter?ref_src=twsrc%5Etfw
|
||||
[7]: https://twitter.com/pycon?ref_src=twsrc%5Etfw
|
||||
[8]: https://t.co/Kpjo8d3ul6
|
||||
[9]: https://twitter.com/jessicamckellar/status/1191601209917837312?ref_src=twsrc%5Etfw
|
||||
[10]: http://shop.oreilly.com/product/110000448.do
|
||||
[11]: https://t.co/WnzdEUTuxr
|
||||
[12]: https://twitter.com/jessicamckellar/status/1127640222504636416?ref_src=twsrc%5Etfw
|
@ -0,0 +1,109 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Screenshot your Linux system configuration with Bash tools)
|
||||
[#]: via: (https://opensource.com/article/20/1/screenfetch-neofetch)
|
||||
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
|
||||
|
||||
使用 Bash 工具截屏 Linux 系统配置
|
||||
======
|
||||
使用 ScreenFetch 和 Neofetch 与其他人轻松分享 Linux 环境。
|
||||
![metrics and data shown on a computer screen][1]
|
||||
|
||||
你可能有很多原因想要与他人分享 Linux 配置。你可能正在寻求帮助来对系统上的问题进行故障排除,或者你对所创建的环境感到非常自豪,因此想向其他开源爱好者展示。
|
||||
|
||||
你可以在 Bash 提示符下使用 **cat /proc/cpuinfo** 或 **lscpu** 命令获取某些信息。但是,如果你想共享更多详细信息,例如你的操作系统、内核、运行时间、shell 环境,屏幕分辨率等,那么可以选择两个很棒的工具:screenFetch 和 Neofetch。
|
||||
|
||||
### ScreenFetch
|
||||
|
||||
[ScreenFetch][2] 是 Bash 命令行程序,它可以产生非常漂亮的系统配置和运行时间的截图。这是方便的与它人共享系统配置的方法。
|
||||
|
||||
在许多 Linux 发行版上安装 screenFetch 很简单。
|
||||
|
||||
在 Fedora 上,输入:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install screenfetch`
|
||||
```
|
||||
|
||||
在 Ubuntu 上,输入:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install screenfetch`
|
||||
```
|
||||
|
||||
对于其他操作系统,包括 FreeBSD、MacOS 等,请查阅 screenFetch 的 wiki [安装页面][3]。安装 screenFetch 后,它可以生成详细而彩色的截图,如下所示:
|
||||
|
||||
![screenFetch][4]
|
||||
|
||||
ScreenFetch 还提供各种命令行选项来调整你的结果。例如, **screenfetch -v** 返回详细输出,逐行显示每个选项以及上面的显示。
|
||||
|
||||
**screenfetch -n** 在显示系统信息时消除了操作系统图标。
|
||||
|
||||
![screenfetch -n option][5]
|
||||
|
||||
其他选项包括 **screenfetch -N**,它去除所有输出的颜色。**screenfetch -t**,它根据终端的大小截断输出。**screenFetch -E**,它可抑制错误输出。
|
||||
|
||||
请检查手册页来了解其他选项。ScreenFetch 在 GPLv3 许可证下的开源,你可以在它的 [GitHub 仓库][6]中了解有关该项目的更多信息。
|
||||
|
||||
### Neofetch
|
||||
|
||||
[Neofetch][7] 是创建系统信息截图的另一个工具。它是用 Bash 3.2 编写的,在 [MIT 许可证][8]下开源。
|
||||
|
||||
根据项目网站,“Neofetch 支持近 150 种不同的操作系统。从 Linux 到 Windows,一直到 Minix、AIX 和 Haiku 等更晦涩的操作系统。”
|
||||
|
||||
![Neofetch][9]
|
||||
|
||||
该项目维护了一个 wiki,其中包含用于各种发行版和操作系统的出色的[安装文档] [10]。
|
||||
|
||||
如果你使用的是 Fedora、RHEL 或 CentOS,那么可以在 Bash 提示符下使用以下命令安装 Neofetch:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo dnf install neofetch`
|
||||
```
|
||||
|
||||
在 Ubuntu 17.10 及更高版本上,你可以使用:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt install neofetch`
|
||||
```
|
||||
|
||||
首次运行时,Neofetch 将 **~/.config/neofetch/config.conf** 文件写入主目录(**.config/config.conf**),它让你可以[自定义和控制] [ 11] Neofetch 输出的各个方面。例如,你可以配置 Neofetch 使用图像、ASCII 文件、你选择的壁纸,或者完全不使用。config.conf 文件还让与它人分享配置变得容易。
|
||||
|
||||
如果 Neofetch 不支持你的操作系统或不提供所需选项,请在项目的 [GitHub 仓库] [12]中打开一个问题。
|
||||
|
||||
### 总结
|
||||
|
||||
无论为什么要共享系统配置,screenFetch 或 Neofetch 都应该能做到。你是否知道在 Linux 上提供此功能的另一个开源工具?请在评论中分享你的最爱。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/1/screenfetch-neofetch
|
||||
|
||||
作者:[Don Watkins][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/don-watkins
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen)
|
||||
[2]: https://github.com/KittyKatt/screenFetch
|
||||
[3]: https://github.com/KittyKatt/screenFetch/wiki/Installation
|
||||
[4]: https://opensource.com/sites/default/files/uploads/screenfetch.png (screenFetch)
|
||||
[5]: https://opensource.com/sites/default/files/uploads/screenfetch-n.png (screenfetch -n option)
|
||||
[6]: http://github.com/KittyKatt/screenFetch
|
||||
[7]: https://github.com/dylanaraps/neofetch
|
||||
[8]: https://github.com/dylanaraps/neofetch/blob/master/LICENSE.md
|
||||
[9]: https://opensource.com/sites/default/files/uploads/neofetch.png (Neofetch)
|
||||
[10]: https://github.com/dylanaraps/neofetch/wiki/Installation
|
||||
[11]: https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
|
||||
[12]: https://github.com/dylanaraps/neofetch/issues
|
@ -1,83 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (qianmingtian)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Give an old MacBook new life with Linux)
|
||||
[#]: via: (https://opensource.com/article/20/2/macbook-linux-elementary)
|
||||
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
|
||||
|
||||
用 Linux 给旧 MacBook 以新生
|
||||
======
|
||||
|
||||
Elementary OS 的最新版本 Hera 是一个令人印象深刻的平台,它让过时的 MacBook 得以重生。
|
||||
|
||||
![Coffee and laptop][1]
|
||||
|
||||
当我安装苹果的 [MacOS Mojave][2] 时,它使我以前可靠的 MacBook Air 运行变慢了。我的计算机于 2015 年发布,具有 4 GB 内存, i5 处理器和 Broadcom 4360 无线卡,但是 Mojava 提供的日常驱动程序使 [GnuCash][3] 不可用,这激起了我重返 Linux 的欲望。我很高兴能做到这一点,但是我感到非常遗憾的是,我的这台 MacBook 被闲置了。
|
||||
|
||||
我在 MacBook Air 上尝试了几种 Linux 发行版,但总是会有陷阱。有时是无线网卡;还有一次,它缺少对触摸板的支持。看了一些不错的评论后,我决定尝试 [Elementary OS][4] 5.0(Juno)。我用 USB [制作了启动盘][5],并将其插入 MacBook Air 。我来到了一个实时桌面,并且操作系统识别了我的 Broadcom 无线芯片组-我认为这可能已经正常工作了!
|
||||
|
||||
我喜欢在 Elementary OS 中看到的内容。它的 [Pantheon][6] 桌面真的很棒,并且其外观和使用起来的感觉对 Apple 用户来说很熟悉-它的显示屏底部有一个底座,并带有可引导常用应用程序的图标。我喜欢我之前期待的预览,所以我决定安装它,然后我的无线设备消失了。真的很令人失望。我真的很喜欢 Elementary OS ,但是没有无线是不行的。
|
||||
|
||||
时间快进到 2019 年 12 月,当我在 [Linux4Everyone][7] 播客上听到有关 Elementary 最新版本 v.5.1(Hera) 使MacBook复活的评论时,我决定用 Hera 再试一次。我下载了 ISO ,创建了可启动驱动器,将其插入电脑,这次操作系统识别了我的无线网卡。我可以在上面工作了。
|
||||
|
||||
![MacBook Air with Hera][8]
|
||||
|
||||
我非常高兴我轻巧又功能强大的 MacBook Air 通过 Linux 焕然一新。我一直在更详细地研究 Elementary OS ,我可以告诉你我印象深刻的东西。
|
||||
|
||||
### Elementary OS 的功能
|
||||
|
||||
根据 [Elementary 的博客][9],“新设计的登录和锁定屏幕问候语看起来更清晰,效果更好,并且修复了以前问候语中报告的许多问题,包括焦点问题, HiDPI 问题和更好的本地化。 Hera 的新设计是为了响应来自 Juno 的用户反馈,并启用了一些不错的新功能。”
|
||||
|
||||
轻描淡写的“不错的新功能” — Elementary OS 拥有我见过的最佳设计的 Linux 用户界面之一。默认情况下,系统上的“系统设置”图标位于扩展坞上。更改设置很容易,很快我就按照自己的喜好配置了系统。我需要的文字大小比默认值大,辅助功能要易于使用并且允许我设置大文字和高对比度。我还可以使用较大的图标和其他选项来调整底座。
|
||||
|
||||
![Elementary OS 的设置界面][10]
|
||||
|
||||
按下 Mac 的 Command 键将弹出一个键盘快捷键列表,这对新用户非常有帮助。
|
||||
|
||||
![Elementary OS' 的键盘快捷键][11]
|
||||
|
||||
Elementary OS 附带的 [Epiphany][12] Web 浏览器,我发现它非常易于使用。 它与 Chrome , Chromium 或 Firefox 略有不同,但它已经绰绰有余。
|
||||
|
||||
对于注重安全的用户(我们应该都是), Elementary OS 的安全和隐私设置提供了多个选项,包括防火墙,历史记录,锁定,临时和垃圾文件的自动删除以及用于位置服务开/关的开关。
|
||||
|
||||
![Elementary OS 的隐私与安全][13]
|
||||
|
||||
### 有关 Elementray OS 的更多信息
|
||||
|
||||
Elementary OS 最初于 2011 年发布,其最新版本 Hera 于 2019 年 12 月 3 日发布。 Elementary 的联合创始人兼 CXO 的 [Cassidy James Blaede][14] 是操作系统的 UX 架构师。 Cassidy 喜欢使用开放技术来设计和构建有用,可用和令人愉悦的数字产品。
|
||||
|
||||
Elementary OS 具有出色的用户[文档][15],其代码(在 GPL 3.0 下许可)可在 [GitHub][16] 上获得。 Elementary OS 鼓励参与该项目,因此请务必伸出援手并[加入社区][17]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/macbook-linux-elementary
|
||||
|
||||
作者:[Don Watkins][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[qianmingtian][c]
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/don-watkins
|
||||
[b]: https://github.com/lujun9972
|
||||
[c]: https://github.com/qianmingtian
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_cafe_brew_laptop_desktop.jpg?itok=G-n1o1-o (Coffee and laptop)
|
||||
[2]: https://en.wikipedia.org/wiki/MacOS_Mojave
|
||||
[3]: https://www.gnucash.org/
|
||||
[4]: https://elementary.io/
|
||||
[5]: https://opensource.com/life/14/10/test-drive-linux-nothing-flash-drive
|
||||
[6]: https://opensource.com/article/19/12/pantheon-linux-desktop
|
||||
[7]: https://www.linux4everyone.com/20-macbook-pro-elementary-os
|
||||
[8]: https://opensource.com/sites/default/files/uploads/macbookair_hera.png (MacBook Air with Hera)
|
||||
[9]: https://blog.elementary.io/introducing-elementary-os-5-1-hera/
|
||||
[10]: https://opensource.com/sites/default/files/uploads/elementaryos_settings.png (Elementary OS's Settings screen)
|
||||
[11]: https://opensource.com/sites/default/files/uploads/elementaryos_keyboardshortcuts.png (Elementary OS's Keyboard shortcuts)
|
||||
[12]: https://en.wikipedia.org/wiki/GNOME_Web
|
||||
[13]: https://opensource.com/sites/default/files/uploads/elementaryos_privacy-security.png (Elementary OS's Privacy and Security screen)
|
||||
[14]: https://github.com/cassidyjames
|
||||
[15]: https://elementary.io/docs/learning-the-basics#learning-the-basics
|
||||
[16]: https://github.com/elementary
|
||||
[17]: https://elementary.io/get-involved
|
@ -0,0 +1,161 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( guevaraya)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Troubleshoot Kubernetes with the power of tmux and kubectl)
|
||||
[#]: via: (https://opensource.com/article/20/2/kubernetes-tmux-kubectl)
|
||||
[#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakar)
|
||||
|
||||
解决 Kubernetes 问题的利器 Tmux 和 kubectl
|
||||
======
|
||||
一个 kubectl 插件 用 tmux 使 Kubernetes 疑难问题变得更简单。
|
||||
|
||||
![一个坐在笔记本面前的妇女][1]
|
||||
|
||||
[Kubernetes][2] 是一个活跃的开源容器管理平台,它提供了可扩展性,高可用性,健壮性和富有弹性的应用程序管理。它的众多特性之一是支持通过原生的客户端程序 [kubectl][3] 运行定制脚本或可执行程序,Kubectl 很强大的,允许用户在 Kubernetes 集群上用它直接做很多事情。
|
||||
|
||||
### 使用别名进行 Kubernetes 的故障排查
|
||||
|
||||
使用 Kubernetes 的容器管理的人都知道由于设计上原因带来了其复杂性。因此迫切的需要快速的以及几乎不需要人工干预方式简化故障排查(除过特殊情况)。
|
||||
|
||||
在故障排查功能方面,这有很多场景需要考虑。有一个场景,你知道你需要运行什么,但是这个命令的语法(即使作为一个单独的命令运行)过于复杂,或需要一、两次交互才能起作用。
|
||||
|
||||
例如,如果你频繁的需要调整一个系统命名空间里正在运行的容器,你可能发现自己在重复的写入:
|
||||
|
||||
```
|
||||
`kubectl --namespace=kube-system exec -i -t <your-pod-name>`
|
||||
```
|
||||
为了简化故障排查,你可以用这些指令的命令行补全功能。比如,你可以增加下面命令到你的隐藏配置文件(.bashrc 或 .zshrc):
|
||||
|
||||
```
|
||||
`alias ksysex='kubectl --namespace=kube-system exec -i -t'`
|
||||
```
|
||||
|
||||
这是来自于常见的 [Kubernetes 别名仓][4]的一个例子,它展示了一个 kubectl 简化的功能的方法。像这个场景的简化情况,使用别名很有用。
|
||||
|
||||
### 切换到 kubectl 插件
|
||||
|
||||
更复杂的故障排查场景是需要执行很多命令,一个一个的执行,然后去调查环境,最后得出结论。单用别名方法是不能解决这种情况的;你需要知道你所部署的Kubernetes 之间逻辑和和相关性,你真是需要的是自动化来短时间输出你想要的。
|
||||
|
||||
考虑到你的集群有10到20或50到100个命名空间来提供不同的微服务。一般在进行故障排查时,做什么事情对你有帮助?
|
||||
|
||||
* 你需要某个东西可快速的告知哪个 Pod 哪个 命名空间抛的错误。
|
||||
* 你需要某个东西可监视一个命名空间的所有 pod 的日志。
|
||||
* 你可能也需要监视出现错误的指定命名空间的特定 pod 的日志。
|
||||
|
||||
|
||||
只要包含以上任意的解决方案将对定位产品问题很大的帮助,包含对开发和测试周期过程。
|
||||
|
||||
你可以用 [kubectl 插件][5] 创建比简易别名更强大的方法。插件类似于其他用任何语言编写的独立脚本,被设计为 Kubernetes 管理员的主要命令扩展。
|
||||
|
||||
创建一个插件,你必须用正确的语法 **kubectl-<your-plugin-name>** 来拷贝这个脚本到导出目录 **$PATH** ,需要赋予可执行权限(**chmod +x**)。
|
||||
|
||||
创建插件之后把他移动到你的目录,你需要立即运行。例如,你的目录下有一个 kubectl-krawl 和 kubectl-kmux:
|
||||
|
||||
|
||||
```
|
||||
$ kubectl plugin list
|
||||
The following compatible plugins are available:
|
||||
|
||||
/usr/local/bin/kubectl-krawl
|
||||
/usr/local/bin/kubectl-kmux
|
||||
|
||||
$ kubectl kmux
|
||||
```
|
||||
现在让我们见识下带有 tmux 的 Kubernetes 的有多强大。
|
||||
|
||||
### 驾驭强大的 tmux
|
||||
|
||||
[Tmux][6] 是一个非常强大的工具,许多管理员和操作团队通过它来反馈问题故障,通过易于分屏的方式到窗口上并行调试多个机器以及管理日志。他的主要的优点是可基于命令行或自动化的脚本。
|
||||
|
||||
我创建[一个 kubectl 插件][7] 用 tmux 使故障排查更加简单。我将通过注释来了解插件背后的逻辑(我们来瞅一瞅插件的整个源码):
|
||||
|
||||
```
|
||||
#NAMESPACE is namespace to monitor.
|
||||
#POD is pod name
|
||||
#Containers is container names
|
||||
|
||||
# initialize a counter n to count the number of loop counts, later be used by tmux to split panes.
|
||||
n=0;
|
||||
|
||||
# start a loop on a list of pod and containers
|
||||
while IFS=' ' read -r POD CONTAINERS
|
||||
do
|
||||
|
||||
# tmux create the new window for each pod
|
||||
tmux neww $COMMAND -n $POD 2>/dev/null
|
||||
|
||||
# start a loop for all containers inside a running pod
|
||||
for CONTAINER in ${CONTAINERS//,/ }
|
||||
do
|
||||
|
||||
if [ x$POD = x -o x$CONTAINER = x ]; then
|
||||
# if any of the values is null, exit.
|
||||
warn "Looks like there is a problem getting pods data."
|
||||
break
|
||||
fi
|
||||
|
||||
# set the command to execute
|
||||
COMMAND=”kubectl logs -f $POD -c $CONTAINER -n $NAMESPACE”
|
||||
# check tmux session
|
||||
if tmux has-session -t <session name> 2>/dev/null;
|
||||
then
|
||||
<set session exists>
|
||||
else
|
||||
<create session>
|
||||
fi
|
||||
|
||||
# split planes in the current window for each containers
|
||||
tmux selectp -t $n \; \
|
||||
splitw $COMMAND \; \
|
||||
select-layout tiled \;
|
||||
|
||||
# end loop for containers
|
||||
done
|
||||
|
||||
# rename the window to identify by pod name
|
||||
tmux renamew $POD 2>/dev/null
|
||||
|
||||
# increment the counter
|
||||
((n+=1))
|
||||
|
||||
# end loop for pods
|
||||
done< <(<fetch list of pod and containers from kubernetes cluster>)
|
||||
|
||||
# finally select the window and attach session
|
||||
tmux selectw -t <session name>:1 \; \
|
||||
attach-session -t <session name>\;
|
||||
```
|
||||
|
||||
运行插件脚本后,它将在当前目录会生成一个同名的镜像。每个 pod 有一个窗口,每个容器(如果有多个)被分割成不同 pos 窗口,日志以数据流形式输出。 漂亮的tmux 如下;如果配置正确,你将会看到哪个窗口是否处于激活运行状态(可看到标签是白色的)。
|
||||
|
||||
![kmux 插件的输出][8]
|
||||
|
||||
### 总结
|
||||
|
||||
别名是在 Kubernetes 环境下常见的也有用的简易故障排查方法。当环境变得复杂,用高级脚本生成的kubectl 插件是一个很强大的方法。至于用哪个编程语言来编写 kubectl 插件是没有限制。唯一的要求是路径命名是可执行的,并且不能与已知的 kubectl 命令重复。
|
||||
|
||||
为了阅读完整的插件源码,我们尝试创建了一个插件,请查看我的 [kube-plugins-github][7] 仓。欢迎提交问题和补丁。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/kubernetes-tmux-kubectl
|
||||
|
||||
作者:[Abhishek Tamrakar][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/guevaraya)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/tamrakar
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_4.png?itok=VGZO8CxT (一个坐在笔记本面前的妇女)
|
||||
[2]: https://opensource.com/resources/what-is-kubernetes
|
||||
[3]: https://kubernetes.io/docs/reference/kubectl/overview/
|
||||
[4]: https://github.com/ahmetb/kubectl-aliases/blob/master/.kubectl_aliases
|
||||
[5]: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/
|
||||
[6]: https://opensource.com/article/19/6/tmux-terminal-joy
|
||||
[7]: https://github.com/abhiTamrakar/kube-plugins
|
||||
[8]: https://opensource.com/sites/default/files/uploads/kmux-output.png (Output of kmux plugin)
|
@ -1,118 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chai-yuan)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Connect Fedora to your Android phone with GSConnect)
|
||||
[#]: via: (https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/)
|
||||
[#]: author: (Lokesh Krishna https://fedoramagazine.org/author/lowkeyskywalker/)
|
||||
|
||||
使用GSConnect将Android手机连接到Fedora系统
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
苹果和微软公司都提供了集成好的与移动设备交互的应用。Fedora提供了类似的工具——**GSConnect**。它可以让你将你的安卓手机和你的Fedora桌面配对并使用。读下去,来了解更多关于它是什么以及它是如何工作的信息。
|
||||
|
||||
### GSConnect是什么?
|
||||
|
||||
GSConnect是基于KDE Connect项目而为GNOME桌面定制的程序。KDE Connect使你的设备相互之间能够进行通信。但是,在Fedora的默认GNOME桌面上安装它需要安装大量的KDE依赖。
|
||||
|
||||
GSConnect基于KDE Connect实现,作为GNOME shell的拓展应用。一旦安装,GSConnect允许您执行以下操作:
|
||||
|
||||
* 在电脑上接收电话通知并回复信息
|
||||
* 用手机操纵你的桌面
|
||||
* 在不同设备之间分享文件与链接
|
||||
* 在电脑上查看手机电量
|
||||
* 让手机响铃以便你能找到它
|
||||
|
||||
|
||||
|
||||
### 设置GSConnect扩展
|
||||
|
||||
设置GSConnect需要安装两款软件:电脑上的GSConnect扩展和Android设备上的KDE Connect应用。
|
||||
|
||||
首先,从GNOME Shell扩展网站[GSConnect][2]安装GSConnect扩展。(Fedora Magazine有一篇关于[如何安装GNOMEShell扩展名][3]的文章,可以帮助你完成这一步。)
|
||||
|
||||
KDE Connect应用程序可以在Google的[Play Store][4]上找到。它也可以在FOSS Android应用程序库[F-Droid][5]上找到。
|
||||
|
||||
一旦安装了这两个组件,就可以配对两个设备。安装扩展后再系统菜单中显示“移动设备(Mobile Devices)”。单击它会出现一个下拉菜单,你可以从中访问“移动设置(Mobile Settings)”。
|
||||
|
||||
![][6]
|
||||
|
||||
在这里,你可以用GSConnect查看并管理配对的设备。进入此界面后,需要在Android设备上启动应用程序。
|
||||
|
||||
配对的初始化可以再任意一台设备上进行,在这里我们从Android设备连接到电脑。点击应用程序上的刷新(refresh),只要两个设备都在同一个无线网络环境中,你的Android设备便可以搜索到你的电脑。现在可以向桌面发送配对请求,并在桌面上接受配对请求以完成配对。
|
||||
|
||||
![][7]
|
||||
|
||||
### 使用 GSConnect
|
||||
|
||||
配对后,你将需要授予对Android设备的权限,才能使用GSConnect上提供的许多功能。单击设备列表中的配对设备,便可以查看所有可用功能,并根据你的偏好和需要启用或禁用它们。
|
||||
|
||||
![][8]
|
||||
|
||||
请记住,你还需要在Android应用程序中授予相应的权限才能使用这些功能。启用权限后,你现在可以访问桌面上的移动联系人,获得消息通知并回复消息,甚至同步桌面和Android设备剪贴板。
|
||||
|
||||
### 集成在文件系统与浏览器上
|
||||
|
||||
GSConnect允许你直接从桌面文件资源管理器向Android设备发送文件。
|
||||
|
||||
在Fedora的默认GNOME桌面上,你需要安装_nautilus-python_依赖包,以便在菜单中显示配对的设备。安装它只需要再终端中输入:
|
||||
|
||||
```
|
||||
$ sudo dnf install nautilus-python
|
||||
```
|
||||
|
||||
完成后,将在“文件(Files)”的菜单中显示“发送到移动设备(Send to Mobile Device)”选项。
|
||||
|
||||
![][9]
|
||||
|
||||
同样,为你的浏览器安装相应的WebExtension,无论是[Firefox][10]还是[Chrome][11]浏览器,都可以将链接发送到你的Android设备。你可以选择直接在浏览器中发送要启动的链接,或将其作为短信息发送。
|
||||
|
||||
### 运行命令
|
||||
|
||||
GSConnect允许你定义命令,然后可以从远程设备在电脑上运行这些命令。这使得你可以远程截屏,或者从你的Android设备锁定和解锁你的桌面。
|
||||
|
||||
![][12]
|
||||
|
||||
要使用此功能,可以使用标准shell命令和GSConnect公开的CLI。项目的GitHub存储库中提供了有关此操作的文档: _CLI Scripting_。
|
||||
|
||||
[KDE UserBase Wiki][13]有一个命令示例列表。这些例子包括控制桌面的亮度和音量,锁定鼠标和键盘,甚至更改桌面主题。其中一些命令是针对KDE Plasma设计的,需要进行修改才能在GNOME桌面上运行。
|
||||
|
||||
### 探索并享受乐趣
|
||||
|
||||
GSConnect使我们能够享受到极大的便利和舒适。深入研究首选项,查看你可以做的所有事情,灵活的使用这些命令功能。并在下面的评论中自由分享你解锁的新方式。
|
||||
|
||||
* * *
|
||||
|
||||
_Photo by [Pathum Danthanarayana][14] on [Unsplash][15]._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/connect-fedora-to-your-android-phone-with-gsconnect/
|
||||
|
||||
作者:[Lokesh Krishna][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[chai-yuan](https://github.com/chai-yuan)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/lowkeyskywalker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2019/12/gsconnect-816x345.jpg
|
||||
[2]: https://extensions.gnome.org/extension/1319/gsconnect/
|
||||
[3]: https://fedoramagazine.org/install-gnome-shell-extension/
|
||||
[4]: https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp
|
||||
[5]: https://f-droid.org/en/packages/org.kde.kdeconnect_tp/
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2020/01/within-the-menu-1024x576.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2020/01/pair-request-1024x576.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2020/01/permissions-1024x576.png
|
||||
[9]: https://fedoramagazine.org/wp-content/uploads/2020/01/send-to-mobile-2-1024x576.png
|
||||
[10]: https://addons.mozilla.org/en-US/firefox/addon/gsconnect/
|
||||
[11]: https://chrome.google.com/webstore/detail/gsconnect/jfnifeihccihocjbfcfhicmmgpjicaec
|
||||
[12]: https://fedoramagazine.org/wp-content/uploads/2020/01/commands-1024x576.png
|
||||
[13]: https://userbase.kde.org/KDE_Connect/Tutorials/Useful_commands
|
||||
[14]: https://unsplash.com/@pathum_danthanarayana?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[15]: https://unsplash.com/s/photos/android?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
@ -0,0 +1,118 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Customize your internet with an open source search engine)
|
||||
[#]: via: (https://opensource.com/article/20/2/open-source-search-engine)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
用开源搜索引擎定制你的互联网
|
||||
======
|
||||
|
||||
> 上手开源的对等 Web 索引器 YaCy。
|
||||
|
||||
![Person using a laptop][1]
|
||||
|
||||
很久以前,互联网很小,小到几个人就可以索引它们,这些人收集了所有网站的名称和链接,并按主题将它们分别列在页面或印刷书籍中。随着万维网网络的发展,“网络环”惯例得到了发展,在该惯例中,具有类似的内容、主题或敏感性的站点捆绑在一起,形成了通往每个成员的循环路径。环中任何站点的访问者都可以单击按钮以转到环中的下一个或上一个站点,以发现与其兴趣相关的新站点。
|
||||
|
||||
过了一段时间,互联网似乎变得臃肿不堪了。每个人都在线上,有很多冗余和垃圾邮件,多到让你无法找到任何东西。Yahoo 和 AOL、CompuServe 以及类似的服务各自采用了不同的方法来解决这个问题,但是直到谷歌出现后,现代的搜索模型才得以普及。按谷歌的做法,互联网应该通过搜索引擎进行索引、排序和排名。
|
||||
|
||||
### 为什么选择开源替代品?
|
||||
|
||||
像谷歌和 DuckDuckGo 这样的搜索引擎显然是卓有成效的。你可能是通过搜索引擎访问的本站。尽管对于因主机选择不遵循最佳实践来优化搜索引擎从而使内容陷入困境仍存在争论,但用于管理丰富的文化、知识和轻率的信息(即互联网)的现代解决方案是无情的索引。
|
||||
|
||||
但是也许出于隐私方面的考虑,或者你希望为使互联网更加独立而做出的贡献,你或许不愿意使用谷歌或 DuckDuckGo。如果你对此感兴趣,那么可以考虑参加 [YaCy] [2],这是一个对等互联网索引器和搜索引擎。
|
||||
|
||||
### 安装 YaCy
|
||||
|
||||
要安装并尝试 YaCy,请首先确保已安装 Java。如果你使用的是 Linux,则可以按照我的《[如何在 Linux 上安装 Java][3]》中的说明进行操作。如果你使用 Windows 或 MacOS,请从 [AdoptOpenJDK.net][4] 获取安装程序。
|
||||
|
||||
安装 Java 后,请根据你的平台[下载安装程序][5]。
|
||||
|
||||
如果你使用的是 Linux,请解压缩 tarball 并将其移至 `/opt` 目录:
|
||||
|
||||
```
|
||||
$ sudo tar --extract --file yacy_*z --directory /opt
|
||||
```
|
||||
|
||||
根据下载的安装程序的说明启动 YaCy。
|
||||
|
||||
在 Linux 上,启动在后台运行的 YaCy:
|
||||
|
||||
```
|
||||
$ /opt/startYACY.sh &
|
||||
```
|
||||
|
||||
在 Web 浏览器中,导航到 `localhost:8090` 并进行搜索。
|
||||
|
||||
![YaCy start page][6]
|
||||
|
||||
### 将 YaCy 添加到你的地址栏
|
||||
|
||||
如果你使用的是 Firefox Web 浏览器,则只需单击几下,即可在 Awesome Bar(Mozilla 给 URL 栏起的名称)中将 YaCy 设置为默认搜索引擎。
|
||||
|
||||
首先,如果尚未显示,在 Firefox 工具栏中使专用搜索栏显示出来(你不必使搜索栏保持一直可见;只需要激活它足够长的时间即可添加自定义搜索引擎)。Firefox 右上角的“汉堡”菜单中的“自定义”菜单中提供了搜索栏。在 Firefox 工具栏上的搜索栏可见后,导航至 `localhost:8090`,然后单击刚添加的 Firefox 搜索栏中的放大镜图标。单击选项将 YaCy 添加到你的 Firefox 搜索引擎。
|
||||
|
||||
![Adding YaCy to Firefox][7]
|
||||
|
||||
完成此操作后,你可以在 Firefox 首选项中将其标记为默认值,或者仅在 Firefox 搜索栏中执行的搜索中选择性地使用它。如果将其设置为默认搜索引擎,则可能不需要专用的搜索栏,因为 Awesome Bar 也使用默认引擎,因此可以将其从工具栏中删除。
|
||||
|
||||
### 对等搜索引擎如何工作
|
||||
|
||||
YaCy 是一个开源的分布式搜索引擎。它是用 [Java][8] 编写的,因此可以在任何平台上运行,并且可以执行 Web 爬网、索引和搜索。这是一个对等(P2P)网络,因此每个运行 YaCy 的用户都将努力地不断跟踪互联网的变化情况。当然,没有单个用户能拥有整个互联网的完整索引,因为这将需要一个数据中心来容纳,但是该索引分布在所有 YaCy 用户中且是冗余的。它与 BitTorrent 非常相似(因为它使用分布式哈希表 DHT 来引用索引条目),只不过你所共享的数据是单词和 URL 关联的矩阵。通过混合哈希表返回的结果,没人能告诉谁搜索了哪些单词,因此所有搜索在功能上都是匿名的。这是用于无偏见、无广告、未跟踪和匿名搜索的有效系统,你只需要使用它就加入了它。
|
||||
|
||||
### 搜索引擎和算法
|
||||
|
||||
索引互联网的行为是指将网页分成单个单词,然后将页面的 URL 与每个单词相关联。在搜索引擎中搜索一个或多个单词将获取与该查询关联的所有 URL。YaCy 客户端在运行时也是如此。
|
||||
|
||||
客户端要做的另一件事是为你的浏览器提供搜索界面。你可以将网络浏览器指向 `localhost:8090` 来搜索 YaCy,而不是在要搜索时导航到谷歌。你甚至可以将其添加到浏览器的搜索栏中(取决于浏览器的可扩展性),因此可以从 URL 栏中进行搜索。
|
||||
|
||||
### YaCy 的防火墙设置
|
||||
|
||||
首次开始使用 YaCy 时,它可能运行在“初级”模式下。这意味着你的客户端爬网的站点仅对你可用,因为其他 YaCy 客户端无法访问你的索引条目。要加入对等环境,必须在路由器的防火墙(或者你正在运行的软件防火墙)中打开端口 8090, 这称为“高级”模式。
|
||||
|
||||
如果你使用的是 Linux,则可以在《[使用防火墙让你的 Linux 更加强大][9]》中找到有关计算机防火墙的更多信息。 在其他平台上,请参考操作系统的文档。
|
||||
|
||||
互联网服务提供商(ISP)提供的路由器上几乎总是启用防火墙,并且这里有太多种类的防火墙无法准确说明。大多数路由器都提供了在防火墙中“打洞”的选项,因为许多流行的联网游戏都需要双向流量。
|
||||
|
||||
如果你知道如何登录路由器(通常为 192.168.0.1 或 10.1.0.1,但可能因制造商的设置而异),则登录并查找配置面板来控制“防火墙”或“端口转发”或“应用”。
|
||||
|
||||
找到路由器防火墙的首选项后,将端口 8090 添加到白名单。例如:
|
||||
|
||||
![Adding YaCy to an ISP router][10]
|
||||
|
||||
如果路由器正在进行端口转发,则必须使用相同的端口将传入的流量转发到计算机的 IP 地址。例如:
|
||||
|
||||
![Adding YaCy to an ISP router][11]
|
||||
|
||||
如果由于某种原因无法调整防火墙设置,那也没事。YaCy 将继续以初级模式运行并作为对等搜索网络的客户端运行。
|
||||
|
||||
### 你的互联网
|
||||
|
||||
使用 YaCy 搜索引擎可以做的不仅仅是被动搜索。你可以强制抓取不太显眼的网站,可以请求对网站进行网络抓取,可以选择使用 YaCy 进行本地搜索,等等。你可以更好地控制*你的*互联网的外观。高级用户越多,索引的网站就越多。索引的网站越多,所有用户的体验就越好。加入吧!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/open-source-search-engine
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
|
||||
[2]: https://yacy.net/
|
||||
[3]: https://linux.cn/article-11614-1.html
|
||||
[4]: https://adoptopenjdk.net/releases.html
|
||||
[5]: https://yacy.net/download_installation/
|
||||
[6]: https://opensource.com/sites/default/files/uploads/yacy-startpage.jpg (YaCy start page)
|
||||
[7]: https://opensource.com/sites/default/files/uploads/yacy-add-firefox.jpg (Adding YaCy to Firefox)
|
||||
[8]: https://opensource.com/resources/java
|
||||
[9]: https://opensource.com/article/19/7/make-linux-stronger-firewalls
|
||||
[10]: https://opensource.com/sites/default/files/uploads/router-add-app.jpg (Adding YaCy to an ISP router)
|
||||
[11]: https://opensource.com/sites/default/files/uploads/router-add-app1.jpg (Adding YaCy to an ISP router)
|
@ -0,0 +1,99 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What is WireGuard? Why Linux Users Going Crazy Over it?)
|
||||
[#]: via: (https://itsfoss.com/wireguard/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
什么是 WireGuard?为什么 Linux 用户对它疯狂?
|
||||
======
|
||||
|
||||
从普通的 Linux 用户到 Linux 创建者 [Linus Torvalds][1],每个人都对 WireGuard 很感兴趣。什么是 WireGuard,它为何如此特别?
|
||||
|
||||
### 什么是 WireGuard?
|
||||
|
||||
![][2]
|
||||
|
||||
[WireGuard][3] 是一个易于配置、快速且安全的开源 [VPN][4],它利用了最新的加密技术。目的是提供一种更快、更简单、更精简的通用 VPN,它可以轻松地在树莓派这类低端设备到高端服务器上部署。
|
||||
|
||||
|
||||
[IPsec][5] 和 OpenVPN 等大多数其他解决方案是几十年前开发的。安全研究人员和内核开发人员 Jason Donenfeld 意识到它们速度慢且难以正确配置和管理。
|
||||
|
||||
这让他创建了一个新的开源 VPN 协议和解决方案,它更加快速、安全、易于部署和管理。
|
||||
|
||||
WireGuard 最初是为 Linux 开发的,但现在可用于 Windows、macOS、BSD、iOS 和 Android。它仍在活跃开发中。
|
||||
|
||||
### 为什么 WireGuard 如此受欢迎?
|
||||
|
||||
![][6]
|
||||
|
||||
除了可以跨平台之外,WireGuard 的最大优点之一就是易于部署。配置和部署 WireGuard 就像配置和使用 SSH 一样容易。
|
||||
|
||||
看看 [WireGuard 设置指南][7]。安装 WireGuard、生成公钥和私钥(像 SSH 一样),设置防火墙规则并启动服务。现在将它和 [OpenVPN 设置指南][8]进行比较。它有太多要做的了。
|
||||
|
||||
WireGuard 的另一个好处是它有一个仅 4000 行代码的精简代码库。将它与 [OpenVPN][9](另一个流行的开源 VPN)的 100,000 行代码相比。显然,调试W ireGuard 更加容易。
|
||||
|
||||
不要小看它的简单。WireGuard 支持所有最新的加密技术,例如 [Noise协议框架][10]、[Curve25519][11]、[ChaCha20][12]、[Poly1305][13]、[BLAKE2][14]、[SipHash24][15]、[HKDF][16] 和安全受信任结构。
|
||||
|
||||
由于 WireGuard 运行在[内核空间][17],因此可以高速提供安全的网络。
|
||||
|
||||
这些是 WireGuard 越来越受欢迎的一些原因。Linux 创造者 Linus Torvalds 非常喜欢 WireGuard,以至于将其合并到 [Linux Kernel 5.6][18] 中:
|
||||
|
||||
> 我能否再次声明对它的爱,并希望它能很快合并?也许代码不是完美的,但我已经忽略,与 OpenVPN 和 IPSec 的恐怖相比,这是一件艺术品。
|
||||
>
|
||||
> Linus Torvalds
|
||||
|
||||
### 如果 WireGuard 已经可用,那么将其包含在 Linux 内核中有什么大惊小怪的?
|
||||
|
||||
这可能会让新的 Linux 用户感到困惑。你知道可以在 Linux 上安装和配置 WireGuard VPN 服务器,但同时会看到 Linux Kernel 5.6 将包含 WireGuard 的消息。让我向您解释。
|
||||
|
||||
目前,你可以将 WireGuard 作为[内核模块][19]安装在 Linux 中。诸如 VLC、GIMP 等常规应用安装在 Linux 内核之上(在 [用户空间][20]中),而不是内部。
|
||||
|
||||
当将 WireGuard 安装为内核模块时,基本上是自行修改 Linux 内核并向其添加代码。从 5.6 内核开始,你无需手动添加内核模块。默认情况下它将包含在内核中。
|
||||
|
||||
在 5.6 内核中包含 WireGuard 很有可能[扩展 WireGuard 的采用,从而改变当前的 VPN 场景][21]。
|
||||
|
||||
**总结**
|
||||
|
||||
WireGuard 之所以受欢迎是有充分理由的。诸如 [Mullvad VPN][23] 之类的一些流行的[关注隐私的 VPN][22] 已经在使用 WireGuard,并且在不久的将来,采用率可能还会增长。
|
||||
|
||||
希望你对 WireGuard 有所了解。与往常一样,欢迎提供反馈。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/wireguard/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/linus-torvalds-facts/
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/wireguard.png?ssl=1
|
||||
[3]: https://www.wireguard.com/
|
||||
[4]: https://en.wikipedia.org/wiki/Virtual_private_network
|
||||
[5]: https://en.wikipedia.org/wiki/IPsec
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/wireguard-logo.png?ssl=1
|
||||
[7]: https://www.linode.com/docs/networking/vpn/set-up-wireguard-vpn-on-ubuntu/
|
||||
[8]: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04
|
||||
[9]: https://openvpn.net/
|
||||
[10]: https://noiseprotocol.org/
|
||||
[11]: https://cr.yp.to/ecdh.html
|
||||
[12]: https://cr.yp.to/chacha.html
|
||||
[13]: https://cr.yp.to/mac.html
|
||||
[14]: https://blake2.net/
|
||||
[15]: https://131002.net/siphash/
|
||||
[16]: https://eprint.iacr.org/2010/264
|
||||
[17]: http://www.linfo.org/kernel_space.html
|
||||
[18]: https://itsfoss.com/linux-kernel-5-6/
|
||||
[19]: https://wiki.archlinux.org/index.php/Kernel_module
|
||||
[20]: http://www.linfo.org/user_space.html
|
||||
[21]: https://www.zdnet.com/article/vpns-will-change-forever-with-the-arrival-of-wireguard-into-linux/
|
||||
[22]: https://itsfoss.com/best-vpn-linux/
|
||||
[23]: https://mullvad.net/en/
|
@ -0,0 +1,118 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chai-yuan)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Playing Music on your Fedora Terminal with MPD and ncmpcpp)
|
||||
[#]: via: (https://fedoramagazine.org/playing-music-on-your-fedora-terminal-with-mpd-and-ncmpcpp/)
|
||||
[#]: author: (Carmine Zaccagnino https://fedoramagazine.org/author/carzacc/)
|
||||
|
||||
使用MPD和ncmpcpp在你的Fedora终端上播放音乐
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
MPD(Music Playing Daemon),顾名思义,是一个音乐(Music)播放(Playing)程序(Daemon)。它可以播放音乐,并且作为一个守护进程,任何软件都可以与之交互并播放声音,包括一些CLI客户端。
|
||||
|
||||
其中一个被称为 _ncmpcpp_ ,它是对之前NNCMPCI工具的改进。名字的变化与他们所写的语言没有太大关系:都是C++,但称为 _ncmpcpp_ ,因为它是 _NCurses Music Playing Client_ _Plus Plus_ .
|
||||
|
||||
### 安装 MPD 和 ncmpcpp
|
||||
|
||||
_ncmpmpcc_ 的客户端可以从官方Fedora库中通过dnf命令直接安装.
|
||||
|
||||
```
|
||||
$ sudo dnf install ncmpcpp
|
||||
```
|
||||
|
||||
另一方面,MPD必须从RPMFusion free库安装,你可以通过运行:
|
||||
|
||||
```
|
||||
$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
|
||||
```
|
||||
|
||||
然后你可以运行下面的命令安装它:
|
||||
|
||||
```
|
||||
$ sudo dnf install mpd
|
||||
```
|
||||
|
||||
### 配置并启用 MPD
|
||||
|
||||
设置MPD最简单的方法是以普通用户的身份运行它。默认情况是以专用 _mpd_ 用户的身份运行它,但这会导致各种权限问题。
|
||||
|
||||
在运行它之前,我们需要创建一个本地配置文件,允许我们作为普通用户运行。
|
||||
|
||||
首先创建一个名叫 _mpd_ 的目录在 _~/.config_ 里:
|
||||
|
||||
```
|
||||
$ mkdir ~/.config/mpd
|
||||
```
|
||||
|
||||
将配置文件拷贝到此目录下:
|
||||
|
||||
```
|
||||
$ cp /etc/mpd.conf ~/.config/mpd
|
||||
```
|
||||
|
||||
然后用 _vim_, _nano_ 或 _gedit_之类的软件编辑它:
|
||||
|
||||
```
|
||||
$ nano ~/.config/mpd/mpd.conf
|
||||
```
|
||||
|
||||
我建议您通读所有内容,检查是否有任何需要做的事情,但对于大多数设置,您可以删除所有内容,只需保留以下内容:
|
||||
|
||||
```
|
||||
db_file "~/.config/mpd/mpd.db"
|
||||
log_file "syslog"
|
||||
```
|
||||
|
||||
现在你可以运行它了:
|
||||
|
||||
```
|
||||
$ mpd
|
||||
```
|
||||
|
||||
没有报错,这将在后台启动MPD守护进程。
|
||||
|
||||
### 使用 ncmpcpp
|
||||
|
||||
只需运行:
|
||||
|
||||
```
|
||||
$ ncmpcpp
|
||||
```
|
||||
|
||||
您将在终端中看到一个由ncurses所支持的图形用户界面。
|
||||
|
||||
按下 _4_ 键,然后就可以看到本地的音乐目录,用方向键进行选择并按下 _Enter_ 进行播放。
|
||||
|
||||
多播放几次就会创建一个 _playlist_, 让你可以使用 _>_ 键(不是右箭头, _>_ 是右尖括号) 移动到下一首,并使用 _<_ 返回上一首. + 和 – 键可以调节音量. _Q_ 键可以让你退出 ncmpcpp 但不停止播放音乐. 你可以按下 _P_ 来控制暂停和播放.
|
||||
|
||||
你可以按下 _1_ 键来查看当前播放列表 (这是默认的视图). 从这个视图中,您可以按 _i_ 查看有关当前歌曲的信息(标记)。按 _6_ 可更改当前歌曲的标记。
|
||||
|
||||
按 _\_ 按钮将在视图顶部添加(或删除)信息面板。在左上角,你可以看到如下的内容:
|
||||
|
||||
```
|
||||
[------]
|
||||
```
|
||||
|
||||
按下 _r_, _z_, _y_, _R_, _x_ 将会分别切换到 _repeat_, _random_, _single_, _consume_ 和 _crossfade_ 播放模式并将小指示器中的 _–_ 字符替换为选定模式.
|
||||
|
||||
按下 _F1_ 键将会显示一些帮助文档,包含一系列的键绑定列表, 因此无需在此处编写完整列表。所以继续吧!做一个极客, 在你的终端上播放音乐!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/playing-music-on-your-fedora-terminal-with-mpd-and-ncmpcpp/
|
||||
|
||||
作者:[Carmine Zaccagnino][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[chai-yuan](https://github.com/chai-yuan)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/carzacc/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/play_music_mpd-816x346.png
|
||||
[2]: https://rpmfusion.org/Configuration
|
@ -0,0 +1,99 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (HankChow)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Top hacks for the YaCy open source search engine)
|
||||
[#]: via: (https://opensource.com/article/20/2/yacy-search-engine-hacks)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
使用开源搜索引擎 YaCy 的技巧
|
||||
======
|
||||
> 不想再受制于各种版本的搜索引擎?使用 YaCy 自定义一款吧。
|
||||
![Browser of things][1]
|
||||
|
||||
在我以前介绍 [YaCy 入门][2]的文章中讲述过 [YaCy][3] 这个<ruby>点对点<rt>peer-to-peer</rt></ruby>式的搜索引擎是如何安装和使用的。YaCy 最大的一个特点就是可以在本地部署,全球范围内的每一个 YaCy 用户都是构成整个分布式搜索引擎架构的其中一个节点,因此每个用户都可以掌控自己的互联网搜索体验。
|
||||
|
||||
Google 曾经提供过 `google.com/linux` 这样的简便方式以便快速筛选出和 Linux 相关的搜索内容,这个功能受到了很多人的青睐,但 Google 最终还是在 2011 年的时候把它[下线][4]了。
|
||||
|
||||
而 YaCy 则让自定义搜索引擎变得可能。
|
||||
|
||||
### 自定义 YaCy
|
||||
|
||||
YaCy 安装好之后,只需要访问 `localhost:8090` 就可以使用了。要开始自定义搜索引擎,只需要点击右上角的“<ruby>管理<rt>Administration</rt></ruby>”按钮,如果没有找到,需要点击菜单图标打开菜单。
|
||||
|
||||
你可以在管理面板中配置 YaCy 对系统资源的使用策略,以及如何跟其它的 YaCy 客户端进行交互。
|
||||
|
||||
![YaCy profile selector][5]
|
||||
|
||||
例如,点击侧栏中的“<ruby>初步<rt>First steps</rt></ruby>”按钮可以配置备用端口,以及设置 YaCy 对内存和硬盘的使用量;而“<ruby>监控<rt>Monitoring</rt></ruby>”面板则可以监控 YaCy 的运行状况。大多数功能都只需要在面板上点击几下就可以完成了,例如以下几个常用的功能。
|
||||
|
||||
### 搜索应用
|
||||
|
||||
目前市面上也有不少公司推出了[内网搜索应用][6],而 YaCy 的优势是免费使用。对于能够通过 HTTP、FTP、Samba 等协议访问的文件,YaCy 都可以进行索引,因此无论是作为私人的文件搜索还是企业内部的本地共享文件搜索,YaCy 都可以实现。它可以让内部网络中的用户使用自定义配置的 YaCy 查找共享文件,于此同时保持对内部网络以外的用户不可见。
|
||||
|
||||
### 网络配置
|
||||
|
||||
YaCy 在默认情况下就对隐私隔离有比较好的支持。点击“<ruby>用例与账号<rt>Use Case & Account</rt></ruby>”页面顶部的“<ruby>网络配置<rt>Network Configuration</rt></ruby>”链接,即可进入网络配置面板设置点对点网络。
|
||||
|
||||
![YaCy network configuration][7]
|
||||
|
||||
### 爬取站点
|
||||
|
||||
YaCy 点对点的分布式运作方式决定了它对页面的爬取是由用户驱动的。任何一个公司的爬虫都不可能完全访问到整个互联网上的所有页面,对于 YaCy 来说也是这样,一个站点只有在被用户指定爬取的前提下,才会被 YaCy 爬取并进入索引。
|
||||
|
||||
YaCy 客户端提供了两种爬取页面的方式:一是自定义爬虫,二是使用 YaCy 推荐的爬虫。
|
||||
|
||||
![YaCy advanced crawler][8]
|
||||
|
||||
#### 自定义爬虫任务
|
||||
|
||||
自定义爬虫是指由用户输入指定的网站 URL 并启动 YaCy 的爬虫任务。只需要点击“<ruby>高级爬虫<rt>Advanced Crawler</rt></ruby>”并输入计划爬取的 URL,然后选择页面底部的“<ruby>进行远程索引<rt>Do Remote indexing</rt></ruby>”选项,这个选项会让客户端将上面输入的 URL 向互联网广播,接收到广播的其它远程客户端就会开始爬取这些 URL 所指向的页面。
|
||||
|
||||
点击页面底部的“<ruby>开始新爬虫任务<rt>Start New Crawl Job</rt></ruby>”按钮就可以开始进行爬取了,我就是这样对一些常用和有用站点进行爬取和索引的。
|
||||
|
||||
爬虫任务启动之后,YaCy 会将这些 URL 对应的页面在本地生成和存储索引。在高级模式下,也就是本地计算机允许 8090 端口流量进出时,全网的 YaCy 用户都可以使用到这一份索引。
|
||||
|
||||
#### 加入爬虫任务
|
||||
|
||||
尽管 YaCy 用户已经在互联网上爬取了很多页面,但对于全网浩如烟海的页面而言也只是沧海一粟。单个用户所拥有的资源远不及很多大公司的网络爬虫,但大量 YaCy 用户如果联合起来成为一个社区,能产生的力量就大得多了。只要开启了 YaCy 的爬虫请求广播功能,就可以让其它客户端参与进来爬取更多页面。
|
||||
|
||||
只需要在“<ruby>高级爬虫<rt>Advanced Crawler</rt></ruby>”面板中点击页面顶部的“<ruby>远程爬取<rt>Remote Crawling</rt></ruby>”,勾选“<ruby>加载<rt>Load</rt></ruby>”复选框,就可以让你的客户端接受其它人发来的爬虫任务请求了。
|
||||
|
||||
![YaCy remote crawling][9]
|
||||
|
||||
### YaCy 监控相关
|
||||
|
||||
YaCy 除了作为一个非常强大的搜索引擎,还提供了很丰富的用户体验。你可以在“<ruby>监控<rt>Monitor</rt></ruby>”面板中监控 YaCy 客户端的网络运行状况,甚至还可以了解到有多少人从 YaCy 社区中获取到了自己所需要的东西。
|
||||
|
||||
![YaCy monitoring screen][10]
|
||||
|
||||
### 搜索引擎发挥了作用
|
||||
|
||||
你使用 YaCy 的时间越长,就越会思考搜索引擎如何改变自己的视野,因为你对互联网的体验很大一部分来自于你在搜索引擎中一次次简单查询的结果。实际上,当你和不同行业的人交流时,可能会注意到每个人对“互联网”的理解都有所不同。有些人会认为,互联网的搜索引擎中充斥着各种广告和推广,同时也仅仅能从搜索结果中获取到有限的信息。例如,假设有人不断搜索关于关键词 X 的内容,那么大部分商业搜索引擎都会在搜索结果中提高关键词 X 的权重,但与此同时,另一个关键词 Y 的权重则会相对降低,从而让关键词 Y 被淹没在搜索结果当中。
|
||||
|
||||
就像在现实生活中一样,走出舒适圈会让你看到一个更广阔的世界。尝试使用 YaCy,看看你会不会有所收获。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/yacy-search-engine-hacks
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[HankChow](https://github.com/HankChow)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things)
|
||||
[2]: https://opensource.com/article/20/2/open-source-search-engine
|
||||
[3]: https://yacy.net/
|
||||
[4]: https://www.linuxquestions.org/questions/linux-news-59/is-there-no-more-linux-google-884306/
|
||||
[5]: https://opensource.com/sites/default/files/uploads/yacy-profiles.jpg (YaCy profile selector)
|
||||
[6]: https://en.wikipedia.org/wiki/Vivisimo
|
||||
[7]: https://opensource.com/sites/default/files/uploads/yacy-network-config.jpg (YaCy network configuration)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/yacy-advanced-crawler.jpg (YaCy advanced crawler)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/yacy-remote-crawl-accept.jpg (YaCy remote crawling)
|
||||
[10]: https://opensource.com/sites/default/files/uploads/yacy-monitor.jpg (YaCy monitoring screen)
|
@ -0,0 +1,105 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Dino is a Modern Looking Open Source XMPP Client)
|
||||
[#]: via: (https://itsfoss.com/dino-xmpp-client/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Dino 是一个有着现代外观的开源 XMPP 客户端
|
||||
======
|
||||
|
||||
_**简介:Dino 是一个相对较新的开源 XMPP 客户端,它尝试提供良好的用户体验,同时鼓励注重隐私的用户使用 XMPP 发送消息。**_
|
||||
|
||||
### Dino:一个开源 XMPP 客户端
|
||||
|
||||
![][1]
|
||||
|
||||
[XMPP][2] (可扩展通讯和表示协议) 是一个去中心化的网络模型,可促进即时消息传递和协作。去中心化意味着没有中央服务器可以访问你的数据。通信直接点对点。
|
||||
|
||||
我们中的一些人可能会称它为"老派"技术,可能是因为 XMPP 客户端通常有着非常糟糕的用户体验,或者仅仅是因为它需要时间来适应(或设置它)。
|
||||
|
||||
这时候 [Dino[3] 作为现代 XMPP 客户端出现了,在不损害你的隐私的情况下提供干净清爽的用户体验。
|
||||
|
||||
### 用户体验
|
||||
|
||||
![][4]
|
||||
|
||||
Dino 有试图改善 XMPP 客户端的用户体验,但值得注意的是,它的外观和感受将在一定程度上取决于你的 Linux 发行版。你的图标主题或 Gnome 主题会让你的个人体验更好或更糟。
|
||||
|
||||
从技术上讲,它的用户界面非常简单,易于使用。所以,我建议你看下 Ubuntu 中的[最佳图标主题][5]和 [GNOME 主题][6]来调整 Dino 的外观。
|
||||
|
||||
### Dino 的特性
|
||||
|
||||
![Dino Screenshot][7]
|
||||
|
||||
你可以期望将 Dino 用作 Slack、[Signal][8] 或 [Wire][9] 的替代产品,来用于你的业务或个人用途。
|
||||
|
||||
它提供了消息应用所需的所有基本特性,让我们看下你可以从中得到的:
|
||||
|
||||
* 去中心化通信
|
||||
* 如果无法设置自己的服务器,它支持公共 XMPP 的服务器
|
||||
* 和其他流行消息应用相似的 UI,因此易于使用
|
||||
* 图像和文件共享
|
||||
* 支持多个帐户
|
||||
* 高级消息搜索
|
||||
* 支持 [OpenPGP][10] 和 [OMEMO][11] 加密
|
||||
* 轻量级原生桌面应用
|
||||
|
||||
|
||||
|
||||
### 在 Linux 上安装 Dino
|
||||
|
||||
你可能会发现它列在你的软件中心中,也可能未找到。Dino 为基于 Debian(deb)和 Fedora(rpm)的发行版提供了可用的二进制文件。
|
||||
|
||||
**对于 Ubuntu:**
|
||||
|
||||
Dino 在 Ubuntu 的 universe 仓库中,你可以使用以下命令安装它:
|
||||
|
||||
```
|
||||
sudo apt install dino-im
|
||||
```
|
||||
|
||||
类似地,你可以在 [GitHub 分发包页面][12]上找到其他 Linux 发行版的包。
|
||||
|
||||
如果你想要获取最新的,你可以在 [OpenSUSE 的软件页面][13]找到 Dino 的 **.deb** 和 .**rpm** (每日构建版)安装在 Linux 中。
|
||||
|
||||
在任何一种情况下,前往它的 [Github 页面][14]或点击下面的链接访问官方网站。
|
||||
|
||||
[下载 Dino][3]
|
||||
|
||||
**总结**
|
||||
|
||||
它工作良好没有出过任何问题(在我编写这篇文章时快速测试过它)。我将尝试探索更多,并希望能涵盖更多有关 XMPP 的文章来鼓励用户使用 XMPP 的客户端和服务器用于通信。
|
||||
|
||||
你觉得 Dino 怎么样?你会推荐另一个可能好于 Dino 的开源 XMPP 客户端吗?在下面的评论中让我知道你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/dino-xmpp-client/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-main.png?ssl=1
|
||||
[2]: https://xmpp.org/about/
|
||||
[3]: https://dino.im/
|
||||
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-xmpp-client.jpg?ssl=1
|
||||
[5]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/
|
||||
[6]: https://itsfoss.com/best-gtk-themes/
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/dino-screenshot.png?ssl=1
|
||||
[8]: https://itsfoss.com/signal-messaging-app/
|
||||
[9]: https://itsfoss.com/wire-messaging-linux/
|
||||
[10]: https://www.openpgp.org/
|
||||
[11]: https://en.wikipedia.org/wiki/OMEMO
|
||||
[12]: https://github.com/dino/dino/wiki/Distribution-Packages
|
||||
[13]: https://software.opensuse.org/download.html?project=network:messaging:xmpp:dino&package=dino
|
||||
[14]: https://github.com/dino/dino
|
||||
|
101
translated/tech/20200213 Why developers like to code at night.md
Normal file
101
translated/tech/20200213 Why developers like to code at night.md
Normal file
@ -0,0 +1,101 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Morisun029)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Why developers like to code at night)
|
||||
[#]: via: (https://opensource.com/article/20/2/why-developers-code-night)
|
||||
[#]: author: (Matt Shealy https://opensource.com/users/mshealy)
|
||||
|
||||
开发人员为什么喜欢在晚上编码
|
||||
======
|
||||
对许多开源程序员来说,夜间工作计划是创造力和生产力来源的关键。
|
||||
![Person programming on a laptop on a building][1]
|
||||
|
||||
|
||||
如果你问大多数开发人员更喜欢在什么时候工作,大部人会说他们最高效的时间在晚上。这对于那些在工作之余为开源项目做贡献的人来说更是如此(尽管如此,希望在他们的健康范围内[避免透支][2])。
|
||||
|
||||
有些人喜欢从晚上开始,一直工作到凌晨,而另一些人则很早就起床(例如,凌晨4点),以便在开始日常工作之前完成大部分编程工作。
|
||||
|
||||
这种工作习惯可能会使许多开发人员看起来像个怪胎和不称职。 但是,为什么有这么多的程序员喜欢在非正常时间工作,这其中有很多原因:
|
||||
|
||||
### maker 日程
|
||||
|
||||
根据[Paul Graham][3]的观点, "生产东西" 的人倾向于遵守 maker's schedule—他们更愿意以半天或更长时间为单位使用时间。事实上,大多数 [开发人员也有相同的偏好][4].
|
||||
|
||||
一方面,开发人员从事大型抽象系统工作,需要思维空间来处理整个模型。 将他们的日程分割成15分钟或30分钟的时间段来处理电子邮件,会议,电话以及来自同事的打断,工作效果只会适得其反。
|
||||
|
||||
另一方面,通常不可能以一个小时为单位进行有效编程。 因为这么短的时间几乎不够来处理当前的任务并开始工作。
|
||||
|
||||
上下文切换也会对编程产生不利影响。 在晚上工作,开发人员可以避免尽可能多的干扰。 在没有持续中断的情况下,他们可以花几个小时专注于手头任务,并尽可能提高工作效率。
|
||||
|
||||
### 平和安静的环境
|
||||
|
||||
由于晚上或凌晨不太会有来自各种活动的噪音(例如,办公室闲谈,街道上的交通),这使许多程序员感到放松,促使他们更具创造力和生产力,特别是在处理诸如编码之类的精神刺激任务时。
|
||||
|
||||
独处与平和,加上知道自己将有几个小时不被中断的工作时间,通常会使他们摆脱白天工作计划相关的时间压力,从而产出高质量的工作。
|
||||
|
||||
更不用说了,当解决了一个棘手的问题后,没有什么比尽情享受自己最喜欢的午夜小吃更美好的事情了!
|
||||
|
||||
|
||||
### 沟通
|
||||
|
||||
与在公司内里工作的程序员相比,从事开源项目的开发人员可以拥有不同的沟通节奏。 大多数开源项目的沟通都是通过邮件或 GitHub 上的评论等渠道异步完成。 很多时候,其他程序员在不同的国家和时区,因此实时交流通常需要开发人员变成一个夜猫子。
|
||||
|
||||
### 昏昏欲睡的大脑
|
||||
|
||||
|
||||
这听起来可能违反直觉,但是随着时间的推移,大脑会变得非常疲倦,因此只能专注于一项任务。 晚上工作从根本上消除了多任务处理,多任务处理是保持专注和高效的主要障碍。 当大脑处于昏昏欲睡的状态时,你是无法保持专注的!
|
||||
|
||||
许多开发人员在入睡时思考要解决的问题通常会取得重大进展。 潜意识开始工作,答案通常在他们半睡半醒的早些时候就出现了。
|
||||
|
||||
这不足为奇,因为[睡眠可增强大脑功能][5],可帮助我们理解新信息并进行更有创造性的思考。当解决方案在凌晨出现时,这些开发人员便会起来并开始工作,不错过任何机会。
|
||||
|
||||
|
||||
|
||||
### 灵活和创造性思考
|
||||
|
||||
许多程序员体会到晚上创造力会提升。 前额叶皮层,即与集中能力有关的大脑部分,在一天结束时会感到疲倦。 这似乎为某些人提供了更灵活和更具创造性的思考。
|
||||
|
||||
匹兹堡大学医学院精神病学助理教授[Brant Hasler][6] 表示:“由于自上而下的控制和'认知抑制'功能较少,大脑可能会解放出来进行更多样化的思考,从而使人们更容易地将不同概念之间的联系建立起来。” 结合轻松环境所带来的积极情绪,开发人员可以更轻松地产生创新想法。
|
||||
|
||||
此外,在没有干扰的情况下集中精力几个小时,“沉浸在你做的事情中”。 这可以帮助你更好地专注于项目并参与其中,而不必担心周围发生的事情。
|
||||
|
||||
### 明亮的电脑屏幕
|
||||
|
||||
|
||||
因为整天看着明亮的屏幕, 许多程序员的睡眠周期被延迟。电脑屏幕发出的蓝光[扰乱我们的昼夜节律][7]通过延迟释放诱发睡眠的褪黑激素和提高人的机敏性将人体生物钟重置到更晚的时间。从而导致,开发人员往往睡得越来越晚。
|
||||
|
||||
### 过去的影响
|
||||
|
||||
过去,大多数开发人员是出于必要在晚上工作,因为在白天当公司其他人都在使用服务器时,共享服务器的计算能力支撑不了编程工作,所以开发人员需要等到深夜才能执行白天无法进行的任务,例如测试项目,运行大量的代码编译运行调试周期以及部署新代码。现在尽管服务器功能变强大了,大多数可以满足需求,但夜间工作的趋势仍是这种文化的一部分。
|
||||
|
||||
### 结语
|
||||
|
||||
尽管开发人员喜欢在晚上工作出于多种原因,但请记住,成为夜猫子并不意味着你应该克扣睡眠时间。 睡眠不足会导致压力和焦虑,并最终导致倦怠。
|
||||
|
||||
获得足够质量的睡眠是维持良好身体健康和大脑功能的关键。 例如,它可以帮助你整合新信息,巩固记忆,创造性思考,清除身体积聚的毒素,调节食欲并防止过早衰老。
|
||||
|
||||
无论你是哪种日程,请确保让你的大脑得到充分的休息,这样你就可以在一整天及每天的工作中发挥最大的作用!
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/2/why-developers-code-night
|
||||
|
||||
作者:[Matt Shealy][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[Morisun029](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/mshealy
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building)
|
||||
[2]: https://opensource.com/article/19/11/burnout-open-source-communities
|
||||
[3]: http://www.paulgraham.com/makersschedule.html
|
||||
[4]: https://www.chamberofcommerce.com/business-advice/software-development-trends-overtaking-the-market
|
||||
[5]: https://amerisleep.com/blog/sleep-impacts-brain-health/
|
||||
[6]: https://www.vice.com/en_us/article/mb58a8/late-night-creativity-spike
|
||||
[7]: https://www.sleepfoundation.org/articles/how-blue-light-affects-kids-sleep
|
Loading…
Reference in New Issue
Block a user