mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-10 22:21:11 +08:00
commit
d309a0c523
@ -0,0 +1,156 @@
|
|||||||
|
如何在 Linux 上使用 Gmail SMTP 服务器发送邮件通知
|
||||||
|
================================================================================
|
||||||
|
假定你想配置一个 Linux 应用,用于从你的服务器或桌面客户端发送邮件信息。邮件信息可能是邮件简报、状态更新(如 [Cachet][1])、监控警报(如 [Monit][2])、磁盘时间(如 [RAID mdadm][3])等等。当你要建立自己的 [邮件发送服务器][4] 传递信息时 ,你可以替代使用一个免费的公共 SMTP 服务器,从而避免遭受维护之苦。
|
||||||
|
|
||||||
|
谷歌的 Gmail 服务就是最可靠的 **免费 SMTP 服务器** 之一。想要从应用中发送邮件通知,你仅需在应用中添加 Gmail 的 SMTP 服务器地址和你的身份凭证即可。
|
||||||
|
|
||||||
|
使用 Gmail 的 SMTP 服务器会遇到一些限制,这些限制主要用于阻止那些经常滥用服务器来发送垃圾邮件和使用邮件营销的家伙。举个例子,你一次只能给至多 100 个地址发送信息,并且一天不能超过 500 个收件人。同样,如果你不想被标为垃圾邮件发送者,你就不能发送过多的不可投递的邮件。当你达到任何一个限制,你的 Gmail 账户将被暂时的锁定一天。简而言之,Gmail 的 SMTP 服务器对于你个人的使用是非常棒的,但不适合商业的批量邮件。
|
||||||
|
|
||||||
|
说了这么多,是时候向你们展示 **如何在 Linux 环境下使用 Gmail 的 SMTP 服务器** 了。
|
||||||
|
|
||||||
|
### Google Gmail SMTP 服务器设置 ###
|
||||||
|
|
||||||
|
如果你想要通过你的应用使用 Gmail 的 SMTP 服务器发送邮件,请牢记接下来的详细说明。
|
||||||
|
|
||||||
|
- **邮件发送服务器 (SMTP 服务器)**: smtp.gmail.com
|
||||||
|
- **使用认证**: 是
|
||||||
|
- **使用安全连接**: 是
|
||||||
|
- **用户名**: 你的 Gmail 账户 ID (比如 "alice" ,如果你的邮箱为 alice@gmail.com)
|
||||||
|
- **密码**: 你的 Gmail 密码
|
||||||
|
- **端口**: 587
|
||||||
|
|
||||||
|
确切的配置根据应用会有所不同。在本教程的剩余部分,我将向你展示一些在 Linux 上使用 Gmail SMTP 服务器的应用示例。
|
||||||
|
|
||||||
|
### 从命令行发送邮件 ###
|
||||||
|
|
||||||
|
作为第一个例子,让我们尝试最基本的邮件功能:使用 Gmail SMTP 服务器从命令行发送一封邮件。为此,我将使用一个称为 mutt 的命令行邮件客户端。
|
||||||
|
|
||||||
|
先安装 mutt:
|
||||||
|
|
||||||
|
对于 Debian-based 系统:
|
||||||
|
|
||||||
|
$ sudo apt-get install mutt
|
||||||
|
|
||||||
|
对于 Red Hat based 系统:
|
||||||
|
|
||||||
|
$ sudo yum install mutt
|
||||||
|
|
||||||
|
创建一个 mutt 配置文件(~/.muttrc),并和下面一样,在文件中指定 Gmail SMTP 服务器信息。将 \<gmail-id> 替换成自己的 Gmail ID。注意该配置只是为了发送邮件而已(而非接收邮件)。
|
||||||
|
|
||||||
|
$ vi ~/.muttrc
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
set from = "<gmail-id>@gmail.com"
|
||||||
|
set realname = "Dan Nanni"
|
||||||
|
set smtp_url = "smtp://<gmail-id>@smtp.gmail.com:587/"
|
||||||
|
set smtp_pass = "<gmail-password>"
|
||||||
|
|
||||||
|
一切就绪,使用 mutt 发送一封邮件:
|
||||||
|
|
||||||
|
$ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com
|
||||||
|
|
||||||
|
想在一封邮件中添加附件,使用 "-a" 选项
|
||||||
|
|
||||||
|
$ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com -a ~/test_attachment.jpg
|
||||||
|
|
||||||
|
![](https://c1.staticflickr.com/1/770/22239850784_5fb0988075_c.jpg)
|
||||||
|
|
||||||
|
使用 Gmail SMTP 服务器意味着邮件将显示是从你 Gmail 账户发出的。换句话说,收件人将视你的 Gmail 地址为发件人地址。如果你想要使用自己的域名作为邮件发送方,你需要使用 Gmail SMTP 转发服务。
|
||||||
|
|
||||||
|
### 当服务器重启时发送邮件通知 ###
|
||||||
|
|
||||||
|
如果你在 [虚拟专用服务器(VPS)][5] 上跑了些重要的网站,建议监控 VPS 的重启行为。作为一个更为实用的例子,让我们研究如何在你的 VPS 上为每一次重启事件建立邮件通知。这里假设你的 VPS 上使用的是 systemd,并向你展示如何为自动邮件通知创建一个自定义的 systemd 启动服务。
|
||||||
|
|
||||||
|
首先创建下面的脚本 reboot_notify.sh,用于负责邮件通知。
|
||||||
|
|
||||||
|
$ sudo vi /usr/local/bin/reboot_notify.sh
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "`hostname` was rebooted on `date`" | mutt -F /etc/muttrc -s "Notification on `hostname`" alice@yahoo.com
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
$ sudo chmod +x /usr/local/bin/reboot_notify.sh
|
||||||
|
|
||||||
|
在这个脚本中,我使用 "-F" 选项,用于指定系统级的 mutt 配置文件位置。因此不要忘了创建 /etc/muttrc 文件,并如前面描述的那样填入 Gmail SMTP 信息。
|
||||||
|
|
||||||
|
现在让我们创建如下一个自定义的 systemd 服务。
|
||||||
|
|
||||||
|
$ sudo mkdir -p /usr/local/lib/systemd/system
|
||||||
|
$ sudo vi /usr/local/lib/systemd/system/reboot-task.service
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Send a notification email when the server gets rebooted
|
||||||
|
DefaultDependencies=no
|
||||||
|
Before=reboot.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/local/bin/reboot_notify.sh
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=reboot.target
|
||||||
|
|
||||||
|
在创建服务后,添加并启动该服务。
|
||||||
|
|
||||||
|
$ sudo systemctl enable reboot-task
|
||||||
|
$ sudo systemctl start reboot-task
|
||||||
|
|
||||||
|
从现在起,在每次 VPS 重启时,你将会收到一封通知邮件。
|
||||||
|
|
||||||
|
![](https://c1.staticflickr.com/1/608/22241452923_2ace9cde2e_c.jpg)
|
||||||
|
|
||||||
|
### 通过服务器使用监控发送邮件通知 ###
|
||||||
|
|
||||||
|
作为最后一个例子,让我展示一个现实生活中的应用程序,[Monit][6],这是一款极其有用的服务器监控应用程序。它带有全面的 [VPS][7] 监控能力(比如 CPU、内存、进程、文件系统)和邮件通知功能。
|
||||||
|
|
||||||
|
如果你想要接收 VPS 上由 Monit 产生的任何事件的邮件通知,你可以在 Monit 配置文件中添加以下 SMTP 信息。
|
||||||
|
|
||||||
|
set mailserver smtp.gmail.com port 587
|
||||||
|
username "<your-gmail-ID>" password "<gmail-password>"
|
||||||
|
using tlsv12
|
||||||
|
|
||||||
|
set mail-format {
|
||||||
|
from: <your-gmail-ID>@gmail.com
|
||||||
|
subject: $SERVICE $EVENT at $DATE on $HOST
|
||||||
|
message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION.
|
||||||
|
|
||||||
|
Yours sincerely,
|
||||||
|
Monit
|
||||||
|
}
|
||||||
|
|
||||||
|
# the person who will receive notification emails
|
||||||
|
set alert alice@yahoo.com
|
||||||
|
|
||||||
|
这是一个因为 CPU 负载超载而由 Monit 发送的邮件通知的例子。
|
||||||
|
|
||||||
|
![](https://c1.staticflickr.com/1/566/22873764251_8fe66bfd16_c.jpg)
|
||||||
|
|
||||||
|
### 总结 ###
|
||||||
|
|
||||||
|
如你所见,类似 Gmail 这样免费的 SMTP 服务器有着这么多不同的运用方式 。但再次重申,请牢记免费的 SMTP 服务器不适用于商业用途,仅仅适用于个人项目。无论你正在哪款应用中使用 Gmail SMTP 服务器,欢迎自由分享你的用例。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://xmodulo.com/send-email-notifications-gmail-smtp-server-linux.html
|
||||||
|
|
||||||
|
作者:[Dan Nanni][a]
|
||||||
|
译者:[cposture](https://github.com/cposture)
|
||||||
|
校对:[martin2011qi](https://github.com/martin2011qi), [wxy](https://github.com/wxy)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:http://xmodulo.com/author/nanni
|
||||||
|
[1]:http://xmodulo.com/setup-system-status-page.html
|
||||||
|
[2]:http://xmodulo.com/server-monitoring-system-monit.html
|
||||||
|
[3]:http://xmodulo.com/create-software-raid1-array-mdadm-linux.html
|
||||||
|
[4]:http://xmodulo.com/mail-server-ubuntu-debian.html
|
||||||
|
[5]:http://xmodulo.com/go/digitalocean
|
||||||
|
[6]:http://xmodulo.com/server-monitoring-system-monit.html
|
||||||
|
[7]:http://xmodulo.com/go/digitalocean
|
@ -0,0 +1,371 @@
|
|||||||
|
怎样在 ubuntu 和 debian 中通过命令行管理 KVM
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
有很多不同的方式去管理运行在 KVM 管理程序上的虚拟机。例如,virt-manager 就是一个流行的基于图形界面的前端虚拟机管理工具。然而,如果你想要在没有图形窗口的服务器环境下使用 KVM ,那么基于图形界面的解决方案显然是行不通的。事实上,你可以单纯使用包装了 kvm 命令行脚本的命令行来管理 KVM 虚拟机。作为替代方案,你可以使用 virsh 这个容易使用的命令行程序来管理客户虚拟机。在 virsh 中,它通过和 libvirtd 服务通信来达到控制虚拟机的目的,而 libvirtd 可以控制多个不同的虚拟机管理器,包括 KVM,Xen,QEMU,LXC 和 OpenVZ。
|
||||||
|
|
||||||
|
当你想要对虚拟机的前期准备和后期管理实现自动化操作时,像 virsh 这样的命令行管理工具是非常有用的。同样,virsh 支持多个管理器也就意味着你可以通过相同的 virsh 接口去管理不同的虚拟机管理器。
|
||||||
|
|
||||||
|
在这篇文章中,我会示范**怎样在 ubuntu 和 debian 上通过使用 virsh 命令行去运行 KVM**。
|
||||||
|
|
||||||
|
### 第一步:确认你的硬件平台支持虚拟化 ###
|
||||||
|
|
||||||
|
第一步,首先要确认你的 CPU 支持硬件虚拟化扩展(e.g.,Intel VT 或者 AMD-V),这是 KVM 对硬件的要求。下面的命令可以检查硬件是否支持虚拟化。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ egrep '(vmx|svm)' --color /proc/cpuinfo
|
||||||
|
```
|
||||||
|
|
||||||
|
![](https://c2.staticflickr.com/2/1505/24050288606_758a44c4c6_c.jpg)
|
||||||
|
|
||||||
|
如果在输出中不包含 vmx 或者 svm 标识,那么就意味着你的 cpu 不支持硬件虚拟化。因此你不能在你的机器上使用 KVM 。确认了 cpu 支持 vmx 或者 svm 之后,接下来开始安装 KVM。
|
||||||
|
|
||||||
|
对于 KVM 来说,它不要求运行在拥有 64 位内核系统的主机上,但是通常我们会推荐在 64 位系统的主机上面运行 KVM。
|
||||||
|
|
||||||
|
### 第二步:安装KVM ###
|
||||||
|
|
||||||
|
使用 `apt-get` 安装 KVM 和相关的用户空间工具。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt-get install qemu-kvm libvirt-bin
|
||||||
|
```
|
||||||
|
|
||||||
|
安装期间,libvirtd 用户组(在 debian 上是 libvirtd-qemu 用户组)将会被创建,并且你的用户 id 将会被自动添加到该组中。这样做的目的是让你可以以一个普通用户而不是 root 用户的身份去管理虚拟机。你可以使用 `id` 命令来确认这一点,下面将会告诉你怎么去显示你的组 id:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ id <your-userID>
|
||||||
|
```
|
||||||
|
|
||||||
|
![](https://c2.staticflickr.com/6/5597/15432586092_64dfb867d3_c.jpg)
|
||||||
|
|
||||||
|
如果因为某些原因,libvirt(在 debian 中是 libvirt-qemu)没有在你的组 id 中被找到,你也可以手动将你自己添加到对应的组中,如下所示:
|
||||||
|
|
||||||
|
在 ubuntu 上:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo adduser [youruserID] libvirtd
|
||||||
|
```
|
||||||
|
|
||||||
|
在 debian 上:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo adduser [youruserID] libvirt-qemu
|
||||||
|
```
|
||||||
|
|
||||||
|
按照如下命令重新载入更新后的组成员关系。如果要求输入密码,那么输入你的登陆密码即可。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ exec su -l $USER
|
||||||
|
```
|
||||||
|
|
||||||
|
这时,你应该可以以普通用户的身份去执行 virsh 了。做一个如下所示的测试,这个命令将会以列表的形式列出可用的虚拟机(当前的列表是空的)。如果你没有遇到权限问题,那意味着到目前为止一切都是正常的。
|
||||||
|
|
||||||
|
$ virsh list
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
Id Name State
|
||||||
|
----------------------------------------------------
|
||||||
|
|
||||||
|
### 第三步:配置桥接网络 ###
|
||||||
|
|
||||||
|
为了使 KVM 虚拟机能够访问外部网络,一种方法是通过在 KVM 宿主机上创建 Linux 桥来实现。创建之后的桥能够将虚拟机的虚拟网卡和宿主机的物理网卡连接起来,因此,虚拟机能够发送和接收由物理网卡传输的数据包。这种方式叫做网络桥接。
|
||||||
|
|
||||||
|
下面将告诉你如何创建并且配置网桥,我们创建一个网桥称它为 br0。
|
||||||
|
|
||||||
|
首先,安装一个必需的包,然后用命令行创建一个网桥。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt-get install bridge-utils
|
||||||
|
$ sudo brctl addbr br0
|
||||||
|
```
|
||||||
|
|
||||||
|
下一步就是配置已经创建好的网桥,即修改位于 `/etc/network/interfaces` 的配置文件。我们需要将该桥接网卡设置成开机启动。为了修改该配置文件,你需要关闭你的操作系统上的网络管理器(如果你在使用它的话)。跟随[操作指南][1]的说明去关闭网络管理器。
|
||||||
|
|
||||||
|
关闭网络管理器之后,接下来就是通过修改配置文件来配置网桥了。
|
||||||
|
|
||||||
|
```
|
||||||
|
#auto eth0
|
||||||
|
#iface eth0 inet dhcp
|
||||||
|
|
||||||
|
auto br0
|
||||||
|
iface br0 inet dhcp
|
||||||
|
bridge_ports eth0
|
||||||
|
bridge_stp off
|
||||||
|
bridge_fd 0
|
||||||
|
bridge_maxwait 0
|
||||||
|
```
|
||||||
|
|
||||||
|
在上面的配置中,我假设 eth0 是主要网卡,它也是连接到外网的网卡,同样,我假设 eth0 将会通过 DHCP 协议自动获取 ip 地址。注意,之前在 `/etc/network/interfaces` 中还没有对 eth0 进行任何配置。桥接网卡 br0 引用了 eth0 的配置,而 eth0 也会受到 br0 的制约。
|
||||||
|
|
||||||
|
重启网络服务,并确认网桥已经被成功的配置好。如果成功的话,br0 的 ip 地址将会是 eth0 自动分配的 ip 地址,而且 eth0 不会被分配任何 ip 地址。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo /etc/init.d/networking restart
|
||||||
|
$ ifconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
如果因为某些原因,eth0 仍然保留了之前分配给了 br0 的 ip 地址,那么你可能必须手动删除 eth0 的 ip 地址。
|
||||||
|
|
||||||
|
![](https://c2.staticflickr.com/2/1698/23780708850_66cd7ba6ea_c.jpg)
|
||||||
|
|
||||||
|
### 第四步:用命令行创建一个虚拟机 ###
|
||||||
|
|
||||||
|
对于虚拟机来说,它的配置信息被存储在它对应的xml文件中。因此,创建一个虚拟机的第一步就是准备一个与虚拟机对应的 xml 文件。
|
||||||
|
|
||||||
|
下面是一个示例 xml 文件,你可以根据需要手动修改它。
|
||||||
|
|
||||||
|
```
|
||||||
|
<domain type='kvm'>
|
||||||
|
<name>alice</name>
|
||||||
|
<uuid>f5b8c05b-9c7a-3211-49b9-2bd635f7e2aa</uuid>
|
||||||
|
<memory>1048576</memory>
|
||||||
|
<currentMemory>1048576</currentMemory>
|
||||||
|
<vcpu>1</vcpu>
|
||||||
|
<os>
|
||||||
|
<type>hvm</type>
|
||||||
|
<boot dev='cdrom'/>
|
||||||
|
</os>
|
||||||
|
<features>
|
||||||
|
<acpi/>
|
||||||
|
</features>
|
||||||
|
<clock offset='utc'/>
|
||||||
|
<on_poweroff>destroy</on_poweroff>
|
||||||
|
<on_reboot>restart</on_reboot>
|
||||||
|
<on_crash>destroy</on_crash>
|
||||||
|
<devices>
|
||||||
|
<emulator>/usr/bin/kvm</emulator>
|
||||||
|
<disk type="file" device="disk">
|
||||||
|
<driver name="qemu" type="raw"/>
|
||||||
|
<source file="/home/dev/images/alice.img"/>
|
||||||
|
<target dev="vda" bus="virtio"/>
|
||||||
|
<address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
|
||||||
|
</disk>
|
||||||
|
<disk type="file" device="cdrom">
|
||||||
|
<driver name="qemu" type="raw"/>
|
||||||
|
<source file="/home/dev/iso/CentOS-6.5-x86_64-minimal.iso"/>
|
||||||
|
<target dev="hdc" bus="ide"/>
|
||||||
|
<readonly/>
|
||||||
|
<address type="drive" controller="0" bus="1" target="0" unit="0"/>
|
||||||
|
</disk>
|
||||||
|
<interface type='bridge'>
|
||||||
|
<source bridge='br0'/>
|
||||||
|
<mac address="00:00:A3:B0:56:10"/>
|
||||||
|
</interface>
|
||||||
|
<controller type="ide" index="0">
|
||||||
|
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/>
|
||||||
|
</controller>
|
||||||
|
<input type='mouse' bus='ps2'/>
|
||||||
|
<graphics type='vnc' port='-1' autoport="yes" listen='0.0.0.0'/>
|
||||||
|
<console type='pty'>
|
||||||
|
<target port='0'/>
|
||||||
|
</console>
|
||||||
|
</devices>
|
||||||
|
</domain>
|
||||||
|
```
|
||||||
|
|
||||||
|
上面的主机xml配置文件定义了如下的虚拟机内容。
|
||||||
|
|
||||||
|
- 1GB内存,一个虚拟cpu和一个硬件驱动
|
||||||
|
|
||||||
|
- 磁盘镜像:`/home/dev/images/alice.img`
|
||||||
|
|
||||||
|
- 从 CD-ROM 引导(`/home/dev/iso/CentOS-6.5-x86_64-minomal.iso`)
|
||||||
|
|
||||||
|
- 网络:一个桥接到 br0 的虚拟网卡
|
||||||
|
|
||||||
|
- 通过 VNC 远程访问
|
||||||
|
|
||||||
|
`<uuid></uuid>` 中的 UUID 字符串可以随机生成。为了得到一个随机的 uuid 字符串,你可能需要使用 uuid 命令行工具。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo apt-get install uuid
|
||||||
|
$ uuid
|
||||||
|
```
|
||||||
|
|
||||||
|
生成一个主机 xml 配置文件的方式就是通过一个已经存在的虚拟机来导出它的 xml 配置文件。如下所示。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh dumpxml alice > bob.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
![](https://c2.staticflickr.com/6/5808/23968234602_25e8019ec8_c.jpg)
|
||||||
|
|
||||||
|
### 第五步:使用命令行启动虚拟机 ###
|
||||||
|
|
||||||
|
在启动虚拟机之前,我们需要创建它的初始磁盘镜像。为此,你需要使用 qemu-img 命令来生成一个 qemu-kvm 镜像。下面的命令将会创建 10 GB 大小的空磁盘,并且它是 qcow2 格式的。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ qemu-img create -f qcow2 /home/dev/images/alice.img 10G
|
||||||
|
```
|
||||||
|
|
||||||
|
使用 qcow2 格式的磁盘镜像的好处就是它在创建之初并不会给它分配全部大小磁盘容量(这里是 10 GB),而是随着虚拟机中文件的增加而逐渐增大。因此,它对空间的使用更加有效。
|
||||||
|
|
||||||
|
现在,你可以通过使用之前创建的 xml 配置文件启动你的虚拟机了。下面的命令将会创建一个虚拟机,然后自动启动它。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh create alice.xml
|
||||||
|
Domain alice created from alice.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
**注意**: 如果你对一个已经存在的虚拟机执行了了上面的命令,那么这个操作将会在没有任何警告的情况下抹去那个已经存在的虚拟机的全部信息。如果你已经创建了一个虚拟机,你可能会使用下面的命令来启动虚拟机。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh start alice.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
使用如下命令确认一个新的虚拟机已经被创建并成功的被启动。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh list
|
||||||
|
```
|
||||||
|
|
||||||
|
Id Name State
|
||||||
|
----------------------------------------------------
|
||||||
|
3 alice running
|
||||||
|
|
||||||
|
同样,使用如下命令确认你的虚拟机的虚拟网卡已经被成功的添加到了你先前创建的 br0 网桥中。
|
||||||
|
|
||||||
|
$ sudo brctl show
|
||||||
|
|
||||||
|
![](https://c2.staticflickr.com/2/1546/23449585383_a371e9e579_c.jpg)
|
||||||
|
|
||||||
|
### 远程连接虚拟机 ###
|
||||||
|
|
||||||
|
为了远程访问一个正在运行的虚拟机的控制台,你可以使用VNC客户端。
|
||||||
|
|
||||||
|
首先,你需要使用如下命令找出用于虚拟机的VNC端口号。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo netstat -nap | egrep '(kvm|qemu)'
|
||||||
|
```
|
||||||
|
|
||||||
|
![](https://c2.staticflickr.com/6/5633/23448144274_49045bc868_c.jpg)
|
||||||
|
|
||||||
|
在这个例子中,用于 alice 虚拟机的 VNC 端口号是 5900。 然后启动一个VNC客户端,连接到一个端口号为5900的VNC服务器。在我们的例子中,虚拟机支持由CentOS光盘文件启动。
|
||||||
|
|
||||||
|
![](https://c2.staticflickr.com/2/1533/24076369675_99408972a4_c.jpg)
|
||||||
|
|
||||||
|
### 使用 virsh 管理虚拟机 ###
|
||||||
|
|
||||||
|
下面列出了 virsh 命令的常规用法:
|
||||||
|
|
||||||
|
创建客户机并且启动虚拟机:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh create alice.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
停止虚拟机并且删除客户机:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh destroy alice
|
||||||
|
```
|
||||||
|
|
||||||
|
关闭虚拟机(不用删除它):
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh shutdown alice
|
||||||
|
```
|
||||||
|
|
||||||
|
暂停虚拟机:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh suspend alice
|
||||||
|
```
|
||||||
|
|
||||||
|
恢复虚拟机:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh resume alice
|
||||||
|
```
|
||||||
|
|
||||||
|
访问正在运行的虚拟机的控制台:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh console alice
|
||||||
|
```
|
||||||
|
|
||||||
|
设置虚拟机开机启动:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh autostart alice
|
||||||
|
```
|
||||||
|
|
||||||
|
查看虚拟机的详细信息:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh dominfo alice
|
||||||
|
```
|
||||||
|
|
||||||
|
编辑虚拟机的配置文件:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh edit alice
|
||||||
|
```
|
||||||
|
|
||||||
|
上面的这个命令将会使用一个默认的编辑器来调用主机配置文件。该配置文件中的任何改变都将自动被libvirt验证其正确性。
|
||||||
|
|
||||||
|
你也可以在一个virsh会话中管理虚拟机。下面的命令会创建并进入到一个virsh会话中:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh
|
||||||
|
```
|
||||||
|
|
||||||
|
在 virsh 提示中,你可以使用任何 virsh 命令。
|
||||||
|
|
||||||
|
![](https://c2.staticflickr.com/6/5645/23708565129_b1ef968b30_c.jpg)
|
||||||
|
|
||||||
|
### 问题处理 ###
|
||||||
|
|
||||||
|
1. 我在创建虚拟机的时候遇到了一个错误:
|
||||||
|
|
||||||
|
error: internal error: no supported architecture for os type 'hvm'
|
||||||
|
|
||||||
|
如果你的硬件不支持虚拟化的话你可能就会遇到这个错误。(例如,Intel VT或者AMD-V),这是运行KVM所必需的。如果你遇到了这个错误,而你的cpu支持虚拟化,那么这里可以给你一些可用的解决方案:
|
||||||
|
|
||||||
|
首先,检查你的内核模块是否丢失。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ lsmod | grep kvm
|
||||||
|
```
|
||||||
|
|
||||||
|
如果内核模块没有加载,你必须按照如下方式加载它。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo modprobe kvm_intel (for Intel processor)
|
||||||
|
$ sudo modprobe kvm_amd (for AMD processor)
|
||||||
|
```
|
||||||
|
|
||||||
|
第二个解决方案就是添加 `--connect qemu:///system` 参数到 `virsh` 命令中,如下所示。当你正在你的硬件平台上使用超过一个虚拟机管理器的时候就需要添加这个参数(例如,VirtualBox,VMware)。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh --connect qemu:///system create alice.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 当我试着访问我的虚拟机的登陆控制台的时候遇到了错误:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ virsh console alice
|
||||||
|
error: internal error: cannot find character device <null>
|
||||||
|
```
|
||||||
|
|
||||||
|
这个错误发生的原因是你没有在你的虚拟机配置文件中定义控制台设备。在 xml 文件中加上下面的内部设备部分即可。
|
||||||
|
|
||||||
|
```
|
||||||
|
<console type='pty'>
|
||||||
|
<target port='0'/>
|
||||||
|
</console>
|
||||||
|
```
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://xmodulo.com/use-kvm-command-line-debian-ubuntu.html
|
||||||
|
|
||||||
|
作者:[Dan Nanni][a]
|
||||||
|
译者:[kylepeng93](https://github.com/kylepeng93 )
|
||||||
|
校对:[Ezio](https://github.com/oska874)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:http://xmodulo.com/author/nanni
|
||||||
|
[1]:http://xmodulo.com/disable-network-manager-linux.html
|
@ -1,15 +1,15 @@
|
|||||||
我们能通过快速的,开放的研究战胜寨卡病毒吗?
|
我们能通过快速、开放的研究来战胜寨卡病毒吗?
|
||||||
============================================================
|
============================================================
|
||||||
|
|
||||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/OSDC_LifeScience_OpenScience_520x292_12268077_0614MM.png?itok=3ZD2Mce9)
|
![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/OSDC_LifeScience_OpenScience_520x292_12268077_0614MM.png?itok=3ZD2Mce9)
|
||||||
|
|
||||||
关于寨卡病毒,最主要的问题就是我们对于它了解的太少了。这意味着我们需要尽快对它作出很多研究。
|
关于寨卡病毒,最主要的问题就是我们对于它了解的太少了。这意味着我们需要尽快对它作出很多研究。
|
||||||
|
|
||||||
寨卡病毒现已严重威胁到世界人民的健康。在 2015 年爆发之后,它就成为了全球卫生的紧急状况,并且这个病毒也可能与儿童的出生缺陷有关。根据维基百科,在这个病毒在 40 年代末期被发现以后,它对于人类的影响早在 1952 年就被观测到了。
|
寨卡病毒现已严重威胁到世界人民的健康。在 2015 年爆发之后,它就成为了全球性的突发公共卫生事件,并且这个病毒也可能与儿童的出生缺陷有关。根据[维基百科][4],在这个病毒在 40 年代末期被发现以后,早在 1952 年就被观测到了对于人类的影响。
|
||||||
|
|
||||||
在 2 月 10 日,开放杂志 PLoS [发布了一个声明][1],这个是声明是关于有关公共公众紧急状况的信息的共享。在此之后,刊登在开放期刊 F1000 的一篇文章 [开始了对于能治疗寨卡病毒的药物的研究][2],它开放的讨论寨卡病毒的状况以及对它进行研究的需要。那个来自 PLoS 的声明列出了超过 30 个开放了对于寨卡病毒的研究进度的数据的重要组织。并且世界卫生组织实施了对于提交到他们那里的资料的特别规定使得在一个[创作共用许可证下][3]公布。
|
在 2 月 10 日,开放杂志 PLoS [发布了一个声明][1],这个是声明是关于有关公众紧急状况的信息共享。在此之后,刊登在研究期刊 F1000 的一篇文章 [对于能治疗寨卡病毒的开源药物(Open drug)的研究][2],它讨论了寨卡病毒及其开放研究的状况。那篇来自 PLoS 的声明列出了超过 30 个开放了对于寨卡病毒的研究进度的数据的重要组织。并且世界卫生组织实施了一个特别规定,以[创作共用许可证][3]公布提交到他们那里的资料。
|
||||||
|
|
||||||
快速公布,无限制的重复利用,以及强调研究结果的传播是开放科研组织把他们的研究推出的战略性一步。看到一个需要我们给予关注的紧急状况的研究的开端是很令人受鼓舞的。
|
快速公布,无限制的重复利用,以及强调研究结果的传播是推动开放科研社区的战略性一步。看到我们所关注的突发公共卫生事件能够以这样的方式开始是很令人受鼓舞的。
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ via: https://opensource.com/life/16/2/how-rapid-open-science-could-change-game-z
|
|||||||
|
|
||||||
作者:[Marcus D. Hanwell][a]
|
作者:[Marcus D. Hanwell][a]
|
||||||
译者:[name1e5s](https://github.com/name1e5s)
|
译者:[name1e5s](https://github.com/name1e5s)
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
校对:[wxy](https://github.com/wxy)
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
@ -25,3 +25,4 @@ via: https://opensource.com/life/16/2/how-rapid-open-science-could-change-game-z
|
|||||||
[1]: http://blogs.plos.org/plos/2016/02/statement-on-data-sharing-in-public-health-emergencies/
|
[1]: http://blogs.plos.org/plos/2016/02/statement-on-data-sharing-in-public-health-emergencies/
|
||||||
[2]: http://f1000research.com/articles/5-150/v1
|
[2]: http://f1000research.com/articles/5-150/v1
|
||||||
[3]: https://creativecommons.org/licenses/by/3.0/igo/
|
[3]: https://creativecommons.org/licenses/by/3.0/igo/
|
||||||
|
[4]: https://en.wikipedia.org/wiki/Zika_virus
|
@ -0,0 +1,27 @@
|
|||||||
|
Xubuntu 16.04 Beta 1 开发者版本发布
|
||||||
|
============================================
|
||||||
|
|
||||||
|
Ubuntu 发布团队宣布为选定的社区版本而准备的最新的 beta 测试镜像已经可以使用了。新的发布版本名称是 16.04 beta 1 ,这个版本只推荐给测试人员测试用,并不适合普通人进行日常使用。
|
||||||
|
|
||||||
|
![](https://www.linux.com/images/stories/66866/xubuntu-small.png)
|
||||||
|
|
||||||
|
“这个 beta 特性的镜像主要是为 [Lubuntu][1], Ubuntu Cloud, [Ubuntu GNOME][2], [Ubuntu MATE][3], [Ubuntu Kylin][4], [Ubuntu Studio][5] 和 [Xubuntu][6] 这几个发布版准备的。Xenial Xerus (LCTT 译注: ubuntu 16.04 的开发代号)的这个预发布版本并不推荐那些需要稳定版本的人员使用,同时那些不希望在系统运行中偶尔或频繁的出现 bug 的人也不建议使用这个版本。这个版本主要还是推荐给那些喜欢 ubuntu 的开发人员,以及那些想协助我们测试、报告 bug 和修改 bug 的人使用,和我们一起努力让这个发布版本早日准备就绪。” 更多的信息可以从 [发布日志][7] 获取。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.linux.com/news/software/applications/888731-development-release-xubuntu-1604-beta-1
|
||||||
|
|
||||||
|
作者:[DistroWatch][a]
|
||||||
|
译者:[Ezio](https://github.com/oska874)
|
||||||
|
校对:[Ezio](https://github.com/oska874)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.linux.com/community/forums/person/284
|
||||||
|
[1]: http://distrowatch.com/lubuntu
|
||||||
|
[2]: http://distrowatch.com/ubuntugnome
|
||||||
|
[3]: http://distrowatch.com/ubuntumate
|
||||||
|
[4]: http://distrowatch.com/ubuntukylin
|
||||||
|
[5]: http://distrowatch.com/ubuntustudio
|
||||||
|
[6]: http://distrowatch.com/xubuntu
|
||||||
|
[7]: https://lists.ubuntu.com/archives/ubuntu-devel-announce/2016-February/001173.html
|
@ -0,0 +1,25 @@
|
|||||||
|
逾千万使用 https 的站点受到新型解密攻击的威胁
|
||||||
|
===========================================================================
|
||||||
|
|
||||||
|
![](https://www.linux.com/images/stories/66866/drown-explainer.jpg)
|
||||||
|
|
||||||
|
|
||||||
|
低成本的 DROWN 攻击能在数小时内完成数据解密,该攻击对采用了 TLS 的邮件服务器也同样奏效。
|
||||||
|
|
||||||
|
一个国际研究小组于周二发出警告,据称逾 1100 万家网站和邮件服务采用的用以保证服务安全的 [传输层安全协议 TLS][1],对于一种新发现的、成本低廉的攻击而言异常脆弱,这种攻击会在几个小时内解密敏感的通信,在某些情况下解密甚至能瞬间完成。 前一百万家最大的网站中有超过 81,000 个站点正处于这种脆弱的 HTTPS 协议保护之下。
|
||||||
|
|
||||||
|
这种攻击主要针对依赖于 [RSA 加密系统][2]的 TLS 所保护的通信,密钥会间接的通过 SSLv2 暴露,这是一种在 20 年前就因为自身缺陷而退休了的 TLS 前代协议。该漏洞允许攻击者可以通过反复使用 SSLv2 创建与服务器连接的方式,解密截获的 TLS 连接。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.linux.com/news/software/applications/889455--more-than-11-million-https-websites-imperiled-by-new-decryption-attack
|
||||||
|
|
||||||
|
作者:[ArsTechnica][a]
|
||||||
|
译者:[Ezio](https://github.com/oska874)
|
||||||
|
校对:[martin2011qi](https://github.com/martin2011qi), [wxy](https://github.com/wxy)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.linux.com/community/forums/person/112
|
||||||
|
[1]: https://en.wikipedia.org/wiki/Transport_Layer_Security
|
||||||
|
[2]: https://en.wikipedia.org/wiki/RSA_(cryptosystem)
|
@ -0,0 +1,72 @@
|
|||||||
|
Zephyr Project for Internet of Things, releases from Facebook, IBM, Yahoo, and more news
|
||||||
|
===========================================================================================
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/weekly_news_roundup_tv.png?itok=eqUoW1gU)
|
||||||
|
|
||||||
|
In this week's edition of our open source news roundup, we take a look at the new IoT project from the Linux Foundation, three big corporations releasing open source, and more.
|
||||||
|
|
||||||
|
**News roundup for February 21 - 26, 2016**
|
||||||
|
|
||||||
|
### Linux Foundation unveils the Zephyr Project
|
||||||
|
|
||||||
|
The Internet of Things (IoT) is shaping up to be the next big thing in consumer technology. At the moment, most IoT solutions are proprietary and closed source. Open source is making numerous in-roads into the IoT world, and that's undoubtedly going to accelerate now that the Linux Foundation has [announced the Zephyr Project][1].
|
||||||
|
|
||||||
|
The Zephyr Project, according to ZDNet, "hopes to bring vendors and developers together under a single operating system which could make the development of connected devices an easier, less expensive and more stable process." The Project "aims to incorporate input from the open source and embedded developer communities and to encourage collaboration on the RTOS (real-time operating system)," according to the [Linux Foundation's press release][2].
|
||||||
|
|
||||||
|
Currently, Intel Corporation, NXP Semiconductors N.V., Synopsys, Inc., and UbiquiOS Technology Limited are the main supporters of the project. The Linux Foundation intends to attract other IoT vendors to this effort as well.
|
||||||
|
|
||||||
|
### Releases from Facebook, IBM, Yahoo
|
||||||
|
|
||||||
|
As we all know, open source isn't just about individuals or small groups hacking on code and hardware. Quite a few large corporations have significant investments in open source. This past week, three of them affirmed their commitment to open source.
|
||||||
|
|
||||||
|
Yahoo again waded into open source waters this week with the [release of CaffeOnSpark][3] artificial intelligence software under an Apache 2.0 license. CaffeOnSpark performs "a popular type of AI called 'deep learning' on the vast swaths of data kept in its Hadoop open-source file system for storing big data," according to VentureBeat. If you're curious, you can [find the source code on GitHub][4].
|
||||||
|
|
||||||
|
Earlier this week, Facebook "[unveiled a new project that seeks not only to accelerate the evolution of technologies that drive our mobile networks, but to freely share this work with the world’s telecoms][5]," according to Wired. The company plans to build "everything from new wireless radios to nee optical fiber equipment." The designs, according to Facebook, will be open source so any telecom firm can use them.
|
||||||
|
|
||||||
|
As part of the [Open Mainframe Project][6], IBM has open sourced the code for its Anomaly Detection Engine (ADE) for Linux logs. [According to IBM][7], "ADE detects anomalous time slices and messages in Linux logs using statistical learning" to detect suspicious behaviour. You can grab the [source code for ADE][8] from GitHub.
|
||||||
|
|
||||||
|
### European Union to fund research
|
||||||
|
|
||||||
|
The European Research Council, the European Union's science and technology funding body, is [funding four open source research projects][9] to the tune of about €2 million. According to joinup.ec.europa.eu, the projects being funded are:
|
||||||
|
|
||||||
|
- A code audit of Mozilla's open source Rust programming language
|
||||||
|
|
||||||
|
- An initiative at INRIA (France's national computer science research center) studying secure programming
|
||||||
|
|
||||||
|
- A project at Austria's Technische Universitat Graz testing "ways to secure code against attacks that exploit certain properties of the computer hardware"
|
||||||
|
|
||||||
|
- The "development of techniques to prove popular cryptographic protocols and schemes" at IST Austria
|
||||||
|
|
||||||
|
### In other news
|
||||||
|
|
||||||
|
- [Infosys' newest weapon: open source][10]
|
||||||
|
|
||||||
|
- [Intel demonstrates Android smartphone running a Linux desktop][11]
|
||||||
|
|
||||||
|
- [BeeGFS file system goes open source][12]
|
||||||
|
|
||||||
|
A big thanks, as always, to the Opensource.com moderators and staff for their help this week.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/life/16/2/weekly-news-feb-26
|
||||||
|
|
||||||
|
作者:[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/scottnesbitt
|
||||||
|
[1]: http://www.zdnet.com/article/the-linux-foundations-zephyr-project-building-an-operating-system-for-iot-devices/
|
||||||
|
[2]: http://www.linuxfoundation.org/news-media/announcements/2016/02/linux-foundation-announces-project-build-real-time-operating-system
|
||||||
|
[3]: http://venturebeat.com/2016/02/24/yahoo-open-sources-caffeonspark-deep-learning-framework-for-hadoop/
|
||||||
|
[4]: https://github.com/yahoo/CaffeOnSpark
|
||||||
|
[5]: http://www.wired.com/2016/02/facebook-open-source-wireless-gear-forge-5g-world/
|
||||||
|
[6]: https://www.openmainframeproject.org/
|
||||||
|
[7]: http://openmainframeproject.github.io/ade/
|
||||||
|
[8]: https://github.com/openmainframeproject/ade
|
||||||
|
[9]: https://joinup.ec.europa.eu/node/149541
|
||||||
|
[10]: http://www.businessinsider.in/Exclusive-Infosys-is-using-Open-Source-as-its-mostlethal-weapon-yet/articleshow/51109129.cms
|
||||||
|
[11]: http://www.theregister.co.uk/2016/02/23/move_over_continuum_intel_shows_android_smartphone_powering_bigscreen_linux/
|
||||||
|
[12]: http://insidehpc.com/2016/02/beegfs-parallel-file-system-now-open-source/
|
@ -0,0 +1,42 @@
|
|||||||
|
Node.js 5.7 released ahead of impending OpenSSL updates
|
||||||
|
=============================================================
|
||||||
|
|
||||||
|
![](http://images.techhive.com/images/article/2014/09/nodejs-100449932-primary.idge.jpg)
|
||||||
|
|
||||||
|
>Once again, OpenSSL fixes must be evaluated by keepers of the popular server-side JavaScript platform
|
||||||
|
|
||||||
|
The Node.js Foundation is gearing up this week for fixes to OpenSSL that could mean updates to Node.js itself.
|
||||||
|
|
||||||
|
Releases to OpenSSL due on Tuesday will fix defects deemed to be of "high" severity, Rod Vagg, foundation technical steering committee director, said [in a blog post][1] on Monday. Within a day of the OpenSSL releases, the Node.js crypto team will assess their impacts, saying, "Please be prepared for the possibility of important updates to Node.js v0.10, v0.12, v4 and v5 soon after Tuesday, the 1st of March."
|
||||||
|
|
||||||
|
[ Deep Dive: [How to rethink security for the new world of IT][2]. | Discover how to secure your systems with InfoWorld's [Security newsletter][3]. ]
|
||||||
|
|
||||||
|
The high severity status actually means the issues are of lower risks than critical, perhaps affecting less-common configurations or less likely to be exploitable. Due to an embargo, the exact nature of these fixes and their impact on Node.js remain uncertain, said Vagg. "Node.js v0.10 and v0.12 both use OpenSSL v1.0.1, and Node.js v4 and v5 both use OpenSSL v1.0.2, and releases from nodejs.org and some other popular distribution sources are statically compiled. Therefore, all active release lines are impacted by this update." OpenSSL also impacted Node.js in December, [when two critical vulnerabilities were fixed][4].
|
||||||
|
|
||||||
|
The latest OpenSSL developments follow [the release of Node.js 5.7.0][5], which is clearing a path for the upcoming Node.js 6. Version 5 is the main focus for active development, said foundation representative Mikeal Rogers, "However, v5 won't be supported long-term, and most users will want to wait for v6, which will be released by the end of April, for the new features that are landing in v5."
|
||||||
|
|
||||||
|
Release 5.7 has more predictability for C++ add-ons' interactions with JavaScript. Node.js can invoke JavaScript code from C++ code, and in version 5.7, the C++ node::MakeCallback() API is now re-entrant; calling it from inside another MakeCallback() call no longer causes the nextTick queue or Promises microtask queue to be processed out of order, [according to release notes][6].
|
||||||
|
|
||||||
|
Also fixed is an HTTP bug where handling headers mistakenly trigger an "upgrade" event where the server just advertises protocols. The bug can prevent HTTP clients from communicating with HTTP2-enabled servers. Version 5.7 performance improvements are featured in the path, querystring, streams, and process.nextTick modules.
|
||||||
|
|
||||||
|
This story, "Node.js 5.7 released ahead of impending OpenSSL updates" was originally published by [InfoWorld][7].
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://www.itworld.com/article/3039005/security/nodejs-57-released-ahead-of-impending-openssl-updates.html
|
||||||
|
|
||||||
|
作者:[Paul Krill][a]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:http://www.itworld.com/author/Paul-Krill/
|
||||||
|
[1]: https://nodejs.org/en/blog/vulnerability/openssl-march-2016/
|
||||||
|
[2]: http://www.infoworld.com/resources/17273/security-management/how-to-rethink-security-for-the-new-world-of-it#tk.ifw-infsb
|
||||||
|
[3]: http://www.infoworld.com/newsletters/signup.html#tk.ifw-infsb
|
||||||
|
[4]: http://www.infoworld.com/article/3012157/security/why-nodejs-waited-for-openssl-security-update-before-patching.html
|
||||||
|
[5]: https://nodejs.org/en/blog/release/v5.7.0/
|
||||||
|
[6]: https://nodejs.org/en/blog/release/v5.7.0/
|
||||||
|
[7]: http://www.infoworld.com/
|
@ -1,165 +0,0 @@
|
|||||||
robot527 translating
|
|
||||||
|
|
||||||
|
|
||||||
Bossie Awards 2015: The best open source networking and security software
|
|
||||||
================================================================================
|
|
||||||
InfoWorld's top picks of the year among open source tools for building, operating, and securing networks
|
|
||||||
|
|
||||||
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-net-sec-100614459-orig.jpg)
|
|
||||||
|
|
||||||
### The best open source networking and security software ###
|
|
||||||
|
|
||||||
BIND, Sendmail, OpenSSH, Cacti, Nagios, Snort -- open source software seems to have been invented for networks, and many of the oldies and goodies are still going strong. Among our top picks in the category this year, you'll find a mix of stalwarts, mainstays, newcomers, and upstarts perfecting the arts of network management, security monitoring, vulnerability assessment, rootkit detection, and much more.
|
|
||||||
|
|
||||||
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-icinga-100614482-orig.jpg)
|
|
||||||
|
|
||||||
### Icinga 2 ###
|
|
||||||
|
|
||||||
Icinga began life as a fork of system monitoring application Nagios. [Icinga 2][1] was completely rewritten to give users a modern interface, support for multiple databases, and an API to integrate numerous extensions. With out-of-the-box load balancing, notifications, and configuration, Icinga 2 shortens the time to installation for complex environments. Icinga 2 supports Graphite natively, giving administrators real-time performance graphing without any fuss. But what puts Icinga back on the radar this year is its release of Icinga Web 2, a graphical front end with drag-and-drop customizable dashboards and streamlined monitoring tools.
|
|
||||||
|
|
||||||
Administrators can view, filter, and prioritize problems, while keeping track of which actions have already been taken. A new matrix view lets administrators view hosts and services on one page. You can view events over a particular time period or filter incidents to understand which ones need immediate attention. Icinga Web 2 may boast a new interface and zippier performance, but all the usual commands from Icinga Classic and Icinga Web are still available. That means there is no downtime trying to learn a new version of the tool.
|
|
||||||
|
|
||||||
-- Fahmida Rashid
|
|
||||||
|
|
||||||
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-zenoss-100614465-orig.jpg)
|
|
||||||
|
|
||||||
### Zenoss Core ###
|
|
||||||
|
|
||||||
Another open source stalwart, [Zenoss Core][2] gives network administrators a complete, one-stop solution for tracking and managing all of the applications, servers, storage, networking components, virtualization tools, and other elements of an enterprise infrastructure. Administrators can make sure the hardware is running efficiently and take advantage of the modular design to plug in ZenPacks for extended functionality.
|
|
||||||
|
|
||||||
Zenoss Core 5, released in February of this year, takes the already powerful tool and improves it further, with an enhanced user interface and expanded dashboard. The Web-based console and dashboards were already highly customizable and dynamic, and the new version now lets administrators mash up multiple component charts onto a single chart. Think of it as the tool for better root cause and cause/effect analysis.
|
|
||||||
|
|
||||||
Portlets give additional insights for network mapping, device issues, daemon processes, production states, watch lists, and event views, to name a few. And new HTML5 charts can be exported outside the tool. The Zenoss Control Center allows out-of-band management and monitoring of all Zenoss components. Zenoss Core has new tools for online backup and restore, snapshots and rollbacks, and multihost deployment. Even more important, deployments are faster with full Docker support.
|
|
||||||
|
|
||||||
-- Fahmida Rashid
|
|
||||||
|
|
||||||
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-opennms-100614461-orig.jpg)
|
|
||||||
|
|
||||||
### OpenNMS ###
|
|
||||||
|
|
||||||
An extremely flexible network management solution, [OpenNMS][3] can handle any network management task, whether it's device management, application performance monitoring, inventory control, or events management. With IPv6 support, a robust alerts system, and the ability to record user scripts to test Web applications, OpenNMS has everything network administrators and testers need. OpenNMS has become, as now a mobile dashboard, called OpenNMS Compass, lets networking pros keep an eye on their network even when they're out and about.
|
|
||||||
|
|
||||||
The iOS version of the app, which is available on the [iTunes App Store][4], displays outages, nodes, and alarms. The next version will offer additional event details, resource graphs, and information about IP and SNMP interfaces. The Android version, available on [Google Play][5], displays network availability, outages, and alarms on the dashboard, as well as the ability to acknowledge, escalate, or clear alarms. The mobile clients are compatible with OpenNMS Horizon 1.12 or greater and OpenNMS Meridian 2015.1.0 or greater.
|
|
||||||
|
|
||||||
-- Fahmida Rashid
|
|
||||||
|
|
||||||
![](http://images.techhive.com/images/article/2015/09/bossies-2015-onion-100614460-orig.jpg)
|
|
||||||
|
|
||||||
### Security Onion ###
|
|
||||||
|
|
||||||
Like an onion, network security monitoring is made of many layers. No single tool will give you visibility into every attack or show you every reconnaissance or foot-printing session on your company network. [Security Onion][6] bundles scores of proven tools into one handy Ubuntu distro that will allow you to see who's inside your network and help keep the bad guys out.
|
|
||||||
|
|
||||||
Whether you're taking a proactive approach to network security monitoring or following up on a potential attack, Security Onion can assist. Consisting of sensor, server, and display layers, the Onion combines full network packet capture with network-based and host-based intrusion detection, and it serves up all of the various logs for inspection and analysis.
|
|
||||||
|
|
||||||
The star-studded network security toolchain includes Netsniff-NG for packet capture, Snort and Suricata for rules-based network intrusion detection, Bro for analysis-based network monitoring, OSSEC for host intrusion detection, and Sguil, Squert, Snorby, and ELSA (Enterprise Log Search and Archive) for display, analysis, and log management. It’s a carefully vetted collection of tools, all wrapped in a wizard-driven installer and backed by thorough documentation, that can help you get from zero to monitoring as fast as possible.
|
|
||||||
|
|
||||||
-- Victor R. Garza
|
|
||||||
|
|
||||||
![](http://images.techhive.com/images/article/2015/09/bossies-2015-kali-100614458-orig.jpg)
|
|
||||||
|
|
||||||
Kali Linux
|
|
||||||
|
|
||||||
The team behind [Kali Linux][7] revamped the popular security Linux distribution this year to make it faster and even more versatile. Kali sports a new 4.0 kernel, improved hardware and wireless driver support, and a snappier interface. The most popular tools are easily accessible from a dock on the side of the screen. The biggest change? Kali Linux is now a rolling distribution, with a continuous stream of software updates. Kali's core system is based on Debian Jessie, and the team will pull packages continuously from Debian Testing, while continuing to add new Kali-flavored features on top.
|
|
||||||
|
|
||||||
The distribution still comes jam-packed with tools for penetration testing, vulnerability analysis, security forensics, Web application analysis, wireless networking and assessment, reverse engineering, and exploitation tools. Now the distribution has an upstream version checking system that will automatically notify users when updates are available for the individual tools. The distribution also features ARM images for a range of devices, including Raspberry Pi, Chromebook, and Odroids, as well as updates to the NetHunter penetration testing platform that runs on Android devices. There are other changes too: Metasploit Community/Pro is no longer included, because Kali 2.0 is not yet [officially supported by Rapid7][8].
|
|
||||||
|
|
||||||
-- Fahmida Rashid
|
|
||||||
|
|
||||||
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-openvas-100614462-orig.jpg)
|
|
||||||
|
|
||||||
### OpenVAS ###
|
|
||||||
|
|
||||||
[OpenVAS][9], the Open Vulnerability Assessment System, is a framework that combines multiple services and tools to offer vulnerability scanning and vulnerability management. The scanner is coupled with a weekly feed of network vulnerability tests, or you can use a feed from a commercial service. The framework includes a command-line interface (so it can be scripted) and an SSL-secured, browser-based interface via the [Greenbone Security Assistant][10]. OpenVAS accommodates various plug-ins for additional functionality. Scans can be scheduled or run on-demand.
|
|
||||||
|
|
||||||
Multiple OpenVAS installations can be controlled through a single master, which makes this a scalable vulnerability assessment tool for enterprises. The project is as compatible with standards as can be: Scan results and configurations are stored in a SQL database, where they can be accessed easily by external reporting tools. Client tools access the OpenVAS Manager via the XML-based stateless OpenVAS Management Protocol, so security administrators can extend the functionality of the framework. The software can be installed from packages or source code to run on Windows or Linux, or downloaded as a virtual appliance.
|
|
||||||
|
|
||||||
-- Matt Sarrel
|
|
||||||
|
|
||||||
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-owasp-100614463-orig.jpg)
|
|
||||||
|
|
||||||
### OWASP ###
|
|
||||||
|
|
||||||
[OWASP][11], the Open Web Application Security Project, is a nonprofit organization with worldwide chapters focused on improving software security. The community-driven organization provides test tools, documentation, training, and almost anything you could imagine that’s related to assessing software security and best practices for developing secure software. Several OWASP projects have become valuable components of many a security practitioner's toolkit:
|
|
||||||
|
|
||||||
[ZAP][12], the Zed Attack Proxy Project, is a penetration test tool for finding vulnerabilities in Web applications. One of the design goals of ZAP was to make it easy to use so that developers and functional testers who aren't security experts can benefit from using it. ZAP provides automated scanners and a set of manual test tools.
|
|
||||||
|
|
||||||
The [Xenotix XSS Exploit Framework][13] is an advanced cross-site scripting vulnerability detection and exploitation framework that runs scans within browser engines to get real-world results. The Xenotix Scanner Module uses three intelligent fuzzers, and it can run through nearly 5,000 distinct XSS payloads. An API lets security administrators extend and customize the exploit toolkit.
|
|
||||||
|
|
||||||
[O-Saft][14], or the OWASP SSL advanced forensic tool, is an SSL auditing tool that shows detailed information about SSL certificates and tests SSL connections. This command-line tool can run online or offline to assess SSL security such as ciphers and configurations. O-Saft provides built-in checks for common vulnerabilities, and you can easily extend these through scripting. In May 2015 a simple GUI was added as an optional download.
|
|
||||||
|
|
||||||
[OWTF][15], the Offensive Web Testing Framework, is an automated test tool that follows OWASP testing guidelines and the NIST and PTES standards. The framework uses both a Web UI and a CLI, and it probes Web and application servers for common vulnerabilities such as improper configuration and unpatched software.
|
|
||||||
|
|
||||||
-- Matt Sarrel
|
|
||||||
|
|
||||||
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-beef-100614456-orig.jpg)
|
|
||||||
|
|
||||||
### BeEF ###
|
|
||||||
|
|
||||||
The Web browser has become the most common vector for attacks against clients. [BeEF][15], the Browser Exploitation Framework Project, is a widely used penetration tool to assess Web browser security. BeEF helps you expose the security weaknesses of client systems using client-side attacks launched through the browser. BeEF sets up a malicious website, which security administrators visit from the browser they want to test. BeEF then sends commands to attack the Web browser and use it to plant software on the client machine. Administrators can then launch attacks on the client machine as if they were zombies.
|
|
||||||
|
|
||||||
BeEF comes with commonly used modules like a key logger, a port scanner, and a Web proxy, plus you can write your own modules or send commands directly to the zombified test machine. BeEF comes with a handful of demo Web pages to help you get started and makes it very easy to write additional Web pages and attack modules so you can customize testing to your environment. BeEF is a valuable test tool for assessing browser and endpoint security and for learning how browser-based attacks are launched. Use it to put together a demo to show your users how malware typically infects client devices.
|
|
||||||
|
|
||||||
-- Matt Sarrel
|
|
||||||
|
|
||||||
![](http://images.techhive.com/images/article/2015/09/bossies-2015-unhide-100614464-orig.jpg)
|
|
||||||
|
|
||||||
### Unhide ###
|
|
||||||
|
|
||||||
[Unhide][16] is a forensic tool that locates open TCP/UDP ports and hidden process on UNIX, Linux, and Windows. Hidden ports and processes can be the result of rootkit or LKM (loadable kernel module) activity. Rootkits can be difficult to find and remove because they are designed to be stealthy, hiding themselves from the OS and user. A rootkit can use LKMs to hide its processes or impersonate other processes, allowing it to run on machines undiscovered for a long time. Unhide can provide the assurance that administrators need to know their systems are clean.
|
|
||||||
|
|
||||||
Unhide is really two separate scripts: one for processes and one for ports. The tool interrogates running processes, threads, and open ports and compares this info to what's registered with the system as active, reporting discrepancies. Unhide and WinUnhide are extremely lightweight scripts that run from the command line to produce text output. They're not pretty, but they are extremely useful. Unhide is also included in the [Rootkit Hunter][17] project.
|
|
||||||
|
|
||||||
-- Matt Sarrel
|
|
||||||
|
|
||||||
![](http://images.techhive.com/images/article/2015/09/bossies-2015-main-100614457-orig.jpg)
|
|
||||||
|
|
||||||
Read about more open source winners
|
|
||||||
|
|
||||||
InfoWorld's Best of Open Source Awards for 2014 celebrate more than 100 open source projects, from the bottom of the stack to the top. Follow these links to more open source winners:
|
|
||||||
|
|
||||||
[Bossie Awards 2015: The best open source applications][18]
|
|
||||||
|
|
||||||
[Bossie Awards 2015: The best open source application development tools][19]
|
|
||||||
|
|
||||||
[Bossie Awards 2015: The best open source big data tools][20]
|
|
||||||
|
|
||||||
[Bossie Awards 2015: The best open source data center and cloud software][21]
|
|
||||||
|
|
||||||
[Bossie Awards 2015: The best open source desktop and mobile software][22]
|
|
||||||
|
|
||||||
[Bossie Awards 2015: The best open source networking and security software][23]
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: http://www.infoworld.com/article/2982962/open-source-tools/bossie-awards-2015-the-best-open-source-networking-and-security-software.html
|
|
||||||
|
|
||||||
作者:[InfoWorld staff][a]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]:http://www.infoworld.com/author/InfoWorld-staff/
|
|
||||||
[1]:https://www.icinga.org/icinga/icinga-2/
|
|
||||||
[2]:http://www.zenoss.com/
|
|
||||||
[3]:http://www.opennms.org/
|
|
||||||
[4]:https://itunes.apple.com/us/app/opennms-compass/id968875097?mt=8
|
|
||||||
[5]:https://play.google.com/store/apps/details?id=com.opennms.compass&hl=en
|
|
||||||
[6]:http://blog.securityonion.net/p/securityonion.html
|
|
||||||
[7]:https://www.kali.org/
|
|
||||||
[8]:https://community.rapid7.com/community/metasploit/blog/2015/08/12/metasploit-on-kali-linux-20
|
|
||||||
[9]:http://www.openvas.org/
|
|
||||||
[10]:http://www.greenbone.net/
|
|
||||||
[11]:https://www.owasp.org/index.php/Main_Page
|
|
||||||
[12]:https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project
|
|
||||||
[13]:https://www.owasp.org/index.php/O-Saft
|
|
||||||
[14]:https://www.owasp.org/index.php/OWASP_OWTF
|
|
||||||
[15]:http://www.beefproject.com/
|
|
||||||
[16]:http://www.unhide-forensics.info/
|
|
||||||
[17]:http://www.rootkit.nl/projects/rootkit_hunter.html
|
|
||||||
[18]:http://www.infoworld.com/article/2982622/bossie-awards-2015-the-best-open-source-applications.html
|
|
||||||
[19]:http://www.infoworld.com/article/2982920/bossie-awards-2015-the-best-open-source-application-development-tools.html
|
|
||||||
[20]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html
|
|
||||||
[21]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html
|
|
||||||
[22]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html
|
|
||||||
[23]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html
|
|
@ -1,66 +0,0 @@
|
|||||||
ictlyh Translating
|
|
||||||
Review EXT4 vs. Btrfs vs. XFS
|
|
||||||
================================================================================
|
|
||||||
![](http://1426826955.rsc.cdn77.org/wp-content/uploads/2015/09/1385698302_funny_linux_wallpapers-593x445.jpg)
|
|
||||||
|
|
||||||
To be honest, one of the things that comes last in people’s thinking is to look at which file system on their PC is being used. Windows users as well as Mac OS X users even have less reason for looking as they have really only 1 choice for their operating system which are NTFS and HFS+. Linux operating system, on the other side, has plenty of various file system options, with the current default is being widely used ext4. However, there is another push for changing the file system to something other which is called btrfs. But what makes btrfs better, what are other file systems, and when can we see the distributions making the change?
|
|
||||||
|
|
||||||
Let’s first have a general look at file systems and what they really do, then we will make a small comparison between famous file systems.
|
|
||||||
|
|
||||||
### So, What Do File Systems Do? ###
|
|
||||||
|
|
||||||
Just in case if you are unfamiliar about what file systems really do, it is actually simple when it is summarized. The file systems are mainly used in order for controlling how the data is stored after any program is no longer using it, how access to the data is controlled, what other information (metadata) is attached to the data itself, etc. I know that it does not sound like an easy thing to be programmed, and it is definitely not. The file systems are continually still being revised for including more functionality while becoming more efficient in what it simply needs to do. Therefore, however, it is a basic need for all computers, it is not quite as basic as it sounds like.
|
|
||||||
|
|
||||||
### Why Partitioning? ###
|
|
||||||
|
|
||||||
Many people have a vague knowledge of what the partitions are since each operating system has an ability for creating or removing them. It can seem strange that Linux operating system uses more than 1 partition on the same disk, even while using the standard installation procedure, so few explanations are called for them. One of the main goals of having different partitions is achieving higher data security in the disaster case.
|
|
||||||
|
|
||||||
By dividing your hard disk into partitions, the data may be grouped and also separated. When the accidents occur, only the data stored in the partition which got the hit will only be damaged, while data on the other partitions will survive most likely. These principles date from the days when the Linux operating system didn’t have a journaled file system and any power failure might have led to a disaster.
|
|
||||||
|
|
||||||
The using of partitions will remain for security and the robustness reasons, then the breach on 1 part of the operating system does not automatically mean that whole computer is under risk or danger. This is currently most important factor for the partitioning process. For example, the users create scripts, the programs or web applications which start filling up the disk. If that disk contains only 1 big partition, then entire system may stop functioning if that disk is full. If the users store data on separate partitions, then only that data partition can be affected, while system partitions and the possible other data partitions will keep functioning.
|
|
||||||
|
|
||||||
Mind that to have a journaled file system will only provide data security in case if there is a power failure as well as sudden disconnection of the storage devices. Such will not protect the data against the bad blocks and the logical errors in the file system. In such cases, the user should use a Redundant Array of Inexpensive Disks (RAID) solution.
|
|
||||||
|
|
||||||
### Why Switch File Systems? ###
|
|
||||||
|
|
||||||
The ext4 file system has been an improvement for the ext3 file system that was also an improvement over the ext2 file system. While the ext4 is a very solid file system which has been the default choice for almost all distributions for the past few years, it is made from an aging code base. Additionally, Linux operating system users are seeking many new different features in file systems which ext4 does not handle on its own. There is software which takes care of some of such needs, but in the performance aspect, being able to do such things on the file system level could be faster.
|
|
||||||
|
|
||||||
### Ext4 File System ###
|
|
||||||
|
|
||||||
The ext4 has some limits which are still a bit impressive. The maximum file size is 16 tebibytes (which is roughly 17.6 terabytes) and is much bigger than any hard drive a regular consumer can currently buy. While, the largest volume/partition you can make with ext4 is 1 exbibyte (which is roughly 1,152,921.5 terabytes). The ext4 is known to bring the speed improvements over ext3 by using multiple various techniques. Like in the most modern file systems, it is a journaling file system that means that it will keep a journal of where the files are mainly located on the disk and of any other changes that happen to the disk. Regardless all of its features, it doesn’t support the transparent compression, the data deduplication, or the transparent encryption. The snapshots are supported technically, but such feature is experimental at best.
|
|
||||||
|
|
||||||
### Btrfs File System ###
|
|
||||||
|
|
||||||
The btrfs, many of us pronounce it different ways, as an example, Better FS, Butter FS, or B-Tree FS. It is a file system which is completely made from scratch. The btrfs exists because its developers firstly wanted to expand the file system functionality in order to include snapshots, pooling, as well as checksums among the other things. While it is independent from the ext4, it also wants to build off the ideas present in the ext4 that are great for the consumers and the businesses alike as well as incorporate those additional features that will benefit everybody, but specifically the enterprises. For the enterprises who are using very large programs with very large databases, they are having a seemingly continuous file system across the multiple hard drives could be very beneficial as it will make a consolidation of the data much easier. The data deduplication could reduce the amount of the actual space data could occupy, and the data mirroring could become easier with the btrfs as well when there is a single and broad file system which needs to be mirrored.
|
|
||||||
|
|
||||||
The user certainly can still choose to create multiple partitions so that he does not need to mirror everything. Considering that the btrfs will be able for spanning over the multiple hard drives, it is a very good thing that it can support 16 times more drive space than the ext4. A maximum partition size of the btrfs file system is 16 exbibytes, as well as maximum file size is 16 exbibytes too.
|
|
||||||
|
|
||||||
### XFS File System ###
|
|
||||||
|
|
||||||
The XFS file system is an extension of the extent file system. The XFS is a high-performance 64-bit journaling file system. The support of the XFS was merged into Linux kernel in around 2002 and In 2009 Red Hat Enterprise Linux version 5.4 usage of the XFS file system. XFS supports maximum file system size of 8 exbibytes for the 64-bit file system. There is some comparison of XFS file system is XFS file system can’t be shrunk and poor performance with deletions of the large numbers of files. Now, the RHEL 7.0 uses XFS as the default filesystem.
|
|
||||||
|
|
||||||
### Final Thoughts ###
|
|
||||||
|
|
||||||
Unfortunately, the arrival date for the btrfs is not quite known. But officially, the next-generation file system is still classified as “unstable”, but if the user downloads the latest version of Ubuntu, he will be able to choose to install on a btrfs partition. When the btrfs will be classified actually as “stable” is still a mystery, but users shouldn’t expect the Ubuntu to use the btrfs by default until it’s indeed considered “stable”. It has been reported that Fedora 18 will use the btrfs as its default file system as by the time of its release a file system checker for the btrfs should exist. There is a good amount of work still left for the btrfs, as not all the features are yet implemented and the performance is a little sluggish if we compare it to the ext4.
|
|
||||||
|
|
||||||
So, which is better to use? Till now, the ext4 will be the winner despite the identical performance. But why? The answer will be the convenience as well as the ubiquity. The ext4 is still excellent file system for the desktop or workstation use. It is provided by default, so the user can install the operating system on it. Also, the ext4 supports volumes up to 1 Exabyte and files up to 16 Terabyte in size, so there’s still a plenty of room for the growth where space is concerned.
|
|
||||||
|
|
||||||
The btrfs might offer greater volumes up to 16 Exabyte and improved fault tolerance, but, till now, it feels more as an add-on file system rather than one integrated into the Linux operating system. For example, the btrfs-tools have to be present before a drive will be formatted with the btrfs, which means that the btrfs is not an option during the Linux operating system installation though that could vary with the distribution.
|
|
||||||
|
|
||||||
Even though the transfer rates are so important, there’s more to a just file system than speed of the file transfers. The btrfs has many useful features such as Copy-on-Write (CoW), extensive checksums, snapshots, scrubbing, self-healing data, deduplication, as well as many more good improvements that ensure the data integrity. The btrfs lacks the RAID-Z features of ZFS, so the RAID is still in an experimental state with the btrfs. For pure data storage, however, the btrfs is the winner over the ext4, but time still will tell.
|
|
||||||
|
|
||||||
Till the moment, the ext4 seems to be a better choice on the desktop system since it is presented as a default file system, as well as it is faster than the btrfs when transferring files. The btrfs is definitely worth to look into, but to completely switch to replace the ext4 on desktop Linux might be few years later. The data farms and the large storage pools could reveal different stories and show the right differences between ext4, XCF, and btrfs.
|
|
||||||
|
|
||||||
If you have a different or additional opinion, kindly let us know by commenting on this article.
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: http://www.unixmen.com/review-ext4-vs-btrfs-vs-xfs/
|
|
||||||
|
|
||||||
作者:[M.el Khamlichi][a]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]:http://www.unixmen.com/author/pirat9/
|
|
@ -1,204 +0,0 @@
|
|||||||
name1e5s translating
|
|
||||||
Gaming On Linux: All You Need To Know
|
|
||||||
================================================================================
|
|
||||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Gaming-on-Linux.jpeg)
|
|
||||||
|
|
||||||
**Can I play games on Linux?**
|
|
||||||
|
|
||||||
This is one of the most frequently asked questions by people who are thinking about [switching to Linux][1]. After all, gaming on Linux often termed as a distant possibility. In fact, some people even wonder if they can listen to music or watch movies on Linux. Considering that, question about native Linux games seem genuine.
|
|
||||||
|
|
||||||
In this article, I am going to answer most of the Linux gaming questions a Linux beginner may have. For example, if it is possible to play games on Linux, if yes, what are the Linux games available, where can you **download Linux games** from or how do you get more information of gaming on Linux.
|
|
||||||
|
|
||||||
But before I do that, let me make a confession. I am not a PC gamer or rather I should say, I am not desktop Linux gamer. I prefer to play games on my PS4 and I don’t care about PC games or even mobile games (no candy crush request sent to anyone in my friend list). This is the reason you see only a few articles in [Linux games][2] section of It’s FOSS.
|
|
||||||
|
|
||||||
So why am I covering this topic then?
|
|
||||||
|
|
||||||
Because I have been asked questions about playing games on Linux several times and I wanted to come up with a Linux gaming guide that could answer all those question. And remember, it’s not just gaming on Ubuntu I am talking about here. I am talking about Linux in general.
|
|
||||||
|
|
||||||
### Can you play games on Linux? ###
|
|
||||||
|
|
||||||
Yes and no!
|
|
||||||
|
|
||||||
Yes, you can play games on Linux and no, you cannot play ‘all the games’ in Linux.
|
|
||||||
|
|
||||||
Confused? Don’t be. What I meant here is that you can get plenty of popular games on Linux such as [Counter Strike, Metro Last Night][3] etc. But you might not get all the latest and popular Windows games on Linux, for e.g., [PES 2015][4].
|
|
||||||
|
|
||||||
The reason, in my opinion, is that Linux has less than 2% of desktop market share and these numbers are demotivating enough for most game developers to avoid working on the Linux version of their games.
|
|
||||||
|
|
||||||
Which means that there is huge possibility that the most talked about games of the year may not be playable in Linux. Don’t despair, there are ‘other means’ to get these games on Linux and we shall see it in coming sections, but before that let’s talk about what kind of games are available for Linux.
|
|
||||||
|
|
||||||
If I have to categorize, I’ll divide them in four categories:
|
|
||||||
|
|
||||||
1. Native Linux Games
|
|
||||||
1. Windows games in Linux
|
|
||||||
1. Browser Games
|
|
||||||
1. Terminal Games
|
|
||||||
|
|
||||||
Let’s start with the most important one, native Linux games, first.
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
### 1. Where to find native Linux games? ###
|
|
||||||
|
|
||||||
Native Linux games mean those games which are officially supported in Linux. These games have native Linux client and can be installed like most other applications in Linux without requiring any additional effort (we’ll see about these in next section).
|
|
||||||
|
|
||||||
So, as you see, there are games developed for Linux. Next question that arises is where can you find these Linux games and how can you play them. I am going to list some of the resources where you can get Linux games.
|
|
||||||
|
|
||||||
#### Steam ####
|
|
||||||
|
|
||||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/09/Install-Steam-Ubuntu-11.jpeg)
|
|
||||||
|
|
||||||
“[Steam][5] is a digital distribution platform for video games. As Amazon Kindle is digital distribution platform for e-Books, iTunes for music, similarly Steam is for games. It provides you the option to buy and install games, play multiplayer and stay in touch with other games via social networking on its platform. The games are protected with [DRM][6].”
|
|
||||||
|
|
||||||
A couple of years ago, when gaming platform Steam announced support for Linux, it was a big news. It was an indication that gaming on Linux is being taken seriously. Though Steam’s decision was more influenced with its own Linux-based gaming console and a separate [Linux distribution called Steam OS][7], it still was a reassuring move that has brought a number of games on Linux.
|
|
||||||
|
|
||||||
I have written a detailed article about installing and using Steam. If you are getting started with Steam, do read it.
|
|
||||||
|
|
||||||
- [Install and use Steam for gaming on Linux][8]
|
|
||||||
|
|
||||||
#### GOG.com ####
|
|
||||||
|
|
||||||
[GOG.com][9] is another platform similar to Steam. Like Steam, you can browse and find hundreds of native Linux games on GOG.com, purchase the games and install them. If the games support several platforms, you can download and use them across various operating systems. Your purchased games are available for you all the time in your account. You can download them anytime you wish.
|
|
||||||
|
|
||||||
One main difference between the two is that GOG.com offers only DRM free games and movies. Also, GOG.com is entirely web based. So you don’t need to install a client like Steam. You can simply download the games from browser and install them in your system.
|
|
||||||
|
|
||||||
#### Portable Linux Games ####
|
|
||||||
|
|
||||||
[Portable Linux Games][10] is a website that has a collection of a number of Linux games. The unique and best thing about Portable Linux Games is that you can download and store the games for offline installation.
|
|
||||||
|
|
||||||
The downloaded files have all the dependencies (at times Wine and Perl installation) and these are also platform independent. All you need to do is to download the files and double click to install them. Store the downloadable file on external hard disk and use them in future. Highly recommend if you don’t have continuous access to high speed internet.
|
|
||||||
|
|
||||||
#### Game Drift Game Store ####
|
|
||||||
|
|
||||||
[Game Drift][11] is actually a Linux distribution based on Ubuntu with sole focus on gaming. While you might not want to start using this Linux distribution for the sole purpose of gaming, you can always visit its game store online and see what games are available for Linux and install them.
|
|
||||||
|
|
||||||
#### Linux Game Database ####
|
|
||||||
|
|
||||||
As the name suggests, [Linux Game Database][12] is a website with a huge collection of Linux games. You can browse through various category of games and download/install them from the game developer’s website. As a member of Linux Game Database, you can even rate the games. LGDB, kind of, aims to be the IGN or IMDB for Linux games.
|
|
||||||
|
|
||||||
#### Penguspy ####
|
|
||||||
|
|
||||||
Created by a gamer who refused to use Windows for playing games, [Penguspy][13] showcases a collection of some of the best Linux games. You can browse games based on category and if you like the game, you’ll have to go to the respective game developer’s website.
|
|
||||||
|
|
||||||
#### Software Repositories ####
|
|
||||||
|
|
||||||
Look into the software repositories of your own Linux distribution. There always will be some games in it. If you are using Ubuntu, Ubuntu Software Center itself has an entire section for games. Same is true for other Linux distributions such as Linux Mint etc.
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
### 2. How to play Windows games in Linux? ###
|
|
||||||
|
|
||||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Wine-Linux.png)
|
|
||||||
|
|
||||||
So far we talked about native Linux games. But there are not many Linux games, or to be more precise, most popular Linux games are not available for Linux but they are available for Windows PC. So the questions arises, how to play Windows games in Linux?
|
|
||||||
|
|
||||||
Good thing is that with the help of tools like Wine, PlayOnLinux and CrossOver, you can play a number of popular Windows games in Linux.
|
|
||||||
|
|
||||||
#### Wine ####
|
|
||||||
|
|
||||||
Wine is a compatibility layer which is capable of running Windows applications in systems like Linux, BSD and OS X. With the help of Wine, you can install and use a number of Windows applications in Linux.
|
|
||||||
|
|
||||||
[Installing Wine in Ubuntu][14] or any other Linux is easy as it is available in most Linux distributions’ repository. There is a huge [database of applications and games supported by Wine][15] that you can browse.
|
|
||||||
|
|
||||||
#### CrossOver ####
|
|
||||||
|
|
||||||
[CrossOver][16] is an improved version of Wine that brings professional and technical support to Wine. But unlike Wine, CrossOver is not free. You’ll have to purchase the yearly license for it. Good thing about CrossOver is that every purchase contributes to Wine developers and that in fact boosts the development of Wine to support more Windows games and applications. If you can afford $48 a year, you should buy CrossOver for the support they provide.
|
|
||||||
|
|
||||||
### PlayOnLinux ###
|
|
||||||
|
|
||||||
PlayOnLinux too is based on Wine but implemented differently. It has different interface and slightly easier to use than Wine. Like Wine, PlayOnLinux too is free to use. You can browse the [applications and games supported by PlayOnLinux on its database][17].
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
### 3. Browser Games ###
|
|
||||||
|
|
||||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Chrome-Web-Store.jpeg)
|
|
||||||
|
|
||||||
Needless to say that there are tons of browser based games that are available to play in any operating system, be it Windows or Linux or Mac OS X. Most of the addictive mobile games, such as [GoodGame Empire][18], also have their web browser counterparts.
|
|
||||||
|
|
||||||
Apart from that, thanks to [Google Chrome Web Store][19], you can play some more games in Linux. These Chrome games are installed like a standalone app and they can be accessed from the application menu of your Linux OS. Some of these Chrome games are playable offline as well.
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
### 4. Terminal Games ###
|
|
||||||
|
|
||||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/03/nSnake_Linux_terminal_game.jpeg)
|
|
||||||
|
|
||||||
Added advantage of using Linux is that you can use the command line terminal to play games. I know that it’s not the best way to play games but at times, it’s fun to play games like [Snake][20] or [2048][21] in terminal. There is a good collection of Linux terminal games at [this blog][22]. You can browse through it and play the ones you want.
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
### How to stay updated about Linux games? ###
|
|
||||||
|
|
||||||
When you have learned a lot about what kind of games are available on Linux and how could you use them, next question is how to stay updated about new games on Linux? And for that, I advise you to follow these blogs that provide you with the latest happenings of the Linux gaming world:
|
|
||||||
|
|
||||||
- [Gaming on Linux][23]: I won’t be wrong if I call it the nest Linux gaming news portal. You get all the latest rumblings and news about Linux games. Frequently updated, Gaming on Linux has dedicated fan following which makes it a nice community of Linux game lovers.
|
|
||||||
- [Free Gamer][24]: A blog focusing on free and open source games.
|
|
||||||
- [Linux Game News][25]: A Tumbler blog that updates on various Linux games.
|
|
||||||
|
|
||||||
#### What else? ####
|
|
||||||
|
|
||||||
I think that’s pretty much what you need to know to get started with gaming on Linux. If you are still not convinced, I would advise you to [dual boot Linux with Windows][26]. Use Linux as your main desktop and if you want to play games, boot into Windows. This could be a compromised solution.
|
|
||||||
|
|
||||||
I think that’s pretty much what you need to know to get started with gaming on Linux. If you are still not convinced, I would advise you to [dual boot Linux with Windows][27]. Use Linux as your main desktop and if you want to play games, boot into Windows. This could be a compromised solution.
|
|
||||||
|
|
||||||
It’s time for you to add your inputs. Do you play games on your Linux desktop? What are your favorites? What blogs you follow to stay updated on latest Linux games?
|
|
||||||
|
|
||||||
|
|
||||||
投票项目:
|
|
||||||
How do you play games on Linux?
|
|
||||||
|
|
||||||
- I use Wine and PlayOnLinux along with native Linux Games
|
|
||||||
- I am happy with Browser Games
|
|
||||||
- I prefer the Terminal Games
|
|
||||||
- I use native Linux games only
|
|
||||||
- I play it on Steam
|
|
||||||
- I dual boot and go in to Windows to play games
|
|
||||||
- I don't play games at all
|
|
||||||
|
|
||||||
注:投票代码
|
|
||||||
<div class="PDS_Poll" id="PDI_container9132962" style="display:inline-block;"></div>
|
|
||||||
<div id="PD_superContainer"></div>
|
|
||||||
<script type="text/javascript" charset="UTF-8" src="http://static.polldaddy.com/p/9132962.js"></script>
|
|
||||||
<noscript><a href="http://polldaddy.com/poll/9132962">Take Our Poll</a></noscript>
|
|
||||||
|
|
||||||
注,发布时根据情况看怎么处理
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: http://itsfoss.com/linux-gaming-guide/
|
|
||||||
|
|
||||||
作者:[Abhishek][a]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]:http://itsfoss.com/author/abhishek/
|
|
||||||
[1]:http://itsfoss.com/reasons-switch-linux-windows-xp/
|
|
||||||
[2]:http://itsfoss.com/category/games/
|
|
||||||
[3]:http://blog.counter-strike.net/
|
|
||||||
[4]:https://pes.konami.com/tag/pes-2015/
|
|
||||||
[5]:http://store.steampowered.com/
|
|
||||||
[6]:https://en.wikipedia.org/wiki/Digital_rights_management
|
|
||||||
[7]:http://itsfoss.com/valve-annouces-linux-based-gaming-operating-system-steamos/
|
|
||||||
[8]:http://itsfoss.com/install-steam-ubuntu-linux/
|
|
||||||
[9]:http://www.gog.com/
|
|
||||||
[10]:http://www.portablelinuxgames.org/
|
|
||||||
[11]:http://gamedrift.org/GameStore.html
|
|
||||||
[12]:http://www.lgdb.org/
|
|
||||||
[13]:http://www.penguspy.com/
|
|
||||||
[14]:http://itsfoss.com/wine-1-5-11-released-ppa-available-to-download/
|
|
||||||
[15]:https://appdb.winehq.org/
|
|
||||||
[16]:https://www.codeweavers.com/products/
|
|
||||||
[17]:https://www.playonlinux.com/en/supported_apps.html
|
|
||||||
[18]:http://empire.goodgamestudios.com/
|
|
||||||
[19]:https://chrome.google.com/webstore/category/apps
|
|
||||||
[20]:http://itsfoss.com/nsnake-play-classic-snake-game-linux-terminal/
|
|
||||||
[21]:http://itsfoss.com/play-2048-linux-terminal/
|
|
||||||
[22]:https://ttygames.wordpress.com/
|
|
||||||
[23]:https://www.gamingonlinux.com/
|
|
||||||
[24]:http://freegamer.blogspot.fr/
|
|
||||||
[25]:http://linuxgamenews.com/
|
|
||||||
[26]:http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/
|
|
||||||
[27]:http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/
|
|
@ -1,86 +0,0 @@
|
|||||||
alim0x translating
|
|
||||||
|
|
||||||
The history of Android
|
|
||||||
================================================================================
|
|
||||||
### Android 4.2, Jelly Bean—new Nexus devices, new tablet interface ###
|
|
||||||
|
|
||||||
The Android Platform was rapidly maturing, and with Google hosting more and more apps in the Play Store, there was less and less that needed to go out in the OS update. Still, the relentless march of updates must continue, and in November 2012 Android 4.2 was released. 4.2 was still called "Jelly Bean," a nod to the relatively small amount of changes that were present in this release.
|
|
||||||
|
|
||||||
![The LG-made Nexus 4 and Samsung-made Nexus 10.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/unnamed.jpg)
|
|
||||||
The LG-made Nexus 4 and Samsung-made Nexus 10.
|
|
||||||
Photo by Google/Ron Amadeo
|
|
||||||
|
|
||||||
Along with Android 4.2 came two flagship devices, the Nexus 4 and the Nexus 10, both of which were sold direct by Google on the Play Store. The Nexus 4 applied the Nexus 7 strategy of a quality device at a shockingly low price and sold for $300 unlocked. The Nexus 4 had a quad-core 1.5 GHz Snapdragon S4 Pro, 2GB of RAM and a 4.7-inch 1280×768 LCD. Google's new flagship phone was manufactured by LG, and with the manufacturer switch came a focus on materials and build quality. The Nexus 4 had a glass front and back, and while you couldn't drop it, it was one of the nicest-feeling Android phones to date. The biggest downside to the Nexus 4 was the lack of LTE at a time when most phones, including the Verizon Galaxy Nexus, came with the faster modem. Still, demand for the Nexus 4 greatly exceeded Google's expectations—the launch rush crashed the Play Store Web site on launch day. The device sold out in under an hour.
|
|
||||||
|
|
||||||
The Nexus 10 was Google's first 10-inch Nexus tablet. The highlight of the device was the 2560×1600 display, which was the highest resolution in its class. All those pixels were powered by a dual core, 1.7GHz Cortex A15 processor and 2GB of RAM. With each passing month, it's looking more and more like the Nexus 10 is the first and last 10-inch Nexus tablet. Usually these devices are upgraded every year, but the Nexus 10 is now 16 months old, and there's no sign of the new model on the horizon. Google is doing well with smaller-sized 7-inch tablets, and it seems content to let partners [like Samsung][1] explore the larger end of the tablet spectrum.
|
|
||||||
|
|
||||||
![The new lock screen, wallpaper, and clock widget design.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/JBvsjb.jpg)
|
|
||||||
The new lock screen, wallpaper, and clock widget design.
|
|
||||||
Photo by Ron Amadeo
|
|
||||||
|
|
||||||
4.2 brought lots of changes to the lock screen. The font was centered and used an extremely thick weight for the hour and a thin font for the minutes. The lock screen was now paginated and could be customized with widgets. Rather than a simple clock on the lock screen, users could replace it with another widget or add extra pages to the lock screen for more widgets.
|
|
||||||
|
|
||||||
![The lock screen's add widget page, the list of widgets, the Gmail widget on the lock screen, and swiping over to the camera.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/locksc2reen.jpg)
|
|
||||||
The lock screen's add widget page, the list of widgets, the Gmail widget on the lock screen, and swiping over to the camera.
|
|
||||||
Photo by Ron Amadeo
|
|
||||||
|
|
||||||
The lock screen now worked like a stripped-down version of the home screen. Page outlines would pop up on the left and right sides of the lock screen to hint to users that they could swipe to other pages with other widgets. Swiping to the left would show a simple blank page with a plus sign in the center, and tapping on it would bring up a list of widgets that were compatible with the lock screen. Lock screens were limited to one widget per page and could be expanded or collapsed by dragging up or down on the widget. The right-most page was reserved for the camera—a simple over would open the camera interface, but you weren't able to swipe back.
|
|
||||||
|
|
||||||
![The new Quick Settings panel and a composite image of the app lineup.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/42fix.png)
|
|
||||||
The new Quick Settings panel and a composite image of the app lineup.
|
|
||||||
Photo by Ron Amadeo
|
|
||||||
|
|
||||||
One of the biggest additions to 4.2 was the new "Quick Settings" panel. Android 3.0 brought a way to quickly change power settings to tablets, and 4.2 finally brought that ability to phones. A new icon was added to the top right corner of the notification panel that would switch between the normal list of notifications and the new quick settings screen. Quick Settings offered faster access to screen brightness, network connections, and battery and data usage without having to dig through the full settings screen. The top level settings button in Android 4.1 was removed, and a square was added to the Quick Settings screen for it.
|
|
||||||
|
|
||||||
There were lots of changes to the app drawer and 4.2's lineup of apps and icons. Thanks to the wider aspect ratio of the Nexus 4 (5:3 vs 16:9 on the Galaxy Nexus), the app drawer on that device could now show a five-wide grid of icons. 4.2 replaced the stock browser with Google Chrome and the stock calendar with Google Calendar, both of which brought new icon designs. The Clock and Camera apps were revamped in 4.2, and new icons were part of the deal. "Google Settings" was a new app that offered shortcuts to all the existing Google Account settings around the OS, and it had a unified look with Google Search and the new Google+ icon. Google Maps got a new icon, and Google Latitude, which was part of Google Maps, was retired in favor of Google+ location.
|
|
||||||
|
|
||||||
![The browser was replaced with Chrome, and the new camera interface with a full screen viewfinder.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/chroemcam.jpg)
|
|
||||||
The browser was replaced with Chrome, and the new camera interface with a full screen viewfinder.
|
|
||||||
Photo by Ron Amadeo
|
|
||||||
|
|
||||||
The stock browser did its best Chrome imitation for a while—it took many cues from Chrome’s interface, many Chrome features, and was even using Chrome’s javascript engine—but by the time Android 4.2 rolled around, Google deemed the Android version of Chrome ready to replace the imitator. On the surface, it didn't seem like much of a difference; the interface looked different, and early versions of Chrome for Android didn't scroll as smoothly as the stock browser. Under the hood, though, everything was different. Development of Android's main browser was now handled by the Google Chrome team instead of being a side project of the Android team. Android's default browser moved from being a stagnant app tied to Android releases to a Play Store app that was continually updated. Today there is even a beta channel that receives several updates per month.
|
|
||||||
|
|
||||||
The camera interface was redesigned. It was now a completely full-screen app, showing a live view of the camera and places controls on top of it. The layout aesthetic had a lot in common with the [camera design][2] of Android 1.5: minimal controls with a focus on the viewfinder output. The circle of controls in the center appeared when you either held your finger on the screen or pressed the circle icon in the bottom right corner. When holding your finger down, you could slide around to pick the options around the circle, often expanding out into a sub-menu. Releasing over a highlighted item would select it. This was clearly inspired by the Quick Controls in the Android 4.0 browser, but arranging the options in a circle meant your finger was almost always blocking part of the interface.
|
|
||||||
|
|
||||||
![The clock app, which went from a two-screen app to a feature-packed, useful application.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/clock-1.jpg)
|
|
||||||
The clock app, which went from a two-screen app to a feature-packed, useful application.
|
|
||||||
Photo by Ron Amadeo
|
|
||||||
|
|
||||||
The clock application was completely revamped, going from a simple two-screen alarm clock to a world clock, alarm, timer, and stopwatch. The clock app design was like nothing Google introduced before, with an ultra-minimal aesthetic and red highlights. It seemed to be an experiment for Google. Even several versions later, this design language seemed to be confined only to this app.
|
|
||||||
|
|
||||||
The clock's time picker was particularly well-designed. It showed a simple number pad, and it would intelligently disable numbers that would result in an invalid time. It was also impossible to set an alarm time without implicitly selecting AM or PM, forever solving the problem of accidentally setting an alarm for 9pm instead of 9am.
|
|
||||||
|
|
||||||
![The new system UI for tablets used a stretched-out phone interface.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/tablet2.jpg)
|
|
||||||
The new system UI for tablets used a stretched-out phone interface.
|
|
||||||
Photo by Ron Amadeo
|
|
||||||
|
|
||||||
The most controversial change in Android 4.2 was made to the tablet UI, which switched from a unified single bottom system bar to a two-bar interface with a top status bar and bottom system bar. The new design unified the phone and tablet interfaces, but critics said it was a waste of space to stretch the phone interface to a 10-inch landscape tablet. Since the navigation buttons had the whole bottom bar to themselves now, they were centered, just like the phone interface.
|
|
||||||
|
|
||||||
![Multiple users on a tablet, and the new gesture-driven keyboard.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/2014-03-06-14.55.png)
|
|
||||||
Multiple users on a tablet, and the new gesture-driven keyboard.
|
|
||||||
Photo by Ron Amadeo
|
|
||||||
|
|
||||||
On tablets, Android 4.2 brought support for multiple users. In the settings, a "Users" section was added, where you could manage users on a device. Setup was done from within each user account, where Android would keep separate settings, home screens, apps, and app data for each user.
|
|
||||||
|
|
||||||
4.2 also added a new keyboard with swiping abilities. Rather than just tapping each individual letter, users could now keep a finger on the screen the whole time and just slide from letter to letter to type.
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg)
|
|
||||||
|
|
||||||
[Ron Amadeo][a] / Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work.
|
|
||||||
|
|
||||||
[@RonAmadeo][t]
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/22/
|
|
||||||
|
|
||||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[1]:http://arstechnica.com/gadgets/2014/01/hands-on-with-samsungs-notepro-and-tabpro-new-screen-sizes-and-magazine-ui/
|
|
||||||
[2]:http://cdn.arstechnica.net/wp-content/uploads/2013/12/device-2013-12-26-11016071.png
|
|
||||||
[a]:http://arstechnica.com/author/ronamadeo
|
|
||||||
[t]:https://twitter.com/RonAmadeo
|
|
@ -1,96 +0,0 @@
|
|||||||
5 great Raspberry Pi projects for the classroom
|
|
||||||
================================================================================
|
|
||||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png)
|
|
||||||
|
|
||||||
Image by : opensource.com
|
|
||||||
|
|
||||||
### 1. Minecraft Pi ###
|
|
||||||
|
|
||||||
Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0.][1]
|
|
||||||
|
|
||||||
Minecraft is the favorite game of pretty much every teenager in the world—and it's one of the most creative games ever to capture the attention of young people. The version that comes with every Raspberry Pi is not only a creative thinking building game, but comes with a programming interface allowing for additional interaction with the Minecraft world through Python code.
|
|
||||||
|
|
||||||
Minecraft: Pi Edition is a great way for teachers to engage students with problem solving and writing code to perform tasks. You can use the Python API to build a house and have it follow you wherever you go, build a bridge wherever you walk, make it rain lava, show the temperature in the sky, and anything else your imagination can create.
|
|
||||||
|
|
||||||
Read more in "[Getting Started with Minecraft Pi][2]."
|
|
||||||
|
|
||||||
### 2. Reaction game and traffic lights ###
|
|
||||||
|
|
||||||
![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg)
|
|
||||||
|
|
||||||
Courtesy of [Low Voltage Labs][3]. [CC BY-SA 4.0][1].
|
|
||||||
|
|
||||||
It's really easy to get started with physical computing on Raspberry Pi—just connect up LEDs and buttons to the GPIO pins, and with a few lines of code you can turn lights on and control things with button presses. Once you know the code to do the basics, it's down to your imagination as to what you do next!
|
|
||||||
|
|
||||||
If you know how to flash one light, you can flash three. Pick out three LEDs in traffic light colors and you can code the traffic light sequence. If you know how to use a button to a trigger an event, then you have a pedestrian crossing! Also look out for great pre-built traffic light add-ons like [PI-TRAFFIC][4], [PI-STOP][5], [Traffic HAT][6], and more.
|
|
||||||
|
|
||||||
It's not always about the code—this can be used as an exercise in understanding how real world systems are devised. Computational thinking is a useful skill in any walk of life.
|
|
||||||
|
|
||||||
![](https://opensource.com/sites/default/files/reaction-game.png)
|
|
||||||
|
|
||||||
Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0][1].
|
|
||||||
|
|
||||||
Next, try wiring up two buttons and an LED and making a two-player reaction game—let the light come on after a random amount of time and see who can press the button first!
|
|
||||||
|
|
||||||
To learn more, check out "[GPIO Zero recipes][7]. Everything you need is in [CamJam EduKit 1][8].
|
|
||||||
|
|
||||||
### 3. Sense HAT Pixel Pet ###
|
|
||||||
|
|
||||||
The Astro Pi—an augmented Raspberry Pi—is going to space this December, but you haven't missed your chance to get your hands on the hardware. The Sense HAT is the sensor board add-on used in the Astro Pi mission and it's available for anyone to buy. You can use it for data collection, science experiments, games and more. Watch this Gurl Geek Diaries video from Raspberry Pi's Carrie Anne for a great way to get started—by bringing to life an animated pixel pet of your own design on the Sense HAT display:
|
|
||||||
|
|
||||||
注:youtube 视频
|
|
||||||
<iframe width="520" height="315" frameborder="0" src="https://www.youtube.com/embed/gfRDFvEVz-w" allowfullscreen=""></iframe>
|
|
||||||
|
|
||||||
Learn more in "[Exploring the Sense HAT][9]."
|
|
||||||
|
|
||||||
### 4. Infrared bird box ###
|
|
||||||
|
|
||||||
![](https://opensource.com/sites/default/files/ir-bird-box.png)
|
|
||||||
Courtesy of the Raspberry Pi Foundation. [CC BY-SA 4.0.][1]
|
|
||||||
|
|
||||||
A great exercise for the whole class to get involved with—place a Raspberry Pi and the NoIR camera module inside a bird box along with some infra-red lights so you can see in the dark, then stream video from the Pi over the network or on the internet. Wait for birds to nest and you can observe them without disturbing them in their habitat.
|
|
||||||
|
|
||||||
Learn all about infrared and the light spectrum, and how to adjust the camera focus and control the camera in software.
|
|
||||||
|
|
||||||
Learn more in "[Make an infrared bird box.][10]"
|
|
||||||
|
|
||||||
### 5. Robotics ###
|
|
||||||
|
|
||||||
![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg)
|
|
||||||
|
|
||||||
Courtesy of Low Voltage Labs. [CC BY-SA 4.0][1].
|
|
||||||
|
|
||||||
With a Raspberry Pi and as little as a couple of motors and a motor controller board, you can build your own robot. There is a vast range of robots you can make, from basic buggies held together by sellotape and a homemade chassis, all the way to self-aware, sensor-laden metallic stallions with camera attachments driven by games controllers.
|
|
||||||
|
|
||||||
Learn how to control individual motors with something straightforward like the RTK Motor Controller Board (£8/$12), or dive into the new CamJam robotics kit (£17/$25) which comes with motors, wheels and a couple of sensors—great value and plenty of learning potential.
|
|
||||||
|
|
||||||
Alternatively, if you'd like something more hardcore, try PiBorg's [4Borg][11] (£99/$150) or [DiddyBorg][12] (£180/$273) or go the whole hog and treat yourself to their DoodleBorg Metal edition (£250/$380)—and build a mini version of their infamous [DoodleBorg tank][13] (unfortunately not for sale).
|
|
||||||
|
|
||||||
Check out the [CamJam robotics kit worksheets][14].
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://opensource.com/education/15/12/5-great-raspberry-pi-projects-classroom
|
|
||||||
|
|
||||||
作者:[Ben Nuttall][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/bennuttall
|
|
||||||
[1]:https://creativecommons.org/licenses/by-sa/4.0/
|
|
||||||
[2]:https://opensource.com/life/15/5/getting-started-minecraft-pi
|
|
||||||
[3]:http://lowvoltagelabs.com/
|
|
||||||
[4]:http://lowvoltagelabs.com/products/pi-traffic/
|
|
||||||
[5]:http://4tronix.co.uk/store/index.php?rt=product/product&product_id=390
|
|
||||||
[6]:https://ryanteck.uk/hats/1-traffichat-0635648607122.html
|
|
||||||
[7]:http://pythonhosted.org/gpiozero/recipes/
|
|
||||||
[8]:http://camjam.me/?page_id=236
|
|
||||||
[9]:https://opensource.com/life/15/10/exploring-raspberry-pi-sense-hat
|
|
||||||
[10]:https://www.raspberrypi.org/learning/infrared-bird-box/
|
|
||||||
[11]:https://www.piborg.org/4borg
|
|
||||||
[12]:https://www.piborg.org/diddyborg
|
|
||||||
[13]:https://www.piborg.org/doodleborg
|
|
||||||
[14]:http://camjam.me/?page_id=1035#worksheets
|
|
@ -1,3 +1,4 @@
|
|||||||
|
translated by bestony
|
||||||
How to Install OsTicket Ticketing System in Fedora 22 / Centos 7
|
How to Install OsTicket Ticketing System in Fedora 22 / Centos 7
|
||||||
================================================================================
|
================================================================================
|
||||||
In this article, we'll learn how to setup help desk ticketing system with osTicket in our machine or server running Fedora 22 or CentOS 7 as operating system. osTicket is a free and open source popular customer support ticketing system developed and maintained by [Enhancesoft][1] and its contributors. osTicket is the best solution for help and support ticketing system and management for better communication and support assistance with clients and customers. It has the ability to easily integrate with inquiries created via email, phone and web based forms into a beautiful multi-user web interface. osTicket makes us easy to manage, organize and log all our support requests and responses in one single place. It is a simple, lightweight, reliable, open source, web-based and easy to setup and use help desk ticketing system.
|
In this article, we'll learn how to setup help desk ticketing system with osTicket in our machine or server running Fedora 22 or CentOS 7 as operating system. osTicket is a free and open source popular customer support ticketing system developed and maintained by [Enhancesoft][1] and its contributors. osTicket is the best solution for help and support ticketing system and management for better communication and support assistance with clients and customers. It has the ability to easily integrate with inquiries created via email, phone and web based forms into a beautiful multi-user web interface. osTicket makes us easy to manage, organize and log all our support requests and responses in one single place. It is a simple, lightweight, reliable, open source, web-based and easy to setup and use help desk ticketing system.
|
||||||
|
@ -1,156 +0,0 @@
|
|||||||
How to send email notifications using Gmail SMTP server on Linux
|
|
||||||
================================================================================
|
|
||||||
Suppose you want to configure a Linux app to send out email messages from your server or desktop. The email messages can be part of email newsletters, status updates (e.g., [Cachet][1]), monitoring alerts (e.g., [Monit][2]), disk events (e.g., [RAID mdadm][3]), and so on. While you can set up your [own outgoing mail server][4] to deliver messages, you can alternatively rely on a freely available public SMTP server as a maintenance-free option.
|
|
||||||
|
|
||||||
One of the most reliable **free SMTP servers** is from Google's Gmail service. All you have to do to send email notifications within your app is to add Gmail's SMTP server address and your credentials to the app, and you are good to go.
|
|
||||||
|
|
||||||
One catch with using Gmail's SMTP server is that there are various restrictions in place, mainly to combat spammers and email marketers who often abuse the server. For example, you can send messages to no more than 100 addresses at once, and no more than 500 recipients per day. Also, if you don't want to be flagged as a spammer, you cannot send a large number of undeliverable messages. When any of these limitations is reached, your Gmail account will temporarily be locked out for a day. In short, Gmail's SMTP server is perfectly fine for your personal use, but not meant for commercial bulk emails.
|
|
||||||
|
|
||||||
With that being said, let me demonstrate **how to use Gmail's SMTP server in Linux environment**.
|
|
||||||
|
|
||||||
### Google Gmail SMTP Server Setting ###
|
|
||||||
|
|
||||||
If you want to send emails from your app using Gmail's SMTP server, remember the following details.
|
|
||||||
|
|
||||||
- **Outgoing mail server (SMTP server)**: smtp.gmail.com
|
|
||||||
- **Use authentication**: yes
|
|
||||||
- **Use secure connection**: yes
|
|
||||||
- **Username**: your Gmail account ID (e.g., "alice" if your email is alice@gmail.com)
|
|
||||||
- **Password**: your Gmail password
|
|
||||||
- **Port**: 587
|
|
||||||
|
|
||||||
Exact configuration syntax may vary depending on apps. In the rest of this tutorial, I will show you several useful examples of using Gmail SMTP server in Linux.
|
|
||||||
|
|
||||||
### Send Emails from the Command Line ###
|
|
||||||
|
|
||||||
As the first example, let's try the most basic email functionality: send an email from the command line using Gmail SMTP server. For this, I am going to use a command-line email client called mutt.
|
|
||||||
|
|
||||||
First, install mutt:
|
|
||||||
|
|
||||||
For Debian-based system:
|
|
||||||
|
|
||||||
$ sudo apt-get install mutt
|
|
||||||
|
|
||||||
For Red Hat based system:
|
|
||||||
|
|
||||||
$ sudo yum install mutt
|
|
||||||
|
|
||||||
Create a mutt configuration file (~/.muttrc) and specify in the file Gmail SMTP server information as follows. Replace <gmail-id> with your own Gmail ID. Note that this configuration is for sending emails only (not receiving emails).
|
|
||||||
|
|
||||||
$ vi ~/.muttrc
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
set from = "<gmail-id>@gmail.com"
|
|
||||||
set realname = "Dan Nanni"
|
|
||||||
set smtp_url = "smtp://<gmail-id>@smtp.gmail.com:587/"
|
|
||||||
set smtp_pass = "<gmail-password>"
|
|
||||||
|
|
||||||
Now you are ready to send out an email using mutt:
|
|
||||||
|
|
||||||
$ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com
|
|
||||||
|
|
||||||
To attach a file in an email, use "-a" option:
|
|
||||||
|
|
||||||
$ echo "This is an email body." | mutt -s "This is an email subject" alice@yahoo.com -a ~/test_attachment.jpg
|
|
||||||
|
|
||||||
![](https://c1.staticflickr.com/1/770/22239850784_5fb0988075_c.jpg)
|
|
||||||
|
|
||||||
Using Gmail SMTP server means that the emails appear as sent from your Gmail account. In other words, a recepient will see your Gmail address as the sender's address. If you want to use your domain as the email sender, you need to use Gmail SMTP relay service instead.
|
|
||||||
|
|
||||||
### Send Email Notification When a Server is Rebooted ###
|
|
||||||
|
|
||||||
If you are running a [virtual private server (VPS)][5] for some critical website, one recommendation is to monitor VPS reboot activities. As a more practical example, let's consider how to set up email notifications for every reboot event on your VPS. Here I assume you are using systemd on your VPS, and show you how to create a custom systemd boot-time service for automatic email notifications.
|
|
||||||
|
|
||||||
First create the following script reboot_notify.sh which takes care of email notifications.
|
|
||||||
|
|
||||||
$ sudo vi /usr/local/bin/reboot_notify.sh
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "`hostname` was rebooted on `date`" | mutt -F /etc/muttrc -s "Notification on `hostname`" alice@yahoo.com
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
$ sudo chmod +x /usr/local/bin/reboot_notify.sh
|
|
||||||
|
|
||||||
In the script, I use "-F" option to specify the location of system-wide mutt configuration file. So don't forget to create /etc/muttrc file and populate Gmail SMTP information as described earlier.
|
|
||||||
|
|
||||||
Now let's create a custom systemd service as follows.
|
|
||||||
|
|
||||||
$ sudo mkdir -p /usr/local/lib/systemd/system
|
|
||||||
$ sudo vi /usr/local/lib/systemd/system/reboot-task.service
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
Description=Send a notification email when the server gets rebooted
|
|
||||||
DefaultDependencies=no
|
|
||||||
Before=reboot.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/usr/local/bin/reboot_notify.sh
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=reboot.target
|
|
||||||
|
|
||||||
Once the service file is created, enable and start the service.
|
|
||||||
|
|
||||||
$ sudo systemctl enable reboot-task
|
|
||||||
$ sudo systemctl start reboot-task
|
|
||||||
|
|
||||||
From now on, you will be receiving a notification email every time the VPS gets rebooted.
|
|
||||||
|
|
||||||
![](https://c1.staticflickr.com/1/608/22241452923_2ace9cde2e_c.jpg)
|
|
||||||
|
|
||||||
### Send Email Notification from Server Usage Monitoring ###
|
|
||||||
|
|
||||||
As a final example, let me present a real-world application called [Monit][6], which is a pretty useful server monitoring application. It comes with comprehensive [VPS][7] monitoring capabilities (e.g., CPU, memory, processes, file system), as well as email notification functions.
|
|
||||||
|
|
||||||
If you want to receive email notifications for any event on your VPS (e.g., server overload) generated by Monit, you can add the following SMTP information to Monit configuration file.
|
|
||||||
|
|
||||||
set mailserver smtp.gmail.com port 587
|
|
||||||
username "<your-gmail-ID>" password "<gmail-password>"
|
|
||||||
using tlsv12
|
|
||||||
|
|
||||||
set mail-format {
|
|
||||||
from: <your-gmail-ID>@gmail.com
|
|
||||||
subject: $SERVICE $EVENT at $DATE on $HOST
|
|
||||||
message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION.
|
|
||||||
|
|
||||||
Yours sincerely,
|
|
||||||
Monit
|
|
||||||
}
|
|
||||||
|
|
||||||
# the person who will receive notification emails
|
|
||||||
set alert alice@yahoo.com
|
|
||||||
|
|
||||||
Here is the example email notification sent by Monit for excessive CPU load.
|
|
||||||
|
|
||||||
![](https://c1.staticflickr.com/1/566/22873764251_8fe66bfd16_c.jpg)
|
|
||||||
|
|
||||||
### Conclusion ###
|
|
||||||
|
|
||||||
As you can imagine, there will be so many different ways to take advantage of free SMTP servers like Gmail. But once again, remember that the free SMTP server is not meant for commercial usage, but only for your own personal project. If you are using Gmail SMTP server inside any app, feel free to share your use case.
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: http://xmodulo.com/send-email-notifications-gmail-smtp-server-linux.html
|
|
||||||
|
|
||||||
作者:[Dan Nanni][a]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]:http://xmodulo.com/author/nanni
|
|
||||||
[1]:http://xmodulo.com/setup-system-status-page.html
|
|
||||||
[2]:http://xmodulo.com/server-monitoring-system-monit.html
|
|
||||||
[3]:http://xmodulo.com/create-software-raid1-array-mdadm-linux.html
|
|
||||||
[4]:http://xmodulo.com/mail-server-ubuntu-debian.html
|
|
||||||
[5]:http://xmodulo.com/go/digitalocean
|
|
||||||
[6]:http://xmodulo.com/server-monitoring-system-monit.html
|
|
||||||
[7]:http://xmodulo.com/go/digitalocean
|
|
@ -1,202 +0,0 @@
|
|||||||
【Translating By cposture 2016-02-26】
|
|
||||||
Data Structures in the Linux Kernel
|
|
||||||
================================================================================
|
|
||||||
|
|
||||||
Radix tree
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
As you already know linux kernel provides many different libraries and functions which implement different data structures and algorithms. In this part we will consider one of these data structures - [Radix tree](http://en.wikipedia.org/wiki/Radix_tree). There are two files which are related to `radix tree` implementation and API in the linux kernel:
|
|
||||||
|
|
||||||
* [include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h)
|
|
||||||
* [lib/radix-tree.c](https://github.com/torvalds/linux/blob/master/lib/radix-tree.c)
|
|
||||||
|
|
||||||
Lets talk about what a `radix tree` is. Radix tree is a `compressed trie` where a [trie](http://en.wikipedia.org/wiki/Trie) is a data structure which implements an interface of an associative array and allows to store values as `key-value`. The keys are usually strings, but any data type can be used. A trie is different from an `n-tree` because of its nodes. Nodes of a trie do not store keys; instead, a node of a trie stores single character labels. The key which is related to a given node is derived by traversing from the root of the tree to this node. For example:
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
+-----------+
|
|
||||||
| |
|
|
||||||
| " " |
|
|
||||||
| |
|
|
||||||
+------+-----------+------+
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
+----v------+ +-----v-----+
|
|
||||||
| | | |
|
|
||||||
| g | | c |
|
|
||||||
| | | |
|
|
||||||
+-----------+ +-----------+
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
+----v------+ +-----v-----+
|
|
||||||
| | | |
|
|
||||||
| o | | a |
|
|
||||||
| | | |
|
|
||||||
+-----------+ +-----------+
|
|
||||||
|
|
|
||||||
|
|
|
||||||
+-----v-----+
|
|
||||||
| |
|
|
||||||
| t |
|
|
||||||
| |
|
|
||||||
+-----------+
|
|
||||||
```
|
|
||||||
|
|
||||||
So in this example, we can see the `trie` with keys, `go` and `cat`. The compressed trie or `radix tree` differs from `trie` in that all intermediates nodes which have only one child are removed.
|
|
||||||
|
|
||||||
Radix tree in linux kernel is the datastructure which maps values to integer keys. It is represented by the following structures from the file [include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h):
|
|
||||||
|
|
||||||
```C
|
|
||||||
struct radix_tree_root {
|
|
||||||
unsigned int height;
|
|
||||||
gfp_t gfp_mask;
|
|
||||||
struct radix_tree_node __rcu *rnode;
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
This structure presents the root of a radix tree and contains three fields:
|
|
||||||
|
|
||||||
* `height` - height of the tree;
|
|
||||||
* `gfp_mask` - tells how memory allocations will be performed;
|
|
||||||
* `rnode` - pointer to the child node.
|
|
||||||
|
|
||||||
The first field we will discuss is `gfp_mask`:
|
|
||||||
|
|
||||||
Low-level kernel memory allocation functions take a set of flags as - `gfp_mask`, which describes how that allocation is to be performed. These `GFP_` flags which control the allocation process can have following values: (`GF_NOIO` flag) means sleep and wait for memory, (`__GFP_HIGHMEM` flag) means high memory can be used, (`GFP_ATOMIC` flag) means the allocation process has high-priority and can't sleep etc.
|
|
||||||
|
|
||||||
* `GFP_NOIO` - can sleep and wait for memory;
|
|
||||||
* `__GFP_HIGHMEM` - high memory can be used;
|
|
||||||
* `GFP_ATOMIC` - allocation process is high-priority and can't sleep;
|
|
||||||
|
|
||||||
etc.
|
|
||||||
|
|
||||||
The next field is `rnode`:
|
|
||||||
|
|
||||||
```C
|
|
||||||
struct radix_tree_node {
|
|
||||||
unsigned int path;
|
|
||||||
unsigned int count;
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
struct radix_tree_node *parent;
|
|
||||||
void *private_data;
|
|
||||||
};
|
|
||||||
struct rcu_head rcu_head;
|
|
||||||
};
|
|
||||||
/* For tree user */
|
|
||||||
struct list_head private_list;
|
|
||||||
void __rcu *slots[RADIX_TREE_MAP_SIZE];
|
|
||||||
unsigned long tags[RADIX_TREE_MAX_TAGS][RADIX_TREE_TAG_LONGS];
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
This structure contains information about the offset in a parent and height from the bottom, count of the child nodes and fields for accessing and freeing a node. This fields are described below:
|
|
||||||
|
|
||||||
* `path` - offset in parent & height from the bottom;
|
|
||||||
* `count` - count of the child nodes;
|
|
||||||
* `parent` - pointer to the parent node;
|
|
||||||
* `private_data` - used by the user of a tree;
|
|
||||||
* `rcu_head` - used for freeing a node;
|
|
||||||
* `private_list` - used by the user of a tree;
|
|
||||||
|
|
||||||
The two last fields of the `radix_tree_node` - `tags` and `slots` are important and interesting. Every node can contains a set of slots which are store pointers to the data. Empty slots in the linux kernel radix tree implementation store `NULL`. Radix trees in the linux kernel also supports tags which are associated with the `tags` fields in the `radix_tree_node` structure. Tags allow individual bits to be set on records which are stored in the radix tree.
|
|
||||||
|
|
||||||
Now that we know about radix tree structure, it is time to look on its API.
|
|
||||||
|
|
||||||
Linux kernel radix tree API
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
We start from the datastructure initialization. There are two ways to initialize a new radix tree. The first is to use `RADIX_TREE` macro:
|
|
||||||
|
|
||||||
```C
|
|
||||||
RADIX_TREE(name, gfp_mask);
|
|
||||||
````
|
|
||||||
|
|
||||||
As you can see we pass the `name` parameter, so with the `RADIX_TREE` macro we can define and initialize radix tree with the given name. Implementation of the `RADIX_TREE` is easy:
|
|
||||||
|
|
||||||
```C
|
|
||||||
#define RADIX_TREE(name, mask) \
|
|
||||||
struct radix_tree_root name = RADIX_TREE_INIT(mask)
|
|
||||||
|
|
||||||
#define RADIX_TREE_INIT(mask) { \
|
|
||||||
.height = 0, \
|
|
||||||
.gfp_mask = (mask), \
|
|
||||||
.rnode = NULL, \
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
At the beginning of the `RADIX_TREE` macro we define instance of the `radix_tree_root` structure with the given name and call `RADIX_TREE_INIT` macro with the given mask. The `RADIX_TREE_INIT` macro just initializes `radix_tree_root` structure with the default values and the given mask.
|
|
||||||
|
|
||||||
The second way is to define `radix_tree_root` structure by hand and pass it with mask to the `INIT_RADIX_TREE` macro:
|
|
||||||
|
|
||||||
```C
|
|
||||||
struct radix_tree_root my_radix_tree;
|
|
||||||
INIT_RADIX_TREE(my_tree, gfp_mask_for_my_radix_tree);
|
|
||||||
```
|
|
||||||
|
|
||||||
where:
|
|
||||||
|
|
||||||
```C
|
|
||||||
#define INIT_RADIX_TREE(root, mask) \
|
|
||||||
do { \
|
|
||||||
(root)->height = 0; \
|
|
||||||
(root)->gfp_mask = (mask); \
|
|
||||||
(root)->rnode = NULL; \
|
|
||||||
} while (0)
|
|
||||||
```
|
|
||||||
|
|
||||||
makes the same initialziation with default values as it does `RADIX_TREE_INIT` macro.
|
|
||||||
|
|
||||||
The next are two functions for inserting and deleting records to/from a radix tree:
|
|
||||||
|
|
||||||
* `radix_tree_insert`;
|
|
||||||
* `radix_tree_delete`;
|
|
||||||
|
|
||||||
The first `radix_tree_insert` function takes three parameters:
|
|
||||||
|
|
||||||
* root of a radix tree;
|
|
||||||
* index key;
|
|
||||||
* data to insert;
|
|
||||||
|
|
||||||
The `radix_tree_delete` function takes the same set of parameters as the `radix_tree_insert`, but without data.
|
|
||||||
|
|
||||||
The search in a radix tree implemented in two ways:
|
|
||||||
|
|
||||||
* `radix_tree_lookup`;
|
|
||||||
* `radix_tree_gang_lookup`;
|
|
||||||
* `radix_tree_lookup_slot`.
|
|
||||||
|
|
||||||
The first `radix_tree_lookup` function takes two parameters:
|
|
||||||
|
|
||||||
* root of a radix tree;
|
|
||||||
* index key;
|
|
||||||
|
|
||||||
This function tries to find the given key in the tree and return the record associated with this key. The second `radix_tree_gang_lookup` function have the following signature
|
|
||||||
|
|
||||||
```C
|
|
||||||
unsigned int radix_tree_gang_lookup(struct radix_tree_root *root,
|
|
||||||
void **results,
|
|
||||||
unsigned long first_index,
|
|
||||||
unsigned int max_items);
|
|
||||||
```
|
|
||||||
|
|
||||||
and returns number of records, sorted by the keys, starting from the first index. Number of the returned records will not be greater than `max_items` value.
|
|
||||||
|
|
||||||
And the last `radix_tree_lookup_slot` function will return the slot which will contain the data.
|
|
||||||
|
|
||||||
Links
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
* [Radix tree](http://en.wikipedia.org/wiki/Radix_tree)
|
|
||||||
* [Trie](http://en.wikipedia.org/wiki/Trie)
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://github.com/0xAX/linux-insides/edit/master/DataStructures/radix-tree.md
|
|
||||||
|
|
||||||
作者:[0xAX]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
|||||||
|
【Translating by cposture 2016-03-01】
|
||||||
* * *
|
* * *
|
||||||
|
|
||||||
# GCC-Inline-Assembly-HOWTO
|
# GCC-Inline-Assembly-HOWTO
|
||||||
|
@ -1,214 +0,0 @@
|
|||||||
[Translating] Haohong Wang
|
|
||||||
How to Setup Lighttpd Web server on Ubuntu 15.04 / CentOS 7
|
|
||||||
=================================================================================
|
|
||||||
|
|
||||||
Lighttpd is an open source web server which is secure, fast, compliant, and very flexible and is optimized for high-performance environments. It uses very low memory compared to other web servers , small CPU load and speed optimization making it popular among the server for its efficiency and speed. Its advanced feature-set (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and many more) makes lighttpd the perfect webserver-software for every server that suffers load problems.
|
|
||||||
|
|
||||||
Here are some simple easy setups on how we can setup Lighttpd web server on our machine running Ubuntu 15.04 or CentOS 7 linux distributions.
|
|
||||||
|
|
||||||
### Installing Lighttpd
|
|
||||||
|
|
||||||
#### Installing using Package Manager
|
|
||||||
|
|
||||||
Here, we'll install Lighttpd using package manager as its the easiest method to install it. So, we can simply run the following command under `sudo` mode in a terminal or console to install Lighttpd.
|
|
||||||
|
|
||||||
**CentOS 7**
|
|
||||||
|
|
||||||
As lighttpd is not available in the official repository of CentOS 7, we'll need to install epel additional repository to our system. To do so, we'll need to run the following `yum` command.
|
|
||||||
|
|
||||||
# yum install epel-release
|
|
||||||
|
|
||||||
Then, we'll gonna update our system and proceed towards the installation of lighttpd.
|
|
||||||
|
|
||||||
# yum update
|
|
||||||
# yum install lighttpd
|
|
||||||
|
|
||||||
![Install Lighttpd Centos](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-centos.png)
|
|
||||||
|
|
||||||
**Ubuntu 15.04**
|
|
||||||
|
|
||||||
Lighttpd is available on the official repository of Ubuntu 15.04 so, we'll simply update our local repository index and then go for the installation of lighttpd using `apt-get` command.
|
|
||||||
|
|
||||||
# apt-get update
|
|
||||||
# apt-get install lighttpd
|
|
||||||
|
|
||||||
![Install lighttpd ubuntu](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-ubuntu.png)
|
|
||||||
|
|
||||||
#### Installing from Source
|
|
||||||
|
|
||||||
If we wanna install lighttpd from the latest version of source code ie 1.4.39, we'll need to compile the source code and install it into our system. First of all, we'll need to install the dependencies required to compile it.
|
|
||||||
|
|
||||||
# cd /tmp/
|
|
||||||
# wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.39.tar.gz
|
|
||||||
|
|
||||||
After its downloaded, we'll need to extract it the tarball by running the following.
|
|
||||||
|
|
||||||
# tar -zxvf lighttpd-1.4.39.tar.gz
|
|
||||||
|
|
||||||
Then, we'll compile it by running the following commands.
|
|
||||||
|
|
||||||
# cd lighttpd-1.4.39
|
|
||||||
# ./configure
|
|
||||||
# make
|
|
||||||
|
|
||||||
**Note:** In this tutorial, we are installing lighttpd with its standard configuration. If you wanna configure beyond the standard configuration and want to install more features like support for SSL, `mod_rewrite`, `mod_redirect` then you can configure.
|
|
||||||
|
|
||||||
Once, its compiled, we'll install it in our system.
|
|
||||||
|
|
||||||
# make install
|
|
||||||
|
|
||||||
### Configuring Lighttpd
|
|
||||||
|
|
||||||
If we need to configure our lighttpd web server further as our requirements, we can make changes to the default configuration file ie `/etc/lighttpd/lighttpd.conf` . As wee'll go with the default configuration here in this tutorial, we'll not gonna make changes to it. If we had made any changes and we wanna check for errors in the config file, we'll need to run the following command.
|
|
||||||
|
|
||||||
# lighttpd -t -f /etc/lighttpd/lighttpd.conf
|
|
||||||
|
|
||||||
#### On CentOS 7
|
|
||||||
|
|
||||||
If we are running CentOS 7, we'll need to create a new directory for our webroot defined in our lighttpd's default configuration ie `/src/www/htdocs/` .
|
|
||||||
|
|
||||||
# mkdir -p /srv/www/htdocs/
|
|
||||||
|
|
||||||
Then, we'll copy the default welcome page from `/var/www/lighttpd/` directory to the above created directory.
|
|
||||||
|
|
||||||
# cp -r /var/www/lighttpd/* /srv/www/htdocs/
|
|
||||||
|
|
||||||
### Starting and Enabling Services
|
|
||||||
|
|
||||||
Now, we'll gonna restart our database server by executing the following `systemctl` command.
|
|
||||||
|
|
||||||
# systemctl start lighttpd
|
|
||||||
|
|
||||||
Then, we'll enable it to start automatically in every system boot.
|
|
||||||
|
|
||||||
# systemctl enable lighttpd
|
|
||||||
|
|
||||||
### Allowing Firewall
|
|
||||||
|
|
||||||
To allow our webpages or websites running lighttpd web server on the internet or inside the same network, we'll need to allow port 80 from the firewall program. As both CentOS 7 and Ubuntu 15.04 are shipped with systemd as the default init system, we will have firewalld installed as a firewall solution. To allow port 80 or http service, we'll need to run the following commands.
|
|
||||||
|
|
||||||
# firewall-cmd --permanent --add-service=http
|
|
||||||
success
|
|
||||||
# firewall-cmd --reload
|
|
||||||
success
|
|
||||||
|
|
||||||
### Accessing Web Server
|
|
||||||
|
|
||||||
As we have allowed port 80 which is the default port of lighttpd, we should be able to access lighttpd's welcome page by default. To do so, we'll need to point our browser to the ip address or domain of our machine running lighttpd according to our configuration. In this tutorial, we'll point our browser to [http://lighttpd.linoxide.com/](http://lighttpd.linoxide.com/) as we have pointed our sub-domain to its ip address. On doing so, we'll see the following welcome page in our browser.
|
|
||||||
|
|
||||||
![Lighttpd Welcome Page](http://blog.linoxide.com/wp-content/uploads/2016/02/lighttpd-welcome-page.png)
|
|
||||||
|
|
||||||
Further, we can add our website's files to the webroot directory and remove the default lighttpd's index file to make our static website live to the internet.
|
|
||||||
|
|
||||||
If we want to run our PHP application in our lighttpd webserver, we'll need to follow the following steps.
|
|
||||||
|
|
||||||
### Installing PHP5 Modules
|
|
||||||
|
|
||||||
Once our lighttpd is installed successfully, we'll need to install PHP and some PHP modules to run PHP5 scripts in our lighttpd web server.
|
|
||||||
|
|
||||||
#### On Ubuntu 15.04
|
|
||||||
|
|
||||||
# apt-get install php5 php5-cgi php5-fpm php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-mcrypt php5-memcache php-pear
|
|
||||||
|
|
||||||
#### On CentOS 7
|
|
||||||
|
|
||||||
# yum install php php-cgi php-fpm php-mysql php-curl php-gd php-intl php-pecl-imagick php-mcrypt php-memcache php-pear lighttpd-fastcgi
|
|
||||||
|
|
||||||
### Configuring Lighttpd with PHP
|
|
||||||
|
|
||||||
To make PHP work with lighttpd web server, we'll need to follow the following methods respect to the distribution we are running.
|
|
||||||
|
|
||||||
#### On CentOS 7
|
|
||||||
|
|
||||||
First of all, we'll need to edit our php configuration ie `/etc/php.ini` and uncomment a line **cgi.fix_pathinfo=1** using a text editor.
|
|
||||||
|
|
||||||
# nano /etc/php.ini
|
|
||||||
|
|
||||||
After its done, we'll need to change the ownership of PHP-FPM process from apache to lighttpd. To do so, we'll need to open the configuration file `/etc/php-fpm.d/www.conf` using a text editor.
|
|
||||||
|
|
||||||
# nano /etc/php-fpm.d/www.conf
|
|
||||||
|
|
||||||
Then, we'll append the file with the following configurations.
|
|
||||||
|
|
||||||
user = lighttpd
|
|
||||||
group = lighttpd
|
|
||||||
|
|
||||||
Once done, we'll need to save the file and exit the text editor. Then, we'll need to include fastcgi module from `/etc/lighttpd/modules.conf` configuration file.
|
|
||||||
|
|
||||||
# nano /etc/lighttpd/modules.conf
|
|
||||||
|
|
||||||
Then, we'll need to uncomment the following line by removing `#` from it.
|
|
||||||
|
|
||||||
include "conf.d/fastcgi.conf"
|
|
||||||
|
|
||||||
At last, we'll need to configure our fastcgi configuration file using our favorite text editor.
|
|
||||||
|
|
||||||
# nano /etc/lighttpd/conf.d/fastcgi.conf
|
|
||||||
|
|
||||||
Then, we'll need to add the following lines at the end of the file.
|
|
||||||
|
|
||||||
fastcgi.server += ( ".php" =>
|
|
||||||
((
|
|
||||||
"host" => "127.0.0.1",
|
|
||||||
"port" => "9000",
|
|
||||||
"broken-scriptfilename" => "enable"
|
|
||||||
))
|
|
||||||
)
|
|
||||||
|
|
||||||
After its done, we'll save the file and exit the text editor.
|
|
||||||
|
|
||||||
#### On Ubuntu 15.04
|
|
||||||
|
|
||||||
To enable fastcgi with lighttpd web server, we'll simply need to execute the following commands.
|
|
||||||
|
|
||||||
# lighttpd-enable-mod fastcgi
|
|
||||||
|
|
||||||
Enabling fastcgi: ok
|
|
||||||
Run /etc/init.d/lighttpd force-reload to enable changes
|
|
||||||
|
|
||||||
# lighttpd-enable-mod fastcgi-php
|
|
||||||
|
|
||||||
Enabling fastcgi-php: ok
|
|
||||||
Run `/etc/init.d/lighttpd` force-reload to enable changes
|
|
||||||
|
|
||||||
Then, we'll reload our lighttpd by running the following command.
|
|
||||||
|
|
||||||
# systemctl force-reload lighttpd
|
|
||||||
|
|
||||||
### Testing if PHP is working
|
|
||||||
|
|
||||||
In order to see if PHP is working as expected or not, we'll need to create a new php file under the webroot of our lighttpd web server. Here, in this tutorial we have `/var/www/html` in Ubuntu and `/srv/www/htdocs` in CentOS as the default webroot so, we'll create a info.php file under it using a text editor.
|
|
||||||
|
|
||||||
**On CentOS 7**
|
|
||||||
|
|
||||||
# nano /var/www/info.php
|
|
||||||
|
|
||||||
**On Ubuntu 15.04**
|
|
||||||
|
|
||||||
# nano /srv/www/htdocs/info.php
|
|
||||||
|
|
||||||
Then, we'll simply add the following line into the file.
|
|
||||||
|
|
||||||
<?php phpinfo(); ?>
|
|
||||||
|
|
||||||
Once done, we'll simply save the file and exit from the text editor.
|
|
||||||
|
|
||||||
Now, we'll point our web browser to our machine running lighttpd using its ip address or domain name with the info.php file path as [http://lighttpd.linoxide.com/info.php](http://lighttpd.linoxide.com/info.php) If everything was done as described above, we will see our PHP information page as shown below.
|
|
||||||
|
|
||||||
![phpinfo lighttpd](http://blog.linoxide.com/wp-content/uploads/2016/02/phpinfo-lighttpd.png)
|
|
||||||
|
|
||||||
### Conclusion
|
|
||||||
|
|
||||||
Finally we have successfully installed the world's lightweight, fast and secure web server Lighttpd in our machine running CentOS 7 and Ubuntu 15.04 linux distributions. Once its ready, we can upload our website files into our web root, configure virtual host, enable ssl, connect database, run web apps and much more with our lighttpd web server. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-)
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: http://linoxide.com/linux-how-to/setup-lighttpd-web-server-ubuntu-15-04-centos-7/
|
|
||||||
|
|
||||||
作者:[Arun Pyasi][a]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]:http://linoxide.com/author/arunp/
|
|
@ -1,32 +0,0 @@
|
|||||||
Intel shows budget Android phone powering big-screen Linux
|
|
||||||
==============================================================
|
|
||||||
|
|
||||||
![](https://regmedia.co.uk/2016/02/23/intel-bigscreen.jpg?x=648&y=348&crop=1)
|
|
||||||
|
|
||||||
**MWC16** Intel is showing what it calls "Big Screen Experience" at Mobile World Congress, an Android smartphone which runs a full Linux desktop when plugged into an external display.
|
|
||||||
|
|
||||||
The concept is broadly similar to Microsoft's Continuum for Windows 10 Mobile, but whereas Continuum devices are towards the high end, Intel's project is aimed, it says, at budget smartphones and emerging markets.
|
|
||||||
|
|
||||||
On display in Barcelona is a prototype SoFIA (Smart or Feature Phone with Intel Architecture) smartphone with an Atom x3 processor, 2GB RAM and 16GB storage, and modified to support an external display. Attach keyboard, mouse and display, and it becomes desktop Linux, with an option to display the Android screen in a window on the large display.
|
|
||||||
|
|
||||||
"Android is based on a Linux kernel, so we're running one kernel, we have an Android stack and a Linux stack, and we're sharing the same context, so the file system is identical. The phone stays fully functional," Intel's Nir Metzer, Path Finding Group Manager, told the Reg.
|
|
||||||
|
|
||||||
"I have a multi-window environment. As soon as I plug in I can do spreadsheets, I can drag and drop, play video. Achieving all this on a low-end platform is a challenge," said Metzer.
|
|
||||||
|
|
||||||
Currently the display on the device goes blank when the external display is attached, but Metzer said that the next version of the Atom X3 will support dual displays.
|
|
||||||
|
|
||||||
The version of Linux used is maintained by Intel. "We need to align between the Linux versions and the Android," said Metzer. "The framework is pre-installed, not an app you can download."
|
|
||||||
|
|
||||||
Intel is pitching the idea at phone manufacturers here at Mobile World Congress, but had nothing to report concerning actual customers for its device. "The chip is ready, this is production-ready. This can go into production tomorrow. It is a business decision," said Metzer.®
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: http://www.theregister.co.uk/2016/02/23/move_over_continuum_intel_shows_android_smartphone_powering_bigscreen_linux/
|
|
||||||
|
|
||||||
作者:[Tim Anderson][a]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]:http://www.theregister.co.uk/Author/2878
|
|
@ -1,4 +1,3 @@
|
|||||||
【Translating by cposture 2016-02-25】
|
|
||||||
How to add open source experience to your resume
|
How to add open source experience to your resume
|
||||||
==================================================
|
==================================================
|
||||||
|
|
||||||
|
@ -0,0 +1,215 @@
|
|||||||
|
How to use Python to hack your Eclipse IDE
|
||||||
|
==============================================
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/lightbulb_computer_person_general_.png?itok=ZY3UuQQa)
|
||||||
|
|
||||||
|
The Eclipse Advanced Scripting Environment ([EASE][1]) project is a new but powerful set of plugins that enables you to quickly hack your Eclipse IDE.
|
||||||
|
|
||||||
|
Eclipse is a powerful framework that can be extended in many different ways by using its built-in plugin mechanism. However, writing and deploying a new plugin can be cumbersome if all you want is a bit of additional functionality. Now, using EASE, there's a better way to do that, without having to write a single line of Java code. EASE provides a way to easily automate workbench functionality using scripting languages such as Python or Javascript.
|
||||||
|
|
||||||
|
In this article, based on my [talk][2] at EclipseCon North America this year, I'll cover the basics of how to set up your Eclipse environment with Python and EASE and look at a few ideas to supercharge your IDE with the power of Python.
|
||||||
|
|
||||||
|
### Setup and run "Hello World"
|
||||||
|
|
||||||
|
The examples in this article are based on the Java-implementation of Python, Jython. You can install EASE directly into your existing Eclipse IDE. In this example we use Eclipse [Mars][3] and install EASE itself, its modules and the Jython engine.
|
||||||
|
|
||||||
|
From within the Eclipse Install Dialog (`Help>Install New Software`...), install EASE: [http://download.eclipse.org/ease/update/nightly][4]
|
||||||
|
|
||||||
|
And, select the following components:
|
||||||
|
|
||||||
|
- EASE Core feature
|
||||||
|
|
||||||
|
- EASE core UI feature
|
||||||
|
|
||||||
|
- EASE Python Developer Resources
|
||||||
|
|
||||||
|
- EASE modules (Incubation)
|
||||||
|
|
||||||
|
This will give you EASE and its modules. The main one we are interested in is the Resource module that gives you access to the Eclipse workspace, projects, and files API.
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/1_installease_nightly.png)
|
||||||
|
|
||||||
|
|
||||||
|
After those have been successfully installed, next install the EASE Jython engine: [https://dl.bintray.com/pontesegger/ease-jython/][5]. Once the plugins are installed, test EASE out. Create a new project and add in a new file called hello.py with this content:
|
||||||
|
|
||||||
|
```
|
||||||
|
print "hello world"
|
||||||
|
```
|
||||||
|
|
||||||
|
Select the file, right click, and select 'Run as -> EASE script'. You should see "Hello World" appear in the console.
|
||||||
|
|
||||||
|
Now you can start writing Python scripts that can access the workspace and projects. This power can be used for all sorts of hacks, below are just a few ideas.
|
||||||
|
|
||||||
|
### Improve your code quality
|
||||||
|
|
||||||
|
Maintaining good code quality can be a tiresome job especially when dealing with a large codebase or when lots of developers are involved. Some of this pain can be made easier with a script, such as for batch formatting for a set of files, or even fixing certain files to [remove unix line endings][6] for easy comparison in source control like git. Another nice thing to do is use a script to generate Eclipse markers to highlight code that could do with improving. Here's an example script that you could use to add task markers for all "printStackTrace" methods it detects in Java files. See the source code: [markers.py][7]
|
||||||
|
|
||||||
|
To run, copy the file to your workspace, then right click and select 'Run as -> EASE script'.
|
||||||
|
|
||||||
|
```
|
||||||
|
loadModule('/System/Resources')
|
||||||
|
```
|
||||||
|
|
||||||
|
from org.eclipse.core.resources import IMarker
|
||||||
|
|
||||||
|
```
|
||||||
|
for ifile in findFiles("*.java"):
|
||||||
|
file_name = str(ifile.getLocation())
|
||||||
|
print "Processing " + file_name
|
||||||
|
with open(file_name) as f:
|
||||||
|
for line_no, line in enumerate(f, start=1):
|
||||||
|
if "printStackTrace" in line:
|
||||||
|
marker = ifile.createMarker(IMarker.TASK)
|
||||||
|
marker.setAttribute(IMarker.TRANSIENT, True)
|
||||||
|
marker.setAttribute(IMarker.LINE_NUMBER, line_no)
|
||||||
|
marker.setAttribute(IMarker.MESSAGE, "Fix in Sprint 2: " + line.strip())
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
If you have any java files with printStackTraces you will be able to see the newly created markers in the Tasks view and in the editor margin.
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/2_codequality.png)
|
||||||
|
|
||||||
|
### Automate tedious tasks
|
||||||
|
|
||||||
|
When you are working with several projects you may want to automate some tedious, repetitive tasks. Perhaps you need to add in a copyright header to the beginning of each source file, or update source files when adopting a new framework. For instance, when we first switched to using Tycho and Maven, we had to add a pom.xml to each project. This is easily done using a few lines of Python. Then when Tycho provided support for pom-less builds, we wanted to remove unnecessary pom files. Again, a few lines of Python script enabled this. As an example, here is a script which adds a README.md file to every open project in your workspace, noting if they are Java or Python projects. See the source code: [add_readme.py][8].
|
||||||
|
|
||||||
|
To run, copy the file to your workspace, then right click and select 'Run as -> EASE script'.
|
||||||
|
|
||||||
|
loadModule('/System/Resources')
|
||||||
|
|
||||||
|
```
|
||||||
|
for iproject in getWorkspace().getProjects():
|
||||||
|
if not iproject.isOpen():
|
||||||
|
continue
|
||||||
|
|
||||||
|
ifile = iproject.getFile("README.md")
|
||||||
|
|
||||||
|
if not ifile.exists():
|
||||||
|
contents = "# " + iproject.getName() + "\n\n"
|
||||||
|
if iproject.hasNature("org.eclipse.jdt.core.javanature"):
|
||||||
|
contents += "A Java Project\n"
|
||||||
|
elif iproject.hasNature("org.python.pydev.pythonNature"):
|
||||||
|
contents += "A Python Project\n"
|
||||||
|
writeFile(ifile, contents)
|
||||||
|
```
|
||||||
|
|
||||||
|
The result should be that every open project will have a README.md file, with Java and Python projects having an additional descriptive line.
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/3_tedioustask.png)
|
||||||
|
|
||||||
|
### Prototype new features
|
||||||
|
|
||||||
|
You can also use a Python script to hack a quick-fix for some much wanted functionality, or as a prototype to help demonstrate to your team or users how you envision a feature. For instance, one feature Eclipse IDE doesn't currently support is auto-save on the current file you are working on. Although this feature is in the works for future releases, you can have a quick and dirty version that autosaves every 30 seconds or when the editor is deactivated. Below is a snippet of the main method. See the full source: [autosave.py][9]
|
||||||
|
|
||||||
|
```
|
||||||
|
def save_dirty_editors():
|
||||||
|
workbench = getService(org.eclipse.ui.IWorkbench)
|
||||||
|
for window in workbench.getWorkbenchWindows():
|
||||||
|
for page in window.getPages():
|
||||||
|
for editor_ref in page.getEditorReferences():
|
||||||
|
part = editor_ref.getPart(False)
|
||||||
|
if part and part.isDirty():
|
||||||
|
print "Auto-Saving", part.getTitle()
|
||||||
|
part.doSave(None)
|
||||||
|
```
|
||||||
|
|
||||||
|
Before running this script you will need to turn on the 'Allow Scripts to run code in UI thread' setting by checking the box under Window > Preferences > Scripting. Then you can add the file to your workspace, right click on it and select 'Run As>EASE Script'. A save message is printed out in the Console view every time an editor is saved. To turn off the autosave just stop the script by pressing the 'Terminate' red square button in the Console view.
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/4_prototype.png)
|
||||||
|
|
||||||
|
### Quickly extend the user interface with custom buttons, menus, etc
|
||||||
|
|
||||||
|
One of the best things about EASE is that it allows you to take your scripts and quickly hook them into UI elements of the IDE, for example, as a new button or new menu item. No need to write Java or have a new plugin, just add a couple of lines to your script header—it's that simple.
|
||||||
|
|
||||||
|
Here's an example for a simplistic script that creates us three new projects.
|
||||||
|
|
||||||
|
```
|
||||||
|
# name : Create fruit projects
|
||||||
|
# toolbar : Project Explorer
|
||||||
|
# description : Create fruit projects
|
||||||
|
|
||||||
|
loadModule("/System/Resources")
|
||||||
|
|
||||||
|
for name in ["banana", "pineapple", "mango"]:
|
||||||
|
createProject(name)
|
||||||
|
```
|
||||||
|
|
||||||
|
The comment lines specify to EASE to add a button to the Project Explorer toolbar. Here's another script that adds a button to the same toolbar to delete those three projects. See the source files: [createProjects.py][10] and [deleteProjects.py][11]
|
||||||
|
|
||||||
|
```
|
||||||
|
# name :Delete fruit projects
|
||||||
|
# toolbar : Project Explorer
|
||||||
|
# description : Get rid of the fruit projects
|
||||||
|
|
||||||
|
loadModule("/System/Resources")
|
||||||
|
|
||||||
|
for name in ["banana", "pineapple", "mango"]:
|
||||||
|
project = getProject(name)
|
||||||
|
project.delete(0, None)
|
||||||
|
```
|
||||||
|
|
||||||
|
To get the buttons to appear, add the two script files to a new project—let's call it 'ScriptsProject'. Then go to Windows > Preference > Scripting > Script Locations. Click on the 'Add Workspace' button and select the ScriptsProject. This project now becomes a default location for locating script files. You should see the buttons show up in the Project Explorer without needing to restart your IDE. You should be able to quickly create and delete the projects using your newly added buttons.
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/5_buttons.png)
|
||||||
|
|
||||||
|
### Integrate with third-party tools
|
||||||
|
|
||||||
|
Every now and then you may need to use a tool outside the Eclipse ecosystem (sad but true, it has a lot but it does not do everything). For those occasions it might be quite handy to wrap calling that call to the tool in a script. Here's an example that allows you to integrate with explorer.exe, and add it to the content menu so you could instantly open a file browser using the current selection. See the source code: [explorer.py][12]
|
||||||
|
|
||||||
|
```
|
||||||
|
# name : Explore from here
|
||||||
|
# popup : enableFor(org.eclipse.core.resources.IResource)
|
||||||
|
# description : Start a file browser using current selection
|
||||||
|
loadModule("/System/Platform")
|
||||||
|
loadModule('/System/UI')
|
||||||
|
|
||||||
|
selection = getSelection()
|
||||||
|
if isinstance(selection, org.eclipse.jface.viewers.IStructuredSelection):
|
||||||
|
selection = selection.getFirstElement()
|
||||||
|
|
||||||
|
if not isinstance(selection, org.eclipse.core.resources.IResource):
|
||||||
|
selection = adapt(selection, org.eclipse.core.resources.IResource)
|
||||||
|
|
||||||
|
if isinstance(selection, org.eclipse.core.resources.IFile):
|
||||||
|
selection = selection.getParent()
|
||||||
|
|
||||||
|
if isinstance(selection, org.eclipse.core.resources.IContainer):
|
||||||
|
runProcess("explorer.exe", [selection.getLocation().toFile().toString()])
|
||||||
|
```
|
||||||
|
|
||||||
|
To get the menu to appear, add the script to a new project—let's call it 'ScriptsProject'. Then go to Windows > Preference > Scripting > Script Locations. Click on the 'Add Workspace' button and select the ScriptsProject. You should see the new menu item show up in the context menu when you right-click on a file. Select this action to bring up a file browser. (Note this functionality already exists in Eclipse but this example is one you could adapt to other third-party tools).
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/6_explorer.png)
|
||||||
|
|
||||||
|
The Eclipse Advanced Scripting Environment provides a great way to get more out of your Eclipse IDE by leveraging the power of Python. It is a project in its infancy so there is so much more to come. Learn more [about the project][13] and get involved by signing up for the [forum][14].
|
||||||
|
|
||||||
|
I'll be talking more about EASE at [Eclipsecon North America][15] 2016. My talk [Scripting Eclipse with Python][16] will go into how you can use not just Jython, but C-Python and how this functionality can be extended specifically for scientific use-cases.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/life/16/2/how-use-python-hack-your-ide
|
||||||
|
|
||||||
|
作者:[Tracy Miranda][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/tracymiranda
|
||||||
|
[1]: https://eclipse.org/ease/
|
||||||
|
[2]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python
|
||||||
|
[3]: https://www.eclipse.org/downloads/packages/eclipse-ide-eclipse-committers-451/mars1
|
||||||
|
[4]: http://download.eclipse.org/ease/update/nightly
|
||||||
|
[5]: https://dl.bintray.com/pontesegger/ease-jython/
|
||||||
|
[6]: http://code.activestate.com/recipes/66434-change-line-endings/
|
||||||
|
[7]: https://gist.github.com/tracymiranda/6556482e278c9afc421d
|
||||||
|
[8]: https://gist.github.com/tracymiranda/f20f233b40f1f79b1df2
|
||||||
|
[9]: https://gist.github.com/tracymiranda/e9588d0976c46a987463
|
||||||
|
[10]: https://gist.github.com/tracymiranda/55995daaea9a4db584dc
|
||||||
|
[11]: https://gist.github.com/tracymiranda/baa218fc2c1a8e898194
|
||||||
|
[12]: https://gist.github.com/tracymiranda/8aa3f0fc4bf44f4a5cd3
|
||||||
|
[13]: https://eclipse.org/ease/
|
||||||
|
[14]: https://dev.eclipse.org/mailman/listinfo/ease-dev
|
||||||
|
[15]: https://www.eclipsecon.org/na2016
|
||||||
|
[16]: https://www.eclipsecon.org/na2016/session/scripting-eclipse-python
|
@ -0,0 +1,40 @@
|
|||||||
|
The Evolving Market for Commercial Software Built On Open Source
|
||||||
|
=====================================================================
|
||||||
|
|
||||||
|
![](https://www.linux.com/images/stories/41373/Structure-event-photo.jpg)
|
||||||
|
>Attendees listen to a presentation during Structure at the UCSF Mission Bay Conference Center, where Structure Data 2016 will take place. Image credit: Structure Events.
|
||||||
|
|
||||||
|
It's really hard to understate the impact of open source projects on the enterprise software market these days; open source integration became the norm so quickly we could be forgiven for missing the turning point.
|
||||||
|
|
||||||
|
Hadoop, for example, changed more than just the world of data analysis. It gave rise to a new generation of data companies that created their own software around open source projects, tweaking and supporting that code as needed, much like how Red Hat embraced Linux in the 1990s and early 2000s. And this software is increasingly delivered over public clouds, rather than run on the buyer's own servers, enabling an amazing degree of operational flexibility but raising all sorts of new questions about licensing, support, and pricing.
|
||||||
|
|
||||||
|
We've been following this closely over the years when putting together the lineup for our Structure Data conference, and Structure Data 2016 is no exception. The CEOs of three of the most important companies in big data operating around Hadoop -- Hortonworks, Cloudera and MapR -- will share the stage to discuss how they sell enterprise software and services around open source projects, generating cash while giving back to that community project at the same time.
|
||||||
|
|
||||||
|
There was a time when making money on enterprise software was easier. Once purchased by a customer, a mega-package of software from an enterprise vendor turned into its own cash register, generating something close to lifetime income from maintenance contracts and periodic upgrades to software that became harder and harder to displace as it became the heart of a customer’s business. Customers grumbled about lock-in, but they didn't really have much of a choice if they wanted to make their workforce more productive.
|
||||||
|
|
||||||
|
That is no longer the case. While an awful lot of companies are still stuck running immense software packages critical to their infrastructure, new projects are being deployed on cloud servers using open source technologies. This makes it much easier to upgrade one's capabilities without having to rip out a huge software package and reinstall something else, and it also allows companies to pay as they go, rather than paying for a bunch of features they'll never use.
|
||||||
|
|
||||||
|
And there are a lot of customers who want to take advantage of open source projects without building and supporting a team of engineers to tweak one of those projects for their own unique needs. Those customers are willing to pay for software packages whose value is based on the delta between the open source projects and the proprietary features laid on top of that project.
|
||||||
|
|
||||||
|
This is especially true for infrastructure-related software. Sure, your customers could install their own tweaks to a project like Hadoop or Spark or Node.js, but there's money to be made helping those customers out with a customizable package that lets them implement some of today's vital open source technologies without having to do all of the heavy lifting themselves. Just look at Structure Data 2016 presenters such as Confluent (Kafka), Databricks (Spark), and the Cloudera-Hortonworks-MapR (Hadoop) trio.
|
||||||
|
|
||||||
|
There's certainly something to be said for having a vendor to yell at when things go wrong. If your engineers botch the implementation of an open source project, you've only yourself to blame. But If you contract with a company that is willing to guarantee certain performance and uptime metrics inside of a service-level agreement, you're willing to pay for support, guidance, and a chance to yell at somebody outside of your organization when inevitable problems crop up.
|
||||||
|
|
||||||
|
The evolving market for commercial software on top of open source projects is something we've been tracking at Structure Data for years, and we urge you to join us in San Francisco March 9 and 10 if this is a topic near and dear to your heart.
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.linux.com/news/enterprise/cloud-computing/889564-the-evolving-market-for-commercial-software-built-on-open-source-
|
||||||
|
|
||||||
|
作者:[Tom Krazit ][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/community/forums/person/70513
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
|||||||
|
(翻译中 by runningwater)
|
||||||
|
Viper, the Python IoT Development Suite, is now Zerynth
|
||||||
|
============================================================
|
||||||
|
|
||||||
|
|
||||||
|
![](http://www.open-electronics.org/wp-content/uploads/2016/02/Logo_Zerynth-636x144.png)
|
||||||
|
|
||||||
|
|
||||||
|
The startup that launched the tools to develop embedded solutions in Python language announced the brand change along with the first official release.
|
||||||
|
|
||||||
|
>Exactly one year after the Kickstarter launch of the suite for developing Internet of Things solutions in Python language, **Viper becomes Zerynth**. It is definitely a big day for the startup that created a radically new way to approach the world of microcontrollers and connected devices, making professionals and makers able to design interactive solutions with reduced efforts and shorter time.
|
||||||
|
|
||||||
|
>“We really believe in the uniqueness of our tools, this is why they deserve an adequate recognition. Viper was a great name for a product, but other notable companies had the same feeling many decades ago, with the result that this term was shared with too many other actors out there. We are grown now, and ready to take off fast and light, like the design processes that our tools are enabling”, says the Viper (now Zerynth), co-founders.
|
||||||
|
|
||||||
|
>**Thousands of users** developed amazing connected solutions in just 9 months of life in Beta version. Built to be cross-platform, Zerynth’s tools are meant for high-level design of Internet/cloud-connected devices, interactive objects, artistic installations. They are: **Zerynth Studio**, a browser-based IDE for programming embedded devices in Python with cloud sync and board management features; **Zerynth Virtual Machine**: a multithreaded real-time OS that provides real hardware independence allowing code reuse on the entire ARM architecture; **Zerynth App**, a general purpose interface that turns any mobile into the controller and display for smart objects and IoT systems.
|
||||||
|
|
||||||
|
>This modular set of tools, adaptable to different hardware and cloud infrastructures, can dramatically reduce the time to market and the overall development costs for makers, professionals and companies.
|
||||||
|
|
||||||
|
>Now Zerynth celebrates its new name launching the **first official release** of the toolkit. Check it here [www.zerynth.com][1]
|
||||||
|
|
||||||
|
![](http://www.open-electronics.org/wp-content/uploads/2016/02/Zerynth-Press-Release_Studio-Img-768x432.png)
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://www.open-electronics.org/viper-the-python-iot-development-suite-is-now-zerynth/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+OpenElectronics+%28Open+Electronics%29
|
||||||
|
|
||||||
|
作者:[Staff ][a]
|
||||||
|
译者:[runningwater](https://github.com/runningwater)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:http://www.open-electronics.org/author/staff/
|
||||||
|
[1]: http://www.zerynth.com/
|
||||||
|
|
@ -0,0 +1,89 @@
|
|||||||
|
Top 5 open source command shells for Linux
|
||||||
|
===============================================
|
||||||
|
|
||||||
|
keyword: shell , Linux , bash , zsh , fish , ksh , tcsh , license
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/terminal_blue_smoke_command_line_0.jpg?itok=u2mRRqOa)
|
||||||
|
|
||||||
|
There are two kinds of Linux users: the cautious and the adventurous.
|
||||||
|
|
||||||
|
On one side is the user who almost reflexively tries out ever new option which hits the scene. They’ve tried handfuls of window managers, dozens of distributions, and every new desktop widget they can find.
|
||||||
|
|
||||||
|
On the other side is the user who finds something they like and sticks with it. They tend to like their distribution’s defaults. If they’re passionate about a text editor, it’s whichever one they mastered first.
|
||||||
|
|
||||||
|
As a Linux user, both on the server and the desktop, for going on fifteen years now, I am definitely more in the second category than the first. I have a tendency to use what’s presented to me, and I like the fact that this means more often than not I can find thorough documentation and examples of most any use case I can dream up. If I used something non-standard, the switch was carefully researched and often predicated by a strong pitch from someone I trust.
|
||||||
|
|
||||||
|
But that doesn’t mean I don’t like to sometimes try and see what I’m missing. So recently, after years of using the bash shell without even giving it a thought, I decided to try out four alternative shells: ksh, tcsh, zsh, and fish. All four were easy installs from my default repositories in Fedora, and they’re likely already packaged for your distribution of choice as well.
|
||||||
|
|
||||||
|
Here’s a little bit on each option and why you might choose it to be your next Linux command-line interpreter.
|
||||||
|
|
||||||
|
### bash
|
||||||
|
|
||||||
|
First, let’s take a look back at the familiar. [GNU Bash][1], the Bourne Again Shell, has been the default in pretty much every Linux distribution I’ve used through the years. Originally released in 1989, bash has grown to easily become the most used shell across the Linux world, and it is commonly found in other unix-like operating systems as well.
|
||||||
|
|
||||||
|
Bash is a perfectly respectable shell, and as you look for documentation of how to do various things across the Internet, almost invariably you’ll find instructions which assume you are using a bash shell. But bash has some shortcomings, as anyone who has ever written a bash script that’s more than a few lines can attest to. It’s not that you can’t do something, it’s that it’s not always particularly intuitive (or at least elegant) to read and write. For some examples, see this list of [common bash pitfalls][2].
|
||||||
|
|
||||||
|
That said, bash is probably here to stay for at least the near future, with its enormous install base and legions of both casual and professional system administrators who are already attuned to its usage, and quirks. The bash project is available under a [GPLv3][3] license.
|
||||||
|
|
||||||
|
### ksh
|
||||||
|
|
||||||
|
[KornShell][4], also known by its command invocation, ksh, is an alternative shell that grew out of Bell Labs in the 1980s, written by David Korn. While originally proprietary software, later versions were released under the [Eclipse Public License][5].
|
||||||
|
|
||||||
|
Proponents of ksh list a number of ways in which they feel it is superior, including having a better loop syntax, cleaner exit codes from pipes, an easier way to repeat commands, and associative arrays. It's also capable of emulating many of the behaviors of vi or emacs, so if you are very partial to a text editor, it may be worth giving a try. Overall, I found it to be very similar to bash for basic input, although for advanced scripting it would surely be a different experience.
|
||||||
|
|
||||||
|
### tcsh
|
||||||
|
|
||||||
|
[Tcsh][6] is a derivative of csh, the Berkely Unix C shell, and sports a very long lineage back to the early days of Unix and computing itself.
|
||||||
|
|
||||||
|
The big selling point for tcsh is its scripting language, which should look very familiar to anyone who has programmed in C. Tcsh's scripting is loved by some and hated by others. But it has other features as well, including adding arguments to aliases, and various defaults that might appeal to your preferences, including the way autocompletion with tab and history tab completion work.
|
||||||
|
|
||||||
|
You can find tcsh under a [BSD license][7].
|
||||||
|
|
||||||
|
### zsh
|
||||||
|
|
||||||
|
[Zsh][8] is another shell which has similarities to bash and ksh. Originating in the early 90s, zsh sports a number of useful features, including spelling correction, theming, namable directory shortcuts, sharing your command history across multiple terminals, and various other slight tweaks from the original Bourne shell.
|
||||||
|
|
||||||
|
The code and binaries for zsh can be distributed under an MIT-like license, though portions are under the GPL; check the [actual license][9] for details.
|
||||||
|
|
||||||
|
### fish
|
||||||
|
|
||||||
|
I knew I was going to like the Friendly Interactive Shell, [fish][10], when I visited the website and found it described tongue-in-cheek with "Finally, a command line shell for the 90s"—fish was written in 2005.
|
||||||
|
|
||||||
|
The authors of fish offer a number of reasons to make the switch, all invoking a bit of humor and poking a bit of fun at shells that don't quite live up. Features include autosuggestions ("Watch out, Netscape Navigator 4.0"), support of the "astonishing" 256 color palette of VGA, but some actually quite helpful features as well including command completion based on the man pages on your machine, clean scripting, and a web-based configuration.
|
||||||
|
|
||||||
|
Fish is licensed primarily unde the GPL version 2 but with portions under other licenses; check the repository for [complete information][11].
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
Looking for a more detailed rundown on the precise differences between each option? [This site][12] ought to help you out.
|
||||||
|
|
||||||
|
So where did I land? Well, ultimately, I’m probably going back to bash, because the differences were subtle enough that someone who mostly used the command line interactively as opposed to writing advanced scripts really wouldn't benefit much from the switch, and I'm already pretty comfortable in bash.
|
||||||
|
|
||||||
|
But I’m glad I decided to come out of my shell (ha!) and try some new options. And I know there are many, many others out there. Which shells have you tried, and which one do you prefer? Let us know in the comments!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
via: https://opensource.com/business/16/3/top-linux-shells
|
||||||
|
|
||||||
|
作者:[Jason Baker][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/jason-baker
|
||||||
|
|
||||||
|
[1]: https://www.gnu.org/software/bash/
|
||||||
|
[2]: http://mywiki.wooledge.org/BashPitfalls
|
||||||
|
[3]: http://www.gnu.org/licenses/gpl.html
|
||||||
|
[4]: http://www.kornshell.org/
|
||||||
|
[5]: https://www.eclipse.org/legal/epl-v10.html
|
||||||
|
[6]: http://www.tcsh.org/Welcome
|
||||||
|
[7]: https://en.wikipedia.org/wiki/BSD_licenses
|
||||||
|
[8]: http://www.zsh.org/
|
||||||
|
[9]: https://sourceforge.net/p/zsh/code/ci/master/tree/LICENCE
|
||||||
|
[10]: https://fishshell.com/
|
||||||
|
[11]: https://github.com/fish-shell/fish-shell/blob/master/COPYING
|
||||||
|
[12]: http://hyperpolyglot.org/unix-shells
|
||||||
|
|
@ -0,0 +1,81 @@
|
|||||||
|
Image processing at NASA with open source tools
|
||||||
|
=======================================================
|
||||||
|
|
||||||
|
keyword: NASA , Image Process , Node.js , OpenCV
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/nasa_spitzer_space_pink_spiral.jpg?itok=3XEUstkl)
|
||||||
|
|
||||||
|
This past summer, I was an intern at the [GVIS][1] Lab at [NASA][2] Glenn, where I brought my passion for open source into the lab. My task was to improve our lab's contributions to an open source fluid flow dynamics [simulation][3] developed by Dan Schroeder. The original simulation presents obstacles that users can draw in with their mouse to model computational fluid dynamics. My team contributed by adding image processing code that analyzes each frame of a live video feed to show how a physical object interacts with a fluid. But, there was more for us to do.
|
||||||
|
|
||||||
|
We wanted to make the image processing more robust, so I worked on improving the image processing library.
|
||||||
|
|
||||||
|
With the new library, the simulation would be able to detect contours, perform coordinate transformations in place, and find the center of mass of an object. The image processing doesn't directly relate to the physics of the fluid flow dynamics simulation. It detects the object with a camera and creates a barrier for the fluid flow simulation by getting the outline of the object. Then, the fluid flow simulation runs, and the output is projected down onto the actual object.
|
||||||
|
|
||||||
|
My goal was to improve the simulation in three ways:
|
||||||
|
|
||||||
|
1. to find accurate contours of an object
|
||||||
|
2. to find the center of mass of an object
|
||||||
|
3. to be able to perform accurate transformations about the center of an object
|
||||||
|
|
||||||
|
My mentor recommended that I install [Node.js][4], [OpenCV][5], and the [Node.js bindings for OpenCV][6]. While I was waiting for those to install, I looked at the example code on the OpenCV bindings on their [GitHub page][7]. I discovered that the example code was in JavaScript, so because I didn’t know JavaScript, I started a short course from Codecademy. Two days later, I was sick of JavaScript but ready to start my project... which involved yet more JavaScript.
|
||||||
|
|
||||||
|
The example contour-finding code worked well. In fact, it allowed me to accomplish my first goal in a matter of hours! To get the contours of an image, here's what it looked like:
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/resize/image_processing_nasa_1-520x293.jpg)
|
||||||
|
>The original image with all of the contours.
|
||||||
|
|
||||||
|
The example contour-finding code worked a bit too well. Instead of the contour of the object being detected, all of the contours in the image were detected. This would have resulted in the simulation interacting with all of the unwanted contours. This is a problem because it would return incorrect data. To keep the simulation from interacting with the unwanted contours, I added an area constraint. If the contour was in a certain area range, then it would be drawn. The area constraint resulted in a much cleaner contour.
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/resize/image_processing_nasa_2-520x293.jpg)
|
||||||
|
>The filtered contour with the shadow contour.
|
||||||
|
|
||||||
|
Though the extraneous contours weren't detected, there was still a problem with the image. There was only one contour in the image, but it doubled back on itself and wasn't complete. Area couldn't be a deciding factor here, so it was time to try something else.
|
||||||
|
|
||||||
|
This time around, instead of immediately finding the contours, I first converted the image into a binary image. A binary image is an image where each pixel is either black or white. To get a binary image I first converted the color image to grayscale. Once the image was in grayscale, I called the threshold method on the image. The threshold method went through the image pixel by pixel and if the color value of the pixel was less than 30, the pixel color would be changed to black. Otherwise, the pixel value would be turned to white. After the original image was converted to a binary image, the resulting image looked like this:
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/resize/image_processing_nasa_3-520x293.jpg)
|
||||||
|
>The binary image.
|
||||||
|
|
||||||
|
Then I got the contours from the binary image, which resulted in a much cleaner contour, without the shadow contour.
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/image_processing_nasa_4.jpg)
|
||||||
|
>The final clean contour.
|
||||||
|
|
||||||
|
At this point, I was able to get clean contours and detect the center of mass. Unfortunately, I didn't have enough time to be able to complete transformations about the center of mass. Since I only had a few days left in my internship, I started to think about other things I could do within a limited time span. One of those things was the bounding rectangle. The bounding rectangle is a quadrilateral with the smallest area that contains the entire contour of an image. The bounding rectangle is important because it is key in scaling the contour on the page. Unfortunately I didn't have time to do much with the bounding rectangle, but I still wanted to learn about it because it's a useful tool.
|
||||||
|
|
||||||
|
Finally, after all of that, I was able to finish processing the image!
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/resize/image_processing_nasa_5-521x293.jpg)
|
||||||
|
>The final image with bounding rectangle and center of mass in red.
|
||||||
|
|
||||||
|
Once the image processing code was complete, I replaced the old image processing code in the simulation with my code. To my surprise, it worked!
|
||||||
|
|
||||||
|
Well, mostly.
|
||||||
|
|
||||||
|
The program had a memory leak in it, which leaked 100MB every 1/10 of a second. I was glad that it wasn’t because of my code. The bad thing was that fixing it was out of my control. The good thing was that there was a workaround that I could use. It was less than ideal, but it checked the amount of memory the simulation was using and when it used more than 1 GiB, the simulation restarted.
|
||||||
|
|
||||||
|
At the NASA lab, we use a lot of open source software, and my work there isn't possible without it.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/life/16/3/image-processing-nasa
|
||||||
|
|
||||||
|
作者:[Lauren Egts][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/laurenegts
|
||||||
|
[1]: https://ocio.grc.nasa.gov/gvis/
|
||||||
|
[2]: http://www.nasa.gov/centers/glenn/home/index.html
|
||||||
|
[3]: http://physics.weber.edu/schroeder/fluids/
|
||||||
|
[4]: http://nodejs.org/
|
||||||
|
[5]: http://opencv.org/
|
||||||
|
[6]: https://github.com/peterbraden/node-opencv
|
||||||
|
[7]: https://github.com/peterbraden/node-opencv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
|||||||
|
GHLandy Translating
|
||||||
|
|
||||||
Part 10 - LFCS: Understanding & Learning Basic Shell Scripting and Linux Filesystem Troubleshooting
|
Part 10 - LFCS: Understanding & Learning Basic Shell Scripting and Linux Filesystem Troubleshooting
|
||||||
================================================================================
|
================================================================================
|
||||||
The Linux Foundation launched the LFCS certification (Linux Foundation Certified Sysadmin), a brand new initiative whose purpose is to allow individuals everywhere (and anywhere) to get certified in basic to intermediate operational support for Linux systems, which includes supporting running systems and services, along with overall monitoring and analysis, plus smart decision-making when it comes to raising issues to upper support teams.
|
The Linux Foundation launched the LFCS certification (Linux Foundation Certified Sysadmin), a brand new initiative whose purpose is to allow individuals everywhere (and anywhere) to get certified in basic to intermediate operational support for Linux systems, which includes supporting running systems and services, along with overall monitoring and analysis, plus smart decision-making when it comes to raising issues to upper support teams.
|
||||||
|
0
translated/news/20160226 Development Release
Normal file
0
translated/news/20160226 Development Release
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
使用SHA-256/512算法作为RSA签名的OpenSSH 7.2发布了
|
||||||
|
========================================================
|
||||||
|
|
||||||
|
**今天,2016.2.29,OpenBSD项目很高兴地宣布OpenSSH 7.2发布了,并且很块可在所有支持的平台下载。**
|
||||||
|
|
||||||
|
根据内部[发布公告][1],该公告附在了文章的最后,OpenSSH 7.2主要是bug修复,修改了自OpenSSH 7.1p2以来由用户报告和开发团队发现的问题,但是我们可以看到几个新功能。
|
||||||
|
|
||||||
|
这其中,我们可以提到使用了SHA-256 或者 SHA-256 512哈希算法的RSA签名,增加了一个AddKeysToAgent客户端选项添加用于身份验证的ssh-agent的私钥,和实现了一个“restrict”级别的authorized_keys选项用于存储键限制。
|
||||||
|
|
||||||
|
此外,现在ssh_config中CertificateFile选项可以明确列出证书,ssh-keygen现在能够改所有支持的格式的密钥注释、指纹可以来自标准输入,文件可含多个公钥。
|
||||||
|
|
||||||
|
### ssh-keygen现在支持多证书
|
||||||
|
|
||||||
|
除了上面提到的,OpenSSH 7.2正加了ssh-keygen多证书的支持,一个一行,实现了sshd_config ChrootDirectory及前台的0参数,“-c”标志允许ssh-keyscan取回证书而不是文本密钥。
|
||||||
|
|
||||||
|
最后但并非最不重要的,OpenSSH 7.3不再默认启用rijndael-cbc也叫AES,blowfish-cbc、古老的cast128-cbc密码,同样还有基于MD5和截断的HMAC算法。getrandom()系统调用在Linux中支持。[下载OpenSSH 7.2][2]并在更新日志中查看更细节的在本主要更新中修复的问题。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://news.softpedia.com/news/openssh-7-2-out-now-with-support-for-rsa-signatures-using-sha-256-512-algorithms-501111.shtml
|
||||||
|
|
||||||
|
作者:[Marius Nestor][a]
|
||||||
|
译者:[geekpi](https://github.com/geekpi)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: http://news.softpedia.com/editors/browse/marius-nestor
|
||||||
|
[1]: http://www.openssh.com/txt/release-7.2
|
||||||
|
[2]: http://linux.softpedia.com/get/Security/OpenSSH-4474.shtml
|
@ -0,0 +1,164 @@
|
|||||||
|
Martin
|
||||||
|
|
||||||
|
2015 Bossie 评选:最佳开源网络和安全软件
|
||||||
|
================================================================================
|
||||||
|
InfoWorld 在建设网络,运营网络和保障网络安全领域精选出了年度开源工具获奖者。
|
||||||
|
|
||||||
|
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-net-sec-100614459-orig.jpg)
|
||||||
|
|
||||||
|
### 最佳开源网络和安全软件 ###
|
||||||
|
|
||||||
|
[BIND](https://en.wikipedia.org/wiki/BIND), [Sendmail](https://en.wikipedia.org/wiki/Sendmail), [OpenSSH](https://en.wikipedia.org/wiki/OpenSSH), [Cacti](https://en.wikipedia.org/wiki/Cactus), [Nagios](https://en.wikipedia.org/wiki/Nagios), [Snort](https://en.wikipedia.org/wiki/Snort_%28software%29) -- 这些为了网络而发明的开源软件,许多老家伙和好东西依然强劲。今年在我们这个范畴的最佳选择中,你会发现中坚支柱,新人,和新贵正在完善网络管理,安全监控,漏洞评估,[rootkit](https://en.wikipedia.org/wiki/Rootkit) 检测,以及更多。
|
||||||
|
|
||||||
|
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-icinga-100614482-orig.jpg)
|
||||||
|
|
||||||
|
### Icinga 2 ###
|
||||||
|
|
||||||
|
Icinga 起先只是系统监控应用 Nagios 的一个分叉。为了给用户一个时尚的界面,对多个数据库的支持,以及一个集成众多扩展的 API,[Icinga 2][1] 被完全重写。凭借开箱即用的负载均衡、通知和配置,Icinga 2 缩短了在复杂环境下的安装时间。Icinga 2 原生支持 [Graphite](https://github.com/graphite-project/graphite-web)(系统监控应用),轻松为管理员呈现实时性能图表。但是 Icinga 今年很火是因为它发布了一个支持可拖放可定制 dashboard 和一些流式监控工具的前端图形界面系统 Icinga Web 2。
|
||||||
|
|
||||||
|
管理员可以查看,过滤,并把问题按优先顺序排好,同时保持跟踪已经进行的动作。一个新的矩阵视图使管理员能够在一个页面上查看主机和服务。您可以查看一个特定时间段的事件或筛选了的事件来了解哪些需要立即关注。Icinga Web 2 能够拥有一个全新界面和更为强劲的性能,然而传统版 Icinga 和 Web 版 Icinga 的所有常用命令仍然可用。这意味着学习新版工具不耗费额外的时间。
|
||||||
|
|
||||||
|
-- Fahmida Rashid
|
||||||
|
|
||||||
|
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-zenoss-100614465-orig.jpg)
|
||||||
|
|
||||||
|
### Zenoss Core ###
|
||||||
|
|
||||||
|
另一个强大的开源软件,[Zenoss Core][2] 为网络管理员提供了一个完整的,一站式解决方案来跟踪和管理所有的应用程序、服务器、存储,网络组件、虚拟化工具、以及企业基础架构的其他元素。管理员可以确保硬件的运行效率并利用模块化设计的插件来扩展 ZenPacks 的功能。
|
||||||
|
|
||||||
|
Zenoss Core 5,在今年二月发布,作为已经很强大的工具,并进一步改进以增强用户界面和扩展 dashboard。基于 Web 的控制台和 dashboard 已经是高度可定制的和动态调整的,现在新版本可让管理员混搭多个组件图表到一个图表。可把它作为一种更好的根源分析和因果分析的工具。
|
||||||
|
|
||||||
|
Portlets 为网络映射、设备问题、守护进程、产品状态、监视列表和事件视图等等提供深入的分析。而且新的 HTML5 图表可以从工具导出。Zenoss 的控制中心支持带外管理并且可监控所有 Zenoss 组件。Zenoss Core 拥有在线备份和恢复、快照和回滚和多主机部署的新工具。更重要的是,凭借对 Docker 的全面支持,部署起来更快了。
|
||||||
|
|
||||||
|
-- Fahmida Rashid
|
||||||
|
|
||||||
|
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-opennms-100614461-orig.jpg)
|
||||||
|
|
||||||
|
### OpenNMS ###
|
||||||
|
|
||||||
|
一个非常灵活的网络管理解决方案,[OpenNMS][3] 可以处理任何网络管理任务,无论是设备管理,应用性能监控,库存控制,或事件管理。凭借对 IPv6 的支持,强大的警报系统,和记录用户脚本来测试 Web 应用程序的能力,OpenNMS 拥有网络管理员和测试人员需要的一切。OpenNMS 现在变得像一款移动 dashboard,堪称 OpenNMS 指南针,可让网络专家随时,甚至当他们外出时都可以监视他们的网络。
|
||||||
|
|
||||||
|
该应用程序的 IOS 版本,可从 [iTunes App Store][4] 上获取,显示故障、节点和告警。下一个版本将提供更多的事件细节、资源图表、以及关于 IP 和 SNMP 接口的信息。安卓版可从 [Google Play][5] 上获取,可在仪表板上显示网络可用性,故障和告警,以及确认、提升或清除告警的能力。移动客户端与 OpenNMS Horizon 1.12 或更高版本以及 OpenNMS Meridian 2015.1.0 或更高版本兼容。
|
||||||
|
|
||||||
|
-- Fahmida Rashid
|
||||||
|
|
||||||
|
![](http://images.techhive.com/images/article/2015/09/bossies-2015-onion-100614460-orig.jpg)
|
||||||
|
|
||||||
|
### Security Onion ###
|
||||||
|
|
||||||
|
如同一个洋葱,网络安全监控是由许多层组成。没有单一的工具会使你洞察在你公司网络中的每次攻击,或者显示每一次侦查或文本会话给你。[Security Onion][6] 打包了许多经过验证的工具成为一个便于使用的 Ubuntu 发行版,这会让你看到谁留在你的网络里,并帮助你隔离坏家伙。
|
||||||
|
|
||||||
|
无论你是采取主动式的网络安全监测还是追查可能的攻击,Security Onion 都可以帮助你。由传感器、服务器和显示层组成,Onion 结合了基于网络和基于主机的入侵检测,全面的网络数据包捕获,并提供了所有的各种日志进行检查和分析。
|
||||||
|
|
||||||
|
众星云集的的网络安全工具链,包括用于网络抓包的 [Netsniff-NG](http://www.netsniff-ng.org/)、基于规则的网络入侵检测系统 Snort 和 [Suricata](https://en.wikipedia.org/wiki/Suricata_%28software%29),基于分析的网络监控系统 Bro,基于主机的入侵检测系统 OSSEC 和用于显示、分析和日志管理的 Sguil、Squert、Snorby 和 ELSA (企业日志搜索和归档)。它是一个经过精挑细选的工具集,全被打包进一个向导驱动式的安装程序并有完整的文档支持,可以帮助你尽可能快地进行监控。
|
||||||
|
|
||||||
|
-- Victor R. Garza
|
||||||
|
|
||||||
|
![](http://images.techhive.com/images/article/2015/09/bossies-2015-kali-100614458-orig.jpg)
|
||||||
|
|
||||||
|
Kali Linux
|
||||||
|
|
||||||
|
[Kali Linux][7] 背后的团队修改了今年流行的安全 Linux 发行版,使其更快,更全能。Kali 采用全新 4.0 版的内核 ,改进了对硬件和无线驱动程序的支持,以及一个更流畅的界面。最流行的工具都可从屏幕的侧边栏上轻松访问。最大的改变?Kali Linux 现在是一个滚动发行版,具有连续的软件更新。Kali 的核心系统是基于 Debian Jessie 发行版,而且该团队会不断地从 Debian 测试版 pull 程序包,同时持续在上面添加新的 Kali 风格的特性。
|
||||||
|
|
||||||
|
该发行版仍然配备满了渗透测试,漏洞分析,安全审查,网络应用分析,无线网络评估,逆向工程,和漏洞利用工具。现在该发行版具有新版本检测系统,当有个别工具可更新时系统会自动通知用户。该发行版还具有一系列设备的 ARM 映像,包括树莓派、[Chromebook](https://en.wikipedia.org/wiki/Chromebook) 和 [Odroid](https://en.wikipedia.org/wiki/ODROID),也可更新在 Android 设备上运行的 [NetHunter](https://www.kali.org/kali-linux-nethunter/) 渗透测试平台。还有其他的变化:Metasploit 的社区版/专业版不再包括在内,因为 Kali 2.0 还没有 [Rapid7 的官方支持][8]。
|
||||||
|
|
||||||
|
-- Fahmida Rashid
|
||||||
|
|
||||||
|
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-openvas-100614462-orig.jpg)
|
||||||
|
|
||||||
|
### OpenVAS ###
|
||||||
|
|
||||||
|
[OpenVAS][9],开源漏洞评估系统,是一种整合多种服务和工具来提供漏洞扫描和漏洞管理的软件框架。该扫描器与每周一次的网络漏洞测试数据配合,或者您可以使用商业数据。该软件框架包括一个命令行界面(所以它可以用脚本运行)和一个带 SSL 安全机制的基于 [Greenbone 安全助手][10] 的浏览器界面。OpenVAS 提供了用于附加功能的各种插件。扫描可以预定运行或按需运行。
|
||||||
|
|
||||||
|
可通过单一的主控来控制多个 OpenVAS 的安装,使得它成为一个可扩展的企业漏洞评估工具。该项目与兼容这样的标准:扫描结果和配置存储在 SQL 数据库中,在那里他们可以容易地被外部报告工具访问。客户端工具通过基于 XML 的无状态 OpenVAS 管理协议访问 OpenVAS 管理器,所以安全管理员可以扩展该框架的功能。该软件能以包或源代码的方式安装在 Windows 或 Linux 上运行,或者作为一个虚拟设备被下载。
|
||||||
|
|
||||||
|
-- Matt Sarrel
|
||||||
|
|
||||||
|
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-owasp-100614463-orig.jpg)
|
||||||
|
|
||||||
|
### OWASP ###
|
||||||
|
|
||||||
|
[OWASP][11],开放的 Web 应用安全项目,是专注于提高软件安全性的全球协会的非营利组织。社区性组织提供测试工具、文档、培训和几乎任何你可以想象的评估软件安全和开发安全软件相关的最佳实践。有几个 OWASP 项目已成为很多安全从业者的工具箱中有价值的组件:
|
||||||
|
|
||||||
|
[ZAP][12],ZED 攻击代理项目,是一个在 Web 应用程序中寻找漏洞的渗透测试工具。ZAP 的设计目标之一是使之易于使用,以便于开发人员和非安全专家的测试人员可以受益于使用它。ZAP 提供了自动扫描器和一套手动测试工具。
|
||||||
|
|
||||||
|
[Xenotix XSS Exploit Framework][13] 是一款运行浏览器引擎内的扫描来获得实际结果的先进的跨站脚本漏洞检测和漏洞利用框架。Xenotix 扫描器模块采用三个智能的 fuzzer,它可以运行近 5000 个不同的XSS有效载荷。一个 API 可以让安全管理员扩展和定制开发工具包。
|
||||||
|
|
||||||
|
[O-Saft][14],OWASP SSL 高级审查工具,一个查看 SSL 证书详细信息和测试 SSL 连接的 SSL 审计工具。这个命令行工具可以在线或离线运行来评估 SSL 安全性,比如密码和配置。O-Saft 提供了常见漏洞的内置检查,你可以容易地通过编写脚本来扩展这些功能。在 2015 年 5 月加入了一个简单的图形用户界面作为可选的下载项。
|
||||||
|
|
||||||
|
[OWTF][15],攻击性的 Web 测试框架,一个遵循 OWASP 测试指南和 NIST 和 PTES 标准的自动化测试工具。该框架使用一个 Web 用户界面和一个命令行,它探测 Web 和应用服务器常见漏洞,如配置不当和未打补丁的软件。
|
||||||
|
|
||||||
|
-- Matt Sarrel
|
||||||
|
|
||||||
|
![](http://core0.staticworld.net/images/article/2015/09/bossies-2015-beef-100614456-orig.jpg)
|
||||||
|
|
||||||
|
### BeEF ###
|
||||||
|
|
||||||
|
Web 浏览器已经成为用于针对客户端的攻击中最常见的载体。[BeEF][15] 浏览器漏洞利用框架项目,是一种广泛使用的用以评估 Web 浏览器安全性的渗透工具。BeEF 帮助你揭露客户端系统的安全弱点,通过启动浏览器来进行客户端攻击。BeEF 建立了一个恶意网站,安全管理员用想要测试的浏览器访问该网站。然后 BeEF 发送命令来攻击 Web 浏览器并使用命令在客户端机器上植入软件。如果他们是僵尸机 ,管理员可以对客户端机器发动攻击。
|
||||||
|
|
||||||
|
BeEF 自带像键盘记录器,一个端口扫描器,和 Web 代理这样的常用模块,此外你可以编写你自己的模块或直接将命令发送到僵尸测试机。BeEF 带有少量的演示网页来帮你快速入门使得编写额外的网页和攻击模块很简单,因此你可以自定义测试你的环境。BeEF 是一个评估浏览器和终端安全、学习如何发起基于浏览器的攻击的宝贵的测试工具。可使用它来展示恶意软件通常如何感染客户端设备的演示给你的用户。
|
||||||
|
|
||||||
|
-- Matt Sarrel
|
||||||
|
|
||||||
|
![](http://images.techhive.com/images/article/2015/09/bossies-2015-unhide-100614464-orig.jpg)
|
||||||
|
|
||||||
|
### Unhide ###
|
||||||
|
|
||||||
|
[Unhide][16] 是一个定位开放的 TCP/UDP 端口和隐藏在 UNIX、Linux 和 Windows 上的进程的审查工具。隐藏的端口和进程可以是 rootkit 或 LKM(可加载的内核模块)activity 的结果。rootkit 可能很难找到并移除,因为它们被设计成隐蔽的,对操作系统和用户隐藏自己。一个 rootkit 可以使用内核模块隐藏其进程或冒充其他进程,让它在机器上运行很长一段时间而不被发现。Unhide 可以保证管理员需要的干净系统。
|
||||||
|
|
||||||
|
Unhide 实际上是两个单独的脚本:一个用于进程,一个用于端口。该工具查询正在运行的进程、线程和开放的端口并将这些信息与系统中注册的活动比较,报告之间的差异。Unhide 和 WinUnhide 是在运行命令行产生文本输出的非常轻量级的脚本。它们不算优美,但是极为有用。Unhide 还列入了 [Rootkit Hunter][17] 项目中。
|
||||||
|
|
||||||
|
-- Matt Sarrel
|
||||||
|
|
||||||
|
![](http://images.techhive.com/images/article/2015/09/bossies-2015-main-100614457-orig.jpg)
|
||||||
|
|
||||||
|
查看更多的开源软件优胜者
|
||||||
|
|
||||||
|
InfoWorld 网站的 2014 年最佳开源奖从堆栈底部到顶部庆祝了 100 多个开源项目。以下链接指向更多开源软件优胜者:
|
||||||
|
|
||||||
|
[2015 Bossie 评选:最佳开源应用程序][18]
|
||||||
|
|
||||||
|
[2015 Bossie 评选:最佳开源应用程序开发工具][19]
|
||||||
|
|
||||||
|
[2015 Bossie 评选:最佳开源大数据工具][20]
|
||||||
|
|
||||||
|
[2015 Bossie 评选:最佳开源数据中心和云计算软件][21]
|
||||||
|
|
||||||
|
[2015 Bossie 评选:最佳开源桌面和移动端软件][22]
|
||||||
|
|
||||||
|
[2015 Bossie 评选:最佳开源网络和安全软件][23]
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://www.infoworld.com/article/2982962/open-source-tools/bossie-awards-2015-the-best-open-source-networking-and-security-software.html
|
||||||
|
|
||||||
|
作者:[InfoWorld staff][a]
|
||||||
|
译者:[robot527](https://github.com/robot527)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:http://www.infoworld.com/author/InfoWorld-staff/
|
||||||
|
[1]:https://www.icinga.org/icinga/icinga-2/
|
||||||
|
[2]:http://www.zenoss.com/
|
||||||
|
[3]:http://www.opennms.org/
|
||||||
|
[4]:https://itunes.apple.com/us/app/opennms-compass/id968875097?mt=8
|
||||||
|
[5]:https://play.google.com/store/apps/details?id=com.opennms.compass&hl=en
|
||||||
|
[6]:http://blog.securityonion.net/p/securityonion.html
|
||||||
|
[7]:https://www.kali.org/
|
||||||
|
[8]:https://community.rapid7.com/community/metasploit/blog/2015/08/12/metasploit-on-kali-linux-20
|
||||||
|
[9]:http://www.openvas.org/
|
||||||
|
[10]:http://www.greenbone.net/
|
||||||
|
[11]:https://www.owasp.org/index.php/Main_Page
|
||||||
|
[12]:https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project
|
||||||
|
[13]:https://www.owasp.org/index.php/O-Saft
|
||||||
|
[14]:https://www.owasp.org/index.php/OWASP_OWTF
|
||||||
|
[15]:http://www.beefproject.com/
|
||||||
|
[16]:http://www.unhide-forensics.info/
|
||||||
|
[17]:http://www.rootkit.nl/projects/rootkit_hunter.html
|
||||||
|
[18]:http://www.infoworld.com/article/2982622/bossie-awards-2015-the-best-open-source-applications.html
|
||||||
|
[19]:http://www.infoworld.com/article/2982920/bossie-awards-2015-the-best-open-source-application-development-tools.html
|
||||||
|
[20]:http://www.infoworld.com/article/2982429/bossie-awards-2015-the-best-open-source-big-data-tools.html
|
||||||
|
[21]:http://www.infoworld.com/article/2982923/bossie-awards-2015-the-best-open-source-data-center-and-cloud-software.html
|
||||||
|
[22]:http://www.infoworld.com/article/2982630/bossie-awards-2015-the-best-open-source-desktop-and-mobile-software.html
|
||||||
|
[23]:http://www.infoworld.com/article/2982962/bossie-awards-2015-the-best-open-source-networking-and-security-software.html
|
@ -0,0 +1,200 @@
|
|||||||
|
Linux上的游戏:所有你需要知道的
|
||||||
|
================================================================================
|
||||||
|
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Gaming-on-Linux.jpeg)
|
||||||
|
|
||||||
|
** 我能在 Linux 上玩游戏吗 ?**
|
||||||
|
|
||||||
|
这是打算[投奔 Linux 阵营][1]的人最经常问的问题之一。毕竟,在 Linux 上面玩游戏经常被认为有点难以实现。事实上,一些人甚至考虑他们能不能在 Linux 上看电影或者听音乐。考虑到这些,关于 Linux 的平台的游戏的问题是很现实的。「
|
||||||
|
|
||||||
|
在本文中,我将解答大多数 Linux 新手关于在 Linux 打游戏的问题。例如 Linux 下能不能玩游戏,如果能的话,在**哪里下载游戏**或者如何获取有关游戏的信息。
|
||||||
|
|
||||||
|
但是在此之前,我需要说明一下。我不是一个 PC 上的玩家或者说我不认为我是一个在 Linux 桌面上完游玩戏的家伙。我更喜欢在 PS4 上玩游戏并且我不关心 PC 上的游戏甚至也不关心手机上的游戏(我没有给我的任何一个朋友安利糖果传奇)。这也就是你很少在 It's FOSS 上很少看见关于 [Linux 上的游戏][2]的部分。
|
||||||
|
|
||||||
|
所以我为什么要写这个主题?
|
||||||
|
|
||||||
|
因为别人问过我几次有关 Linux 上的游戏的问题并且我想要写出来一个能解答这些问题的 Linux 上的游戏指南。注意,在这里我不只是讨论 Ubuntu 上的游戏。我讨论的是在所有的 Linux 上的游戏。
|
||||||
|
|
||||||
|
### 我能在 Linux 上玩游戏吗 ? ###
|
||||||
|
|
||||||
|
是,但不是完全是。
|
||||||
|
|
||||||
|
“是”,是指你能在Linux上玩游戏;“不完全是”,是指你不能在 Linux 上玩 ’所有的游戏‘。
|
||||||
|
|
||||||
|
什么?你是拒绝的?不必这样。我的意思是你能在 Linux 上玩很多流行的游戏,比如[反恐精英以及地铁:最后的曙光][3]等。但是你可能不能玩到所有在 Windows 上流行的最新游戏,比如[实况足球2015][4]。
|
||||||
|
|
||||||
|
在我看来,造成这种情况的原因是 Linux 在桌面系统中仅占不到 2%,这占比使得大多数开发者没有在 Linux 上发布他们的游戏的打算。
|
||||||
|
|
||||||
|
这就意味指大多数近年来被提及的比较多的游戏很有可能不能在 Linux 上玩。不要灰心。我们能以某种方式在 Linux 上玩这些游戏,我们将在下面的章节中讨论这些方法。但是,在此之前,让我们看看在 Linux 上能玩的游戏的种类。
|
||||||
|
|
||||||
|
要我说的话,我会把那些游戏分为四类:
|
||||||
|
|
||||||
|
1. Linux 原生游戏
|
||||||
|
2. Linux 上的 Windows 游戏
|
||||||
|
3. 浏览器里的游戏
|
||||||
|
4. 终端里的游戏
|
||||||
|
|
||||||
|
让我们以最重要的 Linux 的原生游戏开始。
|
||||||
|
|
||||||
|
---------
|
||||||
|
|
||||||
|
### 1. 在哪里去找 Llinux 原生游戏 ?###
|
||||||
|
|
||||||
|
原生游戏指的是官方支持 Linux 的游戏。这些游戏有原生的 Linux 客户端并且能像在 Linux 上的其他软件一样不需要附加的步骤就能安装在 Linux 上面(我们将在下一节讨论)。
|
||||||
|
|
||||||
|
所以,如你所见,这里有一些为 Linux 开发的游戏,下一个问题就是在哪能找到这些游戏以及如何安装。我将列出来一些让你玩到游戏的渠道了。
|
||||||
|
|
||||||
|
#### Steam ####
|
||||||
|
|
||||||
|
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/09/Install-Steam-Ubuntu-11.jpeg)
|
||||||
|
|
||||||
|
“[Steam][5] 是一个游戏的分发平台。就如同 Kindle 是电子书的分发平台,iTunes 是音乐的分发平台一样,Steam 也具有那样的功能。它给了你购买和安装游戏,玩多人游戏以及在它的平台上关注其他游戏的选项。这些游戏被[ DRM ][6]所保护。”
|
||||||
|
|
||||||
|
两年以前,游戏平台 Steam 宣布支持 Linux,这在当时是一个大新闻。这是 Linux 上玩游戏被严肃的对待的一个迹象。尽管这个决定更多地影响了他们自己的基于 Linux 游戏平台[ Steam OS][7]。这仍然是令人欣慰的事情,因为它给 Linux 带来了一大堆游戏。
|
||||||
|
|
||||||
|
我已经写了一篇详细的关于安装以及使用 Steam 的文章。如果你想开始使用 Steam 的话,读读那篇文章。
|
||||||
|
|
||||||
|
- [在 Linux 上安装以及使用 Steam ][8]
|
||||||
|
|
||||||
|
#### GOG.com ####
|
||||||
|
|
||||||
|
[GOG.com][9] 失灵一个与 Steam 类似的平台。与 Steam 一样,你能在这上面找到数以百计的 Linux 游戏,你可以购买和安装它们。如果游戏支持好几个平台,尼卡一在多个操作系统上安装他们。你买到你账户的游戏你可以随时玩。捏可以在你想要下载的任何时间下载。
|
||||||
|
|
||||||
|
GOG.com 与 Steam 不同的是前者仅提供没有 DRM 保护的游戏以及电影。而且,GOG.com 完全是基于网页的,所以你不需要安装类似 Steam 的客户端。你只需要用浏览器下载游戏然后安装到你的系统上。
|
||||||
|
|
||||||
|
#### Portable Linux Games ####
|
||||||
|
|
||||||
|
[Portable Linux Games][10] 是一个集聚了不少 Linux 游戏的网站。这家网站最特别以及最好的就是你能离线安装这些游戏。
|
||||||
|
|
||||||
|
你下载到的文件包含所有的依赖(仅需 Wine 以及 Perl)并且他们也是与平台无关的。你所需要的仅仅是下载文件并且双击来启动安装程序。你也可以把文件储存起来以用于将来的安装,如果你网速不够快的话我很推荐您这样做。
|
||||||
|
|
||||||
|
#### Game Drift 游戏商店 ####
|
||||||
|
|
||||||
|
[Game Drift][11] 是一个只专注于游戏的基于 Ubuntu 的 Linux 发行版。但是如果你不想只为游戏就去安装这个发行版的话,你也可以经常上线看哪个游戏可以在 Linux 上运行并且安装他们。
|
||||||
|
|
||||||
|
#### Linux Game Database ####
|
||||||
|
|
||||||
|
如其名字所示,[Linux Game Database][12]是一个收集了很多 Linux 游戏的网站。你能在这里浏览诸多类型的游戏并从游戏开发者的网站下载/安装这些游戏。作为这家网站的会员,你甚至可以为游戏打分。LGDB,有点像 Linux 游戏界的 IMDB 或者 IGN.
|
||||||
|
|
||||||
|
#### Penguspy ####
|
||||||
|
|
||||||
|
此网站由一个不想用 Windows 玩游戏的玩家创立。[Penguspy][13] 聚集了一些 Linux 下最好的游戏。在这里你也能分类浏览游戏,如果你喜欢这个游戏的话,你可以跳转到游戏开发者的网站去下载安装。
|
||||||
|
|
||||||
|
#### 软件源 ####
|
||||||
|
|
||||||
|
看看你自己的发行版的软件源。那里可能有一些游戏。如果你用 Ubuntu 的话,它的软件中心里有一个游戏的分类。在一些其他的发行版里也有,比如 Liux Mint 等。
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
### 2. 如何在 Linux 上玩 Windows 的游戏 ?###
|
||||||
|
|
||||||
|
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Wine-Linux.png)
|
||||||
|
|
||||||
|
到现在为止,我们一直在讨论 Linux 的原生游戏。但是并没有很多 Linux 上的原生游戏,或者说,火的不要不要的游戏大多不支持 Linux,但是都支持 Windows PC。所以,如何在 Linux 上玩 Wendows 的游戏?
|
||||||
|
|
||||||
|
幸好,由于我们有 Wine, PlayOnLinux 和 CrossOver 等工具,我们能在 Linux 上玩不少的 Wendows 游戏。
|
||||||
|
|
||||||
|
#### Wine ####
|
||||||
|
|
||||||
|
Wine 是一个能使 Wendows 应用在类似 Linux, BSD 和 OS X 上运行的兼容层。在 Wine 的帮助下,你可以在 Linux 下安装以及使用很多 Windows 下的应用。
|
||||||
|
|
||||||
|
[在 Ubuntu 上安装 Wine][14]或者在其他 Linux 上安装 Wine 是很简单的,因为大多数发行版的软件源里都有它。这里也有一个很大的[ Wine 支持的应用的数据库][15]供您浏览。
|
||||||
|
|
||||||
|
#### CrossOver ####
|
||||||
|
|
||||||
|
[CrossOver][16] 是 Wine 的增强版,它给 Wine 提供了专业的技术上的支持。但是与 Wine 不同, CrossOver 不是免费的。你需要购买许可。好消息是它会把更新也贡献到 Wine 的开发者那里并且事实上加速了 Wine 的开发使得 Wine 能支持更多的 Windows 上的游戏和应用。如果你可以一年支付 48 美元,你可以购买 CrossOver 并得到他们提供的技术支持。
|
||||||
|
|
||||||
|
### PlayOnLinux ###
|
||||||
|
|
||||||
|
PlayOnLinux 也基于 Wine 但是执行程序的方式略有不同。它有着更好用的,不同的界面。与 Wine 一样,PlayOnLinux 也是免费使用。你可以在[开发者自己的数据库里查看它支持的应用以及游戏][17]。
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
### 3. 网页游戏 ###
|
||||||
|
|
||||||
|
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/10/Chrome-Web-Store.jpeg)
|
||||||
|
|
||||||
|
不必说你也应该知道有非常多的基于网页的游戏,这些游戏都可以在任何操作系统里运行,无论是 Windows,Linux,还是 OS X。大多数让人上瘾的手机游戏,比如[帝国之战][18]就有官方的网页版。
|
||||||
|
|
||||||
|
除了这些,还有 [Google Chrome在线商店][19],你可以在 Linux 上玩更多的这些游戏。这些 Chrome 上的游戏可以像一个单独的应用一样安装并从应用菜单中打开,一些游戏就算是离线也能运行。
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
### 4. 终端游戏 ###
|
||||||
|
|
||||||
|
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/03/nSnake_Linux_terminal_game.jpeg)
|
||||||
|
|
||||||
|
使用 Linux 的一个附加优势就是可以使用命令行终端玩游戏。我知道这不是最好的玩游戏的 方法,但是在终端里玩[贪吃蛇][20]或者 [2048][21] 很有趣。在[这个博客][21]中有一些好玩的的终端游戏。你可以浏览并安装你喜欢的游戏。
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
### 如何保证游戏的版本是最新的 ?###
|
||||||
|
|
||||||
|
当你了解了不少的在 Linux 上你可以玩到的游戏以及你如何使用他们,下一个问题就是如何保持游戏的版本是最新的。对于这件事,我建议你看看下面的博客,这些博客能告诉你 Linux 游戏世界的最新消息:
|
||||||
|
|
||||||
|
- [Gaming on Linux][23]:我认为我把它叫做 Linux 游戏的门户并没有错误。在这你可以得到关于 Linux 的游戏的最新的传言以及新闻。最近, Gaming on Linux 有了一个由 Linux 游戏爱好者组成的漂亮的社区。
|
||||||
|
- [Free Gamer][24]:一个专注于免费开源的游戏的博客。
|
||||||
|
- [Linux Game News][25]:一个提供很多的 Linux 游戏的升级的 Tumbler 博客。
|
||||||
|
|
||||||
|
#### 还有别的要说的吗? ####
|
||||||
|
|
||||||
|
我认为让你知道如何开始在 Linux 上的游戏人生是一个好事。如果你仍然不能被说服。我推荐你做个[双系统][26],把 Linux 作为你的主要桌面系统,当你想玩游戏时,重启到 Windows。这是一个对游戏妥协的解决办法。
|
||||||
|
|
||||||
|
现在,这里是你说出你自己的状况的时候了。你在 Linux 上玩游戏吗?你最喜欢什么游戏?你关注了哪些游戏博客?
|
||||||
|
|
||||||
|
|
||||||
|
投票项目:
|
||||||
|
你怎样在 Linux 上玩游戏?
|
||||||
|
|
||||||
|
- 我玩原生 Linux 游戏,我也用 Wine 以及 PlayOnLinux 运行 Windows 游戏
|
||||||
|
- 我喜欢网页游戏
|
||||||
|
- 我喜欢终端游戏
|
||||||
|
- 我只玩原生 Linux 游戏
|
||||||
|
- 我用 Steam
|
||||||
|
- 我用双系统,要玩游戏时就换到 Windows
|
||||||
|
- 我不玩游戏
|
||||||
|
|
||||||
|
注:投票代码
|
||||||
|
<div class="PDS_Poll" id="PDI_container9132962" style="display:inline-block;"></div>
|
||||||
|
<div id="PD_superContainer"></div>
|
||||||
|
<script type="text/javascript" charset="UTF-8" src="http://static.polldaddy.com/p/9132962.js"></script>
|
||||||
|
<noscript><a href="http://polldaddy.com/poll/9132962">Take Our Poll</a></noscript>
|
||||||
|
|
||||||
|
注,发布时根据情况看怎么处理
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://itsfoss.com/linux-gaming-guide/
|
||||||
|
|
||||||
|
作者:[Abhishek][a]
|
||||||
|
译者:[name1e5s](https://github.com/name1e5s)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:http://itsfoss.com/author/abhishek/
|
||||||
|
[1]:http://itsfoss.com/reasons-switch-linux-windows-xp/
|
||||||
|
[2]:http://itsfoss.com/category/games/
|
||||||
|
[3]:http://blog.counter-strike.net/
|
||||||
|
[4]:https://pes.konami.com/tag/pes-2015/
|
||||||
|
[5]:http://store.steampowered.com/
|
||||||
|
[6]:https://en.wikipedia.org/wiki/Digital_rights_management
|
||||||
|
[7]:http://itsfoss.com/valve-annouces-linux-based-gaming-operating-system-steamos/
|
||||||
|
[8]:http://itsfoss.com/install-steam-ubuntu-linux/
|
||||||
|
[9]:http://www.gog.com/
|
||||||
|
[10]:http://www.portablelinuxgames.org/
|
||||||
|
[11]:http://gamedrift.org/GameStore.html
|
||||||
|
[12]:http://www.lgdb.org/
|
||||||
|
[13]:http://www.penguspy.com/
|
||||||
|
[14]:http://itsfoss.com/wine-1-5-11-released-ppa-available-to-download/
|
||||||
|
[15]:https://appdb.winehq.org/
|
||||||
|
[16]:https://www.codeweavers.com/products/
|
||||||
|
[17]:https://www.playonlinux.com/en/supported_apps.html
|
||||||
|
[18]:http://empire.goodgamestudios.com/
|
||||||
|
[19]:https://chrome.google.com/webstore/category/apps
|
||||||
|
[20]:http://itsfoss.com/nsnake-play-classic-snake-game-linux-terminal/
|
||||||
|
[21]:http://itsfoss.com/play-2048-linux-terminal/
|
||||||
|
[22]:https://ttygames.wordpress.com/
|
||||||
|
[23]:https://www.gamingonlinux.com/
|
||||||
|
[24]:http://freegamer.blogspot.fr/
|
||||||
|
[25]:http://linuxgamenews.com/
|
||||||
|
[26]:http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/
|
@ -0,0 +1,84 @@
|
|||||||
|
安卓编年史
|
||||||
|
================================================================================
|
||||||
|
### Android 4.2,果冻豆——全新 Nexus 设备,全新平板界面 ###
|
||||||
|
|
||||||
|
安卓平台成熟的脚步越来越快,谷歌也将越来越多的应用托管到 Play 商店,需要通过系统更新来更新的应用越来越少。但是不间断的更新还是要继续的,2012 年 11 月,安卓 4.2 发布。4.2 还是叫做“果冻豆”,这个版本主要是一些少量变动。
|
||||||
|
|
||||||
|
![LG 生产的 Nexus 4 和三星生产的 Nexus 10。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/unnamed.jpg)
|
||||||
|
LG 生产的 Nexus 4 和三星生产的 Nexus 10。
|
||||||
|
Google/Ron Amadeo 供图
|
||||||
|
|
||||||
|
和安卓 4.2 一同发布的还有两部旗舰设备,Nexus 4 和 Nexus 10,都由谷歌直接在 Play 商店出售。Nexus 4 使用了 Nexus 7 的策略,令人惊讶的低价和高质量,并且无锁设备售价 300 美元。Nexus 4 有一个 4 核 1.5GHz 骁龙 S4 Pro 处理器,2GB 内存以及 1280×768 分辨率 4.7 英寸 LCD 显示屏。谷歌的新旗舰手机由 LG 生产,并和制造商一起将关注点转向了材料和质量。Nexus 4 有着正反两面双面玻璃,这会让你爱不释手,他是有史以来触感最佳的安卓手机之一。Nexus 4 最大的缺点是没有 LTE 支持,那时候大部分手机,包括 Version Galaxy Nexus 都有更快的基带。但 Nexus 4 的需求仍大大超出了谷歌的预料——发布当日大量的流量拖垮了 Play 商店网站。手机在一小时之内销售一空。
|
||||||
|
|
||||||
|
Nexus 10 是谷歌的第一部 10 英寸 Nexus 平板。该设备的亮点是 2560×1600 分辨率的显示屏,在其等级上是分辨率最高的。这背后是双核 1.7GHz Cortex A15 处理器和 2GB 内存的强力支持。随着时间一个月一个月地流逝,Nexus 10 似乎逐渐成为了第一部也是最后一部 10 英寸 Nexus 平板。通常这些设备每年都升级,但 Nexus 10 至今面世 16 个月了,可预见的未来还没有新设备的迹象。谷歌在小尺寸的 7 英寸平板上做得很出色,它似乎更倾向于让[像三星][1]这样的合作伙伴探索更大的平板家族。
|
||||||
|
|
||||||
|
![新的锁屏,壁纸,以及时钟小部件设计。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/JBvsjb.jpg)
|
||||||
|
新的锁屏,壁纸,以及时钟小部件设计。
|
||||||
|
Ron Amadeo 供图
|
||||||
|
|
||||||
|
4.2 为锁屏带来了很多变化。文字居中,并且对小时使用了较大的字重,对分钟使用了较细的字体。锁屏现在是分页的,可以自定义小部件。锁屏不仅仅是一个简单的时钟,用户还可以将其替换成其它小部件或者添加额外的页面和更多的小部件。
|
||||||
|
|
||||||
|
![锁屏的添加小部件页面,小部件列表,锁屏上的 Gmail 部件,以及滑动到相机。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/locksc2reen.jpg)
|
||||||
|
锁屏的添加小部件页面,小部件列表,锁屏上的 Gmail 部件,以及滑动到相机。
|
||||||
|
Ron Amadeo 供图
|
||||||
|
|
||||||
|
锁屏现在就像是一个精简版的主屏幕。页面轮廓会显示在锁屏的左右两侧来提示用户可以滑动到有其他小部件的页面。向左滑动页面会显示一个中间带有加号的简单空白页面,点击加号会打开兼容锁屏的小部件列表。锁屏每个页面限制一个小部件,将小部件向上或向下拖动可以展开或收起。最右侧的页面保留给了相机——一个简单的滑动就能打开相机界面,但是你没办法滑动回来。
|
||||||
|
|
||||||
|
![新的快速设置面板以及内置应用集合。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/42fix.png)
|
||||||
|
新的快速设置面板以及内置应用集合。
|
||||||
|
Ron Amadeo 供图
|
||||||
|
|
||||||
|
4.2 最大的新增特性之一就是“快速设置”面板。安卓 3.0 为平板引入了快速改变电源设置的途径,4.2 终于将这种能力带给了手机。通知中心右上角加入了一枚新图标,可以在正常的通知列表和新的快速设置之间切换。快速设置提供了对屏幕亮度,网络连接,电池以及数据用量更加快捷的访问,而不用打开完整的设置界面。安卓 4.1 中顶部的设置按钮移除掉了,快速设置中添加了一个按钮来替代它。
|
||||||
|
|
||||||
|
应用抽屉和 4.2 中的应用阵容有很多改变。得益于 Nexus 4 更宽的屏幕横纵比(5:3,Galaxy Nexus 是 16:9),应用抽屉可以显示一行五个应用图标的方阵。4.2 将自带的浏览器替换为了 Google Chrome,自带的日历换成了 Google Calendar,他们都带来了新的图标设计。时钟和相机应用在 4.2 中经过了重制,新的图标也是其中的一部分。“Google Settings”是个新应用,用于提供对系统范围内所有存在的谷歌账户设置的快捷方式,它有着和 Google Search 和 Google+ 图标一致的风格。谷歌地图拥有了新图标,谷歌纵横,以往是谷歌地图的一部分,作为对 Google+ location 的支持在这个版本退役。
|
||||||
|
|
||||||
|
![浏览器替换为 Chrome,带有全屏取景器的新相机界面。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/chroemcam.jpg)
|
||||||
|
浏览器替换为 Chrome,带有全屏取景器的新相机界面。
|
||||||
|
Ron Amadeo 供图
|
||||||
|
|
||||||
|
原自带浏览器在一段时间内对 Chrome 的模仿上下了不少功夫——它引入了许多 Chrome 的界面元素,许多 Chrome 的特性,甚至还使用了 Chrome 的 javascript 引擎——但安卓 4.2 来临的时候,谷歌认为安卓版的 Chrome 已经准备好替代这个模仿者了。表面上看起来没有多大不同;界面看起来不一样,而且早期版本的 Chrome 安卓版滚动起来没有原浏览器顺畅。不过深层次来说,一切都不一样。安卓的主浏览器开发现在由 Google Chrome 团队负责,而不是作为安卓团队的子项目存在。安卓的默认浏览器从绑定安卓版本发布停滞不前的应用变成了不断更新的 Play 商店应用。现在甚至还有一个每个月接收一些更新的 beta 通道。
|
||||||
|
|
||||||
|
相机界面经过了重新设计。它现在完全是个全屏应用,显示摄像头的实时图像并且在上面显示控制选项。布局审美和安卓 1.5 的[相机设计][2]有很多共同之处:带对焦的最小化的控制放置在取景器显示之上。中间的控制环在你长按屏幕或点击右下角圆形按钮的时候显示。你的手指保持在屏幕上时,你可以滑动来选择环上的选项,通常是展开进入一个子菜单。在高亮的选项上释放手指选中它。这灵感很明显来自于安卓 4.0 浏览器中的快速控制,但是将选项安排在一个环上意味着你的手指几乎总会挡住一部分界面。
|
||||||
|
|
||||||
|
![时钟应用,从一个只有两个界面的应用变成功能强大,实用的应用。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/clock-1.jpg)
|
||||||
|
时钟应用,从一个只有两个界面的应用变成功能强大,实用的应用。
|
||||||
|
Ron Amadeo 供图
|
||||||
|
|
||||||
|
时钟应用经过了完整的改造,从一个简单的两个界面的闹钟,到一个世界时钟,闹钟,定时器,以及秒表俱全。时钟应用的设计和谷歌之前引入的完全不同,有着极简审美和红色高亮。它看起来像是谷歌的一个试验。甚至是几个版本之后,这个设计语言似乎也仅限于这个应用。
|
||||||
|
|
||||||
|
时钟的时间选择器是经过特别精心设计的。它显示一个简单的数字盘,会智能地禁用会导致无效时间的数字。设置闹钟时间也不可能没有隐式选择选择的 AM 和 PM,永远地解决了不小心将 9am 的闹钟设置成 9pm 的问题。
|
||||||
|
|
||||||
|
![平板的新系统界面使用了延展版的手机界面。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/tablet2.jpg)
|
||||||
|
平板的新系统界面使用了延展版的手机界面。
|
||||||
|
Ron Amadeo 供图
|
||||||
|
|
||||||
|
安卓 4.2 中最有争议的改变是平板界面,从单独一个统一的底部系统栏变成带有顶部状态栏和底部系统栏的双栏设计。新设计统一了手机和平板的界面,但批评人士说将手机界面延展到 10 英寸的横向平板上是浪费空间。因为导航按键现在拥有了整个底栏,所以他们像手机界面那样被居中。
|
||||||
|
|
||||||
|
![平板上的多用户,以及新的手势键盘。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/2014-03-06-14.55.png)
|
||||||
|
平板上的多用户,以及新的手势键盘。
|
||||||
|
Ron Amadeo 供图
|
||||||
|
|
||||||
|
在平板上,安卓 4.2 带来了多用户支持。在设置里,新增了“用户”部分,你可以在这里管理一台设备上的用户。设置在每个用户账户内完成,安卓会给每个用户保存单独的设置,主屏幕,应用以及应用数据。
|
||||||
|
|
||||||
|
4.2 还添加了有滑动输入能力的键盘。用户可以将手指一直保持在屏幕上,按顺序在字母按键上滑动来输入,而不用像以前那样一个一个字母单独地输入。
|
||||||
|
|
||||||
|
----------
|
||||||
|
|
||||||
|
![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg)
|
||||||
|
|
||||||
|
[Ron Amadeo][a] / Ron是Ars Technica的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。
|
||||||
|
|
||||||
|
[@RonAmadeo][t]
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/22/
|
||||||
|
|
||||||
|
译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[1]:http://arstechnica.com/gadgets/2014/01/hands-on-with-samsungs-notepro-and-tabpro-new-screen-sizes-and-magazine-ui/
|
||||||
|
[2]:http://cdn.arstechnica.net/wp-content/uploads/2013/12/device-2013-12-26-11016071.png
|
||||||
|
[a]:http://arstechnica.com/author/ronamadeo
|
||||||
|
[t]:https://twitter.com/RonAmadeo
|
@ -0,0 +1,98 @@
|
|||||||
|
5 个适合课堂教学的树莓派项目
|
||||||
|
================================================================================
|
||||||
|
![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-open-source-yearbook-lead3.png)
|
||||||
|
|
||||||
|
图片来源 : opensource.com
|
||||||
|
|
||||||
|
### 1. Minecraft Pi ###
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/lava.png)
|
||||||
|
|
||||||
|
上图由树莓派基金会提供。遵循 [CC BY-SA 4.0.][1] 协议。
|
||||||
|
|
||||||
|
Minecraft(我的世界)几乎是世界上每个青少年都极其喜爱的游戏 —— 在吸引年轻人注意力方面,它也是最具创意的游戏之一。伴随着每一个树莓派的游戏版本不仅仅是一个关于创造性思维的建筑游戏,它还带有一个编程接口,允许使用者通过 Python 代码来与 Minecraft 世界进行互动。
|
||||||
|
|
||||||
|
对于教师来说,Minecraft: Pi 版本是一个鼓励学生们解决遇到的问题以及通过书写代码来执行特定任务的极好方式。你可以使用 Python API
|
||||||
|
来建造一所房子,让它跟随你到任何地方;或在你所到之处修建一座桥梁;又或者是下一场岩溶雨;或在天空中显示温度;以及其他任何你能想像到的事物。
|
||||||
|
|
||||||
|
可在 "[Minecraft Pi 入门][2]" 中了解更多相关内容。
|
||||||
|
|
||||||
|
### 2. 反应游戏和交通指示灯 ###
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/pi_traffic_installed_yellow_led_on.jpg)
|
||||||
|
|
||||||
|
上图由 [Low Voltage Labs][3] 提供。遵循 [CC BY-SA 4.0][1] 协议。
|
||||||
|
|
||||||
|
在树莓派上进行物理计算是非常容易的 —— 只需将 LED 灯 和按钮连接到 GPIO 针脚上,再加上少量的代码,你就可以点亮 LED 灯并通过按按钮来控制物体。一旦你知道来执行基本操作的代码,下一步就可以随你的想像那样去做了!
|
||||||
|
|
||||||
|
假如你知道如何让一盏灯闪烁,你就可以让三盏灯闪烁。选出三盏交通灯颜色的 LED 灯,你就可以编程出交通灯闪烁序列。假如你知道如何使用一个按钮来触发一个事件,然后你就有一个人行横道了!同时,你还可以找到诸如 [PI-TRAFFIC][4]、[PI-STOP][5]、[Traffic HAT][6] 等预先构建好的交通灯插件。
|
||||||
|
|
||||||
|
这不总是关于代码的 —— 它还可以被用来作为一个的练习,用以理解真实世界中的系统是如何被设计出来的。计算思维在生活中的各种情景中都是一个有用的技能。
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/reaction-game.png)
|
||||||
|
|
||||||
|
上图由树莓派基金会提供。遵循 [CC BY-SA 4.0][1] 协议。
|
||||||
|
|
||||||
|
下面尝试将两个按钮和一个 LED 灯连接起来,来制作一个二人制反应游戏 —— 让灯在一段随机的时间中点亮,然后看谁能够先按到按钮!
|
||||||
|
|
||||||
|
想了解更多的话,请查看 [GPIO 新手指南][7]。你所需要的尽在 [CamJam EduKit 1][8]。
|
||||||
|
|
||||||
|
### 3. Sense HAT 像素宠物 ###
|
||||||
|
|
||||||
|
Astro Pi— 一个增强版的树莓派 —将于今年 12 月(注:应该是去年的事了。)问世,但你并没有错过让你的手玩弄硬件的机会。Sense HAT 是一个用在 Astro Pi 任务中的感应器主板插件,且任何人都可以买到。你可以用它来做数据收集、科学实验、游戏或者更多。 观看下面这个由树莓派的 Carrie Anne 带来的 Gurl Geek Diaries 录像来开始一段美妙的旅程吧 —— 通过在 Sense HAT 的显示器上展现出你自己设计的一个动物像素宠物:
|
||||||
|
|
||||||
|
注:youtube 视频
|
||||||
|
<iframe width="520" height="315" frameborder="0" src="https://www.youtube.com/embed/gfRDFvEVz-w" allowfullscreen=""></iframe>
|
||||||
|
|
||||||
|
在 "[探索 Sense HAT][9]" 中可以学到更多。
|
||||||
|
|
||||||
|
### 4. 红外鸟箱 ###
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/ir-bird-box.png)
|
||||||
|
上图由 [Low Voltage Labs][3] 提供。遵循 [CC BY-SA 4.0][1] 协议。
|
||||||
|
|
||||||
|
让全班所有同学都能够参与进来的一个好的练习是 —— 在一个鸟箱中沿着某些红外线放置一个树莓派和 NoIR 照相模块,这样你就可以在黑暗中观看,然后通过网络或在网络中你可以从树莓派那里获取到视频流。等鸟进入笼子,然后你就可以在不打扰到它们的情况下观察它们。
|
||||||
|
|
||||||
|
在这期间,你可以学习到所有关于红外和光谱的知识,以及如何用软件来调整摄像头的焦距和控制它。
|
||||||
|
|
||||||
|
在 "[制作一个红外鸟箱][10]" 中你可以学到更多。
|
||||||
|
|
||||||
|
### 5. 机器人 ###
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/edukit3_1500-alex-eames-sm.jpg)
|
||||||
|
|
||||||
|
上图由 Low Voltage Labs 提供。遵循 [CC BY-SA 4.0][1] 协议。
|
||||||
|
|
||||||
|
拥有一个树莓派,一些感应器和一个感应器控制电路板,你就可以构建你自己的机器人。你可以制作各种类型的机器人,从用透明胶带和自制底盘组合在一起的简易四驱车,一直到由游戏控制器驱动的具有自我意识,带有传感器和摄像头的金属马儿。
|
||||||
|
|
||||||
|
学习如何直接去控制单个的发动机,例如通过 RTK Motor Controller Board (£8/$12),或者尝试新的 CamJam robotics kit (£17/$25) ,它带有发动机、轮胎和一系列的感应器 — 这些都很有价值并很有学习的潜力。
|
||||||
|
|
||||||
|
另外,如何你喜欢更为骨灰级别的东西,可以尝试 PiBorg 的 [4Borg][11] (£99/$150) 或 [DiddyBorg][12] (£180/$273) 或者一干到底,享受他们的 DoodleBorg 金属版 (£250/$380) — 并构建一个他们声名远扬的 [DoodleBorg tank][13](很不幸的时,这个没有卖的) 的迷你版。
|
||||||
|
|
||||||
|
另外请参考 [CamJam robotics kit worksheets][14]。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/education/15/12/5-great-raspberry-pi-projects-classroom
|
||||||
|
|
||||||
|
作者:[Ben Nuttall][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/bennuttall
|
||||||
|
[1]:https://creativecommons.org/licenses/by-sa/4.0/
|
||||||
|
[2]:https://opensource.com/life/15/5/getting-started-minecraft-pi
|
||||||
|
[3]:http://lowvoltagelabs.com/
|
||||||
|
[4]:http://lowvoltagelabs.com/products/pi-traffic/
|
||||||
|
[5]:http://4tronix.co.uk/store/index.php?rt=product/product&product_id=390
|
||||||
|
[6]:https://ryanteck.uk/hats/1-traffichat-0635648607122.html
|
||||||
|
[7]:http://pythonhosted.org/gpiozero/recipes/
|
||||||
|
[8]:http://camjam.me/?page_id=236
|
||||||
|
[9]:https://opensource.com/life/15/10/exploring-raspberry-pi-sense-hat
|
||||||
|
[10]:https://www.raspberrypi.org/learning/infrared-bird-box/
|
||||||
|
[11]:https://www.piborg.org/4borg
|
||||||
|
[12]:https://www.piborg.org/diddyborg
|
||||||
|
[13]:https://www.piborg.org/doodleborg
|
||||||
|
[14]:http://camjam.me/?page_id=1035#worksheets
|
198
translated/tech/20151123 Data Structures in the Linux Kernel.md
Normal file
198
translated/tech/20151123 Data Structures in the Linux Kernel.md
Normal file
@ -0,0 +1,198 @@
|
|||||||
|
Linux内核数据结构
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
基数树 Radix tree
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
正如你所知道的,Linux内核提供了许多不同的库和函数,它们实现了不同的数据结构和算法。在这部分,我们将研究其中一种数据结构——[基数树 Radix tree](http://en.wikipedia.org/wiki/Radix_tree)。在Linux内核中,有两个与基数树实现和API相关的文件:
|
||||||
|
|
||||||
|
* [include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h)
|
||||||
|
* [lib/radix-tree.c](https://github.com/torvalds/linux/blob/master/lib/radix-tree.c)
|
||||||
|
|
||||||
|
让我们讨论什么是`基数树`吧。基数树是一种`压缩的字典树`,而[字典树](http://en.wikipedia.org/wiki/Trie)是实现了关联数组接口并允许以`键值对`方式存储值的一种数据结构。该键通常是字符串,但能够使用任何数据类型。字典树因为它的节点而与`n叉树`不同。字典树的节点不存储键;相反,字典树的一个节点存储单个字符的标签。与一个给定节点关联的键可以通过从根遍历到该节点获得。举个例子:
|
||||||
|
|
||||||
|
```
|
||||||
|
+-----------+
|
||||||
|
| |
|
||||||
|
| " " |
|
||||||
|
| |
|
||||||
|
+------+-----------+------+
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
+----v------+ +-----v-----+
|
||||||
|
| | | |
|
||||||
|
| g | | c |
|
||||||
|
| | | |
|
||||||
|
+-----------+ +-----------+
|
||||||
|
| |
|
||||||
|
| |
|
||||||
|
+----v------+ +-----v-----+
|
||||||
|
| | | |
|
||||||
|
| o | | a |
|
||||||
|
| | | |
|
||||||
|
+-----------+ +-----------+
|
||||||
|
|
|
||||||
|
|
|
||||||
|
+-----v-----+
|
||||||
|
| |
|
||||||
|
| t |
|
||||||
|
| |
|
||||||
|
+-----------+
|
||||||
|
```
|
||||||
|
|
||||||
|
因此在这个例子中,我们可以看到一个有着两个键`go`和`cat`的`字典树`。压缩的字典树或者`基数树`和`字典树`不同于所有只有一个孩子的中间节点都被删除。
|
||||||
|
|
||||||
|
Linu内核中的基数树是映射值到整形键的一种数据结构。[include/linux/radix-tree.h](https://github.com/torvalds/linux/blob/master/include/linux/radix-tree.h)文件中的以下结构体表示了基数树:
|
||||||
|
|
||||||
|
```C
|
||||||
|
struct radix_tree_root {
|
||||||
|
unsigned int height;
|
||||||
|
gfp_t gfp_mask;
|
||||||
|
struct radix_tree_node __rcu *rnode;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
这个结构体表示了一个基数树的根,并包含了3个域成员:
|
||||||
|
|
||||||
|
* `height` - 树的高度;
|
||||||
|
* `gfp_mask` - 告诉如何执行动态内存分配;
|
||||||
|
* `rnode` - 孩子节点指针.
|
||||||
|
|
||||||
|
我们第一个要讨论的域是`gfp_mask`:
|
||||||
|
|
||||||
|
底层内核内存动态分配函数以一组标志作为` gfp_mask `,用于描述如何执行动态内存分配。这些控制分配进程的`GFP_`标志拥有以下值:(`GF_NOIO`标志)意味着睡眠等待内存,(`__GFP_HIGHMEM`标志)意味着高端内存能够被使用,(`GFP_ATOMIC`标志)意味着分配进程拥有高优先级并不能睡眠等等。
|
||||||
|
|
||||||
|
* `GFP_NOIO` - 睡眠等待内存
|
||||||
|
* `__GFP_HIGHMEM` - 高端内存能够被使用;
|
||||||
|
* `GFP_ATOMIC` - 分配进程拥有高优先级并且不能睡眠;
|
||||||
|
|
||||||
|
等等。
|
||||||
|
|
||||||
|
下一个域是`rnode`:
|
||||||
|
|
||||||
|
```C
|
||||||
|
struct radix_tree_node {
|
||||||
|
unsigned int path;
|
||||||
|
unsigned int count;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
struct radix_tree_node *parent;
|
||||||
|
void *private_data;
|
||||||
|
};
|
||||||
|
struct rcu_head rcu_head;
|
||||||
|
};
|
||||||
|
/* For tree user */
|
||||||
|
struct list_head private_list;
|
||||||
|
void __rcu *slots[RADIX_TREE_MAP_SIZE];
|
||||||
|
unsigned long tags[RADIX_TREE_MAX_TAGS][RADIX_TREE_TAG_LONGS];
|
||||||
|
};
|
||||||
|
```
|
||||||
|
这个结构体包含的信息有父节点中的偏移以及到底端(叶节点)的高度、孩子节点的个数以及用于访问和释放节点的域成员。这些域成员描述如下:
|
||||||
|
|
||||||
|
* `path` - 父节点中的偏移和到底端(叶节点)的高度
|
||||||
|
* `count` - 孩子节点的个数;
|
||||||
|
* `parent` - 父节点指针;
|
||||||
|
* `private_data` - 由树的用户使用;
|
||||||
|
* `rcu_head` - 用于释放节点;
|
||||||
|
* `private_list` - 由树的用户使用;
|
||||||
|
|
||||||
|
`radix_tree_node`的最后两个成员——`tags`和`slots`非常重要且令人关注。Linux内核基数树的每个节点都包含一组存储指向数据指针的slots。Linux内核基数树实现的空slots存储`NULL`值。Linux内核中的基数树也支持与`radix_tree_node`结构体的`tags`域相关联的标签。标签允许在基数树存储的记录中设置各个位。
|
||||||
|
|
||||||
|
既然我们了解了基数树的结构,那么该是时候看一下它的API了。
|
||||||
|
|
||||||
|
Linux内核基数树API
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
我们从结构体的初始化开始。有两种方法初始化一个新的基数树。第一种是使用`RADIX_TREE`宏:
|
||||||
|
|
||||||
|
```C
|
||||||
|
RADIX_TREE(name, gfp_mask);
|
||||||
|
````
|
||||||
|
|
||||||
|
正如你所看到的,我们传递`name`参数,所以使用`RADIX_TREE`宏,我们能够定义和初始化基数树为给定的名字。`RADIX_TREE`的实现是简单的:
|
||||||
|
|
||||||
|
```C
|
||||||
|
#define RADIX_TREE(name, mask) \
|
||||||
|
struct radix_tree_root name = RADIX_TREE_INIT(mask)
|
||||||
|
|
||||||
|
#define RADIX_TREE_INIT(mask) { \
|
||||||
|
.height = 0, \
|
||||||
|
.gfp_mask = (mask), \
|
||||||
|
.rnode = NULL, \
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
在`RADIX_TREE`宏的开始,我们使用给定的名字定义`radix_tree_root`结构体实例,并使用给定的mask调用`RADIX_TREE_INIT`宏。`RADIX_TREE_INIT`宏只是初始化`radix_tree_root`结构体为默认值和给定的mask而已。
|
||||||
|
|
||||||
|
第二种方法是亲手定义`radix_tree_root`结构体,并且将它和mask传给`INIT_RADIX_TREE`宏:
|
||||||
|
|
||||||
|
```C
|
||||||
|
struct radix_tree_root my_radix_tree;
|
||||||
|
INIT_RADIX_TREE(my_tree, gfp_mask_for_my_radix_tree);
|
||||||
|
```
|
||||||
|
|
||||||
|
where:
|
||||||
|
|
||||||
|
```C
|
||||||
|
#define INIT_RADIX_TREE(root, mask) \
|
||||||
|
do { \
|
||||||
|
(root)->height = 0; \
|
||||||
|
(root)->gfp_mask = (mask); \
|
||||||
|
(root)->rnode = NULL; \
|
||||||
|
} while (0)
|
||||||
|
```
|
||||||
|
|
||||||
|
和`RADIX_TREE_INIT`宏所做的初始化一样,初始化为默认值。
|
||||||
|
|
||||||
|
接下来是用于从基数树插入和删除数据的两个函数:
|
||||||
|
|
||||||
|
* `radix_tree_insert`;
|
||||||
|
* `radix_tree_delete`;
|
||||||
|
|
||||||
|
第一个函数`radix_tree_insert`需要3个参数:
|
||||||
|
|
||||||
|
* 基数树的根;
|
||||||
|
* 索引键;
|
||||||
|
* 插入的数据;
|
||||||
|
|
||||||
|
`radix_tree_delete`函数需要和`radix_tree_insert`一样的一组参数,但是没有data。
|
||||||
|
|
||||||
|
基数树的搜索以两种方法实现:
|
||||||
|
|
||||||
|
* `radix_tree_lookup`;
|
||||||
|
* `radix_tree_gang_lookup`;
|
||||||
|
* `radix_tree_lookup_slot`.
|
||||||
|
|
||||||
|
第一个函数`radix_tree_lookup`需要两个参数:
|
||||||
|
|
||||||
|
* 基数树的根;
|
||||||
|
* 索引键;
|
||||||
|
|
||||||
|
这个函数尝试在树中查找给定的键,并返回和该键相关联的记录。第二个函数`radix_tree_gang_lookup`有以下的函数签名:
|
||||||
|
|
||||||
|
```C
|
||||||
|
unsigned int radix_tree_gang_lookup(struct radix_tree_root *root,
|
||||||
|
void **results,
|
||||||
|
unsigned long first_index,
|
||||||
|
unsigned int max_items);
|
||||||
|
```
|
||||||
|
|
||||||
|
和返回记录的个数,(results指向的数据)按键排序并从第一个索引开始。返回的记录个数将不会超过`max_items`。
|
||||||
|
|
||||||
|
最后一个函数`radix_tree_lookup_slot`将会返回包含数据的slot。
|
||||||
|
|
||||||
|
链接
|
||||||
|
---------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
* [Radix tree](http://en.wikipedia.org/wiki/Radix_tree)
|
||||||
|
* [Trie](http://en.wikipedia.org/wiki/Trie)
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://github.com/0xAX/linux-insides/edit/master/DataStructures/radix-tree.md
|
||||||
|
|
||||||
|
作者:[0xAX]
|
||||||
|
译者:[cposture](https://github.com/cposture)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||||
|
|
@ -1,43 +1,43 @@
|
|||||||
Linux Desktop Fun: Summon Swarms Of Penguins To Waddle About The Desktop
|
Linux桌面趣闻:召唤一群企鹅在桌面上行走
|
||||||
================================================================================
|
================================================================================
|
||||||
XPenguins is a program for animating cute cartoons animals in your root window. By default it will be penguins they drop in from the top of the screen, walk along the tops of your windows, up the side of your windows, levitate, skateboard, and do other similarly exciting things. Now you can send an army of cute little penguins to invade the screen of someone else on your network.
|
XPenguins是一个在窗口播放可爱动物动画的程序。默认情况下,将会从屏幕上方掉落企鹅,沿着你的窗口顶部行走,在窗口变漂浮,滑板,和做其他类似的令人兴奋的事情。现在,你可以把这些可爱的小企鹅大军入侵别人的桌面了。
|
||||||
|
|
||||||
### Install XPenguins ###
|
### 安装XPenguins ###
|
||||||
|
|
||||||
Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands to install XPenguins program. First, type the command apt-get update to tell apt to refresh its package information by querying the configured repositories and then install the required program:
|
打开终端(选择程序->附件->终端),接着输入下面的命令来安装XPenguins。首先,输入apt-get update通过请求配置的仓库刷新包的信息,接着安装需要的程序:
|
||||||
|
|
||||||
$ sudo apt-get update
|
$ sudo apt-get update
|
||||||
$ sudo apt-get install xpenguins
|
$ sudo apt-get install xpenguins
|
||||||
|
|
||||||
### How do I Start XPenguins Locally? ###
|
### 我本地如何启动XPenguins? ###
|
||||||
|
|
||||||
Type the following command:
|
输入下面的命令:
|
||||||
|
|
||||||
$ xpenguins
|
$ xpenguins
|
||||||
|
|
||||||
Sample outputs:
|
示例输出:
|
||||||
|
|
||||||
![An army of cute little penguins invading the screen](http://files.cyberciti.biz/uploads/tips/2011/07/Workspace-1_002_12_07_2011.png)
|
![An army of cute little penguins invading the screen](http://files.cyberciti.biz/uploads/tips/2011/07/Workspace-1_002_12_07_2011.png)
|
||||||
|
|
||||||
An army of cute little penguins invading the screen
|
一支可爱企鹅军队正在入侵屏幕。
|
||||||
|
|
||||||
![Linux: Cute little penguins walking along the tops of your windows](http://files.cyberciti.biz/uploads/tips/2011/07/Workspace-1_001_12_07_2011.png)
|
![Linux: Cute little penguins walking along the tops of your windows](http://files.cyberciti.biz/uploads/tips/2011/07/Workspace-1_001_12_07_2011.png)
|
||||||
|
|
||||||
Linux: Cute little penguins walking along the tops of your windows
|
Linux:可爱的小企鹅沿着窗口的顶部行走。
|
||||||
|
|
||||||
![Xpenguins Screenshot](http://files.cyberciti.biz/uploads/tips/2011/07/xpenguins-screenshot.jpg)
|
![Xpenguins Screenshot](http://files.cyberciti.biz/uploads/tips/2011/07/xpenguins-screenshot.jpg)
|
||||||
|
|
||||||
Xpenguins Screenshot
|
Xpenguins截图
|
||||||
|
|
||||||
Be careful when you move windows as the little guys squash easily. If you send the program an interupt signal (Ctrl-C) they will burst.
|
移动窗口时小心点,小家伙们很容易被压坏。如果你发送中断程序(Ctrl-C),它们会爆炸。
|
||||||
|
|
||||||
### Themes ###
|
### 主题 ###
|
||||||
|
|
||||||
To list themes, enter:
|
要列出主题,输入:
|
||||||
|
|
||||||
$ xpenguins -l
|
$ xpenguins -l
|
||||||
|
|
||||||
Sample outputs:
|
示例输出:
|
||||||
|
|
||||||
Big Penguins
|
Big Penguins
|
||||||
Bill
|
Bill
|
||||||
@ -45,11 +45,11 @@ Sample outputs:
|
|||||||
Penguins
|
Penguins
|
||||||
Turtles
|
Turtles
|
||||||
|
|
||||||
You can use alternative themes as follows:
|
你可以用下面的命令使用其他的主题:
|
||||||
|
|
||||||
$ xpenguins --theme "Big Penguins" --theme "Turtles"
|
$ xpenguins --theme "Big Penguins" --theme "Turtles"
|
||||||
|
|
||||||
You can install additional themes as follows:
|
你可以用下面的命令安装额外的主题:
|
||||||
|
|
||||||
$ cd /tmp
|
$ cd /tmp
|
||||||
$ wget http://xpenguins.seul.org/xpenguins_themes-1.0.tar.gz
|
$ wget http://xpenguins.seul.org/xpenguins_themes-1.0.tar.gz
|
||||||
@ -58,7 +58,7 @@ You can install additional themes as follows:
|
|||||||
$ mv -v themes ~/.xpenguins/
|
$ mv -v themes ~/.xpenguins/
|
||||||
$ xpenguins -l
|
$ xpenguins -l
|
||||||
|
|
||||||
Sample outputs:
|
示例输出:
|
||||||
|
|
||||||
Lemmings
|
Lemmings
|
||||||
Sonic the Hedgehog
|
Sonic the Hedgehog
|
||||||
@ -71,26 +71,26 @@ Sample outputs:
|
|||||||
Penguins
|
Penguins
|
||||||
Turtles
|
Turtles
|
||||||
|
|
||||||
To start with a random theme, enter:
|
已一个随机主题开始,输入:
|
||||||
|
|
||||||
$ xpenguins --random-theme
|
$ xpenguins --random-theme
|
||||||
|
|
||||||
To load all available themes and run them simultaneously, enter:
|
要加载所有的主题并且同时运行,输入:
|
||||||
|
|
||||||
$ xpenguins --all
|
$ xpenguins --all
|
||||||
|
|
||||||
More links and information:
|
更多链接何信息:
|
||||||
|
|
||||||
- [XPenguins][1] home page.
|
- [XPenguins][1] 主页。
|
||||||
- man penguins
|
- man penguins
|
||||||
- More Linux / UNIX desktop fun with [Steam Locomotive][2] and [Terminal ASCII Aquarium][3].
|
- 更多Linux/Unix桌面乐趣在[蒸汽火车][2]和[终端ASCII水族馆][3]。
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
via: http://www.cyberciti.biz/tips/linux-cute-little-xpenguins-walk-along-tops-ofyour-windows.html
|
via: http://www.cyberciti.biz/tips/linux-cute-little-xpenguins-walk-along-tops-ofyour-windows.html
|
||||||
|
|
||||||
作者:Vivek Gite
|
作者:Vivek Gite
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
译者:[geekpi](https://github.com/geekpi)
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
@ -98,3 +98,5 @@ via: http://www.cyberciti.biz/tips/linux-cute-little-xpenguins-walk-along-tops-o
|
|||||||
[1]:http://xpenguins.seul.org/
|
[1]:http://xpenguins.seul.org/
|
||||||
[2]:http://www.cyberciti.biz/tips/displays-animations-when-accidentally-you-type-sl-instead-of-ls.html
|
[2]:http://www.cyberciti.biz/tips/displays-animations-when-accidentally-you-type-sl-instead-of-ls.html
|
||||||
[3]:http://www.cyberciti.biz/tips/linux-unix-apple-osx-terminal-ascii-aquarium.html
|
[3]:http://www.cyberciti.biz/tips/linux-unix-apple-osx-terminal-ascii-aquarium.html
|
||||||
|
|
||||||
|
|
@ -1,297 +0,0 @@
|
|||||||
|
|
||||||
怎样在ubuntu和debian中用命令行使用KVM
|
|
||||||
================================================================================
|
|
||||||
有很多不同的方式去管理运行在KVM管理程序上的虚拟机。例如,virt-manager就是一个流行的基于图形用户界面的前端虚拟机管理工具。然而,如果你想要在没有图形窗口的服务器环境下使用KVM,那么基于图形用户界面的解决方案显然是行不通的。事实上,你可以纯粹的使用包装了kvm命令行脚本的命令行来管理KVM虚拟机。作为替代方案,你可以使用virsh这个容易使用的命令行用户接口来管理客户虚拟机。在virsh中,它通过和libvirtd服务通信来达到控制虚拟机的目的,而libvirtd可以控制几个不同的虚拟机管理器,包括KVM,Xen,QEMU,LXC和OpenVZ。
|
|
||||||
当你想要对虚拟机的前期准备和后期管理实现自动化操作时,像virsh这样的命令行管理工具是非常有用的。同样,virsh支持多个管理器的事实也意味着你可以通过相同的virsh接口去管理不同的虚拟机管理器。
|
|
||||||
在这篇文章中,我会示范**怎样在ubuntu和debian上通过使用virsh命令行去运行KVM**。
|
|
||||||
|
|
||||||
### 第一步:确认你的硬件平台支持虚拟化 ###
|
|
||||||
|
|
||||||
作为第一步,首先要确认你的主机CPU配备了硬件虚拟化拓展(e.g.,Intel VT或者AMD-V),这是KVM对硬件的要求。下面的命令可以检查硬件是否支持虚拟化。
|
|
||||||
|
|
||||||
$ egrep '(vmx|svm)' --color /proc/cpuinfo
|
|
||||||
|
|
||||||
![](https://c2.staticflickr.com/2/1505/24050288606_758a44c4c6_c.jpg)
|
|
||||||
|
|
||||||
如果在输出中不包含vmx或者svm标识,那么就意味着你的主机cpu不支持硬件虚拟化。因此你不能在你的机器上使用KVM。确认了主机cpu存在vmx或者svm之后,接下来开始安装KVM。
|
|
||||||
对于KVM来说,它不要求运行在拥有64位内核系统的主机上,但是通常我们会推荐在64位系统的主机上面运行KVM。
|
|
||||||
|
|
||||||
### 第二步:安装KVM ###
|
|
||||||
|
|
||||||
使用apt-get安装KVM和相关的用户空间工具。
|
|
||||||
|
|
||||||
$ sudo apt-get install qemu-kvm libvirt-bin
|
|
||||||
|
|
||||||
安装期间,libvirtd组(在debian上是libvirtd-qemu组)将会被创建,并且你的用户id将会被自动添加到该组中。这样做的目的是让你可以以一个普通用户而不是root用户的身份去管理虚拟机。你可以使用id命令来确认这一点,下面将会告诉你怎么去显示你的组id:
|
|
||||||
|
|
||||||
$ id <your-userID>
|
|
||||||
|
|
||||||
![](https://c2.staticflickr.com/6/5597/15432586092_64dfb867d3_c.jpg)
|
|
||||||
|
|
||||||
如果因为某些原因,libvirt(在debian中是libvirt-qemu)没有在你的组id中被找到,你也可以手动将你自己添加到对应的组中,如下所示:
|
|
||||||
在ubuntu上:
|
|
||||||
|
|
||||||
$ sudo adduser [youruserID] libvirtd
|
|
||||||
|
|
||||||
在debian上:
|
|
||||||
|
|
||||||
$ sudo adduser [youruserID] libvirt-qemu
|
|
||||||
|
|
||||||
按照如下形式重修载入更新后的组成员关系。如果要求输入密码,那么输入你的登陆密码即可。
|
|
||||||
|
|
||||||
$ exec su -l $USER
|
|
||||||
|
|
||||||
这时,你应该可以以普通用户的身份去执行virsh了。做一个如下所示的测试,这个命令将会以列表的形式列出可用的虚拟机(当前的列表是空的)。如果你没有遇到权限问题,那意味着迄今为止一切都是正常的。
|
|
||||||
|
|
||||||
$ virsh list
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
Id Name State
|
|
||||||
----------------------------------------------------
|
|
||||||
|
|
||||||
### 第三步:配置桥接网络 ###
|
|
||||||
|
|
||||||
为了使KVM虚拟机能够访问外部网络,一种方法是通过在KVM宿主机上创建Linux桥来实现。创建之后的桥能够将虚拟机的虚拟网卡和宿主机的物理网卡连接起来,因此,虚拟机能够发送和接受由物理网卡发送过来的流量数据包。这种方式叫做网桥连接。
|
|
||||||
下面将告诉你如何创建并且配置网桥,我们称它为br0.
|
|
||||||
首先,安装一个必需的包,然后用命令行创建一个网桥。
|
|
||||||
|
|
||||||
$ sudo apt-get install bridge-utils
|
|
||||||
$ sudo brctl addbr br0
|
|
||||||
|
|
||||||
下一步就是配置已经创建好的网桥,即修改位于/etc/network/interfaces的配置文件。我们需要将该桥接网卡设置成开机启动。为了修改该配置文件,你需要关闭你的操作系统上的网络管理器(如果你在使用它的话)。跟随[操作指南][1]的说明去关闭网络管理器。
|
|
||||||
关闭网络管理器之后,接下来就是通过修改配置文件来配置网桥了。
|
|
||||||
|
|
||||||
#auto eth0
|
|
||||||
#iface eth0 inet dhcp
|
|
||||||
|
|
||||||
auto br0
|
|
||||||
iface br0 inet dhcp
|
|
||||||
bridge_ports eth0
|
|
||||||
bridge_stp off
|
|
||||||
bridge_fd 0
|
|
||||||
bridge_maxwait 0
|
|
||||||
|
|
||||||
|
|
||||||
在上面的配置中,我假设eth0是主要网卡,它也是连接到外网的网卡,同样,我假设eth0将会通过DHCP得到它的ip地址。注意,之前在/etc/network/interfaces中还没有对eth0进行任何配置。桥接网卡br0引用了eth0的配置,而eth0也会受到br0的制约。
|
|
||||||
重启网络服务,并确认网桥已经被成功的配置好。如果成功的话,br0的ip地址将会是eth0的被自动分配的ip地址,而且eth0不会被分配任何ip地址。
|
|
||||||
|
|
||||||
$ sudo /etc/init.d/networking restart
|
|
||||||
$ ifconfig
|
|
||||||
|
|
||||||
如果因为某些原因,eth0仍然保留了之前分配给了br0的ip地址,那么你可能必须明确的删除eth0的ip地址。
|
|
||||||
|
|
||||||
![](https://c2.staticflickr.com/2/1698/23780708850_66cd7ba6ea_c.jpg)
|
|
||||||
|
|
||||||
###第四步:用命令行创建一个虚拟机 ###
|
|
||||||
|
|
||||||
对于虚拟机来说,它的配置信息被存储在它对应的xml文件中。因此,创建一个虚拟机的第一步就是准备一个与主机名对应的xml文件。
|
|
||||||
下面是一个示例xml文件,你可以根据需要手动修改它。
|
|
||||||
|
|
||||||
<domain type='kvm'>
|
|
||||||
<name>alice</name>
|
|
||||||
<uuid>f5b8c05b-9c7a-3211-49b9-2bd635f7e2aa</uuid>
|
|
||||||
<memory>1048576</memory>
|
|
||||||
<currentMemory>1048576</currentMemory>
|
|
||||||
<vcpu>1</vcpu>
|
|
||||||
<os>
|
|
||||||
<type>hvm</type>
|
|
||||||
<boot dev='cdrom'/>
|
|
||||||
</os>
|
|
||||||
<features>
|
|
||||||
<acpi/>
|
|
||||||
</features>
|
|
||||||
<clock offset='utc'/>
|
|
||||||
<on_poweroff>destroy</on_poweroff>
|
|
||||||
<on_reboot>restart</on_reboot>
|
|
||||||
<on_crash>destroy</on_crash>
|
|
||||||
<devices>
|
|
||||||
<emulator>/usr/bin/kvm</emulator>
|
|
||||||
<disk type="file" device="disk">
|
|
||||||
<driver name="qemu" type="raw"/>
|
|
||||||
<source file="/home/dev/images/alice.img"/>
|
|
||||||
<target dev="vda" bus="virtio"/>
|
|
||||||
<address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
|
|
||||||
</disk>
|
|
||||||
<disk type="file" device="cdrom">
|
|
||||||
<driver name="qemu" type="raw"/>
|
|
||||||
<source file="/home/dev/iso/CentOS-6.5-x86_64-minimal.iso"/>
|
|
||||||
<target dev="hdc" bus="ide"/>
|
|
||||||
<readonly/>
|
|
||||||
<address type="drive" controller="0" bus="1" target="0" unit="0"/>
|
|
||||||
</disk>
|
|
||||||
<interface type='bridge'>
|
|
||||||
<source bridge='br0'/>
|
|
||||||
<mac address="00:00:A3:B0:56:10"/>
|
|
||||||
</interface>
|
|
||||||
<controller type="ide" index="0">
|
|
||||||
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/>
|
|
||||||
</controller>
|
|
||||||
<input type='mouse' bus='ps2'/>
|
|
||||||
<graphics type='vnc' port='-1' autoport="yes" listen='0.0.0.0'/>
|
|
||||||
<console type='pty'>
|
|
||||||
<target port='0'/>
|
|
||||||
</console>
|
|
||||||
</devices>
|
|
||||||
</domain>
|
|
||||||
|
|
||||||
上面的主机xml配置文件定义了如下的虚拟机内容。
|
|
||||||
|
|
||||||
- 1GB内存,一个虚拟cpu和一个硬件驱动。
|
|
||||||
- Disk image:/home/dev/images/alice.img。
|
|
||||||
- Boot from CD-ROM(/home/dev/iso/CentOS-6.5-x86_64-minomal.iso)。
|
|
||||||
- Networking:一个桥接到br0的虚拟网卡。
|
|
||||||
- 通过VNC远程访问。
|
|
||||||
<uuid></uuid>中的UUID字符串可以随机生成。为了得到一个随机的uuid字符串,你可能需要使用uuid命令行工具。
|
|
||||||
|
|
||||||
$ sudo apt-get install uuid
|
|
||||||
$ uuid
|
|
||||||
|
|
||||||
生成一个主机xml配置文件的方式就是通过一个已经存在的虚拟机来导出它的xml配置文件。如下所示。
|
|
||||||
|
|
||||||
$ virsh dumpxml alice > bob.xml
|
|
||||||
|
|
||||||
![](https://c2.staticflickr.com/6/5808/23968234602_25e8019ec8_c.jpg)
|
|
||||||
|
|
||||||
###第五步:使用命令行启动虚拟机###
|
|
||||||
|
|
||||||
在启动虚拟机之前,我们需要创建它的初始磁盘镜像。为此,你需要使用qemu-img命令来生成一个你已经安装的qemu-kvm镜像。下面的命令将会创建10GB大小的空磁盘,并且它是qcow2格式的。
|
|
||||||
|
|
||||||
$ qemu-img create -f qcow2 /home/dev/images/alice.img 10G
|
|
||||||
|
|
||||||
使用qcow2格式的磁盘镜像的好处就是它在创建之初并不会给它分配全部大小磁盘容量(这里是10GB),而是随着虚拟机中文件的增加而逐渐增大。因此,它对空间的使用更加有效。
|
|
||||||
现在,你可以准备通过使用之前创建的xml配置文件启动你的虚拟机了。下面的命令将会创建一个虚拟机,然后自动启动它。
|
|
||||||
|
|
||||||
$ virsh create alice.xml
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
Domain alice created from alice.xml
|
|
||||||
|
|
||||||
**注意**:如果你对一个已经存在的虚拟机运行了上面的命令,那么这个操作将会在没有警告信息的情况下抹去那个已经存在的虚拟机的全部信息。如果你已经创建了一个虚拟机,你可能会使用下面的命令来启动虚拟机。
|
|
||||||
|
|
||||||
$ virsh start alice.xml
|
|
||||||
|
|
||||||
使用如下命令确认一个新的虚拟机已经被创建并成功的被启动。
|
|
||||||
|
|
||||||
$ virsh list
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
Id Name State
|
|
||||||
----------------------------------------------------
|
|
||||||
3 alice running
|
|
||||||
|
|
||||||
同样,使用如下命令确认你的虚拟机的虚拟网卡已经被成功的添加到了你先前创建的br0网桥中。
|
|
||||||
|
|
||||||
$ sudo brctl show
|
|
||||||
|
|
||||||
![](https://c2.staticflickr.com/2/1546/23449585383_a371e9e579_c.jpg)
|
|
||||||
|
|
||||||
### 远程连接虚拟机 ###
|
|
||||||
|
|
||||||
为了远程访问一个正在运行的虚拟机的控制台,你可以使用VNC客户端。
|
|
||||||
首先,你需要使用如下命令找出用于虚拟机的VNC端口号。
|
|
||||||
|
|
||||||
$ sudo netstat -nap | egrep '(kvm|qemu)'
|
|
||||||
|
|
||||||
![](https://c2.staticflickr.com/6/5633/23448144274_49045bc868_c.jpg)
|
|
||||||
|
|
||||||
在这个例子中,用于alice虚拟机的VNC端口号是5900
|
|
||||||
然后启动一个VNC客户端,连接到一个端口号为5900的VNC服务器。在我们的例子中,虚拟机支持由CentOS光盘文件启动。
|
|
||||||
|
|
||||||
![](https://c2.staticflickr.com/2/1533/24076369675_99408972a4_c.jpg)
|
|
||||||
|
|
||||||
### 使用virsh管理虚拟机 ###
|
|
||||||
|
|
||||||
下面列出了virsh命令的常规用法
|
|
||||||
创建客户机并且启动虚拟机:
|
|
||||||
|
|
||||||
$ virsh create alice.xml
|
|
||||||
|
|
||||||
停止虚拟机并且删除客户机
|
|
||||||
|
|
||||||
$ virsh destroy alice
|
|
||||||
|
|
||||||
关闭虚拟机(不用删除它)
|
|
||||||
|
|
||||||
$ virsh shutdown alice
|
|
||||||
|
|
||||||
暂停虚拟机
|
|
||||||
|
|
||||||
$ virsh suspend alice
|
|
||||||
|
|
||||||
恢复虚拟机
|
|
||||||
|
|
||||||
$ virsh resume alice
|
|
||||||
|
|
||||||
访问正在运行的虚拟机的登陆控制台
|
|
||||||
|
|
||||||
$ virsh console alice
|
|
||||||
|
|
||||||
设置虚拟机开机启动:
|
|
||||||
|
|
||||||
$ virsh autostart alice
|
|
||||||
|
|
||||||
查看虚拟机的详细信息
|
|
||||||
|
|
||||||
$ virsh dominfo alice
|
|
||||||
|
|
||||||
编辑虚拟机的配置文件:
|
|
||||||
|
|
||||||
$ virsh edit alice
|
|
||||||
|
|
||||||
上面的这个命令将会使用一个默认的编辑器来调用主机配置文件。该配置文件中的任何改变都将自动被libvirt验证其正确性。
|
|
||||||
你也可以在一个virsh会话中管理虚拟机。下面的命令会创建并进入到一个virsh会话中:
|
|
||||||
|
|
||||||
$ virsh
|
|
||||||
在virsh提示中,你可以使用任何virsh命令。
|
|
||||||
|
|
||||||
![](https://c2.staticflickr.com/6/5645/23708565129_b1ef968b30_c.jpg)
|
|
||||||
|
|
||||||
### 问题处理 ###
|
|
||||||
|
|
||||||
1. 我在创建虚拟机的时候遇到了一个错误:
|
|
||||||
|
|
||||||
error: internal error: no supported architecture for os type 'hvm'
|
|
||||||
|
|
||||||
如果你的硬件不支持虚拟化的话你可能就会遇到这个错误。(例如,Intel VT或者AMD-V),这是运行KVM所必需的。如果你遇到了这个错误,而你的cpu支持虚拟化,那么这里可以给你一些可用的解决方案:
|
|
||||||
|
|
||||||
首先,检查你的内核模块是否丢失。
|
|
||||||
|
|
||||||
$ lsmod | grep kvm
|
|
||||||
|
|
||||||
如果内核模块没有加载,你必须按照如下方式加载它。
|
|
||||||
|
|
||||||
$ sudo modprobe kvm_intel (for Intel processor)
|
|
||||||
$ sudo modprobe kvm_amd (for AMD processor)
|
|
||||||
|
|
||||||
第二个解决方案就是添加“--connect qemu:///system”参数到virsh命令中,如下所示。当你正在你的硬件平台上使用超过一个虚拟机管理器的时候就需要添加这个参数(例如,VirtualBox,VMware)。
|
|
||||||
$ virsh --connect qemu:///system create alice.xml
|
|
||||||
|
|
||||||
2. 当我试着访问我的虚拟机的登陆控制台的时候遇到了错误:
|
|
||||||
|
|
||||||
$ virsh console alice
|
|
||||||
|
|
||||||
----------
|
|
||||||
|
|
||||||
error: internal error: cannot find character device <null>
|
|
||||||
|
|
||||||
这个错误发生的原因是你没有在你的虚拟机配置文件中定义控制台设备。在xml文件中加上下面的内部设备部分即可。
|
|
||||||
|
|
||||||
<console type='pty'>
|
|
||||||
<target port='0'/>
|
|
||||||
</console>
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: http://xmodulo.com/use-kvm-command-line-debian-ubuntu.html
|
|
||||||
|
|
||||||
作者:[Dan Nanni][a]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]:http://xmodulo.com/author/nanni
|
|
||||||
[1]:http://xmodulo.com/disable-network-manager-linux.html
|
|
@ -0,0 +1,210 @@
|
|||||||
|
[Translated] Haohong Wang
|
||||||
|
如何在Ubuntu 15.04/CentOS 7中安装Lighttpd Web server
|
||||||
|
=================================================================================
|
||||||
|
Lighttpd 是一款开源Web服务器软件。Lighttpd 安全快速,符合行业标准,适配性强并且针对高配置环境进行了优化。Lighttpd因其CPU、内存占用小,针对小型CPU加载的快速适配以及出色的效率和速度而从众多Web服务器中脱颖而出。 而Lighttpd诸如FastCGI,CGI,Auth,Out-Compression,URL-Rewriting等高级功能更是那些低配置的服务器的福音。
|
||||||
|
|
||||||
|
以下便是在我们运行Ubuntu 15.04 或CentOS 7 Linux发行版的机器上安装Lighttpd Web服务器的简要流程。
|
||||||
|
|
||||||
|
### 安装Lighttpd
|
||||||
|
|
||||||
|
#### 使用包管理器安装
|
||||||
|
|
||||||
|
这里我们通过使用包管理器这种最简单的方法来安装Lighttpd。只需以sudo模式在终端或控制台中输入下面的指令即可。
|
||||||
|
|
||||||
|
**CentOS 7**
|
||||||
|
|
||||||
|
由于CentOS 7.0官方repo中并没有提供Lighttpd,所以我们需要在系统中安装额外的软件源epel repo。使用下面的yum指令来安装epel。
|
||||||
|
|
||||||
|
# yum install epel-release
|
||||||
|
|
||||||
|
然后,我们需要更新系统及进程为Lighttpd的安装做准备。
|
||||||
|
|
||||||
|
# yum update
|
||||||
|
# yum install lighttpd
|
||||||
|
|
||||||
|
![Install Lighttpd Centos](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-centos.png)
|
||||||
|
|
||||||
|
**Ubuntu 15.04**
|
||||||
|
|
||||||
|
Ubuntu 15.04官方repo中包含了Lighttpd,所以只需更新本地repo并使用apt-get指令即可安装Lighttpd。
|
||||||
|
|
||||||
|
# apt-get update
|
||||||
|
# apt-get install lighttpd
|
||||||
|
|
||||||
|
![Install lighttpd ubuntu](http://blog.linoxide.com/wp-content/uploads/2016/02/install-lighttpd-ubuntu.png)
|
||||||
|
|
||||||
|
#### 从源代码安装Lighttpd
|
||||||
|
|
||||||
|
如果想从Lighttpd源码安装最新版本(例如1.4.39),我们需要在本地编译源码并进行安装。首先我们要安装编译源码所需的依赖包。
|
||||||
|
|
||||||
|
# cd /tmp/
|
||||||
|
# wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.39.tar.gz
|
||||||
|
|
||||||
|
下载完成后,执行下面的指令解压缩。
|
||||||
|
|
||||||
|
# tar -zxvf lighttpd-1.4.39.tar.gz
|
||||||
|
|
||||||
|
然后使用下面的指令进行编译。
|
||||||
|
|
||||||
|
# cd lighttpd-1.4.39
|
||||||
|
# ./configure
|
||||||
|
# make
|
||||||
|
|
||||||
|
**注:**在这份教程中,我们安装的是默认配置的Lighttpd。其他诸如高级功能或拓展功能,如对SSL的支持,mod_rewrite,mod_redirect等,需自行配置。
|
||||||
|
|
||||||
|
当编译完成后,我们就可以把它安装到系统中了。
|
||||||
|
|
||||||
|
# make install
|
||||||
|
|
||||||
|
### 设置Lighttpd
|
||||||
|
|
||||||
|
如果有更高的需求,我们可以通过修改默认设置文件,如`/etc/lighttpd/lighttpd.conf`,来对Lighttpd进行进一步设置。 而在这份教程中我们将使用默认设置,不对设置文件进行修改。如果你曾做过修改并想检查设置文件是否出错,可以执行下面的指令。
|
||||||
|
|
||||||
|
# lighttpd -t -f /etc/lighttpd/lighttpd.conf
|
||||||
|
|
||||||
|
#### 使用 CentOS 7
|
||||||
|
|
||||||
|
在CentOS 7中,我们需在Lighttpd默认设置中创设一个例如`/src/www/htdocs`的webroot文件夹。
|
||||||
|
|
||||||
|
# mkdir -p /srv/www/htdocs/
|
||||||
|
|
||||||
|
而后将默认欢迎页面从`/var/www/lighttpd`复制至刚刚新建的目录中:
|
||||||
|
|
||||||
|
# cp -r /var/www/lighttpd/* /srv/www/htdocs/
|
||||||
|
|
||||||
|
### 开启服务
|
||||||
|
|
||||||
|
现在,通过执行systemctl指令来重启数据库服务。
|
||||||
|
|
||||||
|
# systemctl start lighttpd
|
||||||
|
|
||||||
|
然后我们将它设置为伴随系统启动自动运行。
|
||||||
|
|
||||||
|
# systemctl enable lighttpd
|
||||||
|
|
||||||
|
### 设置防火墙
|
||||||
|
|
||||||
|
如要让我们运行在Lighttpd上的网页和网站能在Internet或相似的网络上被访问,我们需要在防火墙程序中设置打开80端口。由于CentOS 7和Ubuntu15.04都附带Systemd作为默认初始化系统,所以我们安装firewalld作为解决方案。如果要打开80端口或http服务,我们只需执行下面的命令:
|
||||||
|
|
||||||
|
# firewall-cmd --permanent --add-service=http
|
||||||
|
success
|
||||||
|
# firewall-cmd --reload
|
||||||
|
success
|
||||||
|
|
||||||
|
### 连接至Web Server
|
||||||
|
在将80端口设置为默认端口后,我们就可以默认直接访问Lighttpd的欢迎页了。我们需要根据运行Lighttpd的设备来设置浏览器的IP地址和域名。在本教程中,我们令浏览器指向 [http://lighttpd.linoxide.com/](http://lighttpd.linoxide.com/) 同时将子域名指向它的IP地址。如此一来,我们就可以在浏览器中看到如下的欢迎页面了。
|
||||||
|
|
||||||
|
![Lighttpd Welcome Page](http://blog.linoxide.com/wp-content/uploads/2016/02/lighttpd-welcome-page.png)
|
||||||
|
|
||||||
|
此外,我们可以将网站的文件添加到webroot目录下,并删除lighttpd的默认索引文件,使我们的静态网站链接至互联网上。
|
||||||
|
|
||||||
|
如果想在Lighttpd Web Server中运行PHP应用,请参考下面的步骤:
|
||||||
|
|
||||||
|
### 安装PHP5模块
|
||||||
|
在Lighttpd成功安装后,我们需要安装PHP及相关模块以在Lighttpd中运行PHP5脚本。
|
||||||
|
|
||||||
|
#### 使用 Ubuntu 15.04
|
||||||
|
|
||||||
|
# apt-get install php5 php5-cgi php5-fpm php5-mysql php5-curl php5-gd php5-intl php5-imagick php5-mcrypt php5-memcache php-pear
|
||||||
|
|
||||||
|
#### 使用 CentOS 7
|
||||||
|
|
||||||
|
# yum install php php-cgi php-fpm php-mysql php-curl php-gd php-intl php-pecl-imagick php-mcrypt php-memcache php-pear lighttpd-fastcgi
|
||||||
|
|
||||||
|
### 设置Lighttpd的PHP服务
|
||||||
|
|
||||||
|
如要让PHP与Lighttpd协同工作,我们只要根据所使用的发行版执行如下对应的指令即可。
|
||||||
|
|
||||||
|
#### 使用 CentOS 7
|
||||||
|
|
||||||
|
首先要做的便是使用文件编辑器编辑php设置文件(例如`/etc/php.ini`)并取消掉对**cgi.fix_pathinfo=1**的注释。
|
||||||
|
|
||||||
|
# nano /etc/php.ini
|
||||||
|
|
||||||
|
完成上面的步骤之后,我们需要把PHP-FPM进程的所有权从Apache转移至Lighttpd。要完成这些,首先用文件编辑器打开`/etc/php-fpm.d/www.conf`文件。
|
||||||
|
|
||||||
|
# nano /etc/php-fpm.d/www.conf
|
||||||
|
|
||||||
|
然后在文件中增加下面的语句:
|
||||||
|
|
||||||
|
user = lighttpd
|
||||||
|
group = lighttpd
|
||||||
|
|
||||||
|
做完这些,我们保存并退出文本编辑器。然后从`/etc/lighttpd/modules.conf`设置文件中添加FastCGI模块。
|
||||||
|
|
||||||
|
# nano /etc/lighttpd/modules.conf
|
||||||
|
|
||||||
|
然后,去掉下面语句前面的`#`来取消对它的注释。
|
||||||
|
|
||||||
|
include "conf.d/fastcgi.conf"
|
||||||
|
|
||||||
|
最后我们还需在文本编辑器设置FastCGI的设置文件。
|
||||||
|
|
||||||
|
# nano /etc/lighttpd/conf.d/fastcgi.conf
|
||||||
|
|
||||||
|
在文件尾部添加以下代码:
|
||||||
|
|
||||||
|
fastcgi.server += ( ".php" =>
|
||||||
|
((
|
||||||
|
"host" => "127.0.0.1",
|
||||||
|
"port" => "9000",
|
||||||
|
"broken-scriptfilename" => "enable"
|
||||||
|
))
|
||||||
|
)
|
||||||
|
|
||||||
|
在编辑完成后保存并退出文本编辑器即可。
|
||||||
|
|
||||||
|
#### 使用 Ubuntu 15.04
|
||||||
|
|
||||||
|
如需启用Lighttpd的FastCGI,只需执行下列代码:
|
||||||
|
|
||||||
|
# lighttpd-enable-mod fastcgi
|
||||||
|
|
||||||
|
Enabling fastcgi: ok
|
||||||
|
Run /etc/init.d/lighttpd force-reload to enable changes
|
||||||
|
|
||||||
|
# lighttpd-enable-mod fastcgi-php
|
||||||
|
|
||||||
|
Enabling fastcgi-php: ok
|
||||||
|
Run `/etc/init.d/lighttpd` force-reload to enable changes
|
||||||
|
|
||||||
|
然后,执行下列命令来重启Lighttpd。
|
||||||
|
|
||||||
|
# systemctl force-reload lighttpd
|
||||||
|
|
||||||
|
### 检测PHP工作状态
|
||||||
|
|
||||||
|
如需检测PHP是否按预期工作,我们需在Lighttpd的webroot目录下新建一个php文件。本教程中,在Ubuntu下/var/www/html 目录,CentOS下/src/www/htdocs目录下使用文本编辑器创建并打开info.php。
|
||||||
|
|
||||||
|
**使用 CentOS 7**
|
||||||
|
|
||||||
|
# nano /var/www/info.php
|
||||||
|
|
||||||
|
**使用 Ubuntu 15.04**
|
||||||
|
|
||||||
|
# nano /srv/www/htdocs/info.php
|
||||||
|
|
||||||
|
然后只需将下面的语句添加到文件里即可。
|
||||||
|
|
||||||
|
<?php phpinfo(); ?>
|
||||||
|
|
||||||
|
在编辑完成后保存并推出文本编辑器即可。
|
||||||
|
|
||||||
|
现在,我们需根据路径 [http://lighttpd.linoxide.com/info.php](http://lighttpd.linoxide.com/info.php) 下的info.php文件的IP地址或域名,来让我们的网页浏览器指向系统上运行的Lighttpd。如果一切都按照以上说明进行,我们将看到如下图所示的PHP页面信息。
|
||||||
|
|
||||||
|
![phpinfo lighttpd](http://blog.linoxide.com/wp-content/uploads/2016/02/phpinfo-lighttpd.png)
|
||||||
|
|
||||||
|
### 总结
|
||||||
|
|
||||||
|
至此,我们已经在CentOS 7和Ubuntu 15.04 Linux 发行版上成功安装了轻巧快捷并且安全的Lighttpd Web服务器。现在,我们已经可以利用Lighttpd Web服务器来实现上传网站文件到网站根目录,配置虚拟主机,启用SSL,连接数据库,运行Web应用等功能了。 如果你有任何疑问,建议或反馈请在下面的评论区中写下来以让我们更好的改良Lighttpd。谢谢!(译注:评论网址 http://linoxide.com/linux-how-to/setup-lighttpd-web-server-ubuntu-15-04-centos-7/ )
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://linoxide.com/linux-how-to/setup-lighttpd-web-server-ubuntu-15-04-centos-7/
|
||||||
|
|
||||||
|
作者:[Arun Pyasi][a]
|
||||||
|
译者:[HaohongWANG](https://github.com/HaohongWANG)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:http://linoxide.com/author/arunp/
|
@ -0,0 +1,34 @@
|
|||||||
|
Intel展示了带动大屏幕Linux的便宜Android手机
|
||||||
|
==============================================================
|
||||||
|
|
||||||
|
![](https://regmedia.co.uk/2016/02/23/intel-bigscreen.jpg?x=648&y=348&crop=1)
|
||||||
|
|
||||||
|
在世界移动会议**MWC16**上Intel展示了称之为“大屏体验”的一款的Android智能手机,它在插入一个外部显示后运行了一个完整的Linux桌面。
|
||||||
|
|
||||||
|
这个概念大体上与微软在Windows 10手机中的Continuum相似,但是Continuum面向的是高端设备,Intel的项目面向的是低端智能机何新兴市场。
|
||||||
|
|
||||||
|
显示上Barcelona是拥有Atom x3、2GB RAM和16GB存储以及支持外部显示的的SoFIA(Intel架构的只能或功能手机)智能机原型。插上键盘、鼠标何显示,它就变成了一台桌面Linux,可以选择在大屏幕中显示Android桌面。
|
||||||
|
|
||||||
|
Intel的拓荒小组经理Nir Metzer告诉Reg:“Android基于Linux内核,因此我们运行的是一个内核,我们有一个Android栈和一个Linux栈,并且我们共享一个上下文,因此文件系统是相同的。电话是全功能的。”
|
||||||
|
|
||||||
|
Metzer说:“我有一个多窗口环境。只要我插入后就可以做电子表格,我可以拖拽、播放音频。在一个低端平台实现这一切是一个挑战。”
|
||||||
|
|
||||||
|
现在当连上外部显示器时设备的屏幕显示的空白,但是Metzer说下个版本的Atom X3会支持双显示。
|
||||||
|
|
||||||
|
使用的Linux版本是由Intel维护的。Metzer说:“我们需要将Linux和Android保持一致。框架是预安装的,你不能下载任何app”
|
||||||
|
|
||||||
|
英特尔在移动世界大会上向手机制造商们推销这一想法,但却没有实际报告购买该设备的消费者。Metzer说:“芯片已经准备好了,已经为量产准备好了。这可以明天进入生产。这是一个商业决定。”
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://www.theregister.co.uk/2016/02/23/move_over_continuum_intel_shows_android_smartphone_powering_bigscreen_linux/
|
||||||
|
|
||||||
|
作者:[Tim Anderson][a]
|
||||||
|
译者:[geekpi](https://github.com/geekpi)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:http://www.theregister.co.uk/Author/2878
|
||||||
|
|
||||||
|
|
41
选题模板.txt
Normal file
41
选题模板.txt
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
选题标题格式:
|
||||||
|
|
||||||
|
原文日期 标题.md
|
||||||
|
|
||||||
|
正文内容:
|
||||||
|
|
||||||
|
标题
|
||||||
|
=======
|
||||||
|
|
||||||
|
### 子一级标题
|
||||||
|
|
||||||
|
正文
|
||||||
|
|
||||||
|
#### 子二级标题
|
||||||
|
|
||||||
|
正文内容
|
||||||
|
|
||||||
|
![](图片地址)
|
||||||
|
|
||||||
|
### 子一级标题
|
||||||
|
|
||||||
|
正文内容 : I have a [dream][1]。
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: 原文地址
|
||||||
|
|
||||||
|
作者:[作者名][a]
|
||||||
|
译者:[译者ID](https://github.com/译者ID)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: 作者介绍地址
|
||||||
|
[1]: 引文链接地址
|
||||||
|
|
||||||
|
说明:
|
||||||
|
1. 标题层级很多时从 “##” 开始
|
||||||
|
2. 引文链接地址在下方集中写
|
||||||
|
|
Loading…
Reference in New Issue
Block a user