mirror of
https://github.com/LCTT/TranslateProject.git
synced 2026-08-29 04:23:33 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
@@ -1,40 +1,38 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12791-1.html)
|
||||
[#]: subject: (Start using virtual tables in Apache Cassandra 4.0)
|
||||
[#]: via: (https://opensource.com/article/20/10/virtual-tables-apache-cassandra)
|
||||
[#]: author: (Ben Bromhead https://opensource.com/users/ben-bromhead)
|
||||
|
||||
开始在 Apache Cassandra 4.0 中使用虚拟表
|
||||
如何在 Apache Cassandra 4.0 中使用虚拟表
|
||||
======
|
||||
它们是什么以及如何使用它们。
|
||||
![Computer laptop in space][1]
|
||||
|
||||
在最近的 [Apache Cassandra 4.0 测试版][3]中的[众多新增功能][2]中,虚拟表是一个值得关注的功能。
|
||||
> 虚拟表是什么以及如何使用。
|
||||
|
||||
在以前的 Cassandra 版本中,用户需要访问 Java 管理扩展 ([JMX][4]) 来检查 Cassandra 的细节,如运行中的压缩、客户端、度量和各种配置设置。虚拟表消除了这些挑战。Cassandra 4.0 测试版使用户能够从一个只读的系统表中以 Cassandra 查询语言 (CQL) 行的形式查询这些细节和数据。
|
||||

|
||||
|
||||
以下是之前 Cassandra 版本中基于 JMX 的机制是如何工作的。想象一下,一个用户想要检查集群中某个节点的压缩状态。用户首先要建立一个 JMX 连接,在节点上运行 `nodetool compactionstats`。这个要求给用户带来了一些复杂的问题。用户的客户端是否配置了 JMX 访问?Cassandra 节点和防火墙是否配置为允许 JMX 访问?是否准备好了适当的安全和审计措施,并落实到位?这些只是用户在处理 Cassandra 以前版本时不得不面对的一些问题。
|
||||
在最近的发布的 [Apache Cassandra 4.0 测试版][3]中的[众多新增功能][2]中,<ruby>虚拟表<rt>virtual table</rt></ruby>是一个值得关注的功能。
|
||||
|
||||
在以前的 Cassandra 版本中,用户需要访问 <ruby>Java 管理扩展<rt>Java Management Extensions</rt></ruby>([JMX][4]) 来查看 Cassandra 的细节,如运行中的<ruby>压实<rt>compaction</rt></ruby>、客户端、度量和各种配置设置。虚拟表消除了这些挑战。Cassandra 4.0 测试版让用户能够从一个只读的系统表中以 <ruby>Cassandra 查询语言<rt>Cassandra Query Language</rt></ruby>(CQL)行的形式查询这些细节和数据。
|
||||
|
||||
以下是之前 Cassandra 版本中基于 JMX 的机制是如何工作的。想象一下,一个用户想要检查集群中某个节点的压实状态。用户首先要建立一个 JMX 连接,在节点上运行 `nodetool compactionstats`。这个要求马上就给用户带来了一些复杂的问题。用户的客户端是否配置了 JMX 访问?Cassandra 节点和防火墙是否配置为允许 JMX 访问?是否准备好了适当的安全和审计措施,并落实到位?这些只是用户在处理 Cassandra 以前版本时必须面对的其中一些问题。
|
||||
|
||||
在 Cassandra 4.0 中,虚拟表使得用户可以利用之前配置的驱动来查询所需信息。这一变化消除了与实现和维护 JMX 访问相关的所有开销。
|
||||
|
||||
Cassandra 4.0 创建了两个新的键空间来帮助用户利用虚拟表:`system_views` 和 `system_virtual_schema`。`system_views` 键空间包含了用户查询的所有有价值的信息,有用地存储在一些表中。`system_virtual_schema` 键空间,顾名思义,存储了这些虚拟表的所有必要的模式信息。
|
||||
Cassandra 4.0 创建了两个新的<ruby>键空间<rt>keyspace</rt></ruby>来帮助用户利用虚拟表:`system_views` 和 `system_virtual_schema`。`system_views` 键空间包含了用户查询的所有有价值的信息,有用地存储在一些表中。`system_virtual_schema` 键空间,顾名思义,存储了这些虚拟表的所有必要的模式信息。
|
||||
|
||||
![system_views and system_virtual_schema keyspaces and tables][5]
|
||||
|
||||
(Ben Bromhead, [CC BY-SA 4.0][6])
|
||||
重要的是要明白,每个虚拟表的范围仅限于其节点。任何虚拟表查询都将返回的数据,只对其协调器的节点有效,而不管一致性如何。为了简化这一要求,已经在几个驱动中添加了支持,以便在这些查询中指定协调器节点 (Python、DataStax Java 和其他驱动现在提供了这种支持)。
|
||||
|
||||
重要的是要明白,每个虚拟表的范围仅限于其节点。任何虚拟表查询都将返回只对作为其协调器的节点有效的数据,而不管一致性如何。为了简化这一要求,已经在几个驱动中添加了支持,以便在这些查询中指定协调器节点 (Python、DataStax Java 和其他驱动现在提供了这种支持)。
|
||||
|
||||
为了说明这一点,请检查这个 `sstable_tasks` 虚拟表。这个虚拟表显示了对 [SSTables][7] 的所有操作,包括压缩、清理、升级等。
|
||||
为了说明这一点,请查看这个 `sstable_tasks` 虚拟表。这个虚拟表显示了对 [SSTables][7] 的所有操作,包括压实、清理、升级等。
|
||||
|
||||
![Querying the sstable_tasks virtual table][8]
|
||||
|
||||
(Ben Bromhead, [CC BY-SA 4.0][6])
|
||||
|
||||
如果用户在以前的 Cassandra 版本中运行 `nodetool compactionstats`,则会显示相同类型的信息。 在这里,查询发现该节点当前有一个活动的压缩。它还显示了它的进度以及它的键空间和表。得益于虚拟表,用户可以快速收集这些信息,并同样有效地获得正确诊断集群健康状况所需的能力。
|
||||
如果用户在以前的 Cassandra 版本中运行 `nodetool compactionstats`,则会显示相同类型的信息。 在这里,这个查询发现该节点当前有一个活动的压缩。它还显示了它的进度以及它的键空间和表。得益于虚拟表,用户可以快速收集这些信息,并同样有效地获得正确诊断集群健康状况所需的能力。
|
||||
|
||||
需要说明的是,Cassandra 4.0 并没有去除对 JMX 访问的需求。JMX 仍然是查询某些指标的唯一选择。尽管如此,用户会欢迎简单地使用 CQL 来获取关键集群指标的能力。由于虚拟表提供的便利,用户可能会将之前投入到 JMX 工具的时间和资源重新投入到 Cassandra 本身。客户端工具也应该开始利用虚拟表提供的优势。
|
||||
|
||||
@@ -47,7 +45,7 @@ via: https://opensource.com/article/20/10/virtual-tables-apache-cassandra
|
||||
作者:[Ben Bromhead][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12793-1.html)
|
||||
[#]: subject: (The New Raspberry Pi 400 is Basically a Tiny Computer Inside a Keyboard)
|
||||
[#]: via: (https://itsfoss.com/raspberry-pi-400/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
新的树莓派 400:一台藏身于键盘内微型计算机
|
||||
======
|
||||
|
||||
树莓派是什么已经无需介绍。这台起初是为 DIY 爱好者打造的低规格电脑,现在可以作为全功能桌面使用了。
|
||||
|
||||
随着树莓派 400 的发布,使得它更加适合作为家庭电脑使用。树莓派 400 基本上是一台藏身于键盘内微型计算机。
|
||||
|
||||
如果你还记得,[Commodore 64][1] 在 1982 年时也是一台键盘形式的电脑。尽管树莓派 400 并不是独一无二的,但对于树莓派这样的成功产品来说,这是一个令人心仪的产品。
|
||||
|
||||
### 树莓派 400 概观
|
||||
|
||||
![][2]
|
||||
|
||||
它是基于树莓派 4 的(带有 4GB 内存),并已调整附加了冷却器。它采用四核处理器,速度比以往更快。
|
||||
|
||||
除了易用性和便携性,它还可以为你节省很多桌面空间。而且,就像我一样,如果你打算买一台备用电脑来测试东西,我想我可能会选择树莓派 400,而不是组装另一台 PC 或[基于 Linux 的迷你 PC][3]。
|
||||
|
||||
尽管我在下面提到了它的技术规格,但你可以观看官方视频来了解它的外观,以及它所承诺的是否可以满足作为你的家用电脑的需求。
|
||||
|
||||

|
||||
|
||||
### 树莓派 400 技术规格
|
||||
|
||||
* 博通 BCM2711 四核 Cortex-A72(ARM v8)64 位 SoC @ 1.8GHz
|
||||
* 4GB LPDDR4-3200
|
||||
* 双频(2.4GHz 和 5.0GHz)IEEE 802.11b/g/n/ac 无线局域网
|
||||
* 蓝牙 5.0,BLE
|
||||
* 千兆以太网
|
||||
* 2 个 USB 3.0 和 1 个 USB 2.0 端口
|
||||
* 水平 40 针 GPIO 头
|
||||
* 2 个 micro HDMI 端口(支持最高 4Kp60)
|
||||
* H.265(4Kp60 解码);H.264(1080p60 解码,1080p30 编码);OpenGL ES 3.0 图形
|
||||
* micro SD 卡插槽,用于操作系统和数据存储
|
||||
* 78 或 79 键的小型键盘(取决于地区差异)
|
||||
* 5V DC,通过 USB 连接器
|
||||
* 工作温度:环境温度 0℃ 至 +50℃。
|
||||
* 最大尺寸 286 毫米 × 122 毫米 × 23 毫米
|
||||
|
||||
![][4]
|
||||
|
||||
### 定价与供应
|
||||
|
||||
这是你付出 **70** 美元,所能得到的最好的现代家用电脑,只需一个键盘就可以简单的携带到任何地方(你只需要一个屏幕连接)。
|
||||
|
||||
你可以花 70 美元只买树莓派 400,也可以花 100 美元买完整的套装,它还包括一个 USB 鼠标、micro HDMI 转 HDMI 线、USB-C 电源、一本初学者指南和一张预装了树莓派操作系统的 SD 卡。
|
||||
|
||||
如果你想知道,对于键盘布局的支持,新闻稿中是这样提到的:
|
||||
|
||||
> 在发布时,我们支持英语(英国和美国)、法语、意大利语、德语和西班牙语的键盘布局,并(首次)提供翻译版的新手指南。在不久的将来,我们计划支持与我们的[官方键盘][5]相同的语言集。
|
||||
|
||||
换句话说,一开始他们就支持所有主要的键盘布局。所以,对于大多数人来说,这应该不是问题。
|
||||
|
||||
除了键盘布局的细节外,下面是你如何获得树莓派 400 的方法:
|
||||
|
||||
> 英国、美国和法国的树莓派 400 [套件][6]和[电脑][7]现在就可以购买。意大利、德国和西班牙的产品正在送往树莓派授权经销商的路上,他们应该在下周就会有货。
|
||||
>
|
||||
> 我们预计,印度、澳大利亚和新西兰的授权经销商将在今年年底前拿到套件和电脑。我们也在迅速推出其他地区的合规认证,因此树莓派 400 将在 2021 年的前几个月在全球范围内上市。
|
||||
>
|
||||
> 当然,如果你在剑桥附近的任何地方,你可以前往[树莓派商店][8],今天就可以领取你的树莓派 400。
|
||||
|
||||
- [树莓派 400][9]
|
||||
|
||||
### 总结
|
||||
|
||||
在远程办公成为新常态的当下,树莓派 400 绝对是令人印象深刻的好东西,也是非常有用的。
|
||||
|
||||
你对新的树莓派 400 有什么看法?打算买一台吗?在下面的评论中告诉我你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/raspberry-pi-400/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://en.wikipedia.org/wiki/Commodore_64
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/raspberry-pi-400.jpg?resize=800%2C554&ssl=1
|
||||
[3]: https://itsfoss.com/linux-based-mini-pc/
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/raspberry-pi-400-shot.jpeg?resize=800%2C572&ssl=1
|
||||
[5]: https://www.raspberrypi.org/products/raspberry-pi-keyboard-and-hub/
|
||||
[6]: https://www.raspberrypi.org/products/raspberry-pi-400/
|
||||
[7]: https://www.raspberrypi.org/products/raspberry-pi-400-unit/
|
||||
[8]: https://www.raspberrypi.org/raspberry-pi-store/
|
||||
[9]: https://www.raspberrypi.org/products/raspberry-pi-400
|
||||
@@ -0,0 +1,125 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Roy Fielding's Misappropriated REST Dissertation)
|
||||
[#]: via: (https://twobithistory.org/2020/06/28/rest.html)
|
||||
[#]: author: (Two-Bit History https://twobithistory.org)
|
||||
|
||||
Roy Fielding's Misappropriated REST Dissertation
|
||||
======
|
||||
|
||||
RESTful APIs are everywhere. This is funny, because how many people really know what “RESTful” is supposed to mean?
|
||||
|
||||
I think most of us can empathize with [this Hacker News poster][1]:
|
||||
|
||||
> I’ve read several articles about REST, even a bit of the original paper. But I still have quite a vague idea about what it is. I’m beginning to think that nobody knows, that it’s simply a very poorly defined concept.
|
||||
|
||||
I had planned to write a blog post exploring how REST came to be such a dominant paradigm for communication across the internet. I started my research by reading [Roy Fielding’s 2000 dissertation][2], which introduced REST to the world. After reading Fielding’s dissertation, I realized that the much more interesting story here is how Fielding’s ideas came to be so widely misunderstood.
|
||||
|
||||
Many more people know that Fielding’s dissertation is where REST came from than have read the dissertation (fair enough), so misconceptions about what the dissertation actually contains are pervasive.
|
||||
|
||||
The biggest of these misconceptions is that the dissertation directly addresses the problem of building APIs. I had always assumed, as I imagine many people do, that REST was intended from the get-go as an architectural model for web APIs built on top of HTTP. I thought perhaps that there had been some chaotic experimental period where people were building APIs on top of HTTP all wrong, and then Fielding came along and presented REST as the sane way to do things. But the timeline doesn’t make sense here: APIs for web services, in the sense that we know them today, weren’t a thing until a few years after Fielding published his dissertation.
|
||||
|
||||
Fielding’s dissertation (titled “Architectural Styles and the Design of Network-based Software Architectures”) is not about how to build APIs on top of HTTP but rather about HTTP itself. Fielding contributed to the HTTP/1.0 specification and co-authored the HTTP/1.1 specification, which was published in 1999. He was interested in the architectural lessons that could be drawn from the design of the HTTP protocol; his dissertation presents REST as a distillation of the architectural principles that guided the standardization process for HTTP/1.1. Fielding used these principles to make decisions about which proposals to incorporate into HTTP/1.1. For example, he rejected a proposal to batch requests using new `MGET` and `MHEAD` methods because he felt the proposal violated the constraints prescribed by REST, especially the constraint that messages in a REST system should be easy to proxy and cache.[1][3] So HTTP/1.1 was instead designed around persistent connections over which multiple HTTP requests can be sent. (Fielding also felt that cookies are not RESTful because they add state to what should be a stateless system, but their usage was already entrenched.[2][4]) REST, for Fielding, was not a guide to building HTTP-based systems but a guide to extending HTTP.
|
||||
|
||||
This isn’t to say that Fielding doesn’t think REST could be used to build other systems. It’s just that he assumes these other systems will also be “distributed hypermedia systems.” This is another misconception people have about REST: that it is a general architecture you can use for any kind of networked application. But you could sum up the part of the dissertation where Fielding introduces REST as, essentially, “Listen, we just designed HTTP, so if you also find yourself designing a _distributed hypermedia system_ you should use this cool architecture we worked out called REST to make things easier.” It’s not obvious why Fielding thinks anyone would ever attempt to build such a thing given that the web already exists; perhaps in 2000 it seemed like there was room for more than one distributed hypermedia system in the world. Anyway, Fielding makes clear that REST is intended as a solution for the scalability and consistency problems that arise when trying to connect hypermedia across the internet, _not_ as an architectural model for distributed applications in general.
|
||||
|
||||
We remember Fielding’s dissertation now as the dissertation that introduced REST, but really the dissertation is about how much one-size-fits-all software architectures suck, and how you can better pick a software architecture appropriate for your needs. Only a single chapter of the dissertation is devoted to REST itself; much of the word count is spent on a taxonomy of alternative architectural styles[3][5] that one could use for networked applications. Among these is the Pipe-and-Filter (PF) style, inspired by Unix pipes, along with various refinements of the Client-Server style (CS), such as Layered-Client-Server (LCS), Client-Cache-Stateless-Server (C$SS), and Layered-Client-Cache-Stateless-Server (LC$SS). The acronyms get unwieldy but Fielding’s point is that you can mix and match constraints imposed by existing styles to derive new styles. REST gets derived this way and could instead have been called—but for obvious reasons was not—Uniform-Layered-Code-on-Demand-Client-Cache-Stateless-Server (ULCODC$SS). Fielding establishes this taxonomy to emphasize that different constraints are appropriate for different applications and that this last group of constraints were the ones he felt worked best for HTTP.
|
||||
|
||||
This is the deep, deep irony of REST’s ubiquity today. REST gets blindly used for all sorts of networked applications now, but Fielding originally offered REST as an illustration of how to derive a software architecture tailored to an individual application’s particular needs.
|
||||
|
||||
I struggle to understand how this happened, because Fielding is so explicit about the pitfalls of not letting form follow function. He warns, almost at the very beginning of the dissertation, that “design-by-buzzword is a common occurrence” brought on by a failure to properly appreciate software architecture.[4][6] He picks up this theme again several pages later:
|
||||
|
||||
> Some architectural styles are often portrayed as “silver bullet” solutions for all forms of software. However, a good designer should select a style that matches the needs of a particular problem being solved.[5][7]
|
||||
|
||||
REST itself is an especially poor “silver bullet” solution, because, as Fielding later points out, it incorporates trade-offs that may not be appropriate unless you are building a distributed hypermedia application:
|
||||
|
||||
> REST is designed to be efficient for large-grain hypermedia data transfer, optimizing for the common case of the Web, but resulting in an interface that is not optimal for other forms of architectural interaction.[6][8]
|
||||
|
||||
Fielding came up with REST because the web posed a thorny problem of “anarchic scalability,” by which Fielding means the need to connect documents in a performant way across organizational and national boundaries. The constraints that REST imposes were carefully chosen to solve this anarchic scalability problem. Web service APIs that are _public-facing_ have to deal with a similar problem, so one can see why REST is relevant there. Yet today it would not be at all surprising to find that an engineering team has built a backend using REST even though the backend only talks to clients that the engineering team has full control over. We have all become the architect in [this Monty Python sketch][9], who designs an apartment building in the style of a slaughterhouse because slaughterhouses are the only thing he has experience building. (Fielding uses a line from this sketch as an epigraph for his dissertation: “Excuse me… did you say ‘knives’?”)
|
||||
|
||||
So, given that Fielding’s dissertation was all about avoiding silver bullet software architectures, how did REST become a de facto standard for web services of every kind?
|
||||
|
||||
My theory is that, in the mid-2000s, the people who were sick of SOAP and wanted to do something else needed their own four-letter acronym.
|
||||
|
||||
I’m only half-joking here. SOAP, or the Simple Object Access Protocol, is a verbose and complicated protocol that you cannot use without first understanding a bunch of interrelated XML specifications. Early web services offered APIs based on SOAP, but, as more and more APIs started being offered in the mid-2000s, software developers burned by SOAP’s complexity migrated away en masse.
|
||||
|
||||
Among this crowd, SOAP inspired contempt. Ruby-on-Rails dropped SOAP support in 2007, leading to this emblematic comment from Rails creator David Heinemeier Hansson: “We feel that SOAP is overly complicated. It’s been taken over by the enterprise people, and when that happens, usually nothing good comes of it.”[7][10] The “enterprise people” wanted everything to be formally specified, but the get-shit-done crowd saw that as a waste of time.
|
||||
|
||||
If the get-shit-done crowd wasn’t going to use SOAP, they still needed some standard way of doing things. Since everyone was using HTTP, and since everyone would keep using HTTP at least as a transport layer because of all the proxying and caching support, the simplest possible thing to do was just rely on HTTP’s existing semantics. So that’s what they did. They could have called their approach Fuck It, Overload HTTP (FIOH), and that would have been an accurate name, as anyone who has ever tried to decide what HTTP status code to return for a business logic error can attest. But that would have seemed recklessly blasé next to all the formal specification work that went into SOAP.
|
||||
|
||||
Luckily, there was this dissertation out there, written by a co-author of the HTTP/1.1 specification, that had something vaguely to do with extending HTTP and could offer FIOH a veneer of academic respectability. So REST was appropriated to give cover for what was really just FIOH.
|
||||
|
||||
I’m not saying that this is exactly how things happened, or that there was an actual conspiracy among irreverent startup types to misappropriate REST, but this story helps me understand how REST became a model for web service APIs when Fielding’s dissertation isn’t about web service APIs at all. Adopting REST’s constraints makes some sense, especially for public-facing APIs that do cross organizational boundaries and thus benefit from REST’s “uniform interface.” That link must have been the kernel of why REST first got mentioned in connection with building APIs on the web. But imagining a separate approach called “FIOH,” that borrowed the “REST” name partly just for marketing reasons, helps me account for the many disparities between what today we know as RESTful APIs and the REST architectural style that Fielding originally described.
|
||||
|
||||
REST purists often complain, for example, that so-called REST APIs aren’t actually REST APIs because they do not use Hypermedia as The Engine of Application State (HATEOAS). Fielding himself [has made this criticism][11]. According to him, a real REST API is supposed to allow you to navigate all its endpoints from a base endpoint by following links. If you think that people are actually out there trying to build REST APIs, then this is a glaring omission—HATEOAS really is fundamental to Fielding’s original conception of REST, especially considering that the “state transfer” in “Representational State Transfer” refers to navigating a state machine using hyperlinks between resources (and not, as many people seem to believe, to transferring resource state over the wire).[8][12] But if you imagine that everyone is just building FIOH APIs and advertising them, with a nudge and a wink, as REST APIs, or slightly more honestly as “RESTful” APIs, then of course HATEOAS is unimportant.
|
||||
|
||||
Similarly, you might be surprised to know that there is nothing in Fielding’s dissertation about which HTTP verb should map to which CRUD action, even though software developers like to argue endlessly about whether using PUT or PATCH to update a resource is more RESTful. Having a standard mapping of HTTP verbs to CRUD actions is a useful thing, but this standard mapping is part of FIOH and not part of REST.
|
||||
|
||||
This is why, rather than saying that nobody understands REST, we should just think of the term “REST” as having been misappropriated. The modern notion of a REST API has historical links to Fielding’s REST architecture, but really the two things are separate. The historical link is good to keep in mind as a guide for when to build a RESTful API. Does your API cross organizational and national boundaries the same way that HTTP needs to? Then building a RESTful API with a predictable, uniform interface might be the right approach. If not, it’s good to remember that Fielding favored having form follow function. Maybe something like GraphQL or even just JSON-RPC would be a better fit for what you are trying to accomplish.
|
||||
|
||||
_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][13] on Twitter or subscribe to the [RSS feed][14] to make sure you know when a new post is out._
|
||||
|
||||
_Previously on TwoBitHistory…_
|
||||
|
||||
> New post is up! I wrote about how to solve differential equations using an analog computer from the '30s mostly made out of gears. As a bonus there's even some stuff in here about how to aim very large artillery pieces.<https://t.co/fwswXymgZa>
|
||||
>
|
||||
> — TwoBitHistory (@TwoBitHistory) [April 6, 2020][15]
|
||||
|
||||
1. Roy Fielding. “Architectural Styles and the Design of Network-based Software Architectures,” 128. 2000. University of California, Irvine, PhD Dissertation, accessed June 28, 2020, <https://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation_2up.pdf>. [↩︎][16]
|
||||
|
||||
2. Fielding, 130. [↩︎][17]
|
||||
|
||||
3. Fielding distinguishes between software architectures and software architecture “styles.” REST is an architectural style that has an instantiation in the architecture of HTTP. [↩︎][18]
|
||||
|
||||
4. Fielding, 2. [↩︎][19]
|
||||
|
||||
5. Fielding, 15. [↩︎][20]
|
||||
|
||||
6. Fielding, 82. [↩︎][21]
|
||||
|
||||
7. Paul Krill. “Ruby on Rails 2.0 released for Web Apps,” InfoWorld. Dec 7, 2007, accessed June 28, 2020, <https://www.infoworld.com/article/2648925/ruby-on-rails-2-0-released-for-web-apps.html> [↩︎][22]
|
||||
|
||||
8. Fielding, 109. [↩︎][23]
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://twobithistory.org/2020/06/28/rest.html
|
||||
|
||||
作者:[Two-Bit History][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://twobithistory.org
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://news.ycombinator.com/item?id=7201871
|
||||
[2]: https://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation_2up.pdf
|
||||
[3]: tmp.o6JUcKs91D#fn:1
|
||||
[4]: tmp.o6JUcKs91D#fn:2
|
||||
[5]: tmp.o6JUcKs91D#fn:3
|
||||
[6]: tmp.o6JUcKs91D#fn:4
|
||||
[7]: tmp.o6JUcKs91D#fn:5
|
||||
[8]: tmp.o6JUcKs91D#fn:6
|
||||
[9]: https://www.youtube.com/watch?v=vNoPJqm3DAY
|
||||
[10]: tmp.o6JUcKs91D#fn:7
|
||||
[11]: https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
|
||||
[12]: tmp.o6JUcKs91D#fn:8
|
||||
[13]: https://twitter.com/TwoBitHistory
|
||||
[14]: https://twobithistory.org/feed.xml
|
||||
[15]: https://twitter.com/TwoBitHistory/status/1247187881946275841?ref_src=twsrc%5Etfw
|
||||
[16]: tmp.o6JUcKs91D#fnref:1
|
||||
[17]: tmp.o6JUcKs91D#fnref:2
|
||||
[18]: tmp.o6JUcKs91D#fnref:3
|
||||
[19]: tmp.o6JUcKs91D#fnref:4
|
||||
[20]: tmp.o6JUcKs91D#fnref:5
|
||||
[21]: tmp.o6JUcKs91D#fnref:6
|
||||
[22]: tmp.o6JUcKs91D#fnref:7
|
||||
[23]: tmp.o6JUcKs91D#fnref:8
|
||||
@@ -1,93 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Linux Kernel 5.10 Will be the Next LTS Release and it has Some Exciting Improvements Lined Up)
|
||||
[#]: via: (https://itsfoss.com/kernel-5-10/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Linux Kernel 5.10 Will be the Next LTS Release and it has Some Exciting Improvements Lined Up
|
||||
======
|
||||
|
||||
_**Development for Linux Kernel 5.10 is in progress. It’s been confirmed to be a long term support release and it will be bringing newer hardware support among other promised features.**_
|
||||
|
||||
### Linux Kernel 5.10 will be Long Term Support Release
|
||||
|
||||
**Greg Kroah-Hartman**, the key stable kernel maintainer, addressed an “Ask the Expert” session at Linux Foundation’s Open-Source Summit Europe and confirmed that Linux 5.10 will be the next LTS release.
|
||||
|
||||
Even though there were some early speculations of 5.9 being the LTS release, Greg clarified that the last kernel release of the year will always be an LTS release.
|
||||
|
||||
As of now, [Linux Kernel 5.4][1] series happens to be the latest LTS version out there which added a lot of improvements and hardware support. Also, considering the development progress with Linux [Kernel 5.8][2] being the biggest release so far and Linux 5.10’s first release candidate being close to it, there’s a lot of things going on under the hood.
|
||||
|
||||
> Because people keep asking me… <https://t.co/cUcGoXEZtX>
|
||||
>
|
||||
> — Greg K-H (@gregkh) [October 26, 2020][3]
|
||||
|
||||
Let’s take a look at some of the features and improvements that you can expect with Linux Kernel 5.10.
|
||||
|
||||
### Linux kernel 5.10 features
|
||||
|
||||
![][4]
|
||||
|
||||
**Note:** _Linux Kernel 5.10 is still in early development. So, we will be updating the article regularly for the latest additions/feature updates._
|
||||
|
||||
#### AMD Zen 3 Processor Support
|
||||
|
||||
The new [Ryzen 5000][5] lineup is one of the biggest buzzes of 2020. So, with Linux Kernel 5.10 release candidate version, various additions are being made for Zen 3 processors.
|
||||
|
||||
#### Intel Rocket Lake Support
|
||||
|
||||
I do not hope for a lot with Intel’s Rocket Lake chipsets arriving Q1 next year (2021). But, considering that Intel’s constantly squeezing everything out of that 14 nm process, it is definitely a good thing to see work done for Intel Rocket Lake on Linux Kernel 5.10
|
||||
|
||||
#### Open Source Driver for Radeon RX 6000 series
|
||||
|
||||
Even though we’re covering this a day before the Big Navi reveal, the Radeon RX 6000 series is definitely going to be something impressive to compete with NVIDIA RTX 3000 series.
|
||||
|
||||
Of course, unless it suffers from the same issues the Vega series or the 5000 series met with.
|
||||
|
||||
It’s good to see work being already done for an open source driver to support the next-gen Radeon GPUs on Linux Kernel 5.10.
|
||||
|
||||
#### File System Optimizations and Storage Improvements
|
||||
|
||||
[Phoronix][6] reports on file-system optimizations and storage improvements with 5.10 as well. So, judging by that, we should see some performance improvements.
|
||||
|
||||
#### Other Improvements
|
||||
|
||||
Undoubtedly, you should expect a great deal of driver updates and hardware supports with the new kernel.
|
||||
|
||||
For now, the support for SoundBlaster AE-7, early support for NVIDIA Orin (AI processor), and Tiger Lake GPU improvements seem to be the key highlights.
|
||||
|
||||
A stable release for Linux Kernel 5.10 should be expected around the mid-December timeline. It will be supported for at least 2 years but you could end up with security/bug fix updates till 2026. So, we will have to stay tuned to the development for anything exciting on the next Linux Kernel 5.10 LTS release.
|
||||
|
||||
**Recommended Read:**
|
||||
|
||||
![][7]
|
||||
|
||||
#### [Explained! Why Your Distribution Still Using an ‘Outdated’ Linux Kernel?][8]
|
||||
|
||||
A new stable kernel is released every 2-3 months yet your distribution might still be using an old, outdated Linux kernel. But you don’t need to worry and here’s why!
|
||||
|
||||
What do you think about the upcoming Linux Kernel 5.10 release? Let us know your thoughts in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/kernel-5-10/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/linux-kernel-5-4/
|
||||
[2]: https://itsfoss.com/kernel-5-8-release/
|
||||
[3]: https://twitter.com/gregkh/status/1320745076566433793?ref_src=twsrc%5Etfw
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/kernel-5-10-release.png?resize=800%2C450&ssl=1
|
||||
[5]: https://www.tomsguide.com/news/amd-ryzen-5000-revealed-what-it-means-for-pc-gaming
|
||||
[6]: https://www.phoronix.com/scan.php?page=article&item=linux-510-features&num=1
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/why_Linux_distro_use_outdated_kernel.jpg?fit=800%2C450&ssl=1
|
||||
[8]: https://itsfoss.com/why-distros-use-old-kernel/
|
||||
@@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (The New Raspberry Pi 400 is Basically a Tiny Computer Inside a Keyboard)
|
||||
[#]: via: (https://itsfoss.com/raspberry-pi-400/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
The New Raspberry Pi 400 is Basically a Tiny Computer Inside a Keyboard
|
||||
======
|
||||
|
||||
Raspberry Pi needs no introduction. What started as a low-spec computer for DIY enthusiasts, it can now be used as full-featured desktop.
|
||||
|
||||
With the Raspberry Pi 400 release, they are making it more friendly for home computer usage. The Raspberry Pi 400 is basically a computer in the form of a keyboard.
|
||||
|
||||
If you remember, [Commodore 64][1] was also a computer in the form of a keyboard back in 1982. Even though it isn’t unique, for a successful product like Raspberry Pi, it is a sweet deal.
|
||||
|
||||
### Raspberry Pi 400: Overview
|
||||
|
||||
![][2]
|
||||
|
||||
It is based on the Raspberry Pi 4 (with 4 GB RAM) and has been tweaked to run cooler as well. With a Quad-core processor, it is faster than ever.
|
||||
|
||||
Not just limited to the ease of use and portability, but it should save you a lot of desk space. And, just like me, if you were planning to get a spare computer to test stuff, I think I may want to go with the Raspberry Pi 400 instead of building another PC or [Linux-based mini PC][3].
|
||||
|
||||
Even though I’ve mentioned the tech specs below, you can watch the official video to get an idea on how it looks and if it’s promising enough as your home computer:
|
||||
|
||||
### Raspberry Pi 400 specification
|
||||
|
||||
Here’s the tech specs for the Pi 400:
|
||||
|
||||
* Broadcom BCM2711 quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1.8GHz
|
||||
* 4GB LPDDR4-3200
|
||||
* Dual-band (2.4GHz and 5.0GHz) IEEE 802.11b/g/n/ac wireless LAN
|
||||
* Bluetooth 5.0, BLE
|
||||
* Gigabit Ethernet
|
||||
* 2 × USB 3.0 and 1 × USB 2.0 ports
|
||||
* Horizontal 40-pin GPIO header
|
||||
* 2 × micro HDMI ports (supports up to 4Kp60)
|
||||
* H.265 (4Kp60 decode); H.264 (1080p60 decode, 1080p30 encode); OpenGL ES 3.0 graphics
|
||||
* MicroSD card slot for operating system and data storage
|
||||
* 78- or 79-key compact keyboard (depending on regional variant)
|
||||
* 5V DC via USB connector
|
||||
* Operating temperature: 0°C to +50°C ambient
|
||||
* Maximum dimensions 286 mm × 122 mm × 23 mm
|
||||
|
||||
|
||||
|
||||
![][4]
|
||||
|
||||
### Pricing & Availability
|
||||
|
||||
For **$70**, this is the best modern home computer that you can get with the simplicity of just having a keyboard and being able to carry it anywhere (you just need a screen to connect to).
|
||||
|
||||
You can either get just the Raspberry Pi 400 for **$70** or get the complete kit for **$100** with a USB mouse, micro HDMI to HDMI cable, USB-C power supply, a beginners guide, and an SD card with Raspberry Pi OS pre-installed.
|
||||
|
||||
If you’re wondering, for the keyboard layout support, here’s what the press release mentioned:
|
||||
|
||||
> At launch, we are supporting English (UK and US), French, Italian, German, and Spanish keyboard layouts, with (for the first time) translated versions of the Beginner’s Guide. In the near future, we plan to support the same set of languages as our [official keyboard][5].
|
||||
|
||||
In other words, they support every major keyboard layout to start with. So, it shouldn’t be an issue for the majority.
|
||||
|
||||
In addition to the details for keyboard layout, here’s how you can get your hands on a Raspberry Pi 400:
|
||||
|
||||
> UK, US, and French Raspberry Pi 400 [kits][6] and [computers][7] are available to buy right now. Italian, German, and Spanish units are on their way to Raspberry Pi Approved Resellers, who should have them in stock in the next week.
|
||||
>
|
||||
> We expect that Approved Resellers in India, Australia, and New Zealand will have kits and computers in stock by the end of the year. We’re rapidly rolling out compliance certification for other territories too, so that Raspberry Pi 400 will be available around the world in the first few months of 2021.
|
||||
>
|
||||
> Of course, if you’re anywhere near Cambridge, you can head over to the [Raspberry Pi Store][8] to pick up your Raspberry Pi 400 today.
|
||||
|
||||
[Raspberry Pi 400][9]
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
Raspberry Pi 400 is definitely something impressive and useful in the current time when remote work is becoming the new norm.
|
||||
|
||||
What do you think about the new Raspberry Pi 400? Planning to get one? Let me know your thoughts in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/raspberry-pi-400/
|
||||
|
||||
作者:[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://en.wikipedia.org/wiki/Commodore_64
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/raspberry-pi-400.jpg?resize=800%2C554&ssl=1
|
||||
[3]: https://itsfoss.com/linux-based-mini-pc/
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/raspberry-pi-400-shot.jpeg?resize=800%2C572&ssl=1
|
||||
[5]: https://www.raspberrypi.org/products/raspberry-pi-keyboard-and-hub/
|
||||
[6]: https://www.raspberrypi.org/products/raspberry-pi-400/
|
||||
[7]: https://www.raspberrypi.org/products/raspberry-pi-400-unit/
|
||||
[8]: https://www.raspberrypi.org/raspberry-pi-store/
|
||||
[9]: https://www.raspberrypi.org/products/raspberry-pi-400
|
||||
@@ -0,0 +1,111 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Got Kids? Limit Computer Usage Per Account in Linux With Timekpr-nExt)
|
||||
[#]: via: (https://itsfoss.com/timekpr-next/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
Got Kids? Limit Computer Usage Per Account in Linux With Timekpr-nExt
|
||||
======
|
||||
|
||||
_**Open source software highlight of this week is Timekpr-nExt. It is a GUI application to limit the computer usage for certain accounts on a Linux system. This is a handy utility for parents who do not want children to spend excessive time on the computer.**_
|
||||
|
||||
### Use Timekpr-nExt to limit computer usage on Linux
|
||||
|
||||
If you have young children at home who spend too much time on computer, you may want to put some sort of restriction on the usage.
|
||||
|
||||
Timekpr-nExt enables you to limit computer usage for certain accounts based on the time of day, number of hours a day, week or month. You may also set time interval to force the account user to take break.
|
||||
|
||||
![][1]
|
||||
|
||||
After the given time expires, the user is automatically logged out and cannot log back in until the restriction conditions are satisfied.
|
||||
|
||||
![][2]
|
||||
|
||||
Of course, this means that you need to have separate non-admin (no sudo access) accounts for the children. If the kids accounts also have admin access, they can change the settings easily. Kids are smart, you know.
|
||||
|
||||
### Features of Timekpr-nExt
|
||||
|
||||
Apart from an annoyingly stylized name, Timekpr-nExt has the following features:
|
||||
|
||||
* Limit system usage as day wise limit, daily limit, weekly or monthly limit
|
||||
* You can also set access restrictions based on time and hour
|
||||
* Users can be shown notification about how much time they have left
|
||||
* Set the lockout action (terminate session, shutdown, suspend or lock screen)
|
||||
* Track the time usage of the accounts
|
||||
|
||||
|
||||
|
||||
Keep the following things in mind:
|
||||
|
||||
* Check carefully which account you are configuring. _**Do not lock yourself out**_.
|
||||
* Hit the apply or set button for each configuration changes otherwise the changes won’t be set.
|
||||
* Children accounts should not have admin action otherwise they can overwrite the settings.
|
||||
|
||||
|
||||
|
||||
Read the [documents about more information on using Timekpr-nExt][3].
|
||||
|
||||
### Installing Timekpr-nExt on Linux
|
||||
|
||||
For Ubuntu-based Linux distributions (like Mint, Linux Lite etc), there is an [official PPA available][4]. You can install it by using the following commands one by one:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:mjasnik/ppa
|
||||
sudo apt update
|
||||
sudo apt install timekpr-next
|
||||
```
|
||||
|
||||
Arch Linux users can [find it in AUR][5]. For others, please check your distribution’s repository. If there is no such package, you may try using the source code.
|
||||
|
||||
[Timekpr-nExt Source Code][6]
|
||||
|
||||
_**Again, do not use Timekpr-nExt for your own main account. You may lock yourself out.**_
|
||||
|
||||
You’ll see two instances of the application. Use the one with (SU) at the beginning.
|
||||
|
||||
![][7]
|
||||
|
||||
#### Removing Timekpr-nExt
|
||||
|
||||
I cannot say for certain if removing Timekpr-nExt will also remove the restrictions you put in place for the users. It will be a good idea to manually restore them (putting 24 hr interval a day). There is no reset button here.
|
||||
|
||||
To remove this application (if you used PPA to install it), use the following command:
|
||||
|
||||
```
|
||||
sudo apt-get remove --purge timekpr-next
|
||||
```
|
||||
|
||||
Delete the PPA repository as well:
|
||||
|
||||
```
|
||||
sudo add-apt-repository -r ppa:mjasnik/ppa
|
||||
```
|
||||
|
||||
Like [blocking adult content on Linux][8], this application is also children specific. Not everyone would find it useful but people with young children at home may use it if they feel the need.
|
||||
|
||||
Do you use some other application to monitor/restrict children from accessing computer?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/timekpr-next/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/timekpr-next-ubuntu.png?resize=800%2C612&ssl=1
|
||||
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/timekpr-next-icon-system-notification-area.png?resize=640%2C94&ssl=1
|
||||
[3]: https://mjasnik.gitlab.io/timekpr-next/
|
||||
[4]: https://launchpad.net/~mjasnik/+archive/ubuntu/ppa
|
||||
[5]: https://aur.archlinux.org/packages/timekpr-next/
|
||||
[6]: https://launchpad.net/timekpr-next
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/timekeeper-next.jpg?resize=799%2C250&ssl=1
|
||||
[8]: https://itsfoss.com/how-to-block-porn-by-content-filtering-on-ubuntu/
|
||||
@@ -0,0 +1,129 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Check Free Disk Space on Linux [Terminal and GUI Methods])
|
||||
[#]: via: (https://itsfoss.com/check-free-disk-space-linux/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
How to Check Free Disk Space on Linux [Terminal and GUI Methods]
|
||||
======
|
||||
|
||||
_**How much disk space I have utilized?**_
|
||||
|
||||
The simplest way to find the free disk space on Linux is to [use df command][1]. The df command stands for disk-free and quite obviously, it shows you the free and available disk space on Linux systems.
|
||||
|
||||
```
|
||||
df -h
|
||||
```
|
||||
|
||||
With `-h` option, it shows the disk space in human-readable format (MB and GB).
|
||||
|
||||
Here’s the output of the df command for my Dell XPS system that has only Linux installed with encrypted disk:
|
||||
|
||||
![Checking free disk space with df command in Linux][2]
|
||||
|
||||
If the above output is confusing for you, don’t worry. I’ll explain a few things around checking available disk space in Linux. _**I’ll also show the GUI method for desktop Linux users.**_
|
||||
|
||||
### Method 1: Checking free disk space in Linux with df command (and understanding its output)
|
||||
|
||||
When you use the df command to check disk space, it will show a bunch of ‘file systems’ with their size, used space and free space. Your actual disks should normally be listed as one of the following:
|
||||
|
||||
* /dev/sda
|
||||
* /dev/sdb
|
||||
* /dev/nvme0n1p
|
||||
|
||||
|
||||
|
||||
This is not a hard and fast rule but it gives you an indication to easily recognize the actual disk from the crowd.
|
||||
|
||||
Your Linux system might have several partitions on your disk for boot, EFI, root, swap, home etc. In such cases, these partitions are reflected with a number at the end of the ‘disk name’, like /dev/sda1, /dev/nvme0n1p2 etc.
|
||||
|
||||
You could identify which partition is used for what purpose from its mount point. Root is mounted on /, EFI in /boot/EFI etc.
|
||||
|
||||
In my case, I have used 41% of the 232 GB of disk space under root. If you have 2-3 big partitions (like root, home etc), you’ll have to make a calculation here.
|
||||
|
||||
![Understanding df command output][3]
|
||||
|
||||
* **tmpfs**: The [tmpfs][4] (temporary filesystem) used for keeping files in virtual memory. You can ignore this virtual filesystem comfortably.
|
||||
* **udev**: The [udev filesystem][5] is used for storing information related to devices (like USB, network card, CD ROM etc) plugged to your system. You may ignore it as well.
|
||||
* **/dev/loop**: These are loop devices. You’ll see plenty of them while checking disk space in Ubuntu because of snap applications. Loops are virtual devices that allow normal files to be accessed as block devices. With the loop devices, snap applications are sandboxed in their own virtual disk. Since they are under root, you don’t need to count their used disk space separately.
|
||||
|
||||
|
||||
|
||||
#### Missing disk space? Check if you have mounted all disks and partitions
|
||||
|
||||
Keep in mind that the df command only shows disk space for mounted filesystems. If you are using more than one Linux distribution (or operating systems) on the same disk or you have multiple disks on your system, you need to mount them first in order to see the free space available on those partitions and disks.
|
||||
|
||||
For example, my [Intel NUC][6] has two SSDs and 4 or 5 Linux distributions installed on them. It shows additional disks only when I mount them explicitly.
|
||||
|
||||
![][7]
|
||||
|
||||
You can use the lsblk command to see all the disks and partitions on your system.
|
||||
|
||||
![][8]
|
||||
|
||||
Once you have the disk partition name, you can mount it in this fashion:
|
||||
|
||||
```
|
||||
sudo mount /dev/sdb2 /mnt
|
||||
```
|
||||
|
||||
I hope this gives you a pretty good idea about checking hard drive space on Linux. Let’s see how to do it graphically.
|
||||
|
||||
### Method 2: Check free disk usage graphically
|
||||
|
||||
Checking free disk space graphically is much easier in Ubuntu with the Disk Usage Analyzer tool.
|
||||
|
||||
![Disk Usage Analyzer Tool][9]
|
||||
|
||||
You’ll see all the actual disks and partitions here. You may have to mount some partitions by clicking on them. It displays the disk usage for all the mounted partitions.
|
||||
|
||||
![Disk usage check][10]
|
||||
|
||||
#### Checking free disk space with GNOME Disks utility
|
||||
|
||||
Otherwise, the GNOME Disks utility is also pretty handy tool.
|
||||
|
||||
![GNOME Disks Tool][11]
|
||||
|
||||
Start the tool and select the disk. Select a partition to see the free disk space. If a partition is not mounted, mount it first by clicking the ‘play’ icon.
|
||||
|
||||
![Free Disk Space Check in Ubuntu Desktop][12]
|
||||
|
||||
I think all major desktop environments have some sort of graphical tool to check the disk usage on Linux. You can search for it in the menu of your desktop Linux system.
|
||||
|
||||
**Conclusion**
|
||||
|
||||
There can be more ways and tools to check the disk space of course. I showed you the most common command line and GUI methods for this purpose.
|
||||
|
||||
I also explained a few things that might trouble you in understanding the disk usage. Hope you like it.
|
||||
|
||||
If you have questions or suggestions, please let me know in the comment section.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/check-free-disk-space-linux/
|
||||
|
||||
作者:[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://linuxhandbook.com/df-command/
|
||||
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/free-disk-space-linux-df-command-output.png?resize=786%2C475&ssl=1
|
||||
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/df-command-output.png?resize=800%2C600&ssl=1
|
||||
[4]: https://www.kernel.org/doc/html/latest/filesystems/tmpfs.html
|
||||
[5]: https://wiki.debian.org/udev
|
||||
[6]: https://itsfoss.com/install-linux-on-intel-nuc/
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/df-command-ubuntu-1.png?resize=786%2C443&ssl=1
|
||||
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/lsblk-command-to-see-disks-linux.png?resize=786%2C538&ssl=1
|
||||
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/disk-usage-analyzer-tool-linux.jpg?resize=800%2C250&ssl=1
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/free-disk-space-ubuntu-desktop.png?resize=800%2C648&ssl=1
|
||||
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/disks-tool-linux.jpg?resize=800%2C250&ssl=1
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/free-disk-space-check-ubuntu-desktop.png?resize=800%2C600&ssl=1
|
||||
@@ -0,0 +1,163 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Scan/Detect New LUNs and SCSI Disks on Linux)
|
||||
[#]: via: (https://www.2daygeek.com/scan-detect-luns-scsi-disks-on-redhat-centos-oracle-linux/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
How to Scan/Detect New LUNs and SCSI Disks on Linux
|
||||
======
|
||||
|
||||
When the Linux system has connected to the SAN (Storage Area Network) you need to rescan the iSCSI service to discover new LUNs.
|
||||
|
||||
To do so, you must provide the WWN number of the Linux host and required LUN size to the storage team.
|
||||
|
||||
The following article will help you [**find the WWN number of a Linux host**][1].
|
||||
|
||||
Once the storage team has mapped the LUNs with the given Linux host, they will provide you with the new LUN details.
|
||||
|
||||
LUN in storage terms is referred to as serial-hex of LUN.
|
||||
|
||||
You need to scan the SCSI host to find new LUNs assigned by the storage team.
|
||||
|
||||
This can be done in two ways, scan each scsi host device or run the “rescan-scsi-bus.sh” script to detect new disks.
|
||||
|
||||
After scanning they can be found under the “/dev/disk/by-id” directory.
|
||||
|
||||
```
|
||||
# ll /dev/disk/by-id
|
||||
|
||||
total 0
|
||||
lrwxrwxrwx 1 root root 10 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684b -> ../../sdah
|
||||
lrwxrwxrwx 1 root root 9 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684c -> ../../sdw
|
||||
.
|
||||
.
|
||||
lrwxrwxrwx 1 root root 10 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684d -> ../../sdjk
|
||||
lrwxrwxrwx 1 root root 10 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684e -> ../../sdaa
|
||||
lrwxrwxrwx 1 root root 9 Jul 9 17:52 scsi-60a98000486e542d4f5a2f47694d684f -> ../../sdh
|
||||
```
|
||||
|
||||
Also, you can find them using the Multipath command if you already have them configured with Multipath.
|
||||
|
||||
Multipath is mostly configured into the Oracle database server for better performance.
|
||||
|
||||
```
|
||||
# multipath -ll
|
||||
|
||||
60a98000486e542d4f5a2f47694d684b dm-37 NETAPP,LUN C-Mode
|
||||
size=512G features='3 queue_if_no_path pg_init_retries 50' hwhandler='1 alua' wp=rw
|
||||
|-+- policy='round-robin 0' prio=50 status=active
|
||||
| |- 1:0:4:18 sdoe 128:416 active ready running
|
||||
| |- 0:0:4:18 sdpq 131:256 active ready running
|
||||
| |- 0:0:5:18 sdsr 135:496 active ready running
|
||||
| `- 1:0:5:18 sdsq 135:480 active ready running
|
||||
`-+- policy='round-robin 0' prio=10 status=enabled
|
||||
|- 1:0:1:18 sdfw 131:32 active ready running
|
||||
|- 1:0:0:18 sdci 69:96 active ready running
|
||||
|- 0:0:1:18 sdbz 68:208 active ready running
|
||||
|- 0:0:0:18 sds 65:32 active ready running
|
||||
|- 1:0:3:18 sdmd 69:336 active ready running
|
||||
|- 1:0:2:18 sdjj 8:464 active ready running
|
||||
|- 0:0:3:34 sdjt 65:368 active ready running
|
||||
`- 0:0:2:34 sdgi 131:224 active ready running
|
||||
```
|
||||
|
||||
This procedure works on Red Hat 6.x, 7.x and 8.x (RHEL – Red Hat Enterprise Linux) based systems such as CentOS and Oracle Linux.
|
||||
|
||||
### Method-1: How to Scan New LUNs and SCSI Disks on Linux Using the “/sys” Class File
|
||||
|
||||
The sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data structures.
|
||||
|
||||
The files under sysfs provide information about devices, kernel modules, filesystems, and other kernel components.
|
||||
|
||||
The sysfs filesystem is commonly mounted at “/sys”. Typically, it is mounted automatically by the system.
|
||||
|
||||
You can use the echo command to scan each scsi host device as shown below.
|
||||
|
||||
```
|
||||
# echo "- - -" > /sys/class/scsi_host/host[n]/scan
|
||||
```
|
||||
|
||||
When you run the above command that rescan everything, the three dash (“- – -“) refers the wildcard option. These values would be as follow.
|
||||
|
||||
```
|
||||
# echo "c t l" > /sys/class/scsi_host/host[n]/scan
|
||||
```
|
||||
|
||||
where
|
||||
|
||||
* **c –** Channel on the HBA
|
||||
* **t –** SCSI target ID
|
||||
* **l –** LUN ID
|
||||
* **n –** HBA number
|
||||
|
||||
|
||||
|
||||
Run the below command to find all the host bus number on your system.
|
||||
|
||||
```
|
||||
# ls /sys/class/scsi_host
|
||||
host0 host1 host2
|
||||
```
|
||||
|
||||
Once you get the host bus number, run the following command to discover new disks.
|
||||
|
||||
```
|
||||
# echo "- - -" > /sys/class/scsi_host/host0/scan
|
||||
# echo "- - -" > /sys/class/scsi_host/host1/scan
|
||||
# echo "- - -" > /sys/class/scsi_host/host2/scan
|
||||
```
|
||||
|
||||
Also, it can be scanned using “for loop” with a single command.
|
||||
|
||||
```
|
||||
# for host in ls /sys/class/scsi_host/;do echo "- - -" >/sys/class/scsi_host/${host}/scan; done
|
||||
```
|
||||
|
||||
You can check them using the **[ls command][2]** as mentioned at the beginning of the article.
|
||||
|
||||
```
|
||||
# ls /dev/disk/by-id | grep -i "serial-hex of LUN"
|
||||
```
|
||||
|
||||
### Method-2: How to Scan New LUNs and SCSI Disks on Linux Using the rescan-scsi-bus.sh Script
|
||||
|
||||
Make sure you have already installed the “sg3_utils” package to use this script. Otherwise, run the following command to install it.
|
||||
|
||||
For **RHEL/CentOS 6/7** systems, use the **[yum command][3]** to install sg3_utils.
|
||||
|
||||
```
|
||||
# yum install -y sg3_utils
|
||||
```
|
||||
|
||||
For **RHEL/CentOS 8** and Fedora systems, use the **[dnf command][4]** to install sg3_utils.
|
||||
|
||||
```
|
||||
# dnf install -y sg3_utils
|
||||
```
|
||||
|
||||
Now you can rescan the LUNs using the rescan-scsi-bus.sh script.
|
||||
|
||||
```
|
||||
# ./rescan-scsi-bus.sh
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/scan-detect-luns-scsi-disks-on-redhat-centos-oracle-linux/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.2daygeek.com/how-to-find-wwn-wwnn-wwpn-number-of-hba-card-in-linux/
|
||||
[2]: https://www.2daygeek.com/linux-unix-ls-command-display-directory-contents/
|
||||
[3]: https://www.2daygeek.com/linux-yum-command-examples-manage-packages-rhel-centos-systems/
|
||||
[4]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/
|
||||
@@ -0,0 +1,80 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Linux Kernel 5.10 Will be the Next LTS Release and it has Some Exciting Improvements Lined Up)
|
||||
[#]: via: (https://itsfoss.com/kernel-5-10/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Linux Kernel 5.10 将是下一个 LTS 版本,它有一些令人兴奋的改进
|
||||
======
|
||||
|
||||
_**Linux Kernel 5.10 的开发正在进行中。已确认这是一个长期支持的版本,将带来更新的硬件支持和其他承诺的功能。**_
|
||||
|
||||
### Linux Kernel 5.10 将是长期支持版本
|
||||
|
||||
主要稳定内核维护者 **Greg Kroah-Hartman** 在 Linux 基金会欧洲开源峰会的 “Ask the Expert” 会议上发言,确认 Linux 5.10 将是下一个 LTS 版本。
|
||||
|
||||
尽管早期有一些关于 5.9 是 LTS 版本的猜测,但 Greg 澄清说,一年的最后一个内核版本永远是 LTS 版本。
|
||||
|
||||
目前来看,[Linux Kernel 5.4][1] 系列恰好是最新的 LTS 版本,它增加了很多改进和硬件支持。另外,考虑到开发进度,Linux [Kernel 5.8][2] 是目前最大的版本,而 Linux 5.10 的第一个候选版本也很接近,所以下面有很多事情要做。
|
||||
|
||||
让我们来看看 Linux Kernel 5.10 的一些功能和改进。
|
||||
|
||||
### Linux kernel 5.10 的功能
|
||||
|
||||
![][4]
|
||||
|
||||
**注意:** _Linux Kernel 5.10 仍处于早期开发阶段。因此,我们将定期更新文章,以更新最新的补充/功能。_
|
||||
|
||||
#### AMD Zen 3 处理器支持
|
||||
|
||||
新的 [Ryzen 5000][5] 产品线是 2020 年最大的看点之一。所以,随着 Linux Kernel 5.10 发布候选版本的推出,针对 Zen 3 处理器的各种新增功能也在陆续推出。
|
||||
|
||||
#### Intel Rocket Lake 支持
|
||||
|
||||
我并不对 Intel 的 Rocket Lake 芯片组在明年 Q1(2021 年)出货报太大希望。但是,考虑到英特尔在不断地压榨 14 纳米制程,看到 Intel Rocket Lake 在 Linux Kernel 5.10 上所做的工作,绝对是一件好事。
|
||||
|
||||
#### Radeon RX 6000 系列开源驱动
|
||||
|
||||
尽管我们是在 Big Navi 揭晓前一天才报道的,但 Radeon RX 6000 系列绝对会是一个令人印象深刻的东西,可以和 NVIDIA RTX 3000 系列竞争。
|
||||
|
||||
当然,除非它和 Vega 系列或 5000 系列遇到的同样问题。
|
||||
|
||||
很高兴在 Linux Kernel 5.10 上看到下一代 Radeon GPU 的开源驱动已经完成。
|
||||
|
||||
|
||||
#### 文件系统优化和存储改进
|
||||
|
||||
[Phoronix][6] 报道了 5.10 也对文件系统进行了优化和存储改进。所以,从这一点来看,我们应该会看到一些性能上的改进。
|
||||
|
||||
#### 其他改进
|
||||
|
||||
毫无疑问,你应该期待新内核带来大量的驱动更新和硬件支持。
|
||||
|
||||
目前,对 SoundBlaster AE-7 的支持、对 NVIDIA Orin(AI 处理器)的早期支持以及 Tiger Lake GPU 的改进似乎是主要亮点。
|
||||
|
||||
Linux Kernel 5.10 的稳定版本应该会在 12 月中旬左右发布。它将被支持至少2年,但可能一直会有安全/bug 修复更新,直到 2026 年。因此,我们将继续关注下一个 Linux Kernel 5.10 LTS 版本的发展,以获得任何令人兴奋的东西。
|
||||
|
||||
你对即将发布的 Linux Kernel 5.10 有什么看法?请在评论中告诉我们你的想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/kernel-5-10/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/linux-kernel-5-4/
|
||||
[2]: https://itsfoss.com/kernel-5-8-release/
|
||||
[3]: https://twitter.com/gregkh/status/1320745076566433793?ref_src=twsrc%5Etfw
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/kernel-5-10-release.png?resize=800%2C450&ssl=1
|
||||
[5]: https://www.tomsguide.com/news/amd-ryzen-5000-revealed-what-it-means-for-pc-gaming
|
||||
[6]: https://www.phoronix.com/scan.php?page=article&item=linux-510-features&num=1
|
||||
Reference in New Issue
Block a user