Merge pull request #23 from LCTT/master

update 0922
This commit is contained in:
SamMa 2021-09-22 09:06:24 +08:00 committed by GitHub
commit e85af0d37e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 3253 additions and 2273 deletions

View File

@ -0,0 +1,444 @@
[#]: collector: (lujun9972)
[#]: translator: (zpl1025)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13796-1.html)
[#]: subject: (13 of the best React JavaScript frameworks)
[#]: via: (https://opensource.com/article/20/1/react-javascript-frameworks)
[#]: author: (Amit Dua https://opensource.com/users/amitdua)
13 个最好的 React JavaScript 框架
======
> 如果你正在用 React.js 或 React Native 来开发用户界面的话,试试这些框架。
![](https://img.linux.net.cn/data/attachment/album/202109/18/095748k48eskmjpzuhyzuj.jpg)
React.js 和 React Native 都是用来开发用户界面UI的很受欢迎的开源平台。在 StackOverflow 2019 年度开发者调查里两个框架的可取性和使用情况都排名靠前。React.js 是 Facebook 在 2011 年开发的一个 JavaScript 库,来实现跨平台,动态以及高性能的 UI 设计需求;而 React Native 则是 Facebook 在 2015 年发布的框架,目的是使用 JavaScript 构建原生应用。
下面介绍 13 个最好的 React JavaScript 框架,都是开源项目。前 11 个(和 React 一样)都使用 MIT 许可证授权,后面两个使用 Apache 2.0 许可证。
### 1、Create React App
这个 Facebook 开发的命令行工具是 React Native 项目一定要用的。因为 [Create React App][2] 使用很简单,还可以避免你自己手动设定和配置应用,因此能节省大量的时间和精力。仅仅使用给一个简单的命令,就可以为你准备好创建 React 原生项目所需的一切。你可以用它来创建分类和文件,而且该框架还自带了工具用来构建,测试和启动应用。
```
# 安装软件包
$ npm install -g create-react-native-web-app
 
# 运行 create-react-native-web-app <项目目录>
$ create-react-native-web-app myApp
 
# 切换到创建的 <项目目录>
$ cd myApp
 
# 运行 Web/Ios/Android 调试
# Web
$ npm run web
 
# IOS模拟
$ npm run ios
 
# Android实际连接的设备
$ npm run android
```
#### 为什么选择 Create React App
1. 使用配置包、转码器,以及测试运行器进行开发的一流工具
2. 在应用架构里不需要配置以及没有额外文件
3. 确定的开发栈
4. 高效快速的开发工具
### 2、Material Kit React
[Material Kit React][3] 是受谷歌的 Material Design 系统启发开发的,很适合用来创建 React UI 组件。这个库最大的优点是提供了大量的组件,可以互相搭配做出非常好的效果。有超过一千个完全编码的组件,每一个都有用文件夹组织起来的独立层。这样你就可以有上千个选项可以选择。它同时也包含一些示例页面,方便你从中寻找灵感,或者向别人分享你的点子或创意。
#### 安装 Material Kit
```
$ npm install @material-ui/core
```
#### 使用
```
import React from 'react';
import Button from '@material-ui/core/Button';
const App = () => (
  <Button variant="contained" color="primary">
    Hello World
  </Button>
);
```
Material-UI 组件不需要其他额外设置,也不会干扰全局变量空间。
#### 优点
这个 React 组件支持简易快速的网页开发。你可以用它创建自己的设计系统,或者直接开始 Material Design。
### 3、Shards React
这个现代的 React UI 工具为了追求高效率,是从最底层开始构建的。它拥有现代的设计系统,可以让你按自己的想法任意定制。你甚至可以下载源文件,然后从代码级别定制。另外,它用来设计样式的 SCSS 语法提高了开发体验。
[Shards React][4] 基于 Shards使用了 React Datepicker、React Popper一个定位引擎和 noUISlider。还带有非常优秀的 Material Design 图标。还有很多设计好的版本,可以帮你寻找灵感或上手。
#### 用 Yarn 或 NPM 安装 Shards
```
# Yarn
yarn add shards-react
# NPM
npm i shards-react
```
#### 优点
1. Shards 是一个轻量级的脚本,压缩后大概 13kb
2. Shards 默认支持响应式,图层可以适配任意大小屏幕
3. Shards 有完整的文档,可以快速开始构建漂亮的界面
### 4、Styled Components
这个高效的 CSS 工具可以用来为应用的可视界面创建小型可重用的组件。使用传统的 CSS你可能会不小心覆盖掉网站其他位置的选择器但 [Styled Components][5] 通过使用直接内嵌到组件里的 CSS 语法,可以完全避免这个问题。
#### 安装
```
npm install --save styled-components
```
#### 使用
```
const Button = styled.button`
  background: background_type;
  border-radius: radius_value;
  border: abc;
  color: name_of_color;
  Margin: margin_value;
  padding: value`;
```
#### 优点
1. 让组件有更好的可读性
2. 组件样式依赖 JavaScript
3. 创建定制 CSS 组件
4. 内嵌样式
5. 简单地调用 `styled()` 可以将组件甚至是自定义组件转换成样式组件
### 5、Redux
[Redux][6] 是一个为 JavaScript 应用提供状态管理的方案。常用于 React.js也可以用在其他类 React 框架里。
#### 安装
```
sudo npm install redux
sudo npm install react-redux
```
#### 使用
```
import { createStore } from "redux";
import rotateReducer from "reducers/rotateReducer";
function configureStore(state = { rotating: value}) {
  return createStore(rotateReducer,state);
}
export default configureStore;
```
#### 优点
1. 可预计的状态更新有助于定义应用里的数据流
2. 逻辑上测试更简单,使用 reducer 函数进行时间旅行调试也更容易
3. 统一管理状态
### 6、React Virtualized
这个 React Native JavaScript 框架帮助渲染 large-list 和 tabular-data。使用 [React Virtualized][7]你可以限制请求和文档对象模型DOM元素的数量从而提高 React 应用的性能。
#### 安装
```
npm install react-virtualized
```
#### 使用
```
import 'react-virtualized/styles.css'
import { Column, Table } from 'react-virtualized'
import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer'
import List from 'react-virtualized/dist/commonjs/List'
{
  alias: {
    'react-virtualized/List': 'react-virtualized/dist/es/List',
  },
  ...等等
}
```
#### 优点
1. 高效展示大量数据
2. 渲染超大数据集
3. 使用一系列组件实现虚拟渲染
### 7、React DnD
[React DnD][8] 用来创建复杂的拖放界面。拖放控件库有很多,选用 React DnD 是因为它是基于 HTML5 的拖放 API 的,创建界面更简单。
#### 安装
```
npm install react-dnd-preview
```
#### 使用
```
import Preview from 'react-dnd-preview';
 
const generatePreview = ({itemType, item, style}) => {
  return <div class="item-list" style={style}>{itemType}</div>;
};
class App extends React.Component {
...
  render() {
    return (
      <DndProvider backend={MyBackend}>
        <ItemList />
        <Preview generator={generatePreview} />
        // or
        <Preview>{generatePreview}</Preview>
      </DndProvider>
    );
  }
}
```
#### 优点
1. 漂亮自然的控件移动
2. 强大的键盘和屏幕阅读支持
3. 极限性能
4. 强大整洁的接口
5. 标准浏览器支持非常好
6. 中性样式
7. 没有额外创建 DOM 节点
### 8、React Bootstrap
这个 UI 库将 Bootstrap 的 JavaScript 替换成了 React可以更好地控制每个组件的功能。每个组件都构建成能轻易访问因此 [React Bootstrap][9] 有利于构建前端框架。有上千种 bootstrap 主题可以选择。
#### 安装
```
npm install react-bootstrap bootstrap
```
#### 使用
```
import 'bootstrap/dist/css/bootstrap.min.css';
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
```
#### 优点
1. 可以简单导入所需的代码/组件
2. 通过压缩 Bootstrap 节省了输入和问题
3. 通过压缩 Bootstrap 减少了输入工作和冲突
4. 使用简单
5. 使用元素封装
### 9、React Suite
[React Suite][10] 是另一个高效的 React.js 框架,包含了大量组件库,方便开发企业级产品。支持所有主流浏览器和平台,适用于任何系统。还支持服务器端渲染。
#### 安装
```
npm i rsuite --save
```
#### 使用
```
import { Button } from 'rsuite';
import 'rsuite/styles/less/index.less';
ReactDOM.render(<Button>Button</Button>, mountNode);
```
#### 优点
1. 通过全局访问特性轻松管理应用
2. 使用 Redux 库集中管理系统状态
3. Redux 库有灵活的 UI 层,以及广泛的生态
4. Redux 库减少系统复杂度,并提供了全局访问特性
### 10、PrimeReact
[PrimeReact][11] 最值得推荐的是它提供了几乎覆盖所有基本 UI 需求的组件,比如输入选项,菜单,数据展示,消息,等等。这个框架还优化了移动体验,帮助你设计触摸优化的元素。
#### 安装
```
npm install primereact --save
npm install primeicons --save
```
#### 使用
```
import {Dialog} from 'primereact/dialog';
import {Accordion,AccordionTab} from 'primereact/accordion';
dependencies: {
    "react": "^16.0.0",
    "react-dom": "^16.0.0",
    "react-transition-group": "^2.2.1",
    "classnames": "^2.2.5",
    "primeicons": "^2.0.0"
}
```
#### 优点
1. 简单而高效
2. 容易使用
3. Spring 应用
4. 创建复杂用户界面
5. 好用而简单
### 11、React Router
[React Router][12] 在 React Native 开发社区很受欢迎,因为它上手很容易。只需要你在电脑上安装 Git 和 npm 包管理工具,有 React 的基础知识,以及好学的意愿。没什么特别难的地方。
#### 安装
```
$ npm install --save react-router
```
#### 使用
```
import { Router, Route, Switch } from "react-router";
 
// 使用 CommonJS 模块
var Router = require("react-router").Router;
var Route = require("react-router").Route;
var Switch = require("react-router").Switch;
```
#### 优点
1. 动态路由匹配
2. 在导航时支持不同页面的 CSS 切换
3. 统一的应用结构和行为
### 12、Grommet
[Grommet][13] 常用于开发响应式、可访问的移动网页应用。这个用 Apache 2.0 许可证授权的 JavaScript 框架最大的优点是用很小的包提供了可访问性、模块化、响应式以及主题功能。这可能是它被一些公司广泛使用的主要原因,比如奈飞、通用电气、优步以及波音。
#### 安装 for yarn and npm
```
$ npm install grommet styled-components --save
```
#### 使用
```
"grommet-controls/chartjs": {
          "transform": "grommet-controls/es6/chartjs/${member}",
          "preventFullImport": true,
          "skipDefaultConversion": true
```
#### 优点
1. 创建一个工具包来打包
2. 把开放政策发挥到极致
3. 重构有助于影响已成立的组织
### 13、Onsen UI
[Onsen UI][14] 另一个使用 HTML5 和 JavaScript 的手机应用开发框架,集成了 Angular、Vue 和 React使用 Apache 2.0 许可证授权。
Onsen 提供了标签、侧边栏、堆栈导航以及其他组件。这个框架最好的地方是,它所有的组件都支持 iOS 和安卓 Material Design 自动适配,会根据不同的平台切换应用的外观。
#### 安装
```
npm install onsenui
```
#### 使用
```
(function() {
    'use strict';
    var module = angular.module('app', ['onsen']);
    module.controller('AppController', function($scope) {
      // more to come here
    });
})();
```
#### 优点
1. Onsen UI 基于自由而开源代码
2. 不强制基于它开发的应用使用任何形式的 DRM
3. 内置了 JavaScript 和 HTML5 代码
4. 给最终用户带来原生体验
* * *
你最喜欢哪个 React JavaScript 框架?请在评论区分享。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/react-javascript-frameworks
作者:[Amit Dua][a]
选题:[lujun9972][b]
译者:[zpl1025](https://github.com/zpl1025)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/amitdua
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_javascript.jpg?itok=60evKmGl (Javascript code close-up with neon graphic overlay)
[2]: https://github.com/facebook/create-react-app
[3]: https://github.com/creativetimofficial/material-kit-react
[4]: https://github.com/DesignRevision/shards-react
[5]: https://github.com/styled-components/styled-components
[6]: https://github.com/reduxjs/redux
[7]: https://github.com/bvaughn/react-virtualized
[8]: https://github.com/react-dnd/react-dnd/
[9]: https://github.com/react-bootstrap/react-bootstrap
[10]: https://github.com/rsuite/rsuite
[11]: https://github.com/primefaces/primereact
[12]: https://github.com/ReactTraining/react-router
[13]: https://github.com/grommet/grommet
[14]: https://github.com/OnsenUI/OnsenUI

View File

@ -4,13 +4,15 @@
[#]: collector: "lujun9972"
[#]: translator: "unigeorge"
[#]: reviewer: "turbokernel"
[#]: publisher: " "
[#]: url: " "
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13793-1.html"
在 Linux 上使用 lspci 命令查看硬件情况
======
lspci 命令用于显示 Linux 系统上的设备和驱动程序。
![computer screen ][1]
> lspci 命令用于显示 Linux 系统上的设备和驱动程序。
![](https://img.linux.net.cn/data/attachment/album/202109/17/091425l7c8au5c865x7q68.jpg)
当你在个人电脑或服务器上运行 Linux 时,有时需要识别该系统中的硬件。`lspci` 命令用于显示连接到 PCI 总线的所有设备,从而满足上述需求。该命令由 [pciutils][2] 包提供,可用于各种基于 Linux 和 BSD 的操作系统。
@ -50,7 +52,7 @@ $ sudo lspci
### 详细输出
添加 `-v` 选项会显示每个设备的详细信息,你可以使用 `-vv``-vvv` 来获取更多的设备细节。在 `-v` 级别,`lspci` 会显示所有设备的各种子系统和内存地址、中断请求 (IRQ) 编号和一些其他功能信息。输出信息会非常长。在你的系统上试一试吧。
添加 `-v` 选项会显示每个设备的详细信息,你可以使用 `-vv``-vvv` 来获取更多的设备细节。在 `-v` 级别,`lspci` 会显示所有设备的各种子系统和内存地址、中断请求IRQ编号和一些其他功能信息。输出信息会非常长。在你的系统上试一试吧。
### 使用 grep 过滤搜索
@ -81,7 +83,7 @@ $ sudo lspci -nn | grep -e VGA
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107 [GeForce GTX 650] [10de:0fc6] (rev a1)
```
设备名称后的方括号内有用冒号分隔的数字,即供应商和设备 ID。输出表明 Nvidia Corporation 制造的设备的供应商 ID 为 **10de**
设备名称后的方括号内有用冒号分隔的数字,即供应商和设备 ID。输出表明 Nvidia Corporation 制造的设备的供应商 ID 为 `10de`
`-d` 选项用于指定供应商、设备或类 ID 的所有设备。以下是我系统中的所有 Nvidia 设备(保留 `-nn` 以解析供应商 ID
@ -109,14 +111,14 @@ $ sudo lspci -nn -k -d 10de:
 Kernel modules: snd_hda_intel
```
可以看到额外显示了两行:<ruby>_正在使用的内核驱动程序_<rt><rp>(</rp>Kernel driver in use<rp>)</rp></rt></ruby><ruby>_内核模块_<rt><rp>(</rp>Kernel modules<rp>)</rp></rt></ruby>,其中后者列出了可用于支持该设备的模块。
可以看到额外显示了两行:<ruby>正在使用的内核驱动程序<rt>Kernel driver in use</rt></ruby><ruby>内核模块<rt>Kernel modules</rt></ruby>,其中后者列出了可用于支持该设备的模块。
### 同步最新状态
新设备和供应商总是在不断迭代。如果看到显示为 _unknown_ 的设备,说明你的 PCI 设备 ID 数据库可能已过时。有两种方法可以检查更新。`-Q` 选项会使用 DNS 查询中央数据库,当然,这需要联网。
新设备和供应商总是在不断迭代。如果看到显示为 `unknown` 的设备,说明你的 PCI 设备 ID 数据库可能已过时。有两种方法可以检查更新。`-Q` 选项会使用 DNS 查询中央数据库,当然,这需要联网。
```
`$ sudo lspci -Q`
$ sudo lspci -Q
```
你还可以通过运行命令 `update-pciids` 来更新本地 PCI ID 数据库。

View File

@ -0,0 +1,78 @@
[#]: subject: "Apps for daily needs part 5: video editors"
[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/"
[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13808-1.html"
满足日常需求的应用(五):视频编辑器
======
![][1]
视频编辑已经成为一种流行的活动。人们出于各种原因需要视频编辑,不管是工作、教育或仅仅是一种爱好。现在也有很多平台可以在互联网上分享视频,以及几乎所有的社交媒体和聊天工具都提供分享视频的功能。本文将介绍一些你可以在 Fedora Linux 上使用的开源视频编辑器。你可能需要安装提到的这些软件才能使用。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章《[安装 Fedora 34 工作站后要做的事情][4]》。这里列出了视频编辑器类别的一些日常需求的应用程序。
### Kdenlive
当有人问起 Linux 上的开源视频编辑器时,经常出现的答案是 Kdenlive。它是一个在开源用户群体中非常流行的视频编辑器。这是因为它的功能对于一般用途来说是足够的而且对于非专业人士的人来说也很容易使用。
Kdenlive 支持多轨编辑因此你可以将多个来源的音频、视频、图像和文本结合起来。这个应用程序还支持各种视频和音频格式这样你就不必事先转换它们。此外Kdenlive 提供了各种各样的效果和转场以支持你的创造力来制作很酷的视频。Kdenlive 提供的一些功能有:用于创建 2D 字幕的字幕器、音频和视频范围、代理编辑、时间线预览、关键帧效果等等。
![][5]
更多信息可在此链接中获得:<https://kdenlive.org/en/>
### Shotcut
Shotcut 与 Kdenlive 的功能大致相同。这个应用程序是一个通用的视频编辑器。它有一个相当简单的界面,但功能齐全,可以满足你视频编辑工作的各种需要。
Shotcut 拥有一套完整视频编辑功能提供了从简单的编辑到高级的功能。它还支持各种视频、音频和图像格式。你不需要担心你的编辑历史因为这个应用程序有无限的撤销和重做功能。Shotcut 还提供了各种视频和音频效果因此你可以自由地创造性地制作你的视频作品。它提供的一些功能有音频过滤器、音频混合、交叉淡化的音视频溶解过渡、音调发生器、速度变化、视频合成、3 路色轮、轨道合成/混合模式、视频过滤器等。
![][6]
更多信息可在此链接中获得:<https://shotcut.org/>
### Pitivi
如果你想要一个具有直观和简洁用户界面的视频编辑器Pitivi 将是正确的选择。你会对它的外观感到舒适并且不难找到你需要的功能。这个应用程序被归类为非常容易学习特别是如果你需要一个用于简单编辑需求的应用程序时。然而Pitivi 仍然提供了种种功能,如修剪 & 切割、混音、关键帧音频效果、音频波形、音量关键帧曲线、视频过渡等。
![][7]
更多信息可在此链接中获得:<https://www.pitivi.org/>
### Cinelerra
Cinelerra 是一个已经开发了很久的视频编辑器。它为你的视频工作提供了大量的功能如内置帧渲染、各种视频效果、无限的层、8K 支持、多相机支持、视频音频同步、渲染农场、动态图形、实时预览等。这个应用程序可能不适合那些刚开始学习的人。我认为你需要一段时间来适应这个界面,特别是如果你已经熟悉了其他流行的视频编辑应用程序。但 Cinelerra 仍是一个有趣的选择,可以作为你的视频编辑器。
![][8]
更多信息请见此链接:<http://cinelerra.org/>
### 总结
这篇文章介绍了四个在 Fedora Linux 上可用的视频编辑器应用,以满足你的日常需求。实际上,在 Fedora Linux 上还有很多其他的视频编辑器可以使用。你也可以使用 OliveFedora Linux 仓库)、 OpenShotrpmfusion-free、Flowbladerpmfusion-free等等。每个视频编辑器都有自己的优势。有些在纠正颜色方面比较好而有些在各种转场和效果方面比较好。当涉及到如何轻松地添加文本时有些则更好。请选择适合你需求的应用程序。希望这篇文章可以帮助你选择正确的视频编辑。如果你有使用这些应用程序的经验请在评论中分享你的经验。
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/
作者:[Arman Arisman][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://fedoramagazine.org/author/armanwu/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/FedoraMagz-Apps-5-video-816x345.jpg
[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/
[5]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-kdenlive-1024x576.png
[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-shotcut-1024x576.png
[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-pitivi-1024x576.png
[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-cinelerra-1024x576.png
[9]: https://www.olivevideoeditor.org/

View File

@ -3,71 +3,56 @@
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13795-1.html"
从命令行调试网页错误
从命令行使用 wget 调试网页错误
======
调试网络服务器的一种方法是使用 wget 命令行程序。
![Digital creative of a browser on the internet][1]
有时在管理一个网站时,事情会被搞得一团糟。你可能会删除一些陈旧的内容,用重定向到其他页面来代替。后来,在做了其他改动后,你发现一些网页变得完全无法访问了。你可能会在浏览器中看到一个错误:“该页面没有正确重定向”,并建议你检查你的 cookies。
> 调试 Web 服务器的一种方法是使用 wget 命令行程序。
![](https://img.linux.net.cn/data/attachment/album/202109/17/225018elcip4pii4qcknir.jpg)
有时在管理一个网站时,事情会被搞得一团糟。你可能会删除一些陈旧的内容,用重定向到其他页面来代替。后来,在做了其他改动后,你发现一些网页变得完全无法访问了。你可能会在浏览器中看到一个错误:“该页面没有正确重定向”,并建议你检查你的 cookie。
![Redirect loop example in Firefox][2]
Screenshot by Jim Hall[CC-BY SA 4.0][3]
调试这种情况的一个方法是使用 `wget` 命令行程序,使用 `-S` 选项来显示所有的服务器响应。当使用 `wget` 进行调试时,我也喜欢使用 `-O` 选项将输出保存到一些临时文件中,以备以后需要查看其内容。
```
$ wget -O /tmp/test.html -S <http://10.0.0.11/announce/>
\--2021-08-24 17:09:49-- <http://10.0.0.11/announce/>
$ wget -O /tmp/test.html -S http://10.0.0.11/announce/
--2021-08-24 17:09:49-- http://10.0.0.11/announce/
Connecting to 10.0.0.11:80... connected.
HTTP request sent, awaiting response...
HTTP request sent, awaiting response...
HTTP/1.1 302 Found
Date: Tue, 24 Aug 2021 22:09:49 GMT
Server: Apache/2.4.48 (Fedora)
X-Powered-By: PHP/7.4.21
Location: <http://10.0.0.11/assets/>
Location: http://10.0.0.11/assets/
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
Location: <http://10.0.0.11/assets/> [following]
\--2021-08-24 17:09:49-- <http://10.0.0.11/assets/>
Location: http://10.0.0.11/assets/ [following]
--2021-08-24 17:09:49-- http://10.0.0.11/assets/
Reusing existing connection to 10.0.0.11:80.
HTTP request sent, awaiting response...
HTTP request sent, awaiting response...
HTTP/1.1 302 Found
Date: Tue, 24 Aug 2021 22:09:49 GMT
Server: Apache/2.4.48 (Fedora)
X-Powered-By: PHP/7.4.21
Location: <http://10.0.0.11/announce/>
Location: http://10.0.0.11/announce/
Content-Length: 0
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
Location: <http://10.0.0.11/announce/> [following]
\--2021-08-24 17:09:49-- <http://10.0.0.11/announce/>
Location: http://10.0.0.11/announce/ [following]
--2021-08-24 17:09:49-- http://10.0.0.11/announce/
Reusing existing connection to 10.0.0.11:80.
.
.
@ -84,7 +69,7 @@ via: https://opensource.com/article/21/9/wget-debug-web-server
作者:[Jim Hall][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/) 荣誉推出

View File

@ -3,38 +3,38 @@
[#]: author: "Quinn Foster https://opensource.com/users/quinn-foster"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13800-1.html"
构建开源的社区健康分析平台
======
一个学术性的 OSPO 正在与 CHAOSS 软件合作以建立一个社区健康分析平台。
![metrics and data shown on a computer screen][1]
罗切斯特理工学院RIT最近在增加其在开源世界的存在方面取得了相当大的进展。例如其开源项目办公室Open@RIT已经开始帮助 RIT 的教职员工为他们的开源项目建立和维护社区
> 一个学术性的 OSPO 正在与 CHAOSS 软件合作,以建立一个社区健康分析平台。
这些进展是由 RIT 的学生、教师和工作人员推动的。目前,大学里已经有越来越多的人在领导他们自己的开放项目。然而,运行一个完全的开源项目可能是很麻烦的。这主要来自于维护项目的社区和管理数据,如项目的代码、问题跟踪和仓库。
![](https://img.linux.net.cn/data/attachment/album/202109/19/100755mlngkwvvwjjlblgn.png)
为了帮助这些人Open@RIT 正在创建一个名为 Mystic 的系统,这是一个社区健康分析平台,利用了 [GrimoireLab][2],这是一个由 [CHAOSS][3] 软件开发的开源工具包为开源项目提供指标和分析。GrimoireLab 允许用户收集、丰富、过滤和可视化一个项目的数据,例如一个报告的问题被解决的时间、贡献者的关系等。
<ruby>罗切斯特理工学院<rt>Rochester Institute of Technology</rt></ruby>RIT最近在增加其在开源世界的影响力方面取得了相当大的进展。RIT的自由和开源软件及自由文化辅修课程是学术界的第一个此类课程。例如其开源项目办公室 Open@RIT 已经开始帮助 RIT 的教职员工和研究员为他们的开源项目建立和维护社区。
这些进展是由 RIT 的学生、教师和工作人员推动的。目前,大学里已经有越来越多的人在管理他们自己的开源项目。然而,运行一个完全的开源项目可能是很麻烦的。这主要来自于维护项目的社区和管理数据,如项目的代码、问题跟踪和仓库。
为了帮助他们Open@RIT 正在创建一个名为 Mystic 的系统,这是一个社区健康分析平台,利用了 [GrimoireLab][2],这是一个由 [CHAOSS][3] 软件开发的开源工具包为开源项目提供了指标和分析。GrimoireLab 允许用户收集、丰富、过滤和可视化一个项目的数据,例如一个报告的问题被解决的时间、贡献者的关系等。
Mystic 将作为一个前端门户,任何人都可以提交他们的项目。在那里,项目将被直接发送到 GrimoireLab它将在几分钟后为提交者计算并发布项目的指标。
> Open@RIT 的全栈开发者和 Mystic 的首席开发者 Emi Simpson 说:“我们希望 RIT 的任何管理、领导或参与开源项目的人都能将该项目提交给 Mystic并获得他们需要的任何指标”。
这个过程很简单。登录 Mystic 后,上传项目的用户会打开一个弹出式窗口,输入项目的细节和数据源的链接,如 GitLab、RSS feed 和一个开放软件基金会OSF项目。一旦细节和项目被保存下来Mystic 就会使用 GrimoireLab 从项目源中自动检索指标,并为每个源渲染图表。然后,该项目及其指标将显示在它自己的仪表板上。
这个过程很简单。登录 Mystic 后,上传项目的用户会打开一个弹出式窗口,输入项目的细节和数据源的链接,如 GitLab、RSS feed 和一个<ruby>开放软件基金会<rt>Open Software Foundation</rt></ruby>OSF项目。一旦保存了细节和项目Mystic 就会使用 GrimoireLab 从项目源中自动检索指标,并为每个源渲染图表。然后,该项目及其指标将显示在它自己的仪表板上。
![Mystic statistics page][4]
Screenshot by Quinn Foster[CC-BY SA 4.0][5]
这些仪表盘将并列显示在一个页面上,以供其他人查看,鼓励 RIT 内部的开源社区之间的合作开发和互动。Simpson 和 Open@RIT 希望这将增加 RIT 的开放工作的参与度,并进一步巩固该大学作为开放工作中心的地位。
这些仪表盘将并列显示在一个页面上,以供其他人查看,鼓励全世界 RIT 内部的开源社区之间的合作开发和互动。Simpson 和 Open@RIT 希望这将增加 RIT 的开放工作的参与度,并进一步巩固该大学作为开放工作中心的地位。
> Simpson 说:“如果有人问 RIT 在为开源软件做什么,我希望人们能够指着 Mystic 和 GrimoireLab 说就是这些。通过建立‘这些’是我们正在做的,这些是我们的贡献,这些是人们正在做的项目的指标,我们可以在 RIT 建立一个以我们正在做的开源工作为中心的社区。”
> Simpson 说:“如果有人问 RIT 在为开源软件做什么,我希望人们能够指着 Mystic 和 GrimoireLab 说就是这些。通过建立‘这些是我们正在做的,这些是我们的贡献,这些是人们正在做的项目’的指标,我们可以在 RIT 建立一个以我们正在做的开源工作为中心的社区。”
目前Mystic 仍在开发中,还没有准备好进入生产环境,但它对 RIT 和整个开源的潜力仍然是有目共睹的。未来的目标包括实现与大学报告工具的轻松整合,以及在项目层面和总体上的综合仪表盘。
你对 Mystic 的贡献感兴趣吗?[请与我们联系][6]开始吧。
你对 Mystic 的贡献感兴趣吗?[请与我们联系][6] 开始吧。
--------------------------------------------------------------------------------
@ -43,7 +43,7 @@ via: https://opensource.com/article/21/9/openrit-mystic
作者:[Quinn Foster][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/) 荣誉推出

View File

@ -3,31 +3,31 @@
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13806-1.html"
用 Linux sed 命令替换智能引号
======
用你喜欢的 sed 版本去除“智能”引号。
![Coding on a computer][1]
In typography, a pair of quotation marks were traditionally oriented toward one another. They look like this:
> 用你喜欢的 sed 版本去除“智能”引号。
![](https://img.linux.net.cn/data/attachment/album/202109/21/151406chun5nyumy8wyu5y.png)
在排版学中,一对引号传统上是朝向彼此的。它们看起来像这样:
“智能引号”
随着计算机在二十世纪中期的普及,这种向往往被放弃了。计算机的原始字符集没有太多的空间,所以在 ASCII 规范中,两个双引号和两个单引号被缩减为各一个是合理的。如今,通用的字符集是 Unicode有足够的空间容纳许多花哨的引号和撇号但许多人已经习惯了开头和结尾引号都只有一个字符的极简主义。此外计算机实际上将不同种类的引号和撇号视为不同的字符。换句话说对计算机来说右双引号与左双引号或直引号是不同的。
随着计算机在二十世纪中期的普及,这种向往往被放弃了。计算机的原始字符集没有太多的空间,所以在 ASCII 规范中,两个双引号和两个单引号被缩减为各一个是合理的。如今,通用的字符集是 Unicode有足够的空间容纳许多花哨的引号和撇号但许多人已经习惯了开头和结尾引号都只有一个字符的极简主义。此外计算机实际上将不同种类的引号和撇号视为不同的字符。换句话说对计算机来说右双引号与左双引号或直引号是不同的。
### 用 sed 替换智能引号
计算机并不是打字机。当你按下键盘上的一个键时,你不是在按一个带有印章的控制杆。你只是按下一个按钮,向你的计算机发送一个信号,计算机将其解释为一个显示特定预定义字符的请求。这个请求取决于你的键盘映射。作为一个 Dvorak 打字员,我目睹了人们在发现我的键盘上的 “asdf” 在屏幕上产生 “aoeu” 时脸上的困惑。你也可能按了一些特殊的组合键来产生字符,如 ™ 或 ß 或 ≠,这甚至没有印在你的键盘上。
每个字母或字符不管它是否印在你的键盘上都有一个编码。字符编码可以用不同的方式表达但对计算机来说Unicode 序列 u2018 和 u2019 产生 **** 和 ****,而代码 u201c 和 u201d 产生 **“** 和 **”** 字符。知道这些“秘密”代码意味着你可以使用 [sed][2] 这样的命令以编程方式替换它们。任何版本的 sed 都可以,所以你可以使用 GNU sed 或 BSD sed甚至是 [Busybox][3] sed。
每个字母或字符不管它是否印在你的键盘上都有一个编码。字符编码可以用不同的方式表达但对计算机来说Unicode 序列 u2018 和 u2019 产生 ````,而代码 u201c 和 u201d 产生 `“``”` 字符。知道这些“秘密”代码意味着你可以使用 [sed][2] 这样的命令以编程方式替换它们。任何版本的 sed 都可以,所以你可以使用 GNU sed 或 BSD sed甚至是 [Busybox][3] sed。
下面是我使用的简单的 shell 脚本:
```
#!/bin/sh
# GNU All-Permissive License
@ -39,7 +39,6 @@ $SED -i -e "s/[$SDQUO]/\'/g" -e "s/[$RDQUO]/\"/g" "${1}"
将此脚本保存为 `fixquotes.sh`,然后创建一个包含智能引号的单独测试文件:
```
Single quote
“Double quote”
@ -47,7 +46,6 @@ $SED -i -e "s/[$SDQUO]/\'/g" -e "s/[$RDQUO]/\"/g" "${1}"
运行该脚本,然后使用 [cat][4] 命令查看结果:
```
$ sh ./fixquotes.sh test.txt
$ cat test.txt
@ -68,7 +66,7 @@ via: https://opensource.com/article/21/9/sed-replace-smart-quotes
作者:[Seth Kenlon][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/) 荣誉推出

View File

@ -3,32 +3,30 @@
[#]: author: "Mateus Rodrigues Costa https://fedoramagazine.org/author/mateusrodcosta/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13803-1.html"
How to check for update info and changelogs with rpm-ostree db
如何用 rpm-ostree 数据库检查更新信息和更新日志
======
![][1]
Photo by [Dan-Cristian Pădureț][2] on [Unsplash][3]
这篇文章将教你如何使用 `rpm-ostree` 数据库及其子命令检查更新、检查更改的软件包和阅读更新日志。
This article will teach you how to check for updates, check the changed packages, and read the changelogs with _rpm-ostree db_ and its subcommands.
这些命令将在 Fedora Silverblue 上进行演示,并且应该在任何使用 `rpm-ostree` 的操作系统上工作。
The commands will be demoed on a Fedora Silverblue installation and should work on any OS that uses _rpm-ostree_.
### 简介
### Introduction
假设你对不可更改的系统感兴趣。在基于容器技术构建用例时使用只读的基本系统听起来非常有吸引力,它会说服你选择使用 `rpm-ostree` 的发行版。
Lets say you are interested in immutable systems. Using a base system that is read-only while you build your use cases on top of containers technology sounds very attractive and it persuades you to select a distro that uses _rpm-ostree_.
你现在发现自己在 [Fedora Silverblue][4](或其他类似的发行版)上,你想检查更新。但你遇到了一个问题。虽然你可以通过 GNOME Software 找到 Fedora Silverblue 上的更新包,但你实际上无法阅读它们的更新日志。你也不能 [使用 dnf updateinfo 在命令行上读取它们][5],因为主机系统上没有 DNF。
You now find yourself on [Fedora Silverblue][4] (or another similar distro) and you want to check for updates. But you hit a problem. While you can find the updated packages on Fedora Silverblue with GNOME Software, you cant actually read their changelogs. You also cant [use _dnf updateinfo_ to read them on the command line][5], since theres no DNF on the host system.
那么,你应该怎么做呢?嗯,`rpm-ostree` 有一些子命令可以在这种情况下提供帮助。
So, what should you do? Well, _rpm-ostree_ has subcommands that can help in this situation.
### 检查更新
### Checking for updates
The first step is to check for updates. Simply run _rpm-ostree upgrade check_:
第一步是检查更新。只需运行:
```
$ rpm-ostree upgrade --check
@ -41,9 +39,9 @@ AvailableUpdate:
Diff: 4 upgraded
```
Notice that while it doesnt tell the updated packages in the output, it does show the Commit for the update as _d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4_. This will be useful later.
请注意,虽然它没有在输出中告诉更新的软件包,但它显示了更新的提交为 `d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4`。这在后面会很有用。
Next thing you need to do is find the Commit for the current deployment you are running. Run _rpm-ostree status_ to get the BaseCommit of the current deployment:
接下来你需要做的是找到你正在运行的当前部署的提交。运行 `rpm-ostree status` 以获得当前部署的<ruby>基提交<rt>BaseCommit</rt></ruby>
```
$ rpm-ostree status
@ -58,9 +56,9 @@ Deployments:
...
```
For this example BaseCommit is _e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e_.
对于这个例子,基提交是`e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e`。
Now you can find the diff of the two commits with _rpm-ostree db diff [commit1] [commit2]_. In this command _commit1_ will be the BaseCommit from the current deployment and _commit2_ will be the Commit from the upgrade checking command.
现在你可以用 `rpm-ostree db diff [commit1] [commit2]` 找到这两个提交的差异。在这个命令中,`[commit1]` 将是当前部署的基提交,`[commit2]` 将是升级检查命令中的提交。
```
$ rpm-ostree db diff e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4
@ -70,7 +68,7 @@ Upgraded:
soundtouch 2.1.1-6.fc34 -> 2.1.2-1.fc34
```
The diff output shows that _soundtouch_ was updated and indicates the version numbers. View the changelogs by adding _changelogs_ to the previous command:
`diff` 输出显示 `soundtouch` 被更新了,并指出了版本号。通过在前面的命令中加入 `-changelogs` 来查看更新日志:
```
$ rpm-ostree db diff e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4 --changelogs
@ -86,13 +84,13 @@ Upgraded:
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
```
This output shows the commit notes as well as the version numbers.
这个输出显示了提交说明以及版本号。
### Conclusion
### 总结
Using _rpm-ostree db_ you are now able to have the functionality equivalent to _dnf check-update_ and _dnf updateinfo_.
使用 `rpm-ostree db`,你现在可以拥有相当于 `dnf check-update``dnf updateinfo` 的功能。
This will come in handy if you want to inspect detailed info about the updates you install.
如果你想检查你所安装的更新的详细信息,这将非常有用。
--------------------------------------------------------------------------------
@ -100,8 +98,8 @@ via: https://fedoramagazine.org/how-to-check-for-update-info-and-changelogs-with
作者:[Mateus Rodrigues Costa][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者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/) 荣誉推出

View File

@ -0,0 +1,96 @@
[#]: subject: "Raspberry Pi Zero vs Zero W: Whats the Difference?"
[#]: via: "https://itsfoss.com/raspberry-pi-zero-vs-zero-w/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "anine09"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13799-1.html"
树莓派 Zero 与 Zero W 对比
======
树莓派十年前凭借 25 美元的迷你电脑掀起了一场革命。随着时间的推移,树莓派发布了许多变种。有些是对以前的型号进行升级,有些是为特定目的而制作的。
在所有的树莓派模块中Pi Zero 和 Pi Zero W 是最便宜的型号,旨在用于小规模项目和 IoT 项目。这两种设备几乎是相同的,但是它们之间有一些微妙而重要的区别。
**那么,树莓派 Zero 和 Zero W 之间的区别是什么Zero W 中的 W 代表的是<ruby>无线<rt>Wireless</rt></ruby>,它表示的是 Zero W 模块拥有无线功能。这是这两个相似模块之间的最大差异。**
让我们来详细了解一下。
### Pi Zero 与 Pi Zero W 之间的主要不同点
![][1]
树莓派 Zero 是以在只有 A+ 板一半的大小上提供尽可能多的功能为目标。
而树莓派 Zero W 是为了支持无线在后来推出的,在不需要任何附加的组件和模块的情况下就可以使用蓝牙和 Wi-Fi。
这是两者之间的关键区别,其他的规格保持一致。
所以,如果你需要以下功能:
* 802.11 b/g/n 无线网口
* 蓝牙 4.1
* 低功耗蓝牙BLE
树莓派 Zero W 将是你的不二之选。
此外,树莓派 Zero W 还提供了一种带引脚的版本,叫做 “树莓派 Pi Zero WH”
### 树莓派 Zero 和 Zero W 的规格
![Raspberry Pi Zero W][6]
[树莓派 Zero 和 Zero W 的规格][7] 几乎是一样的。
它们都具有 1 GHz 的单核 CPU 和 512 MB 的 RAM。至于接口方面一个 mini HDMI 接口,支持 micro USB OTG、micro USB 供电和一个 CSI 摄像头接口(用于插入一个相机模块)。
这些板子会提供一种叫 [HAT][8]<ruby>顶部附加硬件<rt>Hardware Attached on Top</rt></ruby>)兼容的 40 个引脚。但一般情况下,没有这些可以让你轻松插入接口的引脚。
你可以根据自己的功能需要选择使用 [各种树莓派兼容的系统][9],但无论哪种情况,我还是推荐你使用树莓派 OS。
### 树莓派 Zero 系列值不值得买?
![Raspberry Pi Zero][10]
树莓派 Zero 是一种很受人们喜欢的单片机形式,即使你有很多树莓派 Zero 的替代品,树莓派 Zero 仍然是最推荐的选择。
当然,除非你有特殊需求。
除了板子的尺寸之外,定价、功率要求、运算能力也是这款 20 美元以下的板子的主要亮点。
因此,如果你正在寻找预算内满足基本功能的单片机,树莓派 Zero 就是专门为你打造的。
### 树莓派 Zero 系列价格怎么样?
树莓派 Zero 售价 **5 美元** Zero W 售价 **10 美元左右**,当然,根据其供应情况和地区,定价规则会不一样,如果你选择带引脚的版本树莓派 Zero WH ,售价大概是 **14 美元** 左右。
还有 [其他的设备可以代替树莓派 Zero][11],它们价格也相差不大。
--------------------------------------------------------------------------------
via: https://itsfoss.com/raspberry-pi-zero-vs-zero-w/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[anine09](https://github.com/anine09)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-vs-zero-w.png?resize=800%2C450&ssl=1
[2]: https://i1.wp.com/m.media-amazon.com/images/I/517BwcAPmTL._SL160_.jpg?ssl=1
[3]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 "CanaKit Raspberry Pi Zero W (Wireless) Complete Starter Kit - 16 GB Edition"
[4]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 "Amazon Prime"
[5]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 "Buy on Amazon"
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-w.png?resize=600%2C400&ssl=1
[7]: https://itsfoss.com/raspberry-pi-zero-w/
[8]: https://github.com/raspberrypi/hats
[9]: https://itsfoss.com/raspberry-pi-os/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-1.png?resize=600%2C400&ssl=1
[11]: https://itsfoss.com/raspberry-pi-zero-alternatives/
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/raspberry-pi-zero-w-projects.png?fit=800%2C450&ssl=1
[13]: https://itsfoss.com/raspberry-pi-zero-projects/

View File

@ -3,22 +3,22 @@
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13802-1.html"
在 Linux 中使用 OBS 和 Wayland 进行屏幕录制
======
有[大量可用于 Linux 的屏幕录像机][1]。但是当涉及到支持 [Wayland][2] 时,几乎所有的都不能用。
[大量可用于 Linux 的屏幕录像机][1]。但是当涉及到支持 [Wayland][2] 时,几乎所有的都不能用。
这是个问题,因为许多新发布的版本都再次默认切换到 Wayland 显示管理器。而如果像屏幕录像机这样基本的东西不能工作,就会给人留下不好的体验。
[GNOME 的内置屏幕录像机][3]可以工作,但它是隐藏的,没有 GUI也没有办法配置和控制记录内容。还有一个叫 [Kooha][4] 的工具,但它一直在屏幕上显示一个计时器。
[GNOME 的内置屏幕录像机][3] 可以工作,但它是隐藏的,没有 GUI也没有办法配置和控制记录内容。此外,还有一个叫 [Kooha][4] 的工具,但它一直在屏幕上显示一个计时器。
只是为了录制屏幕而[在 Xorg 和 Wayland 之间切换][5],这不是很方便。
只是为了录制屏幕而 [在 Xorg 和 Wayland 之间切换][5],这不是很方便。
在这一切中,我很高兴地得知,由于 Pipewire 的帮助,在 OBS Studio v27 中支持了 Wayland。但即使是这样也不是很简单因此我将向你展示使用 [OBS Studio][6] 在 Wayland 上录制屏幕的步骤。
这种情况下,我很高兴地得知,由于 Pipewire 的帮助,在 OBS Studio v27 中支持了 Wayland。但即使是这样也不是很简单因此我将向你展示使用 [OBS Studio][6] 在 Wayland 上录制屏幕的步骤。
### 使用 OBS 在 Wayland 上进行屏幕录制
@ -30,7 +30,7 @@
你应该先安装 OBS Studio v27。它已经包含在 Ubuntu 21.10 中,我会在本教程中使用它。
要在 Ubuntu 18.04、20.04、Linux Mint 20 等系统上安装 OBS Studio 27请使用[官方的 OBS Studio PPA][8]。
要在 Ubuntu 18.04、20.04、Linux Mint 20 等系统上安装 OBS Studio 27请使用 [官方的 OBS Studio PPA][8]。
打开终端,逐一使用以下命令:
@ -56,7 +56,7 @@ sudo apt install obs-studio
![Do you see PipeWire option in the screen sources?][10]
**如果答案是否定的,请退出 OBS Studio**。这很正常。至少在 Ubuntu 下OBS Studio 不会自动切换到使用 Wayland。对此有一个修复方法。
**如果没看到,请退出 OBS Studio**。这很正常。至少在 Ubuntu 下OBS Studio 不会自动切换到使用 Wayland。对此有一个修复方法。
打开一个终端,使用以下命令:
@ -74,7 +74,7 @@ obs
![][10]
你这次用 QT_QPA_PLATFORM 变量明确要求 OBS Studio 使用 Wayland。
你这次用 `QT_QPA_PLATFORM` 变量明确要求 OBS Studio 使用 Wayland。
选择 PipeWire 作为源,然后它要求你选择一个显示屏幕。选择它并点击分享按钮。
@ -88,7 +88,7 @@ obs
这很好。你刚刚验证了你可以在 Wayland 上录制屏幕。但每次设置环境变量并从终端启动 OBS 并不方便。
你可以做的是**把这个变量导出到你的 ~/.bash_profile对你而言或 /etc/profile对系统中的所有用户而言。**
你可以做的是**把这个变量导出到你的 `~/.bash_profile`(对你而言)或 `/etc/profile`(对系统中的所有用户而言)。**
```
export QT_QPA_PLATFORM=wayland
@ -105,7 +105,7 @@ via: https://itsfoss.com/screen-record-obs-wayland/
作者:[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/) 荣誉推出

View File

@ -0,0 +1,107 @@
[#]: subject: "Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements"
[#]: via: "https://news.itsfoss.com/kali-linux-2021-3-release/"
[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13798-1.html"
Kali Linux 2021.3 的新改进
======
> Kali Linux 2021.3 带来了一些重要的功能改进以及一些新工具。此外还有一个惊喜,他们还宣布正在开发他们的第一个 NetHunter 智能手表。
![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/kali-linux-2021-3.jpg?w=1200&ssl=1)
Kali Linux 是 [用于渗透测试的最佳 Linux 发行版][1] 之一。它是基于 Debian 的,但它可能不适合替代你的成熟的桌面操作系统。
最新的 2021.3 版本带来了一些重要的功能添加和改进。让我们来看看它们。
### 有何新变化?
![][2]
#### OpenSSL 兼容性
重新配置了 [OpenSSL][3],以扩大 Kali 可以连接的服务。因此,老式过期的协议,如 TLS 1.0 和 TLS 1.1 以及更旧的加密算法,在默认情况下是允许的。也就是说;它将让 Kali 可以连接到更多过时的服务器。然而,如果你不需要它,你可以改变这个选项。
#### 虚拟化的改进
众所周知Kali 可以作为一个虚拟机完美地工作。首先,无论你的访客机是在 VirtualBox、VMware、Hyper-V 还是 QEMU+Spice 下运行,宿主机和访客机系统之间的拖放、复制和粘贴等操作都比以前更顺畅。
其次,使用 Kali-Tweaks 可以更容易为 Hyper-V 增强会话模式(一种虚拟化管理程序)配置 Kali。
简而言之Kali Linux 2021.3 使得在设置虚拟环境时的体验更加完美。
#### Kali 工具
每一个 Kali 版本都包含新的工具这是理所当然的。同样的这个版本也不例外。Kali 加入的工具有:
* [Berate_ap][4] - 编组 MANA rogue Wi-Fi 接入点
* [CALDERA][5] - 可扩展的自动对手模拟平台
* [EAPHammer][6] - 针对 WPA2-Enterprise Wi-Fi 网络的 evil twin 攻击
* [HostHunter][7] - 使用 OSINT 技术发现主机名的侦察工具
* [RouterKeygenPC][8] - 生成默认的 WPA/WEP 无线密钥
* [Subjack][9] - 子域接管
* [WPA_Sycophant][10] - EAP 中继攻击的邪恶客户端部分
#### Kali ARM 更新和 Kali-Tools
在 Kali 2021.3 中,对 ARM 设备的支持得到了更多的改进。我发现最吸引人的是:
* en_US.UTF-8 是所有镜像的默认语言。
* 重新构建了 Kali ARM 构建脚本,以更好地支持一些设备。
* 树莓派镜像现在可以使用 `/boot` 分区上的 `wpa_supplicant.conf` 文件。
此外Kali 刷新了其信息域 **Kali-Tools**,以提供简洁的工具概述、整洁的界面和快速的系统。
### 其他变化
![Kali Linux 2021.3][11]
Kali 还有其他一些不错的改进,包括:
* 改进了 Xfce 和 Gnome 版本的布局。Kali 并没有忘记 KDE因为这是它最喜欢的桌面环境之一已经内置了 KDE 5.21 是新的版本。
* 他们的文档网站中的一些重要页面进行了大幅更新。
* 与 Ampere 合作,让其 ARM 包构建机运行在 Ampere 的硬件上。因此,其大幅的提速使得 Kali 受益。
Kali 增强了针对安卓设备的移动渗透测试平台。换句话说,你现在可以在 Android 11 设备上安装 Kali NetHunter而不需要完整的可工作的 [TWRP][12]Team Win Recovery Project。最重要的是由于其方便的安装程序这一更新很有希望。
除了这个版本之外,他们还宣布了他们的第一个 NetHunter 智能手表,**TicHunter Pro**。但是,它仍然处于开发的最初阶段。
要了解更多关于这次升级的所有技术变化,请参考 [官方公告][13]。
### 总结
总的来说,这是一个重要的版本,提供了重要的改进和令人兴奋的新工具。从它的官方网站上下载它,就可以开始了。
- [下载 Kali Linux 2021.3][14]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/kali-linux-2021-3-release/
作者:[Omar Maarof][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://news.itsfoss.com/author/omar/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/linux-hacking-penetration-testing/
[2]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/kali-linux-desktop-2021-3.png?w=1200&ssl=1
[3]: https://www.openssl.org/
[4]: https://pkg.kali.org/pkg/berate-ap
[5]: https://pkg.kali.org/pkg/caldera
[6]: https://pkg.kali.org/pkg/eaphammer
[7]: https://pkg.kali.org/pkg/hosthunter
[8]: https://pkg.kali.org/pkg/routerkeygenpc
[9]: https://pkg.kali.org/pkg/subjack
[10]: https://pkg.kali.org/pkg/wpa-sycophant
[11]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/banner-kali-2021.3-release.jpg?w=1200&ssl=1
[12]: http://twrp.me/
[13]: https://www.kali.org/blog/kali-linux-2021-3-release/
[14]: https://www.kali.org/get-kali/

View File

@ -0,0 +1,194 @@
[#]: subject: "How to Install Kali Linux in VMware"
[#]: via: "https://itsfoss.com/install-kali-linux-vmware/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: " "
[#]: url: " "
如何在 VMware 中安装 Kali Linux
======
![](https://img.linux.net.cn/data/attachment/album/202109/21/144206sjhgutyjgtu6m22z.jpg)
Kali Linux 是 [用于学习和练习黑客攻击和渗透测试的 Linux 发行版][1] 的不二之选。
而且,如果你经常捣鼓 Linux 发行版,出于好奇心,你可能已经尝试过它。
> **警告!**
>
> 本文介绍的内容仅供学习 Kali Linux 的安装,请勿使用 Kali Linux 进行任何非授权的行为。Kali Linux 应该用于在授权的情况下,对授权的目标进行合理的渗透测试,以了解其脆弱性并加以防范。本文作译者和本站均不对非授权和非法的使用及其造成的后果负责。
然而,无论你用它做什么,它都不能替代正规成熟的桌面 Linux 操作系统。因此,(至少对于初学者来说)建议使用虚拟机程序(如 VMware来安装 Kali Linux。
通过虚拟机,你可以把 Kali Linux 作为你的 Windows 或 Linux 系统中的一个常规应用程序来使用,就像在你的系统中运行 VLC 或 Skype 一样。
有一些免费的虚拟化工具可供使用。你可以 [在 Oracle VirtualBox 上安装 Kali Linux][2] ,也可以使用 VMWare Workstation。
本教程重点介绍 VMWare。
### 在 Windows 和 Linux 的 VMware 上安装 Kali Linux
> **非 FOSS 警报!**
>
> VMWare 不是开源软件。
对于本教程,我假定你使用的是 Windows是考虑到大多数 VMware 用户喜欢使用 Windows 10/11。
然而,除了在 Windows 上安装 VMWare 的部分,本 **教程对 Linux 也是有效的**。你可以 [轻松地在 Ubuntu 和其他 Linux 发行版上安装 VMWare][3]。
#### 步骤 1安装 VMWare Workstation Player在 Windows 上)
如果你的系统上已经安装了 VMware你可以跳到安装 Kali Linux 的步骤。
前往 [VMWare 的 Workstation Player 官方网页][4],然后点击 “Download For Free” 按钮。
![][5]
接下来,你可以选择版本(如果你想要特定的版本或遇到最新版本的 bug然后点击 “Go to Downloads”。
![][6]
然后你就会看到 Windows 和 Linux 版本的下载按钮。你需要点击 “Windows 64-bit” 的按钮,因为这就是我们在这里需要的。
![][7]
顺便提一句,它不支持 32 位系统。
最后,当你得到下载的 .exe 文件时,启动它以开始安装过程。你需要点击 “Next” 来开始安装 VMware。
![][8]
接下来,你需要同意这些政策和条件才能继续。
![][9]
现在,你可以选择安装的路径。理想情况下,保持默认设置。但是,如果你在虚拟机中需要更好的键盘响应/屏幕上的键盘性能,你可能想启用 “<ruby>增强型键盘驱动程序<rt>Enhanced Keyboard Driver</rt></ruby>”。
![][10]
进入下一步,你可以选择禁用每次启动程序时的更新检查(可能很烦人),并禁用向 VMware 发送数据,这是其用户体验改进计划的一部分。
![][11]
如果你想使用桌面和开始菜单的快捷方式进行快速访问,你可以勾选这些设置,或像我一样将其取消。
![][12]
现在,继续以开始安装。
![][13]
这可能需要一些时间,完成后,你会看到另一个窗口,让你完成这个过程,并让你选择输入一个许可证密钥。如果你想获得商业许可,你需要 VMware Workstation 专业版,否则,该 Player 版本对个人使用是免费的。
![][14]
> **注意!**
>
> 请确保你的系统已经启用了虚拟化功能。最近的 VMWare 的 Windows 版本要求你明确启用虚拟化以使用虚拟机。
#### 步骤 2在 VMware 上安装 Kali Linux
开始时,你需要下载 Kali Linux 的镜像文件。而且如果你打算在虚拟机上使用它Kali Linux 会提供一个单独的 ISO 文件。
![][15]
前往其 [官方下载页面][16],下载可用的预构建的 VMware 镜像。
![][17]
你可以直接下载 .7z 文件或利用 Torrent一般来说速度更快。在这两种情况下你也可以用提供的 SHA256 值检查文件的完整性。
下载完成,你需要将文件解压到你选择的任何路径。
![][18]
打开 VMware Workstation Player然后点击 “<ruby>打开一个虚拟机<rt>Open a Virtual Machine</rt></ruby>”。现在,寻找你提取的文件夹。然后浏览它,直到你找到一个扩展名为 .vmx 的文件。
比如说,`Kali-Linux-2021.3-vmware-amd64.vmx`。
![][19]
选择 .vmx 文件来打开该虚拟机。它应该直接出现在你的 VMware Player 中。
你可以选择以默认设置启动虚拟机。或者,如果你想调整分配给虚拟机的硬件,可以在启动前随意改变设置。
![][20]
根据你的计算机硬件,你应该分配更多的内存和至少一半的处理器核心,以获得流畅的性能。
在这种情况下,我有 16GB 的内存和一个四核处理器。因此,为这个虚拟机分配近 7GB 的内存和两个内核是安全的。
![][21]
虽然你可以分配更多的资源,但它可能会影响你的宿主机操作系统在工作时的性能。所以,建议在这两者之间保持平衡。
现在,保存设置并点击 “<ruby>播放虚拟机<rt>Play virtual machine</rt></ruby>” 来启动 Kali Linux on VMware。
当它开始加载时,你可能会看到一些提示,告诉你可以通过调整一些虚拟机设置来提高性能。
你不用必须这样做,但如果你注意到性能问题,你可以禁用<ruby>侧通道缓解措施<rt>side-channel mitigations</rt></ruby>(用于增强安全性)来提高虚拟机的性能。
另外,你可能会被提示下载并 [安装 VMware tools for Linux][22];你需要这样做以获得良好的虚拟机体验。
完成之后,你就会看到 Kali Linux 的登录界面。
![][23]
考虑到你启动了一个预先建立的 VMware 虚拟机,你需要输入默认的登录名和密码来继续。
- 用户名:`kali`
- 密码: `kali`
![][24]
就是这样!你已经完成了在 VMware 上安装 Kali Linux。现在你所要做的就是开始探索了
### 接下来呢?
这里有一些你可以利用的提示:
* 如果剪贴板共享和文件共享不工作请在访客系统Kali Linux上 [安装 VMWare tools][22]。
* 如果你是新手,请查看这个 [Kali Linux 工具列表][25]。
如果你觉得这个教程有帮助,欢迎分享你的想法。你是否喜欢在不使用 VMware 镜像的情况下安装 Kali Linux请在下面的评论中告诉我。
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-kali-linux-vmware/
作者:[Ankush Das][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://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/linux-hacking-penetration-testing/
[2]: https://itsfoss.com/install-kali-linux-virtualbox/
[3]: https://itsfoss.com/install-vmware-player-ubuntu-1310/
[4]: https://www.vmware.com/products/workstation-player.html
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download.png?resize=732%2C486&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download-1.png?resize=800%2C292&ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download-final.png?resize=800%2C212&ssl=1
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-1.png?resize=692%2C465&ssl=1
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-license.png?resize=629%2C443&ssl=1
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-2.png?resize=638%2C440&ssl=1
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-workstation-tracking.png?resize=618%2C473&ssl=1
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-workstation-shortcuts.png?resize=595%2C445&ssl=1
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-install.png?resize=620%2C474&ssl=1
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-installed.png?resize=589%2C441&ssl=1
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-image-kali.png?resize=800%2C488&ssl=1
[16]: https://www.kali.org/get-kali/
[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux-image-download.png?resize=800%2C764&ssl=1
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/extract-vmware-image.png?resize=617%2C359&ssl=1
[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux-image-folder.png?resize=800%2C498&ssl=1
[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/virtual-machine-settings-kali.png?resize=800%2C652&ssl=1
[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/kali-vm-settings.png?resize=800%2C329&ssl=1
[22]: https://itsfoss.com/install-vmware-tools-linux/
[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/kali-linux-vm-login.png?resize=800%2C540&ssl=1
[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux.png?resize=800%2C537&ssl=1
[25]: https://itsfoss.com/best-kali-linux-tools/

View File

@ -1,71 +0,0 @@
[#]: subject: "Ubuntus Yaru Theme Now Officially Supports Xfce"
[#]: via: "https://news.itsfoss.com/yaru-xfce-support/"
[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Ubuntus Yaru Theme Now Officially Supports Xfce
======
Back when [Ubuntu 20.04][1] was released, the Ubuntu team stunned everyone with the new Yaru themes beautiful visuals and simplicity. It keeps on getting better with each Ubuntu release. It has become the symbolism of Ubuntu now.
However, the Yaru theme was not well supported for other desktop environments like Xfce.
Fortunately, this is set to change with a recent pull request on the [projects GitHub page][2]. Here, we will be looking at this change, as well as how to try out these changes for yourself.
### Yaru on Xfce
![][3]
This update started in late July, when developer [Muqtxdir][4] opened [a pull request on the Yaru GitHub page][5] to add support for the XFCE desktop environment. Over the course of a month, the awesome developers there worked tirelessly on improving Muqtxdirs work, with a result that is truly stunning.
![][3]
One interesting change is the panel, which now looks similar to the panel found in the GNOME desktop environment.
### If you want to try it right away (not recommended)
If you are already using XFCE, trying out the Yaru theme is as simple as following the instructions on here. For this, I will be assuming that you are using Xubuntu, however the commands can be easily adapted for other distributions.
```
sudo apt install git meson sassc libglib2.0-dev libxml2-utils
git clone https://github.com/ubuntu/yaru
cd yaru && meson build -Dxfwm4=true && sudo ninja -C build install
```
_**If you dont quite feel comfortable building it from source, I suspect that it will be available with Xubuntu 21.10, which is only a month away now.**_
Either way, I am really excited about this change, especially as it gives XFCE a much more modern and simplistic look. Plus, it also gives users a major reason to upgrade to Xubuntu 21.10.
What do you think about the Yaru theme on XFCE? Let me know in the comments below!
_Source: [Linux Uprising][6]_
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/yaru-xfce-support/
作者:[Jacob Crume][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://news.itsfoss.com/author/jacob/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/download-ubuntu-20-04/
[2]: https://github.com/ubuntu/yaru
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://github.com/Muqtxdir
[5]: https://github.com/ubuntu/yaru/pull/2971
[6]: https://www.linuxuprising.com/2021/09/ubuntus-yaru-theme-gets-official.html

View File

@ -1,81 +0,0 @@
[#]: subject: "Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon"
[#]: via: "https://news.itsfoss.com/vivaldi-replaces-firefox-manjaro/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon
======
Vivaldi is one of the [best web browsers available for Linux][1].
For all the good reasons, many Linux users have been switching to Vivaldi, especially after [Vivaldi 4.0 release][2].
Now, to take it up a notch, Vivaldi has managed to replace Firefox as the default browser on Arch-based Manjaro Linux (Cinnamon edition).
![][3]
Even though the Cinnamon version is a community edition, it is surprising that Mozilla Firefox dropped from a Linux distribution.
As per the official announcement, Manjaros co-CEO mentioned why they chose Vivaldi:
> _To give Vivaldi more of the attention it deserves, I decided to include it as the default browser in our popular Cinnamon Community Edition. With its remarkable browsing speed, exceptional customizability and especially the way it values user privacy, Vivaldi for me is a perfect match for Manjaro Linux._
### Customized Experience for Manjaro Linux Users
![][4]
To spice things up, [Vivaldi][5] comes baked in with a Manjaro-Cinnamon theme to give you a refreshing out-of-the-box experience.
Of course, if you have already used Vivaldi as your browser, you have to sync your data to get started.
### Vivaldi is a Great Option for Linux Users
![][6]
It is worth noting that Vivaldi is not 100% open-source, but you can find most of its source code online, except its UI. Also, it is based on Chromium.
However, it is a feature-rich web browser that lets you customize a lot of things. You also get a unique tab management feature, integration of web apps, email, calendar, timer, RSS feeds, and more.
I have been using Vivaldi as my daily driver on Linux, keeping Firefox as the secondary for a while now. And, I like the experience so far!
So, if you prefer multi-tasking without leaving the web browser, Vivaldi as your default choice should be exciting.
In addition to this, Vivaldi seems to be taking good care of its privacy policies while offering in-built ad blockers and encrypted sync features.
### Get Started Using Vivaldi on Manjaro Linux
You should be able to find and install Vivaldi through official Manjaro repositories.
If you want it by default, you can consider performing a fresh installation of Manjaro Linux Cinnamon.
Manjaro Linux Cinnamon
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/vivaldi-replaces-firefox-manjaro/
作者:[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://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/best-browsers-ubuntu-linux/
[2]: https://news.itsfoss.com/vivaldi-4-0-release/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMCIgd2lkdGg9IjY2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: https://vivaldi.com
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYxOCIgd2lkdGg9IjY5NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=

View File

@ -1,103 +0,0 @@
[#]: subject: "Fedora 35 Release Date and Expected New Features"
[#]: via: "https://news.itsfoss.com/fedora-35-release-date-features/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Fedora 35 Release Date and Expected New Features
======
Fedora 35 is just around the corner. And, if you cannot wait already, let us highlight some of the essential details about the release.
### Fedora 35 Release Date
The expected release date for Fedora 35 beta is **14th September 2021**. But, if delayed, the next planned date is **21st September 2021**.
After the public beta testing, the final release has been planned for **19th October 2021,** with a delayed date for **26th October 2021.**
Of course, you can get your hands on Fedora 35 before the final and beta releases as well. But, considering it is just a few days away from its first beta release, you may want to wait it out.
### Fedora 35 Features
![][1]
[Fedora 34][2] was an exciting release with GNOME 40 and a new i3 spin. And Fedora 35 is also shaping up as an interesting upgrade to it.
Some of the fundamental changes that you can expect are:
#### GNOME 41
GNOME 41 may not be a radical change when compared to [GNOME 40][3], but there are some visual improvements and valuable feature additions that you can expect.
For instance, the GNOME Software will get a clean look and context tiles, resembling much like all the details that you can find in the [Apps for GNOME][4] portal. You should also find [VoIP support added to GNOME 41][5].
A new “**Connections**” app has been added to let you connect to other platforms/systems remotely.
GNOME 41 has a planned release date of **September 22, 2021**. So, you may want to watch out for our coverage for the complete details when it releases.
#### DNS Over TLS Support
DNS Over TLS (DoT) is essential to encrypt DNS requests and prevent your ISP from spying. With Fedora 35, any configured DNS server should automatically attempt to connect using DoT if the DNS supports it.
#### Default Btrfs Filesystem for Fedora Cloud
While Fedora has already switched to the Btrfs filesystem since [Fedora 33][6], they enforce that change for the Cloud edition.
#### Linux Kernel 5.14
[Linux Kernel 5.14][7] wasnt a big release, but it added many features, especially when it comes to ARM devices.
For Fedora 35, the improved hardware support should make a difference.
#### Flathub Applications Included with Third-Party Repositories
You also get some selected Flatpak applications added from a filtered Flathub remote when you enable third-party repositories.
This should come in handy for better third-party app support in Fedora.
#### PulseAudio Daemon Replaced by PipeWire
While we saw initial implementations of replacing PulseAudio in Fedora 34, this time, there is a proposal to replace the PulseAudio daemon with a compatible implementation based on PipeWire.
### Other Improvements
Along with the key highlights mentioned above, you should find several under-the-hood changes and package updates that could translate as significant upgrades.
For instance, the Firewalld package update and the GNU Toolchain update should prove to be valuable upgrades.
You can explore more about the proposed changes in their [official changeset wiki][8].
### Wrapping Up
It should be exciting to see the changes in the final release. For now, let us keep an eye out to test the public beta release. And, if you do not want to experiment on your system with a beta release, you should wait for the stable release.
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/fedora-35-release-date-features/
作者:[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://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[2]: https://news.itsfoss.com/fedora-34-release/
[3]: https://news.itsfoss.com/gnome-40-release/
[4]: https://news.itsfoss.com/apps-for-gnome-portal/
[5]: https://news.itsfoss.com/gnome-41-beta/
[6]: https://itsfoss.com/fedora-33/
[7]: https://news.itsfoss.com/kernel-5-14-release/
[8]: https://fedoraproject.org/wiki/Releases/35/ChangeSet

View File

@ -1,115 +0,0 @@
[#]: subject: "Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements"
[#]: via: "https://news.itsfoss.com/kali-linux-2021-3-release/"
[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements
======
Kali Linux is one of the [best Linux distributions for penetration testing][1]. It is based on Debian, but it may not be a suitable replacement for your full-fledged desktop operating system.
The latest 2021.3 release brings some significant feature additions and improvements onboard. Let us check them out.
### Whats New?
![][2]
#### OpenSSL Compatibility
[OpenSSL][3] has been **reconfigured to expand the services networked to Kali**. As a result, legacy protocols such as TLS 1.0 and TLS 1.1 and older ciphers are allowed by default. That is to say; it will grant Kali the capability of connecting to more out-of-date servers. However, you can alter this option if you do not need it.
#### Virtualization Improvements
Kali is known to work flawlessly as a virtual machine. Firstly, actions like drag and drop, copy and paste between host and guest systems are smoother than ever, whether your guest machine is running under VirtualBox, VMware, Hyper-V, or QEMU+Spice.
Secondly, it is easier to configure Kali for Hyper-V Enhanced Session Mode, a virtualization hypervisor, using Kali-Tweaks.
In short, Kali Linux 2021.3 has made the experience even more seamless when setting up a virtual environment.
#### Kali Tools
It is taken for granted that every release of Kali contains new tools. Likewise, this release is no exception. The tools that Kali added to its fleet are:
* [Berate_ap][4]  Orchestrating MANA rogue Wi-Fi Access Points
* [CALDERA][5]  Scalable automated adversary emulation platform
* [EAPHammer][6]  Targeted evil twin attacks against WPA2-Enterprise Wi-Fi networks
* [HostHunter][7]  Recon tool for discovering hostnames using OSINT techniques
* [RouterKeygenPC][8]  Generate default WPA/WEP Wi-Fi keys
* [Subjack][9]  Subdomain takeover
* [WPA_Sycophant][10]  Evil client portion of EAP relay attack
##### Kali ARM Updates and Kali-Tools
With Kali 2021.3, ARM devices are getting more ameliorations. The ones I found eye-catching are: 
* en_US.UTF-8 is the default locale on all images.
* The Kali ARM build scripts are rebuilt to better support some devices.
* Raspberry Pi images can now use a wpa_supplicant.conf file on the /boot partition.
Moreover, Kali has refreshed its information domain **Kali-Tools**, to provide a concise overview of tools, a neat and clean interface, and a fast system.
### Other Changes
![Kali Linux 2021.3][11]
Kali has seen other neat improvements as well that includes:
* Improvement to its layout for its Xfce and Gnome editions. Kali did not forget about KDE, as it is one of its favorite desktop environments. For instance, KDE 5.21 is the new version available baked in.
* Some of the important pages in their documentation site has received major updates.
* Partnered with Ampere to have its ARM package building machines running on Amperes hardware. As a consequence, Kali benefited from a burst in speed.
Kalis mobile penetration testing platform for Android devices has seen an enhancement. In other words, you can now install Kali NetHunter on Android 11 devices without the need for a fully working [TWRP][12] (Team Win Recovery Project). Above all, this update is promising due to its convenient installation procedure.
In addition to this release, they also announced their first NetHunter smartwatch, **TicHunter Pro**. But, it is still in its very first stages of development.
To learn more about all the technical changes with this upgrade, refer to [the official announcement][13].
### Summing Up
Overall, this is a significant release with valuable improvements and exciting new tools. Get started by downloading it from its official site.
[Download Kali Linux 2021.3][14]
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/kali-linux-2021-3-release/
作者:[Omar Maarof][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://news.itsfoss.com/author/omar/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/linux-hacking-penetration-testing/
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[3]: https://www.openssl.org/
[4]: https://pkg.kali.org/pkg/berate-ap
[5]: https://pkg.kali.org/pkg/caldera
[6]: https://pkg.kali.org/pkg/eaphammer
[7]: https://pkg.kali.org/pkg/hosthunter
[8]: https://pkg.kali.org/pkg/routerkeygenpc
[9]: https://pkg.kali.org/pkg/subjack
[10]: https://pkg.kali.org/pkg/wpa-sycophant
[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[12]: http://twrp.me/
[13]: https://www.kali.org/blog/kali-linux-2021-3-release/
[14]: https://www.kali.org/get-kali/

View File

@ -0,0 +1,86 @@
[#]: subject: "After Chromium, Ubuntu Now Converts Firefox to Snap by Default"
[#]: via: "https://news.itsfoss.com/ubuntu-firefox-snap-default/"
[#]: author: "Abhishek https://news.itsfoss.com/author/root/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
After Chromium, Ubuntu Now Converts Firefox to Snap by Default
======
One of the major and controversial [changes in the upcoming Ubuntu 21.10][1] is the conversion of Firefox from deb to snap.
Yes, you heard it right. The default Firefox will be a Snap application, not the regular DEB version.
As [spotted by OMG! Ubuntu][2], this is done as per an agreement between Mozilla and Canonical (Ubuntus parent company).
The [feature freeze exception (FFE)][3] mentions it clearly:
> Per Canonicals distribution agreement with Mozilla, were making the snap the default installation of Firefox on desktop ISOs starting with Ubuntu 21.10.
With this change, the Firefox deb package will be converted to Firefox snap package.
This means that going forward, Firefox will be available as Snap. I think this change also means that even if you use apt command to install it, youll be getting the Snap package.
### Deja vu?
If you feel that this has been done in the past, you have got the right feeling. In the past, Ubuntu converted the Chromium browser to Snap.
Today, if you use apt install chromium-browser, you still get the Snap version. There is no DEB package for Chromium in Ubuntu anymore.
When Ubuntu made this sudden change on its own, there was an uproar. The conversion of Firefox to Snap will also create controversy. But this time, Ubuntu shares the blame with Mozilla.
### Mozilla wants Snap
![][4]
Interestingly, it was [Mozilla that approached Canonical for this change][5]. Mozilla will maintain the Snap version of Firefox and the end users will get quick updates directly from the source.
After all, it takes a few days before a new Firefox release lands in Ubuntu. With the Snap move, your Firefox will be updated to the new version the same day.
### Concerns?
A few for sure. I know there are a few people completely averted to Snap, I am not one of them.
I have three major complaints with Snap packages: slow start up speed, poor system integration and high disk space.
Over the time, Snaps have improved on the disk space front. But despite all the improvements, Snap packages still take longer to start. This could be tolerable with an IDE but it may ruin the browsing experience.
This slow startup speed makes me wonder why it is called Snap because surely, it doesnt start in a snap.
Another thing that bothers me is the Snap auto-refresh. Snap apps are updated automatically. If Mozilla starts pushing updates more frequently, this [Firefox restart annoyance][6] in the middle of work will be more frequently as well.
![][7]
The change will impact you when you install or upgrade to Ubuntu 21.10. The change will eventually propagate to Ubuntu 22.04 LTS.
What do you think of this change? Yeah or neah?
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/ubuntu-firefox-snap-default/
作者:[Abhishek][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://news.itsfoss.com/author/root/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/ubuntu-21-10-release-schedule/
[2]: https://www.omgubuntu.co.uk/2021/09/ubuntu-makes-firefox-snap-default
[3]: https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1943840
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI1NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: https://discourse.ubuntu.com/t/feature-freeze-exception-seeding-the-official-firefox-snap-in-ubuntu-desktop/24210
[6]: https://news.itsfoss.com/mozilla-annoying-new-tab/
[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=

View File

@ -0,0 +1,65 @@
[#]: subject: "Linux Mints Website Has a Much Needed Minty Fresh New Look"
[#]: via: "https://news.itsfoss.com/linux-mint-new-website-design/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Linux Mints Website Has a Much Needed Minty Fresh New Look
======
Linux Mint is one of the [best Linux distributions][1] available while offering a modern user experience.
However, Linux Mints original website looked dated and potentially unattractive to new-age computer users.
Many suggested a visual makeover to reflect Linux Mints taste through a modern website design. And, only recently the developers started working on a redesign in collaboration with the community members, asking for feedback and getting insights on proposed designs.
Finally, a design was finalized and applied to [Linux M][2][i][2][nts official website][2].
The website looks clean and informative, great on desktop, and perfectly fits mobile phone browsers!
![][3]
Every new Linux user should be able to evaluate their requirements by looking at the features offered easily.
The information is well-presented to convince users why they should try out Linux Mint on their desktop system.
![][4]
The key highlights of the website would be the homepage, download page, and donation page.
Of course, you can choose to explore more about Linux Mint and how everything works through individual resources (like our articles), but the official website should be the essential starting point, which it is now.
The accent color and the theme combination feels just like what Linux Mint needed! Navigating through various web pages and the menu is a breeze. I dont think there is any unnecessary element on the website; everything fits perfectly in the first look. The page load time is faster as well.
The blog/monthly news section continues to use the same design. And, Im not certain if they intend to refresh that by applying the same design anytime soon. But, I think that should happen to ensure consistency between their web pages.
_What do you think about Linux Mints new website design? Do you like it? Do you think this would help them get more attention from new-age users?_
_You are welcome to share your thoughts in the comments down below._
### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/linux-mint-new-website-design/
作者:[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://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/best-linux-distributions/
[2]: https://linuxmint.com
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzMSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=

View File

@ -2,7 +2,7 @@
[#]: via: (https://news.itsfoss.com/linux-for-gaming-opinion/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (perfiffer)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

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

View File

@ -1,496 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (13 of the best React JavaScript frameworks)
[#]: via: (https://opensource.com/article/20/1/react-javascript-frameworks)
[#]: author: (Amit Dua https://opensource.com/users/amitdua)
13 of the best React JavaScript frameworks
======
If you're using React.js or React Native to create user interfaces, try
these frameworks.
![Javascript code close-up with neon graphic overlay][1]
React.js and React Native are popular open source platforms for developing user interfaces (UIs); both rank well for desirability and use in StackOverflow's 2019 Developer Survey. React.js was developed by Facebook in 2011 as a JavaScript library to address the need for cross-platform, dynamic, and high-performing UIs, while React Native, which Facebook released in 2015, is used for building native applications using JavaScript.
The following are 13 of the best React JavaScript frameworks; all are open source—the first 11 (like React) are licensed under the MIT license and the latter two are licensed under Apache 2.0.
### 1\. Create React App
This command-line interface from Facebook developers is a must-have for every React Native project. The reason is that the [Create React App][2] is easy to use and prevents you from having to manually set up and configure your app, thereby saving you a lot of time and effort. With just a simple command, everything will be ready for you to create a React native project easily. You can use it to build a catalog and files, and the framework also includes tools to build, test, and launch your application.
```
# Install package
$ npm install -g create-react-native-web-app
 
# Run create-react-native-web-app &lt;project-directory&gt;
$ create-react-native-web-app myApp
 
# cd into your &lt;project-directory&gt;
$ cd myApp
 
# Run Web/Ios/Android development
# Web
$ npm run web
 
# IOS (simulator)
$ npm run ios
 
# Android (connected device)
$ npm run android
```
#### Why opt for Create React App
1. Top-notch tool developed with a configure bundle, transpiler, and test runner
2. No configuration and no extra files at the app structure
3. Fixed Development stack
4. Effective Fast developing tool
### 2\. Material Kit React
Inspired by Google's Material Design system, [Material Kit React][3] can be an excellent choice for building React UI components. The best thing about this library is that it offers a lot of components that are built to fit together and look incredible. There are over 1,000 fully coded components, and each one comes with separate layers organized in folders. This means you have thousands of options to choose from. There are several example pages as well, in case you want to get inspiration or share an idea or concept with someone.
#### Installing the Material Kit
```
`  $ npm install @material-ui/core`
```
#### Implementation
```
import React from 'react';
import Button from '@material-ui/core/Button';
const App = () =&gt; (
  &lt;Button variant="contained" color="primary"&gt;
    Hello World
  &lt;/Button&gt;
);
```
The Material-UI component work without any additional setup, and do not pollute the global scope.
#### Advantage
The React component supports easier and faster web development. With it, you can build your own design system, or start with Material Design.
### 3\. Shards React
This modern React UI kit has been built from scratch to achieve fast performance. It has a modern design system that lets you customize things the way you want. You can even download the source files to customize things at the code level. Also, the SCSS syntax used for styling enhances the development experience.
[Shards React][4] is based on Shards and uses React Datepicker, React Popper (a positioning engine), and noUISlider. It also supports incredible Material Design icons. There are some pre-made versions to help you gain some inspiration and get started.
#### Installation Shards with Yarn or NPM
```
# Yarn
yarn add shards-react
# NPM
npm i shards-react
```
#### Advantages
1. Shards is lightweight having a small footprint and weighting ~13kb minified and gzipped
2. Shards is responsive by default being able to adapt and reflow its layout to any screen size
3. Shards is well documented so you can start building beautiful interfaces as soon as possible
### 4\. Styled Components
This efficient CSS tool helps build small, reusable components that are responsible for an app's visual interface. With traditional CSS, you can accidentally overwrite the selectors used in other places on the website, but [Styled Components][5] can help you completely avoid this problem by using a CSS syntax directly inside your components.
#### Installation
```
`npm install --save styled-components`
```
#### Implementation
```
const Button = styled.button`
  background: background_type;
  border-radius: radius_value;
  border: abc;
  color: name_of_color;
  Margin: margin_value;
  padding: value;
```
#### Advantage
1. Make components more readable
2. Components rely on JavaScript for their style
3. Build custom components with CSS
4. Inline styling
5. Convert component even the custom component to a styled component by simply invoking styled()
### 5\. Redux
[Redux][6] is a state-management solution for JavaScript applications. While it is mostly used for React.js, you can also use it for other React-like frameworks.
#### Installation
```
sudo npm install redux
sudo npm install react-redux
```
#### Implementation
```
import { createStore } from "redux";
import rotateReducer from "reducers/rotateReducer";
function configureStore(state = { rotating: value}) {
  return createStore(rotateReducer,state);
}
export default configureStore;
```
#### Advantage
1. Predictable state update helps in defining the data flow of the application
2. Logic easier to test and time-travel debugging with reducer functions
3. Centralizing the state
### 6\. React Virtualized
This React Native JavaScript framework helps in large-list and tabular-data rendering. Using [React Virtualized][7], you can restrict the number of requests and Document Object Model (DOM) elements, thus enhancing the performance of React apps.
#### Installation
```
`npm install react-virtualized`
```
#### Implementation
```
import 'react-virtualized/styles.css'
import { Column, Table } from 'react-virtualized'
import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer'
import List from 'react-virtualized/dist/commonjs/List'
{
  alias: {
    'react-virtualized/List': 'react-virtualized/dist/es/List',
  },
  ...rest
}
```
#### Advantages
1. Display a large amount of data efficiently
2. Rendering a huge data set
3. Implements virtual rendering with a set of components
### 7\. React DnD
[ReactDnD][8] is responsible for the creation of complex drag-and-drop interfaces. There are dozens of drag-and-drop libraries, but React DnD stands out because it is built on top of modern HTML5's drag-and-drop API, making the process of creating interfaces easy.
#### Installation
```
`npm install react-dnd-preview`
```
#### Implementation
```
 import Preview from 'react-dnd-preview';
 
  const generatePreview = ({itemType, item, style}) =&gt; {
    return &lt;div class="item-list" style={style}&gt;{itemType}&lt;/div&gt;;
  };
 
  class App extends React.Component {
    ...
 
    render() {
      return (
        &lt;DndProvider backend={MyBackend}&gt;
          &lt;ItemList /&gt;
          &lt;Preview generator={generatePreview} /&gt;
          // or
          &lt;Preview&gt;{generatePreview}&lt;/Preview&gt;
        &lt;/DndProvider&gt;
      );
    }
  }
```
#### Advantages
1. Beautiful and natural movement of items bouquet
2. Powerful keyboard and screen reader support wheelchair
3. Extremely performant
4. Clean and powerful api
5. Plays extremely well with standard browser interactions
6. Unopinionated styling
7. No creation of additional wrapper dom nodes
### 8\. React Bootstrap
This UI Kit library replaces Bootstrap's JavaScript with React, giving you more control over the functions of each component. Because each component is built to be easily accessible, [React Bootstrap][9] can be beneficial for frontend framework building. There are thousands of bootstrap themes to choose from.
#### Installation
```
`npm install react-bootstrap bootstrap`
```
#### Implementation
```
import 'bootstrap/dist/css/bootstrap.min.css';
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(&lt;App /&gt;, document.getElementById('root'));
registerServiceWorker();
```
#### Advantages
1. Can easily import required code/component
2. Saves typing and bugs by compressing the Bootstrap
3. Reduces typing efforts and conflicts by compressing the Bootstrap
4. It is easy to use
5. It encapsulates in elements
### 9\. React Suite
[React Suite][10] is another efficient React.js framework that contains a wide range of component libraries for enterprise system products. It supports all major browsers and platforms, making it suitable for just about any system. It also supports server-side rendering.
#### Installation
```
`npm i rsuite --save`
```
#### Implementation
```
import { Button } from 'rsuite';
import 'rsuite/styles/less/index.less';
ReactDOM.render(&lt;Button&gt;Button&lt;/Button&gt;, mountNode);
```
#### Advantages
1. Easily manage the application easily by the help of global accessing features
2. Redux library centralizes the state management
3. Redux is flexible with all the UI layers and has a large ecosystem
4. Redux reduces this complexity and provides global accessibility
### 10\. PrimeReact
The best thing about [PrimeReact][11] is that it provides components that cover almost all of a UI's basic requirements, such as input options, menus, data presentations, messages, etc. The framework also pays close attention to the mobile experience, thus helping you design touch-optimized elements.
#### Installation
```
npm install primereact --save
npm install primeicons --save
```
#### Implementation
```
import {Dialog} from 'primereact/dialog';
import {Accordion,AccordionTab} from 'primereact/accordion';
dependencies: {
    "react": "^16.0.0",
    "react-dom": "^16.0.0",
    "react-transition-group": "^2.2.1",
    "classnames": "^2.2.5",
    "primeicons": "^2.0.0"
}
```
#### Advantages
1. Simplicity and Performance
2. Ease of Use
3. Spring Applications
4. Create rich user interfaces
5. Usability and simplicity
### 11\. React Router
[React Router][12] is quite popular in the React Native developer community because it is very easy to start working with. All you need is Git and the npm package manager installed on your PC, a basic knowledge of React, and a willingness to learn. There is nothing too complicated.
#### Installation
```
`$ npm install --save react-router`
```
#### Implementation
```
import { Router, Route, Switch } from "react-router";
 
// using CommonJS modules
var Router = require("react-router").Router;
var Route = require("react-router").Route;
var Switch = require("react-router").Switch;
```
#### Advantages
1. Dynamic route matching
2. CSS transitions on views when navigating
3. Standardized app structure and behavior
### 12\. Grommet
[Grommet][13] is used for creating responsive and accessible mobile-first web apps. The best thing about this Apache 2.0-licensed JavaScript framework is that it offers accessibility, modularity, responsiveness, and theming in one small package. Perhaps this is one of the major reasons it is widely used by companies like Netflix, GE, Uber, and Boeing.
#### Installation for yarn and npm
```
` $ npm install grommet styled-components --save`
```
#### Implementation
```
"grommet-controls/chartjs": {
          "transform": "grommet-controls/es6/chartjs/${member}",
          "preventFullImport": true,
          "skipDefaultConversion": true
```
#### Advantages
1. Create one toolkit as a packaged deal
2. Take the open-door policy to the extreme
3. Restructuring can help influence an established org
### 13\. Onsen UI
[Onsen UI][14] is another mobile app development framework that uses HTML5 and JavaScript and offers integration with Angular, Vue, and React. It is licensed under Apache 2.0.
Onsen offers tabs, a side menu, stack navigation, and other components. The best thing about the framework is that all of its components have iOS and Android Material Design support along with automatic styling, which changes the app's appearance depending on the platform.
#### Installation
```
`npm install onsenui`
```
#### Implementation
```
(function() {
    'use strict';
    var module = angular.module('app', ['onsen']);
    module.controller('AppController', function($scope) {
      // more to come here
    });
})();
```
#### Advantages
1. Onsen UI is built on free and open-source code
2. Doesn't force any type of DRM on apps developed with it
3. Compiles JavaScript and HTML5 code
4. Offers end users the native experience
* * *
What are your favorite React JavaScript frameworks? Please share them in the comments.
Learn more about React Native, a framework for building native apps using React and JavaScript.
Whether you are new to JavaScript or an experienced JavaScript developer, using libraries and...
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/react-javascript-frameworks
作者:[Amit Dua][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/amitdua
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_javascript.jpg?itok=60evKmGl (Javascript code close-up with neon graphic overlay)
[2]: https://github.com/facebook/create-react-app
[3]: https://github.com/creativetimofficial/material-kit-react
[4]: https://github.com/DesignRevision/shards-react
[5]: https://github.com/styled-components/styled-components
[6]: https://github.com/reduxjs/redux
[7]: https://github.com/bvaughn/react-virtualized
[8]: https://github.com/react-dnd/react-dnd/
[9]: https://github.com/react-bootstrap/react-bootstrap
[10]: https://github.com/rsuite/rsuite
[11]: https://github.com/primefaces/primereact
[12]: https://github.com/ReactTraining/react-router
[13]: https://github.com/grommet/grommet
[14]: https://github.com/OnsenUI/OnsenUI

View File

@ -1,101 +0,0 @@
[#]: subject: (Windows 11 System Requirement is Turning Heads. Time to migrate to Linux?)
[#]: via: (https://www.debugpoint.com/2021/06/windows-11-system-requirement/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Windows 11 System Requirement is Turning Heads. Time to migrate to Linux?
======
Microsoft announced Windows 11 at the official online event. Heres in
this post we brief the Windows 11 system requirement and give you
thinking points on whether you should permanently migrate to Linux.
There are many debates and discussions going around after the announcement of Windows 11 from Microsoft. Many are “blown away” by the look and feel of the customization option that it brings, little they know that it might be “[inspired][1]” by other operating systems.
![Windows 11 Desktop][2]
Heres a quick recap of visible features
* New Start Menu, Taskbar, and Search Bar
* New Animations are added while moving and dragging the windows. Even Opening a new window, closing, and minimize tap have different animation than earlier versions of Windows.
* Featured add to perform multitask with windows like split-screen, creating groups of various task windows, etc.
* Touch controls are improved significantly.
* New sounds are added in this version. After the release of Windows 10 in 2015, no significant changes were made in the sounds. But in Windows 11, you will see various new sound options.
* You will have access to dark mode also.
* Rounded Corners: Pointy corners will not be available in Windows 11. Corners of various bars will be made round.
* New icons are added which will make it more attractive than the earlier versions.
* Various new Widgets are added in this version.
* You can run Android apps via Windows 11 store
### Windows 11 System Requirement
* Processor 1 gigahertz (GHz)orfaster with 2 or more cores on acompatible 64-bit processor or System on a Chip (SoC)
* Memory 4 GB RAM
* Storage 64 GB or larger storage device
* System firmware UEFI, Secure Boot capable
* TPM Trusted Platform Module (TPM) version 2.0
* Graphics card DirectX 12 compatible graphics / WDDM 2.x
Display &gt;9” with HD Resolution (720p)
* Internet connection Microsoft account and internet connectivity required for setup for Windows 11 Home
Looking at the specification, you might have noticed a couple of interesting items. Windows 11 recommends your system should have TPM a.k.a Trusted Platform Module (TPM) version 2.0. Trusted Platform Module (TPM) technology is designed to provide hardware-based, security-related functions. A TPM chip is a secure crypto-processor that is designed to carry out cryptographic operations. The chip includes multiple physical security mechanisms to make it tamper-resistant, and malicious software is unable to tamper with the security functions of the TPM.
And this is why Microsoft boasts about Windows 11 being more secure.
Not all the hardware that is available today has a TPM chip. And worse is, many may force to buy new hardware as well. As a thumb rule, if you have bought any Laptop, Desktop 2017 onwards, you should be fine.
[][1]
SEE ALSO:   Windows 11 Look Inspired by KDE Plasma and GNOME?
### Internet Required for set up?
From an end-user perspective, this is not a good idea at all. This forces everyone to create a Microsoft account for the initial setup. Think about millions of users who probably buy Laptops for basic usage, and now they required to create an account, with OneDrive and other online “BS”. And you end up consuming more data, give away your data, and so on.
This move is completely unnecessary from the Microsoft side. Internet connectivity should be optional and not mandatory for setting up your computer which you bought with a price.
### Should you be moving to Linux?
Yes, of course. Linux can run super-fast in all newer and older hardware. There are plenty of versions of the Linux operating system with a nice-looking desktop out there that you can easily install and use. You do not need to shell out additional money just to experience fancy Windows 11.
Linux has many variants which cater to different people with a variety of tastes. You do not need to settle for only one look and feel and functionality. You have the freedom to choose.
You do not need to buy expensive Antivirus which is recommended for Windows operating system. Linux doesnt get a virus that easily as it is designed in a different way, and not that popular. So, you are protected on that front and save more money.
Linux updates are much faster due to stability and the small size of updates. Hence you save money on your data plan as well.
And, you save thousands of hours by not looking at this:
![The Never ending wait which becomes part of your life][3]
### Closing Notes
Benchmarking a certain set of hardware as “old” is completely subjective in terms of software. You can easily run Debian, or Lubuntu in ten-year-old or more hardware for basic tasks. If someone tells you that your hardware is old, doesnt make it so. Windows 11 may compel some users to think about their personal hardware strategy in the longer term. It is a market leader in the Desktop operating system and it is a business model for them and OEMs. Fair enough. But if you are a Windows user and reading this, I would recommend you to start experimenting with simple and friendly Linux distributions such as [Linux Mint][4], right now. So that you have options to choose from and have control over your spending in the longer run.
Cheers.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/06/windows-11-system-requirement/
作者:[Arindam][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.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/2021/06/windows-11-inspiration-linux-kde-plasma/
[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Windows-11-Desktop-1024x575.jpg
[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/The-Never-ending-wait-which-becomes-part-of-your-life.jpg
[4]: https://www.debugpoint.com/2021/02/cinnamon-arch-linux-install/

View File

@ -1,166 +0,0 @@
[#]: subject: (Ubuntu 21.10 Impish Indri New Features and Release Date)
[#]: via: (https://www.debugpoint.com/2021/07/ubuntu-21-10/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Ubuntu 21.10 Impish Indri New Features and Release Date
======
Final release of 2021, Ubuntu 21.10 Impish Indri development is in
progress. In this post, we sum up the new features known so far and
planned release dates.
This post includes information about ongoing development. The information may change frequently, and this page is regularly updated until the final release.
This page contains the following topics
* [Ubuntu 21.10 Code name history][1]
* [New Features in desktop flavor][2]
* [Ubuntu Official flavor information][3]
* [Release schedule][4]
* [Daily-build .ISO download][5]
* [Canary build .ISO download][6]
Before we list out the features, you should remember that, we are at a very early stage of the development considering October as of publishing this. And the final pieces may change as we move closer to the final release.
Historically, October releases are somewhat quieter but impactful. They create the base for next LTS in every alternate year. So having said that, this is an important release due to many factors.
### The Code Name
Following the trend, Ubuntu 21.10 is code named “impish indri” as we are at “I” based names. The “Indri” refers to _“babakoto, is one of the largest living lemurs, with a head-and-body length of about 6472 cm and a weight of between 6 to 9.5 kg. It has a black and white coat and maintains an upright posture when climbing or clinging” (from Wikipedia)_. Well, the final mascot is yet to be revealed.
So, all the packages and repo is tagged with “impish” for this version of Ubuntu.
Lets take a look at other new features.
### Ubuntu 21.10 New Features
![Ubuntu 21.10 Desktop \(daily build\)][7]
* Ubuntu 21.10 would feature **Linux Kernel 5.14**. This is currently in development and will be released before the feature freeze.
* If you are wondering of about GNOME, well yes, Ubuntu 21.10 features [GNOME 40 desktop][8] but with a twist. The **GNOME 40** version brings some fundamental changes to GNOME desktop, which you are already aware of by now. But with the usual left fixed dock! So, the customized GNOME 40 with left fixed doc, eliminates the bottom dock of vanilla GNOME 40.
* So, initially it would feel a bit strange with have **left fixed dock** with horizontal workspaces, overview and scrolling. But it would be interesting to observe user reactions and feedback once it releases.
* Version wise, this release would feature **GNOME 40.3** (its due by July 2021).
* A brand **new Desktop Installer** which would replace the decade old Ubiquity. This is created in collaboration with Google in Flutter and gives a nice and easy way of installing Ubuntu. We covered more about this installer in detail when it was launched. You can read the coverage [here][9].
![New Installer Ubuntu 21.10][10]
* The new installer is still in Canary build and not arrived in daily build as of publishing this. And when I tested, it has many bugs which are simple ones. I hope they would be sorted out before final release.
* The default theme would be set to **Yaru Light**. As per the Ubuntu team, it is difficult to maintain a mixed theme with both and dark and light together.
* In the prior Ubuntu 21.04, the Wayland display server is made default. In this release, **NVIDIA** driver users also would be able to Wayland, hopefully.
* With the **wallpaper** competition is back, we expect a stunning default wallpaper with “Indri” mascot. Already there are beautiful wallpapers submitted by the community, and they look promising.
* The applications and packages sees their respective version upgrades in this release. Heres a quick summary.
1. Firefox 89
2. LibreOffice 7.1 (I am still hopeful whether [LibreOffice 7.2][11] is an option)
3. Thunderbird 78.12
### Official Flavors
The official Ubuntu desktop flavors would have their respective version upgrades. Heres a quick update.
* Xubuntu with Xfce 4.16
* Ubuntu MATE with MATE 1.24
* Kubuntu with KDE Plasma 5.22 (I dont think Plasma 5.23 would be ready before BETA)
### Ubuntu 21.10 Release Date
Ubuntu 21.10 releases on October 14, 2021. Here is the schedule of this release.
* **Feature Freeze**: August 19, 2021
* **Beta Release**: September 23, 2021
* **Final Releas**e: October 14, 2021
### Daily Build Downloads for Ubuntu 21.10
Default desktop image .ISO for daily build is available in below link. The following images are unstable so, do not use this as your serious work. Try for testing only.
[download ubuntu 21.10 daily build GNOME][12]
#### Other flavors
Ubuntu Flavor | Link for Daily build .iso image (64 bit)
---|---
Ubuntu 21.10 Desktop (GNOME) | <https://cdimage.ubuntu.com/daily-live/current/>
Xubuntu 21.10 | <https://cdimage.ubuntu.com/xubuntu/daily-live/current/>
Ubuntu MATE 21.10 | <https://cdimage.ubuntu.com/ubuntu-mate/daily-live/current/>
Ubuntu Kylin 21.10 | <https://cdimage.ubuntu.com/ubuntukylin/daily-live/current/>
Lubuntu 21.10 | <https://cdimage.ubuntu.com/lubuntu/daily-live/current/>
Kubuntu 21.10 | <https://cdimage.ubuntu.com/kubuntu/daily-live/current/>
Ubuntu Budgie 21.10 | <https://cdimage.ubuntu.com/ubuntu-budgie/daily-live/current/>
### Untested Canary build
The daily canary build can be downloaded from the below link. This is super unstable and did not pass automatic testing. So, unless absolutely necessary, do not use this .iso.
<http://cdimage.ubuntu.com/daily-canary/pending/>
### Closing Notes
I am specifically interested on the new desktop installer. Because it gives a repair option and a brand-new way of installing Ubuntu. We know there are many powerful installers out there like Calamares but it would be interesting to see Ubuntus new Flutter based app. And the adaptation of GNOME 40 is really a thing to observe with more users.
I will keep this post updated with the latest info when available with details.
* _[Official change log and schedule][13]_
* _[Launchpad source][14]_
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/ubuntu-21-10/
作者:[Arindam][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.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: tmp.Bd5zVlb4BJ#code-name
[2]: tmp.Bd5zVlb4BJ#new-features
[3]: tmp.Bd5zVlb4BJ#official-flavors
[4]: tmp.Bd5zVlb4BJ#release-schedule
[5]: tmp.Bd5zVlb4BJ#daily-build-download
[6]: tmp.Bd5zVlb4BJ#canary-build-download
[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Ubuntu-21.10-Desktop-daily-build-1024x535.jpeg
[8]: https://www.debugpoint.com/2021/03/gnome-40-release/
[9]: https://www.debugpoint.com/2021/02/new-ubuntu-desktop-installer/
[10]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/New-Installer-Ubuntu-21.10.jpeg
[11]: https://www.debugpoint.com/2021/05/libreoffice-7-2/
[12]: https://cdimage.ubuntu.com/daily-live/current/
[13]: https://discourse.ubuntu.com/t/impish-indri-release-schedule/18540
[14]: https://launchpad.net/ubuntu/impish

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/21/8/memory-programming-c"
[#]: author: "Marty Kalin https://opensource.com/users/mkalindepauledu"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: translator: "unigeorge"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
@ -688,7 +688,7 @@ via: https://opensource.com/article/21/8/memory-programming-c
作者:[Marty Kalin][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[unigeorge](https://github.com/unigeorge)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,143 +0,0 @@
[#]: subject: "Linux Jargon Buster: What is sudo rm -rf? Why is it Dangerous?"
[#]: via: "https://itsfoss.com/sudo-rm-rf/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Linux Jargon Buster: What is sudo rm -rf? Why is it Dangerous?
======
When you are new to Linux, youll often come across advice to never run `sudo rm -rf /`. There are so many memes in the Linux world around `sudo rm -rf`.
![][1]
But it seems that there are some confusions around it. In the tutorial on [cleaning Ubuntu to make free space][2], I advised running some command that involved sudo and rm -rf. An Its FOSS reader asked me why I am advising that if sudo rm -rf is a dangerous Linux command that should not be run.
And thus I thought of writing this chapter of Linux jargon buster and clear the misconceptions.
### sudo rm -rf: what does it do?
Lets learn things in steps.
The rm command is used for [removing files and directories in Linux command line][3].
```
[email protected]:$ rm agatha
[email protected]:$
```
But some files will not be removed immediate because of read only [file permissions][4]. They have to be forced delete with the option `-f`.
```
[email protected]:$ rm books
rm: remove write-protected regular file 'books'? y
[email protected]:$ rm -f christie
[email protected]:$
```
However, rm command cannot be used to delete directories (folders) directly. You have to use the recursive option `-r` with the rm command.
```
[email protected]:$ rm new_dir
rm: cannot remove 'new_dir': Is a directory
```
And thus ultimately, rm -rf command means recursively force delete the given directory.
```
[email protected]:~$ rm -r new_dir
rm: remove write-protected regular file 'new_dir/books'? ^C
[email protected]:$ rm -rf new_dir
[email protected]:$
```
Heres a screenshot of all the above commands:
![Example explaining rm command][5]
If you add sudo to the rm -rf command, you are deleting files with root power. That means you could delete system files owned by [root user][6].
### So, sudo rm -rf is a dangerous Linux command?
Well, any command that deletes something could be dangerous if you are not sure of what you are deleting.
Consider **rm -rf command** as a knife. Is knife a dangerous thing? Possibly. If you cut vegetables with the knife, its good. If you cut your fingers with the knife, it is bad, of course.
The same goes for rm -rf command. It is not dangerous in itself. It is used for deleting files after all. But if you use it to delete important files unknowingly, then it is a problem.
Now coming to sudo rm -rf /.
You know that with sudo, you run a command as root, which allows you to make any changes to the system.
/ is the symbol for the root directory. /var means the var directory under root. /var/log/apt means apt directory under log, under root.
![Linux directory hierarchy representation][7]
As per [Linux directory hierarchy][8], everything in a Linux file system starts at root. If you delete root, you are basically removing all the files of your system.
And this is why it is advised to not run `sudo rm -rf /` command because youll wipe out your entire Linux system.
Please note that in some cases, you could be running a command like sudo rm -rf /var/log/apt which could be fine. Again, you have to pay attention on what you are deleting, the same as you have to pay attention on what you are cutting with a knife.
### I play with danger: what if I run sudo rm -rf / to see what happens?
Most Linux distributions provide a failsafe protection against accidentally deleting the root directory.
```
[email protected]:~$ sudo rm -rf /
[sudo] password for abhishek:
rm: it is dangerous to operate recursively on '/'
rm: use --no-preserve-root to override this failsafe
```
I mean it is human to make typos and if you accidentally typed “/ var/log/apt” instead of “/var/log/apt” (a space between / and var meaning that you are providing / and var directories to for deletion), youll be deleting the root directory.
![Pay attention when using sudo rm -rf][9]
Thats quite good. Your Linux system takes care of such accidents.
Now, what if you are hell-bent on destroying your system with sudo rm -rf /? Youll have to use It will ask you to use no-preserve-root with it.
No, please do not do that on your own. Let me show it to you.
So, I have elementary OS running in a virtual machine. I run `sudo rm -rf / --no-preserve-root` and you can see the lights going out literally in the video below (around 1 minute).
[Subscribe to our YouTube channel for more Linux videos][10]
### Clear or still confused?
Linux has an active community where most people try to help new users. Most people because there are some evil trolls lurking to mess with the new users. They will often suggest running rm -rf / for the simplest of the problems faced by beginners. These idiots get some sort of supremacist satisfaction I think for such evil acts. I ban them immediately from the forums and groups I administer.
I hope this article made things clearer for you. Its possible that you still have some confusion, specially because it involves root, file permissions and other things new users might not be familiar with. If thats the case, please let me know your doubts in the comment section and Ill try to clear them.
In the end, remember. Dont drink and root. Stay safe while running your Linux system :)
![][11]
--------------------------------------------------------------------------------
via: https://itsfoss.com/sudo-rm-rf/
作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2016/04/sudo-rm-rf.gif?resize=400%2C225&ssl=1
[2]: https://itsfoss.com/free-up-space-ubuntu-linux/
[3]: https://linuxhandbook.com/remove-files-directories/
[4]: https://linuxhandbook.com/linux-file-permissions/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/rm-rf-command-example-800x487.png?resize=800%2C487&ssl=1
[6]: https://itsfoss.com/root-user-ubuntu/
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/linux-directory-structure.png?resize=800%2C400&ssl=1
[8]: https://linuxhandbook.com/linux-directory-structure/
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/sudo-rm-rf-example.png?resize=798%2C346&ssl=1
[10]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/dont-drink-and-root.jpg?resize=800%2C450&ssl=1

View File

@ -1,88 +0,0 @@
[#]: subject: "Apps for daily needs part 5: video editors"
[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/"
[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Apps for daily needs part 5: video editors
======
![][1]
Photo by [Brooke Cagle][2] on [Unsplash][3]
Video editing has become a popular activity. People need video editors for various reasons, such as work, education, or just a hobby. There are also now many platforms for sharing video on the internet. Almost all social media and chat messengers provide features for sharing videos. This article will introduce some of the open source video editors that you can use on Fedora Linux. You may need to install the software mentioned. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4]. Here is a list of a few apps for daily needs in the video editors category.
### Kdenlive
When anyone asks about an open source video editor on Linux, the answer that often comes up is Kdenlive. It is a very popular video editor among open source users. This is because its features are complete for general purposes and are easy to use by someone who is not a professional.
Kdenlive supports multi-track, so you can combine audio, video, images, and text from multiple sources. This application also supports various video and audio formats without having to convert them first. In addition, Kdenlive provides a wide variety of effects and transitions to support your creativity in producing cool videos. Some of the features that Kdenlive provides are titler for creating 2D titles, audio and video scopes, proxy editing, timeline preview, keyframeable effects, and many more.
![][5]
More information is available at this link: <https://kdenlive.org/en/>
* * *
### Shotcut
Shotcut has more or less the same features as Kdenlive. This application is a general purposes video editor. It has a fairly simple interface, but with complete features to meet the various needs of your video editing work.
Shotcut has a complete set of features for a video editor, ranging from simple editing to high-level capabilities. It also supports various video, audio, and image formats. You dont need to worry about your work history, because this application has unlimited undo and redo. Shotcut also provides a variety of video and audio effects features, so you have freedom to be creative in producing your video works. Some of the features offered are audio filters, audio mixing, cross fade audio and video dissolve transition, tone generator, speed change, video compositing, 3 way color wheels, track compositing/blending mode, video filters, etc.
![][6]
More information is available at this link: <https://shotcut.org/>
* * *
### Pitivi
Pitivi will be the right choice if you want a video editor that has an intuitive and clean user interface. You will feel comfortable with how it looks and will have no trouble finding the features you need. This application is classified as very easy to learn, especially if you need an application for simple editing needs. However, Pitivi still offers a variety of features, like trimming &amp; cutting, sound mixing, keyframeable audio effects, audio waveforms, volume keyframe curves, video transitions, etc.
![][7]
More information is available at this link: <https://www.pitivi.org/>
* * *
### Cinelerra
Cinelerra is a video editor that has been in development for a long time. There are tons of features for your video work such as built-in frame render, various video effects, unlimited layers, 8K support, multi camera support, video audio sync, render farm, motion graphics, live preview, etc. This application is maybe not suitable for those who are just learning. I think it will take you a while to get used to the interface, especially if you are already familiar with other popular video editor applications. But Cinelerra will still be an interesting choice as your video editor.
![][8]
More information is available at this link: <http://cinelerra.org/>[][9]
* * *
### Conclusion
This article presented four video editor apps for your daily needs that are available on Fedora Linux. Actually there are many other video editors that you can use in Fedora Linux. You can also use Olive (Fedora Linux repo), OpenShot (rpmfusion-free) , Flowblade (rpmfusion-free) and many more. Each video editor has its own advantages. Some are better at correcting color, while others are better at a variety of transitions and effects. Some are better when it comes to how easy it is to add text. Choose the application that suits your needs. Hopefully this article can help you to choose the right video editors. If you have experience in using these applications, please share your experience in the comments.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/
作者:[Arman Arisman][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/armanwu/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/FedoraMagz-Apps-5-video-816x345.jpg
[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/
[5]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-kdenlive-1024x576.png
[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-shotcut-1024x576.png
[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-pitivi-1024x576.png
[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-cinelerra-1024x576.png
[9]: https://www.olivevideoeditor.org/

View File

@ -1,378 +0,0 @@
[#]: subject: "Build a data sharding service with DistSQL"
[#]: via: "https://opensource.com/article/21/9/distsql"
[#]: author: "Meng Haoran https://opensource.com/users/haoran-meng"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Build a data sharding service with DistSQL
======
Database sharding demonstrates the additional functionality of DistSQL.
![Person standing in front of a giant computer screen with numbers, data][1]
If you're reading this, then you're probably familiar with the data query and programming language, SQL (Structured Query Language). It's also used as the standard language for management systems for accessing data, querying, updating, and managing relational database systems. Like standard SQL, DistSQL, or Distributed SQL, it is a built-in SQL language unique to ShardingSphere that provides incremental functional capabilities beyond standard SQL. Leveraging ShardingSphere's powerful SQL parsing engine, DistSQL provides a syntax structure and syntax validation system like that of standard SQL, making DistSQL more flexible while maintaining regularity. ShardingSphere's Database Plus concept aims at creating an open source distributed database system that is both functional and relevant to the actual database business. DistSQL is built on top of the traditional database to provide SQL capabilities that are both standards-compliant and feature ShardingSphere's functionality to enhance conventional database management.
### Original design intention of DistSQL
Over its years of rapid development, ShardingSphere has become unique in the database middleware space as the kernel has gradually stabilized, and the core functionality has continuously been honed. As an open source leader in Asia, ShardingSphere keeps pursuing its exploration of a distributed database ecosystem. Redefining the boundary between middleware and database to allow developers to leverage Apache ShardingSphere as if they were using a database natively is DistSQL's design goal. It is also an integral part of ShardingSphere's ability to transform from a developer-oriented framework and middleware to an operations-oriented infrastructure product.
### DistSQL syntax system
DistSQL has been designed from the outset to be standards-oriented, considering the habits of both database developers and operators. The syntax of DistSQL is based on the standard SQL language, maintaining readability and ease of use while retaining the maximum amount of ShardingSphere's own features and providing the highest possible number of customization options for users to cope with different business scenarios.
Developers familiar with SQL and ShardingSphere can get started quickly.
Standard SQL provides different types of syntaxes such as DQL, DDL, DML, DCL, etc., to define various functional SQL statements. DistSQL defines a syntax system of its own, as well.
In ShardingSphere, the DistSQL syntax is currently divided into three main types: RDL, RQL, and RAL.
* RDL (Resource &amp; Rule Definition Language) - Resource rule definition language for creating, modifying, and deleting resources and rules.
* RQL (Resource &amp; Rule Query Language) - Resource rule query language for querying and presenting resources and rules.
* RAL (Resource &amp; Rule Administrate Language) - Resource rule administration language for incremental functional operations such as hint, transaction type switching, and query of a sharding execution plan.
DistSQL's syntax builds a bridge for ShardingSphere to move towards a distributed database. It is still being improved as more ideas are implemented, so DistSQL will become increasingly powerful. Developers who are interested are welcome to join ShardingSphere and contribute ideas and code to DistSQL.
For more detailed syntax rules, please refer to the official [documentation][2].
For the project's community, please refer to the official [Slack channel][3].
### DistSQL in practice
Having understood the design concept and syntax system of DistSQL, let's demonstrate how to build a data sharding service based on ShardingSphere.
#### Environment preparation
* Start MySQL services
* Create a MySQL database for sharding
* Start the Zookeeper service
* Turn on the distributed governance configuration and start [ShardingSphere-Proxy][4]
#### Practical demonstration
1\. Connect to the launched ShardingSphere-Proxy using the MySQL command line.
2\. Create and query the distributed database `sharding_db`:
```
mysql&gt; CREATE DATABASE sharding_db;
Query OK, 0 ROWS affected (0.04 sec)
mysql&gt; SHOW DATABASES;
+-------------+
| SCHEMA_NAME |
+-------------+
| sharding_db |
+-------------+
1 ROW IN SET (0.04 sec)
```
3\. Use the newly created database:
```
mysql&gt; USE sharding_db;
No connection. Trying TO reconnect...
Connection id: 2
CURRENT DATABASE: *** NONE ***
DATABASE changed
```
4\. Execute RDL to configure two data source resources, `ds_1` and `ds_2`, for sharding:
```
mysql&gt; ADD RESOURCE ds_1 (
    -&gt; HOST=127.0.0.1,
    -&gt; PORT=3306,
    -&gt; DB=ds_1,
    -&gt; USER=root,
    -&gt; PASSWORD=root123456
    -&gt; );
Query OK, 0 ROWS affected (0.53 sec)
mysql&gt;
mysql&gt; ADD RESOURCE ds_2 (
    -&gt; HOST=127.0.0.1,
    -&gt; PORT=3306,
    -&gt; DB=ds_2,
    -&gt; USER=root,
    -&gt; PASSWORD=root123456
    -&gt; );
Query OK, 0 ROWS affected (0.02 sec)
```
5\. Execute RQL to query the newly added data source resources:
```
    mysql&gt; SHOW RESOURCES FROM sharding_db;
    +------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | name | TYPE  | host      | port | db   | attribute                                                                                                                                                   |
    +------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | ds_1 | MySQL | 127.0.0.1 | 3306 | ds_1 | {"maxLifetimeMilliseconds":1800000,"readOnly":FALSE,"minPoolSize":1,"idleTimeoutMilliseconds":60000,"maxPoolSize":50,"connectionTimeoutMilliseconds":30000} |
    | ds_2 | MySQL | 127.0.0.1 | 3306 | ds_2 | {"maxLifetimeMilliseconds":1800000,"readOnly":FALSE,"minPoolSize":1,"idleTimeoutMilliseconds":60000,"maxPoolSize":50,"connectionTimeoutMilliseconds":30000} |
    +------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
    2 ROWS IN SET (0.13 sec)
```
6\. Execute RDL to create a sharding rule for the `t_order` table:
```
mysql&gt; CREATE SHARDING TABLE RULE t_order(
    -&gt; RESOURCES(ds_1,ds_2),
    -&gt; SHARDING_COLUMN=order_id,
    -&gt; TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)),
    -&gt; GENERATED_KEY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123)))
    -&gt; );
Query OK, 0 ROWS affected (0.06 sec)
```
7\. Execute RQL to query the sharding rules:
```
    mysql&gt; SHOW SHARDING TABLE RULES FROM sharding_db;
    +---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+
    | TABLE   | actualDataNodes | actualDataSources | databaseStrategyType | databaseShardingColumn | databaseShardingAlgorithmType | databaseShardingAlgorithmProps | tableStrategyType | tableShardingColumn | tableShardingAlgorithmType | tableShardingAlgorithmProps | keyGenerateColumn | keyGeneratorType | keyGeneratorProps |
    +---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+
    | t_order |                 | ds_1,ds_2         |                      |                        |                               |                                | hash_mod          | order_id            | hash_mod                   | sharding-COUNT=4            | order_id          | snowflake        | worker-id=123     |
    +---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+
    1 ROW IN SET (0.01 sec)
```
In addition to querying all sharding rules under the current database, RQL can also query individual tables for sharding rules with the following statement:
`SHOW SHARDING TABLE RULE t_order FROM sharding_db`
Creating and querying the `t_order` sharding table:
```
mysql&gt; CREATE TABLE `t_order`(
    -&gt; `order_id` INT NOT NULL,
    -&gt; `user_id` INT NOT NULL,
    -&gt; `status` VARCHAR(45) DEFAULT NULL,
    -&gt; PRIMARY KEY (`order_id`)
    -&gt; )ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Query OK, 0 ROWS affected (0.28 sec)
mysql&gt; SHOW TABLES;
+-----------------------+
| Tables_in_sharding_db |
+-----------------------+
| t_order               |
+-----------------------+
1 ROW IN SET (0.01 sec)
```
After successfully creating the sharding table `t_order` on the ShardingSphere-Proxy side, ShardingSphere automatically creates the sharding table based on the sharding rules of the `t_order` table by connecting to the underlying databases `ds_1` and `ds_2` via the client-side.
```
mysql&gt; USE ds_1;
DATABASE changed
mysql&gt; SHOW TABLES;
+----------------+
| Tables_in_ds_1 |
+----------------+
| t_order_0      |
| t_order_2      |
+----------------+
2 ROWS IN SET (0.01 sec)
[/code] [code]
mysql&gt; USE ds_2;
DATABASE changed
mysql&gt; SHOW TABLES;
+----------------+
| Tables_in_ds_2 |
+----------------+
| t_order_1      |
| t_order_3      |
+----------------+
2 ROWS IN SET (0.00 sec)
```
Once the sharding table is created, continue to execute the SQL statement on the ShardingSphere-Proxy side to insert the data:
```
mysql&gt; INSERT INTO t_order VALUES(1, 1, 'ok');
Query OK, 1 ROW affected (0.06 sec)
mysql&gt; INSERT INTO t_order VALUES(2, 2, 'disabled');
Query OK, 1 ROW affected (0.00 sec)
mysql&gt; INSERT INTO t_order VALUES(3, 3, 'locked');
Query OK, 1 ROW affected (0.01 sec)
mysql&gt; SELECT * FROM t_order;
+----------+---------+----------+
| order_id | user_id | STATUS   |
+----------+---------+----------+
|        1 |       1 | ok       |
|        2 |       2 | disabled |
|        3 |       3 | locked   |
+----------+---------+----------+
3 ROWS IN SET (0.06 sec)
```
Query the execution plan via RAL:
```
mysql&gt; preview SELECT * FROM t_order;
+-----------------+------------------------------------------------+
| datasource_name | SQL                                            |
+-----------------+------------------------------------------------+
| ds_1            | SELECT * FROM t_order_0 ORDER BY order_id ASC  |
| ds_1            | SELECT * FROM t_order_2 ORDER BY order_id ASC  |
| ds_2            | SELECT * FROM t_order_1 ORDER BY order_id ASC  |
| ds_2            | SELECT * FROM t_order_3 ORDER BY order_id ASC  |
+-----------------+------------------------------------------------+
4 ROWS IN SET (0.02 sec)
```
This completes the ShardingSphere data sharding service using DistSQL. Compared to the previous version of the ShardingSphere proxy, which was profile-driven, DistSQL is more developer-friendly and flexible in managing resources and rules. Moreover, the SQL-driven approach enables seamless interfacing between DistSQL and standard SQL.
```
schemaName: sharding_db
dataSources:
  ds_0:
    url: jdbc:mysql://127.0.0.1:3306/ds_1?serverTimezone=UTC&amp;useSSL=false
    username: root
    password: root123456
    connectionTimeoutMilliseconds: 30000
    idleTimeoutMilliseconds: 60000
    maxLifetimeMilliseconds: 1800000
    maxPoolSize: 50
    minPoolSize: 1
  ds_1:
    url: jdbc:mysql://127.0.0.1:3306/ds_2?serverTimezone=UTC&amp;useSSL=false
    username: root
    password: root123456
    connectionTimeoutMilliseconds: 30000
    idleTimeoutMilliseconds: 60000
    maxLifetimeMilliseconds: 1800000
    maxPoolSize: 50
    minPoolSize: 1
rules:
\- !SHARDING
  tables:
    t_order:
      actualDataNodes: ds_${0..1}.t_order_${0..1}
      tableStrategy:
        standard:
          shardingColumn: order_id
          shardingAlgorithmName: t_order_inline
      keyGenerateStrategy:
        column: order_id
        keyGeneratorName: snowflake
    t_order_item:
      actualDataNodes: ds_${0..1}.t_order_item_${0..1}
      tableStrategy:
        standard:
          shardingColumn: order_id
          shardingAlgorithmName: t_order_item_inline
      keyGenerateStrategy:
        column: order_item_id
        keyGeneratorName: snowflake
  bindingTables:
   - t_order,t_order_item
  defaultDatabaseStrategy:
    standard:
      shardingColumn: user_id
      shardingAlgorithmName: database_inline
  defaultTableStrategy:
    none:
  shardingAlgorithms:
    database_inline:
      type: INLINE
      props:
        algorithm-expression: ds_${user_id % 2}
    t_order_inline:
      type: INLINE
      props:
        algorithm-expression: t_order_${order_id % 2}
    t_order_item_inline:
      type: INLINE
      props:
        algorithm-expression: t_order_item_${order_id % 2}
  keyGenerators:
    snowflake:
      type: SNOWFLAKE
      props:
        worker-id: 123
[/code] [code]
1\. CREATE a distributed DATABASE
CREATE DATABASE sharding_db;
2\. ADD DATA resources
ADD RESOURCE ds_1 (
HOST=127.0.0.1,
PORT=3306,
DB=ds_1,
USER=root,
PASSWORD=root123456
);
ADD RESOURCE ds_2 (
HOST=127.0.0.1,
PORT=3306,
DB=ds_2,
USER=root,
PASSWORD=root123456
);
3\. CREATE sharding rules
CREATE SHARDING TABLE RULE t_order(
RESOURCES(ds_1,ds_2),
SHARDING_COLUMN=order_id,
TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)),
GENERATED_KEY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123)))
);
```
In the above example, only a small part of the DistSQL syntax is demonstrated. In addition to creating and querying resources and rules via `CREATE` and `SHOW` statements, DistSQL also provides additional operations such as `ALTRE DROP` and supports configuration control of data sharding's core functions, read and write separation, data encryption, and database discovery.
### Conclusion
As one of the new features released in Apache ShardingSphere's 5.0.0-beta, DistSQL will continue to build on this release to improve syntax and increasingly powerful functions. DistSQL has opened up endless possibilities for ShardingSphere to explore the distributed database space. In the future, DistSQL will be used as a link to connect more functions and provide one-click operations.
For example, it'll allow the analysis of the overall database status with one click, connect with elastic migration, provide one-click data expansion and shrinkage, and connect with control to realize one-click master-slave switch and change database status. Open source and JavaScript enthusiasts are warmly welcomed to join the Slack community or check the project's GitHub page to learn more about ShardingSphere's latest developments.
* * *
_This article is adapted from the author's [original publication][5]._
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/distsql
作者:[Meng Haoran][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/haoran-meng
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
[2]: https://shardingsphere.apache.org/document/current/en/features/dist-sql/syntax/
[3]: https://join.slack.com/t/apacheshardingsphere/shared_invite/zt-sbdde7ie-SjDqo9~I4rYcR18bq0SYTg
[4]: https://shardingsphere.apache.org/document/current/cn/quick-start/shardingsphere-proxy-quick-start/
[5]: https://shardingsphere.apache.org/blog/en/material/jul_26_an_introduction_to_distsql/

View File

@ -1,124 +0,0 @@
[#]: subject: "Watch commands and tasks with the Linux watch command"
[#]: via: "https://opensource.com/article/21/9/linux-watch-command"
[#]: author: "Moshe Zadka https://opensource.com/users/moshez"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Watch commands and tasks with the Linux watch command
======
See how the watch command can let you know when a task has been
completed or a command has been executed.
![Clock, pen, and notepad on a desk][1]
There are many times when you need to wait for something to finish, such as:
* A file download.
* Creating or extracting a [tar][2] file.
* An [Ansible][3] job.
Some of these processes have some sort of progress indication, but sometimes the process is run through a layer of abstraction, and the only way to measure the progress is through its side effects. Some of these might be:
* A file being downloaded keeps growing.
* A directory extracted from a tarball fills up with files.
* The Ansible job builds a [container][4].
You can query all of these things with commands like these:
```
$ ls -l downloaded-file
$ find . | wc -l
$ podman ps
$ docker ps
```
But running these commands over and over, even if it is with the convenience of [Bash history][5] and the **Up Arrow**, is tedious.
Another approach is to write a little Bash script to automate these commands for you:
```
while :
do
  docker ps
  sleep 2
done
```
But such scripts can also become tedious to write. You could write a little generic script and package it, so it's always available to you. Luckily, other open source developers have already been there and done that.
The result is the command `watch`.
### Installing watch
The `watch` command is part of the [`procps-ng` package][6], so if you're on Linux, you already have it installed.
On macOS, install `watch` using [MacPorts][7] or [Homebrew][8]. On Windows, use [Chocolatey][9].
### Using watch
The `watch` command periodically runs a command and shows its output. It has some text-terminal niceties, so only the latest output is on the screen.
The simplest usage is: `watch <command>`.
For example, prefixing the `docker ps` command with `watch` works like this:
```
`$ watch docker ps`
```
The `watch` command, and a few creative Unix command-line tricks, can generate ad-hoc dashboards. For example, to count audit events:
```
`$ watch 'grep audit: /var/log/kern.log |wc -l'`
```
In the last example, it is probably useful if there's a visual indication that the number of audit events changed. If change is expected, but you want something to look "different," `watch --differences` works well. It highlights any differences from the last run. This works especially well if you are grepping in multiple files, so you can easily see which one changed.
If changes are not expected, you can ask for them to be highlighted "permanently" to know which ones to investigate by using `watch --differences=permanent`. This is often more useful.
### Controlling frequency
Finally, sometimes the command might be resource-intensive and should not be run too frequently. The `-n` parameter controls the frequency. Watch uses two seconds by default, but `watch -n 10` might be appropriate for something more resource-intensive, like grepping for a pattern in any file in a subdirectory:
```
`$ watch -n 10 'find . -type f | xargs grep suspicious-pattern'`
```
### Watch a command with watch
The `watch` command is useful for many ad-hoc system administration tasks where you need to wait for some time-consuming step, without a progress bar, before moving on to the next one. Though this is not a great situation to be in, `watch` can make it slightly better—and give you time to start working on those notes for the retrospective! Download the **[cheat sheet][10] **to keep helpful syntax and options close at hand.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/linux-watch-command
作者:[Moshe Zadka][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/moshez
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 (Clock, pen, and notepad on a desk)
[2]: https://opensource.com/article/17/7/how-unzip-targz-file
[3]: https://opensource.com/resources/what-ansible
[4]: https://opensource.com/resources/what-docker
[5]: https://opensource.com/article/20/6/bash-history-control
[6]: https://opensource.com/article/21/8/linux-procps-ng
[7]: https://opensource.com/article/20/11/macports
[8]: https://opensource.com/article/20/6/homebrew-mac
[9]: https://opensource.com/article/20/3/chocolatey
[10]: https://opensource.com/downloads/watch-cheat-sheet

View File

@ -1,190 +0,0 @@
[#]: subject: "How to Install Kali Linux in VMware"
[#]: via: "https://itsfoss.com/install-kali-linux-vmware/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install Kali Linux in VMware
======
Kali Linux is the de facto standard of [Linux distributions used for learning and practicin][1][g][1] [hacking and penetration testing][1].
And, if youve been tinkering around with Linux distros long enough, you might have tried it out just out of curiosity.
However, no matter what you use it for, it is not a replacement for a regular full-fledged desktop Linux operating system. Hence, it is recommended (at least for beginners) to install Kali Linux using a virtual machine program like VMware.
With a virtual machine, you can use Kali Linux as a regular application in your Windows or Linux system. Its almost the same as running VLC or Skype in your system.
There are a few free virtualization tools available for you. You can [install Kali Linux on Oracle VirtualBox][2] or use VMWare Workstation.
This tutorial focuses on VMWare.
### Installing Kali Linux on VMware on Windows and Linux
Non-FOSS alert!
VM Ware is not open source software.
For this tutorial, I presume that you are using Windows, considering most VMware users prefer using Windows 10/11.
However, the _**tutorial is also valid for Linux except the VMWare installation on Windows part**_. You can [easily install VMWare on Ubuntu][3] and other Linux distributions.
#### Step 1: Install VMWare Workstation Player (on Windows)
If you already have VMware installed on your system, you can skip the steps to install Kali Linux.
Head to [VMWares official workstation player webpage][4] and then click on the “**Download Free**” button.
![][5]
Next, you get to choose the version (if you want something specific or encountering bugs in the latest version) and then click on “**Go to Downloads.**“
![][6]
And then you get the download buttons for both Windows and Linux versions. You will have to click on the button for Windows 64-bit because that is what we need here.
![][7]
There is no support for 32-bit systems, in case you were wondering.
Finally, when you get the .exe file downloaded, launch it to start the installation process. You need to hit “Next” to get started installing VMware.
![][8]
Next, you will have to agree to the policies and conditions to continue.
![][9]
Now, you get to choose the path of your installation. Ideally, keep it at the default settings. But, if you need better keyboard response / in-screen keyboard performance in the virtual machine, you may want to enable the “**Enhanced Keyboard Driver**.”
![][10]
Proceeding to the next step, you can choose to disable checking for updates every time you start the program (can be annoying) and disable sending data to VMware as part of its user experience improvement program.
![][11]
If you want quick access using desktop and start menu shortcuts, you can check those settings or toggle them off, which I prefer.
![][12]
Now, you have to continue to start the installation.
![][13]
This may take a while, and when completed, you get greeted with another window that lets you finish the process and gives you the option to enter a license key. If you want to get the commercial license for your use-case, you need the VMware Workstation Pro edition, or else, the player is free for personal use.
![][14]
Attention!
Please make sure that virtualization is enabled in your system. Recent Windows versions require that you enable the virtualization explicitly to use virtual machines.
#### Step 2: Install Kali Linux on VMware
To get started, you need to download the image file of Kali Linux. And, when it comes to Kali Linux, they offer a separate ISO file if you plan to use it on a virtual machine.
![][15]
Head to its [official download page][16] and download the prebuilt VMware image available.
![][17]
You can download the **.7z** file directly or utilize Torrent (which is generally faster). In either case, you can also check the file integrity with the SHA256 value provided.
Once downloaded, you need to extract the file to any path of your choice.
![][18]
Open VMware Workstation Player and then click on “**Open a Virtual Machine**.” Now, look for the folder you extracted. And navigate through it till you find a file with the “**.vmx**” extension.
For instance: **Kali-Linux-2021.3-vmware-amd64.vmx**
![][19]
Select the .vmx file to open the virtual machine. And, it should appear right in your VMware player.
You can choose to launch the virtual machine with the default settings. Or, if you want to tweak the hardware allocated to the virtual machine, feel free to change the settings before you launch it.
![][20]
Depending on your computer hardware, you should allocate more memory and at least half of your processor cores to get a smooth performance.
In this case, I have 16 Gigs of RAM and a quad-core processor. Hence, it is safe to allocate nearly 7 GB of RAM and two cores for this virtual machine.
![][21]
While you can assign more resources, but it might affect the performance of your host operating system when working on a task. So, it is recommended to keep a balance between the two.
Now, save the settings and hit “**Play virtual machine**” to start Kali Linux on VMware.
When it starts loading up, you may be prompted with some tips to improve performance by tweaking some virtual machine settings.
You do not have to do that, but if you notice performance issues, you can disable side-channel mitigations (needed for enhanced security) to uplift the performance of the VM.
Also, you may be prompted to download and [install VMware tools for Linux][22]; you need to do this to get a good VM experience.
Once you do that, you will be greeted with Kali Linuxs login screen.
![][23]
Considering that you launched a prebuilt VMware folder, you need to enter the default login and password to proceed.
**Username**: kali
**Password:** kali
![][24]
Thats it! Youre done installing Kali Linux on VMware. Now, all you have to do is start exploring!
### Where to go from here?
Here are a few tips you can utilize:
* If clipboard sharing and file sharing is not working, [install VMWare tools][22] on the guest system (Kali Linux).
* If you are new to it, check out this [list of Kali Linux tools][25].
Feel free to share your thoughts if you find this tutorial helpful. Do you prefer to install Kali Linux without using a VMware image ready to go? Let me know in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-kali-linux-vmware/
作者:[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/linux-hacking-penetration-testing/
[2]: https://itsfoss.com/install-kali-linux-virtualbox/
[3]: https://itsfoss.com/install-vmware-player-ubuntu-1310/
[4]: https://www.vmware.com/products/workstation-player.html
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download.png?resize=732%2C486&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download-1.png?resize=800%2C292&ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download-final.png?resize=800%2C212&ssl=1
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-1.png?resize=692%2C465&ssl=1
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-license.png?resize=629%2C443&ssl=1
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-2.png?resize=638%2C440&ssl=1
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-workstation-tracking.png?resize=618%2C473&ssl=1
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-workstation-shortcuts.png?resize=595%2C445&ssl=1
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-install.png?resize=620%2C474&ssl=1
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-installed.png?resize=589%2C441&ssl=1
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-image-kali.png?resize=800%2C488&ssl=1
[16]: https://www.kali.org/get-kali/
[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux-image-download.png?resize=800%2C764&ssl=1
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/extract-vmware-image.png?resize=617%2C359&ssl=1
[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux-image-folder.png?resize=800%2C498&ssl=1
[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/virtual-machine-settings-kali.png?resize=800%2C652&ssl=1
[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/kali-vm-settings.png?resize=800%2C329&ssl=1
[22]: https://itsfoss.com/install-vmware-tools-linux/
[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/kali-linux-vm-login.png?resize=800%2C540&ssl=1
[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux.png?resize=800%2C537&ssl=1
[25]: https://itsfoss.com/best-kali-linux-tools/

View File

@ -0,0 +1,82 @@
[#]: subject: "Open source game achievements"
[#]: via: "https://fedoramagazine.org/open-source-game-achievements/"
[#]: author: "Dennis Payne https://fedoramagazine.org/author/dulsi/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Open source game achievements
======
![][1]
Photo by [Michał Parzuchowski][2] on [Unsplash][3]
Learn how Gamerzilla brings an achievement system to open source games and enables all developers to implement achievements separate from the game platform.
Some open source games rival the quality of commercial games. While it is hard to match the quality of triple-a games, open source games compete effectively against the indie games. But, gamer expectations change over time. Early games included a high score. Achievements expanded over time to promote replay. For example, you may have completed a level but you didnt find all the secrets or collect all the coins. The Xbox 360 introduced the first multi-game online achievement system. Since that introduction, many game platforms added an achievement system.
Open source games are largely left out of the achievement systems. You can publish an open source game on Steam, but it costs money and they focus on working with companies not the free software community. Additionally, this locks players into a non-free platform.
Commercial game developers are not well served either, since some players enjoy achievements and refuse to purchase from other stores due to the inability to share their accomplishments. This lock-in gives the power to the platform holder. Each platform has a different system forcing the developer to implement support and testing multiple times. Smaller platform are likely to be skipped entirely. Furthermore, the platform holder has access to the achievement data on all companies using their system which could be used for competitive advantage.
### Architecture of Gamerzilla
[Gamerzilla][4] is an open source game achievement system which attempts to correct this situation. The design considered both open source and commercial games. You can run your own Gamerzilla server, use one provided by a game store, or even distributions, or other groups could run them. Where you buy the game doesnt matter. The achievement data uploads to your Gamerzilla server.
Game achievements require two things, a game, and a Gamerzilla server. As game collections grow, however, that setup has a disadvantage. Each game needs to have credentials to upload to the Gamerzilla server. Many gamers turn to game launchers due to their large number of games and ability to synchronize with one or more stores. By adding Gamerzilla support to the launcher, the individual games no longer need to know your credentials. Session results will relay from the game launcher to the Gamerzilla server.
At one time, freegamedev.net provided the Hubzilla social networking system. We created an addon allowing us to jump start Gamerzilla development. Unfortunately server upgrades broke the service so freegamedev.net stopped offering it.
For Gamerzilla servers, two implementations exist. Maintaining Hubzilla is a complex task, so we developed a standalone Gamerzilla service using *.*Net and React. The API used by games remains the same so it doesnt matter which implementation you connect to.
Game launchers development and support often lags. To facilitate adding support, we created libgamerzilla. The library handles all the interaction between the game launcher, games, and the Gamerzilla server. Right now only _GameHub_ has an implementation with Gamerzilla support and merging into the project is pending. On Fedora Linux, libgamerzilla-server package serves as a temporary solution. It does not launch games but listens for achievements and relays them to your server.
Game support continues growing. As with game launchers, developers use libgamerzilla to handle the Gamerzilla integration. The library, written in C, is in use in a variety of languages like Python and nim. Games which already have an achievement system typically take only a few days to add support. For other games ,collecting all the information to award the achievements occupies the bulk of the implementation time.
### Setting up a server
The easiest server to setup is the Hubzilla addon. That, however, requires a working Hubzilla site which is not the simplest thing to setup. The new .Net and React server can be setup relatively easily on Fedora Linux, although there are a lot of steps. The [readme][5] details all the steps. The long set of steps is, in part, due to the lack of a built release. This means you need to build the .Net and the React code. Once built, React code serves up directly in Apache. A new service runs the .Net piece. Apache proxies all requests to the Gamerzilla API for the new service.
With the setup steps done, Gamerzilla runs but there are no users. There needs to be an easy way to create an administrator and register new users. Unfortunately this piece does not exist yet. At this time, users must be entered directly using the sqlite3 command line tool. The instructions are in the [readme][5]. Users can be publicly visible or not. The approval flag allows new users to not use the system immediately but web registration still needs to be implemented The user piece is designed with replacement in mind. It would not be hard to replace backend/Service/UserService.cs to integrate with an existing site. Gaming web sites could use this to offer Gamerzilla achievements to their users.
Currently the backend uses a sqlite database. No performance testing has been done. We expect that larger installations may need to modify the system to use a more robust database system.
### Testing the system
There is no game launcher easily available at the moment. If you install libgamerzilla-server, you will have the command _gamerzillaserver_ available from the command line. The first time you run it, you enter your url and login information. Subsequent executions will simply read the information from the configuration file. There is currently no way to correct a mistake except deleting the file at _.local/share/ga_merzillaserver/server.cfg and running _gamerzillaserver_ again.
Most games have no built releases with Gamerzilla support. [Pinball Disc Room on itch.io][6] does have support built in the Linux version. The web version has no achievements There are only two achievements in the game, one for surviving for ten seconds and the other for unlocking and using the tunnel. With a little practice you can get an achievement. You need to check your Gamerzila server as the game provides no visual notification of the achievement.
Currently no game packaged in Fedora Linux supports Gamerzilla. SuperTuxKart merged support but is still awaiting a new release. Seahorse adventures and Shippy 1984 added achievements but new releases are not packaged yet. Some games with support, we maintain independently as the developers ignore pull requests or other attempt to contact them.
### Future work
Gamerzilla needs more games. A variety of games currently support the system. An addition occurs nearly every month. If you have a game you like, ask the developer to support Gamerzilla. If you are making a game and need help adding support, please let us now.
Server development proceeds at a slow pace and we hope to have a functional registration system soon. After that we may setup a permanent hosting site. Right now you can see our [test server][7]. Some people expressed concern with the .Net backend. The API is not very complex and could be rewritten in Python fairly easily.
The largest unknown remains game launchers. GameHub wants a generic achievement interface. We could try to work with them to get that implemented. Adding support to the itch.io app could increase interest in the system. Another possibility is to do away with the game launcher entirely. Perhaps adding something like the gamerzillaserver to Gnome might be possible. You would then configure your url and login information on a settings page. Any game launched could then record achievements.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/open-source-game-achievements/
作者:[Dennis Payne][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/dulsi/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2021/09/game_acheivements-816x345.jpg
[2]: https://unsplash.com/@mparzuchowski?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[3]: https://unsplash.com/s/photos/jenga?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: http://identicalsoftware.com/gamerzilla/
[5]: https://github.com/dulsi/gamerzilla.net#readme
[6]: https://dulsi.itch.io/pinball-disc-room
[7]: http://108.49.106.217/

View File

@ -0,0 +1,114 @@
[#]: subject: "Organize your Magic: The Gathering decks with Magic Assistant"
[#]: via: "https://opensource.com/article/21/9/magic-the-gathering-assistant"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Organize your Magic: The Gathering decks with Magic Assistant
======
The open source application Magic Assistant makes managing your Magic
collection easy.
![Holding a Magic the Gathering deckmaster card][1]
The world's first trading card game was _Magic: The Gathering,_ first published in 1993.
It remains popular today because of its great flexibility. With more than 25,000 unique cards published over nearly three decades, there are enough cards for players to build hundreds of different decks for surprisingly unique gameplay experiences.
Along with this flexibility, however, there comes a cost: many _Magic: The Gathering_ players collect lots of cards so they can construct lots of different decks, which in turn lets them focus on different win conditions and try out different strategies.
It can be quite a job to keep track of 1,000 cards when you only need 60 to 100 for a deck, but the open source application Magic Assistant makes managing your _Magic_ collection easy.
### Installing Magic Assistant
[Magic Assistant][2] is a Java application, so it's cross-platform. Regardless of whether you're on the open source operating system [Linux,][3] macOS, or Windows, you can download Magic Assistant, double-click on its launcher icon, and use it to manage your cards.
After the application first launches, there are sure to be updates to the card database available. Multiple new _Magic_ sets are released each year, so accept the offer to update and go grab a cup of coffee while new cards are added.
### Importing cards
To catalog your cards with Magic Assistant, either you can rummage through the card database manually to add cards to your local collection, or you can import an existing list. The simplest format for a list of _Magic_ cards is a text file containing the number of copies you own and the name of a card on a line by itself:
```
2x Mimic 1x Mordenkainen's Polymorph 2x Ray of Frost 4x Sol Ring
```
However, the application supports many formats, including a CSV from _Magic: The Gathering Online,_ TCGPlayer table, MTG Studio, Apprentice, DeckBox, and more.
To import your cards, select the Import option from the File menu.
![Sample entry field for importing cards into a deck or collection][4]
Importing cards (Seth Kenlon, [CC BY-SA 4.0][5])
Importing cards adds them to the default collection database (called **main**). This database represents the entirety of your collection. You can then use cards from your collection to build decks and cubes. There's no limit on how many collections you can have, so you can organize your cards in whatever way you prefer.
### Browsing your collection
A collection is organized by its metadata by default. That means you can browse your collection by any number of attributes, including mana cost, card type, color, keyword abilities, and format legality. All of these options are available as tabs at the bottom of the collection interface.
![A view of sorting tabs with several card categories][6]
Interface tabs (Seth Kenlon, [CC BY-SA 4.0][5])
### Building a deck or cube
One way to get better at _Magic: The Gathering_—and get a better feel for how you like to experience the game—is to build decks. On the one hand, it's great to hold physical cards, but, on the other hand, it can be a lot of work to sort through hundreds of cards kept in several different boxes or binders. With Magic Assistant, it's easy to sort through your cards based on whatever attribute you need, so building decks with it is a pleasure.
To build a new deck (Magic Assistant has no concept of a cube, but functionally a cube is arguably no different than a deck), right-click on the Deck category in the Card Navigator panel, then select New to create a new deck.
There are two kinds of decks you can build. You can build a virtual deck, which is purely theorycrafting, with no implication that the deck exists physically. When you create a virtual deck, you can take a card you own only one actual copy of and use it in several decks. You could not build the decks in real life, obviously, because you would be overusing some number of cards, but as a deck idea or recipe, it works well.
Alternately, you can build a "real" deck, which affects your collection the same way a physical deck does. If you put three copies of Sol Ring into a deck, then your collection shows that you have three fewer copies of Sol Ring available.
Choose what kind of deck you're building, and give your deck a name for your own reference in the New window.
![Sample entry field for creating a new deck, with name and parent container][7]
Deckbuilding tool (Seth Kenlon, [CC BY-SA 4.0][5])
To add cards to your a deck, locate the card in your collection, right-click on it, and select Move to or Copy to, followed by the deck you want it to appear in. A virtual deck never lets you move cards to it. Instead, it prompts you to copy the card, because a virtual card never removes a card from your collection.
![Using Copy to to add a card to a specific deck][8]
Adding a card to a deck (Seth Kenlon, [CC BY-SA 4.0][5])
When you have multiple copies of a card and copy that card into a deck, Magic Assistant adds all copies. To decrease or increase the number of copies of a card in a deck, right-click on the card in your deck and choose Decrease count or Increase count.
### Deck reports
After you've built a deck, you can view reports detailing the statistics for the cards you've assembled. You can get charts to view card types, creature types, mana curve, color distribution, and more.
![A pie chart showing the different types of cards, and a chart with greater detail][9]
Charts and graphs (Seth Kenlon, [CC BY-SA 4.0][5])
### Open source tools for everything
There's an open source application for nearly everything, so it's no surprise that there's a robust card collection manager like Magic Assistant to help _Magic: The Gathering_ players. If you play the original trading card game, try this one out. It can help you keep track of which cards you have available for building decks. And just as important, it may encourage you to build more decks more often, because it's so easy to do when all the cards are at your fingertips.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/magic-the-gathering-assistant
作者:[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/wayne-low-unsplash.jpg?itok=eqvfc71L (Holding a Magic the Gathering deckmaster card)
[2]: https://sourceforge.net/projects/mtgbrowser/
[3]: https://opensource.com/resources/linux
[4]: https://opensource.com/sites/default/files/mtgassistant-import.jpeg (Importing cards into a deck or collection)
[5]: https://creativecommons.org/licenses/by-sa/4.0/
[6]: https://opensource.com/sites/default/files/mtgassistant-tab.jpeg (Interface tabs)
[7]: https://opensource.com/sites/default/files/mtgassistant-deck_0.jpeg (Deckbuilding tool)
[8]: https://opensource.com/sites/default/files/mtgassistant-add_0.jpeg (Using Copy to to add a card to a specific deck)
[9]: https://opensource.com/sites/default/files/mtgassistant-chart.jpeg (Charts and graphs)

View File

@ -0,0 +1,129 @@
[#]: subject: "Start using YAML now"
[#]: via: "https://opensource.com/article/21/9/intro-yaml"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Start using YAML now
======
What is YAML, and why is it about time we started using it?
![woman on laptop sitting at the window][1]
YAML (YAML Ain't Markup Language) is a human-readable data serialization language. Its syntax is simple and human-readable. It does not contain quotation marks, opening and closing tags, or braces. It does not contain anything which might make it harder for humans to parse nesting rules. You can scan your YAML document and immediately know what's going on.
### YAML features
YAML has some super features which make it superior to other serialization formats:
* Easy to skim.
* Easy to use.
* Portable between programming languages.
* Native data structures of Agile languages.
* Consistent model to support generic tools.
* Supports one-pass processing.
* Expressive and extensible.
I will show you YAML's power further with some examples.
Can you figure out what's going on below?
```
\-------
# My grocery list
groceries:
    - Milk
     - Eggs
     - Bread
     - Butter
...
```
The above example contains a simple list of groceries to buy, and it's a fully-formed YAML document. In YAML, strings aren't quoted, and lists need simple hyphens and spaces. A YAML document starts with **\---** and ends with **...**, but they are optional. Comments in YAML begin with a **#**.
Indentation is key in YAML. Indentation must contain spaces, not tabs. And while the number of spaces required is flexible, it's a good idea to keep them consistent.
### Basic Elements
#### Collections
YAML has two types of collections: _Lists_ (for sequences) and _dictionaries_ (for mappings). Lists are key-value pairs where every value is on a new line, beginning with a hyphen and space. Dictionaries are key-value pairs where every value is a mapping containing a key, a colon and space, and a value.
For example:
```
# My List
groceries:
    - Milk
     - Eggs
     - Bread
     - Butter
# My dictionary
contact:
 name: Ayush Sharma
 email: [myemail@example.com][2]
```
Lists and dictionaries are often combined to provide more complex data structures. Lists can contain dictionaries, and dictionaries can contain lists.
#### Strings
Strings in YAML don't need quotation marks. Multi-line strings are defined using **|** or **&gt;**. The former preserves newlines, but the latter does not.
For example:
```
my_string: |
    This is my string.
     It can contain many lines.
     Newlines are preserved.
my_string_2: &gt;
    This is my string.
     This can also contain many lines.
     Newlines aren't preserved and all lines are folded.
```
#### Anchors
YAML can have repeatable blocks of data using node anchors. The **&amp;** character defines a block of data that is later referenced using *****. For example:
```
billing_address: &amp;add1
 house: B1
 street: My Street
shipping_address: *add1
```
At this point, you know enough YAML to get started. You can play around with the online YAML parser to test yourself. If you work with YAML daily, then [this handy cheatsheet][3] will be helpful.
* * *
_This article was originally published on the [author's personal blog][4] and has been adapted with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/intro-yaml
作者:[Ayush Sharma][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/ayushsharma
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop)
[2]: mailto:myemail@example.com
[3]: https://yaml.org/refcard.html
[4]: https://notes.ayushsharma.in/2021/08/introduction-to-yaml

View File

@ -0,0 +1,235 @@
[#]: subject: "How to Install Ubuntu Desktop on Raspberry Pi 4"
[#]: via: "https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/"
[#]: author: "Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install Ubuntu Desktop on Raspberry Pi 4
======
_**Brief: This thorough tutorial shows you how to install Ubuntu Desktop on Raspberry Pi 4 device.**_
The revolutionary Raspberry Pi is the most popular single board computer. It has its very own Debian based operating system called [Raspbian][1].
There are several other [operating systems available for Raspberry Pi][2] but almost all of them are lightweight. This was appropriate for the small factor and low end hardware of the Pi devices.
This changes with the introduction of Raspberry Pi 4B that flaunts 8 GB RAM and supports 4K display. The aim is to use Raspberry Pi as a regular desktop and it succeeds in doing so to a larger extent.
Before the 4B model, you could [install the Ubuntu server on Raspberry Pi][3] but the desktop version was not available. However, **Ubuntu now provides official desktop image for Pi 4 models**.
In this tutorial, I am going to show the steps for installing Ubuntu desktop on Raspberry Pi 4.
First, a quick look at the prerequisites.
### Prerequisites for running Ubuntu on Raspberry Pi 4
![][4]
Heres what you need:
1. A Linux or Windows system with active internet connection.
2. [Raspberry Pi Imager][5] : The official open source tool from Raspberry that gets you the distro image on your SD card.
3. Micro SD Card: Consider using at least a 16 GB storage for your card, albeit a 32 GB version is recommended.
4. A USB based Micro SD Card Reader (if your computer does not have a card reader).
5. Essential Raspberry Pi 4 accessories such as an HDMI compatible display, [Micro HDMI to Standard HDMI (A/M) Cable][6], [Power Supply (Official Adapter Recommended)][7], USB Wired/Wireless Keyboard and Mouse/Touchpad.
It is good practice to [read in detail about the Pi requirements][8] beforehand.
Now, without further delay, let me quickly walk you through the image preparation for the SD Card.
### Preparing the Ubuntu Desktop image for Raspberry Pi
Raspberry Pi provides a GUI application for writing the ISO image to the SD Card. **This tool can also download compatible operating systems like Ubuntu, Raspbian etc automatically**.
![Official tool to download and put operating system on SD card][9]
You can download this tool for Ubuntu, Windows and macOS from the official website:
[Download Raspberry Pi Imager][10]
On Ubuntu and other Linux distributions, you can also install it with Snap:
```
sudo snap install rpi-imager
```
Once installed, run the imager tool. When you see the screen below, select “CHOOSE OS”:
![Pi imager: choose the preferred operating system][11]
Under “Operating System”, select “Other general purpose OS”:
![Pi imager: other general purpose operating systems][12]
Now, select “Ubuntu”:
![Pi imager distro: Ubuntu][13]
Next, select “Ubuntu Desktop 21.04 (RPI 4/400)” as shown below:
![Pi imager distro version: Ubuntu 21.04][14]
Note
If you do not have a good, consistent internet collection, you can [download the Ubuntu for Raspberry Pi image separately from Ubuntus website][15]. In the Imager tool, while choosing the OS, go to the bottom and select “Use custom” option. You can also use Etcher for writing the image to the SD card.
Insert the micro SD card inside your Card reader and wait for it to mount. Select “CHOOSE STORAGE” under “Storage”:
![Pi imager choose storage \(SD card\)][16]
You should be seeing only your micro SD card storage and youd recognize it instantly based on the size. Here, Ive used a 32 GB card:
![Pi imager choose SD card][17]
Now click on “WRITE”:
![Pi imager image write][18]
Ill assume you have the contents of the SD card backed up. If its a new card, you can just proceed:
![Pi imager image write confirmation query][19]
Since this is a [sudo][20] privilege, you must enter your password. If you run `sudo rpi-imager` from a terminal, this would not appear:
![Pi imager image write authentication asking for password][21]
If your SD card is a bit old, it would take some time. But if it is a recent one with high speeds, it wouldnt take long:
![Pi imager writing image][22]
I also wouldnt recommend skipping verification. Make sure the image write went successful:
![Pi imager verifying changes][23]
Once it is over, you will get the following confirmation:
![Pi imager write successful][24]
Now, safely-remove the SD card from your system.
### Using the micro SD card with Ubuntu on Raspberry Pi
Half of the battle is won. Unlike the regular Ubuntu install, you have not created a live environment. Ubuntu is already installed on the SD card and is almost read to use. Lets see what remains here.
#### Step 1: Insert the SD card into Pi
For first time users, it can take a bit confusing sometimes to figure out where on earth is that card slot! Not to worry. It is located below the board on the left-hand side. Heres an inverted view with a card inserted:
![Pi 4B board inverted and micro SD card inserted][25]
Keep sliding the card in this orientation slowly into the slot below the board, gently until it no longer goes any further. You may also hear a little clicking sound for confirmation. This means it has just fit in perfectly:
![Raspberry Pi SD slot left side middle and below the pi board][26]
You might notice two little pins adjusting themselves in the slot (shown above) as you put it inside, but thats ok. Once inserted, the card would look like a bit protruded. Thats how it is supposed to look like:
![Pi SD card inserted with a little portion visible][27]
#### Step 2: Setting Up the Raspberry Pi
I do not need to go in detail here, I presume.
Ensure that the power cable connector, micro HDMI cable connector, keyboard and mouse connectors (wired/non-wired) are securely connected to the Pi board in the relevant ports.
Make sure the display and power plug are properly connected as well, before you go ahead and turn on the power socket. I wouldnt recommend plugging in the adapter to a live electrical socket. Look up [electrical arcing][28].
Once youve ensured the above two steps, you can [power on the Raspberry Pi device][29].
#### Step 3: The first run of Ubuntu desktop on Raspberry Pi
Once you power on the Raspberry Pi, youll be asked to some basic configuration on your first run. You just have to follow the onscreen instructions.
Select your language, keyboard layout, connect to WiFi etc.
![Select language][30]
![Select keyboard layout][31]
![Select WiFi][32]
Youll be asked to select the time zone:
![Select time zone][33]
And then create the user and password:
![Enter desired username and password][34]
It will configure a couple of things and may take some time in doing so.
![Finishing Ubuntu setup][35]
![Finishing Ubuntu setup][36]
It may take some time after this, your system will reboot and youll find yourself at the Ubuntu login screen:
![][37]
You can start enjoying Ubuntu desktop on Raspberry Pi now.
![Ubuntu desktop on Raspberry Pi][38]
### Conclusion
I noticed **a temporary anomaly**: A red flickering border on the left-hand side of my display while doing the installation. This flickering (also of different colors) was noticeable on random parts of the screen as well. But it went away after restarting and the first boot.
It was much needed that Ubuntu to start providing support for popular ARM devices like Raspberry Pi and I am happy to see it running on a Raspberry Pi.
I hope you find this tutorial helpful. If you have questions or suggestions, please let me know in the comments.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/
作者:[Avimanyu Bandyopadhyay][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/avimanyu/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/
[2]: https://itsfoss.com/raspberry-pi-os/
[3]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-desktop-raspberry-pi.png?resize=800%2C450&ssl=1
[5]: https://github.com/raspberrypi/rpi-imager
[6]: https://www.raspberrypi.org/products/micro-hdmi-to-standard-hdmi-a-cable/
[7]: https://www.raspberrypi.org/products/type-c-power-supply/
[8]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-imager-tool.webp?resize=680%2C448&ssl=1
[10]: https://www.raspberrypi.org/software/
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-os.webp?resize=681%2C443&ssl=1
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-other-general-purpose-os.webp?resize=679%2C440&ssl=1
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-os-ubuntu.webp?resize=677%2C440&ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-os-ubuntu-21-04.webp?resize=677%2C440&ssl=1
[15]: https://ubuntu.com/download/raspberry-pi
[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-storage.webp?resize=677%2C438&ssl=1
[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-sd-card.webp?resize=790%2C450&ssl=1
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write.webp?resize=676%2C437&ssl=1
[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write-confirm.webp?resize=679%2C440&ssl=1
[20]: https://itsfoss.com/add-sudo-user-ubuntu/
[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write-password.webp?resize=380%2C227&ssl=1
[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-writing-image.webp?resize=673%2C438&ssl=1
[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-verifying-changes.webp?resize=677%2C440&ssl=1
[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-write-successful.webp?resize=675%2C442&ssl=1
[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-inverted-micro-sd-card-inserted.webp?resize=800%2C572&ssl=1
[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-sd-slot-left-side-middle-below-board.webp?resize=632%2C324&ssl=1
[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-sd-card-inserted.webp?resize=650%2C432&ssl=1
[28]: https://www.electricianatlanta.net/what-is-electrical-arcing-and-why-is-it-dangerous/
[29]: https://itsfoss.com/turn-on-raspberry-pi/
[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run.webp?resize=800%2C451&ssl=1
[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-2.webp?resize=800%2C600&ssl=1
[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-3.webp?resize=800%2C600&ssl=1
[33]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-4.webp?resize=800%2C600&ssl=1
[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-5.webp?resize=800%2C600&ssl=1
[35]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-6.webp?resize=800%2C600&ssl=1
[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-7.webp?resize=800%2C600&ssl=1
[37]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-login-screen.webp?resize=800%2C600&ssl=1
[38]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-21-04-post-setup-desktop.webp?resize=800%2C450&ssl=1

View File

@ -0,0 +1,142 @@
[#]: subject: "Use Vagrant to test your scripts on different operating systems"
[#]: via: "https://opensource.com/article/21/9/test-vagrant"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Use Vagrant to test your scripts on different operating systems
======
Vagrant helps you run other operating systems on your computer—meaning
you can build things, test things, and do wacky stuff without blowing up
your own system.
![Business woman on laptop sitting in front of window][1]
I've been happy using Vagrant for quite a while now. I work with several DevOps tools, and installing them all on one system can get complicated. Vagrant lets you do cool things without breaking your system because you don't have to experiment on your production system at all.
If you're familiar with [VirtualBox][2] or [GNOME Boxes][3], then learning Vagrant is easy. Vagrant is a simple and clean interface for working with virtual machines. A single config file, called `Vagrantfile`, allows you to customize your virtual machines (called _Vagrant boxes_). A simple command-line interface lets you start, stop, suspend, or destroy your boxes.
Consider this simple example.
Let's say you want to write Ansible or shell scripts to install Nginx on a new server. You can't do it on your own system because you might not be running the operating system you want to test, or you may not have all of the dependencies for what you want to do. Launching new cloud servers for testing can be time-consuming and expensive. This is where Vagrant comes in. You can use it to bring up a virtual machine, provision it using your scripts, and prove that everything works as expected. You can then delete the box, re-provision it, and re-run your scripts to verify it. You can repeat this process as many times as you want until you're confident your scripts work under all conditions. And you can commit your Vagrantfile to Git to ensure your team is testing the exact same environment (because they'll be using the exact same test box). No more "…but it works fine on my machine!"
### Getting started
First, [install Vagrant on your system][4] and then create a new folder to experiment in. In this new folder, create a new file named `Vagrantfile` with these contents:
```
Vagrant.configure("2") do |config|
 
  config.vm.box = "ubuntu/hirsute64"
 
end
```
You can also run `vagrant init ubuntu/hirsute64`, and it will generate a new Vagrantfile for you. Now run `vagrant up`. This command will download the `ubuntu/hirsuite64` image from the Vagrant registry.
```
Bringing machine 'default' up with 'virtualbox' provider...
==&gt; default: Importing base box 'ubuntu/hirsute64'...
==&gt; default: Matching MAC address for NAT networking...
==&gt; default: Checking if box 'ubuntu/hirsute64' version '20210820.0.0' is up to date...
==&gt; default: Setting the name of the VM: a_default_1630204214778_76885
==&gt; default: Clearing any previously set network interfaces...
==&gt; default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==&gt; default: Forwarding ports...
    default: 22 (guest) =&gt; 2222 (host) (adapter 1)
==&gt; default: Running 'pre-boot' VM customizations...
==&gt; default: Booting VM...
==&gt; default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==&gt; default: Machine booted and ready!
```
At this point, if you open your Vagrant backend (such as VirtualBox or virt-manager), you'll see your box there. Next, run `vagrant ssh` to log in to the box. If you can see the Vagrant prompt, then youre in!
```
~ vagrant ssh
Welcome to Ubuntu 21.04 (GNU/Linux 5.11.0-31-generic x86_64)
 * Documentation:  <https://help.ubuntu.com>
 * Management:     <https://landscape.canonical.com>
 * Support:        <https://ubuntu.com/advantage>
  System information as of Sun Aug 29 02:33:51 UTC 2021
  System load:  0.01              Processes:               110
  Usage of /:   4.1% of 38.71GB   Users logged in:         0
  Memory usage: 17%               IPv4 address for enp0s3: 10.0.2.15
  Swap usage:   0%                IPv4 address for enp0s8: 192.168.1.20
0 updates can be applied immediately.
vagrant@ubuntu-hirsute:~$
```
Vagrant uses "base boxes" to bring up your local machines. In our case, Vagrant downloads the `ubuntu/hirsuite64` image from [Hashicorps Vagrant catalogue][5] and plugs into VirtualBox to create the actual box.
### Shared folders
Vagrant maps your current folder as `/vagrant` within the Vagrant box. This allows you to keep your files in sync on your system and within the box. This is great for testing a Nginx website by pointing your document root to `/vagrant`. You can use an IDE to make changes and Nginx within the box will serve them.
### Vagrant commands
There are several Vagrant commands which you can use to control your box.
Some of the important ones are:
* `vagrant up`: Bring a box online.
* `vagrant status`: Show current box status.
* `vagrant suspend`: Pause the current box.
* `vagrant resume`: Resume the current box.
* `vagrant halt`: Shutdown the current box.
* `vagrant destroy`: Destroy the current box. By running this command, you will lose any data stored on the box.
* `vagrant snapshot`: Take a snapshot of the current box.
### Try Vagrant
Vagrant is a time-tested tool for virtual machine management using DevOps principles. Configure your test machines, share the configs with your team, and test your projects in a predictable and reproducible environment. If you're developing software, then you'll do your users a great service by using Vagrant for testing. If you're not developing software but you love to try out new versions of an OS, then there's no easier way. Try Vagrant today!
* * *
_This article was originally published on the [author's personal blog][6] and has been adapted with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/test-vagrant
作者:[Ayush Sharma][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/ayushsharma
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating)
[2]: https://opensource.com/article/21/6/try-linux-virtualbox
[3]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization
[4]: https://www.vagrantup.com/docs/installation
[5]: https://app.vagrantup.com/boxes/search
[6]: https://notes.ayushsharma.in/2021/08/introduction-to-vagrant

View File

@ -0,0 +1,183 @@
[#]: subject: "Use this Linux command-line tool to learn more about your NVMe drives"
[#]: via: "https://opensource.com/article/21/9/nvme-cli"
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Use this Linux command-line tool to learn more about your NVMe drives
======
The nvme-cli command has lots of useful options, and it's a great way to
take control of how you manage your data.
![Command line prompt][1]
NVMe stands for _Non-Volatile Memory Express_, and it refers to how software and storage communicate across PCIe and other protocols, including TCP. It's an [open specification][2] led by a non-profit organization and defines several forms of solid-state storage.
My laptop has an NVMe drive, as does my desktop. And they're fast. I love how quickly my computers boot and how quickly they're able to read and write data. There's no perceptible delay.
It also didn't take long for me to get curious about the technology driving this ultra-fast storage, so I did a little investigation. I learned that NVMe drives consume less power while delivering much faster access to data compared to even SSD drives over SATA. That was interesting, but I wanted to know more about my particular NVMe drives, and I wanted to know how they compared with other drives. Could I securely erase the drive? How could I check its integrity?
Those questions led me to an Internet search that yielded an open source project with a collection of tools to manage NVMe drives. It's called [nvme-cli][3].
### Install nvme-cli
You can install `nvme-cli` from your distribution's package manager. For instance, on Fedora, CentOS, or similar:
```
`$ sudo dnf install nvme-cli`
```
On Debian, Mint, Elementary, and similar:
```
`$ sudo apt install nvme-cli`
```
### Exploring an NVMe drive
After installing `nvme-cli` for my distribution, I wanted to explore my drive. There's no man page for `nvme-cli`, but you can get lots of help by entering `nvme help`:
```
$ nvme help
nvme-1.14
usage: nvme &lt;command&gt; [&lt;device&gt;] [&lt;args&gt;]
The '&lt;device&gt;' may be either an NVMe character device (ex: /dev/nvme0) or an
nvme block device (ex: /dev/nvme0n1).
The following are all implemented sub-commands:
 list List all NVMe devices and namespaces on machine
 list-subsys List nvme subsystems
 id-ctrl Send NVMe Identify Controller
 id-ns Send NVMe Identify Namespace, display structure
 id-ns-granularity Send NVMe Identify Namespace Granularity List, display structure
 list-ns Send NVMe Identify List, display structure
 list-ctrl Send NVMe Identify Controller List, display structure
 nvm-id-ctrl Send NVMe Identify Controller NVM Command Set, display structure
 primary-ctrl-caps Send NVMe Identify Primary Controller Capabilities
[...]
```
### List all NVMe drives
The `sudo nvme list` command lists all NVMe devices and namespaces on your machine. I used it and found an NVMe drive at `/dev/nvme0n1`. Here is the output:
```
$ sudo nvme list
Node SN Model Namespace Usage Format FW Rev
\--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1    S42GMY9M141281 SAMSUNG MZVLB256HAHQ-000L7 1
214.68 GB / 256.06 GB 512  B + 0 B 0L2QEXD7
```
I have a drive called `nvme0n1`. It lists the serial number, brand, size, firmware revision, and so on.
You can get even more information about the drive and the features it supports by using the `id-ctrl` subcommand:
```
$ sudo nvme id-ctrl /dev/nvme0n1
NVME Identify Controller:
vid : 0x144d
ssvid : 0x144d
sn : S42GMY9M141281
mn : SAMSUNG MZVLB256HAHQ-000L7
fr : 0L2QEXD7
rab : 2
ieee : 002538
cmic : 0
mdts : 9
cntlid : 0x4
ver : 0x10200
rtd3r : 0x186a0
rtd3e : 0x7a1200
[...]
```
### Drive health
You can read about the overall health of a drive with the `smart-log` subcommand:
```
$ sudo nvme smart-log /dev/nvme0n1
Smart Log for NVME device:nvme0n1 namespace-id:ffffffff
critical_warning : 0
temperature : 21 C
available_spare : 100%
available_spare_threshold : 10%
percentage_used : 2%
endurance group critical warning summary: 0
data_units_read : 5,749,452
data_units_written : 10,602,948
host_read_commands : 77,809,121
host_write_commands : 153,405,213
controller_busy_time : 756
power_cycles : 1,719
power_on_hours : 1,311
unsafe_shutdowns : 129
media_errors : 0
num_err_log_entries : 1,243
Warning Temperature Time : 0
Critical Composite Temperature Time : 0
Temperature Sensor 1 : 21 C
Temperature Sensor 2 : 22 C
Thermal Management T1 Trans Count : 0
Thermal Management T2 Trans Count : 0
Thermal Management T1 Total Time : 0
Thermal Management T2 Total Time : 0
```
This provides you with the drive's current temperature, the hours of use it's had so far, how many times it was unsafely shut down, and so on.
### Formatting an NVMe drive
You can format an NVMe drive with `nvme-cli`, but beware: This erases all of the data on the drive! If there's important data on your drive, you _must_ back it up before doing this, or else you **will** lose data. The subcommand is `format`:
```
`$ sudo nvme format /dev/nvme0nX`
```
(For safety, I've replaced the actual location of the drive with **X** to prevent copy-paste mishaps. Change the **X** to **1** or the appropriate location as listed in the results of `nvme list`.)
### Securely erasing an NVMe drive
When you get ready to sell or dispose of your NVMe computer, you probably want to erase the drive securely. The same warnings apply here as with the format process: Back up important data first because this command erases it!
```
`$ sudo nvme sanitize /dev/nvme0nX`
```
### Try nvme-cli
The `nvme-cli` command is released under a [GPLv2][4] license. It's a robust command with lots of useful options, and it's a great way to take control of how you manage your data.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/nvme-cli
作者:[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/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt)
[2]: https://nvmexpress.org/
[3]: https://github.com/linux-nvme/nvme-cli
[4]: https://github.com/linux-nvme/nvme-cli/blob/master/LICENSE

View File

@ -0,0 +1,513 @@
[#]: subject: "3 ways to test your API with Python"
[#]: via: "https://opensource.com/article/21/9/unit-test-python"
[#]: author: "Miguel Brito https://opensource.com/users/miguendes"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
3 ways to test your API with Python
======
Unit testing can be daunting, but these Python modules will make your
life much easier.
![Puzzle pieces coming together to form a computer screen][1]
In this tutorial, you'll learn how to unit test code that performs HTTP requests. In other words, you'll see the art of API unit testing in Python.
Unit tests are meant to test a single unit of behavior. In testing, a well-known rule of thumb is to isolate code that reaches external dependencies.
For instance, when testing a code that performs HTTP requests, it's recommended to replace the real call with a fake call during test time. This way, you can unit test it without performing a real HTTP request every time you run the test.
The question is, _how can you isolate the code?_
Hopefully, that's what I'm going to answer in this post! I'll not only show you how to do it but also weigh the pros and cons of three different approaches.
Requirements:
* [Python 3.8][2]
* pytest-mock
* requests
* flask
* responses
* VCR.py
### Demo app using a weather REST API
To put this problem in context, imagine that you're building a weather app. This app uses a third-party weather REST API to retrieve weather information for a particular city. One of the requirements is to generate a simple HTML page, like the image below:
![web page displaying London weather][3]
The weather in London, OpenWeatherMap. Image is the author's own.
To get the information about the weather, you must find it somewhere. Fortunately, [OpenWeatherMap][2] provides everything you need through its REST API service.
_Ok, that's cool, but how can I use it?_
You can get everything you need by sending a `GET` request to: `https://api.openweathermap.org/data/2.5/weather?q={city_name}&appid={api_key}&units=metric`. For this tutorial, I'll parameterize the city name and settle on the metric unit.
### Retrieving the data
To retrieve the weather data, use `requests`. You can create a function that receives a city name as a parameter and returns a JSON. The JSON will contain the temperature, weather description, sunset, sunrise time, and so on.
The example below illustrates such a function:
```
def find_weather_for(city: str) -&gt; dict:
    """Queries the weather API and returns the weather data for a particular city."""
    url = API.format(city_name=city, api_key=API_KEY)
    resp = requests.get(url)
    return resp.json()
```
The URL is made up of two global variables:
```
BASE_URL = "<https://api.openweathermap.org/data/2.5/weather>"
API = BASE_URL + "?q={city_name}&amp;appid={api_key}&amp;units=metric"
```
The API returns a JSON in this format:
```
{
  "coord": {
    "lon": -0.13,
    "lat": 51.51
  },
  "weather": [
    {
      "id": 800,
      "main": "Clear",
      "description": "clear sky",
      "icon": "01d"
    }
  ],
  "base": "stations",
  "main": {
    "temp": 16.53,
    "feels_like": 15.52,
    "temp_min": 15,
    "temp_max": 17.78,
    "pressure": 1023,
    "humidity": 72
  },
  "visibility": 10000,
  "wind": {
    "speed": 2.1,
    "deg": 40
  },
  "clouds": {
    "all": 0
  },
  "dt": 1600420164,
  "sys": {
    "type": 1,
    "id": 1414,
    "country": "GB",
    "sunrise": 1600407646,
    "sunset": 1600452509
  },
  "timezone": 3600,
  "id": 2643743,
  "name": "London",
  "cod": 200
```
The data is returned as a Python dictionary when you call `resp.json()`. In order to encapsulate all the details, you can represent them as a `dataclass`. This class has a factory method that gets the dictionary and returns a `WeatherInfo` instance.
This is good because you keep the representation stable. For example, if the API changes the way it structures the JSON, you can change the logic in just one place, the `from_dict` method. Other parts of the code won't be affected. You can even get information from different sources and combine them in the `from_dict` method!
```
@dataclass
class WeatherInfo:
    temp: float
    sunset: str
    sunrise: str
    temp_min: float
    temp_max: float
    desc: str
    @classmethod
    def from_dict(cls, data: dict) -&gt; "WeatherInfo":
        return cls(
            temp=data["main"]["temp"],
            temp_min=data["main"]["temp_min"],
            temp_max=data["main"]["temp_max"],
            desc=data["weather"][0]["main"],
            sunset=format_date(data["sys"]["sunset"]),
            sunrise=format_date(data["sys"]["sunrise"]),
        )
```
Now, you'll create a function called `retrieve_weather`. You'll use this function to call the API and return a `WeatherInfo` so you can build your HTML page.
```
def retrieve_weather(city: str) -&gt; WeatherInfo:
    """Finds the weather for a city and returns a WeatherInfo instance."""
    data = find_weather_for(city)
    return WeatherInfo.from_dict(data)
```
Good, you have the basic building blocks for our app. Before moving forward, unit test those functions.
### 1\. Testing the API using mocks
[According to Wikipedia][4], a mock object is an object that simulates the behavior of a real object by mimicking it. In Python, you can mock any object using the `unittest.mock` lib that is part of the standard library. To test the `retrieve_weather` function, you can then mock `requests.get` and return static data.
#### pytest-mock
For this tutorial, you'll use `pytest` as your testing framework of choice. The `pytest` library is very extensible through plugins. To accomplish our mocking goals, use `pytest-mock`. This plugin abstracts a bunch of setups from `unittest.mock` and makes your testing code very concise. If you are curious, I discuss more about it in [another blog post][5].
_Ok, enough talking, show me the code._
Here's a complete test case for the `retrieve_weather` function. This test uses two fixtures: One is the `mocker` fixture provided by the `pytest-mock` plugin. The other one is ours. It's just the static data you saved from a previous request.
```
@pytest.fixture()
def fake_weather_info():
    """Fixture that returns a static weather data."""
    with open("tests/resources/weather.json") as f:
        return json.load(f)
[/code] [code]
def test_retrieve_weather_using_mocks(mocker, fake_weather_info):
    """Given a city name, test that a HTML report about the weather is generated
    correctly."""
    # Creates a fake requests response object
    fake_resp = mocker.Mock()
    # Mock the json method to return the static weather data
    fake_resp.json = mocker.Mock(return_value=fake_weather_info)
    # Mock the status code
    fake_resp.status_code = HTTPStatus.OK
    mocker.patch("weather_app.requests.get", return_value=fake_resp)
    weather_info = retrieve_weather(city="London")
    assert weather_info == WeatherInfo.from_dict(fake_weather_info)
```
If you run the test, you get the following output:
```
============================= test session starts ==============================
...[omitted]...
tests/test_weather_app.py::test_retrieve_weather_using_mocks PASSED      [100%]
============================== 1 passed in 0.20s ===============================
Process finished with exit code 0
```
Great, your tests pass! But... Life is not a bed of roses. This test has pros and cons. I'll take a look at them.
#### Pros
Well, one pro already discussed is that by mocking the API's return, you make your tests easier. Isolate the communication with the API and make the test predictable. It will always return what you want.
#### Cons
As for cons, the problem is, what if you don't want to use `requests` anymore and decide to go with the standard library's `urllib`. Every time you change the implementation of `find_weather_for`, you will have to adapt the test. A good test doesn't change when your implementation changes. So, by mocking, you end up coupling your test with the implementation.
Also, another downside is the amount of setup you have to do before calling the function—at least three lines of code.
```
...
    # Creates a fake requests response object
    fake_resp = mocker.Mock()
    # Mock the json method to return the static weather data
    fake_resp.json = mocker.Mock(return_value=fake_weather_info)
    # Mock the status code
    fake_resp.status_code = HTTPStatus.OK
...
```
_Can I do better?_
Yes, please, follow along. I'll see now how to improve it a bit.
### Using responses
Mocking `requests` using the `mocker` feature has the downside of having a long setup. A good way to avoid that is to use a library that intercepts `requests` calls and patches them. There is more than one lib for that, but the simplest to me is `responses`. Let's see how to use it to replace `mock`.
```
@responses.activate
def test_retrieve_weather_using_responses(fake_weather_info):
    """Given a city name, test that a HTML report about the weather is generated
    correctly."""
    api_uri = API.format(city_name="London", api_key=API_KEY)
    responses.add(responses.GET, api_uri, json=fake_weather_info, status=HTTPStatus.OK)
    weather_info = retrieve_weather(city="London")
    assert weather_info == WeatherInfo.from_dict(fake_weather_info)
```
Again, this function makes use of our `fake_weather_info` fixture.
Next, run the test:
```
============================= test session starts ==============================
...
tests/test_weather_app.py::test_retrieve_weather_using_responses PASSED  [100%]
============================== 1 passed in 0.19s ===============================
```
Excellent! This test pass too. But... It's still not that great.
#### Pros
The good thing about using libraries like `responses` is that you don't need to patch `requests` ourselves. You save some setup by delegating the abstraction to the library. However, in case you haven't noticed, there are problems.
#### Cons
Again, the problem is, much like `unittest.mock`, your test is coupled to the implementation. If you replace `requests`, your test breaks.
### 2\. Testing the API using an adapter
_If by using mocks I couple our tests, what can I do?_
Imagine the following scenario: Say that you can no longer use `requests`, and you'll have to replace it with `urllib` since it comes with Python. Not only that, you learned the lesson of not coupling test code with implementation, and you want to avoid that in the future. You want to replace `urllib` and not have to rewrite the tests.
It turns out you can abstract away the code that performs the `GET` request.
_Really? How?_
You can abstract it by using an adapter. The adapter is a design pattern used to encapsulate or wrap the interface of other classes and expose it as a new interface. This way, you can change the adapters without changing our code. For example, you can encapsulate the details about `requests` in our `find_weather_for` and expose it via a function that takes only the URL.
So, this:
```
def find_weather_for(city: str) -&gt; dict:
    """Queries the weather API and returns the weather data for a particular city."""
    url = API.format(city_name=city, api_key=API_KEY)
    resp = requests.get(url)
    return resp.json()
```
Becomes this:
```
def find_weather_for(city: str) -&gt; dict:
    """Queries the weather API and returns the weather data for a particular city."""
    url = API.format(city_name=city, api_key=API_KEY)
    return adapter(url)
```
And the adapter becomes this:
```
def requests_adapter(url: str) -&gt; dict:
    resp = requests.get(url)
    return resp.json()
```
Now it's time to refactor our `retrieve_weather` function:
```
def retrieve_weather(city: str) -&gt; WeatherInfo:
    """Finds the weather for a city and returns a WeatherInfo instance."""
    data = find_weather_for(city, adapter=requests_adapter)
    return WeatherInfo.from_dict(data)
```
So, if you decide to change this implementation to one that uses `urllib`, just swap the adapters:
```
def urllib_adapter(url: str) -&gt; dict:
    """An adapter that encapsulates urllib.urlopen"""
    with urllib.request.urlopen(url) as response:
        resp = response.read()
    return json.loads(resp)
[/code] [code]
def retrieve_weather(city: str) -&gt; WeatherInfo:
    """Finds the weather for a city and returns a WeatherInfo instance."""
    data = find_weather_for(city, adapter=urllib_adapter)
    return WeatherInfo.from_dict(data)
```
_Ok, how about the tests?_
To test r`etrieve_weather`, just create a fake adapter that is used during test time:
```
@responses.activate
def test_retrieve_weather_using_adapter(
    fake_weather_info,
):
    def fake_adapter(url: str):
        return fake_weather_info
    weather_info = retrieve_weather(city="London", adapter=fake_adapter)
    assert weather_info == WeatherInfo.from_dict(fake_weather_info)
```
If you run the test you get:
```
============================= test session starts ==============================
tests/test_weather_app.py::test_retrieve_weather_using_adapter PASSED    [100%]
============================== 1 passed in 0.22s ===============================
```
#### Pros
The pro for this approach is that you successfully decoupled your test from the implementation. Use [dependency injection][6] to inject a fake adapter during test time. Also, you can swap the adapter at any time, including during runtime. You did all of this without changing the behavior.
#### Cons
The cons are that, since you're using a fake adapter for tests, if you introduce a bug in the adapter you employ in the implementation, your test won't catch it. For example, say that we pass a faulty parameter to `requests`, like this:
```
def requests_adapter(url: str) -&gt; dict:
    resp = requests.get(url, headers=&lt;some broken headers&gt;)
    return resp.json()
```
This adapter will fail in production, and the unit tests won't catch it. But truth to be told, you also have the same problem with the previous approach. That's why you always need to go beyond unit tests and also have integration tests. That being said, consider another option.
### 3\. Testing the API using VCR.py
Now it's finally the time to discuss our last option. I have only found about it quite recently, frankly. I've been using mocks for a long time and always had some problems with them. `VCR.py` is a library that simplifies a lot of the tests that make HTTP requests.
It works by recording the HTTP interaction the first time you run the test as a flat YAML file called a _cassette_. Both the request and the response are serialized. When you run the test for the second time, `VCR.py` will intercept the call and return a response for the request made.
Now see how to test `retrieve_weather` using `VCR.py below:`
```
@vcr.use_cassette()
def test_retrieve_weather_using_vcr(fake_weather_info):
    weather_info = retrieve_weather(city="London")
    assert weather_info == WeatherInfo.from_dict(fake_weather_info)
```
_Wow, is that it? No setup? What is that `@vcr.use_cassette()`?_
Yes, that's it! There is no setup, just a `pytest` annotation to tell VCR to intercept the call and save the cassette file.
_What does the cassette file look like?_
Good question. There's a bunch of things in it. This is because VCR saves every detail of the interaction.
```
interactions:
\- request:
    body: null
    headers:
      Accept:
      - '*/*'
      Accept-Encoding:
      - gzip, deflate
      Connection:
      - keep-alive
      User-Agent:
      - python-requests/2.24.0
    method: GET
    uri: [https://api.openweathermap.org/data/2.5/weather?q=London\&amp;appid=\][7]&lt;YOUR API KEY HERE&gt;&amp;units=metric
  response:
    body:
      string: '{"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":800,"main":"Clear","description":"clearsky","icon":"01d"}],"base":"stations","main":{"temp":16.53,"feels_like":15.52,"temp_min":15,"temp_max":17.78,"pressure":1023,"humidity":72},"visibility":10000,"wind":{"speed":2.1,"deg":40},"clouds":{"all":0},"dt":1600420164,"sys":{"type":1,"id":1414,"country":"GB","sunrise":1600407646,"sunset":1600452509},"timezone":3600,"id":2643743,"name":"London","cod":200}'
    headers:
      Access-Control-Allow-Credentials:
      - 'true'
      Access-Control-Allow-Methods:
      - GET, POST
      Access-Control-Allow-Origin:
      - '*'
      Connection:
      - keep-alive
      Content-Length:
      - '454'
      Content-Type:
      - application/json; charset=utf-8
      Date:
      - Fri, 18 Sep 2020 10:53:25 GMT
      Server:
      - openresty
      X-Cache-Key:
      - /data/2.5/weather?q=london&amp;units=metric
    status:
      code: 200
      message: OK
version: 1
```
_That's a lot!_
Indeed! The good thing is that you don't need to care much about it. `VCR.py` takes care of that for you.
#### Pros
Now, for the pros, I can list at least five things:
* No setup code.
* Tests remain isolated, so it's fast.
* Tests are deterministic.
* If you change the request, like by using incorrect headers, the test will fail.
* It's not coupled to the implementation, so you can swap the adapters, and the test will pass. The only thing that matters is that you request is the same.
#### Cons
Again, despite the enormous benefits compared to mocking, there are still problems.
If the API provider changes the format of the data for some reason, the test will still pass. Fortunately, this is not very frequent, and API providers usually version their APIs before introducing such breaking changes. Also, unit tests are not meant to access the external API, so there isn't much to do here.
Another thing to consider is having end-to-end tests in place. These tests will call the server every time it runs. As the name says, it's a more broad test and slow. They cover a lot more ground than unit tests. In fact, not every project will need to have them. So, in my view, `VCR.py` is more than enough for most people's needs.
### Conclusion
This is it. I hope you've learned something useful today. Testing API client applications can be a bit daunting. Yet, when armed with the right tools and knowledge, you can tame the beast.
You can find the full app on [my GitHub][8].
* * *
_This article was originally published on the [author's personal blog][9] and has been adapted with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/unit-test-python
作者:[Miguel Brito][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/miguendes
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen)
[2]: https://miguendes.me/how-i-set-up-my-python-workspace
[3]: https://opensource.com/sites/default/files/sbzkkiywh.jpeg
[4]: https://en.wikipedia.org/wiki/Mock_object
[5]: https://miguendes.me/7-pytest-plugins-you-must-definitely-use
[6]: https://stackoverflow.com/questions/130794/what-is-dependency-injection
[7]: https://api.openweathermap.org/data/2.5/weather?q=London\&appid=\
[8]: https://github.com/miguendes/tutorials/tree/master/testing_http
[9]: https://miguendes.me/3-ways-to-test-api-client-applications-in-python

View File

@ -0,0 +1,116 @@
[#]: subject: "Pensela: An Open-Source Tool Tailored for Screen Annotations"
[#]: via: "https://itsfoss.com/pensela/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Pensela: An Open-Source Tool Tailored for Screen Annotations
======
_**Brief:** Pensela is an interesting screen annotation tool available cross-platform. Let us take a closer look at it._
You may have come across [several screenshot tools][1] available for Linux. However, a dedicated screen annotation tool along with the ability to take screenshots? And, with cross-platform support?
Well, that sounds even better!
### Pensela: A Useful Screen Annotation Tool
![][2]
While you get many tools to beautify your screenshots and the screenshot tools like Flameshot, Pensela lets you focus on annotations first.
It focuses on offering several annotation options while giving you the ability to take full-size screenshots.
Here, I shall highlight some of its features along with my experience using it.
### Features of Pensela
**Note:** Pensela is a fairly new project on [GitHub][3] with no recent updates to it. If you like what you see, I encourage you to help the project or fork it to add the necessary improvements.
Given that it is a new project with an uncertain future, the feature set is impressive as per what it describes.
Heres what you can expect:
* Cross-platform support (Windows, macOS, and Linux)
* Drawing shapes (circle,square,triangle, and more)
* Signs for yes or no (or correct or wrong)
* Arrow object
* Double-sided arrow
* Ability to change the color of the objects added
* Undo/Redo option
* Add custom text
* Adjust the placement of text/objects
* Toggle the annotation tool or turn off to use the active window
* Text highlighter
* Screenshot button to take the full-screen picture
* Option for clearing all the drawings
### Using Pensela as Screen Annotation Tool
The moment you launch the tool, your active window gets unresponsive because it focuses on the annotation capability of pensela.
You get the option to toggle it using the visibility button (icon with an eye). If you disable it, you can interact with the active windows and your computer, but you cannot add annotations.
![][4]
When you enable it, the annotations should start working, and the existing ones will be visible.
This should come in handy if you are streaming/screencasting so that you can use the annotations live and toggle them off when needed.
In the same section, you select the drag button with two double-side arrows, which lets you move the annotations you already created before turning off the button.
You can add a piece of text if you click on “T” and then tweak it around to set a color to add them. The tool gives you the freedom to customize the colors of every object available.
The undo/redo feature works like a charm without limits, which is a good thing.
The ability to hide all the annotations in one click while resuming it after finishing any existing work should come in handy.
![][5]
**Some downsides of Pensela as of now:**
Unfortunately, it does not let you take a screenshot of a specific region on your screen. It only takes a full-screen screenshot, and any annotations you work on need to be full-screen specific for the best results.
Of course, you can manually crop/resize the screenshot later, but that is a limitation I have come across.
Also, you cannot adjust the position of the annotation bar. So, it could be an inconvenience if you want to add an annotation on the top side of your screen.
And, there is no advanced customization option to tweak or change the behavior of how the tools work, how the screenshot is taken, etc.
### Installing Pensela in Linux
You get an AppImage file and a deb file available from its [GitHub releases section][6].
Using an AppImage file should come in handy irrelevant of your Linux distribution, but feel free to try other options mentioned on its GitHub page.
You should also find it in [AUR][7] on an Arch-based Linux distro.
[Pensela][3]
What do you think about Pensela as an annotation tool? Do you know of any similar annotation tools? Feel free to let me know your thoughts in the comments down below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/pensela/
作者:[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/take-screenshot-linux/
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pensela-screenshot.png?resize=800%2C442&ssl=1
[3]: https://github.com/weiameili/Pensela
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pensela-visibility.png?resize=575%2C186&ssl=1
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pensela-folder-screenshot.png?resize=800%2C285&ssl=1
[6]: https://github.com/weiameili/Pensela/releases/tag/v1.1.3
[7]: https://itsfoss.com/aur-arch-linux/

View File

@ -0,0 +1,157 @@
[#]: subject: "Run containers on your Mac with Lima"
[#]: via: "https://opensource.com/article/21/9/run-containers-mac-lima"
[#]: author: "Moshe Zadka https://opensource.com/users/moshez"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Run containers on your Mac with Lima
======
Lima can help overcome the challenges of running containers on a Mac.
![Containers for shipping overseas][1]
Running containers on your Mac can be a challenge. After all, containers are based on Linux-specific technologies like cgroups and namespaces.
Luckily, macOS has a built-in hypervisor, allowing virtual machines (VMs) on the Mac. The hypervisor is a low-level kernel feature, not a user-facing one.
Enter `hyperkit`, an [open source project][2] that will run VMs using the macOS hypervisor. The `hyperkit` tool is designed to be a "minimalist" VM runner. Unlike, say, VirtualBox, it does not come with fancy UI features to manage VMs.
You can grab `hyperkit`, a minimalist Linux distribution running a container manager, and plumb all the pieces together. This would be a lot of moving parts, and sounds like a lot of work. Especially if you want to make the network connections a bit more seamless by using `vpnkit`, an open source project to create a VM's network that feels more like part of the host's network.
### Lima
There is no reason to go to all that effort, when [the `lima` project][3] has figured out the details. One of the easiest ways to get `lima` running is with [Homebrew][4]. You can install `lima` with this command:
```
`$ brew install lima`
```
After installation, which might take a while, it is time to begin having some fun. In order to let `lima` know you are ready for some fun, you need to start it. Here's the command:
```
`$ limactl start`
```
If this is your first time, you will be asked if you like the defaults or whether you want to change any of them. The defaults are pretty safe, but I like to live on the wild side. This is why I jump into an editor and make the following modifications from:
```
 - location: "~"
    # CAUTION: `writable` SHOULD be false for the home directory.
    # Setting `writable` to true is possible but untested and dangerous.
    writable: false
```
to:
```
  - location: "~"
    # I *also* like to live dangerously -- Austin Powers
    writable: true
```
As it says in the comment, this can be dangerous. Many existing workflows, sadly, depend on this mounting to be read-write.
By default, `lima` runs `containerd` to manage containers. The `containerd` manager is also a pretty frill-less one. While it is not uncommon to use a wrapper daemon, like `dockerd`, to add those nice-to-have ergonomics, there is another way.
### The nerdctl tool
The `nerdctl` tool is a drop-in replacement for the Docker client which puts those features in the client, not the server. The `lima` tool allows running `nerdctl` without installing it locally, directly from inside the VM.
Putting it all together, it is time to run a container! This container will run an HTTP server. You can create the files on your Mac:
```
$ ls
index.html
$ cat index.html
hello
```
Now, mount and forward the ports:
```
$ lima nerdctl run --rm -it -p 8000:8000 -v $(pwd):/html --entrypoint bash python
root@9486145449ab:/#
```
Inside the container, run a simple web server:
```
$ lima nerdctl run --rm -it -p 8000:8000 -v $(pwd):/html --entrypoint bash python
root@9486145449ab:/# cd /html/
root@9486145449ab:/html# python -m http.server 8000
Serving HTTP on 0.0.0.0 port 8000 (<http://0.0.0.0:8000/>) ...
```
From a different terminal, you can check that everything looks good:
```
$ curl localhost:8000
hello
```
Back on the container, there is a log message documenting the HTTP client's connection:
```
`10.4.0.1 - - [09/Sep/2021 14:59:08] "GET / HTTP/1.1" 200 -`
```
One file is not enough, so times to make some things better. **CTRL-C** the server, and add another file:
```
^C
Keyboard interrupt received, exiting.
root@9486145449ab:/html# echo goodbye &gt; foo.html
root@9486145449ab:/html# python -m http.server 8000
Serving HTTP on 0.0.0.0 port 8000 (<http://0.0.0.0:8000/>) ...
```
Check that you can see the new file:
```
$ curl localhost:8000/foo.html
goodbye
```
### Wrap up
To recap, installing `lima` takes a while, but after you are done, you can do the following:
* Run containers.
* Mount arbitrary sub-directories of your home directory into containers.
* Edit files in those directories.
* Run network servers that appear to Mac programs like they are running on localhost.
All with `lima nerdctl`.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/run-containers-mac-lima
作者:[Moshe Zadka][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/moshez
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_2015-2-osdc-lead.png?itok=kAfHrBoy (Containers for shipping overseas)
[2]: https://www.docker.com/blog/docker-unikernels-open-source/
[3]: https://github.com/lima-vm/lima
[4]: https://brew.sh/

View File

@ -0,0 +1,149 @@
[#]: subject: "Install AnyDesk on Ubuntu Linux [GUI and Terminal Methods]"
[#]: via: "https://itsfoss.com/install-anydesk-ubuntu/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Install AnyDesk on Ubuntu Linux [GUI and Terminal Methods]
======
_**Brief: This beginners tutorial discusses both GUI and terminal methods of installing AnyDesk on Ubuntu-based Linux distributions.**_
[AnyDesk][1] is a popular remote desktop software available for Linux, Windows, BSD, macOS and mobile platforms.
With this tool, you can remotely access other computer using AnyDesk or let someone else remotely access your system. Not everyone can access it just because two devices use AnyDesk. You have to accept the incoming connection and/or provide a password for secure connection.
This is helpful in providing tech support to friend, family, colleagues or even to the customers.
In this tutorial, Ill show you both graphical and command line ways of installing AnyDesk on Ubuntu. You can use either method based on your preference. Both methods will install the same AnyDesk version on your Ubuntu system.
The same method should be applicable to Debian and other Debian and Ubuntu based distributions such as Linux Mint, Linux Lite etc.
Non-FOSS alert!
AnyDesk is not open source software. It is covered here because it is available on Linux and the articles focus is on Linux.
### Method 1: Install AnyDesk on Ubuntu using terminal
[Open the terminal application][2] on your system. Youll need a tool like wget to [download files in the terminal. For th][3]at, use the following command:
```
sudo apt update
sudo apt install wget
```
The next step now is to download the GPG key of AnyDesk repository and add it to your systems trusted keys. This way, your system will trust the software coming from this [external repository][4].
```
wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | sudo apt-key add -
```
You may ignore the deprecated warning about apt-key command for now. The next step is to add the AnyDesk repository to your systems repository sources:
```
echo "deb http://deb.anydesk.com/ all main" | sudo tee /etc/apt/sources.list.d/anydesk-stable.list
```
Update the package cache so that your system learns about the availability of new applications through the newly added repository.
```
sudo apt update
```
And now, you can install AnyDesk:
```
sudo apt install anydesk
```
Once that is done, you can start AnyDesk from the system menu or from the terminal itself:
```
anydesk
```
You can enjoy AnyDesk now.
![AnyDesk running in Ubuntu][5]
### Method 2: Install AnyDesk on Ubuntu graphically
If you are not comfortable with the command line, no worries. You can also install AnyDesk without going into the terminal.
You can download AnyDesk for Ubuntu from the official AnyDesk website:
[Download AnyDesk for Linux][6]
Youll see a Download Now button. Click on it.
![Download AnyDesk][7]
When you click on the download button, it gives you options for various Linux distributions. Select the one for Ubuntu:
![Download the appropriate file][8]
It will download the DEB file of AnyDesk application. [Installing deb file][9] is easy. Either double click on it or right click and open with Software Install.
![Right click on deb file and open with software center][10]
Software Center application will be opened and you can install it from there.
![Installing AnyDesk in Ubuntu software center][11]
Once installed, search for it in the system menu and start from there.
![AnyDesk installed in Ubuntu][12]
Thats it. Not too hard, is it?
I am not going to show the steps for using AnyDesk. I think you already have some idea about that. If not, refer to [this article][13], please.
#### Troubleshooting tip
When I tried to run AnyDesk from the system menu, it didnt start. So, I started it from the terminal and it showed me this error:
```
[email protected]:~$ anydesk
anydesk: error while loading shared libraries: libpangox-1.0.so.0: cannot open shared object file: No such file or directory
```
If you see the [error while loading shared libraries][14] message, you install the package it is complaining about. Heres what I did in my case:
```
sudo apt install libpangox-1.0-0
```
That solved the issue for me and I hope it fixes for you as well.
If you have any questions related to this topic, please let me know in the comment section.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-anydesk-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://anydesk.com/en
[2]: https://itsfoss.com/open-terminal-ubuntu/
[3]: https://itsfoss.com/download-files-from-linux-terminal/
[4]: https://itsfoss.com/adding-external-repositories-ubuntu/
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/anydesk-running-in-ubuntu.png?resize=800%2C418&ssl=1
[6]: https://anydesk.com/en/downloads/linux
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/any-desk-ubuntu-download.webp?resize=800%2C312&ssl=1
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/any-desk-ubuntu-download-1.webp?resize=800%2C427&ssl=1
[9]: https://itsfoss.com/install-deb-files-ubuntu/
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/install-anaydesk-ubuntu.png?resize=800%2C403&ssl=1
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-anydesk-in-ubuntu-software-center.png?resize=781%2C405&ssl=1
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/anydesk-installed-in-ubuntu.png?resize=759%2C196&ssl=1
[13]: https://support.anydesk.com/Access
[14]: https://itsfoss.com/solve-open-shared-object-file-quick-tip/

View File

@ -0,0 +1,143 @@
[#]: subject: "Linux Jargon Buster: What is sudo rm -rf? Why is it Dangerous?"
[#]: via: "https://itsfoss.com/sudo-rm-rf/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: " "
[#]: url: " "
Linux 黑话解释:什么是 sudo rm -rf为什么如此危险
======
当你刚接触 Linux 时,你会经常遇到这样的建议:永远不要运行 `sudo rm -rf /`。在 Linux 世界里,围绕着 `sudo rm -rf` 有很多梗。
![][1]
但似乎关于它有一些混乱的现象。在 [清理 Ubuntu 以腾出空间][2] 的教程中,我建议运行一些涉及 `sudo``rm -rf` 的命令。一位读者问我,如果 `sudo rm -rf` 是一个不应该运行的危险的 Linux 命令,我为什么要建议这样做。
因此,我想到了写一篇 Linux 黑话解释,以消除误解。
### sudo rm -rf在做什么
让我们按步骤来学习。
`rm` 命令用于 [在 Linux 命令行中删除文件和目录][3]。
```
$ rm agatha
$
```
但是因为有只读的 [文件权限][4],有些文件不会被立即删除。它们必须用选项 `-f` 强制删除。
```
$ rm books
rm: remove write-protected regular file 'books'? y
$ rm -f christie
$
```
另外,`rm` 命令不能被用来直接删除目录(文件夹)。你必须在 `rm` 命令中使用递归选项 `-r`
```
$ rm new_dir
rm: cannot remove 'new_dir': Is a directory
```
因此最终,`rm -rf` 命令意味着递归地、强制删除指定的目录。
```
$ rm -r new_dir
rm: remove write-protected regular file 'new_dir/books'? ^C
$ rm -rf new_dir
$
```
下面是上述所有命令的截图。
![解释 rm 命令的例子][5]
如果你在 `rm -rf` 命令前加入 `sudo`,你就是在删除具有 root 权限的文件。这意味着你可以删除由 [root 用户][6] 拥有的系统文件。
### 所以sudo rm -rf 是一个危险的 Linux 命令?
嗯,任何删除东西的命令都可能是危险的,如果你不确定你正在删除什么。
`rm -rf` 命令看作一把刀。刀是一个危险的东西吗?有可能。如果你用刀切蔬菜,那是好事。如果你用刀切手指,那当然是不好的。
`rm -rf` 命令也是如此。它本身并不危险。它毕竟是用来删除文件的。但是,如果你在不知情的情况下用它来删除重要文件,那就有问题了。
现在来看看 `sudo rm -rf /`
你知道,使用 `sudo`,你以 root 身份运行一个命令,这允许你对系统进行任何改变。
`/` 是根目录的符号。`/var` 表示根目录下的 `var` 目录。`/var/log/apt` 指的是根目录的 `log` 目录下的 `apt` 目录。
![Linux 目录层次表示法][7]
按照 [Linux 目录层次结构][8]Linux 文件系统中的一切都从根目录开始。如果你删除了根目录,你基本上就是删除了系统中的所有文件。
这就是为什么建议不要运行 `sudo rm -rf /` 命令,因为你会抹去你的整个 Linux 系统。
请注意,在某些情况下,你可能正在运行像 `sudo rm -rf /var/log/apt` 这样的命令,这可能是好的。同样,你必须注意你正在删除的东西,就像你必须注意你正在用刀切割的东西一样。
### 我在玩火:如果我运行 sudo rm -rf /,看看会发生什么呢?
大多数 Linux 发行版都提供了一个故障安全保护,防止意外删除根目录。
```
$ sudo rm -rf /
[sudo] password for abhishek:
rm: it is dangerous to operate recursively on '/'
rm: use --no-preserve-root to override this failsafe
```
我的意思是,人是会打错字的,如果你不小心打了 `/ var/log/apt`,而不是 `/var/log/apt``/` 和 `var` 之间的空格意味着你给出了 `/``var` 目录来删除),你将会删除根目录。
![使用 sudo rm -rf 时要注意][9]
别担心。你的 Linux 系统会照顾到这种意外。
现在,如果你一心想用 `sudo rm -rf /` 来破坏你的系统呢?你将必须使用它将要求你使用的 `-no-preserve-root` 选项与之配合。
不,请不要自己这样做。让我做给你看看。
所以,我在一个虚拟机中运行基本的操作系统。我运行 `sudo rm -rf / --no-preserve-root`,你可以在下面的视频中看到灯光熄灭(大约 1 分钟)。
![video](https://player.vimeo.com/video/594025609)
### 清楚了么?
Linux 有一个活跃的社区,大多数人都会帮助新用户。 之所以说是大多数,是是因为有一些的邪恶坏人潜伏着捣乱新用户。他们经常会建议对初学者所面临的最简单的问题运行 `rm -rf /`。我认为这些白痴在这种邪恶行为中得到了某种至上主义的满足。我会立即将他们从我管理的论坛和群组中踢出去。
我希望这篇文章能让你更清楚地了解这些情况。你有可能仍然有一些困惑,特别是因为它涉及到根目录、文件权限和其他新用户可能不熟悉的东西。如果是这样的话,请在评论区告诉我你的疑惑,我会尽力去解决。
最后,请记住。<ruby>不要喝酒胡搞<rt>Dont drink and root</rt></ruby>。在运行你的 Linux 系统时要安全驾驶。
![][11]
--------------------------------------------------------------------------------
via: https://itsfoss.com/sudo-rm-rf/
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/04/sudo-rm-rf.gif?resize=400%2C225&ssl=1
[2]: https://itsfoss.com/free-up-space-ubuntu-linux/
[3]: https://linuxhandbook.com/remove-files-directories/
[4]: https://linuxhandbook.com/linux-file-permissions/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/rm-rf-command-example-800x487.png?resize=800%2C487&ssl=1
[6]: https://itsfoss.com/root-user-ubuntu/
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/linux-directory-structure.png?resize=800%2C400&ssl=1
[8]: https://linuxhandbook.com/linux-directory-structure/
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/sudo-rm-rf-example.png?resize=798%2C346&ssl=1
[10]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/dont-drink-and-root.jpg?resize=800%2C450&ssl=1

View File

@ -1,103 +0,0 @@
[#]: subject: "Raspberry Pi Zero vs Zero W: Whats the Difference?"
[#]: via: "https://itsfoss.com/raspberry-pi-zero-vs-zero-w/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "anine09"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
树莓派 Zero 与 Zero W多方位对比
======
树莓派十年前凭借 25 美元的迷你电脑掀起了一场革命。在这段时间里,树莓派发布了许多分支系列。也将一些为特定目的而设计的模块进行了一些升级。
在所有的树莓派模块中Pi Zero 和 Pi Zero W 是旨在为小规模项目和 IoT 项目设计的最便宜的模块。这两种设备几乎是相同的,但是它们之间有一些微妙而重要的区别。
**那么,树莓派 Zero 和 Zero W 之间的区别是什么Zero W 中的 W 代表的是无线Wireless它表示的是 Zero W 模块拥有无线功能。这是这两个相似模块之间的最大差异**
让我们更详细地看看其他细节吧。
### Pi Zero 与 Pi Zero W 之间的主要不同点
![][1]
虽然 树莓派 Zero 是以在只有 A+ 板一半的大小上提供尽可能多的功能为目标。
而且,树莓派 Zero W 在不需要任何附加的组件和模块的情况下就可以使用蓝牙和 Wifi。
这是两者之间的区别,其他的部分都是相同的。
所以,如果你需要以下功能:
* 802.11 b/g/n 无线网口
* 蓝牙 4.1
* 低功耗的蓝牙模块BLEBluetooth Low Energy
树莓派 Zero W 将是你的不二之选。
此外,树莓派 Zero W 提供了一种带引脚的版本,叫做 “树莓派 Pi Zero WH”
### 树莓派 Zero 和 Zero W 的规格
![Raspberry Pi Zero W][6]
[树莓派 Zero 和 Zero W 的规格][7]几乎是一样的。
它们都具有 1 GHz 的单核 CPU 和 512 MB 的 RAM。至于接口方面一个 mini HDMI 接口,支持 micro USB OTGmicro USB 供电和一个 CSI 摄像头接口(需要插入一个相机模块)。
这些板子会提供一种叫 [HAT][8]Hardware Attached on Top顶部附加硬件兼容 40个引脚当通常情况下没有这些引脚你能更容易的使用接口。
你可以根据自己的功能需要选择使用[各种树莓派兼容的系统][9],但无论哪种情况,我还是推荐你使用 Raspberry Pi OS。
### 树莓派 Zero 系列值不值得买?
![Raspberry Pi Zero][10]
树莓派 Zero 是一种很受人们喜欢的单片机形式,尽管你有很多树莓派 Zero 的替代品,树莓派 Zero 仍然是最推荐的选择。
当然,除非你有特殊需求。
In addition to the size of the board, the pricing, power requirement, and processing power are some of the key highlights of this board under **$20**.
另外,对于同水平的单片机规模,定价,功率要求,运算能力而言,树莓派 Zero 最亮眼的地方就是它低于 **20 美元**的价格。
So, if you are looking for the essential features under a budget, the Raspberry Zero series should work for you.
因此,如果你正在寻找预算中满足基本功能的单片机,树莓派 Zero 就是专门为你打造的。
### Is Raspberry Pi Zero series affordable?
### 树莓派 Zero 系列价格怎么样?
Raspberry Pi Zero costs **$5** and the Raspberry Pi Zero W would cost you around **$10**. ****Of course, depending on its availability and region, the cost will differ. If you want the Raspberry Pi Zero W with header pins, it should cost you around **$14**.
树莓派 Zero 售价 **5 美元** Zero W 售价 **10 美元左右**,当然,在不同的地方,定价规则会不一样,如果你选择树莓派 Zero W 带 引脚的版本,售价大概是 **14 美元**左右。
There are other devices that can be used as an [alternative to Raspberry Pi Zero][11] and they have similar price tag.
还有[其他的设备可以代替树莓派 Zero][11],它们价格也相差不大。
--------------------------------------------------------------------------------
via: https://itsfoss.com/raspberry-pi-zero-vs-zero-w/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[anine09](https://github.com/anine09)
校对:[校对者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://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-vs-zero-w.png?resize=800%2C450&ssl=1
[2]: https://i1.wp.com/m.media-amazon.com/images/I/517BwcAPmTL._SL160_.jpg?ssl=1
[3]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 "CanaKit Raspberry Pi Zero W (Wireless) Complete Starter Kit - 16 GB Edition"
[4]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 "Amazon Prime"
[5]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 "Buy on Amazon"
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-w.png?resize=600%2C400&ssl=1
[7]: https://itsfoss.com/raspberry-pi-zero-w/
[8]: https://github.com/raspberrypi/hats
[9]: https://itsfoss.com/raspberry-pi-os/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-1.png?resize=600%2C400&ssl=1
[11]: https://itsfoss.com/raspberry-pi-zero-alternatives/
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/raspberry-pi-zero-w-projects.png?fit=800%2C450&ssl=1
[13]: https://itsfoss.com/raspberry-pi-zero-projects/

View File

@ -0,0 +1,123 @@
[#]: subject: "Watch commands and tasks with the Linux watch command"
[#]: via: "https://opensource.com/article/21/9/linux-watch-command"
[#]: author: "Moshe Zadka https://opensource.com/users/moshez"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
用 Linux 的 watch 命令观察命令和任务
======
了解 watch 命令如何让你知道任务已完成或命令已执行。
![Clock, pen, and notepad on a desk][1]
有很多时候,你需要等待一些事情的完成,比如:
* 一个文件的下载。
* 创建或解压一个 [tar][2] 文件。
* 一个 [Ansible][3] 作业。
其中一些进程有进度指示,但有时进程是通过一层抽象运行的,衡量进度的唯一方法是通过其副作用。其中一些可能是:
* 一个正在下载的文件不断增长。
* 一个从 tarball 中提取的目录被文件填满了。
* Ansible 作业构建了一个[容器][4]。
你可以用这样的命令查询所有这些:
```
$ ls -l downloaded-file
$ find . | wc -l
$ podman ps
$ docker ps
```
但是反复运行这些命令,即使是利用 [Bash 历史][5]和**向上箭头**的便利,也是很乏味的。
另一种方法是写一个小的 Bash 脚本来为你自动执行这些命令:
```
while :
do
docker ps
sleep 2
done
```
但这样的脚本写起来也会很繁琐。你可以写一个小的通用脚本,并将其打包,这样它就可以一直被你使用。幸运的是,其他开源的开发者已经有了这样的经验和做法。
那就是 `watch` 这个命令。
### 安装 watch
`watch` 命令是 [`procps-ng` 包][6]的一部分,所以如果你是在 Linux 上,你已经安装了它。
在 macOS 上,使用 [MacPorts][7] 或 [Homebrew][8] 安装 `watch`。在 Windows 上,使用 [Chocolatey][9]。
### 使用 watch
`watch` 命令定期运行一个命令并显示其输出。它有一些文本终端的特性,所以只有最新的输出才会出现在屏幕上。
最简单的用法是:`watch <command>`。
例如,在 `docker ps` 命令前加上 `watch`,就可以这样操作:
```
`$ watch docker ps`
```
`watch` 命令,以及一些创造性的 Unix 命令行技巧,可以生成临时的仪表盘。例如,要计算审计事件:
```
`$ watch 'grep audit: /var/log/kern.log |wc -l'`
```
在最后一个例子中,如果有一个可视化的指示,表明审计事件的数量发生了变化,这可能是有用的。如果变化是预期的,但你想让一些东西看起来“不同”,`watch --differences` 就很好用。它可以高亮显示与上次运行的任何差异。如果你在多个文件中搜索,这一点尤其有效,所以你可以很容易地看到哪个文件发生了变化。
如果没有预期的变化,你可以使用 `watch --differences=permanent` 要求它们被“永久”高亮显示,以便知道哪些变化需要调查。这通常是更有用的。
### 控制频率
最后,有时该命令可能是资源密集型的,不应运行得太频繁。`-n` 参数控制频率。Watch 默认使用 2 秒,但是 `watch -n 10` 可能适合于资源密集型的情况,比如在子目录的任何文件中搜索一个模式:
```
`$ watch -n 10 'find . -type f | xargs grep suspicious-pattern'`
```
### 用 watch 观察一个命令
`watch` 命令对于许多临时性的系统管理任务非常有用,在这些任务中,你需要在没有进度条的情况下等待一些耗时的步骤,然后再进入下一个步骤。尽管这种情况并不理想,但 `watch` 可以使情况稍微好转。它让你有时间为工作做回顾性笔记!"。下载**[备忘录][10]**,让有用的语法和选项触手可及。。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/linux-watch-command
作者:[Moshe Zadka][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/moshez
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 (Clock, pen, and notepad on a desk)
[2]: https://opensource.com/article/17/7/how-unzip-targz-file
[3]: https://opensource.com/resources/what-ansible
[4]: https://opensource.com/resources/what-docker
[5]: https://opensource.com/article/20/6/bash-history-control
[6]: https://opensource.com/article/21/8/linux-procps-ng
[7]: https://opensource.com/article/20/11/macports
[8]: https://opensource.com/article/20/6/homebrew-mac
[9]: https://opensource.com/article/20/3/chocolatey
[10]: https://opensource.com/downloads/watch-cheat-sheet