mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
3e341129cd
@ -1,22 +1,25 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-10742-1.html)
|
||||
[#]: subject: (Parallel computation in Python with Dask)
|
||||
[#]: via: (https://opensource.com/article/19/4/parallel-computation-python-dask)
|
||||
[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez)
|
||||
|
||||
使用 Dask 在 Python 中进行并行计算
|
||||
======
|
||||
Dask 库将 Python 计算扩展到多个核心甚至是多台机器。
|
||||
|
||||
> Dask 库可以将 Python 计算扩展到多个核心甚至是多台机器。
|
||||
|
||||
![Pair programming][1]
|
||||
|
||||
关于 Python 性能的一个常见抱怨是[全局解释器锁][2](GIL)。由于 GIL,一次只能有一个线程执行 Python 字节码。因此,即使在现代的多核机器上,使用线程也不会加速计算。
|
||||
关于 Python 性能的一个常见抱怨是[全局解释器锁][2](GIL)。由于 GIL,同一时刻只能有一个线程执行 Python 字节码。因此,即使在现代的多核机器上,使用线程也不会加速计算。
|
||||
|
||||
但当你需要并行化到多核时,你不需要停止使用 Python:**[Dask][3]** 库可以将计算扩展到多个内核甚至多个机器。某些设置在数千台机器上配置 Dask,每台机器都有多个内核。虽然存在扩展限制,但并不容易达到。
|
||||
但当你需要并行化到多核时,你不需要放弃使用 Python:[Dask][3] 库可以将计算扩展到多个内核甚至多个机器。某些设置可以在数千台机器上配置 Dask,每台机器都有多个内核。虽然存在扩展规模的限制,但一般达不到。
|
||||
|
||||
虽然 Dask 有许多内置的数组操作,但举一个非内置的例子,我们可以计算[偏度][4]:
|
||||
|
||||
```
|
||||
import numpy
|
||||
import dask
|
||||
@ -31,11 +34,12 @@ skewness = ((unnormalized_moment - (3 * mean * stddev ** 2) - mean ** 3) /
|
||||
stddev ** 3)
|
||||
```
|
||||
|
||||
请注意,每个操作将根据需要使用尽可能多的内核。这将在所有核心上并行化,即使在计算数十亿个元素时也是如此。
|
||||
请注意,每个操作将根据需要使用尽可能多的内核。这将在所有核心上并行化执行,即使在计算数十亿个元素时也是如此。
|
||||
|
||||
当然,并不是我们所有的操作都可由库并行化,有时我们需要自己实现并行性。
|
||||
当然,并不是我们所有的操作都可由这个库并行化,有时我们需要自己实现并行性。
|
||||
|
||||
为此,Dask 有一个“延迟”功能:
|
||||
|
||||
```
|
||||
import dask
|
||||
|
||||
@ -47,9 +51,9 @@ total = dask.delayed(sum)(palindromes)
|
||||
result = total.compute()
|
||||
```
|
||||
|
||||
这将计算字符串是否是回文并返回回回文的数量。
|
||||
这将计算字符串是否是回文并返回回文的数量。
|
||||
|
||||
虽然 Dask 是为数据科学家创建的,但它绝不仅限于数据科学。每当我们需要在 Python 中并行化任务时,我们可以使用 Dask-有 GIL 或没有 GIL。
|
||||
虽然 Dask 是为数据科学家创建的,但它绝不仅限于数据科学。每当我们需要在 Python 中并行化任务时,我们可以使用 Dask —— 无论有没有 GIL。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -58,7 +62,7 @@ via: https://opensource.com/article/19/4/parallel-computation-python-dask
|
||||
作者:[Moshe Zadka (Community Moderator)][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,4 +1,3 @@
|
||||
DaivdMax2006 is translating
|
||||
100 Best Ubuntu Apps
|
||||
======
|
||||
|
||||
|
@ -1,78 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (tomjlw)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development)
|
||||
[#]: via: (https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all)
|
||||
[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/)
|
||||
|
||||
Cisco, Google reenergize multicloud/hybrid cloud joint development
|
||||
======
|
||||
Cisco, VMware, HPE and others tap into new Google Cloud Athos cloud technology
|
||||
![Thinkstock][1]
|
||||
|
||||
Cisco and Google have expanded their joint cloud-development activities to help customers more easily build secure multicloud and hybrid applications everywhere from on-premises data centers to public clouds.
|
||||
|
||||
**[Check out[what hybrid cloud computing is][2] and learn [what you need to know about multi-cloud][3]. Get regularly scheduled insights by [signing up for Network World newsletters][4]]**
|
||||
|
||||
The expansion centers around Google’s new open-source hybrid cloud package called Anthos, which was introduced at the company’s Google Next event this week. Anthos is based on – and supplants – the company's existing Google Cloud Service beta. Anthos will let customers run applications, unmodified, on existing on-premises hardware or in the public cloud and will be available on [Google Cloud Platform][5] (GCP) with [Google Kubernetes Engine][6] (GKE), and in data centers with [GKE On-Prem][7], the company says. Anthos will also let customers for the first time manage workloads running on third-party clouds such as AWS and Azure from the Google platform without requiring administrators and developers to learn different environments and APIs, Google said.
|
||||
|
||||
Essentially, Athos offers a single managed service that promises to let customers manage and deploy workloads across clouds, without having to worry about dissimilar environments or APIs.
|
||||
|
||||
As part of the rollout, Google also announced a beta program called[ Anthos Migrate][8] that Google says auto-migrates VMs from on-premises, or other clouds, directly into containers in GKE. “This unique migration technology lets you migrate and modernize your infrastructure in one streamlined motion, without upfront modifications to the original VMs or applications,” Google said. It gives companies the flexibility to move on-prem apps to a cloud environment at the customers pace, Google said.
|
||||
|
||||
### Cisco and Google
|
||||
|
||||
For its part Cisco announced support of Anthos and promised to tightly integrate it with Cisco data center-technologies, such as its HyperFlex hyperconverged package, Application Centric Infrastructure (Cisco’s flagship SDN offering), SD-WAN and Stealthwatch Cloud. The integrations will enable a consistent, cloud-like experience whether on-prem or in the cloud with automatic upgrades to the latest versions and security patches, Cisco stated.
|
||||
|
||||
"Google Cloud’s expertise in containerization and service mesh – Kubernetes and Istio, respectively – as well as their leadership in the developer community, combined with Cisco’s enterprise-class networking, compute, storage and security products and services makes for a winning combination for our customers," [wrote][9] Kip Compton, Cisco senior vice president, Cloud Platform and Solutions Group. “The Cisco integrations for Anthos will help customers build and manage multicloud and hybrid applications across their on-premises datacenters and public clouds and let them focus on innovation and agility without compromising security or increasing complexity.”
|
||||
|
||||
### Google Cloud and Cisco
|
||||
|
||||
Eyal Manor, vice president, engineering at Google Cloud, [wrote][10] that with Cisco’s support for Anthos, customers will be able to:
|
||||
|
||||
* Benefit from a fully-managed service, like GKE, and Cisco’s hyperconverged infrastructure, networking, and security technologies.
|
||||
* Operate consistently across an enterprise data center and the cloud.
|
||||
* Consume cloud services from an enterprise data center.
|
||||
* Modernize now on premises with the latest cloud technologies.
|
||||
|
||||
|
||||
|
||||
Cisco and Google have been working closely together since October 2017, when the companies said they were working on an open hybrid cloud platform that bridges on-premises and cloud environments. That package, [Cisco Hybrid Cloud Platform for Google Cloud][11], became generally available in September 2018. It lets customer develop enterprise-grade capabilities from Google Cloud-managed Kubernetes containers that include Cisco networking and security technology as well as service mesh monitoring from Istio.
|
||||
|
||||
Google says Istio’s open-source, container- and microservice-optimized technology offers developers a uniform way to connect, secure, manage and monitor microservices across clouds through service-to-service level mTLS [Mutual Transport Layer Security] authentication access control. As a result, customers can easily implement new, portable services and centrally configure and manage those services.
|
||||
|
||||
Cisco wasn’t the only vendor to announce support for Anthos. At least 30 other big Google partners including [VMware][12], [Dell EMC][13], [HPE][14], Intel, and Lenovo committed to delivering Anthos on their own hyperconverged infrastructure for their customers, Google stated.
|
||||
|
||||
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/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all
|
||||
|
||||
作者:[Michael Cooney][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[tomjlw](https://github.com/tomjlw)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Michael-Cooney/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://images.techhive.com/images/article/2016/12/hybrid_cloud-100700390-large.jpg
|
||||
[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html
|
||||
[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html
|
||||
[4]: https://www.networkworld.com/newsletters/signup.html
|
||||
[5]: https://cloud.google.com/
|
||||
[6]: https://cloud.google.com/kubernetes-engine/
|
||||
[7]: https://cloud.google.com/gke-on-prem/
|
||||
[8]: https://cloud.google.com/contact/
|
||||
[9]: https://blogs.cisco.com/news/next-phase-cisco-google-cloud
|
||||
[10]: https://cloud.google.com/blog/topics/partners/google-cloud-partners-with-cisco-on-hybrid-cloud-next19?utm_medium=unpaidsocial&utm_campaign=global-googlecloud-liveevent&utm_content=event-next
|
||||
[11]: https://cloud.google.com/cisco/
|
||||
[12]: https://blogs.vmware.com/networkvirtualization/2019/04/vmware-and-google-showcase-hybrid-cloud-deployment.html/
|
||||
[13]: https://www.dellemc.com/en-us/index.htm
|
||||
[14]: https://www.hpe.com/us/en/newsroom/blog-post/2019/04/hpe-and-google-cloud-join-forces-to-accelerate-innovation-with-hybrid-cloud-solutions-optimized-for-containerized-applications.html
|
||||
[15]: https://www.facebook.com/NetworkWorld/
|
||||
[16]: https://www.linkedin.com/company/network-world
|
@ -1,106 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip])
|
||||
[#]: via: (https://itsfoss.com/linux-zip-folder/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
How to Zip Files and Folders in Linux [Beginner Tip]
|
||||
======
|
||||
|
||||
_**Brief: This quick tip shows you how to create a zip folder in Ubuntu and other Linux distributions. Both terminal and GUI methods have been discussed.**_
|
||||
|
||||
Zip is one of the most popular archive file format out there. With zip, you can compress multiple files into one file. This not only saves disk space, it also saves network bandwidth. This is why you’ll encounter zip files almost all the time.
|
||||
|
||||
As a normal user, mostly you’ll unzip folders in Linux. But how do you zip a folder in Linux? This article helps you answer that question.
|
||||
|
||||
**Prerequisite: Verify if zip is installed**
|
||||
|
||||
Normally [zip][1] support is installed but no harm in verifying. You can run the below command to install zip and unzip support. If it’s not installed already, it will be installed now.
|
||||
|
||||
```
|
||||
sudo apt install zip unzip
|
||||
```
|
||||
|
||||
Now that you know your system has zip support, you can read on to learn how to zip a directory in Linux.
|
||||
|
||||
![][2]
|
||||
|
||||
### Zip a folder in Linux Command Line
|
||||
|
||||
The syntax for using the zip command is pretty straight forward.
|
||||
|
||||
```
|
||||
zip [option] output_file_name input1 input2
|
||||
```
|
||||
|
||||
While there could be several options, I don’t want you to confuse with them. If your only aim is to create a zip folder from a bunch of files and directories, use the command like this:
|
||||
|
||||
```
|
||||
zip -r output_file.zip file1 folder1
|
||||
```
|
||||
|
||||
The -r option will recurse into directories and compress its contents as well. The .zip extension in the output files is optional as .zip is added by default.
|
||||
|
||||
You should see the files being added to the compressed folder during the zip operation.
|
||||
|
||||
```
|
||||
zip -r myzip abhi-1.txt abhi-2.txt sample_directory
|
||||
adding: abhi-1.txt (stored 0%)
|
||||
adding: abhi-2.txt (stored 0%)
|
||||
adding: sample_directory/ (stored 0%)
|
||||
adding: sample_directory/newfile.txt (stored 0%)
|
||||
adding: sample_directory/agatha.txt (deflated 41%)
|
||||
```
|
||||
|
||||
You can use the -e option to [create a password protect zip folder in Linux][3].
|
||||
|
||||
You are not always restricted to the terminal for creating zip archive files. You can do that graphically as well. Here’s how!
|
||||
|
||||
### Zip a folder in Ubuntu Linux Using GUI
|
||||
|
||||
_Though I have used Ubuntu here, the method should be pretty much the same in other distributions using GNOME or other desktop environment._
|
||||
|
||||
If you want to compress a file or folder in desktop Linux, it’s just a matter of a few clicks.
|
||||
|
||||
Go to the folder where you have the desired files (and folders) you want to compress into one zip folder.
|
||||
|
||||
In here, select the files and folders. Now, right click and select Compress. You can do the same for a single file as well.
|
||||
|
||||
![Select the files, right click and click compress][4]
|
||||
|
||||
Now you can create a compressed archive file in zip, tar xz or 7z format. In case you are wondering, all these three are various compression algorithms that you can use for compressing your files.
|
||||
|
||||
Give it the name you desire and click on Create.
|
||||
|
||||
![Create archive file][5]
|
||||
|
||||
It shouldn’t take long and you should see an archive file in the same directory.
|
||||
|
||||
![][6]
|
||||
|
||||
Well, that’s it. You successfully created a zip folder in Linux.
|
||||
|
||||
I hope this quick little tip helped you with the zip files. Please feel free to share your suggestions.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/linux-zip-folder/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://en.wikipedia.org/wiki/Zip_(file_format)
|
||||
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-folder-linux.png?resize=800%2C450&ssl=1
|
||||
[3]: https://itsfoss.com/password-protect-zip-file/
|
||||
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-file-ubuntu.jpg?resize=800%2C428&ssl=1
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-folder-ubuntu-1.jpg?ssl=1
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-file-created-in-ubuntu.png?resize=800%2C277&ssl=1
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (MjSeven)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -0,0 +1,78 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (tomjlw)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development)
|
||||
[#]: via: (https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all)
|
||||
[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/)
|
||||
|
||||
思科、谷歌重新赋能多/混合云共同开发
|
||||
======
|
||||
思科,VMware,HPE 与其它公司踏入新的 Google Cloud Athos 云技术
|
||||
![Thinkstock][1]
|
||||
|
||||
思科与谷歌已扩展它们的混合云开发活动,以帮助其客户在从预置的数据中心到公共云上的任何地方更简便地搭建安全的多云以及混合云应用。
|
||||
|
||||
**[查看[什么是混合云计算][2]并了解[关于多云你所需要知道的][3]。[注册 Network World 速报][4]]以定时接受资讯**
|
||||
|
||||
这次扩张围绕着谷歌在这周的 Google Next 活动上介绍的新的称作 Anthos 的开源混合云包展开。Anthos 基于并取代了谷歌现有的谷歌云服务测试版。Anthos 将让客户们无须修改就可以在现有的预置硬件或公共云上运行应用。据谷歌说,它可以在[谷歌云平台][5] (GCP) 与 [谷歌 Kubernetes 引擎][6] (GKE) 或者在数据中心中与 [GKE On-Prem][7] 一同被获取。谷歌说,Anthos 首次让客户们可以无需管理员和开发者了解不同的坏境和 API 就能从谷歌平台上管理在第三方云上的工作负荷如 AWS 和 Azure。
|
||||
|
||||
关键在于,Athos 提供一个单独的受管理的服务,它使得客户们无须忧虑不相似的环境或 API 就能跨云管理、部署工作负荷。
|
||||
|
||||
作为首秀的一部分,谷歌也宣布一个能够从预置环境或者其它云自动移植虚拟机到 GKE 上的容器的叫做 [Anthos Migrate[8] 的测试项目。谷歌说,“这种独特的移植技术使你无须修改原来的虚拟机或者应用就能以一种行云流水般的方式迁移、更新你的基础架构”。谷歌称它给予了公司按客户节奏转移预置应用到云环境的灵活性。
|
||||
|
||||
### 思科和谷歌
|
||||
|
||||
就思科来说,它宣布对 Anthos 的支持并承诺将它紧密集成进思科的数据中心科技中,例如 HyperFlex 超融合包,应用中心基础架构(思科的旗舰 SDN 方案), SD-WAN 和 StealthWatch 云。思科说,无论是预置的还是在云端的,这次集成将通过自动更新到最新版本和安全补丁,给予一种一致的、云般的感觉。
|
||||
|
||||
“谷歌云在容器和服务网——分别在 Kubernetes 和 Istio——上的专业与它们在开发者社区的领导力,混合思科的企业级网络,计算,存储和安全产品及服务,将为我们的顾客促成一次强强联合。”思科的资深副总裁,云平台和解决方案小组的 Kip Compton 这样[写道][9],“思科对于 Anthos 的集成将会帮助顾客跨预置数据中心和公共云搭建、管理多云/混合云应用,并使得他们无须在安全上让步或者增加复杂性就能集中精力在创新与敏捷上。”
|
||||
|
||||
### 谷歌云和思科
|
||||
|
||||
Eyal Manor,在谷歌云工作的副总裁,[写道][10] 通过思科对 Anthos 的支持,客户将能够:
|
||||
* 从完全受管理的服务例如 GKE 以及思科的超融合基础架构,网络和安全科技中收益。
|
||||
* 具有一致性地跨企业数据中心和云操作
|
||||
* 从一个企业数据中心消耗云服务
|
||||
* 用最新的云技术更新预置架构
|
||||
|
||||
|
||||
|
||||
思科和谷歌从2017年10月两公司说他们将从事能够连接预置架构和云环境的开放混合云平台就开始紧密合作。那个包,[为谷歌云打造的思科混合云平台],大致在2018年9月可以获取。它使得客户们能通过谷歌云管理的包含思科网络和安全以及来自 Istio 的服务网络监听技术的 Kubernetes 容器拥有企业级开发的能力。
|
||||
|
||||
谷歌说 Istio 的开源容器和微服务优化科技给开发者提供了通过服务到服务级的 mTLS [双向传输层安全]访问控制认证进行跨云连接,保护,管理和监听微服务的同一方式。其结果就是,客户能够轻松落实新的便携的服务同时也能够中心化地配置管理那些服务。
|
||||
|
||||
思科不是唯一宣布对 Anthos 的支持的供应商。谷歌宣称至少30家大的谷歌合作商包括 [VMware][12],[Dell EMC][13], [HPE][14], Intel 和 Lenovo 致力于为他们的客户在它们自己的超融合基础架构上分发 Anthos 服务。
|
||||
|
||||
在 [Facebook][15] 和 [LinkedIn][16] 上加入 Network World 社区以对高端话题评论。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all
|
||||
|
||||
作者:[Michael Cooney][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[tomjlw](https://github.com/tomjlw)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Michael-Cooney/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://images.techhive.com/images/article/2016/12/hybrid_cloud-100700390-large.jpg
|
||||
[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html
|
||||
[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html
|
||||
[4]: https://www.networkworld.com/newsletters/signup.html
|
||||
[5]: https://cloud.google.com/
|
||||
[6]: https://cloud.google.com/kubernetes-engine/
|
||||
[7]: https://cloud.google.com/gke-on-prem/
|
||||
[8]: https://cloud.google.com/contact/
|
||||
[9]: https://blogs.cisco.com/news/next-phase-cisco-google-cloud
|
||||
[10]: https://cloud.google.com/blog/topics/partners/google-cloud-partners-with-cisco-on-hybrid-cloud-next19?utm_medium=unpaidsocial&utm_campaign=global-googlecloud-liveevent&utm_content=event-next
|
||||
[11]: https://cloud.google.com/cisco/
|
||||
[12]: https://blogs.vmware.com/networkvirtualization/2019/04/vmware-and-google-showcase-hybrid-cloud-deployment.html/
|
||||
[13]: https://www.dellemc.com/en-us/index.htm
|
||||
[14]: https://www.hpe.com/us/en/newsroom/blog-post/2019/04/hpe-and-google-cloud-join-forces-to-accelerate-innovation-with-hybrid-cloud-solutions-optimized-for-containerized-applications.html
|
||||
[15]: https://www.facebook.com/NetworkWorld/
|
||||
[16]: https://www.linkedin.com/company/network-world
|
||||
|
@ -0,0 +1,106 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip])
|
||||
[#]: via: (https://itsfoss.com/linux-zip-folder/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
如何在 Linux 中 zip 压缩文件和文件夹(初学者提示)
|
||||
======
|
||||
|
||||
_ **简介:本文向你展示了如何在 Ubuntu 和其他 Linux 发行版中创建一个 zip 文件夹。终端和 GUI 方法都有。** _
|
||||
|
||||
zip 是最流行的归档文件格式之一。使用 zip,你可以将多个文件压缩到一个文件中。这不仅节省了磁盘空间,还节省了网络带宽。这就是为什么你几乎一直会看到 zip 文件的原因。
|
||||
|
||||
作为普通用户,大多数情况下你会在 Linux 中解压缩文件夹。但是如何在 Linux 中压缩文件夹?本文可以帮助你回答这个问题。
|
||||
|
||||
**先决条件:验证是否安装了 zip**
|
||||
|
||||
通常 [zip][1] 已经安装,但验证下也没坏处。你可以运行以下命令来安装 zip 和 unzip。如果它尚未安装,它将立即安装。
|
||||
|
||||
```
|
||||
sudo apt install zip unzip
|
||||
```
|
||||
|
||||
现在你知道你的系统有 zip 支持,你可以继续了解如何在 Linux 中压缩一个目录。
|
||||
|
||||
![][2]
|
||||
|
||||
### 在 Linux 命令行中压缩文件夹
|
||||
|
||||
zip 命令的语法非常简单。
|
||||
|
||||
```
|
||||
zip [option] output_file_name input1 input2
|
||||
```
|
||||
|
||||
虽然有几个选项,但我不希望你将它们混淆。如果你只想要将一堆文件变成一个 zip 文件夹,请使用如下命令:
|
||||
|
||||
```
|
||||
zip -r output_file.zip file1 folder1
|
||||
```
|
||||
|
||||
-r 选项将递归目录并压缩其内容。输出文件中的 .zip 扩展名是可选的,因为默认情况下会添加 .zip。
|
||||
|
||||
你应该会在 zip 操作期间看到要添加到压缩文件夹中的文件。
|
||||
|
||||
```
|
||||
zip -r myzip abhi-1.txt abhi-2.txt sample_directory
|
||||
adding: abhi-1.txt (stored 0%)
|
||||
adding: abhi-2.txt (stored 0%)
|
||||
adding: sample_directory/ (stored 0%)
|
||||
adding: sample_directory/newfile.txt (stored 0%)
|
||||
adding: sample_directory/agatha.txt (deflated 41%)
|
||||
```
|
||||
|
||||
你可以使用 -e 选项[在 Linux 中创建密码保护的 zip 文件夹][3]。
|
||||
|
||||
你并不是只能通过终端创建 zip 归档文件。你也可以用图形方式做到这一点。下面是如何做的!
|
||||
|
||||
### 在 Ubuntu Linux 中使用 GUI 压缩文件夹
|
||||
|
||||
_虽然我在这里使用 Ubuntu,但在使用 GNOME 或其他桌面环境的其他发行版中,方法应该基本相同。_
|
||||
|
||||
如果要在 Linux 桌面中压缩文件或文件夹,只需点击几下即可。
|
||||
|
||||
进入到你想将文件(和文件夹)压缩到一个 zip 文件夹的所在文件夹。
|
||||
|
||||
在这里,选择文件和文件夹。现在,右键单击并选择“压缩”。你也可以对单个文件执行相同操作。
|
||||
|
||||
![Select the files, right click and click compress][4]
|
||||
|
||||
现在,你可以使用 zip、tar xz 或 7z 格式创建压缩归档文件。如果你好奇,这三个都是各种压缩算法,你可以使用它们来压缩文件。
|
||||
|
||||
输入一个你想要的名字,并点击“创建”
|
||||
|
||||
![Create archive file][5]
|
||||
|
||||
这不会花很长时间,你会同一目录中看到一个归档文件。
|
||||
|
||||
![][6]
|
||||
|
||||
好了,就是这些。你已经成功地在 Linux 中创建了一个 zip 文件夹。
|
||||
|
||||
我希望这篇文章能帮助你了解 zip 文件。请随时分享你的建议。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/linux-zip-folder/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://en.wikipedia.org/wiki/Zip_(file_format)
|
||||
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-folder-linux.png?resize=800%2C450&ssl=1
|
||||
[3]: https://itsfoss.com/password-protect-zip-file/
|
||||
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-file-ubuntu.jpg?resize=800%2C428&ssl=1
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-folder-ubuntu-1.jpg?ssl=1
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-file-created-in-ubuntu.png?resize=800%2C277&ssl=1
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (zgj1024)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
@ -7,86 +7,83 @@
|
||||
[#]: via: (https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative
|
||||
HTTPie – 替代 Curl 和 Wget 的现代 HTTP 命令行客户端
|
||||
======
|
||||
|
||||
Most of the time we use Curl Command or Wget Command for file download and other purpose.
|
||||
大多数时间我们会使用 Curl 命令或是 Wget 命令下载文件或者做其他事
|
||||
|
||||
We had written **[best command line download manager][1]** in the past. You can navigate those articles by clicking the corresponding URLs.
|
||||
我们以前曾写过 **[最佳命令行下载管理器][1]** 的文章。你可以点击相应的 URL 连接来浏览这些文章。
|
||||
|
||||
* **[aria2 – A Command Line Multi-Protocol Download Tool For Linux][2]**
|
||||
* **[Axel – A Lightweight Command Line Download Accelerator For Linux][3]**
|
||||
* **[Wget – A Standard Command Line Download Utility For Linux][4]**
|
||||
* **[curl – A Nifty Command Line Download Tool For Linux][5]**
|
||||
* **[aria2 – Linux 下的多协议命令行下载工具][2]**
|
||||
* **[Axel – Linux 下的轻量级命令行下载加速器][3]**
|
||||
* **[Wget – Linux 下的标准命令行下载工具][4]**
|
||||
* **[curl – Linux 下的实用的命令行下载工具][5]**
|
||||
|
||||
|
||||
今天我们将讨论同样的话题。实用程序名为 HTTPie。
|
||||
|
||||
Today we are going to discuss about the same kind of topic. The utility name is HTTPie.
|
||||
它是现代命令行 http 客户端,也是curl和wget命令的最佳替代品。
|
||||
|
||||
It’s modern command line http client and best alternative for curl and wget commands.
|
||||
### 什么是 HTTPie?
|
||||
|
||||
### What Is HTTPie?
|
||||
HTTPie (发音是 aitch-tee-tee-pie) 是一个 Http 命令行客户端。
|
||||
|
||||
HTTPie (pronounced aitch-tee-tee-pie) is a command line HTTP client.
|
||||
httpie 工具是现代命令的 HTTP 客户端,它能让命令行界面与 Web 服务进行交互。
|
||||
|
||||
The httpie tool is a modern command line http client which makes CLI interaction with web services.
|
||||
他提供一个简单 Http 命令,运行使用简单而自然的语法发送任意的 HTTP 请求,并会显示彩色的输出。
|
||||
|
||||
It provides a simple http command that allows for sending arbitrary HTTP requests using a simple and natural syntax, and displays colorized output.
|
||||
HTTPie 能用于测试、debugging及与 HTTP 服务器交互。
|
||||
|
||||
HTTPie can be used for testing, debugging, and generally interacting with HTTP servers.
|
||||
### 主要特点
|
||||
|
||||
### Main Features
|
||||
* 具表达力的和直观语法
|
||||
* 格式化的及彩色化的终端输出
|
||||
* 内置 JSON 支持
|
||||
* 表单和文件上传
|
||||
* HTTPS, 代理, 和认证
|
||||
* 任意请求数据
|
||||
* 自定义头部
|
||||
* 持久化会话(sessions)
|
||||
* 类似 wget 的下载
|
||||
* 支持 Python 2.7 和 3.x
|
||||
|
||||
* Expressive and intuitive syntax
|
||||
* Formatted and colorized terminal output
|
||||
* Built-in JSON support
|
||||
* Forms and file uploads
|
||||
* HTTPS, proxies, and authentication
|
||||
* Arbitrary request data
|
||||
* Custom headers
|
||||
* Persistent sessions
|
||||
* Wget-like downloads
|
||||
* Python 2.7 and 3.x support
|
||||
### 在 Linux 下如何安装 HTTPie
|
||||
|
||||
大部分 Linux 发行版都提供了系统包管理器,可以用它来安装。
|
||||
|
||||
|
||||
### How To Install HTTPie In Linux?
|
||||
|
||||
Most Linux distributions provide a package that can be installed using the system package manager.
|
||||
|
||||
For **`Fedora`** system, use **[DNF Command][6]** to install httpie.
|
||||
**`Fedora`** 系统,使用 **[DNF 命令][6]** 来安装 httpie
|
||||
|
||||
```
|
||||
$ sudo dnf install httpie
|
||||
```
|
||||
|
||||
For **`Debian/Ubuntu`** systems, use **[APT-GET Command][7]** or **[APT Command][8]** to install httpie.
|
||||
**`Debian/Ubuntu`** 系统, 使用 **[APT-GET 命令][7]** 或 **[APT 命令][8]** 来安装 httpie。
|
||||
|
||||
```
|
||||
$ sudo apt install httpie
|
||||
```
|
||||
|
||||
For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install httpie.
|
||||
基于 **`Arch Linux`** 的系统, 使用 **[Pacman 命令][9]** 来安装 httpie。
|
||||
|
||||
```
|
||||
$ sudo pacman -S httpie
|
||||
```
|
||||
|
||||
For **`RHEL/CentOS`** systems, use **[YUM Command][10]** to install httpie.
|
||||
**`RHEL/CentOS`** 的系统, 使用 **[YUM 命令][10]** 来安装 httpie。
|
||||
|
||||
```
|
||||
$ sudo yum install httpie
|
||||
```
|
||||
|
||||
For **`openSUSE Leap`** system, use **[Zypper Command][11]** to install httpie.
|
||||
**`openSUSE Leap`** 系统, 使用 **[Zypper 命令][11]** 来安装 httpie。
|
||||
|
||||
```
|
||||
$ sudo zypper install httpie
|
||||
```
|
||||
|
||||
### 1) How To Request A URL Using HTTPie?
|
||||
### 1) 如何使用 HTTPie 请求URL?
|
||||
|
||||
The basic usage of httpie is to request a website URL as an argument.
|
||||
httpie 的基本用法是将网站的 URL 作为参数。
|
||||
|
||||
```
|
||||
# http 2daygeek.com
|
||||
@ -102,9 +99,9 @@ Transfer-Encoding: chunked
|
||||
Vary: Accept-Encoding
|
||||
```
|
||||
|
||||
### 2) How To Download A File Using HTTPie?
|
||||
### 2) 如何使用 HTTPie 下载文件
|
||||
|
||||
You can download a file using HTTPie with the `--download` parameter. This is similar to wget command.
|
||||
你可以使用带 `--download` 参数的 HTTPie 命令下载文件。类似于 wget 命令。
|
||||
|
||||
```
|
||||
# http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png
|
||||
@ -128,7 +125,7 @@ Downloading 31.31 kB to "Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png"
|
||||
Done. 31.31 kB in 0.01187s (2.58 MB/s)
|
||||
```
|
||||
|
||||
Alternatively you can save the output file with different name by using `-o` parameter.
|
||||
你还可以使用 `-o` 参数用不同的名称保存输出文件。
|
||||
|
||||
```
|
||||
# http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png -o Anbox-1.png
|
||||
@ -151,11 +148,10 @@ Vary: Accept-Encoding
|
||||
Downloading 31.31 kB to "Anbox-1.png"
|
||||
Done. 31.31 kB in 0.01551s (1.97 MB/s)
|
||||
```
|
||||
如何使用HTTPie恢复部分下载?
|
||||
### 3) 如何使用 HTTPie 恢复部分下载?
|
||||
|
||||
### 3) How To Resume Partial Download Using HTTPie?
|
||||
|
||||
You can resume the download using HTTPie with the `-c` parameter.
|
||||
|
||||
你可以使用带 `-c` 参数的 HTTPie 继续下载。
|
||||
```
|
||||
# http --download --continue https://speed.hetzner.de/100MB.bin -o 100MB.bin
|
||||
HTTP/1.1 206 Partial Content
|
||||
@ -173,24 +169,24 @@ Downloading 100.00 MB to "100MB.bin"
|
||||
| 24.14 % 24.14 MB 1.12 MB/s 0:01:07 ETA^C
|
||||
```
|
||||
|
||||
You can verify the same in the below output.
|
||||
|
||||
你根据下面的输出验证是否同一个文件
|
||||
```
|
||||
[email protected]:/var/log# ls -lhtr 100MB.bin
|
||||
-rw-r--r-- 1 root root 25M Apr 9 01:33 100MB.bin
|
||||
```
|
||||
|
||||
### 5) How To Upload A File Using HTTPie?
|
||||
### 5) 如何使用 HTTPie 上传文件?
|
||||
|
||||
你可以通过使用带有 `小于号 "<"` 的 HTTPie 命令上传文件
|
||||
You can upload a file using HTTPie with the `less-than symbol "<"` symbol.
|
||||
|
||||
```
|
||||
$ http https://transfer.sh < Anbox-1.png
|
||||
```
|
||||
|
||||
### 6) How To Download A File Using HTTPie With Redirect Symbol ">"?
|
||||
### 6) 如何使用带有重定向符号">" 的 HTTPie 下载文件?
|
||||
|
||||
You can download a file using HTTPie with the `redirect ">"` symbol.
|
||||
你可以使用带有 `重定向 ">"` 符号的 HTTPie 命令下载文件。
|
||||
|
||||
```
|
||||
# http https://www.2daygeek.com/wp-content/uploads/2019/03/How-To-Install-And-Enable-Flatpak-Support-On-Linux-1.png > Flatpak.png
|
||||
@ -199,9 +195,10 @@ You can download a file using HTTPie with the `redirect ">"` symbol.
|
||||
-rw-r--r-- 1 root root 47K Apr 9 01:44 Flatpak.png
|
||||
```
|
||||
|
||||
### 7) Send a HTTP GET Method?
|
||||
### 7) 发送一个 HTTP GET 请求?
|
||||
|
||||
您可以在请求中发送 HTTP GET 方法。GET 方法会使用给定的 URI,从给定服务器检索信息。
|
||||
|
||||
You can send a HTTP GET method in the request. The GET method is used to retrieve information from the given server using a given URI.
|
||||
|
||||
```
|
||||
# http GET httpie.org
|
||||
@ -217,9 +214,9 @@ Transfer-Encoding: chunked
|
||||
Vary: Accept-Encoding
|
||||
```
|
||||
|
||||
### 8) Submit A Form?
|
||||
### 8) 提交表单?
|
||||
|
||||
Use the following format to Submit a forms. A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms.
|
||||
使用以下格式提交表单。POST 请求用于向服务器发送数据,例如客户信息、文件上传等。要使用 HTML 表单。
|
||||
|
||||
```
|
||||
# http -f POST Ubuntu18.2daygeek.com hello='World'
|
||||
@ -237,7 +234,7 @@ Server: Apache/2.4.29 (Ubuntu)
|
||||
Vary: Accept-Encoding
|
||||
```
|
||||
|
||||
Run the following command to see the request that is being sent.
|
||||
运行下面的指令以查看正在发送的请求。
|
||||
|
||||
```
|
||||
# http -v Ubuntu18.2daygeek.com
|
||||
@ -264,24 +261,24 @@ Server: Apache/2.4.29 (Ubuntu)
|
||||
Vary: Accept-Encoding
|
||||
```
|
||||
|
||||
### 9) HTTP Authentication?
|
||||
### 9) HTTP 认证?
|
||||
|
||||
当前支持的身份验证认证方案是基本认证(Basic)和摘要验证(Digest)
|
||||
The currently supported authentication schemes are Basic and Digest
|
||||
|
||||
Basic auth
|
||||
基本认证
|
||||
|
||||
```
|
||||
$ http -a username:password example.org
|
||||
```
|
||||
|
||||
Digest auth
|
||||
摘要验证
|
||||
|
||||
```
|
||||
$ http -A digest -a username:password example.org
|
||||
```
|
||||
|
||||
Password prompt
|
||||
|
||||
提示输入密码
|
||||
```
|
||||
$ http -a username example.org
|
||||
```
|
||||
@ -292,7 +289,7 @@ via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[译者ID](https://github.com/zgj1024)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
@ -309,4 +306,4 @@ via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/
|
||||
[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/
|
||||
[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/
|
||||
[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
|
||||
[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/
|
||||
[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/
|
Loading…
Reference in New Issue
Block a user