mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-21 02:10:11 +08:00
Merge branch 'lyxwest_translate_1' of https://github.com/lyxwest/TranslateProject into lyxwest_translate_1
This commit is contained in:
commit
73a02c735d
139
published/20220222 4 levels of DevOps documentation maturity.md
Normal file
139
published/20220222 4 levels of DevOps documentation maturity.md
Normal file
@ -0,0 +1,139 @@
|
||||
[#]: subject: "4 levels of DevOps documentation maturity"
|
||||
[#]: via: "https://opensource.com/article/22/2/devops-documentation-maturity"
|
||||
[#]: author: "Will Kelly https://opensource.com/users/willkelly"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "toknow-gh"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-16196-1.html"
|
||||
|
||||
DevOps 文档成熟度的四个层次
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 提升 DevOps 文档成熟度的过程与达到 DevOps 或 DevSecOps 成熟化的历程是类似的。
|
||||
|
||||
为了能在软件迭代交付周期内按时交付优质的文档,DevOps 和 DevSecOps 的文档实践也需要是敏捷的。这与实现 DevOps 类似,只是更偏向自动化和敏捷的内容处理方法。如果文档现在才进入你的机构的 DevOps 讨论,那么是时候让文档实践追上 DevOps 的步伐了。
|
||||
|
||||
下面是 DevOps 文档成熟度的四个层次:
|
||||
|
||||
### 第一层:临时且孤立
|
||||
|
||||
在最低一级成熟度(最不成熟),文档编制工作没有和 DevOps 开发对齐。开发团队和文档团队按照各自的路线开展工作,常常导致文档落后于开发。在竞争激烈的“云”世界里,因为文档问题而推迟产品发布是不可接受的。
|
||||
|
||||
#### 人员
|
||||
|
||||
这个阶段的文档编制人员还没有摆脱传统的工作方式。<ruby>技术写作<rt>technical writer</rt></ruby>人员隶属于一个中心化的单独团队,与开发团队是脱节的。技术写作组和开发团队之间的鸿可能是由多方面原因造成的:
|
||||
|
||||
* 造成团队分裂和孤立的公司政治
|
||||
* 团队只是将技术文档视为项目验收清单上的检查项,而不是推动项目成功的资产
|
||||
* 事后才雇佣技术写作人员
|
||||
* 技术写作的优先级与开发团队的实际情况不匹配
|
||||
|
||||
这个阶段,另一个在人员配置上的挑战是如何“界定工作完成”。刚接触敏捷实践的技术写作可能难以适应 CI/CD 工具链和流程。
|
||||
|
||||
#### 文档工具和流程
|
||||
|
||||
这个阶段的技术写作仍习惯于使用传统的办公工具,比如办公套件和布局程序。这些工具不够敏捷,没有版本控制和内容管理的要求。它们无法与 DevOps 工具链高效集成,不能支撑快速开发。在这个成熟度,技术写作仍然参照遗留的模板和流程。
|
||||
|
||||
#### 成果
|
||||
|
||||
这个级别交付的文档可能是过时的,甚至缺乏技术准确性的。如果开发团队以 DevOps 的速度推进工作,而技术文档编制却遵循传统的非敏捷流程(使用专有的工具和交付格式),这就很难让文档迭代速度并跟上应用程序的变化。
|
||||
|
||||
### 第二层:实验和试点
|
||||
|
||||
DevOps 文档成熟度的第二层是实验/试验阶段。这个阶段是 DevOps 团队主管和技术写作采取行动打造更敏捷的文档实践和工具的第一步。
|
||||
|
||||
理想的情况下,这些实验是<ruby>相关方<rt>stakeholder</rt></ruby>支持的试点项目的一部分。他们能够从文档交付流程的改善以及其与 DevOps 实践的集成中获益。
|
||||
|
||||
#### 人员
|
||||
|
||||
本阶段的人员可能来自以下三种形式:
|
||||
|
||||
1. 有远见的技术写作为了更好地完成工作,用自己的时间来实验更敏捷的工具。并且向领导层提出更敏捷的文档编制过程的想法。
|
||||
2. DevOps 负责人或工程师试用 Hugo 和 Jekyll 等工具,并将这些工具集成到 CI/CD 流水线中。然后 DevOps 小组教授技术写作如何使用它们。
|
||||
3. 团队引入了第三方承包商或顾问,他们在 DevOps 文档工具方面具有专业知识,并且了解文档工具适合嵌入到 CI/CD 工具链和 DevOps 生命周期的位置。
|
||||
|
||||
#### 文档工具和实践
|
||||
|
||||
[Hugo][2] 和 [Jekyll][3] 是本阶段开始出现的工具。在这个阶段也出现新的内容策略和技术写作方法。
|
||||
|
||||
#### 成果
|
||||
|
||||
实验试点阶段理想的成果应该能够“<ruby>落地并推广<rt>land and expand</rt></ruby>”。也就是说其它项目组也可以将其付诸实践。
|
||||
|
||||
这个阶段的实验也包括内容策略和发布流程上的根本性变化。其它非试点项目组的技术写作可以学习和使用它们。
|
||||
|
||||
试点带来的另一个可能的产出是 [技术写作招聘流程][4] 的变化。你需要针对 DevOps 和你新引入的文档工具对内部编写人员进行培训。
|
||||
|
||||
新的文档工具和流程是此阶段的关键成果,你需要通过演示、状态报告和内部案例研究等方式,将这一成果推给领导层、相关方和其它团队。
|
||||
|
||||
### 第三层:部分自动化和扩展
|
||||
|
||||
DevOps 文档成熟度的第三层(部分自动化和扩展)就是“落地并推广”的进一步行动。在这个阶段,其它 DevOps 团队借用试点项目中产生的 DevOps 文档工具和流程,吸取其中的经验教训。
|
||||
|
||||
#### 人员
|
||||
|
||||
在这个成熟度,技术写作和 DevOps 团队开始更紧密的协作。招聘新的技术写作主要关注具有 DevOps 环境经验的人选。
|
||||
|
||||
#### 工具和文档实践
|
||||
|
||||
技术写作开始从抛弃传统的工具和流程,转到更敏捷的文档工具上,比如:
|
||||
|
||||
* [docToolchain][5]
|
||||
* [Docbook][6]
|
||||
* Hugo
|
||||
* Jekyll
|
||||
|
||||
在这个成熟度,技术写作也负责调整遗留的文档实践。
|
||||
|
||||
#### 成果
|
||||
|
||||
DevOps 文档工具和实践超越试点项目,成为标准实践。在这个成熟度,随着新团队使用新的文档工具和流程,持续学习是必不可少的。
|
||||
|
||||
### 第四层:完全采用
|
||||
|
||||
在最高一级的 DevOps 文档成熟度(完全采用且自动化)所有工具、实践和流程已经到位,以支持将文档为项目中的高优先级事项。要达到这一成熟度,需要不断实验、迭代和团队协作。
|
||||
|
||||
#### 人员
|
||||
|
||||
完全自动化使 DevOps 团队与技术写作之间的协作更紧密。这一阶段的标志是,技术写作牢牢地融入到项目团队的工作流程中。文档工具的维护工作由一些大型企业负责,它们拥有专职维护 DevOps 工具链的工程师。
|
||||
|
||||
#### 文档工具和实践
|
||||
|
||||
在这个成熟度,技术写作统一采用 Markdown 语言和自动化工具。
|
||||
|
||||
#### 成果
|
||||
|
||||
本阶段的成果是一套完整的工具和实践,它们支持自动化在线文档发布。技术写作者可以按需发布和重新发布文档,以支持迭代开发流程。
|
||||
|
||||
持续学习是这个阶段的另一项成果。技术写作和工具链维护者寻找改进自动化和流程的方法,以帮助文档实践。
|
||||
|
||||
### 总结
|
||||
|
||||
提升 DevOps 文档成熟度的过程跟达到 DevOps 或 DevSecOps 成熟化的历程是类似的。我希望行业能够将更灵活的文档实践和工具作为公司推进 DevOps 进程中的一个部分。提高 DevOps 文档成熟度应该作整体 DevOps 成熟化甚至 [DevOps 到 DevSecOps 转型][7]的一部分。
|
||||
|
||||
*(题图:MJ/154429b7-bdfc-4b34-9a81-55d9fe33ab07)*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/2/devops-documentation-maturity
|
||||
|
||||
作者:[Will Kelly][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[toknow-gh](https://github.com/toknow-gh)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/willkelly
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_lead-steps-measure.png?itok=DG7rFZPk (Green graph of measurements)
|
||||
[2]: https://opensource.com/article/18/3/start-blog-30-minutes-hugo
|
||||
[3]: https://opensource.com/article/17/4/getting-started-jekyll
|
||||
[4]: https://opensource.com/article/19/11/hiring-technical-writers-devops
|
||||
[5]: http://doctoolchain.org/
|
||||
[6]: https://opensource.com/article/17/9/docbook
|
||||
[7]: https://opensource.com/article/21/10/devops-to-devsecops
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202309/16/135943xon0788ou667jujw.jpg
|
@ -0,0 +1,148 @@
|
||||
[#]: subject: "How I use the attr command with my Linux filesystem"
|
||||
[#]: via: "https://opensource.com/article/22/6/linux-attr-command"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "wznmickey"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-16192-1.html"
|
||||
|
||||
在 Linux 文件系统中使用 attr 添加扩展属性
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 我使用开源的 XFS 文件系统是为了其扩展属性带来的小小便利。扩展属性是一种为我的数据添加上下文的独特方式。
|
||||
|
||||
“文件系统” 是一个描述你的计算机怎样跟踪你创建的所有文件的完美词语。你的计算机存储有大量的数据,无论是文档、配置文件还是数以千计的照片。这需要一种对人和机器都友好的方式。诸如 Ext4、XFS、JFS、BtrFS 的文件系统是你的计算机用来跟踪文件的“语言”。
|
||||
|
||||
你的桌面或终端可以帮助你快速查找文件。例如,你的文件管理器可能有过滤功能,以便让你可以快速查看家目录内的图片,它也可能带有搜索功能以让你使用文件名定位文件。这些特性被称作*文件属性*,正如其名,它们是由文件头或者文件系统代码定义的文件对象的属性。大多数的文件系统记录了标准的文件属性,例如文件名、文件大小、文件类型、创建时间、上次访问时间等。
|
||||
|
||||
我在我的计算机上使用开源的 XFS 文件系统,不是为了其稳定性和高性能,而是为了其扩展属性带来的小小便利。
|
||||
|
||||
### 常见的文件属性
|
||||
|
||||
当你保存一个文件,文件相关的数据也会随同保存。常见的属性会告诉操作系统是否更新访问时间,什么时间同步数据到硬盘等逻辑细节。哪些属性被保存取决于底层文件系统的功能和特性。
|
||||
|
||||
在标准文件属性(如果有标准属性的话)之外,XFS、Ext4 和 BtrFS 文件系统都可以使用扩展属性。
|
||||
|
||||
### 扩展属性
|
||||
|
||||
XFS、Ext4 和 BtrFs 允许你创建自己的任意文件属性。由于是自己创建的,操作系统不会有内建支持,不过我以“标签”的方式使用它们,就像图片的 EXIF 数据一样。开发者们也许会选择使用扩展属性去开发应用内的自定义的功能。
|
||||
|
||||
XFS 中的属性有两个“命名空间”:用户(`user`)和根(`root`)。当创建属性时,你必须将其加入其中一个命名空间。要将属性添加到根命名空间,必须使用 `sudo` 命令或以 `root` 身份登录。
|
||||
|
||||
### 增加一个属性
|
||||
|
||||
你可以使用 `attr` 和 `setfattr` 命令在 XFS 文件系统中为文件增加属性。
|
||||
|
||||
`attr` 命令默认在 `user` 命名空间下进行,所以你只需要为属性设置一个名字(`-s`)和值(`-V`)。
|
||||
|
||||
```
|
||||
$ attr -s flavor -V vanilla example.txt
|
||||
Attribute "flavor" set to a 7 byte value for example.txt:
|
||||
vanilla
|
||||
```
|
||||
|
||||
`setfattr` 命令需要你指定目标命名空间:
|
||||
|
||||
```
|
||||
$ setfattr --name user.flavor --value chocolate example.txt
|
||||
```
|
||||
|
||||
### 列出扩展文件属性
|
||||
|
||||
使用 `attr` 或者 `getfattr` 命令可以看已添加到文件上的扩展属性。`attr` 命令默认使用 `user` 空间,使用 `-g` 以获取扩展属性:
|
||||
|
||||
```
|
||||
$ attr -g flavor example.txt
|
||||
Attribute "flavor" had a 9 byte value for example.txt:
|
||||
chocolate
|
||||
```
|
||||
|
||||
`getfattr` 命令需要属性的命名空间和名字:
|
||||
|
||||
```
|
||||
$ getfattr --name user.flavor example.txt
|
||||
# file: example.txt
|
||||
user.flavor="chocolate"
|
||||
```
|
||||
|
||||
### 列出所有扩展属性
|
||||
|
||||
要看一个文件的所有扩展属性,你可以使用 `attr -l`:
|
||||
|
||||
```
|
||||
$ attr -l example.txt
|
||||
Attribute "md5sum" has a 32 byte value for example.txt
|
||||
Attribute "flavor" has a 9 byte value for example.txt
|
||||
```
|
||||
|
||||
或者,你也可以使用 `getfattr -d`:
|
||||
|
||||
```
|
||||
$ getfattr -d example.txt
|
||||
# file: example.txt
|
||||
user.flavor="chocolate"
|
||||
user.md5sum="969181e76237567018e14fe1448dfd11"
|
||||
```
|
||||
|
||||
扩展文件属性可以使用 `attr` 和 `setfattr` 更新,就像你创建这些属性一样:
|
||||
|
||||
```
|
||||
$ setfattr --name user.flavor --value strawberry example.txt
|
||||
|
||||
$ getfattr -d example.txt
|
||||
# file: example.txt
|
||||
user.flavor="strawberry"
|
||||
user.md5sum="969181e76237567018e14fe1448dfd11"
|
||||
```
|
||||
|
||||
### 其他文件系统上的属性
|
||||
|
||||
使用扩展属性最大的风险是忘记这些属性是特定于某个文件系统的。这意味着当你从一个磁盘或分区复制文件到另外一个磁盘或分区时,这些属性都会丢失,**即使**目标位置的文件系统也支持扩展属性。
|
||||
|
||||
为了避免丢失扩展属性,你需要使用支持保留这些属性的工具,例如 `rsync` 命令。
|
||||
|
||||
```
|
||||
$ rsync --archive --xattrs ~/example.txt /tmp/
|
||||
```
|
||||
|
||||
但无论你使用什么工具,如果你传输文件到一个不知道如何处理扩展属性的文件系统,这些属性都会被丢弃。
|
||||
|
||||
### 搜索属性
|
||||
|
||||
与扩展属性交互的机制并不多,所以使用这些添加的文件属性的方法也有限。我使用扩展属性作为标签机制,这让我可以将没有明显关系的文件联系起来。例如,假设我需要在一个项目中用“知识共享”的图形。假如我预见性地将 `license` 属性添加到了我的图形库中,我就可以使用 `find` 和 `getfattr` 在图形文件夹中寻找:
|
||||
|
||||
```
|
||||
find ~/Graphics/ -type f \
|
||||
-exec getfattr \
|
||||
--name user.license \
|
||||
-m cc-by-sa {} \; 2>/dev/null
|
||||
|
||||
# file: /home/tux/Graphics/Linux/kde-eco-award.png
|
||||
user.license="cc-by-sa"
|
||||
user.md5sum="969181e76237567018e14fe1448dfd11"
|
||||
```
|
||||
|
||||
### 文件系统的秘密
|
||||
|
||||
文件系统一般不会引起你的注意。它们实际是定义文件的系统。这不是计算机做的最让人兴奋的任务,也不是用户应该关心的东西。但是有些文件系统可以给你有趣、安全的特殊能力,扩展文件属性就是一个好例子。它的用途可能有限,但是扩展属性是你为数据增加上下文的独特方法。
|
||||
|
||||
*(题图:MJ/06c0c478-7af7-49e4-836b-a9923db9dc0c)*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/6/linux-attr-command
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[wznmickey](https://github.com/wznmickey)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/lead-images/yearbook-haff-rx-linux-file-lead_0.png
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202309/15/081240syst7uisttadnky6.jpg
|
@ -0,0 +1,172 @@
|
||||
[#]: subject: "Using R for Building an Interactive Web App"
|
||||
[#]: via: "https://www.opensourceforu.com/2022/10/using-r-for-building-an-interactive-web-app/"
|
||||
[#]: author: "Dr Kumar Gaurav https://www.opensourceforu.com/author/dr-gaurav-kumar/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "charonxin"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-16193-1.html"
|
||||
|
||||
使用 R 语言构建一个可交互的 Web 应用
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
数据分析已成为企业的当务之急,并且对具有用户友好界面的数据驱动应用程序有巨大的需求。本文介绍如何使用 R 语言中的 Shiny 包开发交互式 Web 应用程序,R 语言是一种流行的数据科学编程语言。
|
||||
|
||||
如今,世界各地几乎所有企业都以某种形式依赖于数据。数据科学通过使用数据驱动的应用程序帮助许多企业实现转型,无论是在金融、银行、零售、物流、电子商务、运输、航空还是任何其他领域。
|
||||
|
||||
高性能计算机和低成本存储使我们现在能够在几分钟内预测结果,而不是像以前一样以前需要花费很多时间。数据科学家着眼于未来,正在开发具有高性能和多维可视化的便捷应用。这一切都始于大数据,它由三个组成部分组成:数量、多样性和速度。算法和模型都是根据这些数据提供的。机器学习和人工智能领域最前沿的数据科学家正在创建能够自我改进、检测错误并从中学习的模型。
|
||||
|
||||
在数据科学领域,统计和计算用于将数据转化为有用的信息,通常称为数据驱动科学。数据科学是来自各个领域的方法的综合,用于收集、分析和解释数据,以形成新的见解并做出选择。构成数据科学的技术学科包括统计学、概率、数学、机器学习、商业智能和一些编程。
|
||||
|
||||
数据科学可以应用于各个领域(图 1)。对大型、复杂数据集的分析是数据科学的重点。它帮助我们创建了一个以全新方式看待数据的新宇宙。亚马逊、谷歌和 Facebook 等科技巨头利用数据科学原理进行商业智能和商业决策。
|
||||
|
||||
![Figure 1 Key applications-and use cases of data science][1]
|
||||
|
||||
### R 语言:为数据科学量身打造的语言
|
||||
|
||||
由于海量的可用信息,我们迫切需要数据分析以得到新的见解,在多种技术的帮助下,原始数据转化为成品数据产品。在数据研究、处理、转换和可视化方面,没有比 R 语言更好的工具了。
|
||||
|
||||
R 语言用于数据科学的主要功能包括:
|
||||
|
||||
* 数据预处理
|
||||
* 社交媒体数据获取和分析
|
||||
* 对数据结构的各种操作
|
||||
* 提取、转换、加载(ETL)
|
||||
* 连接到各种数据库,包括 SQL 和电子表格
|
||||
* 与 NoSQL 数据库交互
|
||||
* 使用模型进行训练和预测
|
||||
* 机器学习模型
|
||||
* 聚类
|
||||
* 傅里叶变换
|
||||
* 网页抓取
|
||||
|
||||
R 语言是一种强大的编程语言,常用于统计计算和数据分析。有关优化 R 语言用户界面的努力由来已久。从简单的文本编辑器到更现代的交互式 R Studio 和 Jupyter Notebooks,世界各地的多个数据科学小组都在关注 R 语言的发展。
|
||||
|
||||
只有全世界 R 用户的贡献才使这一切成为可能。R 语言中包含的强大软件包使其日益强大。许多开源软件包使处理大型数据集和可视化数据变得更加容易和高效。
|
||||
|
||||
### 使用 Shiny 在 R 语言中开发交互式 Web 应用
|
||||
|
||||
你可以使用 Shiny 包在 R 语言中构建交互式 Web 应用程序。应用程序可以托管在网站上、嵌入 R Markdown 文档中,或用于开发控制面板板和可视化。CSS 主题、HTML 小部件和 JavaScript 操作都可以用于进一步自定义你的 Shiny 应用程序。
|
||||
|
||||
Shiny 是一款 R 语言工具,它可以轻松创建交互式的 Web 应用程序。它允许你将你的 R 代码扩展到 Web 上,从而使更多的人能够使用它,从中获益。
|
||||
|
||||
除了 Shiny 内置的功能外,还有许多第三方扩展包可用,例如 shinythemes、shinydashboard 和 shinyjs。
|
||||
|
||||
使用 Shiny 可以开发各种应用程序。以下是其中一些:
|
||||
|
||||
* 基于 Web 应用的机器学习
|
||||
* 具有动态控件的 Web 应用程序
|
||||
* 数据驱动的仪表盘
|
||||
* 多重数据集的交互式应用
|
||||
* 实时数据可视化面板
|
||||
* 数据收集表单
|
||||
|
||||
Shiny Web 应用程序可以分为以下几类:
|
||||
|
||||
* 用户接口
|
||||
* 服务功能逻辑
|
||||
* Shiny 应用逻辑
|
||||
|
||||
获取更深理解,请访问以下网站 https://shiny.rstudio.com/gallery/ 。
|
||||
|
||||
其中某个用 Shiny 开发的应用如图 2(https://shiny.rstudio.com/gallery/radiant.html )。
|
||||
|
||||
![Figure 2: Shiny based app][2]
|
||||
|
||||
### 销售仪表盘的生成
|
||||
|
||||
下面是一个与销售仪表盘相关的 Web 应用程序的代码片段。该仪表板具有多个控件和用户界面模块,用于查看数据。
|
||||
|
||||
首先,安装 Shiny 包,然后在代码中调用它,以便将输出呈现为 Web 页面的形式。
|
||||
|
||||
```
|
||||
library(shiny)
|
||||
library(dplyr)
|
||||
|
||||
sales <- vroom::vroom(“salesdata.csv”, na = “”)
|
||||
ui <- fluidPage(
|
||||
titlePanel(“Dashboard for Sales Data”),
|
||||
sidebarLayout(
|
||||
sidebarPanel(
|
||||
selectInput(“territories”, “territories”, choices = unique(sales$territories)),
|
||||
selectInput(“Customers”, “Customer”, choices = NULL),
|
||||
selectInput(“orders”, “Order number”, choices = NULL, size = 5, selectize = FALSE),
|
||||
),
|
||||
mainPanel(
|
||||
uiOutput(“customer”),
|
||||
tableOutput(“data”)
|
||||
)
|
||||
)
|
||||
)
|
||||
server <- function(input, output, session) {
|
||||
territories <- reactive({
|
||||
req(input$territories)
|
||||
filter(sales, territories == input$territories)
|
||||
})
|
||||
customer <- reactive({
|
||||
req(input$Customers)
|
||||
filter(territories(), Customers == input$Customers)
|
||||
})
|
||||
|
||||
output$customer <- renderUI({
|
||||
row <- customer()[1, ]
|
||||
tags$div(
|
||||
class = “well”,
|
||||
tags$p(tags$strong(“Name: “), row$customers),
|
||||
tags$p(tags$strong(“Phone: “), row$contact),
|
||||
tags$p(tags$strong(“Contact: “), row$fname, “ “, row$lname)
|
||||
)
|
||||
})
|
||||
|
||||
order <- reactive({
|
||||
req(input$order)
|
||||
customer() %>%
|
||||
filter(ORDER == input$order) %>%
|
||||
arrange(OLNUMBER) %>%
|
||||
select(pline, qty, price, sales, status)
|
||||
})
|
||||
|
||||
output$data <- renderTable(order())
|
||||
|
||||
observeEvent(territories(), {
|
||||
updateSelectInput(session, “Customers”, choices = unique(territories()$Customers), selected = character())
|
||||
})
|
||||
observeEvent(customer(), {
|
||||
updateSelectInput(session, “order”, choices = unique(customer()$order))
|
||||
})
|
||||
}
|
||||
shinyApp(ui, server)
|
||||
```
|
||||
|
||||
运行 Shiny 应用程序的代码后,生成了图 3 所示的输出,可以在任何 Web 浏览器上查看。销售仪表盘具有多个控件,并且具有不同的用户界面模块,非常互动。
|
||||
|
||||
![Figure 3: Sales dashboard with multiple controls][3]
|
||||
|
||||
通过使用 Shiny Cloud,可以将这个应用程序部署和托管在云上,以便随时随地在互联网上使用。
|
||||
|
||||
![Figure 4: Cloud for hosting and deployment of Shiny app][4]
|
||||
|
||||
Shiny Cloud 的免费版本允许在 25 个活动小时内部署五个应用程序。研究人员和数据科学家可以使用 R 的 Shiny 库开发基于实时数据驱动的用户友好应用程序。这个库也可以用于在 Web 平台上部署他们的机器学习应用程序。
|
||||
|
||||
*(题图:MJ/1a76ad20-e56d-480b-b28b-8cf74d2230a1)*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.opensourceforu.com/2022/10/using-r-for-building-an-interactive-web-app/
|
||||
|
||||
作者:[Dr Kumar Gaurav][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[Charonxin](https://github.com/Charonxin)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.opensourceforu.com/author/dr-gaurav-kumar/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/09/Figure-1-Key-applications-and-use-cases-of-data-science.jpg
|
||||
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/09/Figure-2-Shiny-based-app.jpg
|
||||
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/09/Figure-3-Sales-dashboard-with-multiple-controls.jpg
|
||||
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/09/Figure-4-Cloud-for-hosting-and-deployment-of-Shiny-app.jpg
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202309/15/091903rot5yx9z9x8fq5df.jpg
|
109
published/20221005 Working with Btrfs – General Concepts.md
Normal file
109
published/20221005 Working with Btrfs – General Concepts.md
Normal file
@ -0,0 +1,109 @@
|
||||
[#]: subject: "Working with Btrfs – General Concepts"
|
||||
[#]: via: "https://fedoramagazine.org/working-with-btrfs-general-concepts/"
|
||||
[#]: author: "Andreas Hartmann https://fedoramagazine.org/author/hartan/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "A2ureStone"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-16189-1.html"
|
||||
|
||||
Btrfs 详解:基础概念
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
这篇文章是《Btrfs 详解》系列文章中的一篇。从 Fedora Linux 33 开始,Btrfs 就是 Fedora Workstation 和 Fedora Silverblue 的默认文件系统。
|
||||
|
||||
### 介绍
|
||||
|
||||
文件系统是现代计算机的基础之一。它是任何操作系统必不可少的一部分,且通常不为人注意。但是,像 Btrfs 这样的现代文件系统提供了许多很棒的特性,使计算机的使用更加方便。例如,它可以无感地为你压缩文件,或者为增量备份建立可靠的基础。
|
||||
|
||||
这篇文章将带你高屋建瓴地了解 Btrfs 文件系统是如何工作的,有什么特性。本文既不会过多涉及技术细节,也不会研究其底层实现,系列后续的文章会详细介绍一些重要特性。
|
||||
|
||||
### 什么是文件系统
|
||||
|
||||
如果你基本了解过文件系统是如何工作的,那么下面的内容对你应该是不陌生的,你可以直接跳到下一节。否则,请先阅读下面对文件系统的简短介绍。
|
||||
|
||||
简单来说,文件系统允许你的 PC 去寻找存储在磁盘上的数据。这听起来像是微不足道的工作,但实际上时至今日各种类型的非易失性存储设备(比如机械硬盘、固态硬盘、SD 卡等等)仍然与 1970 年代 PC 被发明时基本相同:一个(巨大的)存储块集合。
|
||||
|
||||
“<ruby>块<rt>Block</rt></ruby>” 是最小的可寻址存储单元。PC 上的每个文件内容被存储在多个块中。一个块通常是 4096 字节的大小。这取决于你的硬件和在这之上的软件(即文件系统)。
|
||||
|
||||
文件系统允许我们从海量的存储块中查找文件的内容,这是通过所谓的 *inode* 去实现的。一个 inode 在特殊格式的存储块里记录了文件的信息。这包含文件的大小,哪里去寻找组成文件内容的存储块,访问规则(即谁可读,可写,可执行)等等。
|
||||
|
||||
下面是 inode 的示意图:
|
||||
|
||||
![A text file “myfile.txt” and a hypothetical example of its representation on disk. All the squares are individual storage blocks.][4]
|
||||
|
||||
inode 的结构对文件系统的功能有巨大的影响,因此它是各种文件系统诸多的重要数据结构之一。出于这个原因,每个文件系统有各自的 inode 结构。如果你想了解更多信息,看看下面 [链接][6] 关于 Btrfs 文件系统 inode 结构的内容。如需更详细地了解各个字段的含义,你可以 [参考][7] ext4 文件系统的 inode 结构。
|
||||
|
||||
### 写时复制(CoW)文件系统
|
||||
|
||||
相比 ext4,Btrfs 拥有的杰出特性之一是,它是一个 <ruby>写时复制<rt>Copy-on-Write</rt></ruby>(CoW)文件系统。当一个文件被改变和回写磁盘,它不会故意写回它原来的位置,而是被复制和存储在磁盘上的新位置。从这个意义上,可以简单地认为 Cow 是一种 “重定向”,因为文件写入被重定向到不同的存储块上。
|
||||
|
||||
这听起来很浪费,但实际上并不是。这是因为被修改的数据无论如何一定会被写到磁盘上,不管文件系统是如何工作的。Btrfs 仅仅是确保了数据被写入在之前没被占据的块上,所以旧数据保持完整。唯一真正的缺点就是这种行为会导致文件碎片化比其他文件系统要快。在日常的电脑使用中,你不太可能会注意到这点差异。
|
||||
|
||||
CoW 的优势在哪里?简单的说:文件被修改和编辑的历史被保存了下来。Btrfs 保存文件旧版本的引用(inode)可以轻易地被访问。这个引用就是快照:文件系统在某个时间点的状态镜像。这将是这系列文章里的单独的一篇,所以暂时留到后面介绍。
|
||||
|
||||
除了保存文件历史,CoW 文件系统永远处于一致的状态,即使之前的文件系统事务(比如写入一个文件)由于断电等原因没有完成。这是因为文件系统的元数据更新也是写时复制的:文件系统本身永远不会被覆写,所以中断不会使其处于部分写入的状态。
|
||||
|
||||
### 对文件的写时复制
|
||||
|
||||
你可以将文件名视为对 inode 的指针。在写入文件的时候,Btrfs 创建一个被修改文件内容(数据)的拷贝,和一个新的 inode(元数据),然后让文件名指向新的 inode,旧的 inode 保持不变。下面是一个假设示例来阐述这点:
|
||||
|
||||
![Continuation of the example above: 3 more bytes of data were added][5]
|
||||
|
||||
这里 `myfile.txt` 增加了三个字节。传统的文件系统会更新中间的 `Data` 块去包含新的内容。CoW 文件系统不会改变旧的数据块(图中灰色),写入(复制)更改的数据和元数据在新的地方。值得注意的是,只有被改变的数据块被复制,而不是全部文件。
|
||||
|
||||
如果没有空闲的块去写入新内容,Btrfs 将从被旧文件版本占据的数据块中回收空间(除非它们是快照的一部分,本系列后续文章会看到)。
|
||||
|
||||
### 对目录的写时复制
|
||||
|
||||
从文件系统的角度看,目录只是特殊类型的文件。与常规文件不同,文件系统直接解释数据块的内容。一个目录有自身的元数据(inode,就像上面说的文件一样)去记录访问权限或修改时间。最简单的形式,存在目录里的数据(被叫作目录项)是一个 inode 引用的列表,每个 inode 又是另外的文件或目录。但是,现代文件系统在目录项中至少会存储一个文件名和对应的 inode 引用。
|
||||
|
||||
之前已经指出,写入一个文件会创建之前 inode 的副本,并相应修改其内容。从根本上,这产生了一个和之前无关的新的 inode 。为了让被修改的文件对文件系统可见,所有包含这个文件引用的目录项都会被更新。
|
||||
|
||||
这是一个递归的过程!因为一个目录本身是一个带有 inode 的文件。修改目录里的任何一项都会为这个目录文件创建新的 inode 。这会沿着文件系统树递归直到文件系统的根。
|
||||
|
||||
所以,只要保留对任何旧目录的引用,并且这些目录没有被删除和覆写,就可以遍历之前旧状态的文件系统树。这就是快照的功能。
|
||||
|
||||
### 后续文章可以期待的内容
|
||||
|
||||
Btrfs 不只是一个 Cow 文件系统。它目标是实现高级特性的同时关注容错、修复和易于管理(参见 [文档][8])。本系列未来的文章将会专门介绍这些特性。
|
||||
|
||||
* 子卷 – 文件系统中的文件系统
|
||||
* 快照 – 回到过去
|
||||
* 压缩 – 透明节省存储空间
|
||||
* 配额组 – 限制文件系统大小
|
||||
* RAID – 替代 mdadm 配置
|
||||
|
||||
这远非 Btrfs 特性的详尽列表。如果你想全面地了解可用特性,查看 [维基][9] 和 [文档][8]。
|
||||
|
||||
### 总结
|
||||
|
||||
我希望我已能激起你进一步了解计算机文件系统的兴趣。如果目前你有任何疑问,请在评论区留言讨论以便在日后文章中探讨,同时,你也可以自行学习文中提供的相关资源。如果你发现 Btrfs 中某项特别有趣的功能,也欢迎在评论区提出。如果某个主题收到足够的关注,我可能会在系列文章中新增相关内容。下一篇文章再见!
|
||||
|
||||
*(题图:MJ/35fa1970-1806-4026-8d58-095a56206ec9)*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/working-with-btrfs-general-concepts/
|
||||
|
||||
作者:[Andreas Hartmann][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[A2ureStone](https://github.com/A2ureStone)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/hartan/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2022/07/working_w_btrfs_general-816x345.jpg
|
||||
[2]: https://unsplash.com/@helibertoarias?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[3]: https://unsplash.com/s/photos/hdd?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[4]: https://fedoramagazine.org/wp-content/uploads/2022/07/file_regular.png
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2022/07/file_cow.png
|
||||
[6]: https://btrfs.wiki.kernel.org/index.php/Data_Structures#btrfs_inode_item
|
||||
[7]: https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inode_Table
|
||||
[8]: https://btrfs.readthedocs.io/en/latest/Introduction.html
|
||||
[9]: https://btrfs.wiki.kernel.org/index.php/Main_Page
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202309/13/235109zpss77b87s0e00g2.jpg
|
@ -3,28 +3,30 @@
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-16186-1.html"
|
||||
|
||||
让你的 Windows 系统为虚拟机做好准备
|
||||
======
|
||||
|
||||
在 VirtualBox 中看到“**无法打开虚拟机会话**”错误?
|
||||
![][0]
|
||||
|
||||
> 以下是确保 Windows 系统已准备好运行虚拟机的必要条件。
|
||||
|
||||
在 VirtualBox 中看到了“<ruby>无法打开虚拟机会话<rt>failed to open a session for the virtual machine</rt></ruby>”错误?
|
||||
|
||||
你的系统上可能没有启用虚拟化。
|
||||
|
||||
这是在任何 Windows 支持的系统上创建虚拟机所需执行的几件事之一。
|
||||
这是在 Windows 系统上创建虚拟机所需执行的几件事之一。
|
||||
|
||||
为了给你一个概述,你需要了解:
|
||||
简单来说,你需要了解:
|
||||
|
||||
* **在你的 PC 上启用虚拟化支持**
|
||||
* **使用虚拟机程序创建/管理虚拟机**
|
||||
* **确保某些系统资源要求以无缝使用虚拟机**
|
||||
* 在你的 PC 上启用虚拟化支持
|
||||
* 使用虚拟机程序创建/管理虚拟机
|
||||
* 确保某些系统资源要求以无缝使用虚拟机
|
||||
|
||||
|
||||
|
||||
这是第一件事:
|
||||
下面是第一件事:
|
||||
|
||||
### 在 Windows PC 上启用虚拟化
|
||||
|
||||
@ -40,13 +42,11 @@
|
||||
|
||||
![][2]
|
||||
|
||||
1. 前往 UEFI 固件设置(或 BIOS 菜单)。你通常可以通过按“**Del**”按钮或**F1、F2、F10或F12**来访问它。
|
||||
2. 根据主板制造商的不同,用户界面会有所不同。但是,在大多数情况下,你必须进入到其中的“**高级**”选项,并访问“**CPU 配置**”设置。
|
||||
3. 在 CPU 配置中,你必须启用 “**Intel (VMX) Virtualization Technology**” 或 “**SVM Mode**”(适用于 AMD 处理器)。
|
||||
1. 前往 UEFI 固件设置(或 BIOS 菜单)。你通常可以通过按 `Del` 按钮或 `F1`、`F2`、`F10` 或 `F12` 来访问它。
|
||||
2. 根据主板制造商的不同,用户界面会有所不同。但是,在大多数情况下,你必须进入到其中的“<ruby>高级<rt>Advance</rt></ruby>”选项,并访问“<ruby>CPU 配置<rt>CPU Configuration</rt></ruby>”设置。
|
||||
3. 在 CPU 配置中,你必须启用 “Intel (VMX) Virtualization Technology” 或 “SVM Mode”(适用于 AMD 处理器)。
|
||||
|
||||
|
||||
|
||||
下一步是什么? 考虑到你已经启用了虚拟化支持,你需要使用[虚拟化程序][3]来帮助你完成工作。
|
||||
下一步是什么? 考虑到你已经启用了虚拟化支持,你需要使用 [虚拟化程序][3] 来帮助你完成工作。
|
||||
|
||||
### 使用虚拟化程序
|
||||
|
||||
@ -56,17 +56,15 @@
|
||||
|
||||
我们不会详细介绍如何使用 Hyper-V,但为了节省你一些时间,你可以按照以下步骤启用它,然后按照其[文档][4]使用它。
|
||||
|
||||
📋
|
||||
|
||||
Hyper-V 不适用于 Windows 10/11 家庭版。
|
||||
> 📋 Hyper-V 不适用于 Windows 10/11 家庭版。
|
||||
|
||||
考虑到你的系统上安装了 Windows 专业版/教育版/企业版,可以通过**控制面板**或使用 **PowerShell** 轻松启用它。
|
||||
|
||||
![][5]
|
||||
|
||||
我更喜欢控制面板,只需在搜索栏中搜索 “Windows 功能”或通过**控制面板 → 程序 → 打开或关闭 Windows 功能**打开。
|
||||
我更喜欢控制面板,只需在搜索栏中搜索 “Windows 功能”或通过 “控制面板 → 程序 → 打开或关闭 Windows 功能” 打开。
|
||||
|
||||
接下来,单击 **“Hyper-V”** 并点击 **“OK”**。就是这样。
|
||||
接下来,单击 “Hyper-V” 并点击 “OK”。就是这样。
|
||||
|
||||
![][6]
|
||||
|
||||
@ -92,7 +90,7 @@ Hyper-V 不适用于 Windows 10/11 家庭版。
|
||||
|
||||
想了解这些程序吗?你可以查看 Linux 下的一些可用选项,了解有哪些解决方案:
|
||||
|
||||
![][12]
|
||||
> **[9 个最佳虚拟化软件][12]**
|
||||
|
||||
### 检查系统资源和要求
|
||||
|
||||
@ -103,11 +101,9 @@ Hyper-V 不适用于 Windows 10/11 家庭版。
|
||||
* 确保你的系统至少有 4 GB 内存(越多越好)
|
||||
* 双核或以上 64 位处理器
|
||||
|
||||
|
||||
|
||||
如果你不知道,即使虚拟机是孤立的机器,也会占用你系统的资源。大多数最低规格建议 4 GB RAM,但**我建议使用 8 GB**。
|
||||
|
||||
如果你想要**运行两个虚拟机**,你可能需要在 Windows 上拥有**超过 8GB 的 RAM**。
|
||||
如果你想要**运行两个虚拟机**,你可能需要在 Windows 上拥有**超过 8GB 的内存**。
|
||||
|
||||
除了内存,你应该有一个**多核**处理器。这样,一些内核可以自由地让你在主机上做其他事情,而另一些内核则用于处理虚拟机。
|
||||
|
||||
@ -117,11 +113,11 @@ Hyper-V 不适用于 Windows 10/11 家庭版。
|
||||
|
||||
在某些类型的虚拟磁盘中,它保留你指定的整个空间。因此,执行此操作时,请在启动之前检查可用磁盘空间。通常最好选择一个未安装 Windows 系统的单独驱动器。
|
||||
|
||||
**如果你遵循了上述所有提示,你的 Windows 系统就可以运行和管理虚拟机了。现在,你可以[**在 Windows 的虚拟机中轻松安装 Linux**][9]**。
|
||||
**如果你遵循了上述所有提示,你的 Windows 系统就可以运行和管理虚拟机了。现在,你可以 [在 Windows 的虚拟机中轻松地安装 Linux][9]**。
|
||||
|
||||
![][12]
|
||||
💬 那么,你喜欢用什么方式来处理虚拟机?请在下面的评论中告诉我们你的想法。
|
||||
|
||||
💬 _那么,你喜欢用什么方式来处理虚拟机?请在下面的评论中告诉我们你的想法。_
|
||||
*(题图:MJ/c1690724-a797-442b-8fb5-b6d41ef0c45c)*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -130,7 +126,7 @@ via: https://itsfoss.com/windows-enable-virtualization/
|
||||
作者:[Ankush Das][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/) 荣誉推出
|
||||
|
||||
@ -147,4 +143,5 @@ via: https://itsfoss.com/windows-enable-virtualization/
|
||||
[9]: https://itsfoss.com/install-linux-in-virtualbox/
|
||||
[10]: https://itsfoss.com/content/images/2023/07/virtualbox-7.png
|
||||
[11]: https://www.vmware.com/products/workstation-player.html
|
||||
[12]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png
|
||||
[12]: https://itsfoss.com/virtualization-software-linux/
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202309/13/100649idhbxhxehrqb9ahh.jpg
|
@ -3,19 +3,22 @@
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-16187-1.html"
|
||||
|
||||
Ubuntu 23.10 将提供实验性 TPM 支持的全磁盘加密
|
||||
======
|
||||
展望未来,Ubuntu 将允许你利用 TPM 支持的全磁盘加密。但是,这是你想要的吗?
|
||||
|
||||
![][0]
|
||||
|
||||
> 展望未来,Ubuntu 将允许你利用 TPM 支持的全磁盘加密。但是,这是你想要的吗?
|
||||
|
||||
Ubuntu 23.10 每日构建不断增加令人兴奋的新功能!
|
||||
|
||||
早些时候,我们介绍了[主要的 PPA 更改][1]和新的[基于 Flutter 的商店][2](也随最新的每日构建一起发布)。
|
||||
早些时候,我们介绍了 [主要的 PPA 变化][1] 和新的 [基于 Flutter 的商店][2](也随最新的每日构建一起发布)。
|
||||
|
||||
现在,我们又进行了另一项重大更改,通过更改用户处理磁盘加密的方式(如果启用),增强 Ubuntu 系统的安全性。
|
||||
现在,我们又看到了另一项重大更改,通过更改用户处理磁盘加密的方式(如果启用),增强 Ubuntu 系统的安全性。
|
||||
|
||||
该功能的初始支持将在 Ubuntu 23.10 中提供,并将在未来的 Ubuntu 版本中得到改进。
|
||||
|
||||
@ -23,23 +26,21 @@ Ubuntu 23.10 每日构建不断增加令人兴奋的新功能!
|
||||
|
||||
![][4]
|
||||
|
||||
TPM 支持的全磁盘加密 (FDE) 作为**一项实验性功能**引入,是 Ubuntu 过去 15 年处理 FDE 方式的重大变化。
|
||||
TPM 支持的<ruby>全磁盘加密<rt>Full Disk Encryption</rt></ruby>(FDE)作为**一项实验性功能**引入,是 Ubuntu 过去 15 年处理 FDE 方式的重大变化。
|
||||
|
||||
**在现有系统中**,采用了密码机制,该机制将通过接受用户设置的密码来对用户进行身份验证,然后使用该密码提供对磁盘的访问。
|
||||
|
||||
所有这一切都是由于集成了 **[Linux 统一密钥设置][5]** (LUKS) 框架而成为可能,该框架在块级别处理磁盘加密。
|
||||
所有这一切都是由于集成了 <ruby>[Linux 统一密钥设置][5]<rt>Linux Unified Key Setup</rt></ruby>(LUKS)框架而成为可能,该框架在块级别处理磁盘加密。
|
||||
|
||||
**使用 TPM 支持的系统**,主板上的 TPM 芯片将用于提供全磁盘加密,而无需密码。
|
||||
|
||||
**芯片将处理锁定完整 EFI 状态的密钥**以及内核命令行的解密。只有当设备使用已定义为“**授权**”来访问机密数据的软件启动时,才有可能实现这一点。
|
||||
**芯片将处理锁定完整 EFI 状态的密钥** 以及内核命令行的解密。只有当设备使用已定义为“**授权**”来访问机密数据的软件启动时,才有可能实现这一点。
|
||||
|
||||
📋
|
||||
|
||||
TPM 代表[可信平台模块][6]。
|
||||
> 📋 TPM <ruby>[可信平台模块][6]<rt>Trusted Platform Module</rt></ruby> 的缩写。
|
||||
|
||||
**但是,有一个问题。**
|
||||
|
||||
TPM 支持的 FDE 基于与 [Ubuntu Core][8] [相同的架构][7],这导致了许多关键组件的共享,这些组件**以 snap 包的形式提供**。因此,**引导加载程序**(shim/GRUB)和**内核文件**等内容是通过 snap 交付的。
|
||||
TPM 支持的 FDE 基于与 [Ubuntu Core][8] [相同的架构][7],这导致了许多关键组件的共享,这些组件 **以 Snap 包的形式提供**。因此,**引导加载程序**(shim/GRUB)和**内核文件**等内容是通过 Snap 交付的。
|
||||
|
||||
幸运的是,这种新的 **TPM 支持的 FDE 并不是加密磁盘的唯一方法**。对于那些不想使用新系统的人来说,**传统密码系统仍将存在**。
|
||||
|
||||
@ -49,17 +50,15 @@ TPM 支持的 FDE 基于与 [Ubuntu Core][8] [相同的架构][7],这导致了
|
||||
|
||||
**有兴趣测试一下吗?** 🤔
|
||||
|
||||
🚧
|
||||
> 🚧 测试任何实验功能都可能导致全部数据丢失。因此,请自行承担风险。
|
||||
|
||||
测试任何实验功能都可能导致全部数据丢失。因此,请自行承担风险。
|
||||
|
||||
好吧,TPM 支持的 FDE 已推出到 **Ubuntu 23.10** 的[**每日构建**][10]中,你只需在安装过程中进行设置,如本文中的截图所示。
|
||||
好吧,TPM 支持的 FDE 已推出到 **Ubuntu 23.10** 的 [每日构建][10] 中,你只需在安装过程中进行设置,如本文中的截图所示。
|
||||
|
||||
在 Ubuntu 安装程序中选择安装类型时,可在“**高级功能**”下使用新的 FDE 选项。
|
||||
|
||||
_💬 你对这个新的实验性功能有何看法? 在下面的评论中分享你的想法。_
|
||||
💬 你对这个新的实验性功能有何看法? 在下面的评论中分享你的想法。
|
||||
|
||||
* * *
|
||||
*(题图:MJ/d89e5b66-af24-4a2f-b351-9257239819cd)*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -68,7 +67,7 @@ via: https://news.itsfoss.com/ubuntu-23-10-disk-encryption/
|
||||
作者:[Sourav Rudra][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/) 荣誉推出
|
||||
|
||||
@ -84,3 +83,4 @@ via: https://news.itsfoss.com/ubuntu-23-10-disk-encryption/
|
||||
[8]: https://ubuntu.com/core
|
||||
[9]: https://ubuntu.com/blog/tpm-backed-full-disk-encryption-is-coming-to-ubuntu
|
||||
[10]: https://cdimage.ubuntu.com/daily-live/current/
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202309/13/104252l8yzx8ivb8y59iv6.jpg
|
@ -0,0 +1,82 @@
|
||||
[#]: subject: "openSUSE Wants to Replace Leap With a New Offering"
|
||||
[#]: via: "https://news.itsfoss.com/opensuse-leap-replacement/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-16195-1.html"
|
||||
|
||||
openSUSE 将用新产品取代 Leap
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> openSUSE Leap 将被新产品取代。在这里了解更多。
|
||||
|
||||
openSUSE 项目的长期贡献者 Richard Brown 分享了最近贡献者调查的一些结果。
|
||||
|
||||
这是关于用新的社区构建的产品取代 openSUSE Leap 的兴趣和可行性。哦?一个 openSUSE Leap 的替代品?
|
||||
|
||||
有趣的消息,对吧? 😳
|
||||
|
||||
这并不令人震惊。随着 <ruby>适应性 Linux 平台<rt>Adaptable Linux Platform</rt></ruby> (ALP) 的推出,openSUSE 团队曾 [暗示][1] Leap 将于 **2022** 停止运营。所以,这是预料之中的。
|
||||
|
||||
但是,有哪些选择可以替代 openSUSE Leap?
|
||||
|
||||
### Tumbleweed 衍生版可能取代 Leap
|
||||
|
||||
根据这份更换提案,我们有两种选择:
|
||||
|
||||
* **Linarite**:一个普通的老式桌面发行版,软件包的选择范围可能比我们习惯的 Leap 更小,除非我们找到更多的贡献者来支持所有的软件包。
|
||||
* **Slowroll** :是 Tumbleweed 的衍生版本,尽可能地自动构建,使用自动化和度量标准仅在特定条件(最大周期、X 周无变化等)后才从 Tumbleweed 复制软件包。基本上,它试图提供比全速运行的 Tumbleweed 不那么风险的东西。
|
||||
|
||||
> 作为这件事的后继,openSUSE 现在为 Slowroll 做了一个 [页面][1A] 供你测试。
|
||||
|
||||
然而,调查结果显示意见不一。
|
||||
|
||||
大多数**用户**选择 “**Slowroll**” 作为未来可行的替代方案,他们愿意为此做出贡献。
|
||||
|
||||
相比之下,**贡献者**们则投票不取代 openSUSE Leap 或使用 Tumbleweed 替代它。
|
||||
|
||||
但是,在选择一个选项时,贡献者选择了 “**Linarite**”。
|
||||
|
||||
因此,用户和现有贡献者有不同的选择。
|
||||
|
||||
openSUSE 决定按照**用户**的喜好使用滚动发行版 Slowroll。它需要比调查中表示感兴趣的更多的贡献者。
|
||||
|
||||
Richard 还透露,**两个替代方案中的任何一个都需要比 Leap** 付出更多的努力,而且截至目前,对这两个选项感兴趣的 **贡献者数量比 Leap** 少。
|
||||
|
||||
> 即使有 61 个人直接为代码库和 backports/PackageHub 做出贡献,Leap 仍然举步维艰。这时我们就可以借用 SLE 代码库,这大大减少了所需的工作。
|
||||
>
|
||||
> Slowroll 或 Linarite 都比 Leap 需要更多的打包和维护工作。
|
||||
|
||||
他还强调,**任何 Leap 替代品都应该专注于桌面场景**,而不是试图同时兼顾服务器和桌面的需求。
|
||||
|
||||
### 换还是不换?
|
||||
|
||||
[调查结果公告][2] 要求社区回答 openSUSE 是否应该继续替换 Leap。
|
||||
|
||||
而且,如果他们继续这样做,社区可以帮助他们支持吗?
|
||||
|
||||
💬 你认为 openSUSE 的最终决定应该是什么? 请在下面的评论部分告诉我你的想法。
|
||||
|
||||
(题图:MJ/f0fcd9d7-dcae-493f-83db-4a0338eece3b)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/opensuse-leap-replacement/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/N6TTE7ZBY7GFJ27XSDTXRF3MVLF6HW4W/
|
||||
[1A]: https://en.opensuse.org/openSUSE:Slowroll
|
||||
[2]: https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/KJMMAZFTP2MPKWKFZCYUROZFJ44BNVB5/
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202309/16/105805yqv5omxmwbmj5amk.jpg
|
@ -0,0 +1,86 @@
|
||||
[#]: subject: "Linux Malware! Read This If You Use Free Download Manager"
|
||||
[#]: via: "https://news.itsfoss.com/free-download-manager-malware/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: "wxy"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-16190-1.html"
|
||||
|
||||
如果你使用过 “Free Download Manager”,必读以下信息
|
||||
======
|
||||
|
||||
![][0]
|
||||
|
||||
> 无论如何,保持谨慎总是上策!
|
||||
|
||||
对于 Linux 的恶意软件,我们并不常提及,这是因为它常会被迅速修复,并且与 Windows/macOS 相比,在现实中被利用的情况相对较少。
|
||||
|
||||
然而,一款颇受欢迎的跨平台下载管理器 **Free Download Manager**,最近引起了一些关注。
|
||||
|
||||
虽然在我们的 [下载管理器列表][1] 中,并未将其列为 Linux 的推荐选项,但我们的一些读者以及我自己在过去的 Windows 使用体验中,都曾选择了它。
|
||||
|
||||
那么,问题来了,这究竟是怎么回事?
|
||||
|
||||
### 伪装成 Linux 版 Free Download Manager 的恶意软件
|
||||
|
||||
**Free Download Manager 本身并非恶意软件**。但问题在于,研究人员发现了一个恶意 Linux 程序包,而这个包,正是假冒 Free Download Manager 的。
|
||||
|
||||
安全研究公司卡巴斯基的研究员们 [发现][2],这个恶意程序包已经存在了至少两年(**2020-2022年**)的时间,而在此期间,大部分使用者并未意识到他们所安装的软件包,含有恶意组件。
|
||||
|
||||
许多恶意程序包都试图伪装成市场上受欢迎的程序;那么,_这件事究竟是怎么回事呢?_
|
||||
|
||||
**问题的核心在于**:这个恶意程序包是通过 **Free Download Manager 的官方网站** 😱 和其他非官方渠道分发的,一直持续到 2022 年。
|
||||
|
||||
> 🚧 Free Download Manager 的官方网站是 `freedownloadmanager.org`,正式的下载 URL 是 `files2.freedownloadmanager.org`。
|
||||
|
||||
而恶意程序包下载的域名是 `deb.fdmpkg.org`。
|
||||
|
||||
换言之,这表明开发者并未察觉其官方网站已被恶意破坏,用户已被重定向,下载安装来自另一个域名的带有恶意的 Linux 程序包。
|
||||
|
||||
**需要注意的是**:并非所有用户在 2020 年至 2022 年期间,都被从官方网站重定向,下载了恶意程序包。然而,这并不能让情况改观,对吧?
|
||||
|
||||
你可能下载了,也可能没有下载安装过这个具有感染性的程序包 😕
|
||||
|
||||
**这个恶意软件究竟干了什么** 🤖
|
||||
|
||||
卡巴斯基的报告在描述这个恶意软件时,称其为 “一种 bash 窃取器”,这种窃取器可以收集系统信息、浏览记录、已保存的密码、加密货币钱包的文件,以及云服务的凭据,包括 AWS、Google Cloud、Oracle Cloud Infrastructure 以及 Azure 等。
|
||||
|
||||
考虑到在现实世界中很少看到 Linux 版的恶意软件,因此验证你下载工具的来源和可靠程度是至关重要的,这需要你始终保持谨慎态度。
|
||||
|
||||
尽管我们并未明确了解有多少的 Linux 用户习惯使用 Free Download Manager,但这的确是令人警惕的新闻。你应当遵循所有 [提高隐私保护的建议][3],确保你的在线体验安全无忧。
|
||||
|
||||
### 现在,你应该怎么做?
|
||||
|
||||
在软件的开发者就此问题做出正式公开回应之前,我会建议你转而使用其他下载管理器:
|
||||
|
||||
> **[6 个最好的 Linux 下载管理器][4]**
|
||||
|
||||
如果你不记得(或无法确认你下载源的准确位置),我会建议你移除该下载管理器。
|
||||
|
||||
另外,我建议你阅读卡巴斯基发表的 [研究报告][2],找出可能的系统遭受损害的迹象。如果你的系统中存在相同的文件路径,且 Debian 程序包的恶意校验和与之相吻合,那么你应该手动移除它们。
|
||||
|
||||
即使你想要重新下载该软件,在安装包到你的 Linux 系统之前,你也必须核对下载 URL 的准确性。
|
||||
|
||||
💬 你如何看待 Linux 用户如何保护自己避免受到恶意软件的攻击?欢迎在评论中留言分享你的想法。
|
||||
|
||||
*(题图:MJ/6b1e3b3f-a880-4342-b38b-500468c72052)*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/free-download-manager-malware/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:ChatGPT
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/best-download-managers-linux/
|
||||
[2]: https://securelist.com/backdoored-free-download-manager-linux-malware/110465/
|
||||
[3]: https://itsfoss.com/improve-privacy/
|
||||
[4]: https://itsfoss.com/best-download-managers-linux/
|
||||
[0]: https://img.linux.net.cn/data/attachment/album/202309/14/080300ykkwbb9n48kj81bn.jpg
|
@ -1,77 +0,0 @@
|
||||
[#]: subject: "openSUSE Wants to Replace Leap With a New Offering"
|
||||
[#]: via: "https://news.itsfoss.com/opensuse-leap-replacement/"
|
||||
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
openSUSE Wants to Replace Leap With a New Offering
|
||||
======
|
||||
openSUSE Leap is set to be replaced with a new option. Learn more about
|
||||
it here.
|
||||
Richard Brown, a long-time contributor to the openSUSE project, shared some results from a recent contributor survey.
|
||||
|
||||
It was about the interest and feasibility of replacing openSUSE Leap with a new community-built offering. Yes? A replacement to openSUSE Leap?
|
||||
|
||||
Interesting news, right? 😳
|
||||
|
||||
It's not shocking. The openSUSE team [hinted][1] at Leap being discontinued in **2022** with the introduction of the **Adaptable Linux Platform** (ALP). So, it was expected.
|
||||
|
||||
But, what are the options to replace openSUSE Leap with?
|
||||
|
||||
### A Derivative of Tumbleweed Likely to Replace Leap
|
||||
|
||||
As per the replacement proposal, we have two options:
|
||||
|
||||
* **Linarite** : _A regular old-fashioned release desktop distribution, likely with a narrower package selection than we're used to with Leap unless we find significantly more contributors to be able to support everything_
|
||||
* **Slowroll** : _A derivative of Tumbleweed, built automatically as much as possible, using automation and metrics to copy packages from Tumbleweed only after certain conditions (max age, X weeks without change, etc). Basically an attempt to provide something less scary than full speed Tumbleweed._
|
||||
|
||||
|
||||
|
||||
However, the survey results show a mixed bag of opinions.
|
||||
|
||||
Most **users** choose " **Slowroll** " as a viable replacement going forward, which they would like to contribute to.
|
||||
|
||||
In contrast, **contributors** voted not to replace openSUSE Leap or use Tumbleweed instead.
|
||||
|
||||
But, when choosing one option, the contributors chose " **Linarite** ".
|
||||
|
||||
So, the users and existing contributors have different choices.
|
||||
|
||||
OpenSUSE decides to go with the users' preference as Slowroll, a rolling release distro. It would need more contributors than what the survey highlights as interested.
|
||||
|
||||
Richard also revealed that either of the **two replacements will need more effort than Leap** , and as of now, the **contributors interested in both options are fewer in number when compared to Leap**.
|
||||
|
||||
> Leap has struggled even with 61 folk contributing directly to the codebase and backports/PackageHub. And this is when we've had the SLE codebase to borrow from, which dramatically reduced the work required.
|
||||
>
|
||||
> Either Slowroll or Linarite would require considerably more packaging and maintenance work than Leap.
|
||||
|
||||
He also emphasized that **any Leap replacement should focus on desktop use cases** rather than trying to cater to both server and desktop.
|
||||
|
||||
### To Replace or Not?
|
||||
|
||||
The [announcement of survey results][2] challenges the community to answer if openSUSE should proceed with replacing Leap or not.
|
||||
|
||||
And, if they go ahead, can the community help them support it?
|
||||
|
||||
_💬_ _What do you think should be the final decision for openSUSE? Let me know your thoughts in the comments section below._
|
||||
|
||||
* * *
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/opensuse-leap-replacement/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/N6TTE7ZBY7GFJ27XSDTXRF3MVLF6HW4W/
|
||||
[2]: https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/KJMMAZFTP2MPKWKFZCYUROZFJ44BNVB5/
|
@ -0,0 +1,117 @@
|
||||
[#]: subject: "Coding in Rust? Here's a New IDE by JetBrains"
|
||||
[#]: via: "https://news.itsfoss.com/rust-ide-jetbreains/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Coding in Rust? Here's a New IDE by JetBrains
|
||||
======
|
||||
Rust developers, you have something new to try out!
|
||||
After recently announcing that IntelliJ-based IDEs [will support][1] the Wayland [display server][2] protocol, JetBrains has unveiled a **new IDE for Rust Developers**.
|
||||
|
||||
Called the “ **RustRover** ”, it aims to be **a feature-packed standalone Rust IDE** that is set to receive regular updates, quick support, and an “out-of-the-box experience”.
|
||||
|
||||
Allow me to show you what it has to offer.
|
||||
|
||||
📋
|
||||
|
||||
This is an early access tool not meant for production usage right now.
|
||||
|
||||
### RustRover: What to Expect?
|
||||
|
||||
![][3]
|
||||
|
||||
🚧
|
||||
|
||||
RustRover is not FOSS.
|
||||
|
||||
Developed from the ground up, RustRover **replaces the now deprecated[IntelliJ Rust][4] plugin** that used to handle Rust support on the JetBrains platform.
|
||||
|
||||
It has been built in line with JetBrains' other IDEs for providing **a dedicated Rust development environment** , that was missing previously.
|
||||
|
||||
💡
|
||||
|
||||
RustRover also uses the IntelliJ Rust plugin as a building block.
|
||||
|
||||
In its current state, RustRover has support for languages and technologies such as **Rust** , **Cargo** , **TOML** , **web** , and **database**. With the **additional functionality of[IntelliJ IDEA][5]**, including **[VCS integration][6]**.
|
||||
|
||||
And, as for its features, there are quite a few! 🗒️
|
||||
|
||||
**For coding,** it has support for **code completion** , **code generation** , **smart refactoring** , **live templates** , and more. RustRover has been designed to help users write code faster, and more accurately.
|
||||
|
||||
It also features the essentials, like **syntax highlighting** , **macro expansion** , **cross-language actions** , etc. for helping understand the codebase better.
|
||||
|
||||
**For testing** , RustRover features test runners, a debugger, support for running configurations, run targets, profiling and performance analysis.
|
||||
|
||||
**For project management** , it has support for Cargo and 'Cargo.toml', build scripts, code completion in dependency declarations, with easy access to crates documentation.
|
||||
|
||||
RustRover also **features some neat real-time collaboration features** such as **support for[VCS][7]** ([Git][8] and [GitHub][9]), **configuration sharing** , and **[code with me][10]**.
|
||||
|
||||
You are maybe wondering; **what about its licensing and pricing model?**
|
||||
|
||||
Seeing as **RustRover is not** **open-source** , JetBrains has **plans to sell it as a commercial product on a subscription basis** , similar to its other IDE offerings.
|
||||
|
||||
The pricing structure is yet to be finalized, but expect something similar to what they have been charging for their IDE products.
|
||||
|
||||
You can go through their [announcement blog][11] to know more about RustRover.
|
||||
|
||||
📋
|
||||
|
||||
Seeing that we are on the topic of Rust, why not give our [Rust Basics series][12] a try? It should act as a nice introduction into the world of Rust.
|
||||
|
||||
**Suggested Read** 📖
|
||||
|
||||
![][13]
|
||||
|
||||
**Want to give it a try?**
|
||||
|
||||
RustRover has been made available as **a tar.gz package** , **a JetBrains Toolbox App** , and as **a Snap for Ubuntu**. You can grab the package of your choice from the [official website][14].
|
||||
|
||||
[RustRover][14]
|
||||
|
||||
For Ubuntu, you can also run this command:
|
||||
|
||||
```
|
||||
|
||||
sudo snap install jetbrains rustrover --classic
|
||||
|
||||
```
|
||||
|
||||
Do note that, at the time of writing this article, the **Snap package was not working as expected** , throwing an error during install when using the above-mentioned command.
|
||||
|
||||
JetBrains have **planned to keep RustRover in public review until September 2024** , with scope for the release of a stable version before that.
|
||||
|
||||
_💬 Would you be interested in using such an IDE for coding in Rust? Share your thoughts in the comments below!_
|
||||
|
||||
* * *
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/rust-ide-jetbreains/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://news.itsfoss.com/intellij-wayland-support/
|
||||
[2]: https://itsfoss.com/display-server/
|
||||
[3]: https://news.itsfoss.com/content/images/2023/09/RustRover_IDE.png
|
||||
[4]: https://intellij-rust.github.io/
|
||||
[5]: https://www.jetbrains.com/idea/
|
||||
[6]: https://www.jetbrains.com/help/youtrack/cloud/Integration-with-Version-Control-Systems.html
|
||||
[7]: https://en.wikipedia.org/wiki/Version_control
|
||||
[8]: https://git-scm.com/
|
||||
[9]: https://github.com/
|
||||
[10]: https://www.jetbrains.com/code-with-me/
|
||||
[11]: https://blog.jetbrains.com/rust/2023/09/13/introducing-rustrover-a-standalone-rust-ide-by-jetbrains/
|
||||
[12]: https://itsfoss.com/tag/rust-basics/
|
||||
[13]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png
|
||||
[14]: https://www.jetbrains.com/rust/download/
|
@ -1,141 +0,0 @@
|
||||
[#]: subject: "4 levels of DevOps documentation maturity"
|
||||
[#]: via: "https://opensource.com/article/22/2/devops-documentation-maturity"
|
||||
[#]: author: "Will Kelly https://opensource.com/users/willkelly"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "toknow-gh"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
4 levels of DevOps documentation maturity
|
||||
======
|
||||
DevOps documentation requires a similar journey as you went through to
|
||||
reach DevOps or DevSecOps maturity.
|
||||
![Green graph of measurements][1]
|
||||
|
||||
DevOps and DevSecOps require agile documentation practices to deliver quality documentation on time with an iterative software delivery cycle. It's a similar journey to DevOps with a move to automation and a more agile approach to content. If documentation is only now entering your organization's DevOps discussions, it's time to catch your documentation practices up to DevOps.
|
||||
|
||||
Here are the four levels of DevOps documentation maturity:
|
||||
|
||||
### Level 1: Ad hoc and siloed
|
||||
|
||||
In the first level of DevOps documentation maturity (most immature), documentation efforts do not align with DevOps efforts. DevOps development follows their path while the documentation team follows a separate path, which often causes the documentation to be behind the development. Delaying a product launch because of documentation is not an option in the hyper-competitive cloud world.
|
||||
|
||||
#### Staffing
|
||||
|
||||
The documentation staffing at this level hasn't deviated from the old way of doing things. Technical writers still work in a centralized team detached from the development teams. A gulf between the technical writing group and development teams happens for a variety of reasons, including:
|
||||
|
||||
* Corporate politics that create team divisions and silos
|
||||
* The team sees technical documentation as a checkmark, not an asset that creates project success
|
||||
* The hiring of technical writers in an afterthought
|
||||
* Misalignment of technical writer priorities with development team realities
|
||||
|
||||
|
||||
|
||||
Another sign of staffing challenges at this phase is the "definition of done." This is where technical writers new to the agile experience may find it challenging working with applications developed through the iteration that continuous integration/continuous development (CI/CD) toolchains and processes.
|
||||
|
||||
#### Documentation tools and processes
|
||||
|
||||
Technical writers in this phase use tools they're used to from traditional office work, such as office suites and layout programs. The tools aren't agile and require version control, and content management requirements don't integrate efficiently with DevOps toolchains or support development velocity. Technical writers still follow legacy templates and processes at this level.
|
||||
|
||||
#### Outcomes
|
||||
|
||||
The documentation deliverables at this level may not be current or even lack technical accuracy. When a development team moves at the velocity of DevOps and their technical writer support follows a legacy non-agile process (using proprietary tools and delivery formats), it is difficult to iterate the documentation and keep pace with application changes.
|
||||
|
||||
### Level 2: Experimentation and pilot
|
||||
|
||||
The second level of DevOps documentation maturity (experimentation phase) is where DevOps leads and technical writers make the first moves to implement more agile documentation practices and tools.
|
||||
|
||||
Ideally, experimentation is part of a pilot project with support from stakeholders who have the most to gain from improved documentation delivery and its integration with DevOps practices.
|
||||
|
||||
#### Staffing
|
||||
|
||||
The staffing at the experimental phase can take one of three forms:
|
||||
|
||||
1. A forward-thinking technical writer experimenting with more agile tools on their own time brings their findings to work because they want a better way to do their job. The writer pitches the idea of a more agile documentation process to their leadership.
|
||||
2. The DevOps lead or engineer is experimenting with tools such as Hugo and Jekyll and integrating the tool into the CI/CD pipeline. The DevOps team teaches the tooling to the technical writer.
|
||||
3. The team brings in third-party contractors or consultants with expertise in DevOps documentation tools and knowledge of where documentation tools fit into the CI/CD toolchain and DevOps lifecycle.
|
||||
|
||||
|
||||
|
||||
#### Documentation tools & practices
|
||||
|
||||
[Hugo][2] and [Jekyll][3] are among the tools that appear during this phase. This phase also sees new approaches to content strategy and technical writing.
|
||||
|
||||
#### Outcomes
|
||||
|
||||
An outcome of a successful experimentation phase should be "land and expand" and set up DevOps documentation practices that other project teams can put into practice.
|
||||
|
||||
Experimentation in this phase also includes fundamental changes to content strategy and publishing processes, which technical writers outside the pilot project can learn and adopt.
|
||||
|
||||
A change in [technical writer hiring practices][4] is another potential outcome of this phase based on the pilot's success. It's essential to bring your in-house writers along by offering them training about DevOps and your newly implemented documentation tools.
|
||||
|
||||
New documentation tooling and processes are the critical outcomes for this phase. You'll also need to sell this outcome to your leadership, stakeholders, and other teams through presentations, status reports, and internal case studies.
|
||||
|
||||
### Level 3: Partial automation and expansion
|
||||
|
||||
The third level of DevOps documentation maturity (partial automation and expansion) is the next step in the "land and expand" outcome. In this phase, other DevOps teams adopt the DevOps documentation tools, practices, and lessons learned from the pilot project.
|
||||
|
||||
#### Staffing
|
||||
|
||||
Technical writers and DevOps teams begin a much closer collaboration at this level. Hiring new technical writers at this level focuses on writers with experience in DevOps environments.
|
||||
|
||||
#### Tools and documentation practices
|
||||
|
||||
Technical writers begin to migrate away from their legacy tools and processes and adopt more agile documentation tools during this phase, such as:
|
||||
|
||||
* [docToolchain][5]
|
||||
* [Docbook][6]
|
||||
* Hugo
|
||||
* Jekyll
|
||||
|
||||
|
||||
|
||||
Technical writers also work to adjust their legacy practices at this level.
|
||||
|
||||
#### Outcomes
|
||||
|
||||
DevOps documentation tools and practices expand beyond the pilot project(s) to become standard practices. Continuous learning is essential at this level as new teams go live with new documentation tools and processes.
|
||||
|
||||
### Level 4: Full adoption
|
||||
|
||||
The highest level of DevOps documentation maturity (full adoption and automation) is where the tools, practices, and processes are in place to support documentation as a top-level project priority. Reaching this level of maturity requires experimentation, iteration, and collaboration.
|
||||
|
||||
#### Staffing
|
||||
|
||||
Full automation brings together the closest collaboration between the DevOps team and technical writers. A mark of this phase is that your technical writers become firmly embedded into the project team's workflow. Large enterprises with engineers assigned to maintain DevOps toolchains assume maintenance duties over the documentation tools.
|
||||
|
||||
#### Documentation tools and practices
|
||||
|
||||
Technical writers at this level of maturity are standardized on markdown language and automated tools.
|
||||
|
||||
#### Outcomes
|
||||
|
||||
The outcomes at this phase are a complete suite of tools and practices that support the automation of online documentation publishing. Technical writers can publish and republish documentation as needed to support an iterative development process.
|
||||
|
||||
Continuous learning is another outcome of this phase. Technical writers and toolchain maintainers seek ways to improve automation and processes that help documentation practices.
|
||||
|
||||
### Final thoughts
|
||||
|
||||
DevOps documentation requires a similar journey as you went through to reach DevOps or DevSecOps maturity. I hope to reach a point across industries where moving to more agile documentation practices and tools becomes part of an organization's overall DevOps journey. There is still work to be done. Advancing your DevOps documentation maturity should come as part of your overall DevOps maturity or even [DevOps to DevSecOps transformation][7].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/2/devops-documentation-maturity
|
||||
|
||||
作者:[Will Kelly][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/willkelly
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_lead-steps-measure.png?itok=DG7rFZPk (Green graph of measurements)
|
||||
[2]: https://opensource.com/article/18/3/start-blog-30-minutes-hugo
|
||||
[3]: https://opensource.com/article/17/4/getting-started-jekyll
|
||||
[4]: https://opensource.com/article/19/11/hiring-technical-writers-devops
|
||||
[5]: http://doctoolchain.org/
|
||||
[6]: https://opensource.com/article/17/9/docbook
|
||||
[7]: https://opensource.com/article/21/10/devops-to-devsecops
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://opensource.com/article/22/5/document-source-code-doxygen-linux"
|
||||
[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "toknow-gh"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
@ -1,146 +0,0 @@
|
||||
[#]: subject: "How I use the attr command with my Linux filesystem"
|
||||
[#]: via: "https://opensource.com/article/22/6/linux-attr-command"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How I use the attr command with my Linux filesystem
|
||||
======
|
||||
I use the open source XFS filesystem because of the subtle convenience of extended attributes. Extended attributes are a unique way to add context to my data.
|
||||
|
||||
![Why the operating system matters even more in 2017][1]
|
||||
|
||||
Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0
|
||||
|
||||
The term *filesystem* is a fancy word to describe how your computer keeps track of all the files you create. Whether it's an office document, a configuration file, or thousands of digital photos, your computer has to store a lot of data in a way that's useful for both you and it. Filesystems like Ext4, XFS, JFS, BtrFS, and so on are the "languages" your computer uses to keep track of data.
|
||||
|
||||
Your desktop or terminal can do a lot to help you find your data quickly. Your file manager might have, for instance, a filter function so you can quickly see just the image files in your home directory, or it might have a search function that can locate a file by its filename, and so on. These qualities are known as *file attributes* because they are exactly that: Attributes of the data object, defined by code in file headers and within the filesystem itself. Most filesystems record standard file attributes such as filename, file size, file type, time stamps for when it was created, and time stamps for when it was last visited.
|
||||
|
||||
I use the open source XFS filesystem on my computers not for its reliability and high performance but for the subtle convenience of extended attributes.
|
||||
|
||||
### Common file attributes
|
||||
|
||||
When you save a file, data about it are saved along with it. Common attributes tell your operating system whether to update the access time, when to synchronize the data in the file back to disk, and other logistical details. Which attributes get saved depends on the capabilities and features of the underlying filesystem.
|
||||
|
||||
In addition to standard file attributes (insofar as there are standard attributes), the XFS, Ext4, and BtrFS filesystems can all use extending filesystems.
|
||||
|
||||
### Extended attributes
|
||||
|
||||
XFS, Ext4, and BtrFS allow you to create your own arbitrary file attributes. Because you're making up attributes, there's nothing built into your operating system to utilize them, but I use them as "tags" for files in much the same way I use EXIF data on photos. Developers might choose to use extended attributes to develop custom capabilities in applications.
|
||||
|
||||
There are two "namespaces" for attributes in XFS: **user** and **root**. When creating an attribute, you must add your attribute to one of these namespaces. To add an attribute to the **root** namespace, you must use the `sudo` command or be logged in as root.
|
||||
|
||||
### Add an attribute
|
||||
|
||||
You can add an attribute to a file on an XFS filesystem with the `attr` or `setfattr` commands.
|
||||
|
||||
The `attr` command assumes the `user` namespace, so you only have to set (`-s` ) a name for your attribute followed by a value (`-V` ):
|
||||
|
||||
```
|
||||
$ attr -s flavor -V vanilla example.txt
|
||||
Attribute "flavor" set to a 7 byte value for example.txt:
|
||||
vanilla
|
||||
```
|
||||
|
||||
The `setfattr` command requires that you specify the target namespace:
|
||||
|
||||
```
|
||||
$ setfattr --name user.flavor --value chocolate example.txt
|
||||
```
|
||||
|
||||
### List extended file attributes
|
||||
|
||||
Use the `attr` or `getfattr` commands to see extended attributes you've added to a file. The `attr` command defaults to the **user** namespace and uses the `-g` option to *get* extended attributes:
|
||||
|
||||
```
|
||||
$ attr -g flavor example.txt
|
||||
Attribute "flavor" had a 9 byte value for example.txt:
|
||||
chocolate
|
||||
```
|
||||
|
||||
The `getfattr` command requires the namespace and name of the attribute:
|
||||
|
||||
```
|
||||
$ getfattr --name user.flavor example.txt
|
||||
# file: example.txt
|
||||
user.flavor="chocolate"
|
||||
```
|
||||
|
||||
### List all extended attributes
|
||||
|
||||
To see all extended attributes on a file, you can use `attr -l` :
|
||||
|
||||
```
|
||||
$ attr -l example.txt
|
||||
Attribute "md5sum" has a 32 byte value for example.txt
|
||||
Attribute "flavor" has a 9 byte value for example.txt
|
||||
```
|
||||
|
||||
Alternately, you can use `getfattr -d` :
|
||||
|
||||
```
|
||||
$ getfattr -d example.txt
|
||||
# file: example.txt
|
||||
user.flavor="chocolate"
|
||||
user.md5sum="969181e76237567018e14fe1448dfd11"
|
||||
```
|
||||
|
||||
Any extended file attribute can be updated with `attr` or `setfattr`, just as if you were creating the attribute:
|
||||
|
||||
```
|
||||
$ setfattr --name user.flavor --value strawberry example.txt
|
||||
|
||||
$ getfattr -d example.txt
|
||||
# file: example.txt
|
||||
user.flavor="strawberry"
|
||||
user.md5sum="969181e76237567018e14fe1448dfd11"
|
||||
```
|
||||
|
||||
### Attributes on other filesystems
|
||||
|
||||
The greatest risk when using extended attributes is forgetting that these attributes are specific to the filesystem they're on. That means when you copy a file from one drive or partition to another, the attributes are lost *even if the target filesystem supports extended attributes*.
|
||||
|
||||
To avoid losing extended attributes, you must use a tool that supports retaining them, such as the `rsync` command.
|
||||
|
||||
```
|
||||
$ rsync --archive --xattrs ~/example.txt /tmp/
|
||||
```
|
||||
|
||||
No matter what tool you use, if you transfer a file to a filesystem that doesn't know what to do with extended attributes, those attributes are dropped.
|
||||
|
||||
### Search for attributes
|
||||
|
||||
There aren't many mechanisms to interact with extended attributes, so the options for using the file attributes you've added are limited. I use extended attributes as a tagging mechanism, which allows me to associate files that have no obvious relation to one another. For instance, suppose I need a Creative Commons graphic for a project I'm working on. Assume I've had the foresight to add the extended attribute **license** to my collection of graphics. I could search my graphic folder with `find` and `getfattr` together:
|
||||
|
||||
```
|
||||
find ~/Graphics/ -type f \
|
||||
-exec getfattr \
|
||||
--name user.license \
|
||||
-m cc-by-sa {} \; 2>/dev/null
|
||||
|
||||
# file: /home/tux/Graphics/Linux/kde-eco-award.png
|
||||
user.license="cc-by-sa"
|
||||
user.md5sum="969181e76237567018e14fe1448dfd11"
|
||||
```
|
||||
|
||||
### Secrets of your filesystem
|
||||
|
||||
Filesystems aren't generally something you're meant to notice. They're literally systems for defining a file. It's not the most exciting task a computer performs, and it's not something users are supposed to have to be concerned with. But some filesystems give you some fun, and safe, special abilities, and extended file attributes are a good example. Its use may be limited, but extended attributes are a unique way to add context to your data.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/6/linux-attr-command
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/lead-images/yearbook-haff-rx-linux-file-lead_0.png
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://itsfoss.com/ascii-art-linux-terminal/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "泠知落汐"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
@ -261,7 +261,7 @@ via: https://itsfoss.com/ascii-art-linux-terminal/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[泠知落汐](https://github.com/CoWave-Fall)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,164 +0,0 @@
|
||||
[#]: subject: "Using R for Building an Interactive Web App"
|
||||
[#]: via: "https://www.opensourceforu.com/2022/10/using-r-for-building-an-interactive-web-app/"
|
||||
[#]: author: "Dr Kumar Gaurav https://www.opensourceforu.com/author/dr-gaurav-kumar/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Using R for Building an Interactive Web App
|
||||
======
|
||||
*Data analysis has become imperative for companies, and there is a huge demand for data-driven applications with user friendly interfaces. This article tells you how to develop an interactive web app using the Shiny package in R, which is a popular programming language for data science.*
|
||||
|
||||
Nearly every business across the world relies on data today, in some way or the other. In fact, data science has helped transform many businesses by using data-driven applications, whether in the field of finance, banking, retail, logistics, e-commerce, transportation, airlines, or any other.
|
||||
|
||||
High performance computers and low-cost storage allow us to predict results in minutes today rather than the many hours it used to take earlier. Data scientists focused on the future are developing easy to use applications with high performance and multi-dimensional visualisation. It all starts with Big Data, which consists of three components: quantity, diversity, and velocity. Algorithms and models are fed from this data. The most cutting-edge data scientists working in machine learning and AI are creating models that self-improve, detecting and learning from their errors.
|
||||
|
||||
Statistics and computing are used to turn data into useful information in the field of data science, often termed as data-driven science. Data science is a synthesis of methods from a variety of fields to gather, analyse, and interpret data in order to develop new insights and make choices. The technological disciplines that constitute data science include statistics, probability, mathematics, machine learning, business intelligence, and some programming.
|
||||
Data science can be applied in various areas (Figure 1). The analysis of large, complicated data sets is the focus of data science. It has helped to create a new universe in which data is seen in whole new ways. Tech giants like Amazon, Google, and Facebook use data science principles for business intelligence and decision making.
|
||||
|
||||
![Figure 1 Key applications-and use cases of data science][1]
|
||||
|
||||
### R: The language for data science
|
||||
|
||||
Data analysis and insights are urgently needed because of the volume of information available. Raw data is transformed into finished data products with the help of a number of technologies. When it comes to research, processing, transformation, and visualisation of data, there are few better tools than R.
|
||||
|
||||
The key features in R for data science are:
|
||||
|
||||
* Data pre-processing
|
||||
* Social media fetching and analysis
|
||||
* Assorted operations on data frames
|
||||
* Extract, transform, load (ETL)
|
||||
* Connection to a variety of databases, including SQL and spreadsheets
|
||||
* Interaction with NoSQL databases
|
||||
* Training and prediction with models
|
||||
* Machine learning models
|
||||
* Clustering
|
||||
* Fourier transform
|
||||
* Web scraping
|
||||
|
||||
R is a robust programming language commonly used in statistical computation and data analysis. Efforts to enhance R’s user interface have been going on since long. Several data science groups throughout the world have followed the development of R from a simple text editor to the more current interactive R Studio and Jupyter Notebooks.
|
||||
|
||||
Only the contributions of R users throughout the world have made this possible. The inclusion of strong packages in R has made it increasingly powerful over time. Numerous open source packages have made it easier and more efficient to work with large data sets and visualise data.
|
||||
|
||||
### Developing interactive web applications in R using Shiny
|
||||
|
||||
You can construct interactive web apps in R using the Shiny package. Apps can be hosted on a website, embedded in R Markdown documents, or used to develop dashboards and visualisations. CSS themes, HTML widgets, and JavaScript actions can all be used to customise your Shiny apps further.
|
||||
|
||||
Shiny is an R tool that makes it simple to create interactive web apps. It allows you to extend your R code to the web so that it may benefit from the larger community of people who can use it.
|
||||
|
||||
In addition to Shiny’s built-in features, there are a number of third-party extension packages available, such as shinythemes, shinydashboard, and shinyjs.
|
||||
|
||||
There are various apps that can be developed using Shiny. Here is a list of a few of them.
|
||||
|
||||
* Machine learning based web apps
|
||||
* Web apps with dynamic controls
|
||||
* Data-driven dashboards
|
||||
* Interactive apps for multiple data sets
|
||||
* Real-time data visualisation panels
|
||||
* Data collection forms
|
||||
* Shiny web apps can be divided into the following:
|
||||
* User interface
|
||||
* Server function
|
||||
* Shiny app function
|
||||
|
||||
For better understanding, you can refer to the examples and use cases available at https://shiny.rstudio.com/gallery/.
|
||||
|
||||
One of the apps developed using Shiny is shown in Figure 2 (https://shiny.rstudio.com/gallery/radiant.html).
|
||||
|
||||
![Figure 2: Shiny based app][2]
|
||||
|
||||
### Generation of a sales dashboard
|
||||
|
||||
The code snippet for a web app related to a sales dashboard is given below. This dashboard has multiple controls and user interface modules to view the data.
|
||||
|
||||
First, the Shiny package is installed and then it is called in the code so that the output can be presented in the form of a web page.
|
||||
|
||||
```
|
||||
library(shiny)
|
||||
library(dplyr)
|
||||
|
||||
sales <- vroom::vroom(“salesdata.csv”, na = “”)
|
||||
ui <- fluidPage(
|
||||
titlePanel(“Dashboard for Sales Data”),
|
||||
sidebarLayout(
|
||||
sidebarPanel(
|
||||
selectInput(“territories”, “territories”, choices = unique(sales$territories)),
|
||||
selectInput(“Customers”, “Customer”, choices = NULL),
|
||||
selectInput(“orders”, “Order number”, choices = NULL, size = 5, selectize = FALSE),
|
||||
),
|
||||
mainPanel(
|
||||
uiOutput(“customer”),
|
||||
tableOutput(“data”)
|
||||
)
|
||||
)
|
||||
)
|
||||
server <- function(input, output, session) {
|
||||
territories <- reactive({
|
||||
req(input$territories)
|
||||
filter(sales, territories == input$territories)
|
||||
})
|
||||
customer <- reactive({
|
||||
req(input$Customers)
|
||||
filter(territories(), Customers == input$Customers)
|
||||
})
|
||||
|
||||
output$customer <- renderUI({
|
||||
row <- customer()[1, ]
|
||||
tags$div(
|
||||
class = “well”,
|
||||
tags$p(tags$strong(“Name: “), row$customers),
|
||||
tags$p(tags$strong(“Phone: “), row$contact),
|
||||
tags$p(tags$strong(“Contact: “), row$fname, “ “, row$lname)
|
||||
)
|
||||
})
|
||||
|
||||
order <- reactive({
|
||||
req(input$order)
|
||||
customer() %>%
|
||||
filter(ORDER == input$order) %>%
|
||||
arrange(OLNUMBER) %>%
|
||||
select(pline, qty, price, sales, status)
|
||||
})
|
||||
|
||||
output$data <- renderTable(order())
|
||||
|
||||
observeEvent(territories(), {
|
||||
updateSelectInput(session, “Customers”, choices = unique(territories()$Customers), selected = character())
|
||||
})
|
||||
observeEvent(customer(), {
|
||||
updateSelectInput(session, “order”, choices = unique(customer()$order))
|
||||
})
|
||||
}
|
||||
shinyApp(ui, server)
|
||||
```
|
||||
|
||||
On running the code of the Shiny app, the output shown in Figure 3 is generated which can be viewed on any web browser. The sales dashboard has multiple controls and is quite interactive with different user interface modules.
|
||||
|
||||
![Figure 3: Sales dashboard with multiple controls][3]
|
||||
|
||||
With the use of Shiny cloud, this app can be deployed and hosted on the cloud for anytime anywhere availability on the internet.
|
||||
|
||||
![Figure 4: Cloud for hosting and deployment of Shiny app][4]
|
||||
|
||||
The free variant of Shiny cloud allows five applications to be deployed within 25 active hours.
|
||||
Researchers and data scientists can develop user-friendly apps driven with real-time data using the Shiny library of R. This library can also be used for deploying their machine learning apps on web platforms.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.opensourceforu.com/2022/10/using-r-for-building-an-interactive-web-app/
|
||||
|
||||
作者:[Dr Kumar Gaurav][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.opensourceforu.com/author/dr-gaurav-kumar/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/09/Figure-1-Key-applications-and-use-cases-of-data-science.jpg
|
||||
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/09/Figure-2-Shiny-based-app.jpg
|
||||
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/09/Figure-3-Sales-dashboard-with-multiple-controls.jpg
|
||||
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/09/Figure-4-Cloud-for-hosting-and-deployment-of-Shiny-app.jpg
|
@ -1,114 +0,0 @@
|
||||
[#]: subject: "Working with Btrfs – General Concepts"
|
||||
[#]: via: "https://fedoramagazine.org/working-with-btrfs-general-concepts/"
|
||||
[#]: author: "Andreas Hartmann https://fedoramagazine.org/author/hartan/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Working with Btrfs – General Concepts
|
||||
======
|
||||
![][1]
|
||||
|
||||
Photo by [Heliberto Arias][2] on [Unsplash][3]
|
||||
|
||||
This article is part of a series of articles that takes a closer look at Btrfs. This is the default filesystem for Fedora Workstation and Fedora Silverblue since Fedora Linux 33.
|
||||
|
||||
### Introduction
|
||||
|
||||
Filesystems are one of the foundations of modern computers. They are an essential part of every operating system and they usually work unnoticed. However, modern filesystems such as Btrfs offer many great features that make working with computers more convenient. Next to other things they can, for example, transparently compress your files for you or build a solid foundation for incremental backups.
|
||||
|
||||
This article gives you a high-level overview of how the Btrfs filesystem works and some of the features it has. It will not go into much technical detail nor look at the implementation. More detailed explanations of some highlighted features follow in later articles of this series.
|
||||
|
||||
### What is a filesystem?
|
||||
|
||||
If you’ve heard before how filesystems work on the most basic level, then this isn’t new to you and you can skip to the next section. Otherwise, read ahead for a short introduction into what makes a filesystem in the first place.
|
||||
|
||||
In simple terms, a filesystem allows your PC to find the data that it stores on disk. This sounds like a trivial task, but in essence any type of non-volatile storage device today (such as HDDs, SSDs, SD cards, etc…) is still mostly what it was back in 1970 when PCs were being invented: A (huge) collection of storage blocks.
|
||||
|
||||
Blocks are the most granular addressable storage unit. Every file on your PC is stored across one or more blocks. A block is typically 4096 bytes in size. This depends on the hardware you have and the software (i.e. the filesystem) on top of it.
|
||||
|
||||
Filesystems allow us to find the contents of our files from the vast amount of available storage blocks. This is done via so-called *inodes*. An inode contains information about a file in a specially formatted storage block. This includes the file’s size, where to find the storage blocks that make up the file contents, its access rules (i.e. who can read, write or execute the file) and much more.
|
||||
|
||||
Below is an example of what this looks like:
|
||||
|
||||
![A text file “myfile.txt” and a hypothetical example of its representation on disk. All the squares are individual storage blocks.][4]
|
||||
|
||||
The structure of an inode has big implications on a filesystem’s capabilities, so it is one of the central datastructures for any file system. For this reason every filesystem has its own inode structure. If you want to know more about this, have a look at the inode structure of the Btrfs filesystem linked below . For a more detailed explanation of what the individual fields mean, you can refer to the inode structure of the ext4 filesystem .
|
||||
|
||||
### Copy-on-Write filesystems
|
||||
|
||||
One of the outstanding features of Btrfs, compared to ext4, for example, is that it is a CoW (Copy-on-Write) filesystem. When a file is changed and written back to disk, it intentionally is not written back to where it was before. Instead, it is copied and stored in an entirely new location on disk. In this sense, it may be simpler to think of CoW as a kind of “redirection”, because the file write is redirected to different storage blocks.
|
||||
|
||||
This may sound wasteful, but in practice it isn’t. This is because the modified data must be written back to the disk in any case, regardless of how the filesystem works. Btrfs merely makes sure that the data is written to previously unoccupied blocks, so the old data remains intact. The only real drawback is that this behavior can lead to file fragmentation quicker than on other filesystems. In regular desktop usage scenarios it is unlikely you will notice a difference.
|
||||
|
||||
What is the advantage of CoW? In simple terms: a history of the modified and edited files can be kept. Btrfs will keep the references to the old file versions (inodes) somewhere they can be easily accessed. This reference is a *snapshot*: An image of the filesystem state at some point in time. This will be the topic of a separate article in this series, so it will be left at that for now.
|
||||
|
||||
Beyond keeping file histories, CoW filesystems are always in a consistent state, even if a previous filesystem transaction (like writing to a file) didn’t complete due to e.g. power loss. That is because filesystem metadata updates are also CoW: The file system itself is never overwritten, so an interruption can’t leave it in a partially written state
|
||||
|
||||
### Copy-on-Write for files
|
||||
|
||||
You can think of filenames as pointers to the inodes of the file they belong to. Upon writing to a file, Btrfs creates a copy of the modified file content (the data), along with a new inode (the metadata), and then makes your filename point to this new inode. The old inode remains untouched. Below you see another hypothetical example to illustrate this:
|
||||
|
||||
![Continuation of the example above: 3 more bytes of data were added][5]
|
||||
|
||||
Here “myfile.txt” has had three bytes appended. A traditional filesystem would have updated the “Data” block in the middle to contain the new contents. A CoW filesystem keeps the old blocks intact (greyed out) and writes (copies) changed data and metadata somewhere new. It is important to note that only changed data blocks are copied, and not the whole file.
|
||||
|
||||
If there are no more unused blocks to write new contents to, Btrfs will reclaim space from data blocks occupied by old file versions (Unless they are part of a snapshot, see later article in this series).
|
||||
|
||||
### Copy-on-Write for folders
|
||||
|
||||
From a filesystem’s point of view, a folder is a special type of file. In contrast to regular files, the filesystem interprets the underlying contents directly. A folder has some metadata associated with it (an inode, as seen for files above) that governs access permissions or modification time. In the simplest case, the data stored in a folder (so called “directory entries”) is a list of references to inodes, where each inode is in turn another file or folder. However, modern filesystems store at least a filename, together with a reference to an inode of the file in question, in a directory entry.
|
||||
|
||||
Earlier it was pointed out that writing to a file creates a copy of the previous inode and modifies the contents accordingly. In essence, this yields a new inode that isn’t related to its predecessor. To make the modified file show up in the filesystem, all the directory entries containing a reference to it are updated as well.
|
||||
|
||||
This is a recursive process! Since a folder is itself a file with an inode, modifying any of its folder entries creates a new inode for the folder file. This recursion occurs all the way up the filesystem tree, until it arrives at the filesystem root.
|
||||
|
||||
As a consequence, as long as a reference is kept to any of the old directories and they are not deleted or overwritten, the filesystem tree can be traversed in it’s previous state. This, again, is exactly what snapshots do.
|
||||
|
||||
### What to expect in future articles
|
||||
|
||||
Btrfs is more than just a CoW filesystem. It aims to implement “advanced features while also focusing on fault tolerance, repair and easy administration” (See ). Future articles of this series will have a look at these features in particular:
|
||||
|
||||
* Subvolumes – Filetrees within your filetree
|
||||
* Snapshots – Going back in time
|
||||
* Compression – Transparently saving storage space
|
||||
* Qgroups – Limiting your filesystem size
|
||||
* RAID – Replace your mdadm configuration
|
||||
|
||||
This is by far not an exhaustive list of Btrfs features. If you want the full overview of available features, check out the Wiki and Docs .
|
||||
|
||||
### Conclusion
|
||||
|
||||
I hope that I managed to whet your appetite for getting to know your PC filesystem. If you have questions so far, please leave a comment about what you come up with so they can be discussed in future articles. In the meantime, feel free to study the linked resources in the text. If you stumble over a Btrfs feature that you find particularly intriguing, please add a comment below, too. If there’s enough interest in a particular topic, maybe I’ll add an article to the series. See you in the next article!
|
||||
|
||||
### Sources
|
||||
|
||||
1. [https://btrfs.wiki.kernel.org/index.php/Data_Structures#btrfs_inode_item][6]
|
||||
2. [https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inode_Table][7]
|
||||
3. [https://btrfs.readthedocs.io/en/latest/Introduction.html][8]
|
||||
4. [https://btrfs.wiki.kernel.org/index.php/Main_Page][9]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/working-with-btrfs-general-concepts/
|
||||
|
||||
作者:[Andreas Hartmann][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/hartan/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2022/07/working_w_btrfs_general-816x345.jpg
|
||||
[2]: https://unsplash.com/@helibertoarias?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[3]: https://unsplash.com/s/photos/hdd?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[4]: https://fedoramagazine.org/wp-content/uploads/2022/07/file_regular.png
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2022/07/file_cow.png
|
||||
[6]: https://btrfs.wiki.kernel.org/index.php/Data_Structures#btrfs_inode_item
|
||||
[7]: https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inode_Table
|
||||
[8]: https://btrfs.readthedocs.io/en/latest/Introduction.html
|
||||
[9]: https://btrfs.wiki.kernel.org/index.php/Main_Page
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://itsfoss.com/change-directories/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "Cubik65536"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
@ -198,7 +198,7 @@ via: https://itsfoss.com/change-directories/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[Cubik65536](https://github.com/Cubik65536)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,235 +0,0 @@
|
||||
[#]: subject: "Boot From a USB Drive in VirtualBox in Linux"
|
||||
[#]: via: "https://itsfoss.com/virtualbox-boot-from-usb/"
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Boot From a USB Drive in VirtualBox in Linux
|
||||
======
|
||||
|
||||
Got a live Linux USB? The usual way to test it on your current system is to reboot and choose to boot from the live USB when the system restarts.
|
||||
|
||||
But that's annoying as you need to quit working on your computer and restart it.
|
||||
|
||||
A less disruptive way is to use a VM.
|
||||
|
||||
Yes, you can boot from a USB in a virtual machine with VirtualBox. This way, you don't have to install a distribution in VM just to try it. Use the live session instead.
|
||||
|
||||
In this tutorial, I'll show the steps to boot from a USB drive in VirtualBox on Linux systems. It takes some time and effort but saves you from rebooting your system.
|
||||
|
||||
### Boot from USB drive in VirtualBox in Linux
|
||||
|
||||
Since this is a tutorial for advanced users, I am leaving out a few steps that you need beforehand**:**
|
||||
|
||||
* VirtualBox installed on your Linux system
|
||||
* A live Linux USB, preferably [Using Ventoy][1]
|
||||
|
||||
|
||||
|
||||
![][2]
|
||||
|
||||
This guide is divided into three parts:
|
||||
|
||||
* Create a virtual machine disk file
|
||||
* Boot using USB in VM
|
||||
* Removing virtual machine disk (optional)
|
||||
|
||||
|
||||
|
||||
So let's start with the first one.
|
||||
|
||||
#### Step 1: Create a virtual machine disk file (VMDK)
|
||||
|
||||
First, you need to identify the disk name of the USB drive, and to do so, you have to [list the drives of your system][3].
|
||||
|
||||
For that purpose, I'm going to use the lsblk command:
|
||||
|
||||
```
|
||||
|
||||
lsblk
|
||||
|
||||
```
|
||||
|
||||
![][4]
|
||||
|
||||
🚧
|
||||
|
||||
Make sure to use the disk name without any numbers. In my case, Ventoy is named with sdb1 but still, I have to use the sdb only.
|
||||
|
||||
From the above image, you can see, Ventoy is listed having the `sdb1` but you have to use the name without any numbers. This means I have to use the `sdb` only, or else, it will throw an error.
|
||||
|
||||
Once you find your drive name, use the VBoxManage command in the following command to create
|
||||
|
||||
```
|
||||
|
||||
sudo VBoxManage createmedium disk --filename=/path/to/rawdisk.vmdk --variant=RawDisk --format=VMDK --property RawDrive=/dev/sda
|
||||
|
||||
```
|
||||
|
||||
In the above command, replace the path with `/path/to/rawdisk.vmdk` to where you want to save the file and `/dev/sda` with your target drive.
|
||||
|
||||
In my case, I want to create a file named `IF.vmdk` in my home directory and my target drive is `/dev/sdb`, then, I will be using the following:
|
||||
|
||||
📋
|
||||
|
||||
You have to give an absolute path to create the vmdk file!
|
||||
|
||||
```
|
||||
|
||||
sudo VBoxManage createmedium disk --filename=/home/sagar/IF.vmdk --variant=RawDisk --format=VMDK --property RawDrive=/dev/sdb
|
||||
|
||||
```
|
||||
|
||||
![][5]
|
||||
|
||||
And finally, change the permissions using the chmod command:
|
||||
|
||||
```
|
||||
|
||||
sudo chmod 777 Filename.vmdk
|
||||
|
||||
```
|
||||
|
||||
![][6]
|
||||
|
||||
#### Step 2: Boot from USB in VirtualBox in Linux
|
||||
|
||||
First, open the VirtualBox from your system menu and click on the `New` button.
|
||||
|
||||
There, name your VM and select the operating system type and its version:
|
||||
|
||||
![][7]
|
||||
|
||||
Now, click on the `Next` button and it will ask you to allocate hardware resources for your VM:
|
||||
|
||||
![][8]
|
||||
|
||||
Once you are done allocating the hardware resources, click on the `Next` button.
|
||||
|
||||
Here, you will find an option to create or add a virtual disk. Now, follow 3 simple steps:
|
||||
|
||||
* Select the 2nd option saying `Use an Existing Virtual Hard Disk File`.
|
||||
* Click on the `File` icon.
|
||||
* Hit the `Add` button and select the file ending the `.vmdk` that you created recently.
|
||||
|
||||
|
||||
|
||||
![][9]
|
||||
|
||||
Once you select the file, it will show you the name of the file, select it and hit the `Choose` option:
|
||||
|
||||
![][10]
|
||||
|
||||
It will show you the file that has been selected to boot from. Click on the next and it will show the summery of choices you've made.
|
||||
|
||||
Hit the `Finish` button:
|
||||
|
||||
![][11]
|
||||
|
||||
That's it! The VM has been created.
|
||||
|
||||
To start the VM, first, select the VM and hit the start button:
|
||||
|
||||
![][12]
|
||||
|
||||
As my USB had Ventoy, you can see, multiple distros listed here:
|
||||
|
||||
![][13]
|
||||
|
||||
Pretty cool. Right?
|
||||
|
||||
#### Step 3: Remove VM with vmdk file (optional)
|
||||
|
||||
When I tried removing the vmdk file after deleting the VM, sure, it was getting deleted but whenever I tried creating a new file having the same name, it gave me an error saying the file already exists!
|
||||
|
||||
So here, I will walk you through how you can remove the VM with the vmdk file.
|
||||
|
||||
First, turn off the VM and remove it
|
||||
|
||||
![][14]
|
||||
|
||||
Now, if you try to remove the vmdk file [using the rm command][15] and elevated privileges, you can remove it (but there's where the illusion starts).
|
||||
|
||||
For example, here, I removed the IF.vmdk file:
|
||||
|
||||
```
|
||||
|
||||
sudo rm IF.vmdk
|
||||
|
||||
```
|
||||
|
||||
![][16]
|
||||
|
||||
And now, if I try to create a new vmdk file with the same name, it gives me an error saying the file already exists:
|
||||
|
||||
![][17]
|
||||
|
||||
To remove the vmdk file, first, you have to unregister the file using the following:
|
||||
|
||||
```
|
||||
|
||||
sudo VBoxManage closemedium disk /path/to/MyDrive.vmdk
|
||||
|
||||
```
|
||||
|
||||
![][18]
|
||||
|
||||
Once done, you can remove the file using the rm command and it will be removed easily:
|
||||
|
||||
```
|
||||
|
||||
sudo rm Filename.vmdk
|
||||
|
||||
```
|
||||
|
||||
And then, if you try to create a vmdk file with the same filename, you can do that:
|
||||
|
||||
![][19]
|
||||
|
||||
There you have it!
|
||||
|
||||
### More VM tips
|
||||
|
||||
If you are looking for the fastest VM, you can use the combination of Qemu + KVM. I know it sounds complex.
|
||||
|
||||
But to make things easy, we made a dedicated guide on how to install and use Qemu on Ubuntu including enabling shared folders, clipboard, and auto-resizing:
|
||||
|
||||
![][2]
|
||||
|
||||
I hope you will find this guide helpful.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/virtualbox-boot-from-usb/
|
||||
|
||||
作者:[Sagar Sharma][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sagar/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/use-ventoy/
|
||||
[2]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png
|
||||
[3]: https://linuxhandbook.com/linux-list-disks/
|
||||
[4]: https://itsfoss.com/content/images/2023/07/list-drives-in-Linux.png
|
||||
[5]: https://itsfoss.com/content/images/2023/07/create-virtual-machine-disk-drive-for-virtualbox-to-boot-from-USB-drive-in-Linux.png
|
||||
[6]: https://itsfoss.com/content/images/2023/07/use-chmod-command-to-change-the-permissions.png
|
||||
[7]: https://itsfoss.com/content/images/2023/07/Create-VM-in-VirtualBox-to-boot-from-USB-in-Linux.png
|
||||
[8]: https://itsfoss.com/content/images/2023/07/allocate-RAM-and-cores-to-Vm-to-boot-from-USB-in-VirtualBox-in-Linux.png
|
||||
[9]: https://itsfoss.com/content/images/2023/07/add-virtual-machine-disk-drive-in-VirtualBox-to-boot-from-USB-in-Linux.png
|
||||
[10]: https://itsfoss.com/content/images/2023/07/select-the-vmdk-file.png
|
||||
[11]: https://itsfoss.com/content/images/2023/07/Finish-the-VM-creation-to-boot-from-USB-in-VirtualBox-in-Linux.png
|
||||
[12]: https://itsfoss.com/content/images/2023/07/start-the-VM.png
|
||||
[13]: https://itsfoss.com/content/images/2023/07/Boot-from-USB-in-VirtualBox-in-Linux.png
|
||||
[14]: https://itsfoss.com/content/images/2023/07/Remove-VM-from-VirtualBox.png
|
||||
[15]: https://linuxhandbook.com/remove-files-directories/
|
||||
[16]: https://itsfoss.com/content/images/2023/07/use-rm-command-to-remove-vmdk-file.png
|
||||
[17]: https://itsfoss.com/content/images/2023/07/unable-to-create-vmdk-file-in-Linux--file-already-exist.png
|
||||
[18]: https://itsfoss.com/content/images/2023/07/unregister-vmdk-file-in-Linux-to-remove-it.png
|
||||
[19]: https://itsfoss.com/content/images/2023/07/how-to-remove-the-vmdk-file-in-Linux.png
|
@ -0,0 +1,116 @@
|
||||
[#]: subject: "Access USB from Virtual Machine in VirtualBox on Linux"
|
||||
[#]: via: "https://itsfoss.com/virtualbox-access-usb/"
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Access USB from Virtual Machine in VirtualBox on Linux
|
||||
======
|
||||
|
||||
When you plug in a USB, your host OS can easily access it and use the files on it. That's not a surprise.
|
||||
|
||||
If you are using virtual machines with Virtual Box on Linux, you can put some effort and access the USB plugged in to your physical machine from the VM.
|
||||
|
||||
Let me walk you through step-by-step how you can access a USB disk in VirtualBox VM.
|
||||
|
||||
### How to access a USB drive in VirtualBox VM
|
||||
|
||||
By default, you can not use VirtualBox to access the USB drive as you have to install the extension pack manager and additionally, a little configuration part is also there.
|
||||
|
||||
This is the reason why I've divided this tutorial into three easy steps. So let's start with the first one.
|
||||
|
||||
#### Step 1: Install the VirtualBox extension pack (on host)
|
||||
|
||||
This is the most important step of this tutorial as you are about to install an extension of VirtualBox which will enable you to use a USB drive in a VM.
|
||||
|
||||
🚧
|
||||
|
||||
You should install the same version extension pack as your installed version of VirtualBox.
|
||||
|
||||
To install the VirtualBox extension pack, simply visit the [official download page of VirtualBox][1], scroll down a bit and there you will find an option to download the extension pack:
|
||||
|
||||
![][2]
|
||||
|
||||
Once you are done downloading the extension pack follow 3 simple steps:
|
||||
|
||||
* Go to `File` > `Tools` > `Extension Pack Manager`
|
||||
* Hit the `Install` button
|
||||
* Select the downloaded file from the file manager:
|
||||
|
||||
|
||||
|
||||
![Click to expand][3]
|
||||
|
||||
It will open a new prompt to install the extension pack where all you have to do is hit the Install button and accept the terms and conditions:
|
||||
|
||||
![Click to expand][4]
|
||||
|
||||
And we are done with the installation of the extension pack.
|
||||
|
||||
#### Step 2: Add the user to the vboxusers group (on host)
|
||||
|
||||
To use a USB drive in VirtualBox, your current user needs to be in the `vboxusers` group.
|
||||
|
||||
I know it sounds a little complex but [adding a user to the group][5] is one command process and to add your user to `vboxusers group can be done by following:
|
||||
|
||||
```
|
||||
|
||||
sudo usermod -aG vboxusers $USER
|
||||
|
||||
```
|
||||
|
||||
**Once you are done with these two steps, reboot your system to take effect from the steps.**
|
||||
|
||||
#### **Step 3: Add USB drive to VM**
|
||||
|
||||
🚧
|
||||
|
||||
Before you add a USB for a specific VM, make sure it is powered off (not saved) or you won't be able to follow the given instructions.
|
||||
|
||||
To add USB for VM, you have to follow the given simple steps:
|
||||
|
||||
* Select the VM on which you want to use USB and hit `Settings`
|
||||
* Go to `USB` tab
|
||||
* Check the `Enable USB Controller` box and select the USB by clicking on `+` button:
|
||||
|
||||
|
||||
|
||||
![][6]
|
||||
|
||||
And that's it! Now you can start your VM and the USB drive should reflect in the file manager. In my case it was Ubuntu, so it looked like this:
|
||||
|
||||
![][7]
|
||||
|
||||
### More USB and VM trick
|
||||
|
||||
If using USB in a VM looks cool to you, booting from it in the VM is even cooler! And here's a detailed guide on [how to boot from a USB drive in VirtualBox][8]:
|
||||
|
||||
![][9]
|
||||
|
||||
I hope you will find this guide helpful.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/virtualbox-access-usb/
|
||||
|
||||
作者:[Sagar Sharma][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sagar/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.virtualbox.org/wiki/Downloads
|
||||
[2]: https://itsfoss.com/content/images/2023/09/download-VirtualBox-extension-pack.png
|
||||
[3]: https://itsfoss.com/content/images/2023/09/Install-VirtualBox-extension-pack-to-use-USB-in-VM.png
|
||||
[4]: https://itsfoss.com/content/images/2023/09/Install-VirtualBox-extension-pack.png
|
||||
[5]: https://learnubuntu.com/add-user-group/
|
||||
[6]: https://itsfoss.com/content/images/2023/09/Enable-USB-drive-for-VM-in-VirtualBox.png
|
||||
[7]: https://itsfoss.com/content/images/2023/09/Use-USB-drive-in-VirtualBox-VM-1.png
|
||||
[8]: https://itsfoss.com/virtualbox-boot-from-usb/
|
||||
[9]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png
|
@ -0,0 +1,371 @@
|
||||
[#]: subject: "In a git repository, where do your files live?"
|
||||
[#]: via: "https://jvns.ca/blog/2023/09/14/in-a-git-repository--where-do-your-files-live-/"
|
||||
[#]: author: "Julia Evans https://jvns.ca/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
In a git repository, where do your files live?
|
||||
======
|
||||
|
||||
Hello! I was talking to a friend about how git works today, and we got onto the topic – where does git store your files? We know that it’s in your `.git` directory, but where exactly in there are all the versions of your old files?
|
||||
|
||||
For example, this blog is in a git repository, and it contains a file called `content/post/2019-06-28-brag-doc.markdown`. Where is that in my `.git` folder? And where are the old versions of that file? Let’s investigate by writing some very short Python programs.
|
||||
|
||||
### git stores files in `.git/objects`
|
||||
|
||||
Every previous version of every file in your repository is in `.git/objects`. For example, for this blog, `.git/objects` contains 2700 files.
|
||||
|
||||
```
|
||||
|
||||
$ find .git/objects/ -type f | wc -l
|
||||
2761
|
||||
|
||||
```
|
||||
|
||||
note: `.git/objects` actually has more information than “every previous version of every file in your repository”, but we’re not going to get into that just yet
|
||||
|
||||
Here’s a very short Python program ([find-git-object.py][1]) that finds out where any given file is stored in `.git/objects`.
|
||||
|
||||
```
|
||||
|
||||
import hashlib
|
||||
import sys
|
||||
|
||||
|
||||
def object_path(content):
|
||||
header = f"blob {len(content)}\0"
|
||||
data = header.encode() + content
|
||||
sha1 = hashlib.sha1()
|
||||
sha1.update(data)
|
||||
digest = sha1.hexdigest()
|
||||
return f".git/objects/{digest[:2]}/{digest[2:]}"
|
||||
|
||||
|
||||
with open(sys.argv[1], "rb") as f:
|
||||
print(object_path(f.read()))
|
||||
|
||||
```
|
||||
|
||||
What this does is:
|
||||
|
||||
* read the contents of the file
|
||||
* calculate a header (`blob 16673\0`) and combine it with the contents
|
||||
* calculate the sha1 sum (`e33121a9af82dd99d6d706d037204251d41d54` in this case)
|
||||
* translate that sha1 sum into a path (`.git/objects/e3/3121a9af82dd99d6d706d037204251d41d54`)
|
||||
|
||||
|
||||
|
||||
We can run it like this:
|
||||
|
||||
```
|
||||
|
||||
$ python3 find-git-object.py content/post/2019-06-28-brag-doc.markdown
|
||||
.git/objects/8a/e33121a9af82dd99d6d706d037204251d41d54
|
||||
|
||||
```
|
||||
|
||||
### jargon: “content addressed storage”
|
||||
|
||||
The term for this storage strategy (where the filename of an object in the database is the same as the hash of the file’s contents) is “content addressed storage”.
|
||||
|
||||
One neat thing about content addressed storage is that if I have two files (or 50 files!) with the exact same contents, that doesn’t take up any extra space in Git’s database – if the hash of the contents is `aabbbbbbbbbbbbbbbbbbbbbbbbb`, they’ll both be stored in `.git/objects/aa/bbbbbbbbbbbbbbbbbbbbb`.
|
||||
|
||||
### how are those objects encoded?
|
||||
|
||||
If I try to look at this file in `.git/objects`, it gets a bit weird:
|
||||
|
||||
```
|
||||
|
||||
$ cat .git/objects/8a/e33121a9af82dd99d6d706d037204251d41d54
|
||||
x^A<8D><9B>}s<E3>Ƒ<C6><EF>o|<8A>^Q<9D><EC>ju<92><E8><DD>\<9C><9C>*<89>j<FD>^...
|
||||
|
||||
```
|
||||
|
||||
What’s going on? Let’s run `file` on it:
|
||||
|
||||
```
|
||||
|
||||
$ file .git/objects/8a/e33121a9af82dd99d6d706d037204251d41d54
|
||||
.git/objects/8a/e33121a9af82dd99d6d706d037204251d41d54: zlib compressed data
|
||||
|
||||
```
|
||||
|
||||
It’s just compressed! We can write another little Python program called `decompress.py` that uses the `zlib` module to decompress the data:
|
||||
|
||||
```
|
||||
|
||||
import zlib
|
||||
import sys
|
||||
|
||||
with open(sys.argv[1], "rb") as f:
|
||||
content = f.read()
|
||||
print(zlib.decompress(content).decode())
|
||||
|
||||
```
|
||||
|
||||
Now let’s decompress it:
|
||||
|
||||
```
|
||||
|
||||
$ python3 decompress.py .git/objects/8a/e33121a9af82dd99d6d706d037204251d41d54
|
||||
blob 16673---
|
||||
title: "Get your work recognized: write a brag document"
|
||||
date: 2019-06-28T18:46:02Z
|
||||
url: /blog/brag-documents/
|
||||
categories: []
|
||||
---
|
||||
... the entire blog post ...
|
||||
|
||||
```
|
||||
|
||||
So this data is encoded in a pretty simple way: there’s this `blob 16673\0` thing, and then the full contents of the file.
|
||||
|
||||
### there aren’t any diffs
|
||||
|
||||
One thing that surprised me here is the first time I learned it: there aren’t any diffs here! That file is the 9th version of that blog post, but the version git stores in the `.git/objects` is the whole file, not the diff from the previous version.
|
||||
|
||||
Git actually sometimes also does store files as diffs (when you run `git gc` it can combine multiple different files into a “packfile” for efficiency), but I have never needed to think about that in my life so we’re not going to get into it. Aditya Mukerjee has a great post called [Unpacking Git packfiles][2] about how the format works.
|
||||
|
||||
### what about older versions of the blog post?
|
||||
|
||||
Now you might be wondering – if there are 8 previous versions of that blog post (before I fixed some typos), where are they in the `.git/objects` directory? How do we find them?
|
||||
|
||||
First, let’s find every commit where that file changed with `git log`:
|
||||
|
||||
```
|
||||
|
||||
$ git log --oneline content/post/2019-06-28-brag-doc.markdown
|
||||
c6d4db2d
|
||||
423cd76a
|
||||
7e91d7d0
|
||||
f105905a
|
||||
b6d23643
|
||||
998a46dd
|
||||
67a26b04
|
||||
d9999f17
|
||||
026c0f52
|
||||
72442b67
|
||||
|
||||
```
|
||||
|
||||
Now let’s pick a previous commit, let’s say `026c0f52`. Commits are also stored in `.git/objects`, and we can try to look at it there. But the commit isn’t there! `ls .git/objects/02/6c*` doesn’t have any results! You know how we mentioned “sometimes git packs objects to save space but we don’t need to worry about it?“. I guess now is the time that we need to worry about it.
|
||||
|
||||
So let’s take care of that.
|
||||
|
||||
### let’s unpack some objects
|
||||
|
||||
So we need to unpack the objects from the pack files. I looked it up on Stack Overflow and apparently you can do it like this:
|
||||
|
||||
```
|
||||
|
||||
$ mv .git/objects/pack/pack-adeb3c14576443e593a3161e7e1b202faba73f54.pack .
|
||||
$ git unpack-objects < pack-adeb3c14576443e593a3161e7e1b202faba73f54.pack
|
||||
|
||||
```
|
||||
|
||||
This is weird repository surgery so it’s a bit alarming but I can always just clone the repository from Github again if I mess it up, so I wasn’t too worried.
|
||||
|
||||
After unpacking all the object files, we end up with way more objects: about 20000 instead of about 2700. Neat.
|
||||
|
||||
```
|
||||
|
||||
find .git/objects/ -type f | wc -l
|
||||
20138
|
||||
|
||||
```
|
||||
|
||||
### back to looking at a commit
|
||||
|
||||
Now we can go back to looking at our commit `026c0f52`. You know how we said that not everything in `.git/objects` is a file? Some of them are commits! And to figure out where the old version of our post `content/post/2019-06-28-brag-doc.markdown` is stored, we need to dig pretty deep into this commit.
|
||||
|
||||
The first step is to look at the commit in `.git/objects`.
|
||||
|
||||
### commit step 1: look at the commit
|
||||
|
||||
The commit `026c0f52` is now in `.git/objects/02/6c0f5208c5ea10608afc9252c4a56c1ac1d7e4` after doing some unpacking and we can look at it like this:
|
||||
|
||||
```
|
||||
|
||||
$ python3 decompress.py .git/objects/02/6c0f5208c5ea10608afc9252c4a56c1ac1d7e4
|
||||
commit 211tree 01832a9109ab738dac78ee4e95024c74b9b71c27
|
||||
parent 72442b67590ae1fcbfe05883a351d822454e3826
|
||||
author Julia Evans <julia@jvns.ca> 1561998673 -0400
|
||||
committer Julia Evans <julia@jvns.ca> 1561998673 -0400
|
||||
|
||||
brag doc
|
||||
|
||||
```
|
||||
|
||||
We can also do get same information with `git cat-file -p 026c0f52`, which does the same thing but does a better job of formatting the data. (the `-p` option means “format it nicely please”)
|
||||
|
||||
### commit step 2: look at the tree
|
||||
|
||||
This commit has a **tree**. What’s that? Well let’s take a look. The tree’s ID is `01832a9109ab738dac78ee4e95024c74b9b71c27`, and we can use our `decompress.py` script from earlier to look at that git object. (though I had to remove the `.decode()` to get the script to not crash)
|
||||
|
||||
```
|
||||
|
||||
$ python3 decompress.py .git/objects/01/832a9109ab738dac78ee4e95024c74b9b71c27
|
||||
b'tree 396\x00100644 .gitignore\x00\xc3\xf7`$8\x9b\x8dO\x19/\x18\xb7}|\xc7\xce\x8e:h\xad100644 README.md\x00~\xba\xec\xb3\x11\xa0^\x1c\xa9\xa4?\x1e\xb9\x0f\x1cfG\x96\x0b
|
||||
|
||||
```
|
||||
|
||||
This is formatted in kind of an unreadable way. The main display issue here is that the commit hashes (`\xc3\xf7$8\x9b\x8dO\x19/\x18\xb7}|\xc7\xce\`…) are raw bytes instead of being encoded in hexadecimal. So we see `\xc3\xf7$8\x9b\x8d` instead of `c3f76024389b8d`. Let’s switch over to using `git cat-file -p` which formats the data in a friendlier way, because I don’t feel like writing a parser for that.
|
||||
|
||||
```
|
||||
|
||||
$ git cat-file -p 01832a9109ab738dac78ee4e95024c74b9b71c27
|
||||
100644 blob c3f76024389b8d4f192f18b77d7cc7ce8e3a68ad .gitignore
|
||||
100644 blob 7ebaecb311a05e1ca9a43f1eb90f1c6647960bc1 README.md
|
||||
100644 blob 0f21dc9bf1a73afc89634bac586271384e24b2c9 Rakefile
|
||||
100644 blob 00b9d54abd71119737d33ee5d29d81ebdcea5a37 config.yaml
|
||||
040000 tree 61ad34108a327a163cdd66fa1a86342dcef4518e content <-- this is where we're going next
|
||||
040000 tree 6d8543e9eeba67748ded7b5f88b781016200db6f layouts
|
||||
100644 blob 22a321a88157293c81e4ddcfef4844c6c698c26f mystery.rb
|
||||
040000 tree 8157dc84a37fca4cb13e1257f37a7dd35cfe391e scripts
|
||||
040000 tree 84fe9c4cb9cef83e78e90a7fbf33a9a799d7be60 static
|
||||
040000 tree 34fd3aa2625ba784bced4a95db6154806ae1d9ee themes
|
||||
|
||||
```
|
||||
|
||||
This is showing us all of the files I had in the root directory of the repository as of that commit. Looks like I accidentally committed some file called `mystery.rb` at some point which I later removed.
|
||||
|
||||
Our file is in the `content` directory, so let’s look at that tree: `61ad34108a327a163cdd66fa1a86342dcef4518e`
|
||||
|
||||
### commit step 3: yet another tree
|
||||
|
||||
```
|
||||
|
||||
$ git cat-file -p 61ad34108a327a163cdd66fa1a86342dcef4518e
|
||||
|
||||
040000 tree 1168078878f9d500ea4e7462a9cd29cbdf4f9a56 about
|
||||
100644 blob e06d03f28d58982a5b8282a61c4d3cd5ca793005 newsletter.markdown
|
||||
040000 tree 1f94b8103ca9b6714614614ed79254feb1d9676c post <-- where we're going next!
|
||||
100644 blob 2d7d22581e64ef9077455d834d18c209a8f05302 profiler-project.markdown
|
||||
040000 tree 06bd3cee1ed46cf403d9d5a201232af5697527bb projects
|
||||
040000 tree 65e9357973f0cc60bedaa511489a9c2eeab73c29 talks
|
||||
040000 tree 8a9d561d536b955209def58f5255fc7fe9523efd zines
|
||||
|
||||
```
|
||||
|
||||
Still not done…
|
||||
|
||||
### commit step 4: one more tree….
|
||||
|
||||
The file we’re looking for is in the `post/` directory, so there’s one more tree:
|
||||
|
||||
```
|
||||
|
||||
$ git cat-file -p 1f94b8103ca9b6714614614ed79254feb1d9676c
|
||||
.... MANY MANY lines omitted ...
|
||||
100644 blob 170da7b0e607c4fd6fb4e921d76307397ab89c1e 2019-02-17-organizing-this-blog-into-categories.markdown
|
||||
100644 blob 7d4f27e9804e3dc80ab3a3912b4f1c890c4d2432 2019-03-15-new-zine--bite-size-networking-.markdown
|
||||
100644 blob 0d1b9fbc7896e47da6166e9386347f9ff58856aa 2019-03-26-what-are-monoidal-categories.markdown
|
||||
100644 blob d6949755c3dadbc6fcbdd20cc0d919809d754e56 2019-06-23-a-few-debugging-resources.markdown
|
||||
100644 blob 3105bdd067f7db16436d2ea85463755c8a772046 2019-06-28-brag-doc.markdown <-- found it!!!!!
|
||||
|
||||
```
|
||||
|
||||
Here the `2019-06-28-brag-doc.markdown` is the last file listed because it was the most recent blog post when it was published.
|
||||
|
||||
### commit step 5: we made it!
|
||||
|
||||
Finally we have found the object file where a previous version of my blog post lives! Hooray! It has the hash `3105bdd067f7db16436d2ea85463755c8a772046`, so it’s in `git/objects/31/05bdd067f7db16436d2ea85463755c8a772046`.
|
||||
|
||||
We can look at it with `decompress.py`
|
||||
|
||||
```
|
||||
|
||||
$ python3 decompress.py .git/objects/31/05bdd067f7db16436d2ea85463755c8a772046 | head
|
||||
blob 15924---
|
||||
title: "Get your work recognized: write a brag document"
|
||||
date: 2019-06-28T18:46:02Z
|
||||
url: /blog/brag-documents/
|
||||
categories: []
|
||||
---
|
||||
... rest of the contents of the file here ...
|
||||
|
||||
```
|
||||
|
||||
This is the old version of the post! If I ran `git checkout 026c0f52 content/post/2019-06-28-brag-doc.markdown` or `git restore --source 026c0f52 content/post/2019-06-28-brag-doc.markdown`, that’s what I’d get.
|
||||
|
||||
### this tree traversal is how `git log` works
|
||||
|
||||
This whole process we just went through (find the commit, go through the various directory trees, search for the filename we wanted) seems kind of long and complicated but this is actually what’s happening behind the scenes when we run `git log content/post/2019-06-28-brag-doc.markdown`. It needs to go through every single commit in your history, check the version (for example `3105bdd067f7db16436d2ea85463755c8a772046` in this case) of `content/post/2019-06-28-brag-doc.markdown`, and see if it changed from the previous commit.
|
||||
|
||||
That’s why `git log FILENAME` is a little slow sometimes – I have 3000 commits in this repository and it needs to do a bunch of work for every single commit to figure out if the file changed in that commit or not.
|
||||
|
||||
### how many previous versions of files do I have?
|
||||
|
||||
Right now I have 1530 files tracked in my blog repository:
|
||||
|
||||
```
|
||||
|
||||
$ git ls-files | wc -l
|
||||
1530
|
||||
|
||||
```
|
||||
|
||||
But how many historical files are there? We can list everything in `.git/objects` to see how many object files there are:
|
||||
|
||||
```
|
||||
|
||||
$ find .git/objects/ -type f | grep -v pack | awk -F/ '{print $3 $4}' | wc -l
|
||||
20135
|
||||
|
||||
```
|
||||
|
||||
Not all of these represent previous versions of files though – as we saw before, lots of them are commits and directory trees. But we can write another little Python script called `find-blobs.py` that goes through all of the objects and checks if it starts with `blob` or not:
|
||||
|
||||
```
|
||||
|
||||
import zlib
|
||||
import sys
|
||||
|
||||
for line in sys.stdin:
|
||||
line = line.strip()
|
||||
filename = f".git/objects/{line[0:2]}/{line[2:]}"
|
||||
with open(filename, "rb") as f:
|
||||
contents = zlib.decompress(f.read())
|
||||
if contents.startswith(b"blob"):
|
||||
print(line)
|
||||
|
||||
$ find .git/objects/ -type f | grep -v pack | awk -F/ '{print $3 $4}' | python3 find-blobs.py | wc -l
|
||||
6713
|
||||
|
||||
```
|
||||
|
||||
So it looks like there are `6713 - 1530 = 5183` old versions of files lying around in my git repository that git is keeping around for me in case I ever want to get them back. How nice!
|
||||
|
||||
### that’s all!
|
||||
|
||||
[Here’s the gist][1] with all the code for this post. There’s not very much.
|
||||
|
||||
I thought I already knew how git worked, but I’d never really thought about pack files before so this was a fun exploration. I also don’t spend too much time thinking about how much work `git log` is actually doing when I ask it to track the history of a file, so that was fun to dig into.
|
||||
|
||||
As a funny postscript: as soon as I committed this blog post, git got mad about how many objects I had in my repository (I guess 20,000 is too many!) and ran `git gc` to compress them all into packfiles. So now my `.git/objects` directory is very small:
|
||||
|
||||
```
|
||||
|
||||
$ find .git/objects/ -type f | wc -l
|
||||
14
|
||||
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://jvns.ca/blog/2023/09/14/in-a-git-repository--where-do-your-files-live-/
|
||||
|
||||
作者:[Julia Evans][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://jvns.ca/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://gist.github.com/jvns/ff884dceef7660402fe1eca697cfbf51
|
||||
[2]: https://codewords.recurse.com/issues/three/unpacking-git-packfiles
|
221
sources/tech/20230914 Install VSCodium on Ubuntu.md
Normal file
221
sources/tech/20230914 Install VSCodium on Ubuntu.md
Normal file
@ -0,0 +1,221 @@
|
||||
[#]: subject: "Install VSCodium on Ubuntu"
|
||||
[#]: via: "https://itsfoss.com/install-vscodium-ubuntu/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Install VSCodium on Ubuntu
|
||||
======
|
||||
|
||||
[VSCodium][1] is the 'complete open source version' of Microsoft's VS Code.
|
||||
|
||||
It's basically a clone of the [VS Code][2] that removes any signs of telemetry. The [telemetry is used for collecting data][3] on the usage of the application. Many developers use it to get an insight on improving their application.
|
||||
|
||||
Look and feature wise, the two editors are identical.
|
||||
|
||||
![VSCodium is identical to VS Code][4]
|
||||
|
||||
There are three ways to install VSCodium on Ubuntu:
|
||||
|
||||
1. Install it by downloading the deb file from the release page. The downside is that you cannot easily update it as you have to download the new deb file again.
|
||||
2. Add a third-party developer repository (recommended by [VSCodium][5]) to your system. This way, you also get regular updates for the new releases of VSCodium.
|
||||
3. Use the snap version. Perhaps the easiest way if you don't have an aversion to Snap packages.
|
||||
|
||||
|
||||
|
||||
I won't discuss the first method, as it is just downloading and [installing the deb file][6] from the [release page][7].
|
||||
|
||||
Let's see the other two methods.
|
||||
|
||||
### Method 1: Installing VSCodium by adding external repo
|
||||
|
||||
The official VSCodium documentation refers to a [GitLab repository by Pavlo Rudy][8] that gives you a continuous update version of VSCodium.
|
||||
|
||||
📋
|
||||
|
||||
Though I am using Ubuntu here, the steps should be applicable for Debian and other Debian and Ubuntu-based distributions.
|
||||
|
||||
Here are the steps.
|
||||
|
||||
[Open a terminal in Ubuntu][9] and use the following command to get the GPG signature key of the developer and add it to your system. This way, your Ubuntu system will trust the packages that are signed by this developer.
|
||||
|
||||
```
|
||||
|
||||
sudo wget https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg -O /usr/share/keyrings/vscodium-archive-keyring.asc
|
||||
|
||||
```
|
||||
|
||||
![Adding the GPG signature key for VSCodium repository][10]
|
||||
|
||||
The next step is to add the repository to [your system's sources.list file][11]. This way, your Ubuntu system will know from where it should get the package from.
|
||||
|
||||
```
|
||||
|
||||
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.asc ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main' | sudo tee /etc/apt/sources.list.d/vscodium.list
|
||||
|
||||
```
|
||||
|
||||
![Adding the VSCodium repo to sources.list][12]
|
||||
|
||||
As you can see, the entry mentions that the repository is signed by the key you had added just above it.
|
||||
|
||||
Update the local package cache so that your system is aware of the packages from the newly added repository.
|
||||
|
||||
```
|
||||
|
||||
sudo apt update
|
||||
|
||||
```
|
||||
|
||||
Now you are ready to install VSCodium on Ubuntu:
|
||||
|
||||
```
|
||||
|
||||
sudo apt install codium
|
||||
|
||||
```
|
||||
|
||||
Yes, the package is called `codium`, not `vscodium`.
|
||||
|
||||
![][13]
|
||||
|
||||
Great! Now you can look for VSCodium in the menu and start the application from there:
|
||||
|
||||
![][14]
|
||||
|
||||
And now you can enjoy coding in VSCodium.
|
||||
|
||||
#### Updating VSCodium
|
||||
|
||||
The good thing is that you have added a repository to your system. When a new VSCodium is released, the repository maintainer pushes the new version to the repository and you should see the new version in the system updater.
|
||||
|
||||
In other words, [keep your Ubuntu system updated][15] and you should have the newer version of VSCodium.
|
||||
|
||||
#### Removing VSCodium
|
||||
|
||||
If you don't want to use it any more for some reason, you can remove it using this command:
|
||||
|
||||
```
|
||||
|
||||
sudo apt remove codium
|
||||
|
||||
```
|
||||
|
||||
You may keep the repository and signature added to your system.
|
||||
|
||||
🚧
|
||||
|
||||
If you are picky about those things, you can remove them from the system as well. Be a little careful while [deleting file in the Linux terminal][16] with sudo.
|
||||
|
||||
```
|
||||
|
||||
sudo rm /usr/share/keyrings/vscodium-archive-keyring.asc
|
||||
|
||||
```
|
||||
|
||||
Next, you could also remove the repository from the sources.list:
|
||||
|
||||
```
|
||||
|
||||
sudo rm /etc/apt/sources.list.d/vscodium.list
|
||||
|
||||
```
|
||||
|
||||
There should be some local, application related files in your home directory, you may want to delete them as well:
|
||||
|
||||
```
|
||||
|
||||
rm -r ~/.config/VSCodium
|
||||
|
||||
```
|
||||
|
||||
### Method 2: Install VSCodium using snap
|
||||
|
||||
💡
|
||||
|
||||
The snap method works on any Linux distribution, not just Ubuntu, as long as [you have snap support enabled on the system][17].
|
||||
|
||||
The snap installation method is rather easier and involves less steps.
|
||||
|
||||
Open a terminal and use the following command to install VSCodium snap package:
|
||||
|
||||
```
|
||||
|
||||
sudo snap install codium --classic
|
||||
|
||||
```
|
||||
|
||||
Wait for some seconds as it downloads the Snap package and then installs it. You'll see the progress on the screen and
|
||||
|
||||
![][18]
|
||||
|
||||
**How do you[ **update the snap version**][19] of VSCodium**? Snap applications are updated automatically multiple times a day. However, the application won't be updated if it's running.
|
||||
|
||||
So, alternatively, you can close any running instance of VSCodium and run this command to force an update (if there is any new version):
|
||||
|
||||
```
|
||||
|
||||
sudo snap refresh codium
|
||||
|
||||
```
|
||||
|
||||
If you don't like it, you can easily remove it with the command below:
|
||||
|
||||
```
|
||||
|
||||
sudo snap remove codium
|
||||
|
||||
```
|
||||
|
||||
### VS Code VS VSCodium
|
||||
|
||||
The major difference is that VSCodium removes the telemetry part from the VS Code. Otherwise, it's a clone of the Microsoft's project and looks and works identical to the famous VS Code.
|
||||
|
||||
The telemetry could be a dealbreaker for some, and hence this project has a considerable popularity in the open source community.
|
||||
|
||||
Here's a good take on the [VS Code telemetry issue][20].
|
||||
|
||||
![][21]
|
||||
|
||||
If you are okay with the telemetry part, you can [install VS Code on Ubuntu as easily][22]. It's really your choice.
|
||||
|
||||
I hope you find this tutorial helpful in installing VSCodium on Ubuntu and other Debian-based distributions. Please leave your feedback in the comment sections.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/install-vscodium-ubuntu/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/vscodium/
|
||||
[2]: https://code.visualstudio.com/
|
||||
[3]: https://code.visualstudio.com/docs/getstarted/telemetry
|
||||
[4]: https://itsfoss.com/content/images/2023/09/vscodium-interface.png
|
||||
[5]: https://vscodium.com/
|
||||
[6]: https://itsfoss.com/install-deb-files-ubuntu/
|
||||
[7]: https://github.com/VSCodium/vscodium/releases
|
||||
[8]: https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo
|
||||
[9]: https://itsfoss.com/open-terminal-ubuntu/
|
||||
[10]: https://itsfoss.com/content/images/2023/09/add-vscodium-signature-key.png
|
||||
[11]: https://itsfoss.com/sources-list-ubuntu/
|
||||
[12]: https://itsfoss.com/content/images/2023/09/add-vscodium-repo-ubuntu.png
|
||||
[13]: https://itsfoss.com/content/images/2023/09/install-vscodium-ubuntu.png
|
||||
[14]: https://itsfoss.com/content/images/2023/09/vscodium-ubuntu.png
|
||||
[15]: https://itsfoss.com/update-ubuntu/
|
||||
[16]: https://itsfoss.com/delete-files-folders-linux/
|
||||
[17]: https://itsfoss.com/install-snap-linux/
|
||||
[18]: https://itsfoss.com/content/images/2023/09/snap-install-codium.png
|
||||
[19]: https://itsfoss.com/snap-update/
|
||||
[20]: https://www.roboleary.net/tools/2022/04/20/vscode-telemetry.html
|
||||
[21]: https://www.roboleary.net/assets/logo/prod/logo.svg
|
||||
[22]: https://itsfoss.com/install-visual-studio-code-ubuntu/
|
@ -0,0 +1,100 @@
|
||||
[#]: subject: "Librem 11: Purism Unveils a Privacy-Focused Linux Tablet"
|
||||
[#]: via: "https://news.itsfoss.com/librem-11-tablet/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Librem 11:Purism 推出注重隐私的 Linux 平板电脑
|
||||
======
|
||||
一款昂贵的 Linux 平板电脑,注重安全和隐私。让我们拭目以待。
|
||||
|
||||
[Purism][1] 是一家日益流行的计算机硬件产品制造商,专门提供配备注重隐私的开源 Linux 发行版的笔记本电脑、台式机和移动设备。
|
||||
|
||||
最近,他们发布了一款新产品 **Librem 11** 平板电脑,配备了一些非常简洁的硬件。
|
||||
|
||||
让我们看看它能提供什么!
|
||||
|
||||
📋
|
||||
|
||||
这不是赞助文章或认可。在订购之前,你应该从它的官方网站上研究有关该产品的更多信息(包括运输查询)。
|
||||
|
||||
### Librem 11:可以期待什么?
|
||||
|
||||
![][2]
|
||||
|
||||
Librem 11 被称为**安全平板电脑**,由其内部 Linux 发行版 [**PureOS**][3] 以及 **[PureBoot][4]** 提供支持,提供非常安全和专注隐私的体验。
|
||||
|
||||
**Purism 确保了设备的安全和隐私**,这要归功于他们采取的各种措施:
|
||||
|
||||
第一个是**安全启动过程**,得益于 PureBoot,它可以与 [**Librem Key**][5] 结合在一起,以进一步增强安全性,并在与 PureBoot 一起使用时以加密方式识别篡改。
|
||||
|
||||
第二个是 **Purism 承诺不监视用户**,避免任何监视或数据挖掘。
|
||||
|
||||
最后一项是 Librem 11 的附加“[**反拦截**][6]”服务,确保设备在制造和运输过程之前、期间或之后不会被篡改。
|
||||
|
||||
你可能想知道; 所有这些都在谈论安全和隐私,但是,**它的能力是什么?**
|
||||
|
||||
![][7]
|
||||
|
||||
Librem 11 由 **[Intel N5100][8] CPU** 以及 **8 GB LPDDR4 RAM** 和 **高达 1 TB 的 NVMe 存储**提供支持。
|
||||
|
||||
至于显示屏,该平板电脑配备多点触控 **60hz 11.5 英寸 AMOLED 显示屏**,分辨率为 **2560×1600。**
|
||||
|
||||
📋
|
||||
|
||||
出于安全考虑,CPU 上的 Intel 管理引擎默认处于禁用状态。
|
||||
|
||||
它还预装了一个具有 4096 级压力的**笔并支持倾斜**,以及一个**可拆卸键盘**,在平板电脑折叠时**还可用作保护套**。
|
||||
|
||||
**其他一些亮点包括:**
|
||||
|
||||
* 指纹识别器。
|
||||
* 英特尔超高清显卡。
|
||||
* 1 个 USB Type-C 3.1 端口。
|
||||
* 借助 [Intel AX201][9] 芯片支持 Wi-Fi 6。
|
||||
* 支持 Bluetooth 5,由 [Intel 9460][10] 芯片提供。
|
||||
* 3.5 毫米音频插孔(麦克风输入和耳机输出组合)。
|
||||
* 前置 2MP 摄像头,后置 5MP 自动/手动对焦摄像头。
|
||||
|
||||
|
||||
|
||||
你可以浏览其[公告博客][11]以了解有关这款注重安全的平板电脑的更多信息。
|
||||
|
||||
### 🛒 获取 Librem 11
|
||||
|
||||
Purism 的 Librem 11 平板电脑现已发售,**价格为 999 美元**,交货期长达 10 天。
|
||||
|
||||
但是,如果你居住在美国,你很可能会比其他地区更早收到它。
|
||||
|
||||
[Librem 11][12]
|
||||
|
||||
* * *
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/librem-11-tablet/
|
||||
|
||||
作者:[Sourav Rudra][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://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://puri.sm/
|
||||
[2]: https://news.itsfoss.com/content/images/2023/09/Librem_11.jpg
|
||||
[3]: https://www.pureos.net/
|
||||
[4]: https://puri.sm/projects/pureboot/
|
||||
[5]: https://puri.sm/products/librem-key/
|
||||
[6]: https://puri.sm/posts/anti-interdiction-services/
|
||||
[7]: https://news.itsfoss.com/content/images/2023/09/Librem_11_2.jpg
|
||||
[8]: https://www.intel.com/content/www/us/en/products/sku/212329/intel-celeron-processor-n5100-4m-cache-up-to-2-80-ghz/specifications.html
|
||||
[9]: https://www.intel.com/content/www/us/en/products/sku/130293/intel-wifi-6-ax201-gig/specifications.html
|
||||
[10]: https://www.intel.com/content/www/us/en/products/sku/99446/intel-wirelessac-9560/specifications.html
|
||||
[11]: https://puri.sm/posts/purism-launches-new-secure-librem-11-tablet/
|
||||
[12]: https://shop.puri.sm/shop/librem-11/
|
@ -0,0 +1,236 @@
|
||||
[#]: subject: "Boot From a USB Drive in VirtualBox in Linux"
|
||||
[#]: via: "https://itsfoss.com/virtualbox-boot-from-usb/"
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
在 Linux 的 VirtualBox 中从 USB 驱动器启动
|
||||
======
|
||||
|
||||
有一个实时 Linux USB 吗? 在当前系统上测试它的常用方法是重新启动并在系统重新启动时选择从实时 USB 启动。
|
||||
|
||||
但这很烦人,因为你需要停止计算机上的工作并重新启动它。
|
||||
|
||||
一种破坏性较小的方法是使用虚拟机。
|
||||
|
||||
是的,你可以使用 VirtualBox 从虚拟机中的 USB 启动。这样,你不必为了尝试而在 VM 中安装发行版。请改用实时会话。
|
||||
|
||||
在本教程中,我将展示在 Linux 系统上的 VirtualBox 中从 USB 驱动器启动的步骤。这需要一些时间和精力,但可以让你免于重启系统。
|
||||
|
||||
### Linux 的 VirtualBox 中从 USB 驱动器启动
|
||||
|
||||
由于这是针对高级用户的教程,因此我省略了你事先需要的几个步骤:
|
||||
|
||||
* 在 Linux 系统上安装 VirtualBox
|
||||
* 实时 Linux USB,最好是[使用 Ventoy][1]
|
||||
|
||||
|
||||
|
||||
![][2]
|
||||
|
||||
本指南分为三个部分:
|
||||
|
||||
* 创建虚拟机磁盘文件
|
||||
* 在 VM 中使用 USB 启动
|
||||
* 删除虚拟机磁盘(可选)
|
||||
|
||||
|
||||
|
||||
那么让我们从第一个开始。
|
||||
|
||||
#### 步骤 1:创建虚拟机磁盘文件(VMDK)
|
||||
|
||||
首先,你需要识别 USB 驱动器的磁盘名称,为此,你需要[列出系统的驱动器][3]。
|
||||
|
||||
为此,我将使用 lsblk 命令:
|
||||
|
||||
```
|
||||
|
||||
lsblk
|
||||
|
||||
```
|
||||
|
||||
![][4]
|
||||
|
||||
🚧
|
||||
|
||||
确保使用不带任何数字的磁盘名称。就我而言,Ventoy 以 sdb1 命名,但我仍然只能使用 sdb。
|
||||
|
||||
|
||||
从上图中,你可以看到,Ventoy 列出了 `sdb11`,但你必须使用不带任何数字的名称。这意味着我必须只使用 `sdb`,否则,它会抛出错误。
|
||||
|
||||
找到驱动器名称后,使用以下命令中的 VBoxManage 命令来创建:
|
||||
|
||||
```
|
||||
|
||||
sudo VBoxManage createmedium disk --filename=/path/to/rawdisk.vmdk --variant=RawDisk --format=VMDK --property RawDrive=/dev/sda
|
||||
|
||||
```
|
||||
|
||||
在上面的命令中,将 `/path/to/rawdisk.vmdk` 替换为要保存文件的路径 ,将 `/dev/sda` 替换为目标驱动器。
|
||||
|
||||
就我而言,我想在我的主目录中创建一个名为 `IF.vmdk` 的文件,并且我的目标驱动器是 `/dev/sdb`,然后,我将使用以下命令:
|
||||
|
||||
📋
|
||||
|
||||
你需要提供绝对路径来创建 vmdk 文件!
|
||||
|
||||
```
|
||||
|
||||
sudo VBoxManage createmedium disk --filename=/home/sagar/IF.vmdk --variant=RawDisk --format=VMDK --property RawDrive=/dev/sdb
|
||||
|
||||
```
|
||||
|
||||
![][5]
|
||||
|
||||
最后,使用 chmod 命令更改权限:
|
||||
|
||||
```
|
||||
|
||||
sudo chmod 777 Filename.vmdk
|
||||
|
||||
```
|
||||
|
||||
![][6]
|
||||
|
||||
#### 步骤 2:在 Linux 的 VirtualBox 中从 USB 启动
|
||||
|
||||
首先,从系统菜单中打开 VirtualBox,然后单击`新建`按钮。
|
||||
|
||||
在那里,为你的虚拟机命名并选择操作系统类型及其版本:
|
||||
|
||||
![][7]
|
||||
|
||||
现在,单击`下一步`按钮,它会要求你为虚拟机分配硬件资源:
|
||||
|
||||
![][8]
|
||||
|
||||
完成硬件资源分配后,单击`下一步`按钮。
|
||||
|
||||
在这里,你将找到创建或添加虚拟磁盘的选项。现在,请执行 3 个简单步骤:
|
||||
|
||||
* 选择第二个选项`使用现有虚拟硬盘文件`。
|
||||
* 单击`文件`图标。
|
||||
* 点击`添加`按钮并选择你最近创建的以 `.vmdk` 结尾的文件。
|
||||
|
||||
|
||||
|
||||
![][9]
|
||||
|
||||
选择文件后,它将显示文件的名称,选择它并点击`选择`选项:
|
||||
|
||||
![][10]
|
||||
|
||||
它将向你显示已选择从中启动的文件。单击下一步,它将显示你所做的选择的摘要。
|
||||
|
||||
点击`完成`按钮:
|
||||
|
||||
![][11]
|
||||
|
||||
就是这样! 虚拟机已创建。
|
||||
|
||||
要启动虚拟机,首先选择虚拟机并单击启动按钮:
|
||||
|
||||
![][12]
|
||||
|
||||
由于我的 USB 有 Ventoy,你可以看到,此处列出了多个发行版:
|
||||
|
||||
![][13]
|
||||
|
||||
很酷。是么?
|
||||
|
||||
#### 步骤 3:使用删除虚拟机及 vmdk 文件(可选)
|
||||
|
||||
当我在删除虚拟机后尝试删除 vmdk 文件时,当然,它被删除了,但每当我尝试创建具有相同名称的新文件时,它都会给我一个错误,说该文件已经存在!
|
||||
|
||||
因此,在这里,我将引导你了解如何删除虚拟机及 vmdk 文件。
|
||||
|
||||
首先,关闭虚拟机并将其删除
|
||||
|
||||
![][14]
|
||||
|
||||
现在,如果你尝试[使用 rm 命令][15]并提升权限删除 vmdk 文件,你可以删除它(但这就是幻觉的开始)。
|
||||
|
||||
例如,在这里,我删除了 IF.vmdk 文件:
|
||||
|
||||
```
|
||||
|
||||
sudo rm IF.vmdk
|
||||
|
||||
```
|
||||
|
||||
![][16]
|
||||
|
||||
现在,如果我尝试创建一个具有相同名称的新 vmdk 文件,则会出现错误,指出该文件已存在:
|
||||
|
||||
![][17]
|
||||
|
||||
要删除 vmdk 文件,首先,你必须使用以下命令取消注册该文件:
|
||||
|
||||
```
|
||||
|
||||
sudo VBoxManage closemedium disk /path/to/MyDrive.vmdk
|
||||
|
||||
```
|
||||
|
||||
![][18]
|
||||
|
||||
完成后,你可以使用 rm 命令删除该文件,它将轻松删除:
|
||||
|
||||
```
|
||||
|
||||
sudo rm Filename.vmdk
|
||||
|
||||
```
|
||||
|
||||
然后,如果你尝试创建具有相同文件名的 vmdk 文件,你可以这样做:
|
||||
|
||||
![][19]
|
||||
|
||||
这就行了!
|
||||
|
||||
### 更多虚拟机技巧
|
||||
|
||||
如果你正在寻找最快的 VM,可以使用 Qemu + KVM 的组合。我知道这听起来很复杂。
|
||||
|
||||
但为了让事情变得简单,我们制作了一份关于如何在 Ubuntu 上安装和使用 Qemu 的专门指南,包括启用共享文件夹、剪贴板和自动调整大小:
|
||||
|
||||
![][2]
|
||||
|
||||
我希望本指南对你有所帮助。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/virtualbox-boot-from-usb/
|
||||
|
||||
作者:[Sagar Sharma][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/sagar/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/use-ventoy/
|
||||
[2]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png
|
||||
[3]: https://linuxhandbook.com/linux-list-disks/
|
||||
[4]: https://itsfoss.com/content/images/2023/07/list-drives-in-Linux.png
|
||||
[5]: https://itsfoss.com/content/images/2023/07/create-virtual-machine-disk-drive-for-virtualbox-to-boot-from-USB-drive-in-Linux.png
|
||||
[6]: https://itsfoss.com/content/images/2023/07/use-chmod-command-to-change-the-permissions.png
|
||||
[7]: https://itsfoss.com/content/images/2023/07/Create-VM-in-VirtualBox-to-boot-from-USB-in-Linux.png
|
||||
[8]: https://itsfoss.com/content/images/2023/07/allocate-RAM-and-cores-to-Vm-to-boot-from-USB-in-VirtualBox-in-Linux.png
|
||||
[9]: https://itsfoss.com/content/images/2023/07/add-virtual-machine-disk-drive-in-VirtualBox-to-boot-from-USB-in-Linux.png
|
||||
[10]: https://itsfoss.com/content/images/2023/07/select-the-vmdk-file.png
|
||||
[11]: https://itsfoss.com/content/images/2023/07/Finish-the-VM-creation-to-boot-from-USB-in-VirtualBox-in-Linux.png
|
||||
[12]: https://itsfoss.com/content/images/2023/07/start-the-VM.png
|
||||
[13]: https://itsfoss.com/content/images/2023/07/Boot-from-USB-in-VirtualBox-in-Linux.png
|
||||
[14]: https://itsfoss.com/content/images/2023/07/Remove-VM-from-VirtualBox.png
|
||||
[15]: https://linuxhandbook.com/remove-files-directories/
|
||||
[16]: https://itsfoss.com/content/images/2023/07/use-rm-command-to-remove-vmdk-file.png
|
||||
[17]: https://itsfoss.com/content/images/2023/07/unable-to-create-vmdk-file-in-Linux--file-already-exist.png
|
||||
[18]: https://itsfoss.com/content/images/2023/07/unregister-vmdk-file-in-Linux-to-remove-it.png
|
||||
[19]: https://itsfoss.com/content/images/2023/07/how-to-remove-the-vmdk-file-in-Linux.png
|
Loading…
Reference in New Issue
Block a user