Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu.Wang 2019-02-19 10:05:50 +08:00
commit 2515fac1ef
11 changed files with 1035 additions and 144 deletions

View File

@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-10550-1.html)
[#]: subject: (Installing Kali Linux on VirtualBox: Quickest & Safest Way)
[#]: via: (https://itsfoss.com/install-kali-linux-virtualbox)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
@ -10,11 +10,11 @@
在 VirtualBox 上安装 Kali Linux 的最安全快捷的方式
======
> 本教程将向你展示如何以最快的方式在 Windows 和 Linux 上的 VirtualBox 上安装 Kali Linux。
> 本教程将向你展示如何以最快的方式在运行于 Windows 和 Linux 上的 VirtualBox 上安装 Kali Linux。
[Kali Linux][1] 是最好的[黑客][2] 和安全爱好者的 Linux 发行版之一。
由于它涉及像黑客这样的敏感话题,它就像一把双刃剑。我们过去在一篇详细的 Kali Linux 点评中对此进行了讨论,所以我不会再次赘述。
由于它涉及像黑客这样的敏感话题,它就像一把双刃剑。我们过去在一篇详细的 [Kali Linux 点评](https://linux.cn/article-10198-1.html)中对此进行了讨论,所以我不会再次赘述。
虽然你可以通过替换现有的操作系统来安装 Kali Linux但通过虚拟机使用它将是一个更好、更安全的选择。
@ -36,11 +36,11 @@
而且,最好的是,即使你碰巧使用 Linux 发行版作为主要操作系统,相同的步骤也完全适用!
想知道怎么样做吗? 让我们来看看…
想知道怎么样做吗?让我们来看看…
### 在 VirtualBox 上安装 Kali Linux 的逐步指导
我们将使用专为 VirtualBox 制作的定制 Kali Linux 镜像。当然,你还可以下载 Kali Linux 的 ISO 文件并创建一个新的虚拟机,但是为什么在你有一个简单的替代方案时这样做呢?
我们将使用专为 VirtualBox 制作的定制 Kali Linux 镜像。当然,你还可以下载 Kali Linux 的 ISO 文件并创建一个新的虚拟机,但是为什么在你有一个简单的替代方案时还要这样做呢?
#### 1、下载并安装 VirtualBox
@ -48,7 +48,7 @@
- [下载 VirtualBox](https://www.virtualbox.org/wiki/Downloads)
下载了安装程序后,只需双击它即可安装 VirtualBox。 在 Ubuntu / Fedora Linux 上安装 VirtualBox 也是一样的。
下载了安装程序后,只需双击它即可安装 VirtualBox。在 Ubuntu / Fedora Linux 上安装 VirtualBox 也是一样的。
#### 2、下载就绪的 Kali Linux 虚拟镜像
@ -64,7 +64,7 @@ VirtualBox 成功安装后,前往 [Offensive Security 的下载页面][5] 下
以下是如何导入 Kali Linux 的 VirtualBox 镜像:
**步骤 1**:启动 VirtualBox。你会注意到有一个 “Import”点击它。
**步骤 1**:启动 VirtualBox。你会注意到有一个 “Import” 按钮,点击它。
![virtualbox import][9]
@ -78,7 +78,7 @@ VirtualBox 成功安装后,前往 [Offensive Security 的下载页面][5] 下
选择好之后,点击 “Next” 进行处理。
**步骤 3**:现在,你将看到要导入的这个虚拟机的设置。你可以自定义它们,这是你的自由。如果你使用默认设置,也没关系。
**步骤 3**:现在,你将看到要导入的这个虚拟机的设置。你可以自定义它们,这是你的自由。如果你使用默认设置,也没关系。
你需要选择具有足够存储空间的路径。我永远不会在 Windows 上推荐使用 C驱动器。
@ -86,11 +86,11 @@ VirtualBox 成功安装后,前往 [Offensive Security 的下载页面][5] 下
*以 VDI 方式导入硬盘驱动器*
这里, VDI 方式的硬盘驱动器是指通过分配存储空间集来虚拟安装硬盘驱动器。
这里,VDI 方式的硬盘驱动器是指通过分配其存储空间设置来实际挂载该硬盘驱动器。
完成设置后,点击 “Import” 并等待一段时间。
**步骤 4**:你现在将看到这个虚拟机已经列出了。 所以只需点击“Start”即可启动它。
**步骤 4**:你现在将看到这个虚拟机已经列出了。所以,只需点击 “Start” 即可启动它。
你最初可能会因 USB 端口 2.0 控制器支持而出现错误,你可以将其禁用以解决此问题,或者只需按照屏幕上的说明安装其他软件包进行修复即可。现在就完成了!
@ -98,21 +98,21 @@ VirtualBox 成功安装后,前往 [Offensive Security 的下载页面][5] 下
*运行于 VirtualBox 中的 Kali Linux*
我希望本指南可以帮助你在 VirtualBox 上轻松安装 Kali Linux。当然Kali Linux 有很多有用的工具可用于渗透测试 - 祝你好运!
我希望本指南可以帮助你在 VirtualBox 上轻松安装 Kali Linux。当然Kali Linux 有很多有用的工具可用于渗透测试 —— 祝你好运!
**提示**Kali Linux 和 Ubuntu 都是基于 Debian 的。如果你在使用 Kali Linux 时遇到任何问题或错误,可以按照互联网上针对 Ubuntu 或 Debian 的教程进行操作。
### 赠品:免费的 Kali Linux 指南手册
如果你刚刚开始使用 Kali Linux那么了解如何使用 Kali Linux 是一个好主意。
如果你刚刚开始使用 Kali Linux那么了解如何使用 Kali Linux 是一个好主意。
Kali Linux 背后的公司 Offensive Security 已经创建了一本指南,介绍了 Linux 的基础知识Kali Linux 的基础知识、配置和设置。它还有一些关于渗透测试和安全工具的章节。
基本上,它拥有你开始使用 Kali Linux 所需知道的一切。最棒的是这本书可以免费下载。
基本上,它拥有你开始使用 Kali Linux 所需知道的一切。最棒的是这本书可以免费下载。
- [免费下载 Kali Linux 揭秘](https://kali.training/downloads/Kali-Linux-Revealed-1st-edition.pdf)
如果你遇到问题或想分享 VirtualBox 上运行 Kali Linux 的经验,请在下面的评论中告诉我们。
如果你遇到问题或想分享 VirtualBox 上运行 Kali Linux 的经验,请在下面的评论中告诉我们。
--------------------------------------------------------------------------------
@ -121,7 +121,7 @@ via: https://itsfoss.com/install-kali-linux-virtualbox
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (dianbanjiu )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: translator: (dianbanjiu)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-10549-1.html)
[#]: subject: (10 Methods To Create A File In Linux)
[#]: via: (https://www.2daygeek.com/linux-command-to-create-a-file/)
[#]: author: (Vinoth Kumar https://www.2daygeek.com/author/vinoth/)
@ -10,47 +10,36 @@
在 Linux 上创建文件的 10 个方法
======
我们都知道,在 Linux 上,包括设备在内的一切都是文件。
我们都知道,在 Linux 上,包括设备在内的一切都是文件。Linux 管理员每天应该会多次执行文件创建活动(可能是 20 次50 次,甚至是更多,这依赖于他们的环境)。如果你想 [在Linux上创建一个特定大小的文件][1],查看前面的这个链接。
Linux 管理员每天应该会多次执行文件创建活动(可能是 20 次50 次,甚至是更多,这依赖于他们的环境)。
高效创建一个文件是非常重要的能力。为什么我说高效?如果你了解一些高效进行你当前活动的方式,你就可以事半功倍。这将会节省你很多的时间。你可以把这些有用的时间用到到其他重要的事情上。
如果你想 **[在Linux上创建一个特定大小的文件][1]**,查看前面的这个链接。
高效创建一个文件是非常重要的。为什么我说高效?如果你了解一些高效进行你当前活动的方式,你就可以事半功倍。
这将会节省你很多的时间。你可以把这些有用的时间用到到其他重要的事情上。
我下面将会介绍多个在 Linux 上创建文件的方法。我建议你选择几个简单高效的来辅助你的工作。
你不必安装下列的任何一个命令,因为它们已经作为 Linux 核心工具的一部分安装到你的系统上了。
我下面将会介绍多个在 Linux 上创建文件的方法。我建议你选择几个简单高效的来辅助你的工作。你不必安装下列的任何一个命令,因为它们已经作为 Linux 核心工具的一部分安装到你的系统上了。
创建文件可以通过以下六个方式来完成。
* **`重定向符号 (>):`** 标准重定向符允许我们创建一个 0KB 的空文件。
* **`touch:`** 如果文件不存在的话touch 命令将会创建一个 0KB 的空文件。
* **`echo:`** echo 命令通过一个参数显示文本的某行。
* **`printf:`** printf 命令用于显示在终端给定的文本。
* **`cat:`** 它串联并打印文件到标准输出。
* **`vi/vim:`** Vim 是一个向上兼容 Vi 的文本编辑器。它常用于编辑各种类型的纯文本。
* **`nano:`** nano 是一个简小且用户友好的编辑器。它复制了 Pico 的外观和优点,而且还是免费的
* **`head:`** head 用于打印一个文件开头的一部分。
* **`tail:`** tail 用于打印一个文件的最后一部分。
* **`truncate:`** truncate 用于缩小或者扩展文件的尺寸到指定大小。
* `>`:标准重定向符允许我们创建一个 0KB 的空文件。
* `touch`:如果文件不存在的话,`touch` 命令将会创建一个 0KB 的空文件。
* `echo`:通过一个参数显示文本的某行。
* `printf`:用于显示在终端给定的文本。
* `cat`:它串联并打印文件到标准输出。
* `vi`/`vim`Vim 是一个向上兼容 Vi 的文本编辑器。它常用于编辑各种类型的纯文本。
* `nano`:是一个简小且用户友好的编辑器。它复制了 `pico` 的外观和优点,但它是自由软件
* `head`用于打印一个文件开头的一部分。
* `tail`用于打印一个文件的最后一部分。
* `truncate`用于缩小或者扩展文件的尺寸到指定大小。
### 在 Linux 上使用重定向符(>>)创建一个文件
### 在 Linux 上使用重定向符(>)创建一个文件
标准重定向符允许我们创建一个 0KB 的空文件。它通常用于重定向一个命令的输出到一个新文件中。在没有命令的情况下使用重定向符号时,它会创建一个文件。
但是它不允许你在创建文件时向其中输入任何文本。然而它对于不是很勤劳的管理员是非常简单有用的。只需要输入重定向符后面跟着你想要的文件名。
(译者注:在输入下面的命令回车后,该命令并不会立刻中断,回车后你其实还可以继续输入一些文本,而这些文本都会被记录到你所创建的文章中去。在输入完成后,你可以使用 Ctrl+C 或者 Ctrl+D 来结束输入)
```
$ > daygeek.txt
```
使用 ls 命令查看刚刚创建的文件。
使用 `ls` 命令查看刚刚创建的文件。
```
$ ls -lh daygeek.txt
@ -59,15 +48,15 @@ $ ls -lh daygeek.txt
### 在 Linux 上使用 touch 命令创建一个文件
touch 命令常用于将每个文件的访问和修改时间更新为当前时间。
`touch` 命令常用于将每个文件的访问和修改时间更新为当前时间。
如果指定的文件名不存在将会创建一个新的文件。touch 不允许我们在创建文件的同时向其中输入一些文本。它默认创建一个 0KB 的空文件。
如果指定的文件名不存在,将会创建一个新的文件。`touch` 不允许我们在创建文件的同时向其中输入一些文本。它默认创建一个 0KB 的空文件。
```
$ touch daygeek1.txt
```
使用 ls 命令查看刚刚创建的文件。
使用 `ls` 命令查看刚刚创建的文件。
```
$ ls -lh daygeek1.txt
@ -76,7 +65,7 @@ $ ls -lh daygeek1.txt
### 在 Linux 上使用 echo 命令创建一个文件
echo 内置于大多数的操作系统中。它常用于脚本批处理文件,以及作为插入文本的单个命令的一部分。
`echo` 内置于大多数的操作系统中。它常用于脚本批处理文件,以及作为插入文本的单个命令的一部分。
它允许你在创建一个文件时就向其中输入一些文本。当然也允许你在之后向其中输入一些文本。
@ -84,27 +73,27 @@ echo 内置于大多数的操作系统中。它常用于脚本,批处理文件
$ echo "2daygeek.com is a best Linux blog to learn Linux" > daygeek2.txt
```
使用 ls 命令查看刚刚创建的文件。
使用 `ls` 命令查看刚刚创建的文件。
```
$ ls -lh daygeek2.txt
-rw-rw-r-- 1 daygeek daygeek 49 Feb 4 02:04 daygeek2.txt
```
可以使用 cat 命令查看文件的内容。
可以使用 `cat` 命令查看文件的内容。
```
$ cat daygeek2.txt
2daygeek.com is a best Linux blog to learn Linux
```
你可以使用两个重定向符 (>>) 添加其他内容到同一个文件。
你可以使用两个重定向符 (`>>`) 添加其他内容到同一个文件。
```
$ echo "It's FIVE years old blog" >> daygeek2.txt
```
你可以使用 cat 命令查看添加的内容。
你可以使用 `cat` 命令查看添加的内容。
```
$ cat daygeek2.txt
@ -113,35 +102,36 @@ It's FIVE years old blog
```
### 在 Linux 上使用 printf 命令创建一个新的文件
printf 命令也可以以类似 echo 的方式执行。
printf 命令常用来显示在终端窗口给出的字符串。printf 可以有格式说明符,转义序列或普通字符。
`printf` 命令也可以以类似 `echo` 的方式执行。
`printf` 命令常用来显示在终端窗口给出的字符串。`printf` 可以有格式说明符、转义序列或普通字符。
```
$ printf "2daygeek.com is a best Linux blog to learn Linux\n" > daygeek3.txt
```
使用 ls 命令查看刚刚创建的文件。
使用 `ls` 命令查看刚刚创建的文件。
```
$ ls -lh daygeek3.txt
-rw-rw-r-- 1 daygeek daygeek 48 Feb 4 02:12 daygeek3.txt
```
使用 cat 命令查看文件的内容。
使用 `cat` 命令查看文件的内容。
```
$ cat daygeek3.txt
2daygeek.com is a best Linux blog to learn Linux
```
你可以使用两个重定向符 (>>) 添加其他的内容到同一个文件中去。
你可以使用两个重定向符 (`>>`) 添加其他的内容到同一个文件中去。
```
$ printf "It's FIVE years old blog\n" >> daygeek3.txt
```
你可以使用 cat 命令查看这个文件中添加的内容。
你可以使用 `cat` 命令查看这个文件中添加的内容。
```
$ cat daygeek3.txt
@ -150,11 +140,10 @@ It's FIVE years old blog
```
### 在 Linux 中使用 cat 创建一个文件
cat 表示串联concatenate。在 Linux 经常用于读取一个文件中的数据。
cat 是在类 Unix 系统中最常使用的命令之一。 它提供了三个与文本文件相关的功能:显示一个文件的内容,组合多个文件的内容到一个输出以及创建一个新的文件。
(译者注:如果 cat 命令后如果不带任何文件的话,下面的命令在回车后也不会立刻结束,回车后的操作同上面的重定向符中的注解)
`cat` 表示<ruby>串联<rt>concatenate</rt></ruby>。在 Linux 经常用于读取一个文件中的数据。
`cat` 是在类 Unix 系统中最常使用的命令之一。它提供了三个与文本文件相关的功能显示一个文件的内容、组合多个文件的内容到一个输出以及创建一个新的文件。LCTT 译注:如果 `cat` 命令后如果不带任何文件的话,下面的命令在回车后也不会立刻结束,回车后的操作可以按 `Ctrl-C``Ctrl-D` 来结束。)
```
$ cat > daygeek4.txt
@ -162,14 +151,14 @@ $ cat > daygeek4.txt
It's FIVE years old blog
```
使用 ls 命令查看创建的文件。
使用 `ls` 命令查看创建的文件。
```
$ ls -lh daygeek4.txt
-rw-rw-r-- 1 daygeek daygeek 74 Feb 4 02:18 daygeek4.txt
```
使用 cat 命令查看文件的内容。
使用 `cat` 命令查看文件的内容。
```
$ cat daygeek4.txt
@ -177,14 +166,14 @@ $ cat daygeek4.txt
It's FIVE years old blog
```
如果你想向同一个文件中添加其他内容,使用两个连接的重定向符(>>)。
如果你想向同一个文件中添加其他内容,使用两个连接的重定向符(`>>`)。
```
$ cat >> daygeek4.txt
This website is maintained by Magesh M, It's licensed under CC BY-NC 4.0.
```
你可以使用 cat 命令查看添加的内容。
你可以使用 `cat` 命令查看添加的内容。
```
$ cat daygeek4.txt
@ -194,9 +183,10 @@ This website is maintained by Magesh M, It's licensed under CC BY-NC 4.0.
```
### 在 Linux 上使用 vi/vim 命令创建一个文件
Vim 是一个向上兼容 Vi 的文本编辑器。它通常用来编辑所有种类的纯文本。在编辑程序时特别有用。
vim 中有很多功能可以用于编辑单个文件。
`vim` 是一个向上兼容 `vi` 的文本编辑器。它通常用来编辑所有种类的纯文本。在编辑程序时特别有用。
`vim` 中有很多功能可以用于编辑单个文件。
```
$ vi daygeek5.txt
@ -205,14 +195,14 @@ $ vi daygeek5.txt
It's FIVE years old blog
```
使用 ls 查看刚才创建的文件。
使用 `ls` 查看刚才创建的文件。
```
$ ls -lh daygeek5.txt
-rw-rw-r-- 1 daygeek daygeek 75 Feb 4 02:23 daygeek5.txt
```
使用 cat 命令查看文件的内容。
使用 `cat` 命令查看文件的内容。
```
$ cat daygeek5.txt
@ -221,7 +211,8 @@ It's FIVE years old blog
```
### 在 Linux 上使用 nano 命令创建一个文件
Nano 是一个编辑器,它是一个免费的 Pico 的克隆。nano 是一个小且用户友好的编辑器。它复制了 Pico 的外观及优点,并且是一个免费的应用,它添加了 Pico 缺乏的一系列特性,像是打开多个文件,每行滚动,撤销/重做,语法高亮,行号等等。
`nano` 是一个编辑器,它是一个自由版本的 `pico` 克隆。`nano` 是一个小且用户友好的编辑器。它复制了 `pico` 的外观及优点,并且是一个自由软件,它添加了 `pico` 缺乏的一系列特性,像是打开多个文件、逐行滚动、撤销/重做、语法高亮、行号等等。
```
$ nano daygeek6.txt
@ -231,13 +222,14 @@ It's FIVE years old blog
This website is maintained by Magesh M, It's licensed under CC BY-NC 4.0.
```
使用 ls 命令查看创建的文件。
使用 `ls` 命令查看创建的文件。
```
$ ls -lh daygeek6.txt
-rw-rw-r-- 1 daygeek daygeek 148 Feb 4 02:26 daygeek6.txt
```
使用 cat 命令来查看一个文件的内容。
使用 `cat` 命令来查看一个文件的内容。
```
$ cat daygeek6.txt
@ -248,13 +240,13 @@ This website is maintained by Magesh M, It's licensed under CC BY-NC 4.0.
### 在 Linux 上使用 head 命令创建一个文件
head 命令通常用于输出一个文件开头的一部分。它默认会打印一个文件的开头 10 行到标准输出。如果有多个文件,则每个文件前都会有一个标题,用来表示文件名。
`head` 命令通常用于输出一个文件开头的一部分。它默认会打印一个文件的开头 10 行到标准输出。如果有多个文件,则每个文件前都会有一个标题,用来表示文件名。
```
$ head -c 0K /dev/zero > daygeek7.txt
```
使用 ls 命令查看创建的文件。
使用 `ls` 命令查看创建的文件。
```
$ ls -lh daygeek7.txt
@ -263,13 +255,13 @@ $ ls -lh daygeek7.txt
### 在 Linux 上使用 tail 创建一个文件
tail 命令通常用来输出一个文件最后的一部分。它默认会打印每个文件的最后 10 行到标准输出。如果有多个文件,则每个文件前都会有一个标题,用来表示文件名。
`tail` 命令通常用来输出一个文件最后的一部分。它默认会打印每个文件的最后 10 行到标准输出。如果有多个文件,则每个文件前都会有一个标题,用来表示文件名。
```
$ tail -c 0K /dev/zero > daygeek8.txt
```
使用 ls 命令查看创建的文件。
使用 `ls` 命令查看创建的文件。
```
$ ls -lh daygeek8.txt
@ -278,13 +270,13 @@ $ ls -lh daygeek8.txt
### 在 Linux 上使用 truncate 命令创建一个文件
truncate 命令通常用作将一个文件的尺寸缩小或者扩展为某个指定的尺寸。
`truncate` 命令通常用作将一个文件的尺寸缩小或者扩展为某个指定的尺寸。
```
$ truncate -s 0K daygeek9.txt
```
使用 ls 命令检查创建的文件。
使用 `ls` 命令检查创建的文件。
```
$ ls -lh daygeek9.txt
@ -314,7 +306,7 @@ via: https://www.2daygeek.com/linux-command-to-create-a-file/
作者:[Vinoth Kumar][a]
选题:[lujun9972][b]
译者:[dianbanjiu](https://github.com/dianbanjiu)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,60 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Get started with Go For It, a flexible to-do list application)
[#]: via: (https://opensource.com/article/19/1/productivity-tool-go-for-it)
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney (Kevin Sonney))
Get started with Go For It, a flexible to-do list application
======
Go For It, the tenth in our series on open source tools that will make you more productive in 2019, builds on the Todo.txt system to help you get more things done.
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_cafe_brew_laptop_desktop.jpg?itok=G-n1o1-o)
There seems to be a mad rush at the beginning of every year to find ways to be more productive. New Year's resolutions, the itch to start the year off right, and of course, an "out with the old, in with the new" attitude all contribute to this. And the usual round of recommendations is heavily biased towards closed source and proprietary software. It doesn't have to be that way.
Here's the tenth of my picks for 19 new (or new-to-you) open source tools to help you be more productive in 2019.
### Go For It
Sometimes what a person needs to be productive isn't a fancy kanban board or a set of notes, but a simple, straightforward to-do list. Something that is as basic as "add item to list, check it off when done." And for that, the [plain-text Todo.txt system][1] is possibly one of the easiest to use, and it's supported on almost every system out there.
![](https://opensource.com/sites/default/files/uploads/go-for-it_1_1.png)
[Go For It][2] is a simple, easy-to-use graphical interface for Todo.txt. It can be used with an existing file, if you are already using Todo.txt, and will create both a to-do and a done file if you aren't. It allows drag-and-drop ordering of tasks, allowing users to organize to-do items in the order they want to execute them. It also supports priorities, projects, and contexts, as outlined in the [Todo.txt format guidelines][3]. And, it can filter tasks by context or project simply by clicking on the project or context in the task list.
![](https://opensource.com/sites/default/files/uploads/go-for-it_2.png)
At first, Go For It may look the same as just about any other Todo.txt program, but looks can be deceiving. The real feature that sets Go For It apart is that it includes a built-in [Pomodoro Technique][4] timer. Select the task you want to complete, switch to the Timer tab, and click Start. When the task is done, simply click Done, and it will automatically reset the timer and pick the next task on the list. You can pause and restart the timer as well as click Skip to jump to the next task (or break). It provides a warning when 60 seconds are left for the current task. The default time for tasks is set at 25 minutes, and the default time for breaks is set at five minutes. You can adjust this in the Settings screen, as well as the location of the directory containing your Todo.txt and done.txt files.
![](https://opensource.com/sites/default/files/uploads/go-for-it_3.png)
Go For It's third tab, Done, allows you to look at the tasks you've completed and clean them out when you want. Being able to look at what you've accomplished can be very motivating and a good way to get a feel for where you are in a longer process.
![](https://opensource.com/sites/default/files/uploads/go-for-it_4.png)
It also has all of Todo.txt's other advantages. Go For It's list is accessible by other programs that use the same format, including [Todo.txt's original command-line tool][5] and any [add-ons][6] you've installed.
Go For It seeks to be a simple tool to help manage your to-do list and get those items done. If you already use Todo.txt, Go For It is a fantastic addition to your toolkit, and if you don't, it's a really good way to start using one of the simplest and most flexible systems available.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/1/productivity-tool-go-for-it
作者:[Kevin Sonney][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/ksonney (Kevin Sonney)
[b]: https://github.com/lujun9972
[1]: http://todotxt.org/
[2]: http://manuel-kehl.de/projects/go-for-it/
[3]: https://github.com/todotxt/todo.txt
[4]: https://en.wikipedia.org/wiki/Pomodoro_Technique
[5]: https://github.com/todotxt/todo.txt-cli
[6]: https://github.com/todotxt/todo.txt-cli/wiki/Todo.sh-Add-on-Directory

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -0,0 +1,135 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to build a WiFi picture frame with a Raspberry Pi)
[#]: via: (https://opensource.com/article/19/2/wifi-picture-frame-raspberry-pi)
[#]: author: (Manuel Dewald https://opensource.com/users/ntlx)
How to build a WiFi picture frame with a Raspberry Pi
======
DIY a digital photo frame that streams photos from the cloud.
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberrypi_board_vector_red.png?itok=yaqYjYqI)
Digital picture frames are really nice because they let you enjoy your photos without having to print them out. Plus, adding and removing digital files is a lot easier than opening a traditional frame and swapping the picture inside when you want to display a new photo. Even so, it's still a bit of overhead to remove your SD card, USB stick, or other storage from a digital picture frame, plug it into your computer, and copy new pictures onto it.
An easier option is a digital picture frame that gets its pictures over WiFi, for example from a cloud service. Here's how to make one.
### Gather your materials
* Old [TFT][1] LCD screen
* HDMI-to-DVI cable (as the TFT screen supports DVI)
* Raspberry Pi 3
* Micro SD card
* Raspberry Pi power supply
* Keyboard
* Mouse (optional)
Connect the Raspberry Pi to the display using the cable and attach the power supply.
### Install Raspbian
**sudo raspi-config**. There I change the hostname (e.g., to **picframe** ) in Network Options and enable SSH to work remotely on the Raspberry Pi in Interfacing Options. Connect to the Raspberry Pi using (for example) .
### Build and install the cloud client
Download and flash Raspbian to the Micro SD card by following these [directions][2] . Plug the Micro SD card into the Raspberry Pi, boot it up, and configure your WiFi. My first action after a new Raspbian installation is usually running. There I change the hostname (e.g., to) in Network Options and enable SSH to work remotely on the Raspberry Pi in Interfacing Options. Connect to the Raspberry Pi using (for example)
I use [Nextcloud][3] to synchronize my pictures, but you could use NFS, [Dropbox][4], or whatever else fits your needs to upload pictures to the frame.
If you use Nextcloud, get a client for Raspbian by following these [instructions][5]. This is handy for placing new pictures on your picture frame and will give you the client application you may be familiar with on a desktop PC. When connecting the client application to your Nextcloud server, make sure to select only the folder where you'll store the images you want to be displayed on the picture frame.
### Set up the slideshow
The easiest way I've found to set up the slideshow is with a [lightweight slideshow project][6] built for exactly this purpose. There are some alternatives, like configuring a screensaver, but this application appears to be the simplest to set up.
On your Raspberry Pi, download the binaries from the latest release, unpack them, and move them to an executable folder:
```
wget https://github.com/NautiluX/slide/releases/download/v0.9.0/slide_pi_stretch_0.9.0.tar.gz
tar xf slide_pi_stretch_0.9.0.tar.gz
mv slide_0.9.0/slide /usr/local/bin/
```
Install the dependencies:
```
sudo apt install libexif12 qt5-default
```
Run the slideshow by executing the command below (don't forget to modify the path to your images). If you access your Raspberry Pi via SSH, set the **DISPLAY** variable to start the slideshow on the display attached to the Raspberry Pi.
```
DISPLAY=:0.0 slide -p /home/pi/nextcloud/picframe
```
### Autostart the slideshow
To autostart the slideshow on Raspbian Stretch, create the following folder and add an **autostart** file to it:
```
mkdir -p /home/pi/.config/lxsession/LXDE/
vi /home/pi/.config/lxsession/LXDE/autostart
```
Insert the following commands to autostart your slideshow. The **slide** command can be adjusted to your needs:
```
@xset s noblank
@xset s off
@xset -dpms
@slide -p -t 60 -o 200 -p /home/pi/nextcloud/picframe
```
Disable screen blanking, which the Raspberry Pi normally does after 10 minutes, by editing the following file:
```
vi /etc/lightdm/lightdm.conf
```
and adding these two lines to the end:
```
[SeatDefaults]
xserver-command=X -s 0 -dpms
```
### Configure a power-on schedule
You can schedule your picture frame to turn on and off at specific times by using two simple cronjobs. For example, say you want it to turn on automatically at 7 am and turn off at 11 pm. Run **crontab -e** and insert the following two lines.
```
0 23 * * * /opt/vc/bin/tvservice -o
0 7 * * * /opt/vc/bin/tvservice -p && sudo systemctl restart display-manager
```
Note that this won't turn the Raspberry Pi power's on and off; it will just turn off HDMI, which will turn the screen off. The first line will power off HDMI at 11 pm. The second line will bring the display back up and restart the display manager at 7 am.
### Add a final touch
By following these simple steps, you can create your own WiFi picture frame. If you want to give it a nicer look, build a wooden frame for the display.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/2/wifi-picture-frame-raspberry-pi
作者:[Manuel Dewald][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/ntlx
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Thin-film-transistor_liquid-crystal_display
[2]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md
[3]: https://nextcloud.com/
[4]: http://dropbox.com/
[5]: https://github.com/nextcloud/client_theming#building-on-debian
[6]: https://github.com/NautiluX/slide/releases/tag/v0.9.0

View File

@ -0,0 +1,157 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Run Particular Commands Without Sudo Password In Linux)
[#]: via: (https://www.ostechnix.com/run-particular-commands-without-sudo-password-linux/)
[#]: author: (SK https://www.ostechnix.com/author/sk/)
Run Particular Commands Without Sudo Password In Linux
======
I had a script on my Ubuntu system deployed on AWS. The primary purpose of this script is to check if a specific service is running at regular interval (every one minute to be precise) and start that service automatically if it is stopped for any reason. But the problem is I need sudo privileges to start the service. As you may know already, we should provide password when we run something as sudo user. But I dont want to do that. What I actually want to do is to run the service as sudo without password. If youre ever in a situation like this, I know a small work around, Today, in this brief guide, I will teach you how to run particular commands without sudo password in Unix-like operating systems.
Have a look at the following example.
```
$ sudo mkdir /ostechnix
[sudo] password for sk:
```
![][2]
As you can see in the above screenshot, I need to provide sudo password when creating a directory named ostechnix in root (/) folder. Whenever we try to execute a command with sudo privileges, we must enter the password. However, in my scenario, I dont want to provide the sudo password. Here is what I did to run a sudo command without password on my Linux box.
### Run Particular Commands Without Sudo Password In Linux
For any reasons, if you want to allow a user to run a particular command without giving the sudo password, you need to add that command in **sudoers** file.
I want the user named **sk** to execute **mkdir** command without giving the sudo password. Let us see how to do it.
Edit sudoers file:
```
$ sudo visudo
```
Add the following line at the end of file.
```
sk ALL=NOPASSWD:/bin/mkdir
```
![][3]
Here, **sk** is the username. As per the above line, the user **sk** can run mkdir command from any terminal, without sudo password.
You can add additional commands (for example **chmod** ) with comma-separated values as shown below.
```
sk ALL=NOPASSWD:/bin/mkdir,/bin/chmod
```
Save and close the file. Log out (or reboot) your system. Now, log in as normal user sk and try to run those commands with sudo and see what happens.
```
$ sudo mkdir /dir1
```
![][4]
See? Even though I ran mkdir command with sudo privileges, there was no password prompt. From now on, the user **sk** need not to enter the sudo password while running mkdir command.
When running all other commands except those commands added in sudoers files, you will be prompted to enter the sudo password.
Let us run another command with sudo.
```
$ sudo apt update
```
![][5]
See? This command prompts me to enter the sudo password.
If you dont want this command to prompt you to ask sudo password, edit sudoers file:
```
$ sudo visudo
```
Add the apt command in visudo file like below:
```
sk ALL=NOPASSWD: /bin/mkdir,/usr/bin/apt
```
Did you notice that the apt binary executable file path is different from mkdir? Yes, you must provide the correct executable file path. To find executable file path of any command, for example apt, use whereis command like below.
```
$ whereis apt
apt: /usr/bin/apt /usr/lib/apt /etc/apt /usr/share/man/man8/apt.8.gz
```
As you see, the executable file for apt command is **/usr/bin/apt** , hence I added it in sudoers file.
Like I already mentioned, you can add any number of commands with comma-separated values. Save and close your sudoers file once youre done. Log out and log in again to your system.
Now, check if you can be able to run the command with sudo prefix without using the password:
```
$ sudo apt update
```
![][6]
See? The apt command didnt ask me the password even though I ran it with sudo.
Here is yet another example. If you want to run a specific service, for example apache2, add it as shown below.
```
sk ALL=NOPASSWD:/bin/mkdir,/usr/bin/apt,/bin systemctl restart apache2
```
Now, the user can run sudo systemctl restart apache2 command without sudo password.
Can I re-authenticate to a particular command in the above case? Of course, yes! Just remove the added command. Log out and log in back.
Alternatively, you can add **PASSWD:** directive in-front of the command. Look at the following example.
Add/modify the following line as shown below.
```
sk ALL=NOPASSWD:/bin/mkdir,/bin/chmod,PASSWD:/usr/bin/apt
```
In this case, the user **sk** can run mkdir and chmod commands without entering the sudo password. However, he must provide sudo password when running apt command.
**Disclaimer:** This is for educational-purpose only. You should be very careful while applying this method. This method might be both productive and destructive. Say for example, if you allow users to execute rm command without sudo password, they could accidentally or intentionally delete important stuffs. You have been warned!
**Suggested read:**
And, thats all for now. Hope this was useful. More good stuffs to come. Stay tuned!
Cheers!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/run-particular-commands-without-sudo-password-linux/
作者:[SK][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[2]: http://www.ostechnix.com/wp-content/uploads/2017/05/sudo-password-1.png
[3]: http://www.ostechnix.com/wp-content/uploads/2017/05/sudo-password-7.png
[4]: http://www.ostechnix.com/wp-content/uploads/2017/05/sudo-password-6.png
[5]: http://www.ostechnix.com/wp-content/uploads/2017/05/sudo-password-4.png
[6]: http://www.ostechnix.com/wp-content/uploads/2017/05/sudo-password-5.png

View File

@ -0,0 +1,258 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Make websites more readable with a shell script)
[#]: via: (https://opensource.com/article/19/2/make-websites-more-readable-shell-script)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
Make websites more readable with a shell script
======
Calculate the contrast ratio between your website's text and background to make sure your site is easy to read.
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ)
If you want people to find your website useful, they need to be able to read it. The colors you choose for your text can affect the readability of your site. Unfortunately, a popular trend in web design is to use low-contrast colors when printing text, such as gray text on a white background. Maybe that looks really cool to the web designer, but it is really hard for many of us to read.
The W3C provides Web Content Accessibility Guidelines, which includes guidance to help web designers pick text and background colors that can be easily distinguished from each other. This is called the "contrast ratio." The W3C definition of the contrast ratio requires several calculations: given two colors, you first compute the relative luminance of each, then calculate the contrast ratio. The ratio will fall in the range 1 to 21 (typically written 1:1 to 21:1). The higher the contrast ratio, the more the text will stand out against the background. For example, black text on a white background is highly visible and has a contrast ratio of 21:1. And white text on a white background is unreadable at a contrast ratio of 1:1.
The [W3C says body text][1] should have a contrast ratio of at least 4.5:1 with headings at least 3:1. But that seems to be the bare minimum. The W3C also recommends at least 7:1 for body text and at least 4.5:1 for headings.
Calculating the contrast ratio can be a chore, so it's best to automate it. I've done that with this handy Bash script. In general, the script does these things:
1. Gets the text color and background color
2. Computes the relative luminance of each
3. Calculates the contrast ratio
### Get the colors
You may know that every color on your monitor can be represented by red, green, and blue (R, G, and B). To calculate the relative luminance of a color, my script will need to know the red, green, and blue components of the color. Ideally, my script would read this information as separate R, G, and B values. Web designers might know the specific RGB code for their favorite colors, but most humans don't know RGB values for the different colors. Instead, most people reference colors by names like "red" or "gold" or "maroon."
Fortunately, the GNOME [Zenity][2] tool has a color-picker app that lets you use different methods to select a color, then returns the RGB values in a predictable format of "rgb( **R** , **G** , **B** )". Using Zenity makes it easy to get a color value:
```
color=$( zenity --title 'Set text color' --color-selection --color='black' )
```
In case the user (accidentally) clicks the Cancel button, the script assumes a color:
```
if [ $? -ne 0 ] ; then
        echo '** color canceled .. assume black'
        color='rgb(0,0,0)'
fi
```
My script does something similar to set the background color value as **$background**.
### Compute the relative luminance
Once you have the foreground color in **$color** and the background color in **$background** , the next step is to compute the relative luminance for each. On its website, the [W3C provides an algorithm][3] to compute the relative luminance of a color.
> For the sRGB colorspace, the relative luminance of a color is defined as
> **L = 0.2126 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated R + 0.7152 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated G + 0.0722 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated B** where R, G and B are defined as:
>
> if RsRGB <= 0.03928 then R = RsRGB/12.92
> else R = ((RsRGB+0.055)/1.055) ^ 2.4
>
> if GsRGB <= 0.03928 then G = GsRGB/12.92
> else G = ((GsRGB+0.055)/1.055) ^ 2.4
>
> if BsRGB <= 0.03928 then B = BsRGB/12.92
> else B = ((BsRGB+0.055)/1.055) ^ 2.4
>
> and RsRGB, GsRGB, and BsRGB are defined as:
>
> RsRGB = R8bit/255
>
> GsRGB = G8bit/255
>
> BsRGB = B8bit/255
Since Zenity returns color values in the format "rgb( **R** , **G** , **B** )," the script can easily pull apart the R, B, and G values to compute the relative luminance. AWK makes this a simple task, using the comma as the field separator ( **-F,** ) and using AWK's **substr()** string function to pick just the text we want from the "rgb( **R** , **G** , **B** )" color value:
```
R=$( echo $color | awk -F, '{print substr($1,5)}' )
G=$( echo $color | awk -F, '{print $2}' )
B=$( echo $color | awk -F, '{n=length($3); print substr($3,1,n-1)}' )
```
**(For more on extracting and displaying data with AWK,[Get our AWK cheat sheet][4].)**
Calculating the final relative luminance is best done using the BC calculator. BC supports the simple if-then-else needed in the calculation, which makes this part simple. But since BC cannot directly calculate exponentiation using a non-integer exponent, we need to do some extra math using the natural logarithm instead:
```
echo "scale=4
rsrgb=$R/255
gsrgb=$G/255
bsrgb=$B/255
if ( rsrgb <= 0.03928 ) r = rsrgb/12.92 else r = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((rsrgb+0.055)/1.055) )
if ( gsrgb <= 0.03928 ) g = gsrgb/12.92 else g = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((gsrgb+0.055)/1.055) )
if ( bsrgb <= 0.03928 ) b = bsrgb/12.92 else b = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((bsrgb+0.055)/1.055) )
0.2126 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated r + 0.7152 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated g + 0.0722 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated b" | bc -l
```
This passes several instructions to BC, including the if-then-else statements that are part of the relative luminance formula. BC then prints the final value.
### Calculate the contrast ratio
With the relative luminance of the text color and the background color, now the script can calculate the contrast ratio. The [W3C determines the contrast ratio][5] with this formula:
> (L1 + 0.05) / (L2 + 0.05), where
> L1 is the relative luminance of the lighter of the colors, and
> L2 is the relative luminance of the darker of the colors
Given two relative luminance values **$r1** and **$r2** , it's easy to calculate the contrast ratio using the BC calculator:
```
echo "scale=2
if ( $r1 > $r2 ) { l1=$r1; l2=$r2 } else { l1=$r2; l2=$r1 }
(l1 + 0.05) / (l2 + 0.05)" | bc
```
This uses an if-then-else statement to determine which value ( **$r1** or **$r2** ) is the lighter or darker color. BC performs the resulting calculation and prints the result, which the script can store in a variable.
### The final script
With the above, we can pull everything together into a final script. I use Zenity to display the final result in a text box:
```
#!/bin/sh
# script to calculate contrast ratio of colors
# read color and background color:
# zenity returns values like 'rgb(255,140,0)' and 'rgb(255,255,255)'
color=$( zenity --title 'Set text color' --color-selection --color='black' )
if [ $? -ne 0 ] ; then
        echo '** color canceled .. assume black'
        color='rgb(0,0,0)'
fi
background=$( zenity --title 'Set background color' --color-selection --color='white' )
if [ $? -ne 0 ] ; then
        echo '** background canceled .. assume white'
        background='rgb(255,255,255)'
fi
# compute relative luminance:
function luminance()
{
        R=$( echo $1 | awk -F, '{print substr($1,5)}' )
        G=$( echo $1 | awk -F, '{print $2}' )
        B=$( echo $1 | awk -F, '{n=length($3); print substr($3,1,n-1)}' )
        echo "scale=4
rsrgb=$R/255
gsrgb=$G/255
bsrgb=$B/255
if ( rsrgb <= 0.03928 ) r = rsrgb/12.92 else r = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((rsrgb+0.055)/1.055) )
if ( gsrgb <= 0.03928 ) g = gsrgb/12.92 else g = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((gsrgb+0.055)/1.055) )
if ( bsrgb <= 0.03928 ) b = bsrgb/12.92 else b = e( 2.4 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated l((bsrgb+0.055)/1.055) )
0.2126 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated r + 0.7152 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated g + 0.0722 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated b" | bc -l
}
lum1=$( luminance $color )
lum2=$( luminance $background )
# compute contrast
function contrast()
{
        echo "scale=2
if ( $1 > $2 ) { l1=$1; l2=$2 } else { l1=$2; l2=$1 }
(l1 + 0.05) / (l2 + 0.05)" | bc
}
rel=$( contrast $lum1 $lum2 )
# print results
( cat<<EOF
Color is $color on $background
Contrast ratio is $rel
Contrast ratios can range from 1 to 21 (commonly written 1:1 to 21:1).
EOF
if [ ${rel%.*} -ge 4 ] ; then
        echo "Ok for body text"
else
        echo "Not good for body text"
fi
if [ ${rel%.*} -ge 3 ] ; then
        echo "Ok for title text"
else
        echo "Not good for title text"
fi
cat<<EOF
The W3C says this:
1.4.3 Contrast (Minimum): The visual presentation of text and images of text has a contrast ratio of at least 4.5:1, except for the following: (Level AA)
    Large Text: Large-scale text and images of large-scale text have a contrast ratio of at least 3:1;
    Incidental: Text or images of text that are part of an inactive user interface component, that are pure decoration, that are not visible to anyone, or that are part of a picture that contains significant other visual content, have no contrast requirement.
    Logotypes: Text that is part of a logo or brand name has no minimum contrast requirement.
and:
1.4.6 Contrast (Enhanced): The visual presentation of text and images of text has a contrast ratio of at least 7:1, except for the following: (Level AAA)
    Large Text: Large-scale text and images of large-scale text have a contrast ratio of at least 4.5:1;
    Incidental: Text or images of text that are part of an inactive user interface component, that are pure decoration, that are not visible to anyone, or that are part of a picture that contains significant other visual content, have no contrast requirement.
    Logotypes: Text that is part of a logo or brand name has no minimum contrast requirement.
EOF
) | zenity --text-info --title='Relative Luminance' --width=800 --height=600
```
At the end, I like to include reference information about the W3C recommendations as a reminder for myself.
The Zenity color picker does all the hard work of interpreting colors, which the user can select by clicking in the color wheel or by entering a value. Zenity accepts standard hex color values used on websites, like #000000 or #000 or rgb(0,0,0) (all of those are black). Here's an example calculation for black text on a white background:
![](https://opensource.com/sites/default/files/uploads/zenity_screenshot1-a.png)
![](https://opensource.com/sites/default/files/uploads/zenity_screenshot1-b.png)
![](https://opensource.com/sites/default/files/uploads/relativeluminescence1-result.png)
Zenity also understands standard color names like cadetblue or orange or gold. Enter the color name in Zenity then hit Tab, and Zenity will convert the color name into a hex color value, as in this example calculation for black text on a gold background:
![](https://opensource.com/sites/default/files/uploads/zenity_screenshot2-a-name.png)
![](https://opensource.com/sites/default/files/uploads/zenity_screenshot2-a-value.png)
![](https://opensource.com/sites/default/files/uploads/zenity_screenshot2-b-name.png)
![](https://opensource.com/sites/default/files/uploads/zenity_screenshot2-b-value.png)
![](https://opensource.com/sites/default/files/uploads/relativeluminescence2-result.png)
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/2/make-websites-more-readable-shell-script
作者:[Jim Hall][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/jim-hall
[b]: https://github.com/lujun9972
[1]: https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast
[2]: https://wiki.gnome.org/Projects/Zenity
[3]: https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
[4]: https://opensource.com/article/18/7/cheat-sheet-awk
[5]: https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef

View File

@ -0,0 +1,117 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (FinalCrypt An Open Source File Encryption Application)
[#]: via: (https://itsfoss.com/finalcrypt/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
FinalCrypt An Open Source File Encryption Application
======
I usually dont encrypt files but if I am planning to organize my important documents or credentials, an encryption program would come in handy.
You may be already using a program like [GnuPG][1] that helps you encrypt/decrypt your files on your Linux machine. There is [EncryptPad][2] as well that encrypts your notes.
However, I have come across a new free and open source encryption tool called FinalCrypt. You can check out their recent releases and the source on its [GitHub page][3].
In this article, I will be sharing my experience of using this tool. Do note that I wont be comparing this with any other program available out there so if you want a detailed comparison between multiple solutions, let us know in the comments.
![FinalCrypt][4]
### Using FinalCrypt to encrypt files
FinalCrypt uses the [One-Time pad][5] key generation cipher to encrypt files. In other words, it generates an OTP key which you will use for encrypting or decrypting your files.
The key will be completely random as per the size of the key which you can specify. So, it is impossible to decrypt the file without the key file.
While the OTP key method for encryption/decryption is simple and effective, but managing or securing the key file could be an inconvenience for some.
If you want to use FinalCrypt, you can install the DEB/RPM files from its website. FinalCrypt is also available for Windows and macOS.
Once downloaded, simply double click to [install it from deb][6] or rpm files. You can also build it from the source code if you want.
### FileCrypt in Action
This video shows how to use FinalCrypt:
<https://youtu.be/6Ir8VcZ26E4>
If you like Linux related videos, please [subscribe to our YouTube channel][7].
Once you have installed FinalCrypt, youll find it in your list of installed applications. Launch it from there.
Upon launch, you will observe two sections (split) for the items to encrypt/decrypt and the other to select the OTP file.
![Using FinalCrypt for encrypting files in Linux][8]
First, you will have to generate an OTP key. Heres how to do that:
![finalcrypt otp][9]
Do note that your file name can be anything but you need to make sure that the key file size is greater or equal to the file you want to encrypt. I find it absurd but thats how it is.
![][10]
After you generate the file, select the key on the right-side of the window and then select the files that you want to encrypt on the left-side of the window.
You will find the checksum value, key file size, and valid status highlighted after generating the OTP:
![][11]
After making the selection, you just need to click on “ **Encrypt** ” to encrypt those files and if already encrypted, then “ **Decrypt** ” to decrypt those.
![][12]
You can also use FinalCrypt in command line to automate your encryption job.
#### How do you secure your OTP key?
It is easy to encrypt/decrypt the files you want to protect. But, where should you keep your OTP key?
It is literally useless if you fail to keep your OTP key in a safe storage location.
Well, one of the best ways would be to use a USB stick specifically for the keys you want to store. Just plug it in when you want to decrypt files and its all good.
In addition to that, you may save your key on a [cloud service][13], if you consider it secure enough.
More information about FinalCrypt can be found on its website.
[FinalCrypt](https://sites.google.com/site/ronuitholland/home/finalcrypt)
**Wrapping Up**
It might seem a little overwhelming at the beginning but it is actually a simple and user-friendly encryption program available for Linux. There are other programs to [password protect folders][14] as well if you are interested in some additional reading.
What do you think about FinalCrypt? Do you happen to know about something similar which is potentially better? Let us know in the comments and we shall take a look at them!
--------------------------------------------------------------------------------
via: https://itsfoss.com/finalcrypt/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://www.gnupg.org/
[2]: https://itsfoss.com/encryptpad-encrypted-text-editor-linux/
[3]: https://github.com/ron-from-nl/FinalCrypt
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt.png?resize=800%2C450&ssl=1
[5]: https://en.wikipedia.org/wiki/One-time_pad
[6]: https://itsfoss.com/install-deb-files-ubuntu/
[7]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt.jpg?fit=800%2C439&ssl=1
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-otp-key.jpg?resize=800%2C443&ssl=1
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-otp-generate.jpg?ssl=1
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-key.jpg?fit=800%2C420&ssl=1
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt-encrypt.jpg?ssl=1
[13]: https://itsfoss.com/cloud-services-linux/
[14]: https://itsfoss.com/password-protect-folder-linux/
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/finalcrypt.png?fit=800%2C450&ssl=1

View File

@ -0,0 +1,103 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How To Grant And Remove Sudo Privileges To Users On Ubuntu)
[#]: via: (https://www.ostechnix.com/how-to-grant-and-remove-sudo-privileges-to-users-on-ubuntu/)
[#]: author: (SK https://www.ostechnix.com/author/sk/)
How To Grant And Remove Sudo Privileges To Users On Ubuntu
======
![](https://www.ostechnix.com/wp-content/uploads/2019/02/sudo-privileges-720x340.png)
As you know already, the user can perform any administrative tasks with sudo privileges on Ubuntu systems. When creating a new users on your Linux box, they cant do any administrative tasks until you make them to be a member of **sudo group**. In this brief tutorial, we explain how to add a regular user to sudo group and remove the given privileges to make it as just a normal user.
**Grant Sudo Privileges To A regular User On Linux**
Usually, we use **adduser** command to create new user like below.
```
$ sudo adduser ostechnix
```
If you want the newly created user to perform any administrative tasks with sudo, just add him to the sudo group using command:
```
$ sudo usermod -a -G sudo hduser
```
The above command will make the user called **ostechnix** to be the member of sudo group.
You can also use this command too to add the users to sudo group.
```
$ sudo adduser ostechnix sudo
```
Now, log out and log in back as the new user for this change to take effect. The user has now become an administrative user.
To verify it, just use sudo as prefix in a any command.
```
$ sudo mkdir /test
[sudo] password for ostechnix:
```
### Remove sudo privileges of an User
Sometimes, you might want to remove sudo privileges to a particular user without deleting it from your Linux box. To make any user as a normal user, just remove them from the sudo group.
Say for example If you want to remove a user called **ostechnix** , from the sudo group, just run:
```
$ sudo deluser ostechnix sudo
```
**Sample output:**
```
Removing user `ostechnix' from group `sudo' ...
Done.
```
This command will only remove user ostechnix from the sudo group, but it will not delete the user permanently from the system. Now, He becomes a regular user and cant do any administrative tasks as sudo user.
Also, you can use the following command to revoke the sudo access from an user:
```
$ sudo gpasswd -d ostechnix sudo
```
Please be careful while removing users from the sudo group. Do not remove the real administrator from the “sudo” group.
Verify the user “ostechnix” has been really removed from sudo group using command:
```
$ sudo -l -U ostechnix
User ostechnix is not allowed to run sudo on ubuntuserver.
```
Yes, the user “ostechnix” has been removed from sudo group, and he cant execute any administrative tasks.
Please be careful while removing a user from a sudo group. If you have only one sudo user on your system and you remove him from the sudo group, you cant perform any administrative stuffs such as installing, removing and updating programs on your system. So, please be careful. In our next, tutorial, we will explain how to restore sudo privileges to a user
And, thats all for now. Hope this was useful. More good stuffs to come. Stay tuned!
Cheers!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/how-to-grant-and-remove-sudo-privileges-to-users-on-ubuntu/
作者:[SK][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972

View File

@ -0,0 +1,130 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Change User Password in Ubuntu [Beginners Tutorial])
[#]: via: (https://itsfoss.com/change-password-ubuntu)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
How to Change User Password in Ubuntu [Beginners Tutorial]
======
**Want to change root password in Ubuntu? Learn how to change the password for any user in Ubuntu Linux. Both terminal and GUI methods have been discussed.**
When do you need to change the password in Ubuntu? Let me give you a couple of scenarios.
When you install [Ubuntu][1], you create a user and set a password for it. It could be a weak password or perhaps a bit too complicated and you want to change it.
If you are a sysadmin, you may need to change the password for other users on your system.
You may have a few other reasons for doing this. Now the question comes, how to change the password for a user in Ubuntu or Linux?
In this quick tutorial, Ill show you the command line and the GUI ways of changing passwords in Ubuntu.
### Change user password in Ubuntu [Command Line]
![How to change user password in Ubuntu Linux][2]
Changing user password in Ubuntu is dead simple. In fact, its the same with any Linu distribution because you use the generic Linux command called passwd for this purpose.
If you want to change your current password, simply run this command in a terminal:
```
passwd
```
Youll be asked to enter your current password and the new password twice.
You wont see anything on the screen while typing the password. This is perfectly normal behavior for UNIX and Linux.
```
passwd
Changing password for abhishek.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
```
Since this is your admin account, you just changed the sudo password in Ubuntu without even realizing it.
![Change user password in Linux command line][3]
If you want to change password for some other user, you can do that as well with the passwd command. But in this case, youll have to use sudo.
```
sudo passwd <user_name>
```
If you changed your password and forgot it later, dont worry. You can [easily reset Ubuntu password][4].
### Change root password in Ubuntu
By default, the root user in Ubuntu doesnt have a password. Dont be surprised. You dont use the root user in Ubuntu all the time. Confused? Let me explain it to you quickly.
While [installing Ubuntu][5], you are forced to create a user. This user has admin access. This admin user can gain root access using the sudo command. But it uses its own password, not the root accounts password (because there is none).
You can set or change root password using the **passwd** command. However, in most cases, you dont need it and you shouldnt be doing it.
Youll have to use sudo (with an account with admin privileges). If the root password has no password set up previously, it will ask you to set it up. Else, you can change it using the existing root password.
```
sudo password root
```
### Change Ubuntu password using GUI
I have used GNOME desktop with Ubuntu 18.04 here. The steps should be more or less the same for other desktop environments and Ubuntu versions.
Go to Menu (press Windows/Super key) and search for Settings.
In the Settings, scroll down a bit and go to Details.
![Go to details in Ubuntu GNOME settings][6]
In here, click on Users to access all the available users on your system.
![Users settings in Ubuntu][7]
You can select any user you want, including your main admin account. You need to unlock the users first and then click the password field.
![Changing user password in Ubuntu][8]
Youll be asked to set the password. If you are changing your own password, youll have to enter your current password as well.
![Changing user password in Ubuntu][9]
Once done, click on the Change button on the top. Thats it. You have successfully changed user password in Ubuntu.
I hope this quick little tip helped you to change user password in Ubuntu. If you have questions or suggestions, please leave a comment below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/change-password-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://www.ubuntu.com/
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/change-password-ubuntu-linux.png?resize=800%2C450&ssl=1
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/change-user-password-linux-1.jpg?resize=800%2C253&ssl=1
[4]: https://itsfoss.com/how-to-hack-ubuntu-password/
[5]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/change-user-password-ubuntu-gui-2.jpg?resize=800%2C484&ssl=1
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/change-user-password-ubuntu-gui-3.jpg?resize=800%2C488&ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/change-user-password-ubuntu-gui-4.jpg?resize=800%2C555&ssl=1
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/change-user-password-ubuntu-gui-1.jpg?ssl=1
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/change-password-ubuntu-linux.png?fit=800%2C450&ssl=1

View File

@ -0,0 +1,59 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Get started with Go For It, a flexible to-do list application)
[#]: via: (https://opensource.com/article/19/1/productivity-tool-go-for-it)
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney (Kevin Sonney))
开始使用 Go For It一个灵活的待办事项列表程序
======
Go For It是我们开源工具系列中的第十个工具它将使你在 2019 年更高效,它在 Todo.txt 系统的基础上构建,以帮助你完成更多工作。
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_cafe_brew_laptop_desktop.jpg?itok=G-n1o1-o)
每年年初似乎都有疯狂的冲动,想方设法提高工作效率。新年的决议,开始一年的权利,当然,“与旧的,与新的”的态度都有助于实现这一目标。通常的一轮建议严重偏向封闭源和专有软件。它不一定是这样。
这是我挑选出的 19 个新的(或者对你而言新的)开源工具中的第 10 个工具来帮助你在 2019 年更有效率。
### Go For It
有时,人们要高效率需要的不是一个花哨的看板或一组笔记,而是一个简单,直接的待办事项清单。像“将项目添加到列表中,在完成后检查”一样基本的东西。为此,[纯文本 Todo.txt 系统][1]可能是最容易使用的系统之一,几乎所有系统都支持它。
![](https://opensource.com/sites/default/files/uploads/go-for-it_1_1.png)
[Go For It][2] 是一个简单易用的 Todo.txt 图形界面。如果你已经在使用 Todo.txt它可以与现有文件一起使用如果还没有那么可以同时创建待办事项和完成事项。它允许拖放任务排序允许用户按照他们想要执行的顺序组织待办事项。它还支持 [Todo.txt 格式指南][3]中所述的优先级,项目和上下文。而且,只需单击任务列表中的项目或者上下文就可通过它们过滤任务。
![](https://opensource.com/sites/default/files/uploads/go-for-it_2.png)
一开始Go For It 可能看起来与任何其他 Todo.txt 程序相同,但外观可能是骗人的。将 Go For It 与其他真正区分开的功能是它包含一个内置的[番茄工作法][4]计时器。选择要完成的任务,切换到“计时器”选项卡,然后单击“启动”。任务完成后,只需单击“完成”,它将自动重置计时器并选择列表中的下一个任务。你可以暂停并重新启动计时器,也可以单击“跳过”跳转到下一个任务(或中断)。当当前任务剩余 60 秒时它会发出警告。任务的默认时间设置为25分钟中断的默认时间设置为五分钟。你可以在“设置”页面中调整同时还能调整 Todo.txt 和 done.txt 文件的目录的位置。
![](https://opensource.com/sites/default/files/uploads/go-for-it_3.png)
Go For It 的第三个选项卡“已完成”,允许你查看已完成的任务并在需要时将其清除。能够看到你已经完成的可能是非常激励的,也是一种了解你在更长的过程中进度的好方法。
![](https://opensource.com/sites/default/files/uploads/go-for-it_4.png)
它还有 Todo.txt 的所有其他优点。Go For It 的列表可以被其他使用相同格式的程序访问,包括 [Todo.txt 的原始命令行工具][5]和任何已安装的[附加组件][6]。
Go For It 旨在成为一个简单的工具来帮助管理你的待办事项列表并完成这些项目。如果你已经使用过 Todo.txt那么 Go For It 是你的工具箱的绝佳补充,如果你还没有,这是一个尝试最简单、最灵活系统之一的好机会。
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/1/productivity-tool-go-for-it
作者:[Kevin Sonney][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ksonney (Kevin Sonney)
[b]: https://github.com/lujun9972
[1]: http://todotxt.org/
[2]: http://manuel-kehl.de/projects/go-for-it/
[3]: https://github.com/todotxt/todo.txt
[4]: https://en.wikipedia.org/wiki/Pomodoro_Technique
[5]: https://github.com/todotxt/todo.txt-cli
[6]: https://github.com/todotxt/todo.txt-cli/wiki/Todo.sh-Add-on-Directory