From 551c19fb5d3b24bb53e2f51205e07467885c7bb9 Mon Sep 17 00:00:00 2001 From: Ocputs <15391606236@163.com> Date: Sun, 24 Dec 2017 10:04:18 +0800 Subject: [PATCH 001/133] change error github's ID --- ...214 How to squeeze the most out of Linux file compression.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20171214 How to squeeze the most out of Linux file compression.md b/translated/tech/20171214 How to squeeze the most out of Linux file compression.md index 66a6ab980a..f844719399 100644 --- a/translated/tech/20171214 How to squeeze the most out of Linux file compression.md +++ b/translated/tech/20171214 How to squeeze the most out of Linux file compression.md @@ -106,7 +106,7 @@ $ xzmore textfile.xz | head -1 -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3240938/linux/how-to-squeeze-the-most-out-of-linux-file-compression.html -作者 :[ Sandra Henry-Stocker ][1] 译者:[ singledp ][2] 校对:校对者ID +作者 :[ Sandra Henry-Stocker ][1] 译者:[ singledo ][2] 校对:校对者ID 本文由 [ LCTT ][3]原创编译,Linux中国 荣誉推出 From 5bb17949891f8f1bd86d0b9531c27fd692b637ab Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 26 Dec 2017 18:28:03 +0800 Subject: [PATCH 002/133] =?UTF-8?q?translate=20done=20at=202017=E5=B9=B4?= =?UTF-8?q?=2012=E6=9C=88=2026=E6=97=A5=20=E6=98=9F=E6=9C=9F=E4=BA=8C=2018?= =?UTF-8?q?:28:03=20CST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... on a Linux - Unix - OS X - BSD Systems.md | 56 ------------------- ... on a Linux - Unix - OS X - BSD Systems.md | 55 ++++++++++++++++++ 2 files changed, 55 insertions(+), 56 deletions(-) delete mode 100644 sources/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md create mode 100644 translated/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md diff --git a/sources/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md b/sources/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md deleted file mode 100644 index 436e143f82..0000000000 --- a/sources/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md +++ /dev/null @@ -1,56 +0,0 @@ -translating by lujun9972 -Fix The Display and Console Gibberish on a Linux / Unix / OS X / BSD Systems -====== -Sometimes my R & D result in the weird output on the screen。For example,accidentally I run cat command over binary file - cat /sbin/*。You will be not able to access your bash/ksh/zsh based terminal。It will be full of wired character sequences that can lock down your display。These characters will hide what you type or character displayed into strange symbols。To clear gibberish all over the screen use the following method。This article describes how to really clear the terminal screen or reset terminal in Linux or Unix-like system。 - - -## The clear command - -The clear command clears your screen including its scrollback buffer。 -`$ clear` -You can press CTRL+L to clear screen too。However,clear command won't clear the terminal screen。Use the following methods to really clear the terminal so you get a get back a good working terminal。 - -## How to fix the display using the rest command - -Here is my console with gibberish all over the screen: -[![Fig.01:Bash fix the display][1]][2] - -To fix the display just type the reset command。It will initialization terminal again for you: -`$ reset` -OR -`$ tput reset` - -If reset command failed to work type the following command to restore the session to a normal state: -`$ stty sane` - -Press CTRL + L to clear the screen (or type the clear command): -`$ clear` - -## Use ANSI escape sequence to really clear the bash terminal - -Another option is to type the following ANSI escape sequence: -``` -clear -echo -e "\033c" -``` - -Sample outputs from both commands: -[![Animated gif 01:Fix Unix Console Gibberish Command Demo][3]][4] -Read man pages of stty and reset for more information stty(1),reset(1),bash(1) - - --------------------------------------------------------------------------------- - -via: https://www.cyberciti.biz/tips/bash-fix-the-display.html - -作者:[Vivek Gite][a] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.cyberciti.biz -[1]:https://www.cyberciti.biz/media/new/tips/2006/08/bash-fix-terminal.png -[2]:https://www.cyberciti.biz/media/uploads/tips/2006/08/bash-fix-terminal.png -[3]:https://www.cyberciti.biz/media/new/tips/2006/08/unix-linux-console-gibberish.gif -[4]:https://www.cyberciti.biz/tips/bash-fix-the-display.html/unix-linux-console-gibberish diff --git a/translated/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md b/translated/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md new file mode 100644 index 0000000000..285b3fe935 --- /dev/null +++ b/translated/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md @@ -0,0 +1,55 @@ +修复 Linux / Unix / OS X / BSD 系统 控制台上的显示垃圾 +====== +有时我的 R & D( 研究与发展??) 会在屏幕上输出一些奇怪的东西。比如,有一次我不小心用 cat 命令查看了一下二进制文件的内容 - `cat /sbin/*`。这种情况下你将无法再访问终端里的 bash/ksh/zsh 了。大量的奇怪字符充斥了你的终端 y。这些字符会隐藏你输入的内容和要显示的字符,取而代之的是一些奇怪的符号。要清理掉这些屏幕上的垃圾可以使用以下方法。本文就将向你描述在 Linux/ 类 Unix 系统中如何真正清理终端屏幕或者重置终端。 + + +## clear 命令 + +clear 命令会清理掉屏幕内容,连带它的回滚缓存区一起也会被清理掉。 +`$ clear` +你也可以按下 `CTRL+L` 来清理屏幕。然而,clear 命令并不会清理掉终端屏幕(译者注:这句话比较难理解,应该是指的运行 clear 命令并不是真正的把以前显示的内容删掉,你还是可以通过向上翻页看到之前显示的内容)。使用下面的方法才可以真正地清空终端,使你的终端恢复正常。 + +## 使用 reset 命令修复显示 + +下面图片中,控制台的屏幕上充满了垃圾信息: +[![Fig.01:Bash fix the display][1]][2] + +要修复正常显示,只需要输入 `reset` 命令。它会为你再初始化一次终端: +`$ reset` +或者 +`$ tput reset` + +如果 `reset` 命令还不行,那么输入下面命令来让绘画回复到正常状态: +`$ stty sane` + +按下 `CTRL + L` 来清理屏幕 (或者输入 clear 命令): +`$ clear` + +## 使用 ANSI 转义序列来真正地晴空 bash 终端 + +另一种选择是输入下面的 ANSI 转义序列: +``` +clear +echo -e "\033c" +``` + +下面是这两个命令的输出示例: +[![Animated gif 01:Fix Unix Console Gibberish Command Demo][3]][4] +更多信息请阅读 stty 和 reset 的 man 页 stty(1),reset(1),bash(1) + + +-------------------------------------------------------------------------------- + +via: https://www.cyberciti.biz/tips/bash-fix-the-display.html + +作者:[Vivek Gite][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.cyberciti.biz +[1]:https://www.cyberciti.biz/media/new/tips/2006/08/bash-fix-terminal.png +[2]:https://www.cyberciti.biz/media/uploads/tips/2006/08/bash-fix-terminal.png +[3]:https://www.cyberciti.biz/media/new/tips/2006/08/unix-linux-console-gibberish.gif +[4]:https://www.cyberciti.biz/tips/bash-fix-the-display.html/unix-linux-console-gibberish From 2534d0e034741ae8f583075f83c612dd4fd1708e Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 26 Dec 2017 21:47:30 +0800 Subject: [PATCH 003/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Check=20Linux=20f?= =?UTF-8?q?ilesystem=20for=20errors:=20FSCK=20command=20with=20examples?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... for errors- FSCK command with examples.md | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 sources/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md diff --git a/sources/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md b/sources/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md new file mode 100644 index 0000000000..d20e862c88 --- /dev/null +++ b/sources/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md @@ -0,0 +1,137 @@ +translating by lujun9972 +Check Linux filesystem for errors: FSCK command with examples +====== +FSCK is a very important Linux/Unix utility, it is used to check & repair the errors in the file system. It is similar to 'chkdsk' utility in Windows operating systems. It is available for Linux, MacOS, FreeBSD operating systems. + +FSCK stands for File System Consistency Check & most of the times, it runs at boot time but can also be started manually by super user, if need arises. + +It can be used with 3 modes of operation, + + **1-** Check for errors & let the user decide what should be done with each error, + + **2-** Check for errors & make repairs automatically, or, + + **3-** Check for errors & display the error but does not perform any repairs. + + **(Recommended Read:[Learn to use TCPDUMP command with examples][1])** + +### Syntax for using FSCK + +We can use the FSCK command manually with the following syntax, + + **$ fsck options drives** + +The options that can be used with fsck command are, + + **-p ** Automatic repair (no questions) + + **-n** Make no changes to the filesystem + + **-y ** Assume "yes" to all questions + + **-c** Check for bad blocks and add them to the badblock list + + **-f ** Force checking even if filesystem is marked clean + + **-v ** Be verbose + + **-b ** superblock Use alternative superblock + + **-B** blocksize Force blocksize when looking for superblock + + **-j ** external_journal Set location of the external journal + + **-l ** bad_blocks_file Add to badblocks list + + **-L ** bad_blocks_file Set badblocks list + +We can use any of the following options, depending on the operation we need to perform. Let's discuss some of the options of fsck command with examples. + +### Fsck command with examples + + **Note:-** Before we discuss any examples, please read this. We should not be using FSCK on mounted drives, as there will be high chances that fsck on mounted drive wll damage the drive permanently. So before performing fsck, we must un-mount the drive with the following command, + + **$ umount drivename** + +For example, + + **$ umount /dev/sdb1** + +You can check the partition number with the following command, + + **$ fdisk -l** + +Also while running the fsck, we might get some error codes. Below mentioned is the list of error codes that we might get along with their meanings, + + **0** - No errors +**1** - Filesystem errors corrected +**2** - System should be rebooted +**4** - Filesystem errors left uncorrected +**8** - Operational error +**16** - Usage or syntax error +**32** - Fsck canceled by user request +**128** - Shared-library error + +Now let's discuss usage of fdisk command with examples, + +### Perform an error check on a single partition + +To perform a file check on a single partition, run the following command from the terminal, + + **$ umount /dev/sdb1** + + **$ fsck /dev/sdb1** + +### Check filesystem for errors & repair them automatically + +Run the fsck command with 'a' option to perform consistency check & to repair them automatically, execute the following command. We can also use 'y' option in place of option 'a'. + + **$ fsck -a /dev/sdb1** + +### Check filesystem for errors but don't repait them + +In case we only need to see the error that are occurring on our file system & dont need to repair them, than we should run fsck with option 'n', + + **$ fsck -n /dev/sdb1** + +### Perform an error check on all partitions + +To perform a filesystem check for all partitions in single go, use fsck with 'A' option, + + **$ fsck -A** + +To disable the root file system check, we will use the option 'R' + + **$ fsck -AR** + +### Check only partition with mentioned filesystem + +In order to run fsck on all the partitiions with mentioned filesystem type, for example 'ext4', use fsck with option 't' followed by filesystem type, + + **$ fsck -t ext4 /dev/sdb1** + +or + + **$ fsck -t -A ext4** + +### Perform consistency check only on unmounted drives + +To make sure that the fsck is performed only on unmounted drives, we will use option 'M' while running fsck, + + **$ fsck -AM** + +This was our tutorial on fsck command with examples. Please feel free to send in your questions or queries to us, using the comment box below. + + +-------------------------------------------------------------------------------- + +via: http://linuxtechlab.com/linux-filesystem-errors-fsck-command-with-examples/ + +作者:[Shusain][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxtechlab.com/author/shsuain/ +[1]:http://linuxtechlab.com/learn-use-tcpdump-command-examples/ From 60fcc496d57cc28d253fe4cbbc14bbe078bb0948 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 26 Dec 2017 21:58:35 +0800 Subject: [PATCH 004/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Learn=20how=20to?= =?UTF-8?q?=20use=20tcpdump=20command=20with=20examples?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow to use tcpdump command with examples.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/tech/20171109 Learn how to use tcpdump command with examples.md diff --git a/sources/tech/20171109 Learn how to use tcpdump command with examples.md b/sources/tech/20171109 Learn how to use tcpdump command with examples.md new file mode 100644 index 0000000000..7df944aacf --- /dev/null +++ b/sources/tech/20171109 Learn how to use tcpdump command with examples.md @@ -0,0 +1,136 @@ +translating by lujun9972 +Learn how to use tcpdump command with examples +====== +Tcpdump command is a famous network packet analysing tool that is used to display TCP\IP & other network packets being transmitted over the network attached to the system on which tcpdump has been installed. Tcpdump uses libpcap library to capture the network packets & is available on almost all Linux/Unix flavors. + +Tcpdump command can read the contents from a network interface or from a previously created packet file or we can also write the packets to a file to be used for later. One must use the tcpdump command as root or as a user with sudo privileges. + +In this tutorial, we are going to discuss the uses of tcpdump command along with some examples, but first let's start with installation of tcpdump on various Linux OS. + + **(Recommended Read:[Monitoring network bandwidth with iftop command][1])** + +### Installation + +By default, tcpdump is available on almost all Linux distributions but if that's not the case for you, install it on your system using the following method. + + **CentOS/RHEL** + +Install tcpdump on CentOS & RHEL using the following command , + + **$ sudo yum install tcpdump** + + **Fedora** + +On Fedora, install tcpdump using the following command, + + **$ dnf install tcpdump** + + **Ubuntu/Debian/Linux Mint** + +On Ubuntu or Debian or Linux Mint, install tcp dumo using the following command, + + **$ apt-get install tcpdump** + +Now that we have install tcpdump on our systems, let's discuss some examples for tcpdump. + +### Examples + + **Get packets from all interfaces** + +To get the network packets from all network interfaces, run the following command, + + **$ tcpdump -i any** + +**Get packets from a single interfaces** + +To get the network packets from a single interface, use + + **$ tcpdump -i eth0** + +**Writing captured packets to file** + +To write all the captured packets to a file, use the '-w' option, + + **$ tcpdump -i eth1 -w packets_file** + +**Reading an old tcpdump file** + +To read an already created, old tcpdump file, use the following command, + + **$ tcpdump -r packets_file** + +**Getting more packets information with readable timestamps** + +To get more information regarding the packets along with readable timestamp, use + + **$ tcpdump -ttttnnvvS** + +**Check packets of whole network** + +To get the packets for whole network, execute the following command from terminal + + **$ tcpdump net 192.168.1.0/24** + +**Check packets based on IP address** + +Get all the packets based on the IP address, whether source or destination or both, using the following command, + + **$ tcpdump host 192.168.1.100** + +To get packets based on source or destination of an IP address, use + + **$ tcpdump src 192.168.1.100** + + **$ tcpdump dst 192.168.1.100** + +**Check packets for a protocol or port number** + +To check all the packets used based on the protocol, run the following command + + **$ tcpdump ssh** + +To get packets for a single port ot for a range of ports, use + + **$ tcpdump port 22** + + **$ tcpdump portrange 22-125** + +We can also use ** 'src'** & **' dst'** options to get packets for ports based on source & destination. + +We can also combine two conditions with AND (and , && ), OR ( or. || ) & EXCEPT (not , ! ). This helps when we have analyze network packets based on the some condtions. + +**Using AND** +We can use 'and' or symbol '&&' to combine two conditions or mote with tcpdump. An example would be, + + **$ tcpdump src 192.168.1.100 && port 22 -w ssh_packets** + +**Using OR** + +OR will check the command agtcpdump -i eth0 src port not 22ainst one the mentioned conditions in the command, like + + **$ tcpdump src 192.168.1.100 or dst 192.168.1.50 && port 22 -w ssh_packets** + + **$ tcpdump port 443 or 80 -w http_packets** + +**Using EXCEPT** + +EXCEPT will be used when we want not fulfill a condition, like + + **$ tcpdump -i eth0 src port not 22** + +This will monitor all the traffic on eth0 but will not capture port 22. + +This was our tutorial on how to install & use tcpdump command to capture the network packets. Please feel free to send in any queries or suggestions using the comment box below. + +-------------------------------------------------------------------------------- + +via: http://linuxtechlab.com/learn-use-tcpdump-command-examples/ + +作者:[Shusain ][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxtechlab.com/author/shsuain/ +[1]:http://linuxtechlab.com/monitoring-network-bandwidth-iftop-command/ From 7e41758fb7e99f4e0e75bad23940e237f6d0eff1 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Dec 2017 09:00:46 +0800 Subject: [PATCH 005/133] PRF:20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wangy325 翻译的很好!不过以后不要改文件名。 --- ...EN SOURCE TECHNOLOGY TRENDS FOR 2018_CN.md | 79 +++++++++---------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/translated/tech/20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018_CN.md b/translated/tech/20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018_CN.md index ab5e952bf7..2753f61e11 100644 --- a/translated/tech/20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018_CN.md +++ b/translated/tech/20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018_CN.md @@ -1,112 +1,111 @@ 2018 年开源技术 10 大发展趋势 ============================================================ -### 你是否关注过开源技术的发展趋势? +> 你是否关注过开源技术的发展趋势? 这里是 10 个预测。 ![2018 年开源技术的 10 大发展趋势](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fireworks-newyear-celebrate.png?itok=6gXaznov "10 open source technology trends for 2018") -图片来源:[Mitch Bennett][10]. [Opensource.com][31] 修改 +*图片来源:[Mitch Bennett][10]. [Opensource.com][31] 修改* -科技一直在发展,诸如OpenStack,PWAs,Rust,R,认知云,人工智能(AI),物联网等一些新技术正在颠覆我们对世界的固有认知。以下是 2018 年最可能成为主流的开源技术纲要。 +技术一直在变革,诸如 OpenStack、增强型网页应用Progressive Web App(PWA)、Rust、R、认知云the cognitive cloud、人工智能(AI),物联网等一些新技术正在颠覆我们对世界的固有认知。以下概述了 2018 年最可能成为主流的开源技术。 -### 1\. OpenStack 认可度持续高涨 +### 1、 OpenStack 认可度持续高涨 [OpenStack][12] 本质上是一个云操作平台(系统),它为管理员提供直观友好的控制面板,以便对大量的计算、存储和网络资源进行配置和监管。 -目前,很多企业运用 OpenStack 平台搭建和管理云计算系统。得益于其灵活的生态系统、透明度和运行速度,OpenStack 越来越流行。相比其他替代方案,OpenStatic 只需更少的花费便能轻松支持任务关键型应用程序。 -但是,复杂的结构以及其对虚拟化、服务器、额外网络资源的严重依赖使得其它一些企业对使用 OpenStack 心存顾虑。另外,想要用好 OpenStack,好的硬件支持和高水平的员工二者缺一不可。 +目前,很多企业运用 OpenStack 平台搭建和管理云计算系统。得益于其灵活的生态系统、透明度和运行速度,OpenStack 越来越流行。相比其他替代方案,OpenStack 只需更少的花费便能轻松支持任务关键型应用程序。 +但是,其复杂的结构以及其对虚拟化、服务器和大量网络资源的严重依赖使得不少企业对使用 OpenStack 心存顾虑。另外,想要用好 OpenStack,好的硬件支持和高水平的员工二者缺一不可。 -OpenStack 基金会一直在致力于完善他们的产品。不管发布与否的一些小的功能创新,都会解决 OpenStack 的潜在问题。随着其结构复杂性降低,OpenStack 将获取更大认可。加之众多大型软件开发和托管公司以及成千上万会员的支持, OpenStack 在云计算时代前途光明。 +OpenStack 基金会一直在致力于完善他们的产品。一些功能创新,无论是已经发布的还是尚处于打造阶段,都将解决许多 OpenStack 潜在的问题。随着其结构复杂性降低,OpenStack 将获取更大认可。加之众多大型的软件开发及托管公司以及成千上万会员的支持, OpenStack 在云计算时代前途光明。 -### 2\. PWA 或将大热 +### 2、 PWA 或将大热 -PWA,即 [增强型网页应用][13],是技术、设计和网络应用程序接口(web APIs)的集合,它能够在移动浏览器上提供类似应用程序的体验 +PWA,即 [增强型网页应用][13]Progressive Web App,是对技术、设计和网络应用程序接口Web API的整合,它能够在移动浏览器上提供类似应用的体验。 -传统的网页有许多与生俱来的缺点。虽然应用程序提供了一个比网页更加个性化、用户参与度更高的体验,但是却要占用大量的系统资源;并且要想使用应用,你还必须提前下载安装。PWA 则扬长避短,它为浏览器、可变引擎搜索框和其他一些操作作出响应,为用户提供应用程序般的体验。PWA 也能像应用程序一样自动更新显示最新的信息,基于网页的 HTTPS 模式又让其更加安全。PWA 运行于标准容器中,无须安装,只要输入 URL 即可。 +传统的网站有许多与生俱来的缺点。虽然应用(app)提供了比网站更加个性化、用户参与度更高的体验,但是却要占用大量的系统资源;并且要想使用应用,你还必须提前下载安装。PWA 则扬长避短,它可用浏览器访问、可被引擎搜索检索,并可响应式适应外在环境,为用户提供应用级体验。PWA 也能像应用一样自我更新,总是显示最新的实时信息,并且像网站一样,以极其安全的 HTTPS 模式递交信息。PWA 运行于标准容器中,无须安装,任何人只要输入 URL 即可访问。 现在的移动用户看重便利性和参与度,PWAs 的特性完美契合这一需求,所以 PWA 成为主流是必然趋势。 -### 3\. Rust 成开发者新宠 +### 3、 Rust 成开发者新宠 -大多数的编程语言都在安全性和控制二者之间折衷,[Rust][14] 是一个例外。Rust 使用广泛的编译时间检查进行 100% 的控制而不影响程序安全性。上一次 [Pwn2Own][15] 竞赛找出了 Firefox C++ 底层实现的许多严重漏洞。如果 Firefox 是用 Rust 编写的,这些漏洞在产品发布之前的编译阶段就会被发现并解决。 +大多数的编程语言都需在安全和控制二者之间折衷,但 [Rust][14] 是一个例外。Rust 使用广泛的编译时检查进行 100% 的控制而不影响程序安全性。上一次 [Pwn2Own][15] 竞赛找出了 Firefox C++ 底层实现的许多严重漏洞。如果 Firefox 是用 Rust 编写的,这些漏洞在产品发布之前的编译阶段就会被发现并解决。 -Rust 独特的内建单元测试方法使开发者们考虑将其作为首选开源语言。它是 C 和 Python 等其他编程语言有效的替代方案,Rust 可以在不丢失程序可读性的情况下写出安全的代码。总之,Rust 前途光明。 +Rust 独特的内建单元测试方式使开发者们考虑将其作为首选的开源语言。它是 C 和 Python 等其他编程语言有效的替代方案,Rust 可以在不损失程序可读性的情况下写出安全的代码。总之,Rust 前途光明。 -### 4\. R 用户群在壮大 +### 4、 R 用户群在壮大 -[R][16] 编程语言,是一个与统计计算和图像呈现相关的 [*GUN* 项目][32]。它提供了大量的统计和图形技术,并且可扩展引导。它是 [S][17] 语言的延续。S 语言早已成为统计方法学的首选工具,R 为数据操作、计算和图形显示提供了开源选择。R 语言的另一个优势是对细节的把控和对细微差别的关注。 +[R][16] 编程语言,是一个与统计计算和图像呈现相关的 [GUN 项目][32]。它提供了大量的统计和图形技术,并且可扩展增强。它是 [S][17] 语言的延续。S 语言早已成为统计方法学的首选工具,R 为数据操作、计算和图形显示提供了开源选择。R 语言的另一个优势是对细节的把控和对细微差别的关注。 和 Rust 一样,R 语言也处于上升期。 -### 5\. 广义的 XaaS +### 5、 广义的 XaaS -XaaS 是 ”一切都是服务“ 的缩写,是通过网络提供的各种线上服务的总称。XaaS 的外延正在扩大,软件服务(SaaS),基础设施服务(IaaS) 和平台服务(PaaS)等观念已深入人心,新兴的基于云的服务如网络服务(NaaS),存储服务(SaaS 或StaaS),监控服务(MaaS)以及通信服务(CaaS)等概念也正在普及。我们正在迈向一个 ”一切都是服务“ 的世界。 +XaaS 是 “一切皆服务anything as a service” 的缩写,是通过网络提供的各种线上服务的总称。XaaS 的外延正在扩大,软件即服务(SaaS)、基础设施即服务(IaaS) 和平台即服务(PaaS)等观念已深入人心,新兴的基于云的服务如网络即服务(NaaS)、存储即服务(SaaS 或 StaaS)、监控即服务(MaaS)以及通信即服务(CaaS)等概念也正在普及。我们正在迈向一个万事万物 “皆为服务” 的世界。 现在,XaaS 的概念已经延伸到实体企业。著名的例子有 Uber 、Lyft 和 Airbnb,前二者利用新科技提供交通服务,后者提供住宿服务。 -高速网络和服务器虚拟化使得强大的计算能力成为可能,这加速了XaaS的发展,2018 年可能是 ”XaaS 年‘’。XaaS 无与伦比的灵活性、可扩展性将推动 XaaS 进一步发展。 +高速网络和服务器虚拟化使得强大的计算能力成为可能,这加速了 XaaS 的发展,2018 年可能是 “XaaS 年”。XaaS 无与伦比的灵活性、可扩展性将推动 XaaS 进一步发展。 -### 6\. 容器技术越来越受欢迎 +### 6、 容器技术越来越受欢迎 -[容器技术][28],是用标准化方法打包代码的技术,它使得代码能够在任意环境中快速地 ”接入和运行“。容器技术使企业削减花费、更快运行程序。尽管容器技术在 IT 基础结构改革方面的潜力已经表现的很明显,事实上,运用好容器技术仍然是一个难题。 +[容器技术][28],是用标准化方法打包代码的技术,它使得代码能够在任意环境中快速地 “接入并运行”。容器技术让企业可以削减经费、降低实施周期。尽管容器技术在 IT 基础结构改革方面的已经初显潜力,但事实上,运用好容器技术仍然比较复杂。 容器技术仍在发展中,技术复杂性随着各方面的进步在下降。最新的技术让容器使用起来像使用智能手机一样简单、直观,更不用说现在的企业需求:速度和灵活性往往能决定业务成败。 -### 7\. 机器学习和人工智能的更广泛应用 +### 7、 机器学习和人工智能的更广泛应用 [机器学习和人工智能][18] 指在没有程序员给出明确的编码指令的情况下,机器具备自主学习并且积累经验自我改进的能力。 随着一些开源技术利用机器学习和人工智能实现尖端服务和应用,这两项技术已经深入人心。 -[Gartner][19] 预测,2018 年机器学习和人工智能的应用会更广。其他一些领域诸如数据准备、集成、算法选择、方法选择、模块制造等随着机器学习的加入将会取得很大进步。 +[Gartner][19] 预测,2018 年机器学习和人工智能的应用会更广。其他一些领域诸如数据准备、集成、算法选择、学习方法选择、模块制造等随着机器学习的加入将会取得很大进步。 全新的智能开源解决方案将改变人们和系统交互的方式,转变由来已久的工作观念。 -* 机器交互,像[自助语音聊天程序][29]这样的对话平台,提供“问与答”的体验——用户提出问题,对话平台作出回应。 -* 无人驾驶和无人机现在已经家喻户晓了,2018年将会更司空见惯。 +* 机器交互,像[聊天机器人][29]这样的对话平台,提供“问与答”的体验——用户提出问题,对话平台作出回应,成为人机之间默认的交互界面。 +* 无人驾驶和无人机现在已经家喻户晓了,2018 年将会更司空见惯。 * 沉浸式体验的应用不再仅仅局限于视频游戏,在真实的生活场景比如设计、培训和可视化过程中都能看到沉浸式体验的身影。 -### 8. 数据区块链将成为主流 +### 8、 区块链将成为主流 -自比特币应用数据区块链技术以来,其已经取得了重大进展,并且已广泛应用在金融系统、保密选举、学历验证、等领域中。未来几年,区块链会在医疗、制造业、供应链物流、政府服务等领域中大展拳脚。 +自比特币应用区块链技术以来,其已经取得了重大进展,并且已广泛应用在金融系统、保密选举、学历验证等领域中。未来几年,区块链会在医疗、制造业、供应链物流、政府服务等领域中大展拳脚。 -数据区块链分布式存储数据信息,这些数据信息依赖于数百万个共享数据库的节点。数据区块不被任意单一所有者控制,并且单个损坏的节点不影响其正常运行,数据区块链的这两个特性让它异常健康、透明、不可破坏。同时也规避了有人从中篡改数据的风险。数据区块链强大的先天优势足够支撑其成为将来主流技术。 +区块链分布式存储数据信息,这些数据信息依赖于数百万个共享数据库的节点。区块链不被任意单一所有者控制,并且单个损坏的节点不影响其正常运行,区块链的这两个特性让它异常健壮、透明、不可破坏。同时也规避了有人从中篡改数据的风险。区块链强大的先天优势足够支撑其成为将来主流技术。 -### 9.认知云粉墨登场 +### 9、 认知云粉墨登场 -认识技术,如前所述的机器学习和人工智能,用于为多行业提供简单化和个性化服务。一个典型例子是金融行业的游戏化应用,其为投资者提供严谨的投资建议,降低投资模块的复杂程度。数字信托平台使得金融机构的身份认证过程较以前精简80%,提升了协议遵守率,降低了诈骗率。 +认识技术,比如前面所述的机器学习和人工智能,用于为多行业提供简单化和个性化服务。一个典型例子是金融行业的游戏化应用,其为投资者提供了严谨的投资建议,降低投资模块的复杂程度。数字信托平台使得金融机构的身份认证过程较以前精简 80%,提升了合规性,降低了诈骗比率。 -认知云技术现在正向云端迁移,借助云,它将更加强大。[IBM Watson][33] 是认知云应用最知名的例子。IBM 的 UIMA 架构是开源的,由 Apache 负责维护。DARPA(美国国防高级研究计划局) 的 DeepDive 项目借鉴 Watson 的机器学习能力,通过不断学习人类行为来增强决断能力。另一个开源平台 [OpenCog][34] ,为开发者和数据科学家开发人工智能应用程序提供支撑。 +认知云技术现在正向云端迁移,借助云,它将更加强大。[IBM Watson][33] 是认知云应用最知名的例子。IBM 的 UIMA 架构是开源的,由 Apache 基金会负责维护。DARPA(美国国防高级研究计划局)的 DeepDive 项目借鉴了 Watson 的机器学习能力,通过不断学习人类行为来增强决策能力。另一个开源平台 [OpenCog][34] ,为开发者和数据科学家开发人工智能应用程序提供支撑。 -考虑到实现先进的、个性化的用户体验风险较高,这些认知云平台决定来年时机成熟,再粉墨登场。 +考虑到实现先进的、个性化的用户体验风险较高,这些认知云平台来年时机成熟时才会粉墨登场。 -### 10.物联网智联万物 +### 10、 物联网智联万物 -物联网(IoT)的核心在于建立小到嵌入式传感器、大至计算机设备的相互连接,让其(“事物”)相互之间可以收发数据。毫无疑问,物联网将会是科技届的下一个 “搅局者”,但物联网本身处于一个不断变化的状态。 +物联网(IoT)的核心在于建立小到嵌入式传感器、大至计算机设备的相互连接,让其(“物”)相互之间可以收发数据。毫无疑问,物联网将会是科技界的下一个 “搅局者”,但物联网本身处于一个不断变化的状态。 -物联网最广为人知的产品就是 IBM 和三星合力打造的去中心化P2P自动遥测系统([ADEPT][20])。它运用和区块链类似的技术来构建一个去中心化的物联网。没有中央控制设备,”事物“ 之间通过自主交流来进行升级软件、处理bug、管理电源等等一系列操作。 +物联网最广为人知的产品就是 IBM 和三星合力打造的去中心化 P2P 自动遥测系统([ADEPT][20])。它运用和区块链类似的技术来构建一个去中心化的物联网。没有中央控制设备,“物” 之间通过自主交流来进行升级软件、处理 bug、管理电源等等一系列操作。 ### 开源推动技术创新 -[数字中断][30]是当今以科技为中心的时代的常态。在技术领域,开放源代码正在逐渐普及,其在2018将年成为大多数科技创新的驱动力。 +[数字化颠覆][30]是当今以科技为中心的时代的常态。在技术领域,开放源代码正在逐渐普及,其在 2018 将年成为大多数技术创新的驱动力。 此榜单对开源技术趋势的预测有遗漏?在评论区告诉我们吧! -*文章标签:* [ `商业` ][25] [ `年鉴` ][26] [ `2017开源年鉴` ][27] ### 关于作者 ![Sreejith Omanakuttan](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/brain_2.jpg?itok=9PkPTyrV) -[**Sreejith Omanakuttan**][21] - 自 2000 年开始编程,2007年开始从事专业工作。目前在 [Fingent][6] 领导开源团队,工作内容涵盖不同的技术层面,从“无聊的工作”(?)到前沿科技。有一套 “构建—修复—推倒重来” 工作哲学。在领英上关注我:https://www.linkedin.com/in/futuregeek/ +[**Sreejith Omanakuttan**][21] - 自 2000 年开始编程,2007年开始从事专业工作。目前在 [Fingent][6] 领导开源团队,工作内容涵盖不同的技术层面,从“无聊的工作”(?)到前沿科技。有一套 “构建—修复—推倒重来” 工作哲学。在领英上关注我: https://www.linkedin.com/in/futuregeek/ -------------------------------------------------------------------------------- -原文链接: https://opensource.com/article/17/11/10-open-source-technology-trends-2018 +via: https://opensource.com/article/17/11/10-open-source-technology-trends-2018 -作者:[Sreejith ][a] +作者:[Sreejith Omanakuttan][a] 译者:[wangy325](https://github.com/wangy25) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a20f57a450306e5097c1df40aaecbde9ec179e88 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Dec 2017 09:01:15 +0800 Subject: [PATCH 006/133] PUB:20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018 @wangy325 https://linux.cn/article-9178-1.html --- .../20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018_CN.md => published/20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018.md (100%) diff --git a/translated/tech/20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018_CN.md b/published/20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018.md similarity index 100% rename from translated/tech/20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018_CN.md rename to published/20171129 10 OPEN SOURCE TECHNOLOGY TRENDS FOR 2018.md From 5e124aac7038a2f114d8d6856b718badeb3463c1 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Dec 2017 10:47:40 +0800 Subject: [PATCH 007/133] PRF&PUB:20171114 Sysadmin 101 Patch Management.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @haoqixu 翻译的很好!https://linux.cn/article-9179-1.html --- .../20171114 Sysadmin 101 Patch Management.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename {translated/tech => published}/20171114 Sysadmin 101 Patch Management.md (69%) diff --git a/translated/tech/20171114 Sysadmin 101 Patch Management.md b/published/20171114 Sysadmin 101 Patch Management.md similarity index 69% rename from translated/tech/20171114 Sysadmin 101 Patch Management.md rename to published/20171114 Sysadmin 101 Patch Management.md index 4a7a223ccf..895c0d0489 100644 --- a/translated/tech/20171114 Sysadmin 101 Patch Management.md +++ b/published/20171114 Sysadmin 101 Patch Management.md @@ -1,15 +1,15 @@ 系统管理 101:补丁管理 ============================================================ -就在之前几篇文章,我开始了“系统管理 101”系列文章,用来记录现今许多初级系统管理员,DevOps 工程师或者“全栈”开发者可能不曾接触过的一些系统管理方面的基本知识。按照我原本的设想,该系列文章已经是完结了的。然而后来 WannaCry 恶意软件出现并在补丁管理不善的 Windows 主机网络间爆发。我能想象到那些仍然深陷 2000 年代 Linux 与 Windows 争论的读者听到这个消息可能已经面露优越的微笑。 +就在之前几篇文章,我开始了“系统管理 101”系列文章,用来记录现今许多初级系统管理员、DevOps 工程师或者“全栈”开发者可能不曾接触过的一些系统管理方面的基本知识。按照我原本的设想,该系列文章已经是完结了的。然而后来 WannaCry 恶意软件出现,并在补丁管理不善的 Windows 主机网络间爆发。我能想象到那些仍然深陷 2000 年代 Linux 与 Windows 争论的读者听到这个消息可能已经面露优越的微笑。 -我之所以这么快就决定再次继续“系统管理 101”文章系列,是因为我意识到在补丁管理方面一些 Linux 系统管理员和 Windows 系统管理员没有差别。实话说,在一些方面甚至做的更差(特别是以运行时间为豪)。所以,这篇文章会涉及 Linux 下补丁管理的基础概念,包括良好的补丁管理该是怎样的,你可能会用到的一些相关工具,以及整个补丁安装过程是如何进行的。 +我之所以这么快就决定再次继续“系统管理 101”文章系列,是因为我意识到在补丁管理方面一些 Linux 系统管理员和 Windows 系统管理员没有差别。实话说,在一些方面甚至做的更差(特别是以持续运行时间为自豪)。所以,这篇文章会涉及 Linux 下补丁管理的基础概念,包括良好的补丁管理该是怎样的,你可能会用到的一些相关工具,以及整个补丁安装过程是如何进行的。 ### 什么是补丁管理? 我所说的补丁管理,是指你部署用于升级服务器上软件的系统,不仅仅是把软件更新到最新最好的前沿版本。即使是像 Debian 这样为了“稳定性”持续保持某一特定版本软件的保守派发行版,也会时常发布升级补丁用于修补错误和安全漏洞。 -当然,因为开发者对最新最好版本的需求,你需要派生软件源码并做出修改,或者因为你喜欢给自己额外的工作量,你的组织可能会决定自己维护特定软件的版本,这时你就会遇到问题。理想情况下,你应该已经配置好你的系统,让它在自动构建和打包定制版本软件时使用其它软件所用的同一套持续集成系统。然而,许多系统管理员仍旧在自己的本地主机上按照维基上的文档(但愿是最新的文档)使用过时的方法打包软件。不论使用哪种方法,你都需要明确你所使用的版本有没有安全缺陷,如果有,那必须确保新补丁安装到你定制版本的软件上了。 +当然,如果你的组织决定自己维护特定软件的版本,要么是因为开发者有最新最好版本的需求,需要派生软件源码并做出修改,要么是因为你喜欢给自己额外的工作量,这时你就会遇到问题。理想情况下,你应该已经配置好你的系统,让它在自动构建和打包定制版本软件时使用其它软件所用的同一套持续集成系统。然而,许多系统管理员仍旧在自己的本地主机上按照维基上的文档(但愿是最新的文档)使用过时的方法打包软件。不论使用哪种方法,你都需要明确你所使用的版本有没有安全缺陷,如果有,那必须确保新补丁安装到你定制版本的软件上了。 ### 良好的补丁管理是怎样的 @@ -17,17 +17,17 @@ 一些组织仍在使用手动方式管理补丁。在这种方式下,当出现一个安全补丁,系统管理员就要凭借记忆,登录到各个服务器上进行检查。在确定了哪些服务器需要升级后,再使用服务器内建的包管理工具从发行版仓库升级这些软件。最后以相同的方式升级剩余的所有服务器。 -手动管理补丁的方式存在很多问题。首先,这么做会使补丁安装成为一个苦力活,安装补丁需要越多人力成本,系统管理员就越可能推迟甚至完全忽略它。其次,手动管理方式依赖系统管理员凭借记忆去跟踪他或她所负责的服务器的升级情况。这非常容易导致有些服务器被遗漏而未能及时升级。 +手动管理补丁的方式存在很多问题。首先,这么做会使补丁安装成为一个苦力活,安装补丁越多就需要越多人力成本,系统管理员就越可能推迟甚至完全忽略它。其次,手动管理方式依赖系统管理员凭借记忆去跟踪他或她所负责的服务器的升级情况。这非常容易导致有些服务器被遗漏而未能及时升级。 -补丁管理越快速简便,你就越可能把它做好。你应该构建一个系统,用来快速查询哪些服务器运行着特定的软件,以及这些软件的版本号,而且它最好还能够推送各种升级补丁。就个人而言,我倾向于使用 MCollective 这样的编排工具来完成这个任务,但是红帽提供的 Satellite 以及 Canonical 提供的 Landscape 也可以让你在统一的管理接口查看服务器上软件的版本信息,并且安装补丁。 +补丁管理越快速简便,你就越可能把它做好。你应该构建一个系统,用来快速查询哪些服务器运行着特定的软件,以及这些软件的版本号,而且它最好还能够推送各种升级补丁。就个人而言,我倾向于使用 MCollective 这样的编排工具来完成这个任务,但是红帽提供的 Satellite 以及 Canonical 提供的 Landscape 也可以让你在统一的管理界面上查看服务器的软件版本信息,并且安装补丁。 -补丁安装还应该具有容错能力。你应该具备在不下线的情况下为服务安装补丁的能力。这同样适用于需要重启系统的内核补丁。我采用的方法是把我的服务器划分为不同的高可用组,lb1,app1,rabbitmq1 和 db1 在一个组,而lb2,app2,rabbitmq2 和 db2 在另一个组。这样,我就能一次升级一个组,而无须下线服务。 +补丁安装还应该具有容错能力。你应该具备在不下线的情况下为服务安装补丁的能力。这同样适用于需要重启系统的内核补丁。我采用的方法是把我的服务器划分为不同的高可用组,lb1、app1、rabbitmq1 和 db1 在一个组,而lb2、app2、rabbitmq2 和 db2 在另一个组。这样,我就能一次升级一个组,而无须下线服务。 所以,多快才能算快呢?对于少数没有附带服务的软件,你的系统最快应该能够在几分钟到一小时内安装好补丁(例如 bash 的 ShellShock 漏洞)。对于像 OpenSSL 这样需要重启服务的软件,以容错的方式安装补丁并重启服务的过程可能会花费稍多的时间,但这就是编排工具派上用场的时候。我在最近的关于 MCollective 的文章中(查看 2016 年 12 月和 2017 年 1 月的工单)给了几个使用 MCollective 实现补丁管理的例子。你最好能够部署一个系统,以具备容错性的自动化方式简化补丁安装和服务重启的过程。 如果补丁要求重启系统,像内核补丁,那它会花费更多的时间。再次强调,自动化和编排工具能够让这个过程比你想象的还要快。我能够在一到两个小时内在生产环境中以容错方式升级并重启服务器,如果重启之间无须等待集群同步备份,这个过程还能更快。 -不幸的是,许多系统管理员仍坚信过时的观点,把运行时间作为一种骄傲的象征——鉴于紧急内核补丁大约每年一次。对于我来说,这只能说明你没有认真对待系统的安全性。 +不幸的是,许多系统管理员仍坚信过时的观点,把持续运行时间(uptime)作为一种骄傲的象征——鉴于紧急内核补丁大约每年一次。对于我来说,这只能说明你没有认真对待系统的安全性! 很多组织仍然使用无法暂时下线的单点故障的服务器,也因为这个原因,它无法升级或者重启。如果你想让系统更加安全,你需要去除过时的包袱,搭建一个至少能在深夜维护时段重启的系统。 @@ -41,9 +41,9 @@ Kyle Rankin 是高级安全与基础设施架构师,其著作包括: Linux H via: https://www.linuxjournal.com/content/sysadmin-101-patch-management -作者:[Kyle Rankin ][a] +作者:[Kyle Rankin][a] 译者:[haoqixu](https://github.com/haoqixu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d280da14beaefe0c5f28c7bfd41ac369b47007b8 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Dec 2017 10:56:20 +0800 Subject: [PATCH 008/133] PRF&PUB:20171208 The Biggest Problems With UC Browser.md @geekpi --- .../20171208 The Biggest Problems With UC Browser.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) rename {translated/tech => published}/20171208 The Biggest Problems With UC Browser.md (86%) diff --git a/translated/tech/20171208 The Biggest Problems With UC Browser.md b/published/20171208 The Biggest Problems With UC Browser.md similarity index 86% rename from translated/tech/20171208 The Biggest Problems With UC Browser.md rename to published/20171208 The Biggest Problems With UC Browser.md index 636adf2b99..5a43480bf6 100644 --- a/translated/tech/20171208 The Biggest Problems With UC Browser.md +++ b/published/20171208 The Biggest Problems With UC Browser.md @@ -1,10 +1,11 @@ UC 浏览器最大的问题 ====== -在我们开始谈论缺点之前,我要確定的事实是过去 3 年来,我一直是一个忠实的 UC 浏览器用户。我真的很喜欢它的下载速度,超时尚的用户界面和工具上引人注目的图标。我一开始是 Android 上的 Chrome 用户,但我在朋友的推荐下开始使用 UC。但在过去的一年左右,我看到了一些东西让我重新思考我的选择,现在我感觉我要重新回到 Chrome。 -### 不需要的 **通知** +在我们开始谈论缺点之前,我要确定的事实是过去 3 年来,我一直是一个忠实的 UC 浏览器用户。我真的很喜欢它的下载速度,超时尚的用户界面和工具上引人注目的图标。我一开始是 Android 上的 Chrome 用户,但我在朋友的推荐下开始使用 UC。但在过去的一年左右,我看到了一些东西让我重新思考我的选择,现在我感觉我要重新回到 Chrome。 -我相信我不是唯一一个每几个小时内就收到这些不需要的通知的人。这些欺骗点击文章真的很糟糕,最糟糕的部分是你每隔几个小时就会收到一次。 +### 不需要的**通知** + +我相信我不是唯一一个每几个小时内就收到这些不需要的通知的人。这些欺骗点击的文章真的很糟糕,最糟糕的部分是你每隔几个小时就会收到一次。 [![uc browser's annoying ads notifications][1]][1] @@ -28,7 +29,7 @@ UC 浏览器在浏览器中集成了一个**音乐播放器**来播放音乐。 [![uc browser adds uc music player][4]][4] -它甚至不是在后台直接播放来自网络的音频。相反,它是一个播放离线音乐的音乐播放器。所以为什么要它?我的意思是,它甚至不够好到作为主要音乐播放器。即使它是,它不能独立于 UC 浏览器运行。所以为什么会有人运行将他/她的浏览器只是为了使用你的音乐播放器? +它甚至不是在后台直接播放来自网络的音频。相反,它是一个播放离线音乐的音乐播放器。所以为什么要它?我的意思是,它甚至没有好到可以作为主要音乐播放器。即使它足够好,它也不能独立于 UC 浏览器运行。所以为什么会有人运行将他/她的浏览器只是为了使用你的音乐播放器? ### **快速**访问栏 @@ -52,7 +53,7 @@ via: https://www.theitstuff.com/biggest-problems-uc-browser 作者:[Rishabh Kandari][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9f55542caa7cae1287259caaf9d2fb14c5860e99 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Dec 2017 11:23:42 +0800 Subject: [PATCH 009/133] PRF&PUB:20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md @lujun9972 --- ... on a Linux - Unix - OS X - BSD Systems.md | 76 +++++++++++++++++++ ... on a Linux - Unix - OS X - BSD Systems.md | 55 -------------- 2 files changed, 76 insertions(+), 55 deletions(-) create mode 100644 published/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md delete mode 100644 translated/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md diff --git a/published/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md b/published/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md new file mode 100644 index 0000000000..3f9ca163cb --- /dev/null +++ b/published/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md @@ -0,0 +1,76 @@ +修复 Linux / Unix / OS X / BSD 系统控制台上的显示乱码 +====== + +有时我的探索会在屏幕上输出一些奇怪的东西。比如,有一次我不小心用 `cat` 命令查看了一下二进制文件的内容 —— `cat /sbin/*`。这种情况下你将无法再访问终端里的 bash/ksh/zsh 了。大量的奇怪字符充斥了你的终端。这些字符会隐藏你输入的内容和要显示的字符,取而代之的是一些奇怪的符号。要清理掉这些屏幕上的垃圾可以使用以下方法。本文就将向你描述在 Linux/ 类 Unix 系统中如何真正清理终端屏幕或者重置终端。 + +### clear 命令 + +`clear` 命令会清理掉屏幕内容,连带它的回滚缓存区一起也会被清理掉。(LCTT 译注:这种情况下你输入的字符回显也是乱码,不必担心,正确输入后回车即可生效。) + +``` +$ clear +``` + +你也可以按下 `CTRL+L` 来清理屏幕。然而,`clear` 命令并不会清理掉终端屏幕(LCTT 译注:这句话比较难理解,应该是指的运行 `clear` 命令并不是真正的把以前显示的内容删掉,你还是可以通过向上翻页看到之前显示的内容)。使用下面的方法才可以真正地清空终端,使你的终端恢复正常。 + +### 使用 reset 命令修复显示 + +下面图片中,控制台的屏幕上充满了垃圾信息: + +[![Fig.01:Bash fix the display][1]][2] + +要修复正常显示,只需要输入 `reset` 命令。它会为你再初始化一次终端: + +``` +$ reset +``` + +或者: + +``` +$ tput reset +``` + +如果 `reset` 命令还不行,那么输入下面命令来让绘画回复到正常状态: + +``` +$ stty sane +``` + +按下 `CTRL + L` 来清理屏幕(或者输入 `clear` 命令): + +``` +$ clear +``` + +### 使用 ANSI 转义序列来真正地清空 bash 终端 + +另一种选择是输入下面的 ANSI 转义序列: + +``` +clear +echo -e "\033c" +``` + +下面是这两个命令的输出示例: + +[![Animated gif 01:Fix Unix Console Gibberish Command Demo][3]][4] + +更多信息请阅读 `stty` 和 `reset` 的 man 页: stty(1),reset(1),bash(1)。 + + +-------------------------------------------------------------------------------- + +via: https://www.cyberciti.biz/tips/bash-fix-the-display.html + +作者:[Vivek Gite][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.cyberciti.biz +[1]:https://www.cyberciti.biz/media/new/tips/2006/08/bash-fix-terminal.png +[2]:https://www.cyberciti.biz/media/uploads/tips/2006/08/bash-fix-terminal.png +[3]:https://www.cyberciti.biz/media/new/tips/2006/08/unix-linux-console-gibberish.gif +[4]:https://www.cyberciti.biz/tips/bash-fix-the-display.html/unix-linux-console-gibberish diff --git a/translated/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md b/translated/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md deleted file mode 100644 index 285b3fe935..0000000000 --- a/translated/tech/20060808 Fix The Display and Console Gibberish on a Linux - Unix - OS X - BSD Systems.md +++ /dev/null @@ -1,55 +0,0 @@ -修复 Linux / Unix / OS X / BSD 系统 控制台上的显示垃圾 -====== -有时我的 R & D( 研究与发展??) 会在屏幕上输出一些奇怪的东西。比如,有一次我不小心用 cat 命令查看了一下二进制文件的内容 - `cat /sbin/*`。这种情况下你将无法再访问终端里的 bash/ksh/zsh 了。大量的奇怪字符充斥了你的终端 y。这些字符会隐藏你输入的内容和要显示的字符,取而代之的是一些奇怪的符号。要清理掉这些屏幕上的垃圾可以使用以下方法。本文就将向你描述在 Linux/ 类 Unix 系统中如何真正清理终端屏幕或者重置终端。 - - -## clear 命令 - -clear 命令会清理掉屏幕内容,连带它的回滚缓存区一起也会被清理掉。 -`$ clear` -你也可以按下 `CTRL+L` 来清理屏幕。然而,clear 命令并不会清理掉终端屏幕(译者注:这句话比较难理解,应该是指的运行 clear 命令并不是真正的把以前显示的内容删掉,你还是可以通过向上翻页看到之前显示的内容)。使用下面的方法才可以真正地清空终端,使你的终端恢复正常。 - -## 使用 reset 命令修复显示 - -下面图片中,控制台的屏幕上充满了垃圾信息: -[![Fig.01:Bash fix the display][1]][2] - -要修复正常显示,只需要输入 `reset` 命令。它会为你再初始化一次终端: -`$ reset` -或者 -`$ tput reset` - -如果 `reset` 命令还不行,那么输入下面命令来让绘画回复到正常状态: -`$ stty sane` - -按下 `CTRL + L` 来清理屏幕 (或者输入 clear 命令): -`$ clear` - -## 使用 ANSI 转义序列来真正地晴空 bash 终端 - -另一种选择是输入下面的 ANSI 转义序列: -``` -clear -echo -e "\033c" -``` - -下面是这两个命令的输出示例: -[![Animated gif 01:Fix Unix Console Gibberish Command Demo][3]][4] -更多信息请阅读 stty 和 reset 的 man 页 stty(1),reset(1),bash(1) - - --------------------------------------------------------------------------------- - -via: https://www.cyberciti.biz/tips/bash-fix-the-display.html - -作者:[Vivek Gite][a] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.cyberciti.biz -[1]:https://www.cyberciti.biz/media/new/tips/2006/08/bash-fix-terminal.png -[2]:https://www.cyberciti.biz/media/uploads/tips/2006/08/bash-fix-terminal.png -[3]:https://www.cyberciti.biz/media/new/tips/2006/08/unix-linux-console-gibberish.gif -[4]:https://www.cyberciti.biz/tips/bash-fix-the-display.html/unix-linux-console-gibberish From a49dd016428b6e1c2e2d58cadd01997586d7cb6f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 Dec 2017 14:16:06 +0800 Subject: [PATCH 010/133] translated --- ... to check System & Hardware Information.md | 98 ------------------- ... to check System & Hardware Information.md | 95 ++++++++++++++++++ 2 files changed, 95 insertions(+), 98 deletions(-) delete mode 100644 sources/tech/20170515 Commands to check System & Hardware Information.md create mode 100644 translated/tech/20170515 Commands to check System & Hardware Information.md diff --git a/sources/tech/20170515 Commands to check System & Hardware Information.md b/sources/tech/20170515 Commands to check System & Hardware Information.md deleted file mode 100644 index 317b3cb538..0000000000 --- a/sources/tech/20170515 Commands to check System & Hardware Information.md +++ /dev/null @@ -1,98 +0,0 @@ -translating---geekpi - -Commands to check System & Hardware Information -====== -Hello linux-fanatics, in this post i will be discussing some important that will make your life as System Administrator. As we all know being a good System Administrator means knowing everything about your IT Infrastructure & having all the information about your servers, whether its hardware or OS. So following commands will help you out in extracting out all the hardware & system information. - -#### 1- Viewing system information - -$ uname -a - -![uname command][2] - -It will provide you all the information about your system. It will provide you with Kernel name of system, Hostname, Kernel version, Kernel Release, Hardware name. - -#### 2- Viewing Hardware information - -$ lshw - -![lshw command][4] - -Using lshw will show you all the Hardware information on your screen. - -#### 3- Viewing Block Devices(Hard disks, Flash drives) information - -$ lsblk - -![lsblk command][6] - -lsblk command prints all the information regarding block devices on screen. Use lsblk -a to show all the block devices. - -#### 4- Viewing CPU information - -$ lscpu - -![lscpu command][8] - -lscpu shows all the CPU information on screen. - -#### 5- Viewing PCI information - -$ lspci - -![lspci command][10] - -All the network adapter cards, USB cards, Graphics cards are termed as PCIs. To view their information use lspci . - -lspci -v will give detailed information regarding PCI cards. - -lspci -t will show them in tree format. - -#### 6- Viewing USB information - -$ lsusb - -![lsusb command][12] - -To view information regarding all USB controllers & devices connected to them, we use lsusb - -#### 7- Viewing SCSI information - -$ lssci - -![lssci][14] - -To view SCSI information type lsscsi. lsscsi -s will also show the size of partition. - -#### 8- Viewing file system information - -$ fdisk -l - -![fdisk command][16] - -Using fdisk -l will show information regarding the file system. Although main function of fdisk utility is to modify a file system, you can create new partitions, delete old ones ( more on that in my future tutorial). - -That's it for now my fellow Linux-fanatics . You are advised to check out my other posts regarding Linux commands **[HERE][17] & ** another one **[HERE][18] -** - --------------------------------------------------------------------------------- - -via: http://linuxtechlab.com/commands-system-hardware-info/ - -作者:[Shusain][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linuxtechlab.com/author/shsuain/ -[2]:https://i0.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/uname.jpg?resize=664%2C69 -[4]:https://i2.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lshw.jpg?resize=641%2C386 -[6]:https://i1.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lsblk.jpg?resize=646%2C162 -[8]:https://i2.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lscpu.jpg?resize=643%2C216 -[10]:https://i0.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lspci.jpg?resize=644%2C238 -[12]:https://i2.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lsusb.jpg?resize=645%2C37 -[14]:https://i2.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lsscsi.jpg?resize=639%2C110 -[16]:https://i2.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/fdisk.jpg?resize=656%2C335 -[17]:http://linuxtechlab.com/linux-commands-beginners-part-1/ -[18]:http://linuxtechlab.com/linux-commands-beginners-part-2/ diff --git a/translated/tech/20170515 Commands to check System & Hardware Information.md b/translated/tech/20170515 Commands to check System & Hardware Information.md new file mode 100644 index 0000000000..e8469797c6 --- /dev/null +++ b/translated/tech/20170515 Commands to check System & Hardware Information.md @@ -0,0 +1,95 @@ +检查系统和硬件信息的命令 +====== +你们好,linux 爱好者们,在这篇文章中,我将讨论一些作为系统管理员重要的事。众所周知,作为一名优秀的系统管理员意味着要了解有关 IT 基础架构的所有信息,并掌握有关服务器的所有信息,无论是硬件还是操作系统。所以下面的命令将帮助你了解所有的硬件和系统信息。 + +#### 1- 查看系统信息 + +$ uname -a + +![uname command][2] + +它会为你提供有关系统的所有信息。它会为你提供系统的内核名、主机名、内核版本、内核发布号、硬件名称。 + +#### 2- 查看硬件信息 + +$ lshw + +![lshw command][4] + +使用 lshw 将在屏幕上显示所有硬件信息。 + +#### 3- 查看块设备(硬盘、闪存驱动器)信息 + +$ lsblk + +![lsblk command][6] + +lsblk 命令在屏幕上打印关于块设备的所有信息。使用 lsblk -a 显示所有块设备。 + +#### 4- 查看 CPU 信息 + +$ lscpu + +![lscpu command][8] + +lscpu 在屏幕上显示所有 CPU 信息。 + +#### 5- 查看 PCI 信息 + +$ lspci + +![lspci command][10] + +所有的网络适配器卡、USB 卡、图形卡都被称为 PCI。要查看他们的信息使用 lspci。 + +lspci -v 将提供有关 PCI 卡的详细信息。 + +lspci -t 会以树形格式显示它们。 + +#### 6- 查看 USB 信息 + +$ lsusb + +![lsusb command][12] + +要查看有关连接到机器的所有 USB 控制器和设备的信息,我们使用 lsusb。 + +#### 7- 查看 SCSI 信息 + +$ lssci + +![lssci][14] + +要查看 SCSI 信息输入 lsscsi。lsscsi -s 会显示分区的大小。 + +#### 8- 查看文件系统信息 + +$ fdisk -l + +![fdisk command][16] + +使用 fdisk -l 将显示有关文件系统的信息。虽然 fdisk 的主要功能是修改文件系统,但是也可以创建新分区,删除旧分区(详情在我以后的教程中)。 + +就是这些了,我的 Linux 爱好者们。建议你在**[这里][17]**和**[这里][18]**查看我文章中关于另外的 Linux 命令。 + +-------------------------------------------------------------------------------- + +via: http://linuxtechlab.com/commands-system-hardware-info/ + +作者:[Shusain][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxtechlab.com/author/shsuain/ +[2]:https://i0.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/uname.jpg?resize=664%2C69 +[4]:https://i2.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lshw.jpg?resize=641%2C386 +[6]:https://i1.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lsblk.jpg?resize=646%2C162 +[8]:https://i2.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lscpu.jpg?resize=643%2C216 +[10]:https://i0.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lspci.jpg?resize=644%2C238 +[12]:https://i2.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lsusb.jpg?resize=645%2C37 +[14]:https://i2.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/lsscsi.jpg?resize=639%2C110 +[16]:https://i2.wp.com/linuxtechlab.com/wp-content/uploads/2017/02/fdisk.jpg?resize=656%2C335 +[17]:http://linuxtechlab.com/linux-commands-beginners-part-1/ +[18]:http://linuxtechlab.com/linux-commands-beginners-part-2/ From 002d0ada16bf5c3659e1c411b72f7c4e45dfcd38 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 Dec 2017 14:20:03 +0800 Subject: [PATCH 011/133] translating --- ...1219 4 Easiest Ways To Find Out Process ID (PID) In Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20171219 4 Easiest Ways To Find Out Process ID (PID) In Linux.md b/sources/tech/20171219 4 Easiest Ways To Find Out Process ID (PID) In Linux.md index 75ec42c268..14d561e766 100644 --- a/sources/tech/20171219 4 Easiest Ways To Find Out Process ID (PID) In Linux.md +++ b/sources/tech/20171219 4 Easiest Ways To Find Out Process ID (PID) In Linux.md @@ -1,3 +1,5 @@ +translating---geekpi + 4 Easiest Ways To Find Out Process ID (PID) In Linux ====== Everybody knows about PID, Exactly what is PID? Why you want PID? What are you going to do using PID? Are you having the same questions on your mind? If so, you are in the right place to get all the details. From d137c0977facb60b55116ba150748254bee32913 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 15:03:24 +0800 Subject: [PATCH 012/133] =?UTF-8?q?translate=20done=20at=202017=E5=B9=B4?= =?UTF-8?q?=2012=E6=9C=88=2027=E6=97=A5=20=E6=98=9F=E6=9C=9F=E4=B8=89=2015?= =?UTF-8?q?:03:24=20CST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... for errors- FSCK command with examples.md | 137 --------------- ... for errors- FSCK command with examples.md | 159 ++++++++++++++++++ 2 files changed, 159 insertions(+), 137 deletions(-) delete mode 100644 sources/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md create mode 100644 translated/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md diff --git a/sources/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md b/sources/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md deleted file mode 100644 index d20e862c88..0000000000 --- a/sources/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md +++ /dev/null @@ -1,137 +0,0 @@ -translating by lujun9972 -Check Linux filesystem for errors: FSCK command with examples -====== -FSCK is a very important Linux/Unix utility, it is used to check & repair the errors in the file system. It is similar to 'chkdsk' utility in Windows operating systems. It is available for Linux, MacOS, FreeBSD operating systems. - -FSCK stands for File System Consistency Check & most of the times, it runs at boot time but can also be started manually by super user, if need arises. - -It can be used with 3 modes of operation, - - **1-** Check for errors & let the user decide what should be done with each error, - - **2-** Check for errors & make repairs automatically, or, - - **3-** Check for errors & display the error but does not perform any repairs. - - **(Recommended Read:[Learn to use TCPDUMP command with examples][1])** - -### Syntax for using FSCK - -We can use the FSCK command manually with the following syntax, - - **$ fsck options drives** - -The options that can be used with fsck command are, - - **-p ** Automatic repair (no questions) - - **-n** Make no changes to the filesystem - - **-y ** Assume "yes" to all questions - - **-c** Check for bad blocks and add them to the badblock list - - **-f ** Force checking even if filesystem is marked clean - - **-v ** Be verbose - - **-b ** superblock Use alternative superblock - - **-B** blocksize Force blocksize when looking for superblock - - **-j ** external_journal Set location of the external journal - - **-l ** bad_blocks_file Add to badblocks list - - **-L ** bad_blocks_file Set badblocks list - -We can use any of the following options, depending on the operation we need to perform. Let's discuss some of the options of fsck command with examples. - -### Fsck command with examples - - **Note:-** Before we discuss any examples, please read this. We should not be using FSCK on mounted drives, as there will be high chances that fsck on mounted drive wll damage the drive permanently. So before performing fsck, we must un-mount the drive with the following command, - - **$ umount drivename** - -For example, - - **$ umount /dev/sdb1** - -You can check the partition number with the following command, - - **$ fdisk -l** - -Also while running the fsck, we might get some error codes. Below mentioned is the list of error codes that we might get along with their meanings, - - **0** - No errors -**1** - Filesystem errors corrected -**2** - System should be rebooted -**4** - Filesystem errors left uncorrected -**8** - Operational error -**16** - Usage or syntax error -**32** - Fsck canceled by user request -**128** - Shared-library error - -Now let's discuss usage of fdisk command with examples, - -### Perform an error check on a single partition - -To perform a file check on a single partition, run the following command from the terminal, - - **$ umount /dev/sdb1** - - **$ fsck /dev/sdb1** - -### Check filesystem for errors & repair them automatically - -Run the fsck command with 'a' option to perform consistency check & to repair them automatically, execute the following command. We can also use 'y' option in place of option 'a'. - - **$ fsck -a /dev/sdb1** - -### Check filesystem for errors but don't repait them - -In case we only need to see the error that are occurring on our file system & dont need to repair them, than we should run fsck with option 'n', - - **$ fsck -n /dev/sdb1** - -### Perform an error check on all partitions - -To perform a filesystem check for all partitions in single go, use fsck with 'A' option, - - **$ fsck -A** - -To disable the root file system check, we will use the option 'R' - - **$ fsck -AR** - -### Check only partition with mentioned filesystem - -In order to run fsck on all the partitiions with mentioned filesystem type, for example 'ext4', use fsck with option 't' followed by filesystem type, - - **$ fsck -t ext4 /dev/sdb1** - -or - - **$ fsck -t -A ext4** - -### Perform consistency check only on unmounted drives - -To make sure that the fsck is performed only on unmounted drives, we will use option 'M' while running fsck, - - **$ fsck -AM** - -This was our tutorial on fsck command with examples. Please feel free to send in your questions or queries to us, using the comment box below. - - --------------------------------------------------------------------------------- - -via: http://linuxtechlab.com/linux-filesystem-errors-fsck-command-with-examples/ - -作者:[Shusain][a] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linuxtechlab.com/author/shsuain/ -[1]:http://linuxtechlab.com/learn-use-tcpdump-command-examples/ diff --git a/translated/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md b/translated/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md new file mode 100644 index 0000000000..c937b6691b --- /dev/null +++ b/translated/tech/20171226 Check Linux filesystem for errors- FSCK command with examples.md @@ -0,0 +1,159 @@ +检查 Linux 文件系统中的错误:通过案例学习 FSCK 命令 +====== +FSCK 是一个很重要的 Linux/Unix 工具,它用于检测并修复文件系统中的错误。它类似于 Windows 操作系统中的 'chkdsk' 工具,但是是为 Linux,MacOS,FreeBSD 操作系统所准备的。 + +FSCK 全称为 File System Consistency Check。在大多数时候,它在系统启动时运行,但是如果需要的话,它也能被超级用户手工启动。 + +它可以进行三种模式的操作, + + **1-** 查错并在发现错误时由用户决定如何处理, + + **2-** 查错并自动修复,以及, + + **3-** 查错但在发现错误时只显示错误而不进行修复。 + + **(推荐阅读:[通过案例学习 TCPDUMP 命令 ][1])** + +### FSCK 的语法 + +手工执行 FSCK 的语法为, + +``` + $ fsck options drives +``` + +fsck 支持的选项有, + + **-p ** 自动修复(不询问) + + **-n ** 不对文件系统做出改动 + + **-y ** 多有所问题都回答 "yes" + + **-c ** 检查所有的坏块并将之添加到坏块列表中 + + **-f ** 即使文件系统标记为 clean 也强制进行检查 + + **-v ** 输出详细信息 + + **-b ** superblock 使用替代的超级块 + + **-B ** blocksize 指定超级块的块大小 + + **-j ** external_journal 指定外部日志的位置 + + **-l ** bad_blocks_file 添加到指定的坏块列表(文件) + + **-L ** bad_blocks_file 指定坏块列表(文件) + +我们可以根据要做的操作任意指定这些选项。下面让我们来看一些例子。 + +### Fsck 命令的案例 + + **注意:-** 在开始讨论案例之前,请先读完这段话。我们不应用 FSCK 检查已挂载的磁盘,这很可能会对磁盘造成永久性的伤害。因此在开始使用 fsck 之前,我们需要使用下面命令来卸载磁盘, + +``` +$ umount drivename +``` + +比如像这样, + +``` +$ umount /dev/sdb1 +``` + +可以通过下面命令来查看分区编号, + +``` +$ fdisk -l +``` + +另外,在运行 fsck 时,可能出错并返回一些错误码。下面是一些常见的错误及其意义的列表, + +**0** - 没有错误 +**1** - 修复了一些文件系统错误 +**2** - 系统需要被重启 +**4** - 文件系统错误未被修复 +**8** - 操作错 +**16** - 使用或语法错 +**32** - Fsck 被用户取消 +**128** - 共享库出错 + +现在让我们来看一些 fsck 命令的例子, + +### 在单个分区上进行错误检查 + +在终端运行下面过命令来对单个分区进行检查,run the following command from the terminal, + +``` +$ umount /dev/sdb1 +$ fsck /dev/sdb1 +``` + +### 检查文件系统错误并自动修复 + +使用选项 ‘a’ 进行一致性检查并会自动修复这些错误。也可以用 'y' 替代 'a' 选项。 + +``` +$ fsck -a /dev/sdb1 +``` + +### 检查文件系统错误但并不进行修复 + +若我们只想知道文件系统上有哪些错误而不想修复这些错误,那么可以使用选项 'n', + +``` +$ fsck -n /dev/sdb1 +``` + +### 检查所有分区中的错误 + +'A' 选项一次性检查所有分区上的文件系统错误, + +``` +$ fsck -A +``` + +若要禁止检查对根进行检查可以使用选项 'R' + +``` +$ fsck -AR +``` + +### 只检查指定文件系统类型的分区 + +使用选项 ‘t’ 跟上文件系统类型,可以让 fsck 只检查指定文件系统类型的分区,比如指定文件系统类型为 'ext4', + +``` +$ fsck -t ext4 /dev/sdb1 +``` + +或者 + +``` +$ fsck -t -A ext4 +``` + +### 只在卸载的磁盘上进行一致性检查 + +要保证 fsck 只在卸载的磁盘上操作,可以使用选项 'M', + +``` +$ fsck -AM +``` + +这就是我们的案例教程了。有任何疑问欢迎在下面的留言框中留言。 + + +-------------------------------------------------------------------------------- + +via: http://linuxtechlab.com/linux-filesystem-errors-fsck-command-with-examples/ + +作者:[Shusain][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxtechlab.com/author/shsuain/ +[1]:http://linuxtechlab.com/learn-use-tcpdump-command-examples/ From 75e7cdbd8e4721c500c229cd17b703696983a773 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Dec 2017 15:12:58 +0800 Subject: [PATCH 013/133] PRF:20171214 Bash Scripting- Learn to use REGEX (Basics).md @kimii --- ... Scripting- Learn to use REGEX (Basics).md | 153 +++++++++--------- 1 file changed, 77 insertions(+), 76 deletions(-) diff --git a/translated/tech/20171214 Bash Scripting- Learn to use REGEX (Basics).md b/translated/tech/20171214 Bash Scripting- Learn to use REGEX (Basics).md index 83e9514054..9203789c0f 100644 --- a/translated/tech/20171214 Bash Scripting- Learn to use REGEX (Basics).md +++ b/translated/tech/20171214 Bash Scripting- Learn to use REGEX (Basics).md @@ -1,136 +1,137 @@ -Bash 脚本:学习使用正则表达式(基础) +Bash 脚本:正则表达式基础篇 ====== -正则表达式(简写为 regex 或者 regexp)基本上是定义一种搜索模式的字符串,可以被用来执行“搜索”或者“搜索并替换”操作,也可以被用来验证像密码策略等条件。 -正则表达式是一个我们可利用的非常强大的工具,并且使用正则表达式最好的事情是它能在几乎所有计算机语言中被使用。所以如果你使用 Bash 脚本或者创建一个 python 程序时,我们可以使用正则表达式或者也可以写一个单行搜索查询。 +正则表达式Regular expressions(简写为 regex 或者 regexp)基本上是定义一种搜索模式的字符串,可以被用来执行“搜索”或者“搜索并替换”操作,也可以被用来验证像密码策略等条件。 -在这篇教程中,我们将会学习一些正则表达式的基本概念,并且学习如何在 Bash 中使用‘grep’时使用它们,但是如果你希望在其他语言如 python 或者 C 中使用它们,你只能使用正则表达式部分。那么让我们通过正则表达式的一个例子开始吧, +正则表达式是一个我们可利用的非常强大的工具,并且使用正则表达式的优点是它能在几乎所有计算机语言中被使用。所以如果你使用 Bash 脚本或者创建一个 python 程序时,我们可以使用正则表达式,或者也可以写一个单行搜索查询。 - **Ex-** 一个正则表达式看起来像 +在这篇教程中,我们将会学习一些正则表达式的基本概念,并且学习如何在 Bash 中通过 `grep` 使用它们,但是如果你希望在其他语言如 python 或者 C 中使用它们,你只能使用正则表达式部分。那么让我们通过正则表达式的一个例子开始吧, - **/t[aeiou]l/** +正则表达式看起来像 `/t[aeiou]l/` 这个样子。 -但这是什么意思呢?它意味着所提到的正则表达式将寻找一个词,它以‘t’开始,在中间包含字母‘a e i o u’中任意一个,并且字母‘l’最为最后一个字符。它可以是‘tel’,‘tal’或者‘til’,匹配可以是一个单独的词或者其它单词像‘tilt’,‘brutal’或者‘telephone’的一部分。 +但这是什么意思呢?它意味着所提到的正则表达式将寻找一个词,它以 `t` 开始,在中间包含字母 `a e i o u` 中任意一个,并且字母 `l` 最为最后一个字符。它可以是 `tel`,`tal` 或者 `til`,可以匹配一个单独的词或者其它单词像 `tilt`,`brutal` 或者 `telephone` 的一部分。 - **grep 使用正则表达式的语法是** +grep 使用正则表达式的语法是 `$ grep "regex_search_term" file_location` - **$ grep "regex_search_term" file_location** +如果不理解,不要担心,这只是一个例子,来展示可以利用正则表达式获取什么,相信我,这是最简单的例子。我们可以从正则表达式中获取更多。现在我们将从正则表达式基础的开始。 -如果头脑中没有想法,不要担心,这只是一个例子,来展示可以利用正则表达式获取什么,并且相信我这是最简单的例子。我们可以从正则表达式中获取更多。现在我们将从正则表达式基础的开始。 +- 推荐阅读: [你应该知道的有用的 linux 命令][1] - **(推荐阅读: [你应该知道的有用的 linux 命令][1])** +### 基础的正则表示式 -## **基础的正则表示式** +现在我们开始学习一些被称为元字符MetaCharacters的特殊字符。它们可以帮助我们创建更复杂的正则表达式搜索项。下面提到的是基本元字符的列表, -现在我们开始学习一些被称为元字符(MetaCharacters)的特殊字符。他们帮助我们创建更复杂的正则表达式搜索项。下面提到的是基本元字符的列表, - - **. or Dot** 将匹配任意字符 - - **[ ]** 将匹配范围内字符 - - **[^ ]** 将匹配除了括号中提到的那个之外的所有字符 - - ***** 将匹配零个或多个前面的项 - - **+** 将匹配一个或多个前面的项 - - **? ** 将匹配零个或一个前面的项 - - **{n}** 将匹配‘n’次前面的项 - - **{n,}** 将匹配‘n’次或更多前面的项 - - **{n m} ** 将匹配在‘n’和‘m’次之间的项 - - **{ ,m}** 将匹配少于或等于‘m’次的项 - - **\ ** 是一个转义字符,当我们需要在我们的搜索中包含一个元字符时使用 +- `.` 点将匹配任意字符 +- `[ ]` 将匹配一个字符范围 +- `[^ ]` 将匹配除了括号中提到的那个之外的所有字符 +- `*` 将匹配零个或多个前面的项 +- `+` 将匹配一个或多个前面的项 +- `?` 将匹配零个或一个前面的项 +- `{n}` 将匹配 n 次前面的项 +- `{n,}` 将匹配 n 次或更多前面的项 +- `{n,m}` 将匹配在 n 和 m 次之间的项 +- `{,m}` 将匹配少于或等于 m 次的项 +- `\` 是一个转义字符,当我们需要在我们的搜索中包含一个元字符时使用 现在我们将用例子讨论所有这些元字符。 -### **. or Dot** +#### `.` (点) -它用于匹配出现在我们搜索项中的任意字符。举个例子,我们可以使用点如 +它用于匹配出现在我们搜索项中的任意字符。举个例子,我们可以使用点如: - **$ grep "d.g" file1** +``` +$ grep "d.g" file1 +``` -这个正则表达式意味着我们在‘file_name’文件中正查找的词以‘d’开始,以‘g’结尾,中间可以有任意字符。同样,我们可以使用任意数量的点作为我们的搜索模式,如 +这个正则表达式意味着我们在名为 ‘file1’ 的文件中查找的词以 `d` 开始,以 `g`结尾,中间可以有 1 个字符的字符串。同样,我们可以使用任意数量的点作为我们的搜索模式,如 `T......h`,这个查询项将查找一个词,以 `T` 开始,以 `h` 结尾,并且中间可以有任意 6 个字符。 - **T ……h** +#### `[ ]` -这个查询项将查找一个词,以‘T’开始,以‘h’结尾,并且中间可以有任意 6 个字符。 +方括号用于定义字符范围。例如,我们需要搜索一些特别的单词而不是匹配任何字符, -### **[ ]** +``` +$ grep "N[oen]n" file2 +``` -方括号用于定义字符的范围。 例如,我们需要搜索一些特别的单词而不是匹配任何字符, +这里,我们正寻找一个单词,以 `N`开头,以 `n` 结尾,并且中间只能有 `o`、`e` 或者 `n` 中的一个。 在方括号中我们可以提到单个到任意数量的字符。 - **$ grep "N[oen]n" file2** +我们在方括号中也可以定义像 `a-e`或者 `1-18` 作为匹配字符的列表。 -这里,我们正寻找一个单词,以‘N’开头,以‘n’结尾,并且中间只能有‘o’,‘e’或者‘n’中的一个。 在方括号中我们可以提到单个到任意数量的字符。 +#### `[^ ]` -我们在方括号中也可以定义像‘a-e’或者‘1-18’作为匹配字符的列表。 +这就像正则表达式的 not 操作。当使用 `[^ ]` 时,它意味着我们的搜索将包括除了方括号内提到的所有字符。例如, -### **[^ ]** +``` +$ grep "St[^1-9]d" file3 +``` -这就像正则表达式的 not 操作。当使用 [^ ] 时,它意味着我们的搜索将包括除了方括号内提到的所有字符。例如, +这意味着我们可以拥有所有这样的单词,它们以 `St` 开始,以字母 `d` 结尾,并且不得包含从 `1` 到 `9` 的任何数字。 - **$ grep "St[^1-9]d" file3** +到现在为止,我们只使用了仅需要在中间查找单个字符的正则表达式的例子,但是如果我们需要更多字符该怎么办呢。假设我们需要找到以一个字符开头和结尾的所有单词,并且在中间可以有任意数量的字符。这就是我们使用乘数元字符如 `+` `*` 与 `?` 的地方。 -这意味着我们可以拥有所有这样的单词,它们以‘St’开始,以字母‘d’结尾,并且不得包含从1到9的任何数字。 +`{n}`、`{n,m}`、`{n,}` 或者 `{,m}` 也是可以在我们的正则表达式项中使用的其他乘数元字符。 -到现在为止,我们只使用了仅需要在中间查找单个字符的正则表达式的例子,但是如果我们需要看的更多该怎么办呢。假设我们需要找到以一个字符开头和结尾的所有单词,并且在中间可以有任意数量的字符。这就是我们使用乘数(multiplier)元字符如 + * & ? 的地方。 +#### `*` (星号) -{n},{n. m},{n , } 或者 { ,m} 也是可以在我们的正则表达式项中使用的其他乘数元字符。 +以下示例匹配字母 `k` 的任意出现次数,包括一次没有: -### * (星号) +``` +$ grep "lak*" file4 +``` -以下示例匹配字母k的任意出现次数,包括一次没有: +它意味着我们可以匹配到 `lake`、`la` 或者 `lakkkk`。 - **$ grep "lak*" file4** +#### `+` -它意味着我们可以匹配到‘lake’,‘la’或者‘lakkkk’ +以下模式要求字符串中的字母 `k` 至少被匹配到一次: -### + +``` +$ grep "lak+" file5 +``` -以下模式要求字符串中的字母k至少被匹配到一次: +这里 `k` 在我们的搜索中至少需要发生一次,所以我们的结果可以为 `lake` 或者 `lakkkk`,但不能是 `la`。 - **$ grep "lak+" file5** - -这里k 在我们的搜索中至少需要发生一次,所以我们的结果可以为‘lake’或者‘lakkkk’,但不能是‘la’。 - -### **?** +#### `?` 在以下模式匹配中 - **$ grep "ba?b" file6** +``` +$ grep "ba?b" file6 +``` -字符串 bb 或 bab,使用‘?’乘数,我们可以有一个或零个字符的出现。 +匹配字符串 `bb` 或 `bab`,使用 `?` 乘数,我们可以有一个或零个字符的出现。 -### **非常重要的提示:** +#### 非常重要的提示 当使用乘数时这是非常重要的,假设我们有一个正则表达式 - **$ grep "S.*l" file7** +``` +$ grep "S.*l" file7 +``` -我们得到的结果是‘small’,‘silly’,并且我们也得到了‘Shane is a little to play ball’。但是为什么我们得到了‘Shane is a little to play ball’,我们只是在搜索中寻找单词,为什么我们得到了整个句子作为我们的输出。 +我们得到的结果是 `small`、`silly`,并且我们也得到了 `Shane is a little to play ball`。但是为什么我们得到了 `Shane is a little to play ball`?我们只是在搜索中寻找单词,为什么我们得到了整个句子作为我们的输出。 -这是因为它满足我们的搜索标准,它以字母‘s’开头,中间有任意数量的字符并以字母‘l’结尾。那么,我们可以做些什么来纠正我们的正则表达式来只是得到单词而不是整个句子作为我们的输出。 +这是因为它满足我们的搜索标准,它以字母 `s` 开头,中间有任意数量的字符并以字母 `l` 结尾。那么,我们可以做些什么来纠正我们的正则表达式来只是得到单词而不是整个句子作为我们的输出。 -我们在正则表达式中需要增加 ? 元字符, +我们在正则表达式中需要增加 `?` 元字符, - **$ grep "S.*?l" file7** +``` +$ grep "S.*?l" file7 +``` 这将会纠正我们正则表达式的行为。 -### **\ or Escape characters** +#### `\` -\ 是当我们需要包含一个元字符或者对正则表达式有特殊含义的字符的时候来使用。例如,我们需要找到所有以点结尾的单词,所以我们可以使用 +`\` 是当我们需要包含一个元字符或者对正则表达式有特殊含义的字符的时候来使用。例如,我们需要找到所有以点结尾的单词,所以我们可以使用: - **$ grep "S.*\\." file8** +``` +$ grep "S.*\\." file8 +``` 这将会查找和匹配所有以一个点字符结尾的词。 -通过这篇基本正则表达式教程,我们现在有一些关于正则表达式如何工作的基本概念。在我们的下一篇教程中,我们将学习一些高级的正则表达式的概念。同时尽可能多地练习,创建正则表达式并试着尽可能多地在你的工作中加入它们。如果有任何疑问或问题,您可以在下面的评论区留言。 +通过这篇基本正则表达式教程,我们现在有一些关于正则表达式如何工作的基本概念。在我们的下一篇教程中,我们将学习一些高级的正则表达式的概念。同时尽可能多地练习,创建正则表达式并试着尽可能多的在你的工作中加入它们。如果有任何疑问或问题,您可以在下面的评论区留言。 -------------------------------------------------------------------------------- @@ -138,7 +139,7 @@ via: http://linuxtechlab.com/bash-scripting-learn-use-regex-basics/ 作者:[SHUSAIN][a] 译者:[kimii](https://github.com/kimii) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 94d1c4c1100fb886ce9f698deb4048bbbca94b32 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Dec 2017 15:13:26 +0800 Subject: [PATCH 014/133] PUB:20171214 Bash Scripting- Learn to use REGEX (Basics).md @kimii https://linux.cn/article-9182-1.html --- .../20171214 Bash Scripting- Learn to use REGEX (Basics).md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20171214 Bash Scripting- Learn to use REGEX (Basics).md (100%) diff --git a/translated/tech/20171214 Bash Scripting- Learn to use REGEX (Basics).md b/published/20171214 Bash Scripting- Learn to use REGEX (Basics).md similarity index 100% rename from translated/tech/20171214 Bash Scripting- Learn to use REGEX (Basics).md rename to published/20171214 Bash Scripting- Learn to use REGEX (Basics).md From 9ef0becb0203131e659404616451073089e981d5 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 17:06:23 +0800 Subject: [PATCH 015/133] translate done: 20171109 Learn how to use tcpdump command with examples.md --- ...ow to use tcpdump command with examples.md | 136 --------------- ...ow to use tcpdump command with examples.md | 165 ++++++++++++++++++ 2 files changed, 165 insertions(+), 136 deletions(-) delete mode 100644 sources/tech/20171109 Learn how to use tcpdump command with examples.md create mode 100644 translated/tech/20171109 Learn how to use tcpdump command with examples.md diff --git a/sources/tech/20171109 Learn how to use tcpdump command with examples.md b/sources/tech/20171109 Learn how to use tcpdump command with examples.md deleted file mode 100644 index 7df944aacf..0000000000 --- a/sources/tech/20171109 Learn how to use tcpdump command with examples.md +++ /dev/null @@ -1,136 +0,0 @@ -translating by lujun9972 -Learn how to use tcpdump command with examples -====== -Tcpdump command is a famous network packet analysing tool that is used to display TCP\IP & other network packets being transmitted over the network attached to the system on which tcpdump has been installed. Tcpdump uses libpcap library to capture the network packets & is available on almost all Linux/Unix flavors. - -Tcpdump command can read the contents from a network interface or from a previously created packet file or we can also write the packets to a file to be used for later. One must use the tcpdump command as root or as a user with sudo privileges. - -In this tutorial, we are going to discuss the uses of tcpdump command along with some examples, but first let's start with installation of tcpdump on various Linux OS. - - **(Recommended Read:[Monitoring network bandwidth with iftop command][1])** - -### Installation - -By default, tcpdump is available on almost all Linux distributions but if that's not the case for you, install it on your system using the following method. - - **CentOS/RHEL** - -Install tcpdump on CentOS & RHEL using the following command , - - **$ sudo yum install tcpdump** - - **Fedora** - -On Fedora, install tcpdump using the following command, - - **$ dnf install tcpdump** - - **Ubuntu/Debian/Linux Mint** - -On Ubuntu or Debian or Linux Mint, install tcp dumo using the following command, - - **$ apt-get install tcpdump** - -Now that we have install tcpdump on our systems, let's discuss some examples for tcpdump. - -### Examples - - **Get packets from all interfaces** - -To get the network packets from all network interfaces, run the following command, - - **$ tcpdump -i any** - -**Get packets from a single interfaces** - -To get the network packets from a single interface, use - - **$ tcpdump -i eth0** - -**Writing captured packets to file** - -To write all the captured packets to a file, use the '-w' option, - - **$ tcpdump -i eth1 -w packets_file** - -**Reading an old tcpdump file** - -To read an already created, old tcpdump file, use the following command, - - **$ tcpdump -r packets_file** - -**Getting more packets information with readable timestamps** - -To get more information regarding the packets along with readable timestamp, use - - **$ tcpdump -ttttnnvvS** - -**Check packets of whole network** - -To get the packets for whole network, execute the following command from terminal - - **$ tcpdump net 192.168.1.0/24** - -**Check packets based on IP address** - -Get all the packets based on the IP address, whether source or destination or both, using the following command, - - **$ tcpdump host 192.168.1.100** - -To get packets based on source or destination of an IP address, use - - **$ tcpdump src 192.168.1.100** - - **$ tcpdump dst 192.168.1.100** - -**Check packets for a protocol or port number** - -To check all the packets used based on the protocol, run the following command - - **$ tcpdump ssh** - -To get packets for a single port ot for a range of ports, use - - **$ tcpdump port 22** - - **$ tcpdump portrange 22-125** - -We can also use ** 'src'** & **' dst'** options to get packets for ports based on source & destination. - -We can also combine two conditions with AND (and , && ), OR ( or. || ) & EXCEPT (not , ! ). This helps when we have analyze network packets based on the some condtions. - -**Using AND** -We can use 'and' or symbol '&&' to combine two conditions or mote with tcpdump. An example would be, - - **$ tcpdump src 192.168.1.100 && port 22 -w ssh_packets** - -**Using OR** - -OR will check the command agtcpdump -i eth0 src port not 22ainst one the mentioned conditions in the command, like - - **$ tcpdump src 192.168.1.100 or dst 192.168.1.50 && port 22 -w ssh_packets** - - **$ tcpdump port 443 or 80 -w http_packets** - -**Using EXCEPT** - -EXCEPT will be used when we want not fulfill a condition, like - - **$ tcpdump -i eth0 src port not 22** - -This will monitor all the traffic on eth0 but will not capture port 22. - -This was our tutorial on how to install & use tcpdump command to capture the network packets. Please feel free to send in any queries or suggestions using the comment box below. - --------------------------------------------------------------------------------- - -via: http://linuxtechlab.com/learn-use-tcpdump-command-examples/ - -作者:[Shusain ][a] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linuxtechlab.com/author/shsuain/ -[1]:http://linuxtechlab.com/monitoring-network-bandwidth-iftop-command/ diff --git a/translated/tech/20171109 Learn how to use tcpdump command with examples.md b/translated/tech/20171109 Learn how to use tcpdump command with examples.md new file mode 100644 index 0000000000..578580ef4c --- /dev/null +++ b/translated/tech/20171109 Learn how to use tcpdump command with examples.md @@ -0,0 +1,165 @@ +通过案例学习 TCPDUMP 命令 +====== +Tcpdump 是一个很常用的网络包分析工具,可以用来显示通过网络传输到本系统的 TCP\IP 以及其他网络的数据包。Tcpdump 使用 libpcap 库来抓取网络报,这个库在几乎存在于所有的 Linux/Unix 中。 + +Tcpdump 可以从网卡或之前创建的数据包文件中读取内容,也可以将包写入文件中以供后续使用。必须是 root 用户或者使用 sudo 特权来运行 tcpdump。 + +在本文中,我们将会通过一些案例来演示如何使用 tcpdump 命令,但首先让我们来看看在各种 Linux 操作系统中是如何安装 tcpdump 的。 + + **(推荐阅读:[使用 iftop 命令监控网络带宽 ][1])** + +### 安装 + +tcpdump 默认在几乎所有的 Linux 发行版中都可用,但若你的 Linux 上没有的话,使用下面方法进行安装。 + +#### CentOS/RHEL + +使用下面命令在 CentOS 和 RHEL 上安装 tcpdump, + +``` +$ sudo yum install tcpdump* +``` + +#### Fedora + +使用下面命令在 Fedora 上安装 tcpdump, + +``` +$ dnf install tcpdump +``` + +#### Ubuntu/Debian/Linux Mint + +在 Ubuntu/Debain/Linux Mint 上使用下面命令安装 tcpdump + +``` +$ apt-get install tcpdump +``` + +安装好 tcpdump 后,现在来看一些例子。 + +### 案例演示 + +#### 从所有网卡中捕获数据包 + +运行下面命令来从所有网卡中捕获数据包,run the following command, + +``` +$ tcpdump -i any +``` + +#### 从指定网卡中捕获数据包 + +要从指定网卡中捕获数据包,运行 + +``` +$ tcpdump -i eth0 +``` + +#### 将捕获的包写入文件 + +使用 ‘-w’ 选项将所有捕获的包写入文件, + +``` +$ tcpdump -i eth1 -w packets_file +``` + +#### 读取之前产生的 tcpdump 文件 + +使用下面命令从之前创建的 tcpdump 文件中读取内容 + +``` +$ tcpdump -r packets_file +``` + +#### 获取更多的包信息并且以可读的形式显示时间戳 + +要获取更多的包信息同时以可读的形式显示时间戳,使用 + +``` +$ tcpdump -ttttnnvvS +``` + +#### 查看整个网络的数据包 + +要获取整个网络的数据包,在终端执行下面命令 + +``` +$ tcpdump net 192.168.1.0/24 +``` + +#### 根据 IP 地址查看报文 + +要获取指定 IP 的数据包,不管是作为源地址还是目的地址,使用下面命令, + +``` +$ tcpdump host 192.168.1.100 +``` + +要指定 IP 地址是源地址或是目的地址则使用 + +``` +$ tcpdump src 192.168.1.100 +$ tcpdump dst 192.168.1.100 +``` + +#### 查看某个协议或端口号的数据包 + +要查看某个协议的数据包,运行下面命令 + +``` +$ tcpdump ssh +``` + +要捕获某个端口或一个范围的数据包,使用 + +``` +$ tcpdump port 22 +$ tcpdump portrange 22-125 +``` + +我们也可以与 'src' 和 'dst' 选项连用来捕获指定源端口或指定目的端口的报文 + +我们还可以使用 AND (与,&& ),OR ( 或。|| ) & EXCEPT (非,!) 来将两个条件组合起来。当我们需要基于某些条件来分析网络报文是非常有用。 + +#### 使用 AND + +可以使用 'and' 或者符号 '&&' 来将两个或多个条件组合起来。比如, + +``` +$ tcpdump src 192.168.1.100 && port 22 -w ssh_packets +``` + +#### 使用 OR + +OR 会检查是否匹配命令所列条件中的其中一条,像这样 + +``` +$ tcpdump src 192.168.1.100 or dst 192.168.1.50 && port 22 -w ssh_packets +$ tcpdump port 443 or 80 -w http_packets +``` + +#### 使用 EXCEPT + +当我们想表达不匹配某项条件时可以使用 EXCEPT,像这样 + +``` +$ tcpdump -i eth0 src port not 22 +``` + +这会捕获 eth0 上除了 22 号端口的所有通讯。 + +我们的教程至此就结束了,在本教程中我们讲解了如何安装并使用 tcpdump 来捕获网络数据包。如有任何疑问或建议,欢迎留言。 + +-------------------------------------------------------------------------------- + +via: http://linuxtechlab.com/learn-use-tcpdump-command-examples/ + +作者:[Shusain ][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxtechlab.com/author/shsuain/ +[1]:http://linuxtechlab.com/monitoring-network-bandwidth-iftop-command/ From 2012a9a6780a4b750b3d5e1192f9696142de260d Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 17:10:38 +0800 Subject: [PATCH 016/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Dockerizing=20Com?= =?UTF-8?q?piled=20Software=20=E2=94=88=20Tianon's=20Ramblings=20=E2=9C=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Compiled Software - Tianon-s Ramblings .md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 sources/tech/20171226 Dockerizing Compiled Software - Tianon-s Ramblings .md diff --git a/sources/tech/20171226 Dockerizing Compiled Software - Tianon-s Ramblings .md b/sources/tech/20171226 Dockerizing Compiled Software - Tianon-s Ramblings .md new file mode 100644 index 0000000000..252180f1fd --- /dev/null +++ b/sources/tech/20171226 Dockerizing Compiled Software - Tianon-s Ramblings .md @@ -0,0 +1,41 @@ +Dockerizing Compiled Software ┈ Tianon's Ramblings ✿ +====== +I recently went through a stint of closing a huge number of issues in the [docker-library/php][1] repository, and one of the oldest (and longest) discussions was related to installing depedencies for a compiling extensions, and I wrote a [semi-long comment][2] explaining how I do this in a general way for any software I wish to Dockerize. + +I'm going to copy most of that comment here and perhaps expand a little bit more in order to have a better/cleaner place to link to! + +The first step I take is to write the naive version of the `Dockerfile`: download the source, run `./configure && make` etc, clean up. I then try building my naive creation, and in doing so hope for an error message. (yes, really!) + +The error message will usually take the form of something like `error: could not find "xyz.h"` or `error: libxyz development headers not found`. + +If I'm building in Debian, I'll hit `https://packages.debian.org/file:xyz.h` (replacing "xyz.h" with the name of the header file from the error message), or even just Google something like "xyz.h debian", to figure out the name of the package I require. + +If I'm building in Alpine, I'll use to perform a similar search. + +The same works to some extent for "libxyz development headers", but in my experience Google works better for those since different distributions and projects will call these development packages by different names, so sometimes it's a little harder to figure out exactly which one is the "right" one to install. + +Once I've got a package name, I add that package name to my `Dockerfile`, rinse, and repeat. Eventually, this usually leads to a successful build. Occationally I find that some library either isn't in Debian or Alpine, or isn't new enough, and I've also got to build it from source, but those instances are rare in my own experience - YMMV. + +I'll also often check the source for the Debian (via ) or Alpine (via ) package of the software I'm looking to compile, especially paying attention to `Build-Depends` (ala [`php7.0=7.0.26-1`'s `debian/control` file][3]) and/or `makedepends` (ala [`php7`'s `APKBUILD` file][4]) for package name clues. + +Personally, I find this sort of detective work interesting and rewarding, but I realize I'm probably a bit of a unique creature. Another good technique I use occationally is to determine whether anyone else has already Dockerized the thing I'm trying to, so I can simply learn directly from their `Dockerfile` which packages I'll need to install. + +For the specific case of PHP extensions, there's almost always someone who's already figured out what's necessary for this or that module, and all I have to do is some light detective work to find them. + +Anyways, that's my method! Hope it's helpful, and happy hunting! + +-------------------------------------------------------------------------------- + +via: https://tianon.github.io/post/2017/12/26/dockerize-compiled-software.html + +作者:[Tianon Gravi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://tianon.github.io +[1]:https://github.com/docker-library/php +[2]:https://github.com/docker-library/php/issues/75#issuecomment-353673374 +[3]:https://sources.debian.org/src/php7.0/7.0.26-1/debian/control/ +[4]:https://git.alpinelinux.org/cgit/aports/tree/community/php7/APKBUILD?id=d0ca197f031f96d4664cafaa618aeccf94640a1e From a3a26a0968a53a99170d6a226de0be1444c2a341 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 17:23:13 +0800 Subject: [PATCH 017/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=2018=20Cyber-Securi?= =?UTF-8?q?ty=20Trends=20Organizations=20Need=20to=20Brace=20for=20in=2020?= =?UTF-8?q?18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Organizations Need to Brace for in 2018.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20171222 18 Cyber-Security Trends Organizations Need to Brace for in 2018.md diff --git a/sources/tech/20171222 18 Cyber-Security Trends Organizations Need to Brace for in 2018.md b/sources/tech/20171222 18 Cyber-Security Trends Organizations Need to Brace for in 2018.md new file mode 100644 index 0000000000..09223ccb21 --- /dev/null +++ b/sources/tech/20171222 18 Cyber-Security Trends Organizations Need to Brace for in 2018.md @@ -0,0 +1,116 @@ +18 Cyber-Security Trends Organizations Need to Brace for in 2018 +====== + +### 18 Cyber-Security Trends Organizations Need to Brace for in 2018 + +Enterprises, end users and governments faced no shortage of security challenges in 2017. Some of those same challenges will continue into 2018, and there will be new problems to solve as well. Ransomware has been a concern for several years and will likely continue to be a big issue in 2018. The new year is also going to bring the formal introduction of the European Union's General Data Protection Regulation (GDPR), which will impact how organizations manage private information. A key trend that emerged in 2017 was an increasing use of artificial intelligence (AI) to help solve cyber-security challenges, and that's a trend that will continue to accelerate in 2018. What else will the new year bring? In this slide show, eWEEK presents 18 security predictions for the year ahead from 18 security experts. + + +### Africa Emerges as New Area for Threat Actors and Targets + +"In 2018, Africa will emerge as a new focus area for cyber-threats--both targeting organizations based there and attacks originating from the continent. With its growth in technology adoption and operations and rising economy, and its increasing number of local resident threat actors, Africa has the largest potential for net-new impactful cyber events." -Steve Stone, IBM X-Force IRIS + + +### AI vs. AI + +"2018 will see a rise in AI-based attacks as cyber-criminals begin using machine learning to spoof human behaviors. The cyber-security industry will need to tune their own AI tools to better combat the new threats. The cat and mouse game of cybercrime and security innovation will rapidly escalate to include AI-enabled tools on both sides." --Caleb Barlow, vice president of Threat Intelligence, IBM Security + + +### Cyber-Security as a Growth Driver + +"CEOs view cyber-security as one of their top risks, but many also see it as an opportunity to innovate and find new ways to generate revenue. In 2018 and beyond, effective cyber-security measures will support companies that are transforming their security, privacy and continuity controls in an effort to grow their businesses." -Greg Bell, KMPG's Global Cyber Security Practice co-leader + + +### GDPR Means Good Enough Isn't Good Enough + +"Too many professionals share a 'good enough' philosophy that they've adopted from their consumer mindset that they can simply upgrade and patch to comply with the latest security and compliance best practices or regulations. In 2018, with the upcoming enforcement of the EU GDPR 'respond fast' rules, organizations will quickly come to terms, and face fines, with why 'good enough' is not 'good' anymore." -Kris Lovejoy, CEO of BluVector + + +### Consumerization of Cyber-Security + +"2018 will mark the debut of the 'consumerization of cyber-security.' This means consumers will be offered a unified, comprehensive suite of security offerings, including, in addition to antivirus and spyware protection, credit and identify abuse monitoring and identity restoration. This is a big step forward compared to what is available in one package today. McAfee Total Protection, which safeguards consumer identities in addition to providing virus and malware protection, is an early, simplified example of this. Consumers want to feel more secure." -Don Dixon, co-founder and managing director, Trident Capital Cybersecurity + + +### Ransomware Will Continue + +"Ransomware will continue to plague organizations with 'old' attacks 'refreshed' and reused. The threat of ransomware will continue into 2018. This year we've seen ransomware wreak havoc across the globe with both WannaCry and NotPetya hitting the headlines. Threats of this type and on this scale will be a common feature of the next 12 months." -Andrew Avanessian, chief operating officer at Avecto + + +### More Encryption Will Be Needed + +"It will become increasingly clear in the industry that HTTPS does not offer the robust security and end-to-end encryption as is commonly believed, and there will be a push to encrypt data before it is sent over HTTPS." -Darren Guccione, CEO and co-founder, Keeper Security + + +### Denial of Service Will Become Financially Lucrative + +"Denial of service will become as financially lucrative as identity theft. Using stolen identities for new account fraud has been the major revenue driver behind breaches. However, in recent years ransomware attacks have caused as much if not more damage, as increased reliance on distributed applications and cloud services results in massive business damage when information, applications or systems are held hostage by attackers." -John Pescatore. SANS' director of emerging security trends + + +### Goodbye Social Security Number + +"2018 is the turning point for the retirement of the Social Security number. At this point, the vast majority of SSNs are compromised, and we can no longer rely on them--nor should we have previously." -Michael Sutton, CISO, Zscaler + + +### Post-Quantum Cyber-Security Discussion Warms Up the Boardroom + +"The uncertainty of cyber-security in a post-quantum world is percolating some circles, but 2018 is the year the discussions gain momentum in the top levels of business. As security experts grapple with preparing for a post-quantum world, top executives will begin to ask what can be done to ensure all of our connected 'things' remain secure." -Malte Pollmann, CEO of Utimaco + + +### Market Consolidation Is Coming + +"There will be accelerated consolidation of cyber niche markets flooded with too many 'me-too' companies offering extremely similar products and services. As an example, authentication, end-point security and threat intelligence now boast a total of more than 25 competitors. Ultimately, only three to six companies in each niche can survive." -Mike Janke, co-founder of DataTribe + + +### Health Care Will Be a Lucrative Target + +"Health records are highly valued on the black market because they are saturated with Personally Identifiable Information (PII). Health care institutions will continue to be a target as they have tighter allocations for security in their IT budgets. Also, medical devices are hard to update and often run on older operating system versions." -Larry Cashdollar, senior engineer, Security Intelligence Response Team, Akamai + + +### 2018: The Year of Simple Multifactor Authentication for SMBs + +"Unfortunately, effective multifactor authentication (MFA) solutions have remained largely out of reach for the average small- and medium-sized business. Though enterprise multifactor technology is quite mature, it often required complex on-premises solutions and expensive hardware tokens that most small businesses couldn't afford or manage. However, the growth of SaaS and smartphones has introduced new multifactor solutions that are inexpensive and easy for small businesses to use. Next year, many SMBs will adopt these new MFA solutions to secure their more privileged accounts and users. 2018 will be the year of MFA for SMBs." -Corey Nachreiner, CTO at WatchGuard Technologies + + +### Automation Will Improve the IT Skills Gap + +"The security skills gap is widening every year, with no signs of slowing down. To combat the skills gap and assist in the growing adoption of advanced analytics, automation will become an even higher priority for CISOs." -Haiyan Song, senior vice president of Security Markets at Splunk + + +### Industrial Security Gets Overdue Attention + +"The high-profile attacks of 2017 acted as a wake-up call, and many plant managers now worry that they could be next. Plant manufacturers themselves will offer enhanced security. Third-party companies going on their own will stay in a niche market. The industrial security manufacturers themselves will drive a cooperation with the security industry to provide security themselves. This is because there is an awareness thing going on and impending government scrutiny. This is different from what happened in the rest of IT/IoT where security vendors just go to market by themselves as a layer on top of IT (i.e.: an antivirus on top of Windows)." -Renaud Deraison, co-founder and CTO, Tenable + + +### Cryptocurrencies Become the New Playground for Identity Thieves + +"The rising value of cryptocurrencies will lead to greater attention from hackers and bad actors. Next year we'll see more fraud, hacks and money laundering take place across the top cryptocurrency marketplaces. This will lead to a greater focus on identity verification and, ultimately, will result in legislation focused on trader identity." -Stephen Maloney, executive vice president of Business Development & Strategy, Acuant + + +### GDPR Compliance Will Be a Challenge + +"In 2018, three quarters of companies or apps will be ruled out of compliance with GDPR and at least one major corporation will be fined to the highest extent in 2018 to set an example for others. Most companies are preparing internally by performing more security assessments and recruiting a mix of security professionals with privacy expertise and lawyers, but with the deadline quickly approaching, it's clear the bulk of businesses are woefully behind and may not be able to avoid these consequences." -Sanjay Beri, founder and CEO, Netskope + + +### Data Security Solidifies Its Spot in the IT Security Stack + +"Many businesses are stuck in the mindset that security of networks, servers and applications is sufficient to protect their data. However, the barrage of breaches in 2017 highlights a clear disconnect between what organizations think is working and what actually works. In 2018, we expect more businesses to implement data security solutions that complement their existing network security deployments." -Jim Varner, CEO of SecurityFirst + + +### [Eight Cyber-Security Vendors Raise New Funding in November 2017][1] + +Though the pace of funding slowed in November, multiple firms raised new venture capital to develop and improve their cyber-security products. + +Though the pace of funding slowed in November, multiple firms raised new venture capital to develop and improve their cyber-security products. + +-------------------------------------------------------------------------------- + +via: http://voip.eweek.com/security/18-cyber-security-trends-organizations-need-to-brace-for-in-2018 + +作者:[Sean Michael Kerner][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://voip.eweek.com/Authors/sean-michael-kerner +[1]:http://voip.eweek.com/security/eight-cyber-security-vendors-raise-new-funding-in-november-2017 From 4fa1d5f5792399866ff7eb13c3cbfd1809c36e5d Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 17:26:08 +0800 Subject: [PATCH 018/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Why=20the=20diver?= =?UTF-8?q?sity=20and=20inclusion=20conversation=20must=20include=20people?= =?UTF-8?q?=20with=20disabilities?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n must include people with disabilities.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20171222 Why the diversity and inclusion conversation must include people with disabilities.md diff --git a/sources/tech/20171222 Why the diversity and inclusion conversation must include people with disabilities.md b/sources/tech/20171222 Why the diversity and inclusion conversation must include people with disabilities.md new file mode 100644 index 0000000000..8052b91dc4 --- /dev/null +++ b/sources/tech/20171222 Why the diversity and inclusion conversation must include people with disabilities.md @@ -0,0 +1,67 @@ +Why the diversity and inclusion conversation must include people with disabilities +====== +![配图](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_community_1.png?itok=rT7EdN2m) +"Diversity is being invited to the party, inclusion is being asked to dance." -Verna Myers + +With this in mind, communities should invite as many individuals as possible to dance the night away. Diversity and inclusion get a lot of attention in the tech community these days, perhaps more than in any other industry. Many experts agree that when people of different backgrounds work together to find solutions to problems, the result is a broader scope of innovation and better outcomes. + +Many organizations, including open source projects, publish reports on diversity to ensure that everybody understands its importance and participates in efforts to support it. But often diversity initiatives are limited to gender (specifically, bringing women into technology fields) and ethnicity. + +Gender and ethnic/racial equality in the tech community are both important, and I certainly don't want to downplay these issues. But limiting diversity efforts to gender and race excludes many other worthy groups. One of these is people with disabilities. + +According to many sources, at least 15% to 20% of people in the U.S. alone struggle with some type of disability. About 70% of these are disabilities such as blindness, cognitive challenges, or chronic disease, which are not visible from the outside. This group includes many talented individuals who can bring unique and valuable experiences and insights to projects and workplaces. + +Oscar-winning actress and activist Marlee Matlin said, "Diversity is a beautiful, absolutely wonderful thing, but I don't think they consider people with disabilities, and deaf and hard-of-hearing people, as part of the diversity mandate." + +Inclusion means everybody, not just specific groups. When diversity efforts focus only on specific groups, many others are excluded. And often, the loudest group wins attention at the expense of others. + +Open source communities are particularly well-positioned for workforce inclusion, because technology can help level the playing field for people with disabilities. But the community must be willing to do so. + +Here are ways organizations can become more inclusive of people with disabilities. + +### Making conferences more accessible + +Scheduling a conference at an ADA-certified building doesn't necessarily mean the conference is accessible to all those with disabilities. + +Providing step-free access from streets and parking lots and wheelchair-accessible restrooms is a good start. But what about the presenter's stage? + +Accessibility to events should consider both presenters and attendees. Many conferences have likely missed out on a great deal of valuable insight from disabled speakers who were unable or unwilling to participate based on previous negative experiences. + +It's also important to scatter reserved seats and areas that can accommodate mobile devices and service dogs throughout the venue so all attendees can be seated with their friends and colleagues (a big shout-out to the fine folks at AlterConf for understanding this). + +Visual impairment doesn't need to preclude people from attending conferences if efforts are made to accommodate them. Visual impairment doesn't always mean total blindness. According to a 2014 World Health Organization report, 285 million people worldwide suffer from some form of visual impairment; about 14% of this group is legally blind, while the rest have low or impaired vision. + +Finding the way to sessions can be a challenge for visually impaired individuals, and an open and welcoming community can address this. For starters, be sure to make accommodations for guide dogs, and don't distract them while they're working. + +Communities could also implement a "buddy system" in which a sighted person teams up with a visually impaired person to help guide them at sessions that both individuals plan to attend. Attendees could find a match using IRC, Slack, Forum, or some other tool and meet at a designated location. This would be a win-win from a community standpoint: Not only would the visually impaired attendee get to the session more easily, but both would have an opportunity to connect over a topic they share an interest in. And isn't that sort of connection the very definition of community? + +Preferred seating can be provided to ensure that attendees with limited vision are located as close as possible to the stage. This would also benefit people with physical disabilities who rely on assistive devices like canes (yours truly), wheelchairs, or walkers. + +If you are a speaker who is sharing your insight with the community, you deserve respect and credit--it is not always easy for people to stand onstage and address a large audience. However, if you use slides and graphics to enhance your presentation, and if these images show key data points, the words "as you can see on this slide" should be eradicated from your talk. This is considerate not only of people with visual impairments, but also anyone who might be listening to your talk while driving, for example. + +Another group to consider are people with hearing impairments, or [D/deaf people][1]. Enabling them to participate presents a technical challenge I would love to see addressed as an open source solution. Live speech-text-transcription would be beneficial in many scenarios. How many people reading this use the closed-captions on TVs in sports bars or at the gym? + +Providing sign language translators is great, of course, but this can present a challenge at international conferences because sign language, like any other language, is regional. While ASL (American Sign Language) is used in the U.S. and English-speaking Canada, there are also dialects, as in other languages. Speech-to-text may be a more realistic option, and accommodations for CART (Communication Access Realtime Translation) would benefit many, including non-English speakers. + +### Making content more accessible + +Sometimes you are simply unable to physically attend a particular conference due to conflicts, distance, or other factors. Or perhaps you did attend but want to catch up on sessions you were unable to fit in. Not a problem, thanks to YouTube and other sites, right? What if you're D/deaf, and the videos online don't include captions? (Please don't rely on YouTube captions; the hashtag #youtubecraptions was created for a reason.) + +Fortunately, you can provide your own recordings. Be sure to format event content, including any posted slides, so that visually impaired users can use an open source screen reader like NVDA on Windows, or Orca on Linux, to navigate both the site and the slides. Correct formatting is key so that screen readers can follow the flow of the document in the right order. Please include ALT IMG tags for pictures to describe what the image shows. + +### Conclusion + +Perhaps the first step toward creating a more inclusive community is to acknowledge that it involves a much wider group of individuals than is typically discussed. Communities have a lot of work to do, and particularly for small teams, this can present an extra challenge. The most important part is to take note of the problems and address them whenever possible. Even small efforts can go a long way--and for that I offer my heartfelt thanks. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/12/diversity-and-inclusion + +作者:[Michael Schulz][a] +译者:[译者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/mschulz +[1]:https://en.wikipedia.org/wiki/Deaf_culture From 86d48a54d24147f0433caf3580b514d7d6a2f080 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 17:28:57 +0800 Subject: [PATCH 019/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=2010=20keys=20to=20?= =?UTF-8?q?quick=20game=20development?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...71222 10 keys to quick game development.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20171222 10 keys to quick game development.md diff --git a/sources/tech/20171222 10 keys to quick game development.md b/sources/tech/20171222 10 keys to quick game development.md new file mode 100644 index 0000000000..e65ad11812 --- /dev/null +++ b/sources/tech/20171222 10 keys to quick game development.md @@ -0,0 +1,99 @@ +10 keys to quick game development +====== +![配图](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb) + +In early October, the inaugural [Open Jam][1] sponsored by Opensource.com drew 45 entries from teams located around the world. The teams had just three days to create a game using open source software to enter into the competition, and [three teams came out on top][2]. + +We hosted our own Open Jam event at our university for anyone who wanted to participate. We reserved a computer lab for the weekend and taught people how to use open source software--[Godot][3] for the game engine, [LMMS][4] for music creation, [GIMP][5] for 2D art, and [Blender][6] for 3D art--to create games and game art assets. Three games were submitted from our event: [Loathsome][7], [Lost Artist][8], and [Paint Rider][9] (which I created). + +From my experience with game jams and game development in general, here are 10 lessons I've learned about game engines, coding, and rapid game development. + +## 1\. Narrow your scope + +It's easy to get carried away with ideas to make an expansive adventure game or something that compares to your favorite game. Pursuing that outside of a game jam can be awesome, once you have some experience, but don't overestimate what you have time for. What I love about game jams is they force you to focus on getting a game from the conceptual stage to a final product quickly, since you have such a limited amount of time. This is why narrowing your scope is so important. + +The theme for Open Jam was "Leave a Mark." As soon as it was announced, my friends and I started brainstorming games that could fit that theme. One idea was a 3D boxing game where the player left bruises on their enemy. I had very little experience making 3D games and, while I would have loved to get better at them, I probably would have spent too much time learning how to get all the textures situated and hit boxes working before I could even start to figure out what would make a fun game. + +## 2\. Have something playable very early + +This is my favorite advice for game jams. Try to come up with the core mechanics and code them to a working state quickly so you can test them and decide whether it's worthy of making a full game. You shouldn't be hours away from the deadline and still trying to get your game playable. For a three-day jam like Open Jam, it shouldn't take more than a few hours to have some sort of demo running. + +## 3\. Keep it simple + +Every feature that you want to include extends your total development time. You never know if committing to a feature will lead to a major time sink because you just can't quite get it to work. Arcade-style high-score games typically work well for game jams because they're usually simple by nature. Once you've finished the core, you can start adding features and polish without having to worry whether you'll have a functioning game in the end. + +## 4\. Take inspiration from other games + +You may be tempted to create something totally original, but having models to base your work on is extremely helpful. It will decrease the time it takes to come up with the mechanics, since you'll already have an idea of what is fun. Remind yourself that the more experience you have under your belt, the easier it is to create that massive game you have so many ideas for, so you might as well practice by trying to recreate things other people have done. + +Considering Open Jam's "Leave a Mark" theme, I thought it would be fun to create a game where you leave a trail of paint as you played, so you could see the mark you left. I remembered the old Flash game [Line Rider 2 Beta][10] (hence the name Paint Rider), and about the secret feature where you could draw a track if you held the Control button down while you played. I simplified that concept even more by requiring only one button for vertical movement (much like old helicopter games). About an hour or two into the jam, I had a basic demo where you could move up or down with one button and leave a trail of little black circles. + +## 5\. Don't overlook accessibility + +Make sure as many people as possible can play your game. One of the games submitted to Open Jam was a virtual-reality game. As cool as that was, hardly anyone was able to play it, because not many people have a VR device. Luckily, its developer didn't expect it would do well in the ratings, and instead considered it practice. But, if you want to share your game with lots of people (or win game jams), it's important to pay attention to accessibility. + +Godot (and most other game engines) allow you to export your game to all major platforms. When submitting a game specifically to [Itch.io][11], having an in-browser version will allow most people to play it. But always look into exporting to as many platforms and operating systems as you can. I even tried exporting Paint Rider to mobile, but technical difficulties got in the way. + +## 6\. Don't make it too difficult + +If your game takes too much effort to learn or play, you'll lose a portion of your audience. This aligns nicely with keeping your game simple and within scope, and it puts even more importance on the game planning phase. Again, it's easy to come up with an epic game idea you could spend weeks or months developing; it's harder to come up with a good, simple game. + +I showed Paint Rider to my Mom and she was able to play it immediately. I don't think I need to say anything more about that. + +## 7\. Don't be too neat + +If you're used to taking your time applying design patterns everywhere and making sure that your code will be reusable and readable, try to loosen up a bit. If you spend too much time worrying about design, when you finally get to the point when you can play your game, you may find out it's not very fun. By then, it's too late to make changes. + +This process is also used for prototyping more serious games: You quickly code up messy proof-of-concept demos until you find one that's worth making into a full game, then you dive into building a perfect code base to support it. Creating a game for a game jam is like quickly coding up a proof of concept. + +## 8\. But don't be too messy, either + +On the other hand, [spaghetti code][12] can easily get out of control, even if there's not a ton of code in a game. Luckily, most game engines are built with design patterns in mind. Take Godot's [Signals][13] functionality, which allows nodes to send messages with data to nodes they've been "connected" with--it's the [observer pattern][14] automatically baked into your design. As long as you know how to take advantage of the game engine's features, you should be able to code quickly without making your code too painful to look at. + +## 9\. Get feedback + +Show people what you're working on. Have them try it out and see what they say about it. Watch how they play your game and see if they find something you didn't expect. If the game jam has a [Discord][15] channel or something similar, post your game there, or bounce your ideas off people. One of Paint Rider's defining features is that the canvas loops, so you see the paint you left before. I hadn't even considered that mechanic until someone asked me why the game didn't have it. + +Working on a team will ensure that there are other people built into the process who can pass feedback around. + +And don't forget to help other people out in the same way; it's a win-win if you realize something that could help your game while you're playing someone else's game. + +## 10\. Know where to find resources + +Creating all your own assets can really slow you down. During Open Jam, I noticed that Loathsome's developer was spending multiple hours drawing the main character while I was busy incorporating new features and fixing bugs. You could simplify your art style for the game and still come up with something that looks and sounds good, but there are other options. Try looking for assets in [Creative Commons][16] or on free music sites like [Anttis Instrumentals][17]. Or, if possible, form a team with a dedicated artist, writer, or musician. + +Other software you might find useful includes [Krita][18], an open source 2D image creator that's nice for digital painting, especially if you have a drawing tablet, and [sfxr][19], a game sound-effect creator that has a lot of parameters to play with, but as its creator says: "Basic usage involves hitting the randomize button." (All sound effects in Paint Rider were made with Sfxr.) You can also check out [Calinou][20]'s large and neatly organized list of open source game development software. + +Have you participated in Open Jam or another a game jam and have other advice? Or do you have questions I didn't address? If so, please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/12/10-keys-rapid-open-source-game-development + +作者:[Ryan Estes][a] +译者:[译者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/figytuna +[1]:https://itch.io/jam/open-jam-1 +[2]:https://opensource.com/article/17/11/open-jam +[3]:https://godotengine.org/ +[4]:https://lmms.io/ +[5]:https://www.gimp.org/ +[6]:https://www.blender.org/ +[7]:https://astropippin.itch.io/loathsome +[8]:https://masonraus.itch.io/lost-artist +[9]:https://figytuna.itch.io/paint-rider +[10]:http://www.andkon.com/arcade/racing/lineriderbeta2/ +[11]:https://itch.io/ +[12]:https://en.wikipedia.org/wiki/Spaghetti_code +[13]:http://kidscancode.org/blog/2017/03/godot_101_07/ +[14]:https://en.wikipedia.org/wiki/Observer_pattern +[15]:https://discordapp.com/ +[16]:https://creativecommons.org/ +[17]:http://www.soundclick.com/bands/default.cfm?bandID=1277008 +[18]:https://krita.org/en/ +[19]:http://www.drpetter.se/project_sfxr.html +[20]:https://notabug.org/Calinou/awesome-gamedev/src/master/README.md From 8d7d65d4fa87193eac6bd67de48d4c389b9c1ec7 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 Dec 2017 17:40:53 +0800 Subject: [PATCH 020/133] =?UTF-8?q?PRF&PUB:20171205=20Ubuntu=2018.04=20?= =?UTF-8?q?=E2=80=93=20New=20Features.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @kimii --- .../20171205 Ubuntu 18.04 – New Features.md | 78 ++++++++----------- 1 file changed, 32 insertions(+), 46 deletions(-) rename {translated/tech => published}/20171205 Ubuntu 18.04 – New Features.md (60%) diff --git a/translated/tech/20171205 Ubuntu 18.04 – New Features.md b/published/20171205 Ubuntu 18.04 – New Features.md similarity index 60% rename from translated/tech/20171205 Ubuntu 18.04 – New Features.md rename to published/20171205 Ubuntu 18.04 – New Features.md index 7c91177850..8422959446 100644 --- a/translated/tech/20171205 Ubuntu 18.04 – New Features.md +++ b/published/20171205 Ubuntu 18.04 – New Features.md @@ -1,8 +1,7 @@ -Ubuntu 18.04 – 新功能,发行日期和更多信息 +Ubuntu 18.04 新功能、发行日期和更多信息 ============================================================ - -我们一直都在翘首以盼 - 新的 Ubuntu 的 LTS 版本 - 18.04。了解有关新功能,发行日期以及更多信息。 +我们一直都在翘首以盼 —— 新的 Ubuntu 的 LTS 版本 —— 18.04。了解有关新功能,发行日期以及更多信息。 > 提示:我们将经常在这篇文章中更新新的信息,所以请为此页面添加书签,然后再回来查看。 @@ -10,9 +9,8 @@ Ubuntu 18.04 – 新功能,发行日期和更多信息 让我们以一些基本信息开始。 -* 这是一个新的 LTS(Long Term Support)版本。所以你得到了对桌面版和服务器版 5 年的支持。 - -* 被命名为“Bionic Beaver”(仿生狐狸)。Canonical 的创始人 Mark Shuttleworth 解释了这个名字背后的含义。吉祥物是一个海狸,因为它充满活力,勤劳,并且是一个很棒工程师 - 这完美地描述了一个典型的 Ubuntu 用户,以及新的 Ubuntu 发行版本身。使用“Bionic”(仿生)这个形容词是由于在 Ubuntu Core 上运行的机器人数量的增加。 +* 这是一个新的 LTS(长期支持)版本。所以对桌面版和服务器版有 5 年的支持。 +* 被命名为 “Bionic Beaver”(仿生河狸)。Canonical 的创始人 Mark Shuttleworth 解释了这个名字背后的含义。吉祥物是一个河狸,因为它充满活力,勤劳,并且是一个很棒工程师 —— 这完美地描述了一个典型的 Ubuntu 用户,以及新的 Ubuntu 发行版本身。使用 “Bionic”(仿生)这个形容词是由于在 Ubuntu Core 上运行的机器人数量的增加。 ### Ubuntu 18.04 发行日期和日程 @@ -21,48 +19,39 @@ Ubuntu 18.04 – 新功能,发行日期和更多信息 对进一步的细节,这里是有关 Ubuntu 18.04 LTS 的重要日期和需要知道的: * 2017 年 11 月 30 日 - 功能定义冻结。 - * 2018 年 1 月 4 日 - 第一个 Alpha 版本。所以,如果您选择接收新的 Alpha 版本,那么您将在这天获得 Alpha 1 更新。 - * 2018 年 2 月 1 日 - 第二个 Alpha 版本。 - * 2018 年 3 月 1 日 - 功能冻结。将不会引入或发布新功能。所以开发团队只会在改进现有功能和修复错误上努力。当然也有例外。如果您不是开发人员或有经验的用户,但仍想尝试新的 Ubuntu ASAP,那么我个人建议从此版本开始。 - -* 2018 年 3 月 8 日 - 第一次 Bata 版本。如果您选择接收 Bata 版更新,则会在当天得到更新。 - -* 2018 年 3 月 22 日 - 用户界面冻结。这意味着不会对实际的用户界面做进一步的更改或更新,因此,如果您编写文档,[教程][1],并使用屏幕截图,那时启动是安全的。 - +* 2018 年 3 月 8 日 - 第一个 Bata 版本。如果您选择接收 Bata 版更新,则会在当天得到更新。 +* 2018 年 3 月 22 日 - 用户界面冻结。这意味着不会对实际的用户界面做进一步的更改或更新,因此,如果您编写文档,[教程][1],并使用屏幕截图,那时开始是可靠的。 * 2018 年 3 月 29 日 - 文档字符串冻结。将不会有任何编辑或新的东西(字符串)添加到文档中,所以翻译者可以开始翻译文档。 - * 2018 年 4 月 5 日 - 最终 Beta 版本。这也是开始使用新版本的好日子。 - * 2018 年 4 月 19 日 - 最终冻结。现在一切都已经完成了。版本的图像被创建和分发,并且可能不会有任何更改。 - -* 2018 年 4 月 26 日 - 官方最终版本的 Ubuntu 18.04。每个人都应该从今天开始使用它,即使在生产服务器上。我们建议从[Vultr][2]获得 Ubuntu 18.04 服务器并测试新功能。[Vultr][3]的服务器每月起价为 2.5 美元。 +* 2018 年 4 月 26 日 - 官方最终版本的 Ubuntu 18.04。每个人都可以从这一天开始使用它,即使在生产服务器上。我们建议从 [Vultr][2] 获得 Ubuntu 18.04 服务器并测试新功能。[Vultr][3] 的服务器每月起价为 2.5 美元。(LCTT 译注:这是原文广告!) ### Ubuntu 18.04 的新功能 在 Ubuntu 18.04 LTS 上的所有新功能: -### 彩色表情符号现已支持 +#### 现已支持彩色表情符号 -在以前的版本中,Ubuntu 只支持单色(黑和白)表情符号,坦白地说,它看起来不是太好。Ubuntu 18.04 将使用[Noto Color Emoji font][7]来支持彩色表情符号。随着 18.04,你可以在任何地方轻松查看和添加颜色表情符号。他们是本地支持的 - 所以你可以使用它们,而不使用第三方应用程序或安装/配置任何额外的东西。你可以随时通过删除字体来禁用彩色表情符号。 +在以前的版本中,Ubuntu 只支持单色(黑和白)表情符号,坦白地说,它看起来不是太好。Ubuntu 18.04 将使用[Noto Color Emoji font][7] 来支持彩色表情符号。随着 18.04,你可以在任何地方轻松查看和添加颜色表情符号。它们是原生支持的 —— 所以你可以使用它们,而不用使用第三方应用程序或安装/配置任何额外的东西。你可以随时通过删除该字体来禁用彩色表情符号。 -### GNOME 桌面环境 +#### GNOME 桌面环境 - [![ubuntu 17.10 gnome](https://thishosting.rocks/wp-content/uploads/2017/12/ubuntu-17-10-gnome.jpg.webp)][8] +[![ubuntu 17.10 gnome](https://thishosting.rocks/wp-content/uploads/2017/12/ubuntu-17-10-gnome.jpg.webp)][8] -Ubuntu 从 Ubuntu 17.10 开始使用的 GNOME 桌面环境,而不是默认的 Unity 环境。Ubuntu 18.04 将继续使用 GNOME。这是 Ubuntu 的一个重要的变化。 +Ubuntu 从 Ubuntu 17.10 开始使用 GNOME 桌面环境,而不是默认的 Unity 环境。Ubuntu 18.04 将继续使用 GNOME。这是 Ubuntu 的一个重要的变化。 -### Ubuntu 18.04 桌面将有一个新的默认主题 +#### Ubuntu 18.04 桌面将有一个新的默认主题 Ubuntu 18.04 正在用新的 GTK 主题以告别旧的默认主题 “Ambience”。如果你想帮助新的主题,看看一些截图甚至更多,去[这里][9]。 到目前为止,有人猜测 Suru 将成 为 Ubuntu 18.04 的[新默认图标主题][10]。这里有一个截图: - [![suru icon theme ubuntu 18.04](https://thishosting.rocks/wp-content/uploads/2017/12/suru-icon-theme-ubuntu-18-04.jpg.webp)][11] +[![suru icon theme ubuntu 18.04](https://thishosting.rocks/wp-content/uploads/2017/12/suru-icon-theme-ubuntu-18-04.jpg.webp)][11] -> 值得注意的是:Ubuntu 16.10,17.04 和 17.10 中的所有新功能都将滚动到 Ubuntu 18.04 中。所以更新像右边的窗口按钮,更好的登录屏幕,改进的蓝牙支持等将推出到Ubuntu 18.04。我们不会包含一个特殊的部分,因为它对 Ubuntu 18.04 本身并不新鲜。如果您想了解更多关于从 16.04 到 18.04 的所有变化,请谷歌搜索它们之间的每个版本。 +> 值得注意的是:Ubuntu 16.10,17.04 和 17.10 中的所有新功能都将滚动到 Ubuntu 18.04 中,这些更新,如右边的窗口按钮、更好的登录屏幕,改进的蓝牙支持等将推送到 Ubuntu 18.04。对此我们不会特别说明,因为它对 Ubuntu 18.04 本身并不新鲜。如果您想了解更多关于从 16.04 到 18.04 的所有变化,请谷歌搜索它们之间的每个版本。 ### 下载 Ubuntu 18.04 @@ -78,49 +67,46 @@ Ubuntu 18.04 正在用新的 GTK 主题以告别旧的默认主题 “Ambience 现在是一些经常被问到的问题(附带答案),这应该能给你关于这一切的更多信息。 -### 什么时候切换到 Ubuntu 18.04 是安全的? +#### 什么时候切换到 Ubuntu 18.04 是安全的? 当然是在正式的最终发布日期。但是,如果您等不及,请开始使用 2018 年 3 月 1 日的桌面版本,并在 2018 年 4 月 5 日开始测试服务器版本。但是为了确保安全,您需要等待最终发布,甚至更长时间,使得您正在使用的第三方服务和应用程序经过测试,并在新版本上进行良好运行。 -### 如何将我的服务器升级到 Ubuntu 18.04? +#### 如何将我的服务器升级到 Ubuntu 18.04? -这个过程相当简单,但潜在风险很大。我们可能会在不久的将来发布一个教程,但你基本上需要使用‘do-release-upgrade’。同样,升级你的服务器也有潜在的风险,并且如果在生产服务器上,我会在升级之前再三考虑。特别是如果你在 16.04 上剩有几年的支持。 +这个过程相当简单,但潜在风险很大。我们可能会在不久的将来发布一个教程,但你基本上需要使用 `do-release-upgrade`。同样,升级你的服务器也有潜在的风险,并且如果在生产服务器上,我会在升级之前再三考虑。特别是如果你在 16.04 上还剩有几年的支持。 -### 我怎样才能帮助 Ubuntu 18.04? +#### 我怎样才能帮助 Ubuntu 18.04? 即使您不是一个经验丰富的开发人员和 Ubuntu 用户,您仍然可以通过以下方式提供帮助: -* 宣传它。让人们了解Ubuntu 18.04。在社交媒体上的一个简单的分享也有点帮助。 - +* 宣传它。让人们了解 Ubuntu 18.04。在社交媒体上的一个简单的分享也有点帮助。 * 使用和测试版本。开始使用该版本并进行测试。同样,您不必是一个开发人员。您仍然可以查找和报告错误,或发送反馈。 - * 翻译。加入翻译团队,开始翻译文档或应用程序。 - * 帮助别人。加入一些在线 Ubuntu 社区,并帮助其他人解决他们对 Ubuntu 18.04 的问题。有时候人们需要帮助,一些简单的事如“我在哪里可以下载 Ubuntu?” -### Ubuntu 18.04 对其他发行版如 Lubuntu 意味着什么? +#### Ubuntu 18.04 对其他发行版如 Lubuntu 意味着什么? 所有基于 Ubuntu 的发行版都将具有相似的新功能和类似的发行计划。你需要检查你的发行版的官方网站来获取更多信息。 -### Ubuntu 18.04 是一个 LTS 版本吗? +#### Ubuntu 18.04 是一个 LTS 版本吗? -是的,Ubuntu 18.04 是一个 LTS(Long Term Support)版本,所以你将得到 5 年的支持。 +是的,Ubuntu 18.04 是一个 LTS(长期支持)版本,所以你将得到 5 年的支持。 -### 我能从 Windows/OS X 切换到 Ubuntu 18.04 吗? +#### 我能从 Windows/OS X 切换到 Ubuntu 18.04 吗? 当然可以!你很可能也会体验到性能的提升。从不同的操作系统切换到 Ubuntu 相当简单,有相当多的相关教程。你甚至可以设置一个双引导,来使用多个操作系统,所以 Windows 和 Ubuntu 18.04 你都可以使用。 -### 我可以尝试 Ubuntu 18.04 而不安装它吗? +#### 我可以尝试 Ubuntu 18.04 而不安装它吗? -当然。你可以使用像[VirtualBox][14]这样的东西来创建一个“虚拟桌面” - 你可以在你的本地机器上安装它,并且使用 Ubuntu 18.04 而不需要真正地安装 Ubuntu。 +当然。你可以使用像 [VirtualBox][14] 这样的东西来创建一个“虚拟桌面” —— 你可以在你的本地机器上安装它,并且使用 Ubuntu 18.04 而不需要真正地安装 Ubuntu。 -或者你可以在[Vultr][15]上以每月 2.5 美元的价格尝试 Ubuntu 18.04 服务器。如果你使用一些[免费账户(free credits)][16],那么它本质上是免费的。 +或者你可以在 [Vultr][15] 上以每月 2.5 美元的价格尝试 Ubuntu 18.04 服务器。如果你使用一些[免费账户(free credits)][16],那么它本质上是免费的。(LCTT 译注:广告!) -### 为什么我找不到 Ubuntu 18.04 的 32 位版本? +#### 为什么我找不到 Ubuntu 18.04 的 32 位版本? -因为没有 32 位版本。Ubuntu的 17.10 版本放弃了 32 位版本。如果你使用的是旧硬件,那么最好使用不同的[轻量级Linux发行版][17]而不是 Ubuntu 18.04。 +因为没有 32 位版本。Ubuntu 的 17.10 版本便放弃了 32 位版本。如果你使用的是旧硬件,那么最好使用不同的[轻量级 Linux 发行版][17]而不是 Ubuntu 18.04。 -### 还有其他问题吗? +#### 还有其他问题吗? 在下面留言!分享您的想法,我们会非常激动,并且一旦有新信息发布,我们就会更新这篇文章。敬请期待,耐心等待! @@ -128,9 +114,9 @@ Ubuntu 18.04 正在用新的 GTK 主题以告别旧的默认主题 “Ambience via: https://thishosting.rocks/ubuntu-18-04-new-features-release-date/ -作者:[ thishosting.rocks][a] +作者:[thishosting.rocks][a] 译者:[kimii](https://github.com/kimii) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b725de398b3108fcc2ba579eac18df58d3c042e5 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 18:02:58 +0800 Subject: [PATCH 021/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20My=20personal=20E?= =?UTF-8?q?mail=20setup=20-=20Notmuch,=20mbsync,=20postfix=20and=20dovecot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... - Notmuch, mbsync, postfix and dovecot.md | 235 ++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md diff --git a/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md new file mode 100644 index 0000000000..2eabd299d7 --- /dev/null +++ b/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md @@ -0,0 +1,235 @@ +My personal Email setup - Notmuch, mbsync, postfix and dovecot +====== +I've been using personal email setup for quite long and have not documented it anywhere. Recently when I changed my laptop (a post is pending about it) I got lost trying to recreate my local mail setup. So this post is a self documentation so that I don't have to struggle again to get it right. + +### Server Side + +I run my own mail server and I use postfix as SMTP server and Dovecot for the IMAP purpose. I'm not going into detail of setting those up as my setup was mostly done by using scripts created by Jonas for Redpill infrastructure. What redpill is?. (In jonas's own words) + +> Redpill is a concept - a way to setup Debian hosts to collaborate across organisations I develop the concept, and use it for the first ever Redpill network-of-networks redpill.dk, involving my own network (jones.dk), my main client's network (homebase.dk), a network in Germany including Skolelinux Germany (free-owl.de), and Vasudev's network (copyninja.info) + +Along with that I have a dovecot sieve filtering to classify on high level mails into various folders depending on from where they originate. All the rules live in the ~/dovecot.sieve file under every account which has a mail address. + +Again I'm not going into detail of how to set these things up, as its not goal of my this post. + +### On my Laptop + +On my laptop I've following 4 parts setup + + 1. Mail syncing : Done using mbsync command + 2. Classification: Done using notmuch + 3. Reading: Done using notmuch-emacs + 4. Mail sending: Done using postfix running as relay server and SMTP client. + + + +### Mail Syncing + +Mail syncing is done using mbsync tool, I was previously user of offlineimap and recently switched to mbsync as I felt it more lighter and simpler to configure than offlineimap. mbsync command is provided by package isync. + +Configuration file is ~/.mbsyncrc. Below is my sample content with some private things redacted. + +``` +IMAPAccount copyninja +Host imap.copyninja.info +User vasudev +PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg" +SSLType IMAPS +SSLVersion TLSv1.2 +CertificateFile /etc/ssl/certs/ca-certificates.crt + + +IMAPAccount gmail-kamathvasudev +Host imap.gmail.com +User kamathvasudev@gmail.com +PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg" +SSLType IMAPS +SSLVersion TLSv1.2 +CertificateFile /etc/ssl/certs/ca-certificates.crt + +IMAPStore copyninja-remote +Account copyninja + +IMAPStore gmail-kamathvasudev-remote +Account gmail-kamathvasudev + +MaildirStore copyninja-local +Path ~/Mail/vasudev-copyninja.info/ +Inbox ~/Mail/vasudev-copyninja.info/INBOX + +MaildirStore gmail-kamathvasudev-local +Path ~/Mail/Gmail-1/ +Inbox ~/Mail/Gmail-1/INBOX + +Channel copyninja +Master :copyninja-remote: +Slave :copyninja-local: +Patterns * +Create Both +SyncState * +Sync All + +Channel gmail-kamathvasudev +Master :gmail-kamathvasudev-remote: +Slave :gmail-kamathvasudev-local: +# Exclude everything under the internal [Gmail] folder, except the interesting folders +Patterns * ![Gmail]* +Create Both +SyncState * +Sync All +``` + +Explanation for some interesting part in above configuration. One is the PassCmd which allows you to provide shell command to obtain the password for the account. This avoids filling in the password in configuration file. I'm using symmetric encryption with gpg and storing password some where on my disk. Which is of course just safe guarded by Unix ACL. + +I actually wanted to use my public key to encrypt the file but unlocking the file when script is run in background or via systemd looks difficult (or looked nearly impossible). If you have better suggestion I'm all ears :-). + +Next instruction part is Patterns. This allows you to selectively sync mail from your mail server. This was really helpful for me to exclude all crappy [Gmail]/ folders. + +### Mail Classification + +Once mail is locally on your device, we need a way to read the mails easily in a mail reader. My original setup was serving synced Maildir using local dovecot instance and read it in Gnus. This setup was bit of a over kill with all server software setups but inability of Gnus to not cope well with Maildir format this was best way to do it. This setup also has a disadvantage, that is searching a mail quickly when you have huge pile of mail to go through. This is where notmuch comes into picture. + +notmuch allows me to easily index through Gigabytes of my mail archives and get what I need very easily. I've created a small script which combines executing of mbsync and notmuch execution. I tag mails based on the Maildirs which are actually created on server side using dovecot sieve. Below is my full shell script which is doing task of syncing classification and deleting of spams. + +``` +#!/bin/sh + +MBSYNC=$(pgrep mbsync) +NOTMUCH=$(pgrep notmuch) + +if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then + echo "Already running one instance of mail-sync. Exiting..." + exit 0 +fi + +echo "Deleting messages tagged as *deleted*" +notmuch search --format=text0 --output=files tag:deleted |xargs -0 --no-run-if-empty rm -v + +echo "Moving spam to Spam folder" +notmuch search --format=text0 --output=files tag:Spam and \ + to:vasudev@copyninja.info | \ + xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur +notmuch search --format=text0 --output=files tag:Spam and + to:vasudev-debian@copyninja.info | \ + xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur + + +MDIR="vasudev-copyninja.info vasudev-debian Gmail-1" +mbsync -Va +notmuch new + +for mdir in $MDIR; do + echo "Processing $mdir" + for fdir in $(ls -d /home/vasudev/Mail/$mdir/*); do + if [ $(basename $fdir) != "INBOX" ]; then + echo "Tagging for $(basename $fdir)" + notmuch tag +$(basename $fdir) -inbox -- folder:$mdir/$(basename $fdir) + fi + done +done +``` + +So before running mbsync I search for all mails tagged as deleted and delete them from system. Next I look for mails tagged as Spam on both my accounts and move it to Spam folder. Yeah you got it right these are mails escaping the spam filter and landing in my inbox and personally marked as Spam. + +After running mbsync I tag mails based on their folder (searching string folder:). This allows me easily get contents of lets say a mailing list without remembering the list address. + +### Reading Mails + +Now that we have synced and classified mail its time to setup the reading part. I use notmuch-emacs interface to read the mails. I use Spacemacs flavor of emacs so I took some time to write down the a private layer which brings together all my keybindings and classification in one place and does not clutter my entire .spacemacs file. You can find the code for my private layer in [notmuch-emacs-layer repository][1] + +### Sending Mails + +Well its not sufficient that if we can read mails, we need to be able to reply to mail. And this was the slightly tricky part where I recently got lost and had to write this post so that I don't forget it again. (And of course don't have to refer some outdated posts on web). + +My setup to send mails is using postfix as SMTP client with my own SMTP server as relayhost for it. The problem of relaying is it's not for the hosts with dynamic IP. There are couple of ways to allow hosts with dynamic IP to use relay servers, one is put the IP address from where mail will originate into my_network or second use SASL authentication. + +My preferred way is use of SASL authentication. For this I first had to create a separate account one for each machine which is going to relay the mails to my main server. Idea is to not use my primary account for SASL authentication. (Originally I was using primary account, but Jonas gave this idea of account per road runner). +``` +adduser _relay + +``` + +Here replace with name of your laptop/desktop or whatever you are using. Now we need to adjust postfix to act as relaying server. So add following lines to postfix configuration +``` +# SASL authentication +smtp_sasl_auth_enable = yes +smtp_tls_security_level = encrypt +smtp_sasl_tls_security_options = noanonymous +relayhost = [smtp.copyninja.info]:submission +smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd +``` + +So here relayhost is the server name which your postfix instance will be using to relay mails forward into internet. :submission part tells postfix to forward mail on to port 587 (secure). smtp_sasl_tls_security_options is set to disallow anonymous connection. This is must so that relay server trusts your mobile host and agrees to forward the mail for you. + +/etc/postfix/sasl_passwd is the file where you need to store password for account to be used for SASL authentication with server. Put following content into it. +``` +[smtp.example.com]:submission user:password + +``` + +Replace smtp.example.com with your SMTP server name which you have put in relayhost configuration. Replace user with _relay user you created and its password. + +To secure the sasl_passwd file and create a hash of it for postfix use following command. +``` +chown root:root /etc/postfix/sasl_passwd +chmod 0600 /etc/postfix/sasl_passwd +postmap /etc/postfix/sasl_passwd +``` + +The last command will create /etc/postfix/sasl_passwd.db file which is hash of your file /etc/postfix/sasl_passwd with same owner and permission. Now reload the postfix and check if mail makes out of your system using mail command. + +### Bonus Part + +Well since I've a script created above bringing together mail syncing and classification. I went ahead and created a systemd timer to periodically sync mails in the background. In my case every 10 minutes. Below is mailsync.timer file. +``` +[Unit] +Description=Check Mail Every 10 minutes +RefuseManualStart=no +RefuseManualStop=no + +[Timer] +Persistent=false +OnBootSec=5min +OnUnitActiveSec=10min +Unit=mailsync.service + +[Install] +WantedBy=default.target +``` + +Below is mailsync.service which is needed by mailsync.timer to execute our scripts. + +``` +[Unit] +Description=Check Mail +RefuseManualStart=no +RefuseManualStop=yes + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/mail-sync +StandardOutput=syslog +StandardError=syslog +``` + +Put these files under /etc/systemd/user and run below command to enable them. +``` +systemctl enable --user mailsync.timer +systemctl enable --user mailsync.service +systemctl start --user mailsync.timer +``` + +So that's how I've sync and send mail from my system. I came to know about afew from Jonas Smedegaard who also proof read this post. So next step I will try to improve my notmuch configuration using afew and of course a post will follow after that :-). + +-------------------------------------------------------------------------------- + +via: https://copyninja.info/blog/email_setup.html + +作者:[copyninja][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://copyninja.info +[1]:https://source.copyninja.info/notmuch-emacs-layer.git/ From 8ba290a8a4a7f4499da52ad923b4ee42eaf899f3 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 18:08:23 +0800 Subject: [PATCH 022/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20use/ru?= =?UTF-8?q?n=20bash=20aliases=20over=20ssh=20based=20session?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...run bash aliases over ssh based session.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 sources/tech/20171226 How to use-run bash aliases over ssh based session.md diff --git a/sources/tech/20171226 How to use-run bash aliases over ssh based session.md b/sources/tech/20171226 How to use-run bash aliases over ssh based session.md new file mode 100644 index 0000000000..af27a605d5 --- /dev/null +++ b/sources/tech/20171226 How to use-run bash aliases over ssh based session.md @@ -0,0 +1,131 @@ +How to use/run bash aliases over ssh based session +====== + +SSH client (ssh) is a Linux/Unix command for logging into a remote server and for executing shell commands on a remote system. It is designed to provide secure encrypted communications between two untrusted machines over an insecure network such as the Internet. + +## How to run or execute commands with Linux ssh client + +I have [set up a bash alias named file_repl][1] . It works entirely when I log in using ssh command. However, my bash aliases are not running over ssh, for example:How do I run bash shell aliases when I use ssh command?SSH client (ssh) is a Linux/Unix command for logging into a remote server and for executing shell commands on a remote system. It is designed to provide secure encrypted communications between two untrusted machines over an insecure network such as the Internet. + +To run a free command or [date command][2] with ssh: +`$ ssh [[email protected]][3] date` +Sample outputs: +``` +Tue Dec 26 09:02:50 UTC 2017 +``` + +OR +`$ ssh [[email protected]][3] free -h` +Sample outputs: +``` +  + total used free shared buff/cache available +Mem: 2.0G 428M 138M 145M 1.4G 1.1G +Swap: 0B 0B 0B +``` + +total used free shared buff/cache available Mem: 2.0G 428M 138M 145M 1.4G 1.1G Swap: 0B 0B 0B + +## Understanding bash shall and command types + +The [bash shell understands][4] the following types of commands: + + 1. Aliases such as ll + 2. Keywords such as if + 3. Functions (user defined functions such as genpasswd) + 4. Built in such as pwd + 5. Files such as /bin/date + + + +The [type command][5] or [command command][6] can be used to find out a command type: +``` +$ type -a date +date is /bin/date +$ type -a free +free is /usr/bin/free +$ command -V pwd +pwd is a shell builtin +$ type -a file_repl +is aliased to `sudo -i /shared/takes/master.replication' +``` +Both date and free are an external commands and file_repl is aliased to sudo -i /shared/takes/master.replication. One can not simply execute aliased command such as file_repl: + +``` +$ ssh user@remote file_repl +``` + +## Bash aliases not running or working over ssh client on Unix based system + +To solve this problem run ssh command as follows: +``` +$ ssh -t [[email protected]][3] /bin/bash -ic 'your-alias-here' +$ ssh -t [[email protected]][3] /bin/bash -ic 'file_repl' +``` +Where ssh command options: + + 1. **-t** :[ Force pseudo-terminal allocation. This can be used to execute arbitrary][7] screen-based programs on a remote machine, which can be very useful. With the -t option you will get an error that read as " bash: cannot set terminal process group (-1): Inappropriate ioctl for device. bash: no job control in this shell. " + + + +Where bash shell options: + + 1. **-i** : Make the shell is interactive so that it can run bash aliases + 2. **-c** : Commands are read from the first non-option argument command_string. If there are arguments after the command_string, they are assigned to the positional parameters, starting with $0. + +In short run the following command to run a bash aliases called ll: +`$ ssh -t [[email protected]][3] -ic 'll'` +Sample session: +[![Running bash aliases over ssh based session when using Unix or Linux ssh cli][8]][8] +Here is my sample shell script: + +``` +#!/bin/bash +I="tags.deleted.410" +O="/tmp/https.www.cyberciti.biz.410.url.conf" +box="vivek@server1.cyberciti.biz" +[ ! -f "$I" ] && { echo "$I file not found."; exit 10; } +>$O +cat "$I" | sort | uniq | while read -r u +do + uu="${u##https://www.cyberciti.biz}" + echo "~^$uu 1;" >>"${O}" +done +echo "Config file created at ${O} and now updating remote nginx config file" +scp "${O}" ${box}:/tmp/ +ssh ${box} /usr/bin/lxc file push /tmp/https.www.cyberciti.biz.410.url.conf nginx-container/etc/nginx/ +ssh -t ${box} /bin/bash -ic 'push_config_job' +``` + +## References + +For more info see [OpenSSH client][9] and [bash man page][10] by typing the following commands: +``` +$ man ssh +$ man bash +$ help type +$ help command +``` + + +-------------------------------------------------------------------------------- + +via: https://www.cyberciti.biz/faq/use-bash-aliases-ssh-based-session/ + +作者:[Vivek Gite][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.cyberciti.biz +[1]:https://bash.cyberciti.biz/guide/Alias_command#How_to_define_alias +[2]:https://www.cyberciti.biz/faq/unix-date-command-howto-see-set-date-time/ (See Linux/Unix date command examples for more info) +[3]:https://www.cyberciti.biz/cdn-cgi/l/email-protection +[4]:https://bash.cyberciti.biz/guide/Shell_commands +[5]:https://bash.cyberciti.biz/guide/Type_command +[6]:https://bash.cyberciti.biz/guide/Command +[7]:https://www.cyberciti.biz/faq/linux-unix-bsd-sudo-sorry-you-must-haveattytorun/ +[8]:https://www.cyberciti.biz/media/new/faq/2017/12/Bash-shell-aliase-not-found-when-run-over-ssh-on-linux-unix.jpg +[9]:https://man.openbsd.org/ssh +[10]:https://www.gnu.org/software/bash/manual/bash.html From 6bd3c6d424cc433fb1ba8e8ebd1b5b62c92076d4 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 22:28:44 +0800 Subject: [PATCH 023/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Mail=20transfer?= =?UTF-8?q?=20agent=20(MTA)=20basics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...171221 Mail transfer agent (MTA) basics.md | 268 ++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 sources/tech/20171221 Mail transfer agent (MTA) basics.md diff --git a/sources/tech/20171221 Mail transfer agent (MTA) basics.md b/sources/tech/20171221 Mail transfer agent (MTA) basics.md new file mode 100644 index 0000000000..94bc55f209 --- /dev/null +++ b/sources/tech/20171221 Mail transfer agent (MTA) basics.md @@ -0,0 +1,268 @@ +Mail transfer agent (MTA) basics +====== + +## Overview + +In this tutorial, learn to: + + * Use the `mail` command. + * Create mail aliases. + * Configure email forwarding. + * Understand common mail transfer agent (MTA) programs such as postfix, sendmail, qmail, and exim. + + + +## Controlling where your mail goes + +Email on a Linux system is delivered using MTAs. Your MTA delivers mail to other users on your system and MTAs communicate with each other to deliver mail all over a group of systems or all over the world. + +### Prerequisites + +To get the most from the tutorials in this series, you need a basic knowledge of Linux and a working Linux system on which you can practice the commands covered in this tutorial. You should be familiar with GNU and UNIX commands. Sometimes different versions of a program format output differently, so your results might not always look exactly like the listings shown here. + +In this tutorial, I use Ubuntu 14.04 LTS and sendmail 8.14.4 for the sendmail examples. + +## Mail transfer + +Mail transfer agents such as sendmail deliver mail between users and between systems. Most Internet mail uses the Simple Mail Transfer Protocol (SMTP), but local mail may be transferred through files or sockets among other possibilities. Mail is a store and forward operation, so mail is stored in some kind of file or database until a user collects it or a receiving system or communication link is available. Configuring and securing an MTA is quite a complex task, most of which is beyond the scope of this introductory tutorial. + +## The mail command + +If you use SMTP email, you probably know that there are many, many mail clients that you can use, including `mail`, `mutt`, `alpine`, `notmuch`, and a host of other console and graphical mail clients. The `mail` command is an old standby that can be used to script the sending of mail as well as receive and manage your incoming mail. + +You can use `mail` interactively to send messages by passing a list of addressees, or with no arguments you can use it to look at your incoming mail. Listing 1 shows how to send a message to user steve and user pat on your system with a carbon copy to user bob. When prompted for the cc:user and the subject, enter the body and complete the message by pressing **Ctrl+D** (hold down the Ctrl key and press D). + +##### Listing 1. Using `mail` interactively to send mail +``` +ian@attic4-u14:~$ mail steve,pat +Cc: bob +Subject: Test message 1 +This is a test message + +Ian +``` + +If all is well, your mail is sent. If there is an error, you will see an error message. For example, if you typed an invalid name as a recipient, the mail is not sent. Note that in this example, all users are on your local system and therefore all must be valid users. + +You can also send mail non-interactively using the command line. Listing 2 shows how to send a small message to users steve and pat. This capability is particularly useful in scripts. Different versions of the `mail` command are available in different packages. Some support a `-c` option for cc:, but the version I am using here does not, so I specify only the to: addresses. + +Listing 2. Using `mail` non-interactively +``` +ian@attic4-u14:~$ mail -t steve,pat -s "Test message 2" <<< "Another test.\n\nIan" +``` + +If you use `mail` with no options you will see a list of your incoming mail as shown in Listing 3. You see that user steve has the two messages I sent above, plus an earlier one from me and a later one from user bob. All the mail is marked as 'N' for new mail. + +Listing 3. Using `mail` for incoming mail +``` +steve@attic4-u14:~$ mail +"/var/mail/steve": 4 messages 4 new +>N 1 Ian Shields Tue Dec 12 21:03 16/704 test message + N 2 Ian Shields Tue Dec 12 21:04 18/701 Test message 1 + N 3 Ian Shields Tue Dec 12 21:23 15/661 Test message 2 + N 4 Bob C Tue Dec 12 21:45 17/653 How about lunch tomorrow? +? +``` + +The currently selected message is shown with a '>', which is message number 1 in Listing 3. If you press **Enter** , the first page of the next unread message will be displayed. Press the **Space bar** to page through the message. When you finish reading the message and return to the '?' prompt, press **Enter** again to view the next message, and so on. At any '?' prompt you can type 'h' to see the list of message headers again. The ones you have read will now show 'R' in the status as shown in Listing 4. + +Listing 4. Using 'h' to display mail headers +``` +? h + R 1 Ian Shields Tue Dec 12 21:03 16/704 test message + R 2 Ian Shields Tue Dec 12 21:04 18/701 Test message 1 +>R 3 Ian Shields Tue Dec 12 21:23 15/661 Test message 2 + N 4 Bob C Tue Dec 12 21:45 17/653 How about lunch tomorrow? +? +``` + +Here Steve has read the three messages from Ian but has not read the message from Bob. You can select individual messages by number, and you can also delete messages that you don't want by typing 'd', or '3d' to delete the third message. If you type 'q' you will quit the `mail` command. Messages that you have read will be transferred to the mbox file in your home directory and the unread messages will remain in your inbox, by default in /var/mail/$(id -un). See Listing 5. + +Listing 5. Using 'q' to quit `mail` +``` +? h + R 1 Ian Shields Tue Dec 12 21:03 16/704 test message + R 2 Ian Shields Tue Dec 12 21:04 18/701 Test message 1 +>R 3 Ian Shields Tue Dec 12 21:23 15/661 Test message 2 + N 4 Bob C Tue Dec 12 21:45 17/653 How about lunch tomorrow? +? q +Saved 3 messages in /home/steve/mbox +Held 1 message in /var/mail/steve +You have mail in /var/mail/steve +``` + +If you type 'x' to exit instead of 'q' to quit, your mailbox will be left unchanged. Because this is on the /var file system, your system administrator may allow mail to be kept there only for a limited time. To reread or otherwise process mail that has been saved to your local mbox file, use the `-f` option to specify the file you want to read. For example `mail -f mbox`. + +## Mail aliases + +In the previous section you saw how mail can be sent to various users on a system. You can use a fully qualified name, such as ian@myexampledomain.com to send mail to a user on another system. + +Sometimes you might want all the mail for a user to go to some other place. For example, you may have a server farm and want all the root mail to go to a central system administrator. Or you may want to create a mailing list where mail goes to several people. To do this, you use aliases that allow you to define one or more destinations for a given user name. The destinations may be other user mail boxes, files, pipes, or commands that do further processing. You do this by specifying the aliases in /etc/mail/aliases or /etc/aliases. Depending on your system, you may find that one of these is a symbolic link to the other, or you may have only one of them. You need root authority to change the aliases file. + +The general form of an alias is +name: addr_1, addr_2, addr_3, ... +where the name is a local user name to alias or an alias and the addr_1, addr_2, ... are one or more aliases. Aliases can be a local user, a local file name, another alias, a command, an include file, or an external address. + +So how does sendmail distinguish the aliases (the addr-N values)? + + * A local user name is a text string that matches the name of a user on this system. Technically this means it can be found using the `getpwnam` call . + * A local file name is a full path and file name that starts with '/'. It must be writeable by `sendmail`. Messages are appended to the file. + * A command starts with the pipe symbol (|). Messages are sent to the command using standard input. + * An include file alias starts with :include: and specifies a path and file name. The aliases in file are added to the aliases for this name. + * An external address is an email address such as john@somewhere.com. + + + +You should find an example file, such as /usr/share/sendmail/examples/db/aliases that was installed with your sendmail package. It contains some recommended aliases for postmaster, MAILER-DAEMON, abuse, and spam. In Listing 6, I have combined entries from the example file on my Ubuntu 14.04 LTS system with some rather artificial examples that illustrate several of the possibilities. + +Listing 6. Somewhat artificial /etc/mail/aliases example + +``` +ian@attic4-u14:~$ cat /etc/mail/aliases +# First include some default system aliases from +# /usr/share/sendmail/examples/db/aliases + +# +# Mail aliases for sendmail +# +# You must run newaliases(1) after making changes to this file. +# + +# Required aliases +postmaster: root +MAILER-DAEMON: postmaster + +# Common aliases +abuse: postmaster +spam: postmaster + +# Other aliases + +# Send steve's mail to bob and pat instead +steve: bob,pat + +# Send pat's mail to a file in her home directory and also to her inbox. +# Finally send it to a command that will make another copy. +pat: /home/pat/accumulated-mail, + \pat, + |/home/pat/makemailcopy.sh + +# Mailing list for system administrators +sysadmins: :include: /etc/aliases-sysadmins +``` + +Note that pat is both an alias and a user of the system. Alias expansion is recursive, so if an alias is also a name, then it will be expanded. Sendmail does not send mail twice to a given user, so if you just put 'pat' as an alias for 'pat', then it would be ignored since sendmail had already found and processed 'pat'. To avoid this problem, you prefix an alias name with a '\' to indicate that it is a name not subject to further aliasing. This way, pat's mail can be sent to her normal inbox as well as the file and command. + +Lines in the aliases that start with '$' are comments and are ignored. Lines that start with blanks are treated as continuation lines. + +The include file /etc/aliases-sysadmins is shown in Listing 7. + +Listing 7. The /etc/aliases-sysadmins include file +``` +ian@attic4-u14:~$ cat /etc/aliases-sysadmins + +# Mailing list for system administrators +bob,pat +``` + +## The newaliases command + +Most configuration files used by sendmail are compiled into database files. This is also true for mail aliases. You use the `newaliases` command to compile your /etc/mail/aliases and any included files to /etc/mail/aliases.db. Note that `newaliases` is equivalent to `sendmail -bi`. Listing 8 shows an example. + +Listing 8. Rebuild the database for the mail aliases file +``` +ian@attic4-u14:~$ sudo newaliases +/etc/mail/aliases: 7 aliases, longest 62 bytes, 184 bytes total +ian@attic4-u14:~$ ls -l /etc/mail/aliases* +lrwxrwxrwx 1 root smmsp 10 Dec 8 15:48 /etc/mail/aliases -> ../aliases +-rw-r----- 1 smmta smmsp 12288 Dec 13 23:18 /etc/mail/aliases.db +``` + +## Examples of using aliases + +Listing 9 shows a simple shell script that is used as a command in my alias example. + +Listing 9. The makemailcopy.sh script +``` +ian@attic4-u14:~$ cat ~pat/makemailcopy.sh +#!/bin/bash + +# Note: Target file ~/mail-copy must be writeable by sendmail! +cat >> ~pat/mail-copy +``` + +Listing 10 shows the files that are updated when you put all this to the test. + +Listing 10. The /etc/aliases-sysadmins include file +``` +ian@attic4-u14:~$ date +Wed Dec 13 22:54:22 EST 2017 +ian@attic4-u14:~$ mail -t sysadmins -s "sysadmin test 1" <<< "Testing mail" +ian@attic4-u14:~$ ls -lrt $(find /var/mail ~pat -type f -mmin -3 2>/dev/null ) +-rw-rw---- 1 pat mail 2046 Dec 13 22:54 /home/pat/mail-copy +-rw------- 1 pat mail 13240 Dec 13 22:54 /var/mail/pat +-rw-rw---- 1 pat mail 9442 Dec 13 22:54 /home/pat/accumulated-mail +-rw-rw---- 1 bob mail 12522 Dec 13 22:54 /var/mail/bob +``` + +Some points to note: + + * There is a user 'mail' with group name 'mail' that is used by sendmail. + * User mail is stored by sendmail in /var/mail which is also the home directory of user 'mail'. The inbox for user 'ian' defaults to /var/mail/ian. + * If you want sendmail to write files in a user directory, the file must be writeable by sendmail. Rather than making it world writeable, it is customary to make it group writeable and make the group 'mail'. You may need a system administrator to do this for you. + + + +## Using a .forward file to forward mail + +The aliases file must be managed by a system administrator. Individual users can enable forwarding of their own mail using a .forward file in their own home directory. You can put anything in your .forward file that is allowed on the right side of the aliases file. The file contains plain text and does not need to be compiled. When mail is destined for you, sendmail checks for a .forward file in your home directory and processes the entries the same way it processes aliases. + +## Mail queues and the mailq command + +Linux mail handling uses a store-and-forward model. You have already seen that your incoming mail is stored in a file in /var/mail until you read it. Outgoing mail is also stored until a receiving server connection is available. You use the `mailq` command to see what mail is queued. Listing 11 shows an example of mail being sent to an external user, ian@attic4-c6, and the result of running the `mailq` command. In this case, there is currently no active link to attic4-c6, so the mail will remain queued until a link becomes active. + +Listing 11. Using the `mailq` command +``` +ian@attic4-u14:~$ mail -t ian@attic4-c6 -s "External mail" <<< "Testing external mail queues" +ian@attic4-u14:~$ mailq +MSP Queue status... +/var/spool/mqueue-client is empty + Total requests: 0 +MTA Queue status... + /var/spool/mqueue (1 request) +-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient----------- +vBE4mdE7025908* 29 Wed Dec 13 23:48 + + Total requests: 1 +``` + +## Other mail transfer agents + +In response to security issues with sendmail, several other mail transfer agents were developed during the 1990's. Postfix is perhaps the most popular, but qmail and exim are also widely used. + +Postfix started life at IBM research as an alternative to sendmail. It attempts to be fast, easy to administer, and secure. The outside looks somewhat like sendmail, but the inside is completely different. + +Qmail is a secure, reliable, efficient, simple message transfer agent developerd by Dan Bernstein. However, the core qmail package has not been updated for many years. Qmail and several other packages have now been collected into IndiMail. + +Exim is another MTA developed at the University of Cambridge. Originally, the name stood for EXperimental Internet Mailer. + +All of these MTAs were designed as sendmail replacements, so they all have some form of sendmail compatibility. Each can handle aliases and .forward files. Some provide a `sendmail` command as a front end to the particular MTA's own command. Most allow the usual sendmail options, although some options might be ignore silently. The `mailq` command is supported directly or by an alternate command with a similar function. For example, you can use `mailq` or `exim -bp` to display the exim mail queue. Needless to say, output can look different compared to that produced by sendmail's `mailq` command. + +See Related topics where you can find more information on all of these MTAs. + +This concludes your introduction to mail transfer agents on Linux. + + +-------------------------------------------------------------------------------- + +via: https://www.ibm.com/developerworks/library/l-lpic1-108-3/index.html + +作者:[Ian Shields][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.ibm.com +[1]:http://www.lpi.org +[2]:https://www.ibm.com/developerworks/library/l-lpic1-map/ From 8dc9c76064dddc4a2329d90e4f91fc49d1552006 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 22:32:26 +0800 Subject: [PATCH 024/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Improve=20your=20?= =?UTF-8?q?code=20searching=20skills=20with=20pss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ove your code searching skills with pss.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20171222 Improve your code searching skills with pss.md diff --git a/sources/tech/20171222 Improve your code searching skills with pss.md b/sources/tech/20171222 Improve your code searching skills with pss.md new file mode 100644 index 0000000000..d273287f15 --- /dev/null +++ b/sources/tech/20171222 Improve your code searching skills with pss.md @@ -0,0 +1,83 @@ +translating by lujun9972 +Improve your code searching skills with pss +====== +Searching a code base is a part of every day developer activities. From fixing a bug, to learning a new code base or checking how to call an api, being able to quickly navigate your way into a code base is a great skill to have. Luckily, we have dedicated tools to search code. Let's see how to install and use one of them - [**pss**][1]. + +### What is pss? + +**pss** is a command line tool that helps searching inside source code file. **pss** searches recursively within a directory tree, knows which extensions and file names to search and which to ignore, automatically skips directories you wouldn't want to search in (for example `.svn` or `.git`), colors its output in a helpful way, and much more. + +### Installing pss + +Install **pss** on Fedora with the following command: +``` + $ dnf install pss +``` + +Once the installation is complete you can now call **pss** in your terminal +``` + $ pss +``` + +Calling **pss** without any argument or with the -h flag will print a detailed usage message. + +### Usage examples + +Now that you have installed **pss** let 's go through some Usage examples. +``` + $ pss foo +``` + +This command simply looks for `foo`. You can be more restrictive and ask pss to look for `foo` only in python files: +``` + $ pss foo --py +``` + +and for `bar` in all other files: +``` + $ pss bar --nopy +``` + +Additionally, **pss** supports most of the well known source file types, to get the full list execute: +``` +$ pss --help-types +``` + +You can also ignore some directories. Note that by default, **pss** will ignore directories like .git, __pycache__, .metadata and more. +``` +$ pss foo --py --ignore-dir=dist +``` + +Furthermore, **pss** also gives you the possibility to get more context from your search using the following : +``` +$ pss -A 5 foo +``` + +will display 5 line of context after the matching word +``` +$ pss -B 5 foo +``` + +will display 5 line of context before the matching word +``` +$ pss -C 5 foo +``` + +will display 5 line of context before & after the matching word + +If you would like to learn how to use **pss ** with regular expression and other options, more examples are available [here][2]. + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/improve-code-searching-skills-pss/ + +作者:[Author Archive;Author Website;Clément Verna][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://fedoramagazine.org +[1]:https://github.com/eliben/pss +[2]:https://github.com/eliben/pss/wiki/Usage-samples From ee074838efde04b434fe1c49de7a45420ed45e17 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 22:38:23 +0800 Subject: [PATCH 025/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20create?= =?UTF-8?q?=20mobile-friendly=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to create mobile-friendly documentation.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20171221 How to create mobile-friendly documentation.md diff --git a/sources/tech/20171221 How to create mobile-friendly documentation.md b/sources/tech/20171221 How to create mobile-friendly documentation.md new file mode 100644 index 0000000000..96d01f515a --- /dev/null +++ b/sources/tech/20171221 How to create mobile-friendly documentation.md @@ -0,0 +1,95 @@ +How to create mobile-friendly documentation +====== +![配图](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_mobile_phone.png?itok=RqVtvxkd) +I'm not sold on the whole idea of [mobile first][1], but I do know that more people than ever are using mobile devices like smartphones and tablets to get information on the go. That includes online software and hardware documentation, much of which is lengthy and poorly suited for small screens. Often, it doesn't scale properly, and it can be difficult to navigate. + +When people access documentation using a mobile device, they usually want a quick hit of information to learn how to perform a task or solve a problem. They don't want to wade through seemingly endless pages to find the specific piece of information they need. Fortunately, it's not hard to address this problem. Here are a few tips to help you structure your documentation to meet the needs of mobile readers. + +### Think short + +That means short sentences, short paragraphs, and short procedures. You're not writing a novel or a piece of long-form journalism. Make your documentation concise. Use as few words as possible to get ideas and information across. + +Use a radio news report as a guide: Focus on the key elements and explain them in simple, direct language. Don't make your reader wade through screen after screen of turgid text. + +Focus on the key elements and explain them in simple, direct language. + +Also, get straight to the point. Focus on the information readers need when they need it. Documentation published online shouldn't resemble the thick manuals of yore. Don't lump everything together on a single page. Break your information into smaller chunks. Here's how to do that: + +### Think topics + +Also, get straight to the point. Focus on the information readers need when they need it. Documentation published online shouldn't resemble the thick manuals of yore. Don't lump everything together on a single page. Break your information into smaller chunks. Here's how to do that: + +In the technical writing world, topics are individual, stand-alone chunks of information. Each topic comprises a single page on your site. Readers should be able to get the information they need--and only that information--from a specific topic. To make that happen, choose which topics to include in your documentation and decide how to organize them: + +### Think DITA + +[Darwin Information Typing Architecture][2], or DITA, is an XML model for writing and publishing. It's been [widely adopted][3] in the technical writing world, especially for longer documentation sets. + +I'm not suggesting that you convert your documentation to XML (unless you really want to). Instead, consider applying DITA's concept of separate types of topics to your documentation: + + * General: overview information + * Task: step-by-step procedures + * Concept: background or conceptual information + * Reference: specialized information like API references or data dictionaries + * Glossary: to define terms + * Troubleshooting: information on problems users may encounter and how to fix them + + + +You'll wind up with a lot of individual pages. To connect those pages: + +### Think linking + +Many content management systems, wikis, and publishing frameworks include some form of navigation--usually a table of contents or [breadcrumbs][4]. It's the kind of navigation that fades into the background on a mobile device. + +For stronger navigation, add explicit links between topics. Place those links at the end of each topic with the heading **See Also** or **Related Topics**. Each section should contain two to five links that point to overview, concept, and reference topics related to the current topic. + +If you need to point to information outside of your documentation set, make sure the link opens in a new browser tab. That sends the reader to another site while also keeping them on your site. + +If you need to point to information outside of your documentation set, make sure the link opens in a new browser tab. + +That takes care of the text. What about graphics? + +### Think unadorned + +That takes care of the text. What about graphics? + +With a few exceptions, images don't add much to documentation. Take a critical look at each image in your documentation. Then ask: + + * Does it serve a purpose? + * Does it enhance the documentation? + * Will readers miss this image if I remove it? + + + +With a few exceptions, images don't add much to documentation. + +If the answer to those questions is no, remove the image. + +If the answer to those questions is no, remove the image. + +On the other hand, if you absolutely can't do without an image, make it [responsive][5]. That way, the image will automatically resize to fit in a smaller screen. + +If you're still not sure about an image, Opensource.com community moderator Ben Cotton offers an [excellent explanation][6] of when to use screen captures in documentation. + +### A final thought + +With a little effort, you can structure your documentation to work well for mobile device users. Another plus: These changes improve documentation for desktop computer and laptop users, too. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/12/think-mobile + +作者:[Scott Nesbitt][a] +译者:[译者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/chrisshort +[1]:https://www.uxmatters.com/mt/archives/2012/03/mobile-first-what-does-it-mean.php +[2]:https://en.wikipedia.org/wiki/Darwin_Information_Typing_Architecture +[3]:http://dita.xml.org/book/list-of-organizations-using-dita +[4]:https://en.wikipedia.org/wiki/Breadcrumb_(navigation) +[5]:https://en.wikipedia.org/wiki/Responsive_web_design +[6]:https://opensource.com/business/15/9/when-does-your-documentation-need-screenshots From 1daab7fa64d9ff9eab95ae5a0821d254cca0b4f3 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 22:43:39 +0800 Subject: [PATCH 026/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20A=20Commandline?= =?UTF-8?q?=20Food=20Recipes=20Manager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1221 A Commandline Food Recipes Manager.md | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 sources/tech/20171221 A Commandline Food Recipes Manager.md diff --git a/sources/tech/20171221 A Commandline Food Recipes Manager.md b/sources/tech/20171221 A Commandline Food Recipes Manager.md new file mode 100644 index 0000000000..63fe9a76ab --- /dev/null +++ b/sources/tech/20171221 A Commandline Food Recipes Manager.md @@ -0,0 +1,141 @@ +HeRM’s - A Commandline Food Recipes Manager +====== +![配图](https://www.ostechnix.com/wp-content/uploads/2017/12/herms-720x340.jpg) + +Cooking is love made visible, isn't? Indeed! Either cooking is your passion or hobby or profession, I am sure you will maintain a cooking journal. Keeping a cooking journal is one way to improve your cooking practice. There are many ways to take notes about the recipes. You could maintain a small diary/notebook or store the recipe's notes in the smartphone or save them in a word document in your computer. There are multitude of options. Today, I introduce **HeRM 's**, a Haskell-based commandline food recipes manager to make notes about your delicious food recipes. Using Herm's, you can add, view, edit, and delete food recipes and even can make your shopping lists. All from your Terminal! It is free, and open source utility written using Haskell programming language. The source code is freely available in GitHub, so you can fork it, add more features or improve it. + +### HeRM's - A Commandline Food Recipes Manager + +#### **Installing HeRM 's** + +Since it is written using Haskell, we need to install Cabal first. Cabal is a command-line program for downloading and building software written in Haskell programming language. Cabal is available in the core repositories of most Linux distributions, so you can install it using your distribution's default package manager. + +For instance, you can install cabal in Arch Linux and its variants such as Antergos, Manjaro Linux using command: +``` +sudo pacman -S cabal-install +``` + +On Debian, Ubuntu: +``` +sudo apt-get install cabal-install +``` + +After installing Cabal, make sure you have added it your PATH. To do so, edit your **~/.bashrc** file: +``` +vi ~/.bashrc +``` + +Add the following line: +``` +PATH=$PATH:~/.cabal/bin +``` + +Press **:wq** to save and quit the file. Then, run the following command to update the changes made. +``` +source ~/.bashrc +``` + +Once cabal installed, run the following command to install herms: +``` +cabal install herms +``` + +Have a cup of coffee! This will take a while. After couple minutes, you will see an output, something like below. +``` +[...] +Linking dist/build/herms/herms ... +Installing executable(s) in /home/sk/.cabal/bin +Installed herms-1.8.1.2 +``` + +Congratulations! Herms is installed. + +#### **Adding recipes** + +Let us add a food recipe, for example **Dosa**. For those wondering, Dosa is a popular south Indian food served hot with **sambar** and **chutney**. It is a healthy, and arguably most delicious food. It contains no added sugars or saturated fats. It is also easy to make one. There are couple types of different Dosas, the most common served in our home is Plain Dosa. + +To add a recipe, type: +``` +herms add +``` + +You will see a screen something like below. Start entering the recipe's details. + +[![][1]][2] + +To navigate through fields,use the following keyboard shortcuts: + + * **Tab / Shift+Tab** - Next / Previous field + * **Ctrl + ** - Navigate fields + * **[Meta or Alt] + ** - Navigate fields + * **Esc** - Save or Cancel. + + + +Once you added the recipe's details, press ESC key and hit Y to save it. Similarly, you can add as many recipes as you want. + +To list the added recipes, type: +``` +herms list +``` + +[![][1]][3] + +To view the details of any recipes listed above, just use the respective number like below. +``` +herms view 1 +``` + +[![][1]][4] + +To edit any recipes, use: +``` +herms edit 1 +``` + +Once you made the changes, press ESC key. You'll be asked whether you want to save or not. Just choose the appropriate option. + +[![][1]][5] + +To delete a recipe, the command would be: +``` +herms remove 1 +``` + +To generate a shopping list for a given recipe(s), run: +``` +herms shopping 1 +``` + +[![][1]][6] + +For help, run: +``` +herms -h +``` + +The next time you overhear a conversation about a good recipe from your colleague or friend or somewhere else, just open Herms and quickly take a note and share them to your spouse. She would be delighted! + +And, that's all. More good stuffs to come. Stay tuned! + +Cheers!! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/herms-commandline-food-recipes-manager/ + +作者:[][a] +译者:[译者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 +[1]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]:http://www.ostechnix.com/wp-content/uploads/2017/12/Make-Dosa-1.png () +[3]:http://www.ostechnix.com/wp-content/uploads/2017/12/herms-1-1.png () +[4]:http://www.ostechnix.com/wp-content/uploads/2017/12/herms-2.png () +[5]:http://www.ostechnix.com/wp-content/uploads/2017/12/herms-3.png () +[6]:http://www.ostechnix.com/wp-content/uploads/2017/12/herms-4.png () From 52af3f928f2cd392e63c6898f04018f3924afa15 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 22:46:57 +0800 Subject: [PATCH 027/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20What=20DevOps=20t?= =?UTF-8?q?eams=20really=20need=20from=20a=20CIO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hat DevOps teams really need from a CIO.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/tech/20171205 What DevOps teams really need from a CIO.md diff --git a/sources/tech/20171205 What DevOps teams really need from a CIO.md b/sources/tech/20171205 What DevOps teams really need from a CIO.md new file mode 100644 index 0000000000..d86f549d18 --- /dev/null +++ b/sources/tech/20171205 What DevOps teams really need from a CIO.md @@ -0,0 +1,59 @@ +What DevOps teams really need from a CIO +====== +IT leaders can learn from plenty of material exploring [DevOps][1] and the challenging cultural shift required for [making the DevOps transition][2]. But are you in tune with the short and long term challenges that a DevOps team faces - and what they really need from a CIO? + +In my conversations with DevOps team members, some of what I heard might surprise you. DevOps pros (whether part of an internal or external team) want to put the following things at the top of your CIO radar screen. + +### 1. Communication + +First and foremost, DevOps pros need peer-level communication. An experienced DevOps team is extremely knowledgeable on current DevOps trends, successes, and failures in the industry and is interested in sharing this information. DevOps concepts are difficult to convey, so be open to a new working relationship in which there are regular (don't worry, not weekly) conversations about the current state of your IT, how the pieces in the environment communicate, and your overall IT estate. + +**[ Want even more wisdom from CIOs on leading DevOps? See our comprehensive resource,[DevOps: The IT Leader's Guide][3]. ]** + +Conversely, be prepared to share current business needs and goals with the DevOps team. Business objectives no longer exist in isolation from IT: They are now an integral component of what drives your IT advancements, and your IT determines how effectively you can execute on your business needs and goals. + +Focus on participating rather than leading. You are still the ultimate arbiter when it comes to decisions, but understand that these decisions are best made collaboratively in order to empower and motivate your DevOps team. + +### 2. Reduction of technical debt + +Second, strive to better understand technical debt and how DevOps efforts are going to reduce it. Your DevOps team is working hard on this front. In this case, technical debt refers to the manpower and infrastructure resources that are usurped daily by maintaining and adding new features on top of a monolithic, non-sustainable environment (read Rube Goldberg). + +Common CIO questions include: + + * Why do we need to do things in a new way? + * Why are we spending time and money on this? + * If there's no new functionality, just existing pieces being broken out with automation, then where is the gain? + + + +The "if it ain't broke don't fix it" thinking is understandable. But if the car is driving fine while everyone on the road accelerates past you, your environment IS broken. Precious resources continue to be sucked into propping up or augmenting an environmental kluge. + +Addressing every issue in isolation results in a compromised choice from the start that is worsened with each successive patch - layer upon layer added to a foundation that wasn't built to support it. In actuality, this approach is similar to plugging a continuously failing dike. Sooner or later you run out of fingers and the whole thing buckles under the added pressures, drowning your resources. + +The solution: automation. The result of automation is scalability - less effort per person to maintain and grow your IT environment. If adding manpower is the only way to grow your business, then scalability is a pipe dream. + +Automation reduces your manpower requirements and provides the flexibility required for continued IT evolution. Simple, right? Yes, but you must be prepared for delayed gratification. An upfront investment of time and effort for architectural and structural changes is required in order to reap the back-end financial benefits of automation with improved productivity and efficiency. Embracing these challenges as an IT leader is crucial in order for your DevOps team to successfully execute. + +### 3. Trust + +Lastly, trust your DevOps team and make sure they know it. DevOps experts understand that this is a tough request, but they must have your unquestionable support and your willingness to actively participate. It will often be a "learn as you go" experience for you as the DevOps team successively refines your IT environment, while they themselves adapt to ever-changing technology. + +Listen, listen, listen to them and trust them. DevOps changes are valuable and well worth the time and money through increased efficiency, productivity, and business responsiveness. Trusting your DevOps team gives them the freedom to make the most effective IT improvements. + +The new CIO bottom line: To maximize your DevOps team's potential, leave your leadership comfort zone and embrace a "CIOps" transition. Continuously work on finding common ground with the DevOps team throughout the DevOps transition, to help your organization achieve long-term IT success. + + +-------------------------------------------------------------------------------- + +via: https://enterprisersproject.com/article/2017/12/what-devops-teams-really-need-cio + +作者:[John Allessio][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://enterprisersproject.com/user/john-allessio +[1]:https://enterprisersproject.com/tags/devops +[2]:https://www.redhat.com/en/insights/devops?intcmp=701f2000000tjyaAAA +[3]:https://enterprisersproject.com/devops?sc_cid=70160000000h0aXAAQ From f5e6e675d240a3d098c2a77ce181e9586a720d7c Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 22:52:49 +0800 Subject: [PATCH 028/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Increase=20Torren?= =?UTF-8?q?t=20Speed=20-=20Here=20Is=20Why=20It=20Will=20Never=20Work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Speed - Here Is Why It Will Never Work.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md diff --git a/sources/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md b/sources/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md new file mode 100644 index 0000000000..55413f97aa --- /dev/null +++ b/sources/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md @@ -0,0 +1,68 @@ +translating by lujun9972 +Increase Torrent Speed - Here Is Why It Will Never Work +====== + +Haven't we always wanted **better torrent speed**? No matter how much you have. You just can 't get enough of it. Our obsession with torrenting speed has often resulted in trying out those tricks from several websites including YouTube videos. And believe me, ever since I was a child till date I haven't found luck with it. So in this article, Let us have a look at why trying to increase torrent speed never works. + +## Factors that affect speed + +### Local Factors + +In the image below you can see that there are 3 computers with User A, B, and C. Now A and B are connected to each locally and C is somewhere far with multiple connection points 1,2 and 3 in between. + +[![][1]][2] + +If user A and B have to share files between them, they can directly do so without the need for torrents with the maximum speed available. This speed does not rely on the internet or anything. + + * The capacity of the wire + + * The capacity of network card of the devices + + * The capacity of the router + +I always see people talk about complicated stuff when it comes to torrenting but they always miss out on important factors. + +[![LAN wire, network cards, router][3]][3] + +Now we are talking about local file share, The usual network cards that people have in their newer devices are of 1 Gigabit. The common routers are around 300 Megabits and the wires can also mostly take 100 Megabits. Now you might be having a different setup but I am just giving a general example. + +Since you have a 1 Gigabit Network adapter, you believe that you should get 125 Megabytes in speed. But the router is only capable of only transferring a 300 Megabits which is 30 Megabyte. + +Even if you wanted to bargain at 30 Megabytes, The cable/link connecting you to the router is only capable of 100 megabits or 10 MegaBytes at best. This is a pure case of bottlenecking where one weak component affects the other stronger ones as transfers will happen with only 10 Megabytes which is the cable's limit. Now imagine a torrent which can be downloaded at extreme speed. But it is your weak hardware creating the bottleneck. + +### Foreign Factors + +Look at this image again. User C is somewhere far away. Probably in another country. **** + +[![how torrent works][1]][2] + +If this user created a torrent and you were to download it. The first problem would be the one we have already discussed. You wouldn 't be able to cross the 10 Megabyte mark. + +Secondly, since there are multiple points in between, maybe one of them could become the bottleneck again, it might have too much traffic and comparatively weaker hardware. Resulting in lower speed. + +### Seeders & Leechers + +There has already been too much discussion about it and the general idea is to have more seeders. I've also discussed seeders and leechers in [this article][4]. This is true, but keeping the above factor in mind, good seeders from a location that doesn't have a great link with mine is of no help at all. Usually, this doesn't happen most of the time as we are not the only ones downloading it and someone from our locality already has the file and is now seeding it. + +## Conclusion + +We tried to understand the reason behind our good or bad torrent speed. Irrespective of how many software tweaks we try, most of the times it is the physical barrier. I have usually never had any problems with the software and the default settings have worked for me. + +I hope you liked the article, Please feel free to pen down your thoughts in the comment section below. + + +-------------------------------------------------------------------------------- + +via: http://www.theitstuff.com/increase-torrent-speed-will-never-work + +作者:[Rishabh Kandari][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.theitstuff.com/author/reevkandari +[1]:http://www.theitstuff.com/wp-content/uploads/2017/11/A-550x275.png +[2]:http://www.theitstuff.com/wp-content/uploads/2017/11/A.png +[3]:http://www.theitstuff.com/wp-content/uploads/2017/11/A-1-e1509773618549.png +[4]:http://www.linuxandubuntu.com/home/torrents-everything-you-need-to-know From 1fa2832c3c6d17ec7fcbd5dd011715e3dc88e902 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 22:56:21 +0800 Subject: [PATCH 029/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=203=20ways=20roboti?= =?UTF-8?q?cs=20affects=20the=20CIO=20role?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...03 3 ways robotics affects the CIO role.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 sources/tech/20171103 3 ways robotics affects the CIO role.md diff --git a/sources/tech/20171103 3 ways robotics affects the CIO role.md b/sources/tech/20171103 3 ways robotics affects the CIO role.md new file mode 100644 index 0000000000..92cdc73509 --- /dev/null +++ b/sources/tech/20171103 3 ways robotics affects the CIO role.md @@ -0,0 +1,51 @@ +3 ways robotics affects the CIO role +====== +As 2017 comes to a close, many CIOs are solidifying their goals for 2018. Perhaps yours involve robotic process automation (RPA.) For years, RPA has been a distant concept for many companies. But as organizations are forced to become ever more nimble and efficient, the potential benefits of RPA bear examining. + +According to a recent[ survey][1] by Redwood Software and Sapio Research, IT decision makers believe that 59 percent of business processes can be automated in the next five years, creating new speed and efficiency while relieving their human counterparts of repetitive manual workloads. However, 20 percent of companies with more than 1000 employees currently have no RPA strategy in place. + +For CIOs, RPA has implications for your role in the business and for your team. Here are three ways that the role of the CIO and other IT decision makers can change as RPA gains prominence in 2018: + +### Added opportunity to be strategic change agents + +As the pressure grows to do more with less, internal processes matter greatly. In every enterprise, employees across departments are performing critical - yet mundane - tasks every single day. These tasks may be boring and repetitive, but they must be performed quickly, and often with no room for error. + +**[ For advice on maximizing your automation strategy's ROI, see our related article,[How to improve ROI on automation: 4 tips][2]. ]** + +From back-office operations in finance to procurement, supply chain, accounting, customer service, and human resources, nearly every position within an organization is plagued with at least some monotonous tasks. For CIOs, this opens up an opportunity to unite the business with IT and spearhead strategic change with RPA. + +Having evolved far beyond screen-scraping technology of the past, robots are now customizable, plug-and-play solutions that can be built to an organization's specific needs. With such a process-centric approach, companies can automate not only tasks previously executed by humans, but also application and system-specific tasks, such as ERP and other enterprise applications. + +Enabling a greater level of automation for end-to-end processes is where the value lies. CIOs will be on the front line of this opportunity. + +### Renewed focus on people and training + +Technology shifts can be unnerving to employees, especially when these changes involve automating substantial portions of their daily duties. The CIO should articulate how RPA will change roles and responsibilities for the better, and fuel data-driven, strategic decisions that will ultimately impact the bottom line. + +When implementing RPA, it's important to convey that humans will always be critical to the success of the organization, and that success requires the right balance of technology and human skills. + +CIOs should also analyze workflow and implement better processes that go beyond mimicking end-user specific tasks. Through end-to-end process automation, CIOs can enable employees to shine. + +Because it will be important to upskill and retrain employees throughout the automation process, CIOs must be prepared to collaborate with the C-suite to determine training programs that help employees navigate the change with confidence. + +### Demand for long-term thinking + +To succeed with robotic process automation, brands must take a long-term approach. This will require a scalable solution, which in turn will benefit the entire business model, including customers. When Amazon introduced faster delivery options for Prime customers, for example, it didn't just retool the entire order fulfillment process in its warehouses; it automated its online customer experience to make it simpler, faster, and easier than ever for consumers to place orders. + +In the coming year, CIOs can approach technology in the same way, architecting holistic solutions to change the way an organization operates. Reducing headcount will net only so much in bottom-line results, but process automation allows CIOs to think bigger through optimization and empowerment. This approach gives CIOs the opportunity to build credibility for the long haul, for themselves and for RPA. This in turn will enhance the CIO's role as a navigator and contributor to the organization's overall success. + +For CIOs, taking a long-term, strategic approach to RPA success takes time and hard work. Nevertheless, CIOs who commit the time to create a strategy that balances manpower and technology will deliver value now and in the future. + +-------------------------------------------------------------------------------- + +via: https://enterprisersproject.com/article/2017/11/3-ways-robotics-affects-cio-role + +作者:[Dennis Walsh][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://enterprisersproject.com/user/dennis-walsh +[1]:https://www.redwood.com/press-releases/it-decision-makers-speak-59-of-business-processes-could-be-automated-by-2022/ +[2]:https://enterprisersproject.com/article/2017/11/how-improve-roi-automation-4-tips?sc_cid=70160000000h0aXAAQ From 520f3acbd1af6e7adf744f3d92ecdb60d8241b0d Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 23:00:23 +0800 Subject: [PATCH 030/133] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20171103 3 ways robotics affects the CIO role.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20171103 3 ways robotics affects the CIO role.md b/sources/tech/20171103 3 ways robotics affects the CIO role.md index 92cdc73509..a14027aebc 100644 --- a/sources/tech/20171103 3 ways robotics affects the CIO role.md +++ b/sources/tech/20171103 3 ways robotics affects the CIO role.md @@ -1,5 +1,6 @@ 3 ways robotics affects the CIO role ====== +![配图](https://enterprisersproject.com/sites/default/files/styles/620x350/public/cio_ai.png?itok=toMIgELj) As 2017 comes to a close, many CIOs are solidifying their goals for 2018. Perhaps yours involve robotic process automation (RPA.) For years, RPA has been a distant concept for many companies. But as organizations are forced to become ever more nimble and efficient, the potential benefits of RPA bear examining. According to a recent[ survey][1] by Redwood Software and Sapio Research, IT decision makers believe that 59 percent of business processes can be automated in the next five years, creating new speed and efficiency while relieving their human counterparts of repetitive manual workloads. However, 20 percent of companies with more than 1000 employees currently have no RPA strategy in place. From 30526352e9110798f88d8a2597a6722414c5480e Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 23:06:40 +0800 Subject: [PATCH 031/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Tap=20the=20power?= =?UTF-8?q?=20of=20community=20with=20organized=20chaos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...power of community with organized chaos.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20171130 Tap the power of community with organized chaos.md diff --git a/sources/tech/20171130 Tap the power of community with organized chaos.md b/sources/tech/20171130 Tap the power of community with organized chaos.md new file mode 100644 index 0000000000..d7664ec21f --- /dev/null +++ b/sources/tech/20171130 Tap the power of community with organized chaos.md @@ -0,0 +1,110 @@ +Tap the power of community with organized chaos +====== +In this article, I want to share with you of the power of an unconference--because I believe it's a technique anyone can use to generate innovative ideas, harness the power of participation, and strengthen community ties. I've developed a 90-minute session that mimics the effects of an unconference, and you can use it to generate engagement with a small group of people and tap into their ideas surrounding a topic of your choice. + +An "unconference" is a loosely organized event format designed specifically to maximize the exchange of ideas and the sharing of knowledge in a group driven by a common purpose. While the structure of an unconference is planned, the content and exchange of ideas for breakout sessions is not. Participants plan and execute unconference sessions by voting on the content they'd like to experience. + +For larger events, some organizers allow the submission of session topics in advance of the event. This is helpful for people new to the unconference format who may not understand what they could expect to experience at the event. However, most organizers have a rule that a participant must be present to pitch and lead a session. + +One of the more popular unconferences is BarCamp. The unconference brings together people interested in a wide range of topics and technologies. As with any unconference, everyone that attends has the opportunity to share, teach, and participate. Other popular unconferences include EduCamp (with a focus on education) and CityCamp (with a focus on government and civic technology). + +As you'll discover when you do this exercise, the success of the unconference format is based on the participants that are involved and the ideas they want to share. Let's take a look at the steps needed to facilitate an unconference exercise. + +### Materials needed + +To facilitate this exercise, you will need: + + * A room for 15-20 people + * Tables and chairs for the group + * Ability to break into two or three groups + * Markers and pens + * "Dot" stickers (optional) + * Sheets of plain paper or larger sticky notes + * Timer (alarm optional) + * Moveable whiteboard (optional) + * Pre-defined topic for participants + * Facilitator(s) + + + +### Facilitation steps + +**Step 1.** Before leading the exercise, the facilitator should pre-select a topic on which the participants should generate and pitch ideas to the group. It could be a business challenge, a customer problem, a way to increase productivity, or a problem you'd like to solve for your organization. + +**Step 2.** Distribute paper or sticky notes and markers/pens to each participant. + +**Step 3.** Introduce the topic that will be the focus of the unconference exercise and ask participants to begin thinking about their pitch. Explain the process, the desired outcome, and the following timeline for the exercise: + + * 10 minutes: Explain process and pitch prep + * 20 minutes: 1-minute pitches from each participant + * 10 minutes: Voting + * 10 minutes: Break / count votes + * 5 minutes: Present top selections and breakout sessions + * 25 minutes: Breakout collaboration + * 10 minutes: Readouts + + + +**Step 4.** Ask participants to first prepare a 30 ‒60 second pitch based on the topic. This is an idea they want to share with the group to potentially explore in a breakout session. Participants should compose a title, brief description, and add their name to the paper you handed out. Pro-tip: Leave room for voting at the bottom. + +An example format for a pitch sheet might look like this: + +Title: + +Description: + +Name: + +Voting: + +**Step 5.** Begin the pitch process and time each participant for 60 seconds. Instruct each participant to share their name, title, and to briefly describe their idea (this is "the pitch.") If a participant begins to go over time, kindly stop them by starting to clap, others will follow suit. Alternatively, you can use an alarm on the timer. As each participant finishes a pitch, the group should clap to encourage others and boost confidence for the other pitches. + +**Step 6.** At the conclusion of each pitch the facilitator should lay out the pitch papers on a table, tape them to the wall, or post them to a moveable whiteboard so participants can vote on them before heading out for the break (second pro-tip: Don't use sharpies to vote if you tape pitch papers to the wall. You've been warned). Allow at least 20 minutes for steps 5 and 6. + +**Step 7.** After the pitches, give all participants three votes to select the topic(s) they are most interested in discussing or exploring further. Have them vote on the pitch paper, using tick marks, with the markers or pens. Alternatively, you can "dot" vote with circular stickers. Votes can spread out or stacked for preferred topics. Allow up to 10 minutes for this step. + +**Step 8.** While participants take a break, facilitators should count the votes on each pitch paper and determine the top two or three ideas. I prefer to count the votes on each pitch paper and write the number in a circle on the paper. This helps me visually see what pitches are the most popular. This will take about 10 minutes. + +**Step 9.** After the break, present these top ideas and ask the presenters of these ideas to lead a breakout session based on their pitches. For larger unconference events, there is a lot more organizing of the sessions with multiple rooms and multiple timeslots occurring. This exercise is drastically simplifying this step. + +**Step 10.** Divide participants into two or three breakout sessions. Ask participants to self-select the breakout session that is most interesting to them. Having balanced groups is preferable. + +**Step 11.** Ask pitch presenters to lead their breakout sessions with the goal of arriving at a prototype of a solution for the idea they pitched. In my experience, things will start off slow, then it will be hard to stop the collaboration. Allow up to 20 minutes for this step. + +**Step 12.** As you approach the end of the breakout sessions, ask participants to prepare their top takeaways for a group readout. Give groups a five-minute and then a two-minute warning to prepare their key takeaways. + +**Step 13.** Ask each breakout group to designate a spokesperson. + +**Step 14.** The spokesperson from each breakout group shall present their key takeaways and a summary of their prototype to the entire group. Divide the time equally between groups. A few questions from other groups are fine. This should last about 10 minutes. + +**Step 15.** Facilitators should summarize the session, encourage further action, and conclude the exercise. + +### Reflection + +I've previously run this exercise with a group of approximately twenty middle school and high school students with the sole purpose of introducing the concept of an unconference to them. For the last three years, in fact, I've had the privilege of hosting a group of bright, young students participating in the [Raleigh Digital Connector Program][1]. I host them at Red Hat, give them a quick tour of our office space, then lead them through this unconference exercise to help them prepare for an annual civic tech event called CityCamp NC, which brings citizens, government change agents, and businesses together to openly innovate and improve the North Carolina community. + +To recap on the general exercise, the facilitator's job is to keep things on time and moving through the process. The participants' job is to be present, share ideas, and build on other ideas. In this smaller setting, having everyone give a pitch is important, because you want everyone to share an idea. In my experience, you never know what you're going to get and I'm alway pleasantly surprised by the ones that get voted up. + +I often get participants who wish they would have made a pitch or shared a topic near and dear to them--after it was all over. Don't be that person. + +In larger events, facilitator's should to drive participants to have some type of outcome or next step by the end of their session. Getting people together to discuss an idea or share knowledge is great, but the most valuable sessions allow participants to leave with something to look forward to after the event. + +I will often refer to unconferences as organized chaos. Once first-timers go through the process, I've had many participants express sheer joy that they've never experienced this level of collaboration and knowledge sharing. On the other end of the spectrum, I often get participants who wish they would have made a pitch or shared a topic near and dear to them--after it was all over. Don't be that person. If you ever find yourself at an unconference, I encourage you to do a pitch. Be prepared to participate, jump right in, and enjoy the experience. + +As you get more experience, you can convert this unconference exercise into a full-blown unconference event for your organization. And the results should be astonishing. + +This article is part of the [Open Organization Workbook project][2]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/17/11/tap-community-power-unconference + +作者:[Jason Hibbets][a] +译者:[译者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/jhibbets +[1]:https://www.raleighnc.gov/safety/content/ParksRec/Articles/Programs/TechnologyEducation/DigitalInclusionPrograms.html +[2]:https://opensource.com/open-organization/17/8/workbook-project-announcement From 500f38ed84fd5140ac79b120b03f92dbfeed7940 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 23:12:30 +0800 Subject: [PATCH 032/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Check=20Cryptocur?= =?UTF-8?q?rency=20Prices=20From=20Commandline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Cryptocurrency Prices From Commandline.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20171123 Check Cryptocurrency Prices From Commandline.md diff --git a/sources/tech/20171123 Check Cryptocurrency Prices From Commandline.md b/sources/tech/20171123 Check Cryptocurrency Prices From Commandline.md new file mode 100644 index 0000000000..a6faf7a2c1 --- /dev/null +++ b/sources/tech/20171123 Check Cryptocurrency Prices From Commandline.md @@ -0,0 +1,87 @@ +Check Cryptocurrency Prices From Commandline +====== +![配图](https://www.ostechnix.com/wp-content/uploads/2017/11/bitcoin-1-720x340.jpg) +A while ago, we published a guide about **[Cli-Fyi][1] ** - a potentially useful command line query tool. Using Cli-Fyi, we can easily find out the latest price of a cryptocurrency and lots of other useful details. Today, we are going to see yet another cryptcurrency price checker tool called **" Coinmon"**. Unlike Cli.Fyi, Coinmon is only for checking the price of various cryptocurrencies. Nothing more! Coinmon will check cryptocurrencies' prices, changes right from your Terminal. It will fetch all details from from [coinmarketcap.com][2] APIs. It is quite useful for those who are both **Crypto investors** and **Engineers**. + +### Installing Coinmon + +Make sure you have Node.js and Npm installed on your system. If you don't have Node.js and/or npm installed on your machine, refer the following link to install them. + +Once Node.js and Npm installed, run the following command from your Terminal to install Coinmon. +``` +sudo npm install -g coinmon +``` + +### Check Cryptocurrency Prices From Commandline + +Run the following command to check the top 10 cryptocurrencies ranked by their market cap: +``` +coinmon +``` + +Sample output would be: + +[![][3]][4] + +Like I said, if you run the coinmon without any parameters, it will display the top 10 cryptocurrencies. You can also find top top n cryptocurrencies, for example 20, by using "-t" flag. +``` +coinmon -t 20 +``` + +All prices will be displayed in USD by default. You can also convert price from USD to another currency by using "-c" flag. + +For instance, to convert the prices to INR (Indian Rupee), run: +``` +coinmon -c inr +``` + +[![][3]][5] + +Currently, Coinmon supports AUD, BRL, CAD, CHF, CLP, CNY, CZK, DKK, EUR, GBP, HKD, HUF, IDR, ILS, INR, JPY, KRW, MXN, MYR, NOK, NZD, PHP, PKR, PLN, RUB, SEK, SGD, THB, TRY, TWD, ZAR currencies. + +It is also possible to search the prices using the symbol of a cryptocurrency. +``` +coinmon -f btc +``` + +Here, **btc** is the symbol of Bitcoin cryptocurrency. You can view the symbols of all available cryptocurrencies [**here**][6]. + +For more details, refer coinmon's help section: +``` +$ coinmon -h + +Usage: coinmon [options] + +Options: + + -V, --version output the version number + -c, --convert [currency] Convert to your fiat currency (default: usd) + -f, --find [symbol] Find specific coin data with coin symbol (can be a comma seperated list) (default: ) + -t, --top [index] Show the top coins ranked from 1 - [index] according to the market cap (default: null) + -H, --humanize [enable] Show market cap as a humanized number, default true (default: true) + -h, --help output usage information +``` + +Hope this helps. More good stuffs to come. Stay tuned! + +Cheers! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/coinmon-check-cryptocurrency-prices-commandline/ + +作者:[SK][a] +译者:[译者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/cli-fyi-quick-easy-way-fetch-information-ips-emails-domains-lots/ +[2]:https://coinmarketcap.com/ +[3]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[4]:http://www.ostechnix.com/wp-content/uploads/2017/11/coinmon-1.png () +[5]:http://www.ostechnix.com/wp-content/uploads/2017/11/coinmon-2.png () +[6]:https://en.wikipedia.org/wiki/List_of_cryptocurrencies From 1c1a565f22c21859f55fe3022089d2451ac50598 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 23:15:46 +0800 Subject: [PATCH 033/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20DevOps=20el?= =?UTF-8?q?iminated=20bottlenecks=20for=20Ranger=20community?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...inated bottlenecks for Ranger community.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20171122 How DevOps eliminated bottlenecks for Ranger community.md diff --git a/sources/tech/20171122 How DevOps eliminated bottlenecks for Ranger community.md b/sources/tech/20171122 How DevOps eliminated bottlenecks for Ranger community.md new file mode 100644 index 0000000000..697b6733fc --- /dev/null +++ b/sources/tech/20171122 How DevOps eliminated bottlenecks for Ranger community.md @@ -0,0 +1,71 @@ +How DevOps eliminated bottlenecks for Ranger community +====== +![配图](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/traffic-light-go.png?itok=nC_851ys) +The Visual Studio Application Lifecycle Management (ALM) [Ranger][1] program is a community of volunteers that gives professional guidance, practical experience, and gap-filling solutions to the developer community. It was created in 2006 as an internal Microsoft community to "connect the product group with the field and remove adoption blockers." By 2009, the community had more than 200 members, which led to collaboration and planning challenges, bottlenecks due to dependencies and manual processes, and increasing delays and dissatisfaction within the developer community. In 2010, the program evolved to include Microsoft Most Valued Professionals (MVPs), expanding into a geographically distributed community that spans the globe. + +The community is divided into roughly a dozen active teams. Each team is committed to design, build, and support one guidance or tooling project through its lifetime. In the past, teams typically bottlenecked at the team management level due to a rigid, waterfall-style process and high dependency on one or more program managers. The program managers intervened in decision making, releases, and driving the "why, what, and how" for projects. Also, a lack of real-time metrics prevented teams from effectively monitoring their solutions, and alerts about bugs and issues typically came from the community. + +It was time to find a better way of doing things and delivering value to the developer community. + +### DevOps to the rescue + +> "DevOps is the union of people, process, and products to enable continuous delivery of value to our end users." --[Donovan Brown][2] + +To address these challenges, the community stopped all new projects for a couple of sprints to explore Agile practices and new products. The aim was to re-energize the community, to find ways to promote autonomy, mastery, and purpose, as outlined in the book [Drive][3], by Daniel H. Pink, and to overhaul the rigid processes and products. + +> Mature self-organizing, self-managed, and cross-functional teams thrive on autonomy, mastery, and purpose." --Drive, Daniel H. Pink. + +Getting the culture--the people--right was the first step to embrace DevOps. The community implemented the [Scrum][4] framework, used [kanban][5] to improve the engineering process, and adopted visualization to improve transparency, awareness, and most important, trust. With self-organization of teams, the traditional hierarchy and chain-of-command disappeared. Self-management encouraged teams to actively monitor and evolve their own process. + +In April 2010, the community took another pivotal step by switching and committing its culture, process, and products to the cloud. While the core focus of the free "by-the-community-for-the-community" [solutions][6] remains on guidance and filling gaps, there's a growing investment in open source solutions (OSS) to research and share outcomes from the DevOps transformations. + +Continuous integration (CI) and continuous delivery (CD) replaced rigid manual processes with automated pipelines. This empowered teams to deploy solutions to canary and early-adopter users without intervention from program management. Adding telemetry enabled teams to watch their solutions and often detect and address unknown issues before users noticed them. + +The DevOps transformation is an ongoing evolution, using experiments to explore and validate people, process, and product innovations. Recent experiments introduced pipeline innovations that are continuously improving the value flow. Scanning components automatically, continuously, and silently checks security, licensing, and quality of open source components. Deployment rings and feature flags enable teams to have fine-grained control of features for all or specific users. + +In October 2017, the community moved most of its private version control repositories to [GitHub][7]. Transferring ownership and administration responsibilities for all repositories to the ALM DevOps Rangers community gives the teams autonomy and an opportunity to energize the broader community to contribute to the open source solutions. Teams are empowered to deliver quality and value to their end users. + +### Benefits and accomplishments + +Embracing DevOps enabled the Ranger community to become nimble, realize faster-to-market and quicker-to-learn-and-react processes, reduce investment of precious time, and proclaim autonomy. + +Here's a list of our observations from the transition, listed in no specific order: + + * Autonomy, mastery, and purpose are core. + * Start with something tangible and iterate--avoid the big bang. + * Tangible and actionable metrics are important--ensure it does not turn into noise. + * The most challenging parts of transformation are the people (culture). + * There's no blueprint; every organization and every team is unique. + * Transformation is continuous. + * Transparency and visibility are key. + * Use the engineering process to reinforce desired behavior. + + + +Table of transformation changes: + +PAST CURRENT ENVISIONED Branching Servicing and release isolation Feature Master Build Manual and error prone Automated and consistent Issue detection Call from user Proactive telemetry Issue resolution Days to weeks Minutes to days Minutes Planning Detailed design Prototyping and storyboards Program management 2 program managers (PM) 0.25 PM 0.125 PM Release cadence 6 to 12 months 3 to 5 sprints Every sprint Release Manual and error prone Automated and consistent Sprints 1 month 3 weeks Team size 10 to 15 2 to 5 Time to build Hours Seconds Time to release Days Minutes + +But, we're not done! Instead, we're part of an exciting, continuous, and likely never-ending transformation. + +If you'd like to learn more about our transformation, positive experiences, and known challenges that need to be addressed, see "[Our journey of transforming to a DevOps culture][8]." + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/11/devops-rangers-transformation + +作者:[Willy Schaub][a] +译者:[译者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/wpschaub +[1]:https://aka.ms/vsaraboutus +[2]:http://donovanbrown.com/post/what-is-devops +[3]:http://www.danpink.com/books/drive/ +[4]:http://www.scrumguides.org/scrum-guide.html +[5]:https://leankit.com/learn/kanban/what-is-kanban/ +[6]:https://aka.ms/vsarsolutions +[7]:https://github.com/ALM-Rangers +[8]:https://github.com/ALM-Rangers/Guidance/blob/master/src/Stories/our-journey-of-transforming-to-a-devops-culture.md From decf660f906a881eca2fbf877db517a8f4375983 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 23:18:12 +0800 Subject: [PATCH 034/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20A=20generic=20int?= =?UTF-8?q?roduction=20to=20Gitlab=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...128 A generic introduction to Gitlab CI.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20171128 A generic introduction to Gitlab CI.md diff --git a/sources/tech/20171128 A generic introduction to Gitlab CI.md b/sources/tech/20171128 A generic introduction to Gitlab CI.md new file mode 100644 index 0000000000..1c1e985232 --- /dev/null +++ b/sources/tech/20171128 A generic introduction to Gitlab CI.md @@ -0,0 +1,130 @@ +translating by lujun9972 +A generic introduction to Gitlab CI +====== +At [fleetster][1] we have our own instance of [Gitlab][2] and we rely a lot on [Gitlab CI][3]. Also our designers and QA guys use (and love) it, thanks to its advanced features. + +Gitlab CI is a very powerful system of Continuous Integration, with a lot of different features, and with every new releases, new features land. It has a very rich technical documentation, but it lacks a generic introduction for whom want to use it in an already existing setup. A designer or a tester doesn't need to know how to autoscale it with Kubernetes or the difference between an `image` or a `service`. + +But still, he needs to know what is a **pipeline** , and how to see a branch deployed to an **environment**. In this article therefore I will try to cover as many features as possible, highlighting how the end users can enjoy them; in the last months I explained such features to some members of our team, also developers: not everyone knows what Continuous Integration is or has used Gitlab CI in a previous job. + +If you want to know why Continuous Integration is important I suggest to read [this article][4], while for finding the reasons for using Gitlab CI specifically, I leave the job to [Gitlab.com][3] itself. + +### Introduction + +Every time a developer changes some code he saves his changes in a **commit**. He can then push that commit to Gitlab, so other developers can review the code. + +Gitlab will also start some work on that commit, if the Gitlab CI has been configured. This work is executed by a **runner**. A runner is basically a server (it can be a lot of different things, also your PC, but we can simplify it as a server) that executes instructions listed in the `.gitlab-ci.yml` file, and reports the result back to Gitlab itself, which will show it in his graphical interface. + +When a developer has finished implementing a new feature or a bugfix (activity that usual requires multiple commits), can open a **merge request** , where other member of the team can comment on the code and on the implementation. + +As we will see, also designers and testers can (and really should!) join this process, giving feedbacks and suggesting improvements, especially thanks to two features of Gitlab CI: **environments** and **artifacts**. + +### Pipelines + +Every commit that is pushed to Gitlab generates a **pipeline** attached to that commit. If multiple commits are pushed together the pipeline will be created only for the last of them. A pipeline is a collection of **jobs** split in different **stages**. + +All the jobs in the same stage run in concurrency (if there are enough runners) and the next stage begins only if all the jobs from the previous stage have finished with success. + +As soon as a job fails, the entire pipeline fails. There is an exception for this, as we will see below: if a job is marked as manual, then a failure will not make the pipeline fails. + +The stages are just a logic division between batches of jobs, where doesn't make sense to execute next jobs if the previous failed. We can have a `build` stage, where all the jobs to build the application are executed, and a `deploy` stage, where the build application is deployed. Doesn't make much sense to deploy something that failed to build, does it? + +Every job shouldn't have any dependency with any other job in the same stage, while they can expect results by jobs from a previous stage. + +Let's see how Gitlab shows information about stages and stages' status. + +![pipeline-overview][5] + +![pipeline-status][6] + +### Jobs + +A job is a collection of instructions that a runner has to execute. You can see in real time what's the output of the job, so developers can understand why a job fails. + +A job can be automatic, so it starts automatically when a commit is pushed, or manual. A manual job has to be triggered by someone manually. Can be useful, for example, to automatize a deploy, but still to deploy only when someone manually approves it. There is a way to limit who can run a job, so only trustworthy people can deploy, to continue the example before. + +A job can also build **artifacts** that users can download, like it creates an APK you can download and test on your device; in this way both designers and testers can download an application and test it without having to ask for help to developers. + +Other than creating artifacts, a job can deploy an **environment** , usually reachable by an URL, where users can test the commit. + +Job status are the same as stages status: indeed stages inherit theirs status from the jobs. + +![running-job][7] + +### Artifacts + +As we said, a job can create an artifact that users can download to test. It can be anything, like an application for Windows, an image generated by a PC, or an APK for Android. + +So you are a designer, and the merge request has been assigned to you: you need to validate the implementation of the new design! + +But how to do that? + +You need to open the merge request, and download the artifact, as shown in the figure. + +Every pipeline collects all the artifacts from all the jobs, and every job can have multiple artifacts. When you click on the download button, it will appear a dropdown where you can select which artifact you want. After the review, you can leave a comment on the MR. + +You can always download the artifacts also from pipelines that do not have a merge request open ;-) + +I am focusing on merge request because usually is where testers, designer, and shareholder in general enter the workflow. + +But merge requests are not linked to pipelines: while they integrate nice one in the other, they do not have any relation. + +![download-artifacts][8] + +### Environments + +In a similar way, a job can deploy something to an external server, so you can reach it through the merge request itself. + +As you can see the environment has a name and a link. Just clicking the link you to go to a deployed version of your application (of course, if your team has setup it correctly). + +You can click also on the name of the environment, because Gitlab has also other cool features for environments, like [monitoring][9]. + +![environment][10] + +### Conclusion + +This was a small introduction to some of the features of Gitlab CI: it is very powerful, and using it in the right way allows all the team to use just one tool to go from planning to deploying. A lot of new features are introduced every month, so keep an eye on the [Gitlab blog][11]. + +For setting it up, or for more advanced features, take a look to the [documentation][12]. + +In fleetster we use it not only for running tests, but also for having automatic versioning of the software and automatic deploys to testing environments. We have automatized other jobs as well (building apps and publish them on the Play Store and so on). + +Speaking of which, **do you want to work in a young and dynamically office with me and a lot of other amazing guys?** Take a look to the [open positions][13] at fleetster! + +Kudos to the Gitlab team (and others guys who help in their free time) for their awesome work! + +If you have any question or feedback about this blog post, please drop me an email at [riccardo@rpadovani.com][14] or [tweet me][15] :-) Feel free to suggest me to add something, or to rephrase paragraphs in a clearer way (English is not my mother tongue). + +Bye for now, +R. + +P.S: if you have found this article helpful and you'd like we write others, do you mind to help us reaching the [Ballmer's peak][16] and [buy me][17] a beer? + +-------------------------------------------------------------------------------- + +via: https://rpadovani.com/introduction-gitlab-ci + +作者:[Riccardo][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://rpadovani.com +[1]:https://www.fleetster.net +[2]:https://gitlab.com/ +[3]:https://about.gitlab.com/gitlab-ci/ +[4]:https://about.gitlab.com/2015/02/03/7-reasons-why-you-should-be-using-ci/ +[5]:https://img.rpadovani.com/posts/pipeline-overview.png +[6]:https://img.rpadovani.com/posts/pipeline-status.png +[7]:https://img.rpadovani.com/posts/running-job.png +[8]:https://img.rpadovani.com/posts/download-artifacts.png +[9]:https://gitlab.com/help/ci/environments.md +[10]:https://img.rpadovani.com/posts/environment.png +[11]:https://about.gitlab.com/ +[12]:https://docs.gitlab.com/ee/ci/README.html +[13]:https://www.fleetster.net/fleetster-team.html +[14]:mailto:riccardo@rpadovani.com +[15]:https://twitter.com/rpadovani93 +[16]:https://www.xkcd.com/323/ +[17]:https://rpadovani.com/donations From 7516c9a2b453976406b66156a299e57faa6ab841 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 27 Dec 2017 23:26:51 +0800 Subject: [PATCH 035/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20MariaDB=20adminis?= =?UTF-8?q?tration=20commands=20for=20beginners?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...B administration commands for beginners.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20171202 MariaDB administration commands for beginners.md diff --git a/sources/tech/20171202 MariaDB administration commands for beginners.md b/sources/tech/20171202 MariaDB administration commands for beginners.md new file mode 100644 index 0000000000..65d8e91749 --- /dev/null +++ b/sources/tech/20171202 MariaDB administration commands for beginners.md @@ -0,0 +1,174 @@ +translating by lujun9972 +MariaDB administration commands for beginners +====== +Earlier we have learned to [**install & secure MariaDB server on Centos/RHEL 7**][1], which is now the default database of RHEL/CentOS 7 onwards.We will now discuss some useful MariaDB administration commands. These are some very basic commands that will get you started with using MariaDB & these can also be used with MySQL, since Mariadb is forked out version of MySQL only. + +**(Recommended Read:[MongoDB installation & configuration on RHEL/CentOS][2])** + +## MariaDB Administration Commands + +### Checking version of your MariaDB installation + +To check the current version of your DB installation, type following command in your terminal + +``` +$ mysql -version +``` + +This command provide you with the current version of DB. Alternatively you can also run below mentioned command for detailed view on version, + +``` +$ mysqladmin -u root -p version +``` + +### Logging into mariadb + +To log into the mariadb server, run + +``` +$ mysql -u root -p +``` + +& then enter password to login to the session. + +### Showing all database + +To show all the databases that your maridb currently has, run + +``` +$ show databases; +``` + +after you are logged into mariadb. + +### Creating new databases + +To create a new database in mariadb, run + +``` +$ create database dan; +``` + +when logged into mariabdb. To create a database directly from terminal, run + +``` +$ mysqladmin -u user -p create dan +``` + +Here, **dan** is the name of the new database. + +### Deleting a database + +To delete a database, run + +``` +$ drop database dan; +``` + +from the logged in session of mariadb. Alternatively you can also use, + +``` +$ mysqladmin -u root -p drop dan +``` + +**Note:-** If you are getting an 'access denied' error while running the mysqladmin commands, that might be because we have not given rights to root. To do so, run the command mentioned in point 7, replacing name of the user with root. + +### Creating new user + +To create a new user for database, run + +``` +$ CREATE USER 'dan'@'localhost' IDENTIFIED BY 'password'; +``` + +### Granting access to user for a database + +For providing access to user for a single database, run + +``` +$ GRANT ALL PRIVILEGES ON test.* to 'dan'@'localhost'; +``` + +This will provide user dan complete access over database named test. We can also grant SELECT, INSERT , DELETE permissions to user. + +To provide access to all database, replace test with * i.e. + +``` +$ GRANT ALL PRIVILEGES ON *.* to 'dan'@'localhost'; +``` + +### Creating backup/dump of database + +To create of a single database, run the following command from your terminal window, + +``` +$ mysqldump -u root -p database_name>db_backup.sql +``` + +To create backup of multiple databases in single command, + +``` +$ mysqldump -u root -p - - databases db1 db2 > db12_backup.sql +``` + +To create dump of all databases in single command, + +``` +$ mysqldump -u root -p - - all-databases >all_dbs.sql +``` + +### Restoring database from the dump + +To restore database from a dump, run + +``` +$ mysql -u root -p database_name Date: Wed, 27 Dec 2017 14:50:31 -0800 Subject: [PATCH 036/133] Proofread by JianqinWang --- ...170530 How to Improve a Legacy Codebase.md | 59 +++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/translated/tech/20170530 How to Improve a Legacy Codebase.md b/translated/tech/20170530 How to Improve a Legacy Codebase.md index a1869b0449..8cd012a1c3 100644 --- a/translated/tech/20170530 How to Improve a Legacy Codebase.md +++ b/translated/tech/20170530 How to Improve a Legacy Codebase.md @@ -1,68 +1,67 @@ # 如何改善遗留的代码库 -这在每一个程序员,项目管理员,团队领导的一生中都会至少发生一次。原来的程序员早已离职去度假了,留下了一坨几百万行屎一样的代码和文档(如果有的话),一旦接手这些代码,想要跟上公司的进度简直让人绝望。 +这在每一个程序员,项目管理员,团队领导的一生中都会至少发生一次。原来的程序员早已离职去度假了,给你留下了一坨几百万行屎一样的代码和(如果有的话)跟今日勉强支撑公司运行的代码驴头不对马嘴的文档。 -你的工作是带领团队摆脱这个混乱的局面 +你的任务:带领团队摆脱这个混乱的局面。 -当你的第一反应过去之后,你开始去熟悉这个项目,公司的管理层都在关注着你,所以项目只能成功,然而,看了一遍代码之后却发现很大的可能会失败。那么该怎么办呢? +当你的第一反应(逃命)过去之后,你开始去熟悉这个项目。公司的管理层都在关注着你,所以项目只能成功;然而,看了一遍代码之后却发现失败几乎是不可避免。那么该怎么办呢? -幸运(不幸)的是我已经遇到好几次这种情况了,我和我的小伙伴发现将这坨热气腾腾的屎变成一个健康可维护的项目是非常值得一试的。下面这些是我们的一些经验: +幸运(不幸)的是我已经遇到好几次这种情况了,我和我的小伙伴发现将这坨热气腾腾的屎变成一个健康可维护的项目是一个有丰厚利润的业务。下面这些是我们的一些经验: ### 备份 -在开始做任何事情之前备份与之可能相关的所有文件。这样可以确保不会丢失任何可能会在另外一些地方很重要的信息。一旦修改其中一些文件,你可能花费一天或者更多天都解决不了这个愚蠢的问题,配置数据通常不受版本控制,所以特别容易受到这方面影响,如果定期备份数据时连带着它一起备份了,还是比较幸运的。所以谨慎总比后悔好,复制所有东西到一个绝对安全的地方吧,除非这些文件是只读模式否则不要轻易碰它。 +在开始做任何事情之前备份与之可能相关的所有文件。这样可以确保不会丢失任何可能会在另外一些地方很重要的信息。一旦修改其中一些文件,你可能花费一天或者更多天都解决不了这个愚蠢的问题。配置数据通常不受版本控制,所以特别容易受到这方面影响,如果定期备份数据时连带着它一起备份了,还是比较幸运的。所以谨慎总比后悔好,复制所有东西到一个绝对安全的地方并不要轻易碰它,除非这些文件是只读模式。 -### 必须确保代码能够在生产环境下构建运行并产出,这是重要的先决条件。 +### 重要的先决条件:必须确保代码能够在生产环境下构建运行并产出 -之前我假设环境已经存在,所以完全丢了这一步,Hacker News 的众多网友指出了这一点并且证明他们是对的:第一步是确认你知道在生产环境下运行着什么东西,也意味着你需要在你的设备上构建一个跟生产环境上运行的版本每一个字节都一模一样的版本。如果你找不到实现它的办法,一旦你将它投入生产环境,你很可能会遭遇一些很糟糕的事情。确保每一部分都尽力测试,之后在你足够信任它能够很好的运行的时候将它部署生产环境下。无论它运行的怎么样都要做好能够马上切换回旧版本的准备,确保日志记录下了所有情况,以便于接下来不可避免的 “验尸” 。 +之前我假设环境已经存在,所以完全丢了这一步,但Hacker News 的众多网友指出了这一点并且证明他们是对的:第一步是确认你知道在生产环境下运行着什么东西,也意味着你需要在你的设备上构建一个跟生产环境上运行的版本每一个字节都一模一样的版本。如果你找不到实现它的办法,一旦你将它投入生产环境,你很可能会遭遇一些预料之外的糟糕事情。确保每一部分都尽力测试,之后在你足够信任它能够很好的运行的时候将它部署生产环境下。无论它运行的怎么样都要做好能够马上切换回旧版本的准备,确保日志记录下了所有情况,以便于接下来不可避免的 “验尸” 。 ### 冻结数据库 -直到你修改代码之前尽可能冻结你的数据库,在你特别熟悉代码库和遗留代码之后再去修改数据库。在这之前过早的修改数据库的话,你可能会碰到大问题,你会失去让新旧代码和数据库一起构建稳固的基础的能力。保持数据库完全不变,就能比较新的逻辑代码和旧的逻辑代码运行的结果,比较的结果应该跟预期的没有差别。 +直到你修改代码结束之前尽可能冻结你的数据库,在你特别熟悉代码库和遗留代码之后再去修改数据库。在这之前过早的修改数据库的话,你可能会碰到大问题,你会失去让新旧代码和数据库一起构建稳固的基础的能力。保持数据库完全不变,就能比较新的逻辑代码和旧的逻辑代码运行的结果,比较的结果应该跟预期的没有差别。 ### 写测试 -在你做任何改变之前,尽可能多的写下端到端测试和集成测试。在你能够清晰的知道旧的是如何工作的情况下确保这些测试能够正确的输出(准备好应对一些突发状况)。这些测试有两个重要的作用,其一,他们能够在早期帮助你抛弃一些错误观念,其二,在你写新代码替换旧代码的时候也有一定防护作用。 +在你做任何改变之前,尽可能多的写下端到端测试和集成测试。确保这些测试能够正确的输出,并测试你对旧的代码运行的各种假设(准备好应对一些意外状况)。这些测试有两个重要的作用:其一,他们能够在早期帮助你抛弃一些错误观念,其二,这些测试在你写新代码替换旧代码的时候也有一定防护作用。 -自动化测试,如果你也有 CI 的使用经验请使用它,并且确保在你提交代码之后能够快速的完成所有测试。 +要自动化测试,如果你有 CI 的使用经验可以用它,并确保在你提交代码之后 CI 能够快速的完成所有测试。 ### 日志监控 -如果旧设备依然可用,那么添加上监控功能。使用一个全新的数据库,为每一个你能想到的事件都添加一个简单的计数器,并且根据这些事件的名字添加一个函数增加这些计数器。用一些额外的代码实现一个带有时间戳的事件日志,这是一个好办法知道有多少事件导致了另外一些种类的事件。例如:用户打开 APP ,用户关闭 APP 。如果这两个事件导致后端调用的数量维持长时间的不同,这个数量差就是当前打开的 APP 的数量。如果你发现打开 APP 比关闭 APP 多的时候,你就必须要知道是什么原因导致 APP 关闭了(例如崩溃)。你会发现每一个事件都跟其他的一些事件有许多不同种类的联系,通常情况下你应该尽量维持这些固定的联系,除非在系统上有一个明显的错误。你的目标是减少那些错误的事件,尽可能多的在开始的时候通过使用计数器在调用链中降低到指定的级别。(例如:用户支付应该得到相同数量的支付回调)。 +如果旧设备依然可用,那么添加上监控功能。在一个全新的数据库,为每一个你能想到的事件都添加一个简单的计数器,并且根据这些事件的名字添加一个函数增加这些计数器。用一些额外的代码实现一个带有时间戳的事件日志,你就能大概知道放生多少事件会导致另外一些种类的事件。例如:用户打开 APP ,用户关闭 APP 。如果这两个事件导致后端调用的数量维持长时间的不同,这个数量差就是当前打开的 APP 的数量。如果你发现打开 APP 比关闭 APP 多的时候,你就必须要知道是什么原因导致 APP 关闭了(例如崩溃)。你会发现每一个事件都跟其他的一些事件有许多不同种类的联系,通常情况下你应该尽量维持这些固定的联系,除非在系统上有一个明显的错误。你的目标是减少那些错误的事件,尽可能多的在开始的时候通过使用计数器在调用链中降低到指定的级别。(例如:用户支付应该得到相同数量的支付回调)。 -这是简单的技巧去将每一个后端应用变成一个就像真实的簿记系统一样,所有数字必须匹配,只要他们在某个地方都不会有什么问题。 +这个简单的技巧可以将每一个后端应用变成一个像真实的簿记系统一样,而像一个真正的簿记系统,所有数字必须匹配,如果它们在某个地方对不上就有问题。 -随着时间的推移,这个系统在监控健康方面变得非常宝贵,而且它也是使用源码控制修改系统日志的一个好伙伴,你可以使用它确认 BUG 出现的位置,以及对多种计数器造成的影响。 +随着时间的推移,这个系统在监控健康方面变得非常宝贵,而且它也是使用源码控制修改系统日志的一个好伙伴,你可以使用它确认 BUG 引进到生产环境的时间,以及对多种计数器造成的影响。 -我通常保持 5 分钟(一小时 12 次)记录一次计数器,如果你的应用生成了更多或者更少的事件,你应该修改这个时间间隔。所有的计数器公用一个数据表,每一个记录都只是简单的一行。 +我通常保持 5 分钟(一小时 12 次)记录一次计数器,但如果你的应用生成了更多或者更少的事件,你应该修改这个时间间隔。所有的计数器公用一个数据表,每一个记录都只是简单的一行。 ### 一次只修改一处 -不要完全陷入在提高代码或者平台可用性的同时添加新特性或者是修复 BUG 的陷阱。这会让你头大而且将会使你之前建立的测试失效,现在必须问问你自己,每一步的操作想要什么样的结果。 +不要陷入在提高代码或者平台可用性的同时添加新特性或者是修复 BUG 的陷阱。这会让你头大,因为你现在必须在每一步操作想好要出什么样的结果,而且会让你之前建立的一些测试失效。 ### 修改平台 -如果你决定转移你的应用到另外一个平台,最主要的是跟之前保持一样。如果你觉得你会添加更多的文档和测试,但是不要忘记这一点,所有的业务逻辑和相互依赖跟从前一样保持不变。 +如果你决定转移你的应用到另外一个平台,最主要的是跟之前保持一模一样。如果你觉得需要,你可以添加更多的文档和测试,但是不要忘记这一点,所有的业务逻辑和相互依赖要跟从前一样保持不变。 ### 修改架构 -接下来处理的是改变应用的结构(如果需要)。这一点上,你可以自由的修改高层的代码,通常是降低模块间的横向联系,这样可以降低代码活动期间对终端用户造成的影响范围。如果老代码是庞大的,那么现在正是让他模块化的时候,将大段代码分解成众多小的,不过不要把变量的名字和他的数据结构分开。 +接下来处理的是改变应用的结构(如果需要)。这一点上,你可以自由的修改高层的代码,通常是降低模块间的横向联系,这样可以降低代码活动期间对终端用户造成的影响范围。如果老代码是庞大的,那么现在正是让它模块化的时候,将大段代码分解成众多小的,不过不要改变量和数据结构的名字。 -Hacker News [mannykannot][1] 网友指出,修改架构并不总是可行,如果你特别不幸的话,你可能为了改变一些架构必须付出沉重的代价。我也赞同这一点,我应该加上这一点,因此这里有一些补充。我非常想补充的是如果你修改高级代码的时候修改了一点点底层代码,那么试着限制只修改一个文件或者最坏的情况是只修改一个子系统,所以尽可能限制修改的范围。否则你可能很难调试刚才所做的更改。 +Hacker News [mannykannot][1] 网友指出,修改高层代码并不总是可行,如果你特别不幸的话,你可能为了改变一些架构必须付出沉重的代价。我赞同这一点也应该在这里加上提示,因此这里有一些补充。我额外想补充的是如果你修改高级代码的时候修改了一点点底层代码,那么试着限制只修改一个文件或者最坏的情况是只修改一个子系统,尽可能限制修改的范围。否则你可能很难调试刚才所做的更改。 ### 底层代码的重构 -现在,你应该非常理解每一个模块的作用了,准备做一些真正的工作吧:重构代码以提高其可维护性并且使代码做好添加新功能的准备。这很可能是项目中最消耗时间的部分,记录你所做的任何操作,在你彻底的记录模块并且理解之前不要对它做任何修改。之后你可以自由的修改变量名、函数名以及数据结构以提高代码的清晰度和统一性,然后请做测试(情况允许的话,包括单元测试)。 +现在,你应该非常理解每一个模块的作用了,准备做一些真正的工作吧:重构代码以提高其可维护性并且使代码做好添加新功能的准备。这很可能是项目中最消耗时间的部分,记录你所做的任何操作,在你彻底的记录并且理解模块之前不要对它做任何修改。之后你可以自由的修改变量名、函数名以及数据结构以提高代码的清晰度和统一性,然后请做测试(情况允许的话,包括单元测试)。 ### 修复 bugs -现在准备做一些用户可见的修改,战斗的第一步是修复很多积累了一整年的bugs,像往常一样,首先证实 bug 仍然存在,然后编写测试并修复这个 bug,你的 CI 和端对端测试应该能避免一些由于不太熟悉或者一些额外的事情而犯的错误。 +现在准备做一些用户可见的修改,战斗的第一步是修复很多积累了一整年的bugs。像往常一样,首先证实 bug 仍然存在,然后编写测试并修复这个 bug,你的 CI 和端对端测试应该能避免一些由于不太熟悉或者一些额外的事情而犯的错误。 ### 升级数据库 -如果在一个坚实且可维护的代码库上完成所有工作,如果你有更改数据库模式的计划,可以使用不同的完全替换数据库。 -把所有的这些都做完将能够帮助你更可靠的修改而不会碰到问题,你会完全的测试新数据库和新代码,所有测试可以确保你顺利的迁移。 +如果你在一个坚实且可维护的代码库上完成所有工作,你就有选择,可以更改数据库模式的计划或者使用不同的完全替换数据库。之前完成的步骤能够帮助你更可靠的修改数据库而不会碰到问题,你可以完全的测试新数据库和新代码,而之前写的所有测试可以确保你顺利的迁移。 ### 按着路线图执行 @@ -70,25 +69,25 @@ Hacker News [mannykannot][1] 网友指出,修改架构并不总是可行,如 ### 任何时候都不要尝试彻底重写 -彻底重写是那种注定会失败的项目,一方面,你在一个未知的领域开始,所以你甚至不知道构建什么,另一方面,你会把所以的问题都推到新系统马上就要上线的前一天,非常不幸的是,这也是你失败的时候,假设业务逻辑存在问题,你会得到异样的眼光,那时您会突然明白为什么旧系统会用某种奇怪的方式来工作,最终也会意识到能将旧系统放在一起工作的人也不都是白痴。在那之后。如果你真的想破坏公司(和你自己的声誉),那就重写吧,但如果你足够聪明,彻底重写系统通常不会成为一个摆到桌上讨论的选项。 +彻底重写是那种注定会失败的项目。一方面,你在一个未知的领域开始,所以你甚至不知道构建什么,另一方面,你会把所以的问题都推到新系统马上就要上线的前一天。非常不幸的是,这也是你失败的时候。假设业务逻辑被发现存在问题,你会得到异样的眼光,那时您会突然明白为什么旧系统会用某种奇怪的方式来工作,最终也会意识到能将旧系统放在一起工作的人也不都是白痴。在那之后。如果你真的想破坏公司(和你自己的声誉),那就重写吧,但如果你聪明人,你会知道彻底重写系统根本不是一个可选的选择。 -### 所以,替代方法是增量迭代工作 +### 所以,替代方法:增量迭代工作 -要解开这些线团最快方法是,使用你熟悉的代码中任何的元素(它可能是外部的,他可以是内核模块),试着使用旧的上下文去增量提升,如果旧的构建工具已经不能用了,你将必须使用一些技巧(看下面)至少当你开始做修改的时候,试着尽力保留已知的工作。那样随着代码库的提升你也对代码的作用更加理解。一个典型的代码提交应该最多两行。 +要解开这些线团最快方法是,使用你熟悉的代码中任何的元素(它可能是外部的,也可能是内核模块),试着使用旧的上下文去增量提升。如果旧的构建工具已经不能用了,你将必须使用一些技巧(看下面),但至少当你开始做修改的时候,试着尽力保留已知的工作。那样随着代码库的提升你也对代码的作用更加理解。一个典型的代码提交应该最多两三行。 ### 发布! -每一次的修改都发布到生产环境,即使一些修改不是用户可见的。使用最少的步骤也是很重要的,因为当你缺乏对系统的了解时,只有生产环境能够告诉你问题在哪里,如果你只做了一个很小的修改之后出了问题,会有一些好处: +每一次的修改都发布到生产环境,即使一些修改不是用户可见的。使用最少的步骤也是很重要的,因为当你缺乏对系统的了解时,有时候只有生产环境能够告诉你问题在哪里。如果你只做了一个很小的修改之后出了问题,会有一些好处: * 很容易弄清楚出了什么问题 * 这是一个改进流程的好位置 * 你应该马上更新文档展示你的新见解 ### 使用代理的好处 -如果你做 web 开发时在旧系统和用户之间加了代理。你能很容易的控制每一个网址哪些请求旧系统,哪些重定向到新系统,从而更轻松更精确的控制运行的内容以及谁能够看到。如果你的代理足够的聪明,你可以使用它发送一定比例的流量到个人的 URL,直到你满意为止,如果你的集成测试也连接到这个接口那就更好了。 +如果你做 web 开发那就谢天谢地要在旧系统和用户之间加一个代理。这样你能很容易的控制每一个网址哪些请求定向到旧系统,哪些请求定向到新系统,从而更轻松更精确的控制运行的内容以及谁能够看到运行系统。如果你的代理足够的聪明,你可以使用它发送一定比例的流量到个人的 URL,直到你满意为止。如果你的集成测试也能连接到这个接口那就更好了。 -### 是的,这会花费很多时间 -这取决于你怎样看待它的,这是事实会有一些重复的工作涉及到这些步骤中。但是它确实有效,对于进程的任何一个优化都将使你对这样系统更加熟悉。我会保持声誉,并且我真的不喜欢在工作期间有负面的意外。如果运气好的话,公司系统已经出现问题,而且可能会影响客户。在这样的情况下,如果你更多地是牛仔的做事方式,并且你的老板同意可以接受冒更大的风险,我比较喜欢完全控制整个流程得到好的结果而不是节省两天或者一星期,但是大多数公司宁愿采取稍微慢一点但更确定的胜利之路。 +### 是的,但这会花费很多时间! +这就取决于你怎样看待它了。的确,在按照以上步骤优化代码时会有一些重复的工作步骤。但是它确实有效,而这里介绍的任何一个步骤都是假设你对系统的了解比现实要多。我需要保持声誉,也真的不喜欢在工作期间有负面的意外。如果运气好的话,公司系统已经出现问题,或者有可能会严重影响到客户。在这样的情况下,我比较喜欢完全控制整个流程得到好的结果而不是节省两天或者一星期。如果你更多地是牛仔的做事方式,并且你的老板同意可以接受冒更大的风险,那可能试着冒险一下没有错,但是大多数公司宁愿采取稍微慢一点但更确定的胜利之路。 -------------------------------------------------------------------------------- @@ -96,7 +95,7 @@ via: https://jacquesmattheij.com/improving-a-legacy-codebase 作者:[Jacques Mattheij][a] 译者:[aiwhj](https://github.com/aiwhj) -校对:[校对者ID](https://github.com/校对者ID) +校对:[JianqinWang](https://github.com/JianqinWang) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 26e4e914a8664d6da2e855ef3a1949fc30558f79 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 28 Dec 2017 08:48:51 +0800 Subject: [PATCH 037/133] translated --- ... Newer Version with This Single Command.md | 111 ------------------ ... Newer Version with This Single Command.md | 109 +++++++++++++++++ 2 files changed, 109 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md create mode 100644 translated/tech/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md diff --git a/sources/tech/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md b/sources/tech/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md deleted file mode 100644 index ff186c1d80..0000000000 --- a/sources/tech/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md +++ /dev/null @@ -1,111 +0,0 @@ -translating---geekpi - -Easily Upgrade Ubuntu to a Newer Version with This Single Command -====== -[zzupdate][1] is an open source command line utility that makes the task of upgrading Ubuntu Desktop and Server to newer versions a tad bit easier by combining several update commands into one single command. - -Upgrading an Ubuntu system to a newer release is not a herculean task. Either with the GUI or with a couple of commands, you can easily upgrade your system to the latest release. - -On the other hand, zzupdate written by Gianluigi 'Zane' Zanettini handles clean, update, autoremove, version upgrade and composer self-update for your Ubuntu system with just a single command. - -It cleans up the local cache, updates available package information, and then perform a distribution upgrade. In the next step, it updates the Composer and removes the unused packages. - -The script must run as root user. - -### Installing zzupdate to upgrade Ubuntu to a newer version - -![Upgrade Ubuntu to a newer version with a single command][2] - -![Upgrade Ubuntu to a newer version with a single command][3] - -To install zzupdate, execute the below command in a Terminal. -``` -curl -s https://raw.githubusercontent.com/TurboLabIt/zzupdate/master/setup.sh | sudo sh -``` - -And then copy the provided sample configuration file to zzupdate.conf and set your preferences. -``` -sudo cp /usr/local/turbolab.it/zzupdate/zzupdate.default.conf /etc/turbolab.it/zzupdate.conf -``` - -Once you have everything, just use the following command and it will start upgrading your Ubuntu system to a newer version (if there is any). - -`sudo zzupdate` - -Note that zzupdate upgrades the system to the next available version in case of a normal release. However, when you are running Ubuntu 16.04 LTS, it tries to search for the next long-term support version only and not the latest version available. - -If you want to move out of the LTS release and upgrade to the latest release, you will have change some options. - -For Ubuntu desktop, open **Software & Updates** and under **Updates** tab and change Notify me of a new Ubuntu version to " **For any new version** ". - -![Software Updater in Ubuntu][2] - -![Software Updater in Ubuntu][4] - -For Ubuntu server, edit the release-upgrades file. -``` -vi /etc/update-manager/release-upgrades - -Prompt=normal -``` - -### Configuring zzupdate [optional] - -zzupdate options to configure -``` -REBOOT=1 -``` - -If this value is 1, a system restart is performed after an upgrade. -``` -REBOOT_TIMEOUT=15 -``` - -This sets up the reboot timeout to 900 seconds as some hardware takes much longer to reboot than others. -``` -VERSION_UPGRADE=1 -``` - -Executes version progression if an upgrade is available. -``` -VERSION_UPGRADE_SILENT=0 -``` - -Version progression occurs automatically. -``` -COMPOSER_UPGRADE=1 -``` - -Value '1' will automatically upgrade the composer. -``` -SWITCH_PROMPT_TO_NORMAL=0 -``` - -This features switches the Ubuntu Version updated to normal i.e. if you have an LTS release running, zzupdate won't upgrade it to Ubuntu 17.10 if its set to 0. It will search for an LTS version only. In contrast, value 1 searches for the latest release whether you are running an LTS or a normal release. - -Once done, all you have to do is run in console to run a complete update of your Ubuntu system -``` -sudo zzupdate -``` - -### Final Words - -Though the upgrade process for Ubuntu is in itself an easy one, zzupdate reduces it to mere one command. No coding knowledge is necessary and the process is complete config file driven. I personally found itself a good tool to update several Ubuntu systems without the need of taking care of different things separately. - -Are you willing to give it a try? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/zzupdate-upgrade-ubuntu/ - -作者:[Ambarish Kumar;Abhishek Prakash][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://itsfoss.com -[1]:https://github.com/TurboLabIt/zzupdate -[2]:data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs= -[3]:https://itsfoss.com/wp-content/uploads/2017/11/upgrade-ubuntu-single-command-featured-800x450.jpg -[4]:https://itsfoss.com/wp-content/uploads/2017/11/software-update-any-new-version-800x378.jpeg diff --git a/translated/tech/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md b/translated/tech/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md new file mode 100644 index 0000000000..dc853e1808 --- /dev/null +++ b/translated/tech/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md @@ -0,0 +1,109 @@ +使用一个命令轻松升级 Ubuntu 到较新的版本 +====== +[zzupdate][1] 是一个开源的命令行程序,通过将几个更新命令组合到一个命令中,使得将 Ubuntu 桌面和服务器版本升级到更新版本的任务变得容易一些。 + +将 Ubuntu 系统升级到更新的版本并不是一项艰巨的任务。无论是使用 GUI 还是使用几个命令,都可以轻松地将系统升级到最新版本。 + +另一方面,Gianluigi ‘Zane’ Zanettini 写的 zzupdate 只需一个命令就可以在 Ubuntu 中清理、更新、自动删除、版本升级、自我更新 composer。 + +它清理本地缓存,更新可用的软件包信息,然后执行发行版升级。在下一步中,它会更新 Composer 并删除未使用的软件包。 + +脚本必须以root用户身份运行。 + +### 安装 zzupdate 将 Ubuntu 升级到更新的版本 + +![Upgrade Ubuntu to a newer version with a single command][2] + +![Upgrade Ubuntu to a newer version with a single command][3] + +要安装 zzupdate,请在终端中执行以下命令。 +``` +curl -s https://raw.githubusercontent.com/TurboLabIt/zzupdate/master/setup.sh | sudo sh +``` + +然后将提供的示例配置文件复制到 zzupdate.conf 并设置你的首选项。 +``` +sudo cp /usr/local/turbolab.it/zzupdate/zzupdate.default.conf /etc/turbolab.it/zzupdate.conf +``` + +完成后,只要使用下面的命令,它就会开始升级你的 Ubuntu 系统到一个更新的版本(如果有的话)。 + +`sudo zzupdate` + +请注意,在普通版本下,zzupdate 会将系统升级到下一个可用的版本。但是,当你运行 Ubuntu 16.04 LTS 时,它将尝试仅搜索下一个长期支持版本,而不是可用的最新版本。 + +如果你想退出 LTS 版本并升级到最新版本,你将需要更改一些选项。 + +对于 Ubuntu 桌面,打开 **软件和更新** 和下面 **更新** 选项卡,并更改通知我新的 Ubuntu 版本选项为 “**对于任何新版本**”。 + +![Software Updater in Ubuntu][2] + +![Software Updater in Ubuntu][4] + +对于 Ubuntu 服务版,编辑版本升级文件。 +``` +vi /etc/update-manager/release-upgrades + +Prompt=normal +``` + +### 配置 zzupdate [可选] + +zzupdate 要配置的选项 +``` +REBOOT=1 +``` + +如果值为 1,升级后系统将重启。 +``` +REBOOT_TIMEOUT=15 +``` + +将重启超时设置为 900 秒,因为某些硬件比其他硬件重启需要更长的时间。 +``` +VERSION_UPGRADE=1 +``` + +如果升级可用,则执行版本升级。 +``` +VERSION_UPGRADE_SILENT=0 +``` + +自动显示版本进度 +``` +COMPOSER_UPGRADE=1 +``` + +值为 “1” 会自动升级 composer。 +``` +SWITCH_PROMPT_TO_NORMAL=0 +``` + +此功能将 Ubuntu 版本更新为普通版本,即如果你运行着 LTS 发行版,zzupdate 将不会将其升级到 Ubuntu 17.10(如果其设置为 0)。它将仅搜索 LTS 版本。相比之下,无论你运行着 LTS 或者普通版,“1” 都将搜索最新版本。 + +完成后,你要做的就是在控制台中运行一个完整的 Ubuntu 系统更新。 +``` +sudo zzupdate +``` + +### 最后的话 + +尽管 Ubuntu 的升级过程本身就很简单,但是 zzupdate 将它简化为一个命令。不需要编码知识,这个过程完全是配置文件驱动。我个人发现这是一个很好的更新几个 Ubuntu 系统的工具,而无需单独关心不同的事情。 + +你愿意试试吗? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/zzupdate-upgrade-ubuntu/ + +作者:[Ambarish Kumar;Abhishek Prakash][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://itsfoss.com +[1]:https://github.com/TurboLabIt/zzupdate +[2]:data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs= +[3]:https://itsfoss.com/wp-content/uploads/2017/11/upgrade-ubuntu-single-command-featured-800x450.jpg +[4]:https://itsfoss.com/wp-content/uploads/2017/11/software-update-any-new-version-800x378.jpeg From 2bae21fb269539ec21d9a6946a0b0efd4648ba63 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 28 Dec 2017 08:51:51 +0800 Subject: [PATCH 038/133] translating --- ...71226 Dockerizing Compiled Software - Tianon-s Ramblings .md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20171226 Dockerizing Compiled Software - Tianon-s Ramblings .md b/sources/tech/20171226 Dockerizing Compiled Software - Tianon-s Ramblings .md index 252180f1fd..de4e945b94 100644 --- a/sources/tech/20171226 Dockerizing Compiled Software - Tianon-s Ramblings .md +++ b/sources/tech/20171226 Dockerizing Compiled Software - Tianon-s Ramblings .md @@ -1,3 +1,5 @@ +translating---geekpi + Dockerizing Compiled Software ┈ Tianon's Ramblings ✿ ====== I recently went through a stint of closing a huge number of issues in the [docker-library/php][1] repository, and one of the oldest (and longest) discussions was related to installing depedencies for a compiling extensions, and I wrote a [semi-long comment][2] explaining how I do this in a general way for any software I wish to Dockerize. From 9aff7e413ec01073ace99d3f7ff6d475e89a9896 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 28 Dec 2017 09:34:50 +0800 Subject: [PATCH 039/133] PRF&PUB:20170530 How to Improve a Legacy Codebase.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @aiwhj @JianqinWang 辛苦了! --- ...170530 How to Improve a Legacy Codebase.md | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) rename {translated/tech => published}/20170530 How to Improve a Legacy Codebase.md (54%) diff --git a/translated/tech/20170530 How to Improve a Legacy Codebase.md b/published/20170530 How to Improve a Legacy Codebase.md similarity index 54% rename from translated/tech/20170530 How to Improve a Legacy Codebase.md rename to published/20170530 How to Improve a Legacy Codebase.md index 8cd012a1c3..e5de1136a5 100644 --- a/translated/tech/20170530 How to Improve a Legacy Codebase.md +++ b/published/20170530 How to Improve a Legacy Codebase.md @@ -1,6 +1,7 @@ -# 如何改善遗留的代码库 +如何改善遗留的代码库 +================= -这在每一个程序员,项目管理员,团队领导的一生中都会至少发生一次。原来的程序员早已离职去度假了,给你留下了一坨几百万行屎一样的代码和(如果有的话)跟今日勉强支撑公司运行的代码驴头不对马嘴的文档。 +在每一个程序员、项目管理员、团队领导的一生中,这都会至少发生一次。原来的程序员早已离职去度假了,给你留下了一坨几百万行屎一样的、勉强支撑公司运行的代码和(如果有的话)跟代码驴头不对马嘴的文档。 你的任务:带领团队摆脱这个混乱的局面。 @@ -10,31 +11,31 @@ ### 备份 -在开始做任何事情之前备份与之可能相关的所有文件。这样可以确保不会丢失任何可能会在另外一些地方很重要的信息。一旦修改其中一些文件,你可能花费一天或者更多天都解决不了这个愚蠢的问题。配置数据通常不受版本控制,所以特别容易受到这方面影响,如果定期备份数据时连带着它一起备份了,还是比较幸运的。所以谨慎总比后悔好,复制所有东西到一个绝对安全的地方并不要轻易碰它,除非这些文件是只读模式。 +在开始做任何事情之前备份与之可能相关的所有文件。这样可以确保不会丢失任何可能会在另外一些地方很重要的信息。一旦修改了其中一些文件,你可能花费一天或者更多天都解决不了这个愚蠢的问题。配置数据通常不受版本控制,所以特别容易受到这方面影响,如果定期备份数据时连带着它一起备份了,还是比较幸运的。所以谨慎总比后悔好,复制所有东西到一个绝对安全的地方并不要轻易碰它,除非这些文件是只读模式。 ### 重要的先决条件:必须确保代码能够在生产环境下构建运行并产出 -之前我假设环境已经存在,所以完全丢了这一步,但Hacker News 的众多网友指出了这一点并且证明他们是对的:第一步是确认你知道在生产环境下运行着什么东西,也意味着你需要在你的设备上构建一个跟生产环境上运行的版本每一个字节都一模一样的版本。如果你找不到实现它的办法,一旦你将它投入生产环境,你很可能会遭遇一些预料之外的糟糕事情。确保每一部分都尽力测试,之后在你足够信任它能够很好的运行的时候将它部署生产环境下。无论它运行的怎么样都要做好能够马上切换回旧版本的准备,确保日志记录下了所有情况,以便于接下来不可避免的 “验尸” 。 +之前我假设环境已经存在,所以完全丢了这一步,但 Hacker News 的众多网友指出了这一点,并且事实证明他们是对的:第一步是确认你知道在生产环境下运行着什么东西,也意味着你需要在你的设备上构建一个跟生产环境上运行的版本每一个字节都一模一样的版本。如果你找不到实现它的办法,一旦你将它投入生产环境,你很可能会遭遇一些预料之外的糟糕事情。确保每一部分都尽力测试,之后在你足够确信它能够很好的运行的时候将它部署生产环境下。无论它运行的怎么样都要做好能够马上切换回旧版本的准备,确保日志记录下了所有情况,以便于接下来不可避免的 “验尸” 。 ### 冻结数据库 -直到你修改代码结束之前尽可能冻结你的数据库,在你特别熟悉代码库和遗留代码之后再去修改数据库。在这之前过早的修改数据库的话,你可能会碰到大问题,你会失去让新旧代码和数据库一起构建稳固的基础的能力。保持数据库完全不变,就能比较新的逻辑代码和旧的逻辑代码运行的结果,比较的结果应该跟预期的没有差别。 +直到你修改代码结束之前尽可能冻结你的数据库,在你已经非常熟悉代码库和遗留代码之后再去修改数据库。在这之前过早的修改数据库的话,你可能会碰到大问题,你会失去让新旧代码和数据库一起构建稳固的基础的能力。保持数据库完全不变,就能比较新的逻辑代码和旧的逻辑代码运行的结果,比较的结果应该跟预期的没有差别。 ### 写测试 -在你做任何改变之前,尽可能多的写下端到端测试和集成测试。确保这些测试能够正确的输出,并测试你对旧的代码运行的各种假设(准备好应对一些意外状况)。这些测试有两个重要的作用:其一,他们能够在早期帮助你抛弃一些错误观念,其二,这些测试在你写新代码替换旧代码的时候也有一定防护作用。 +在你做任何改变之前,尽可能多的写一些端到端测试和集成测试。确保这些测试能够正确的输出,并测试你对旧的代码运行的各种假设(准备好应对一些意外状况)。这些测试有两个重要的作用:其一,它们能够在早期帮助你抛弃一些错误观念,其二,这些测试在你写新代码替换旧代码的时候也有一定防护作用。 要自动化测试,如果你有 CI 的使用经验可以用它,并确保在你提交代码之后 CI 能够快速的完成所有测试。 ### 日志监控 -如果旧设备依然可用,那么添加上监控功能。在一个全新的数据库,为每一个你能想到的事件都添加一个简单的计数器,并且根据这些事件的名字添加一个函数增加这些计数器。用一些额外的代码实现一个带有时间戳的事件日志,你就能大概知道放生多少事件会导致另外一些种类的事件。例如:用户打开 APP ,用户关闭 APP 。如果这两个事件导致后端调用的数量维持长时间的不同,这个数量差就是当前打开的 APP 的数量。如果你发现打开 APP 比关闭 APP 多的时候,你就必须要知道是什么原因导致 APP 关闭了(例如崩溃)。你会发现每一个事件都跟其他的一些事件有许多不同种类的联系,通常情况下你应该尽量维持这些固定的联系,除非在系统上有一个明显的错误。你的目标是减少那些错误的事件,尽可能多的在开始的时候通过使用计数器在调用链中降低到指定的级别。(例如:用户支付应该得到相同数量的支付回调)。 +如果旧设备依然可用,那么添加上监控功能。在一个全新的数据库,为每一个你能想到的事件都添加一个简单的计数器,并且根据这些事件的名字添加一个函数增加这些计数器。用一些额外的代码实现一个带有时间戳的事件日志,你就能大概知道发生多少事件会导致另外一些种类的事件。例如:用户打开 APP 、用户关闭 APP 。如果这两个事件导致后端调用的数量维持长时间的不同,这个数量差就是当前打开的 APP 的数量。如果你发现打开 APP 比关闭 APP 多的时候,你就必须要知道是什么原因导致 APP 关闭了(例如崩溃)。你会发现每一个事件都跟其它的一些事件有许多不同种类的联系,通常情况下你应该尽量维持这些固定的联系,除非在系统上有一个明显的错误。你的目标是减少那些错误的事件,尽可能多的在开始的时候通过使用计数器在调用链中降低到指定的级别。(例如:用户支付应该得到相同数量的支付回调)。 -这个简单的技巧可以将每一个后端应用变成一个像真实的簿记系统一样,而像一个真正的簿记系统,所有数字必须匹配,如果它们在某个地方对不上就有问题。 +这个简单的技巧可以将每一个后端应用变成一个像真实的簿记系统一样,而像一个真正的簿记系统,所有数字必须匹配,如果它们在某个地方对不上就有问题。 -随着时间的推移,这个系统在监控健康方面变得非常宝贵,而且它也是使用源码控制修改系统日志的一个好伙伴,你可以使用它确认 BUG 引进到生产环境的时间,以及对多种计数器造成的影响。 +随着时间的推移,这个系统在监控健康方面变得非常宝贵,而且它也是使用源码控制修改系统日志的一个好伙伴,你可以使用它确认 BUG 引入到生产环境的时间,以及对多种计数器造成的影响。 -我通常保持 5 分钟(一小时 12 次)记录一次计数器,但如果你的应用生成了更多或者更少的事件,你应该修改这个时间间隔。所有的计数器公用一个数据表,每一个记录都只是简单的一行。 +我通常保持每 5 分钟(一小时 12 次)记录一次计数器,但如果你的应用生成了更多或者更少的事件,你应该修改这个时间间隔。所有的计数器公用一个数据表,每一个记录都只是简单的一行。 ### 一次只修改一处 @@ -46,22 +47,21 @@ ### 修改架构 -接下来处理的是改变应用的结构(如果需要)。这一点上,你可以自由的修改高层的代码,通常是降低模块间的横向联系,这样可以降低代码活动期间对终端用户造成的影响范围。如果老代码是庞大的,那么现在正是让它模块化的时候,将大段代码分解成众多小的,不过不要改变量和数据结构的名字。 +接下来处理的是改变应用的结构(如果需要)。这一点上,你可以自由的修改高层的代码,通常是降低模块间的横向联系,这样可以降低代码活动期间对终端用户造成的影响范围。如果旧代码很庞杂,那么现在正是让它模块化的时候,将大段代码分解成众多小的部分,不过不要改变量和数据结构的名字。 -Hacker News [mannykannot][1] 网友指出,修改高层代码并不总是可行,如果你特别不幸的话,你可能为了改变一些架构必须付出沉重的代价。我赞同这一点也应该在这里加上提示,因此这里有一些补充。我额外想补充的是如果你修改高级代码的时候修改了一点点底层代码,那么试着限制只修改一个文件或者最坏的情况是只修改一个子系统,尽可能限制修改的范围。否则你可能很难调试刚才所做的更改。 +Hacker News 的 [mannykannot][1] 网友指出,修改高层代码并不总是可行,如果你特别不幸的话,你可能为了改变一些架构必须付出沉重的代价。我赞同这一点也应该在这里加上提示,因此这里有一些补充。我想额外补充的是如果你修改高层代码的时候修改了一点点底层代码,那么试着只修改一个文件或者最坏的情况是只修改一个子系统,尽可能限制修改的范围。否则你可能很难调试刚才所做的更改。 ### 底层代码的重构 现在,你应该非常理解每一个模块的作用了,准备做一些真正的工作吧:重构代码以提高其可维护性并且使代码做好添加新功能的准备。这很可能是项目中最消耗时间的部分,记录你所做的任何操作,在你彻底的记录并且理解模块之前不要对它做任何修改。之后你可以自由的修改变量名、函数名以及数据结构以提高代码的清晰度和统一性,然后请做测试(情况允许的话,包括单元测试)。 -### 修复 bugs +### 修复 bug -现在准备做一些用户可见的修改,战斗的第一步是修复很多积累了一整年的bugs。像往常一样,首先证实 bug 仍然存在,然后编写测试并修复这个 bug,你的 CI 和端对端测试应该能避免一些由于不太熟悉或者一些额外的事情而犯的错误。 +现在准备做一些用户可见的修改,战斗的第一步是修复很多积累了几年的 bug。像往常一样,首先证实 bug 仍然存在,然后编写测试并修复这个 bug,你的 CI 和端对端测试应该能避免一些由于不太熟悉或者一些额外的事情而犯的错误。 ### 升级数据库 - -如果你在一个坚实且可维护的代码库上完成所有工作,你就有选择,可以更改数据库模式的计划或者使用不同的完全替换数据库。之前完成的步骤能够帮助你更可靠的修改数据库而不会碰到问题,你可以完全的测试新数据库和新代码,而之前写的所有测试可以确保你顺利的迁移。 +如果你在一个坚实且可维护的代码库上完成所有工作,你就可以选择更改数据库模式的计划,或者使用不同的完全替换数据库。之前完成的步骤能够帮助你更可靠的修改数据库而不会碰到问题,你可以完全的测试新数据库和新代码,而之前写的所有测试可以确保你顺利的迁移。 ### 按着路线图执行 @@ -69,11 +69,11 @@ Hacker News [mannykannot][1] 网友指出,修改高层代码并不总是可行 ### 任何时候都不要尝试彻底重写 -彻底重写是那种注定会失败的项目。一方面,你在一个未知的领域开始,所以你甚至不知道构建什么,另一方面,你会把所以的问题都推到新系统马上就要上线的前一天。非常不幸的是,这也是你失败的时候。假设业务逻辑被发现存在问题,你会得到异样的眼光,那时您会突然明白为什么旧系统会用某种奇怪的方式来工作,最终也会意识到能将旧系统放在一起工作的人也不都是白痴。在那之后。如果你真的想破坏公司(和你自己的声誉),那就重写吧,但如果你聪明人,你会知道彻底重写系统根本不是一个可选的选择。 +彻底重写是那种注定会失败的项目。一方面,你在一个未知的领域开始,所以你甚至不知道构建什么,另一方面,你会把所有的问题都推到新系统马上就要上线的前一天。非常不幸的是,这也是你失败的时候。假设业务逻辑被发现存在问题,你会得到异样的眼光,那时您会突然明白为什么旧系统会用某种奇怪的方式来工作,最终也会意识到能将旧系统放在一起工作的人也不都是白痴。在那之后。如果你真的想破坏公司(和你自己的声誉),那就重写吧,但如果你是聪明人,你会知道彻底重写系统根本不是一个可选的选择。 ### 所以,替代方法:增量迭代工作 -要解开这些线团最快方法是,使用你熟悉的代码中任何的元素(它可能是外部的,也可能是内核模块),试着使用旧的上下文去增量提升。如果旧的构建工具已经不能用了,你将必须使用一些技巧(看下面),但至少当你开始做修改的时候,试着尽力保留已知的工作。那样随着代码库的提升你也对代码的作用更加理解。一个典型的代码提交应该最多两三行。 +要解开这些线团最快方法是,使用你熟悉的代码中任何的元素(它可能是外部的,也可能是内核模块),试着使用旧的上下文去增量改进。如果旧的构建工具已经不能用了,你将必须使用一些技巧(看下面),但至少当你开始做修改的时候,试着尽力保留已知的工作。那样随着代码库的提升你也对代码的作用更加理解。一个典型的代码提交应该最多两三行。 ### 发布! @@ -84,10 +84,12 @@ Hacker News [mannykannot][1] 网友指出,修改高层代码并不总是可行 * 你应该马上更新文档展示你的新见解 ### 使用代理的好处 -如果你做 web 开发那就谢天谢地要在旧系统和用户之间加一个代理。这样你能很容易的控制每一个网址哪些请求定向到旧系统,哪些请求定向到新系统,从而更轻松更精确的控制运行的内容以及谁能够看到运行系统。如果你的代理足够的聪明,你可以使用它发送一定比例的流量到个人的 URL,直到你满意为止。如果你的集成测试也能连接到这个接口那就更好了。 + +如果你做 web 开发那就谢天谢地吧,可以在旧系统和用户之间加一个代理。这样你能很容易的控制每一个网址哪些请求定向到旧系统,哪些请求定向到新系统,从而更轻松更精确的控制运行的内容以及谁能够看到运行系统。如果你的代理足够的聪明,你可以使用它针对个别 URL 把一定比例的流量发送到新系统,直到你满意为止。如果你的集成测试也能连接到这个接口那就更好了。 ### 是的,但这会花费很多时间! -这就取决于你怎样看待它了。的确,在按照以上步骤优化代码时会有一些重复的工作步骤。但是它确实有效,而这里介绍的任何一个步骤都是假设你对系统的了解比现实要多。我需要保持声誉,也真的不喜欢在工作期间有负面的意外。如果运气好的话,公司系统已经出现问题,或者有可能会严重影响到客户。在这样的情况下,我比较喜欢完全控制整个流程得到好的结果而不是节省两天或者一星期。如果你更多地是牛仔的做事方式,并且你的老板同意可以接受冒更大的风险,那可能试着冒险一下没有错,但是大多数公司宁愿采取稍微慢一点但更确定的胜利之路。 + +这就取决于你怎样看待它了。的确,在按照以上步骤优化代码时会有一些重复的工作步骤。但是它确实有效,而这里介绍的任何一个步骤都是假设你对系统的了解比现实要多。我需要保持声誉,也真的不喜欢在工作期间有负面的意外。如果运气好的话,公司系统已经出现问题,或者有可能会严重影响到客户。在这样的情况下,我比较喜欢完全控制整个流程得到好的结果,而不是节省两天或者一星期。如果你更多地是牛仔的做事方式,并且你的老板同意可以接受冒更大的风险,那可能试着冒险一下没有错,但是大多数公司宁愿采取稍微慢一点但更确定的胜利之路。 -------------------------------------------------------------------------------- @@ -95,7 +97,7 @@ via: https://jacquesmattheij.com/improving-a-legacy-codebase 作者:[Jacques Mattheij][a] 译者:[aiwhj](https://github.com/aiwhj) -校对:[JianqinWang](https://github.com/JianqinWang) +校对:[JianqinWang](https://github.com/JianqinWang), [wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 33abe404629e931f831f37411743915fb2fafbe0 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 28 Dec 2017 11:00:19 +0800 Subject: [PATCH 040/133] translate done: 20171222 Improve your code searching skills with pss.md --- ...ove your code searching skills with pss.md | 83 ------------------- ...ove your code searching skills with pss.md | 82 ++++++++++++++++++ 2 files changed, 82 insertions(+), 83 deletions(-) delete mode 100644 sources/tech/20171222 Improve your code searching skills with pss.md create mode 100644 translated/tech/20171222 Improve your code searching skills with pss.md diff --git a/sources/tech/20171222 Improve your code searching skills with pss.md b/sources/tech/20171222 Improve your code searching skills with pss.md deleted file mode 100644 index d273287f15..0000000000 --- a/sources/tech/20171222 Improve your code searching skills with pss.md +++ /dev/null @@ -1,83 +0,0 @@ -translating by lujun9972 -Improve your code searching skills with pss -====== -Searching a code base is a part of every day developer activities. From fixing a bug, to learning a new code base or checking how to call an api, being able to quickly navigate your way into a code base is a great skill to have. Luckily, we have dedicated tools to search code. Let's see how to install and use one of them - [**pss**][1]. - -### What is pss? - -**pss** is a command line tool that helps searching inside source code file. **pss** searches recursively within a directory tree, knows which extensions and file names to search and which to ignore, automatically skips directories you wouldn't want to search in (for example `.svn` or `.git`), colors its output in a helpful way, and much more. - -### Installing pss - -Install **pss** on Fedora with the following command: -``` - $ dnf install pss -``` - -Once the installation is complete you can now call **pss** in your terminal -``` - $ pss -``` - -Calling **pss** without any argument or with the -h flag will print a detailed usage message. - -### Usage examples - -Now that you have installed **pss** let 's go through some Usage examples. -``` - $ pss foo -``` - -This command simply looks for `foo`. You can be more restrictive and ask pss to look for `foo` only in python files: -``` - $ pss foo --py -``` - -and for `bar` in all other files: -``` - $ pss bar --nopy -``` - -Additionally, **pss** supports most of the well known source file types, to get the full list execute: -``` -$ pss --help-types -``` - -You can also ignore some directories. Note that by default, **pss** will ignore directories like .git, __pycache__, .metadata and more. -``` -$ pss foo --py --ignore-dir=dist -``` - -Furthermore, **pss** also gives you the possibility to get more context from your search using the following : -``` -$ pss -A 5 foo -``` - -will display 5 line of context after the matching word -``` -$ pss -B 5 foo -``` - -will display 5 line of context before the matching word -``` -$ pss -C 5 foo -``` - -will display 5 line of context before & after the matching word - -If you would like to learn how to use **pss ** with regular expression and other options, more examples are available [here][2]. - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/improve-code-searching-skills-pss/ - -作者:[Author Archive;Author Website;Clément Verna][a] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://fedoramagazine.org -[1]:https://github.com/eliben/pss -[2]:https://github.com/eliben/pss/wiki/Usage-samples diff --git a/translated/tech/20171222 Improve your code searching skills with pss.md b/translated/tech/20171222 Improve your code searching skills with pss.md new file mode 100644 index 0000000000..a03999c9bd --- /dev/null +++ b/translated/tech/20171222 Improve your code searching skills with pss.md @@ -0,0 +1,82 @@ +使用 pss 提升你的代码搜索能力 +====== +搜索代码库是开发者每天都要做的事情。从修改 bug 到学习新代码,或者查看如何调用某个 api,能快速在代码库中导航的能力都是一大助力。幸运的是,我们有专门的工具来搜索代码。[**pss**][1] 就是其中一个工具,让我们来看看如何安装和使用它吧。 + +### 什么是 pss? + +**pss** 是一个帮你在源代码文件中进行搜索的命令行工具。**pss** 递归地在目录树中进行搜索,它能自动根据文件名和后缀判断哪些文件需要搜索,哪些文件不需搜索,并且会自动跳过那些你不会想搜索的目录(比如 `.svn` 和 `.git`),还能用色彩渲染输出以方便人们阅读,以及其他很多功能。 + +### 安装 pss + +使用下面命令在 Fedora 上安装 **pss**: +``` + $ dnf install pss +``` + +安装好后就能在终端调用 **pss** 了 +``` + $ pss +``` + +不带参数调用 **pss** 或者带上 `-h` 标志会输出详细的使用说明。 + +### 使用案例 + +现在你安装好 **pss** 了,下面来看一些例子吧。 +``` + $ pss foo +``` + +该命令只是简单的搜索 `foo`。你也可以限制 pss 让它只在 python 文件中搜索 `foo`: +``` + $ pss foo --py +``` + +还能在非 python 文件中搜索 `bar`: +``` + $ pss bar --nopy +``` + +而且,**pss** 支持大多数常见的源代码文件类型,要获取完整的支持列表,执行: +``` +$ pss --help-types +``` + +你还能指定忽略某些目录不进行搜索。默认情况下,**pss** 会忽略类似 `.git`,`__pycache__`,`.metadata` 等目录。 +``` +$ pss foo --py --ignore-dir=dist +``` + +此外,**pss** 还能显示搜索结果的上下文: +``` +$ pss -A 5 foo +``` +会现实匹配结果的后面 5 行内容 + +``` +$ pss -B 5 foo +``` + +会现实匹配结果的前面 5 行内容 +``` +$ pss -C 5 foo +``` + +会现实匹配结果的前后各 5 行内容 + +如果你想知道如何使用 **pss ** 进行正则表达式搜索以及它的其他选项的话,可以在[这里 ][2] 看到更多的例子。 + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/improve-code-searching-skills-pss/ + +作者:[Author Archive;Author Website;Clément Verna][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://fedoramagazine.org +[1]:https://github.com/eliben/pss +[2]:https://github.com/eliben/pss/wiki/Usage-samples From 1472cfb54fb81b74c0e744b264dbfd550dbafc1f Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 28 Dec 2017 11:03:05 +0800 Subject: [PATCH 041/133] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=85=8D=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20171222 Improve your code searching skills with pss.md | 1 + 1 file changed, 1 insertion(+) diff --git a/translated/tech/20171222 Improve your code searching skills with pss.md b/translated/tech/20171222 Improve your code searching skills with pss.md index a03999c9bd..a9040bae77 100644 --- a/translated/tech/20171222 Improve your code searching skills with pss.md +++ b/translated/tech/20171222 Improve your code searching skills with pss.md @@ -1,5 +1,6 @@ 使用 pss 提升你的代码搜索能力 ====== +![](translate-MjAxNzEyMjIgSW1wcm92ZSB5b3VyIGNvZGUgc2VhcmNoaW5nIHNraWxscyB3aXRoIHBzcy5tZAo=) 搜索代码库是开发者每天都要做的事情。从修改 bug 到学习新代码,或者查看如何调用某个 api,能快速在代码库中导航的能力都是一大助力。幸运的是,我们有专门的工具来搜索代码。[**pss**][1] 就是其中一个工具,让我们来看看如何安装和使用它吧。 ### 什么是 pss? From bd48c6716a5903c8a036656c8328552d31d5f21b Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 28 Dec 2017 11:04:58 +0800 Subject: [PATCH 042/133] fix url --- .../20171222 Improve your code searching skills with pss.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20171222 Improve your code searching skills with pss.md b/translated/tech/20171222 Improve your code searching skills with pss.md index a9040bae77..554342fa79 100644 --- a/translated/tech/20171222 Improve your code searching skills with pss.md +++ b/translated/tech/20171222 Improve your code searching skills with pss.md @@ -1,6 +1,6 @@ 使用 pss 提升你的代码搜索能力 ====== -![](translate-MjAxNzEyMjIgSW1wcm92ZSB5b3VyIGNvZGUgc2VhcmNoaW5nIHNraWxscyB3aXRoIHBzcy5tZAo=) +![](https://fedoramagazine.org/wp-content/uploads/2017/12/pss-945x400.jpg) 搜索代码库是开发者每天都要做的事情。从修改 bug 到学习新代码,或者查看如何调用某个 api,能快速在代码库中导航的能力都是一大助力。幸运的是,我们有专门的工具来搜索代码。[**pss**][1] 就是其中一个工具,让我们来看看如何安装和使用它吧。 ### 什么是 pss? From 49b3ac95b7cc4ecef9efb38bedd360369f260190 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 28 Dec 2017 11:05:15 +0800 Subject: [PATCH 043/133] translate done: 20171222 Improve your code searching skills with pss.md --- .../20171222 Improve your code searching skills with pss.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20171222 Improve your code searching skills with pss.md b/translated/tech/20171222 Improve your code searching skills with pss.md index 554342fa79..3d4da18d6d 100644 --- a/translated/tech/20171222 Improve your code searching skills with pss.md +++ b/translated/tech/20171222 Improve your code searching skills with pss.md @@ -1,6 +1,6 @@ 使用 pss 提升你的代码搜索能力 ====== -![](https://fedoramagazine.org/wp-content/uploads/2017/12/pss-945x400.jpg) +![](https://fedoramagazine.org/wp-content/uploads/2017/12/pss-945x400.jpg) 搜索代码库是开发者每天都要做的事情。从修改 bug 到学习新代码,或者查看如何调用某个 api,能快速在代码库中导航的能力都是一大助力。幸运的是,我们有专门的工具来搜索代码。[**pss**][1] 就是其中一个工具,让我们来看看如何安装和使用它吧。 ### 什么是 pss? From 1d75eeb291d0c921d3969f3d5b8ba57f155e84f9 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 28 Dec 2017 11:59:16 +0800 Subject: [PATCH 044/133] translate done: 20171202 MariaDB administration commands for beginners.md --- ...B administration commands for beginners.md | 174 ------------------ ...B administration commands for beginners.md | 171 +++++++++++++++++ 2 files changed, 171 insertions(+), 174 deletions(-) delete mode 100644 sources/tech/20171202 MariaDB administration commands for beginners.md create mode 100644 translated/tech/20171202 MariaDB administration commands for beginners.md diff --git a/sources/tech/20171202 MariaDB administration commands for beginners.md b/sources/tech/20171202 MariaDB administration commands for beginners.md deleted file mode 100644 index 65d8e91749..0000000000 --- a/sources/tech/20171202 MariaDB administration commands for beginners.md +++ /dev/null @@ -1,174 +0,0 @@ -translating by lujun9972 -MariaDB administration commands for beginners -====== -Earlier we have learned to [**install & secure MariaDB server on Centos/RHEL 7**][1], which is now the default database of RHEL/CentOS 7 onwards.We will now discuss some useful MariaDB administration commands. These are some very basic commands that will get you started with using MariaDB & these can also be used with MySQL, since Mariadb is forked out version of MySQL only. - -**(Recommended Read:[MongoDB installation & configuration on RHEL/CentOS][2])** - -## MariaDB Administration Commands - -### Checking version of your MariaDB installation - -To check the current version of your DB installation, type following command in your terminal - -``` -$ mysql -version -``` - -This command provide you with the current version of DB. Alternatively you can also run below mentioned command for detailed view on version, - -``` -$ mysqladmin -u root -p version -``` - -### Logging into mariadb - -To log into the mariadb server, run - -``` -$ mysql -u root -p -``` - -& then enter password to login to the session. - -### Showing all database - -To show all the databases that your maridb currently has, run - -``` -$ show databases; -``` - -after you are logged into mariadb. - -### Creating new databases - -To create a new database in mariadb, run - -``` -$ create database dan; -``` - -when logged into mariabdb. To create a database directly from terminal, run - -``` -$ mysqladmin -u user -p create dan -``` - -Here, **dan** is the name of the new database. - -### Deleting a database - -To delete a database, run - -``` -$ drop database dan; -``` - -from the logged in session of mariadb. Alternatively you can also use, - -``` -$ mysqladmin -u root -p drop dan -``` - -**Note:-** If you are getting an 'access denied' error while running the mysqladmin commands, that might be because we have not given rights to root. To do so, run the command mentioned in point 7, replacing name of the user with root. - -### Creating new user - -To create a new user for database, run - -``` -$ CREATE USER 'dan'@'localhost' IDENTIFIED BY 'password'; -``` - -### Granting access to user for a database - -For providing access to user for a single database, run - -``` -$ GRANT ALL PRIVILEGES ON test.* to 'dan'@'localhost'; -``` - -This will provide user dan complete access over database named test. We can also grant SELECT, INSERT , DELETE permissions to user. - -To provide access to all database, replace test with * i.e. - -``` -$ GRANT ALL PRIVILEGES ON *.* to 'dan'@'localhost'; -``` - -### Creating backup/dump of database - -To create of a single database, run the following command from your terminal window, - -``` -$ mysqldump -u root -p database_name>db_backup.sql -``` - -To create backup of multiple databases in single command, - -``` -$ mysqldump -u root -p - - databases db1 db2 > db12_backup.sql -``` - -To create dump of all databases in single command, - -``` -$ mysqldump -u root -p - - all-databases >all_dbs.sql -``` - -### Restoring database from the dump - -To restore database from a dump, run - -``` -$ mysql -u root -p database_namedb_backup.sql +``` + +若要一次性创建多个数据库的备份则运行, + +``` +$ mysqldump -u root -p - - databases db1 db2 > db12_backup.sql +``` + +要一次性导出多个数据库,则运行, + +``` +$ mysqldump -u root -p - - all-databases >all_dbs.sql +``` + +### 从备份中恢复数据库 + +要从备份中恢复数据库,运行 + +``` +$ mysql -u root -p database_name Date: Thu, 28 Dec 2017 16:18:19 +0800 Subject: [PATCH 045/133] translate done: 20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md --- ... Speed - Here Is Why It Will Never Work.md | 68 ------------------- ... Speed - Here Is Why It Will Never Work.md | 68 +++++++++++++++++++ 2 files changed, 68 insertions(+), 68 deletions(-) delete mode 100644 sources/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md create mode 100644 translated/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md diff --git a/sources/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md b/sources/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md deleted file mode 100644 index 55413f97aa..0000000000 --- a/sources/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md +++ /dev/null @@ -1,68 +0,0 @@ -translating by lujun9972 -Increase Torrent Speed - Here Is Why It Will Never Work -====== - -Haven't we always wanted **better torrent speed**? No matter how much you have. You just can 't get enough of it. Our obsession with torrenting speed has often resulted in trying out those tricks from several websites including YouTube videos. And believe me, ever since I was a child till date I haven't found luck with it. So in this article, Let us have a look at why trying to increase torrent speed never works. - -## Factors that affect speed - -### Local Factors - -In the image below you can see that there are 3 computers with User A, B, and C. Now A and B are connected to each locally and C is somewhere far with multiple connection points 1,2 and 3 in between. - -[![][1]][2] - -If user A and B have to share files between them, they can directly do so without the need for torrents with the maximum speed available. This speed does not rely on the internet or anything. - - * The capacity of the wire - - * The capacity of network card of the devices - - * The capacity of the router - -I always see people talk about complicated stuff when it comes to torrenting but they always miss out on important factors. - -[![LAN wire, network cards, router][3]][3] - -Now we are talking about local file share, The usual network cards that people have in their newer devices are of 1 Gigabit. The common routers are around 300 Megabits and the wires can also mostly take 100 Megabits. Now you might be having a different setup but I am just giving a general example. - -Since you have a 1 Gigabit Network adapter, you believe that you should get 125 Megabytes in speed. But the router is only capable of only transferring a 300 Megabits which is 30 Megabyte. - -Even if you wanted to bargain at 30 Megabytes, The cable/link connecting you to the router is only capable of 100 megabits or 10 MegaBytes at best. This is a pure case of bottlenecking where one weak component affects the other stronger ones as transfers will happen with only 10 Megabytes which is the cable's limit. Now imagine a torrent which can be downloaded at extreme speed. But it is your weak hardware creating the bottleneck. - -### Foreign Factors - -Look at this image again. User C is somewhere far away. Probably in another country. **** - -[![how torrent works][1]][2] - -If this user created a torrent and you were to download it. The first problem would be the one we have already discussed. You wouldn 't be able to cross the 10 Megabyte mark. - -Secondly, since there are multiple points in between, maybe one of them could become the bottleneck again, it might have too much traffic and comparatively weaker hardware. Resulting in lower speed. - -### Seeders & Leechers - -There has already been too much discussion about it and the general idea is to have more seeders. I've also discussed seeders and leechers in [this article][4]. This is true, but keeping the above factor in mind, good seeders from a location that doesn't have a great link with mine is of no help at all. Usually, this doesn't happen most of the time as we are not the only ones downloading it and someone from our locality already has the file and is now seeding it. - -## Conclusion - -We tried to understand the reason behind our good or bad torrent speed. Irrespective of how many software tweaks we try, most of the times it is the physical barrier. I have usually never had any problems with the software and the default settings have worked for me. - -I hope you liked the article, Please feel free to pen down your thoughts in the comment section below. - - --------------------------------------------------------------------------------- - -via: http://www.theitstuff.com/increase-torrent-speed-will-never-work - -作者:[Rishabh Kandari][a] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.theitstuff.com/author/reevkandari -[1]:http://www.theitstuff.com/wp-content/uploads/2017/11/A-550x275.png -[2]:http://www.theitstuff.com/wp-content/uploads/2017/11/A.png -[3]:http://www.theitstuff.com/wp-content/uploads/2017/11/A-1-e1509773618549.png -[4]:http://www.linuxandubuntu.com/home/torrents-everything-you-need-to-know diff --git a/translated/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md b/translated/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md new file mode 100644 index 0000000000..127bb21066 --- /dev/null +++ b/translated/tech/20171203 Increase Torrent Speed - Here Is Why It Will Never Work.md @@ -0,0 +1,68 @@ +Torrent 提速 - 为什么总是无济于事 +====== + +![](http://www.theitstuff.com/wp-content/uploads/2017/11/increase-torrent-speed.jpg) +是不是总是想要 **更快的 torrent 速度**?不管现在的速度有多块,但总是无法对此满足。我们对 torrent 速度的痴迷使我们经常从包括 YouTube 视频在内的许多网站上寻找并应用各种所谓的技巧。但是相信我,从小到大我就没发现哪个技巧有用过。因此本文我们就就来看看,为什么尝试提高 torrent 速度是行不通的。 + +## 影响速度的因素 + +### 本地因素 + +从下图中可以看到 3 台电脑分别对应的 A,B,C 三个用户。A 和 B 本地相连,而 C 的位置则比较远,它与本地之间有 1,2,3 三个连接点。 + +[![][1]][2] + +若用户 A 和用户 B 之间要分享文件,他们之间直接分享就能达到最大速度了而无需使用 torrent。这个速度跟互联网什么的都没有关系。 + ++ 网线的性能 + ++ 网卡的性能 + ++ 路由器的性能 + +当谈到 torrent 的时候,人们都是在说一些很复杂的东西,但是却总是不得要点。 + +[![LAN wire,network cards,router][3]][3] + +现在我们谈论的是本地文件分享,目前较新一点的网卡速率大约 1 Gigabit 左右。常见的路由器大约 300 Megabits 而网线大概能达到 100 Megabits。当然具体的配置可能不一样,我这里只是给一个一般性的例子。 + +由于你有一个 1 Gigabit 的网卡,你可能会觉得你的下载速度应该达到 125 Megabytes。但是路由器只允许传输 300 Megabits 也就是 30 Megabyte。 + +即使你把目标降到 30 Megabytes,然而你连接到路由器的电缆/网线的性能最多只有 100 megabits 也就是 10 MegaBytes。这是一个纯粹的瓶颈问题,由一个薄弱的环节影响到了其他强健部分,也就是说这个传输速率只能达到 10 Megabytes,即电缆的极限速度。现在想象有一个 torrent 即使能够用最大速度进行下载,那也会由于你的硬件不够强大而导致瓶颈。 + +### 外部因素 + +现在再来看一下这幅图。用户 C 在很遥远的某个地方。甚至可能在另一个国家。 + +[![how torrent works][1]][2] + +假设这个用户创建了一个 torrent 而你想去下载它。第一个问题就是我们刚才讨论过的,你不可能跨越 10 Megabyte 这道坎。 + +第二,由于 C 与本地之间多个有连接点,其中一个点就有可能成为瓶颈所在,可能由于繁重的流量和相对薄弱的硬件导致了缓慢的速度。 + +### Seeders( 译者注:做种者) 与 Leechers( 译者注:只下载不做种的人) + +关于此已经有了太多的讨论,总的想法就是搜索更多的种子,但要注意上面的那些因素,一个很好的种子提供者但是跟我之间的连接不好的话那也是无济于事的。通常,这不可能发生,因为我们也不是唯一下载这个资源的人,一般都会有一些在本地的人已经下载好了这个文件并已经在做种了。 + +## 结论 + +我们尝试搞清楚哪些因素影响了 torrent 速度的好坏。不管我们如何用软件进行优化,大多数时候是这是由于物理瓶颈导致的。我从来不关心那些软件,使用默认配置对我来说就够了。 + +希望你会喜欢这篇文章,有什么想法敬请留言。 + + +-------------------------------------------------------------------------------- + +via: http://www.theitstuff.com/increase-torrent-speed-will-never-work + +作者:[Rishabh Kandari][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.theitstuff.com/author/reevkandari +[1]:http://www.theitstuff.com/wp-content/uploads/2017/11/A-550x275.png +[2]:http://www.theitstuff.com/wp-content/uploads/2017/11/A.png +[3]:http://www.theitstuff.com/wp-content/uploads/2017/11/A-1-e1509773618549.png +[4]:http://www.linuxandubuntu.com/home/torrents-everything-you-need-to-know From 7ffdd87c53a978a897610be904f6f3224bb20ce8 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 28 Dec 2017 16:56:31 +0800 Subject: [PATCH 046/133] PRF&PUB:20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md @geekpi --- ... Newer Version with This Single Command.md | 49 +++++++++++-------- 1 file changed, 29 insertions(+), 20 deletions(-) rename {translated/tech => published}/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md (66%) diff --git a/translated/tech/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md b/published/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md similarity index 66% rename from translated/tech/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md rename to published/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md index dc853e1808..a87aae5879 100644 --- a/translated/tech/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md +++ b/published/20171128 Easily Upgrade Ubuntu to a Newer Version with This Single Command.md @@ -1,46 +1,48 @@ -使用一个命令轻松升级 Ubuntu 到较新的版本 +一行命令轻松升级 Ubuntu ====== + +![Upgrade Ubuntu to a newer version with a single command][3] + [zzupdate][1] 是一个开源的命令行程序,通过将几个更新命令组合到一个命令中,使得将 Ubuntu 桌面和服务器版本升级到更新版本的任务变得容易一些。 将 Ubuntu 系统升级到更新的版本并不是一项艰巨的任务。无论是使用 GUI 还是使用几个命令,都可以轻松地将系统升级到最新版本。 -另一方面,Gianluigi ‘Zane’ Zanettini 写的 zzupdate 只需一个命令就可以在 Ubuntu 中清理、更新、自动删除、版本升级、自我更新 composer。 +另一方面,Gianluigi 'Zane' Zanettini 写的 `zzupdate` 只需一个命令就可以在 Ubuntu 中清理、更新、自动删除、版本升级、该工具自我更新。 -它清理本地缓存,更新可用的软件包信息,然后执行发行版升级。在下一步中,它会更新 Composer 并删除未使用的软件包。 +它会清理本地缓存,更新可用的软件包信息,然后执行发行版升级。接着,它会更新该工具并删除未使用的软件包。 -脚本必须以root用户身份运行。 +该脚本必须以 root 用户身份运行。 ### 安装 zzupdate 将 Ubuntu 升级到更新的版本 -![Upgrade Ubuntu to a newer version with a single command][2] +要安装 `zzupdate`,请在终端中执行以下命令。 -![Upgrade Ubuntu to a newer version with a single command][3] - -要安装 zzupdate,请在终端中执行以下命令。 ``` curl -s https://raw.githubusercontent.com/TurboLabIt/zzupdate/master/setup.sh | sudo sh ``` -然后将提供的示例配置文件复制到 zzupdate.conf 并设置你的首选项。 +然后将提供的示例配置文件复制到 `zzupdate.conf` 并设置你的首选项。 + ``` sudo cp /usr/local/turbolab.it/zzupdate/zzupdate.default.conf /etc/turbolab.it/zzupdate.conf ``` 完成后,只要使用下面的命令,它就会开始升级你的 Ubuntu 系统到一个更新的版本(如果有的话)。 -`sudo zzupdate` +``` +sudo zzupdate +``` -请注意,在普通版本下,zzupdate 会将系统升级到下一个可用的版本。但是,当你运行 Ubuntu 16.04 LTS 时,它将尝试仅搜索下一个长期支持版本,而不是可用的最新版本。 +请注意,在普通版本(非 LTS 版本)下,zzupdate 会将系统升级到下一个可用的版本。但是,当你运行 Ubuntu 16.04 LTS 时,它将尝试仅搜索下一个长期支持版本,而不是可用的最新版本。 如果你想退出 LTS 版本并升级到最新版本,你将需要更改一些选项。 对于 Ubuntu 桌面,打开 **软件和更新** 和下面 **更新** 选项卡,并更改通知我新的 Ubuntu 版本选项为 “**对于任何新版本**”。 -![Software Updater in Ubuntu][2] - ![Software Updater in Ubuntu][4] -对于 Ubuntu 服务版,编辑版本升级文件。 +对于 Ubuntu 服务版,编辑 `release-upgrades` 文件。 + ``` vi /etc/update-manager/release-upgrades @@ -49,39 +51,46 @@ Prompt=normal ### 配置 zzupdate [可选] -zzupdate 要配置的选项 +`zzupdate` 要配置的选项: + ``` REBOOT=1 ``` 如果值为 1,升级后系统将重启。 + ``` REBOOT_TIMEOUT=15 ``` 将重启超时设置为 900 秒,因为某些硬件比其他硬件重启需要更长的时间。 + ``` VERSION_UPGRADE=1 ``` 如果升级可用,则执行版本升级。 + ``` VERSION_UPGRADE_SILENT=0 ``` -自动显示版本进度 +自动显示版本进度。 + ``` COMPOSER_UPGRADE=1 ``` -值为 “1” 会自动升级 composer。 +值为 “1” 会自动升级该工具。 + ``` SWITCH_PROMPT_TO_NORMAL=0 ``` -此功能将 Ubuntu 版本更新为普通版本,即如果你运行着 LTS 发行版,zzupdate 将不会将其升级到 Ubuntu 17.10(如果其设置为 0)。它将仅搜索 LTS 版本。相比之下,无论你运行着 LTS 或者普通版,“1” 都将搜索最新版本。 +此功能将 Ubuntu 版本更新为普通版本,即如果你运行着 LTS 发行版,`zzupdate` 将不会将其升级到 Ubuntu 17.10(如果其设置为 0)。它将仅搜索 LTS 版本。相比之下,无论你运行着 LTS 或者普通版,“1” 都将搜索最新版本。 完成后,你要做的就是在控制台中运行一个完整的 Ubuntu 系统更新。 + ``` sudo zzupdate ``` @@ -96,9 +105,9 @@ sudo zzupdate via: https://itsfoss.com/zzupdate-upgrade-ubuntu/ -作者:[Ambarish Kumar;Abhishek Prakash][a] +作者:[Ambarish Kumar][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 22693e440eb45f65b68988226c4949094a79b36f Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 28 Dec 2017 18:17:43 +0800 Subject: [PATCH 047/133] PRF:20171005 How to manage Linux containers with Ansible Container.md @qhwdw --- ...Linux containers with Ansible Container.md | 61 ++++++++----------- 1 file changed, 24 insertions(+), 37 deletions(-) diff --git a/translated/tech/20171005 How to manage Linux containers with Ansible Container.md b/translated/tech/20171005 How to manage Linux containers with Ansible Container.md index 624d25694a..63918aec5a 100644 --- a/translated/tech/20171005 How to manage Linux containers with Ansible Container.md +++ b/translated/tech/20171005 How to manage Linux containers with Ansible Container.md @@ -1,44 +1,35 @@ -怎么去使用 Ansible Container 去管理 Linux 容器 +用 Ansible Container 去管理 Linux 容器 ============================================================ -### Ansible Container 处理 Dockerfile 的不足和对容器化项目提供完整的管理。 +> Ansible Container 解决了 Dockerfile 的不足,并对容器化项目提供了完整的管理。 ![Ansible Container: A new way to manage containers](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/container-ship.png?itok=pqZYgQ7K "Ansible Container: A new way to manage containers") + Image by : opensource.com -我喜欢容器,并且每天都使用这个技术。在过去几个月,在一组项目中已经解决了我遇到的问题,即便如此,容器并不完美。 +我喜欢容器,并且每天都使用这个技术。即便如此,容器并不完美。不过,在过去几个月里,一系列项目已经解决了我遇到的一些问题。 -我刚开始时,用 [Docker][11] 使用容器,因为这个项目使这个技术非常流行。除此之外,使用这个容器引擎,我学到了怎么去使用 **[docker-compose][6]** 以及怎么去用它管理我的项目。使用它使我的生产力猛增!一个命令去运行我的项目,而不管它有多复杂。因此,我太高兴了。 +我刚开始时,用 [Docker][11] 使用容器,这个项目使得这种技术非常流行。除了使用这个容器引擎之外,我学到了怎么去使用 [docker-compose][6] 以及怎么去用它管理我的项目。使用它使得我的生产力猛增!一个命令就可以运行我的项目,而不管它有多复杂。因此,我太高兴了。 -使用一段时间之后,我发现了一些问题。最明显的问题是创建窗口镜像的过程。Docker 工具使用一个定制的文件格式作为一个 Recipe 去制作容器镜像 — Dockerfiles。这个格式很容易学会,并且很短的一段时间之后,你就可以为你自己制作容器镜像了。但是,一旦你希望去掌握最佳实践或者有复杂场景的想法,问题就会出现。 +使用一段时间之后,我发现了一些问题。最明显的问题是创建容器镜像的过程。Docker 工具使用一个定制的文件格式作为生成容器镜像的依据:Dockerfile。这个格式易于学习,并且很短的一段时间之后,你就可以自己制作容器镜像了。但是,一旦你希望进一步掌握它或者考虑到复杂场景,问题就会出现。 -Ansible 的更多资源 +让我们打断一下,先去了解一个不同的东西:[Ansible][22] 的世界。你知道它吗?它棒极了,是吗?你不这么认为?好吧,是时候去学习一些新事物了。Ansible 是一个允许你通过写一些任务去管理你的基础设施,并在你选择的环境中运行它们的项目。不需要去安装和设置任何的服务;你可以从你的笔记本电脑中很容易地做任何事情。许多人已经接受 Ansible 了。 -* [Ansible 是怎么工作的][1] +想像一下这样的场景:你在 Ansible 中,你写了很多的 Ansible 角色role剧本playbook,你可以用它们去管理你的基础设施,并且你想把它们运用到容器中。你应该怎么做?通过 shell 脚本和 Dockerfile 去写容器镜像定义?听起来好像不对。 -* [免费的 Ansible 电子书][2] +来自 Ansible 开发团队的一些人问到这个问题,并且他们意识到,人们每天编写和使用的那些同样的 Ansible 角色和剧本也可以用来制作容器镜像。但是 Ansible 能做到的不止这些 —— 它可以被用于去管理容器化项目的完整生命周期。从这些想法中,[Ansible Container][12] 项目诞生了。它利用已有的 Ansible 角色转变成容器镜像,甚至还可以被用于生产环境中从构建到部署的完整生命周期。 -* [Ansible 快速上手视频][3] +现在让我们讨论一下,我之前提到过的在 Dockerfile 环境中的最佳实践问题。这里有一个警告:这将是非常具体且技术性的。出现最多的三个问题有: -* [下载和安装 Ansible][4] +### 1、 在 Dockerfile 中内嵌的 Shell 脚本 -让我们先休息一会儿,先去了解一个不同的东西:[Ansible][22] 的世界。你知道它吗?它棒极了,是吗?你不这么认为?好吧,是时候去学习一些新事物了。Ansible 是一个项目,它允许你通过写一些任务去管理你的基础设施,并在你选择的环境中运行它们。不需要去安装和设置任何的服务;你可以从你的笔记本电脑中去很很容易地做任何事情。许多人已经接受 Ansible 了。 - -想像一下这样的场景:你在 Ansible 中,你写了很多的 Ansible 角色和 playbooks,你可以用它们去管理你的基础设施,并且想把它们运用到容器中。你应该怎么做?开始通过 shell 脚本和 Dockerfiles 去写容器镜像定义?听起来好像不对。 - -来自 Ansible 开发团队的一些人问到这个问题,并且它们意识到,人们每天使用那些同样的 Ansible 角色和 playbooks 也可以用来制作容器镜像。但是 Ansible 能做到的不止这些 — 它可以被用于去管理容器化项目的完整的生命周期。从这些想法中,[Ansible Container][12] 项目诞生了。它使用已有的可以变成容器镜像的 Ansible 角色,甚至可以被用于应用程序在生产系统中从构建到部署的完整生命周期。 - -现在让我们讨论一下,在 Dockerfiles 环境中关于最佳实践时可能存在的问题。这里有一个警告:这将是非常具体且技术性的。出现最多的三个问题有: - -### 1\. 在 Dockerfiles 中内嵌的 Shell 脚本。 - -当写 Dockerfiles 时,你可以通过 **/bin/sh -c** 解释指定的脚本。它可以做类似这样的事情: +当写 Dockerfile 时,你可以指定会由 `/bin/sh -c` 解释执行的脚本。它类似如下: ``` RUN dnf install -y nginx ``` -RUN 处是一个 Dockerfile 指令并且其它的都是参数(它传递给 shell)。但是,想像一个更复杂的场景: +这里 `RUN` 是一个 Dockerfile 指令,其它的都是参数(它们传递给 shell)。但是,想像一个更复杂的场景: ``` RUN set -eux; \ @@ -51,29 +42,25 @@ RUN set -eux; \     echo "${goRelSha256} *go.tgz" | sha256sum -c -; \ ``` -这仅是从 [the official golang image][13] 中拿来的一个。它看起来并不好看,是不是? +这仅是从 [golang 官方镜像][13] 中拿来的一段。它看起来并不好看,是不是? -### 2\. 你解析 Dockerfiles 并不容易。 +### 2、 解析 Dockerfile 并不容易 -Dockerfiles 是一个没有正式规范的新格式。如果你需要在你的基础设施(比如,让构建过程自动化一点)中去处理 Dockerfiles 将会很复杂。仅有的规划是 [这个代码][14],它是 **dockerd** 的一部分。问题是你不能使用它作为一个库(library)。最容易的解决方案是你自己写一个解析器,然后祈祷它运行的很好。使用一些众所周知的标记语言不是更好吗?比如,YAML 或者 JSON。 +Dockerfile 是一个没有正式规范的新格式。如果你需要在你的基础设施(比如,让构建过程自动化一点)中去处理 Dockerfile 将会很复杂。仅有的规范是 [这个代码][14],它是 **dockerd** 的一部分。问题是你不能使用它作为一个library来使用。最容易的解决方案是你自己写一个解析器,然后祈祷它运行的很好。使用一些众所周知的标记语言不是更好吗?比如,YAML 或者 JSON。 -### 3\. 管理困难。 +### 3、 管理困难 -如果你熟悉容器镜像的内部结构,你可能知道每个镜像是由层(layers)构成的。一旦容器被创建,这些层就使用联合文件系统技术堆叠在一起(像煎饼一样)。问题是,你并不能显式地管理这些层 — 你不能说,“这儿开始一个新层”,你被迫使用一种可读性不好的方法去改变你的 Dockerfile。最大的问题是,必须遵循一套最佳实践以去达到最优结果 — 新来的人在这个地方可能很困难。 - -### Ansible 语言和 Dockerfiles 比较 - -相比 Ansible,Dockerfiles 的最大缺点,也是 Ansible 的优点,作为一个语言,Ansible 更强大。例如,Dockerfiles 没有直接的变量概念,而 Ansible 有一个完整的模板系统(变量只是它其中的一个特性)。Ansible 包含了很多更易于使用的模块,比如,[**wait_for**][15],它可以被用于服务就绪检查,比如,在处理之前等待服务准备就绪。在 Dockerfiles 中,做任何事情都通过一个 shell 脚本。因此,如果你想去找出已准备好的服务,它必须使用 shell(或者独立安装)去做。使用 shell 脚本的其它问题是,它会变得很复杂,维护成为一种负担。很多人已经找到了这个问题,并将这些 shell 脚本转到 Ansible。 - -如果你对这个主题感兴趣,并且想去了解更多内容,请访问 [Open Source Summit][16],在 Prague 去看 [我的演讲][17],时间是 10 月 23 日,星期一,4:20 p.m. 在 Palmovka room 中。 - - _看更多的 Tomas Tomecek 演讲,[从 Dockerfiles 到 Ansible Container][7],在 [Open Source Summit EU][8],它将在 10 月 23-26 日在 Prague 召开。_ +如果你熟悉容器镜像的内部结构,你可能知道每个镜像是由layer构成的。一旦容器被创建,这些层就使用联合文件系统技术堆叠在一起(像煎饼一样)。问题是,你并不能显式地管理这些层 — 你不能说,“这儿开始一个新层”,你被迫使用一种可读性不好的方法去改变你的 Dockerfile。最大的问题是,必须遵循一套最佳实践以去达到最优结果 — 新来的人在这个地方可能很困难。 +### Ansible 语言和 Dockerfile 比较 +相比 Ansible,Dockerfile 的最大缺点,也是 Ansible 的优点,作为一个语言,Ansible 更强大。例如,Dockerfile 没有直接的变量概念,而 Ansible 有一个完整的模板系统(变量只是它其中的一个特性)。Ansible 包含了很多更易于使用的模块,比如,[wait_for][15],它可以被用于服务就绪检查,比如,在处理之前等待服务准备就绪。在 Dockerfile 中,做任何事情都通过一个 shell 脚本。因此,如果你想去找出已准备好的服务,它必须使用 shell(或者独立安装)去做。使用 shell 脚本的其它问题是,它会变得很复杂,维护成为一种负担。很多人已经发现了这个问题,并将这些 shell 脚本转到 Ansible。 ### 关于作者 - [![human](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/ja.jpeg?itok=4ATUEAbd)][18] Tomas Tomecek - 工程师、Hacker、演讲者、Tinker、Red Hatter。喜欢容器、linux、开源软件、python 3、rust、zsh、tmux。[More about me][9] + [![human](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/ja.jpeg?itok=4ATUEAbd)][18] + +Tomas Tomecek - 工程师、Hacker、演讲者、Tinker、Red Hatter。喜欢容器、linux、开源软件、python 3、rust、zsh、tmux。[More about me][9] -------------------------------------------------------------------------------- @@ -81,7 +68,7 @@ via: https://opensource.com/article/17/10/dockerfiles-ansible-container 作者:[Tomas Tomecek][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/) 荣誉推出 From f4c9c2db746e2d35f096b4c5c38c91d5e40120a6 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 28 Dec 2017 18:17:57 +0800 Subject: [PATCH 048/133] PUB:20171005 How to manage Linux containers with Ansible Container.md @qhwdw --- ...71005 How to manage Linux containers with Ansible Container.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20171005 How to manage Linux containers with Ansible Container.md (100%) diff --git a/translated/tech/20171005 How to manage Linux containers with Ansible Container.md b/published/20171005 How to manage Linux containers with Ansible Container.md similarity index 100% rename from translated/tech/20171005 How to manage Linux containers with Ansible Container.md rename to published/20171005 How to manage Linux containers with Ansible Container.md From e1acc68967a40badc71df3c0d56099b97828202c Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 28 Dec 2017 21:36:12 +0800 Subject: [PATCH 049/133] PRF&PUB:20171222 Improve your code searching skills with pss.md @lujun9972 --- ...ove your code searching skills with pss.md | 95 +++++++++++++++++++ ...ove your code searching skills with pss.md | 83 ---------------- 2 files changed, 95 insertions(+), 83 deletions(-) create mode 100644 published/20171222 Improve your code searching skills with pss.md delete mode 100644 translated/tech/20171222 Improve your code searching skills with pss.md diff --git a/published/20171222 Improve your code searching skills with pss.md b/published/20171222 Improve your code searching skills with pss.md new file mode 100644 index 0000000000..256fa0597e --- /dev/null +++ b/published/20171222 Improve your code searching skills with pss.md @@ -0,0 +1,95 @@ +使用 pss 提升你的代码搜索能力 +====== + +![](https://fedoramagazine.org/wp-content/uploads/2017/12/pss-945x400.jpg) + +搜索代码库是开发者每天都要做的事情。从修改 bug 到学习新代码,或者查看如何调用某个 API,能快速在代码库中导航的能力都是一大助力。幸运的是,我们有专门的工具来搜索代码。[pss][1] 就是其中一个工具,让我们来看看如何安装和使用它吧。 + +### 什么是 pss? + +`pss` 是一个帮你在源代码文件中进行搜索的命令行工具。`pss` 递归地在目录树中进行搜索,它能自动根据文件名和后缀判断哪些文件需要搜索,哪些文件不需搜索,并且会自动跳过那些你不会想搜索的目录(比如 `.svn` 和 `.git`),还能用色彩渲染输出以方便人们阅读,以及其他很多功能。 + +### 安装 pss + +使用下面命令在 Fedora 上安装 `pss`: + +``` + $ dnf install pss +``` + +安装好后就能在终端调用 `pss` 了: + +``` + $ pss +``` + +不带参数调用 `pss` 或者带上 `-h` 标志会输出详细的使用说明。 + +### 使用案例 + +现在你安装好 `pss` 了,下面来看一些例子吧。 + +``` + $ pss foo +``` + +该命令只是简单的搜索 `foo`。你也可以限制 `pss` 让它只在 python 文件中搜索 `foo`: + +``` + $ pss foo --py +``` + +还能在非 python 文件中搜索 `bar`: + +``` + $ pss bar --nopy +``` + +而且,`pss` 支持大多数常见的源代码文件类型,要获取完整的支持列表,执行: + +``` +$ pss --help-types +``` + +你还能指定忽略某些目录不进行搜索。默认情况下,`pss` 会忽略类似 `.git`,`__pycache__`,`.metadata` 等目录。 + +``` +$ pss foo --py --ignore-dir=dist +``` + +此外,`pss` 还能显示搜索结果的上下文。 + +``` +$ pss -A 5 foo +``` + +会显示匹配结果的后面 5 行内容。 + +``` +$ pss -B 5 foo +``` + +会显示匹配结果的前面 5 行内容。 + +``` +$ pss -C 5 foo +``` + +会显示匹配结果的前后各 5 行内容。 + +如果你想知道如何使用 `pss ` 进行正则表达式搜索以及它的其他选项的话,可以在[这里][2]看到更多的例子。 + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/improve-code-searching-skills-pss/ + +作者:[Clément Verna][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://fedoramagazine.org +[1]:https://github.com/eliben/pss +[2]:https://github.com/eliben/pss/wiki/Usage-samples diff --git a/translated/tech/20171222 Improve your code searching skills with pss.md b/translated/tech/20171222 Improve your code searching skills with pss.md deleted file mode 100644 index 3d4da18d6d..0000000000 --- a/translated/tech/20171222 Improve your code searching skills with pss.md +++ /dev/null @@ -1,83 +0,0 @@ -使用 pss 提升你的代码搜索能力 -====== -![](https://fedoramagazine.org/wp-content/uploads/2017/12/pss-945x400.jpg) -搜索代码库是开发者每天都要做的事情。从修改 bug 到学习新代码,或者查看如何调用某个 api,能快速在代码库中导航的能力都是一大助力。幸运的是,我们有专门的工具来搜索代码。[**pss**][1] 就是其中一个工具,让我们来看看如何安装和使用它吧。 - -### 什么是 pss? - -**pss** 是一个帮你在源代码文件中进行搜索的命令行工具。**pss** 递归地在目录树中进行搜索,它能自动根据文件名和后缀判断哪些文件需要搜索,哪些文件不需搜索,并且会自动跳过那些你不会想搜索的目录(比如 `.svn` 和 `.git`),还能用色彩渲染输出以方便人们阅读,以及其他很多功能。 - -### 安装 pss - -使用下面命令在 Fedora 上安装 **pss**: -``` - $ dnf install pss -``` - -安装好后就能在终端调用 **pss** 了 -``` - $ pss -``` - -不带参数调用 **pss** 或者带上 `-h` 标志会输出详细的使用说明。 - -### 使用案例 - -现在你安装好 **pss** 了,下面来看一些例子吧。 -``` - $ pss foo -``` - -该命令只是简单的搜索 `foo`。你也可以限制 pss 让它只在 python 文件中搜索 `foo`: -``` - $ pss foo --py -``` - -还能在非 python 文件中搜索 `bar`: -``` - $ pss bar --nopy -``` - -而且,**pss** 支持大多数常见的源代码文件类型,要获取完整的支持列表,执行: -``` -$ pss --help-types -``` - -你还能指定忽略某些目录不进行搜索。默认情况下,**pss** 会忽略类似 `.git`,`__pycache__`,`.metadata` 等目录。 -``` -$ pss foo --py --ignore-dir=dist -``` - -此外,**pss** 还能显示搜索结果的上下文: -``` -$ pss -A 5 foo -``` -会现实匹配结果的后面 5 行内容 - -``` -$ pss -B 5 foo -``` - -会现实匹配结果的前面 5 行内容 -``` -$ pss -C 5 foo -``` - -会现实匹配结果的前后各 5 行内容 - -如果你想知道如何使用 **pss ** 进行正则表达式搜索以及它的其他选项的话,可以在[这里 ][2] 看到更多的例子。 - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/improve-code-searching-skills-pss/ - -作者:[Author Archive;Author Website;Clément Verna][a] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://fedoramagazine.org -[1]:https://github.com/eliben/pss -[2]:https://github.com/eliben/pss/wiki/Usage-samples From 45fb2866bd0a4e95723fe5f824ce62859a674112 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 29 Dec 2017 08:56:28 +0800 Subject: [PATCH 050/133] translated --- ...- Learn to install TOR network on Linux.md | 104 ------------------ ...- Learn to install TOR network on Linux.md | 101 +++++++++++++++++ 2 files changed, 101 insertions(+), 104 deletions(-) delete mode 100644 sources/tech/20171219 Surf anonymously- Learn to install TOR network on Linux.md create mode 100644 translated/tech/20171219 Surf anonymously- Learn to install TOR network on Linux.md diff --git a/sources/tech/20171219 Surf anonymously- Learn to install TOR network on Linux.md b/sources/tech/20171219 Surf anonymously- Learn to install TOR network on Linux.md deleted file mode 100644 index a47f00ef75..0000000000 --- a/sources/tech/20171219 Surf anonymously- Learn to install TOR network on Linux.md +++ /dev/null @@ -1,104 +0,0 @@ -translating---geekpi - -Surf anonymously: Learn to install TOR network on Linux -====== -Tor Network is an anonymous network to secure your internet & privacy. Tor network is a group of volunteer operated servers. Tor protects internet communication by bouncing it around a distributed network of relay system run by volunteers. This prevents us from people snooping the internet, they can't learn what site we visit or where is the user physically & it also allows us to use blocked websites. - -In this tutorial, we will learn to install Tor network on various Linux operating systems & how we can use it configure our applications to secure the communications. - - **(Recommended Read:[How to install Tor Browser on Linux (Ubuntu, Mint, RHEL, Fedora, CentOS)][1])** - -### CentOS/RHEL/Fedora - -Tor packages are part of EPEL repositories, so we can simply install Tor using yum if we have EPEL repositories installed. If you need to install EPEL repos on your system, use the suitable command (based on OS & Architecture) from the following , - - **RHEL/CentOS 7** - - **$ sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-11.noarch.rpm** - - **RHEL/CentOS 6 (64 Bit)** - - **$ sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm** - - **RHEL/CentOS 6 (32 Bit)** - - **$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm** - -Once installed, we can than install Tor browser with the following command, - - **$ sudo yum install tor** - -### Ubuntu - -For installing Tor network on Ubuntu machines, we need to add Official Tor repositories. We need to add the repo information to '/etc/apt/sources.list' - - **$ sudo nano /etc/apt/sources.list** - -Now add the repo information mentioned below based on your OS, - - **Ubuntu 16.04** - - **deb http://deb.torproject.org/torproject.org xenial main** -**deb-src http://deb.torproject.org/torproject.org xenial main** - - **Ubuntu 14.04** - - **deb http://deb.torproject.org/torproject.org trusty main** -**deb-src http://deb.torproject.org/torproject.org trusty main** - -Next open the terminal & execute the following two commands to add the gpg keys used to sign the packages, - - **$ gpg -keyserver keys.gnupg.net -recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89** -**$ gpg -export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -** - -Now run update & install the Tor network, - - **$ sudo apt-get update** -**$ sudo apt-get install tor deb.torproject.org-keyring** - -### Debian - -We can install Tor network on Debian without having to add any repositories. Just open the terminal & execute the following command as root, - - **$ apt install tor** - -### - -### Tor Configuration - -If your end game is only to secure the internet browsing & not anything else, than its better you use Tor Browser but if you need to secure your apps like Instant Messaging, IRC, Jabber etc than we need to configure those apps for secure communication. But Before we do that, let's check out some [**warning mentioned on Tor Website**][2] - -- No torrents over Tor -- Don't use any browser plugins with Tor -- Use only HTTPS version of the websites -- Don't open any document downloaded through Tor while online. -- Use Tor bridges when you can - -Now to configure any app to use Tor, for example jabber; firstly select the 'SOCKS proxy' rather than using the HTTP proxy & use port number 9050 or you can also use port 9150 (used by Tor browser). - -![install tor network][4] - -You can also configure Firefox browser to be used on Tor network. Open Firefox browser & goto 'Network Proxy ' settings in 'Preferences' under 'General' tab & make the proxy entry as follows, - -![install tor network][6] - -We can now access Firefox on Tor network with complete anonymity. - -This was our tutorial on how we can install Tor network & use ti to surf the internet anonymously. Do mention you queries & suggestions in the comment box below. - - --------------------------------------------------------------------------------- - -via: http://linuxtechlab.com/learn-install-tor-network-linux/ - -作者:[Shusain][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linuxtechlab.com/author/shsuain/ -[1]:http://linuxtechlab.com/install-tor-browser-linux-ubuntu-centos/ -[2]:https://www.torproject.org/download/download.html.en#warning -[4]:https://i0.wp.com/linuxtechlab.com/wp-content/uploads/2017/12/tor-1-compressor.png?resize=333%2C240 -[6]:https://i1.wp.com/linuxtechlab.com/wp-content/uploads/2017/12/tor-2-compressor.png?resize=730%2C640 diff --git a/translated/tech/20171219 Surf anonymously- Learn to install TOR network on Linux.md b/translated/tech/20171219 Surf anonymously- Learn to install TOR network on Linux.md new file mode 100644 index 0000000000..97dc71c641 --- /dev/null +++ b/translated/tech/20171219 Surf anonymously- Learn to install TOR network on Linux.md @@ -0,0 +1,101 @@ +匿名上网:学习在 Linux 上安装 TOR 网络 +====== +Tor 网络是一个匿名网络来保护你的互联网以及隐私。Tor 网络是一组志愿者运营的服务器。Tor 通过在由志愿者运营的分布式中继系统之间跳转来保护互联网通信。这避免了人们窥探我们的网络,他们无法了解我们访问的网站或者用户身在何处,并且也可以让我们访问被屏蔽的网站。 + +在本教程中,我们将学习在各种 Linux 操作系统上安装 Tor 网络,以及如何使用它来配置我们的程序来保护通信。 + + **(推荐阅读:[如何在 Linux 上安装 Tor 浏览器(Ubuntu、Mint、RHEL、Fedora、CentOS)][1])** + +### CentOS/RHEL/Fedora + +Tor 包是 EPEL 仓库的一部分,所以如果我们安装了 EPEL 仓库,我们可以直接使用 yum 来安装 Tor。如果你需要在您的系统上安装 EPEL 仓库,请使用下列适当的命令(基于操作系统和体系结构): + + **RHEL/CentOS 7** + + **$ sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-11.noarch.rpm** + + **RHEL/CentOS 6 (64 位)** + + **$ sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm** + + **RHEL/CentOS 6 (32 位)** + + **$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm** + +安装完成后,我们可以用下面的命令安装 Tor 浏览器: + + **$ sudo yum install tor** + +### Ubuntu + +为了在 Ubuntu 机器上安装 Tor 网络,我们需要添加官方 Tor 仓库。我们需要将仓库信息添加到 “/etc/apt/sources.list” 中。 + + **$ sudo nano /etc/apt/sources.list** + +现在根据你的操作系统添加下面的仓库信息: + + **Ubuntu 16.04** + + **deb http://deb.torproject.org/torproject.org xenial main** +**deb-src http://deb.torproject.org/torproject.org xenial main** + + **Ubuntu 14.04** + + **deb http://deb.torproject.org/torproject.org trusty main** +**deb-src http://deb.torproject.org/torproject.org trusty main** + +接下来打开终端并执行以下两个命令添加用于签名软件包的 gpg 密钥: + + **$ gpg -keyserver keys.gnupg.net -recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89** +**$ gpg -export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -** + +现在运行更新并安装 Tor 网络: + + **$ sudo apt-get update** +**$ sudo apt-get install tor deb.torproject.org-keyring** + +### Debian + +我们可以无需添加任何仓库在 Debian 上安装 Tor 网络。只要打开终端并以 root 身份执行以下命令: + + **$ apt install tor** + +### + +### Tor 配置 + +如果你最终目的只是为了保护互联网浏览,而没有其他要求,直接使用 Tor 更好,但是如果你需要保护即时通信、IRC、Jabber 等程序,则需要配置这些应用程序进行安全通信。但在做之前,让我们先看看**[Tor 网站上提到的警告][2]**。 + +- 不要大流量使用 Tor +- 不要在 Tor 中使用任何浏览器插件 +- 只使用 HTTPS 版本的网站 +- 不要在线打开通过 Tor 下载的任何文档。 +- 尽可能使用 Tor 桥 + +现在配置程序来使用 Tor,例如 jabber。首先选择 “SOCKS代理” 而不是使用 HTTP 代理,并使用端口号 9050,或者也可以使用端口 9150(Tor 浏览器使用)。 + +![install tor network][4] + +你也可以配置 Firefox 浏览器使用 Tor 网络。打开 Firefox 浏览器,在“常规”选项卡的“首选项”中进入“网络代理”设置,并按以下步骤输入代理: + +![install tor network][6] + +现在你可以在 Firefox 中使用 Tor 网络完全匿名访问了。 + +这就是我们如何安装 Tor 网络并使用 Tor 浏览互联网的教程。请在下面的评论栏中提出你的问题和建议。 + +-------------------------------------------------------------------------------- + +via: http://linuxtechlab.com/learn-install-tor-network-linux/ + +作者:[Shusain][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxtechlab.com/author/shsuain/ +[1]:http://linuxtechlab.com/install-tor-browser-linux-ubuntu-centos/ +[2]:https://www.torproject.org/download/download.html.en#warning +[4]:https://i0.wp.com/linuxtechlab.com/wp-content/uploads/2017/12/tor-1-compressor.png?resize=333%2C240 +[6]:https://i1.wp.com/linuxtechlab.com/wp-content/uploads/2017/12/tor-2-compressor.png?resize=730%2C640 From a6804a683ab5bcc2a5ac5b266c56a8ffad744225 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 29 Dec 2017 08:58:15 +0800 Subject: [PATCH 051/133] translating --- .../20171123 Check Cryptocurrency Prices From Commandline.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20171123 Check Cryptocurrency Prices From Commandline.md b/sources/tech/20171123 Check Cryptocurrency Prices From Commandline.md index a6faf7a2c1..4a7e85ce0c 100644 --- a/sources/tech/20171123 Check Cryptocurrency Prices From Commandline.md +++ b/sources/tech/20171123 Check Cryptocurrency Prices From Commandline.md @@ -1,3 +1,5 @@ +translating---geekpi + Check Cryptocurrency Prices From Commandline ====== ![配图](https://www.ostechnix.com/wp-content/uploads/2017/11/bitcoin-1-720x340.jpg) From 3ba62c94fbaa90c158da1ae4bf3430b2fd39f78a Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 15:12:26 +0800 Subject: [PATCH 052/133] translate done: 20171128 A generic introduction to Gitlab CI.md --- ...128 A generic introduction to Gitlab CI.md | 130 ------------------ ...128 A generic introduction to Gitlab CI.md | 129 +++++++++++++++++ 2 files changed, 129 insertions(+), 130 deletions(-) delete mode 100644 sources/tech/20171128 A generic introduction to Gitlab CI.md create mode 100644 translated/tech/20171128 A generic introduction to Gitlab CI.md diff --git a/sources/tech/20171128 A generic introduction to Gitlab CI.md b/sources/tech/20171128 A generic introduction to Gitlab CI.md deleted file mode 100644 index 1c1e985232..0000000000 --- a/sources/tech/20171128 A generic introduction to Gitlab CI.md +++ /dev/null @@ -1,130 +0,0 @@ -translating by lujun9972 -A generic introduction to Gitlab CI -====== -At [fleetster][1] we have our own instance of [Gitlab][2] and we rely a lot on [Gitlab CI][3]. Also our designers and QA guys use (and love) it, thanks to its advanced features. - -Gitlab CI is a very powerful system of Continuous Integration, with a lot of different features, and with every new releases, new features land. It has a very rich technical documentation, but it lacks a generic introduction for whom want to use it in an already existing setup. A designer or a tester doesn't need to know how to autoscale it with Kubernetes or the difference between an `image` or a `service`. - -But still, he needs to know what is a **pipeline** , and how to see a branch deployed to an **environment**. In this article therefore I will try to cover as many features as possible, highlighting how the end users can enjoy them; in the last months I explained such features to some members of our team, also developers: not everyone knows what Continuous Integration is or has used Gitlab CI in a previous job. - -If you want to know why Continuous Integration is important I suggest to read [this article][4], while for finding the reasons for using Gitlab CI specifically, I leave the job to [Gitlab.com][3] itself. - -### Introduction - -Every time a developer changes some code he saves his changes in a **commit**. He can then push that commit to Gitlab, so other developers can review the code. - -Gitlab will also start some work on that commit, if the Gitlab CI has been configured. This work is executed by a **runner**. A runner is basically a server (it can be a lot of different things, also your PC, but we can simplify it as a server) that executes instructions listed in the `.gitlab-ci.yml` file, and reports the result back to Gitlab itself, which will show it in his graphical interface. - -When a developer has finished implementing a new feature or a bugfix (activity that usual requires multiple commits), can open a **merge request** , where other member of the team can comment on the code and on the implementation. - -As we will see, also designers and testers can (and really should!) join this process, giving feedbacks and suggesting improvements, especially thanks to two features of Gitlab CI: **environments** and **artifacts**. - -### Pipelines - -Every commit that is pushed to Gitlab generates a **pipeline** attached to that commit. If multiple commits are pushed together the pipeline will be created only for the last of them. A pipeline is a collection of **jobs** split in different **stages**. - -All the jobs in the same stage run in concurrency (if there are enough runners) and the next stage begins only if all the jobs from the previous stage have finished with success. - -As soon as a job fails, the entire pipeline fails. There is an exception for this, as we will see below: if a job is marked as manual, then a failure will not make the pipeline fails. - -The stages are just a logic division between batches of jobs, where doesn't make sense to execute next jobs if the previous failed. We can have a `build` stage, where all the jobs to build the application are executed, and a `deploy` stage, where the build application is deployed. Doesn't make much sense to deploy something that failed to build, does it? - -Every job shouldn't have any dependency with any other job in the same stage, while they can expect results by jobs from a previous stage. - -Let's see how Gitlab shows information about stages and stages' status. - -![pipeline-overview][5] - -![pipeline-status][6] - -### Jobs - -A job is a collection of instructions that a runner has to execute. You can see in real time what's the output of the job, so developers can understand why a job fails. - -A job can be automatic, so it starts automatically when a commit is pushed, or manual. A manual job has to be triggered by someone manually. Can be useful, for example, to automatize a deploy, but still to deploy only when someone manually approves it. There is a way to limit who can run a job, so only trustworthy people can deploy, to continue the example before. - -A job can also build **artifacts** that users can download, like it creates an APK you can download and test on your device; in this way both designers and testers can download an application and test it without having to ask for help to developers. - -Other than creating artifacts, a job can deploy an **environment** , usually reachable by an URL, where users can test the commit. - -Job status are the same as stages status: indeed stages inherit theirs status from the jobs. - -![running-job][7] - -### Artifacts - -As we said, a job can create an artifact that users can download to test. It can be anything, like an application for Windows, an image generated by a PC, or an APK for Android. - -So you are a designer, and the merge request has been assigned to you: you need to validate the implementation of the new design! - -But how to do that? - -You need to open the merge request, and download the artifact, as shown in the figure. - -Every pipeline collects all the artifacts from all the jobs, and every job can have multiple artifacts. When you click on the download button, it will appear a dropdown where you can select which artifact you want. After the review, you can leave a comment on the MR. - -You can always download the artifacts also from pipelines that do not have a merge request open ;-) - -I am focusing on merge request because usually is where testers, designer, and shareholder in general enter the workflow. - -But merge requests are not linked to pipelines: while they integrate nice one in the other, they do not have any relation. - -![download-artifacts][8] - -### Environments - -In a similar way, a job can deploy something to an external server, so you can reach it through the merge request itself. - -As you can see the environment has a name and a link. Just clicking the link you to go to a deployed version of your application (of course, if your team has setup it correctly). - -You can click also on the name of the environment, because Gitlab has also other cool features for environments, like [monitoring][9]. - -![environment][10] - -### Conclusion - -This was a small introduction to some of the features of Gitlab CI: it is very powerful, and using it in the right way allows all the team to use just one tool to go from planning to deploying. A lot of new features are introduced every month, so keep an eye on the [Gitlab blog][11]. - -For setting it up, or for more advanced features, take a look to the [documentation][12]. - -In fleetster we use it not only for running tests, but also for having automatic versioning of the software and automatic deploys to testing environments. We have automatized other jobs as well (building apps and publish them on the Play Store and so on). - -Speaking of which, **do you want to work in a young and dynamically office with me and a lot of other amazing guys?** Take a look to the [open positions][13] at fleetster! - -Kudos to the Gitlab team (and others guys who help in their free time) for their awesome work! - -If you have any question or feedback about this blog post, please drop me an email at [riccardo@rpadovani.com][14] or [tweet me][15] :-) Feel free to suggest me to add something, or to rephrase paragraphs in a clearer way (English is not my mother tongue). - -Bye for now, -R. - -P.S: if you have found this article helpful and you'd like we write others, do you mind to help us reaching the [Ballmer's peak][16] and [buy me][17] a beer? - --------------------------------------------------------------------------------- - -via: https://rpadovani.com/introduction-gitlab-ci - -作者:[Riccardo][a] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://rpadovani.com -[1]:https://www.fleetster.net -[2]:https://gitlab.com/ -[3]:https://about.gitlab.com/gitlab-ci/ -[4]:https://about.gitlab.com/2015/02/03/7-reasons-why-you-should-be-using-ci/ -[5]:https://img.rpadovani.com/posts/pipeline-overview.png -[6]:https://img.rpadovani.com/posts/pipeline-status.png -[7]:https://img.rpadovani.com/posts/running-job.png -[8]:https://img.rpadovani.com/posts/download-artifacts.png -[9]:https://gitlab.com/help/ci/environments.md -[10]:https://img.rpadovani.com/posts/environment.png -[11]:https://about.gitlab.com/ -[12]:https://docs.gitlab.com/ee/ci/README.html -[13]:https://www.fleetster.net/fleetster-team.html -[14]:mailto:riccardo@rpadovani.com -[15]:https://twitter.com/rpadovani93 -[16]:https://www.xkcd.com/323/ -[17]:https://rpadovani.com/donations diff --git a/translated/tech/20171128 A generic introduction to Gitlab CI.md b/translated/tech/20171128 A generic introduction to Gitlab CI.md new file mode 100644 index 0000000000..41dcc5d359 --- /dev/null +++ b/translated/tech/20171128 A generic introduction to Gitlab CI.md @@ -0,0 +1,129 @@ +Gitlab CI 漫谈 +====== +我们在 [fleetster][1] 中搭建了自己的 [Gitlab][2] 实例,而且我们大量使用了 [Gitlab CI][3]。而且我们的设计师和 QA 也都在用它,也很喜欢用它,它的那些高级功能特别棒。 + +Gitlab CI 是一个功能非常强大的持续集成系统,有很多不同的功能,而且每次发布都会增加新的功能。它的技术文档也很丰富,但是它缺乏一个面向使用已经配置好的 Gitlab 用户的一般性的介绍。一个设计师或者测试人员是无需知道如何通过 Kubernetes 来实现自动伸缩,也无需知道`镜像`和`服务`之间的不同的。 + +但是,他仍然需要知道什么是`管道`,如何查看部署到一个`环境`中的分支。因此,在本文中,我会尽可能覆盖更多的功能,关注最终用户应该如何使用 Gitlab; 在过去的几个月里,我向我们团队中的某些人包括开发者讲解了这些功能:不是所有人都知道持续集成是个什么东西,也不是所有人都用过 Gitlab CI。 + +如果你想了解为什么持续集成那么重要,我建议阅读一下 [这篇文章 ][4],至于为什么要选择 Gitlab CI 呢,你可以去看看 [Gitlab.com][3] 上的说明。 + +### 简介 + +开发者保存更改代码的动作叫做一次`提交`。然后他可以将这次提交推送到 Gitlab 上,这样可以其他开发者就可以复查这些代码了。 + +Gitlab CI 配置好后,Gitlab 也能对这个提交做出一些处理。该处理的工作由一个 `runner` 来执行。所谓 runner 一本上就是一台服务器(也可以是其他的东西,比如你的 PC 机,但我们只是简单的把它看成是一台服务器)。这台服务器执行 `.gitlab-ci.yml` 文件中指令并将执行结果返回给 Gitlab 本身,然后在 Gitlab 的图形化界面上显示出来。 + +开发者完成一项新功能的开发或完成一个 bug 的修复后(这些动作通常包含了多次的提交),就可以发起一个 `合并请求`,团队其他成员则可以在这个合并请求中对代码和实现进行评论。 + +我们随后会看到,由于 Gitlab CI 提供的两大特性,`environments` 与 `artifacts`,使得设计者和测试人员也能(而且真的需要!)参与到这个过程中来,提供反馈以及改进意见。 + +### 管道 (Pipelines) + +每个推送到 Gitlab 的提交都会产生一个与该提交关联的`管道`。若一次推送包含了多个提交,则管道与最后那个提交相关联。一个管道就是一个分`阶段`的`作业`的集合。 + +同一阶段的所有作业会并发执行(在有足够 runner 的前提下),而下一阶段则只会在上一阶段所有作业都运行并返回成功后才会开始。 + +只要有一个作业失败了,整个管道就失败了。不过我们后面会看到,这其中有一个例外:若某个作业被标注成了手工运行,那么即使失败了也不会让整个管道失败。 + +阶段则只是对作业批量集合间的一个逻辑上的划分,若前一个任务集合执行失败了,则后一个执行也没什么意义了。比如我们可能有一个`构建`阶段和一个`部署`阶段,在这`构建`阶段运行所有用于构建应用的作业,而在`部署`阶段,会部署构建出来的应用程序。而部署一个构建失败的东西是没有什么意义的,不是吗? + +同一阶段的作业之间不能有依赖关系,但他们可以依赖于前一阶段的作业运行结果。 + +让我们来看一下 Gitlab 是如何展示阶段与阶段状态的相关信息的。 + +![pipeline-overview][5] + +![pipeline-status][6] + +### 作业 + +作业就是 runner 执行的指令集合。你可以实时地看到作业的输出结果,这样开发者就能知道作业为什么失败了。 + +作业可以是自动执行的,也就是当推送提交后自动开始执行,也可以手工执行。手工作业必须由某个人手工触发。手工作业也有其独特的作用,比如,实现自动化部署,但只有在有人手工授权的情况下才能开始部署。这是限制哪些人可以运行作业的一种方式,这样只有信赖的人才能进行部署,to continue the example before。 + +作业也可以建构出 `制品 (artifacts)` 来以供用户下载,比如可以构建出一个 APK 让你来下载,然后在你的设备中进行测试; 通过这种方式,设计者和测试人员都可以下载应用并进行测试,而无需开发人员的帮助。 + +除了生成制品外,作业也可以部署`环境`,通常这个环境可以通过 URL 访问,让用户来测试对应的提交。 + +做作业状态与阶段状态是一样的:实际上,阶段的状态就是继承自作业的。 + +![running-job][7] + +### 制品 (Artifacts) + +如前所述,作业能够生成制品供用户下载来测试。这个制品可以是任何东西,比如 windows 上的应用程序,PC 生成的图片,甚至 Android 上的 APK。 + +那么,假设你是个设计师,被分配了一个合并请求:你需要验证新设计的实现! + +要改怎么做呢? + +你需要打开该合并请求,下载制品,如图所示。 + +每个管道从所有作业中搜集所有的制品,而且一个作业中可以有多个制品。当你点击下载按钮时,会有一个下拉框让你选择下载哪个制品。检查之后你就可以评论这个合并请求了。 + +你也可以从没有合并请求的管道中下载制品 ;-) + +我之所以关注合并请求是因为通常这正是测试人员,设计师和股东开始工作的地方。 + +但是这并不意味着合并请求和管道就是绑死在一起的:虽然他们结合的很好,但两者之间并没有什么关系。 + +![download-artifacts][8] + +### 环境 + +类似的,作业可以将某些东西部署到外部服务器上去,似的可以通过合并请求本身访问这些内容。 + +如你所见,环境有一个名字和一个链接。只需点击链接你就能够转至应用的部署版本上去了(当前,前提是配置是正确的)。 + +Gitlab 还有其他一些很酷的环境相关的特性,比如 [监控 ][9],你可以通过点击环境的名字来查看。 + +![environment][10] + +### 总结 + +这是对 Gitlab CI 中某些功能的一个简单介绍:它非常强大,使用得当的话,可以让整个团队使用一个工具完成从计划到部署的工具。由于每个月都会推出很多新功能,因此请时刻关注 [Gitlab 博客 ][11]。 + +若想知道如何对它进行设置或想了解它的高级功能,请参阅它的[文档 ][12]。 + +在 fleetster 中,我们不仅用它来跑测试,而且用它来自动生成各种版本的软件,并自动发布到测试环境中去。我们也自动化了其他工作(构建应用并将之发布到 Play Store 中等其他工作)。 + +说起来,**你是否想和我以及其他很多超棒的人一起在一个年轻而又富有活力的办公室中工作呢?** 看看 fleetster 的这些[开放职位 ][13] 吧! + +赞美 Gitlab 团队 (和其他在空闲时间提供帮助的人),他们的工作太棒了! + +若对本文有任何问题或回馈,请给我发邮件:[riccardo@rpadovani.com][14] 或者[发推给我 ][15]:-) 你可以建议我增加内容,或者以更清晰的方式重写内容(英文不是我的母语)。 + +那么,再见吧, +R。 + +P.S:如果你觉得本文有用,而且希望我们写出其他文章的话,请问您是否愿意帮我[买被啤酒给我 ][17] 让我进入 [鲍尔默峰值 ][16]? + +-------------------------------------------------------------------------------- + +via: https://rpadovani.com/introduction-gitlab-ci + +作者:[Riccardo][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://rpadovani.com +[1]:https://www.fleetster.net +[2]:https://gitlab.com/ +[3]:https://about.gitlab.com/gitlab-ci/ +[4]:https://about.gitlab.com/2015/02/03/7-reasons-why-you-should-be-using-ci/ +[5]:https://img.rpadovani.com/posts/pipeline-overview.png +[6]:https://img.rpadovani.com/posts/pipeline-status.png +[7]:https://img.rpadovani.com/posts/running-job.png +[8]:https://img.rpadovani.com/posts/download-artifacts.png +[9]:https://gitlab.com/help/ci/environments.md +[10]:https://img.rpadovani.com/posts/environment.png +[11]:https://about.gitlab.com/ +[12]:https://docs.gitlab.com/ee/ci/README.html +[13]:https://www.fleetster.net/fleetster-team.html +[14]:mailto:riccardo@rpadovani.com +[15]:https://twitter.com/rpadovani93 +[16]:https://www.xkcd.com/323/ +[17]:https://rpadovani.com/donations From d0d04610cca4110bdcb8b60a72be8862f2b1d63c Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 15:30:39 +0800 Subject: [PATCH 053/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20GParted=20The=20C?= =?UTF-8?q?omplete=20Partition=20Editor=20For=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...The Complete Partition Editor For Linux.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20171120 GParted The Complete Partition Editor For Linux.md diff --git a/sources/tech/20171120 GParted The Complete Partition Editor For Linux.md b/sources/tech/20171120 GParted The Complete Partition Editor For Linux.md new file mode 100644 index 0000000000..dac93eb39d --- /dev/null +++ b/sources/tech/20171120 GParted The Complete Partition Editor For Linux.md @@ -0,0 +1,111 @@ +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gparted-the-complete-partition-editor-for-linux_orig.jpg) +**Partition editing**is a task which not only requires carefulness but also a stable environment. Today GParted is one of the leading partition editing tools on Linux environment. + +**GParted**is not only easy but also remains powerful at the same time. Today I am going to list out the installation as well as basics to use GParted which will be helpful to newbies. + +### How to install GParted? + +​Downloading and installing gparted is not a much difficult task. Today GParted is available on almost all distros and can be easily installed from their specific software center. Just go to software center and search “GParted” or use command line package manager to install it. + + [![install gparted from software center](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-gparted-from-software-center_orig.jpg)][1] In case you don’t have a software center or GParted isn’t available on software center you can always grab it from its official website.[Download][2] + +#### The Basics + +​Using GParted isn’t difficult. When I opened it for the first time 3 years ago, sure I was confused for a moment but I was quickly able to use it. Launching GParted requires admin privileges so it requires your password for launching. This is normal. + + [![type password to provide for admin privileges](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/type-password-to-provide-for-admin-privileges_orig.png)][3] + +​Below is the screen that GParted will display when you launch it the first time i.e. all your partitions of the hard disk (It will differ PC to PC). + + [![gparted user interface in linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gparted-user-interface-in-linux_orig.png)][4] + +​The screen presented is not only simple but also effective. You will see that from left to right it displays address of the partition, type of partition, the mount point ( “/” indicates root), Label of partition (In case you name your partitions like I do), total size of partition and capacity used and unused as well as flags (never ever touch a partition with a flag unless you know what you are doing). The key sign in front of file systems indicates that the partition is currently mounted means used by the system. Right-click and select “unmount” to unmount it. + +You can see that it displays all sorts of information that you need to know about a particular partition you want to mess with. The bar with filled and unfilled portion indicates your hard disk. Also a simple thing “dev/sda” goes for hard disk while “dev/sdb” goes for your removable drives mostly flash drives (differs). + +You can change working on drives by clicking on the box at top right corner saying “dev/sda”. The tweaks you want are available on different options at the menu bar. + + [![edit usb partition in gparted](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edit-usb-partition-in-gparted_orig.png)][5] + +​This is my flash drive which I switched using the top right corner box as I told above. See it now indicates different details. Also as my drive is based on different format the color of bar changed. This is a really helpful feature as it indicates that partition changes if color differs. Editing external drives is also same as editing internal. + +#### Tweaking The Partitions + +Tweaking partition requires your full attention as this is somewhat risky because if it's done wrong, you will destroy your data. Keeping this point in mind proceed. + +Select a partition you want to work on rather it is on hard drive or flash drive is non-relevant. If the partition is mounted, unmount it. After unmounting the editing options will become available. + + [![gparted menu bar](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gparted-menu-bar_orig.png)][6] + +This options can be accessed by menu bar or right mouse button too. The first option is for creating a new partition, the second one to delete, third one to resize partition, the fourth one to copy, fifth to paste. The last options are important as the second last is to revert changes and the last one is to apply changes. + +GParted doesn’t make changes in real time but keeps track of changes done by you. So you can easily revert a change if it is caused by mistake. Lastly, you can apply it and save changes. + +​Now let’s come to editing part. + +Let us assume you want to create a new partition by deleting existing one. Select partition of your choice hit the delete key and it will be deleted. Now for creating a new partition select that first option on the menu bar that indicates “new”. + +You will get the following options. + + [![create new partition with gparted](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/create-new-partition-with-gparted_orig.png)][7] + +​Here you can easily resize the partition by either entering values manually or drag the bar. If you want to change alignment do it with align option. You can choose whether to keep partition primary or secondary by option “create as”. Name the partition in Label and choose the appropriate file system. In case you want to access this partition on other OS like windows better use “ + +[NTFS][8] + +” format. + +There are times when data partition table is hampered. GParted handles this thing well too. There is the option to create new data partition table under device option. Remember creating data partition will destroy present data. + + [![select table type in gparted](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/select-table-type-in-gparted_orig.jpg)][9] + +​But what to do when you already having a pen drive on which you want to do data rescue? Gparted helps here too. Reach data rescue option under device section from the menu bar. This option requires the installation of additional components that can be accessed from software center. + + [![scan disk partition in gparted](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/scan-disk-partition-in-gparted_orig.jpg)][10] + +​You can also align flags to certain partition by option “flags”. Remember not to mess with flags unless you know what you are doing. There are a lot of other tweaks too to explore and use. Do that but remember mess with something unless you know what you are doing. + +#### Applying Tweaks + + [![apply changes to disk in gparted partition editor](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/apply-changes-to-disk-in-gparted-partition-editor_orig.png)][11] + +​After you have done tweaking you need to apply them. This could be done by using apply option I mentioned above. It will give you a warning. Check out if everything is proper before applying and proceed the warning to apply tweaks and your changes are done. Enjoy!. + +#### Other Features + +​Gparted offers live environment image files to boot and repair partitions in case of something wrong that can be downloaded from the website. GParted also shows tweaks it can do on your system, partition information and many others. Remember options will be differently available as per system. + + [![file system support in gparted](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/file-system-support-in-gparted_orig.png)][12] + +### Conclusion + +​Here we reach the end of my long article. + +**GParted**is a really nice, powerful software that has great capabilities. There is also a nice community on _GParted_ that will surely help you in case you come across a bug or doubt in which we [LinuxAndUbuntu][13]are too included. The power of GParted will help you to do almost all partition related task but you should be careful about what you are doing. + +Remember to always check out in the last what you are applying and is it right or not. In case you run across a problem don’t hesitate to comment and ask as we are always willing to help you. + +-------------------------------------------------------------------------------- + +via: http://www.linuxandubuntu.com/home/gparted-the-complete-partition-editor-for-linux + +作者:[ ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxandubuntu.com +[1]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-gparted-from-software-center_orig.jpg +[2]:http://gparted.org/download.php +[3]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/type-password-to-provide-for-admin-privileges_orig.png +[4]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gparted-user-interface-in-linux_orig.png +[5]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edit-usb-partition-in-gparted_orig.png +[6]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gparted-menu-bar_orig.png +[7]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/create-new-partition-with-gparted_orig.png +[8]:http://www.linuxandubuntu.com/home/fdisk-command-to-manage-disk-partitions-in-linux +[9]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/select-table-type-in-gparted_orig.jpg +[10]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/scan-disk-partition-in-gparted_orig.jpg +[11]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/apply-changes-to-disk-in-gparted-partition-editor_orig.png +[12]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/file-system-support-in-gparted_orig.png +[13]:http://www.linuxandubuntu.com/ From a220a4354f7615084820b3d767ed0f84942ab514 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 15:31:45 +0800 Subject: [PATCH 054/133] add done: 20171120 GParted The Complete Partition Editor For Linux.md --- ...171120 GParted The Complete Partition Editor For Linux.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/tech/20171120 GParted The Complete Partition Editor For Linux.md b/sources/tech/20171120 GParted The Complete Partition Editor For Linux.md index dac93eb39d..e6ab0e9c2c 100644 --- a/sources/tech/20171120 GParted The Complete Partition Editor For Linux.md +++ b/sources/tech/20171120 GParted The Complete Partition Editor For Linux.md @@ -1,3 +1,6 @@ +GParted The Complete Partition Editor For Linux +====== + ![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gparted-the-complete-partition-editor-for-linux_orig.jpg) **Partition editing**is a task which not only requires carefulness but also a stable environment. Today GParted is one of the leading partition editing tools on Linux environment. @@ -89,7 +92,7 @@ Remember to always check out in the last what you are applying and is it right o via: http://www.linuxandubuntu.com/home/gparted-the-complete-partition-editor-for-linux -作者:[ ][a] +作者:[LinuxAndUbuntu][a] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) From 0dcf133dd4b26d450e8ee867fce511f6c25e8535 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 16:11:12 +0800 Subject: [PATCH 055/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20use=20?= =?UTF-8?q?special=20permissions:=20the=20setuid,=20setgid=20and=20sticky?= =?UTF-8?q?=20bits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ons- the setuid, setgid and sticky bits.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20171120 How to use special permissions- the setuid, setgid and sticky bits.md diff --git a/sources/tech/20171120 How to use special permissions- the setuid, setgid and sticky bits.md b/sources/tech/20171120 How to use special permissions- the setuid, setgid and sticky bits.md new file mode 100644 index 0000000000..ab38f8856a --- /dev/null +++ b/sources/tech/20171120 How to use special permissions- the setuid, setgid and sticky bits.md @@ -0,0 +1,103 @@ +How to use special permissions: the setuid, setgid and sticky bits +====== + +### Objective + +Getting to know how special permissions works, how to identify and set them. + +### Requirements + + * Knowledge of the standard unix/linux permissions system + +### Difficulty + +EASY + +### Conventions + + * **#** \- requires given command to be executed with root privileges either directly as a root user or by use of `sudo` command + * **$** \- given command to be executed as a regular non-privileged user + + + +### Introduction + +Normally, on a unix-like operating system, the ownership of files and directories is based on the default `uid` (user-id) and `gid` (group-id) of the user who created them. The same thing happens when a process is launched: it runs with the effective user-id and group-id of the user who started it, and with the corresponding privileges. This behavior can be modified by using special permissions. + +### The setuid bit + +When the `setuid` bit is used, the behavior described above it's modified so that when an executable is launched, it does not run with the privileges of the user who launched it, but with that of the file owner instead. So, for example, if an executable has the `setuid` bit set on it, and it's owned by root, when launched by a normal user, it will run with root privileges. It should be clear why this represents a potential security risk, if not used correctly. + +An example of an executable with the setuid permission set is `passwd`, the utility we can use to change our login password. We can verify that by using the `ls` command: +``` + +ls -l /bin/passwd +-rwsr-xr-x. 1 root root 27768 Feb 11 2017 /bin/passwd + +``` + +How to identify the `setuid` bit? As you surely have noticed looking at the output of the command above, the `setuid` bit is represented by an `s` in place of the `x` of the executable bit. The `s` implies that the executable bit is set, otherwise you would see a capital `S`. This happens when the `setuid` or `setgid` bits are set, but the executable bit is not, showing the user an inconsistency: the `setuid` and `setgit` bits have no effect if the executable bit is not set. The setuid bit has no effect on directories. + +### The setgid bit + +Unlike the `setuid` bit, the `setgid` bit has effect on both files and directories. In the first case, the file which has the `setgid` bit set, when executed, instead of running with the privileges of the group of the user who started it, runs with those of the group which owns the file: in other words, the group ID of the process will be the same of that of the file. + +When used on a directory, instead, the `setgid` bit alters the standard behavior so that the group of the files created inside said directory, will not be that of the user who created them, but that of the parent directory itself. This is often used to ease the sharing of files (files will be modifiable by all the users that are part of said group). Just like the setuid, the setgid bit can easily be spotted (in this case on a test directory): +``` + +ls -ld test +drwxrwsr-x. 2 egdoc egdoc 4096 Nov 1 17:25 test + +``` + +This time the `s` is present in place of the executable bit on the group sector. + +### The sticky bit + +The sticky bit works in a different way: while it has no effect on files, when used on a directory, all the files in said directory will be modifiable only by their owners. A typical case in which it is used, involves the `/tmp` directory. Typically this directory is writable by all users on the system, so to make impossible for one user to delete the files of another one, the sticky bit is set: +``` + +$ ls -ld /tmp +drwxrwxrwt. 14 root root 300 Nov 1 16:48 /tmp + +``` + +In this case the owner, the group, and all other users, have full permissions on the directory (read, write and execute). The sticky bit is identifiable by a `t` which is reported where normally the executable `x` bit is shown, in the "other" section. Again, a lowercase `t` implies that the executable bit is also present, otherwise you would see a capital `T`. + +### How to set special bits + +Just like normal permissions, the special bits can be assigned with the `chmod` command, using the numeric or the `ugo/rwx` format. In the former case the `setuid`, `setgid`, and `sticky` bits are represented respectively by a value of 4, 2 and 1. So for example if we want to set the `setgid` bit on a directory we would execute: +``` +$ chmod 2775 test +``` + +With this command we set the `setgid` bit on the directory, (identified by the first of the four numbers), and gave full privileges on it to it's owner and to the user that are members of the group the directory belongs to, plus read and execute permission for all the other users (remember the execute bit on a directory means that a user is able to `cd` into it or use `ls` to list its content). + +The other way we can set the special permissions bits is to use the ugo/rwx syntax: +``` +$ chmod g+s test +``` + +To apply the `setuid` bit to a file, we would have run: +``` +$ chmod u+s file +``` + +While to apply the sticky bit: +``` +$ chmod o+t test +``` + +The use of special permissions can be very useful in some situations, but if not used correctly the can introduce serious vulnerabilities, so think twice before using them. + +-------------------------------------------------------------------------------- + +via: https://linuxconfig.org/how-to-use-special-permissions-the-setuid-setgid-and-sticky-bits + +作者:[Egidio Docile][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://linuxconfig.org From 227c30a4a53f65fbcde777512ca41884e8d327a2 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 16:15:13 +0800 Subject: [PATCH 056/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Run=20?= =?UTF-8?q?Diablo=20II=20with=20the=20GLIDE-to-OpenGL=20Wrapper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...blo II with the GLIDE-to-OpenGL Wrapper.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20171120 How to Run Diablo II with the GLIDE-to-OpenGL Wrapper.md diff --git a/sources/tech/20171120 How to Run Diablo II with the GLIDE-to-OpenGL Wrapper.md b/sources/tech/20171120 How to Run Diablo II with the GLIDE-to-OpenGL Wrapper.md new file mode 100644 index 0000000000..63c079be6e --- /dev/null +++ b/sources/tech/20171120 How to Run Diablo II with the GLIDE-to-OpenGL Wrapper.md @@ -0,0 +1,99 @@ +How to Run Diablo II with the GLIDE-to-OpenGL Wrapper +====== +**[Diablo II][1] is usually a breeze to run on Linux, thanks to WINE and so often times you need no special tricks. However, if you're like me and experience a few glitches and washed out colours in the standard fullscreen mode, you have two options: run the game in windowed mode and go without cinematics, or install a GLIDE-OpenGL wrapper and get the game running properly in its fullscreen glory again, without the glitches and colour problems. I detail how to do that in this article.** + +Yes, that's right, unless you run Diablo II in fullscreen, the cinematics won't work for some reason! I'm fairly sure this happens even on Windows if the game is in windowed mode, so while it's a curious side effect, it is what it is. And this is a game from 2001 we're talking about! + +Old or not though, Diablo II is undoubtedly one of my favourite games of all time. While not exactly Linux related (the game itself has never had a Linux port), I've sunk countless hours into the game in years past. So it's very pleasing to me that the game is very easily playable in Linux using WINE and generally from what I've known the game has needed little to no modification to run properly in WINE. However, it seems since the patches released in the last couple of years that Blizzard removed DirectDraw as a video rendering option from the game for some reason, leaving the game with just one option - Direct3D. Which seems to be the culprit of the fullscreen issues, which apparently even happens on modern Windows machines, so we're not even necessarily talking about a WINE issue here. + +For any users running into the fullscreen glitches and washed out colour palette, as long as you don't care about in-game cinematics and playing the game in a small 800x600 (the game's maximum resolution) window, you could just run the game in windowed mode (with the `-w` switch) and it will work fine. + +Example: +``` +wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Diablo\ II/Game.exe -w +``` + +However, again, no cinematics here. Which may not bother you, but for mine the movies are one of the great and memorable aspects of Diablo II. Thankfully, there is a way to get the game running fullscreen correctly, with working movies, and plus the technique also gets the game running in it's original 4:3 aspect ratio, instead of the weird stretched out 16:9 state it does by default. Again, this may not be your preference, but personally I like it! Let's get to it. + +### The GLIDE to OpenGL wrapper + +Okay, so we said that the game only has one video mode now, that being Direct3D. Well, that's not completely true - the game still has the ancient GLIDE/3DFX mode available and gamers for years have known that for whatever reason, Diablo II actually runs better with GLIDE than Direct3D for hardware that supports it. + +Problem is... no modern video cards actually support the now defunct GLIDE anymore and 3DFX (the company) was taken over long ago by NVIDIA, so the whole thing kind of went the way of the dodo. Running the game with the `-3dfx` switch by default will only net you a crash to desktop (sad face). + +Thankfully, there is a wrapper available, seemingly made specifically for Diablo II, that actually translates the GLIDE interface to OpenGL. And being Linux users, OpenGL certainly suits us. + +So, assuming you have the game installed and fully patched (seriously, it's pretty much just click and install with WINE, exactly as you would in Windows. It's easy), you'll want to download the [GLIDE3-to-OpenGL-Wrapper by Sven Labusch][2]. + +Extract the files from the downloaded archive to your Diablo II game folder (eg. `~/.wine/drive_c/Program Files (x86)/Diablo II/`) + +The following is [from a forum guide][3] originally for Windows users, but it worked fine for me on Linux as well. The first two steps you should have already done, but then follow the instructions to configure the wrapper. You'll obviously have to make sure that glide-init.exe is executed with WINE. + +> 1) download GLIDE WRAPPER ( ). +> 2) extract file in the Diablo 2 folder, where the 'Diablo II.exe' is. +> 3) launch glide-init.exe. +> 4) Click on 'English/Deutsch' to change the language to english. +> 5) Click on 'OpenGL Info', then 'Query OpenGL info', wait for the query to finish. +> 6) Click on 'Setting': +> -uncheck 'windows-mode'. +> -check 'captured mouse'. +> -uncheck 'keep aspect ratio'. +> -uncheck 'vertical synchronization'. +> -select 'no' for 'fps-limit'. +> -select '1600x1200' for 'static size. +> -uncheck 'window extra'. +> -select 'auto' for 'refreshrate'. +> -check 'desktopresolution'. +> 7) Click on 'renderer': +> -select '64 mb' for 'texture-memory'. +> -select '2048x2048' for 'buffer texture size'. +> -uncheck ALL box EXCEPT 'shader-gama'. +> 8) Click on 'Extension': +> -check ALL box. +> 9) Click on 'Quit'. + +Make sure to follow that procedure exactly. + +Now, you should be able to launch the game with the `-3dfx` switch and be all good! +``` +wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Diablo\ II/Game.exe -3dfx +``` + +![][4] + +Yes, the black bars will be unavoidable with the 4:3 aspect ratio (I'm playing on a 27 inch monitor with 1080p resolution), but at least the game looks as it was originally intended. Actually playing the game I don't even notice the black borders. + +### Making the switch persistent + +If you want the game to always launch with the `-3dfx` switch, even from the applications menu shortcut, then simply open the .desktop file with your favourite text editor. + +Example (with the Lord of Destruction expansion installed): +``` +gedit .local/share/applications/wine/Programs/Diablo\ II/Diablo\ II\ -\ Lord\ of\ Destruction.desktop +``` + +And simply add the `-3dfx` switch to the end of the line beginning with " **Exec=** ". Make sure it's at the very end! And then save and exit. + +And that's it! Running the game as standard from your applications menu should start the game up in its GLIDE/OpenGL magical glory. + +Happy demon slaying! + +### About the author + +Andrew Powell is the editor and owner of The Linux Rain who loves all things Linux, gaming and everything in between. + +-------------------------------------------------------------------------------- + +via: http://www.thelinuxrain.com/articles/how-to-run-diablo-2-glide-opengl-wrapper + +作者:[Andrew Powell][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.thelinuxrain.com +[1]:http://us.blizzard.com/en-us/games/d2/ +[2]:http://www.svenswrapper.de/english/downloads.html +[3]:https://us.battle.net/forums/en/bnet/topic/20752595513 +[4]:http://www.thelinuxrain.com/content/01-articles/198-how-to-run-diablo-2-glide-opengl-wrapper/diablo2-linux.jpg From 5f8a898d8f31721c242d999000df3429536ab529 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 16:15:47 +0800 Subject: [PATCH 057/133] add done: 20171120 How to Run Diablo II with the GLIDE-to-OpenGL Wrapper.md --- ...120 How to Run Diablo II with the GLIDE-to-OpenGL Wrapper.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20171120 How to Run Diablo II with the GLIDE-to-OpenGL Wrapper.md b/sources/tech/20171120 How to Run Diablo II with the GLIDE-to-OpenGL Wrapper.md index 63c079be6e..42c08d703c 100644 --- a/sources/tech/20171120 How to Run Diablo II with the GLIDE-to-OpenGL Wrapper.md +++ b/sources/tech/20171120 How to Run Diablo II with the GLIDE-to-OpenGL Wrapper.md @@ -1,5 +1,7 @@ How to Run Diablo II with the GLIDE-to-OpenGL Wrapper ====== +![](http://www.thelinuxrain.com/content/01-articles/198-how-to-run-diablo-2-glide-opengl-wrapper/headimage.jpg) + **[Diablo II][1] is usually a breeze to run on Linux, thanks to WINE and so often times you need no special tricks. However, if you're like me and experience a few glitches and washed out colours in the standard fullscreen mode, you have two options: run the game in windowed mode and go without cinematics, or install a GLIDE-OpenGL wrapper and get the game running properly in its fullscreen glory again, without the glitches and colour problems. I detail how to do that in this article.** Yes, that's right, unless you run Diablo II in fullscreen, the cinematics won't work for some reason! I'm fairly sure this happens even on Windows if the game is in windowed mode, so while it's a curious side effect, it is what it is. And this is a game from 2001 we're talking about! From 8e63f5fade11903497c44bcf68627c1eba6b9d56 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 16:24:54 +0800 Subject: [PATCH 058/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Save=20Files=20Di?= =?UTF-8?q?rectly=20To=20Google=20Drive=20And=20Download=2010=20Times=20Fa?= =?UTF-8?q?ster?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ogle Drive And Download 10 Times Faster.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20171120 Save Files Directly To Google Drive And Download 10 Times Faster.md diff --git a/sources/tech/20171120 Save Files Directly To Google Drive And Download 10 Times Faster.md b/sources/tech/20171120 Save Files Directly To Google Drive And Download 10 Times Faster.md new file mode 100644 index 0000000000..3b48f4b47f --- /dev/null +++ b/sources/tech/20171120 Save Files Directly To Google Drive And Download 10 Times Faster.md @@ -0,0 +1,66 @@ +Save Files Directly To Google Drive And Download 10 Times Faster +====== + +![](http://www.theitstuff.com/wp-content/uploads/2017/11/Save-Files-Directly-To-Google-Drive-And-Download-10-Times-Faster.jpg) + +So recently I had to download the update package for my phone but when I started downloading it, I found it was too big in size. Approximately 1.5 GigaByte. + +[![downloading miui update from chorme][1]][1] + +Considering the download speed it would have taken me at least 1 - 1.5 hour to download that file and honestly, I didn't have much time. Now my download speed may be slow but my ISP has Google Peering. Which means that I get incredible speeds on All Google products like Google Drive, Youtube, and PlayStore. + +So I found a web-service called [savetodrive][2]. This website can save files from the web directly to your Google Drive folder. And then you can download it from your google drive which will be much faster. + +So let's see how to do it. + +### **Step 1** + +Get the Download URL of the file. Copy it to your clipboard. + +### **Step 2** + +Head over to [savetodrive][3] and click on Authenticate. + +[![savetodrive to save files to cloud drive][4]][4] + +This will ask for your permissions to use google drive. Click on Allow. + +[![http://www.zdnet.com/article/linux-totally-dominates-supercomputers/][5]][5] + +### **Step 3** + +You will see the following page again. Just enter the download link in the url box and click on Upload. + +[![savetodrive download file directly to cloud][6]][6] + +You will start seeing upload progress bar. You can see that the upload speed is 48 MBps, So it will upload my 1.5 GB file in about 30-35 seconds. Once that is done, head over to your Google Drive and you will see the uploaded file. + +[![google drive savetodrive][7]][7] + +So the file that begins with **miui** is my file that I just uploaded. Now I can download it at great speed. + +[![how to download miui update from browser][8]][8] + +Now you can see my download speed is around 5 Mbps so I will download the that file in 5-6 minutes. + +So that was it guys. I always download my files like this. The service is completely free of charge and totally amazing. + +-------------------------------------------------------------------------------- + +via: http://www.theitstuff.com/save-files-directly-google-drive-download-10-times-faster + +作者:[Rishabh Kandari][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.theitstuff.com/author/reevkandari +[1]:http://www.theitstuff.com/wp-content/uploads/2017/10/1-2-e1508771706462.png +[2]:https://savetodrive.net/ +[3]:http://www.savetodrive.net +[4]:http://www.theitstuff.com/wp-content/uploads/2017/10/3-1.png +[5]:http://www.theitstuff.com/wp-content/uploads/2017/10/authenticate-google-account.jpg +[6]:http://www.theitstuff.com/wp-content/uploads/2017/10/6-2.png +[7]:http://www.theitstuff.com/wp-content/uploads/2017/10/7-2-e1508772046583.png +[8]:http://www.theitstuff.com/wp-content/uploads/2017/10/8-e1508772110385.png From fca53a854d56c8ccf5acbfc6f90ae5ebc2b9acae Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 16:32:47 +0800 Subject: [PATCH 059/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Four=20Hidden=20C?= =?UTF-8?q?osts=20and=20Risks=20of=20Sudo=20Can=20Lead=20to=20Cybersecurit?= =?UTF-8?q?y=20Risks=20and=20Compliance=20Problems=20on=20Unix=20and=20Lin?= =?UTF-8?q?ux=20Servers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ance Problems on Unix and Linux Servers.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20171020 Four Hidden Costs and Risks of Sudo Can Lead to Cybersecurity Risks and Compliance Problems on Unix and Linux Servers.md diff --git a/sources/tech/20171020 Four Hidden Costs and Risks of Sudo Can Lead to Cybersecurity Risks and Compliance Problems on Unix and Linux Servers.md b/sources/tech/20171020 Four Hidden Costs and Risks of Sudo Can Lead to Cybersecurity Risks and Compliance Problems on Unix and Linux Servers.md new file mode 100644 index 0000000000..6acb15c7ec --- /dev/null +++ b/sources/tech/20171020 Four Hidden Costs and Risks of Sudo Can Lead to Cybersecurity Risks and Compliance Problems on Unix and Linux Servers.md @@ -0,0 +1,91 @@ +Four Hidden Costs and Risks of Sudo Can Lead to Cybersecurity Risks and Compliance Problems on Unix and Linux Servers +====== +It is always a philosophical debate as to whether to use open source software in a regulated environment. Open source software is crowd sourced, and developers from all over the world contribute to packages that are later included in Operating System distributions. In the case of ‘sudo’, a package designed to provide privileged access included in many Linux distributions, the debate is whether it meets the requirements of an organization, and to what level it can be relied upon to deliver compliance information to auditors. + +There are four hidden costs or risks that must be considered when evaluating whether sudo is meeting your organization’s cybersecurity and compliance needs on its Unix and Linux systems, including administrative, forensics and audit, business continuity, and vendor support. Although sudo is a low-cost solution, it may come at a high price in a security program, and when an organization is delivering compliance data to satisfy auditors. In this article, we will review these areas while identifying key questions that should be answered to measure acceptable levels of risk. While every organization is different, there are specific risk/cost considerations that make a strong argument for replacing sudo with a commercially-supported solution. + +### Administrative Costs + +There are several hidden administrative costs is using sudo for Unix and Linux privilege management. For example, with sudo, you also need to run a third-party automation management system (like CFEngine or Puppet) plus third party authentication modules on the box. And, if you plan to externalize the box at all, you’re going to have to replace sudo with that supplier’s version of sudo. So, you end up maintaining sudo, a third-party management system, a third-party automation system, and may have to replace it all if you want to authenticate against something external to the box. A commercial solution would help to consolidate this functionality and simplify the overall management of Unix and Linux servers. + +Another complexity with sudo is that everything is local, meaning it can be extremely time-consuming to manage as environments grow. And as we all know, time is money. With sudo, you have to rely on local systems on the server to keep logs locally, rotate them, send them to an archival environment, and ensure that no one is messing with any of the other related subsystems. This can be a complex and time-consuming process. A commercial solution would combine all of this activity together, including binary pushes and retention, upgrades, logs, archival, and more. + +Unix and Linux systems by their very nature are decentralized, so managing each host separately leads to administrative costs and inefficiencies which in turn leads to risks. A commercial solution centralizes management and policy development across all hosts, introducing enterprise level consistency and best practices to a privileged access management program. + +### Forensics & Audit Risks + +Administrative costs aside, let’s look at the risks associated with not being able to produce log data for forensic investigations. Why is this a challenge for sudo? The sudo package is installed locally on individual servers, and configuration files are maintained on each server individually. There are some tools such as Puppet or Chef that can monitor these files for changes, and replace files with known good copies when a change is detected, but those tools only work after a change takes place. These tools usually operate on a schedule, often checking once or twice per day, so if a system is compromised, or authorization files are changed, it may be several hours before the system is restored to a known good state. The question is, what can happen in those hours? + +There is currently no keystroke logging within sudo, and since any logs of sudo activity are stored locally on servers, they can be tampered with by savvy administrators. Event logs are typically collected with normal system logs, but once again, this requires additional configuration and management of these tools. When advanced users are granted administrative access on servers, it is possible that log data can be modified, or deleted, and all evidence of their activities erased with very little indication that events took place. Now, the question is, has this happened, or is it continuing to happen? + +With sudo, there is no log integrity – no chain of custody on logs – meaning logs can’t be non-repudiated and therefore can’t be used in legal proceedings in most jurisdictions. This is a significant risk to organizations, especially in criminal prosecution, termination, or other disciplinary actions. Third-party commercial solutions’ logs are tamper-proof, which is just not possible with sudo. + +Large organizations typically collect a tremendous amount of data, including system logs, access information, and other system information from all their systems. This data is then sent to a SIEM for analytics, and reporting. SIEM tools do not usually deliver real-time alerting when uncharacteristic events happen on systems, and often configuration of events is difficult and time consuming. For this reason, SIEM solutions are rarely relied upon for alerting within an enterprise environment. Here the question is, what is an acceptable delay from the time an event takes place until someone is alerted? + +Correlating log activity with other data to determine a broader pattern of abuse is also impossible with sudo. Commercial solutions gather logs into one place with searchable indices. Some commercial solutions even correlate this log data against other sources to identify uncharacteristic behavior that could be a warning that a serious security issue is afoot. Commercial solutions therefore provide greater forensic benefits than sudo. + +Another gotcha with sudo is that change management processes can’t be verified. It is always a best practice to review change records, and to validate that what was performed during the change matches the implementation that was proposed. ITIL and other security frameworks require validation of change management practices. Sudo can’t do this. Commercial solutions can do this through reviewing session command recording history and file integrity monitoring without revealing the underlying session data. + +There is no session recording with sudo. Session logs are one of the best forensic tools available for investigating what happened on servers. It’s human nature that people tend to be more cautious when they know they can be watched. Sudo doesn’t provide session recordings. + +Finally, there is no segregation of duties with sudo. Most security and compliance frameworks require true separation of duties, and using a tool such as sudo just “skins” over the segregation of duties aspect. All of these deficiencies – lack of log integrity, lack of session monitoring, no change management – introduces risk when organizations must prove compliance or investigate anomalies. + +### Business Continuity Risks + +Sudo is open source. There is no indemnification if there is a critical error. Also, there is no rollback with sudo, so there is always the chance that mistakes will bring and entire system down with no one to call for support. Sure, it is possible to centralize sudo through a third-party tool such as Puppet or CFEngine, but you still end up managing multiple files across multiple groups of systems manually (or managed as one huge policy). With this approach, there is greater risk that mistakes will break every system at once. A commercial solution would have policy roll-back capability that would limit the damage done. + +### Lack of Enterprise Support + +Since sudo is an open source package, there is no official service level for when packages must be updated to respond to identified security flaws, or vulnerabilities. By mid-2017, there have already been two vulnerabilities identified in sudo with a CVSS score greater than six (CVE Sudo Vulnerabilities). Over the past several years, there have been a number of vulnerabilities discovered in sudo that took as many as three years to patch ([CVE-2013-2776][1] , [CVE-2013-2777][2] , [CVE-2013-1776][3]). The question here is, what exploits have been used in the past several months or years? A commercial solution that replaces sudo would eliminate this problem. + +### Ten Questions to Measure Risk in Your Unix and Linux Environment + +Unix and Linux systems present high-value targets for external attackers and malicious insiders. Expect to be breached if you share accounts, provide unfettered root access, or let files and sessions go unmonitored. Gaining root or other privileged credentials makes it easy for attackers to fly under the radar and access sensitive systems and data. And as we have reviewed, sudo isn’t going to help. + +In balancing costs vs. an acceptable level of risk to your Unix and Linux environment, consider these 10 questions: + +1. How much time are Unix/Linux admins spending just trying to keep up? Can your organization benefit from automation? + +2. Are you able to keep up with the different platform and version changes to your Unix/Linux systems? + +3. As you grow and more hosts are added, how much more time will admins need to keep up with policy? Is adding personnel an option? + +4. What about consistency across systems? Modifying individual sudoers files with multiple admins makes that very difficult. Wouldn’t systems become siloed if not consistently managed? + +5. What happens when you bring in new or different Linux or Unix platforms? How will that complicate the management of the environment? + +6. How critical is it for compliance or legal purposes to know whether a policy file or log has been tampered with? + +7. Do you have a way to verify that the sudoers file hasn’t been modified without permission? + +8. How do you know what admins actually did once they became root? Do you have a command history for their activity? + +9. What would it cost the business if a mission-critical Unix/Linux host goes down? With sudo, how quickly could the team troubleshoot and fix the problem? + +10. Can you demonstrate to the board that you have a backup if there is a significant outage? + +### Benefits of Using a Commercial Solution + +Although they come at a higher cost than free open source solutions, commercial solutions provide an effective way to mitigate the general issues related to sudo. Solutions that offer centralized management ease the pressure on monitoring and maintaining remote systems, centralized logging of events, and keystroke recording are the cornerstone of audit expectations for most enterprises. + +Commercial solutions usually have a regular release cycle, and can typically deliver patches in response to vulnerabilities in hours, or days from the time they’re reported. Commercial solutions like PowerBroker for Unix & Linux by BeyondTrust provide event logging on separate infrastructure that is inaccessible to privileged users, and this eliminates the possibility of log tampering. PowerBroker also provides strong, centralized policy controls that are managed within an infrastructure separate from systems under management; this eliminates the possibility of rogue changes to privileged access policies in server environments. Strong policy control also moves security posture from ‘Respond’ to ‘Prevent’, and advanced features provide the ability to integrate with other enterprise tools, and conditionally alert when privileged access sessions begin, or end. + +### Conclusion + +For organizations that are serious about incorporating a strong privileged access management program into their security program, there is no question that a commercial product delivers much better than an open source offering such as sudo. Eliminating the possibility of malicious behavior using strong controls, centralized log file collection, and centralized policy management is far better than relying on questionable, difficult to manage controls delivered within sudo. In calculating an acceptable level of risk to your tier-1 Unix and Linux systems, all of these costs and benefits must be considered. + + +-------------------------------------------------------------------------------- + +via: http://www.linuxjournal.com/content/four-hidden-costs-and-risks-sudo-can-lead-cybersecurity-risks-and-compliance-problems-unix-a + +作者:[Chad Erbe][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxjournal.com/users/chad-erbe +[1]:https://www.cvedetails.com/cve/CVE-2013-2776/ +[2]:https://www.cvedetails.com/cve/CVE-2013-2777/ +[3]:https://www.cvedetails.com/cve/CVE-2013-1776/ From a376418dc2dcdddb4d9023bc82a21827415bf67e Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 16:38:22 +0800 Subject: [PATCH 060/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20improv?= =?UTF-8?q?e=20ROI=20on=20automation:=204=20tips?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow to improve ROI on automation- 4 tips.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20171116 How to improve ROI on automation- 4 tips.md diff --git a/sources/tech/20171116 How to improve ROI on automation- 4 tips.md b/sources/tech/20171116 How to improve ROI on automation- 4 tips.md new file mode 100644 index 0000000000..ce1c2afb45 --- /dev/null +++ b/sources/tech/20171116 How to improve ROI on automation- 4 tips.md @@ -0,0 +1,76 @@ +How to improve ROI on automation: 4 tips +====== + +![](https://enterprisersproject.com/sites/default/files/styles/620x350/public/cio_it_investments_2.png?itok=Ut1XIIBN) +Automation technologies have generated plenty of buzz during the past few years. COOs and operations teams (and indeed, other business functions) are thrilled at the prospect of being able to redefine how costs have historically increased as work volume rose. + +Robotic process automation (RPA) seems to promise the Holy Grail to operations: "Our platform provides out-of-box features to meet most of your daily process needs - checking email, saving attachments, getting data, updating forms, generating reports, file and folder operations. Building bots can be as easy as configuring these features and chaining them together, rather than asking IT to build them." It's a seductive conversation. + +Lower cost, fewer errors, better compliance with procedures - the benefits seem real and achievable to COOs and operations leaders. The fact that RPA tools promise to pay for themselves from the operational savings (with short payback periods) makes the business case even more attractive. + +Automation conversations tend to follow a similar script: COOs and their teams want to know how automating operations can benefit them. They want to know about RPA platform features and capabilities, and they want to see real-world examples of automation in action. The journey from this point to a proof-of-concept implementation is often short. + +**[ For advice on implementing AI technology, see our related article, [Crafting your AI strategy: 3 tips][1]. ]** + +But the reality of automation benefits can sometimes lag behind expectations. Companies that adopt RPA may find themselves questioning its ROI after implementation. Some express disappointment about not seeing the expected savings, and confusion as to why. + +## Are you automating the wrong things? + +What could explain the gap between the promise and reality of operational automation in these cases? To analyze this, let's explore what typically happens after the decision to proceed with an automation proof-of-concept project (or a full-blown implementation, even) has been made. + +After deciding that automation is the path to take, the COO typically asks operational leaders and their teams to decide which processes or tasks should be automated. While participation should be encouraged, this type of decision-making sometimes leads to sub-optimal choices in automation candidates. There are a few reasons for this: + +First, team leaders often have a "narrow field of deep vision:" They know their processes and tasks well, but might not be deeply familiar with those that they do not participate in (especially if they have not had wide operations exposure). This means that they are able to identify good automation candidates within their own scope of work, but not necessarily across the entire operations landscape. Softer factors like "I want my process to be picked as the first automation candidate" can also come into play. + +Second, candidate process selection can sometimes be driven by matching automation features and capabilities rather than by the value of automation. A common misunderstanding is that any task that includes activities like email or folder monitoring, downloads, calculations, etc. is automatically a good candidate for automation. If automating such tasks doesn't provide value to the organization, they are not the right candidates. + +So what can leaders do to ensure that their automation implementation delivers the ROI they are seeking? Take these four steps, up front: + +## 1. Educate your teams + +It's very likely that people in your operations team, from the COO downward, have heard of RPA and operational automation. It's equally likely that they have many questions and concerns. It is critical to address these issues before you start your implementation. + +Proactively educating the operations team can go a long way in drumming up enthusiasm and buy-in for automation. Training can focus on what automation and bots are, what role they play in a typical process, which processes and tasks are best positioned for automation, and what the expected benefits of automation are. + +**Recommendation** : Ask your automation partner to conduct these team education sessions, with your moderation: They will likely be eager to assist. The leadership should shape the message before it is delivered to the broader team. + +"The first step in automation is to get to know your processes better." + +## 2. Examine your internal processes + +The first step in automation is to get to know your processes better. Every RPA implementation should be preceded by a process inventory, activity analysis, and cost/value mapping exercise. + +It's critical to understand where the value add (or cost, if value is unavailable) happens in the process. And this needs to be done at a granular level for each process or every task. + +This will help you identify and prioritize the right candidates for automation. Because of the sheer number of tasks that can or may need to be automated, processes typically get automated in phases, so prioritization is key. + +**Recommendation** : Set up a small working team, with participation from each group within Operations. Nominate a coordinator from each group - typically a group leader or team manager. Conduct a workshop at the group level to build the process inventory, identify candidate processes, and drive buy-in. Your automation partners are likely to have accelerators - questionnaires, scorecards etc. - that can help you speed up this activity. + +## 3. Provide strong direction on business priorities + +Implementations often involve driving consensus (and sometimes tie-breaking) between operations teams on process selection and automation priorities, based on business value. Though team participation remains a critical part of the analysis and implementation exercises, leaders should own final decision-making. + +**Recommendation** : Schedule regular sessions to get updates from the working teams. In addition to factors like driving consensus and buy-in, teams will also look to leaders for directional decisions on ROI, platform selection, and automation prioritization at the group level. + +## 4. CIO and COO should drive close cooperation + +Automation rollouts are much smoother when there is close cooperation between the operations and technology teams. The COO needs to help drive this coordination with the CIO's team. + +Involvement and oversight of the COO and other operations leaders are critical for successful automation implementations. + +**Recommendation** : The COO and CIO team should set up a joint working group (a "war room") with the third-party automation partners. Responsibilities for each participant should be clearly demarcated and tracked on an ongoing basis. Ideally, the COO and CIO should dedicate at least one resource to the group, at least during the initial rollouts. + +Automation can create significant value for an organization. However, to achieve optimal returns on the investment in their automation journey, CIOs must map before they leap. + +-------------------------------------------------------------------------------- + +via: https://enterprisersproject.com/article/2017/11/how-improve-roi-automation-4-tips + +作者:[Rajesh Kamath][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://enterprisersproject.com/user/rajesh-kamath +[1]:https://enterprisersproject.com/article/2017/11/crafting-your-ai-strategy-3-tips?sc_cid=70160000000h0aXAAQ From aedeb3da9d914357c1b920667a0eb09cb708ed66 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 16:42:47 +0800 Subject: [PATCH 061/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20organi?= =?UTF-8?q?ze=20your=20passwords=20using=20pass=20password=20manager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r passwords using pass password manager.md | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 sources/tech/20171121 How to organize your passwords using pass password manager.md diff --git a/sources/tech/20171121 How to organize your passwords using pass password manager.md b/sources/tech/20171121 How to organize your passwords using pass password manager.md new file mode 100644 index 0000000000..5cd203e403 --- /dev/null +++ b/sources/tech/20171121 How to organize your passwords using pass password manager.md @@ -0,0 +1,150 @@ +translating by lujun9972 +How to organize your passwords using pass password manager +====== + +### Objective + +Learn to organize your passwords using the "pass" password manager on linux + +### Requirements + + * Root permissions needed to install required packages + +### Difficulty + +EASY + +### Conventions + + * **#** \- requires given command to be executed with root privileges either directly as a root user or by use of `sudo` command + * **$** \- given command to be executed as a regular non-privileged user +### Introduction + +If you have the good habit to never use the same password for more than one purpose, you have probably already felt the need for a password manager. There are many alternatives to choose from on linux, both proprietary (if you dare) and open source. If you, like me, think that simplicity it's the way to go, you may be interested in knowing however to use the `pass` utility. + +### First steps + +Pass it's a password manager that it's really a wrapper on well trusted and useful tools that you probably already use every day, like `gpg` and `git`. Although graphical interfaces exists for it, it is designed to work from command line: therefore it will work even on headless machines. + +### Step 1 - installation + +Pass it's easily available on the majority of linux distributions, you can obtain via package manager: + +#### Fedora +``` +# dnf install pass +``` + +#### RHEL and CentOS + +Pass is not available in the official repositories, but you can obtain it from `epel`. To make the latter source available on CentOS7, all you have to do is: +``` +# yum install epel-release +``` + +On Red Hat Enterprise Linux, however, the package that enables this extra source it's not available; you can download it from the official EPEL site. + +#### Debian and Ubuntu +``` +# apt-get install pass +``` + +#### Arch Linux +``` +# pacman -S pass +``` + +### Initialize the password store + +Once we have `pass` installed, we can begin to use it and configure it. First of all, since pass relies on `gpg` to encrypt our passwords and store it in a secure way, we must have a `gpg keypair` already in place. + +First thing to do is to initialize the `password store`: this is simply the directory where all your gpg-encrypted password will be saved. By default it will be created as a hidden directory inside your `$HOME`, however you can specify an alternative path, by using the `PASSWORD_STORE_DIR` environment variable. Let's proceed: +``` +$ pass init +``` + +The `password-store` directory will be created. Now, let's try to store our first password: +``` +$ pass edit mysite +``` + +At this point an instance of our default text editor will be opened, and all we have to do is to enter our password in it. The file will be encrypted using gpg, and stored as `mysite.gpg` inside the password-store directory. + +Pass stores encrypted files in a directory tree, which means that we can logically group more files in subdirectories to obtain a better organization, we will just have to specify it on file creation, for example: +``` +$ pass edit foo/bar +``` + +Just as above, this will prompt for password insertion, but the file will be created inside the `foo` subdirectory of the password store. To visualize the file structure, all we have to do is to use the `pass` command without any arguments: +``` + +$ pass +Password Store +├── foo +│   └── bar +└── mysite + +``` + +Whenever we need to modify our password, we will just have to repeat the same command used to create it, as shown above. + +### Access the passwords + +There are basically two ways we can access our password: the first one is to display it on the terminal, by using: +``` +pass mysite +``` + +However a better way is to let pass copy it directly to the clipboard, by using the `-c` option: +``` +pass -c mysite +``` + +In this case the clipboard will be cleared after `45` seconds. In both cases, a prompt will appear where you will have to insert your gpg password. + +### Generate passwords + +Pass can also generate (and automatically store) secure passwords for us. Say we want to generate a password composed by 15 characters: alphanumeric and symbols. The command to use will be: +``` +pass generate mysite 15 +``` + +If we want our password to contain only alphanumeric characters we can use the `--no-symbols` option. The generated password will displayed onscreen. Alternatively, it can be copied directly to the clipboard, using the `--clip` or `-c` option. You can even generate a QR code, by using the `-q` or `--qrcode` option: + +![qrcode][1] + +As you can see from the screenshot above, the qrcode has been generated, but since a password for `mysite` already existed at the time we invoked the command, pass showed a prompt to let us confirm that we want to override it. + +Pass uses the `/dev/urandom` device as a (pseudo) random data generator to create the passwords, while it uses the `xclip` utility to copy them to the clipboard, and `qrencode` to display them as qrcodes. This modularity is, in my opinion, its greatest strength: it doesn't reinvent anything, it just wraps common used tools to reach its goal. + +You can also rename, copy or delete files from the password store, respectively using the `pass mv`, `pass cp`, or `pass rm` commands. + +### Using the password store as a git repository + +Another great feature of `pass` is that it can treat the password store as a git repository: letting us manage our password more easily, under a version control system. +``` +pass git init +``` + +This will create the git repository, and automatically create a commit with all the existing files. The next step is to specify the remote repository to track: +``` +pass git remote add +``` + +We can manage this repository just like we do with all other repository we use. The only "difference" is that every time we add or modify a password, `pass` will automatically add the file to the index and create a commit. + +A graphical interface exists for `pass`, it is called `qtpass` and it's available also for Windows and MacOs. It's also possible to access the password store from firefox, using the `PassFF` extension. You will find more detailed informations on the project site. Go on an try `pass`, you will not regret it! + + +-------------------------------------------------------------------------------- + +via: https://linuxconfig.org/how-to-organize-your-passwords-using-pass-password-manager + +作者:[Egidio Docile][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://linuxconfig.org +[1]:/images/pass-manager-qrcode.png From 95a81f8b14a7d896ac59b1992dd0cd4c6a400e90 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 16:54:40 +0800 Subject: [PATCH 062/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Kill?= =?UTF-8?q?=20The=20Largest=20Process=20In=20An=20Unresponsive=20Linux=20S?= =?UTF-8?q?ystem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Process In An Unresponsive Linux System.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/tech/20171121 How To Kill The Largest Process In An Unresponsive Linux System.md diff --git a/sources/tech/20171121 How To Kill The Largest Process In An Unresponsive Linux System.md b/sources/tech/20171121 How To Kill The Largest Process In An Unresponsive Linux System.md new file mode 100644 index 0000000000..3f173f2fd2 --- /dev/null +++ b/sources/tech/20171121 How To Kill The Largest Process In An Unresponsive Linux System.md @@ -0,0 +1,136 @@ +How To Kill The Largest Process In An Unresponsive Linux System +====== +I, as a blog writer, have bookmarked many blogs, websites and forums to refer Linux and Unix related notes. Sometimes, I had a lot of open tabs in my browser, so my system goes unresponsive for several minutes. I couldn't move the mouse cursor, or kill a process or close any opened tabs. At that times, I had no choice but to forcibly reset the system. Of course, I use **OneTab** and The **Great Suspender** extensions, but they didn 't help much either. I often ran out of memory. This is where **Early OOM** comes in help. For those wondering, it will kill the largest process in an unresponsive system when it has absolutely no other choices. Early OOM checks the amount of available memory and free swap 10 times a second. If both are below 10%, it will kill the largest process. + +### Why Early OOM? Why not built-in OOM killer? + +Before going into further, let me you give a short explanation of OOM killer, also known as **O** ut **O** f **M** emory killer. OOM killer is a process that the Kernel uses when the system is critically low on memory. The main task of OOM killer is to continue killing processes until enough memory is freed for the smooth functioning of the rest of the process that the Kernel is attempting to run. OOM killer will choose the best processes that are least important to the system and free up maximum memory and kill them. We can view the oom_score of each process in **/proc** directory under **pid** section. + +Example: +``` +$ cat /proc/10299/oom_score +1 +``` + +The higher the value of oom_score of any process, the higher is its likelihood of getting killed by the OOM Killer when the system is running out of memory. + +The developer of Early OOM claims that it has one big advantage over the in-kernel OOM killer. As I stated earlier, the Linux oom killer kills the process with the highest score, so the Chrome browser will always be the first victim of the oom killer. To avoid this, Early OOM uses **/proc/*/status** instead of **echo f > /proc/sysrq-trigger**. He also claims that triggering the oom killer manually may not work at all in latest Linux Kernel. + +### Installing Early OOM + +Early OOM is available in AUR, so you can install it using any AUR helper programs in Arch Linux and its derivatives. + +Using [**Pacaur**][1]: +``` +pacaur -S earlyoom +``` + +Using [**Packer**][2]: +``` +packer -S earlyoom +``` + +Using [**Yaourt**][3]: +``` +yaourt -S earlyoom +``` + +Enable and start Early OOM daemon: +``` +sudo systemctl enable earlyoom +``` +``` +sudo systemctl start earlyoom +``` + +On other Linux distributions, compile and install it manually as shown below. +``` +git clone https://github.com/rfjakob/earlyoom.git +cd earlyoom +make +sudo make install +``` + +### Early OOM - Kill The Largest Process In An Unresponsive Linux System + +Run the following command to start Early OOM: +``` +earlyoom +``` + +If you compiled it from source, run the following command to start Early OOM: +``` +./earlyoom +``` + +The sample output would be: +``` +earlyoom 0.12 +mem total: 3863 MiB, min: 386 MiB (10 %) +swap total: 2047 MiB, min: 204 MiB (10 %) +mem avail: 1770 MiB (45 %), swap free: 2047 MiB (99 %) +mem avail: 1773 MiB (45 %), swap free: 2047 MiB (99 %) +mem avail: 1772 MiB (45 %), swap free: 2047 MiB (99 %) +mem avail: 1773 MiB (45 %), swap free: 2047 MiB (99 %) +mem avail: 1772 MiB (45 %), swap free: 2047 MiB (99 %) +mem avail: 1773 MiB (45 %), swap free: 2047 MiB (99 %) +mem avail: 1771 MiB (45 %), swap free: 2047 MiB (99 %) +mem avail: 1773 MiB (45 %), swap free: 2047 MiB (99 %) +mem avail: 1784 MiB (46 %), swap free: 2047 MiB (99 %) +[...] +``` + +As you see in the above output, Early OOM will display how much memory and swap you have, what the minimum is, how much memory is available and how much swap is free. Remember it will keep running until you manually stop by pressing CTRL+C. + +If both memory and swap reaches below 10%, Early OOM will automatically kill the largest processes until the system has enough memory to run smoothly. You can also configure the minimum percentage value as per your requirement. + +To set available memory minimum to PERCENT of total, run:`` +``` +earlyoom -m +``` + +To set available swap minimum to PERCENT of total, run:`` +``` +earlyoom -s +``` + +For more details, refer the help section. +``` +$ earlyoom -h +earlyoom 0.12 +Usage: earlyoom [OPTION]... + + -m PERCENT set available memory minimum to PERCENT of total (default 10 %) + -s PERCENT set free swap minimum to PERCENT of total (default 10 %) + -M SIZE set available memory minimum to SIZE KiB + -S SIZE set free swap minimum to SIZE KiB + -k use kernel oom killer instead of own user-space implementation + -i user-space oom killer should ignore positive oom_score_adj values + -d enable debugging messages + -v print version information and exit + -r INTERVAL memory report interval in seconds (default 1), set to 0 to + disable completely + -p set niceness of earlyoom to -20 and oom_score_adj to -1000 + -h this help text +``` + +Now, you don't need to worry about highest memory consumption processes. Hope this helps. More good stuffs to come. Stay tuned! + +Cheers! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/kill-largest-process-unresponsive-linux-system/ + +作者:[Aditya Goturu][a] +译者:[译者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 +[1]:https://www.ostechnix.com/install-pacaur-arch-linux/ +[2]:https://www.ostechnix.com/install-packer-arch-linux-2/ +[3]:https://www.ostechnix.com/install-yaourt-arch-linux/ From a77fb64f6326b1edf84e5dfaea5f0079dc984e53 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 16:55:06 +0800 Subject: [PATCH 063/133] add done: 20171121 How To Kill The Largest Process In An Unresponsive Linux System.md --- ... Kill The Largest Process In An Unresponsive Linux System.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20171121 How To Kill The Largest Process In An Unresponsive Linux System.md b/sources/tech/20171121 How To Kill The Largest Process In An Unresponsive Linux System.md index 3f173f2fd2..8711f170af 100644 --- a/sources/tech/20171121 How To Kill The Largest Process In An Unresponsive Linux System.md +++ b/sources/tech/20171121 How To Kill The Largest Process In An Unresponsive Linux System.md @@ -1,5 +1,7 @@ How To Kill The Largest Process In An Unresponsive Linux System ====== +![](https://www.ostechnix.com/wp-content/uploads/2017/11/Kill-The-Largest-Process-720x340.png) + I, as a blog writer, have bookmarked many blogs, websites and forums to refer Linux and Unix related notes. Sometimes, I had a lot of open tabs in my browser, so my system goes unresponsive for several minutes. I couldn't move the mouse cursor, or kill a process or close any opened tabs. At that times, I had no choice but to forcibly reset the system. Of course, I use **OneTab** and The **Great Suspender** extensions, but they didn 't help much either. I often ran out of memory. This is where **Early OOM** comes in help. For those wondering, it will kill the largest process in an unresponsive system when it has absolutely no other choices. Early OOM checks the amount of available memory and free swap 10 times a second. If both are below 10%, it will kill the largest process. ### Why Early OOM? Why not built-in OOM killer? From 0806f28b4df92a0b28d2a745d0cf86d9c796a74e Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 17:08:02 +0800 Subject: [PATCH 064/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Finding=20Files?= =?UTF-8?q?=20with=20mlocate:=20Part=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1121 Finding Files with mlocate- Part 3.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20171121 Finding Files with mlocate- Part 3.md diff --git a/sources/tech/20171121 Finding Files with mlocate- Part 3.md b/sources/tech/20171121 Finding Files with mlocate- Part 3.md new file mode 100644 index 0000000000..1969514d41 --- /dev/null +++ b/sources/tech/20171121 Finding Files with mlocate- Part 3.md @@ -0,0 +1,140 @@ +Finding Files with mlocate: Part 3 +====== +In the previous articles in this short series, we [introduced the mlocate][1] (or just locate) command, and then discussed some ways [the updatedb tool][2] can be used to help you find that one particular file in a thousand. + +You are probably also aware of xargs as well as the find command. Our trusty friend locate can also play nicely with the --null option of xargs by outputting all of the results onto one line (without spaces which isn't great if you want to read it yourself) by using the -0 switch like this: +``` +# locate -0 .bash +``` + +An option I like to use (if I remember to use it -- because the locate command rarely needs to be queried twice thanks to its simple syntax) is the -e option. +``` +# locate -e .bash +``` + +For the curious, that -e switch means "existing." And, in this case, you can use -e to ensure that any files returned by the locate command do actually exist at the time of the query on your filesystems. + +It's almost magical, that even on a slow machine, the mastery of the modern locate command allows us to query its file database and then check against the actual existence of many files in seemingly no time whatsoever. Let's try a quick test with a file search that's going to return a zillion results and use the time command to see how long it takes both with and without the -e option being enabled. + +I'll choose files with the compressed .gz extension. Starting with a count, you can see there's not quite a zillion but a fair number of files ending in .gz on my machine, note the -c for "count": +``` +# locate -c .gz +7539 +``` + +This time, we'll output the list but time it and see the abbreviated results as follows: +``` +# time locate .gz +real 0m0.091s +user 0m0.025s +sys 0m0.012s +``` + +That's pretty swift, but it's only reading from the overnight-run database. Let's get it to do a check against those 7,539 files, too, to see if they truly exist and haven't been deleted or renamed since last night: +``` +# time locate -e .gz +real 0m0.096s +user 0m0.028s +sys 0m0.055s +``` + +The speed difference is nominal as you can see. There's no point in talking about lightning or blink-and-you-miss-it, because those aren't suitable yardsticks. Relative to the other indexing service I mentioned previously, let's just say that's pretty darned fast. + +If you need to move the efficient database file used by the locate command (in my version it lives here: /var/lib/mlocate/mlocate.db) then that's also easy to do. You may wish to do this, for example, because you've generated a massive database file (it's only 1.1MB in my case so it's really tiny in reality), which needs to be put onto a faster filesystem. + +Incidentally, even the mlocate utility appears to have created an slocate group of users on my machine, so don't be too alarmed if you see something similar, as shown here from a standard file listing: +``` +-rw-r-----. 1 root slocate 1.1M Jan 11 11:11 /var/lib/mlocate/mlocate.db +``` + +Back to the matter in hand. If you want to move away from /var/lib/mlocate as your directory being used by the database then you can use this command syntax (and you'll have to become the "root" user with sudo -i or su - for at least the first command to work correctly): +``` +# updatedb -o /home/chrisbinnie/my_new.db +# locate -d /home/chrisbinnie/my_new.db SEARCH_TERM +``` + +Obviously, replace your database name and path. The SEARCH_TERM element is the fragment of the filename that you're looking for (wildcards and all). + +If you remember I mentioned that you need to run updatedb command as the superuser to reach all the areas of your filesystems. + +This next example should cover two useful scenarios in one. According to the manual, you can also create a "private" database for standard users as follows: +``` +# updatedb -l 0 -o DATABASE -U source_directory +``` + +Here the previously seen -o option means that we output our database to a file (obviously called DATABASE). The -l 0 addition apparently means that the "visibility" of the database file is affected. It means (if I'm reading the docs correctly) that my user can read it but, otherwise, without that option, only the locate command can. + +The second useful scenario for this example is that we can create a little database file specifying exactly which path its top-level should be. Have a look at the database-root or -U source_directory option in our example. If you don't specify a new root file path, then the whole filesystem(s) is scanned instead. + +If you want to get clever and chuck a couple of top-level source directories into one command, then you can manage that having created two separate databases. Very useful for scripting methinks. + +You can achieve that with this command: +``` +# locate -d /home/chrisbinnie/database_one -d /home/chrisbinnie/database_two SEARCH_TERM +``` + +The manual dutifully warns however that ALL users that can read the DATABASE file can also get the complete list of files in the subdirectories of the chosen source_directory. So use these commands with some care. + +### Priced To Sell + +Back to the mind-blowing simplicity of the locate command in use on a day-to-day basis. There are many times when newbies may confused with case-sensitivity on Unix-type systems. Simply use the conventional -i option to ignore case entirely when using the flexible locate command: +``` +# locate -i ChrisBinnie.pdf +``` + +If you have a file structure that has a number of symlinks holding it together, then there might be occasion when you want to remove broken symlinks from the search results. You can do that with this command: +``` +# locate -Le chrisbinnie_111111.xml +``` + +If you needed to limit the search results then you could use this functionality, also in a script for example (similar to the -c option for counting), as so: +``` +# locate -l25 *.gz +``` + +This command simply stops after outputting the first 25 files that were found. When piped through the grep command, it's very useful on a super busy system. + +### Popular Area + +We briefly touched upon performance earlier, and I happened to see this [nicely written blog entry][3], where the author discusses thoughts on the trade-offs between the database size becoming unwieldy and the speed at which results are delivered. + +What piqued my interest are the comments on how the original locate command was written and what limiting factors were considered during its creation. Namely how disk space isn't quite so precious any longer and nor is the delivery of results even when 700,000 files are involved. + +I'm certain that the author(s) of mlocate and its forebears would have something to say in response to that blog post. I suspect that holding onto the file permissions to give us the "secure" and "slocate" functionality in the database might be a fairly big hit in terms of overhead. And, as much as I enjoyed the post, I won't be writing a Bash script to replace mlocate any time soon. I'm more than happy with the locate command and extol its qualities at every opportunity. + +### Sold + +I hope you've acquired enough insight into the superb locate command to prune, tweak, adjust, and tune it to your unique set of requirements. As we've seen, it's fast, convenient, powerful, and efficient. Additionally, you can ignore the "root" user demands and use it within scripts for very specific tasks. + +My favorite aspect, however, is when I'm awakened in the middle of the night because of an emergency. It's not a good look, having to remember the complex find command and typing it slowly with bleary eyes (and managing to add lots of typos): +``` +# find . -type f -name "*.gz" +``` + +Instead of that, I can just use the simple locate command: +``` +# locate *.gz +``` + +As has been said, any fool can create something bigger, bolder, and tougher, but it takes a bit of genius to create something simpler. And, in terms of introducing more people to the venerable Unix-type command line, there's little argument that the locate command welcomes them with open arms. + +Learn more about essential sysadmin skills: Download the [Future Proof Your SysAdmin Career][4] ebook now. + +Chris Binnie's latest book, Linux Server Security: Hack and Defend, shows how hackers launch sophisticated attacks to compromise servers, steal data, and crack complex passwords, so you can learn how to defend against these attacks. In the book, he also talks you through making your servers invisible, performing penetration testing, and mitigating unwelcome attacks. You can find out more about DevSecOps and Linux security via his website ([http://www.devsecops.cc][5]). + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2017/11/finding-files-mlocate-part-3 + +作者:[][a] +译者:[译者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 +[1]:https://www.linux.com/blog/learn/intro-to-linux/2017/11/finding-files-mlocate +[2]:https://www.linux.com/blog/learn/intro-to-linux/finding-files-mlocate-part-2 +[3]:http://jvns.ca/blog/2015/03/05/how-the-locate-command-works-and-lets-rewrite-it-in-one-minute/ +[4]:https://go.pardot.com/l/6342/2017-07-17/3vwshv?utm_source=linco&utm_medium=blog&utm_campaign=sysadmin&utm_content=promo +[5]:http://www.devsecops.cc/ From 674fa6c0f79f5e81b5e97aaa1a75df59f1b4e6ec Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 17:12:09 +0800 Subject: [PATCH 065/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Finding=20Files?= =?UTF-8?q?=20with=20mlocate:=20Part=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1114 Finding Files with mlocate- Part 2.md | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 sources/tech/20171114 Finding Files with mlocate- Part 2.md diff --git a/sources/tech/20171114 Finding Files with mlocate- Part 2.md b/sources/tech/20171114 Finding Files with mlocate- Part 2.md new file mode 100644 index 0000000000..605ab0acab --- /dev/null +++ b/sources/tech/20171114 Finding Files with mlocate- Part 2.md @@ -0,0 +1,171 @@ +Finding Files with mlocate: Part 2 +====== +[In the previous article][1], we discussed some ways to find a specific file out of the thousands that may be present on your filesystems and introduced the locate tool for the job. Here we explain how the important updatedb tool can help. + +### Well Situated + +Incidentally, you might get a little perplexed if trying to look up the manuals for updatedb and the locate command. Even though it's actually the mlocate command and the binary is /usr/bin/updatedb on my filesystem, you probably want to use varying versions of the following man commands to find what you're looking for: +``` +# man locate + + +# man updatedb + + +# man updatedb.conf + +``` + +Let's look at the important updatedb command in a little more detail now. It's worth mentioning that, after installing the locate utility, you will need to initialize your file-list database before doing anything else. You have to do this as the "root" user in order to reach all the relevant areas of your filesystems or the locate command will complain. Initialize or update your database file, whenever you like, with this command: +``` +# updatedb +``` + +Obviously, the first time this command is run it may take a little while to complete, but when I've installed the locate command afresh I've almost always been pleasantly surprised at how quickly it finishes. After a hop, a skip, and a jump, you can immediately query your file database. However, let's wait a moment before doing that. + +We're dutifully informed by its manual that the database created as a result of running updatedb resides at the following location: /var/lib/mlocate/mlocate.db. + +If you want to change how updatedb is run, then you need to affect it with your config file -- a reminder that it should live here: /etc/updatedb.conf. Listing 1 shows the contents of it on my system: +``` +PRUNE_BIND_MOUNTS = "yes" + +PRUNEFS = "9p afs anon_inodefs auto autofs bdev binfmt_misc cgroup cifs coda configfs +cpuset debugfs devpts ecryptfs exofs fuse fusectl gfs gfs2 hugetlbfs inotifyfs iso9660 +jffs2 lustre mqueue ncpfs nfs nfs4 nfsd pipefs proc ramfs rootfs rpc_pipefs securityfs +selinuxfs sfs sockfs sysfs tmpfs ubifs udf usbfs" + +PRUNENAMES = ".git .hg .svn" + +PRUNEPATHS = "/afs /media /net /sfs /tmp /udev /var/cache/ccache /var/spool/cups +/var/spool/squid /var/tmp" +``` + +Listing 1: The innards of the file /etc/updatedb.conf which affects how our database is created. + +The first thing that my eye is drawn to is the PRUNENAMES section. As you can see by stringing together a list of directory names, delimited with spaces, you can suitably ignore them. One caveat is that only directory names can be skipped, and you can't use wildcards. As we can see, all of the otherwise-hidden files in a Git repository (the .git directory might be an example of putting this option to good use. + +If you need to be more specific then, again using spaces to separate your entries, you can instruct the locate command to ignore certain paths. Imagine for example that you're generating a whole host of temporary files overnight which are only valid for one day. You're aware that this is a special directory of sorts which employs a familiar naming convention for its thousands of files. It would take the locate command a relatively long time to process the subtle changes every night adding unnecessary stress to your system. The solution is of course to simply add it to your faithful "ignore" list. + +### Well Appointed + +As seen in Listing 2, the file /etc/mtab offers not just a list of the more familiar filesystems such as /dev/sda1 but also a number of others that you may not immediately remember. +``` +/dev/sda1 /boot ext4 rw,noexec,nosuid,nodev 0 0 + +proc /proc proc rw 0 0 + +sysfs /sys sysfs rw 0 0 + +devpts /dev/pts devpts rw,gid=5,mode=620 0 0 + +/tmp /var/tmp none rw,noexec,nosuid,nodev,bind 0 0 + +none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0 +``` + +Listing 2: A mashed up example of the innards of the file /etc/mtab. + +Some of the filesystems shown in Listing 2 contain ephemeral content and indeed content that belongs to pseudo-filesystems, so it is clearly important to ignore their files -- if for no other reason than because of the stress added to your system during each overnight update. + +In Listing 1, the PRUNEFS option takes care of this and ditches those not suitable (for most cases). There are a few different filesystems to consider as you can see: +``` +PRUNEFS = "9p afs anon_inodefs auto autofs bdev binfmt_misc cgroup cifs coda configfs +cpuset debugfs devpts ecryptfs exofs fuse fusectl gfs gfs2 hugetlbfs inotifyfs iso9660 jffs2 +lustre mqueue ncpfs nfs nfs4 nfsd pipefs proc ramfs rootfs rpc_pipefs securityfs selinuxfs +sfs sockfs sysfs tmpfs ubifs udf usbfs" +``` + +The updatedb.conf manual succinctly informs us of the following information in relation to the PRUNE_BIND_MOUNTS option: + +"If PRUNE_BIND_MOUNTS is 1 or yes, bind mounts are not scanned by updatedb(8). All file systems mounted in the subtree of a bind mount are skipped as well, even if they are not bind mounts. As an exception, bind mounts of a directory on itself are not skipped." + +Assuming that makes sense, before moving onto some locate command examples, you should note one thing. Excluding some versions of the updatedb command, it can also be told to ignore certain "non-directory files." However, this does not always apply, so don't blindly copy and paste config between versions if you use such an option. + +### In Need of Modernization + +As mentioned earlier, there are times when finding a specific file needs to be so quick that it's at your fingertips before you've consciously recalled the command. This is the irrefutable beauty of the locate command. + +And, if you've ever sat in front of a horrendously slow Windows machine watching the hard disk light flash manically as if it were suffering a conniption due to the indexing service running, then I can assure you that the performance that you'll receive from the updatedb command will be a welcome relief. + +You should bear in mind, that unlike with the find command, there's no need to remember the base paths of where your file might be residing. By that I mean that all of your (hopefully) relevant filesystems are immediately accessed with one simple command and that remembering paths is almost a thing of the past. + +In its most simple form, the locate command looks like this: +``` +# locate chrisbinnie.pdf +``` + +There's also no need to escape hidden files that start with a dot or indeed expand a search with an asterisk: + +### # locate .bash + +Listing 3 shows us what has been returned, in an instant, from the many partitions the clever locate command has scanned previously. +``` +/etc/bash_completion.d/yum.bash + +/etc/skel/.bash_logout + +/etc/skel/.bash_profile + +/etc/skel/.bashrc + +/home/chrisbinnie/.bash_history + +/home/chrisbinnie/.bash_logout + +/home/chrisbinnie/.bash_profile + +/home/chrisbinnie/.bashrc + +/usr/share/doc/git-1.5.1/contrib/completion/git-completion.bash + +/usr/share/doc/util-linux-ng-2.16.1/getopt-parse.bash + +/usr/share/doc/util-linux-ng-2.16.1/getopt-test.bash +``` + +Listing 3: The search results from running the command: "locate .bash" + +I'm suspicious that the following usage has altered slightly, from back in the day when the slocate command was more popular or possibly the original locate command, but you can receive different results by adding an asterisk to that query as so: +``` +# locate .bash* +``` + +In Listing 4, you can see the difference from Listing 3. Thankfully, the results make more sense now that we can see them together. In this case, the addition of the asterisk is asking the locate command to return files beginning with .bash as opposed to all files containing that string of characters. +``` +/etc/skel/.bash_logout + +/etc/skel/.bash_profile + +/etc/skel/.bashrc + +/home/d609288/.bash_history + +/home/d609288/.bash_logout + +/home/d609288/.bash_profile + +/home/d609288/.bashrc +``` + +Listing 4: The search results from running the command: "locate .bash*" with the addition of an asterisk. + +Stay tuned for next time when we learn more about the amazing simplicity of using the locate command on a day-to-day basis. + +Learn more about essential sysadmin skills: Download the [Future Proof Your SysAdmin Career][2] ebook now. + +Chris Binnie's latest book, Linux Server Security: Hack and Defend, shows how hackers launch sophisticated attacks to compromise servers, steal data, and crack complex passwords, so you can learn how to defend against these attacks. In the book, he also talks you through making your servers invisible, performing penetration testing, and mitigating unwelcome attacks. You can find out more about DevSecOps and Linux security via his website ([http://www.devsecops.cc][3]). + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/intro-to-linux/finding-files-mlocate-part-2 + +作者:[Chris Binnie][a] +译者:[译者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/chrisbinnie +[1]:https://www.linux.com/blog/learn/intro-to-linux/2017/11/finding-files-mlocate +[2]:https://go.pardot.com/l/6342/2017-07-17/3vwshv?utm_source=linco&utm_medium=blog&utm_campaign=sysadmin&utm_content=promo +[3]:http://www.devsecops.cc/ From 523186a5dd6d5567e4fa765c748ce7f7a51b0f84 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 17:12:41 +0800 Subject: [PATCH 066/133] add done: 20171114 Finding Files with mlocate- Part 2.md --- sources/tech/20171114 Finding Files with mlocate- Part 2.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/tech/20171114 Finding Files with mlocate- Part 2.md b/sources/tech/20171114 Finding Files with mlocate- Part 2.md index 605ab0acab..19c546a917 100644 --- a/sources/tech/20171114 Finding Files with mlocate- Part 2.md +++ b/sources/tech/20171114 Finding Files with mlocate- Part 2.md @@ -1,5 +1,8 @@ Finding Files with mlocate: Part 2 ====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/question-mark-locate_0.jpg?itok=JfoE_G5f) + [In the previous article][1], we discussed some ways to find a specific file out of the thousands that may be present on your filesystems and introduced the locate tool for the job. Here we explain how the important updatedb tool can help. ### Well Situated From d94d8b23e84c72df26f0ad0d3b0636d1a2ef2de3 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 17:17:31 +0800 Subject: [PATCH 067/133] add done: 20171121 Finding Files with mlocate- Part 3.md --- sources/tech/20171121 Finding Files with mlocate- Part 3.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/tech/20171121 Finding Files with mlocate- Part 3.md b/sources/tech/20171121 Finding Files with mlocate- Part 3.md index 1969514d41..c9eccb2fc7 100644 --- a/sources/tech/20171121 Finding Files with mlocate- Part 3.md +++ b/sources/tech/20171121 Finding Files with mlocate- Part 3.md @@ -1,5 +1,7 @@ Finding Files with mlocate: Part 3 ====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/question-mark-2492009_1920.jpg?itok=stJ3GxL2) In the previous articles in this short series, we [introduced the mlocate][1] (or just locate) command, and then discussed some ways [the updatedb tool][2] can be used to help you find that one particular file in a thousand. You are probably also aware of xargs as well as the find command. Our trusty friend locate can also play nicely with the --null option of xargs by outputting all of the results onto one line (without spaces which isn't great if you want to read it yourself) by using the -0 switch like this: @@ -126,13 +128,13 @@ Chris Binnie's latest book, Linux Server Security: Hack and Defend, shows how ha via: https://www.linux.com/blog/learn/2017/11/finding-files-mlocate-part-3 -作者:[][a] +作者:[Chris Binnie][a] 译者:[译者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 +[a]:https://www.linux.com/users/chrisbinnie [1]:https://www.linux.com/blog/learn/intro-to-linux/2017/11/finding-files-mlocate [2]:https://www.linux.com/blog/learn/intro-to-linux/finding-files-mlocate-part-2 [3]:http://jvns.ca/blog/2015/03/05/how-the-locate-command-works-and-lets-rewrite-it-in-one-minute/ From a3c7c0a86083c9c61da0dc87f8854b701858817f Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 17:19:54 +0800 Subject: [PATCH 068/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20rename?= =?UTF-8?q?=20user=20in=20Linux=20(also=20rename=20group=20&=20home=20dire?= =?UTF-8?q?ctory)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ux (also rename group - home directory).md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md diff --git a/sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md b/sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md new file mode 100644 index 0000000000..20ea0ab04b --- /dev/null +++ b/sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md @@ -0,0 +1,65 @@ +How to rename user in Linux (also rename group & home directory) +====== +We might have come across a situation where we might want to rename user in Linux system, for whatever reasons. We can easily rename user in Linux & also we can rename the home directory or its UID as well. + +In this short tutorial, we will be discussing these things only. Let's start by renaming user in Linux first, + + **(Recommended Read:[How to use FIND command to locate anything in Linux][1])** + +### Rename user in Linux + +For renaming user in Linux systems, we will use ** 'usermod'** command. Syntax for the command is, + + **$ usermod -l new_username old_username** + +For example, if we have a user named ** 'dan'** & want to rename it to **' susan'**, execute the following command from terminal; + + **$ sudo usermod -l susan dan** + +This will only change the username & everything else, like group, home directory, UID will remain same. + + **Note:-** You should need to logged out from the account you are trying to rename. You can also kill all the processes running for that user, to do so execute the following command, + + **$ sudo pkill -u dan** + + **$ sudo pkill -9 -u dan** + +### Renaming Home directory + +For renaming home directory to correspond to the renamed user, we use ** '-d'** option with **' usermod'** command., + + **$ sudo usermod -d /home/susan -m susan** + +### Changing UID for the user + +To change the UID of the user , execute the following command, + + **$ sudo usermod -u 2000 susan** + +where **' 2000'** is the new UID for user. + +### Renaming the group + +To rename the group from ** 'dan'** to **' susan**', we will use **' groupmod'** command. Use the following command to rename the group, + + **$ groupmod -n susan dan** + +Once we have made the required changes, we can than check the changes made using the ** 'id'** command, + + **$ id susan** + +With this we end this tutorial on how to rename user in Linux. Please let us know if you have any question or any issue or if you do have any suggestion, please do let us know that as well. + + +-------------------------------------------------------------------------------- + +via: http://linuxtechlab.com/rename-user-in-linux-rename-home-directory/ + +作者:[Shusain][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxtechlab.com/author/shsuain/ +[1]:http://linuxtechlab.com/use-of-find-command/ From 976e6acefa44bc76f4c6430d9eb018c351b2e810 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 17:21:07 +0800 Subject: [PATCH 069/133] add translating flag --- ...e user in Linux (also rename group - home directory).md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md b/sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md index 20ea0ab04b..30a65a62ad 100644 --- a/sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md +++ b/sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md @@ -1,11 +1,10 @@ +translating by lujun9972 How to rename user in Linux (also rename group & home directory) ====== We might have come across a situation where we might want to rename user in Linux system, for whatever reasons. We can easily rename user in Linux & also we can rename the home directory or its UID as well. In this short tutorial, we will be discussing these things only. Let's start by renaming user in Linux first, - - **(Recommended Read:[How to use FIND command to locate anything in Linux][1])** - +**(Recommended Read:[How to use FIND command to locate anything in Linux][1])** ### Rename user in Linux For renaming user in Linux systems, we will use ** 'usermod'** command. Syntax for the command is, @@ -56,7 +55,7 @@ With this we end this tutorial on how to rename user in Linux. Please let us kno via: http://linuxtechlab.com/rename-user-in-linux-rename-home-directory/ 作者:[Shusain][a] -译者:[译者ID](https://github.com/译者ID) +译者:[lujun9972](https://github.com/lujun9972) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e246e2167ad01091faca2121e464a94864783eda Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 29 Dec 2017 17:28:23 +0800 Subject: [PATCH 070/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Step=20by=20Step?= =?UTF-8?q?=20guide=20for=20creating=20Master=20Slave=20replication=20in?= =?UTF-8?q?=20MariaDB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing Master Slave replication in MariaDB.md | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 sources/tech/20171112 Step by Step guide for creating Master Slave replication in MariaDB.md diff --git a/sources/tech/20171112 Step by Step guide for creating Master Slave replication in MariaDB.md b/sources/tech/20171112 Step by Step guide for creating Master Slave replication in MariaDB.md new file mode 100644 index 0000000000..922ef18040 --- /dev/null +++ b/sources/tech/20171112 Step by Step guide for creating Master Slave replication in MariaDB.md @@ -0,0 +1,185 @@ +Step by Step guide for creating Master Slave replication in MariaDB +====== +In our earlier tutorials,we have already learned [**to install & configure MariaDB**][1] & also [**learned some basic administration commands for managing MariaDB**][2]. We are now going to learn to setup a MASTER SLAVE replication for MariaDB server. + +Replication is used to create multiple copies of our database & these copies then can either be used as another database to run our queries on, queries that might otherwise affect performance of master server like running some heavy analytics queries or we can just use them for data redundancy purposes or for both. We can automate the whole process i.e. data replication occurs automatically from master to slave. Backups are be done without affecting the write operations of the master + +So we will now setup our **master-slave** replication, for this we need two machines with Mariadb installed. IP addresses for the both the machines are mentioned below, + + **Master -** 192.168.1.120 **Hostname-** master.ltechlab.com + + **Slave -** 192.168.1.130 **Hostname -** slave.ltechlab.com + +Once MariaDB has been installed in those machines, we will move on with the tutorial. If you need help installing and configuring maridb, have a[ **look at our tutorial HERE.**][1] + + +### **Step 1- Master Server Configuration** + +We are going to take a database named ' **important '** in MariaDB, that will be replicated to our slave server. To start the process, we will edit the files ' **/etc/my.cnf** ' , it's the configuration file for mariadb, + +``` +$ vi /etc/my.cnf +``` + +& look for section with [mysqld] & then enter the following details, + +``` +[mysqld] +log-bin +server_id=1 +replicate-do-db=important +bind-address=192.168.1.120 +``` + +Save & exit the file. Once done, restart the mariadb services, + +``` +$ systemctl restart mariadb +``` + +Next, we will login to our mariadb instance on master server, + +``` +$ mysql -u root -p +``` + +& then will create a new user for slave named 'slaveuser' & assign it necessary privileges by running the following command + +``` +STOP SLAVE; +GRANT REPLICATION SLAVE ON *.* TO 'slaveuser'@'%' IDENTIFIED BY 'iamslave'; +FLUSH PRIVILEGES; +FLUSH TABLES WITH READ LOCK; +SHOW MASTER STATUS; +``` + +**Note:- ** We need values from **MASTER_LOG_FILE and MASTER_LOG_POS ** from out of 'show master status' for configuring replication, so make sure that you have those. + +Once these commands run successfully, exit from the session by typing 'exit'. + +### Step2 - Create a backup of the database & move it slave + +Now we need to create backup of our database 'important' , which can be done using 'mysqldump' command, + +``` +$ mysqldump -u root -p important > important_backup.sql +``` + +Once the backup is complete, we need to log back into the mariadb & unlock our tables, + +``` +$ mysql -u root -p +$ UNLOCK TABLES; +``` + +& exit the session. Now we will move the database backup to our slave server which has a IPaddress of 192.168.1.130, + +This completes our configuration on Master server, we will now move onto configuring our slave server. + +### Step 3 Configuring Slave server + +We will again start with editing '/etc/my.cnf' file & look for section [mysqld] & enter the following details, + +``` +[mysqld] +server-id = 2 +replicate-do-db=important +[ …] +``` + +We will now restore our database to mariadb, by running + +``` +$ mysql -u root -p < /data/ important_backup.sql +``` + +When the process completes, we will provide the privileges to 'slaveuser' on db 'important' by logging into mariadb on slave server, + +``` +$ mysql -u root -p +``` + +``` +GRANT ALL PRIVILEGES ON important.* TO 'slaveuser'@'localhost' WITH GRANT OPTION; +FLUSH PRIVILEGES; +``` + +Next restart mariadb for implementing the changes. + +``` +$ systemctl restart mariadb +``` + +### **Step 4 Start the replication** + +Remember, we need **MASTER_LOG_FILE and MASTER_LOG_POS** variables which we got from running 'SHOW MASTER STATUS' on mariadb on master server. Now login to mariadb on slave server & we will tell our slave server where to look for the master by running the following commands, + +``` +STOP SLAVE; +CHANGE MASTER TO MASTER_HOST= '192.168.1.110′, MASTER_USER='slaveuser', MASTER_PASSWORD='iamslave', MASTER_LOG_FILE='mariadb-bin.000001′, MASTER_LOG_POS=460; +SLAVE START; +SHOW SLAVE STATUS\G; +``` + +**Note:-** Change details of your master as necessary. + +### Step 5 Testing the replication + +We will now create a new tables in our database on master to make sure if the replication is working or not. So, login to mariadb on master server, + +``` +$ mysql -u root -p +``` + +select the database 'important', + +``` +use important; +``` + +and create a table named test in the db, + +``` +create table test (c int); +``` + +then insert some value into it, + +``` +insert into test (c) value (1); +``` + +To check the added value, + +``` +select * from test; +``` + +& you will find that your db has a table has the value you inserted. + +Now let's login to our slave database to make sure if our data replication is working, + +``` +$ mysql -u root -p +$ use important; +$ select * from test; +``` + +You will see that the output shows the same value that we inserted on the master server, hence our replication is working fine without any issues. + +This concludes our tutorial, please send your queries/questions through the comment box below. + + +-------------------------------------------------------------------------------- + +via: http://linuxtechlab.com/creating-master-slave-replication-mariadb/ + +作者:[Shusain][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxtechlab.com/author/shsuain/ +[1]:http://linuxtechlab.com/installing-configuring-mariadb-rhelcentos/ +[2]:http://linuxtechlab.com/mariadb-administration-commands-beginners/ From 0aa3b72143fa16a5a3ba1468d65043ee4950d870 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 29 Dec 2017 17:45:17 +0800 Subject: [PATCH 071/133] PRF:20171201 How to find a publisher for your tech book.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @FelixYFZ 二校。 --- ... to find a publisher for your tech book.md | 45 +++++++------------ 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/translated/tech/20171201 How to find a publisher for your tech book.md b/translated/tech/20171201 How to find a publisher for your tech book.md index 4f27cba2b7..6aed81b99a 100644 --- a/translated/tech/20171201 How to find a publisher for your tech book.md +++ b/translated/tech/20171201 How to find a publisher for your tech book.md @@ -5,51 +5,38 @@ ![How to find a publisher for your tech book](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_colorbooks.png?itok=vNhsYYyC "How to find a publisher for your tech book") -你有一个写本科技书籍的想法,那么祝贺你!就像徒步旅行,或者是去学做一种甜点心,写一本书就像人们说的那些事情一样,但是却都只停留在思考的初级阶段。那是可以理解的,因为失败的几率是很高的。要想实现它你需要在把你的想法阐述给出版商,去探讨是否已经准备充分去写成一本书。要去实现这一步是相当困难的,但最困难的是你缺少如何完成它的足够信息。 +你有一个写本科技书籍的想法,那么祝贺你!就像在阿巴拉契亚山脉徒步旅行,或者是去学做一种蛋奶酥,写书是人们经常讨论的话题之一,但是却都只停留在思考的初级阶段。那是可以理解的,因为失败的几率是很高的。要想实现它,你需要在把自己的想法阐述给出版商,去探讨是否已经做好充分的准备去写成一本书。要去实现这一步是相当困难的,但缺乏关于如何做这件事的信息会使事情变得复杂。 -如果你想和一个传统的出版商合作,你需要在他们面前推销你的书籍以期望能够得到出版的机会。我是 [Pragmatci Bookshelf][4] 的编辑主管,所以我经常看到很多的提案,也去帮助作者提议更好的主意。有些是好的,有些则不然,但我经常会看到许多不符合我们出版社风格的文稿。我会帮助你去选择最适合的出版商,来让你的想法得到认可。 +如果你想和一家传统的出版商合作,那么你需要在他们面前推销你的书稿以期望能够得到出版的机会。因为我是 [Pragmatci Bookshelf][4] 的总编,所以经常看到很多的选题,也去帮助作者制作出好的作品。这些选题中有些是好的,有些则不然,但我经常会看到许多不符合我们出版社风格的文稿。我会帮助你找到最适合的出版商,来让你的想法得到认可。 -### 鉴别出你的目标 +### 确定你的目标 -你的第一步是要找出最适合你的想法的出版商。你可以从你较喜欢购买的书籍的出版商开始,你的书会被像你自己一样的人喜欢的几率是很高的,所以从你自己最喜欢的出版商开始将会大大缩小你的搜索范围。如果你自己所买的书籍并不多。你可以去书店逛逛,或者在亚马逊网站上看看。 列一个你自己喜欢的的出版商的清单出来 - -下一步,挑选出你期望的,尽管大多数技术类出版商看起来没什么差别,但他们通常各有不同的读者群体。有些出版商会选择广受欢迎的话题,如 C++ 或者 Java。你以 Elixir 为主题的书籍就可能不适合那个出版商。如果你的书是关于教授小孩学习编程的,你可能就不想让学术出版商来出版。 - -一旦你已经鉴别出一些目标,在他们自己的网站或者亚马逊上对他们进行深一步的调查。 去寻找他们有哪些书籍是和你的思想是相符的。如果他们能有一本和你自己的书籍的主题一样或很相近的书,你将会很难说服他们和你签约。但那并不意味着你已经可以把这样的出版商从你的列表中划掉。你可以将你的书籍的主题进行适当的修改以将它和已经发行的书区别开来:比如定位于不同的读者群体,或者不同层次的技能水平。也许已发行的那本书已经过时了,你就可以专注于在该技术领域里的新方法。确保你的书籍能够弥补现有书的不足,更加完善,而不只是去写完这本书。 - -如果你锁定的出版商没有出版过类似的书籍,也许这将会是个好的机遇,但也许也会很糟糕。有时候一些供应商不会选择去出版一些专业技术方面的书籍,或者是因为他们认为他们的读者不会感兴趣,还可能是因为他们曾经在这块领域遇到过麻烦。新的语言或者类库一直在不停的涌现出来,出版商们不得不去琢磨什么样的书籍内容将会吸引他们的读者群体。他们的评估标准可能和你的是不一样的。唯一的途径是通过投稿来试探。 +你的第一步是要找出最适合你的想法的出版商。首先,想想你经常买书的以及你喜欢的出版商,你的书会被像你自己一样的人喜欢的几率是很高的,所以从你自己最喜欢的出版商开始,列出一个简短的列表将会大大缩小你的搜索范围。如果你自己所买的书籍并不多。那么可以去书店逛逛,或者在亚马逊网站上看看。 列一个你自己喜欢的几家出版商的清单出来。 下一步,筛选出你期望的出版商,尽管大多数技术类出版商看起来没什么差别,但他们通常各有不同的读者群体。有些出版商会选择广受欢迎的话题,如 C++ 或者 Java,那么你以 Elixir 为主题的书稿就可能不适合那个出版商;如果你的书稿是关于教授小孩学习编程的,那么你可能就不想让学术出版商来出版。 一旦确定了一些目标,你就可以在他们的商品目录、网站或者亚马逊上对其进行进一步的调查,去寻找有哪些书籍和你的思想是相符的。如果他们能有一本和你自己的书稿主题一样或很相近的书,那么你将很难说服他们和你签约。但那并不意味着已经可以把这样的出版商从你的列表中划掉,你可以将自己的书稿主题进行适当的修改以将它和已经发行的书区别开来:比如定位于不同的读者群体,或者不同层次的技能水平。也许已发行的那本书已经过时了,你就可以专注于该技术领域里的新方法,确保你的书稿能够弥补现有书的不足,更加完善,而不是单纯的竞争。 如果你锁定的出版商没有出版过类似的书籍,也许这将会是个好迹象,但也许是个坏迹象。有时候一些供应商不会选择去出版一些专业技术方面的书籍,或者是因为他们认为自己的读者不会感兴趣,也可能是因为他们曾经在这块领域遇到过麻烦。新的语言或者类库一直在不停地涌现出来,出版商们不得不去琢磨什么样的书籍内容将会吸引他们的读者群体。他们的评估标准可能和你的是不一样的。他们已经有了最终决定,也可能是还在等待合适的选题。判断究竟是哪一种的唯一方法就是提出文稿并找出答案。 ### 建立起你自己的网络 -鉴别出一家出版商是第一步;现在你首先需要去建立联系。不幸的是,出版业你认识的人却往往不是你所需要找的人。你需要认识的那个人是一个去发现新市场、新作者和新选题的组稿编辑。如果你认识某个和出版商有关系的人,请他帮你介绍认识一位组稿编辑。这些组稿编辑往往负责一个专题板块,尤其是在较大的出版商,但你不必一定要找到符合你的书的专题板块的编辑。任何板块的编辑通常会很乐意将你介绍给符合你的主题的编辑。 +确定一家出版商是第一步;现在你需要与其建立联系。不幸的是,出版需要的仍旧是你认识什么人,而不是你知道什么。你需要认识的那个人是一个去发现新市场、新作者和新选题的策划编辑。如果你认识某个和出版商有关系的人,请他给你介绍一位策划编辑。这些策划编辑往往负责一个专题板块,尤其是在较大的出版商,但你并非一定要找到符合你书稿的专题板块的编辑。各类板块的编辑通常都会很乐意将你介绍给合适的编辑。 + 有时候你也许能够在一个技术会议上找到一个策划编辑,特别是在出版商同时也是赞助商,而且还有一个展台时。即使当时并没有一个策划编辑在场,展台的其他工作人员也能够帮你和策划编辑建立联系。 如果会议不符合你的主题思想,那就需要你利用自己的社交网络来获得别人的推荐。比如使用 LinkedIn,或者其他非正式的联系方式,去和一个编辑建立联系。 对于小型的出版商,你可能会在公司网站上发现策划编辑的名单,如果你够幸运的话,还可以找到他们的联系信息。如果找不到联系方式的话,可以在推特上搜寻出版商的名字,试试能否找到他们的编辑的信息,在社交媒体上去寻找一位陌生的人,然后把自己的书稿推荐给他,这也许会让你有些紧张,但是你真的不必去担心这些,建立联系也是策划编辑的工作之一。最坏的结果只不过是他们忽视你而已。 一旦建立起联系,策划编辑将会协助你进行下一步。他们可能会立刻对你的书稿给予反馈,或者在他们可能想让你根据他们的指导来修改你的文章,使其变得更加充实。当你经过努力找到了一名策划编辑后,多听从他们的建议,因为他们比你更熟悉出版商的运作流程。 -有时候你也许能够在一个技术论坛展会上找到一个组稿编辑,特别是出版商是赞助商,而且还有一个展台时。即使在当时并没有一个组稿编辑在场,在展台的其他员工也能够帮你和组稿编辑建立联系。 如果论坛不符合你的主题思想,你需要利用你的社交网络来获得别人的推荐。使用 LinkedIn,或者其他非正式的联系方式,去和一个编辑建立联系。 +### 如果其他的方法都失败了 -对于小型的出版商,如果你很幸运的话,你可以在他们的公司网站上获得组稿编辑的联系方式。如果找不到联系方式的话,在推特上搜寻出版商的名字,试试能否找到他们的组稿编辑的信息,在社交媒体上去寻找一位陌生的人然后把自己的书推荐给他也许会让你有些紧张担心,但是你真的不必去担心这些,建立联系也是组稿编辑的工作之一。最坏的结果只不过是他们忽视你而已。 - -一旦你建立起联系,组稿编辑将会协助你进行下一步。他们可能会很快对你的书稿给予反馈,或者在他们考虑你的书之前想让你根据他们的指导来修改你的文章,当你经过努力找到了一名组稿编辑后,多听从他们的建议,因为他们比你更熟悉出版商的运作系统。 - -### 如果其它的方法都失败了 - -如果你无法找到一名组稿编辑,出版商通常会有一个书稿盲投proposal alias的方式,通常是 `proposals@[publisher].com` 的格式。 查找他们网站的介绍找到如何去发送书稿;有的出版商是有特殊的要求的。遵循他们的要求,如果把你不这样做的话,你的书将会被丢弃,不会被任何人阅读。如果你有疑问,或者不确定出版商的意图,你需要再尝试着去找一名组稿编辑进一步的沟通,因为书稿并不能回答那些问题。整理他们对你的要求(一篇独立的主题文章),发给他们,然后就去期望能够得到满意的答复。 +如果你无法联系到一名策划编辑,出版商通常会有一个书稿盲投proposal alias的方式来接受投稿,通常是 `proposals@[publisher].com` 的格式。 查找他们网站的介绍,找到如何去发送书稿;有的出版商是有特殊的要求的。你需要遵循他们的要求,如果不这样做的话,你的书稿将会被丢弃,它不会被任何人阅读。如果你有疑问,或者不确定出版商的意图,那么你需要再尝试着去找一名编辑进一步地沟通,因为书稿并不能回答那些问题。整理他们对你的要求(一篇独立的主题文章),发给他们,然后你要做的就是期望能够得到满意的答复。 -### 然后就是……等待 +### 等待 -无论你和一个出版商有着多么密切的联系,你也得等待着。如果你已经投递了书稿,也许要过一段时间才有人去处理你的稿件,特别是在一些大公司。即使你已经找了一位组稿编辑去处理你的投稿,你可能也只是他同时在处理的潜在目标之一,所以你可能不会很快得到答复。几乎所有的出版商都会在最终确认之前召开一次组委会来决定接受哪个稿件,所以即使你的书稿已经足够的优秀可以出版了,你也任然需要等待组委会的最后探讨。你可能需要等待几周的时间,甚至是一个月的时间。 +无论你是如何与一个出版商取得联系的,你也得等待着。如果你已经投递了书稿,也许要过一段时间才有人去处理你的稿件,特别是在一些大公司。即使你已经找了一位策划编辑去处理你的投稿,你可能也只是他同时在处理的潜在目标之一,所以你可能不会很快得到答复。几乎所有的出版商都会在最终确认之前召开一次组委会来决定接受哪个稿件,所以即使你的书稿已经足够的优秀,并且可以出版了,你也仍然需要等待组委会开会讨论。你可能需要等待几周,甚至是一个月的时间。 + 几周过后,你可以和编辑再联系一下,看看他们是否需要更多的信息。在邮件中你要表现出足够的礼貌;如果他们仍然没有回复,也许是因为他们有太多的投稿需要处理,即使你不停地催促也不会让你的稿件被提前处理。一些出版商有可能永远不会回复你,也不会去发一份退稿的通知给你,但那种情况并不常见。在这种情况下你除了耐心地等待也没有别的办法,如果几个月后也没有人回复你邮件,你完全可以去接触另一个出版商或者干脆考虑自出版。 -几周过后,你可以和编辑联系一下看看他们是否需要更多的信息。在邮件中你要表现出足够的礼貌;如果他们仍然回复,也许是因为他们有太多的投稿需要处理,即使你不停的催促也不会让你的稿件被提前处理。一些出版商有可能永远不会回复你,也不会去发一份退稿的通知给你,但那种情况并不常见。在这种情况系你除了耐心的等待也没有别的办法,如果几个月后也没有人回复你邮件,你完全可以去接触另一个出版商或者干脆考虑自己来出版。 +### 祝好运 -### 好运气 - -如果这个过程看起来让你感觉有些混乱和不科学,这是很正常的。能够得到出版要依靠合适的地方、合适的时间,和合适的人探讨,而且还要期待他们此时有好的心情。你无法去控制这些不确定的因素,但是对出版社运作过程的熟悉,了解出版商们的需求,能够帮助你做出一个自己能掌控的最佳选择。 - -寻找一个出版商只是万里长征的第一步。你需要提炼你的想法并创建提案,以及其他方面的考虑。在今年的 SeaGLS 上,我对整个过程的介绍指导有个[演讲][5]。去看看那个[视频][6]获得更多的细节信息。 +如果你觉得这个过程看起来让你感觉有些混乱和不科学,这是很正常的。能够得到出版要在合适的时间地点,与合适的人沟通,而且还要期待他们此时有好的心情。你无法去控制这些不确定的因素,但是更好地了解行业的工作方式,以及出版商的需求,可以帮助你完善它们。 + 寻找一个出版商只是万里长征的第一步。你需要提炼你的思想,并创建选题,以及其他方面的考虑。在今年的 SeaGLS 上,我对整个过程做了[介绍][5]。查看[视频][6]可以获取更详细的信息。 ### 关于作者 [![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/portrait.jpg?itok=b77dlNC4)][7] -麦克唐纳先生现在是 Pragmatic Bookshelf 的主管编辑。在过去的 20 年里,在技术出版领域,他是一名编辑、一名作者、偶尔还去客串演讲者或者讲师。他现在把大量的时间都用来去和新作者探讨如何更好的表达出他们的想法。你可以关注他的推特@bmac_editor。 +麦克唐纳先生现在是 Pragmatic Bookshelf 的总编。过去 20 年在技术出版领域生涯中,他是一名编辑、一名作者,偶尔还去客串演讲者或者讲师。他现在把大量的时间都用来和新作者探讨如何更好地表达出他们的想法。你可以关注他的推特@bmac_editor。 如果这篇文章点燃你写书的热情,但又不知道如何找到合适的途径联系出版商,不如逛逛像异步社区这样的网站,按照上文的步骤尝试一下,也许能够发现新的希望。 -------------------------------------------------------------------------------- @@ -57,7 +44,7 @@ via: https://opensource.com/article/17/12/how-find-publisher-your-book 作者:[Brian MacDonald][a] 译者:[FelixYFZ](https://github.com/FelixYFZ) -校对:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy), 陈聪聪 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2af501fec6fc272c2b952edc15922228c6f604ec Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 29 Dec 2017 17:45:44 +0800 Subject: [PATCH 072/133] PUB:20171201 How to find a publisher for your tech book.md @FelixYFZ https://linux.cn/article-9189-1.html --- .../20171201 How to find a publisher for your tech book.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20171201 How to find a publisher for your tech book.md (100%) diff --git a/translated/tech/20171201 How to find a publisher for your tech book.md b/published/20171201 How to find a publisher for your tech book.md similarity index 100% rename from translated/tech/20171201 How to find a publisher for your tech book.md rename to published/20171201 How to find a publisher for your tech book.md From 0611fb57bd4a2cb82053cb07303fc4e3b398d499 Mon Sep 17 00:00:00 2001 From: zjon Date: Fri, 29 Dec 2017 22:48:27 +0800 Subject: [PATCH 073/133] zjon translating --- ...o enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md b/sources/tech/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md index c6dd0cde73..09016734af 100644 --- a/sources/tech/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md +++ b/sources/tech/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md @@ -1,3 +1,4 @@ +zjon Translating How to enable Nested Virtualization in KVM on CentOS 7 / RHEL 7 ====== **Nested virtualization** means to configure virtualization environment inside a virtual machine. In other words we can say nested virtualization is a feature in the hypervisor which allows us to install & run a virtual machine inside a virtual server via hardware acceleration from the **hypervisor** (host). From 91516b127a975f27df5a310dd3f0345487bec5fb Mon Sep 17 00:00:00 2001 From: zjon Date: Fri, 29 Dec 2017 23:01:36 +0800 Subject: [PATCH 074/133] translated --- ...tualization in KVM on CentOS 7 - RHEL 7.md | 117 ------------------ 1 file changed, 117 deletions(-) delete mode 100644 sources/tech/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md diff --git a/sources/tech/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md b/sources/tech/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md deleted file mode 100644 index 09016734af..0000000000 --- a/sources/tech/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md +++ /dev/null @@ -1,117 +0,0 @@ -zjon Translating -How to enable Nested Virtualization in KVM on CentOS 7 / RHEL 7 -====== -**Nested virtualization** means to configure virtualization environment inside a virtual machine. In other words we can say nested virtualization is a feature in the hypervisor which allows us to install & run a virtual machine inside a virtual server via hardware acceleration from the **hypervisor** (host). - -In this article, we will discuss how to enable nested virtualization in KVM on CentOS 7 / RHEL 7. I am assuming you have already configured KVM hypervisor. In case you have not familiar on how to install and configure **KVM hypervisor** , then refer the following article - -Let's jump into the hypervisor and verify whether nested virtualization is enabled or not on your KVM host - -For Intel based Processors run the command, -``` -[root@kvm-hypervisor ~]# cat /sys/module/kvm_intel/parameters/nested -N -[root@kvm-hypervisor ~]# -``` - -For AMD based Processors run the command, -``` -[root@kvm-hypervisor ~]# cat /sys/module/kvm_amd/parameters/nested -N -[root@kvm-hypervisor ~]# -``` - -In the above command output 'N' indicates that Nested virtualization is disabled. If we get the output as 'Y' then it indicates that nested virtualization is enabled on your host. - -Now to enable nested virtualization, create a file with the name " **/etc/modprobe.d/kvm-nested.conf** " with the following content. -``` -[root@kvm-hypervisor ~]# vi /etc/modprobe.d/kvm-nested.conf -options kvm-intel nested=1 -options kvm-intel enable_shadow_vmcs=1 -options kvm-intel enable_apicv=1 -options kvm-intel ept=1 -``` - -Save & exit the file - -Now remove ' **kvm_intel** ' module and then add the same module with modprobe command. Before removing the module, make sure VMs are shutdown otherwise we will get error message like " **modprobe: FATAL: Module kvm_intel is in use** " -``` -[root@kvm-hypervisor ~]# modprobe -r kvm_intel -[root@kvm-hypervisor ~]# modprobe -a kvm_intel -[root@kvm-hypervisor ~]# -``` - -Now verify whether nested virtualization feature enabled or not. -``` -[root@kvm-hypervisor ~]# cat /sys/module/kvm_intel/parameters/nested -Y -[root@kvm-hypervisor ~]# -``` - -#### - -Test Nested Virtualization - -Let's suppose we have a VM with name "director" on KVM hypervisor on which I have enabled nested virtualization. Before testing, make sure CPU mode for the VM is either as " **host-model** " or " **host-passthrough** " , to check cpu mode of a virtual machine use either Virt-Manager GUI or virsh edit command - -![cpu_mode_vm_kvm][1] - -![cpu_mode_vm_kvm][2] - -Now login to the director VM and run lscpu and lsmod command -``` -[root@kvm-hypervisor ~]# ssh 192.168.126.1 -l root -root@192.168.126.1's password: -Last login: Sun Dec 10 07:05:59 2017 from 192.168.126.254 -[root@director ~]# lsmod | grep kvm -kvm_intel             170200  0 -kvm                   566604  1 kvm_intel -irqbypass              13503  1 kvm -[root@director ~]# -[root@director ~]# lscpu -``` - -![lscpu_command_rhel7_centos7][1] - -![lscpu_command_rhel7_centos7][3] - -Let's try creating a virtual machine either from virtual manager GUI or virt-install inside the director vm, in my case i am using virt-install command -``` -[root@director ~]# virt-install  -n Nested-VM  --description "Test Nested VM"  --os-type=Linux  --os-variant=rhel7  --ram=2048  --vcpus=2  --disk path=/var/lib/libvirt/images/nestedvm.img,bus=virtio,size=10  --graphics none  --location /var/lib/libvirt/images/CentOS-7-x86_64-DVD-1511.iso --extra-args console=ttyS0 -Starting install... -Retrieving file .treeinfo...                                                   | 1.1 kB  00:00:00 -Retrieving file vmlinuz...                                                     | 4.9 MB  00:00:00 -Retrieving file initrd.img...                                                  |  37 MB  00:00:00 -Allocating 'nestedvm.img'                                                      |  10 GB  00:00:00 -Connected to domain Nested-VM -Escape character is ^] -[    0.000000] Initializing cgroup subsys cpuset -[    0.000000] Initializing cgroup subsys cpu -[    0.000000] Initializing cgroup subsys cpuacct -[    0.000000] Linux version 3.10.0-327.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Nov 19 22:10:57 UTC 2015 -……………………………………………… -``` - -![cli-installer-virt-install-command-kvm][1] - -![cli-installer-virt-install-command-kvm][4] - -This confirms that nested virtualization has been enabled successfully as we are able to create virtual machine inside a virtual machine. - -This Concludes the article, please do share your feedback and comments. - --------------------------------------------------------------------------------- - -via: https://www.linuxtechi.com/enable-nested-virtualization-kvm-centos-7-rhel-7/ - -作者:[Pradeep Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linuxtechi.com -[1]:https://www.linuxtechi.com/wp-content/plugins/lazy-load/images/1x1.trans.gif -[2]:https://www.linuxtechi.com/wp-content/uploads/2017/12/cpu_mode_vm_kvm.jpg -[3]:https://www.linuxtechi.com/wp-content/uploads/2017/12/lscpu_command_rhel7_centos7-1024x408.jpg -[4]:https://www.linuxtechi.com/wp-content/uploads/2017/12/cli-installer-virt-install-command-kvm.jpg From 0746e5a3b26b96753a264bdfb114c8c29eac4ce1 Mon Sep 17 00:00:00 2001 From: zjon Date: Fri, 29 Dec 2017 23:05:24 +0800 Subject: [PATCH 075/133] update translated --- ...tualization in KVM on CentOS 7 - RHEL 7.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 translated/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md diff --git a/translated/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md b/translated/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md new file mode 100644 index 0000000000..a43e2889ae --- /dev/null +++ b/translated/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md @@ -0,0 +1,123 @@ +zjon Translating +如何在 CentOS 7 / RHEL 7 的 KVM 上启用嵌套虚拟化 +====== +**嵌套虚拟化**意味着在虚拟机内配置虚拟化环境。换句话说,我们可以说嵌套虚拟化是虚拟机管理程序的一个特性,它允许我们通过**虚拟化管理程序**(主机)的硬件加速在虚拟服务器内安装核运行虚拟机。 + +在这篇文章中,我们将讨论如何在 CentOS 7 / RHEL 7 的 KVM 上启用嵌套虚拟化。我假定您已经配置过 KVM 管理程序。如果您不熟悉如何安装和配置 KVM 管理程序,请参考一下文章。 + +让我们跳进虚拟化管理程序,验证您的 KVM 主机是否启用了嵌套虚拟化。 + + +基于 Intel 的处理器运行以下命令, +``` +[root@kvm-hypervisor ~]# cat /sys/module/kvm_intel/parameters/nested +N +[root@kvm-hypervisor ~]# +``` + +基于 AMD 的处理器运行以下命令, + +``` +[root@kvm-hypervisor ~]# cat /sys/module/kvm_amd/parameters/nested +N +[root@kvm-hypervisor ~]# +``` + +一下命令输出 'N' 表示嵌套虚拟化是禁用的。如果我们得到的输出是 'Y' 则表示在您的主机已启用嵌套虚拟化 + +现在启用嵌套虚拟化,使用以下内容创建一个文件名为 "**/etc/modprobe.d/kvm-nested.conf**" 的文件 +``` +[root@kvm-hypervisor ~]# vi /etc/modprobe.d/kvm-nested.conf +options kvm-intel nested=1 +options kvm-intel enable_shadow_vmcs=1 +options kvm-intel enable_apicv=1 +options kvm-intel ept=1 +``` + +保存并退出文件 + +现在移除 '**kvm_intel**' 模块然后通过 modprobe 命令添加同样的模块。在移除模块之前,确保虚拟机已关机,否则我们会得到像 "**modprobe: FATAL: Module kvm_intel is in use**" 这样的错误信息。 +``` +[root@kvm-hypervisor ~]# modprobe -r kvm_intel +[root@kvm-hypervisor ~]# modprobe -a kvm_intel +[root@kvm-hypervisor ~]# +``` + +现在验证嵌套虚拟化功能是否启用。 +``` +[root@kvm-hypervisor ~]# cat /sys/module/kvm_intel/parameters/nested +Y +[root@kvm-hypervisor ~]# +``` + +#### + +测试嵌套虚拟化 + +假设我们在 KVM 管理程序上有一台名为 "director" 的虚拟机,我已经启用了嵌套虚拟化。在测试之前,确保 CPU 模式为 "host-modle" 或 "host-passthrough" ,使用 Virt-Manager 或 virtsh 编译命令检查虚拟机 cpu 模式。 + +![cpu_mode_vm_kvm][1] + +![cpu_mode_vm_kvm][2] + +现在登录 director 这台虚拟机并运行 lscpu 和 lsmod 命令 + +``` +[root@kvm-hypervisor ~]# ssh 192.168.126.1 -l root +root@192.168.126.1's password: +Last login: Sun Dec 10 07:05:59 2017 from 192.168.126.254 +[root@director ~]# lsmod | grep kvm +kvm_intel             170200  0 +kvm                   566604  1 kvm_intel +irqbypass              13503  1 kvm +[root@director ~]# +[root@director ~]# lscpu +``` + +![lscpu_command_rhel7_centos7][1] + +![lscpu_command_rhel7_centos7][3] + +让我们试着在 director 这台虚拟机的虚拟管理器 GUI 或 virt-install 创建一台虚拟机,在我的情况下我使用 virt-install 命令 + +``` +[root@director ~]# virt-install  -n Nested-VM  --description "Test Nested VM"  --os-type=Linux  --os-variant=rhel7  --ram=2048  --vcpus=2  --disk path=/var/lib/libvirt/images/nestedvm.img,bus=virtio,size=10  --graphics none  --location /var/lib/libvirt/images/CentOS-7-x86_64-DVD-1511.iso --extra-args console=ttyS0 +Starting install... +Retrieving file .treeinfo...                                                   | 1.1 kB  00:00:00 +Retrieving file vmlinuz...                                                     | 4.9 MB  00:00:00 +Retrieving file initrd.img...                                                  |  37 MB  00:00:00 +Allocating 'nestedvm.img'                                                      |  10 GB  00:00:00 +Connected to domain Nested-VM +Escape character is ^] +[    0.000000] Initializing cgroup subsys cpuset +[    0.000000] Initializing cgroup subsys cpu +[    0.000000] Initializing cgroup subsys cpuacct +[    0.000000] Linux version 3.10.0-327.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Nov 19 22:10:57 UTC 2015 +……………………………………………… +``` + +![cli-installer-virt-install-command-kvm][1] + +![cli-installer-virt-install-command-kvm][4] + +这证实了嵌套虚拟化已成功启用,因为我们能在虚拟机内创建虚拟机。 + +这篇文章到此结束,请分享您的反馈和意见。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/enable-nested-virtualization-kvm-centos-7-rhel-7/ + +作者:[Pradeep Kumar][a] +译者:[zjon](https://github.com/zjon) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linuxtechi.com +[1]:https://www.linuxtechi.com/wp-content/plugins/lazy-load/images/1x1.trans.gif +[2]:https://www.linuxtechi.com/wp-content/uploads/2017/12/cpu_mode_vm_kvm.jpg +[3]:https://www.linuxtechi.com/wp-content/uploads/2017/12/lscpu_command_rhel7_centos7-1024x408.jpg +[4]:https://www.linuxtechi.com/wp-content/uploads/2017/12/cli-installer-virt-install-command-kvm.jpg + + From da1f3cc9b5f379eab644437f49081b248fdbaa84 Mon Sep 17 00:00:00 2001 From: zjon Date: Fri, 29 Dec 2017 23:09:40 +0800 Subject: [PATCH 076/133] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/{ => tech}/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md (100%) diff --git a/translated/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md b/translated/tech/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md similarity index 100% rename from translated/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md rename to translated/tech/20171212 How to enable Nested Virtualization in KVM on CentOS 7 - RHEL 7.md From 2df0fa8de6470522b0da2d144e3a23b22d04911a Mon Sep 17 00:00:00 2001 From: Markgolzh Date: Fri, 29 Dec 2017 23:19:34 +0800 Subject: [PATCH 077/133] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=AD=20by=20zky0?= =?UTF-8?q?01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 非常感兴趣的话题,马甲不管是markgolzh还是zky001,都会仔仔细细认认真真拿出最高水平翻译这篇文章。 --- sources/tech/20171222 10 keys to quick game development.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20171222 10 keys to quick game development.md b/sources/tech/20171222 10 keys to quick game development.md index e65ad11812..05b92883a3 100644 --- a/sources/tech/20171222 10 keys to quick game development.md +++ b/sources/tech/20171222 10 keys to quick game development.md @@ -1,3 +1,4 @@ +翻译中 by zky001 10 keys to quick game development ====== ![配图](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb) @@ -71,7 +72,7 @@ Have you participated in Open Jam or another a game jam and have other advice? O via: https://opensource.com/article/17/12/10-keys-rapid-open-source-game-development 作者:[Ryan Estes][a] -译者:[译者ID](https://github.com/译者ID) +译者:[zky001](https://github.com/zky001) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4122031e10ddfdc99067432c649293f481d56e88 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 30 Dec 2017 00:19:44 +0800 Subject: [PATCH 078/133] PRF&PUB:20171206 10 useful ncat (nc) Command Examples for Linux Systems.md @lujun9972 --- ...(nc) Command Examples for Linux Systems.md | 212 ++++++++++++++++++ ...(nc) Command Examples for Linux Systems.md | 199 ---------------- 2 files changed, 212 insertions(+), 199 deletions(-) create mode 100644 published/20171206 10 useful ncat (nc) Command Examples for Linux Systems.md delete mode 100644 translated/tech/20171206 10 useful ncat (nc) Command Examples for Linux Systems.md diff --git a/published/20171206 10 useful ncat (nc) Command Examples for Linux Systems.md b/published/20171206 10 useful ncat (nc) Command Examples for Linux Systems.md new file mode 100644 index 0000000000..9b686b1f6a --- /dev/null +++ b/published/20171206 10 useful ncat (nc) Command Examples for Linux Systems.md @@ -0,0 +1,212 @@ +10 个例子教你学会 ncat (nc) 命令 +====== + +[![nc-ncat-command-examples-Linux-Systems](https://www.linuxtechi.com/wp-content/uploads/2017/12/nc-ncat-command-examples-Linux-Systems.jpg)][1] + +`ncat` 或者说 `nc` 是一款功能类似 `cat` 的工具,但是是用于网络的。它是一款拥有多种功能的 CLI 工具,可以用来在网络上读、写以及重定向数据。 它被设计成可以被脚本或其他程序调用的可靠的后端工具。同时由于它能创建任意所需的连接,因此也是一个很好的网络调试工具。 + +`ncat`/`nc` 既是一个端口扫描工具,也是一款安全工具,还能是一款监测工具,甚至可以做为一个简单的 TCP 代理。 由于有这么多的功能,它被誉为是网络界的瑞士军刀。 这是每个系统管理员都应该知道并且掌握它。 + +在大多数 Debian 发行版中,`nc` 是默认可用的,它会在安装系统的过程中自动被安装。 但是在 CentOS 7 / RHEL 7 的最小化安装中,`nc` 并不会默认被安装。 你需要用下列命令手工安装。 + +``` +[root@linuxtechi ~]# yum install nmap-ncat -y +``` + +系统管理员可以用它来审计系统安全,用它来找出开放的端口然后保护这些端口。 管理员还能用它作为客户端来审计 Web 服务器、telnet 服务器、邮件服务器等, 通过 `nc` 我们可以控制发送的每个字符,也可以查看对方的回应。 + +我们还可以用它捕获客户端发送的数据以此来了解这些客户端是做什么的。 + +在本文中,我们会通过 10 个例子来学习如何使用 `nc` 命令。 + +### 例子: 1) 监听入站连接 + +通过 `-l` 选项,`ncat` 可以进入监听模式,使我们可以在指定端口监听入站连接。 完整的命令是这样的: + +``` +$ ncat -l port_number +``` + +比如, + +``` +$ ncat -l 8080 +``` + +服务器就会开始在 8080 端口监听入站连接。 + +### 例子: 2) 连接远程系统 + +使用下面命令可以用 `nc` 来连接远程系统, + +``` +$ ncat IP_address port_number +``` + +让我们来看个例子, + +``` +$ ncat 192.168.1.100 80 +``` + +这会创建一个连接,连接到 IP 为 192.168.1.100 的服务器上的 80 端口,然后我们就可以向服务器发送指令了。 比如我们可以输入下面内容来获取完整的网页内容 + +``` +GET / HTTP/1.1 +``` + +或者获取页面名称, + +``` +GET / HTTP/1.1 +``` + +或者我们可以通过以下方式获得操作系统指纹标识, + +``` +HEAD / HTTP/1.1 +``` + +这会告诉我们使用的是什么软件来运行这个 web 服务器的。 + +### 例子: 3) 连接 UDP 端口 + +默认情况下,`nc` 创建连接时只会连接 TCP 端口。 不过我们可以使用 `-u` 选项来连接到 UDP 端口, + +``` +$ ncat -l -u 1234 +``` + +现在我们的系统会开始监听 UDP 的 1234 端口,我们可以使用下面的 `netstat` 命令来验证这一点, + +``` +$ netstat -tunlp | grep 1234 +udp 0 0 0.0.0.0:1234 0.0.0.0:* 17341/nc +udp6 0 0 :::1234 :::* 17341/nc +``` + +假设我们想发送或者说测试某个远程主机 UDP 端口的连通性,我们可以使用下面命令, + +``` +$ ncat -v -u {host-ip} {udp-port} +``` + +比如: + +``` +[root@localhost ~]# ncat -v -u 192.168.105.150 53 +Ncat: Version 6.40 ( http://nmap.org/ncat ) +Ncat: Connected to 192.168.105.150:53。 +``` + +### 例子: 4) 将 `nc` 作为聊天工具 + +`nc` 也可以作为聊天工具来用,我们可以配置服务器监听某个端口,然后从远程主机上连接到服务器的这个端口,就可以开始发送消息了。 在服务器这端运行: + +``` +$ ncat -l 8080 +``` + +在远程客户端主机上运行: + +``` +$ ncat 192.168.1.100 8080 +``` + +之后开始发送消息,这些消息会在服务器终端上显示出来。 + +### 例子: 5) 将 `nc` 作为代理 + +`nc` 也可以用来做代理。比如下面这个例子, + +``` +$ ncat -l 8080 | ncat 192.168.1.200 80 +``` + +所有发往我们服务器 8080 端口的连接都会自动转发到 192.168.1.200 上的 80 端口。 不过由于我们使用了管道,数据只能被单向传输。 要同时能够接受返回的数据,我们需要创建一个双向管道。 使用下面命令可以做到这点: + +``` +$ mkfifo 2way +$ ncat -l 8080 0<2way | ncat 192.168.1.200 80 1>2way +``` + +现在你可以通过 `nc` 代理来收发数据了。 + +### 例子: 6) 使用 `nc` 拷贝文件 + +`nc` 还能用来在系统间拷贝文件,虽然这么做并不推荐,因为绝大多数系统默认都安装了 `ssh`/`scp`。 不过如果你恰好遇见个没有 `ssh`/`scp` 的系统的话, 你可以用 `nc` 来作最后的努力。 + +在要接受数据的机器上启动 `nc` 并让它进入监听模式: + +``` +$ ncat -l 8080 > file.txt +``` + +现在去要被拷贝数据的机器上运行下面命令: + +``` +$ ncat 192.168.1.100 8080 --send-only < data.txt +``` + +这里,`data.txt` 是要发送的文件。 `-–send-only` 选项会在文件拷贝完后立即关闭连接。 如果不加该选项, 我们需要手工按下 `ctrl+c` 来关闭连接。 + +我们也可以用这种方法拷贝整个磁盘分区,不过请一定要小心。 + +### 例子: 7) 通过 `nc` 创建后门 + +`nc` 命令还可以用来在系统中创建后门,并且这种技术也确实被黑客大量使用。 为了保护我们的系统,我们需要知道它是怎么做的。 创建后门的命令为: + +``` +$ ncat -l 10000 -e /bin/bash +``` + +`-e` 标志将一个 bash 与端口 10000 相连。现在客户端只要连接到服务器上的 10000 端口就能通过 bash 获取我们系统的完整访问权限: + +``` +$ ncat 192.168.1.100 10000 +``` + +### 例子: 8) 通过 `nc` 进行端口转发 + +我们通过选项 `-c` 来用 `nc` 进行端口转发,实现端口转发的语法为: + +``` +$ ncat -u -l 80 -c 'ncat -u -l 8080' +``` + +这样,所有连接到 80 端口的连接都会转发到 8080 端口。 + +### 例子: 9) 设置连接超时 + +`nc` 的监听模式会一直运行,直到手工终止。 不过我们可以通过选项 `-w` 设置超时时间: + +``` +$ ncat -w 10 192.168.1.100 8080 +``` + +这回导致连接 10 秒后终止,不过这个选项只能用于客户端而不是服务端。 + +### 例子: 10) 使用 `-k` 选项强制 `nc` 待命 + +当客户端从服务端断开连接后,过一段时间服务端也会停止监听。 但通过选项 `-k` 我们可以强制服务器保持连接并继续监听端口。 命令如下: + +``` +$ ncat -l -k 8080 +``` + +现在即使来自客户端的连接断了也依然会处于待命状态。 + +自此我们的教程就完了,如有疑问,请在下方留言。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/nc-ncat-command-examples-linux-systems/ + +作者:[Pradeep Kumar][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linuxtechi.com/author/pradeep/ +[1]:https://www.linuxtechi.com/wp-content/uploads/2017/12/nc-ncat-command-examples-Linux-Systems.jpg diff --git a/translated/tech/20171206 10 useful ncat (nc) Command Examples for Linux Systems.md b/translated/tech/20171206 10 useful ncat (nc) Command Examples for Linux Systems.md deleted file mode 100644 index 914aea87ea..0000000000 --- a/translated/tech/20171206 10 useful ncat (nc) Command Examples for Linux Systems.md +++ /dev/null @@ -1,199 +0,0 @@ -10 个例子教你学会 ncat (nc) 命令 -====== - [![nc-ncat-command-examples-Linux-Systems](https://www.linuxtechi.com/wp-content/uploads/2017/12/nc-ncat-command-examples-Linux-Systems.jpg)][1] - -ncat 或者说 nc 是一款功能类似 cat 的网络工具。它是一款拥有多种功能的 CLI 工具,可以用来在网络上读,写以及重定向数据。 它被设计成可以被脚本或其他程序调用的可靠后端工具。 同时由于它能创建任意所需的连接,因此也是一个很好的网络调试工具。 - -ncat/nc 既是一个端口扫描工具,也是一款安全工具, 还能是一款检测工具,甚至可以做一个简单的 TCP 代理。 由于有这么多的功能,它被誉为是网络界的瑞士军刀。 这是每个系统管理员都应该知道并且掌握它。 - -在大多数 Debian 发行版中,`nc` 是默认可用的,它会在安装系统的过程中自动被安装。 但是在 CentOS 7 / RHEL 7 的最小化安装中,`nc` 并不会默认被安装。 你需要用下列命令手工安装。 - -``` -[root@linuxtechi ~]# yum install nmap-ncat -y -``` - -系统管理员可以用它来审计系统安全,用它来找出开放的端口然后保护这些端口。 管理员还能用它作为客户端来审计 Web 服务器, 远程登陆服务器, 邮件服务器等, 通过 `nc` 我们可以控制发送的每个字符,也可以查看对方的回应。 - -我们还可以 o 用它捕获客户端发送的数据一次来了解这些客户端是做什么的。 - -在本文中,我们会通过 10 个例子来学习如何使用 `nc` 命令。 - -### 例子: 1) 监听入站连接 - -通过 `l` 选项,ncat 可以进入监听模式,使我们可以在指定端口监听入站连接。 完整的命令是这样的 - -$ ncat -l port_number - -比如, - -``` -$ ncat -l 8080 -``` - -服务器就会开始在 8080 端口监听入站连接。 - -### 例子: 2) 连接远程系统 - -使用下面命令可以用 nc 来连接远程系统, - -$ ncat IP_address port_number - -让我们来看个例子, - -``` -$ ncat 192。168。1。100 80 -``` - -这会创建一个连接,连接到 IP 为 192。168。1。100 的服务器上的 80 端口,然后我们就可以向服务器发送指令了。 比如我们可以输入下面内容来获取完整的网页内容 - -GET / HTTP/1.1 - -或者获取页面名称, - -GET / HTTP/1.1 - -或者我们可以通过以下方式获得操作系统指纹标识, - -HEAD / HTTP/1.1 - -这会告诉我们使用的是什么软件来运行这个 web 服务器的。 - -### 例子: 3) 连接 UDP 端口 - -默认情况下,nc 创建连接时只会连接 TCP 端口。 不过我们可以使用 `u` 选项来连接到 UDP 端口, - -``` -$ ncat -l -u 1234 -``` - -现在我们的系统会开始监听 udp 的'1234'端口,我们可以使用下面的 netstat 命令来验证这一点, - -``` -$ netstat -tunlp | grep 1234 -udp 0 0 0。0。0。0:1234 0。0。0。0:* 17341/nc -udp6 0 0 :::1234 :::* 17341/nc -``` - -假设我们想发送或者说测试某个远程主机 UDP 端口的连通性,我们可以使用下面命令, - -$ ncat -v -u {host-ip} {udp-port} - -比如: - -``` -[root@localhost ~]# ncat -v -u 192。168。105。150 53 -Ncat: Version 6。40 ( http://nmap.org/ncat ) -Ncat: Connected to 192。168。105。150:53。 -``` - -#### 例子: 4) 将 NC 作为聊天工具 - -NC 也可以作为聊天工具来用,我们可以配置服务器监听某个端口,然后从远程主机上连接到服务器的这个端口,就可以开始发送消息了。 在服务器这端运行: - -``` -$ ncat -l 8080 -``` - -在远程客户端主机上运行: - -``` -$ ncat 192。168。1。100 8080 -``` - -之后开始发送消息,这些消息会在服务器终端上显示出来。 - -#### 例子: 5) 将 NC 作为代理 - -NC 也可以用来做代理。比如下面这个例子, - -``` -$ ncat -l 8080 | ncat 192。168。1。200 80 -``` - -所有发往我们服务器 8080 端口的连接都会自动转发到 192。168。1。200 上的 80 端口。 不过由于我们使用了管道,数据只能被单向传输。 要同时能够接受返回的数据,我们需要创建一个双向管道。 使用下面命令可以做到这点: - -``` -$ mkfifo 2way -$ ncat -l 8080 0<2way | ncat 192。168。1。200 80 1>2way -``` - -现在你可以通过 nc 代理来收发数据了。 - -#### 例子: 6) 使用 nc/ncat 拷贝文件 - -NC 还能用来在系统间拷贝文件,虽然这么做并不推荐,因为绝大多数系统默认都安装了 ssh/scp。 不过如果你恰好遇见个没有 ssh/scp 的系统的话, 你可以用 nc 来作最后的努力。 - -在要接受数据的机器上启动 nc 并让它进入监听模式: - -``` -$ ncat -l 8080 > file.txt -``` - -现在去要被拷贝数据的机器上运行下面命令: - -``` -$ ncat 192。168。1。100 8080 --send-only < data.txt -``` - -这里,data.txt 是要发送的文件。 –send-only 选项会在文件拷贝完后立即关闭连接。 如果不加该选项, 我们需要手工按下 ctrl+c to 来关闭连接。 - -我们也可以用这种方法拷贝整个磁盘分区,不过请一定要小心。 - -#### 例子: 7) 通过 nc/ncat 创建后门 - -NC 命令还可以用来在系统中创建后门,并且这种技术也确实被黑客大量使用。 为了保护我们的系统,我们需要知道它是怎么做的。 创建后门的命令为: - -``` -$ ncat -l 10000 -e /bin/bash -``` - -‘e‘ 标志将一个 bash 与端口 10000 相连。现在客户端只要连接到服务器上的 10000 端口就能通过 bash 获取我们系统的完整访问权限: - -``` -$ ncat 192。168。1。100 10000 -``` - -#### 例子: 8) 通过 nc/ncat 进行端口转发 - -我们通过选项 `c` 来用 NC 进行端口转发,实现端口转发的语法为: - -``` -$ ncat -u -l 80 -c 'ncat -u -l 8080' -``` - -这样,所有连接到 80 端口的连接都会转发到 8080 端口。 - -#### 例子: 9) 设置连接超时 - -ncat 的监听模式会一直运行,直到手工终止。 不过我们可以通过选项 `w` 设置超时时间: - -``` -$ ncat -w 10 192。168。1。100 8080 -``` - -这回导致连接 10 秒后终止,不过这个选项只能用于客户端而不是服务端。 - -#### 例子: 10) 使用 -k 选项强制 ncat 待命 - -当客户端从服务端断开连接后,过一段时间服务端也会停止监听。 但通过选项 `k` 我们可以强制服务器保持连接并继续监听端口。 命令如下: - -``` -$ ncat -l -k 8080 -``` - -现在即使来自客户端的连接断了也依然会处于待命状态。 - -自此我们的教程就完了,如有疑问,请在下方留言。 - --------------------------------------------------------------------------------- - -via: https://www.linuxtechi.com/nc-ncat-command-examples-linux-systems/ - -作者:[Pradeep Kumar][a] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linuxtechi.com/author/pradeep/ -[1]:https://www.linuxtechi.com/wp-content/uploads/2017/12/nc-ncat-command-examples-Linux-Systems.jpg From 0172c808cfa9c2019971da3f5b4433d8271c86f7 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 14:13:15 +0800 Subject: [PATCH 079/133] translate done: 20171121 How to organize your passwords using pass password manager.md --- ...r passwords using pass password manager.md | 150 ------------------ ...r passwords using pass password manager.md | 150 ++++++++++++++++++ 2 files changed, 150 insertions(+), 150 deletions(-) delete mode 100644 sources/tech/20171121 How to organize your passwords using pass password manager.md create mode 100644 translated/tech/20171121 How to organize your passwords using pass password manager.md diff --git a/sources/tech/20171121 How to organize your passwords using pass password manager.md b/sources/tech/20171121 How to organize your passwords using pass password manager.md deleted file mode 100644 index 5cd203e403..0000000000 --- a/sources/tech/20171121 How to organize your passwords using pass password manager.md +++ /dev/null @@ -1,150 +0,0 @@ -translating by lujun9972 -How to organize your passwords using pass password manager -====== - -### Objective - -Learn to organize your passwords using the "pass" password manager on linux - -### Requirements - - * Root permissions needed to install required packages - -### Difficulty - -EASY - -### Conventions - - * **#** \- requires given command to be executed with root privileges either directly as a root user or by use of `sudo` command - * **$** \- given command to be executed as a regular non-privileged user -### Introduction - -If you have the good habit to never use the same password for more than one purpose, you have probably already felt the need for a password manager. There are many alternatives to choose from on linux, both proprietary (if you dare) and open source. If you, like me, think that simplicity it's the way to go, you may be interested in knowing however to use the `pass` utility. - -### First steps - -Pass it's a password manager that it's really a wrapper on well trusted and useful tools that you probably already use every day, like `gpg` and `git`. Although graphical interfaces exists for it, it is designed to work from command line: therefore it will work even on headless machines. - -### Step 1 - installation - -Pass it's easily available on the majority of linux distributions, you can obtain via package manager: - -#### Fedora -``` -# dnf install pass -``` - -#### RHEL and CentOS - -Pass is not available in the official repositories, but you can obtain it from `epel`. To make the latter source available on CentOS7, all you have to do is: -``` -# yum install epel-release -``` - -On Red Hat Enterprise Linux, however, the package that enables this extra source it's not available; you can download it from the official EPEL site. - -#### Debian and Ubuntu -``` -# apt-get install pass -``` - -#### Arch Linux -``` -# pacman -S pass -``` - -### Initialize the password store - -Once we have `pass` installed, we can begin to use it and configure it. First of all, since pass relies on `gpg` to encrypt our passwords and store it in a secure way, we must have a `gpg keypair` already in place. - -First thing to do is to initialize the `password store`: this is simply the directory where all your gpg-encrypted password will be saved. By default it will be created as a hidden directory inside your `$HOME`, however you can specify an alternative path, by using the `PASSWORD_STORE_DIR` environment variable. Let's proceed: -``` -$ pass init -``` - -The `password-store` directory will be created. Now, let's try to store our first password: -``` -$ pass edit mysite -``` - -At this point an instance of our default text editor will be opened, and all we have to do is to enter our password in it. The file will be encrypted using gpg, and stored as `mysite.gpg` inside the password-store directory. - -Pass stores encrypted files in a directory tree, which means that we can logically group more files in subdirectories to obtain a better organization, we will just have to specify it on file creation, for example: -``` -$ pass edit foo/bar -``` - -Just as above, this will prompt for password insertion, but the file will be created inside the `foo` subdirectory of the password store. To visualize the file structure, all we have to do is to use the `pass` command without any arguments: -``` - -$ pass -Password Store -├── foo -│   └── bar -└── mysite - -``` - -Whenever we need to modify our password, we will just have to repeat the same command used to create it, as shown above. - -### Access the passwords - -There are basically two ways we can access our password: the first one is to display it on the terminal, by using: -``` -pass mysite -``` - -However a better way is to let pass copy it directly to the clipboard, by using the `-c` option: -``` -pass -c mysite -``` - -In this case the clipboard will be cleared after `45` seconds. In both cases, a prompt will appear where you will have to insert your gpg password. - -### Generate passwords - -Pass can also generate (and automatically store) secure passwords for us. Say we want to generate a password composed by 15 characters: alphanumeric and symbols. The command to use will be: -``` -pass generate mysite 15 -``` - -If we want our password to contain only alphanumeric characters we can use the `--no-symbols` option. The generated password will displayed onscreen. Alternatively, it can be copied directly to the clipboard, using the `--clip` or `-c` option. You can even generate a QR code, by using the `-q` or `--qrcode` option: - -![qrcode][1] - -As you can see from the screenshot above, the qrcode has been generated, but since a password for `mysite` already existed at the time we invoked the command, pass showed a prompt to let us confirm that we want to override it. - -Pass uses the `/dev/urandom` device as a (pseudo) random data generator to create the passwords, while it uses the `xclip` utility to copy them to the clipboard, and `qrencode` to display them as qrcodes. This modularity is, in my opinion, its greatest strength: it doesn't reinvent anything, it just wraps common used tools to reach its goal. - -You can also rename, copy or delete files from the password store, respectively using the `pass mv`, `pass cp`, or `pass rm` commands. - -### Using the password store as a git repository - -Another great feature of `pass` is that it can treat the password store as a git repository: letting us manage our password more easily, under a version control system. -``` -pass git init -``` - -This will create the git repository, and automatically create a commit with all the existing files. The next step is to specify the remote repository to track: -``` -pass git remote add -``` - -We can manage this repository just like we do with all other repository we use. The only "difference" is that every time we add or modify a password, `pass` will automatically add the file to the index and create a commit. - -A graphical interface exists for `pass`, it is called `qtpass` and it's available also for Windows and MacOs. It's also possible to access the password store from firefox, using the `PassFF` extension. You will find more detailed informations on the project site. Go on an try `pass`, you will not regret it! - - --------------------------------------------------------------------------------- - -via: https://linuxconfig.org/how-to-organize-your-passwords-using-pass-password-manager - -作者:[Egidio Docile][a] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://linuxconfig.org -[1]:/images/pass-manager-qrcode.png diff --git a/translated/tech/20171121 How to organize your passwords using pass password manager.md b/translated/tech/20171121 How to organize your passwords using pass password manager.md new file mode 100644 index 0000000000..b129a5daf9 --- /dev/null +++ b/translated/tech/20171121 How to organize your passwords using pass password manager.md @@ -0,0 +1,150 @@ +使用 pass 密码管理器管理你的密码 +====== + +### 目标 + +学习使用 "pass" 密码管理器来组织你的密码 + +### 需求 + + * 需要 root 权限来安装需要的包 + +### 难度 + +简单 + +### 约定 + + * **#** - 执行指定命令需要 root 权限,可以是直接使用 root 用户来执行或者使用 `sudo` 命令来执行 + * **$** - 使用非特权普通用户执行指定命令 + +### 介绍 + +如果你有根据目的不同设置不同密码的好习惯,你可能已经感受到要一个密码管理器的必要性了。在 Linux 上有很多选择,可以是专利软件(如果你敢的话)也可以是开源软件。如果你跟我一样喜欢简洁的话,你可能会对 `pass` 感兴趣。 + +### First steps + +Pass 作为一个密码管理器,其实际上是对类似 `gpg` 和 `git` 等可信赖的实用工具的一种封装。虽然它也有图形界面,但它专门设计能成在命令行下工作的:因此它也可以在 headless machines 上工作 (LCTT 注:根据 wikipedia 的说法,所谓 headless machines 是指没有显示器、键盘和鼠标的机器,一般通过网络链接来控制)。 + +### 步骤 1 - 安装 + +Pass 在主流的 linux 发行版中都是可用的,你可以通过包管理器安装: + +#### Fedora +``` +# dnf install pass +``` + +#### RHEL and CentOS + +Pass 不在官方仓库中,但你可以从 `epel` 中获取道它。要在 CentOS7 上启用后面这个源,只需要执行: +``` +# yum install epel-release +``` + +然而在 Red Hat 企业版的 Linux 上,这个额外的源是不可用的;你需要从官方的 EPEL 网站上下载它。 + +#### Debian and Ubuntu +``` +# apt-get install pass +``` + +#### Arch Linux +``` +# pacman -S pass +``` + +### 初始化密码仓库 + +安装好 `pass` 后,就可以开始使用和配置它了。首先,由于 pass 依赖 `gpg` 来对我们的密码进行加密并以安全的方式进行存储,我们必须准备好一个 `gpg 密钥对`。 + +首先我们要初始化 `密码仓库`:这就是一个用来存放 gpg 加密后的密码的目录。默认情况下它会在你的 `$HOME` 创建一个隐藏目录,不过你也可以通过使用 `PASSWORD_STORE_DIR` 这一环境变量来指定另一个路径。让我们运行: +``` +$ pass init +``` + +然后`密码仓库`目录就创建好了。现在,让我们来存储我们第一个密码: +``` +$ pass edit mysite +``` + +这会打开默认文本编辑器,我么只需要输入密码就可以了。输入的内容会用 gpg 加密并存储为密码仓库目录中的 `mysite.gpg` 文件。 + +Pass 以目录树的形式存储加密后的文件,也就是说我们可以在逻辑上将多个文件放在子目录中以实现更好的组织形式,我们只需要在创建文件时指定存在哪个目录下就行了,像这样: +``` +$ pass edit foo/bar +``` + +跟上面的命令一样,它也会让你输入密码,但是创建的文件是放在密码仓库目录下的 `foo` 子目录中的。要查看文件组织结构,只需要不带任何参数运行 `pass` 命令即可: +``` + +$ pass +Password Store +├── foo +│   └── bar +└── mysite + +``` + +若想修改密码,只需要重复创建密码的操作就行了。 + +### 获取密码 + +有两种方法可以获取密码:第一种会显示密码到终端上,方法是运行: +``` +pass mysite +``` + +然而更好的方法是使用 `-c` 选项让 pass 将密码直接拷贝道粘帖板上: +``` +pass -c mysite +``` + +这种情况下粘帖板中的内容会在 `45` 秒后自动清除。两种方法都会要求你输入 gpg 密码。 + +### 生成密码 + +Pass 也可以为我们自动生成(并自动存储)安全密码。假设我们想要生成一个由 15 个字符组成的密码:包含字母,数字和特殊符号,其命令如下: +``` +pass generate mysite 15 +``` + +若希望密码只包含字母和数字则可以是使用 `--no-symbols` 选项。生成的密码会显示在屏幕上。也可以通过 `--clip` 或 `-c` 选项让 pass 吧密码直接拷贝到粘帖板中。通过使用 `-q` 或 `--qrcode` 选项来生成二维码: + +![qrcode][1] + +从上面的截屏中尅看出,生成了一个二维码,不过由于 `mysite` 的密码以及存在了,pass 会提示我们确认是否要覆盖原密码。 + +Pass 使用 `/dev/urandom` 设备作为(伪)随机数据生成器来生成密码,同时它使用 `xclip` 工具来将密码拷贝到粘帖板中,同时使用 `qrencode` 来将密码以二维码的形式显示出来。在我看来,这种模块化的设计正是它最大的优势:它并不重复造轮子,而只是将常用的工具包装起来完成任务。 + +你也可以使用 `pass mv`,`pass cp`,和 `pass rm` 来重命名,拷贝和删除密码仓库中的文件。 + +### 将密码仓库变成 git 仓库 + +`pass` 另一个很棒的功能就是可以将密码仓库当成 git 仓库来用:通过版本管理系统能让我们管理密码更方便。 +``` +pass git init +``` + +这会创建 git 仓库,并自动提交所有已存在的文件。下一步就是指定跟踪的远程仓库了: +``` +pass git remote add +``` + +我们可以把这个仓库当成普通密码仓库来用。唯一的不同点在于每次我们新增或修改一个密码,`pass` 都会自动将该文件加入索引并创建一个提交。 + +`pass` 有一个叫做 `qtpass` 的图形界面,而且 `pass` 也支持 Windows 和 MacOs。通过使用 `PassFF` 插件,它还能获取 firefox 中存储的密码。在它的项目网站上可以查看更多详细信息。试一下 `pass` 吧,你不会失望的! + + +-------------------------------------------------------------------------------- + +via: https://linuxconfig.org/how-to-organize-your-passwords-using-pass-password-manager + +作者:[Egidio Docile][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://linuxconfig.org +[1]:/https://linuxconfig.org/images/pass-manager-qrcode.png From af14c8c77a12101625b83f014549a6eb1e91e83d Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 14:20:12 +0800 Subject: [PATCH 080/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Best=20Programmin?= =?UTF-8?q?g=20Languages=20To=20Learn=20In=202018?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Programming Languages To Learn In 2018.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20171227 Best Programming Languages To Learn In 2018.md diff --git a/sources/tech/20171227 Best Programming Languages To Learn In 2018.md b/sources/tech/20171227 Best Programming Languages To Learn In 2018.md new file mode 100644 index 0000000000..c87d62a7d9 --- /dev/null +++ b/sources/tech/20171227 Best Programming Languages To Learn In 2018.md @@ -0,0 +1,129 @@ +Best Programming Languages To Learn In 2018 +====== + +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/best-programming-languages-learn-for-2018_orig.jpg) + +Programming is growing as one of the most sought-after profession unlike olden times when software making was limited to just a handful of **programming languages** . Today we have a large variety of choices when it comes to programming languages. With the cross-platform support growing, most programming languages can be used for multiple tasks. Here let us have a look at some programming languages that you might want to learn in 2018 if you have not already. + +## Best programming languages to learn in 2018 + +### Python + + [![learn programming language](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/learn-programming-language_orig.png)][1] + +There is no denying about the fact that [Python][2] is ruling the market right now. Launched in 1991, python has become really famous after [YouTube][3] started using it. Python can be used in a variety of domains like Web-Development, Game Development, scripting, scientific research and almost anything you imagine. It is cross-platform and runs on an interpreter. Python has a very simple syntax and since it uses indents instead of curly braces for grouping blocks of code, the code is extremely clean. + +**Example -** + +``` +printf("Hello world!") +``` + +### Kotlin + + [![kotlin programming language](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/kotlin-programming-language_orig.jpg)][4] + +While Java has been unbeaten since the beginning, Kotlin is here to break its run. At least in Android programming. Kotlin is a newer language which has officially been supported by Google for Android apps. It is a drop in replacement for Java and seamlessly works with [java][5] code. The code is said to be drastically reduced and cleaned. The way it looks, Kotlin will totally be worth learning in 2018. + +**Example -** + +``` +class Greeter(val name: String) { + + fun greet() { + + println("Hello, $name") + + } + +} + +String Interpolation to cut down ceremony. + +fun main(args: Array) { + + Greeter(args[0]).greet() + +} +``` + +### C/C++ + +This is probably the first language that they teach in schools and colleges. C is one of the oldest languages which is still operational due to its speed of execution and simplicity in code. Though it has a steep learning curve, once you are through with C, you can do any language. You may not be able to use it for fancy websites or software, but C is the language of choice for embedded devices. With the IoT boom, C will be extensively in demand again. For C++, it is extensively used in some great software. + +**Example -** + +``` +#include + +Int main() + +{ + + printf("Hello world"); + + return 0; + +} +``` + +### PHP + + [![php programming language](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/1200px-php-logo-svg_orig.png)][6] + +The Internet is going crazy about how PHP will die, but I do not see a single reason why you should not learn PHP. It is one of the finest server scripting languages with a very simple syntax structure. More than half the internet runs on PHP. [Wordpress][7] , the most popular Content Management System is made PHP. Since this popular language has been there for over 20 years, it has an enormous collection of libraries. You will find one to get your job done. + +**Example -** + +``` +echo "Hello world!"; +``` + +### Javascript + + ![javascript programming language for web](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/javascript_orig.png) + +What do I say about this? This is the most in-demand language right now. Javascript was primarily used on the web for making the pages more dynamic. But today JavaScript has evolved to become something which is a lot more. Entire front end frameworks are being built on JavaScript. Hybrid apps written in HTML+JS are being built to run on any mobile platform. Javascript is even being used for server-side scripting with nodejs. + +**Example -** + +``` +document.write("Hello world!"); +``` + +### SQL + + [![sql database language](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/sql-database-language.png?1514386856)][8] + +SQL is an RDBMS query language which is used to fetch data from databases. There are many implementations of SQL but more or less they are all similar. Databases are being used everywhere. This article you are reading is also stored on our website's database. So you know how important it is. + +**Example -** + +``` +SELECT * FROM TABLENAME +``` + +## Conclusion + +So these were some languages that will be really worth learning in 2018\. I have not included **languages** like asp.net because they require you to learn their entire platform. Java has also not made to the list because a good number of developers are beginning to migrate to Kotlin. All of the mentioned languages are high in demand and extremely popular. They also have great community support. I hope you liked the article. If you feel I missed any of the in-demand languages, feel free to drop a comment below. + + +-------------------------------------------------------------------------------- + +via: http://www.linuxandubuntu.com/home/best-programming-languages-to-learn-in-2018 + +作者:[LinuxAndUbuntu][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxandubuntu.com +[1]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/learn-programming-language_orig.png +[2]:http://www.linuxandubuntu.com/home/best-python-ides-for-linux +[3]:http://www.linuxandubuntu.com/home/youtube-dl-a-command-line-gui-youtube-facebook-dailymotion-videos-downloading-tool-for-linux +[4]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/kotlin-programming-language_orig.jpg +[5]:http://www.linuxandubuntu.com/home/how-to-install-oracle-java-78-on-ubuntu +[6]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/1200px-php-logo-svg_orig.png +[7]:http://www.linuxandubuntu.com/home/wordpress-how-to-host-and-manage-on-web-server-in-linuxubuntu-step-by-step-guide +[8]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/sql-database-language_orig.png From 530e1edaa0bd463d37e90112c8983ceb17e87de7 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 14:24:56 +0800 Subject: [PATCH 081/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20exclud?= =?UTF-8?q?e=20file=20when=20using=20scp=20command=20recursively?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...file when using scp command recursively.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20171228 How to exclude file when using scp command recursively.md diff --git a/sources/tech/20171228 How to exclude file when using scp command recursively.md b/sources/tech/20171228 How to exclude file when using scp command recursively.md new file mode 100644 index 0000000000..f14c5efceb --- /dev/null +++ b/sources/tech/20171228 How to exclude file when using scp command recursively.md @@ -0,0 +1,87 @@ +How to exclude file when using scp command recursively +====== + +I need to copy all the *.c files from local laptop named hostA to hostB including all directories. I am using the following scp command but do not know how to exclude specific files (such as *.out): +``` +$ scp -r ~/projects/ user@hostB:/home/delta/projects/ +``` + +How do I tell scp command to exclude particular file or directory at the Linux/Unix command line? + +One can use scp command to securely copy files between hosts on a network. It uses ssh for data transfer and authentication purpose. Typical syntax is: + +``` +scp file1 user@host:/path/to/dest/ +scp -r /path/to/source/ user@host:/path/to/dest/ +``` + +## Scp exclude files + +I don't think so you can filter or exclude files when using scp command. However, there is a great workaround to exclude files and copy it securely using ssh. This page explains how to filter or excludes files when using scp to copy a directory recursively. + +## How to use rsync command to exclude files + +The syntax is: +`rsync av -e ssh --exclude='*.out' /path/to/source/ [[email protected]][1]:/path/to/dest/` +Where, + + 1. **-a** : Recurse into directories i.e. copy all files and subdirectories. Also, turn on archive mode and all other options (-rlptgoD) + 2. **-v** : Verbose output + 3. **-e ssh** : Use ssh for remote shell so everything gets encrypted + 4. **\--exclude='*.out'** : exclude files matching PATTERN e.g. *.out or *.c and so on. + + +### Example of rsync command + +In this example copy all file recursively from ~/virt/ directory but exclude all *.new files: +`$ rsync -av -e ssh --exclude='*.new' ~/virt/ [[email protected]][1]:/tmp` +Sample outputs: +[![Scp exclude files but using rsync exclude command][2]][2] + +Rsync command will fail if rsync not found on the remote server. In that case try the following scp command that uses [bash shell pattern matching][3] in the current directory (it won't work with the -r option): +`$ ls ` +Sample outputs: +``` +centos71.log centos71.qcow2 centos71.qcow2.new centos71.v2.qcow2.new meta-data user-data +``` + +centos71.log centos71.qcow2 centos71.qcow2.new centos71.v2.qcow2.new meta-data user-data + +Copy everything in the current directory except .new file(s): +``` +$ shopt -s extglob +$ scp !(.new)* [[email protected]][1]:/tmp/ +``` +Sample outputs: +``` +centos71.log 100 % 4262 1.3MB/s 00:00 +centos71.qcow2 100 % 836MB 32.7MB/s 00: 25 +meta-data 100 % 47 18.5KB/s 00:00 +user-data 100 % 1543 569.7KB/s 00:00 +``` + + +See the following man pages for more info: +``` +$ [man rsync][4] +$ man bash +$ [man scp][5] +``` + + +-------------------------------------------------------------------------------- + +via: https://www.cyberciti.biz/faq/scp-exclude-files-when-using-command-recursively-on-unix-linux/ + +作者:[Vivek Gite][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.cyberciti.biz +[1]:https://www.cyberciti.biz/cdn-cgi/l/email-protection +[2]:https://www.cyberciti.biz/media/new/faq/2017/12/scp-exclude-files-on-linux-unix-macos-bash-shell-command-line.jpg +[3]:https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html#Pattern-Matching +[4]:https://www.samba.org/ftp/rsync/rsync.html +[5]:https://man.openbsd.org/scp From e4150da4499cc4085b9e4d534c2a2227e1fdea18 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 14:31:25 +0800 Subject: [PATCH 082/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Top=2010=20Micros?= =?UTF-8?q?oft=20Visio=20Alternatives=20for=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Microsoft Visio Alternatives for Linux.md | 242 ++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 sources/tech/20171226 Top 10 Microsoft Visio Alternatives for Linux.md diff --git a/sources/tech/20171226 Top 10 Microsoft Visio Alternatives for Linux.md b/sources/tech/20171226 Top 10 Microsoft Visio Alternatives for Linux.md new file mode 100644 index 0000000000..6b98dbd30d --- /dev/null +++ b/sources/tech/20171226 Top 10 Microsoft Visio Alternatives for Linux.md @@ -0,0 +1,242 @@ +Top 10 Microsoft Visio Alternatives for Linux +====== +**Brief: If you are looking for a good Visio viewer in Linux, here are some alternatives to Microsoft Visio that you can use in Linux.** + +[Microsoft Visio][1] is a great tool for creating or generating mission-critical diagrams and vector representations. While it may be a good tool for making floor plans or other kinds of diagrams - it is neither free nor open source. + +Moreover, Microsoft Visio is not a standalone product. It comes bundled with Microsoft Office. We have already seen [open source alternatives to MS Office][2] in the past. Today we'll see what tools you can use in place of Visio on Linux. + +## Best Microsoft Visio alternatives for Linux + +![Microsoft Visio Alternatives for Linux][4] + +Mandatory disclaimer here. The list is not a ranking. The product at number three is not better than the one at number six on the list. + +I have also mentioned a couple of non open source Visio software that you can use from the web interface. + +| Software | Type | License Type | +| LibreOffice Draw | Desktop Software | Free and Open Source | +| OpenOffice Draw | Desktop Software | Free and Open Source | +| Dia | Desktop Software | Free and Open Source | +| yED Graph Editor | Desktop and web-based | Freemium | +| Inkscape | Desktop Software | Free and Open Source | +| Pencil | Desktop and web-based | Free and Open Source | +| Graphviz | Desktop Software | Free and Open Source | +| darw.io | Desktop and web-based | Free and Open Source | +| Lucidchart | Web-based | Freemium | +| Calligra Flow | Desktop Software | Free and Open Source | + + +### 1. LibreOffice Draw + +![][5] + +LibreOffice Draw module is one of the best open source alternatives to Microsoft Visio. With the help of it, you can either choose to make a quick sketch of an idea or a complex professional floor plan for presentation. Flowcharts, organization charts, network diagrams, brochures, posters, and what not! All that without even requiring to spend a penny. + +Good thing is that it comes bundled with LibreOffice which is installed in most Linux distributions by default. + +#### Overview of Key Features: + + * Style & Formatting tools to make Brochures/Posters + * Calc Data Visualization + * PDF-File editing capability + * Create Photo Albums by manipulating the pictures from Gallery + * Flexible Diagramming tools similar to the ones with Microsoft Visio (Smart Connectors, Dimension lines, etc.,) + * Supports .VSD files (to open) + + + +[LibreOffice Draw][6] + +### 2. Apache OpenOffice Draw + +![][7] + +A lot of people do know about OpenOffice (on which LibreOffice project was initially based on) but they don't really mention Apache OpenOffice Draw as an alternative to Microsoft Visio. But, for a fact - it is yet another amazing open-source diagramming software tool. Unlike LibreOffice Draw, it does not support editing PDF files but it does offer drawing tools for any type of diagram creation. + +Just a caveat here. Use this tool only if you have OpenOffice already on your system. This is because [installing OpenOffice][8] is a pain and it is [not properly developed anymore][9]. + +#### Overview of Key Features: + + * 3D Controller to create shapes quickly + * Create (.swf) flash versions of your work + * Style & Formatting tools + * Flexible Diagramming tools similar to the ones with Microsoft Visio (Smart Connectors, Dimension lines, etc.,) + + + +[Apache OpenOffice Draw][10] + +### 3. Dia + +![][11] + +Dia is yet another interesting open source tool. It may not seem to be under active development like the other ones mentioned. But, if you were looking for a free and open source alternative to Microsoft Visio for simple and decent diagrams - Dia could be your choice. The only let down of this tool for you could be its user interface. Apart from that, it does let you utilize powerful tools for a complex diagram (but it may not look great - so we recommend it for simpler diagrams). + +#### Overview of Key Features: + + * It can be used via command-line + * Styling & Formatting tools + * Shape Repository for custom shapes + * Diagramming tools similar to the ones with Microsoft Visio (Special Objects, Grid Lines, Layers, etc.,) + * Cross-platform + + + +[Dia][12] + +### 4. yED Graph Editor + +yED Graph editor is one of the most loved free Microsoft Visio alternative. If you worry about it being a freeware but not an open source project, you can still utilize [yED's live editor][13] via your web browser for free. It is one of the best recommendations if you want to make diagrams quickly with a very easy-to-use interface. + +#### Overview of Key Features: + + * Drag and drop feature for easy diagram making + * Supports importing external data for linking + + + +[yED Graph Editor][14] + +### 5. Inkscape + +![][15] + +Inkscape is a free and open source vector graphics editor. You get the basic functionalities of creating a flowchart or a data flow diagram. It does not offer advanced diagramming tools but the basic ones to create simpler diagrams. So, Inkscape could be your Visio alternative only if you are looking to generate basic diagrams with the help of diagram connector tool by utilizing the available symbols from the library. + +#### Overview of Key Features: + + * Connector Tool + * Flexible drawing tools + * Broad file format compatibility + + + +[Inkscape][16] + +### 6. Pencil Project + +![][17] + +Pencil Project is an impressive open source initiative that is available for both Windows and Mac along with Linux. It features an easy-to-use GUI which makes diagramming easier and convenient. A good collection of inbuilt shapes and symbols to make your diagrams look great. It also comes baked in with Android and iOS UI stencils to let you start prototyping apps when needed. + +You can also have it installed as a Firefox extension - but the extension does not utilize the latest build of the project. + +#### Overview of Key Features: + + * Browse cliparts easily (utilizing openclipart.org) + * Export as an ODT file / PDF file + * Diagram connector tool + * Cross-platform + + + +[Pencil Project][18] + +### 7. Graphviz + + +![][19] + +Graphviz is slightly different. It is not a drawing tool but a dedicated graph visualization tool. You should definitely utilize this tool if you are into network diagrams which require several designs to represent a node. Well, of course, you can't make a floor plan with this tool (it won't be easy at least). So, it is best-suited for network diagrams, bioinformatics, database connections, and similar stuff. + +#### Overview of Key Features: + + * Supports command-line usage + * Supports custom shapes & tabular node layouts + * Basic stying and formatting tools + + + +[Graphviz][20] + +### 8. Draw.io + +Draw.io is primarily a free web-based diagramming tool with powerful tools to make almost any type of diagrams. You just need to drag n drop and then connect them to create a flowchart, an E-R diagram, or anything relevant. Also, if you like the tool, you can try the [offline desktop version][21]. + +**Overview of Key Features:** + + * Direct uploads to a cloud storage service + * Custom Shapes + * Styling & Formatting tools + * Cross-platform + + + +[Draw.io][22] + +### 9. Lucidchart + +![][23] + +Lucidchart is a premium web-based diagramming tool which offers a free subscription with limited features. You can utilize the free subscription to create several types of diagrams and export them as an image or a PDF. However, the free version does not support data linking and Visio import/export functionality. If you do not need data linking -Lucidchart could prove to be a very good tool while generating beautiful diagrams. + +#### Overview of Key Features: + + * Integrations to Slack, Jira Core, Confluence + * Ability to make product mockups + * Import Visio files + + + +[Lucidchart][24] + +### 10. Calligra Flow + +![calligra flow][25] + +Calligra Flow is a part of [Calligra Project][26] which aims to provide free and open source software tools. With Calligra flow, you can easily create network diagrams, entity-relation diagrams, flowcharts, and more. + +#### Overview of Key Features: + + * Wide range of stencil boxes + * Styling and formatting tools + + + +[Calligra Flow][27] + +### Wrapping Up + +Now that you know about the best free and open source Visio alternatives, what do you think about them? + +Are they better than Microsoft Visio in any aspect of your requirements? Also, let us know in the comments below if we missed any of your favorite diagramming tools as an Linux alternative to Microsoft Visio. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/visio-alternatives-linux/ + +作者:[Ankush Das][a] +译者:[译者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/ +[1]:https://products.office.com/en/visio/flowchart-software +[2]:https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ +[3]:data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs= +[4]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/12/visio-alternatives-linux-featured.png +[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/12/libreoffice-draw-microsoft-visio-alternatives.jpg +[6]:https://www.libreoffice.org/discover/draw/ +[7]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/12/apache-open-office-draw.jpg +[8]:https://itsfoss.com/install-openoffice-ubuntu-linux/ +[9]:https://itsfoss.com/openoffice-shutdown/ +[10]:https://www.openoffice.org/product/draw.html +[11]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/12/dia-screenshot.jpg +[12]:http://dia-installer.de/ +[13]:https://www.yworks.com/products/yed-live +[14]:https://www.yworks.com/products/yed +[15]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/12/inkscape-screenshot.jpg +[16]:https://inkscape.org/en/ +[17]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/12/pencil-project.jpg +[18]:http://pencil.evolus.vn/Downloads.html +[19]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/12/graphviz.jpg +[20]:http://graphviz.org/ +[21]:https://about.draw.io/integrations/#integrations_offline +[22]:https://about.draw.io/ +[23]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/12/lucidchart-visio-alternative.jpg +[24]:https://www.lucidchart.com/ +[25]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/12/calligra-flow.jpg +[26]:https://www.calligra.org/ +[27]:https://www.calligra.org/flow/ From 4d930ecc686bf017e00cf6f9959448d6e7808aec Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 14:36:11 +0800 Subject: [PATCH 083/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Dual=20Boot=20Ubu?= =?UTF-8?q?ntu=20And=20Arch=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0171228 Dual Boot Ubuntu And Arch Linux.md | 367 ++++++++++++++++++ 1 file changed, 367 insertions(+) create mode 100644 sources/tech/20171228 Dual Boot Ubuntu And Arch Linux.md diff --git a/sources/tech/20171228 Dual Boot Ubuntu And Arch Linux.md b/sources/tech/20171228 Dual Boot Ubuntu And Arch Linux.md new file mode 100644 index 0000000000..6a9091befa --- /dev/null +++ b/sources/tech/20171228 Dual Boot Ubuntu And Arch Linux.md @@ -0,0 +1,367 @@ +Dual Boot Ubuntu And Arch Linux +====== +![](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/dual-boot-ubuntu-and-arch-linux_orig.jpg) + +**Dual booting Ubuntu and Arch Linux** is not as easy as it sounds, however, I’ll make the process as easy as possible with much clarity. First, we will need to install Ubuntu then Arch Linux since it's much easier configuring the Ubuntu grub to be able to **dual boot Ubuntu and Arch Linux** + +### Dual Boot Ubuntu And Arch Linux + +Some of the things you will need: + +1. Ubuntu flavor of your choice, in this case, I’ll use ubuntu 17.10 iso + +2. 2 USB sticks + +3. Windows PC or Linux based PC + +4. Arch Linux iso + +5. Rufus(for windows) or etcher(for Linux distro) + +### ​Install Ubuntu 16.10 + +​First, [create a bootable flash drive][1] using Rufus for both Ubuntu and Arch Linux. Alternatively, you could use etcher to create bootable flash drives for both Ubuntu and Arch Linux. + + [![bootable ubuntu usb etcher image writer](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/bootable-ubuntu-usb-etcher-image-writer_orig.jpg)][2] + +Select the ISO image file for Ubuntu then select the flash drive of your choice after which click flash to create the bootable flash drive. Wait till it completes and Voila! Your bootable flash drive is ready for use. + + [![make ubuntu usb bootable in linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/make-ubuntu-usb-bootable-in-linux_orig.jpg)][3] + +​Turn on your machine and boot using the bootable flash drive with the Ubuntu installation media. Ensure that you boot into UEFI or BIOS compatibility mode depending on the type of PC you are using. I prefer using UEFI for a newer PC builds. + + [![live ubuntu boot](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/live-ubuntu-boot_orig.jpg)][4] + +​Upon Successful boot, you will see the following screen asking you to try Ubuntu or install Ubuntu. Choose install Ubuntu. + + [![install usb from live usb](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-usb-from-live-usb_orig.jpg)][5] + +​Then check install third-party software for graphics and Wifi hardware, MP3 and other media. Optionally if you have an internet connection choose download updates while installing Ubuntu since it will save time setting up the installation as well as ensure you get the latest updates of your installation. + + [![custom partition hd install ubuntu](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/custom-partition-hd-install-ubuntu_orig.jpg)][6] + +​Then choose ‘Something else’ so that we can partition the hard disk and set aside space for swap, Ubuntu, and Archlinux. + + [![create swap partition ubuntu](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/create-swap-partition-ubuntu_orig.jpg)][7] + +​Create a swap area partition. Preferably half the size of the ram. In my case, I have 1GB of ram thus 512mb of swap area space. + + [![install ubuntu root partition](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-ubuntu-root-partition_orig.jpg)][8] + +​Then create a partition with mount point ‘/’. Then click the install now button. + + [![select ubuntu timezone](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/select-ubuntu-timezone_orig.jpg)][9] + +Choose your location then choose language and keyboard settings. + + [![select ubuntu keyboard layout](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-ubuntu-select-location-keyboard-layout_orig.jpg)][10] + +​Then create the user credentials that will create a new user. + + [![create username, system name ubuntu install](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/create-username-system-name-ubuntu-install_orig.jpg)][11] + +​The installation will now start by clicking next. + + [![ubuntu installation finishing](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ubuntu-installation-finishing_orig.jpg)][12] + +​When the installation is done click on restart PC. + + [![ubuntu installation finished restart system](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ubuntu-installation-finished_orig.jpg)][13] + +​Remove the installation media and press enter when done. + + [![remove installation media after ubuntu](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/remove-installation-media-after-ubuntu_orig.jpg)][14] + +​Upon confirmation of successful installation, restart and boot into the Arch Linux installation media. + +### ​Install Arch Linux + +​Upon booting into the + +**Arch Linux installation media** + +you should see an initial screen as follows. Choose Boot Arch Linux(x86_64). Note Arch Linux is a more of + +[DYF][15] + +(do it yourself) kind of Operating system. + + [![arch linux installation boot menu](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/arch-linux-installation-boot-menu_orig.jpg)][16] + +After choosing, it will open a tty1 terminal that you will use to install the operating system. + + [![arch linux tty1 linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/arch-linux-tty1-linux_orig.png)][17] Note: You will need an internet connection to download some packages in order to install Arch Linux successfully. So we need to check if the internet is working fine. Enter the following into the terminal to check internet connectivity. + +ping linuxandubuntu.com -c 4 + + [![arch linux ping check internet connection](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/arch-linux-ping-check-internet-connection_orig.png)][18] + +​If the internet is working fine you should get an echo back showing the number of packets sent and received. In this case, we sent 4 echos and got 4 back meaning the connection is good. + +If you want to setup Wifi in Arch Linux, read this post + +[here][19] + +on setting up Wifi in Arch Linux. + +​Next, we need to select the partition that’s free that we had earlier set aside while installing Ubuntu. + +fdisk -l + +​The above should show you the available disks that are there. You should see the Ubuntu partitions as well as the free space. We will use cfdisk to partition. + +cfdisk + + [![install arch partition disk with cfdisk](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-arch-partition-disk-with-cfdisk_orig.png)][20] + +You will see the partitions. Select the free space that is below the other allocated partitions. + +​You will need to select new and then enter the partition size for the partition. + + [![partition free space swap arch linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/partition-free-space-swap-arch-linux_orig.png)][21] Use for example 9.3G - G representing gigabytes. [![install arch linux partition](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-arch-linux-partition_orig.png)][22] + +Make the partition primary as below. + + [![make arch linux root as primary partition](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/make-arch-linux-root-as-primary-partition_orig.png)][23] Then choose the write partition entry. [![select partition to install arch](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/select-partition-to-install-arch_orig.png)][24] + +​Type ‘yes’ to confirm the writing of the partition. + + [![install arch linux confirm create partition](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-arch-linux-confirm-create-partition_orig.png)][25] + +Then choose the quit option. + + [![quit cfdisk arch linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/quit-cfdisk-arch-linux_orig.png)][26] Then type: + +fdisk -l + +​To confirm the changes + + [![confirm partition changes](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/confirm-partition-changes_orig.png)][27] + +​Then partition the disk using: + +mkfs.ext4 /dev/sda3 + +​Make sure the partition you choose is the last one that we created so that we don’t mess with the Ubuntu partition. + + [![complete arch linux installation partition](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/complete-arch-linux-installation-partition_orig.png)][28] + +​Then mount it to using the following command - + +mount /dev/sda3 /mnt + + [![mount base partition in arch linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/mount-base-partition-in-arch-linux.png?1514472693)][29] + +​Make a home directory using: + +mkdir .mnt/home + + [![mount home partition arch linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/mount-home-partition-arch-linux.png?1514472866)][30] + +​Mount the home folder to the partition using + +mount /dev/sda3 /mnt/home + + [![make mount home directory](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/make-mount-home-directory.png?1514472960)][31] + +​Now install the base system of Archlinux using the command: + +pacstrap /mnt base + +Make sure you have an internet connection. + +​ + +It should take a while to download and set it up depending on the internet speed you have. + + [![install arch linux base](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/install-arch-linux-base.png?1514473056)][32] + +After the step is complete, the Archlinux base installation is completed. + +After installing the Arch Linux base, create a fstab file using the command: + +genfstab -U /mnt >> /mnt/etc/fstab + + [![create fstab in arch linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/create-fstab-file-in-arch-linux.png?1514473226)][33] + +​After that you need to verify the fstab file entries using: + +cat /mnt/etc/fstab + + [![cat fstab file data terminal](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/cat-fstab-file-data-terminal.png?1514473304)][34] + +### ​Configuring Arch Linux: the basic configuration + +You will need to configure the following upon installation: + +1. The system language and the system locales + +2. The system timezones + +3. Root user password + +4. Set a hostname + +Firstly, you will need to switch to the newly installed base by changing root into the system using the command: + +arch-chroot /mnt + +#### The system Language and the system locale + +You will then have to configure the system language. You will have to uncomment en_UTF-8 UTF-8 and the localization you need in /etc/local.gen + +Type: + +nano /etc/local.gen + +Then uncomment the en_UTF-8 UTF-8 + +Then type: + +locale-gen + +To generate the localization settings as follows: + + [![generate localization arch linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/generate-localization-arch-linux.png?1514473406)][35] You will need to set the LANG variable in locale.conf accordingly, for example: + +nano /etc/locale.conf + +​Then change to: + +LANG=en_US.UTF-8 + +If you set the keyboard layout, make the changes persistent in vconsole.conf: + +nano /etc/vconsole.conf + +​Then change to: + +KEYMAP=us-eng + +#### 2\. The system timezones + +​You will need to set the time zone using + +ln -sf /usr/share/zoneinfo/Region/City /etc/localtime + +To see the available time zones, you can use the following command in the terminal: + +Note region is shown in blue below in the screenshot: + +ls /usr/share/zoneinfo + + [![setup zonefile in arch linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/setup-zonefile-in-arch-linux.png?1514473483)][36] [![setup country zonefile](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/setup-country-zonefile_orig.png)][37] Run hwclock command as follows to generate /etc/adjtime(assumes the hardware clock is set to UTC.): + +# hwclock --systohc + +#### 3\. Root password + +​To set a new password for the Arch Linux installation set root password using: + +Passwd + +​Supply a new password and confirm the password to set the root password. + + [![setup arch linux root password](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/setup-arch-linux-root-password.png?1514473649)][38] + +#### 4\. Set a hostname and configure network + +​You will need to create the hostname file: + +nano /etc/hostname + + [![set arch linux hostname](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/set-arch-linux-hostname.png?1514473741)][39] + +Change the name to your username: + + [![set arch linux username](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/set-arch-linux-username.png?1514473822)][40] Then add a matching entry to hosts: + +nano /etc/hosts + +127.0.0.1 localhost.localdomain localhost + +::1 localhost.localdomain localhost + +127.0.1.1 LinuxandUbuntu.localdomain LinuxandUbuntu + +​ + +You will need to make the network connections persistent thus use: + +systemctl enable dhcpd + +#### Grub configuration + +Then reboot the machine and enter into Ubuntu to configure the grub. + +You will type: + +reboot + + [![reboot system after arch linux installation](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/reboot-system-after-arch-linux-installation.png?1514474180)][41] + +The Arch Linux installation still doesn’t appear therefore we need to install it using update-grub in ubuntu. + + [![ubuntu grub menu](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/ubuntu-grub-menu.png?1514474302)][42] Open a terminal in Ubuntu and type: + +sudo update-grub + +It should update the grub to include Arch Linux. + +### Conclusion + +Congratulations you have successfully set up Ubuntu and Arch Linux to dual boot. The Ubuntu installation is easy but the Arch Linux installation is a challenge for new Linux users. I tried making this tutorial as simple as it can be. But if you have any question on the article, let me know in the comment section below. Also share this article with your friends and help them learn Linux. + +-------------------------------------------------------------------------------- + +via: http://www.linuxandubuntu.com/home/dual-boot-ubuntu-and-arch-linux + +作者:[LinuxAndUbuntu][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxandubuntu.com +[1]:http://www.linuxandubuntu.com/home/etcher-burn-images-to-sd-card-make-bootable-usb +[2]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/bootable-ubuntu-usb-etcher-image-writer_orig.jpg +[3]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/make-ubuntu-usb-bootable-in-linux_orig.jpg +[4]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/live-ubuntu-boot_orig.jpg +[5]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-usb-from-live-usb_orig.jpg +[6]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/custom-partition-hd-install-ubuntu_orig.jpg +[7]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/create-swap-partition-ubuntu_orig.jpg +[8]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-ubuntu-root-partition_orig.jpg +[9]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/select-ubuntu-timezone_orig.jpg +[10]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-ubuntu-select-location-keyboard-layout_orig.jpg +[11]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/create-username-system-name-ubuntu-install_orig.jpg +[12]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ubuntu-installation-finishing_orig.jpg +[13]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ubuntu-installation-finished_orig.jpg +[14]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/remove-installation-media-after-ubuntu_orig.jpg +[15]:http://www.linuxandubuntu.com/home/arch-linux-take-your-linux-knowledge-to-next-level-review +[16]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/arch-linux-installation-boot-menu_orig.jpg +[17]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/arch-linux-tty1-linux_orig.png +[18]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/arch-linux-ping-check-internet-connection_orig.png +[19]:http://www.linuxandubuntu.com/home/how-to-setup-a-wifi-in-arch-linux-using-terminal +[20]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-arch-partition-disk-with-cfdisk_orig.png +[21]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/partition-free-space-swap-arch-linux_orig.png +[22]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-arch-linux-partition_orig.png +[23]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/make-arch-linux-root-as-primary-partition_orig.png +[24]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/select-partition-to-install-arch_orig.png +[25]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/install-arch-linux-confirm-create-partition_orig.png +[26]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/quit-cfdisk-arch-linux_orig.png +[27]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/confirm-partition-changes_orig.png +[28]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/complete-arch-linux-installation-partition_orig.png +[29]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/mount-base-partition-in-arch-linux.png +[30]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/mount-home-partition-arch-linux.png +[31]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/make-mount-home-directory.png +[32]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/install-arch-linux-base.png +[33]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/create-fstab-file-in-arch-linux.png +[34]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/cat-fstab-file-data-terminal.png +[35]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/generate-localization-arch-linux.png +[36]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/setup-zonefile-in-arch-linux.png +[37]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/setup-country-zonefile_orig.png +[38]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/setup-arch-linux-root-password.png +[39]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/set-arch-linux-hostname.png +[40]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/set-arch-linux-username.png +[41]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/reboot-system-after-arch-linux-installation.png +[42]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/edited/ubuntu-grub-menu.png From 616af8feac9ba02fc7d19e8e71443cb510e60ca1 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 14:39:32 +0800 Subject: [PATCH 084/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Container=20Basic?= =?UTF-8?q?s:=20Terms=20You=20Need=20to=20Know?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ontainer Basics- Terms You Need to Know.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 sources/tech/20171228 Container Basics- Terms You Need to Know.md diff --git a/sources/tech/20171228 Container Basics- Terms You Need to Know.md b/sources/tech/20171228 Container Basics- Terms You Need to Know.md new file mode 100644 index 0000000000..a68e33a5d9 --- /dev/null +++ b/sources/tech/20171228 Container Basics- Terms You Need to Know.md @@ -0,0 +1,48 @@ +Container Basics: Terms You Need to Know +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/containers-krissia-cruz.jpg?itok=-TNPqdcp) + +[In the previous article][1], we talked about what containers are and how they breed innovation and help companies move faster. And, in the following articles in this series, we will discuss how to use them. Before we dive more deeply into the topic, however, we need to understand some of the terms and commands used in the container world. Without a confident grasp of this terminology, things could get confusing. + +Let's explore some of the basic terms used in the [Docker][2] container world. + +**Container** **:** What exactly is container? It 's a runtime instance of a Docker image. It contains a Docker image, an execution environment, and instructions. It's totally isolated from the system so multiple containers can run on the system, completely oblivious of each other. You can replicate multiple containers from the same image and scale the service when the demand is high and nuke those containers when demand is low. + +**Docker Image** **:** This is no different from the image of a Linux distribution that you download. It's a package of dependencies and information for creating, deploying, and executing a container. You can spin up as many containers as you want in a matter of seconds. Each behaves exactly the same. Images are built on top of one another in layers. Once an image is created, it doesn't change. If you want to make changes to your container, you simply create a new image and deploy new containers from that image. + +**Repository (repo)** **:** Linux users will already be familiar with the term repository; it's a reservoir where packages are stored that can be downloaded and installed on a system. In the context of Docker containers, the only difference is that it hosts Docker images which are categorized via labels. You can have different variants of the same applications or different versions, all tagged appropriately. + +**Registry** **:** Think of this as like GitHub. It 's an online service that hosts and provides access to repositories of docker images. DockerHub, for example is the default registry for public images. Vendors can upload their repositories on DockerHub so that their customers can download and use official images. Some companies offer their own registries for their images. Registries don't have to be run and managed by third party vendors. Organizations can have on-prem registries to manage organization-wide access to repositories. + +**Tag** **:** When you create a Docker image, you can tag it appropriately so that different variants or versions can be easily identified. It's no different from what you see in any software package. Docker images are tagged when you add them to the repository. + +Now that you have an understanding of the basics, the next phase is understanding the terminology used when working with actual Docker containers. + +**Dockerfile** **:** This is a text file that comprises the commands that are executed manually in order to build a Docker image. These instructions are used by Docker to automatically build images. + +**Build** **:** This is the process that creates an image from Dockerfile. + +**Push** **:** Once the image is created, "push" is the process to publish that image to the repository. The term is also used as part of a command that we will learn in the next articles. + +**Pull** **:** A user can retrieve that image from repository through the "pull" process. + +**Compose** **:** Most complex applications comprise more than one container. Compose is a command-line tool that 's used to run a multi-container application. It allows you to run a multi-container application with one command. It eases the headache of running multiple containers needed for that application. + +### Conclusion + +The scope of container terminology is massive, but these are some basic terms that you will frequently encounter. The next time you see these terms, you will know exactly what they mean. In the next article, we will get started working with Docker containers. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/intro-to-linux/2017/12/container-basics-terms-you-need-know + +作者:[Swapnil Bhartiya][a] +译者:[译者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/arnieswap +[1]:https://www.linux.com/blog/intro-to-linux/2017/12/what-are-containers-and-why-should-you-care +[2]:https://www.docker.com/ From 0b210805c681252bef5a0cbb68274f3cd29eef02 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 14:45:08 +0800 Subject: [PATCH 085/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Excellent=20Free?= =?UTF-8?q?=20Roguelike=20Games?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20171229 Excellent Free Roguelike Games.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20171229 Excellent Free Roguelike Games.md diff --git a/sources/tech/20171229 Excellent Free Roguelike Games.md b/sources/tech/20171229 Excellent Free Roguelike Games.md new file mode 100644 index 0000000000..0304b83d05 --- /dev/null +++ b/sources/tech/20171229 Excellent Free Roguelike Games.md @@ -0,0 +1,71 @@ +Excellent Free Roguelike Games +====== +![Dungeon][1] + +Roguelike is a sub-genre of role-playing games. It literally means "a game like Rogue". Rogue is a dungeon crawling video game, first released in 1980 by developers Michel Toy, Glenn Wichman and Ken Arnold. The game stood out from the crowd by being fiendishly addictive. The game's goal was to retrieve the Amulet of Yendor, hidden deep in the 26th level, and ascend back to the top, all set in a world based on Dungeons & Dragons. + +The game is rightly considered to be a classic, formidably difficult yet compelling addictive. While it was popular in college and university campuses, it wasn't a big seller. At the time of its release, Rogue wasn't published under an open source license, which led to many clones being developed. + +There is no exact definition of a roguelike, but this type of game typically has the following characteristics: + + * High fantasy narrative background + * Procedural level generation. Most of the game world is generated by the game for every new gameplay session. This is meant to encourage replayability + * Turn-based dungeon exploration and combat + * Tile-based graphics that are randomly generated + * Random conflict outcomes + * Permanent death - death works realistically, once you're gone, you're gone + * High difficulty + + + +This article compiles a wide selection of roguelike games available for Linux. If you enjoy addictive gameplay with real intensity, I heartily recommended downloading these games. Don't be put off by the primitive graphics offered by many of the games, you'll soon forget the visuals once you get immersed in playing. Remember, in roguelikes game mechanics tend to be the primary focus, with graphics being a welcome, but not essential, addition. + +There are 16 games recommended here. All of the games are available to download without charge, and almost all are released under an open source license. +| **Roguelike Games** | +| --- | +| **[Dungeon Crawl Stone Soup][1]** | A continuation of Linley’s Dungeon Crawl | +| **[Prospector][2]** | Roguelike game set in a science fiction universe | +| **[Dwarf Fortress][3]** | Adventure and Dwarf Fortress modes | +| **[NetHack][4]** | Wonderfully silly, and addictive Dungeons and Dragons-style adventure game | +| **[Angband][5]** | Along the lines of Rogue and NetHack. It is derived from the games Moria and Umoria | +| **[Ancient Domains of Mystery][6]** | Very mature Roguelike game | +| **[Tales of Maj’Eyal][7]** | Features tactical turn-based combat and advanced character building | +| **[UnNetHack][8]** | Inspired fork of NetHack | +| **[Hydra Slayer][9]** | Roguelike game based on mathematical puzzles | +| **[Cataclysm DDA][10]** | Post-apocalyptic roguelike, set in the countryside of fictional New England | +| **[Brogue][11]** | A direct descendant of Rogue | +| **[Goblin Hack][12]** | Inspired by the likes of NetHack, but faster with fewer keys | +| **[Ascii Sector][13]** | 2D trading and space flight simulator with roguelike action | +| **[SLASH'EM][14]** | Super Lotsa Added Stuff Hack - Extended Magic | +| **[Everything Is Fodder][15]** | Seven Day Roguelike competition entry | +| **[Woozoolike][16]** | A simple space exploration roguelike for 7DRL 2017. | + + +-------------------------------------------------------------------------------- + +via: https://www.linuxlinks.com/excellent-free-roguelike-games/ + +作者:[Steve Emms][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linuxlinks.com/author/linuxlinks/ +[1]:https://www.linuxlinks.com/dungeoncrawlstonesoup/ +[2]:https://www.linuxlinks.com/Prospector-roguelike/ +[3]:https://www.linuxlinks.com/dwarffortress/ +[4]:https://www.linuxlinks.com/nethack/ +[5]:https://www.linuxlinks.com/angband/ +[6]:https://www.linuxlinks.com/ADOM/ +[7]:https://www.linuxlinks.com/talesofmajeyal/ +[8]:https://www.linuxlinks.com/unnethack/ +[9]:https://www.linuxlinks.com/hydra-slayer/ +[10]:https://www.linuxlinks.com/cataclysmdda/ +[11]:https://www.linuxlinks.com/brogue/ +[12]:https://www.linuxlinks.com/goblin-hack/ +[13]:https://www.linuxlinks.com/asciisector/ +[14]:https://www.linuxlinks.com/slashem/ +[15]:https://www.linuxlinks.com/everything-is-fodder/ +[16]:https://www.linuxlinks.com/Woozoolike/ +[17]:https://i2.wp.com/www.linuxlinks.com/wp-content/uploads/2017/12/dungeon.jpg?resize=300%2C200&ssl=1 From 48f343e7145ef1544726c455d3c89ebc4d1dcceb Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 14:50:23 +0800 Subject: [PATCH 086/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Linux=20wc=20Comm?= =?UTF-8?q?and=20Explained=20for=20Beginners=20(6=20Examples)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nd Explained for Beginners (6 Examples).md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20171228 Linux wc Command Explained for Beginners (6 Examples).md diff --git a/sources/tech/20171228 Linux wc Command Explained for Beginners (6 Examples).md b/sources/tech/20171228 Linux wc Command Explained for Beginners (6 Examples).md new file mode 100644 index 0000000000..7b4143473f --- /dev/null +++ b/sources/tech/20171228 Linux wc Command Explained for Beginners (6 Examples).md @@ -0,0 +1,127 @@ +Linux wc Command Explained for Beginners (6 Examples) +====== + +While working on the command line, sometimes you may want to access the number of words, byte counts, or even newlines in a file. If you are looking for a tool to do this, you'll be glad to know that in Linux, there exists a command line utility - dubbed **wc** \- that does all this for you. In this article, we will be discussing this tool through easy to understand examples. + +But before we jump in, it's worth mentioning that all examples provided in this tutorial have been tested on Ubuntu 16.04. + +### Linux wc command + +The wc command prints newline, word, and byte counts for each input file. Following is the syntax of this command line tool: + +wc [OPTION]... [FILE]... + +And here's how wc's man page explains it: +``` +Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is +specified. A word is a non-zero-length sequence of characters delimited by white space. With no +FILE, or when FILE is -, read standard input. +``` + +The following Q&A-styled examples will give you an even better idea about the basic usage of wc. + +Note: We'll be using a file named file.txt as the input file in all our examples. Following is what the file contains: +``` +hi +hello +how are you +thanks. +``` + +### Q1. How to print the byte count + +Use the **-c** command line option to print the byte count. + +wc -c file.txt + +Here's the output this command produced on our system: + +[![How to print the byte count][1]][2] + +So the file contains 29 bytes. + +### Q2. How to print the character count + +To print the number of characters, use the **-m** command line option. + +wc -m file.txt + +Here's the output this command produced on our system: + +[![How to print the character count][3]][4] + +So the file contains 29 characters. + +### Q3. How to print the newline count + +Use the **-l** command line option to print the number of newlines in the file. + +wc -l file.txt + +Here's the output in our case: + +[![How to print the newline count][5]][6] + +### Q4. How to print the word count + +To print the number of words present in the file, use the **-w** command line option. + +wc -w file.txt + +Following the output the command produced in our case: + +[![How to print the word count][7]][8] + +So this reveals there are 6 words in the file. + +### Q5. How to print the maximum display width or length of longest line + +In case you want to print the length of the longest line in the input file, use the **-L** command line option. + +wc -L file.txt + +Here's the output the command produced in our case: + +[![How to print the maximum display width or length of longest line][9]][10] + +So the length of the longest file in our file is 11. + +### Q6. How to read input file name(s) from a file + +In case you have multiple file names, and you want wc to read them from a file, then use the **\--files0-from** option. + +wc --files0-from=names.txt + +[![How to read input file name\(s\) from a file][11]][12] + +So you can see that the wc command, in this case, produced lines, words, and characters count for file.txt in the output. The name file.txt was mentioned in the names.txt file. It's worth mentioning that to successfully use this option, names written the file should be NUL terminated - you can generate this character by typing Ctrl+v followed by Ctrl+Shift+@. + +### Conclusion + +As you'd agree, wc is a simple command, both from understanding and usage purposes. We've covered pretty much all command line options the tool offers, so you should be ready to use the tool on a daily basis once you practice whatever we've explained here. For more info on wc, head to its [man page][13]. + + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/linux-wc-command-explained-for-beginners-6-examples/ + +作者:[Himanshu Arora][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.howtoforge.com +[1]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-c-option.png +[2]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-c-option.png +[3]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-m-option.png +[4]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-m-option.png +[5]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-l-option.png +[6]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-l-option.png +[7]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-w-option.png +[8]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-w-option.png +[9]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-L-option.png +[10]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-L-option.png +[11]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/wc-file0-from-option.png +[12]:https://www.howtoforge.com/images/usage_of_pfsense_to_block_dos_attack_/big/wc-file0-from-option.png +[13]:https://linux.die.net/man/1/wc From a18fd31b8e4e474efcdc53d3b538ecccc47312bc Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 18:15:14 +0800 Subject: [PATCH 087/133] translate done: 20171128 How to rename user in Linux (also rename group - home directory).md --- ...ux (also rename group - home directory).md | 64 ---------------- ...ux (also rename group - home directory).md | 76 +++++++++++++++++++ 2 files changed, 76 insertions(+), 64 deletions(-) delete mode 100644 sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md create mode 100644 translated/tech/20171128 How to rename user in Linux (also rename group - home directory).md diff --git a/sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md b/sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md deleted file mode 100644 index 30a65a62ad..0000000000 --- a/sources/tech/20171128 How to rename user in Linux (also rename group - home directory).md +++ /dev/null @@ -1,64 +0,0 @@ -translating by lujun9972 -How to rename user in Linux (also rename group & home directory) -====== -We might have come across a situation where we might want to rename user in Linux system, for whatever reasons. We can easily rename user in Linux & also we can rename the home directory or its UID as well. - -In this short tutorial, we will be discussing these things only. Let's start by renaming user in Linux first, -**(Recommended Read:[How to use FIND command to locate anything in Linux][1])** -### Rename user in Linux - -For renaming user in Linux systems, we will use ** 'usermod'** command. Syntax for the command is, - - **$ usermod -l new_username old_username** - -For example, if we have a user named ** 'dan'** & want to rename it to **' susan'**, execute the following command from terminal; - - **$ sudo usermod -l susan dan** - -This will only change the username & everything else, like group, home directory, UID will remain same. - - **Note:-** You should need to logged out from the account you are trying to rename. You can also kill all the processes running for that user, to do so execute the following command, - - **$ sudo pkill -u dan** - - **$ sudo pkill -9 -u dan** - -### Renaming Home directory - -For renaming home directory to correspond to the renamed user, we use ** '-d'** option with **' usermod'** command., - - **$ sudo usermod -d /home/susan -m susan** - -### Changing UID for the user - -To change the UID of the user , execute the following command, - - **$ sudo usermod -u 2000 susan** - -where **' 2000'** is the new UID for user. - -### Renaming the group - -To rename the group from ** 'dan'** to **' susan**', we will use **' groupmod'** command. Use the following command to rename the group, - - **$ groupmod -n susan dan** - -Once we have made the required changes, we can than check the changes made using the ** 'id'** command, - - **$ id susan** - -With this we end this tutorial on how to rename user in Linux. Please let us know if you have any question or any issue or if you do have any suggestion, please do let us know that as well. - - --------------------------------------------------------------------------------- - -via: http://linuxtechlab.com/rename-user-in-linux-rename-home-directory/ - -作者:[Shusain][a] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linuxtechlab.com/author/shsuain/ -[1]:http://linuxtechlab.com/use-of-find-command/ diff --git a/translated/tech/20171128 How to rename user in Linux (also rename group - home directory).md b/translated/tech/20171128 How to rename user in Linux (also rename group - home directory).md new file mode 100644 index 0000000000..e489cf6380 --- /dev/null +++ b/translated/tech/20171128 How to rename user in Linux (also rename group - home directory).md @@ -0,0 +1,76 @@ +Linux 下如何修改用户名(同时修改用户组名和 home 目录) +====== +有时候,由于某些原因,我们可能会需要重命名用户名。我们可以很容易地修改用户名以及对应的 home 目录和 UID。 + +本教程将会讨论这些东西。让我们先从修改用户名开始, +**(推荐阅读:[Linux 下如何用 FIND 命令查找想要东西的路径 ][1])** +### 修改用户名 + +我们使用 `usermod` 来修改用户名。其语法为, + +``` +$ usermod -l new_username old_username +``` + +举个例子,假设我们有一个名叫 `dan` 的用户想要重命名为 `susan`,那么在终端下执行下面命令; + +``` +$ sudo usermod -l susan dan +``` + +这只会更改用户名,而其他的东西,比如用户组,home 目录,UID 等都保持不变。 + + **注意:-** 你需要从要改名的帐号中登出并杀掉该用户的所有进程,要杀掉该用户的所有进程可以执行下面命令, + +``` +$ sudo pkill -u dan +$ sudo pkill -9 -u dan +``` + +### 修改 Home 目录 + +要同时更改 home 目录,我们需要在执行 `usermod` 命令的同时加上 `-d` 选项, + +``` +$ sudo usermod -d /home/susan -m susan +``` + +### 更改用户 UDI + +执行下面命令修改用户 UID, + +``` +$ sudo usermod -u 2000 susan +``` + +这里 `2000` 就是用户的新 UID。 + +### 修改用户组名 + +要把用户组名从 `dan` 修改为 `susan`,我们需要使用 `groupmod` 命令。使用下面命令来修改用户组名, + +``` +$ groupmod -n susan dan +``` + +做完修改后,可以使用 `id` 命令来检查, + +``` +$ id susan +``` + +这篇教导如何修改用户名的指南就此结束了。有任何疑问或建议,欢迎给我们留言。 + + +-------------------------------------------------------------------------------- + +via: http://linuxtechlab.com/rename-user-in-linux-rename-home-directory/ + +作者:[Shusain][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxtechlab.com/author/shsuain/ +[1]:http://linuxtechlab.com/use-of-find-command/ From 393b8a6b4d29aa23ef740181c5e5b32de3210d8c Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 18:48:23 +0800 Subject: [PATCH 088/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Config?= =?UTF-8?q?ure=20Linux=20for=20Children?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...226 How to Configure Linux for Children.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20171226 How to Configure Linux for Children.md diff --git a/sources/tech/20171226 How to Configure Linux for Children.md b/sources/tech/20171226 How to Configure Linux for Children.md new file mode 100644 index 0000000000..318e4126a7 --- /dev/null +++ b/sources/tech/20171226 How to Configure Linux for Children.md @@ -0,0 +1,143 @@ +How to Configure Linux for Children +====== + +![](https://www.maketecheasier.com/assets/uploads/2017/12/keep-kids-safe-online-hero.jpg) + +If you've been around computers for a while, you might associate Linux with a certain stereotype of computer user. How do you know someone uses Linux? Don't worry, they'll tell you. + +But Linux is an exceptionally customizable operating system. This allows users an unprecedented degree of control. In fact, parents can set up a specialized distro of Linux for children, ensuring children don't stumble across dangerous content accidentally. While the process is more prolonged than using Windows, it's also more powerful and durable. Linux is also free, which can make it well-suited for classroom or computer lab deployment. + +## Linux Distros for Children + +These Linux distros for children are built with simplified, kid-friendly interfaces. An adult will need to install and set up the operating system at first, but kids can run the computer entirely alone. You'll find large colorful interfaces, plenty of pictures and simple language. + +Unfortunately, none of these distros are regularly updated, and some are no longer in active development. That doesn't mean they won't work, but it does make malfunctions more likely. + +![qimo-gcompris][1] + + +### 1. Edubuntu + +[Edubuntu][2] is an education-specific fork of the popular Ubuntu operating system. It has a rich graphical environment and ships with a lot of educational software that's easy to update and maintain. It's designed for children in middle and high school. + +### 2. Ubermix + +[Ubermix][3] is designed from the ground up with the needs of education in mind. Ubermix takes all the complexity out of student devices by making them as reliable and easy-to-use as a cell phone without sacrificing the power and capabilities of a full operating system. With a turn-key, five-minute installation, twenty-second quick recovery mechanism, and more than sixty free applications pre-installed, ubermix turns whatever hardware you have into a powerful device for learning. + +### 3. Sugar + +[Sugar][4] is the operating system built for the One Laptop Per Child initiative. Sugar is pretty different from normal desktop Linux, with a heavy bias towards classroom use and teaching programming skills. + + **Note** : do note that there are several more Linux distros for kids that we didn't include in the list above because they have not been actively developed or were abandoned a long time ago. + +## Content Filtering Linux for Children + +The best tool for protecting children from accessing inappropriate content is you, but you can't be there all the time. Content filtering via proxy filtering sets up certain URLs as "off limits." There are two main tools you can use. + +![linux-for-children-content-filtering][5] + +### 1. DansGuardian + +[DansGuardian][6], an open-source content filter that works on virtually every Linux distro, is flexible and powerful, requiring command-line setup with a proxy of your choice. If you don't mind digging into proxy settings, this is the most powerful choice. + +Setting up DansGuardian is not an easy task, and you can follow the installation instructions on its main page. But once it is set up, it is a very effective tool to filter out unwanted content. + +### 2. Parental Control: Family Friendly Filter + +[Parental Control: Family Friendly Filter][7] is an extension for Firefox that allows parents to block sites containing pornography and any other kind of inappropriate material. You can blacklist particular domains so that bad websites are always blocked. + +![firefox-content-filter-addon][8] + +If you are still using an older version of Firefox that doesn't support [web extensions][9], then you can check out [ProCon Latte Content Filter][10]. Parents add domains to a pre-loaded blacklist and set a password to keep the extension from being modified. + +### 3. Blocksi Web Filter + +[Blocksi Web Filter][11] is an extension for Chrome and is useful for Web and Youtube filtering. It also comes with a time-access control so that you can limit the hours your kids can access the Web. + +## Fun Stuff + +![linux-for-children-tux-kart][12] + +Any computer for children better have some games on it, educational or otherwise. While Linux isn't as gaming-friendly as Windows, it's getting closer all the time. Here are several suggestions for constructive games you might load on to Linux for children: + +* [Super Tux Kart][21] (kart racing game) + +* [GCompris][22] (educational game suite) + +* [Secret Maryo Chronicles][23] (Super Mario clone) + +* [Childsplay][24] (educational/memory games) + +* [EToys][25] (programming for kids) + +* [TuxTyping][26], (typing game) + +* [Kalzium][27] (periodic table guide) + +* [Tux of Math Command][28] (math arcade games) + +* [Pink Pony][29] (Tron-like racing game) + +* [KTuberling][30] (constructor game) + +* [TuxPaint][31] (painting) + +* [Blinken][32] ([memory][33] game) + +* [KTurtle][34] (educational programming environment) + +* [KStars][35] (desktop planetarium) + +* [Marble][36] (virtual globe) + +* [KHangman][37] (hangman guessing game) + +## Conclusion: Why Linux for Children? + +Linux has a reputation for being needlessly complex. So why use Linux for children? It's about setting kids up to learn. Working with Linux provides many opportunities to learn how the operating system works. As children get older, they'll have opportunities to explore, driven by their own interests and curiosity. Because the Linux platform is so open to users, it's an excellent venue for children to discover a life-long love of computers. + +This article was first published in July 2010 and was updated in December 2017. + +Image by [Children at school][13] + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/configure-linux-for-children/ + +作者:[Alexander Fox][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/alexfox/ +[1]:https://www.maketecheasier.com/assets/uploads/2010/08/qimo-gcompris.jpg (qimo-gcompris) +[2]:http://www.edubuntu.org +[3]:http://www.ubermix.org/ +[4]:http://wiki.sugarlabs.org/go/Downloads +[5]:https://www.maketecheasier.com/assets/uploads/2017/12/linux-for-children-content-filtering.png (linux-for-children-content-filtering) +[6]:https://help.ubuntu.com/community/DansGuardian +[7]:https://addons.mozilla.org/en-US/firefox/addon/family-friendly-filter/ +[8]:https://www.maketecheasier.com/assets/uploads/2017/12/firefox-content-filter-addon.png (firefox-content-filter-addon) +[9]:https://www.maketecheasier.com/best-firefox-web-extensions/ +[10]:https://addons.mozilla.org/en-US/firefox/addon/procon-latte/ +[11]:https://chrome.google.com/webstore/detail/blocksi-web-filter/pgmjaihnmedpcdkjcgigocogcbffgkbn?hl=en +[12]:https://www.maketecheasier.com/assets/uploads/2017/12/linux-for-children-tux-kart-e1513389774535.jpg (linux-for-children-tux-kart) +[13]:https://www.flickr.com/photos/lupuca/8720604364 +[21]:http://supertuxkart.sourceforge.net/ +[22]:http://gcompris.net/ +[23]:http://www.secretmaryo.org/ +[24]:http://www.schoolsplay.org/ +[25]:http://www.squeakland.org/about/intro/ +[26]:http://tux4kids.alioth.debian.org/tuxtype/index.php +[27]:http://edu.kde.org/kalzium/ +[28]:http://tux4kids.alioth.debian.org/tuxmath/index.php +[29]:http://code.google.com/p/pink-pony/ +[30]:http://games.kde.org/game.php?game=ktuberling +[31]:http://www.tuxpaint.org/ +[32]:https://www.kde.org/applications/education/blinken/ +[33]:https://www.ebay.com/sch/i.html?_nkw=memory +[34]:https://www.kde.org/applications/education/kturtle/ +[35]:https://www.kde.org/applications/education/kstars/ +[36]:https://www.kde.org/applications/education/marble/ +[37]:https://www.kde.org/applications/education/khangman/ From 2e8d4c0acff714e137d1c54e7d63b7a3ea0c860d Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 18:59:30 +0800 Subject: [PATCH 089/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Testing=20Ansible?= =?UTF-8?q?=20Playbooks=20With=20Vagrant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Testing Ansible Playbooks With Vagrant.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20171228 Testing Ansible Playbooks With Vagrant.md diff --git a/sources/tech/20171228 Testing Ansible Playbooks With Vagrant.md b/sources/tech/20171228 Testing Ansible Playbooks With Vagrant.md new file mode 100644 index 0000000000..a49a1a447f --- /dev/null +++ b/sources/tech/20171228 Testing Ansible Playbooks With Vagrant.md @@ -0,0 +1,130 @@ +translating by lujun9972 +Testing Ansible Playbooks With Vagrant +====== +I use Ansible to automate the deployments of my websites ([LinuxJobs.fr][1], [Journal du hacker][2]) and my applications ([Feed2toot][3], [Feed2tweet][4]). I'll describe in this blog post my setup in order to test my Ansible Playbooks locally on my laptop. + +![ansible](https://carlchenet.com/wp-content/uploads/2017/12/ansible-300x300.png) + +### Why testing the Ansible Playbooks + +I need a simple and a fast way to test the deployments of my Ansible Playbooks locally on my laptop, especially at the beginning of writing a new Playbook, because deploying directly on the production server is both reeeeally slow… and risky for my services in production. + +Instead of deploying on a remote server, I'll deploy my Playbooks on a [VirtualBox][5] using [Vagrant][6]. This allows getting quickly the result of a new modification, iterating and fixing as fast as possible. + +Disclaimer: I am not a profesionnal programmer. There might exist better solutions and I'm only describing one solution of testing Ansible Playbooks I find both easy and efficient for my own use cases. + +### My process + + 1. Begin writing the new Ansible Playbook + 2. Launch a fresh virtual machine (VM) and deploy the playbook on this VM using Vagrant + 3. Fix the issues either from the playbook either from the application deployed by Ansible itself + 4. Relaunch the deployment on the VM + 5. If more errors, go back to step 3. Otherwise destroy the VM, recreate it and deploy to test a last time with a fresh install + 6. If no error remains, tag the version of your Ansible Playbook and you're ready to deploy in production + + + +### What you need + +First, you need Virtualbox. If you use the [Debian][7] distribution, [this link][8] describes how to install it, either from the Debian repositories either from the upstream. + +[![][9]][5] + +Second, you need Vagrant. Why Vagrant? Because it's a kind of middleware between your development environment and your virtual machine, allowing programmatically reproducible operations and easy linking your deployments and the virtual machine. Install it with the following command: +``` +# apt install vagrant +``` + +[![][10]][6] + +### Setting up Vagrant + +Everything about Vagrant lies in the file Vagrantfile. Here is mine: +``` +Vagrant.require_version ">= 2.0.0" + +Vagrant.configure(1) do |config| + + config.vm.box = "debian/stretch64" + config.vm.provision "shell", inline: "apt install --yes git python3-pip" + config.vm.provision "ansible" do |ansible| + ansible.verbose = "v" + ansible.playbook = "site.yml" + ansible.vault_password_file = "vault_password_file" + end +end + +``` + 1. The 1st line defines what versions of Vagrant should execute your Vagrantfile. + 2. The first loop of the file, you could define the following operations for as many virtual machines as you wish (here just 1). + 3. The 3rd line defines the official Vagrant image we'll use for the virtual machine. + 4. The 4th line is really important: those are the missing apps we miss on the VM. Here we install git and python3-pip with apt. + 5. The next line indicates the start of the Ansible configuration. + 6. On the 6th line, we want a verbose output of Ansible. + 7. On the 7th line, we define the entry point of your Ansible Playbook. + 8. On the 8th line, if you use Ansible Vault to encrypt some files, just define here the file with your Ansible Vault passphrase. + + + +When Vagrant launches Ansible, it's going to launch something like: +``` +$  ansible-playbook --inventory-file=/home/me/ansible/test-ansible-playbook/.vagrant/provisioners/ansible/inventory -v --vault-password-file=vault_password_file site.yml +``` + +### Executing Vagrant + +After writing your Vagrantfile, you need to launch your VM. It's as simple as using the following command: +``` +$ vagrant up +``` + +That's a slow operation, because the VM will be launched, the additionnal apps you defined in the Vagrantfile will be installed and finally your Playbook will be deployed on it. You should sparsely use it. + +Ok, now we're really ready to iterate fast. Between your different modifications, in order to test your deployments fast and on a regular basis, just use the following command: +``` +$ vagrant provision +``` + +Once your Ansible Playbook is finally ready, usually after lots of iterations (at least that's my case), you should test it on a fresh install, because your different iterations may have modified your virtual machine and could trigger unexpected results. + +In order to test it from a fresh install, use the following command: +``` +$ vagrant destroy && vagrant up +``` + +That's again a slow operation. You should use it when you're pretty sure your Ansible Playbook is almost finished. After testing your deployment on a fresh VM, you're now ready to deploy in production.Or at least better prepared :p + +### Possible improvements? Let me know + +I find the setup described in this blog post quite useful for my use cases. I can iterate quite fast especially when I begin writing a new playbook, not only on the playbook but sometimes on my own latest apps, not yet ready to be deployed in production. Deploying on a remote server would be both slow and dangerous for my services in production. + +I could use a continous integration (CI) server, but that's not the topic of this blog post. As said before, the goal is to iterate as fast as possible in the beginning of writing a new Ansible Playbook. + +Commiting, pushing to your Git repository and waiting for the execution of your CI tests is overkill at the beginning of your Ansible Playbook, when it's full of errors waiting to be debugged one by one. I think CI is more useful later in the life of the Ansible Playbooks, especially when different people work on it and you have a set or code quality rules to enforce. That's only my opinion and it's open to discussion, one more time I'm not a professionnal programmer. + +If you have better solutions to test Ansible Playbooks or to improve the one describe here, let me know by writing a comment or by contacting me through my accounts on social networks below, I'll be delighted to listen to your improvements. + + + + +-------------------------------------------------------------------------------- + +via: https://carlchenet.com/testing-ansible-playbooks-with-vagrant/ + +作者:[Carl Chenet][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://carlchenet.com +[1]:https://www.linuxjobs.fr +[2]:https://www.journalduhacker.net +[3]:https://gitlab.com/chaica/feed2toot +[4]:https://gitlab.com/chaica/feed2tweet +[5]:https://www.virtualbox.org/ +[6]:https://www.vagrantup.com/ +[7]:https://www.debian.org +[8]:https://wiki.debian.org/VirtualBox +[9]:https://carlchenet.com/wp-content/uploads/2017/12/virtualbox-150x150.png +[10]:https://carlchenet.com/wp-content/uploads/2017/12/vagrant-300x98.png From d4d2882f936e8f0ee8a5d9081c4f7b87e0ca8a2b Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 19:09:21 +0800 Subject: [PATCH 090/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Add=20speech=20to?= =?UTF-8?q?=20your=20Fedora=20system?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...170804 Add speech to your Fedora system.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/tech/20170804 Add speech to your Fedora system.md diff --git a/sources/tech/20170804 Add speech to your Fedora system.md b/sources/tech/20170804 Add speech to your Fedora system.md new file mode 100644 index 0000000000..47a6b46131 --- /dev/null +++ b/sources/tech/20170804 Add speech to your Fedora system.md @@ -0,0 +1,69 @@ +translating by lujun9972 +Add speech to your Fedora system +====== + +![](https://fedoramagazine.org/wp-content/uploads/2017/08/espeak-945x400.png) +By default, Fedora Workstation ships a small package called espeak. It adds a speech synthesizer -- that is, text-to-speech software. + +In today's world, talking devices are nothing impressive as they're very common. You can find speech synthesizers even in your smartphone, a product like Amazon Alexa, or in the announcements at the train station. In addition, synthesized voices are nowadays more or less similar to human speech. We live in a 1980s science fiction movie! + +The voice produced by espeak may sound a bit primitive compared to the aforementioned tools. But at the end of the day espeak produces good quality speech. And whether you find it useful or not, at least it can provide some amusement. + +### Running espeak + +In espeak you can set various parameters using command line options. Examples include: + + * amplitude (-a) + * pitch adjustment (-p) + * speed of sentences (-s) + * gap between words (-g) + + + +Each of these options produces various effects and may help you achieve a cleaner voice. + +You can also select different voice variants with command line options. For example, try -ven+m3 for a different English male voice, and -ven+f1 for a female one. You can also use different languages. For a list, run this command: +``` +espeak --voices +``` + +Note that many languages other than English are experimental attempts. + +To create a WAV file instead of actually speaking something, use the -w option: +``` +espeak -w out.wav "Audio file test" +``` + +The espeak utility also reads the content of a file for you. +``` +espeak -f plaintextfile +``` + +Or you can pass the text to speech from the standard input. In this way, as a simple example, you can build a talking box that alerts you to an event using a voice. Your backup is completed? Add this command to the end of your script: +``` +echo "Backup completed" | espeak -s 160 -a 100 -g 4 +``` + +Suppose an error shows up in a log file: +``` +tail -1F /your/log/file | grep --line-buffered 'ERROR' | espeak +``` + +Or perhaps you want a speaking clock telling you every minute what time it is: +``` +while true; do date +%S | grep '00' && date +%H:%M | espeak; sleep 1; done +``` + +As you can guess, use cases are limited only by your imagination. Enjoy your new talking Fedora system! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/add-speech-fedora-system/ + +作者:[Author Archive][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://alciregi.id.fedoraproject.org/ From b147c96533c72dff18a263b5033d1c1dd253a15e Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 19:12:03 +0800 Subject: [PATCH 091/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Getting=20Started?= =?UTF-8?q?=20with=20Taskwarrior?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...170213 Getting Started with Taskwarrior.md | 238 ++++++++++++++++++ 1 file changed, 238 insertions(+) create mode 100644 sources/tech/20170213 Getting Started with Taskwarrior.md diff --git a/sources/tech/20170213 Getting Started with Taskwarrior.md b/sources/tech/20170213 Getting Started with Taskwarrior.md new file mode 100644 index 0000000000..3fccc15498 --- /dev/null +++ b/sources/tech/20170213 Getting Started with Taskwarrior.md @@ -0,0 +1,238 @@ +Getting Started with Taskwarrior +====== +Taskwarrior is a flexible [command-line task management program][1]. In their [own words][2]: + +Taskwarrior manages your TODO list from your command line. It is flexible, fast, efficient, unobtrusive, does its job then gets out of your way. + +Taskwarrior is highly customizable, but can also be used "right out of the box." In this article, we'll show you the basic commands to add and complete tasks. Then we'll cover a couple more advanced commands. And finally, we'll show you some basic configuration settings to begin customizing your setup. + +### Installing Taskwarrior + +Taskwarrior is available in the Fedora repositories, so installing it is simple: +``` +sudo dnf install task + +``` + +Once installed, run `task`. This first run will create a `~/.taskrc` file for you. +``` +$ **task** +A configuration file could not be found in ~ + +Would you like a sample /home/link/.taskrc created, so Taskwarrior can proceed? (yes/no) yes +[task next] +No matches. + +``` + +### Adding Tasks + +Adding tasks is fast and unobtrusive. +``` +$ **task add Plant the wheat** +Created task 1. + +``` + +Run `task` or `task list` to show upcoming tasks. +``` +$ **task list** + +ID Age Description Urg + 1 8s Plant the wheat 0 + +1 task + +``` + +Let's add a few more tasks to round out the example. +``` +$ **task add Tend the wheat** +Created task 2. +$ **task add Cut the wheat** +Created task 3. +$ **task add Take the wheat to the mill to be ground into flour** +Created task 4. +$ **task add Bake a cake** +Created task 5. + +``` + +Run `task` again to view the list. +``` +[task next] + +ID Age Description Urg + 1 3min Plant the wheat 0 + 2 22s Tend the wheat 0 + 3 16s Cut the wheat 0 + 4 8s Take the wheat to the mill to be ground into flour 0 + 5 2s Bake a cake 0 + +5 tasks + +``` + +### Completing Tasks + +To mark a task as complete, look up its ID and run: +``` +$ **task 1 done** +Completed task 1 'Plant the wheat'. +Completed 1 task. + +``` + +You can also mark a task done with its description. +``` +$ **task 'Tend the wheat' done** +Completed task 1 'Tend the wheat'. +Completed 1 task. + +``` + +With `add`, `list` and `done`, you're all ready to get started with Taskwarrior. + +### Setting Due Dates + +Many tasks do not require a due date: +``` +task add Finish the article on Taskwarrior + +``` + +But sometimes, setting a due date is just the kind of motivation you need to get productive. Use the `due` modifier when adding a task to set a specific due date. +``` +task add Finish the article on Taskwarrior due:tomorrow + +``` + +`due` is highly flexible. It accepts specific dates ("2017-02-02"), or ISO-8601 ("2017-02-02T20:53:00Z"), or even relative time ("8hrs"). See the [Date & Time][3] documentation for all the examples. + +Dates go beyond due dates too. Taskwarrior has `scheduled`, `wait`, and `until`. +``` +task add Proof the article on Taskwarrior scheduled:thurs + +``` + +Once the date (Thursday in this example) passes, the task is tagged with the `READY` virtual tag. It will then show up in the `ready` report. +``` +$ **task ready** + +ID Age S Description Urg + 1 2s 1d Proof the article on Taskwarrior 5 + +``` + +To remove a date, `modify` the task with a blank value: +``` +$ task 1 modify scheduled: + +``` + +### Searching Tasks + +No task list is complete without the ability to search with regular expressions, right? +``` +$ **task '/.* the wheat/' list** + +ID Age Project Description Urg + 2 42min Take the wheat to the mill to be ground into flour 0 + 1 42min Home Cut the wheat 1 + +2 tasks + +``` + +### Customizing Taskwarrior + +Remember that file we created back in the beginning (`~/.taskrc`). Let's take at the defaults: +``` +# [Created by task 2.5.1 2/9/2017 16:39:14] +# Taskwarrior program configuration file. +# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-color', +# 'man task-sync' or 'man taskrc' + +# Here is an example of entries that use the default, override and blank values +# variable=foo -- By specifying a value, this overrides the default +# variable= -- By specifying no value, this means no default +# #variable=foo -- By commenting out the line, or deleting it, this uses the default + +# Use the command 'task show' to see all defaults and overrides + +# Files +data.location=~/.task + +# Color theme (uncomment one to use) +#include /usr//usr/share/task/light-16.theme +#include /usr//usr/share/task/light-256.theme +#include /usr//usr/share/task/dark-16.theme +#include /usr//usr/share/task/dark-256.theme +#include /usr//usr/share/task/dark-red-256.theme +#include /usr//usr/share/task/dark-green-256.theme +#include /usr//usr/share/task/dark-blue-256.theme +#include /usr//usr/share/task/dark-violets-256.theme +#include /usr//usr/share/task/dark-yellow-green.theme +#include /usr//usr/share/task/dark-gray-256.theme +#include /usr//usr/share/task/dark-gray-blue-256.theme +#include /usr//usr/share/task/solarized-dark-256.theme +#include /usr//usr/share/task/solarized-light-256.theme +#include /usr//usr/share/task/no-color.theme + + +``` + +The only active option right now is `data.location=~/.task`. To view active configuration settings (including the built-in defaults), run `show`. +``` +task show + +``` + +To change a setting, use `config`. +``` +$ **task config displayweeknumber no** +Are you sure you want to add 'displayweeknumber' with a value of 'no'? (yes/no) yes +Config file /home/link/.taskrc modified. + +``` + +### Examples + +These are just some of the things you can do with Taskwarrior. + +Assign a project to your tasks: +``` +task 'Fix leak in the roof' modify project:Home + +``` + +Use `start` to mark what you were working on. This can help you remember what you were working on after the weekend: +``` +task 'Fix bug #141291' start + +``` + +Use relevant tags: +``` +task add 'Clean gutters' +weekend +house + +``` + +Be sure to read the [complete documentation][4] to learn all the ways you can catalog and organize your tasks. + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/getting-started-taskwarrior/ + +作者:[Link Dupont][a] +译者:[译者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/linkdupont/ +[1]:https://taskwarrior.org/ +[2]:https://taskwarrior.org/docs/start.html +[3]:https://taskwarrior.org/docs/dates.html +[4]:https://taskwarrior.org/docs/ From 13647f49885a14aa40c2d9d2195d289d915014d9 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 21:08:04 +0800 Subject: [PATCH 092/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Protec?= =?UTF-8?q?t=20Server=20Against=20Brute=20Force=20Attacks=20With=20Fail2ba?= =?UTF-8?q?n=20On=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...te Force Attacks With Fail2ban On Linux.md | 237 ++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 sources/tech/20171107 How To Protect Server Against Brute Force Attacks With Fail2ban On Linux.md diff --git a/sources/tech/20171107 How To Protect Server Against Brute Force Attacks With Fail2ban On Linux.md b/sources/tech/20171107 How To Protect Server Against Brute Force Attacks With Fail2ban On Linux.md new file mode 100644 index 0000000000..0a1a27855e --- /dev/null +++ b/sources/tech/20171107 How To Protect Server Against Brute Force Attacks With Fail2ban On Linux.md @@ -0,0 +1,237 @@ +How To Protect Server Against Brute Force Attacks With Fail2ban On Linux +====== +One of the important task for Linux administrator is to protect server against illegitimate attack or access. By default Linux system comes with well-configured firewall such as Iptables, Uncomplicated Firewall (UFW), ConfigServer Security Firewall (CSF), etc, which will prevent many kinds of attacks. + +Any machine which is connected to the internet is a potential target for malicious attacks. There is a tool called fail2ban is available to mitigate illegitimate access on server. + +### What Is Fail2ban? + +[Fail2ban][1] is an intrusion prevention software, framework which protect server against brute force attacks. It's Written in Python programming language. Fail2ban work based on auth log files, by default it will scan the auth log files such as `/var/log/auth.log`, `/var/log/apache/access.log`, etc.. and bans IPs that show the malicious signs, too many password failures, seeking for exploits, etc. + +Generally fail2Ban is used to update firewall rules to reject the IP addresses for a specified amount of time. Also it will send mail notification too. Fail2Ban comes with many filters for various services such as ssh, apache, nginx, squid, named, mysql, nagios, etc,. + +Fail2Ban is able to reduce the rate of incorrect authentications attempts however it cannot eliminate the risk that weak authentication presents. this is one of the security for server which will prevent brute force attacks. + +### How to Install Fail2ban In Linux + +Fail2ban is already packaged with most of the Linux distribution so, just use you distribution package manager to install it. + +For **`Debian/Ubuntu`** , use [APT-GET Command][2] or [APT Command][3] to install tilda. +``` +$ sudo apt install fail2ban + +``` + +For **`Fedora`** , use [DNF Command][4] to install tilda. +``` +$ sudo dnf install fail2ban + +``` + +For **`CentOS/RHEL`** systems, enable [EPEL Repository][5] or [RPMForge Repository][6] and use [YUM Command][7] to install Terminator. +``` +$ sudo yum install fail2ban + +``` + +For **`Arch Linux`** , use [Pacman Command][8] to install tilda. +``` +$ sudo pacman -S fail2ban + +``` + +For **`openSUSE`** , use [Zypper Command][9] to install tilda. +``` +$ sudo zypper in fail2ban + +``` + +### How To Configure Fail2ban + +By default Fail2ban keeps all the configuration files in `/etc/fail2ban/` directory. The main configuration file is `jail.conf`, it contains a set of pre-defined filters. So, don't edit the file and it's not advisable because whenever new update comes the configuration get reset to default. + +Just create a new configuration file called `jail.local` in the same directory and modify as per your wish. +``` +# cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local + +``` + +By default most of the option was configured perfectly and if you want to enable access to any particular IP then you can add the IP address into `ignoreip` area, for more then one IP give a speace between the IP address. + +The `DEFAULT` section contains the basic set of rules that Fail2Ban follow and you can adjust any parameter as per your wish. +``` +# nano /etc/fail2ban/jail.local + +[DEFAULT] +ignoreip = 127.0.0.1/8 192.168.1.100/24 +bantime = 600 +findtime = 600 +maxretry = 3 +destemail = 2daygeek@gmail.com + +``` + + * **ignoreip :** This section allow us to whitelist the list of IP address and Fail2ban will not ban a host which matches an address in this list + * **bantime :** The number of seconds that a host is banned + * **findtime :** A host is banned if it has generated "maxretry" during the last "findtime" seconds + * **maxretry :** "maxretry" is the number of failures before a host get banned. + + + +### How To Configure Service + +Fail2ban comes with set of pre-defined filters for various servicess such as ssh, apache, nginx, squid, named, mysql, nagios, etc,. We don't want to make any changes on configuration file and just add following line `enabled = true` in the service area to enable jail to any services. To disable make the line to `false` instead of ture. +``` +# SSH servers +[sshd] +enabled = true +port = ssh +logpath = %(sshd_log)s +backend = %(sshd_backend)s + +``` + + * **enabled :** Determines whether the service is turned on or off. + * **port :** It's refering to the particular service. If using the default port, then the service name can be placed here. If using a non-traditional port, this should be the port number. + * **logpath :** Gives the location of the service's logs./li> + * **backend :** "backend" specifies the backend used to get files modification. + + + +### Restart Fail2Ban + +After making changes restart Fail2Ban to take effect. +``` +[For SysVinit Systems] +# service fail2ban restart + +[For systemd Systems] +# systemctl restart fail2ban.service + +``` + +### Verify Fail2Ban iptables rules + +You can confirm whether Fail2Ban iptables rules are added into firewall using below command. +``` +# iptables -L +Chain INPUT (policy ACCEPT) +target prot opt source destination +f2b-apache-auth tcp -- anywhere anywhere multiport dports http,https +f2b-sshd tcp -- anywhere anywhere multiport dports 1234 +ACCEPT tcp -- anywhere anywhere tcp dpt:1234 + +Chain FORWARD (policy ACCEPT) +target prot opt source destination + +Chain OUTPUT (policy ACCEPT) +target prot opt source destination + +Chain f2b-apache-auth (1 references) +target prot opt source destination +RETURN all -- anywhere anywhere + +Chain f2b-sshd (1 references) +target prot opt source destination +RETURN all -- anywhere anywhere +``` + +### How To Test Fail2ban + +I have made some failed attempts to test this. To confirm this, I'm going to verify the `/var/log/fail2ban.log` file. +``` +2017-11-05 14:43:22,901 fail2ban.server [7141]: INFO Changed logging target to /var/log/fail2ban.log for Fail2ban v0.9.6 +2017-11-05 14:43:22,987 fail2ban.database [7141]: INFO Connected to fail2ban persistent database '/var/lib/fail2ban/fail2ban.sqlite3' +2017-11-05 14:43:22,996 fail2ban.database [7141]: WARNING New database created. Version '2' +2017-11-05 14:43:22,998 fail2ban.jail [7141]: INFO Creating new jail 'sshd' +2017-11-05 14:43:23,002 fail2ban.jail [7141]: INFO Jail 'sshd' uses poller {} +2017-11-05 14:43:23,019 fail2ban.jail [7141]: INFO Initiated 'polling' backend +2017-11-05 14:43:23,019 fail2ban.filter [7141]: INFO Set maxRetry = 5 +2017-11-05 14:43:23,020 fail2ban.filter [7141]: INFO Set jail log file encoding to UTF-8 +2017-11-05 14:43:23,020 fail2ban.filter [7141]: INFO Added logfile = /var/log/auth.log +2017-11-05 14:43:23,021 fail2ban.actions [7141]: INFO Set banTime = 600 +2017-11-05 14:43:23,021 fail2ban.filter [7141]: INFO Set findtime = 600 +2017-11-05 14:43:23,022 fail2ban.filter [7141]: INFO Set maxlines = 10 +2017-11-05 14:43:23,070 fail2ban.server [7141]: INFO Jail sshd is not a JournalFilter instance +2017-11-05 14:43:23,081 fail2ban.jail [7141]: INFO Jail 'sshd' started +2017-11-05 14:43:23,763 fail2ban.filter [7141]: INFO [sshd] Found 103.5.134.167 +2017-11-05 14:43:23,763 fail2ban.filter [7141]: INFO [sshd] Found 103.5.134.167 +2017-11-05 14:43:23,764 fail2ban.filter [7141]: INFO [sshd] Found 181.129.54.170 +2017-11-05 14:43:23,764 fail2ban.filter [7141]: INFO [sshd] Found 181.129.54.170 +2017-11-05 14:43:23,765 fail2ban.filter [7141]: INFO [sshd] Found 181.129.54.170 +2017-11-05 14:43:23,765 fail2ban.filter [7141]: INFO [sshd] Found 181.129.54.170 +2017-11-05 15:19:06,192 fail2ban.server [7141]: INFO Stopping all jails +2017-11-05 15:19:06,874 fail2ban.jail [7141]: INFO Jail 'sshd' stopped +2017-11-05 15:19:06,879 fail2ban.server [7141]: INFO Exiting Fail2ban +2017-11-05 15:19:07,123 fail2ban.server [8528]: INFO Changed logging target to /var/log/fail2ban.log for Fail2ban v0.9.6 +2017-11-05 15:19:07,123 fail2ban.database [8528]: INFO Connected to fail2ban persistent database '/var/lib/fail2ban/fail2ban.sqlite3' +2017-11-05 15:19:07,126 fail2ban.jail [8528]: INFO Creating new jail 'sshd' +2017-11-05 15:19:07,129 fail2ban.jail [8528]: INFO Jail 'sshd' uses poller {} +2017-11-05 15:19:07,141 fail2ban.jail [8528]: INFO Initiated 'polling' backend +2017-11-05 15:19:07,142 fail2ban.actions [8528]: INFO Set banTime = 60 +2017-11-05 15:19:07,142 fail2ban.filter [8528]: INFO Set findtime = 60 +2017-11-05 15:19:07,142 fail2ban.filter [8528]: INFO Set jail log file encoding to UTF-8 +2017-11-05 15:19:07,143 fail2ban.filter [8528]: INFO Set maxRetry = 3 +2017-11-05 15:19:07,144 fail2ban.filter [8528]: INFO Added logfile = /var/log/auth.log +2017-11-05 15:19:07,144 fail2ban.filter [8528]: INFO Set maxlines = 10 +2017-11-05 15:19:07,189 fail2ban.server [8528]: INFO Jail sshd is not a JournalFilter instance +2017-11-05 15:19:07,195 fail2ban.jail [8528]: INFO Jail 'sshd' started +2017-11-05 15:20:03,263 fail2ban.filter [8528]: INFO [sshd] Found 103.5.134.167 +2017-11-05 15:20:05,267 fail2ban.filter [8528]: INFO [sshd] Found 103.5.134.167 +2017-11-05 15:20:12,276 fail2ban.filter [8528]: INFO [sshd] Found 103.5.134.167 +2017-11-05 15:20:12,380 fail2ban.actions [8528]: NOTICE [sshd] Ban 103.5.134.167 +2017-11-05 15:21:12,659 fail2ban.actions [8528]: NOTICE [sshd] Unban 103.5.134.167 + +``` + +To Check list of jail enabled, run the following command. +``` +# fail2ban-client status +Status +|- Number of jail: 2 +`- Jail list: apache-auth, sshd + +``` + +To get the blocked Ip address by running following command. +``` +# fail2ban-client status ssh +Status for the jail: ssh +|- filter +| |- File list: /var/log/auth.log +| |- Currently failed: 1 +| `- Total failed: 3 +`- action + |- Currently banned: 1 + | `- IP list: 192.168.1.115 + `- Total banned: 1 + +``` + +To remove blocked IP address from Fail2Ban, run the following command. +``` +# fail2ban-client set ssh unbanip 192.168.1.115 + +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-install-setup-configure-fail2ban-on-linux/# + +作者:[Magesh Maruthamuthu][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.2daygeek.com/author/magesh/ +[1]:https://github.com/fail2ban/fail2ban +[2]:https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[3]:https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[4]:https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[5]:https://www.2daygeek.com/install-enable-epel-repository-on-rhel-centos-scientific-linux-oracle-linux/ +[6]:https://www.2daygeek.com/install-enable-repoforge-rpmforge-repository-on-rhel-centos-sl/ +[7]:https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[8]:https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[9]:https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[10]:/cdn-cgi/l/email-protection From 98d39659e9248529d4450fd31adfd876efa66df2 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 21:18:12 +0800 Subject: [PATCH 093/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Moneti?= =?UTF-8?q?ze=20an=20Open=20Source=20Project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... How to Monetize an Open Source Project.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20171107 How to Monetize an Open Source Project.md diff --git a/sources/tech/20171107 How to Monetize an Open Source Project.md b/sources/tech/20171107 How to Monetize an Open Source Project.md new file mode 100644 index 0000000000..113babe690 --- /dev/null +++ b/sources/tech/20171107 How to Monetize an Open Source Project.md @@ -0,0 +1,84 @@ +How to Monetize an Open Source Project +====== +The problem for any small group of developers putting the finishing touches on a commercial open source application is figuring out how to monetize the software in order to keep the bills paid and food on the table. Often these small pre-startups will start by deciding which of the recognized open source business models they're going to adapt, whether that be following Red Hat's lead and offering professional services, going the SaaS route, releasing as open core or something else. + +Steven Grandchamp, general manager for MariaDB's North America operations and CEO for Denver-based startup [Drud Tech][1], thinks that might be putting the cart before the horse. With an open source project, the best first move is to get people downloading and using your product for free. + +**Related:** [Demand for Open Source Skills Continues to Grow][2] + +"The number one tangent to monetization in any open source product is adoption, because the key to monetizing an open source product is you flip what I would call the sales funnel upside down," he told ITPro at the recent All Things Open conference in Raleigh, North Carolina. + +In many ways, he said, selling open source solutions is the opposite of marketing traditional proprietary products, where adoption doesn't happen until after a contract is signed. + +**Related:** [Is Raleigh the East Coast's Silicon Valley?][3] + +"In a proprietary software company, you advertise, you market, you make claims about what the product can do, and then you have sales people talk to customers. Maybe you have a free trial or whatever. Maybe you have a small version. Maybe it's time bombed or something like that, but you don't really get to realize the benefit of the product until there's a contract and money changes hands." + +Selling open source solutions is different because of the challenge of selling software that's freely available as a GitHub download. + +"The whole idea is to put the product out there, let people use it, experiment with it, and jump on the chat channels," he said, pointing out that his company Drud has a public chat channel that's open to anybody using their product. "A subset of that group is going to raise their hand and go, 'Hey, we need more help. We'd like a tighter relationship with the company. We'd like to know where your road map's going. We'd like to know about customization. We'd like to know if maybe this thing might be on your road map.'" + +Grandchamp knows more than a little about making software pay, from both the proprietary and open source sides of the fence. In the 1980s he served as VP of research and development at Formation Technologies, and became SVP of R&D at John H. Harland after it acquired Formation in the mid-90s. He joined MariaDB in 2016, after serving eight years as CEO at OpenLogic, which was providing commercial support for more than 600 open-source projects at the time it was acquired by Rogue Wave Software. Along the way, there was a two year stint at Microsoft's Redmond campus. + +OpenLogic was where he discovered open source, and his experiences there are key to his approach for monetizing open source projects. + +"When I got to OpenLogic, I was told that we had 300 customers that were each paying $99 a year for access to our tool," he explained. "But the problem was that nobody was renewing the tool. So I called every single customer that I could find and said 'did you like the tool?'" + +It turned out that nearly everyone he talked to was extremely happy with the company's software, which ironically was the reason they weren't renewing. The company's tool solved their problem so well there was no need to renew. + +"What could we have offered that would have made you renew the tool?" he asked. "They said, 'If you had supported all of the open source products that your tool assembled for me, then I would have that ongoing relationship with you.'" + +Grandchamp immediately grasped the situation, and when the CTO said such support would be impossible, Grandchamp didn't mince words: "Then we don't have a company." + +"We figured out a way to support it," he said. "We created something called the Open Logic Expert Community. We developed relationships with committers and contributors to a couple of hundred open source packages, and we acted as sort of the hub of the SLA for our customers. We had some people on staff, too, who knew the big projects." + +After that successful launch, Grandchamp and his team began hearing from customers that they were confused over exactly what open source code they were using in their projects. That lead to the development of what he says was the first software-as-a-service compliance portal of open source, which could scan an application's code and produce a list of all of the open source code included in the project. When customers then expressed confusion over compliance issues, the SaaS service was expanded to flag potential licensing conflicts. + +Although the product lines were completely different, the same approach was used to monetize MariaDB, then called SkySQL, after MySQL co-founders Michael "Monty" Widenius, David Axmark, and Allan Larsson created the project by forking MySQL, which Oracle had acquired from Sun Microsystems in 2010. + +Again, users were approached and asked what things they would be willing to purchase. + +"They wanted different functionality in the database, and you didn't really understand this if you didn't talk to your customers," Grandchamp explained. "Monty and his team, while they were being acquired at Sun and Oracle, were working on all kinds of new functionality, around cloud deployments, around different ways to do clustering, they were working on lots of different things. That work, Oracle and MySQL didn't really pick up." + +Rolling in the new features customers wanted needed to be handled gingerly, because it was important to the folks at MariaDB to not break compatibility with MySQL. This necessitated a strategy around when the code bases would come together and when they would separate. "That road map, knowledge, influence and technical information was worth paying for." + +As with OpenLogic, MariaDB customers expressed a willingness to spend money on a variety of fronts. For example, a big driver in the early days was a project called Remote DBA, which helped customers make up for a shortage of qualified database administrators. The project could help with design issues, as well as monitor existing systems to take the workload off of a customer's DBA team. The service also offered access to MariaDB's own DBAs, many of whom had a history with the database going back to the early days of MySQL. + +"That was a subscription offering that people were definitely willing to pay for," he said. + +The company also learned, again by asking and listening to customers, that there were various types of support subscriptions that customers were willing to purchase, including subscriptions around capability and functionality, and a managed service component of Remote DBA. + +These days Grandchamp is putting much of his focus on his latest project, Drud, a startup that offers a suite of integrated, automated, open source development tools for developing and managing multiple websites, which can be running on any combination of content management systems and deployment platforms. It is monetized partially through modules that add features like a centralized dashboard and an "intelligence engine." + +As you might imagine, he got it off the ground by talking to customers and giving them what they indicated they'd be willing to purchase. + +"Our number one customer target is the agency market," he said. "The enterprise market is a big target, but I believe it's our second target, not our first. And the reason it's number two is they don't make decisions very fast. There are technology refresh cycles that have to come up, there are lots of politics involved and lots of different vendors. It's lucrative once you're in, but in a startup you've got to figure out how to pay your bills. I want to pay my bills today. I don't want to pay them in three years." + +Drud's focus on the agency market illustrates another consideration: the importance of understanding something about your customers' business. When talking with agencies, many said they were tired of being offered generic software that really didn't match their needs from proprietary vendors that didn't understand their business. In Drud's case, that understanding is built into the company DNA. The software was developed by an agency to fill its own needs. + +"We are a platform designed by an agency for an agency," Grandchamp said. "Right there is a relationship that they're willing to pay for. We know their business." + +Grandchamp noted that startups also need to be able to distinguish users from customers. Most of the people downloading and using commercial open source software aren't the people who have authorization to make purchasing decisions. These users, however, can point to the people who control the purse strings. + +"It's our job to build a way to communicate with those users, provide them value so that they'll give us value," he explained. "It has to be an equal exchange. I give you value of a tool that works, some advice, really good documentation, access to experts who can sort of guide you along. Along the way I'm asking you for pieces of information. Who do you work for? How are the technology decisions happening in your company? Are there other people in your company that we should refer the product to? We have to create the dialog." + +In the end, Grandchamp said, in the open source world the people who go out to find business probably shouldn't see themselves as salespeople, but rather, as problem solvers. + +"I believe that you're not really going to need salespeople in this model. I think you're going to need customer success people. I think you're going to need people who can enable your customers to be successful in a business relationship that's more highly transactional." + +"People don't like to be sold," he added, "especially in open source. The last person they want to see is the sales person, but they like to ply and try and consume and give you input and give you feedback. They love that." + +-------------------------------------------------------------------------------- + +via: http://www.itprotoday.com/software-development/how-monetize-open-source-project + +作者:[Christine Hall][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.itprotoday.com/author/christine-hall +[1]:https://www.drud.com/ +[2]:http://www.itprotoday.com/open-source/demand-open-source-skills-continues-grow +[3]:http://www.itprotoday.com/software-development/raleigh-east-coasts-silicon-valley From fde6d795b3e015306bb918145495b7ed8b054404 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 21:19:26 +0800 Subject: [PATCH 094/133] add done: 20171107 How to Monetize an Open Source Project.md --- sources/tech/20171107 How to Monetize an Open Source Project.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20171107 How to Monetize an Open Source Project.md b/sources/tech/20171107 How to Monetize an Open Source Project.md index 113babe690..ab51006101 100644 --- a/sources/tech/20171107 How to Monetize an Open Source Project.md +++ b/sources/tech/20171107 How to Monetize an Open Source Project.md @@ -1,5 +1,7 @@ How to Monetize an Open Source Project ====== + +![](http://www.itprotoday.com/sites/itprotoday.com/files/styles/article_featured_standard/public/ThinkstockPhotos-629994230_0.jpg?itok=5dZ68OTn) The problem for any small group of developers putting the finishing touches on a commercial open source application is figuring out how to monetize the software in order to keep the bills paid and food on the table. Often these small pre-startups will start by deciding which of the recognized open source business models they're going to adapt, whether that be following Red Hat's lead and offering professional services, going the SaaS route, releasing as open core or something else. Steven Grandchamp, general manager for MariaDB's North America operations and CEO for Denver-based startup [Drud Tech][1], thinks that might be putting the cart before the horse. With an open source project, the best first move is to get people downloading and using your product for free. From da317e00b6a0ab5b3afde45fad5985c9182efede Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 21:22:06 +0800 Subject: [PATCH 095/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Setup?= =?UTF-8?q?=20Japanese=20Language=20Environment=20In=20Arch=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nese Language Environment In Arch Linux.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20171108 How To Setup Japanese Language Environment In Arch Linux.md diff --git a/sources/tech/20171108 How To Setup Japanese Language Environment In Arch Linux.md b/sources/tech/20171108 How To Setup Japanese Language Environment In Arch Linux.md new file mode 100644 index 0000000000..17546c1b03 --- /dev/null +++ b/sources/tech/20171108 How To Setup Japanese Language Environment In Arch Linux.md @@ -0,0 +1,98 @@ +How To Setup Japanese Language Environment In Arch Linux +====== + +![](https://www.ostechnix.com/wp-content/uploads/2017/11/Setup-Japanese-Language-Environment-In-Arch-Linux-720x340.jpg) + +In this tutorial, we will be discussing how to setup Japanese language environment in Arch Linux. In other Unix-like operating systems, it is not a big deal to setup Japanese layout. You can easily choose the Japanese keyboard layout from Settings. However, it is bit difficult under Arch Linux and there is no proper documentation in ArchWiki. If you're using Arch Linux and/or its derivatives like Antergos, Manajaro Linux, follow this guide to use Japanese language in your Arch Linux and its derivatives systems. + +### Setup Japanese Language Environment In Arch Linux + +First, install the necessary Japanese fonts for viewing Japanese ascii arts properly: +``` +sudo pacman -S adobe-source-han-sans-jp-fonts otf-ipafont +``` +``` +pacaur -S ttf-monapo +``` + +If you don't have Pacaur installed already, refer [**this link**][1]. + +Make sure you have commented out (add # to comment out) the following line in **/etc/locale.gen** file. +``` +#ja_JP.UTF-8 +``` + +Then, install **iBus** and **ibus-anthy**. For those wondering, iBus is Input method (IM) framework for Unix-like systems and ibus-anthy is the Japanese input method for iBus. +``` +sudo pacman -S ibus ibus-anthy +``` + +Add the following lines in **~/.xprofile** (If it doesn 't exist, create one): +``` +# Settings for Japanese input +export GTK_IM_MODULE='ibus' +export QT_IM_MODULE='ibus' +export XMODIFIERS=@im='ibus' + +#Toolbar for anthy +ibus-daemon -drx +``` + +The ~/.xprofile file allows us to execute commands at the beginning of the X user session before the window manager is started. + +Save and close the file. Restart your Arch Linux system to take effect the changes. + +After logging in to your system, right click on the iBus icon in the task bar and choose **Preferences**. If it is not there, run the following command from Terminal to start IBus and open the preferences window. +``` +ibus-setup +``` + +Choose Yes to start iBus. You will see a screen something like below. Click Ok to close it. + +[![][2]][3] + +Now, you will see the iBus preferences window. Go to **Input Method** tab and click "Add" button. + +[![][2]][4] + +Choose "Japanese" from the list: + +[![][2]][5] + +And then, choose "Anthy" and click Add. + +[![][2]][6] + +That's it. You will now see "Japanese - Anthy" in your Input Method section. + +[![][2]][7] + +Then change the options for Japanese input as per your requirement in the Preferences section (Click Japanese - Anthy -> Preferences). + +[![][2]][8] + +You can also edit the default shortcuts in the key bindings section. Once you made all changes, click Apply and OK. That's it. Choose the Japanese language from iBus icon in the task bar or press **SUPER KEY+SPACE BAR** to switch between Japanese and English languages (or any other default language in your system). You can change the keyboard shortcuts from IBus Preferences window. + +You know now how to use Japanese language in Arch Linux and derivatives. If you find our guides useful, please share them on your social, professional networks and support OSTechNix. + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/setup-japanese-language-environment-arch-linux/ + +作者:[][a] +译者:[译者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 +[1]:https://www.ostechnix.com/install-pacaur-arch-linux/ +[2]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[3]:http://www.ostechnix.com/wp-content/uploads/2017/11/ibus.png () +[4]:http://www.ostechnix.com/wp-content/uploads/2017/11/iBus-preferences.png () +[5]:http://www.ostechnix.com/wp-content/uploads/2017/11/Choose-Japanese.png () +[6]:http://www.ostechnix.com/wp-content/uploads/2017/11/Japanese-Anthy.png () +[7]:http://www.ostechnix.com/wp-content/uploads/2017/11/iBus-preferences-1.png () +[8]:http://www.ostechnix.com/wp-content/uploads/2017/11/ibus-anthy.png () From 7c32e5cf7797f152feea9a0524102d55c0646e22 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 21:28:03 +0800 Subject: [PATCH 096/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Use=20?= =?UTF-8?q?GNOME=20Shell=20Extensions=20[Complete=20Guide]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...GNOME Shell Extensions [Complete Guide].md | 200 ++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 sources/tech/20171108 How to Use GNOME Shell Extensions [Complete Guide].md diff --git a/sources/tech/20171108 How to Use GNOME Shell Extensions [Complete Guide].md b/sources/tech/20171108 How to Use GNOME Shell Extensions [Complete Guide].md new file mode 100644 index 0000000000..db03bb5964 --- /dev/null +++ b/sources/tech/20171108 How to Use GNOME Shell Extensions [Complete Guide].md @@ -0,0 +1,200 @@ +How to Use GNOME Shell Extensions [Complete Guide] +====== +**Brief: This is a detailed guide showing you how to install GNOME Shell Extensions manually or easily via a browser. ** + +While discussing [how to install themes in Ubuntu 17.10][1], I briefly mentioned GNOME Shell Extension. It was used to enable user themes. Today, we'll have a detailed look at GNOME Shell Extensions in Ubuntu 17.10. + +I may use the term GNOME Extensions instead of GNOME Shell Extensions but both have the same meaning here. + +What are GNOME Shell Extensions? How to install GNOME Shell Extensions? And how to manage and remove GNOME Shell Extensions? I'll explain all these questions, one by one. + +Before that, if you prefer video, I have demonstrated all these on [It's FOSS YouTube channel][2]. I highly recommend that you subscribe to it for more Linux videos. + +## What is a GNOME Shell Extension? + +A [GNOME Shell Extension][3] is basically a tiny piece of code that enhances the capability of GNOME desktop. + +Think of it as an add-on in your browser. For example, you can install an add-on in your browser to disable ads. This add-on is developed by a third-party developer. Though your web browser doesn't provide it by default, installing this add-on enhances the capability of your web browser. + +Similarly, GNOME Shell Extensions are like those third-party add-ons and plugins that you can install on top of GNOME. These extensions are created to perform specific tasks such as display weather condition, internet speed etc. Mostly, you can access them in the top panel. + +![GNOME Shell Extension in action][5] + +There are also GNOME Extensions that are not visible on the top panel. But they still tweak GNOME's behavior. For example, middle mouse button can be used to close an application with one such extension. + +## Installing GNOME Shell Extensions + +Now that you know what are GNOME Shell Extensions, let's see how to install them. There are three ways you can use GNOME Extensions: + + * Use a minimal set of extensions from Ubuntu (or your Linux distribution) + * Find and install extensions in your web browser + * Download and manually install extensions + + + +Before you learn how to use GNOME Shell Extensions, you should install GNOME Tweak Tool. You can find it in the Software Center. Alternatively, you can use this command: +``` +sudo apt install gnome-tweak-tool +``` + +At times, you would also need to know the version of GNOME Shell you are using. This helps in determining whether an extension is compatible with your system or not. You can use the command below to find it: +``` +gnome-shell --version +``` + +### 1\. Use gnome-shell-extensions package [easiest and safest way] + +Ubuntu (and several other Linux distributions such as Fedora) provide a package with a minimal set of GNOME extensions. You don't have to worry about the compatibility here as it is tested by your Linux distribution. + +If you want a no-brainer, just get this package and you'll have 8-10 GNOME extensions installed. +``` +sudo apt install gnome-shell-extensions +``` + +You'll have to reboot your system (or maybe just restart GNOME Shell, I don't remember it at this point). After that, start GNOME Tweaks and you'll find a few extensions installed. You can just toggle the button to start using an installed extension. + +![Change GNOME Shell theme in Ubuntu 17.1][6] + +### 2. Install GNOME Shell extensions from a web browser + +GNOME project has an entire website dedicated to extensions. That's not it. You can find, install, and manage your extensions on this website itself. No need even for GNOME Tweaks tool. + +[GNOME Shell Extensions Website][3] + +But in order to install extensions a web browser, you need two things: a browser add-on and a native host connector in your system. + +#### Step 1: Install browser add-on + +When you visit the GNOME Shell Extensions website, you'll see a message like this: + +> "To control GNOME Shell extensions using this site you must install GNOME Shell integration that consists of two parts: browser extension and native host messaging application." + +![Installing GNOME Shell Extensions][7] + +You can simply click on the suggested add-on link by your web browser. You can install them from the link below as well: + +#### Step 2: Install native connector + +Just installing browser add-on won't help you. You'll still see an error like: + +> "Although GNOME Shell integration extension is running, native host connector is not detected. Refer documentation for instructions about installing connector" + +![How to install GNOME Shell Extensions][8] + +This is because you haven't installed the host connector yet. To do that, use this command: +``` +sudo apt install chrome-gnome-shell +``` + +Don't worry about the 'chrome' prefix in the package name. It has nothing to do with Chrome. You don't have to install a separate package for Firefox or Opera here. + +#### Step 3: Installing GNOME Shell Extensions in web browser + +Once you have completed these two requirements, you are all set to roll. Now when you go to GNOME Shell Extension, you won't see any error message. + +![GNOME Shell Extension][9] + +A good thing to do would be to sort the extensions by your GNOME Shell version. It is not mandatory though. What happens here is that a developer creates an extension for the present GNOME version. In one year, there will be two more GNOME releases. But the developer didn't have time to test or update his/her extension. + +As a result, you wouldn't know if that extension is compatible with your system or not. It's possible that the extension works fine even in the newer GNOME Shell version despite that the extension is years old. It is also possible that the extension doesn't work in the newer GNOME Shell. + +You can search for an extension as well. Let's say you want to install a weather extension. Just search for it and go for one of the search results. + +When you visit the extension page, you'll see a toggle button. + +![Installing GNOME Shell Extension ][10] + +Click on it and you'll be prompted if you want to install this extension: + +![Install GNOME Shell Extensions via web browser][11] + +Obviously, go for Install here. Once it's installed, you'll see that the toggle button is now on and there is a setting option available next to it. You can configure the extension using the setting option. You can also disable the extension from here. + +![Configuring installed GNOME Shell Extensions][12] + +You can also configure the settings of an extension that you installed via the web browser in GNOME Tweaks tool: + +![GNOME Tweaks to handle GNOME Shell Extensions][13] + +You can see all your installed extensions on the website under [installed extensions section][14]. You can also delete the extensions that you installed via web browser here + +![Manage your installed GNOME Shell Extensions][15] + +One major advantage of using the GNOME Extensions website is that you can see if there is an update available for an extension. You won't get it in GNOME Tweaks or system update. + +### 3. Install GNOME Shell Extensions manually + +It's not that you have to be always online to install GNOME Shell extensions. You can download the files and install it later, without needing internet. + +Go to GNOME Extensions website and download the extension with the latest version. + +![Download GNOME Shell Extension][16] + +Extract the downloaded file. Copy the folder to **~/.local/share/gnome-shell/extensions** directory. Go to your Home directory and press Crl+H to show hidden folders. Locate .local folder here and from there, you can find your path till extensions directory. + +Once you have the files copied in the correct directory, go inside it and open metadata.json file. Look for the value of uuid. + +Make sure that the name of the extension's folder is same as the value of uuid in the metadata.json file. If not, rename the directory to the value of this uuid. + +![Manually install GNOME Shell extension][17] + +Almost there! Now restart GNOME Shell. Press Alt+F2 and enter r to restart GNOME Shell. + +![Restart GNOME Shell][18] + +Restart GNOME Tweaks tool as well. You should see the manually installed GNOME extension in the Tweak tool now. You can configure or enable the newly installed extension here. + +And that's all you need to know about installing GNOME Shell Extensions. + +## Remove GNOME Shell Extensions + +It is totally understandable that you might want to remove an installed GNOME Shell Extension. + +If you installed it via a web browser, you can go to the [installed extensions section on GNOME website][14] and remove it from there (as shown in an earlier picture). + +If you installed it manually, you can remove it by deleting the extension files from ~/.local/share/gnome-shell/extensions directory. + +## Bonus Tip: Get notified of GNOME Shell Extensions updates + +By now you have realized that there is no way to know if an update is available for a GNOME Shell extension except for visiting the GNOME extension website. + +Luckily for you, there is a GNOME Shell Extension that notifies you if there is an update available for an installed extension. You can get it from the link below: + +[Extension Update Notifier][19] + +### How do you manage GNOME Shell Extensions? + +I find it rather weird that you cannot update the extensions via the system updates. It's as if GNOME Shell extensions are not even part of the system. + +If you are looking for some recommendation, read this article about [best GNOME extensions][20]. At the same time, share your experience with GNOME Shell extensions. Do you often use them? If yes, which ones are your favorite? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnome-shell-extensions/ + +作者:[Abhishek Prakash][a] +译者:[译者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/ +[1]:https://itsfoss.com/install-themes-ubuntu/ +[2]:https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[3]:https://extensions.gnome.org/ +[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/gnome-shell-extension-weather.jpeg +[6]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/enableuser-themes-extension-gnome.jpeg +[7]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/gnome-shell-extension-installation-1.jpeg +[8]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/gnome-shell-extension-installation-2.jpeg +[9]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/gnome-shell-extension-installation-3.jpeg +[10]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/gnome-shell-extension-installation-4.jpeg +[11]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/gnome-shell-extension-installation-5.jpeg +[12]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/gnome-shell-extension-installation-6.jpeg +[13]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/gnome-shell-extension-installation-7-800x572.jpeg +[14]:https://extensions.gnome.org/local/ +[15]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/gnome-shell-extension-installation-8.jpeg +[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/gnome-shell-extension-installation-9-800x456.jpeg +[17]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/gnome-shell-extension-installation-10-800x450.jpg +[18]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/11/restart-gnome-shell-800x299.jpeg +[19]:https://extensions.gnome.org/extension/1166/extension-update-notifier/ +[20]:https://itsfoss.com/best-gnome-extensions/ From 73579b1b98049f1abd9588fb4af644bb1b04fde7 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 21:33:49 +0800 Subject: [PATCH 097/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Improve=20Your=20?= =?UTF-8?q?Mental=20Mettle=20with=20These=20Open=20Source=20Puzzle=20Games?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tle with These Open Source Puzzle Games.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20170923 Improve Your Mental Mettle with These Open Source Puzzle Games.md diff --git a/sources/tech/20170923 Improve Your Mental Mettle with These Open Source Puzzle Games.md b/sources/tech/20170923 Improve Your Mental Mettle with These Open Source Puzzle Games.md new file mode 100644 index 0000000000..5650a304bf --- /dev/null +++ b/sources/tech/20170923 Improve Your Mental Mettle with These Open Source Puzzle Games.md @@ -0,0 +1,62 @@ +Improve Your Mental Mettle with These Open Source Puzzle Games +====== +### Tax Your Brain, Not Your Wallet + +Puzzle video games are a type of game that focuses on puzzle solving. A puzzle is a problem or set of problems a player has to solve within the confines of the game. + +The puzzle genre often tests problem-solving skills enhancing both analytical and critical thinking skills. Word completion, pattern recognition, logical reasoning, persistence, and sequence solving are some of the skills often required to prosper here. Some games offer unlimited time or attempts to solve a puzzle, others present time-limited exercises which increase the difficulty of the puzzle. Most puzzle games are basic in graphics but are very addictive. + +This genre owes its origins to puzzles and brain teasers. Traditional thinking games such as Hangman, Mastermind, and the mathematical game Nim were early computer implementations. + +Software developers can shape a gamer's brain in a multitude of directions -- cognitive awareness, logistics, reflexes, memory, to cite a selection -- puzzle games are appealing for all ages. + +Many of the biggest computer games concentrate on explosion-filled genres. But there's still strong demand for compelling puzzle games. It's a neglected genre in the mainstream. Here are our picks of the best games. We only advocate open source games here. And we give preference to games that run on multiple operating systems. + + +**PUZZLE GAMES** + +| --- | --- | +| **[Trackballs][1]** | Inspired by Marble Madness | +| **[Fish Fillets - Next Generation][2]** | Port of the Puzzle Game Fish Fillets | +| **[Frozen Bubble][3]** | A clone of the popular “Puzzle Bobble” game | +| **[Neverball][4]** | Tilt the Floor to Roll a Ball Game | +| **[Crack Attack!][5]** | Based on the Super Nintendo classic Tetris Attack + | +| **[Brain Workshop][6]** | Dual N-Back Game | +| **[Angry, Drunken Dwarves][7]** | “Falling Blocks” Puzzle Game | +| **[gbrainy][8]** | Brain Teaser Game for GNOME | +| **[Enigma][9]** | Huge Collection of Puzzle Games | +| **[Amoebax][10]** | Cute and Addictive Action-Puzzle Game | +| **[Dinothawr][11]** | Save your frozen friends by pushing them onto lava | +| **[Pingus][12]** | Lemmings Like Game | +| **[Kmahjongg][13]** | Remove Matching Mahjongg Tiles to Clear the Board | + + +For other games, check out our **[Games Portal page][14]**. + + +-------------------------------------------------------------------------------- + +via: https://www.ossblog.org/improve-your-mental-mettle-with-these-open-source-puzzle-games/ + +作者:[Steve Emms][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.ossblog.org/author/steve/ +[1]:https://www.ossblog.org/trackballs-inspired-marble-madness/ +[2]:https://www.ossblog.org/fish-fillets-ng-port-puzzle-game-fish-fillets/ +[3]:https://www.ossblog.org/frozen-bubble-puzzle-bobble-style-game/ +[4]:https://www.ossblog.org/neverball-tilt-floor-roll-ball-game/ +[5]:https://www.ossblog.org/crack-attack-based-super-nintendo-classic-tetris-attack/ +[6]:https://www.ossblog.org/brain-workshop-dual-n-back-game/ +[7]:https://www.ossblog.org/angry-drunken-dwarves-falling-blocks-puzzle-game/ +[8]:https://www.ossblog.org/gbrainy-brain-teaser-game-gnome/ +[9]:https://www.ossblog.org/enigma-huge-collection-puzzle-games/ +[10]:https://www.ossblog.org/amoebax-cute-addictive-action-puzzle-game/ +[11]:https://www.ossblog.org/dinothawr-save-frozen-friends/ +[12]:https://www.ossblog.org/pingus-lemmings-like-game/ +[13]:https://www.ossblog.org/kmahjongg-remove-matching-mahjongg-tiles-clear-board/ +[14]:https://www.ossblog.org/free-games/ From 0b6d285370e8cafeb78547f49665d5bb9c84cf17 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 21:37:28 +0800 Subject: [PATCH 098/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Complete=20Guide?= =?UTF-8?q?=20for=20Using=20AsciiDoc=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...plete Guide for Using AsciiDoc in Linux.md | 347 ++++++++++++++++++ 1 file changed, 347 insertions(+) create mode 100644 sources/tech/20171030 Complete Guide for Using AsciiDoc in Linux.md diff --git a/sources/tech/20171030 Complete Guide for Using AsciiDoc in Linux.md b/sources/tech/20171030 Complete Guide for Using AsciiDoc in Linux.md new file mode 100644 index 0000000000..b321f4fb23 --- /dev/null +++ b/sources/tech/20171030 Complete Guide for Using AsciiDoc in Linux.md @@ -0,0 +1,347 @@ +Complete Guide for Using AsciiDoc in Linux +====== +**Brief: This detailed guide discusses the advantages of using AsciiDoc and shows you how to install and use AsciiDoc in Linux.** + +Over the years I used many different tools to write articles, reports or documentation. I think all started for me with Luc Barthelet's Epistole on Apple IIc from the French editor Version Soft. Then I switched to GUI tools with the excellent Microsoft Word 5 for Apple Macintosh, then the less convincing (to me) StarOffice on Sparc Solaris, that was already known as OpenOffice when I definitively switched to Linux. All these tools were really [word-processors][1]. + +But I was never really convinced by [WYSIWYG][2] editors. So I investigated many different more-or-less human-readable text formats: [troff][3], [HTML][4], [RTF][5], [TeX][6]/[LaTeX][7], [XML][8] and finally [AsciiDoc][9] which is the tool I use the most today. In fact, I am using it right now to write this article! + +If I made that history, it was because somehow the loop is closed. Epistole was a word-processor of the text-console era. As far as I remember, there were menus and you can use the mouse to select text -- but most of the formatting was done by adding non-intrusive tags into the text. Just like it is done with AsciiDoc. Of course, it was not the first software to do that. But it was the first I used! + + +![Controlling text alignment in Luc Barthelet's Epistole \(1985-Apple II\) by using commands embedded into the text][11] + +### Why AsciiDoc (or any other text file format)? + +I see two advantages in using text formats for writing: first, there is a clear separation between the content and the presentation. This argument is open to discussion since some text formats like TeX or HTML require a good discipline to adhere to that separation. And on the other hand, you can somehow achieve some level of separation by using [templates and stylesheets][12] with WYSIWYG editors. I agree with that. But I still find presentation issues intrusive with GUI tools. Whereas, when using text formats, you can focus on the content only without any font style or widow line disturbing you in your writing. But maybe it's just me? However, I can't count the number of times I stopped my writing just to fix some minor styling issue -- and having lost my inspiration when I came back to the text. If you disagree or have a different experience, don't hesitate to contradict me using the comment section below! + +Anyway, my second argument will be less subject to personal interpretation: documents based on text formats are highly interoperable. Not only you can edit them with any text editor on any platform, but you can easily manage text revisions with a tool such as [git][13] or [SVN][14], or automate text modification using common tools such as [sed][15], [AWK][16], [Perl][17] and so on. To give you a concrete example, when using a text-based format like AsciiDoc, I only need one command to produce highly personalized mailing from a master document, whereas the same job using a WYSIWYG editor would have required a clever use of "fields" and going through several wizard screens. + +### What is AsciiDoc? + +Strictly speaking, AsciiDoc is a file format. It defines syntactic constructs that will help a processor to understand the semantics of the various parts of your text. Usually in order to produce a nicely formatted output. + +Even if that definition could seem abstract, this is something simple: some keywords or characters in your document have a special meaning that will change the rendering of the document. This is the exact same concept as the tags in HTML. But a key difference with AsciiDoc is the property of the source document to remain easily human readable. + +Check [our GitHub repository][18] to compare how the same output can be produced using few common text files format: (coffee manpage idea courtesy of ) + + * `coffee.man` uses the venerable troff processor (based on the 1964 [RUNOFF][19] program). It's mostly used today to write [man pages][20]. You can try it after having downloaded the `coffee.*` files by typing `man ./coffee.man` at your command prompt. + * `coffee.tex` uses the LaTeX syntax (1985) to achieve mostly the same result but for a PDF output. LaTeX is a typesetting program especially well suited for scientific publications because of its ability to nicely format mathematical formulae and tables. You can produce the PDF from the LaTeX source using `pdflatex coffee.tex` + * `coffee.html` is using the HTML format (1991) to describe the page. You can directly open that file with your favorite web browser to see the result. + * `coffee.adoc`, finally, is using the AsciiDoc syntax (2002). You can produce both HTML and PDF from that file: + + +``` +asciidoc coffee.adoc # HTML output +a2x --format pdf ./coffee.adoc # PDF output (dblatex) +a2x --fop --format pdf ./coffee.adoc # PDF output (Apache FOP) +``` + +Now you've seen the result, open those four files using your favorite [text editor][21] (nano, vim, SublimeText, gedit, Atom, … ) and compare the sources: there are great chances you will agree the AsciiDoc sources are easier to read -- and probably to write too. + + +![Who is who? Could you guess which of these example files is written using AsciiDoc?][22] + +### How to install AsciiDoc in Linux? + +AsciiDoc is relatively complex to install because of the many dependencies. I mean complex if you want to install it from sources. For most of us, using our package manager is probably the best way: +``` +apt-get install asciidoc fop +``` + +or the following command: +``` +yum install acsiidoc fop +``` + +(fop is only required if you need the [Apache FOP][23] backend for PDF generation -- this is the PDF backend I use myself) + +More details about the installation can be found on [the official AsciiDoc website][24]. For now, all you need now is a little bit of patience, since, at least on my minimal Debian system, installing AsciiDoc require 360MB to be downloaded (mostly because of the LaTeX dependency). Which, depending on your Internet bandwidth, may give you plenty of time to read the rest of this article. + +### AsciiDoc Tutorial: How to write in AsciiDoc? + + +![AsciiDoc tutorial for Linux][25] + +I said it several times, AsciiDoc is a human-readable text file format. So, you can write your documents using the text editor of your choice. There are even dedicated text editors. But I will not talk about them here-- simply because I don't use them. But if are using one of them, don't hesitate to share your feedback using the comment section at the end of this article. + +I do not intend to create yet another AsciiDoc syntax tutorial here: there are plenty of them already available on the web. So I will only mention the very basic syntactic constructs you will use in virtually any document. From the simple "coffee" command example quoted above, you may see: + + * **titles** in AsciiDoc are identified by underlying them with `===` or `---` (depending on the title level), + * **bold** character spans are written between starts, + * and **italics** between underscores. + + + +Those are pretty common convention probably dating back to the pre-HTML email era. In addition, you may need two other common constructs, not illustrated in my previous example: **hyperlinks** and **images** inclusion, whose syntax is pretty self-explanatory. +``` +// HyperText links +link:http://dashing-kazoo.flywheelsites.com[ItsFOSS Linux Blog] + +// Inline Images +image:https://itsfoss.com/wp-content/uploads/2017/06/itsfoss-text-logo.png[ItsFOSS Text Logo] + +// Block Images +image::https://itsfoss.com/wp-content/uploads/2017/06/itsfoss-text-logo.png[ItsFOSS Text Logo] +``` + +But the AsciiDoc syntax is much richer than that. If you want more, I can point you to that nice AsciiDoc cheatsheet: + +### How to render the final output? + +I will assume here you have already written some text following the AsciiDoc format. If this is not the case, you can download [here][26] some example files copied straight out of the AsciiDoc documentation: +``` +# Download the AsciiDoc User Guide source document +BASE='https://raw.githubusercontent.com/itsfoss/asciidoc-intro/master' +wget "${BASE}"/{asciidoc.txt,customers.csv} +``` + +Since AsciiDoc is human-readable, you can send the AsciiDoc source text directly to someone by email, and the recipient will be able to read that message without further ado. But, you may want to provide some more nicely formatted output. For example as HTML for web publication (just like I've done it for this article). Or as PDF for print or display usage. + +In all cases, you need a processor. In fact, under the hood, you will need several processors. Because your AsciiDoc document will be transformed into various intermediate formats before producing the final output. Since several tools are used, the output of one being the input of the next one, we sometimes speak of a toolchain. + +Even if I explain some inner working details here, you have to understand most of that will be hidden from you. Unless maybe when you initially have to install the tools-- or if you want to fine-tune some steps of the process. + +#### In practice? + +For HTML output, you only need the `asciidoc` tool. For more complicated toolchains, I encourage you to use the `a2x` tool (part of the AsciiDoc distribution) that will trigger the necessary processors in order: +``` +# All examples are based on the AsciiDoc User Guide source document + +# HTML output +asciidoc asciidoc.txt +firefox asciidoc.html + +# XHTML output +a2x --format=xhtml asciidoc.txt + +# PDF output (LaTeX processor) +a2x --format=pdf asciidoc.txt + +# PDF output (FOP processor) +a2x --fop --format=pdf asciidoc.txt +``` + +Even if it can directly produce an HTML output, the core functionality of the `asciidoc` tool remains to transform the AsciiDoc document to the intermediate [DocBook][27] format. DocBook is a XML-based format commonly used for (but not limited to) technical documentation publishing. DocBook is a semantic format. That means it describes your document content. But not its presentation. So formatting will be the next step of the transformation. For that, whatever is the output format, the DocBook intermediate document is processed through an [XSLT][28] processor to produce either directly the output (e.g. XHTML), or another intermediate format. + +This is the case when you generate a PDF document where the DocBook document will be (at your will) converted either as a LaTeX intermediate representation or as [XSL-FO][29] (a XML-based language for page description). Finally, a dedicated tool will convert that representation to PDF. + +The extra steps for PDF generations are notably justified by the fact the toolchain has to handle pagination for the PDF output. Something this is not necessary for a "stream" format like HTML. + +#### dblatex or fop? + +Since there are two PDF backends, the usual question is "Which is the best?" Something I can't answer for you. + +Both processors have [pros and cons][30]. And ultimately, the choice will be a compromise between your needs and your tastes. So I encourage you to take the time to try both of them before choosing the backend you will use. If you follow the LaTeX path, [dblatex][31] will be the backend used to produce the PDF. Whereas it will be [Apache FOP][32] if you prefer using the XSL-FO intermediate format. So don't forget to take a look at the documentation of these tools to see how easy it will be to customize the output to your needs. Unless of course if you are satisfied with the default output! + +### How to customize the output of AsciiDoc? + +#### AsciiDoc to HTML + +Out of the box, AsciiDoc produces pretty nice documents. But sooner or later you will what to customize their appearance. + +The exact changes will depend on the backend you use. For the HTML output, most changes can be done by changing the [CSS][33] stylesheet associated with the document. + +For example, let's say I want to display all section headings in red, I could create the following `custom.css` file: +``` +h2 { + color: red; +} +``` + +And process the document using the slightly modified command: +``` +# Set the 'stylesheet' attribute to +# the absolute path to our custom CSS file +asciidoc -a stylesheet=$PWD/custom.css asciidoc.txt +``` + +You can also make changes at a finer level by attaching a role attribute to an element. This will translate into a class attribute in the generated HTML. + +For example, try to modify our test document to add the role attribute to the first paragraph of the text: +``` +[role="summary"] +AsciiDoc is a text document format .... +``` + +Then add the following rule to the `custom.css` file: +``` +.summary { + font-style: italic; +} +``` + +Re-generate the document: +``` +asciidoc -a stylesheet=$PWD/custom.css asciidoc.txt +``` + + +![AsciiDoc HTML output with custom CSS to display the first paragraph in italics and section headings in color][34] + + 1. et voila: the first paragraph is now displayed in italic. With a little bit of creativity, some patience and a couple of CSS tutorials, you should be able to customize your document at your wills. + + + +#### AsciiDoc to PDF + +Customizing the PDF output is somewhat more complex. Not from the author's perspective since the source text will remain identical. Eventually using the same role attribute as above to identify the parts that need a special treatment. + +But you can no longer use CSS to define the formatting for PDF output. For the most common settings, there are parameters you can set from the command line. Some parameters can be used both with the dblatex and the fop backends, others are specific to each backend. + +For the list of dblatex supported parameters, see + +For the list of DocBook XSL parameters, see + +Since margin adjustment is a pretty common requirement, you may also want to take a look at that: + +If the parameter names are somewhat consistent between the two backends, the command-line arguments used to pass those values to the backends differ between dblatex and fop. So, double check first your syntax if apparently, this isn't working. But to be honest, while writing this article I wasn't able to make the `body.font.family` parameter work with the dblatex backend. Since I usually use fop, maybe did I miss something? If you have more clues about that, I will be more than happy to read your suggestions in the comment section at the end of this article! + +Worth mentioning using non-standard fonts-- even with fop-require some extra work. But it's pretty well documented on the Apache website: +``` +# XSL-FO/FOP +a2x -v --format pdf \ + --fop \ + --xsltproc-opts='--stringparam page.margin.inner 10cm' \ + --xsltproc-opts='--stringparam body.font.family Helvetica' \ + --xsltproc-opts='--stringparam body.font.size 8pt' \ + asciidoc.txt + +# dblatex +# (body.font.family _should_ work, but, apparently, it isn't ?!?) +a2x -v --format pdf \ + --dblatex-opts='--param page.margin.inner=10cm' \ + --dblatex-opts='--stringparam body.font.family Helvetica' \ + asciidoc.txt +``` + +#### Fine-grained setting for PDF generation + +Global parameters are nice if you just need to adjust some pre-defined settings. But if you want to fine-tune the document (or completely change the layout) you will need some extra efforts. + +At the core of the DocBook processing there is [XSLT][28]. XSLT is a computer language, expressed in XML notation, that allows to write arbitrary transformation from an XML document to … something else. XML or not. + +For example, you will need to extend or modify the [DocBook XSL stylesheet][35] to produce the XSL-FO code for the new styles you may want. And if you use the dblatex backend, this may require modifying the corresponding DocBook-to-LaTeX XSLT stylesheet. In that latter case you may also need to use a custom LaTeX package. But I will not focus on that since dblatex is not the backend I use myself. I can only point you to the [official documentation][36] if you want to know more. But once again, if you're familiar with that, please share your tips and tricks in the comment section! + +Even while focusing only on fop, I don't really have the room here to detail the entire procedure. So, I will just show you the changes you could use to obtain a similar result as the one obtained with few CSS lines in HTML output above. That is: section titles in red and a summary paragraph in italics. + +The trick I use here is to create a new XSLT stylesheet, importing the original DocBook stylesheet, but overriding the attribute sets or template for the elements we want to change: +``` + + + + + + + + + #FF0000 + + + + + + + + + + + + + + italic + + + + + + + +``` + +Then, you have to request `a2x` to use that custom XSL stylesheet to produce the output rather than the default one using the `--xsl-file` option: +``` +a2x -v --format pdf \ + --fop \ + --xsl-file=./custom.xsl \ + asciidoc.txt +``` + +![AsciiDoc PDF output generated from Apache FOP using a custom XSLT to display the first paragraph in italics and section headings in color][37] + +With a little bit of familiarity with XSLT, the hints given here and some queries on your favorite search engine, I think you should be able to start customizing the XSL-FO output. + +But I will not lie, some apparently simple changes in the document output may require you to spend quite some times searching through the DocBook XML and XSL-FO manuals, examining the stylesheets sources and performing a couple of tests before you finally achieve what you want. + +### My opinion + +Writing documents using a text format has tremendous advantages. And if you need to publish to HTML, there is not much reason for not using AsciiDoc. The syntax is clean and neat, processing is simple and changing the presentation if needed, mostly require easy to acquire CSS skills. + +And even if you don't use the HTML output directly, HTML can be used as an interchange format with many WYSIWYG applications today. As an example, this is was I've done here: I copied the HTML output of this article into the WordPress edition area, thus conserving all formatting, without having to type anything directly into WordPress. + +If you need to publish to PDF-- the advantages remain the same for the writer. Things will be certainly harsher if you need to change the default layout in depth though. In a corporate environment, that probably means hiring a document designed skilled with XSLT to produce the set of stylesheets that will suit your branding or technical requirements-- or for someone in the team to acquire those skills. But once done it will be a pleasure to write text with AsciiDoc. And seeing those writings being automatically converted to beautiful HTML pages or PDF documents! + +Finally, if you find AsciiDoc either too simplistic or too complex, you may take a look at some other file formats with similar goals: [Markdown][38], [Textile][39], [reStructuredText][40] or [AsciiDoctor][41] to name few. Even if based on concepts dating back to the early days of computing, the human-readable text format ecosystem is pretty rich. Probably richer it was only 20 years ago. As a proof, many modern [static web site generators][42] are based on them. Unfortunately, this is out of the scope for this article. So, let us know if you want to hear more about that! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/asciidoc-guide/ + +作者:[Sylvain Leroux][a] +译者:[译者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/sylvain/ +[1]:https://www.computerhope.com/jargon/w/wordssor.htm +[2]:https://en.wikipedia.org/wiki/WYSIWYG +[3]:https://en.wikipedia.org/wiki/Troff +[4]:https://en.wikipedia.org/wiki/HTML +[5]:https://en.wikipedia.org/wiki/Rich_Text_Format +[6]:https://en.wikipedia.org/wiki/TeX +[7]:https://en.wikipedia.org/wiki/LaTeX +[8]:https://en.wikipedia.org/wiki/XML +[9]:https://en.wikipedia.org/wiki/AsciiDoc +[11]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09//epistole-manual-command-example-version-soft-luc-barthelet-1985.png +[12]:https://wiki.openoffice.org/wiki/Documentation/OOo3_User_Guides/Getting_Started/Templates_and_Styles +[13]:https://en.wikipedia.org/wiki/Git +[14]:https://en.wikipedia.org/wiki/Apache_Subversion +[15]:https://en.wikipedia.org/wiki/Sed +[16]:https://en.wikipedia.org/wiki/AWK +[17]:https://en.wikipedia.org/wiki/Perl +[18]:https://github.com/itsfoss/asciidoc-intro/tree/master/coffee +[19]:https://en.wikipedia.org/wiki/TYPSET_and_RUNOFF +[20]:https://en.wikipedia.org/wiki/Man_page +[21]:https://en.wikipedia.org/wiki/Text_editor +[22]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09//troff-latex-html-asciidoc-compare-source-code.png +[23]:https://en.wikipedia.org/wiki/Formatting_Objects_Processor +[24]:http://www.methods.co.nz/asciidoc/INSTALL.html +[25]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/10/asciidoc-tutorial-linux.jpg +[26]:https://raw.githubusercontent.com/itsfoss/asciidoc-intro/master +[27]:https://en.wikipedia.org/wiki/DocBook +[28]:https://en.wikipedia.org/wiki/XSLT +[29]:https://en.wikipedia.org/wiki/XSL_Formatting_Objects +[30]:http://www.methods.co.nz/asciidoc/userguide.html#_pdf_generation +[31]:http://dblatex.sourceforge.net/ +[32]:https://xmlgraphics.apache.org/fop/ +[33]:https://en.wikipedia.org/wiki/Cascading_Style_Sheets +[34]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09//asciidoc-html-output-custom-role-italic-paragraph-color-heading.png +[35]:http://www.sagehill.net/docbookxsl/ +[36]:http://dblatex.sourceforge.net/doc/manual/sec-custom.html +[37]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09//asciidoc-fop-output-custom-role-italic-paragraph-color-heading.png +[38]:https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet +[39]:https://txstyle.org/ +[40]:http://docutils.sourceforge.net/docs/user/rst/quickstart.html +[41]:http://asciidoctor.org/ +[42]:https://www.smashingmagazine.com/2015/11/modern-static-website-generators-next-big-thing/ From 92cb1935711e2a6718ce677d61258cf12a8c9746 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 21:40:44 +0800 Subject: [PATCH 099/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=209=20Lightweight?= =?UTF-8?q?=20Linux=20Applications=20to=20Speed=20Up=20Your=20System?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ux Applications to Speed Up Your System.md | 213 ++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 sources/tech/20170310 9 Lightweight Linux Applications to Speed Up Your System.md diff --git a/sources/tech/20170310 9 Lightweight Linux Applications to Speed Up Your System.md b/sources/tech/20170310 9 Lightweight Linux Applications to Speed Up Your System.md new file mode 100644 index 0000000000..5d5696cf6c --- /dev/null +++ b/sources/tech/20170310 9 Lightweight Linux Applications to Speed Up Your System.md @@ -0,0 +1,213 @@ +9 Lightweight Linux Applications to Speed Up Your System +====== +**Brief:** One of the many ways to [speed up Ubuntu][1] system is to use lightweight alternatives of the popular applications. We have already seen [must have Linux application][2] earlier. we'll see the lightweight alternative applications for Ubuntu and other Linux distributions. + +![Use these Lightweight alternative applications in Ubuntu Linux][4] + +## 9 Lightweight alternatives of popular Linux applications + +Is your Linux system slow? Are the applications taking a long time to open? The best option you have is to use a [light Linux distro][5]. But it's not always possible to reinstall an operating system, is it? + +So if you want to stick to your present Linux distribution, but want improved performance, you should use lightweight alternatives of the applications you are using. Here, I'm going to put together a small list of lightweight alternatives to various Linux applications. + +Since I am using Ubuntu, I have provided installation instructions for Ubuntu-based Linux distributions. But these applications will work on almost all other Linux distribution. You just have to find a way to install these lightweight Linux software in your distro. + +### 1. Midori: Web Browser + +Midori is one of the most lightweight web browsers that have reasonable compatibility with the modern web. It is open source and uses the same rendering engine that Google Chrome was initially built on -- WebKit. It is super fast and minimal yet highly customizable. + +![Midori Browser][6] + +It has plenty of extensions and options to tinker with. So if you are a power user, it's a great choice for you too. If you face any problems browsing round the web, check the [Frequently Asked Question][7] section of their website -- it contains the common problems you might face along with their solution. + +[Midori][8] + +#### Installing Midori on Ubuntu based distributions + +Midori is available on Ubuntu via the official repository. Just run the following commands for installing it: +``` + sudo apt install midori +``` + +### 2. Trojita: email client + +Trojita is an open source robust IMAP e-mail client. It is fast and resource efficient. I can certainly call it one of the [best email clients for Linux][9]. If you can live with only IMAP support on your e-mail client, you might not want to look any further. + +![Trojitá][10] + +Trojita uses various techniques -- on-demand e-mail loading, offline caching, bandwidth-saving mode etc. -- for achieving its impressive performance. + +[Trojita][11] + +#### Installing Trojita on Ubuntu based distributions + +Trojita currently doesn't have an official PPA for Ubuntu. But that shouldn't be a problem. You can install it quite easily using the following commands: +``` +sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/jkt-gentoo:/trojita/xUbuntu_16.04/ /' > /etc/apt/sources.list.d/trojita.list" +wget http://download.opensuse.org/repositories/home:jkt-gentoo:trojita/xUbuntu_16.04/Release.key +sudo apt-key add - < Release.key +sudo apt update +sudo apt install trojita +``` + +### 3. GDebi: Package Installer + +Sometimes you need to quickly install DEB packages. Ubuntu Software Center is a resource-heavy application and using it just for installing .deb files is not wise. + +Gdebi is certainly a nifty tool for the same purpose, just with a minimal graphical interface. + +![GDebi][12] + +GDebi is totally lightweight and does its job flawlessly. You should even [make Gdebi the default installer for DEB files][13]. + +#### Installing GDebi on Ubuntu based distributions + +You can install GDebi on Ubuntu with this simple one-liner: +``` +sudo apt install gdebi +``` + +### 4. App Grid: Software Center + +If you use software center frequently for searching, installing and managing applications on Ubuntu, App Grid is a must have application. It is the most visually appealing and yet fast alternative to the default Ubuntu Software Center. + +![App Grid][14] + +App Grid supports ratings, reviews and screenshots for applications. + +[App Grid][15] + +#### Installing App Grid on Ubuntu based distributions + +App Grid has its official PPA for Ubuntu. Use the following commands for installing App Grid: +``` +sudo add-apt-repository ppa:appgrid/stable +sudo apt update +sudo apt install appgrid +``` + +### 5. Yarock: Music Player + +Yarock is an elegant music player with a modern and minimal user interface. It is lightweight in design and yet it has a comprehensive list of advanced features. + +![Yarock][16] + +The main features of Yarock include multiple music collections, rating, smart playlist, multiple back-end option, desktop notification, scrobbling, context fetching etc. + +[Yarock][17] + +#### Installing Yarock on Ubuntu based distributions + +You will have to install Yarock on Ubuntu via PPA using the following commands: +``` +sudo add-apt-repository ppa:nilarimogard/webupd8 +sudo apt update +sudo apt install yarock +``` + +### 6. VLC: Video Player + +Who doesn't need a video player? And who has never heard about VLC? It doesn't really need any introduction. + +![VLC][18] + +VLC is all you need to play various media files on Ubuntu and it is quite lightweight too. It works flawlessly on even on very old PCs. + +[VLC][19] + +#### Installing VLC on Ubuntu based distributions + +VLC has official PPA for Ubuntu. Enter the following commands for installing it: +``` +sudo apt install vlc +``` + +### 7. PCManFM: File Manager + +PCManFM is the standard file manager from LXDE. As with the other applications from LXDE, this one too is lightweight. If you are looking for a lighter alternative for your file manager, try this one. + +![PCManFM][20] + +Although coming from LXDE, PCManFM works with other desktop environments just as well. + +#### Installing PCManFM on Ubuntu based distributions + +Installing PCManFM on Ubuntu will just take one simple command: +``` +sudo apt install pcmanfm +``` + +### 8. Mousepad: Text Editor + +Nothing can beat command-line text editors like - nano, vim etc. in terms of being lightweight. But if you want a graphical interface, here you go -- Mousepad is a minimal text editor. It's extremely lightweight and blazing fast. It comes with a simple customizable user interface with multiple themes. + +![Mousepad][21] + +Mousepad supports syntax highlighting. So, you can also use it as a basic code editor. + +#### Installing Mousepad on Ubuntu based distributions + +For installing Mousepad use the following command: +``` +sudo apt install mousepad +``` + +### 9. GNOME Office: Office Suite + +Many of us need to use office applications quite often. Generally, most of the office applications are bulky in size and resource hungry. Gnome Office is quite lightweight in that respect. Gnome Office is technically not a complete office suite. It's composed of different standalone applications and among them, **AbiWord** & **Gnumeric** stands out. + +**AbiWord** is the word processor. It is lightweight and a lot faster than other alternatives. But that came to be at a cost -- you might miss some features like macros, grammar checking etc. It's not perfect but it works. + +![AbiWord][22] + +**Gnumeric** is the spreadsheet editor. Just like AbiWord, Gnumeric is also very fast and it provides accurate calculations. If you are looking for a simple and lightweight spreadsheet editor, Gnumeric has got you covered. + +![Gnumeric][23] + +There are some other applications listed under Gnome Office. You can find them in the official page. + +[Gnome Office][24] + +#### Installing AbiWord & Gnumeric on Ubuntu based distributions + +For installing AbiWord & Gnumeric, simply enter the following command in your terminal: +``` +sudo apt install abiword gnumeric +``` + +That's all for today. Would you like to add some other **lightweight Linux applications** to this list? Do let us know! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/lightweight-alternative-applications-ubuntu/ + +作者:[Munif Tanjim][a] +译者:[译者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/munif/ +[1]:https://itsfoss.com/speed-up-ubuntu-1310/ +[2]:https://itsfoss.com/essential-linux-applications/ +[4]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/03/Lightweight-alternative-applications-for-Linux-800x450.jpg +[5]:https://itsfoss.com/lightweight-linux-beginners/ +[6]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/03/Midori-800x497.png +[7]:http://midori-browser.org/faqs/ +[8]:http://midori-browser.org/ +[9]:https://itsfoss.com/best-email-clients-linux/ +[10]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/03/Trojit%C3%A1-800x608.png +[11]:http://trojita.flaska.net/ +[12]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/03/GDebi.png +[13]:https://itsfoss.com/gdebi-default-ubuntu-software-center/ +[14]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/03/AppGrid-800x553.png +[15]:http://www.appgrid.org/ +[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/03/Yarock-800x529.png +[17]:https://seb-apps.github.io/yarock/ +[18]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/03/VLC-800x526.png +[19]:http://www.videolan.org/index.html +[20]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/03/PCManFM.png +[21]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/03/Mousepad.png +[22]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/03/AbiWord-800x626.png +[23]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/03/Gnumeric-800x470.png +[24]:https://gnome.org/gnome-office/ From ac5c3b75aaed930d40dae2566ab2fb9b1cae9206 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 21:47:06 +0800 Subject: [PATCH 100/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20config?= =?UTF-8?q?ure=20login=20banners=20in=20Linux=20(RedHat,=20Ubuntu,=20CentO?= =?UTF-8?q?S,=20Fedora)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Linux (RedHat, Ubuntu, CentOS, Fedora).md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20171110 How to configure login banners in Linux (RedHat, Ubuntu, CentOS, Fedora).md diff --git a/sources/tech/20171110 How to configure login banners in Linux (RedHat, Ubuntu, CentOS, Fedora).md b/sources/tech/20171110 How to configure login banners in Linux (RedHat, Ubuntu, CentOS, Fedora).md new file mode 100644 index 0000000000..485be46ab7 --- /dev/null +++ b/sources/tech/20171110 How to configure login banners in Linux (RedHat, Ubuntu, CentOS, Fedora).md @@ -0,0 +1,95 @@ +How to configure login banners in Linux (RedHat, Ubuntu, CentOS, Fedora) +====== +Learn how to create login banners in Linux to display different warning or information messages to user who is about to log in or after he logs in. + +![Login banners in Linux][1] + +Whenever you login to some production systems of firm, you get to see some login messages, warnings or info about server you are about to login or already logged in like below. Those are the login banners. + +![Login welcome messages in Linux][2] + +In this article we will walk you through how to configure them. + +There are two types of banners you can configure. + + 1. Banner message to display before user log in (configure in file of your choice eg. `/etc/login.warn`) + 2. Banner message to display after user successfully logged in (configure in `/etc/motd`) + + + +### How to display message when user connects to system before login + +This message will be displayed to user when he connects to server and before he logged in. Means when he enter the username, this message will be displayed before password prompt. + +You can use any filename and enter your message within. Here we used `/etc/login.warn` file and put our messages inside. + +``` +# cat /etc/login.warn + !!!! Welcome to KernelTalks test server !!!! +This server is meant for testing Linux commands and tools. If you are +not associated with kerneltalks.com and not authorized please dis-connect +immediately. +``` + +Now, you need to supply this file and path to `sshd` daemon so that it can fetch this banner for each user login request. For that open `/etc/sshd/sshd_config` file and search for line `#Banner none` + +Here you have to edit file and write your filename and remove hash mark. It should look like : `Banner /etc/login.warn` + +Save file and restart `sshd` daemon. To avoid disconnecting existing connected users, use HUP signal to restart sshd. + +``` +oot@kerneltalks # ps -ef |grep -i sshd +root 14255 1 0 18:42 ? 00:00:00 /usr/sbin/sshd -D +root 19074 14255 0 18:46 ? 00:00:00 sshd: ec2-user [priv] +root 19177 19127 0 18:54 pts/0 00:00:00 grep -i sshd + +root@kerneltalks # kill -HUP 14255 +``` + +Thats it! Open new session and try login. You will be greeted with the message you configured in above steps . + +![Login banner in Linux][3] + +You can see message is displayed before user enter his password and log in to system. + +### How to display message after user logs in + +Message user sees after he logs into system successfully is **M** essage **O** f **T** he **D** ay & is controlled by `/etc/motd` file. Edit this file and enter message you want to greet user with once he successfully logged in. + +``` +root@kerneltalks # cat /etc/motd + W E L C O M E +Welcome to the testing environment of kerneltalks. +Feel free to use this system for testing your Linux +skills. In case of any issues reach out to admin at +info@kerneltalks.com. Thank you. + +``` + +You dont need to restart `sshd` daemon to take this change effect. As soon as you save the file, its content will be read and displayed by sshd daemon from very next login request it serves. + +![motd in linux][4] + +You can see in above screenshot : Yellow box is MOTD controlled by `/etc/motd` and green box is what we saw earlier login banner. + +You can use tools like [cowsay][5], [banner][6], [figlet][7], [lolcat ][8]to create fancy, eye-catching messages to display at login. This method works on almost all Linux distros like RedHat, CentOs, Ubuntu, Fedora etc. + +-------------------------------------------------------------------------------- + +via: https://kerneltalks.com/tips-tricks/how-to-configure-login-banners-in-linux/ + +作者:[kerneltalks][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://kerneltalks.com +[1]:https://c3.kerneltalks.com/wp-content/uploads/2017/11/login-banner-message-in-linux.png +[2]:https://c3.kerneltalks.com/wp-content/uploads/2017/11/Login-message-in-linux.png +[3]:https://c1.kerneltalks.com/wp-content/uploads/2017/11/login-banner.png +[4]:https://c3.kerneltalks.com/wp-content/uploads/2017/11/motd-message-in-linux.png +[5]:https://kerneltalks.com/tips-tricks/cowsay-fun-in-linux-terminal/ +[6]:https://kerneltalks.com/howto/create-nice-text-banner-hpux/ +[7]:https://kerneltalks.com/tips-tricks/create-beautiful-ascii-text-banners-linux/ +[8]:https://kerneltalks.com/linux/lolcat-tool-to-rainbow-color-linux-terminal/ From 40c01c4583314970f640749e95e8c6574b2f472d Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 21:49:51 +0800 Subject: [PATCH 101/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20My=20Adventure=20?= =?UTF-8?q?Migrating=20Back=20To=20Windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... My Adventure Migrating Back To Windows.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20171113 My Adventure Migrating Back To Windows.md diff --git a/sources/tech/20171113 My Adventure Migrating Back To Windows.md b/sources/tech/20171113 My Adventure Migrating Back To Windows.md new file mode 100644 index 0000000000..9356dc8204 --- /dev/null +++ b/sources/tech/20171113 My Adventure Migrating Back To Windows.md @@ -0,0 +1,129 @@ +My Adventure Migrating Back To Windows +====== +I have had linux as my primary OS for about a decade now, and primarily use Ubuntu. But with the latest release I have decided to migrate back to an OS I generally dislike, Windows 10. + +![Ubuntu On Windows][1] +I have always been a fan of Linux, with my two favorite distributions being debian and ubuntu. Now as a server OS, linus is perfect and unquestionable, but there has always been problems of varing degree on the desktop. + +The most recent set of problems I had made me realise that I dont need to use linux as my desktop os to still be a fan so based on my experience fresh installing Ubutnu 17.10 I have decided to move back to windows. + +### What Caused Me to Switch Back? + +The problem was, when 17.10 came out I did a fresh install like usual but faced some really strange an new issues. + + * Dell D3100 Dock no longer worked (Including the Work Arounds) + * Ubuntu kept Freezing (Randomly) + * Double Clicking Icons on the desktop did nothing + * Using the HUD to search for programs such as "tweaks" would try installing MATE versions. + * The GUI felt worse than standard GNOME + + + +Now I did considor going back to using 16.04 or to another distro. But I feel Unity 7 was the most polished desktop environment, and the only other which is as polished and stable is windows 10. + +In addition to the above, there were also the inherent set backs from using Linux over Windows. Such as; + + * Most Propriatry Commerical Software is unavailable, E.G Maya, PhotoShop, Microsoft Office (In most cases the alternatives are not on par) + * Most Games are not ported to Linux, including games from major studios like EA, Rockstar Ect. + * Drivers for most hardware is a second thought for the manufacturers when it comes to linux. + + + +Before deciding upon windows I did look at other distributions and operatong systems. + +While doing so I looked more at the "Microsoft Loves Linux" compaign and came across WSL. Their new developer focused angle was interesting to me, so I gave it a try. + +### What I am Looking For in Windows + +I use computers mainly for programming, and I use virtual machines, git , ssh and rely heavily on bash for most of what I do. I also occasionally game, watch netflix and some light office work. + +In short I am looking to keep my current workflow in Ubuntu and transplant it onto Windows. I also want to take advantage of Windows strong points. + + * All PC Games Written For Windows + * Native Support for Most Programs + * Microsoft Office + + + +Now there are caveats with using windows, but I intend to maintain it correctly so I am not worried about the usual windows nasties such as viruses and malware. + +### Windows Subsystem For Linux (Bash on Ubuntu on Windows) + +Microsoft has worked closely with Canonical to bring Ubuntu to Windows. After quickly setting up and launching the program, you have a very familiar bash interface. + +Now I have been looking into the limitations of this, but the only real limitation I hit at the time of writing this article is that it is abstracted away from the hardware. For instance lsblk won't show what partitions you have, because Ubuntu is not being given that information. + +But besides accessing low level tools, I found the experience to be quite familiar and nice. + +I utilised this within my workflow for the following. + + * Generating SSH Keypair + * Using Git with Github to manage my repositories + * SSH into several servers, including passwordless + * Running MySQL for Local Databases + * Monitoring System Resources + * Using VIM for Config Files + * Running Bash Scripts + * Running Local Web Server + * Running PHP, NodeJS + + + +It has proven so far to be quite the formidable tool, and besides being in the Window 10 UI, my workflow feels almost identical to when I was on Ubuntu itself. Although most of my workload can be handled in WSL, i still intend on having virtual machines on had for mote indepth work which may be beyond the scope of wsl. + +### No WINE for me + +Another major upside I am experiencing is compatibility.Now I rarely used WINE to enable me to use windows software. But on occasion it was needed, and usually was not very good. + +#### HeidiSQL + +One of the first Programs I installed was HeidiSQL, one of my favourite DB Clients. It does work under wine, but it felt horrid so I ditched it for MySQL Workbench. Having it back in pride of place in windows is like having a trusty old friend back. + +#### Gaming / Steam + +What is a Windows PC without a little gaming. I installed steam from its website and was greated with all my linux catalogue, plus my windows catalogue which was 5 times bigger and including AAA titles like GTA V. Something I could only dream about in Ubuntu. + +Now I had so much hope for SteamOS and still do, but I don't think it will ever make a dent in the gaming market anywhere in the near future. So if you want to game on a pc, you really do need windows. + +Something else noted, the driver support was better for ny nvidia graphics card which made some linux native games like TF2 run slightly better. + +**Windows will always be superior in gaming, so this was not much of a surprise** + +### Running From a USB HDD and WHY + +I run linux on my main sss drives, but have in the past run from usb keys and usb hard drives. I got used to this durability of linux which allowed me to try out multiple versiobs long term without loosing my main os. Now the last time i tried installing windows to a usb connected hdd it just did not work and was impossoble, so when I did a clone of my Windows HDD as a backup, I was surprised when I could boot from it over USB. + +This has become a handy option for me as I plan to migrate my work laptop back to windows, but did not want to be risky and just throw it on there. + +So for the past few days I have ran it from the USB, and apart from a few buggy messages, I have had no real downside from running it over USB. + +The notable issues doing this is: + + * Slower Boot Speed + * Annoying Don't Unplug Your USB message + * Not been able to get it to Activate + + + +**I might do an article just on Windows on a USB Drive so we can go into more detail.** + +### So what is the verdict? + +I have been using windows 10 for about two weeks now, and have not noticed any negative effect to my work flow. All the tools I need are on hand and the OS is generally behaving, although there have been some minor hiccups along the way. + +## Will I stay with windows + +Although it's early days, I think I will be sticking with windows the the forseable future. + +-------------------------------------------------------------------------------- + +via: https://www.chris-shaw.com/blog/my-adventure-migrating-back-to-windows + +作者:[Christopher Shaw][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.chris-shaw.com +[1]:https://winaero.com/blog/wp-content/uploads/2016/07/Ubutntu-on-Windows-10-logo-banner.jpg From 7ce90f1e334c5c6a2ed30e0190d78d57866d63b2 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 21:53:27 +0800 Subject: [PATCH 102/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Trying=20out=20LX?= =?UTF-8?q?D=20containers=20on=20our=20Ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Trying out LXD containers on our Ubuntu.md | 227 ++++++++++++++++++ 1 file changed, 227 insertions(+) create mode 100644 sources/tech/20160625 Trying out LXD containers on our Ubuntu.md diff --git a/sources/tech/20160625 Trying out LXD containers on our Ubuntu.md b/sources/tech/20160625 Trying out LXD containers on our Ubuntu.md new file mode 100644 index 0000000000..85dad4206d --- /dev/null +++ b/sources/tech/20160625 Trying out LXD containers on our Ubuntu.md @@ -0,0 +1,227 @@ +translating by lujun9972 +Trying out LXD containers on our Ubuntu +====== +This post is about containers, a construct similar to virtual machines (VM) but so much lightweight that you can easily create a dozen on your desktop Ubuntu! + +A VM virtualizes a whole computer and then you install in there the guest operating system. **In contrast** , a container **reuses** the host Linux kernel and simply **contains** just the root filesystem (aka runtimes) of our choice. The Linux kernel has several features that rigidly separate the running Linux container from our host computer (i.e. our desktop Ubuntu). + +By themselves, Linux containers would need some manual work to manage them directly. Fortunately, there is LXD (pronounced Lex-deeh), a service that manages Linux containers for us. + +We will see how to + + 1. setup our Ubuntu desktop for containers, + 2. create a container, + 3. install a Web server, + 4. test it a bit, and + 5. clear everything up. + + + +### Set up your Ubuntu for containers + +If you have Ubuntu 16.04, then you are ready to go. Just install a couple of extra packages that we see below. If you have Ubuntu 14.04.x or Ubuntu 15.10, see [LXD 2.0: Installing and configuring LXD [2/12]][1] for some extra steps, then come back. + +Make sure the package list is up-to-date: +``` +sudo apt update +sudo apt upgrade +``` + +Install the **lxd** package: +``` +sudo apt install lxd +``` + +If you have Ubuntu 16.04, you can enable the feature to store your container files in a ZFS filesystem. The Linux kernel in Ubuntu 16.04 includes the necessary kernel modules for ZFS. For LXD to use ZFS for storage, we just need to install a package with ZFS utilities. Without ZFS, the containers would be stored as separate files on the host filesystem. With ZFS, we have features like copy-on-write which makes the tasks much faster. + +Install the **zfsutils-linux** package (if you have Ubuntu 16.04.x): +``` +sudo apt install zfsutils-linux +``` + +Once you installed the LXD package on the desktop Ubuntu, the package installation scripts should have added you to the **lxd** group. If your desktop account is a member of that group, then your account can manage containers with LXD and can avoid adding sudo in front of all commands. The way Linux works, **you would need to log out from the desktop session and then log in again** to activate the **lxd** group membership. (If you are an advanced user, you can avoid the re-login by newgrp lxd in your current shell). + +Before use, LXD should be initialized with our storage choice and networking choice. + +Initialize **lxd** for storage and networking by running the following command: +``` +$ **sudo  lxd init** +Name of the storage backend to use (dir or zfs): **zfs** +Create a new ZFS pool (yes/no)? **yes** +Name of the new ZFS pool: **lxd-pool** +Would you like to use an existing block device (yes/no)? **no** +Size in GB of the new loop device (1GB minimum): **30** +Would you like LXD to be available over the network (yes/no)? **no** +Do you want to configure the LXD bridge (yes/no)? **yes** +**> You will be asked about the network bridge configuration. Accept all defaults and continue.** +Warning: Stopping lxd.service, but it can still be activated by: + lxd.socket + LXD has been successfully configured. +$ _ +``` + +We created the ZFS pool as a filesystem inside a (single) file, not a block device (i.e. in a partition), thus no need for extra partitioning. In the example I specified 30GB, and this space will come from the root (/) filesystem. If you want to look at this file, it is at /var/lib/lxd/zfs.img. + +That's it! The initial configuration has been completed. For troubleshooting or background information, see https://www.stgraber.org/2016/03/15/lxd-2-0-installing-and-configuring-lxd-212/ + +### Create your first container + +All management commands with LXD are available through the **lxc** command. We run **lxc** with some parameters and that 's how we manage containers. +``` +lxc list +``` + +to get a list of installed containers. Obviously, the list will be empty but it verifies that all are fine. +``` +lxc image list +``` + +shows the list of (cached) images that we can use to launch a container. Obviously, the list will be empty but it verifies that all are fine. +``` +lxc image list ubuntu: +``` + +shows the list of available remote images that we can use to download and launch as containers. This specific list shows Ubuntu images. +``` +lxc image list images: +``` + +shows the list of available remote images for various distributions that we can use to download and launch as containers. This specific list shows all sort of distributions like Alpine, Debian, Gentoo, Opensuse and Fedora. + +Let's launch a container with Ubuntu 16.04 and call it c1: +``` +$ lxc launch ubuntu:x c1 +Creating c1 +Starting c1 +$ _ +``` + +We used the launch action, then selected the image **ubuntu:x** (x is an alias for the Xenial/16.04 image) and lastly we use the name c1 for our container. + +Let's view our first installed container, +``` +$ lxc list + ++---------|---------|----------------------|------|------------|-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++---------|---------|----------------------|------|------------|-----------+ +| c1 | RUNNING | 10.173.82.158 (eth0) | | PERSISTENT | 0 | ++---------|---------|----------------------|------|------------|-----------+ +``` + +Our first container c1 is running and it has an IP address (accessible locally). It is ready to be used! + +### Install a Web server + +We can run commands in our container. The action for running commands, is **exec**. +``` +$ lxc exec c1 -- uptime + 11:47:25 up 2 min, 0 users, load average: 0.07, 0.05, 0.04 +$ _ +``` + +After the action exec, we specify the container and finally we type command to run inside the container. The uptime is just 2 minutes, it's a fresh container :-). + +The -- thing on the command line has to do with parameter processing of our shell. If our command does not have any parameters, we can safely omit the -. +``` +$ lxc exec c1 -- df -h +``` + +This is an example that requires the -, because for our command we use the parameter -h. If you omit the -, you get an error. + +Let's get a shell in the container, and update the package list already. +``` +$ lxc exec c1 bash +root@c1:~# **apt update** +Ign http://archive.ubuntu.com trusty InRelease +Get:1 http://archive.ubuntu.com trusty-updates InRelease [65.9 kB] +Get:2 http://security.ubuntu.com trusty-security InRelease [65.9 kB] +... +Hit http://archive.ubuntu.com trusty/universe Translation-en +Fetched 11.2 MB in 9s (1228 kB/s) +Reading package lists... Done +root@c1:~# **apt upgrade** +Reading package lists... Done +Building dependency tree +... +Processing triggers for man-db (2.6.7.1-1ubuntu1) ... +Setting up dpkg (1.17.5ubuntu5.7) ... +root@c1:~# _ +``` + +We are going to install **nginx** as our Web server. nginx is somewhat cooler than Apache Web server. +``` +root@c1:~# apt install nginx +Reading package lists... Done +Building dependency tree +... +Setting up nginx-core (1.4.6-1ubuntu3.5) ... +Setting up nginx (1.4.6-1ubuntu3.5) ... +Processing triggers for libc-bin (2.19-0ubuntu6.9) ... +root@c1:~# _ +``` + +Let's view our Web server with our browser. Remeber the IP address you got 10.173.82.158, so I enter it into my browser. + +[![lxd-nginx][2]][3] + +Let's make a small change in the text of that page. Back inside our container, we enter the directory with the default HTML page. +``` +root@c1:~# **cd /var/www/html/** +root@c1:/var/www/html# **ls -l** +total 2 +-rw-r--r-- 1 root root 612 Jun 25 12:15 index.nginx-debian.html +root@c1:/var/www/html# +``` + +We can edit the file with nano, then save + +[![lxd-nginx-nano][4]][5] + +Finally, let's check the page again, + +[![lxd-nginx-modified][6]][7] + +### Clearing up + +Let's clear up the container by deleting it. We can easily create new ones when we need them. +``` +$ **lxc list** ++---------|---------|----------------------|------|------------|-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++---------|---------|----------------------|------|------------|-----------+ +| c1 | RUNNING | 10.173.82.169 (eth0) | | PERSISTENT | 0 | ++---------|---------|----------------------|------|------------|-----------+ +$ **lxc stop c1** +$ **lxc delete c1** +$ **lxc list** ++---------|---------|----------------------|------|------------|-----------+ +| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | ++---------|---------|----------------------|------|------------|-----------+ ++---------|---------|----------------------|------|------------|-----------+ + +``` + +We stopped (shutdown) the container, then we deleted it. + +That's all. There are many more ideas on what do with containers. Here are the first steps on setting up our Ubuntu desktop and trying out one such container. + + +-------------------------------------------------------------------------------- + +via: https://blog.simos.info/trying-out-lxd-containers-on-our-ubuntu/ + +作者:[Simos Xenitellis][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://blog.simos.info/author/simos/ +[1]:https://www.stgraber.org/2016/03/15/lxd-2-0-installing-and-configuring-lxd-212/ +[2]:https://i2.wp.com/blog.simos.info/wp-content/uploads/2016/06/lxd-nginx.png?resize=564%2C269&ssl=1 +[3]:https://i2.wp.com/blog.simos.info/wp-content/uploads/2016/06/lxd-nginx.png?ssl=1 +[4]:https://i2.wp.com/blog.simos.info/wp-content/uploads/2016/06/lxd-nginx-nano.png?resize=750%2C424&ssl=1 +[5]:https://i2.wp.com/blog.simos.info/wp-content/uploads/2016/06/lxd-nginx-nano.png?ssl=1 +[6]:https://i1.wp.com/blog.simos.info/wp-content/uploads/2016/06/lxd-nginx-modified.png?resize=595%2C317&ssl=1 +[7]:https://i1.wp.com/blog.simos.info/wp-content/uploads/2016/06/lxd-nginx-modified.png?ssl=1 From d70504eba426a8a753a222d49324d3b52060ee70 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 22:01:19 +0800 Subject: [PATCH 103/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20record?= =?UTF-8?q?=20statistics=20about=20a=20Linux=20machine=E2=80=99s=20uptime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...atistics about a Linux machine-s uptime.md | 215 ++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 sources/tech/20171109 How to record statistics about a Linux machine-s uptime.md diff --git a/sources/tech/20171109 How to record statistics about a Linux machine-s uptime.md b/sources/tech/20171109 How to record statistics about a Linux machine-s uptime.md new file mode 100644 index 0000000000..1a5be11efa --- /dev/null +++ b/sources/tech/20171109 How to record statistics about a Linux machine-s uptime.md @@ -0,0 +1,215 @@ +How to record statistics about a Linux machine’s uptime +====== +Linux/Unix sysadmins have a weird obsession with server uptime. There is a xkcd comic devoted to this subject where a good sysadmin is an unstoppable force that it stands between the forces of darkness and your cat blog's servers. +[![Fig.01: Devotion to Duty https://xkcd.com/705/][1]][1] +One can tell how long the Linux system has been running using the uptime command or [w command][2] or top command. I can get [a report of the historical and statistical running time of the system][3], keeping it between restarts using tuptime tool. + +Like uptime command but with the more impressive output. Recently I discovered another tool called uptimed that records statistics about a machine's uptime. Let us see how to get uptime record statistics using uptimed and uprecords on Linux operating system. + +Finding uptime is pretty easy, just type the following on your Linux based system: +``` +$ **uptime -p** +up 2 weeks, 4 days, 7 hours, 28 minutes +``` +To keep historical stats about uptime use either [tuptime][3] or uptimed tool. + +## uptimed installation + +The simplest way to install uptimed locally is through your package managers such as apt/apt-get/yum and friends as per your Linux distro. + +### Install uptimed on a Debian/Ubuntu Linux + +Type the following [apt command][4]/[apt-get command][5]: +`$ sudo apt-get install uptimed` +Sample outputs: +``` +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following additional packages will be installed: + libuptimed0 +The following NEW packages will be installed: + libuptimed0 uptimed +0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded. +Need to get 40.7 kB of archives. +After this operation, 228 kB of additional disk space will be used. +Do you want to continue? [Y/n] y +Get:1 http://mirrors.linode.com/ubuntu xenial/universe amd64 libuptimed0 amd64 1:0.3.17-4 [9,050 B] +Get:2 http://mirrors.linode.com/ubuntu xenial/universe amd64 uptimed amd64 1:0.3.17-4 [31.6 kB] +Fetched 40.7 kB in 0s (2,738 kB/s) +Preconfiguring packages ... +Selecting previously unselected package libuptimed0. +(Reading database ... 39163 files and directories currently installed.) +Preparing to unpack .../libuptimed0_1%3a0.3.17-4_amd64.deb ... +Unpacking libuptimed0 (1:0.3.17-4) ... +Selecting previously unselected package uptimed. +Preparing to unpack .../uptimed_1%3a0.3.17-4_amd64.deb ... +Unpacking uptimed (1:0.3.17-4) ... +Processing triggers for systemd (229-4ubuntu21) ... +Processing triggers for ureadahead (0.100.0-19) ... +Processing triggers for man-db (2.7.5-1) ... +Setting up libuptimed0 (1:0.3.17-4) ... +Setting up uptimed (1:0.3.17-4) ... +Processing triggers for libc-bin (2.23-0ubuntu9) ... +Processing triggers for systemd (229-4ubuntu21) ... +Processing triggers for ureadahead (0.100.0-19) ... +``` + +### Install uptimed on a CentOS/RHEL/Fedora/Oracle/Scientific Linux + +First [enable EPEL repo on a CentOS/RHEL][6]: +`$ sudo yum -y install epel-release` +Next, type the following [yum command][7]: +`$ sudo yum install uptimed` +Sample outputs: +``` +Loaded plugins: fastestmirror +Loading mirror speeds from cached hostfile + * base: centos.excellmedia.net + * epel: ftp.cuhk.edu.hk + * extras: centos.excellmedia.net + * updates: centos.excellmedia.net +Resolving Dependencies +--> Running transaction check +---> Package uptimed.x86_64 0:0.4.0-6.el7 will be installed +--> Finished Dependency Resolution + +Dependencies Resolved + +=============================================================================== + Package Arch Version Repository Size +=============================================================================== +Installing: + uptimed x86_64 0.4.0-6.el7 epel 47 k + +Transaction Summary +=============================================================================== +Install 1 Package + +Total download size: 47 k +Installed size: 98 k +Is this ok [y/d/N]: y +Downloading packages: +uptimed-0.4.0-6.el7.x86_64.rpm | 47 kB 00:01 +Running transaction check +Running transaction test +Transaction test succeeded +Running transaction + Installing : uptimed-0.4.0-6.el7.x86_64 1/1 + Verifying : uptimed-0.4.0-6.el7.x86_64 1/1 + +Installed: + uptimed.x86_64 0:0.4.0-6.el7 + +Complete! +``` + +If you are using **a Fedora Linux** , run the following dnf command: +`$ sudo dnf install uptimed` + +### Install uptimed on an Arch Linux + +Type the following pacman command: +`$ sudo pacman -S uptimed` + +### Install uptimed on a Gentoo Linux + +Type the following emerge command: +`$ sudo emerge --ask uptimed` + +## How to configure uptimed + +Edit the file /etc/uptimed.conf using a text editor such as vim command: +`$ sudo vim /etc/uptimed.conf` +At least set an email address to mail milestones/records to. Assumes sendmail compatible MTA installed as /usr/lib/sendmail. +``` +EMAIL=vivek@server1.cyberciti.biz +``` +Save and close the file. + +### How do I enable uptimed service at boot time? + +Enable uptimed service using the systemctl command: +`$ sudo systemctl enable uptimed` + +### How do I start/stop/restart or view status of uptimed service? + +``` +$ sudo systemctl start uptimed ## start it ## +$ sudo systemctl stop uptimed ## stop it ## +$ sudo systemctl restart uptimed ## restart it ## +$ sudo systemctl status uptimed ## view status ## +``` +Sample outputs: +``` +● uptimed.service - uptime record daemon + Loaded: loaded (/lib/systemd/system/uptimed.service; enabled; vendor preset: enabled) + Active: active (running) since Thu 2017-11-09 17:49:14 UTC; 18min ago + Main PID: 11137 (uptimed) + CGroup: /system.slice/uptimed.service + └─11137 /usr/sbin/uptimed -f + +Nov 09 17:49:14 gfs04 systemd[1]: Started uptime record daemon. +``` + +## How to see uptime record + +Simply type the following command to see statistics from the uptimed(8) program: +``` +$ uprecords +``` +Sample outputs: +[![Fig.02: uprecords in action][9]][9] +uprecords has a few more option: +``` +$ uprecords -? +``` +Sample outputs: +``` +usage: uprecords [OPTION]... + + -? this help + -a do not print ansi codes + -b sort by boottime + -B reverse sort by boottime + -k sort by sysinfo + -K reverse sort by sysinfo + -d print downtime seen before every uptimes instead of system + -c do not show current entry if not in top entries + -f run continously in a loop + -s do not print extra statistics + -w wide output (more than 80 cols per line) + -i INTERVAL use INTERVAL seconds for loop instead of 5, implies -f + -m COUNT show a maximum of top COUNT entries instead of 10 + -M show next milestone + -v version information +``` + +## Conclusion + +This is an excellent little tool to show your server uptime records to prove your uptime and business continuity. On a related note, you should get the official [XKCD sysadmin t-shirt][10] as comic was made into a shirt, which includes a new illustration on the back. +[![Fig.03: Sysadmin XKCD shirt features the original comic on the front and a new illustration on the back.][11]][11] + + +-------------------------------------------------------------------------------- + +via: https://www.cyberciti.biz/hardware/see-records-statistics-about-a-linux-servers-uptime/ + +作者:[][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.cyberciti.biz +[1]:https://www.cyberciti.biz/media/new/cms/2017/11/devotion_to_duty.png +[2]:https://www.cyberciti.biz//www.cyberciti.biz/faq/unix-linux-w-command-examples-syntax-usage-2/ (See Linux/Unix w command examples for more info) +[3]:https://www.cyberciti.biz/hardware/howto-see-historical-statistical-uptime-on-linux-server/ +[4]:https://www.cyberciti.biz//www.cyberciti.biz/faq/ubuntu-lts-debian-linux-apt-command-examples/ (See Linux/Unix apt command examples for more info) +[5]:https://www.cyberciti.biz//www.cyberciti.biz/tips/linux-debian-package-management-cheat-sheet.html (See Linux/Unix apt-get command examples for more info) +[6]:https://www.cyberciti.biz/faq/installing-rhel-epel-repo-on-centos-redhat-7-x/ +[7]:https://www.cyberciti.biz//www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/ (See Linux/Unix yum command examples for more info) +[8]:https://www.cyberciti.biz/cdn-cgi/l/email-protection +[9]:https://www.cyberciti.biz/media/new/cms/2017/11/uprecord-screenshot.jpg +[10]:https://store.xkcd.com/collections/apparel/products/sysadmin +[11]:https://www.cyberciti.biz/media/new/cms/2017/11/sysadmin_shirt_5_1024x1024.jpg From b06171772b55cef6da549bedff164d65bb7ee9f0 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 22:14:35 +0800 Subject: [PATCH 104/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Fix=20?= =?UTF-8?q?the=20=E2=80=98No=20Space=20Left=20on=20Device=E2=80=99=20Error?= =?UTF-8?q?=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...No Space Left on Device- Error on Linux.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20171115 How to Fix the ‘No Space Left on Device- Error on Linux.md diff --git a/sources/tech/20171115 How to Fix the ‘No Space Left on Device- Error on Linux.md b/sources/tech/20171115 How to Fix the ‘No Space Left on Device- Error on Linux.md new file mode 100644 index 0000000000..0ab151e9d5 --- /dev/null +++ b/sources/tech/20171115 How to Fix the ‘No Space Left on Device- Error on Linux.md @@ -0,0 +1,93 @@ +translating by lujun9972 +How to Fix the ‘No Space Left on Device’ Error on Linux +====== + +![](https://www.maketecheasier.com/assets/uploads/2017/10/no-space-feat.jpg) + +So your Linux system is telling you that you have no space left on your hard drive, but you know there is actually a lot of free space left. Why? This is one of those few frustratingly vague errors on Linux systems, but there are a few usual culprits. + +## Check du and df + +Before you go any further, it's a good idea to check that there really _is_ space left on the disk. While the tools in your desktop environment are good, it 's much better to use the direct ones from the command line. + +![Linux Filesystem du][1] + +Begin with `du`. Point it to the base directory on the drive that's having the problem. This guide is assuming it's the partition with root. +``` +sudo du -sh / +``` + +![Linux Filesystem df][2] + +It'll take some time to go through everything. Now, try with `df`. +``` +sudo df -h +``` + +Add root and the filesystems mounted under it. For example, if you have "/home" on a separate drive, add that in with the reading for root. The total should come out close to what you had with `du`. If not, that might point toward a deleted file being used by a process. + +Of course, the main concern here is whether or not the results of these commands come in under the size of the drive. If it did, there's obviously something wrong. + + **Related** : [Use Agedu to Analyze Hard Disk Space Usage in Linux][3] + +## Possible Causes + +There are a couple of main causes here. If you saw a discrepancy between `du` and `df` you can jump down to the first option here. Otherwise, start at the second one. + +### Deleted File Reserved by Process + +Occasionally, a file will be deleted, but a process is still using it. Linux won't release the storage associated with the file while the process is still running. You just need to find the process and restart it. + +![Check processes for deleted files][4] + +Try to locate the process. +``` +sudo lsof / | grep deleted +``` + +The problematic process should be listed, then just restart it. +``` +sudo systemctl restart service_name +``` + +### Not Enough Inodes + +![Linux check filesystem inodes][5] + +There is a set of metadata on filesystems called "inodes." Inodes track information about files. A lot of filesystems have a fixed amount of inodes, so it's very possible to fill the max allocation of inodes without filling the filesystem itself. You can use `df` to check. +``` +sudo df -i / +``` + +Compare the inodes used with the total inodes. If there's no more available, unfortunately, you can't get more. Delete some useless or out-of-date files to clear up inodes. + +### Bad Blocks + +The last common problem is bad filesystem blocks. Filesystems get corrupt and hard drives die. Your operating system will most likely see those blocks as usable unless they're otherwise marked. The best way to find and mark those blocks is by using `fsck` with the `-cc` flag. Remember that you can't use `fsck` from the same filesystem that you're testing. You'll probably need to use a live CD. +``` +sudo fsck -vcck /dev/sda2 +``` + +Obviously, replace the drive location with the drive that you want to check. Also, keep in mind that this will probably take a long time. + + **Related** : [Check and Repair Your Filesystem With fsck [Linux]][6] + +Hopefully, one of these solutions solved your problem. This issue isn't exactly easy to diagnose in every instance. With any luck, though, you can get it cleared up and have your hard drive working again as normal. + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/fix-linux-no-space-left-on-device-error/ + +作者:[Nick Congleton][a] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/nickcongleton/ +[1]:https://www.maketecheasier.com/assets/uploads/2017/10/no-space-du.jpg (Linux Filesystem du) +[2]:https://www.maketecheasier.com/assets/uploads/2017/10/no-space-df.jpg (Linux Filesystem df) +[3]:https://www.maketecheasier.com/agedu-analyze-hard-disk-space-usage-in-linux/ (Use Agedu to Analyze Hard Disk Space Usage in Linux) +[4]:https://www.maketecheasier.com/assets/uploads/2017/10/no-space-process.jpg (Check processes for deleted files) +[5]:https://www.maketecheasier.com/assets/uploads/2017/10/no-space-inode.jpg (Linux check filesystem inodes) +[6]:https://www.maketecheasier.com/check-repair-filesystem-fsck-linux/ (Check and Repair Your Filesystem With fsck [Linux]) From bc01aab5f3a4b38347e3e6361c845730c6643062 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 22:24:32 +0800 Subject: [PATCH 105/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20use=20?= =?UTF-8?q?a=20here=20documents=20to=20write=20data=20to=20a=20file=20in?= =?UTF-8?q?=20bash=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... to write data to a file in bash script.md | 203 ++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 sources/tech/20171116 How to use a here documents to write data to a file in bash script.md diff --git a/sources/tech/20171116 How to use a here documents to write data to a file in bash script.md b/sources/tech/20171116 How to use a here documents to write data to a file in bash script.md new file mode 100644 index 0000000000..12d15af78f --- /dev/null +++ b/sources/tech/20171116 How to use a here documents to write data to a file in bash script.md @@ -0,0 +1,203 @@ +How to use a here documents to write data to a file in bash script +====== + +A here document is nothing but I/O redirection that tells the bash shell to read input from the current source until a line containing only delimiter is seen. +[![redirect output of here document to a text file][1]][1] +This is useful for providing commands to ftp, cat, echo, ssh and many other useful Linux/Unix commands. This feature should work with bash or Bourne/Korn/POSIX shell too. + +## heredoc syntax + +How do I use a heredoc redirection feature (here documents) to write data to a file in my bash shell scripts? [A here document][2] is nothing but I/O redirection that tells the bash shell to read input from the current source until a line containing only delimiter is seen.This is useful for providing commands to ftp, cat, echo, ssh and many other useful Linux/Unix commands. This feature should work with bash or Bourne/Korn/POSIX shell too. + +The syntax is: +``` +command < my_output_file.txt + mesg1 + msg2 + msg3 + $var on $foo +EOF +``` + +OR **redirect and append it** to a file named my_output_file.txt: +``` +command << EOF >> my_output_file.txt + mesg1 + msg2 + msg3 + $var on $foo +EOF +``` + +## Examples + +The following script will write the needed contents to a file named /tmp/output.txt: +``` +#!/bin/bash +OUT=/tmp/output.txt + +echo "Starting my script..." +echo "Doing something..." + +cat <$OUT + Status of backup as on $(date) + Backing up files $HOME and /etc/ +EOF + +echo "Starting backup using rsync..." +``` + + +You can view /tmp/output.txt with the [cat command][3]: +`$ cat /tmp/output.txt` +Sample outputs: +``` + Status of backup as on Thu Nov 16 17:00:21 IST 2017 + Backing up files /home/vivek and /etc/ + +``` + +### Disabling pathname/parameter/variable expansion, command substitution, arithmetic expansion + +Variable such as $HOME and command such as $(date) were interpreted substitution in script. To disable it use single quotes with 'EOF' as follows: +``` +#!/bin/bash +OUT=/tmp/output.txt + +echo "Starting my script..." +echo "Doing something..." +# No parameter and variable expansion, command substitution, arithmetic expansion, or pathname expansion is performed on word. +# If any part of word is quoted, the delimiter is the result of quote removal on word, and the lines in the here-document +# are not expanded. So EOF is quoted as follows +cat <<'EOF' >$OUT + Status of backup as on $(date) + Backing up files $HOME and /etc/ +EOF + +echo "Starting backup using rsync..." +``` + +#!/bin/bash OUT=/tmp/output.txtecho "Starting my script..." echo "Doing something..." # No parameter and variable expansion, command substitution, arithmetic expansion, or pathname expansion is performed on word. # If any part of word is quoted, the delimiter is the result of quote removal on word, and the lines in the here-document # are not expanded. So EOF is quoted as follows cat <<'EOF' >$OUT Status of backup as on $(date) Backing up files $HOME and /etc/ EOFecho "Starting backup using rsync..." + +You can view /tmp/output.txt with the [cat command][3]: +`$ cat /tmp/output.txt` +Sample outputs: +``` + Status of backup as on $(date) + Backing up files $HOME and /etc/ + +``` + +## A note about using tee command + +The syntax is: +``` +tee /tmp/filename </dev/null +line 1 +line 2 +line 3 +$(cmd) +$var on $foo +EOF +``` + +tee /tmp/filename </dev/null line 1 line 2 line 3 $(cmd) $var on $foo EOF + +Or disable variable substitution/command substitution by quoting EOF in a single quote: +``` +tee /tmp/filename <<'EOF' >/dev/null +line 1 +line 2 +line 3 +$(cmd) +$var on $foo +EOF +``` + +tee /tmp/filename <<'EOF' >/dev/null line 1 line 2 line 3 $(cmd) $var on $foo EOF + +Here is my updated script: +``` +#!/bin/bash +OUT=/tmp/output.txt + +echo "Starting my script..." +echo "Doing something..." + +tee $OUT </dev/null + Status of backup as on $(date) + Backing up files $HOME and /etc/ +EOF + +echo "Starting backup using rsync..." +``` + +#!/bin/bash OUT=/tmp/output.txtecho "Starting my script..." echo "Doing something..."tee $OUT </dev/null Status of backup as on $(date) Backing up files $HOME and /etc/ EOFecho "Starting backup using rsync..." + +## A note about using in-memory here-docs + +Here is my updated script: +``` +#!/bin/bash +OUT=/tmp/output.txt + +## in memory here docs +## thanks https://twitter.com/freebsdfrau +exec 9<$OUT + +echo "Starting backup using rsync..." +``` + + + +-------------------------------------------------------------------------------- + +via: https://www.cyberciti.biz/faq/using-heredoc-rediection-in-bash-shell-script-to-write-to-file/ + +作者:[Vivek Gite][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.cyberciti.biz +[1]:https://www.cyberciti.biz/media/new/faq/2017/11/redirect-output-of-here-document-to-a-text-file.jpg +[2]:https://bash.cyberciti.biz/guide/Here_documents +[3]:https//www.cyberciti.biz/faq/linux-unix-appleosx-bsd-cat-command-examples/ (See Linux/Unix cat command examples for more info) From dbead827cbdd0d9ea5a34ced2203c1d77a442195 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 30 Dec 2017 22:28:12 +0800 Subject: [PATCH 106/133] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Record=20and=20Sh?= =?UTF-8?q?are=20Terminal=20Session=20with=20Showterm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nd Share Terminal Session with Showterm.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20171116 Record and Share Terminal Session with Showterm.md diff --git a/sources/tech/20171116 Record and Share Terminal Session with Showterm.md b/sources/tech/20171116 Record and Share Terminal Session with Showterm.md new file mode 100644 index 0000000000..ff86cf743d --- /dev/null +++ b/sources/tech/20171116 Record and Share Terminal Session with Showterm.md @@ -0,0 +1,74 @@ +Record and Share Terminal Session with Showterm +====== + +![](https://www.maketecheasier.com/assets/uploads/2017/11/record-terminal-session.jpg) + +You can easily record your terminal sessions with virtually all screen recording programs. However, you are very likely to end up with an oversized video file. There are several terminal recorders available in Linux, each with its own strengths and weakness. Showterm is a tool that makes it pretty easy to record terminal sessions, upload them, share, and embed them in any web page. On the plus side, you don't end up with any huge file to deal with. + +Showterm is open source, and the project can be found on this [GitHub page][1]. + + **Related** : [2 Simple Applications That Record Your Terminal Session as Video [Linux]][2] + +### Installing Showterm for Linux + +Showterm requires that you have Ruby installed on your computer. Here's how to go about installing the program. +``` +gem install showterm +``` + +If you don't have Ruby installed on your Linux system: +``` +sudo curl showterm.io/showterm > ~/bin/showterm +sudo chmod +x ~/bin/showterm +``` + +If you just want to run the application without installation: +``` +bash <(curl record.showterm.io) +``` + +You can type `showterm --help` for the help screen. If a help page doesn't appear, showterm is probably not installed. Now that you have Showterm installed (or are running the standalone version), let us dive into using the tool to record. + + **Related** : [How to Record Terminal Session in Ubuntu][3] + +### Recording Terminal Session + +![showterm terminal][4] + +Recording a terminal session is pretty simple. From the command line run `showterm`. This should start the terminal recording in the background. All commands entered in the command line from hereon are recorded by Showterm. Once you are done recording, press Ctrl + D or type `exit` in the command line to stop your recording. + +Showterm should upload your video and output a link to the video that looks like http://showterm.io/. It is rather unfortunate that terminal sessions are uploaded right away without any prompting. Don't panic! You can delete any uploaded recording by entering `showterm --delete `. Before uploading your recordings, you'll have the chance to change the timing by adding the `-e` option to the showterm command. If by any chance a recording fails to upload, you can use `showterm --retry