mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-06 01:20:12 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
11c86e18c5
@ -1,15 +1,17 @@
|
||||
如何创建适合移动设备的文档
|
||||
=====
|
||||
to 校正:原文章中有些右侧的 tag,出现在仓库文章中,这些没有翻译
|
||||
|
||||
> 帮助用户在智能手机或平板上快速轻松地找到他们所需的信息。
|
||||
|
||||

|
||||
我并不是完全相信[移动为先][1]的理念,但是我确实发现更多的人使用只能手机和平板电脑等移动设备来获取信息。这包括在线的软件和硬件文档,但它们大部分都是冗长的,不适合小屏幕。通常情况下,它的伸缩性不太好,而且很难导航。
|
||||
|
||||
当用户使用移动设备访问文档时,他们通常需要迅速获取信息以了解如何执行任务或解决问题,他们不想通过看似无尽的页面来寻找他们需要的特定信息。幸运的是,解决这个问题并不看来。以下是一些提示,可以帮助你构建文档以满足移动阅读器的需求。
|
||||
我并不是完全相信[移动为先][1]的理念,但是我确实发现更多的人使用智能手机和平板电脑等移动设备来获取信息。这包括在线的软件和硬件文档,但它们大部分都是冗长的,不适合小屏幕。通常情况下,它的伸缩性不太好,而且很难导航。
|
||||
|
||||
当用户使用移动设备访问文档时,他们通常需要迅速获取信息以了解如何执行任务或解决问题,他们不想通过看似无尽的页面来寻找他们需要的特定信息。幸运的是,解决这个问题并不难。以下是一些技巧,可以帮助你构建文档以满足移动阅读器的需求。
|
||||
|
||||
### 简短一点
|
||||
|
||||
这意味着简短的句子,简短的段落和简短的程序。你不是在写一部长篇小说或一段长新闻。使你的文档简洁。尽可能使用少量的语言来获得想法和信息。
|
||||
这意味着简短的句子,简短的段落和简短的流程。你不是在写一部长篇小说或一段长新闻。使你的文档简洁。尽可能使用少量的语言来获得想法和信息。
|
||||
|
||||
以广播新闻报道为示范:关注关键要素,用简单直接的语言对其进行解释。不要让你的读者在屏幕上看到冗长的文字。
|
||||
|
||||
@ -17,16 +19,16 @@ to 校正:原文章中有些右侧的 tag,出现在仓库文章中,这些
|
||||
|
||||
### 主题
|
||||
|
||||
在技术写作的世界里,主题是独立的,独立的信息块。每个主题都包含你网站上的单个页面。读者应该能从特定的主题中获取他们需要的信息 -- 并且只是那些信息。要做到这一点,选择哪些主题要包含在文档中并决定如何组织它们:
|
||||
在技术写作的世界里,主题是独立的,独立的信息块。每个主题都由你网站上的单个页面组成。读者应该能从特定的主题中获取他们需要的信息 -- 并且只是那些信息。要做到这一点,选择哪些主题要包含在文档中并决定如何组织它们:
|
||||
|
||||
### 考虑 DITA
|
||||
### DITA
|
||||
|
||||
[Darwin Information Typing Architecture][2] 或 DITA 是用于编写和发布的一个 XML 模型。它在技术写作中被[广泛采用][3],特别是对于教程的文档集。
|
||||
<ruby>[达尔文信息类型化体系结构][2]<rt>Darwin Information Typing Architecture</rt></ruby> (DITA) 是用于编写和发布的一个 XML 模型。它[广泛采用][3]在技术写作中,特别是作为较长的文档集中。
|
||||
|
||||
我并不是建议你将文档转换为 XML(除非你真的想)。相反,考虑将 DITA 的不同类型主题的概念应用到你的文档中:
|
||||
|
||||
* 一般:概述信息
|
||||
* 任务:分布程序
|
||||
* 任务:分步骤的流程
|
||||
* 概念:背景或概念信息
|
||||
* 参考:API 参考或数据字典等专用信息
|
||||
* 术语表:定义术语
|
||||
@ -34,19 +36,19 @@ to 校正:原文章中有些右侧的 tag,出现在仓库文章中,这些
|
||||
|
||||
你会得到很多单独的页面。要连接这些页面:
|
||||
|
||||
### 考虑链接
|
||||
### 链接
|
||||
|
||||
许多内容管理系统,维基和发布框架都包含某种形式的导航 - 通常是目录或[面包屑][4],这是一种在移动设备上淡入背景的导航。
|
||||
许多内容管理系统、维基和发布框架都包含某种形式的导航 —— 通常是目录或[面包屑导航][4],这是一种在移动设备上逐渐消失的导航。
|
||||
|
||||
为了加强导航,在主题之间添加明确的链接。将这些链接放在每个主题末尾的标题**另请参阅**或**相关主题**。每个部分应包含两到五个链接,指向与当前主题相关的概述,概念和参考主题。
|
||||
为了加强导航,在主题之间添加明确的链接。将这些链接放在每个主题末尾的标题**另请参阅**或**相关主题**。每个部分应包含两到五个链接,指向与当前主题相关的概述、概念和参考主题。
|
||||
|
||||
如果你需要指向文档集之外的信息,请确保链接在浏览器新的选项中打开。这将把读者送到另一个网站,同时也将读者留你的网站上。
|
||||
如果你需要指向文档集之外的信息,请确保链接在浏览器新的选项卡中打开。这将把读者送到另一个网站,同时也将读者继续留你的网站上。
|
||||
|
||||
这解决了文本问题,那么图片呢?
|
||||
|
||||
### 考虑不使用图片
|
||||
### 不使用图片
|
||||
|
||||
除少数情况之外,图片不会增加太多文档。仔细查看文档中的每个图片,然后问自己:
|
||||
除少数情况之外,不应该加太多图片到文档中。仔细查看文档中的每个图片,然后问自己:
|
||||
|
||||
* 它有用吗?
|
||||
* 它是否增强了文档?
|
||||
@ -60,7 +62,7 @@ to 校正:原文章中有些右侧的 tag,出现在仓库文章中,这些
|
||||
|
||||
### 最后的想法
|
||||
|
||||
通过较少的努力,你就可以构建文档以便移动设备用户很好的阅读。另外还有:这些更改也改进了桌面计算机和笔记本电脑用户的文档。
|
||||
通过少量努力,你就可以构建适合移动设备用户的文档。此外,这些更改也改进了桌面计算机和笔记本电脑用户的文档体验。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
@ -69,7 +71,7 @@ via: https://opensource.com/article/17/12/think-mobile
|
||||
|
||||
作者:[Scott Nesbitt][a]
|
||||
译者:[MjSeven](https://github.com/MjSeven)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,24 +1,24 @@
|
||||
使用一个树莓派和 projectx/os 托管你自己的电子邮件
|
||||
使用树莓派和 projectx/os 托管你自己的电子邮件
|
||||
======
|
||||
|
||||
> 这个开源项目可以通过低成本的服务器设施帮助你保护你的数据隐私和所有权。
|
||||
|
||||

|
||||
|
||||
现在有大量的理由,不能再将存储你的数据的任务委以他人之手,也不能在第三方公司运行你的服务;隐私、所有权、以及防范任何人拿你的数据去“赚钱”。但是对于大多数人来说,自己去运行一个服务器,是件即费时间又需要太多的专业知识的事情。不得已,我们只能妥协。抛开这些顾虑,使用某些公司的云服务,随之而来的就是广告、数据挖掘和售卖、以及其它可能的任何东西。
|
||||
现在有大量的理由,不能再将存储你的数据的任务委以他人之手,也不能在第三方公司运行你的服务;隐私、所有权,以及防范任何人拿你的数据去“赚钱”。但是对于大多数人来说,自己去运行一个服务器,是件即费时间又需要太多的专业知识的事情。不得已,我们只能妥协。抛开这些顾虑,使用某些公司的云服务,随之而来的就是广告、数据挖掘和售卖、以及其它可能的任何东西。
|
||||
|
||||
[projectx/os][1] 项目就是要去除这种顾虑,它可以在家里毫不费力地做服务托管,并且可以很容易地创建一个类似于 Gmail 的帐户。实现上述目标,你只需一个 $35 的树莓派 3 和一个基于 Debian 的操作系统镜像 —— 并且不需要很多的专业知识。仅需要四步就可以实现:
|
||||
|
||||
1. 解压缩一个 ZIP 文件到 SD 存储卡中。
|
||||
2. 编辑 SD 上的一个文本文件以便于它连接你的 WiFi(如果你不使用有线网络的话)。
|
||||
2. 编辑 SD 卡上的一个文本文件以便于它连接你的 WiFi(如果你不使用有线网络的话)。
|
||||
3. 将这个 SD 卡插到树莓派 3 中。
|
||||
4. 使用你的智能手机在树莓派 3 上安装 "email 服务器“ 应用并选择一个二级域。
|
||||
4. 使用你的智能手机在树莓派 3 上安装 “email 服务器” 应用并选择一个二级域。
|
||||
|
||||
服务器应用程序(比如电子邮件服务器)被分解到多个容器中,它们中的每个都只能够使用指定的方式与外界通讯,它们使用了管理粒度非常细的隔离措施以提高安全性。例如,入站 SMTP、[SpamAssassin][2](反垃圾邮件平台)、[Dovecot][3] (安全的 IMAP 服务器),以及 webmail 都使用了独立的容器,它们之间相互不能看到对方的数据,因此,单个守护进程出现问题不会波及其它的进程。
|
||||
|
||||
另外,它们都是无状态容器,比如 SpamAssassin 和入站 SMTP,每次收到电子邮件之后,它们的容器都会被销毁并重建,因此,即便是有人找到了 bug 并利用了它,他们也不能访问以前的电子邮件或者接下来的电子邮件;他们只能访问他们自己挖掘出漏洞的那封电子邮件。幸运的是,大多数对外发布的、最容易受到攻击的服务都是隔离的和无状态的。
|
||||
|
||||
服务器应用程序(比如电子邮件服务器)被分解到多个容器中,它们中的每个都只能够使用指定的方式与外界通讯,它们使用了管理粒度非常细的隔离措施以提高安全性。例如,入站 SMTP,[SpamAssassin][2](防垃圾邮件平台),[Dovecot][3] (安全 IMAP 服务器),并且 webmail 都使用了独立的容器,它们之间相互不能看到对方的数据,因此,单个守护进程出现问题不会波及其它的进程。
|
||||
|
||||
另外,它们都是无状态容器,比如 SpamAssassin 和入站 SMTP,每次收到电子邮件之后,它们的连接都会被拆除并重建,因此,即便是有人找到了 bug 并利用了它,他们也不能访问以前的电子邮件或者接下来的电子邮件;他们只能访问他们自己挖掘出漏洞的那封电子邮件。幸运的是,大多数对外发布的、最容易受到攻击的服务都是隔离的和无状态的。
|
||||
|
||||
所有存储的数据都使用 [dm-crypt][4] 进行加密。非公开服务,比如 Dovecot(IMAP)或者 webmail,都是在内部监听,并使用 [ZeroTier One][5] 加密整个网络,因此只有你的设备(智能手机、笔记本电脑、平板等等)才能访问它们。
|
||||
所有存储的数据都使用 [dm-crypt][4] 进行加密。非公开的服务,比如 Dovecot(IMAP)或者 webmail,都是在内部监听,并使用 [ZeroTier One][5] 所提供的私有的加密层叠网络,因此只有你的设备(智能手机、笔记本电脑、平板等等)才能访问它们。
|
||||
|
||||
虽然电子邮件并不是端到端加密的(除非你使用了 [PGP][6]),但是非加密的电子邮件绝不会跨越网络,并且也不会存储在磁盘上。现在明文的电子邮件只存在于双方的私有邮件服务器上,它们都在他们的家中受到很好的安全保护并且只能通过他们的客户端访问(智能手机、笔记本电脑、平板等等)。
|
||||
|
||||
@ -26,9 +26,7 @@
|
||||
|
||||
### 展望
|
||||
|
||||
电子邮件是我使用 project/os 项目打包的第一个应用程序。想像一下,一个应用程序商店有全部的服务器软件,为易于安装和使用将它们打包到一起。想要一个博客?添加一个 WordPress 应用程序!想替换安全的 Dropbox ?添加一个 [Seafile][8] 应用程序或者一个 [Syncthing][9] 后端应用程序。 [IPFS][10] 节点? [Mastodon][11] 实例?GitLab 服务器?各种家庭自动化/物联网后端服务?这里有大量的非常好的开源服务器软件 ,它们都非常易于安装,并且可以使用它们来替换那些有专利的云服务。
|
||||
|
||||
Nolan Leake 的 [在每个家庭中都有一个云:0 系统管理员技能就可以在家里托管服务器][12] 将在三月 8 - 11日的 [Southern California Linux Expo][12] 进行。使用折扣代码 **OSDC** 去注册可以 50% 的价格得到门票。
|
||||
电子邮件是我使用 project/os 项目打包的第一个应用程序。想像一下,一个应用程序商店有全部的服务器软件,打包起来易于安装和使用。想要一个博客?添加一个 WordPress 应用程序!想替换安全的 Dropbox ?添加一个 [Seafile][8] 应用程序或者一个 [Syncthing][9] 后端应用程序。 [IPFS][10] 节点? [Mastodon][11] 实例?GitLab 服务器?各种家庭自动化/物联网后端服务?这里有大量的非常好的开源服务器软件 ,它们都非常易于安装,并且可以使用它们来替换那些有专利的云服务。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -36,7 +34,7 @@ via: https://opensource.com/article/18/3/host-your-own-email
|
||||
|
||||
作者:[Nolan Leake][a]
|
||||
译者:[qhwdw](https://github.com/qhwdw)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,44 @@
|
||||
使用 AppImageLauncher 轻松运行和集成 AppImage 文件
|
||||
======
|
||||
|
||||
你有没有下载过 AppImage 文件,而你不知道如何使用它?或许你可能知道如何使用它,但是你每次要运行它时必须要进入到下载了该 .AppImage 的文件夹中来运行它,或者手动为其创建启动程序。
|
||||
|
||||
使用 AppImageLauncher,这些就都是过去的问题。该程序可让你轻松运行 AppImage 文件,而无需使其可执行。但它最有趣的特点是可以轻松地将 AppImage 与你的系统进行整合:AppImageLauncher 可以自动将 AppImage 程序快捷方式添加到桌面环境的程序启动器/菜单(包括程序图标和合适的说明)中。
|
||||
|
||||
这 里有个例子,我想在 Ubuntu 上使用 [Kdenlive][2],但我不想从仓库中安装它,因为它有大量的 KDE 依赖,我不想把它们弄到我的 Gnome 系统中。因为没有它的 Flatpak 或 Snap 镜像,我只能去下载了 Kdenlive 的 AppImage。
|
||||
|
||||
在没有把下载的 [Kdenline][2] AppImage 变成可执行的情况下,我第一次双击它时(安装好了 AppImageLauncher),AppImageLauncher 提供了两个选项:
|
||||
|
||||
“Run once”或者“Integrate and run”。
|
||||
|
||||

|
||||
|
||||
点击 “Integrate and run”,这个 AppImage 就被复制到 `~/.bin/` (家目录中的隐藏文件夹)并添加到菜单中,然后启动该程序。
|
||||
|
||||
要删除它也很简单,只要您使用的桌面环境支持桌面动作就行。例如,在 Gnome Shell 中,只需右键单击“活动概览”中的应用程序图标,然后选择“Remove from system”:
|
||||
|
||||

|
||||
|
||||
更新:该应用只初步为 Ubuntu 和 Mint 做了开发,但它最近会提供 Debian、 Netrunner 和 openSUSE 支持。本文首次发布后添加的另一个功能是支持 AppImage 的更新;你在启动器中可以找到 “Update AppImage”。
|
||||
|
||||
### 下载 AppImageLauncher
|
||||
|
||||
AppImageLauncher 支持 Ubuntu、 Debian、Netrunner 和 openSUSE。如果你使用 Ubuntu 18.04,请确保你下载的 deb 包的名字中有“bionic”,而其它的 deb 是用于旧一些的 Ubuntu 版本的。
|
||||
|
||||
- [下载 AppImageLauncher][1]
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxuprising.com/2018/04/easily-run-and-integrate-appimage-files.html
|
||||
|
||||
作者:[Logix][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/118280394805678839070
|
||||
[1]:https://github.com/TheAssassin/AppImageLauncher/releases
|
||||
[2]:https://kdenlive.org/download/
|
55
sources/'tech
Normal file
55
sources/'tech
Normal file
@ -0,0 +1,55 @@
|
||||
How to find your IP address in Linux
|
||||
======
|
||||

|
||||
Internet Protocol (IP) needs no introduction—we all use it daily. Even if you don't use it directly, when you type website-name.com on your web browser, it looks up the IP address of that URL and then loads the website.
|
||||
|
||||
Let's divide IP addresses into two categories: private and public. Private IP addresses are the ones your WiFi box (and company intranet) provide. They are in the range of 10.x.x.x, 172.16.x.x-172.31.x.x, and 192.168.x.x, where x=0 to 255. Public IP addresses, as the name suggests, are "public" and you can reach them from anywhere in the world. Every website has a unique IP address that can be reached by anyone and from anywhere; that is considered a public IP address.
|
||||
|
||||
Furthermore, there are two types of IP addresses: IPv4 and IPv6.
|
||||
|
||||
IPv4 addresses have the format x.x.x.x, where x=0 to 255. There are 2^32 (approximately 4 billion) possible IPv4 addresses.
|
||||
|
||||
IPv6 addresses have a more complex format using hex numbers. The total number of bits is 128, which means there are 2^128—340 undecillion!—possible IPv6 addresses. IPv6 was introduced to tackle the foreseeable exhaustion of IPv4 addresses in the near future.
|
||||
|
||||
As a network engineer, I recommend not sharing your machine’s public IP address with anyone. Your WiFi router has a public IP, which is the WAN (wide-area network) IP address, and it will be the same for any device connected to that WiFi. All the devices connected to the same WiFi have private IP addresses locally identified by the range provided above. For example, my laptop is connected with the IP address 192.168.0.5, and my phone is connected with 192.168.0.8. These are private IP addresses, but both would have the same public IP address.
|
||||
|
||||
The following commands will get you the IP address list to find public IP addresses for your machine:
|
||||
|
||||
1. `ifconfig.me`
|
||||
2. `curl -4/-6 icanhazip.com`
|
||||
3. `curl ipinfo.io/ip`
|
||||
4. `curl api.ipify.org`
|
||||
5. `curl checkip.dyndns.org`
|
||||
6. `dig +short myip.opendns.com @resolver1.opendns.com`
|
||||
7. `host myip.opendns.com resolver1.opendns.com`
|
||||
8. `curl ident.me`
|
||||
9. `curl bot.whatismyipaddress.com`
|
||||
10. `curl ipecho.net/plain`
|
||||
|
||||
|
||||
|
||||
The following commands will get you the private IP address of your interfaces:
|
||||
|
||||
1. `ifconfig -a`
|
||||
2. `ip addr (ip a)`
|
||||
3. `hostname -I | awk ‘{print $1}’`
|
||||
4. `ip route get 1.2.3.4 | awk '{print $7}'`
|
||||
5. `(Fedora) Wifi-Settings→ click the setting icon next to the Wifi name that you are connected to → Ipv4 and Ipv6 both can be seen`
|
||||
6. `nmcli -p device show`
|
||||
|
||||
|
||||
|
||||
_Note: Some utilities need to be installed on your system based on the Linux distro you are using. Also, some of the noted commands use a third-party website to get the IP_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/5/how-find-ip-address-linux
|
||||
|
||||
作者:[Archit Modi][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者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/architmodi
|
@ -0,0 +1,164 @@
|
||||
How To Downgrade A Package In Arch Linux
|
||||
======
|
||||
|
||||

|
||||
As you might know, Arch Linux is a rolling release and DIY (do-it-yourself) distribution. So you have to be bit careful while updating it often, especially installing or updating packages from the third party repositories like AUR. You might be end up with broken system if you don’t know what you are doing. It is your responsibility to make Arch Linux more stable. However, we all do mistakes. It is difficult to be careful all time. Sometimes, you want to update to most bleeding edge, and you might be stuck with broken packages. Don’t panic! In such cases, you can simply rollback to the old stable packages. This short tutorial describes how to downgrade a package in Arch Linux and its variants like Antergos, Manjaro Linux.
|
||||
|
||||
### Downgrade a package in Arch Linux
|
||||
|
||||
In Arch Linux, there is an utility called** “downgrade”** that helps you to downgrade an installed package to any available older version. This utility will check your local cache and the remote servers (Arch Linux repositories) for the old versions of a required package. You can pick any one of the old stable package from that list and install it.
|
||||
|
||||
This package is not available in the official repositories. You need to add the unofficial **archlinuxfr** repository.
|
||||
|
||||
To do so, edit **/etc/pacman.conf** file:
|
||||
```
|
||||
$ sudo nano /etc/pacman.conf
|
||||
|
||||
```
|
||||
|
||||
Add the following lines:
|
||||
```
|
||||
[archlinuxfr]
|
||||
SigLevel = Never
|
||||
Server = http://repo.archlinux.fr/$arch
|
||||
|
||||
```
|
||||
|
||||
Save and close the file.
|
||||
|
||||
Update the repositories with command:
|
||||
```
|
||||
$ sudo pacman -Sy
|
||||
|
||||
```
|
||||
|
||||
Then install “Downgrade” utility using the following command from your Terminal:
|
||||
```
|
||||
$ sudo pacman -S downgrade
|
||||
|
||||
```
|
||||
|
||||
**Sample output:**
|
||||
```
|
||||
resolving dependencies...
|
||||
looking for conflicting packages...
|
||||
|
||||
Packages (1) downgrade-5.2.3-1
|
||||
|
||||
Total Download Size: 0.01 MiB
|
||||
Total Installed Size: 0.10 MiB
|
||||
|
||||
:: Proceed with installation? [Y/n]
|
||||
|
||||
```
|
||||
|
||||
The typical usage of “downgrade” command is:
|
||||
```
|
||||
$ sudo downgrade [PACKAGE, ...] [-- [PACMAN OPTIONS]]
|
||||
|
||||
```
|
||||
|
||||
Let us say you want to downgrade **opera web browser** to any available old version.
|
||||
|
||||
To do so, run:
|
||||
```
|
||||
$ sudo downgrade opera
|
||||
|
||||
```
|
||||
|
||||
This command will list all available versions of opera package (both new and old) from your local cache and remote mirror.
|
||||
|
||||
**Sample output:**
|
||||
```
|
||||
Available packages:
|
||||
|
||||
1) opera-37.0.2178.43-1-x86_64.pkg.tar.xz (local)
|
||||
2) opera-37.0.2178.43-1-x86_64.pkg.tar.xz (remote)
|
||||
3) opera-37.0.2178.32-1-x86_64.pkg.tar.xz (remote)
|
||||
4) opera-36.0.2130.65-2-x86_64.pkg.tar.xz (remote)
|
||||
5) opera-36.0.2130.65-1-x86_64.pkg.tar.xz (remote)
|
||||
6) opera-36.0.2130.46-2-x86_64.pkg.tar.xz (remote)
|
||||
7) opera-36.0.2130.46-1-x86_64.pkg.tar.xz (remote)
|
||||
8) opera-36.0.2130.32-2-x86_64.pkg.tar.xz (remote)
|
||||
9) opera-36.0.2130.32-1-x86_64.pkg.tar.xz (remote)
|
||||
10) opera-35.0.2066.92-1-x86_64.pkg.tar.xz (remote)
|
||||
11) opera-35.0.2066.82-1-x86_64.pkg.tar.xz (remote)
|
||||
12) opera-35.0.2066.68-1-x86_64.pkg.tar.xz (remote)
|
||||
13) opera-35.0.2066.37-2-x86_64.pkg.tar.xz (remote)
|
||||
14) opera-34.0.2036.50-1-x86_64.pkg.tar.xz (remote)
|
||||
15) opera-34.0.2036.47-1-x86_64.pkg.tar.xz (remote)
|
||||
16) opera-34.0.2036.25-1-x86_64.pkg.tar.xz (remote)
|
||||
17) opera-33.0.1990.115-2-x86_64.pkg.tar.xz (remote)
|
||||
18) opera-33.0.1990.115-1-x86_64.pkg.tar.xz (remote)
|
||||
19) opera-33.0.1990.58-1-x86_64.pkg.tar.xz (remote)
|
||||
20) opera-32.0.1948.69-1-x86_64.pkg.tar.xz (remote)
|
||||
21) opera-32.0.1948.25-1-x86_64.pkg.tar.xz (remote)
|
||||
22) opera-31.0.1889.174-1-x86_64.pkg.tar.xz (remote)
|
||||
23) opera-31.0.1889.99-1-x86_64.pkg.tar.xz (remote)
|
||||
24) opera-30.0.1835.125-1-x86_64.pkg.tar.xz (remote)
|
||||
25) opera-30.0.1835.88-1-x86_64.pkg.tar.xz (remote)
|
||||
26) opera-30.0.1835.59-1-x86_64.pkg.tar.xz (remote)
|
||||
27) opera-30.0.1835.52-1-x86_64.pkg.tar.xz (remote)
|
||||
28) opera-29.0.1795.60-1-x86_64.pkg.tar.xz (remote)
|
||||
29) opera-29.0.1795.47-1-x86_64.pkg.tar.xz (remote)
|
||||
30) opera-28.0.1750.51-1-x86_64.pkg.tar.xz (remote)
|
||||
31) opera-28.0.1750.48-1-x86_64.pkg.tar.xz (remote)
|
||||
32) opera-28.0.1750.40-1-x86_64.pkg.tar.xz (remote)
|
||||
33) opera-27.0.1689.76-1-x86_64.pkg.tar.xz (remote)
|
||||
34) opera-27.0.1689.69-1-x86_64.pkg.tar.xz (remote)
|
||||
35) opera-27.0.1689.66-1-x86_64.pkg.tar.xz (remote)
|
||||
36) opera-27.0.1689.54-2-x86_64.pkg.tar.xz (remote)
|
||||
37) opera-27.0.1689.54-1-x86_64.pkg.tar.xz (remote)
|
||||
38) opera-26.0.1656.60-1-x86_64.pkg.tar.xz (remote)
|
||||
39) opera-26.0.1656.32-1-x86_64.pkg.tar.xz (remote)
|
||||
40) opera-12.16.1860-2-x86_64.pkg.tar.xz (remote)
|
||||
41) opera-12.16.1860-1-x86_64.pkg.tar.xz (remote)
|
||||
|
||||
select a package by number:
|
||||
|
||||
```
|
||||
|
||||
Just type the package number of your choice, and hit enter to install it.
|
||||
|
||||
That’s it. The current installed package will be downgraded to the old version.
|
||||
|
||||
**Also Read:[How To Downgrade All Packages To A Specific Date In Arch Linux][1]**
|
||||
|
||||
##### So, how can avoid broken packages and make Arch Linux more stable?
|
||||
|
||||
Check [**Arch Linux news**][2] and [**forums**][3] before updating Arch Linux to find out if there have been any reported problem. I have been using Arch Linux as my main OS for the past few weeks. Here is some simple tips that I have found over a period of time to avoid installing unstable packages in Arch Linux.
|
||||
|
||||
1. Avoid partial upgrades. It means that never run “pacman -Sy <package-name>”. This command will partially upgrade your system while installing a package. Instead, first use “pacman -Syu” to update the system and then use “package -S <package-name>” to a install package.
|
||||
2. Avoid using “pacman -Syu –force” command. The –force flag will ignore the package and file conflicts and you might end-up with broken packages or broken system.
|
||||
3. Do not skip dependency check. It means that do not use “pacman -Rdd <package-name>”. This command will avoid dependency check while removing a package. If you run this command, a critical dependency which is needed by another important package could be removed too. Eventually, it will break your Arch Linux.
|
||||
4. It is always a good practice to make regular backup of important data and configuration files to avoid any data loss.
|
||||
5. Be careful while installing packages from third party and unofficial repositories like AUR. And do not install packages that are in heavy development.
|
||||
|
||||
|
||||
|
||||
For more details, check the [**Arch Linux maintenance guide**][4].
|
||||
|
||||
I am not an Arch Linux expert, and I am still learning to make it more stable. Please feel free to let me know If you have any tips to make Arch Linux stable and safe in the comment section below. I am all ears.
|
||||
|
||||
Hope this helps. That’s all for now. I will be here again with another interesting article soon. Until then, stay tuned with OSTechNix.
|
||||
|
||||
Cheers!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/downgrade-package-arch-linux/
|
||||
|
||||
作者:[SK][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.ostechnix.com/author/sk/
|
||||
[1]:https://www.ostechnix.com/downgrade-packages-specific-date-arch-linux/
|
||||
[2]:https://www.archlinux.org/news/
|
||||
[3]:https://bbs.archlinux.org/
|
||||
[4]:https://wiki.archlinux.org/index.php/System_maintenance
|
@ -0,0 +1,72 @@
|
||||
Protect your Fedora system against this DHCP flaw
|
||||
======
|
||||

|
||||
|
||||
A critical security vulnerability was discovered and disclosed earlier today in dhcp-client. This DHCP flaw carries a high risk to your system and data, especially if you use untrusted networks such as a WiFi access point you don’t own. Read more here for how to protect your Fedora system.
|
||||
|
||||
Dynamic Host Control Protocol (DHCP) allows your system to get configuration from a network it joins. Your system will make a request for DHCP data, and typically a server such as a router answers. The server provides the necessary data for your system to configure itself. This is how, for instance, your system configures itself properly for networking when it joins a wireless network.
|
||||
|
||||
However, an attacker on the local network may be able to exploit this vulnerability. Using a flaw in a dhcp-client script that runs under NetworkManager, the attacker may be able to run arbitrary commands with root privileges on your system. This DHCP flaw puts your system and your data at high risk. The flaw has been assigned CVE-2018-1111 and has a [Bugzilla tracking bug][1].
|
||||
|
||||
### Guarding against this DHCP flaw
|
||||
|
||||
New dhcp packages contain fixes for Fedora 26, 27, and 28, as well as Rawhide. The maintainers have submitted these updates to the updates-testing repositories. They should show up in stable repos within a day or so of this post for most users. The desired packages are:
|
||||
|
||||
* Fedora 26: dhcp-4.3.5-11.fc26
|
||||
* Fedora 27: dhcp-4.3.6-10.fc27
|
||||
* Fedora 28: dhcp-4.3.6-20.fc28
|
||||
* Rawhide: dhcp-4.3.6-21.fc29
|
||||
|
||||
|
||||
|
||||
#### Updating a stable Fedora system
|
||||
|
||||
To update immediately on a stable Fedora release, use this command [with sudo][2]. Type your password at the prompt, if necessary:
|
||||
```
|
||||
sudo dnf --refresh --enablerepo=updates-testing update dhcp-client
|
||||
|
||||
```
|
||||
|
||||
Later, use the standard stable repos to update. To update your Fedora system from the stable repos, use this command:
|
||||
```
|
||||
sudo dnf --refresh update dhcp-client
|
||||
|
||||
```
|
||||
|
||||
#### Updating a Rawhide system
|
||||
|
||||
If your system is on Rawhide, use these commands to download and update the packages immediately:
|
||||
```
|
||||
mkdir dhcp && cd dhcp
|
||||
koji download-build --arch={x86_64,noarch} dhcp-4.3.6-21.fc29
|
||||
sudo dnf update ./dhcp-*.rpm
|
||||
|
||||
```
|
||||
|
||||
After the nightly Rawhide compose, simply run sudo dnf update to get the update.
|
||||
|
||||
### Fedora Atomic Host
|
||||
|
||||
The fixes for Fedora Atomic Host are in ostree version 28.20180515.1. To get the update, run this command:
|
||||
```
|
||||
atomic host upgrade -r
|
||||
|
||||
```
|
||||
|
||||
This command reboots your system to apply the upgrade.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/protect-fedora-system-dhcp-flaw/
|
||||
|
||||
作者:[Paul W. Frields][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者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/pfrields/
|
||||
[1]:https://bugzilla.redhat.com/show_bug.cgi?id=1567974
|
||||
[2]:https://fedoramagazine.org/howto-use-sudo/
|
@ -0,0 +1,81 @@
|
||||
Termux turns Android into a Linux development environment
|
||||
======
|
||||
|
||||

|
||||
So you finally figured out how to exit Vim and you can write the most highly optimized version of "Hello World" this side of the Mississippi. Now it's time to up your game! Check out [Termux][1] for Android.
|
||||
|
||||
### What is Termux?
|
||||
|
||||
Termux is an Android terminal emulator and Linux environment. What that means in practice is that you can install Termux on most Android devices and do almost anything you would do in a full Linux development environment on that device. That all sounds cool, but you're probably asking yourself, "why would I want to code on my phone on a touch screen? That just sounds awful." Start thinking more along the lines of tablets paired with a keyboards or Chromebooks that can now run Android applications. These are very cheap devices that can now be used to introduce people to Linux hacking and development. I know many of us in the Linux community started out by installing Linux on an old PC.
|
||||
|
||||
Tablets and Chromebooks are this generation's old, junky computers. And there are plenty to go around. Why not use them to introduce the next generation to Linux? And since Termux can be installed with a click in the [Google Play Store][2] , I would argue Termux is the easiest way to introduce anyone to Linux. But don't leave all the fun for the noobs. Termux can accommodate many of your needs for a Linux development environment.
|
||||
|
||||
Termux is Linux, but it is based on Android and runs in a container. That means you can install it with no root access required—but it also means it may take some getting used to. In this article, I'll outline some tips and tricks I found to get Termux working as a full-time development environment.
|
||||
|
||||
### Where's all my stuff?
|
||||
|
||||
The base of the Termux filesystem that you can see starts around `/data/data/com.termux/files/`. Under that directory, you'll find your home directory and the `usr` directory, where all the Linux packages are installed. This is kind of weird, but no big deal right? You would be wrong, because almost every script on the planet is hard coded for `/bin/bash`. Other libraries, executables, and configuration files are in places inconsistent with other Linux distributions.
|
||||
|
||||
Termux provides lots of [packages][3] that have been modified to run correctly. Try looking there first instead of doing a custom build. However, you will still probably need to custom-build many things. You can try modifying your package's source code, and even though changing paths is easy, it gets old quick. Thankfully Termux also comes bundled with [termux-exec][4]. Termux-exec will redirect script paths on the fly to get them to work correctly.
|
||||
|
||||
You may still run into some hard-coded paths that termux-exec doesn't handle. Since you don't have root access in Termux, you can't just create a symlink to fix path issues. However, you can create a [chroot jail][5]. Using the [PRoot][6] package, you can create a chroot that you have full control over and allows you to modify anything you want. You can also make chroots of different Linux distributions. If you are a Fedora fan, you can use Termux and run it in a chroot jail. Check out the [PRoot page][6] for more distros and installation details, or you can use [this script][7] to make a Termux chroot jail. I've only tried the Termux chroot and the Ubuntu chroot. The Ubuntu chroot had some issues that needed to be worked around, so your mileage may vary depending on the version of Linux you choose.
|
||||
|
||||
### One user to rule them all
|
||||
|
||||
In Termux, everything is installed and run under one user. This isn't so much a problem, rather something you need to get used to. This also means the typical services and user groups you might be familiar with are nowhere to be found. And nothing auto-starts on boot, so it's up to you to manage the start and stop of services you might use, like databases, SSH, etc. Also remember, your one user can't modify the base system, so you will need to use a chroot if you need to do that. Since you don't have nice, preset start scripts, you will probably have to come up with some of your own.
|
||||
|
||||
For everyday development, I needed Postgres, Nginx, and Redis. I'd never started these services manually before; normally they start and stop for me automatically, and I had to do a little digging to find out how to start my favorite services. Here is a sample of the three services I just mentioned. Hopefully, these examples will point you in the right direction to use your favorite service. You can also look at a package's documentation to find information on how to start and stop it.
|
||||
|
||||
#### Postgres
|
||||
|
||||
Start: `pg_ctl -D $PREFIX/var/lib/postgresql start`
|
||||
Stop: `pg_ctl -D $PREFIX/var/lib/postgresql stop`
|
||||
|
||||
#### Nginx
|
||||
|
||||
Start: `nginx`
|
||||
Stop: `nginx -s stop`
|
||||
|
||||
#### Redis
|
||||
|
||||
Start: `redis-server $PREFIX/etc/redis.conf`
|
||||
Stop: `kill "$("$PREFIX/bin/applets/cat" "$PREFIX/var/run/redis_6379.pid"`
|
||||
|
||||
### Broken dependencies
|
||||
|
||||
Android is built differently than other versions of Linux, and its kernel and libraries don't always match those in typical Linux software. You can see the [common porting problems][8] when trying to build software in Termux. You can work around most of them, but it may be too much effort to fix every dependency in your software.
|
||||
|
||||
For example, the biggest problem I ran into as a Python developer is by the Android kernel not supporting semaphores. The multi-processing library in Python depends on this functionality, and fixing this on my own was too difficult. Instead, I hacked around it by using a different deployment mechanism. Before I was using [uWSGI][9] to run my Python web services, so I switched to [Gunicorn][10]. This allowed me to route around using the standard Python multi-processing library. You may have to get a little creative to find alternative software dependencies when switching to Termux, but your list will probably be very small.
|
||||
|
||||
### Everyday Termux
|
||||
|
||||
When using Termux on a daily basis, you'll want to learn its [touch screen][11] or [hardware keyboard][12] shortcuts. You'll also need a text editor or IDE for coding. All the likely console-based editors are available through a quick package install: Vim, Emacs, and Nano. Termux is only console-based, so you won't be able to install any editors based on a graphical interface. I wanted to make sure Termux had a great IDE to go along with it, so I built the web-based Neutron64 editor to interface seamlessly with Termux. Just go to [Neutron64.com][13] and install [Neutron Beam][14] on Termux to start coding.
|
||||
|
||||
Check out [Termux][1] and turn your old Android devices into development powerhouses. Happy coding!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/5/termux
|
||||
|
||||
作者:[Paul Bailey][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者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/pizzapanther
|
||||
[1]:https://termux.com/
|
||||
[2]:https://play.google.com/store/apps/details?id=com.termux&hl=en_US
|
||||
[3]:https://termux.com/package-management.html
|
||||
[4]:https://wiki.termux.com/wiki/Termux-exec
|
||||
[5]:https://en.wikipedia.org/wiki/Chroot
|
||||
[6]:https://wiki.termux.com/wiki/PRoot
|
||||
[7]:https://github.com/Neo-Oli/chrooted-termux
|
||||
[8]:https://github.com/termux/termux-packages/blob/master/README.md#common-porting-problems
|
||||
[9]:https://uwsgi-docs.readthedocs.io/en/latest/
|
||||
[10]:http://gunicorn.org/
|
||||
[11]:https://termux.com/touch-keyboard.html
|
||||
[12]:https://termux.com/hardware-keyboard.html
|
||||
[13]:https://www.neutron64.com/
|
||||
[14]:https://www.neutron64.com/help/neutron-beam
|
169
sources/tech/20180516 A guide to Git branching.md
Normal file
169
sources/tech/20180516 A guide to Git branching.md
Normal file
@ -0,0 +1,169 @@
|
||||
A guide to Git branching
|
||||
======
|
||||
|
||||

|
||||
In my two previous articles in this series, we [started using Git][1] and learned how to [clone, modify, add, and delete][2] Git files. In this third installment, we'll explore Git branching and why and how it is used.
|
||||
|
||||
![tree branches][3]
|
||||
|
||||
Picture this tree as a Git repository. It has a lot of branches, long and short, stemming from the trunk and stemming from other branches. Let's say the tree's trunk represents a master branch of our repo. I will use `master` in this article as an alias for "master branch"—i.e., the central or first branch of a repo. To simplify things, let's assume that the `master` is a tree trunk and the other branches start from it.
|
||||
|
||||
### Why we need branches in a Git repo
|
||||
|
||||
* If you are creating a new feature for your project, there's a reasonable chance that adding it could break your working code. This would be very bad for active users of your project. It's better to start with a prototype, which you would want to design roughly in a different branch and see how it works, before you decide whether to add the feature to the repo's `master` for others to use.
|
||||
* Another, probably more important, reason is [Git was made][4] for collaboration. If everyone starts programming on top of your repo's `master` branch, it will cause a lot of confusion. Everyone has different knowledge and experience (in the programming language and/or the project); some people may write faulty/buggy code or simply the kind of code/feature you may not want in your project. Using branches allows you to verify contributions and select which to add to the project. (This assumes you are the only owner of the repo and want full control of what code is added to it. In real-life projects, there are multiple owners with the rights to merge code in a repo.)
|
||||
|
||||
|
||||
|
||||
### Adding a branch
|
||||
|
||||
The main reasons for having branches are:
|
||||
|
||||
Let's go back to the [previous article in this series][2] and see what branching in our Demo directory looks like. If you haven't yet done so, follow the instructions in that article to clone the repo from GitHub and navigate to Demo. Run the following commands:
|
||||
```
|
||||
pwd
|
||||
|
||||
git branch
|
||||
|
||||
ls -la
|
||||
|
||||
```
|
||||
|
||||
The `pwd` command (which stands for present working directory) reports which directory you're in (so you can check that you're in Demo), `git branch` lists all the branches on your computer in the Demo repository, and `ls -la` lists all the files in the PWD. Now your terminal will look like this:
|
||||
|
||||
![Terminal output][5]
|
||||
|
||||
There's only one file, `README.md`, on the branch master. (Kindly ignore the other directories and files listed.)
|
||||
|
||||
Next, run the following commands:
|
||||
```
|
||||
git status
|
||||
|
||||
git checkout -b myBranch
|
||||
|
||||
git status
|
||||
|
||||
```
|
||||
|
||||
The first command, `git status` reports you are currently on `branch master`, and (as you can see in the terminal screenshot below) it is up to date with `origin/master`, which means all the files you have on your local copy of the branch master are also present on GitHub. There is no difference between the two copies. All commits are identical on both the copies as well.
|
||||
|
||||
The next command, `git checkout -b myBranch`, `-b` tells Git to create a new branch and name it `myBranch`, and `checkout` switches us to the newly created branch. Enter the third line, `git status`, to verify you are on the new branch you just created.
|
||||
|
||||
As you can see below, `git status` reports you are on branch `myBranch` and there is nothing to commit. This is because there is neither a new file nor any modification in existing files.
|
||||
|
||||
![Terminal output][6]
|
||||
|
||||
If you want to see a visual representation of branches, run the command `gitk`. If the computer complains `bash: gitk: command not found…`, then install `gitk`. (See documentation for your operating system for the install instructions.)
|
||||
|
||||
The image below reports what we've done in Demo: Your last commit was `Delete file.txt` and there were three commits before that. The current commit is noted with a yellow dot, previous commits with blue dots, and the three boxes between the yellow dot and `Delete file.txt` tell you where each branch is (i.e., what is the last commit on each branch). Since you just created `myBranch`, it is on the same commit as `master` and the remote counterpart of `master`, namely `remotes/origin/master`. (A big thanks to [Peter Savage][7] from Red Hat who made me aware of `gitk`.)
|
||||
|
||||
![Gitk output][8]
|
||||
|
||||
Now let's create a new file on our branch `myBranch` and let's observe terminal output. **** Run the following commands:
|
||||
```
|
||||
echo "Creating a newFile on myBranch" > newFile
|
||||
|
||||
cat newFile
|
||||
|
||||
git status
|
||||
|
||||
```
|
||||
|
||||
The first command, `echo`, creates a file named `newFile`, and `cat newFile` shows what is written in it. `git status` tells you the current status of our branch `myBranch`. In the terminal screenshot below, Git reports there is a file called `newFile` on `myBranch` and `newFile` is currently `untracked`. That means Git has not been told to track any changes that happen to `newFile`.
|
||||
|
||||
![Terminal output][9]
|
||||
|
||||
The next step is to add, commit, and push `newFile` to `myBranch` (go back to the last article in this series for more details).
|
||||
```
|
||||
git add newFile
|
||||
|
||||
git commit -m "Adding newFile to myBranch"
|
||||
|
||||
git push origin myBranch
|
||||
|
||||
```
|
||||
|
||||
In these commands, the branch in the `push` command is `myBranch` instead of `master`. Git is taking `newFile`, pushing it to your Demo repository in GitHub, and telling you it's created a new branch on GitHub that is identical to your local copy of `myBranch`. The terminal screenshot below details the run of commands and its output.
|
||||
|
||||
![Terminal output][10]
|
||||
|
||||
If you go to GitHub, you can see there are two branches to pick from in the branch drop-down.
|
||||
|
||||
![GitHub][11]
|
||||
|
||||
Switch to `myBranch` by clicking on it, and you can see the file you added on that branch.
|
||||
|
||||
![GitHub][12]
|
||||
|
||||
Now there are two different branches; one, `master`, has a single file, `README.md`, and the other, `myBranch`, has two files.
|
||||
|
||||
Now that you know how to create a branch, let's create another branch. Enter the following commands:
|
||||
```
|
||||
git checkout master
|
||||
|
||||
git checkout -b myBranch2
|
||||
|
||||
touch newFile2
|
||||
|
||||
git add newFile2
|
||||
|
||||
git commit -m "Adding newFile2 to myBranch2"
|
||||
|
||||
git push origin myBranch2
|
||||
|
||||
```
|
||||
|
||||
I won't show this terminal output as I want you to try it yourself, but you are more than welcome to check out the [repository on GitHub][13].
|
||||
|
||||
### Deleting a branch
|
||||
|
||||
Since we've added two branches, let's delete one of them (`myBranch`) using a two-step process.
|
||||
|
||||
**1\. Delete the local copy of your branch:** Since you can't delete a branch you're on, switch to the `master` branch (or another one you plan to keep) by running the commands shown in the terminal image below:
|
||||
|
||||
`git branch` lists the available branches; `checkout` changes to the `master` branch and `git branch -D myBranch` removes that branch. Run `git branch` again to verify there are now only two branches (instead of three).
|
||||
|
||||
**2\. Delete the branch from GitHub:** Delete the remote copy of `myBranch` by running the following command:
|
||||
```
|
||||
git push origin :myBranch
|
||||
|
||||
```
|
||||
|
||||
![Terminal output][14]
|
||||
|
||||
The colon (`:`) before the branch name in the `push` command tells GitHub to delete the branch. Another option is:
|
||||
```
|
||||
git push -d origin myBranch
|
||||
|
||||
```
|
||||
|
||||
as `-d` (or `--delete`) also tells GitHub to remove your branch.
|
||||
|
||||
Now that we've learned about using Git branches, in the next article in this series we'll look at how to fetch and rebase branch operations. These are essential things to know when you are working on a project with multiple contributors.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/5/git-branching
|
||||
|
||||
作者:[Kedar Vijay Kulkarni][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者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/kkulkarn
|
||||
[1]:https://opensource.com/article/18/1/step-step-guide-git
|
||||
[2]:https://opensource.com/article/18/2/how-clone-modify-add-delete-git-files
|
||||
[3]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/tree-branches.jpg?itok=bQGpa5Uc (tree branches)
|
||||
[4]:https://en.wikipedia.org/wiki/Git
|
||||
[5]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/gitbranching_terminal1.png?itok=ZcAzRdlR (Terminal output)
|
||||
[6]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/gitbranching_terminal2.png?itok=nIcfy2Vh (Terminal output)
|
||||
[7]:https://opensource.com/users/psav
|
||||
[8]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/gitbranching_commit3.png?itok=GoP51yE4 (Gitk output)
|
||||
[9]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/gitbranching_terminal4.png?itok=HThID5aU (Terminal output)
|
||||
[10]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/gitbranching_terminal5.png?itok=rHVdrJ0m (Terminal output)
|
||||
[11]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/gitbranching_github6.png?itok=EyaKfCg2 (GitHub)
|
||||
[12]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/gitbranching_github7.png?itok=0ZSu0W2P (GitHub)
|
||||
[13]:https://github.com/kedark3/Demo/tree/myBranch2
|
||||
[14]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/u128651/gitbranching_terminal9.png?itok=B0vaRkyI (Terminal output)
|
182
sources/tech/20180516 Manipulating Directories in Linux.md
Normal file
182
sources/tech/20180516 Manipulating Directories in Linux.md
Normal file
@ -0,0 +1,182 @@
|
||||
Manipulating Directories in Linux
|
||||
======
|
||||
|
||||

|
||||
|
||||
If you are new to this series (and to Linux), [take a look at our first installment][1]. In that article, we worked our way through the tree-like structure of the Linux filesystem, or more precisely, the File Hierarchy Standard. I recommend reading through it to make sure you understand what you can and cannot safely touch. Because this time around, I’ll show how to get all touchy-feely with your directories.
|
||||
|
||||
### Making Directories
|
||||
|
||||
Let's get creative before getting destructive, though. To begin, open a terminal window and use `mkdir` to create a new directory like this:
|
||||
```
|
||||
mkdir <directoryname>
|
||||
|
||||
```
|
||||
|
||||
If you just put the directory name, the directory will appear hanging off the directory you are currently in. If you just opened a terminal, that will be your home directory. In a case like this, we say the directory will be created _relative_ to your current position:
|
||||
```
|
||||
$ pwd #This tells you where you are now -- see our first tutorial
|
||||
/home/<username>
|
||||
$ mkdir newdirectory #Creates /home/<username>/newdirectory
|
||||
|
||||
```
|
||||
|
||||
(Note that you do not have to type the text following the `#`. Text following the pound symbol `#` is considered a comment and is used to explain what is going on. It is ignored by the shell).
|
||||
|
||||
You can create a directory within an existing directory hanging off your current location by specifying it in the command line:
|
||||
```
|
||||
mkdir Documents/Letters
|
||||
|
||||
```
|
||||
|
||||
Will create the _Letters_ directory within the _Documents_ directory.
|
||||
|
||||
You can also create a directory above where you are by using `..` in the path. Say you move into the _Documents/Letters/_ directory you just created and you want to create a _Documents/Memos/_ directory. You can do:
|
||||
```
|
||||
cd Documents/Letters # Move into your recently created Letters/ directory
|
||||
mkdir ../Memos
|
||||
|
||||
```
|
||||
|
||||
Again, all of the above is done relative to you current position. This is called using a _relative path_.
|
||||
|
||||
You can also use an _absolute path_ to directories: This means telling `mkdir` where to put your directory in relation to the root (`/`) directory:
|
||||
```
|
||||
mkdir /home/<username>/Documents/Letters
|
||||
|
||||
```
|
||||
|
||||
Change `<username>` to your user name in the command above and it will be equivalent to executing `mkdir Documents/Letters` from your home directory, except that it will work from wherever you are located in the directory tree.
|
||||
|
||||
As a side note, regardless of whether you use a relative or an absolute path, if the command is successful, `mkdir` will create the directory silently, without any apparent feedback whatsoever. Only if there is some sort of trouble will `mkdir` print some feedback after you hit _[Enter]_.
|
||||
|
||||
As with most other command-line tools, `mkdir` comes with several interesting options. The `-p` option is particularly useful, as it lets you create directories within directories within directories, even if none exist. To create, for example, a directory for letters to your Mom within _Documents/_ , you could do:
|
||||
```
|
||||
mkdir -p Documents/Letters/Family/Mom
|
||||
|
||||
```
|
||||
|
||||
And `mkdir` will create the whole branch of directories above _Mom/_ and also the directory _Mom/_ for you, regardless of whether any of the parent directories existed before you issued the command.
|
||||
|
||||
You can also create several folders all at once by putting them one after another, separated by spaces:
|
||||
```
|
||||
mkdir Letters Memos Reports
|
||||
|
||||
```
|
||||
|
||||
will create the directories _Letters/_ , _Memos/_ and _Reports_ under the current directory.
|
||||
|
||||
### In space nobody can hear you scream
|
||||
|
||||
... Which brings us to the tricky question of spaces in directory names. Can you use spaces in directory names? Yes, you can. Is it advised you use spaces? No, absolutely not. Spaces make everything more complicated and, potentially, dangerous.
|
||||
|
||||
Say you want to create a directory called _letters mom/_. If you didn't know any better, you could type:
|
||||
```
|
||||
mkdir letters mom
|
||||
|
||||
```
|
||||
|
||||
But this is WRONG! WRONG! WRONG! As we saw above, this will create two directories, _letters/_ and _mom/_ , but not _letters mom/_.
|
||||
|
||||
Agreed that this is a minor annoyance: all you have to do is delete the two directories and start over. No big deal.
|
||||
|
||||
But, wait! Deleting directories is where things get dangerous. Imagine you did create _letters mom/_ using a graphical tool, like, say [Dolphin][2] or [Nautilus][3]. If you suddenly decide to delete _letters mom/_ from a terminal, and you have another directory just called _letters/_ under the same directory, and said directory is full of important documents, and you tried this:
|
||||
```
|
||||
rmdir letters mom
|
||||
|
||||
```
|
||||
|
||||
You would risk removing _letters/_. I say "risk" because fortunately `rmdir`, the instruction used to remove directories, has a built in safeguard and will warn you if you try to delete a non-empty directory.
|
||||
|
||||
However, this:
|
||||
```
|
||||
rm -Rf letters mom
|
||||
|
||||
```
|
||||
|
||||
(and this is a pretty standard way of getting rid of directories and their contents) will completely obliterate _letters/_ and will never even tell you what just happened.
|
||||
|
||||
The `rm` command is used to delete files and directories. When you use it with the options `-R` (delete _recursively_ ) and `-f` ( _force_ deletion), it will burrow down into a directory and its subdirectories, deleting all the files they contain, then deleting the subdirectories themselves, then it will delete all the files in the top directory and then the directory itself.
|
||||
|
||||
`rm -Rf` is an instruction you must handle with extreme care.
|
||||
|
||||
My advice is, instead of spaces, use underscores (`_`), but if you still insist on spaces, there are two ways of getting them to work. You can use single or double quotes (`'` or `"`) like so:
|
||||
```
|
||||
mkdir 'letters mom'
|
||||
mkdir "letters dad"
|
||||
|
||||
```
|
||||
|
||||
Or, you can _escape_ the spaces. Some characters have a special meaning for the shell. Spaces, as you have seen, are used to separate options and arguments on the command line. "Separating options and arguments" falls under the category of "special meaning". When you want the shell to ignore the special meaning of a character, you need to _escape_ it and to escape a character, you put a backslash (`\`) in front of it:
|
||||
```
|
||||
mkdir letters\ mom
|
||||
mkdir letter\ dad
|
||||
|
||||
```
|
||||
|
||||
There are other special characters that would need escaping, like the apostrophe or single quote (`'`), double quotes (`"`), and the ampersand (`&`):
|
||||
```
|
||||
mkdir mom\ \&\ dad\'s\ letters
|
||||
|
||||
```
|
||||
|
||||
I know what you're thinking: If the backslash has a special meaning (to wit, telling the shell it has to escape the next character), that makes it a special character, too. Then, how would you escape the escape character which is `\`?
|
||||
|
||||
Turns out, the exact way you escape any other special character:
|
||||
```
|
||||
mkdir special\\characters
|
||||
|
||||
```
|
||||
|
||||
will produce a directory called _special\characters_.
|
||||
|
||||
Confusing? Of course. That's why you should avoid using special characters, including spaces, in directory names.
|
||||
|
||||
For the record, here is a list of special characters you can refer to just in case.
|
||||
|
||||
### Things to Remember
|
||||
|
||||
* Use `mkdir <directory name>` to create a new directory.
|
||||
* Use `rmdir <directory name>` to delete a directory (only works if it is empty).
|
||||
* Use `rm -Rf <directory name>` to annihilate a directory -- use with extreme caution.
|
||||
* Use a relative path to create directories relative to your current directory: `mkdir newdir.`.
|
||||
* Use an absolute path to create directories relative to the root directory (`/`): `mkdir /home/<username>/newdir`
|
||||
* Use `..` to create a directory in the directory above the current directory: `mkdir ../newdir`
|
||||
* You can create several directories all in one go by separating them with spaces on the command line: `mkdir onedir twodir threedir`
|
||||
* You can mix and mash relative and absolute paths when creating several directories simultaneously: `mkdir onedir twodir /home/<username>/threedir`
|
||||
* Using spaces and special characters in directory names guarantees plenty of headaches and heartburn. Don't do it.
|
||||
|
||||
|
||||
|
||||
For more information, you can look up the manuals of `mkdir`, `rmdir` and `rm`:
|
||||
```
|
||||
man mkdir
|
||||
man rmdir
|
||||
man rm
|
||||
|
||||
```
|
||||
|
||||
To exit the man pages, press _[q]_.
|
||||
|
||||
### Next Time
|
||||
|
||||
In the next installment, you'll learn about creating, modifying, and erasing files, as well as everything you need to know about permissions and privileges. See you then!
|
||||
|
||||
Learn more about Linux through the free ["Introduction to Linux" ][4]course from The Linux Foundation and edX.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux
|
||||
|
||||
作者:[Paul Brown][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.linux.com/users/bro66
|
||||
[1]:https://www.linux.com/blog/learn/intro-to-linux/2018/4/linux-filesystem-explained
|
||||
[2]:https://userbase.kde.org/Dolphin
|
||||
[3]:https://projects-old.gnome.org/nautilus/screenshots.html
|
||||
[4]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
|
@ -1,37 +0,0 @@
|
||||
使用 AppImageLauncher 轻松运行和集成 AppImage 文件
|
||||
======
|
||||
你有没有下载过 AppImage 文件,而你不知道如何使用它?或者你可能知道如何使用它,但是你每次要运行它时必须要进入到下载 .AppImage 的文件夹中,或者手动为其创建启动程序。
|
||||
|
||||
使用 AppImageLauncher,这些就都是过去的问题。该程序可让你**轻松运行 AppImage 文件,而无需使其可执行**。但它最有趣的特点是可以轻松地将 AppImage 与你的系统进行整合:**AppImageLauncher 可以自动将 AppImage 程序快捷方式添加到桌面环境的程序启动器/菜单(包括程序图标和合适的说明)中**。
|
||||
|
||||
在不手动下载 Kdenline AppImage 可执行文件的情况下,我第一次双击它(安装了 AppImageLauncher)时,AppImageLauncher 提供了两个选项:
|
||||
|
||||
`运行一次`或者`集成并运行`。
|
||||
|
||||
点击 Integrate 并运行,AppImage 被复制到 `~/.bin/` (家目录中的隐藏文件夹)并添加到菜单中,然后启动该程序。
|
||||
|
||||
**删除它也很简单**,只要您使用的桌面环境支持桌面动作就行。例如,在 Gnome Shell 中,只需**右键单击活动概览中的应用程序图标,然后选择**`从系统中删除`:
|
||||
|
||||
AppImageLauncher GitHub 页面显示,因为它与系统深度集成,该程序目前仅支持基于 Debian 的系统(这包括 Ubuntu 和 Linux Mint)。目前,该程序正处于频繁开发阶段,开发人员已经发了关于 RPM 包的问题,因此在不久的将来可能会添加 Fedora/openSUSE 支持。
|
||||
|
||||
### 下载 AppImageLauncher
|
||||
|
||||
AppImageLauncher 下载页提供 Debian、Ubuntu 或 Linux Mint(64位)的 64 位 AppImage 二进制文件。源码也有。
|
||||
|
||||
[下载 AppImageLauncher][1]
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxuprising.com/2018/04/easily-run-and-integrate-appimage-files.html
|
||||
|
||||
作者:[Logix][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/118280394805678839070
|
||||
[1]:https://github.com/TheAssassin/AppImageLauncher/releases
|
||||
[2]:https://kdenlive.org/download/
|
Loading…
Reference in New Issue
Block a user