Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu.Wang 2019-01-21 11:29:46 +08:00
commit 5952bdc0a4
14 changed files with 483 additions and 484 deletions

View File

@ -0,0 +1,111 @@
4 个值得一提的 Firefox 扩展插件
======
> 这些扩展可以使火狐更具生产力和使用乐趣。
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/firefox_blue_lead.jpg?itok=gYaubJUv)
自从大约 12 年前 Firefox火狐浏览器v2.0 推出以来, 我一直是它的用户。它不是那时最好的网络浏览器,但是总会有一个理由让我回到它:我最喜爱的浏览器扩展插件不能工作在其它浏览器上。
如今,我喜欢现下的 Firefox因为它快速、可定制和开源我也很欣赏那些体现了原开发人员从未想到过的想法的扩展插件如果你想在没有鼠标的情况下浏览网页呢如果你不喜欢盯着晚上从显示器里发出来的强光呢如何在 YouTube 和其他视频托管网站上使用一个更专业的播放器来获得更好的性能和更多播放控制呢?如果你需要更复杂的方法来禁用跟踪器和加快加载页面,该怎么办?
幸运的是,这些问题都有答案,我将展现给你我最喜爱的扩展 —— 所有这些都是免费软件或开源的 (即,在 [GNU GPL][1]、[MPL][2] 或 [Apache][3] 许可帧下) ,它们可以使一个优秀的浏览器更优秀。
尽管术语<ruby>加载项<rt>add-on</rt></ruby><ruby>扩展<rt>extension</rt></ruby>的含义稍微不同,但我在本文中的使用不会区分它们。
### Tridactyl
![Tridactyl screenshot][5]
*Tridactyl 的新选项卡页面,展示了链接的指引。*
[Tridactyl][6] 使你能够在大多数浏览活动中使用键盘。它的灵感来自于现已不复存在的 [Vimperator][7] 和 [Pentadactyl][8],而它们受到了 [Vim][9] 的默认键绑定的启发。由于我已经习惯了 Vim 和其他命令行应用程序,我发现了它的功能类似于使用键值 `h/j/k/l` 进行导航,用 `f/F` 可以与超链接进行交互,而且创建自定义的键绑定和命令非常方便。
Tridactyl 最近刚刚实现了一个可选的本地信使(目前,仅适用于 GNU/Linux 和 Mac OSX提供了更酷的功能。例如有了它你可以隐藏 Firefox 用户界面上的一些元素(以 Vimperator 和 Pentadactyl 的方式)、在外部程序中打开链接或当前页(我经常用 [mpv][10] 和 [youtube-dl][11] 播放视频)、通过按 `Ctrl-I`(或者任意你选择的组合键)用你喜爱的编辑器来编辑文本框的内容。
话虽如此,但要记住,这是一个相对早期的项目,细节可能还是很粗糙。另一方面,它的开发非常活跃,当你回顾它早期的缺陷时,未尝不是一种乐趣。
### Open With
![Open With Screenshot][13]
*Open With 提供的菜单。我可以用这里列出的一个外部程序打开当前页面。*
说到与外部程序的互动,有时能够用鼠标来做到这一点还是让人很高兴的。这是 [Open With][14] 的用武之地。
除了添加的上下文菜单(如屏幕截图所示)之外,你还可以通过单击加载项栏上的扩展图标来找到自己定义的命令。如[它在 Mozilla Add-ons 页面上][14] 的图标和描述所示,它主要是为了切换到其它的 web 浏览器,但我也可以轻松地将它与 mpv 和 youtube-dl 相配合。
它也提供了键盘快捷方式但它们受到了严重限制。可以在扩展设置的下拉列表中选择的组合不超过三种。相反Tridactyl 允许我将命令分配给几乎任何没有被 Firefox 所阻止的东西。没错Open With 目前为鼠标而准备的。
### Stylus
![Stylus Screenshot][16]
*在这个屏幕截图中,我刚刚搜索并为当前正在浏览的 Stylus 的网站安装了一个黑暗主题。即使是弹出窗口也可以定制风格(称为 Deepdark Stylus*
[Stylus][17] 是一个用户样式管理器,这意味着可以通过编写自定义 CSS 规则并将其加载到 Stylus 中来更改任何网页的外观。如果你不懂 CSS在如 [userstyles.org][18] 这样网站上有大量的其他人制作的样式。
现在,你可能会问,“这不就是 [Stylish][19] 么?” 你是对的Stylus 是基于 Stylish 的,并提供了更多的改进:它不包含任何远程记录、尊重你的隐私,所有开发都是公开的(尽管 Stylish 仍在积极开发,我一直未能找到最新版本的源代码),而且它还支持 [UserCSS][20]。
UserCSS 是一种有趣的格式,尤其是对于开发人员来说。我已经为不同的网站写了几种用户样式(主要是黑暗主题,和为了提高可读性的调整),虽然 Stylus 的内部编辑器很好,我还是喜欢用 Neovim 编辑代码。为了做到这样我所需要做的就是用 “.user.css” 作为本地加载文件的后缀名,在 Stylus 里启动 “Live Reload” 选项,只要我在 Neovim 中保存文件就会应用所有的更改。它也支持远程 UserCSS 文件,因此,每当我将更改推送到 GitHub 或任何基于 git 的开发平台时,它们将自动对用户可用。(我提供了指向该文件的原始版本的链接,以便他们可以轻松地访问它。)
### uMatrix
![uMatrix Screenshot][22]
*uMatrix 的用户界面,显示当前访问过的网页的当前规则。*
Jeremy Garcia 在他发表在 Opensource.com 的[文章][23]中提到了一个优秀的拦截器 uBlock Origin。我想提请大家关注另一个由 [gorhill][24] 开发的扩展插件: uMatrix 。
[uMatrix][25] 允许你为网页上的某些请求设置拦截规则可以通过点击该加载项的弹出窗口来切换在上面的屏幕截图中可以看到。这些请求的区别在于脚本的类别、脚本发起的请求、cookies、CSS 规则、图像、媒体、帧,和被 uMatrix 标记为“other” 的其它内容。例如,你可以设置全局规则,以便在默认情况下允许所有请求,并将特定的请求添加到黑名单中(更方便的方法),或在默认情况下阻止所有内容,并手动将某些请求列入白名单(更安全的方法)。如果你一直在使用 NoScript 或 RequestPolicy你可以从它们 [导入][26] 你的白名单规则。
另外 uMatrix 支持 [hosts 文件][27],可用于阻止来自某些域的请求。不要与 uBlock Origin 所使用的筛选列表混淆,它使用的语法同 Adblock Plus 一样。默认情况下uMatrix 会通过几个 hosts 文件阻止已知的分发广告、跟踪器和恶意软件的服务器,如果需要,你可以添加更多外部数据源。
那么你将选择哪一个uBlock Origin 或 uMatrix ?就个人而言,我在电脑上两个都用,而只在安卓手机上用 uMatrix 。[据 gorhill 所说][28]两者之间存在某种重叠但它们有不同的目标用户和目地。如果你想要的只是阻止跟踪器和广告的简单方法uBlock Origine 是更好的选择另一方面如果你希望对网页在浏览器中可以执行或不能执行的操作进行精细的控制即使需要一些时间来进行配置并且可能会阻止某些网站如预期的工作uMatrix 也是更好的选择。
### 结论
目前,这些是 Firefox 里我最喜欢的扩展。Tridactyl 通过依靠键盘和与外部程序交互加快了浏览导航速度Open With 能让我用鼠标在另外一个程序中打开页面Stylus 是全面的用户样式管理器对用户和开发人员都很有吸引力uMatrix 本质上是 Firefox 的防火墙,可以用于过滤未知的请求。
尽管我基本上只是讨论了这些加载项的好处,但没有一个软件是完美的。如果你喜欢它们中的任何一个,并认为它们的某些方面可以改进,我建议你去它们的 Github 页面,并查看它们的贡献指南。通常情况下,自由开源软件的开发人员是欢迎错误报告和提交请求的。告诉你的朋友或道谢也是帮助开发者的好方法,特别是如果这些开发者是在业余时间从事他们的项目的话。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/6/firefox-open-source-extensions
作者:[Zsolt Szakács][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[lixinyuxx](https://github.com/lixinyuxx)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/zsolt
[1]:https://www.gnu.org/licenses/gpl-3.0.en.html
[2]:https://www.mozilla.org/en-US/MPL/
[3]:https://www.apache.org/licenses/LICENSE-2.0
[4]:/file/398411
[5]:https://opensource.com/sites/default/files/uploads/tridactyl.png "Tridactyl's new tab page, showcasing link hinting"
[6]:https://addons.mozilla.org/en-US/firefox/addon/tridactyl-vim/
[7]:https://github.com/vimperator/vimperator-labs
[8]:https://addons.mozilla.org/en-US/firefox/addon/pentadactyl/
[9]:https://www.vim.org/
[10]:https://mpv.io/
[11]:https://rg3.github.io/youtube-dl/index.html
[12]:/file/398416
[13]:https://opensource.com/sites/default/files/uploads/openwith.png "A context menu provided by Open With. I can open the current page with one of the external programs listed here."
[14]:https://addons.mozilla.org/en-US/firefox/addon/open-with/
[15]:/file/398421
[16]:https://opensource.com/sites/default/files/uploads/stylus.png "In this screenshot, I've just searched for and installed a dark theme for the site I'm currently on with Stylus. Even the popup has custom style (called Deepdark Stylus)!"
[17]:https://addons.mozilla.org/en-US/firefox/addon/styl-us/
[18]:https://userstyles.org/
[19]:https://addons.mozilla.org/en-US/firefox/addon/stylish/
[20]:https://github.com/openstyles/stylus/wiki/Usercss
[21]:/file/398426
[22]:https://opensource.com/sites/default/files/uploads/umatrix.png "The user interface of uMatrix, showing the current rules for the currently visited webpage."
[23]:https://opensource.com/article/18/5/firefox-extensions
[24]:https://addons.mozilla.org/en-US/firefox/user/gorhill/
[25]:https://addons.mozilla.org/en-US/firefox/addon/umatrix
[26]:https://github.com/gorhill/uMatrix/wiki/FAQ
[27]:https://en.wikipedia.org/wiki/Hosts_(file)
[28]:https://github.com/gorhill/uMatrix/issues/32#issuecomment-61372436

View File

@ -1,76 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (beamrolling)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (You (probably) don't need Kubernetes)
[#]: via: (https://arp242.net/weblog/dont-need-k8s.html)
[#]: author: (Martin Tournoij https://arp242.net/)
You (probably) don't need Kubernetes
======
This may perhaps be an unpopular opinion, but the overwhelming majority of companies are probably better off not using k8s.
You know those old “Hello world according to programmer skill” jokes that start with `printf("hello, world\n")` for a junior programmer and end with some convoluted Java OOP design pattern solution for senior software architect engineer? This is kind of like that.
* Junior sysops
`./binary`
* Experienced sysops
`./binary` on EC2.
* devops
Self-deployed CI pipeline to run `./binary` on EC2.
* Senior cloud orchestration engineer
k8s orchestrated self-deployed CI pipeline to run `./binary` on E2C platform.
¯\\_(ツ)_/¯
That doesnt mean that Kubernetes or any of these things are bad per se, just as Java or OOP arent bad per se, but rather that theyre horribly misapplied in many cases, just as using several Java OOP design patterns are horribly misapplied to a hello world program. For most companies the sysops requirements are fundamentally not very complex, and applying k8s to them makes litle sense.
Complexity creates work by its very nature, and Im skeptical that using k8s is a time-saver for most users. Its like spending a day on a script to automate some 10-minute task that you do once a month. Thats not a good time investment (especially since the chances are youll have to invest further time in the future by expanding or debugging that script at some point).
Your deployments probably should be automated lest you [end up like Knightmare][1] but k8s can often be replaced by a simple shell script.
In our own company the sysops team spent a lot of time setting up k8s. They also had to spend a lot of time on updating to a newer version a while ago (1.6 ➙ 1.8). And the result is something no one really understands without really diving in to k8s, and even then its hard (those YAML files, yikes!)
Before I could debug and fix deploy issues myself. Now thats a lot harder. I understand the basic concepts, but thats not all that useful when actually debugging practical issues. I dont deal with k8s often enough to justify learning this.
That k8s is really hard is not a novel insight, which is why there are a host of “k8s made easy” solutions out there. The idea of adding another layer on top of k8s to “make it easier” strikes me as, ehh, unwise. Its not like that complexity disappears; youve just hidden it.
I have said this many times before: when determining if something is “easy” then my prime concern is not how easy something is to write, but how easy something is to debug when things fail. Wrapping k8s will not make things easier to debug, quite the opposite: it will make it even harder.
There is a famous Blaise Pascal quote:
> All human evil comes from a single cause, mans inability to sit still in a room.
k8s and to lesser extent, Docker seem to be an example of that. A lot of people seem lost in the excitement of the moment and are “k8s al the things!”, just as some people were lost in the excitement when Java OOP was new, so everything has to be converted from the “old” way to the “new” ones, even though the “old” ways still worked fine.
Sometimes the IT industry is pretty silly.
Or to summarize this post [with a Tweet][2]:
> 2014 - We must adopt #microservices to solve all problems with monoliths
> 2016 - We must adopt #docker to solve all problems with microservices
> 2018 - We must adopt #kubernetes to solve all problems with docker
You can mail me at [martin@arp242.net][3] or [create a GitHub issue][4] for feedback, questions, etc.
--------------------------------------------------------------------------------
via: https://arp242.net/weblog/dont-need-k8s.html
作者:[Martin Tournoij][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://arp242.net/
[b]: https://github.com/lujun9972
[1]: https://dougseven.com/2014/04/17/knightmare-a-devops-cautionary-tale/
[2]: https://twitter.com/sahrizv/status/1018184792611827712
[3]: mailto:martin@arp242.net
[4]: https://github.com/Carpetsmoker/arp242.net/issues/new

View File

@ -1,68 +0,0 @@
translated by lixinyuxx
The life cycle of a software bug
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bug_software_issue_tracking_computer_screen.jpg?itok=6qfIHR5y)
In 1947, the first computer bug was found—a moth trapped in a computer relay.
If only all bugs were as simple to uncover. As software has become more complex, so too has the process of testing and debugging. Today, the life cycle of a software bug can be lengthy—though the right technology and business processes can help. For open source software, developers use rigorous ticketing services and collaboration to find and mitigate bugs.
### Confirming a computer bug
During the process of testing, bugs are reported to the development team. Quality assurance testers describe the bug in as much detail as possible, reporting on their system state, the processes they were undertaking, and how the bug manifested itself.
Despite this, some bugs are never confirmed; they may be reported in testing but can never be reproduced in a controlled environment. In such cases they may not be resolved but are instead closed.
It can be difficult to confirm a computer bug due to the wide array of platforms in use and the many different types of user behavior. Some bugs only occur intermittently or under very specific situations, and others may occur seemingly at random.
Many people use and interact with open source software, and many bugs and issues may be non-repeatable or may not be adequately described. Still, because every user and developer also plays the role of quality assurance tester, at least in part, there is a good chance that bugs will be revealed.
When a bug is confirmed, work begins.
### Assigning a bug to be fixed
A confirmed bug is assigned to a developer or a development team to be addressed. At this stage, the bug needs to be reproduced, the issue uncovered, and the associated code fixed. Developers may categorize this bug as an issue to be fixed later if the bug is low-priority, or they may assign someone directly if it is high-priority. Either way, a ticket is opened during the process of development, and the bug becomes a known issue.
In open source solutions, developers may select from the bugs that they want to tackle, either choosing the areas of the program with which they are most familiar or working from the top priorities. Consolidated solutions such as [GitHub][1] make it easy for multiple developers to work on solutions without interfering with each other's work.
When assigning bugs to be fixed, reporters may also select a priority level for the bug. Major bugs may have a high priority level, whereas bugs related to appearance only, for example, may have a lower level. This priority level determines how and when the development team is assigned to resolve these issues. Either way, all bugs need to be resolved before a product can be considered complete. Using proper traceability back to prioritized requirements can also be helpful in this regard.
### Resolving the bug
Once a bug has been fixed, it is usually be sent back to Quality Assurance as a resolved bug. Quality Assurance then puts the product through its paces again to reproduce the bug. If the bug cannot be reproduced, Quality Assurance will assume that it has been properly resolved.
In open source situations, any changes are distributed—often as a tentative release that is being tested. This test release is distributed to users, who again fulfill the role of Quality Assurance and test the product.
If the bug occurs again, the issue is sent back to the development team. At this stage, the bug is reopened, and it is up to the development team to repeat the cycle of resolving the bug. This may occur multiple times, especially if the bug is unpredictable or intermittent. Intermittent bugs are notoriously difficult to resolve.
If the bug does not occur again, the issue will be marked as resolved. In some cases, the initial bug is resolved, but other bugs emerge as a result of the changes made. When this happens, new bug reports may need to be initiated, starting the process over again.
### Closing the bug
After a bug has been addressed, identified, and resolved, the bug is closed and developers can move on to other areas of software development and testing. A bug will also be closed if it was never found or if developers were never able to reproduce it—either way, the next stage of development and testing will begin.
Any changes made to the solution in the testing version will be rolled into the next release of the product. If the bug was a serious one, a patch or a hotfix may be provided for current users until the release of the next version. This is common for security issues.
Software bugs can be difficult to find, but by following set processes and procedures, developers can make the process faster, easier, and more consistent. Quality Assurance is an important part of this process, as QA testers must find and identify bugs and help developers reproduce them. Bugs cannot be closed and resolved until the error no longer occurs.
Open source solutions distribute the burden of quality assurance testing, development, and mitigation, which often leads to bugs being discovered and mitigated more quickly and comprehensively. However, because of the nature of open source technology, the speed and accuracy of this process often depends upon the popularity of the solution and the dedication of its maintenance and development team.
_Rich Butkevic is a PMP certified project manager, certified scum master, and runs[Project Zendo][2] , a website for project management professionals to discover strategies to simplify and improve their project results. Connect with Rich at [Richbutkevic.com][3] or on [LinkedIn][4]._
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/6/life-cycle-software-bug
作者:[Rich Butkevic][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/rich-butkevic
[1]:https://github.com/
[2]:https://projectzendo.com
[3]:https://richbutkevic.com
[4]:https://www.linkedin.com/in/richbutkevic

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: (HankChow)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,131 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (s-tui: A Terminal Tool To Monitor CPU Temperature, Frequency, Power And Utilization In Linux)
[#]: via: (https://www.2daygeek.com/s-tui-stress-terminal-ui-monitor-linux-cpu-temperature-frequency/)
[#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/)
s-tui: A Terminal Tool To Monitor CPU Temperature, Frequency, Power And Utilization In Linux
======
By default every Linux administrator would go with **[lm_sensors to monitor CPU temperature][1]**.
lm_sensors (Linux monitoring sensors) is a free and open-source application that provides tools and drivers for monitoring temperatures, voltage, and fans.
Its a CLI utility and if you are looking for alternative tools.
I would suggest you to go for s-tui.
Its a Stress Terminal UI which helps administrator to view CPU temperature with colors.
### What is s-tui
s-tui is a terminal UI for monitoring your computer. s-tui allows to monitor CPU temperature, frequency, power and utilization in a graphical way from the terminal.
Also, shows performance dips caused by thermal throttling, it requires minimal resources and doesnt requires X-server. It was written in Python and requires root privilege to use this.
s-tui is a self-contained application which can run out-of-the-box and doesnt need config files to drive its core features.
s-tui uses psutil to probe some of your hardware information. If your hardware is not supported, you might not see all the information.
Running s-tui as root gives access to the maximum Turbo Boost frequency available to your CPU when stressing all cores.
It uses Stress utility in the background to check the temperature of its components do not exceed their acceptable range by imposes certain types of compute stress on your system.
Running an overclocked PC is fine as long as it is stable and that the temperature of its components do not exceed their acceptable range.
There are several programs available to assess system stability through stress testing the system and thereby the overclock level.
### How to Install s-tui In Linux
It was written in Python and pip installation is a recommended method to install s-tui on Linux. Make sure you should have installed python-pip package on your system. If no, use the following command to install it.
For Debian/Ubuntu users, use **[Apt Command][2]** or **[Apt-Get Command][3]** to install pip package.
```
$ sudo apt install python-pip stress
```
For Archlinux users, use **[Pacman Command][4]** to install pip package.
```
$ sudo pacman -S python-pip stress
```
For Fedora users, use **[DNF Command][5]** to install pip package.
```
$ sudo dnf install python-pip stress
```
For CentOS/RHEL users, use **[YUM Command][6]** to install pip package.
```
$ sudo yum install python-pip stress
```
For openSUSE users, use **[Zypper Command][7]** to install pip package.
```
$ sudo zypper install python-pip stress
```
Finally run the following **[pip command][8]** to install s-tui tool in Linux.
For Python 2.x:
```
$ sudo pip install s-tui
```
For Python 3.x:
```
$ sudo pip3 install s-tui
```
### How to Access s-tui
As i told in the beginning of the article. It requires root privilege to get all the information from your system. Just run the following command to launch s-tui.
```
$ sudo s-tui
```
![][10]
By default it enable hardware monitoring and select the “Stress” option to do the stress test on your system.
![][11]
To check other options, navigate to help page.
```
$ s-tui --help
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/s-tui-stress-terminal-ui-monitor-linux-cpu-temperature-frequency/
作者:[Prakash Subramanian][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/prakash/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/view-check-cpu-hard-disk-temperature-linux/
[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/
[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/
[4]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/
[5]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/
[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/
[8]: https://www.2daygeek.com/install-pip-manage-python-packages-linux/
[9]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[10]: https://www.2daygeek.com/wp-content/uploads/2018/12/s-tui-stress-terminal-ui-monitor-linux-cpu-temperature-frequency-1.jpg
[11]: https://www.2daygeek.com/wp-content/uploads/2018/12/s-tui-stress-terminal-ui-monitor-linux-cpu-temperature-frequency-2.jpg

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,96 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How To Move Multiple File Types Simultaneously From Commandline)
[#]: via: (https://www.ostechnix.com/how-to-move-multiple-file-types-simultaneously-from-commandline/)
[#]: author: (SK https://www.ostechnix.com/author/sk/)
How To Move Multiple File Types Simultaneously From Commandline
======
![](https://www.ostechnix.com/wp-content/uploads/2019/01/Move-Multiple-File-Types-720x340.png)
The other day I was wondering how can I move (not copy) multiple file types from directory to another. I already knew how to [**find and copy certain type of files from one directory to another**][1]. But, I dont know how to move multiple file types simultaneously. If youre ever in a situation like this, I know a easy way to do it from commandline in Unix-like systems.
### Move Multiple File Types Simultaneously
Picture this scenario.You have multiple type of files, for example .pdf, .doc, .mp3, .mp4, .txt etc., on a directory named **dir1**. Let us take a look at the dir1 contents:
```
$ ls dir1
file.txt image.jpg mydoc.doc personal.pdf song.mp3 video.mp4
```
You want to move some of the file types (not all of them) to different location. For example, let us say you want to move doc, pdf and txt files only to another directory named **dir2** in one go.
To copy .doc, .pdf and .txt files from dir1 to dir2 simultaneously, the command would be:
```
$ mv dir1/*.{doc,pdf,txt} dir2/
```
Its easy, isnt it?
Now, let us check the contents of dir2:
```
$ ls dir2/
file.txt mydoc.doc personal.pdf
```
See? Only the file types .doc, .pdf and .txt from dir1 have been moved to dir2.
![][3]
You can add as many file types as you want to inside curly braces in the above command to move them across different directories. The above command just works fine for me on Bash.
Another way to move multiple file types is go to the source directory i.e dir1 in our case:
```
$ cd ~/dir1
```
And, move file types of your choice to the destination (E.g dir2) as shown below.
```
$ mv *.doc *.txt *.pdf /home/sk/dir2/
```
To move all files having a particular extension, for example **.doc** only, run:
```
$ mv dir1/*.doc dir2/
```
For more details, refer man pages.
```
$ man mv
```
Moving a few number of same or different file types is easy! You could do this with couple mouse clicks in GUI mode or use a one-liner command in CLI mode. However, If you have thousands of different file types in a directory and wanted to move multiple file types to different directory in one go, it would be a cumbersome task. To me, the above method did the job easily! If you know any other one-liner commands to move multiple file types at a time, please share it in the comment section below. I will check and update the guide accordingly.
And, thats all for now. Hope this was useful. More good stuffs to come. Stay tuned!
Cheers!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/how-to-move-multiple-file-types-simultaneously-from-commandline/
作者:[SK][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972
[1]: https://www.ostechnix.com/find-copy-certain-type-files-one-directory-another-linux/
[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[3]: http://www.ostechnix.com/wp-content/uploads/2019/01/mv-command.gif

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (asche910)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -0,0 +1,76 @@
[#]: collector: (lujun9972)
[#]: translator: (beamrolling)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (You (probably) don't need Kubernetes)
[#]: via: (https://arp242.net/weblog/dont-need-k8s.html)
[#]: author: (Martin Tournoij https://arp242.net/)
你(大概)不需要 Kubernetes
======
这也许是一个不太受欢迎的观点,但大多数主流公司最好不要再使用 k8s 了。
你知道那个古老的“根据程序员技能写 Hello world ”笑话吗?它从一个新手程序员的 printf("hello, world\n") 语句开始,最后结束于高级软件架构工程师令人费解的 Java OOP 模式设计。使用 k8s 就有点像这样。
* 新手 SysOp
`./binary`
* 有经验的 SysOp
在 EC2 上的 `./binary`
* DevOp
在 EC2 上自部署的 CI 管道运行 `./binary`
* 高级云编排工程师:
在 EC2 上通过 k8s 编排的自部署 CI 管道运行 `./binary`
¯\\_(ツ)_/¯
这不意味着 Kubernetes 或者任何这样的东西本身都是坏的,就像 Java 或者 OOP 设计本身并不是坏的一样,但是,在很多情况下,它们被严重地误用,就像在一个 hello world 的程序中可怕地误用 Java 面向对象设计模式一样。对大多数公司而言,系统运维从根本上来说并不十分复杂,此时在这上面应用 k8s 起效甚微。
复杂性本质上来说创造了工作,我十分怀疑使用 k8s 对大多数使用者来说是省时的这一说法。这就好像花一天时间来写一个脚本,用来自动完成一些你一个月一次,每次只花 10 分钟完成的工作。这不是一个好的时间投资(特别是你可能会在未来由于扩展或调试这个脚本来进一步投入更多的时间)。
你的部署大概应该需要自动化 以免你 [最终像 Knightmare][1] 那样 但 k8s 通常可以被一个简单的 shell 脚本所替代。
在我们公司sysops 团队用了很多时间来设置 k8s 。他们还不得不用了很大一部分时间来更新到新一点的版本1.6 1.8)。结果是如果没有真正深入理解 k8s ,没人会真正明白一些东西,甚至连深入理解 k8s 这一点也很难(那些 YAML 文件,哦呦!)
在我能自己调试和修复问题之前——现在这更难了,我理解基本概念,但在真正调试实际问题的时候,它们并不是那么有用。我不经常用 k8s 足以证明这点。
k8s 真的很难这点并不是什么新看法,这也是为什么现在会有这么多“ k8s 简单学”的解决方案。在 k8s 上再添一层来“让它更简单”的方法让我觉得,呃,不明智。复杂性并没有消失,你只是把它藏起来了。
以前我说过很多次:在确定一样东西是否“简单”时,我最关心的不是写东西的时候有多简单,而是当失败的时候调试起来有多容易。包装 k8s 并不会让调试更加简单,恰恰相反,它让事情更加困难了。
Blaise Pascal 有一句名言:
> 几乎所有的痛苦都来自于我们不善于在房间里独处。
k8s —— 略微拓展一下Docker ——似乎就是这样的例子。许多人似乎迷失在当下的兴奋中,觉得“ k8s 就是这么回事!”,就像有些人迷失在 Java OOP 刚出来时的兴奋中一样,所以一切都必须从“旧”方法转为“新”方法,即使“旧”方法依然可行。
有时候 IT 产业挺蠢的。
或者用 [一条推特][2] 来总结:
> 2014 - 我们必须采用 #微服务 来解决 monolith 的所有问题
> 2016 - 我们必须采用 #docker 来解决微服务的所有问题
> 2018 - 我们必须采用 #kubernetes 来解决 docker 的所有问题
你可以通过 [martin@arp242.net][3] 给我发邮件或者 [创建 GitHub issue][4] 来给我反馈或提出问题等。
--------------------------------------------------------------------------------
via: https://arp242.net/weblog/dont-need-k8s.html
作者:[Martin Tournoij][a]
选题:[lujun9972][b]
译者:[beamrolling](https://github.com/beamrolling)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://arp242.net/
[b]: https://github.com/lujun9972
[1]: https://dougseven.com/2014/04/17/knightmare-a-devops-cautionary-tale/
[2]: https://twitter.com/sahrizv/status/1018184792611827712
[3]: mailto:martin@arp242.net
[4]: https://github.com/Carpetsmoker/arp242.net/issues/new

View File

@ -1,109 +0,0 @@
4个值得一提的 Firefox 拓展插件
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/firefox_blue_lead.jpg?itok=gYaubJUv)
自从大约12年前 V2.0 推出以来, 我一直是 Firefox (火狐浏览器)的用户。那时它不是最好的网络浏览器,但我仍旧因为一个理由使用它:我最喜爱的无可比拟的浏览器拓展插件
如今, 我喜欢 Firefox 的当前状态,因为它快速、可定制和开源,但我也很欣赏扩展插件来体现原开发人员从未想到的特点: 如果您想在没有鼠标的情况下浏览呢?如果您不喜欢盯着晚上从显示器里出来的强光呢?对于 YouTube 和其他视频托管网站为了更好的性能和扩展使用一个更专业的播放器又如何呢?如果您需要更复杂的方法来禁用跟踪器和加快加载页面, 该怎么办?
幸运的是, 这些问题都有答案, 我将展现给你我最喜爱的拓展--所有这些都是免费软件或开源的 (即, 在 [GNU GPL][1] [MPL][2],或 [Apache][3] 许可下) 并使一个优秀的浏览器更好。
尽管术语加载项和扩展具有微微不同的含义,,但我将在本文中交替使用它们。
### Tridactyl
![Tridactyl screenshot][5]
Tridactyl 的新选项卡页面,展示隐藏连接。
[Tridactyl][6] 使您能够在大多数浏览活动中使用键盘。它的灵感来自于现已解散的 [Vimperator][7] 和 [Pentadactyl][8] ,这是由 [Vim][9] 默认绑定值启发的。由于我已经习惯了 Vim 和其他命令行应用程序,我发现了一些功能,比如能够使用键值 `h/j/k/l` 进行导航,用 `f/F` 与超链接进行交互,并创建非常方便的自定义键绑定和命令。
Tridactyl 的可选本地信代理目前仅适用于GNU/Linux 和 Mac OSX 最近才实现的,提供了更酷的功能来启动。例如, 有了它, 您可以隐藏 Firefox GUI 的一些元素(à la Vimperator 和 Pentadactyl在外部程序中打开链接或当前页 (我经常用 [mpv][10] 和 [youtube-dl][11] 在视频上)通过按 `Ctrl-I` 用您喜爱的编辑器编辑文本内容(或者任意您选择的组合键)。
话虽如此, 但要记住,这是一个相对早期的项目,细节可能还是很粗糙。 另一方面,它的发展非常活跃, 当你回顾它早期的缺陷时, 使用它可能是一种乐趣。
### Open With
![Open With Screenshot][13]
Open With 提供的菜单。我可以在当前页面打开一个额外的列表。
说到与外部程序的互动,有时很高兴有能力用鼠标来做到这一点。这是 [Open With][14] 想法的来源.
除了添加的上下文菜单 (如屏幕截图所示) 外,您还可以通过单击加载项栏上的扩展图标来找到自己定义的命令。 [its page on Mozilla Add-ons][14] 建议作为它的图标和描述,它主要是为了与其他 web 浏览器一起工作, 但我也可以轻松地使用它与 mpv 和 youtube-dl 。
这里也提供键盘快捷方式,但它们受到严重限制。可以在扩展设置的下拉列表中选择的组合不超过三种。相反, Tridactyl 允许我将命令分配给几乎任何没有被 Firefox 阻止的东西。打开与是目前为鼠标,真的。
### Stylus
![Stylus Screenshot][16]
在这个屏幕截图中, 我刚刚搜索并安装了一个黑暗的主题, 我正在上 Stylus 的网站。即使是弹出窗口也可以定制风格 (称为 Deepdark Stylus
[Stylus][17] 是一个用户样式管理器,这意味着通过编写自定义 CSS 规则并将其加载到 Stylus 中,您可以更改任何网页的外观。如果你不知道 CSS ,有大量的风格在其他网站上,如 [userstyles.org][18] 。
现在,你可能会问,“这不正是什么 [Stylish][19] 么?” 你是对的!你看 Stylus 是基于 Stylish 并提供了更多的改进:它不包含任何遥测数据, 尊重您的隐私,所有开发都是公开的(尽管 Stylish 仍在积极开发, 我一直未能找到最新版本的源代码), 而且它还支持 [UserCSS][20]。
UserCSS 是一种有趣的格式,尤其是对于开发人员。我已经为不同的网站写了几种用户样式(主要是黑暗的主题和调整,以提高可读性),虽然 Stylus 的内部编辑器很好,我还是喜欢用 Neovim 编辑代码。为了做到这样我所需要做的就是用 ".user.css" 作为本地加载文件的后缀名,在 Stylus 里启动 "Live Reload" 选项,所有更改都会被应用只要我在 Neovim 中启保存和更改文件。远程 UserCSS 文件也支持,因此,每当我将更改推送到 Github 或任何基于 git 的开发平台时,它们将自动对用户可用。(我提供了指向该文件的原始版本的链接, 以便他们可以轻松地访问它。)
### uMatrix
![uMatrix Screenshot][22]
uMatrix 的用户使用界面,显示当前访问过的网页的当前规则。
Jeremy Garcia 提到了 uBlock Origin 在 [his article][23] 在 Opensource.com 作为一个优秀的 blocker 。我想推荐另一个拓展插件作者是 [gorhill][24]: uMatrix 。
[uMatrix][25] 允许您为网页上的某些请求设置阻止规则,可以通过点击加载项的弹出窗口来切换(在上面的屏幕截图中可以看到)。 这些请求的区别在于脚本的类别、 scripts, cookies, CSS rules, images, media content, frames和其他被 uMatrix 标记为 "other" 的 。 例如,您可以设置全局规则, 以便在默认情况下允许所有请求, 并将特定请求添加到黑名单中(更方便的方法),或在默认情况下阻止所有内容, 并手动将某些请求列入白名单 更安全的方法。如果您一直在使用NoScript 或 RequestPolicy你可以 [import][26] 你的白名单规则。
另外 uMatrix 支持 [hosts files ][27],可用于阻止来自某些网站的请求。 不能与原始 uBlock 的筛选列表相比, 其使用的语法是 Adblock Plus 。默认情况下, uMatrix 会在几个文件的帮助下阻止已知分发广告、跟踪器和恶意软件的服务器, 如果需要, 您可以添加更多外部源。
那么你将选择哪一个-- uBlock Origin 或 uMatrix ?就个人而言,我在电脑上两个都用,只在安卓手机上用 uMatrix 。两者之间会有重叠的部分 [according to gorhill][28] ,但他们有不同的用户和目标群,如果你想要的只是阻止跟踪器和广告的简单方法, uBlock Origine 是更好的选择, 另一方面,如果您希望对网页在浏览器中可以执行或不能执行的操作进行精细的控制, 即使需要一些时间来进行配置, 并且可能会阻止网站按预期运行, uMatrix 是更好的选择。
### 结论
目前, 这些是 Firefox 里我最喜欢的扩展。Tridactyl 是依靠键盘和与外部程序交互, 加快浏览导航速度Open With 能让我用鼠标点击程序操作, Stylus 是明确的用户风格的管理器, 对用户和开发人员都有吸引力; uMatrix 本质上是 Firefox 的防火墙用于过滤未知的请求。
尽管我几乎完全讨论了这些加载项的好处,但没有一个软件是完美的。如果你喜欢他们中的任何一个,并认为他们可以以任何方式改进, 我建议你去他们的 Github 页面,并寻找他们的贡献指南。通常情况下,免费和开源软件的开发人员欢迎错误报告和提交请求。告诉你的朋友或道谢也是帮助开发者的好方法, 特别是如果他们在业余时间从事他们的项目。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/6/firefox-open-source-extensions
作者:[Zsolt Szakács][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[lixinyuxx](https://github.com/lixinyuxx)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/zsolt
[1]:https://www.gnu.org/licenses/gpl-3.0.en.html
[2]:https://www.mozilla.org/en-US/MPL/
[3]:https://www.apache.org/licenses/LICENSE-2.0
[4]:/file/398411
[5]:https://opensource.com/sites/default/files/uploads/tridactyl.png "Tridactyl's new tab page, showcasing link hinting"
[6]:https://addons.mozilla.org/en-US/firefox/addon/tridactyl-vim/
[7]:https://github.com/vimperator/vimperator-labs
[8]:https://addons.mozilla.org/en-US/firefox/addon/pentadactyl/
[9]:https://www.vim.org/
[10]:https://mpv.io/
[11]:https://rg3.github.io/youtube-dl/index.html
[12]:/file/398416
[13]:https://opensource.com/sites/default/files/uploads/openwith.png "A context menu provided by Open With. I can open the current page with one of the external programs listed here."
[14]:https://addons.mozilla.org/en-US/firefox/addon/open-with/
[15]:/file/398421
[16]:https://opensource.com/sites/default/files/uploads/stylus.png "In this screenshot, I've just searched for and installed a dark theme for the site I'm currently on with Stylus. Even the popup has custom style (called Deepdark Stylus)!"
[17]:https://addons.mozilla.org/en-US/firefox/addon/styl-us/
[18]:https://userstyles.org/
[19]:https://addons.mozilla.org/en-US/firefox/addon/stylish/
[20]:https://github.com/openstyles/stylus/wiki/Usercss
[21]:/file/398426
[22]:https://opensource.com/sites/default/files/uploads/umatrix.png "The user interface of uMatrix, showing the current rules for the currently visited webpage."
[23]:https://opensource.com/article/18/5/firefox-extensions
[24]:https://addons.mozilla.org/en-US/firefox/user/gorhill/
[25]:https://addons.mozilla.org/en-US/firefox/addon/umatrix
[26]:https://github.com/gorhill/uMatrix/wiki/FAQ
[27]:https://en.wikipedia.org/wiki/Hosts_(file)
[28]:https://github.com/gorhill/uMatrix/issues/32#issuecomment-61372436

View File

@ -0,0 +1,67 @@
软件 bug 的生命周期
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bug_software_issue_tracking_computer_screen.jpg?itok=6qfIHR5y)
1947年发现了第一个计算机 bug --被困在计算机继电器中的飞蛾。
要是所有的 bug 都能如此简单地发现就好了。随着软件变得越来越复杂,测试和调试的过程也变得更加复杂。如今,软件 bug 的生命周期可能会很长,尽管正确的技术和业务流程可能会有所帮助。对于开源软件,开发人员使用严格的票务服务和协作来查找和解决 bugs 。
### 确认计算机 bug
在测试过程中,会向开发团队报告 bug 。质量保证人员尽可能详细地描述 bug ,报告他们的系统状态、他们正在进行的进程以及 bug 是如何表现出来的。
尽管如此,一些 bug 从未得到证实;它们可能会在测试中报告,但永远无法在可控环境中重现。在这种情况下,它们可能得不到解决,而是被关闭。
由于使用的平台种类繁多,用户行为也非常多,因此很难确认计算机 bug ,有些 bug 只是间歇性地或在非常特殊的情况下发生的,而另一些 bug 可能会出现在随机的情况下。
许多人使用开源软件并与之交互,许多 bug 和问题可能是不可重复的,或者可能没有得到充分的描述。不过,由于每个用户和开发人员也都扮演质量保证测试员的角色,至少在一定程度上,很有可能会发现 bug 。
确认 bug 后,修复工作就开始了。
### 分配要修复的 bug
已确认的 bug 被分配给负责解决的开发人员或开发团队。在此阶段,需要重现 bug ,发现问题,并修复相关代码。如果 bug 的优先级较低,开发人员可以将此 bug 分类为稍后要修复的问题,也可以在该 bug 具有高优先级的情况下直接指派某人修复。无论哪种方式,都会在开发过程中打开票证,并且 bug 将成为已知的问题。
在开源解决方案中,开发人员可以从他们想要解决的 bug 中进行选择,要么选择他们最熟悉的程序区域,要么从优先级最高的的开始。综合解决方案,如 [GitHub][1] 使得多个开发人员能够轻松地处理解决方案,而不会干扰彼此的工作。
在分配要修复的 bug 时,记录者还可以为 bug 选择优先级。主要得 bug 可能具有较高的优先级,而仅与外观相关的 bug 可能具有较低的级别。优先级确定开发团队解决这些问题的方式和时间。无论哪种方式,所有的 bug 都需要先解决,然后才能认为产品已完成。在这方面,适当的回溯到优先级高的的需求也会很有帮助。
### 解决 bug
一旦修复了 bug ,通常会将其作为已解决的 bug 发送回质量保证。然后,质量保证再次将产品置于其步伐中,以重现 bug。如果无法重现 bug ,质量保证将假定它已得到适当解决。
在开源情况下,任何更改都是分布式的,通常是作为正在测试的暂定版本。此测试版本分发给用户,用户再次履行质量保证的职责并测试产品。
如果 bug 再次出现,问题将被发送回开发团队。在此阶段,该 bug 将重新触发,开发团队有责任重复循环解决该 bug 。这种情况可能会发生多次,尤其是在 bug 不可预知或间歇性发生的情况下。众所周知,间歇性的 bug 很难解决。
如果该 bug 不再出现,则该问题将被标记为已解决。在某些情况下,初始 bug 已得到解决,但由于所做的更改,会出现其他 bug。发生这种情况时可能需要新的 bug 报告,然后重新开始该过程。
### 关闭 bug
在处理、识别和解决 bug 后,该 bug 将被关闭,开发人员可以转到软件开发和测试的其他阶段。如果始终找不到 bug ,或者开发人员无法重现 bug ,则该 bug 也将被关闭-无论哪种方式,都将开始开发和测试的下一阶段。
在测试版本中对解决方案所做的任何更改都将滚动到产品的下一个版本中。如果 bug 是严重的,则在下一个版本发布之前,可能会为当前用户提供修补程序或修补程序。这在安全问题中很常见。
软件 bug 可能很难找到,但通过遵循过程,开发人员可以使开发更快、更容易、更一致。质量保证是这一过程的重要组成部分,因为 QA 测试人员必须发现和识别 bug ,并帮助开发人员重现这些 bug 。在 bug 不再发生之前,无法关闭和解决 bug。
开源的解决方案分散了质量保证测试、开发和缓解的负担,这往往导致 bug 被更快、更全面地发现和缓解。但是,由于开源技术的性质,此过程的速度和准确性通常取决于解决方案的受欢迎程度及其维护和开发团队的敬业精神。
_Rich Butkevic 是一个 PMP 项目经理认证,,敏捷开发框架认证(*certified scrum master* 并且 使用 [Project Zendo][2] ,供项目管理专业人员去发现、简化和改进其项目成果策略的网站。与 Rich 联系在 [Richbutkevic.com][3] 或者使用 [LinkedIn][4] 。_
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/6/life-cycle-software-bug
作者:[Rich Butkevic][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[lixinyuxx](https://github.com/lixinyuxx)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/rich-butkevic
[1]:https://github.com/
[2]:https://projectzendo.com
[3]:https://richbutkevic.com
[4]:https://www.linkedin.com/in/richbutkevic

View File

@ -0,0 +1,132 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (s-tui: A Terminal Tool To Monitor CPU Temperature, Frequency, Power And Utilization In Linux)
[#]: via: (https://www.2daygeek.com/s-tui-stress-terminal-ui-monitor-linux-cpu-temperature-frequency/)
[#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/)
s-tui在 Linux 中监控 CPU 温度、频率、功率和使用率的终端工具
======
默认情况下,每个 Linux 管理员都会使用 **[lm_sensors 监控 CPU 温度][1]**。
lm_sensors Linux 监控传感器)是一个免费开源程序,它提供监控温度、电压和风扇的工具和驱动。
如果你正在找替代工具,这有一个 CLI 工具。
我会建议你尝试 s-tui。
它有一个压力终端 UI可以帮助管理员通过颜色查看 CPU 温度。
### s-tui 是什么
s-tui 是一个用于监控计算机的终端 UI。s-tui 可以在终端以图形方式监控 CPU 温度、频率、功率和使用率。
此外,它还显示由热量限制引起的性能下降,它需要很少的资源并且不需要 X 服务器。它是用 Python 编写的,需要 root 权限才能使用它。
s-tui 是一个独立的程序,可以开箱即用,并且不需要配置文件来使用其核心功能。
s-tui 使用 psutil 来探测你的一些硬件信息。如果你的硬件不受支持,你可能看不到所有信息。
以root身份运行 s-tui 时,当压测所有核心时,可以访问到 CPU 的最大睿频频率。
它在后台使用 Stress 工具,通过对系统施加某些类型的计算压力来检查其组件的温度是否超过其可接受的范围。
只要计算机稳定并且其组件的温度不超过其可接受的范围,超频 PC 就没问题。
有几个程序可以通过压力测试得到系统的稳定性,从而评估超频水平。
### 如何在 Linux 中安装 s-tui
它是用 Python 写的pip 是在 Linux 上安装 s-tui 的推荐方法。确保你在系统上安装了 python-pip 软件包。如果还没有,请使用以下命令进行安装。
对于 Debian/Ubuntu 用户,使用 **[apt 命令][2]**或 **[apt-get 命令][3]** 来安装 pip。
```
$ sudo apt install python-pip stress
```
对于 Archlinux 用户,使用 **[pacman 命令][4]**来安装 pip。
```
$ sudo pacman -S python-pip stress
```
对于 Fedora 用户,使用 **[dnf 命令][5]**来安装 pip。
```
$ sudo dnf install python-pip stress
```
对于 CentOS/RHEL 用户,使用 **[yum 命令][5]**来安装 pip。
```
$ sudo yum install python-pip stress
```
对于 openSUSE 用户,使用 **[zypper 命令][5]**来安装 pip。
```
$ sudo zypper install python-pip stress
```
最后运行下面的 **[pip 命令][8]**在 Linux 中安装 s-tui 工具。
对于 Python 2.x
```
$ sudo pip install s-tui
```
对于Python 3.x
```
$ sudo pip3 install s-tui
```
### 如何使用 s-tui
正如我在文章开头所说的那样。它需要 root 权限才能从系统获取所有信息。只需运行以下命令即可启动 s-tui。
```
$ sudo s-tui
```
![][10]
默认情况下,它启用硬件监控并选择 “Stress” 选项以对系统执行压力测试。
![][11]
要查看其他选项,请到帮助页面查看。
```
$ s-tui --help
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/s-tui-stress-terminal-ui-monitor-linux-cpu-temperature-frequency/
作者:[Prakash Subramanian][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/prakash/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/view-check-cpu-hard-disk-temperature-linux/
[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/
[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/
[4]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/
[5]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/
[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/
[8]: https://www.2daygeek.com/install-pip-manage-python-packages-linux/
[9]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[10]: https://www.2daygeek.com/wp-content/uploads/2018/12/s-tui-stress-terminal-ui-monitor-linux-cpu-temperature-frequency-1.jpg
[11]: https://www.2daygeek.com/wp-content/uploads/2018/12/s-tui-stress-terminal-ui-monitor-linux-cpu-temperature-frequency-2.jpg

View File

@ -0,0 +1,93 @@
[#]: collector: (lujun9972)
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How To Move Multiple File Types Simultaneously From Commandline)
[#]: via: (https://www.ostechnix.com/how-to-move-multiple-file-types-simultaneously-from-commandline/)
[#]: author: (SK https://www.ostechnix.com/author/sk/)
如何从命令行同时移动多种文件类型
======
![](https://www.ostechnix.com/wp-content/uploads/2019/01/Move-Multiple-File-Types-720x340.png)
前几天,我想知道如何将多个文件类型从一个目录移动(不复制)到另一个目录。我已经知道如何[**查找并将某些类型的文件从一个目录复制到另一个目录**][1]。但是,我不知道如何同时移动多种文件类型。如果你曾遇到这样的情况,我知道在类 Unix 系统中从命令行执行该操作的一个简单方法。
### 同时移动多种文件类型
想象一下这种场景,你在名为 **dir1** 的目录中有多种类型的文件,例如 .pdf, .doc, .mp3, .mp4, .txt 等等。我们来看看 dir1 的内容:
```
$ ls dir1
file.txt image.jpg mydoc.doc personal.pdf song.mp3 video.mp4
```
你希望将某些文件类型(不是所有文件类型)移动到另一个位置。例如,假设你想将 doc, pdf 和 txt 文件一次性移动到名为 **dir2** 的另一个目录中。
要同时将 .doc, .pdf 和 .txt 文件从 dir1 移动到 dir2命令是
```
$ mv dir1/*.{doc,pdf,txt} dir2/
```
很容易,不是吗?
现在让我们来查看一下 dir2 的内容:
```
$ ls dir2/
file.txt mydoc.doc personal.pdf
```
看到了吗?只有 .doc, .pdf 和 .txt 从 dir1 移到了 dir2。
![][3]
在上面的命令中,你可以在花括号内添加任意数量的文件类型,以将它们移动到不同的目录中。它在 Bash 上非常适合我。
另一种移动多种文件类型的方法是转到源目录,在我们的例子中即为 dir1:
```
$ cd ~/dir1
```
将你选择的文件类型移动到目的地(即 dir2如下所示
```
$ mv *.doc *.txt *.pdf /home/sk/dir2/
```
要移动具有特定扩展名的所有文件,例如 **.doc**,运行:
```
$ mv dir1/*.doc dir2/
```
更多细节,参考 man 页:
```
$ man mv
```
移动一些相同或不同的文件类型很容易!你可以在 GUI 模式下单击几下鼠标,或在 CLI 模式下使用一行命令来完成。但是,如果目录中有数千种不同的文件类型,并且希望一次将多种文件类型移动到不同的目录,这将是一项繁琐的任务。对我来说,上面的方法很容易完成工作!如果你知道任何其它一行命令可以一次移动多种文件类型,请在下面的评论部分与我们分享。我会核对并更新指南。
这些就是全部了,希望这很有用。更多好东西将要来了,敬请关注!
共勉!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/how-to-move-multiple-file-types-simultaneously-from-commandline/
作者:[SK][a]
选题:[lujun9972][b]
译者:[MjSeven](https://github.com/MjSeven)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972
[1]: https://www.ostechnix.com/find-copy-certain-type-files-one-directory-another-linux/
[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[3]: http://www.ostechnix.com/wp-content/uploads/2019/01/mv-command.gif