mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-16 22:42:21 +08:00
Merge branch 'master' of https://github.com/LCTT/TranslateProject into translating
This commit is contained in:
commit
2df3c508e7
@ -1,24 +1,26 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (lxbwolf)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11661-1.html)
|
||||
[#]: subject: (6 Methods to Quickly Check if a Website is up or down from the Linux Terminal)
|
||||
[#]: via: (https://www.2daygeek.com/linux-command-check-website-is-up-down-alive/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
在 Linux Terminal 快速检测网站是否宕机的 6 个方法
|
||||
在 Linux 终端快速检测网站是否宕机的 6 个方法
|
||||
======
|
||||
|
||||
本教程教你怎样在 Linux terminal 快速检测一个网站是否宕机。
|
||||
> 本教程教你怎样在 Linux 终端快速检测一个网站是否宕机。
|
||||
|
||||
你可能已经了解了一些类似的命令,像 ping,curl 和 wget。我们在本教程中又加入了一些其他命令。同时,对于要检测单个和多个主机的信息我们也加入了不同的选项。
|
||||
![](https://img.linux.net.cn/data/attachment/album/201912/10/093801u332115oocxz4531.jpg)
|
||||
|
||||
本文将帮助你检测网站是否宕机。但是如果你在维护一个网站,希望网站宕掉时得到实时的报警,我推荐你去使用实时网站监控工具。这种工具有很多,有些是免费的,大部分收费。根据你的需求,选择合适的工具。在后续的文章中我们会涉及这个主题。
|
||||
你可能已经了解了一些类似的命令,像 `ping`、`curl` 和 `wget`。我们在本教程中又加入了一些其他命令。同时,我们也加入了不同的选项来检测单个和多个主机的信息。
|
||||
|
||||
本文将帮助你检测网站是否宕机。但是如果你在维护一些网站,希望网站宕掉时得到实时的报警,我推荐你去使用实时网站监控工具。这种工具有很多,有些是免费的,大部分收费。根据你的需求,选择合适的工具。在后续的文章中我们会涉及这个主题。
|
||||
|
||||
### 方法 1:使用 fping 命令检测一个网站是否宕机
|
||||
|
||||
**[fping 命令][1]** 是一个类似 ping 的程序,使用互联网控制消息协议回应请求报文(ICMP echo request)来判断目标主机是否能回应。fping 与 ping 的不同之处在于它可以并行地 ping 任意数量的主机,也可以从一个文本文件读入主机。fping 发送一个 ICMP echo request 后不等待目标主机响应,就以 round-robin 模式向下一个目标主机发请求。如果一个目标主机有响应,那么它就被标记为存活的(active)然后从检查目标列表里去掉。如果一个目标主机在限定的时间和(或)重试次数内没有响应,则被指定为网站无法到达(unreachable)。
|
||||
[fping 命令][1] 是一个类似 `ping` 的程序,使用互联网控制消息协议(ICMP)的<ruby>回应请求报文<rt>echo request</rt></ruby>来判断目标主机是否能回应。`fping` 与 `ping` 的不同之处在于它可以并行地 `ping` 任意数量的主机,也可以从一个文本文件读入主机名称。`fping` 发送一个 ICMP 回应请求后不等待目标主机响应,就以轮询模式向下一个目标主机发请求。如果一个目标主机有响应,那么它就被标记为存活的,然后从检查目标列表里去掉。如果一个目标主机在限定的时间和(或)重试次数内没有响应,则被指定为网站无法到达的。
|
||||
|
||||
```
|
||||
# fping 2daygeek.com linuxtechnews.com magesh.co.in
|
||||
@ -30,7 +32,7 @@ magesh.co.in is alive
|
||||
|
||||
### 方法 2:使用 http 命令检测一个网站是否宕机
|
||||
|
||||
HTTPie(读作 aitch-tee-tee-pie)是一个命令行 HTTP 客户端。**[httpie tool][2]** 是一个可以与 web 服务通过 CLI(command-line interface)进行交互的现代工具。httpie tool 提供了简单的 http 命令,可以通过发送简单的、自然语言语法的任意 HTTP 请求得到多彩的结果输出。HTTPie 可以用来对 HTTP 服务器进行测试、调试和基本的交互。
|
||||
HTTPie(读作 aitch-tee-tee-pie)是一个命令行 HTTP 客户端。[httpie][2] 是一个可以与 web 服务通过 CLI 进行交互的现代工具。httpie 工具提供了简单的 `http` 命令,可以通过发送简单的、自然语言语法的任意 HTTP 请求得到多彩的结果输出。HTTPie 可以用来对 HTTP 服务器进行测试、调试和基本的交互。
|
||||
|
||||
```
|
||||
# http 2daygeek.com
|
||||
@ -49,7 +51,7 @@ Vary: Accept-Encoding
|
||||
|
||||
### 方法 3:使用 curl 命令检测一个网站是否宕机
|
||||
|
||||
**[curl 命令](https://www.2daygeek.com/curl-linux-command-line-download-manager/)** 是一个用于在服务器间通过支持的协议(DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET 和 TFTP)传输数据的工具。这个工具不支持用户交互。curl 也支持使用代理、用户认证、FTP 上传、HTTP post、SSL 连接、cookies、断点续传、Metalink等等。curl 由 libcurl 库提供所有与传输有关的能力。
|
||||
[curl 命令][3] 是一个用于在服务器间通过支持的协议(DICT、FILE、FTP、FTPS、GOPHER、HTTP、HTTPS、IMAP、IMAPS、LDAP、LDAPS、POP3、POP3S、RTMP、RTSP、SCP、SFTP、SMTP、SMTPS、TELNET 和 TFTP)传输数据的工具。这个工具不支持用户交互。`curl` 也支持使用代理、用户认证、FTP 上传、HTTP POST 请求、SSL 连接、cookie、断点续传、Metalink 等等。`curl `由 libcurl 库提供所有与传输有关的能力。
|
||||
|
||||
```
|
||||
# curl -I https://www.magesh.co.in
|
||||
@ -67,7 +69,7 @@ server: cloudflare
|
||||
cf-ray: 535b74123ca4dbf3-LHR
|
||||
```
|
||||
|
||||
如果你只想看 HTTP 状态码而不是返回的全部信息,用下面的 curl 命令:
|
||||
如果你只想看 HTTP 状态码而不是返回的全部信息,用下面的 `curl` 命令:
|
||||
|
||||
```
|
||||
# curl -I "www.magesh.co.in" 2>&1 | awk '/HTTP\// {print $2}'
|
||||
@ -87,7 +89,7 @@ else
|
||||
fi
|
||||
```
|
||||
|
||||
当你把脚本内容添加到一个文件后,执行文件,查看结果
|
||||
当你把脚本内容添加到一个文件后,执行文件,查看结果:
|
||||
|
||||
```
|
||||
# sh curl-url-check.sh
|
||||
@ -113,7 +115,7 @@ echo "----------------------------------"
|
||||
done
|
||||
```
|
||||
|
||||
当你把上面脚本内容添加到一个文件后,执行文件,查看结果
|
||||
当你把上面脚本内容添加到一个文件后,执行文件,查看结果:
|
||||
|
||||
```
|
||||
# sh curl-url-check-1.sh
|
||||
@ -130,7 +132,7 @@ www.xyzzz.com is down
|
||||
|
||||
### 方法 4:使用 wget 命令检测一个网站是否宕机
|
||||
|
||||
**[wget 命令][4]** (前身是 Geturl)是一个免费的开源命令行下载工具,通过 HTTP、HTTPS、FTP和其他广泛使用的互联网协议检索文件。wget 是非交互式的命令行工具,由 World Wide Web 和 get 得名。wget 相对于其他工具来说更优秀,功能包括后台运行、递归下载、多文件下载、断点续传、非交互式下载和大文件下载。
|
||||
[wget 命令][4](前身是 Geturl)是一个自由开源的命令行下载工具,通过 HTTP、HTTPS、FTP 和其他广泛使用的互联网协议获取文件。`wget` 是非交互式的命令行工具,由 World Wide Web 和 get 得名。`wget` 相对于其他工具来说更优秀,功能包括后台运行、递归下载、多文件下载、断点续传、非交互式下载和大文件下载。
|
||||
|
||||
```
|
||||
# wget -S --spider https://www.magesh.co.in
|
||||
@ -158,7 +160,7 @@ Remote file exists and could contain further links,
|
||||
but recursion is disabled -- not retrieving.
|
||||
```
|
||||
|
||||
如果你只想看 HTTP 状态码而不是返回的全部结果,用下面的 wget 命令:
|
||||
如果你只想看 HTTP 状态码而不是返回的全部结果,用下面的 `wget` 命令:
|
||||
|
||||
```
|
||||
# wget --spider -S "www.magesh.co.in" 2>&1 | awk '/HTTP\// {print $2}'
|
||||
@ -178,7 +180,7 @@ else
|
||||
fi
|
||||
```
|
||||
|
||||
当你把脚本内容添加到一个文件后,执行文件,查看结果
|
||||
当你把脚本内容添加到一个文件后,执行文件,查看结果:
|
||||
|
||||
```
|
||||
# wget-url-check.sh
|
||||
@ -221,7 +223,7 @@ www.xyzzz.com is down
|
||||
|
||||
### 方法 5:使用 lynx 命令检测一个网站是否宕机
|
||||
|
||||
**[lynx][5]** 是一个在可寻址光标字符单元终端上使用的基于文本的高度可配的 web 浏览器,它是最古老的 web 浏览器并且现在仍在开发。
|
||||
[lynx][5] 是一个在<ruby>可寻址光标字符单元终端<rt>cursor-addressable character cell terminals</rt></ruby>上使用的基于文本的高度可配的 web 浏览器,它是最古老的 web 浏览器并且现在仍在活跃开发。
|
||||
|
||||
```
|
||||
# lynx -head -dump http://www.magesh.co.in
|
||||
@ -240,7 +242,7 @@ Server: cloudflare
|
||||
CF-RAY: 535fc5704a43e694-LHR
|
||||
```
|
||||
|
||||
如果你只想看 HTTP 状态码而不是返回的全部结果,用下面的 lynx 命令:
|
||||
如果你只想看 HTTP 状态码而不是返回的全部结果,用下面的 `lynx` 命令:
|
||||
|
||||
```
|
||||
# lynx -head -dump https://www.magesh.co.in 2>&1 | awk '/HTTP\// {print $2}'
|
||||
@ -260,7 +262,7 @@ else
|
||||
fi
|
||||
```
|
||||
|
||||
当你把脚本内容添加到一个文件后,执行文件,查看结果
|
||||
当你把脚本内容添加到一个文件后,执行文件,查看结果:
|
||||
|
||||
```
|
||||
# sh lynx-url-check.sh
|
||||
@ -303,7 +305,7 @@ www.xyzzz.com is down
|
||||
|
||||
### 方法 6:使用 ping 命令检测一个网站是否宕机
|
||||
|
||||
**[ping 命令][1]** (Packet Internet Groper)是网络工具的代表,用于在互联网协议(IP)的网络中测试一个目标主机是否可用/可连接。通过向目标主机发送 ICMP 回应请求报文包并等待 ICMP 回应响应报文来检测主机的可用性。它基于已发送的包、接收到的包和丢失了的包来统计结果数据,通常包含最小/平均/最大响应时间。
|
||||
[ping 命令][1](Packet Internet Groper)是网络工具的代表,用于在互联网协议(IP)的网络中测试一个目标主机是否可用/可连接。通过向目标主机发送 ICMP 回应请求报文包并等待 ICMP 回应响应报文来检测主机的可用性。它基于已发送的包、接收到的包和丢失了的包来统计结果数据,通常包含最小/平均/最大响应时间。
|
||||
|
||||
```
|
||||
# ping -c 5 2daygeek.com
|
||||
@ -320,9 +322,9 @@ PING 2daygeek.com (104.27.157.177) 56(84) bytes of data.
|
||||
rtt min/avg/max/mdev = 170.668/213.824/250.295/28.320 ms
|
||||
```
|
||||
|
||||
### 方法 7:使用 telnet 命令检测一个网站是否宕机
|
||||
### 附加 1:使用 telnet 命令检测一个网站是否宕机
|
||||
|
||||
telnet 命令是一个使用 TELNET 协议用于 TCP/IP 网络中多个主机相互通信的古老的网络协议。它通过 23 端口连接其他设备如计算机和网络设备。telnet 是不安全的协议,现在由于用这个协议发送的数据没有经过加密可能被黑客拦截,所以不推荐使用。大家都使用经过加密且非常安全的 SSH 协议来代替 telnet。
|
||||
`telnet` 命令是一个使用 TELNET 协议用于 TCP/IP 网络中多个主机相互通信的古老的网络协议。它通过 23 端口连接其他设备如计算机和网络设备。`telnet` 是不安全的协议,现在由于用这个协议发送的数据没有经过加密可能被黑客拦截,所以不推荐使用。大家都使用经过加密且非常安全的 SSH 协议来代替 `telnet`。
|
||||
|
||||
```
|
||||
# telnet google.com 80
|
||||
@ -335,11 +337,11 @@ telnet> quit
|
||||
Connection closed.
|
||||
```
|
||||
|
||||
### 方法 8:使用 bash 脚本检测一个网站是否宕机
|
||||
### 附加 2:使用 bash 脚本检测一个网站是否宕机
|
||||
|
||||
简而言之,一个 **[shell 脚本][6]** 就是一个包含一系列命令的文件。shell 从文件读取内容按输入顺序逐行在命令行执行。为了让它更有效,我们添加一些条件。这也减轻了 Linux 管理员的负担。
|
||||
简而言之,一个 [shell 脚本][6] 就是一个包含一系列命令的文件。shell 从文件读取内容按输入顺序逐行在命令行执行。为了让它更有效,我们添加一些条件。这也减轻了 Linux 管理员的负担。
|
||||
|
||||
如果你想想用 wget 命令看多个网站的状态,使用下面的 shell 脚本:
|
||||
如果你想想用 `wget` 命令看多个网站的状态,使用下面的 shell 脚本:
|
||||
|
||||
```
|
||||
# vi wget-url-check-2.sh
|
||||
@ -365,7 +367,7 @@ google.co.in is up
|
||||
www.xyzzz.com is down
|
||||
```
|
||||
|
||||
如果你想想用 wget 命令看多个网站的状态,使用下面的 **[shell 脚本][7]**:
|
||||
如果你想用 `wget` 命令看多个网站的状态,使用下面的 [shell 脚本][7]:
|
||||
|
||||
```
|
||||
# vi curl-url-check-2.sh
|
||||
@ -398,7 +400,7 @@ via: https://www.2daygeek.com/linux-command-check-website-is-up-down-alive/
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,72 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11660-1.html)
|
||||
[#]: subject: (Why use the Pantheon desktop for Linux Elementary OS)
|
||||
[#]: via: (https://opensource.com/article/19/12/pantheon-linux-desktop)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
为何 Elementary OS 中使用 Pantheon 桌面
|
||||
======
|
||||
|
||||
> 本文是 Linux 桌面特别系列的一部分。通过在 Elementary OS 上运行 Pantheon 桌面获得广受喜爱的 Mac OS 特性。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/201912/10/085342dfgngrpt6sgzl3af.jpg)
|
||||
|
||||
你愿意为 Linux 桌面支付 20 美元吗?事实上,我会在下载自由软件时选择支付更多的钱!我这样做的原因是开源是值得的。对于 [Elementary OS][2] 的拷贝,默认价格是 20 美元(你可以选择 1 美元,如果你无法负担,你甚至可以用 0 美元下载)。作为回报,你将获得一个出色且精心制作的发行版,同时拥有它自己的 Pantheon 桌面设计。
|
||||
|
||||
你可能会发现 Pantheon 已包含在软件仓库中,因为它是开源的,但你更可能需要下载并安装 [Elementary][3] Linux 才能体验它。如果你还不准备在计算机上将 Elementary 作为主操作系统,那么可以将其安装到虚拟机中,例如 [GNOME Boxes][4] 中。
|
||||
|
||||
Pantheon 桌面整洁、吸引人,并且有许多用户希望在桌面中获得的东西,但在普通的 Linux 桌面上却无法获得。
|
||||
|
||||
### Pantheon 桌面之旅
|
||||
|
||||
乍一看,Pantheon 桌面看起来有点像 Cinnamon、Budgie 或 GNOME 3 的经典模式。但是,Pantheon 最令人兴奋的功能是极小的接触。它在你很少注意到的地方都表现出色,直到有一天这里成为了你一天都会看的地方,并且会意识到它的工作方式确实改善了你的生活质量,更不用说让你过得愉快多了。
|
||||
|
||||
最明显的例子是“文件名高亮”。几十年来,Mac OS 一直有一个广受欢迎的功能,你可以高亮显示重要文件的名称。人们使用此功能作为快速视觉指示器,来告诉自己哪个文件是这几个的“最佳”版本,或者哪个文件应该发送给朋友,或者哪个文件仍然需要处理。它们可以是任意颜色,可以表示用户想要的任何含义。最重要的是,它是引人注目的视觉元数据。
|
||||
|
||||
从 Mac OS 切换过来用户往往会在 GNOME 和 KDE 以及 Linux 提供的其它桌面里怀念这个功能。Pantheon 悄悄地随手解决了这个问题。
|
||||
|
||||
![A highlighted file in the Pantheon desktop][5]
|
||||
|
||||
当然,那只是其中一个例子。Pantheon 有很多你直到用才会想到的小功能。
|
||||
|
||||
桌面精致而吸引人,有所有其他很多桌面缺少的直观组件。在许多方面,它充分吸取了其他桌面好的想法,并避免实现多余的东西。
|
||||
|
||||
![Pantheon desktop on Elementary OS][6]
|
||||
|
||||
### 自定义 Pantheon 桌面
|
||||
|
||||
Pantheon 桌面表达了如何操作计算机的清晰愿景。这种设计的“问题”(至少在开源之外)是,一个人的偏好可能无法满足另一个人的效率。
|
||||
|
||||
但它是开源的。它可以更改,任何不能改变的东西都可以被丢弃。Pantheon 绝对是针对特定用户群的桌面,但是即使对于那些对桌面应该如何工作抱有自己期望的人,Pantheon 也会比初看上去更加灵活。许多内置设计都具有替代选项,当你无法根据自己的喜好进行调整时,你可以轻松选择其他应用。主题引擎可确保你的替换应用看起来与桌面的其它部分和谐一致,而通常的 Linux 系统兼容性可确保你选择的所有应用都能按预期相互配合。
|
||||
|
||||
![Which one is the guest?][7]
|
||||
|
||||
这些替代品,可使你事半功倍。
|
||||
|
||||
### 受欢迎的补充
|
||||
|
||||
撇开这个桌面的词源不说,此桌面确实是许多 Linux 用户祈祷的答案(LCTT 译注:Pantheon 的意思是“万神庙”)。无论它是否是你的风格,Pantheon 桌面都是 Linux 用户体验中重要且受欢迎的补充。自己尝试一下,看看它是否是你一直期待的。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/12/pantheon-linux-desktop
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming)
|
||||
[2]: https://elementary.io/
|
||||
[3]: http://elementary.io
|
||||
[4]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization
|
||||
[5]: https://opensource.com/sites/default/files/uploads/advent-pantheon-highlight.jpg (A highlighted file in the Pantheon desktop)
|
||||
[6]: https://opensource.com/sites/default/files/uploads/advent-pantheon.jpg (Pantheon desktop on Elementary OS)
|
||||
[7]: https://opensource.com/sites/default/files/uploads/advent-pantheon-pcmanfm.jpg (Which one is the guest?)
|
@ -0,0 +1,225 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (lxbwolf)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11663-1.html)
|
||||
[#]: subject: (6 Ways to Send Email from the Linux Command Line)
|
||||
[#]: via: (https://www.2daygeek.com/6-ways-to-send-email-from-the-linux-command-line/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
Linux 命令行发送邮件的 5 种方法
|
||||
======
|
||||
|
||||
当你需要在 shell 脚本中创建邮件时,就需要用到命令行发送邮件的知识。Linux 中有很多命令可以实现发送邮件。本教程中包含了最流行的 5 个命令行邮件客户端,你可以选择其中一个。这 5 个命令分别是:
|
||||
|
||||
* `mail` / `mailx`
|
||||
* `mutt`
|
||||
* `mpack`
|
||||
* `sendmail`
|
||||
* `ssmtp`
|
||||
|
||||
### 工作原理
|
||||
|
||||
我先从整体上来解释下 Linux 中邮件命令怎么把邮件传递给收件人的。邮件命令撰写邮件并发送给一个本地邮件传输代理(MTA,如 sendmail、Postfix)。邮件服务器和远程邮件服务器之间通信以实际发送和接收邮件。下面的流程可以看得更详细。
|
||||
|
||||
![](https://www.2daygeek.com/wp-content/uploads/2019/12/smtp-simple-mail-transfer-protocol.png)
|
||||
|
||||
### 1) 如何在 Linux 上安装 mail/mailx 命令
|
||||
|
||||
`mail` 命令是 Linux 终端发送邮件用的最多的命令。`mailx` 是 `mail` 命令的更新版本,基于 Berkeley Mail 8.1,意在提供 POSIX `mailx` 命令的功能,并支持 MIME、IMAP、POP3、SMTP 和 S/MIME 扩展。mailx 在某些交互特性上更加强大,如缓冲邮件消息、垃圾邮件评分和过滤等。在 Linux 发行版上,`mail` 命令是 `mailx` 命令的软链接。可以运行下面的命令从官方发行版仓库安装 `mail` 命令。
|
||||
|
||||
对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或 [APT 命令][4] 安装 mailutils。
|
||||
|
||||
```
|
||||
$ sudo apt-get install mailutils
|
||||
```
|
||||
|
||||
对于 RHEL/CentOS 系统,使用 [YUM 命令][5] 安装 mailx。
|
||||
|
||||
```
|
||||
$ sudo yum install mailx
|
||||
```
|
||||
|
||||
对于 Fedora 系统,使用 [DNF 命令][6] 安装 mailx。
|
||||
|
||||
```
|
||||
$ sudo dnf install mailx
|
||||
```
|
||||
|
||||
#### 1a) 如何在 Linux 上使用 mail 命令发送邮件
|
||||
|
||||
`mail` 命令简单易用。如果你不需要发送附件,使用下面的 `mail` 命令格式就可以发送邮件了:
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mail -s "Subject" 2daygeek@gmail.com
|
||||
```
|
||||
|
||||
如果你要发送附件,使用下面的 `mail` 命令格式:
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mail -a test1.txt -s "Subject" 2daygeek@gmail.com
|
||||
```
|
||||
|
||||
- `-a`:用于在基于 Red Hat 的系统上添加附件。
|
||||
- `-A`:用于在基于 Debian 的系统上添加附件。
|
||||
- `-s`:指定消息标题。
|
||||
|
||||
### 2) 如何在 Linux 上安装 mutt 命令
|
||||
|
||||
`mutt` 是另一个很受欢迎的在 Linux 终端发送邮件的命令。`mutt` 是一个小而强大的基于文本的程序,用来在 unix 操作系统下阅读和发送电子邮件,并支持彩色终端、MIME、OpenPGP 和按邮件线索排序的模式。可以运行下面的命令从官方发行版仓库安装 `mutt` 命令。
|
||||
|
||||
对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或 [APT 命令][4] 安装 mutt。
|
||||
|
||||
```
|
||||
$ sudo apt-get install mutt
|
||||
```
|
||||
|
||||
对于 RHEL/CentOS 系统,使用 [YUM 命令][5] 安装 mutt。
|
||||
|
||||
```
|
||||
$ sudo yum install mutt
|
||||
```
|
||||
|
||||
对于 Fedora 系统,使用 [DNF 命令][6] 安装 mutt。
|
||||
|
||||
```
|
||||
$ sudo dnf install mutt
|
||||
```
|
||||
|
||||
#### 2b) 如何在 Linux 上使用 mutt 命令发送邮件
|
||||
|
||||
`mutt` 一样简单易用。如果你不需要发送附件,使用下面的 `mutt` 命令格式就可以发送邮件了:
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mutt -s "Subject" 2daygeek@gmail.com
|
||||
```
|
||||
|
||||
如果你要发送附件,使用下面的 `mutt` 命令格式:
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mutt -s "Subject" 2daygeek@gmail.com -a test1.txt
|
||||
```
|
||||
|
||||
### 3) 如何在 Linux 上安装 mpack 命令
|
||||
|
||||
`mpack` 是另一个很受欢迎的在 Linux 终端上发送邮件的命令。`mpack` 程序会在一个或多个 MIME 消息中对命名的文件进行编码。编码后的消息被发送到一个或多个收件人。可以运行下面的命令从官方发行版仓库安装 `mpack` 命令。
|
||||
|
||||
对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或 [APT 命令][4] 安装 mpack。
|
||||
|
||||
```
|
||||
$ sudo apt-get install mpack
|
||||
```
|
||||
|
||||
对于 RHEL/CentOS 系统,使用 [YUM 命令][5] 安装 mpack。
|
||||
|
||||
```
|
||||
$ sudo yum install mpack
|
||||
```
|
||||
|
||||
对于 Fedora 系统,使用 [DNF 命令][6] 安装 mpack。
|
||||
|
||||
```
|
||||
$ sudo dnf install mpack
|
||||
```
|
||||
|
||||
#### 3a) 如何在 Linux 上使用 mpack 命令发送邮件
|
||||
|
||||
`mpack` 同样简单易用。如果你不需要发送附件,使用下面的 `mpack` 命令格式就可以发送邮件了:
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mpack -s "Subject" 2daygeek@gmail.com
|
||||
```
|
||||
|
||||
如果你要发送附件,使用下面的 mpack 命令格式:
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mpack -s "Subject" 2daygeek@gmail.com -a test1.txt
|
||||
```
|
||||
|
||||
### 4) 如何在 Linux 上安装 sendmail 命令
|
||||
|
||||
sendmail 是一个上广泛使用的通用 SMTP 服务器,你也可以从命令行用 `sendmail` 发邮件。可以运行下面的命令从官方发行版仓库安装 `sendmail` 命令。
|
||||
|
||||
对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或 [APT 命令][4]安装 sendmail。
|
||||
|
||||
```
|
||||
$ sudo apt-get install sendmail
|
||||
```
|
||||
|
||||
对于 RHEL/CentOS 系统,使用 [YUM 命令][5] 安装 sendmail。
|
||||
|
||||
```
|
||||
$ sudo yum install sendmail
|
||||
```
|
||||
|
||||
对于 Fedora 系统,使用 [DNF 命令][6] 安装 sendmail。
|
||||
|
||||
```
|
||||
$ sudo dnf install sendmail
|
||||
```
|
||||
|
||||
#### 4a) 如何在 Linux 上使用 sendmail 命令发送邮件
|
||||
|
||||
`sendmail` 同样简单易用。使用下面的 `sendmail` 命令发送邮件。
|
||||
|
||||
```
|
||||
$ echo -e "Subject: Test Mail\nThis is the mail body" > /tmp/send-mail.txt
|
||||
```
|
||||
|
||||
```
|
||||
$ sendmail 2daygeek@gmail.com < send-mail.txt
|
||||
```
|
||||
|
||||
### 5) 如何在 Linux 上安装 ssmtp 命令
|
||||
|
||||
`ssmtp` 是类似 `sendmail` 的一个只发送不接收的工具,可以把邮件从本地计算机传递到配置好的 邮件主机(mailhub)。用户可以在 Linux 命令行用 `ssmtp` 把邮件发送到 SMTP 服务器。可以运行下面的命令从官方发行版仓库安装 `ssmtp` 命令。
|
||||
|
||||
对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或 [APT 命令][4]安装 ssmtp。
|
||||
|
||||
```
|
||||
$ sudo apt-get install ssmtp
|
||||
```
|
||||
|
||||
对于 RHEL/CentOS 系统,使用 [YUM 命令][5] 安装 ssmtp。
|
||||
|
||||
```
|
||||
$ sudo yum install ssmtp
|
||||
```
|
||||
|
||||
对于 Fedora 系统,使用 [DNF 命令][6] 安装 ssmtp。
|
||||
|
||||
```
|
||||
$ sudo dnf install ssmtp
|
||||
```
|
||||
|
||||
### 5a) 如何在 Linux 上使用 ssmtp 命令发送邮件
|
||||
|
||||
`ssmtp` 同样简单易用。使用下面的 `ssmtp` 命令格式发送邮件。
|
||||
|
||||
```
|
||||
$ echo -e "Subject: Test Mail\nThis is the mail body" > /tmp/ssmtp-mail.txt
|
||||
```
|
||||
|
||||
```
|
||||
$ ssmtp 2daygeek@gmail.com < /tmp/ssmtp-mail.txt
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/6-ways-to-send-email-from-the-linux-command-line/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[2]: https://www.2daygeek.com/wp-content/uploads/2019/12/smtp-simple-mail-transfer-protocol.png
|
||||
[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/
|
||||
[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/
|
||||
[5]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
|
||||
[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/
|
@ -0,0 +1,77 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (5G in 2020: Still just a private party)
|
||||
[#]: via: (https://www.networkworld.com/article/3488563/5g-in-2020-still-just-a-private-party.html)
|
||||
[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/)
|
||||
|
||||
5G in 2020: Still just a private party
|
||||
======
|
||||
|
||||
Vertigo3D / Getty Images
|
||||
|
||||
To hear the major mobile carriers talk about it, [5G][1] is here. They’ve deployed it, it works, and it’s ready to start changing the world just about right away, with ultra-fast connectivity, low latency and a dramatically improved ability to handle huge numbers of different connections at once.
|
||||
|
||||
Eventually, that will all be true – but, according to experts in the field, it isn’t yet, and most of it won’t take place within the coming calendar year. The 3GPP standards that will underpin all new-radio 5G technology are still not yet finalized, although that is expected to happen in early 2020, which means the much-touted 5G deployments in the U.S. are based partially on pre-standard technology.
|
||||
|
||||
[[Get regularly scheduled insights by signing up for Network World newsletters.]][2]
|
||||
|
||||
Those deployments are also, at this point, quite limited in size, confined to a few major cities, and only covering centrally located intersections and occasional landmarks. It’s worth noting, though, that the parts of the 5G standard that work over some of the same frequencies as existing LTE have been finalized.
|
||||
|
||||
[][3]
|
||||
|
||||
BrandPost Sponsored by HPE
|
||||
|
||||
[Take the Intelligent Route with Consumption-Based Storage][3]
|
||||
|
||||
Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency.
|
||||
|
||||
Babak Beheshti, a member of the IEEE’s board of directors, said that the main way 5G will make a mark in 2020 will be in private deployments. A company can use pre-standard versions of 5G to create very fast, low-latency networks within its own facilities. Vendors like Ericsson and Nokia are already getting ready to sell the requisite equipment, and a private 5G network has a number of potential upsides, thanks in part to it being based on existing carrier technology.
|
||||
|
||||
“Because of its inherent privacy and security, in that sense, it’ll provide wireless access to employees at a much more secure level,” he said.
|
||||
|
||||
Beheshti also noted that there are potential downsides to the use of private 5G – including cost and the fact that it will require a fairly dense deployment of access points, given its use of comparatively high-frequency radio waves.
|
||||
|
||||
According to Forrester Research vice president Glenn O’Donnell, another potential issue is power consumption – compared to a [Wi-Fi 6][4] network of similar capacity, at least – but that’s an arguable point, and both technologies will be competitive for this type of deployment.
|
||||
|
||||
“This is one of the many holy wars we’ve seen in technology,” he said. “You’ll get people who fall into one camp or the other – a lot of it, unfortunately, is going to come down to who’s marketing better.”
|
||||
|
||||
Still, it seems clear that there’s a potential market there in the enterprise sector for a fast, low-latency network that’s also highly secure. O’Donnell said that the manufacturing, warehousing and logistics verticals might be particularly interested in private 5G, given the networking needs created by IoT and related developments and a lesser incidence of highly sophisticated Wi-Fi implementations.
|
||||
|
||||
Beheshti concurred, saying that a relatively green field makes the most sense for private 5G deployment.
|
||||
|
||||
“Given the expenditure involved, where it would really provide most ROI is for companies that have no private wireless or very little private wireless setup or infrastructure,” he said.
|
||||
|
||||
Widespread carrier-based implementation of 5G technology, however, is unlikely to happen over the course of 2020, and a big part of the reason why is that the devices on the market that are compatible with 5G networks are slim to non-existent.
|
||||
|
||||
According to O’Donnell, software-defined 5G radios are present on some of the latest Samsung phones and a few handsets made in China, and they’re likely capable of being reconfigured with OTA updates to mesh with any final standard for the millimeter-wave technology that provides 5G’s most impressive connection speeds. Yet that’s not a guarantee.
|
||||
|
||||
“If a new band opened up that nobody foresaw as a possibility, that could cause hiccups,” he said.
|
||||
|
||||
It’s easy to understand the reason behind all the hype. The mobile carriers are eager to tout their cutting-edge technology, and full-fledged 5G will be an undeniably impressive achievement. It will enable a huge range of new wireless applications, and improve overall connectivity for just about every user. But the fact remains that it’s not going to do all that in 2020, and, beyond the limited use case for private implementations of the technology, 5G isn’t something that enterprise users will need to concern themselves with too heavily in the coming year.
|
||||
|
||||
“I fully believe 5G is going to be transformative, but it needs to be built out,” said O’Donnell. “This is going to take time and a lot of money.”
|
||||
|
||||
Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3488563/5g-in-2020-still-just-a-private-party.html
|
||||
|
||||
作者:[Jon Gold][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Jon-Gold/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html
|
||||
[2]: https://www.networkworld.com/newsletters/signup.html
|
||||
[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
|
||||
[4]: https://www.networkworld.com/article/3356838/how-to-determine-if-wi-fi-6-is-right-for-you.html
|
||||
[5]: https://www.facebook.com/NetworkWorld/
|
||||
[6]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,132 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Data centers in 2020: Automation, cheaper memory)
|
||||
[#]: via: (https://www.networkworld.com/article/3487684/data-centers-in-2020-automation-cheaper-memory.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
Data centers in 2020: Automation, cheaper memory
|
||||
======
|
||||
As data centers grow in 2020, enterprises will refine the balance between on-premises and cloud resources, adopt AI on servers and try to manage data sprawl effectively.
|
||||
[Arthur Ogleznev / Unsplash][1] [(CC0)][2]
|
||||
|
||||
It’s that time of year again when those of us in the press make our annual prognostications for the coming year. Some things we saw coming; the rise of the cloud and the advance of SSD. Others, like the return of many cloud migrations to on-premises or the roaring comeback of AMD, went right by us. We do our best but occasionally there are surprises.
|
||||
|
||||
So with that, let’s take a peek into the always cloudy (no pun intended) crystal ball and make 10 data-center-oriented predictions.
|
||||
|
||||
### IoT spawns data-center growth in urban areas
|
||||
|
||||
This isn’t a hard prediction to make since it’s already happening. For the longest time, [data centers][3] were placed in the middle of nowhere near renewable energy (usually hydro), but need is going to force more expansion in major metro areas. [IoT][3] will be one driver but so will the increasing use of data center providers like Equinix and DRT as interconnection providers.
|
||||
|
||||
[][4]
|
||||
|
||||
BrandPost Sponsored by HPE
|
||||
|
||||
[Take the Intelligent Route with Consumption-Based Storage][4]
|
||||
|
||||
Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency.
|
||||
|
||||
### Rise of network accelerators
|
||||
|
||||
Big Data and artificial intelligence of all flavors mean enormous amounts of data, and not all of it can be found in one place. Add to it that for now, CPUs are required to power network traffic controllers, thus taking them away from their main job of crunching data.
|
||||
|
||||
So you will see more and more network accelerators coming to market like Mellanox’s [ConnectX line][5] to let CPUs do the job of processing data and accelerators do the job of moving around massive amounts of data faster than is done now.
|
||||
|
||||
### NVMe over fabrics grows
|
||||
|
||||
Non-volatile memory express ([NVMe][6]) is a storage interface, like serial advanced technology attachment (SATA). The downside of SATA is that its legacy is in hard disks so it fails to take full advantage of the speed and parallelism of [SSD][7]s. But early enterprise SSDs had a problem: They could only talk to the physical server in which they were installed. Either that or a server needed storage arrays, which meant network hops, which meant latency.
|
||||
|
||||
NVMe over fabrics ([NVMeoF][8]) is an important advance. It lets an SSD in one server communicate over the network to another drive somewhere else on the network. This direct communication will be vital for improved data movement in enterprise computing and digital transformation.
|
||||
|
||||
* [Backup vs. archive: Why it’s important to know the difference][9]
|
||||
* [How to pick an off-site data-backup method][10]
|
||||
* [Tape vs. disk storage: Why isn’t tape dead yet?][11]
|
||||
* [The correct levels of backup save time, bandwidth, space][12]
|
||||
|
||||
|
||||
|
||||
### Cheaper storage-class memory
|
||||
|
||||
Storage-class memory is memory that goes in a DRAM slot and can function like DRAM but can also function like an SSD. It has near-DRAM-like speed but has storage capabilities, too, effectively turning it into a cache for SSD.
|
||||
|
||||
Intel and Micron were working on SCM together but parted company. Intel released its SCM product, [Optane][13], in May, and Micron came to market in October with QuantX. South Korean memory giant SK Hynix is also working on a SCM product that’s different from the 3D XPoint technology Micron and Intel use as well.
|
||||
|
||||
All of this should do wonders to advance the technology and hopefully bring the price down. Right now a 512GB stick of Optane runs an insane $8,000. Granted, Xeons sell for even more than that, but after a while it becomes prohibitively expensive to assemble a fully decked-out server. Advancement of the technology and competition should lower prices, which will make this class of memory more attractive to enterprises.
|
||||
|
||||
### AI automation on brand-name servers
|
||||
|
||||
All of the server vendors are adding AI to their systems but Oracle is really taking the lead with its autonomous everything, from the hardware through OS and application and middleware stack. HPE, Dell, and Lenovo will continue to make their own advances as well but the hyperscale-server vendors like Inspur and Supermicro will lag because they have only the hardware stack and have done next to nothing in the OS space. They also are lagging in storage, something the big-three server vendors excel at.
|
||||
|
||||
Oracle may not be a top-five server vendor, but no one can ignore what they are doing in the automation space. Expect the other brand name-vendors to provide their own increasing levels of automation.
|
||||
|
||||
### Cloud migrations slow
|
||||
|
||||
Remember when everyone was looking forward to shutting down their data centers entirely and moving to the cloud? So much for that idea. IDC’s latest CloudPulse survey suggests that 85% of enterprises plan to move workload from public to private environments over the next year. And a recent survey by Nutanix found 73% of respondents reported that they are moving some applications off the public cloud and back on-prem. Security was cited as the primary reason.
|
||||
|
||||
And since it’s doubtful security will ever be good enough for some companies and some data, it seems the mad rush to the cloud will likely slow a little as people become more picky about what they put in the cloud and what they keep behind their firewall.
|
||||
|
||||
### Data sprawl, Part 1
|
||||
|
||||
Most data is not where it should be, according to IDC. Only 10% of corporate data is “hot” – data that is repeatedly accessed and used – while 30% is “warm ” – used semi-regularly – and the other 60% belongs in cold storage where it is rarely if ever accessed.
|
||||
|
||||
But the problem is that data is scattered all over the place and often in the wrong tier. Many storage firms have focused on deduplication but not on storage tiers. A startup called Spectra Logic is targeting that very problem, and I suspect it won’t be the last firm to make such an effort. If it really takes off, I expect HPE and Dell to lock horns over the company, too.
|
||||
|
||||
### Data sprawl, Part 2
|
||||
|
||||
IDC [predicts][14] the total global data haul to weigh in at 175 zettabytes by 2025, and we are already at 32ZB of data, much of it useless. There was a time when data warehousing ruled that data was sorted and processed and stored as something useful. Now people fill data lakes with an endless supply of data from a growing number of sources, like social media and IoT.
|
||||
|
||||
Sooner or later, something will have to give. People will take a look at petabytes of data-lake junk and say enough is enough and start to become considerably more picky about what they store. They will question the rationale behind spending a fortune on hard disks and storage arrays to store vast quantities of unused and valueless data. The pendulum will swing back to the data-warehouse model of keeping usable data. It has to or people will be overwhelmed.
|
||||
|
||||
### More servers with a mix of processors
|
||||
|
||||
Ten years ago, it didn’t matter if your definition of a server was a single-socket Xeon tower sitting under a desk or four-socket rack-mount in a seven-foot cabinet, they were defined by an x86 processor. But now we are seeing more server designs with on-board GPUs, Arm processors, AI accelerators, and network accelerators.
|
||||
|
||||
This will require some changes in server designs. First, liquid cooling will become more necessary with this multitude of chips running faster and hotter and in an enclosed space. Second, the software stack will need to be more robust to handle all these chips, requiring some work on the part of Microsoft and the Linux distros.
|
||||
|
||||
### IT workload will change
|
||||
|
||||
Don’t think that automation means you can sit around playing games on your iPhone. Thanks to their ever-evolving systems, IT pros will have a bunch of new headaches including:
|
||||
|
||||
* Combating shadow IT
|
||||
* Addressing digital transformation
|
||||
* Developing AI strategies to keep up with competitors
|
||||
* Reacting appropriately to the fallout from new AI strategies
|
||||
* Maintaining security governance across the company
|
||||
* Handling an increasing inflow of data and figuring out what to do with it
|
||||
* Responding faster than ever to customers and to company reputation on social media
|
||||
|
||||
|
||||
|
||||
Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3487684/data-centers-in-2020-automation-cheaper-memory.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://unsplash.com/photos/rWDumHFt8E8
|
||||
[2]: https://creativecommons.org/publicdomain/zero/1.0/
|
||||
[3]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html
|
||||
[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
|
||||
[5]: https://www.networkworld.com/article/3433924/mellanox-introduces-smartnics-to-eliminate-network-load-on-cpus.html
|
||||
[6]: https://www.networkworld.com/article/3280991/what-is-nvme-and-how-is-it-changing-enterprise-storage.html
|
||||
[7]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html
|
||||
[8]: https://www.networkworld.com/article/3394296/nvme-over-fabrics-creates-data-center-storage-disruption.html
|
||||
[9]: https://www.networkworld.com/article/3285652/storage/backup-vs-archive-why-its-important-to-know-the-difference.html
|
||||
[10]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html
|
||||
[11]: https://www.networkworld.com/article/3315156/storage/tape-vs-disk-storage-why-isnt-tape-dead-yet.html
|
||||
[12]: https://www.networkworld.com/article/3302804/storage/the-correct-levels-of-backup-save-time-bandwidth-space.html
|
||||
[13]: https://www.networkworld.com/article/3279271/intel-launches-optane-the-go-between-for-memory-and-storage.html
|
||||
[14]: https://www.networkworld.com/article/3325397/idc-expect-175-zettabytes-of-data-worldwide-by-2025.html
|
||||
[15]: https://www.facebook.com/NetworkWorld/
|
||||
[16]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,87 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Google Cloud bare-metal initiative targets migrating legacy apps from on-prem)
|
||||
[#]: via: (https://www.networkworld.com/article/3487626/google-cloud-bare-metal-initiative-targets-migrating-legacy-apps-from-on-prem.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
Google Cloud bare-metal initiative targets migrating legacy apps from on-prem
|
||||
======
|
||||
Google Cloud now offers Google Bare Metal Solution, a service that supplies hardware in the cloud for enterprises that want full control of the entire stack from operating system on up to their most important legacy apps.
|
||||
Google
|
||||
|
||||
In the cloud-services market, [bare metal offerings][1] have lagged behind virtualized ones, mostly because the use of the cloud for things like elastic apps and developer environments are better suited to instances with a native operating system.
|
||||
|
||||
The term “bare metal” simply means no software of any kind, not even a [hypervisor][2]. Customers provide their own operating environments, and the provider offers nothing more than CPUs, memory, and storage. Up to now, IBM has led the charge with bare-metal services because SoftLayer, the major data-center provider it acquired in 2014, was heavily involved in that business.
|
||||
|
||||
Now Google Cloud is going after that market, especially targeting “lift and shift” of an entire operating environment – OS, hypervisor, apps, and data -- from on-premises data centers to the cloud.
|
||||
|
||||
[][3]
|
||||
|
||||
BrandPost Sponsored by HPE
|
||||
|
||||
[HPE Synergy For Dummies][3]
|
||||
|
||||
Here’s how IT can provide an anytime, anywhere, any workload infrastructure.
|
||||
|
||||
Google [recently announced][4] the Google Bare Metal Solution for legacy applications that must run on dedicated hardware and have strict hardware certification requirements, as well as dedicated, low-latency and highly resilient interconnects, and connections to all native Google Cloud services.
|
||||
|
||||
Bare Metal Solution uses OEM hardware that is certified for many ISV software applications as well as custom-built applications, with Oracle Database the one commercial software product specifically named. The hardware is a bit of a mystery, since Google, like most hyperscale data-center operators, uses off-brand hardware from Gigabyte, Inspur, and Supermicro, but it’s usually hardware from HPE, Dell, and Lenovo that gets those kinds of certifications. Not that the white-box brands don’t have it, but it’s usually not as much of a priority for them.
|
||||
|
||||
These hardware configurations are offered as a subscription, billed monthly with a preferred term length of 36 months, which means they want you to stick around a while. There are no data ingress and egress charges between Bare Metal Solution and Google Cloud in the same region, however for now, Bare Metal Solutions are only available in East Coast data centers.
|
||||
|
||||
Moving an Oracle database to the cloud isn’t trivial. If the database stretches into the petabytes, that could get very expensive. Not to mention Oracle is doing its darnedest to keep that business by making it easier for customers to migrate their databases into Oracle’s cloud infrastructure.
|
||||
|
||||
[[Get regularly scheduled insights by signing up for Network World newsletters.]][5]
|
||||
|
||||
Storage comes in 1TB increments, either a mix of HDD and SSD or all-flash. As for the rest of the configurations:
|
||||
|
||||
Dual-socket x86 systems
|
||||
|
||||
* 16 core with 384 GB DRAM
|
||||
* 24 core with 768 GB DRAM
|
||||
* 56 core with 1536 GB DRAM
|
||||
|
||||
|
||||
|
||||
Quad-socket x86 systems
|
||||
|
||||
* 56 core with 1536 GB DRAM
|
||||
* 112 core with 3072 GB DRAM
|
||||
|
||||
|
||||
|
||||
Other benefits of the service are:
|
||||
|
||||
* End-to-end infrastructure management such as compute, storage and networking, as well as fully managed and monitored environments such as power, cooling and facilities.
|
||||
* Support for infrastructure, including defined SLAs for initial response; 24X7 coverage for all Priority 1 and 2 issues; unified billing across Google Cloud and Bare Metal Solution.
|
||||
* Enterprise-grade SLAs for hardware uptime and interconnect availability.
|
||||
|
||||
|
||||
|
||||
Bare metal has its appeal but caveats, too. The allure of the cloud is its bursty elasticity. Many on-prem apps are used to running all out for much if not all of the day. In a cloud setting that can get expensive in a hurry, so it’s up to IT staff to decide if it’s a good idea to migrate an Oracle database to the cloud. If it's serving up reads and writes constantly, any savings from moving it off premises will be immediately offset by paying to run it at high utilization in the cloud.
|
||||
|
||||
Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3487626/google-cloud-bare-metal-initiative-targets-migrating-legacy-apps-from-on-prem.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/article/3261113/why-a-bare-metal-cloud-provider-might-be-just-what-you-need.html
|
||||
[2]: https://www.networkworld.com/article/3243262/what-is-a-hypervisor.html
|
||||
[3]: https://www.networkworld.com/article/3399618/hpe-synergy-for-dummies.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE19718&utm_content=sidebar (HPE Synergy For Dummies)
|
||||
[4]: https://cloud.google.com/blog/products/gcp/bare-metal-solution-enabling-specialized-workloads-in-google-cloud
|
||||
[5]: https://www.networkworld.com/newsletters/signup.html
|
||||
[6]: https://www.facebook.com/NetworkWorld/
|
||||
[7]: https://www.linkedin.com/company/network-world
|
@ -1,241 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (14 SCP Command Examples to Securely Transfer Files in Linux)
|
||||
[#]: via: (https://www.linuxtechi.com/scp-command-examples-in-linux/)
|
||||
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
|
||||
|
||||
14 SCP Command Examples to Securely Transfer Files in Linux
|
||||
======
|
||||
|
||||
**SCP** (Secure Copy) is command line tool in Linux and Unix like systems which is used to transfer files and directories across the systems securely over the network. When we use scp command to copy files and directories from our local system to remote system then in the backend it makes **ssh connection** to remote system. In other words, we can say scp uses the same **SSH security mechanism** in the backend, it needs either password or keys for authentication.
|
||||
|
||||
[![scp-command-examples-linux][1]][2]
|
||||
|
||||
In this tutorial we will discuss 14 useful Linux scp command examples.
|
||||
|
||||
**Syntax of scp command:**
|
||||
|
||||
### scp <options> <files_or_directories> [root@linuxtechi][3]_host:/<folder>
|
||||
|
||||
### scp <options> [root@linuxtechi][3]_host:/files <folder_local_system>
|
||||
|
||||
First syntax of scp command demonstrate how to copy files or directories from local system to target host under the specific folder.
|
||||
|
||||
Second syntax of scp command demonstrate how files from target host is copied into local system.
|
||||
|
||||
Some of the most widely used options in scp command are listed below,
|
||||
|
||||
* -C Enable Compression
|
||||
* -i identity File or private key
|
||||
* -l limit the bandwidth while copying
|
||||
* -P ssh port number of target host
|
||||
* -p Preserves permissions, modes and access time of files while copying
|
||||
* -q Suppress warning message of SSH
|
||||
* -r Copy files and directories recursively
|
||||
* -v verbose output
|
||||
|
||||
|
||||
|
||||
Let’s jump into the examples now!!!!
|
||||
|
||||
###### Example:1) Copy a file from local system to remote system using scp
|
||||
|
||||
Let’s assume we want to copy jdk rpm package from our local Linux system to remote system (172.20.10.8) using scp command, use the following command,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp jdk-linux-x64_bin.rpm root@linuxtechi:/opt
|
||||
root@linuxtechi's password:
|
||||
jdk-linux-x64_bin.rpm 100% 10MB 27.1MB/s 00:00
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
Above command will copy jdk rpm package file to remote system under /opt folder.
|
||||
|
||||
###### Example:2) Copy a file from remote System to local system using scp
|
||||
|
||||
Let’s suppose we want to copy a file from remote system to our local system under the /tmp folder, execute the following scp command,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp root@linuxtechi:/root/Technical-Doc-RHS.odt /tmp
|
||||
root@linuxtechi's password:
|
||||
Technical-Doc-RHS.odt 100% 1109KB 31.8MB/s 00:00
|
||||
[root@linuxtechi ~]$ ls -l /tmp/Technical-Doc-RHS.odt
|
||||
-rwx------. 1 pkumar pkumar 1135521 Oct 19 11:12 /tmp/Technical-Doc-RHS.odt
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
###### Example:3) Verbose Output while transferring files using scp (-v)
|
||||
|
||||
In scp command, we can enable the verbose output using -v option, using verbose output we can easily find what exactly is happening in the background. This becomes very useful in **debugging connection**, **authentication** and **configuration problems**.
|
||||
|
||||
```
|
||||
root@linuxtechi ~]$ scp -v jdk-linux-x64_bin.rpm root@linuxtechi:/opt
|
||||
Executing: program /usr/bin/ssh host 172.20.10.8, user root, command scp -v -t /opt
|
||||
OpenSSH_7.8p1, OpenSSL 1.1.1 FIPS 11 Sep 2018
|
||||
debug1: Reading configuration data /etc/ssh/ssh_config
|
||||
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
|
||||
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
|
||||
debug1: /etc/ssh/ssh_config.d/05-redhat.conf line 8: Applying options for *
|
||||
debug1: Connecting to 172.20.10.8 [172.20.10.8] port 22.
|
||||
debug1: Connection established.
|
||||
…………
|
||||
debug1: Next authentication method: password
|
||||
root@linuxtechi's password:
|
||||
```
|
||||
|
||||
###### Example:4) Transfer multiple files to remote system
|
||||
|
||||
Multiple files can be copied / transferred to remote system using scp command in one go, in scp command specify the multiple files separated by space, example is shown below
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp install.txt index.html jdk-linux-x64_bin.rpm root@linuxtechi:/mnt
|
||||
root@linuxtechi's password:
|
||||
install.txt 100% 0 0.0KB/s 00:00
|
||||
index.html 100% 85KB 7.2MB/s 00:00
|
||||
jdk-linux-x64_bin.rpm 100% 10MB 25.3MB/s 00:00
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
###### Example:5) Transfer files across two remote hosts
|
||||
|
||||
Using scp command we can copy files and directories between two remote hosts, let’s suppose we have a local Linux system which can connect to two remote Linux systems, so from my local linux system I can use scp command to copy files across these two systems,
|
||||
|
||||
Syntax:
|
||||
|
||||
### scp [root@linuxtechi][3]_hosts1:/<files_to_transfer> [root@linuxtechi][3]_host2:/<folder>
|
||||
|
||||
Example is shown below,
|
||||
|
||||
```
|
||||
# scp root@linuxtechi:~/backup-Oct.zip root@linuxtechi:/tmp
|
||||
# ssh root@linuxtechi "ls -l /tmp/backup-Oct.zip"
|
||||
-rwx------. 1 root root 747438080 Oct 19 12:02 /tmp/backup-Oct.zip
|
||||
```
|
||||
|
||||
###### Example:6) Copy files and directories recursively (-r)
|
||||
|
||||
Use -r option in scp command to recursively copy the entire directory from one system to another, example is shown below,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -r Downloads root@linuxtechi:/opt
|
||||
```
|
||||
|
||||
Use below command to verify whether Download folder is copied to remote system or not,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ ssh root@linuxtechi "ls -ld /opt/Downloads"
|
||||
drwxr-xr-x. 2 root root 75 Oct 19 12:10 /opt/Downloads
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
###### Example:7) Increase transfer speed by enabling compression (-C)
|
||||
|
||||
In scp command, we can increase the transfer speed by enabling the compression using -C option, it will automatically enable compression at source and decompression at destination host.
|
||||
|
||||
```
|
||||
root@linuxtechi ~]$ scp -r -C Downloads root@linuxtechi:/mnt
|
||||
```
|
||||
|
||||
In the above example we are transferring the Download directory with compression enabled.
|
||||
|
||||
###### Example:8) Limit bandwidth while copying ( -l )
|
||||
|
||||
Use ‘-l’ option in scp command to put limit on bandwidth usage while copying. Bandwidth is specified in Kbit/s, example is shown below,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -l 500 jdk-linux-x64_bin.rpm root@linuxtechi:/var
|
||||
```
|
||||
|
||||
###### Example:9) Specify different ssh port while scp ( -P)
|
||||
|
||||
There can be some scenario where ssh port is changed on destination host, so while using scp command we can specify the ssh port number using ‘-P’ option.
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -P 2022 jdk-linux-x64_bin.rpm root@linuxtechi:/var
|
||||
```
|
||||
|
||||
In above example, ssh port for remote host is “2022”
|
||||
|
||||
###### Example:10) Preserves permissions, modes and access time of files while copying (-p)
|
||||
|
||||
Use “-p” option in scp command to preserve permissions, access time and modes while copying from source to destination
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -p jdk-linux-x64_bin.rpm root@linuxtechi:/var/tmp
|
||||
jdk-linux-x64_bin.rpm 100% 10MB 13.5MB/s 00:00
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
###### Example:11) Transferring files in quiet mode ( -q) in scp
|
||||
|
||||
Use ‘-q’ option in scp command to suppress transfer progress, warning and diagnostic messages of ssh. Example is shown below,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -q -r Downloads root@linuxtechi:/var/tmp
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
###### Example:12) Use Identify file in scp while transferring ( -i )
|
||||
|
||||
In most of the Linux environments, keys-based authentication is preferred. In scp command we specify the identify file or private key file using ‘-i’ option, example is shown below,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -i my_key.pem -r Downloads root@linuxtechi:/root
|
||||
```
|
||||
|
||||
In above example, “my_key.pem” is the identity file or private key file.
|
||||
|
||||
###### Example:13) Use different ‘ssh_config’ file in scp ( -F)
|
||||
|
||||
There are some scenarios where you use different networks to connect to Linux systems, may be some network is behind proxy servers, so in that case we must have different **ssh_config** file.
|
||||
|
||||
Different ssh_config file in scp command is specified via ‘-F’ option, example is shown below
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -F /home/pkumar/new_ssh_config -r Downloads root@linuxtechi:/root
|
||||
root@linuxtechi's password:
|
||||
jdk-linux-x64_bin.rpm 100% 10MB 16.6MB/s 00:00
|
||||
backup-Oct.zip 100% 713MB 41.9MB/s 00:17
|
||||
index.html 100% 85KB 6.6MB/s 00:00
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
###### Example:14) Use Different Cipher in scp command (-c)
|
||||
|
||||
By default, scp uses ‘AES-128’ cipher to encrypt the files. If you want to use another cipher in scp command then use ‘-c’ option followed by cipher name,
|
||||
|
||||
Let’s suppose we want to use ‘3des-cbc’ cipher in scp command while transferring the files, run the following scp command
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# scp -c 3des-cbc -r Downloads root@linuxtechi:/root
|
||||
```
|
||||
|
||||
Use the below command to list ssh and scp ciphers,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# ssh -Q cipher localhost | paste -d , -s -
|
||||
3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,root@linuxtechi,aes128-ctr,aes192-ctr,aes256-ctr,root@linuxtechi,root@linuxtechi,root@linuxtechi
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
That’s all from this tutorial, to get more details about scp command, kindly refer its man page. Please do share your feedback and comments in comments section below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/scp-command-examples-in-linux/
|
||||
|
||||
作者:[Pradeep Kumar][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.linuxtechi.com/author/pradeep/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[2]: https://www.linuxtechi.com/wp-content/uploads/2019/10/scp-command-examples-linux.jpg
|
||||
[3]: https://www.linuxtechi.com/cdn-cgi/l/email-protection
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (lxbwolf)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,65 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Dell XPS 13 7390 Review: The Best Laptop For Desktop Linux Users)
|
||||
[#]: via: (https://www.linux.com/articles/dell-xps-13-7390-review-the-best-laptop-for-desktop-linux-user/)
|
||||
[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/)
|
||||
|
||||
Dell XPS 13 7390 Review: The Best Laptop For Desktop Linux Users
|
||||
======
|
||||
|
||||
[![][1]][2]
|
||||
|
||||
[![][1]][2]
|
||||
|
||||
Gone are the days when we had to do a lot of research and read a lot of reviews to find a machine that would work with the least amount of trouble with the desktop Linux distribution of choice. Today, almost every machine out there can run Linux. The kernel community has done an incredible job with device driver support to make everything work out of the box.
|
||||
|
||||
Still, there are machines that can run Linux, and then there are machines that run Linux. Dell machines fall in the latter category. Five years ago, Barton George started a program within Dell to bring desktop Linux to consumer grade, high-end Dell systems. What started as one machine is now an entire line of high-end laptops and desktops.
|
||||
|
||||
Among these machines, XPS 13 is my favorite. While I need a really powerful desktop to handle my 4K UHD, multicam video production, I also need an ultra-portable laptop that I can bring with me anywhere without having to worry about a bulky backpack and charger. XPS 13 was also my very first laptop, which lasted me more than 7 years. So, yes, there is that nostalgic factor, too.
|
||||
|
||||
Dell updates the XPS line almost every year and the latest [rollout was announced in October][3] (link to video interview). [XPS 13 (7390)][4] is an incremental update to the series, and Dell was kind enough to send me a review unit.
|
||||
|
||||
It is powered by a 6-core, Core i7-10710U CPU. It comes with 16GB of memory and 1TB SSD. At the base frequency of 1.10 GHz, which can boost to 4.1 GHz, this is a great machine for average workloads. It doesn’t have any dedicated GPU, so it’s not meant for gaming or compiling from source for Gentoo Linux or Arch Linux. However, I did manage to run some Steam games on it.
|
||||
|
||||
If you are looking to run your Kubernetes clusters, AI frameworks or Virtual Reality, then there are more powerful machines from the Precision line, which are certified to run Red Hat Enterprise Linux and Ubuntu.
|
||||
|
||||
The machine’s chassis is identical to the previous generation. The bezels remains as thin as they were in the previous generation, still thinner than MacBook and Microsoft’s Surface Pro.
|
||||
|
||||
It has three ports, two of which are USB-C Thunderbolt 3, which can be used to connect to 4K monitors, USB accessories, and high-speed data transfer between machines with peer-to-peer networking.
|
||||
|
||||
It also has a microSD slot. As a video journalist, a slot for an SD card would have been more useful. Heavy users of Raspberry Pis would also love this card.
|
||||
|
||||
It has 4 microphones and an improved camera, which is now located at the top (goodbye, nosecam!).
|
||||
|
||||
XPS 13 (7390) is sleek and slim. At 2.7 lbs, it is certainly comparable to Apple’s MacBook Air. This machine is meant to be your travel companion and for everyday tasks like checking emails, browsing the web, and writing.
|
||||
|
||||
Its 4K UHD screen supports HDR, which means you will be able to enjoy Mandalorian in all its full glory. That said, the on-board speakers are not that great and sound muffled. They are OK for video chats or casual YouTube viewing, but if you want to enjoy the The Witcher later this year, or if you want to enjoy music from Amazon, Apple Music or YouTube Music, you need headphones or external speakers.
|
||||
|
||||
But how much fun can you get out of this machine before you reach for charging cable? It gave me around 7-8 hours of battery life with average workload: browsing the web with a few tabs, just watching a movie or listening to music. Multi-tasking, especially any kind of web activity, will drain the battery. Some fine-tuning on Linux may give you even more life. On Windows 10, I was able to get more than 10 hours!
|
||||
|
||||
As a video journalist who is still doing a fair amount of writing, I really like the keyboard. However, the trackpad is the same story that we have been hearing on desktop Linux for ages: it’s nowhere near the quality on MacBook or Windows machines. Maybe one day. To Dell’s credit, they do release drivers for the trackpad that enhances the experience, but I am not running the stock Ubuntu 18.04 LTS that came with this system. I did a fresh install of Ubuntu 19.10 because Gnome is painfully slow in 18.04. I tried openSUSE Tumbleweed, Zorin OS, elementary OS, Fedora, KDE’s neon and Arch Linux. All worked, although some needed extra effort to run.
|
||||
|
||||
So, who is this system for? It’s certainly for professionals who want a well designed, high-end machine from a brand they can trust. It’s for those who like a MacBook Air, but prefer the desktop Linux ecosystem. It’s for those who want to use Linux for work, instead of working on it to make it work.
|
||||
|
||||
Spending a week with this machine reinforced why I love Dell’s XPS series so much. They are the best Linux laptops out there. And this XPS 13 (7390) packs a punch.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/articles/dell-xps-13-7390-review-the-best-laptop-for-desktop-linux-user/
|
||||
|
||||
作者:[Swapnil Bhartiya][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linux.com/author/swapnil/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.linux.com/wp-content/uploads/2019/12/dell-xps-13-7390-1068x665.jpg (dell-xps-13-7390)
|
||||
[2]: https://www.linux.com/wp-content/uploads/2019/12/dell-xps-13-7390.jpg
|
||||
[3]: https://bartongeorge.io/2019/08/21/please-welcome-the-9th-generation-of-the-xps-13-developer-edition/
|
||||
[4]: https://blog.dell.com/en-us/dells-new-consumer-pc-portfolio-unveiled-ifa-2019/
|
200
sources/tech/20191208 Dynamically scoped variables in Go.md
Normal file
200
sources/tech/20191208 Dynamically scoped variables in Go.md
Normal file
@ -0,0 +1,200 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Dynamically scoped variables in Go)
|
||||
[#]: via: (https://dave.cheney.net/2019/12/08/dynamically-scoped-variables-in-go)
|
||||
[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney)
|
||||
|
||||
Dynamically scoped variables in Go
|
||||
======
|
||||
|
||||
This is a thought experiment in API design. It starts with the classic Go unit testing idiom:
|
||||
|
||||
```
|
||||
func TestOpenFile(t *testing.T) {
|
||||
f, err := os.Open("notfound")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
What’s the problem with this code? The assertion. `if err != nil { ... }` is repetitive and in the case where multiple conditions need to be checked, somewhat error prone if the author of the test uses `t.Error` not `t.Fatal`, eg:
|
||||
|
||||
```
|
||||
f, err := os.Open("notfound")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
f.Close() // boom!
|
||||
```
|
||||
|
||||
What’s the solution? DRY it up, of course, by moving the repetitive assertion logic to a helper:
|
||||
|
||||
```
|
||||
func TestOpenFile(t *testing.T) {
|
||||
f, err := os.Open("notfound")
|
||||
check(t, err)
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
func check(t *testing.T, err error) {
|
||||
if err != nil {
|
||||
t.Helper()
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Using the `check` helper the code is a little cleaner, and clearer, _check the error_, and hopefully the indecision between `t.Error` and `t.Fatal` has been solved. The downside of abstracting the assertion to a helper function is now you need to pass a `testing.T` into _each and every invocation_. Worse, you need to pass a `*testing.T` to everything that needs to call `check`, transitively, just in case.
|
||||
|
||||
This is ok, I guess, but I will make the observation that the `t` variable is only needed _when the assertion fails_ — and even in a testing scenario, most of the time, most of the tests pass, so that means reading, and writing, all these `t`‘s is a constant overhead for the relatively rare occasion that a test fails.
|
||||
|
||||
What about if we did something like this instead?
|
||||
|
||||
```
|
||||
func TestOpenFile(t *testing.T) {
|
||||
f, err := os.Open("notfound")
|
||||
check(err)
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
func check(err error) {
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Yeah, that’ll work, but it has a few problems
|
||||
|
||||
```
|
||||
% go test
|
||||
--- FAIL: TestOpenFile (0.00s)
|
||||
panic: open notfound: no such file or directory [recovered]
|
||||
panic: open notfound: no such file or directory
|
||||
|
||||
goroutine 22 [running]:
|
||||
testing.tRunner.func1(0xc0000b4400)
|
||||
/Users/dfc/go/src/testing/testing.go:874 +0x3a3
|
||||
panic(0x111b040, 0xc0000866f0)
|
||||
/Users/dfc/go/src/runtime/panic.go:679 +0x1b2
|
||||
github.com/pkg/expect_test.check(...)
|
||||
/Users/dfc/src/github.com/pkg/expect/expect_test.go:18
|
||||
github.com/pkg/expect_test.TestOpenFile(0xc0000b4400)
|
||||
/Users/dfc/src/github.com/pkg/expect/expect_test.go:10 +0xa1
|
||||
testing.tRunner(0xc0000b4400, 0x115ac90)
|
||||
/Users/dfc/go/src/testing/testing.go:909 +0xc9
|
||||
created by testing.(*T).Run
|
||||
/Users/dfc/go/src/testing/testing.go:960 +0x350
|
||||
exit status 2
|
||||
```
|
||||
|
||||
Let’s start with the good; we didn’t have to pass a `testing.T` every place we call `check`, the test fails immediately, and we get a nice message in the panic — albeit twice. But _where_ the assertion failed is hard to see. It occurred on `expect_test.go:11` but you’d be forgiven for not knowing that.
|
||||
|
||||
So `panic` isn’t really a good solution, but there’s something in this stack trace that is — can you see it? Here’s a hint, `github.com/pkg/expect_test.TestOpenFile(0xc0000b4400)`.
|
||||
|
||||
`TestOpenFile` has a `t` value, it was passed to it by `tRunner`, so there’s a `testing.T` in memory at address `0xc0000b4400`. What if we could get access to that `t` inside `check`? Then we could use it to call `t.Helper` and `t.Fatal`. Is that possible?
|
||||
|
||||
### Dynamic scoping
|
||||
|
||||
What we want is to be able to access a variable whose declaration is neither global, or local to the function, but somewhere higher in the call stack. This is called _dynamic scoping_. Go doesn’t support dynamic scoping, but it turns out, for restricted cases, we can fake it. I’ll skip to the chase:
|
||||
|
||||
```
|
||||
// getT returns the address of the testing.T passed to testing.tRunner
|
||||
// which called the function which called getT. If testing.tRunner cannot
|
||||
// be located in the stack, say if getT is not called from the main test
|
||||
// goroutine, getT returns nil.
|
||||
func getT() *testing.T {
|
||||
var buf [8192]byte
|
||||
n := runtime.Stack(buf[:], false)
|
||||
sc := bufio.NewScanner(bytes.NewReader(buf[:n]))
|
||||
for sc.Scan() {
|
||||
var p uintptr
|
||||
n, _ := fmt.Sscanf(sc.Text(), "testing.tRunner(%v", &p)
|
||||
if n != 1 {
|
||||
continue
|
||||
}
|
||||
return (*testing.T)(unsafe.Pointer(p))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
```
|
||||
|
||||
We know that each `Test` is called by the `testing` package in its own goroutine (see the stack trace above). The `testing` package launches the test via a function called `tRunner` which takes a `*testing.T` and a `func(*testing.T)` to invoke. Thus we grab a stack trace of the current goroutine, scan through it for the line beginning with `testing.tRunner` — which can only be the `testing` package as `tRunner` is a private function — and parse the address of the first parameter, which is a pointer to a `testing.T`. With a little `unsafe` we convert the raw pointer back to a `*testing.T` and we’re done.
|
||||
|
||||
If the search fails then it is likely that `getT` wasn’t called from a `Test`. This is actually ok because the reason we needed the `*testing.T` was to call `t.Fatal` and the testing package already requires that `t.Fatal` be called from the [main test goroutine][1].
|
||||
|
||||
```
|
||||
import "github.com/pkg/expect"
|
||||
|
||||
func TestOpenFile(t *testing.T) {
|
||||
f, err := os.Open("notfound")
|
||||
expect.Nil(err)
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
Putting it all together we’ve eliminated the assertion boilerplate and possibly made the expectation of the test a little clearer to read, _after opening the file `err` is expected to be nil_.
|
||||
|
||||
### Is this fine?
|
||||
|
||||
At this point you should be asking, _is this fine?_ And the answer is, no, this is not fine. You should be screaming internally at this point. But it’s probably worth introspecting those feelings of revulsion.
|
||||
|
||||
Apart from the inherent fragility of scrobbling around in a goroutine’s call stack, there are some serious design issues:
|
||||
|
||||
1. The `expect.Nil`‘s behaviour now depends on _who called it_. Provided with the same arguments it may have different behaviour depending on where it appears in the call stack — this is unexpected.
|
||||
2. Taken to the extreme dynamic scoping effective brings into the scope of a single function all the variables passed into any function that preceded it. It is a side channel for passing data in to and out of functions that is not explicitly documented in function declaration.
|
||||
|
||||
|
||||
|
||||
Ironically these are precisely the critiques I have of [`context.Context`][2]. I’ll leave it to you to decide if they are justified.
|
||||
|
||||
### A final word
|
||||
|
||||
This is a bad idea, no argument there. This is not a pattern you should ever use in production code. But, this isn’t production code, it’s a test, and perhaps there are different rules that apply to test code. After all, we use mocks, and stubs, and monkey patching, and type assertions, and reflection, and helper functions, and build flags, and global variables, all so we can test our code effectively. None of those, uh, _hacks_ will ever show up in the production code path, so is it really the end of the world?
|
||||
|
||||
If you’ve read this far perhaps you’ll agree with me that as unconventional as this approach is, not having to pass a `*testing.T` into every function that could possibly need to assert something transitively, makes for clearer test code.
|
||||
|
||||
So maybe, in this case, the ends do justify the means.
|
||||
|
||||
* * *
|
||||
|
||||
If you’re interested, I’ve put together a [small assertion library][3] using this pattern. _Caveat emptor_.
|
||||
|
||||
#### Related posts:
|
||||
|
||||
1. [Go, without package scoped variables][4]
|
||||
2. [On declaring variables][5]
|
||||
3. [A whirlwind tour of Go’s runtime environment variables][6]
|
||||
4. [You shouldn’t name your variables after their types for the same reason you wouldn’t name your pets “dog” or “cat”][7]
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://dave.cheney.net/2019/12/08/dynamically-scoped-variables-in-go
|
||||
|
||||
作者:[Dave Cheney][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://dave.cheney.net/author/davecheney
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://golang.org/pkg/testing/#T.FailNow
|
||||
[2]: https://dave.cheney.net/2017/01/26/context-is-for-cancelation
|
||||
[3]: https://github.com/pkg/expect
|
||||
[4]: https://dave.cheney.net/2017/06/11/go-without-package-scoped-variables (Go, without package scoped variables)
|
||||
[5]: https://dave.cheney.net/2014/05/24/on-declaring-variables (On declaring variables)
|
||||
[6]: https://dave.cheney.net/2015/11/29/a-whirlwind-tour-of-gos-runtime-environment-variables (A whirlwind tour of Go’s runtime environment variables)
|
||||
[7]: https://dave.cheney.net/2019/01/29/you-shouldnt-name-your-variables-after-their-types-for-the-same-reason-you-wouldnt-name-your-pets-dog-or-cat (You shouldn’t name your variables after their types for the same reason you wouldn’t name your pets “dog” or “cat”)
|
137
sources/tech/20191209 Counting down the days using bash.md
Normal file
137
sources/tech/20191209 Counting down the days using bash.md
Normal file
@ -0,0 +1,137 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Counting down the days using bash)
|
||||
[#]: via: (https://www.networkworld.com/article/3487712/counting-down-the-days-using-bash.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
Counting down the days using bash
|
||||
======
|
||||
Need to know how many days there are before some important event? Let Linux bash and the date command help with that!
|
||||
Thinkstock
|
||||
|
||||
With some pretty important holidays right around the corner, you might need to be reminded how much longer you have to prepare.
|
||||
|
||||
Fortunately, you can get a lot of help from the **date** command. In this post, we’ll look at ways that **date** and bash scripts can tell you how many days there are between today and some event that you’re anticipating.
|
||||
|
||||
[[Get regularly scheduled insights by signing up for Network World newsletters.]][1]
|
||||
|
||||
First a couple hints at how this is going to work. The **date** command’s **%j** option is going to show you today’s date as a number between 1 and 366. January 1st, as you’d expect, will be displayed as 1 and December 31st will be 365 or 366 depending on whether it’s leap year. Go ahead and try it. You should see something like this:
|
||||
|
||||
[][2]
|
||||
|
||||
BrandPost Sponsored by HPE
|
||||
|
||||
[Take the Intelligent Route with Consumption-Based Storage][2]
|
||||
|
||||
Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency.
|
||||
|
||||
```
|
||||
$ date +%j
|
||||
339
|
||||
```
|
||||
|
||||
You can, however, get the **date** command to give you the day-of-the-year number for _any_ date by supplying it in a **date** command like this:
|
||||
|
||||
```
|
||||
$ date -d "Mar 18" +%j
|
||||
077
|
||||
```
|
||||
|
||||
One important thing to keep in mind is that this command will show you the date in the _current year_ even if that date is in the past. However, you can add a year to the command and fix that:
|
||||
|
||||
```
|
||||
$ date -d "Apr 29" +%j
|
||||
119
|
||||
$ date -d "Apr 29 2020" +%j
|
||||
120
|
||||
```
|
||||
|
||||
In a leap year, Apr 29th will be the 120th day of the year, not the 119th.
|
||||
|
||||
If you want to count down the days until Christmas and don’t want to end up with fingerprints on your wall calendar, you can use a script like this:
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
XMAS=`date -d "Dec 25" +%j`
|
||||
TODAY=`date +%j`
|
||||
DAYS=$(($XMAS - $TODAY))
|
||||
|
||||
case $DAYS in
|
||||
0) echo "It's today! Merry Christmas!";;
|
||||
[0-9]*) echo "$DAYS days remaining";;
|
||||
-[0-9]*) echo "Oops, you missed it";;
|
||||
esac
|
||||
```
|
||||
|
||||
In this script, we get the day numbers for Dec 25th and today and then subtract one from the other. If the result is positive, we display the number of days remaining. If it’s zero, we issue a “Merry Christmas” message and, if it’s negative, we just tell the person running the script that they missed the holiday. Maybe they got carried away with the egg nog.
|
||||
|
||||
The case statement is made up of ready-to-print statements for remaining-day counts that equal zero, those that that include any digits and those that start with a **-** sign (i.e., in the past).
|
||||
|
||||
The same idea can be generalized for any date that someone wants to keep in focus. In fact, we can ask the person running our script to supply the date and then let them know how many days remain between now and then. This version of the script does just that.
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
echo -n "Enter event date (e.g., June 6): "
|
||||
read dt
|
||||
EVENT=`date -d "$dt" +%j`
|
||||
TODAY=`date +%j`
|
||||
DAYS=`expr $EVENT - $TODAY`
|
||||
|
||||
case $DAYS in
|
||||
0) echo "It's today!";;
|
||||
[0-9]*) echo "$DAYS days remaining";;
|
||||
-[0-9]*) echo "Oops, you missed it";;
|
||||
esac
|
||||
```
|
||||
|
||||
One problem you’ll have with this script is that, if the person running it is hoping to find out how many days must pass before they reach a special day the following year, they’ll be disappointed. Even if they supply a year when they enter the date, the date -d command will still only supply the day number in that year, not the days between now and then.
|
||||
|
||||
Calculating the number of days between today and some date years from now can be a bit tricky. You’d need to include all the intervening years and pay attention to those that are leap years.
|
||||
|
||||
### Using Unix (Epoch) time
|
||||
|
||||
Another way to calculate the number of days between now and some special date is to take advantage of the way that Unix systems store dates. If you convert the number of seconds since the start of the day on Jan 1, 1970 to days, you can do this quite easily as in this script:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
echo -n "Enter target date (e.g., Mar 18 2021)> "
|
||||
read target_date
|
||||
today=`echo $(($(date --utc --date "$1" +%s)/86400))`
|
||||
target=`echo $(($(date --utc --date "$target_date" +%s)/86400))`
|
||||
days=`expr $target - $today`
|
||||
echo "$days days until $target_date"
|
||||
```
|
||||
|
||||
To explain, 86400 is the number of seconds in a day. Dividing the number of seconds since the epoch began by this number gives us the number of days.
|
||||
|
||||
```
|
||||
$ ./countdown
|
||||
Enter target date (e.g., Mar 18 2021)> Mar 18 2020
|
||||
104 days until Mar 18 2020
|
||||
```
|
||||
|
||||
Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3487712/counting-down-the-days-using-bash.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/newsletters/signup.html
|
||||
[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,151 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (App Highlight: Open Source Video Transcoder Handbrake)
|
||||
[#]: via: (https://itsfoss.com/handbrake/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
App Highlight: Open Source Video Transcoder Handbrake
|
||||
======
|
||||
|
||||
_**Brief: HandBrake is a free and open-source video conversion tool that is quite useful. Let’s see what are its main features and how to use them for converting videos from one format to another.**_
|
||||
|
||||
### HandBrake: An Open Source Video Transcoder
|
||||
|
||||
![][1]
|
||||
|
||||
[HandBrake][2] is a quite useful tool which helps you to convert a video from one format to some of the widely supported codecs (**.mp4/.m4v/.mkv/.webm**)
|
||||
|
||||
It can support any video format and help you convert it. In addition to that, you have several features on board to customize the video attributes while converting.
|
||||
|
||||
If you are looking for a [Format Factory alternative][3], this is your best bet.
|
||||
|
||||
I shall highlight the key features to help you know more.
|
||||
|
||||
![HandBrake][4]
|
||||
|
||||
### Features of HandBrake
|
||||
|
||||
When you start using the video transcoder, you will find a lot of tiny features for video conversion. However, here, I’ll highlight the important things you need to know about HandBrake:
|
||||
|
||||
#### Video Conversion Presets
|
||||
|
||||
![HandBrake Presets][5]
|
||||
|
||||
Suppose you want to convert a full HD video to play on a mobile which was originally tailored for desktop viewing, what do you do?
|
||||
|
||||
Would you test various dimensions and convert them repeatedly to get the perfect mobile port? Or, would you rather prefer to have pre-defined settings for such conversions?
|
||||
|
||||
If you opt for a preset, you just have to select the target device (or type of device) from the list of available presets.
|
||||
|
||||
It even features presets for PS4 Pro (4K) and Discord. So, you can expect a big list of presets available.
|
||||
|
||||
#### Input Sources Support
|
||||
|
||||
Unless the file has some sort of copy protection, HandBrake can help you convert it. You will have no problems whatsoever even if you have an Ultra HD Blu-ray disc as the source with no copyright protection.
|
||||
|
||||
All the available video encoding formats should work fine as an input source file.
|
||||
|
||||
#### Basic Video Manipulation
|
||||
|
||||
![HandBrake Screenshot][6]
|
||||
|
||||
In addition to the ability of video conversion, it also lets you tweak the video to suit your requirements.
|
||||
|
||||
You can change the dimensions, crop it, add a filter, change the frame rate settings, and a lot more things.
|
||||
|
||||
If that wasn’t enough, you also get the ability to add subtitles and chapter markers.
|
||||
|
||||
#### Live Video Preview
|
||||
|
||||
This may not be a big deal to have – but I haven’t seen any video converter tool featuring video previews while being able to convert/tweak the video. It could come in handy for someone specific.
|
||||
|
||||
### Installing HandBrake on Ubuntu and other Linux distributions
|
||||
|
||||
HandBrake is a cross-platform application and you can install it on all different platforms like Linux, macOS and Windows. Just head over to heir website and download it from there.
|
||||
|
||||
[Download HandBrake for any platform][7]
|
||||
|
||||
On It’s FOSS, our focus is on Linux so I am going to show the steps to install it on Linux.
|
||||
|
||||
**Installing HandBrake on Ubuntu**
|
||||
|
||||
HandBrake is available in the [universe repository in Ubuntu][8]. If you have it enabled, you should find it in the software center. Just search for the name and install it from there.
|
||||
|
||||
![HandBrake in Ubuntu Software Center][9]
|
||||
|
||||
You can also use terminal for installing HandBrake with apt or [apt-get command][10]:
|
||||
|
||||
```
|
||||
sudo apt-get install handbrake
|
||||
```
|
||||
|
||||
However, the software center might feature the older version. If you want to install the latest version of HandBrake on Ubuntu and other Ubuntu-based distributions, you can [use its official PPA][11]. It’s better to uninstall any existing version of HandBrake beforehand.
|
||||
|
||||
```
|
||||
sudo apt remove handbrake
|
||||
sudo add-apt-repository ppa:stebbins/handbrake-releases
|
||||
sudo apt update
|
||||
sudo apt install handbrake-gtk
|
||||
```
|
||||
|
||||
You can [learn more about using PPA here][12]. It will help you to [remove PPA][13], if you ever need to uninstall HandBrake installed via the PPA.
|
||||
|
||||
If you want to install the CLI version of Handbrake, simply use this command:
|
||||
|
||||
```
|
||||
sudo apt install handbrake-cli
|
||||
```
|
||||
|
||||
Quite honestly, HandBrake should be used as a GUI application. If you want command line, you can always [use ffmpeg][14] that is more powerful and HandBrake uses it underneath anyways.
|
||||
|
||||
**Installing HandBrake on other Linux distributions**
|
||||
|
||||
HandBrake is one of the [popular Linux software][15] and it should be available in the official repositories of almost all Linux distributions.
|
||||
|
||||
Just use the software center or package manager of your distribution to install HandBrake.
|
||||
|
||||
But again, your distribution might not have the latest version of HandBrale. So, if you want the latest version installed, you can try installing the [Flatpak package][16] available. If you are not sure how to use Flatpak, refer to our guide on [using Flatpak on Linux][17].
|
||||
|
||||
[HandBrake][2]
|
||||
|
||||
**Wrapping Up**
|
||||
|
||||
A free and open-source video conversion tool that gets the job done. I’m quite satisfied with it personally.
|
||||
|
||||
If you use HandBrake extensively, mention at least one feature that you like the most about it.
|
||||
|
||||
If you use some other application for converting video formats, do share it with us in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/handbrake/
|
||||
|
||||
作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/handbrake_software_logo.png?ssl=1
|
||||
[2]: https://handbrake.fr/
|
||||
[3]: https://itsfoss.com/format-factory-alternative-linux/
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/11/handbrake.png?ssl=1
|
||||
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/11/handbrake-presets.png?ssl=1
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/handbrake-screenshot.png?ssl=1
|
||||
[7]: https://handbrake.fr/downloads.php
|
||||
[8]: https://itsfoss.com/ubuntu-repositories/
|
||||
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/11/handbrake_ubuntu_software_center.png?ssl=1
|
||||
[10]: https://itsfoss.com/apt-get-linux-guide/
|
||||
[11]: https://launchpad.net/~stebbins/+archive/ubuntu/handbrake-releases
|
||||
[12]: https://itsfoss.com/ppa-guide/
|
||||
[13]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/
|
||||
[14]: https://itsfoss.com/ffmpeg/
|
||||
[15]: https://itsfoss.com/essential-linux-applications/
|
||||
[16]: https://flathub.org/apps/details/fr.handbrake.ghb
|
||||
[17]: https://itsfoss.com/flatpak-guide/
|
@ -0,0 +1,243 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (14 SCP Command Examples to Securely Transfer Files in Linux)
|
||||
[#]: via: (https://www.linuxtechi.com/scp-command-examples-in-linux/)
|
||||
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
|
||||
|
||||
在 Linux 上安全传输文件的 14 SCP 命令示例
|
||||
======
|
||||
|
||||
SCP(Secure Copy)是 Linux 和 Unix 之类的系统中的命令行工具,用于通过网络安全地跨系统传输文件和目录。当我们使用 `scp` 命令将文件和目录从本地系统复制到远程系统时,则在后端与远程系统建立 ssh 连接。换句话说,我们可以说 `scp` 在后端使用了相同的 SSH 安全机制,它需要密码或密钥进行身份验证。
|
||||
|
||||
![scp-command-examples-linux][2]
|
||||
|
||||
在本教程中,我们将讨论 14 个有用的 Linux `scp` 命令示例。
|
||||
|
||||
`scp` 命令语法:
|
||||
|
||||
```
|
||||
# scp <选项> <文件或目录> 用户名@目标主机:/<文件夹>
|
||||
|
||||
# scp <选项> 用户名@目标主机:/文件 <本地文件夹>
|
||||
```
|
||||
|
||||
`scp` 命令的第一个语法演示了如何将文件或目录从本地系统复制到特定文件夹下的目标主机。
|
||||
|
||||
`scp` 命令的第二种语法演示了如何将目标主机中的文件复制到本地系统中。
|
||||
|
||||
下面列出了 `scp` 命令中使用最广泛的一些选项,
|
||||
|
||||
* `-C` 启用压缩
|
||||
* `-i` 指定识别文件或私钥
|
||||
* `-l` 复制时限制带宽
|
||||
* `-P` 目标主机的 ssh 端口号
|
||||
* `-p` 复制时保留文件的权限、模式和访问时间
|
||||
* `-q` 禁止 SSH 警告消息
|
||||
* `-r` 递归复制文件和目录
|
||||
* `-v` 详细输出
|
||||
|
||||
现在让我们跳入示例!!!!
|
||||
|
||||
### 示例:1)使用 scp 将文件从本地系统复制到远程系统
|
||||
|
||||
假设我们要使用 `scp` 命令将 jdk 的 rpm 软件包从本地 Linux 系统复制到远程系统(172.20.10.8),请使用以下命令,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp jdk-linux-x64_bin.rpm root@linuxtechi:/opt
|
||||
root@linuxtechi's password:
|
||||
jdk-linux-x64_bin.rpm 100% 10MB 27.1MB/s 00:00
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
上面的命令会将 jdk 的 rpm 软件包文件复制到 `/opt` 文件夹下的远程系统。
|
||||
|
||||
### 示例:2)使用 scp 将文件从远程系统复制到本地系统
|
||||
|
||||
假设我们想将文件从远程系统复制到 `/tmp` 文件夹下的本地系统,执行以下 `scp` 命令,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp root@linuxtechi:/root/Technical-Doc-RHS.odt /tmp
|
||||
root@linuxtechi's password:
|
||||
Technical-Doc-RHS.odt 100% 1109KB 31.8MB/s 00:00
|
||||
[root@linuxtechi ~]$ ls -l /tmp/Technical-Doc-RHS.odt
|
||||
-rwx------. 1 pkumar pkumar 1135521 Oct 19 11:12 /tmp/Technical-Doc-RHS.odt
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
### 示例:3)使用 scp 传输文件时的详细输出(-v)
|
||||
|
||||
在 `scp` 命令中,我们可以使用 `-v` 选项启用详细输出,使用详细输出,我们可以轻松地发现后台确切发生了什么。这对于调试连接、认证和配置问题非常有用。
|
||||
|
||||
```
|
||||
root@linuxtechi ~]$ scp -v jdk-linux-x64_bin.rpm root@linuxtechi:/opt
|
||||
Executing: program /usr/bin/ssh host 172.20.10.8, user root, command scp -v -t /opt
|
||||
OpenSSH_7.8p1, OpenSSL 1.1.1 FIPS 11 Sep 2018
|
||||
debug1: Reading configuration data /etc/ssh/ssh_config
|
||||
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
|
||||
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
|
||||
debug1: /etc/ssh/ssh_config.d/05-redhat.conf line 8: Applying options for *
|
||||
debug1: Connecting to 172.20.10.8 [172.20.10.8] port 22.
|
||||
debug1: Connection established.
|
||||
…………
|
||||
debug1: Next authentication method: password
|
||||
root@linuxtechi's password:
|
||||
```
|
||||
|
||||
### 示例:4)将多个文件传输到远程系统
|
||||
|
||||
可以使用 `scp` 命令一次性将多个文件复制/传输到远程系统,在 `scp` 命令中指定多个文件,并用空格隔开,示例如下所示
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp install.txt index.html jdk-linux-x64_bin.rpm root@linuxtechi:/mnt
|
||||
root@linuxtechi's password:
|
||||
install.txt 100% 0 0.0KB/s 00:00
|
||||
index.html 100% 85KB 7.2MB/s 00:00
|
||||
jdk-linux-x64_bin.rpm 100% 10MB 25.3MB/s 00:00
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
### 示例:5)在两个远程主机之间传输文件
|
||||
|
||||
使用 `scp` 命令,我们可以在两个远程主机之间复制文件和目录,假设我们有一个可以连接到两个远程 Linux 系统的本地 Linux 系统,因此从我的本地 Linux 系统中,我可以使用 `scp` 命令在这两个系统之间复制文件,
|
||||
|
||||
命令语法:
|
||||
|
||||
```
|
||||
# scp 用户名@远程主机1:/<要传输的文件> 用户名@远程主机2:/<文件夹>
|
||||
```
|
||||
|
||||
示例如下:
|
||||
|
||||
```
|
||||
# scp root@linuxtechi:~/backup-Oct.zip root@linuxtechi:/tmp
|
||||
# ssh root@linuxtechi "ls -l /tmp/backup-Oct.zip"
|
||||
-rwx------. 1 root root 747438080 Oct 19 12:02 /tmp/backup-Oct.zip
|
||||
```
|
||||
|
||||
### 示例:6)递归复制文件和目录(-r)
|
||||
|
||||
在 `scp` 命令中使用 `-r` 选项将整个目录从一个系统递归复制到另一个系统,示例如下所示:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -r Downloads root@linuxtechi:/opt
|
||||
```
|
||||
|
||||
使用以下命令验证 `Downloads` 文件夹是否已复制到远程系统,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ ssh root@linuxtechi "ls -ld /opt/Downloads"
|
||||
drwxr-xr-x. 2 root root 75 Oct 19 12:10 /opt/Downloads
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
### 示例:7)通过启用压缩来提高传输速度(-C)
|
||||
|
||||
在 `scp` 命令中,我们可以通过使用 `-C` 选项启用压缩来提高传输速度,它将自动在源上启用压缩并在目标主机上启用解压缩。
|
||||
|
||||
```
|
||||
root@linuxtechi ~]$ scp -r -C Downloads root@linuxtechi:/mnt
|
||||
```
|
||||
|
||||
在以上示例中,我们正在启用压缩的情况下传输下载目录。
|
||||
|
||||
### 示例:8)复制时限制带宽(-l)
|
||||
|
||||
在 `scp` 命令中使用 `-l` 选项设置复制时对带宽使用的限制。带宽以 Kbit/s 为单位指定,示例如下所示,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -l 500 jdk-linux-x64_bin.rpm root@linuxtechi:/var
|
||||
```
|
||||
|
||||
### 示例:9)在 scp 时指定其他 ssh 端口(-P)
|
||||
|
||||
在某些情况下,目标主机上的 ssh 端口会更改,因此在使用 `scp` 命令时,我们可以使用 `-P` 选项指定 ssh 端口号。
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -P 2022 jdk-linux-x64_bin.rpm root@linuxtechi:/var
|
||||
```
|
||||
|
||||
在上面的示例中,远程主机的 ssh 端口为 “2022”
|
||||
|
||||
### 示例:10)复制时保留文件的权限、模式和访问时间(-p)
|
||||
|
||||
从源复制到目标时,在 `scp` 命令中使用 `-p` 选项保留权限、访问时间和模式。
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -p jdk-linux-x64_bin.rpm root@linuxtechi:/var/tmp
|
||||
jdk-linux-x64_bin.rpm 100% 10MB 13.5MB/s 00:00
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
### 示例:11)在 scp 中以安静模式传输文件(-q)
|
||||
|
||||
在 `scp` 命令中使用 `-q` 选项可禁止显示 ssh 的传输进度、警告和诊断消息。示例如下所示:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -q -r Downloads root@linuxtechi:/var/tmp
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
### 示例:12)在传输时使用 scp 中的识别文件(-i)
|
||||
|
||||
在大多数 Linux 环境中,首选基于密钥的身份验证。在 scp 命令中,我们使用 `-i` 选项指定识别文件(私钥文件),示例如下所示:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -i my_key.pem -r Downloads root@linuxtechi:/root
|
||||
```
|
||||
|
||||
在上面的示例中,`my_key.pem` 是识别文件或私钥文件。
|
||||
|
||||
### 示例:13)在 scp 中使用其他 ssh_config 文件(-F)
|
||||
|
||||
在某些情况下,你使用不同的网络连接到 Linux 系统,可能某些网络位于代理服务器后面,因此在这种情况下,我们必须具有不同的 `ssh_config` 文件。
|
||||
|
||||
通过 `-F` 选项在 `scp` 命令中指定了不同的 `ssh_config` 文件,示例如下所示:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ scp -F /home/pkumar/new_ssh_config -r Downloads root@linuxtechi:/root
|
||||
root@linuxtechi's password:
|
||||
jdk-linux-x64_bin.rpm 100% 10MB 16.6MB/s 00:00
|
||||
backup-Oct.zip 100% 713MB 41.9MB/s 00:17
|
||||
index.html 100% 85KB 6.6MB/s 00:00
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
### 示例:14)在 scp 命令中使用其他加密方式(-c)
|
||||
|
||||
默认情况下,`scp` 使用 AES-128 加密方式来加密文件。如果你想在 `scp` 命令中使用其他加密方式,请使用 `-c` 选项,后接加密方式名称,
|
||||
|
||||
假设我们要在用 `scp`命令传输文件时使用 3des-cbc 加密方式,请运行以下 `scp` 命令:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# scp -c 3des-cbc -r Downloads root@linuxtechi:/root
|
||||
```
|
||||
|
||||
使用以下命令列出 `ssh` 和 `scp` 加密方式:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# ssh -Q cipher localhost | paste -d , -s -
|
||||
3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,root@linuxtechi,aes128-ctr,aes192-ctr,aes256-ctr,root@linuxtechi,root@linuxtechi,root@linuxtechi
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
以上就是本教程的全部内容,要获取有关 `scp` 命令的更多详细信息,请参考其手册页。请在下面的评论部分中分享你的反馈和评论。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/scp-command-examples-in-linux/
|
||||
|
||||
作者:[Pradeep Kumar][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linuxtechi.com/author/pradeep/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[2]: https://www.linuxtechi.com/wp-content/uploads/2019/10/scp-command-examples-linux.jpg
|
||||
[3]: https://www.linuxtechi.com/cdn-cgi/l/email-protection
|
@ -1,70 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Why use the Pantheon desktop for Linux Elementary OS)
|
||||
[#]: via: (https://opensource.com/article/19/12/pantheon-linux-desktop)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
为何在 Elementary OS 中使用 Pantheon 桌面
|
||||
======
|
||||
本文是 Linux 桌面特别系列的一部分。通过 Pantheon 在 Elementary OS 上获得受喜爱的 Mac OS 特性。
|
||||
![A person programming][1]
|
||||
|
||||
你愿意为 Linux 桌面支付 20 美元吗?事实上,我会在下载免费软件时选择支付更多!我这样做的原因是开源是值得的。对于 [Elementary OS][2]的拷贝,默认价格是 20 美元(你可以用 1 美元,如果你无法负担,你甚至可以用 0 美元下载)。作为回报,你将获得一个出色且精心制作的发行版,同时拥有 Pantheon 桌面设计。
|
||||
|
||||
你可能会发现 Pantheon 已包含在软件仓库中,因为它是开源的,但你更可能需要下载并安装 [Elementary][3] Linux 才能体验它。如果你还不准备在计算机上将 Elementary 作为主操作系统安装,那么可以将其安装到虚拟机中,例如 [GNOME Boxes][4] 中。
|
||||
|
||||
Pantheon 桌面整洁、吸引人,并有许多用户希望在桌面中获得的东西,但在普通的 Linux 桌面上却无法获得。
|
||||
|
||||
### Pantheon 桌面之旅
|
||||
|
||||
乍一看,Pantheon 桌面看起来有点像 Cinnamon 或 Budgie 或 GNOME 3 的经典模式。但是,Pantheon 最令人兴奋的功能是最小的触摸。它在你最少注意到的地方都表现出色,直到有一天这里成为了你一天都会看的地方,并且意识到它的工作方式确实改善了你的生活质量,更不用说让你过得愉快了好多了。
|
||||
|
||||
最明显的例子是“文件名高亮”。几十年来,Mac OS 一直有一个广受欢迎的功能,你从而可以高亮显示重要文件的名称。人们使用此功能作为快速的视觉指示器,来告诉自己哪个文件是这几个的“最佳”版本,或者哪个文件应该发送给朋友,或者哪个文件仍然需要处理。它们可以是任意颜色,可以表示用户想要的任何含义。最重要的是,它是引人注目的视觉元数据。
|
||||
|
||||
从 Mac OS 切换过来用户往往会错过 GNOME 和 KDE 以及其他 Linux 桌面提供的这个功能。Pantheon 悄悄和随意地就解决了这个问题。
|
||||
|
||||
![A highlighted file in the Pantheon desktop][5]
|
||||
|
||||
当然,那只是其中一个例子。Pantheon 有很多你直到用才会想到的小功能。
|
||||
|
||||
桌面精致而吸引人,有所有其他很多桌面缺少的直观组件。在许多方面,它充分吸取了其他桌面好的想法,并避免实现多余的东西。
|
||||
|
||||
![Pantheon desktop on Elementary OS][6]
|
||||
|
||||
### 自定义 Pantheon 桌面
|
||||
|
||||
Pantheon 桌面表达了如何操作计算机的清晰愿景。这种设计的“问题”(至少在开源之外)是,一个人的偏好可能无法满足另一个人的效率。
|
||||
|
||||
但它是开源的。它可以更改,任何不能改变的东西都可以被丢弃。Pantheon 绝对是针对特定用户的桌面,但是即使对于那些对桌面应该如何工作抱有自己期望的人,Pantheon 也会比初次出现时更加灵活。许多内置设计都具有替代选项,当你无法根据自己的喜好进行调整时,你可以轻松选择其他应用。主题引擎可确保你的替换应用看起来与桌面的其他部分集成在一起,而平常的 Linux 系统总线可确保你选择的所有应用都能按预期相互通信。
|
||||
|
||||
![Which one is the guest?][7]
|
||||
|
||||
随着折衷的进行,这一过程在中途会做很多事情。
|
||||
|
||||
### 受欢迎的补充
|
||||
|
||||
除开词源,此桌面确实是许多 Linux 用户祈祷的答案。无论它是否是你的风格,Pantheon 桌面都是 Linux 用户体验中重要且受欢迎的补充。自己尝试一下,看看它是否是你一直期待的。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/12/pantheon-linux-desktop
|
||||
|
||||
作者:[Seth Kenlon][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/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming)
|
||||
[2]: https://elementary.io/
|
||||
[3]: http://elementary.io
|
||||
[4]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization
|
||||
[5]: https://opensource.com/sites/default/files/uploads/advent-pantheon-highlight.jpg (A highlighted file in the Pantheon desktop)
|
||||
[6]: https://opensource.com/sites/default/files/uploads/advent-pantheon.jpg (Pantheon desktop on Elementary OS)
|
||||
[7]: https://opensource.com/sites/default/files/uploads/advent-pantheon-pcmanfm.jpg (Which one is the guest?)
|
@ -0,0 +1,63 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Dell XPS 13 7390 Review: The Best Laptop For Desktop Linux Users)
|
||||
[#]: via: (https://www.linux.com/articles/dell-xps-13-7390-review-the-best-laptop-for-desktop-linux-user/)
|
||||
[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/)
|
||||
|
||||
Dell XPS 13 7390:最好的 Linux 桌面笔记本
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
曾经,我们必须进行大量研究、阅读大量评论,才能找到一种在所选的 Linux 桌面发行版上可以以最少的麻烦工作的机器。而如今,这种日子已经一去不复返了,几乎每台机器都可以运行 Linux。Linux 内核社区在设备驱动程序支持方面做得非常出色,可以使一切都开箱即用。
|
||||
|
||||
不过,有的是机器可以运行 Linux,有的是运行 Linux 的机器。戴尔计算机属于后一类。五年前,Barton George 在戴尔内部启动了一项计划,将桌面版 Linux 引入到消费级的高端戴尔系统。从一台机器开始,现在已经是一整套高端的 Linux 笔记本电脑和台式机。
|
||||
|
||||
在这些机器中,XPS 13 是我的最爱。尽管我需要一个功能强大的台式机来处理 4K UHD、多机位视频制作,但我还需要一台超便携的笔记本电脑,可以随身携带,而不必担心笨重的背包和充电器。XPS 13 也是我的第一台笔记本电脑,使用了 7 年多。因此,是的,这还有一个怀旧因素。
|
||||
|
||||
戴尔几乎每年都会更新其 XPS 产品线,并且最新的[产品展示宣布于 10 月][3]。[XPS 13(7390)] [4] 是该系列的增量更新,而且戴尔非常乐意向我寄来一台测评设备。
|
||||
|
||||
它由 6 核 Core i7-10710U CPU 所支持。它配备 16GB 内存和 1TB SSD。在 1.10 GHz 的基本频率(可以超频到 4.1 GHz)的情况下,这是一台用于常规工作负载的出色机器。它没有使用任何专用的 GPU,因此它并不适合进行游戏或从源代码进行编译的 Gentoo Linux 或 Arch Linux。但是,我确实设法在上面运行了一些 Steam 游戏。
|
||||
|
||||
如果你想运行 Kubernetes 集群、AI 框架或虚拟现实,那么 Precision 系列中还有更强大的机器,这些机器可以运行 Red Hat Enterprise Linux 和 Ubuntu。
|
||||
|
||||
该机器的底盘与上一代相同。边框保持与上一代一样的薄,仍比 MacBook 和微软的 Surface Pro 薄。
|
||||
|
||||
它具有三个端口,其中两个是 USB-C Thunderbolt 3,可用于连接 4K 显示器、USB 附件以及用于对等网络的计算机之间的高速数据传输。
|
||||
|
||||
它还具有一个 microSD 插槽。作为视频记者,SD 卡插槽会更有用。大量使用树莓派的用户也会喜欢此卡。
|
||||
|
||||
它具有 4 个麦克风和一个改进的摄像头,该摄像头现在位于顶部(再见,鼻孔摄像头!)。
|
||||
|
||||
XPS 13(7390)光滑纤薄。它的重量仅为 2.7 磅(1.2kg),可以与苹果的 MacBook Air 相提并论。 这台机器可以成为你的旅行伴侣,并且可以执行日常任务,例如检查电子邮件、浏览网络和书写。
|
||||
|
||||
其 4K UHD 屏幕支持 HDR,这意味着你将可以尽享全尺寸的《The Mandalorian》。另外,车载扬声器并没有那么好,听起来有些沉闷。它们适合进行视频聊天或休闲的 YouTube 观看,但是如果你想在今年晚些时候观看《The Witcher》剧集,或者想欣赏 Amazon、Apple Music 或 YouTube Music 的音乐,则需要耳机或外接扬声器。
|
||||
|
||||
但是,在插入充电线之前,你可以从这台机器中获得多少乐趣?在正常工作量的情况下,它为我提供了大约 7-8 个小时的电池续航时间:我打开了几个选项卡浏览网络,只是看看电影或听音乐。多任务处理,尤其是各种 Web 活动,都会消耗电池电量。在 Linux 上进行一些微调可能会给你带来更多的续航时间。而在 Windows 10 上,我可以使用 10 多个小时呢!
|
||||
|
||||
作为仍在从事大量写作工作的视频记者,我非常喜欢键盘。但是,我们这么多年来在 Linux 台式机上听到的触控板故事一直没变:它与 MacBook 或 Windows 上的质量相差甚远。这或许有一天能改变。值得称道的是,他们确实发布了可增强体验的触控板驱动程序,但我没有运行此系统随附的提供的 Ubuntu 18.04 LTS。我全新安装了 Ubuntu 19.10,因为 Gnome 在 18.04 中的运行速度非常慢。我尝试过 openSUSE Tumbleweed、Zorin OS、elementary OS、Fedora、KDE neon 和 Arch Linux。一切正常,尽管有些需要额外的努力才能运行。
|
||||
|
||||
那么,该系统适用于谁?显然,这是给那些想要设计精良的、他们信赖的品牌高端机器的专业人士打造的。适用于喜欢 MacBook Air,但更喜欢 Linux 台式机生态系统的用户。适用于那些希望使用 Linux 来工作,而不是使 Linux 可以工作的人。
|
||||
|
||||
我用这台机器花了一周的时间,进一步说明了为什么我如此喜欢戴尔的 XPS 系列。它们是目前最好的 Linux 笔记本电脑。这款 XPS 13(7390),你值得拥有!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/articles/dell-xps-13-7390-review-the-best-laptop-for-desktop-linux-user/
|
||||
|
||||
作者:[Swapnil Bhartiya][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://www.linux.com/author/swapnil/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.linux.com/wp-content/uploads/2019/12/dell-xps-13-7390-1068x665.jpg (dell-xps-13-7390)
|
||||
[2]: https://www.linux.com/wp-content/uploads/2019/12/dell-xps-13-7390.jpg
|
||||
[3]: https://bartongeorge.io/2019/08/21/please-welcome-the-9th-generation-of-the-xps-13-developer-edition/
|
||||
[4]: https://blog.dell.com/en-us/dells-new-consumer-pc-portfolio-unveiled-ifa-2019/
|
@ -1,258 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (lxbwolf)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (6 Ways to Send Email from the Linux Command Line)
|
||||
[#]: via: (https://www.2daygeek.com/6-ways-to-send-email-from-the-linux-command-line/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
Linux 命令行发送邮件的 6 种方法
|
||||
======
|
||||
|
||||
当你需要在 shell 脚本中创建邮件时,就需要用到命令行发送邮件的知识。Linux 中有很多命令可以实现发送邮件。本教程中包含了命令行邮件客户端的 Top 6,你可以选择其中一个。6 个命令分别是:
|
||||
|
||||
* mail
|
||||
* mailx
|
||||
* mutt
|
||||
* mpack
|
||||
* sendmail
|
||||
* ssmtp
|
||||
|
||||
|
||||
|
||||
### 工作原理
|
||||
|
||||
我先从整体上来解释下Linux中邮件命令怎么把邮件传递给收件人的。邮件命令(如 sendmail,postfix)生成邮件并发送给一个本地的邮件传输代理(MTA)。本质上发送和接收邮件时邮件服务器和远程邮件服务器之间的通信。下面的流程可以看得更详细。
|
||||
|
||||
![](https://www.2daygeek.com/wp-content/uploads/2019/12/smtp-simple-mail-transfer-protocol.png)
|
||||
|
||||
### 1) Linux 安装 mail 命令
|
||||
|
||||
mail 命令是 Linux 终端发送邮件使用次数最多的命令。可以运行下面的命令从官方发行库安装 mail 命令。对于 **”Debian/Ubuntu“** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 安装 mailutils。
|
||||
|
||||
```
|
||||
$ sudo apt-get install mailutils
|
||||
```
|
||||
|
||||
对于 **“RHEL/CentOS”** 系统,使用 **[YUM 命令][5]** 安装 mailx。
|
||||
|
||||
```
|
||||
$ sudo yum install mailx
|
||||
```
|
||||
|
||||
对于 **“Fedora”** 系统,使用 **[DNF 命令][6]** 安装 mailx。
|
||||
|
||||
```
|
||||
$ sudo dnf install mailx
|
||||
```
|
||||
|
||||
### 1a) Linux 安装 mail 命令后发送邮件
|
||||
|
||||
mail 命令简单易用。如果你不需要发送附件,使用下面的 mail 命令格式就可以发送邮件了。
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mail -s "Subject" [email protected]
|
||||
```
|
||||
|
||||
如果你要发送附件,使用下面的 mail 命令格式。
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mail -a test1.txt -s "Subject" [email protected]
|
||||
```
|
||||
|
||||
```
|
||||
+---------+----------------------------------------------------+
|
||||
| Options | Description |
|
||||
+---------+----------------------------------------------------+
|
||||
| -a | It's used for attachment on Red Hat based systems. |
|
||||
| -A | It's used for attachment on Debian based systems. |
|
||||
| -s | Specify the subject of the message |
|
||||
+--------------------------------------------------------------+
|
||||
```
|
||||
|
||||
### 2) Linux 安装 mutt 命令
|
||||
|
||||
mutt 是另一个 Linux 终端发送邮件很受欢迎的命令。mutt 是一个小而强大的基于文本的程序,用来阅读和发送 unix 操作系统的电子邮件,功能支持多彩终端、MIME、OpenPGP和按邮件线索排序的模式。可以运行下面的命令从官方发行库安装 mutt 命令。对于 **”Debian/Ubuntu“** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 安装 mutt。
|
||||
|
||||
```
|
||||
$ sudo apt-get install mutt
|
||||
```
|
||||
|
||||
对于 **“RHEL/CentOS”** 系统,使用 **[YUM 命令][5]** 安装 mutt。
|
||||
|
||||
```
|
||||
$ sudo yum install mutt
|
||||
```
|
||||
|
||||
对于 **“Fedora”** 系统,使用 **[DNF 命令][6]** 安装 mutt。
|
||||
|
||||
```
|
||||
$ sudo dnf install mutt
|
||||
```
|
||||
|
||||
### 2b) Linux 使用 mutt 命令发送邮件
|
||||
|
||||
mutt 也是简单易用的。如果你不需要发送附件,使用下面的 mutt 命令格式就可以发送邮件了。
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mutt -s "Subject" [email protected]
|
||||
```
|
||||
|
||||
如果你要发送附件,使用下面的 mutt 命令格式。
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mutt -s "Subject" [email protected] -a test1.txt
|
||||
```
|
||||
|
||||
### 3) Linux 安装 mpack 命令
|
||||
|
||||
mpack 是另一个 Linux 终端发送邮件很受欢迎的命令。mpack 程序会对 MIME 消息中文件进行编码。编码后的消息被发送到一个或多个收件人。可以运行下面的命令从官方发行库安装 mpack 命令。对于 **”Debian/Ubuntu“** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 安装 mpack。
|
||||
|
||||
```
|
||||
$ sudo apt-get install mpack
|
||||
```
|
||||
|
||||
对于 **“RHEL/CentOS”** 系统,使用 **[YUM 命令][5]** 安装 mpack。
|
||||
|
||||
```
|
||||
$ sudo yum install mpack
|
||||
```
|
||||
|
||||
对于 **“Fedora”** 系统,使用 **[DNF 命令][6]** 安装 mpack。
|
||||
|
||||
```
|
||||
$ sudo dnf install mpack
|
||||
```
|
||||
|
||||
### 3a) Linux 使用 mpack 命令发送邮件
|
||||
|
||||
mpack 也是简单易用的。如果你不需要发送附件,使用下面的 mpack 命令格式就可以发送邮件了。
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mpack -s "Subject" [email protected]
|
||||
```
|
||||
|
||||
如果你要发送附件,使用下面的 mpack 命令格式。
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mpack -s "Subject" [email protected] -a test1.txt
|
||||
```
|
||||
|
||||
### 4) Linux 安装 mailx 命令
|
||||
|
||||
mailx 是 mail 命令的更新版本,基于 Berkeley Mail 8.1,意在提供 POSIX mailx 命令的功能和支持MIME、IMAP、POP3、SMTP和S/MIME 的扩展。mailx 在某些交互特性上更加强大,如缓冲邮件消息、排序和过滤等。可以运行下面的命令从官方发行库安装 mailx 命令。对于 **”Debian/Ubuntu“** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 安装 mailutils。
|
||||
|
||||
```
|
||||
$ sudo apt-get install mailutils
|
||||
```
|
||||
|
||||
对于 **“RHEL/CentOS”** 系统,使用 **[YUM 命令][5]** 安装 mailx。
|
||||
|
||||
```
|
||||
$ sudo yum install mailx
|
||||
```
|
||||
|
||||
对于 **“Fedora”** 系统,使用 **[DNF 命令][6]** 安装 mailx。
|
||||
|
||||
```
|
||||
$ sudo dnf install mailx
|
||||
```
|
||||
|
||||
### 4a) Linux 使用 mailx 命令发送邮件
|
||||
|
||||
mailx 也是简单易用的。如果你不需要发送附件,使用下面的 mail 命令格式就可以发送邮件了。
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mail -s "Subject" [email protected]
|
||||
```
|
||||
|
||||
如果你要发送附件,使用下面的 mail 命令格式。
|
||||
|
||||
```
|
||||
$ echo "This is the mail body" | mail -a test1.txt -s "Subject" [email protected]
|
||||
```
|
||||
|
||||
### 5) Linux 安装 sendmail 命令
|
||||
|
||||
sendmail 是一个 Linux 上广泛使用的 SMTP 服务器,你也可以从命令行用 sendmail 发邮件。可以运行下面的命令从官方发行库安装 sendmail 命令。对于 **”Debian/Ubuntu“** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 安装 sendmail。
|
||||
|
||||
```
|
||||
$ sudo apt-get install sendmail
|
||||
```
|
||||
|
||||
对于 **“RHEL/CentOS”** 系统,使用 **[YUM 命令][5]** 安装 sendmail。
|
||||
|
||||
```
|
||||
$ sudo yum install sendmail
|
||||
```
|
||||
|
||||
对于 **“Fedora”** 系统,使用 **[DNF 命令][6]** 安装 sendmail。
|
||||
|
||||
```
|
||||
$ sudo dnf install sendmail
|
||||
```
|
||||
|
||||
### 5a) Linux 使用 sendmail 命令发送邮件
|
||||
|
||||
sendmail 也是简单易用的。使用下面的 sendmail 命令格式发送邮件。
|
||||
|
||||
```
|
||||
$ echo -e "Subject: Test Mail\nThis is the mail body" > /tmp/send-mail.txt
|
||||
```
|
||||
|
||||
```
|
||||
$ sendmail [email protected] < send-mail.txt
|
||||
```
|
||||
|
||||
### 6) Linux 安装 ssmtp 命令
|
||||
|
||||
ssmtp 是类似 sendmail 的一个只发送不接收的工具,可以把邮件从本地计算机传递到配置好的 mailhost(mailhub)。用户可以在 Linux 命令行用 SSMTP 把邮件发送到 SMTP 服务器。可以运行下面的命令从官方发行库安装 ssmtp 命令。对于 **”Debian/Ubuntu“** 系统,使用 **[APT-GET 命令][3]** 或 **[APT 命令][4]** 安装 ssmtp。
|
||||
|
||||
```
|
||||
$ sudo apt-get install ssmtp
|
||||
```
|
||||
|
||||
对于 **“RHEL/CentOS”** 系统,使用 **[YUM 命令][5]** 安装 ssmtp。
|
||||
|
||||
```
|
||||
$ sudo yum install ssmtp
|
||||
```
|
||||
|
||||
对于 **“Fedora”** 系统,使用 **[DNF 命令][6]** 安装 ssmtp。
|
||||
|
||||
```
|
||||
$ sudo dnf install ssmtp
|
||||
```
|
||||
|
||||
### 6a) Linux 使用 ssmtp 命令发送邮件
|
||||
|
||||
ssmtp 也是简单易用的。使用下面的 sendmail 命令格式发送邮件。
|
||||
|
||||
```
|
||||
$ echo -e "Subject: Test Mail\nThis is the mail body" > /tmp/ssmtp-mail.txt
|
||||
```
|
||||
|
||||
```
|
||||
$ ssmtp [email protected] < /tmp/ssmtp-mail.txt
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/6-ways-to-send-email-from-the-linux-command-line/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[2]: https://www.2daygeek.com/wp-content/uploads/2019/12/smtp-simple-mail-transfer-protocol.png
|
||||
[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/
|
||||
[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/
|
||||
[5]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
|
||||
[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/
|
Loading…
Reference in New Issue
Block a user