Merge pull request #53 from LCTT/master

Update
This commit is contained in:
joeren 2017-01-21 10:05:17 +08:00 committed by GitHub
commit 62b93ea074
10 changed files with 460 additions and 462 deletions

View File

@ -1,32 +1,33 @@
2016 年编程趋势
2016 年编程语言发展趋势
============================================================
### 回顾年度最热门的 AI 项目语言、新语言和更多编程趋势。
> 回顾年度最热门的 AI 项目和容器的编程语言、新出现的编程语言,和更多编程趋势。
![Top programming trends in 2016](https://opensource.com/sites/default/files/styles/image-full-size/public/u23316/climb-top-bridge-yearbook_red.png?itok=YITYmpoR "Top programming trends in 2016")
图片提供:[Museum of Photographic Arts][6]。由 Opensource.com 修改。 CC BY-SA 4.0
技术在不断前进 - 可能不总是向前,但总是在变动。即使对于那些关注趋势及其对程序员的影响的人来说,确切地了解技术的方向也是一个挑战。我们总是在秋天才能够清晰地看出当年开源编程趋势,那是我与我的同事Kelsey Hightower 和 Scott Hanselman以及我们非常棒的编程委员会筹备来年的 [OSCON] [7]O'Reilly 开源大会)的时候。我们获得的建议和对特定主题的关注数量是开源世界热门趋势的良好指标。以下是我们在 2016 年看到的顶级编程趋势的概述。
技术在不断前进 - 可能不总是向前,但总是在变动。即使对于那些关注发展趋势及其对程序员的影响的人来说,确切地了解技术的方向也是一个挑战。我们总是在每年秋季才能够清晰地看出当年开源编程趋势,那时我与我的同事Kelsey Hightower 和 Scott Hanselman以及我们非常棒的编程委员会正在筹备来年的 [OSCON] [7]O'Reilly 开源大会)。我们获得的建议和对特定主题的关注数量是反映开源世界热门趋势的良好指标。以下是我们在 2016 年看到的顶级编程趋势的概述。
### 语言驱动 AI
### 编程语言驱动 AI
走出 20 世纪 90 年代的人工智能冬季,人工智能随着它所依赖的计算能力的提升再次出现,影响着我们如何构建软件。机器学习、深度学习、自然语言处理和自动语音识别覆盖了世界各地 - 从 GitHub 的项目和工作岗位到新公司成立背后的原因以及清除我们杂乱的台面Hey, Alexa!)。[LCTT 译注Alexa 是预装在亚马逊 Echo 内的个人虚拟助手,可以接收及相应语音命令,可被看成是亚马逊版的 Siri 语音助手。用户只需要说一声“Alexa”就可以创建各种任务还可以和各种智能家居设备进行交互。] 是的,即使像 OSCON 这样的会议都处处提及 <ruby>“万物皆智能”<rt>all things AI</rt></ruby> 。虽然计算能力的提升已经铺平了道路,所有关于 all things AI 的开源已经引起了行业广泛开放的创新和竞争。谷歌的 [TensorFlow][8]、[OpenAI][9] 和 [Apache Spark][10] 使用强大框架成为行业领导者,但也有较小的参与者,如 [Nervana][11] 的 [Neon][12] 和 [Theano][13]。
走出 20 世纪 90 年代的人工智能冬季,人工智能随着它所依赖的计算能力的提升再次出现,影响着我们如何构建软件。机器学习、深度学习、自然语言处理和自动语音识别覆盖了世界各地 - 从 GitHub 的项目和工作岗位到新公司成立背后的原因以及清除我们杂乱的台面Hey, Alexa!)。LCTT 译注Alexa 是预装在亚马逊 Echo 内的个人虚拟助手,可以接收及相应语音命令,可被看成是亚马逊版的 Siri 语音助手。用户只需要说一声“Alexa”就可以创建各种任务还可以和各种智能家居设备进行交互。 是的,即使像 OSCON 这样的会议都处处提及 <ruby>“万物皆智能”<rt>all things AI</rt></ruby> 。虽然计算能力的提升已经铺平了道路,所有关于 all things AI 的开源已经引起了行业广泛开放的创新和竞争。谷歌的 [TensorFlow][8]、[OpenAI][9] 和 [Apache Spark][10] 使用强大框架成为行业领导者,但也有较小的参与者,如 [Nervana][11] 的 [Neon][12] 和 [Theano][13]。
AI 的兴起如何影响软件开发者的前景?好,现在是了解 Python 的好时机 - 它对数据工程师和科学家的敏捷性和流行性使它成为最流行的 AI 编程语言,其次是 R、Java 和 Scala。
AI 的兴起已经影响到了软件开发者的前景?没错,现在是了解 Python 的好时机 - 它给数据工程师和科学家带来的敏捷性和流行性使它成为最流行的 AI 编程语言,其次是 R、Java 和 Scala。
### 容器和 Go 的结合就像花生、黄油和果冻LCTT译注最佳组合
### 容器和 Go 的结合就像花生、黄油和果冻
[Go 1.0 发布][14]于 2012 年 3 月。紧接着 [Docker][15] 在一年后发布,[Kubernetes][16] 在另外一年后发布。总之Go 并不是如我们所知的那样专为基础设施的未来而设计的,但 Go 似乎是为了填充编程世界的一个主要的空洞。对于一个高度联网的世界一个必须拥有一流并发性的世界而言Go 是以 Java 或 C++ 永远不会的方式专门写的。如果你在做运维或者类似的事,你应该至少稍微了解下 Go ,因为它正在发展中,它将会被使用多年,并成为许多程序的骨干。
(花生、黄油和果冻 —— LCTT译注最佳组合
[Go 1.0 发布][14]于 2012 年 3 月。紧接着 [Docker][15] 在一年后发布,[Kubernetes][16] 在另外一年后发布。总之Go 并不是如我们所知的那样专为基础设施的未来而设计的,但 Go 似乎是为了填充编程世界的一个主要的空洞而出现。对于一个高度联网的世界一个必须拥有一流并发性的世界而言Go 是以 Java 或 C++ 永远不会有的方式专门写的。如果你在做运维或者类似的事,你应该至少稍微了解下 Go ,因为它正在发展中,它将会被使用多年,并成为许多程序的骨干。
### Swift 超越了 Apple 的生态系统
Swift 是[ Apple 在 2015 年启动该编程语言不久之后就开源的][17]。Swift 已经成为 iOS 和 Mac OS X 开发人员的热门话题。这种语言很容易理解,因此很快流行起来,并且它比它要取代的语言 - Objective-C 和 C++ 赢得了一个[更安全的声誉][18]。在[ JavaScript 框架][19]和其他新语言的世界中Swift 是否成功仍有待观察但如果它继续获得苹果忠实用户的欢迎Swift 将有机会成为伟大的网络世界中有望成功的竞争者和超越者。
Swift 是 [Apple 在 2015 年启动该编程语言不久之后就开源的][17]。Swift 已经成为 iOS 和 Mac OS X 开发人员的热门话题。这种语言很容易理解,因此很快流行起来,并且它比它要取代的语言 - Objective-C 和 C++ 赢得了一个[更安全的声誉][18]。在 [JavaScript 框架][19]和其他新语言的世界中Swift 是否成功仍有待观察但如果它能继续获得苹果忠实用户的欢迎Swift 将有机会成为伟大的网络世界中最有望成功的竞争者和超越者。
### Java 8 vs 使用 JVM 的函数式语言
Java 8 的函数式能力(即引入 Lambdas )的出现使得 JVM 语言(如 Scala 和 Clojure上榜单了。最近很大程度上由于 Apache Spark 的增长使得 Scala 有一点小爆发。现在,因为长期的和新的开发人员一起都在关注 Java 8 所带来的东西至少目前Scala 和 Clojure 似乎被搁置了。Java 现在能够解决并发和大数据相关的事,而那些专门为满足此方面要求而构建的其他编程语言已经做了多年。在 2017 年OSCON 几乎缺乏 Scala 和 Clojure 的提案,不是因为设计,而是那些提交提案的发言者似乎没有什么兴趣。
Java 8 的函数式能力(即引入 Lambdas )的出现使得 JVM 语言(如 Scala 和 Clojure上榜单了。最近很大程度上由于 Apache Spark 的增长使得 Scala 有一点小爆发。现在,因为新老开发人员都在关注 Java 8 所带来的东西至少目前Scala 和 Clojure 似乎被搁置了。Java 现在能够解决并发和大数据相关的事,而那些专门为满足此方面要求而构建的其他编程语言已经做了多年。在 2017 年OSCON 几乎没有 Scala 和 Clojure 的提案,不是因为这样计划的,而是那些提交提案的发言者似乎没有什么兴趣。
### 新兴语言
@ -48,7 +49,7 @@ Java 8 的函数式能力(即引入 Lambdas )的出现使得 JVM 语言(
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/_mts0602.jpg?itok=7cSl2h8C)
Rachel Roumeliotis - O'Reilly MediaInc.的战略内容总监,领导了一个编辑团队,其涵盖各种各样的编程主题,从全栈 web 开发到企业中的开源到新兴的编程语言。她是 OSCONO'Reilly软件架构会议和 Fluent 的编程主席。 她从事技术出版工作超过10年获得许多领域的内容包括移动编程、UX、计算机安全。
Rachel Roumeliotis - O'Reilly MediaInc. 的战略内容总监,领导了一个编辑团队,其涵盖各种各样的编程主题,从全栈 web 开发到企业中的开源到新兴的编程语言。她是 OSCONO'Reilly 软件架构会议)和 Fluent 的编程主席。 她从事技术出版工作超过 10 年,出版了许多领域的内容包括移动编程、UX、计算机安全。
--------------------------------------------------------------------------------

View File

@ -1,79 +0,0 @@
# translating by rusking
Why every business should consider an open source point of sale system
============================================================
![Why every business should consider an open source point of sale system](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_lovemoneyglory2.png?itok=WxnzxyWP "Why every business should consider an open source point of sale system")
Image by : 
opensource.com
Point of sale (POS) systems have come a long way from the days of simple cash registers that rang up purchases. Today, POS systems can be all-in-one solutions that include payment processing, inventory management, marketing tools, and more. Retailers can receive daily reports on their cash flow and labor costs, often from a mobile device.
The POS is the lifeblood of a business, and that means you need to choose one carefully. There are a ton of options out there, but if you want to save money, adapt to changing business needs, and keep up with technological advances, you would be wise to consider an open source system. An open source POS, where the source code is exposed for your use, offers significant advantages over a proprietary system that keeps its code rigidly under wraps.
With an open source POS, you get a few key things.
### Unlimited flexibility
Open source systems play well with others. Their ability to integrate and connect with third-party products—from accounting and customer relationship management software to order management and inventory systems—makes them an attractive proposition for business owners who need to expand beyond the feature set of a proprietary POS.
In a [2014 technology survey][7], restaurant owners said integration would be a major factor influencing their next POS upgrade. This is one area where open source really shines. A proprietary system is what it is. But with open source, you have endless possibilities for integration and customization. If you think your business model is ever going to grow and change, it only makes sense to consider an open source POS that allows you to adapt as needed.
### Faster development
Another advantage of open source systems is that they are often backed by a large community of developers who are continually building new functionality and improving on old features. By its very nature, the software development cycle for an open source project is much quicker than it is for a commercial product—bugs get fixed faster, updates get released sooner, and new modules are constantly being developed.
### Lower cost
In this case, "lower cost" means "almost free." You still need to buy the hardware, but the software itself is free to use. An open source POS doesn't have the high start-up or ongoing maintenance costs of a proprietary POS, which can be anywhere from $3,000 to $50,000 a year, nor does open source force you into the locked-in pricing of a proprietary model.
In the [2015 version][8] of the food service technology study, more than half of the restaurant owners surveyed said they were paying for multiple technology vendors—in some cases as many as 10\. The cost savings of switching to a single open source system with custom modifications and no ongoing fees could be significant.
There is a caveat, however. If you don't have a tech-savvy staff, you may need to hire outside help to install, modify, and upgrade your software. Open source does allow for unlimited integrations and customizations, but you'll need someone with technical expertise to take care of that, which can incur additional fees. Still, it can be a very cost-effective option.
### Better security
If the source code is out there for anyone to see, doesn't that mean it's open to malicious programmers who want to hack into your data? Isn't that a security nightmare? On the contrary.
The large community of developers that builds new functionality also searches out and repairs security flaws. There are many more sets of eyes dissecting and fixing open source code than there are reviewing the code for a proprietary product. In that way, an open source POS is actually _more_ secure.
There are many options for open source POS solutions, to name some:
* [Chromis][1]
* [Drupal POS][2]
* [Floreant][3]
* [Odoo][4]
* [Open Source Point of Sale][5]
* [Unicenta][6]
### Making the jump
You know your business better than anyone. Only you can decide what point of sale software is right for you. Given the compelling advantages of an open source POS over a proprietary POS—flexibility, rapid development, lower cost, more security—open source is something every business should consider.
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/preston-pilgrim-2016_0.jpg?itok=7fzNsTww)
Digital marketing project manager at Acro Media. We excel in custom ecommerce solutions by utilizing the Drupal open source platform.
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/open-source-point-sale-system
作者:[Preston Pilgrim][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/preston-pilgrim
[1]:http://chromis.co.uk/
[2]:https://www.acromediainc.com/drupal-pos
[3]:http://floreant.org/
[4]:https://www.odoo.com/
[5]:https://github.com/jekkos/opensourcepos
[6]:https://unicenta.com/
[7]:http://hospitalitytechnology.edgl.com/news/POS-Integration-Becoming-a--Must-Have-94389
[8]:https://pos.toasttab.com/restaurant-technology-industry-report/2015

View File

@ -1,3 +1,4 @@
#rusking translating
# Arch Linux on a Lenovo Yoga 900
_Warning: this is about 5,500 words with plenty of interesting links, so wait till youve got something to drink and some time._

View File

@ -1,187 +0,0 @@
alim0x translating
# Monthly security updates
[
![Check out that new "Android security patch level" field. ](https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5-980x957.jpg)
][31]
A few months before the release of Marshmallow, [vulnerabilities][32] in Android's "Stagefright" media server were disclosed to the public, which could allow for remote code execution on older versions of Android. Android took a beating in the press, with [a billion phones][33] affected by the newly discovered bugs.
Google responded by starting a monthly Android security update program. Every month it would round up bugs, fix them, and push out new code to AOSP and Nexus devices. OEMs—who were already struggling with updates (possibly due to apathy)—were basically told to "deal with it" and keep up. Every other major operating system has frequent security updates—it's just the cost of being such a huge platform. To accommodate OEMs, Google give them access to the updates a full month ahead of time. After 30 days, security bulletins are posted and Google devices get the updates.
The monthly update program started two months before the release of Marshmallow, but in this major OS update Google added an "Android Security Patch Level" field to the About Phone screen. Rather than use some arcane version number, this was just a date. This let anyone easily see how out of date their phone was, an acted as a nice way to shame slow OEMs.
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/text-150x150.jpg)
][2]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/extra-150x150.jpg)
][3]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/translate-150x150.jpg)
][4]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/chromecustomtab-150x150.jpg)
][5]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/CCT_Large-2-150x150.gif)
][6]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-5-150x150.jpg)
][7]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-1-150x150.jpg)
][8]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings2-150x150.jpg)
][9]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-3-150x150.jpg)
][10]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/nearby-150x150.jpg)
][11]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-6-150x150.jpg)
][12]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-7-150x150.jpg)
][13]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-8-150x150.jpg)
][14]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-9-150x150.jpg)
][15]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/2015-10-03-18.21.17-150x150.png)
][16]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/2015-10-04-05.32.23-150x150.png)
][17]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/easter-egg-150x150.jpg)
][18]
The text selection menu is now a floating toolbar that pops up right next to the text you're selecting. This wasn't just the regular "cut/copy/paste" commands, either. Apps could put special options on the toolbar, like the "add link" option in Google Docs.
After the standard text commands, an ellipsis button would expose a second menu, and it was here that apps could add extra features to the text selection menu. Using a new "text processing" API, it was now super easy to ship text directly to another app. If you had Google Translate installed, a "translate" option would show up in this menu. Eventually Google Search added an "Assist" option to this menu for Google Now on Tap.
Marshmallow added a hidden settings section called the "System UI Tuner." This section would turn into a catch-all for power user features and experimental items. To access this you had to pull down the notification panel and hold down on the "settings" button for several seconds. The settings gear would spin, and eventually you'd see a message indicating that the System UI Tuner was unlocked. Once it was turned on, you could find it as the bottom of the system settings next to Developer Options.
In this first version of the System UI Tuner, users would add custom tiles to the Quick Settings panel, a feature that would later be refined into an API apps could use. For now the feature was very rough, basically allowing users to type a custom command into a text box. System status icons could be individually turned on and off, so if you really hated knowing you were connected to Wi-Fi, you could kill the icon. A popular power user addition was the option for embedding a percentage readout into the battery icon. There was also a "demo" mode for screenshots, which would replace the normal status bar with a fake, clean version.
### Android 7.0 Nougat, Pixel Phones, and the future
[Android 7.0 Nougat][34] and [the Pixel Phones][35] came out just a few months ago, and you can read our full reviews for both of them. Both still have a ton of features and implications that we have not seen come to fruition yet, so we'll save a deep "history" dive for when they are actually "history." 
### FURTHER READING
[Android 7.0 Nougat review—Do more on your gigantic smartphone][25]
Nougat made serious changes to the [graphics and sensor pipeline][36] for Daydream VR, Google's upcoming smartphone-powered VR experience [we tried][37] but have yet to log any serious time with. A new "Seamless update" feature borrowed an update mechanism from Chrome OS, which uses dual system partitions to quietly update one partition in the background while you're still using the other one. Considering the Pixel phones are the only devices to launch with this and haven't gotten an update yet, we're not sure what that looks like, either.
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/2016-08-17-18.21.22-150x150.png)
][19]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/2016-08-17-18.20.59-150x150.png)
][20]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/Android-N_1-150x150.jpg)
][21]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/03/2016-03-20-19.26.55-150x150.png)
][22]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/pip-active-150x150.png)
][23]
One of the most interesting additions to Nougat is a revamp of the app framework to allow for resizable apps. This allowed Google to implement split screen on phones and tablets, picture-in-picture on Android TV, and a mysterious floating windowed mode. We've been able to access the floating window mode with some software trickery, but we've yet to see Google use it in an actual product. Is it being aimed at desktop computing?
Android and Chrome OS also continue to grow together. Android apps [can run][38] on some Chromebooks now, giving the "Web-only" OS the Play Store and a serious app ecosystem. Rumors continue to swirl that the future of Chrome OS and Android will come even closer together, with the name "[Andromeda][39]"—a portmanteau of "Android" and "Chrome"—being tossed around as the codename for a merged Chrome/Android OS.
We have yet to see how the historical legacy of the Pixel phones will shake out. Google dove into the hardware pool with the launch of two new smartphone flagships, the Pixel and Pixel XL, only recently. Google had produced co-branded Nexus phones with partners before, but the Pixel line is a "Google" branded product. The company claims it is a full hardware OEM now, using HTC as a contract manufacturer similarly to the way Apple uses Foxconn.
### FURTHER READING
[Google Pixel review: The best Android phone, even if it is a little pricey][26]</aside>
With its own hardware comes a change in how Google makes software. The company created the "Google Assistant" as the future of the "OK Google" voice command system. But rather than ship it out to every Android device, the Assistant is an exclusive Pixel feature. Google made some changes to the interface, with a custom "Pixel launcher" home screen app and a new System UI, both of which are Pixel exclusives. We'll have to wait to see what the balance of future features are between "Android" and "Pixel" going forward.
### FURTHER READING
[Chatting with Googles Hiroshi Lockheimer about Pixel, Android OEMs, and more][27]</aside>
With these changes, we're probably at the most uncertain point in Android's history. But ahead of the platform's recent October 2016 event, [Hiroshi Lockheimer][40], SVP of Android, Chrome OS, and Google Play, said he believed we'll all look back fondly on these latest Android developments. Lockheimer is essentially the current king of software at Google, and he thought the newest updates could be the most significant Android happening since the OS debuted eight years earlier. While he wouldn't elaborate much on this sentiment after the unveilings, the fact remains that this time next year we _might_ not even be talking about Android—it could be an Android/Chrome OS hybrid! So as has always been the case since 2008, the next chapter in Android's history looks to be nothing if not interesting.
--------------------------------------------------------------------------------
作者简介:
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.
--------------------------------------------------------------------------------
via: http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/
作者:[RON AMADEO][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://arstechnica.com/author/ronamadeo
[1]:http://android-developers.blogspot.com/2015/09/chrome-custom-tabs-smooth-transition.html
[2]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[3]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[4]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[5]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[6]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[7]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[8]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[9]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[10]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[11]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[12]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[13]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[14]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[15]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[16]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[17]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[18]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[19]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[20]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[21]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[22]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[23]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[24]:https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5.jpg
[25]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[26]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[27]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/
[28]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[29]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[30]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/
[31]:https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5.jpg
[32]:http://arstechnica.com/security/2015/07/950-million-android-phones-can-be-hijacked-by-malicious-text-messages/
[33]:http://arstechnica.com/security/2015/10/a-billion-android-phones-are-vulnerable-to-new-stagefright-bugs/
[34]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[35]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[36]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/11/#h1
[37]:http://arstechnica.com/gadgets/2016/10/daydream-vr-hands-on-googles-dumb-vr-headset-is-actually-very-clever/
[38]:http://arstechnica.com/gadgets/2016/05/if-you-want-to-run-android-apps-on-chromebooks-youll-need-a-newer-model/
[39]:http://arstechnica.com/gadgets/2016/09/android-chrome-andromeda-merged-os-reportedly-coming-to-the-pixel-3/
[40]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/

View File

@ -1,81 +0,0 @@
GHLandy Translating
How To Assign Output of a Linux Command to a Variable
============================================================
When you run a command, it produces some kind of output: either the result of a program is suppose to produce or status/error messages of the program execution details. Sometimes, you may want to store the output of a command in a variable to be used in a later operation.
In this post, we will review the different ways of assigning the output of a shell command to a variable, specifically useful for shell scripting purpose.
To store the output of a command in a variable, you can use the shell command substitution feature in the forms below:
```
variable_name=$(command)
variable_name=$(command [option ...] arg1 arg2 ...)
OR
variable_name='command'
variable_name='command [option ...] arg1 arg2 ...'
```
Below are a few examples of using command substitution.
In this first example, we will store the value of `who` (which shows who is logged on the system) command in the variable `CURRENT_USERS` user:
```
$ CURRENT_USERS=$(who)
```
Then we can use the variable in a sentence displayed using the [echo command][1] like so:
```
$ echo -e "The following users are logged on the system:\n\n $CURRENT_USERS"
```
In the command above: the flag `-e` means interpret any escape sequences ( such as `\n` for newline) used. To avoid wasting time as well as memory, simply perform the command substitution within the [echo command][2] as follows:
```
$ echo -e "The following users are logged on the system:\n\n $(who)"
```
[
![Shows Current Logged Users in Linux](http://www.tecmint.com/wp-content/uploads/2017/01/Shows-Current-Logged-Users-in-Linux.png)
][3]
Shows Current Logged Users in Linux
Next, to demonstrate the concept using the second form; we can store the total number of files in the current working directory in a variable called `FILES` and echo it later as follows:
```
$ FILES=`sudo find . -type f -print | wc -l`
$ echo "There are $FILES in the current working directory."
```
[
![Show Number of Files in Directory](http://www.tecmint.com/wp-content/uploads/2017/01/Show-Number-of-Files-in-Directory.png)
][4]
Show Number of Files in Directory
Thats it for now, in this article, we explained the methods of assigning the output of a shell command to a variable. You can add your thoughts to this post via the feedback section below.
--------------------------------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/4e444ab611c7b8c7bcb76e58d2e82ae0?s=128&d=blank&r=g)
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/assign-linux-command-output-to-variable/
作者:[Aaron Kili][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/echo-command-in-linux/
[2]:http://www.tecmint.com/echo-command-in-linux/
[3]:http://www.tecmint.com/wp-content/uploads/2017/01/Shows-Current-Logged-Users-in-Linux.png
[4]:http://www.tecmint.com/wp-content/uploads/2017/01/Show-Number-of-Files-in-Directory.png

View File

@ -0,0 +1,79 @@
Why every business should consider an open source point of sale system
============================================================
为什么每家企业都应该考虑使用开源的 POS 系统
![Why every business should consider an open source point of sale system](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_lovemoneyglory2.png?itok=WxnzxyWP "Why every business should consider an open source point of sale system")
图片来源  
opensource.com
销售点终端 (POS) 系统是从很久以前的简单的收银机发展而来的。如今的 POS 系统可以提供一体化解决方案,包括支付流程,库存管理,营销工具等等。零售店也可以使用移动设备来接收现金流和各种成本支出相关的日报表。
POS 系统是每家企业重要的生命线,那就意味着你在选择 POS 系统的过程中要非常谨慎。目前可供选择的收银系统也很多,但是如果你想节约成本,适应不断变化的业务需求,跟上技术发展的脚步,你应该很明智地考虑使用开源系统。你可以随意使用一款开源 POS 系统公开的源代码,这比那些严格保密源代码的专有系统要有更大的优势。
使用开源的 POS 系统,你可以获得它的一些非常重要的特性。
### 无限的灵活性
开源系统与其它系统的兼容性非常好。它们与第三方厂家系统进行集成的能力——从帐务和客户关系管理软件到订单管理和库存管理系统——当企业管理者想要扩展专有 POS 系统以外的其它功能时,开源系统有更强大的优势。
在 [2014 年科技调查][7] 活动中,很多餐厅管理者声称 POS 系统的功能集成度将会是他们考虑更换新系统的主要因素。这是开源系统最具亮点的一方面。专有系统买来什么样就是什么样,很难与其它厂家的系统进行集成。但是使用开源系统,你就可以进行无限的集成及定制功能。如果你觉得你们公司的商业模式会不断的增长和变化,那么只有考虑使用开源的 POS 系统才能根据需要实时调整系统。
### 更快的开发速度
开源系统的另外一个优势是它有很多的社区开发者提供技术支持,他们持续不断的提交新功能,并且优化原有的功能。由于这种特性,开源项目的开发周期要比商用产品快得多——修复缺陷的速度更快,更新升级也很快,并且新的功能模块也不断地被开发出来。
### 更低的成本
也就是说,“更低的成本”意味着“基本免费”。你还需要购买相关硬件产品,只是软件本身是免费使用的。开源 POS 系统不像专有 POS 系统那样在购买时或是后期维护过程中需要支付高昂的费用,其每年的维护费在 3000 至 50000 美元之间,开源系统也不会像专有系统那样需要花钱来购买。
在 [2013 年版][8] 的餐饮行业技术服务调查研究过程中,有超过一半的受访餐厅老板表示他们从很多的技术产商购买服务——有些餐厅所面对的技术厂家多达 10 个。而使用纯粹的开源定制化系统不需要支付维护费用,这从节约成本上来说意义非常重大。
然而,有一点我还得提醒大家。如果你们公司没有一个技术精湛的员工提供技术支持,你可能还需要聘请外部技术人员来帮助你们安装,调试和升级系统。开源系统允许用户无限制集成和定制化开发,但是你还需要有技术精湛的专家来支持才行,这也会产生额外的费用。尽管如此,开源系统仍然是一个非常具有成本效益的选择。
### 更好的安全性
如果任何人都可以看到源代码,那是不是也意味着它同样对那些怀有恶意并想入侵你系统的程序员开放呢?那不就是一个安全上的严重隐患吗?事实正好相反。
大量的社区开发者在开发新功能的同时也会检查并修复影响系统安全的各种漏洞。有那么多的程序员在分析和维护开源软件的源代码,这可比专有软件开发商对代码的审查要严格得多。因此,开源的 POS 系统实际上更安全。
有很多开源的 POS 系统解决方案可供选择,我列出一部分来:
* [Chromis][1]
* [Drupal POS][2]
* [Floreant][3]
* [Odoo][4]
* [Open Source Point of Sale][5]
* [Unicenta][6]
### 勇敢地跨出第一步
你比其它人更了解你们公司。只有你能决定哪种开源系统最适合你们公司。由于开源 POS 系统比专有 POS 系统有更多亮丽的优点——灵活性、开发快速、低成本、更安全——因此,每个公司都应该考虑使用开源的 POS 系统。
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/preston-pilgrim-2016_0.jpg?itok=7fzNsTww)
我是 AcroMedia 公司数字化市场营销项目经理。我们主要使用 Drupal 开源系统来为客户提供定制化商业解决方案。
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/open-source-point-sale-system
作者:[Preston Pilgrim][a]
译者:[rusking](https://github.com/rusking)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/preston-pilgrim
[1]:http://chromis.co.uk/
[2]:https://www.acromediainc.com/drupal-pos
[3]:http://floreant.org/
[4]:https://www.odoo.com/
[5]:https://github.com/jekkos/opensourcepos
[6]:https://unicenta.com/
[7]:http://hospitalitytechnology.edgl.com/news/POS-Integration-Becoming-a--Must-Have-94389
[8]:https://pos.toasttab.com/restaurant-technology-industry-report/2015

View File

@ -0,0 +1,185 @@
# 每月安全更新
[
![看看新的“安卓安全补丁程序级别”栏。 ](https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5-980x957.jpg)
][31]
在棉花糖发布的几个月前安卓的“Stagefright”媒体服务器漏洞被披露给了公众这个漏洞允许在旧版本安卓上远程执行代码。由于这个漏洞影响到了数十亿安卓设备安卓受到了媒体广泛的批评。
谷歌则以开始一项月度安卓安全更新项目作为回应。每个月它都会手机 bug修复它们然后推送新代码给 AOSP 和 Nexus 设备。OEM 厂商——它们已经在更新的泥潭中挣扎(也许是因为不关心)——基本上就是被告知“面对现实”然后跟上步伐。每个其它的主流操作系统有经常的安全更新——这就是成为这么大的平台的代价。为了协调 OEM 厂商谷歌让他们提前一个月可以获取到更新。30 天之后,发布安全公告并将更新推送给谷歌设备。
月度更新项目是在棉花糖发布的两个月前开始的,但在这个主要的系统更新中谷歌添加了一栏“安卓安全补丁程序级别”到关于手机界面中。这里没有使用晦涩难懂的版本号,就用了日期来表示。这让任何人都能轻松看懂手机系统过时了多久,是个很好的让动作缓慢的 OEM 厂商羞愧的方式。
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/text-150x150.jpg)
][2]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/extra-150x150.jpg)
][3]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/translate-150x150.jpg)
][4]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/chromecustomtab-150x150.jpg)
][5]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/CCT_Large-2-150x150.gif)
][6]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-5-150x150.jpg)
][7]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-1-150x150.jpg)
][8]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings2-150x150.jpg)
][9]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-3-150x150.jpg)
][10]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/nearby-150x150.jpg)
][11]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-6-150x150.jpg)
][12]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-7-150x150.jpg)
][13]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-8-150x150.jpg)
][14]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-9-150x150.jpg)
][15]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/2015-10-03-18.21.17-150x150.png)
][16]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/2015-10-04-05.32.23-150x150.png)
][17]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/easter-egg-150x150.jpg)
][18]
文本选择菜单现在是个浮动工具条,会在你选择的时候在文本旁边弹出。这里也不止是常规的“剪切/复制/粘贴”命令。应用可以在工具栏上放置特殊选项,比如谷歌文档里的“添加链接”。
在标准的文本命令之后一个省略号按钮会显示一个二级菜单应用可以在这里给文本选择菜单添加额外的功能。使用新的“文本处理”API直接给其它应用传递文本现在变得非常轻松。如果你装了谷歌翻译在这个菜单上会显示一个“翻译”选项。谷歌搜索也在这个工具栏里为谷歌 Now on Tap 添加了一个“助理”选项。
棉花糖添加了一个隐藏的设置,叫做“系统界面调谐器”。这个部分包含了全方位的高级用户特性和试验性项目。要访问这个设置,你需要下拉通知中心,按住“设置”按钮几秒钟。设置齿轮会旋转,然后最终你会看到一条消息显示系统界面调谐器已解锁。一旦它被打开,你就可以在系统设置的底部,开发者选项附近找到它了。
在系统界面调谐器的第一部分,用户可以在快速设置面板添加自定义瓷片,这项特性后来被重制成了应用可以使用的 API。此时这项特性还很粗糙基本就是允许用户在文本框里输入一条自定义命令。系统状态图标可以单独打开或关闭所以如果你真的很讨厌知道你已经连接到另外无线网络你可以把这个图标关闭。这里有一项受欢迎的电源显示新增特性可以将电池电量百分比显示嵌入到电池图标中。还有个用来截屏的“演示”模式它会将正常的状态栏替换成一个假的干净的版本。
### 安卓 7.0 牛轧糖Pixel 手机,以及未来
[安卓 7.0 牛轧糖][34]和 [Pixel 手机][35]几个月前刚刚发布,你可以读读我们对它们的完整评测。二者都有无数我们还没看到最终效果的特性和影响,所以我们暂且搁置,等它真正成为“历史”之后再进行评说。
### 延伸阅读
[安卓 7.0 牛轧糖评测——在你的大手机上做更多的事][25]
牛轧糖为了 Daydream VR 对[图形和传感器][36]做出了很大的改动Daydream VR 是谷歌即将来临的智能手机驱动 VR 体验,[我们已经尝试过了][37]但还没花时间写下点什么。从 Chrome OS 借鉴来了新的“无缝升级”功能,系统拥有两个系统分区,可以在你使用其中一个的时候,对另一个在后台进行静默升级。考虑到 Pixel 是这个功能的唯一首发设备,并且还没有收到更新,我们也不确定这个功能是什么样子的。
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/2016-08-17-18.21.22-150x150.png)
][19]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/2016-08-17-18.20.59-150x150.png)
][20]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/Android-N_1-150x150.jpg)
][21]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/03/2016-03-20-19.26.55-150x150.png)
][22]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/pip-active-150x150.png)
][23]
牛轧糖最有趣的新功能之一是改进的应用框架,它允许改变应用尺寸大小。这让谷歌可以在手机和平板上实现分屏,在安卓 TV 上实现画中画,以及一个神秘的浮动窗口模式。我们已经能够通过一些软件技巧来访问浮动窗口模式,但还没有看到谷歌在实际产品中使用它。难道它的目标是桌面计算?
安卓和 Chrome OS 则继续走在共同成长的道路上。安卓应用现在已经能够在一些 Chromebook 上[运行了][38],给了这个“仅 Web”的系统 Play 商店以及一系列的应用生态。有传言称 Chrome OS 和安卓未来将会更加紧密结合成“[Andromeda][39]”——一个“Android”和“Chrome”混合而成的词——它可能是一个融合的 Chrome/安卓系统的代号。
我们还没有看到 Pixel 手机会创造怎样的历史。谷歌最近发布了两部新旗舰机 Pixel 和 Pixel XL加入了硬件竞争之中。谷歌之前和合作伙伴合作生产联名的 Nexus 手机,但 Pixel 产品线用的是“Google”品牌。谷歌声明这是一个完全的硬件 OEMHTC 是合同制造商,就类似苹果把富士康作为合同制造商那样。
### 延伸阅读
[Google Pixel 评测:最好的安卓手机,即便是有点贵][26]</aside>
拥有自己的硬件改变了谷歌制造软件的方式。谷歌发布了“谷歌助理”作为未来版的“OK Google”语音命令系统。但助理是 Pixel 的独占特性谷歌没有把它推送给所有安卓设备。谷歌对界面做了一些改变一个定制版的“Pixel 启动器”主屏应用和一套新的系统界面,这些都是 Pixel 独占的。我们需要时间来见证未来功能点在“安卓”和“Pixel”之间的平衡。
### 延伸阅读
[和谷歌的 Hiroshi Lockheimer 聊聊 Pixel安卓 OEM 和其它][27]</aside>
见证这这些改变,我们可能正处在安卓历史上最不确定的点上。但在安卓最近的 2016 年 10 月活动前安卓、Chrome OS以及谷歌 Play 的 SVP [Hiroshi Lockheimer][40] 说他相信我们将来都会动情回顾这些最新的安卓更新。Lockheimer 是现在谷歌事实上的软件统治者他认为最新的更新会是自安卓八年前亮相以来最有意义的事件。尽管在发布会后他没有对这个观点进行详细阐述但事实表明明年这时候我们_可能_都不会讨论安卓了——它可能已经是一个安卓/Chrome OS 结合体了!正如 2008 年以来那样,安卓历史的下一篇章一定会更加有趣。
--------------------------------------------------------------------------------
作者简介:
Ron 是 Ars Technica 的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。
--------------------------------------------------------------------------------
via: http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/
作者:[RON AMADEO][a]
译者:[alim0x](https://github.com/alim0x)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://arstechnica.com/author/ronamadeo
[1]:http://android-developers.blogspot.com/2015/09/chrome-custom-tabs-smooth-transition.html
[2]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[3]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[4]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[5]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[6]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[7]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[8]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[9]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[10]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[11]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[12]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[13]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[14]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[15]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[16]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[17]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[18]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[19]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[20]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[21]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[22]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[23]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[24]:https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5.jpg
[25]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[26]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[27]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/
[28]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[29]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[30]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/
[31]:https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5.jpg
[32]:http://arstechnica.com/security/2015/07/950-million-android-phones-can-be-hijacked-by-malicious-text-messages/
[33]:http://arstechnica.com/security/2015/10/a-billion-android-phones-are-vulnerable-to-new-stagefright-bugs/
[34]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[35]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[36]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/11/#h1
[37]:http://arstechnica.com/gadgets/2016/10/daydream-vr-hands-on-googles-dumb-vr-headset-is-actually-very-clever/
[38]:http://arstechnica.com/gadgets/2016/05/if-you-want-to-run-android-apps-on-chromebooks-youll-need-a-newer-model/
[39]:http://arstechnica.com/gadgets/2016/09/android-chrome-andromeda-merged-os-reportedly-coming-to-the-pixel-3/
[40]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/

View File

@ -1,33 +1,31 @@
fuowang翻译中
Installing, Obtaining, and Making GTK Themes
获取、安装和制作 GTK 主题
----------------
Many Linux desktops supporting themes. A theme is a particular appearance or "****" for the GUI. Users can change the theme to make the desktop look different. Usually, users also change the icons. However, the theme and icon-pack are two separate entities. Numerous people want to make their own theme, so here is an article about making GTK themes as well as various essential information.
非常多的桌面版 Linux 都支持主题。GUI译者注图形用户界面独有的外观或者”风格“叫做主题。用户可以改变主题让桌面看起来与众不同。通常用户也会更改图标。然而主题和图标包是两个独立的实体。很多人想制作他们自己的主题因此这是一篇关于GTK 主题的制作以及各种制作时必需的信息的文章。
**NOTE:** This article primarily focuses on GTK3, but it will discuss a little about GTK2, Metacity, and others. Cursors and icons will not be discussed in this article.
**注意:** 这篇文章着重讨论 GTK3但会稍微谈一下 GTK2、Metacity 等。本文不会讨论光标和图标。
**Basic Concepts**
The GIMP ToolKit (GTK) is a widget-toolkit used to create GUIs on a variety of systems (thus making GTK cross-platform). GTK ([http://www.gtk.org/][17]) is commonly and incorrectly thought to stand for "GNOME ToolKit", but is actually stands for "GIMP ToolKit" because it was first created to design an user interface for GIMP. GTK is an object-oriented toolkit written in C (GTK itself is not a language). GTK is entirely open-source under the LGPL license. GTK is a widely used toolkit for GUIs and many tools are available for GTK.
**基本概念**
GIMP 工具包(简称 GTK是一个用来创造在多种系统上如此造就了 GTK 的跨平台图形用户界面的构件工具包。GTK[http://www.gtk.org/][17]通常被错误地认为代表“GNOME 工具包”但实际上它代表“GIMP 工具包”,因为最初创造它是为了给 GIMP 设计用户界面。GTK 是一个用 C 语言编写的面向对象工具包GTK 本身不是一种语言。GTK 遵循 LGPL协议完全开源。GTK 是一个使用广泛的图形用户界面工具包,它含有很多可用工具。
Themes made for GTK will not work in Qt-based applications. A Qt-theme is needed to apply a theme to Qt applications.
GTK 主题无法在基于 QT 的应用上使用。QT 主题需要在基于 QT 的应用上使用。
The themes use Cascading Style-Sheets (CSS) to generate the theme's appearance. This is the same CSS that web-developers use on web-pages. However, instead of HTML tags being referenced, GTK widgets are specified. It is important that theme developers learn CSS.
主题使用层叠样式表CSS来生成主题样式。这里的 CSS 和网站开发者在网页上使用的相同。然而它引用的 HTML 标签被 GTK 构件的专用标签代替。学习 CSS 对主题开发者来说很重要。
**Theme Location**
Themes may be stored in "~/.themes" or "/usr/share/themes". Themes that are in "~/.themes" are only accessible to the owner of that home folder. While themes in "/usr/share/themes" are global-themes that are accessible by all users. When a GTK application executes, it has a list of possible theme files that it checks in a specific order. If the theme file is not found, then it will try the next file on the list. Below is the list in the order that GTK3 applications try to use.
$XDG_CONFIG_HOME/gtk-3.0/gtk.css (typically ~/.config/gtk-3.0/gtk.css)
**主题存放位置**
主题可能会存储在“~/.themes”或者“/usr/share/themes”文件夹中。存放在“~/.themes”文件夹下的主题只有此 home 文件夹的所有者可以使用。而存放在“/usr/share/themes”文件夹下的全局主题可供所有用户使用。当执行 GTK 程序时,它会按照某种确定的顺序检查可用主题文件的列表。如果没有找到主题文件,它会尝试检查列表中的下一个文件。下述文字是 GTK3 程序检查时的顺序列表。
$XDG_CONFIG_HOME/gtk-3.0/gtk.css (另一写法 ~/.config/gtk-3.0/gtk.css
~/.themes/NAME/gtk-3.0/gtk.css
$datadir/share/themes/NAME/gtk-3.0/gtk.css (typically /usr/share/themes/name/gtk-3.0/gtk.css)
$datadir/share/themes/NAME/gtk-3.0/gtk.css (另一写法 /usr/share/themes/name/gtk-3.0/gtk.css
**NOTE:** "NAME" is a placeholder for the name of the current theme.
**注意:** ”NAME“是当前主题名称的占位符。
If there are two themes with the same name, then the one in the user's home folder (~/.themes) will be used. Developers can take advantage of GTK's theme-seeking algorithm by testing new themes in their local home's theme directory.
如果有两个主题名字相同,那么存放在用户 home 文件夹(~/.themes里的主题会被使用。开发者测试存放在本地 home 文件夹的主题时可以好好的利用 GTK 的主题查找算法。
**Theme Engines**
A "Theme engine" is a piece of software that changes the look of the GUI's widgets. The engine reads and uses the theme's files to know how the various widgets should be drawn. Some engines come with themes of their own. Each engine has its advantages and disadvantages, and some engines add special properties and features.
**主题引擎**
主题引擎是软件的一部分,用来改变图形用户界面构件的外观。引擎通过解析主题文件来了解应当绘制多少种构件。有些引擎随着主题被开发出来。每种引擎都有优点和缺点,还有些引擎添加了某些特性和特色。
Many theme-engines can be obtained from the default repositories. Debian-based Linux distros can execute "apt-get install gtk2-engines-murrine gtk2-engines-pixbuf gtk3-engines-unico" to install three different engines. Many engines are available for both GTK2 and GTK3\. Below is a small list of examples.
从默认软件源中可以获取很多主题引擎。Debian 系的 Linux 发行版可以执行“apt-get install gtk2-engines-murrine gtk2-engines-pixbuf gtk3-engines-unico”命令来安装三种不同的引擎。很多引擎同时支持 GTK2 和 GTK3。以下述短列表为例。
* gtk2-engines-aurora - Aurora GTK2 engine
* gtk2-engines-pixbuf - Pixbuf GTK2 engine
@ -35,21 +33,21 @@ Many theme-engines can be obtained from the default repositories. Debian-based L
* gtk3-engines-unico - Unico GTK3 engine
* gtk3-engines-xfce - GTK3 engine for Xfce
**Creating GTK3 Themes**
To create a GTK3 theme, developers can start with an empty file or they can use a pre-existing theme as a template. It may help beginners to start with a pre-existing theme. For instance, a theme can be copied to the user's home folder and then the developer can start editing the files.
**创作 GTK3 主题**
开发者创作 GTK3 主题时,或者从空文件着手,或者将已有的主题作为模板。从现存主题着手可能会对新手有帮助。比如,开发者可以把主题复制到用户的 home 文件夹,然后编辑这些文件。
The general format for a GTK3 theme is to create a folder named after the theme. Then, create a sub-directory called "gtk-3.0" and create a file inside of it named "gtk.css". In the "gtk.css" file, use CSS code to control how the theme will look. Move the theme to ~/.themes for testing purposes. Use the newly created theme and make changes as necessary. If desired, developers can add additional components to the theme for GTK2, Openbox, Metacity, Unity, etc.
GTK3 主题的通用格式是新建一个以主题名字命名的文件夹。然后新建一个名为“gtk-3.0”的子目录在子目录里新建一个名为“gtk.css”的文件。在文件“gtk.css“里使用 CSS 代码写出主题的外观。为了测试将主题移动到 ~/.theme 里。使用新主题并在必要时进行改进。如果有需求,开发者可以添加额外的组件,使主题支持 GTK2OpenboxMetacityUnity等桌面环境。
To explain how to create themes, we will study the "Ambiance" theme, which is usually found at /usr/share/themes/Ambiance. This directory contains the below listed sub-directories and a file named "index.theme".
为了阐明如何创造主题我们会学习”Ambiance“主题通常可以在 /usr/share/themes/Ambiance 找到它。此目录包含下面列出的子目录以及一个名为”index.theme“的文件。
* gtk-2.0
* gtk-3.0
* metacity-1
* unity
"**index.theme**" contains metadata (such as the theme's name) and some important settings (such as the button layout). Below is the "index.theme" file for "Ambiance".
“**index.theme**”含有元数据比如主题的名字和一些重要的配置比如按钮的布局。下面是”Ambiance“主题的”index.theme“文件内容。
Code:
代码:
```
[Desktop Entry]
Type=X-GNOME-Metatheme
@ -66,9 +64,9 @@ ButtonLayout=close,minimize,maximize:
X-Ubuntu-UseOverlayScrollbars=true
```
The "**gtk-2.0**" directory contains files for GTK2 such as a "gtkrc" file and an "apps" directory that contains application-specific GTK settings. The "gtkrc" file is the main CSS-file for the GTK2 portion of the theme. Below are the contents of /usr/share/themes/Ambiance/gtk-2.0/apps/nautilus.rc
”**gtk-2.0**“目录包括支持 GTK2 的文件比如文件”gtkrc“和文件夹”apps“。文件夹”apps“包括具体程序的 GTK 配置。文件”gtkrc“是 GTK2 部分的主要 CSS 文件。下面是 /usr/share/themes/Ambiance/gtk-2.0/apps/nautilus.rc 文件的内容。
Code:
代码:
```
# ==============================================================================
# NAUTILUS SPECIFIC SETTINGS
@ -83,9 +81,9 @@ widget_class "*Nautilus*<GtkButton>" style "notebook_button"
widget_class "*Nautilus*<GtkButton>*<GtkLabel>" style "notebook_button"
```
The "**gtk-3.0**" directory contains files for GTK3\. Instead of "gtkrc", GTK3 uses "gtk.css" as the main theme file. In the Ambiance theme, the file contains one line - '@import url("gtk-main.css");'. The "settings.ini" file contains important theme-wide settings. GTK3 themes use an "apps" directory for the same purpose as GTK2\. The "assets" directory contains images for radio buttons, check-boxes, etc. Below are the contents of /usr/share/themes/Ambiance/gtk-3.0/gtk-main.css
”**gtk-3.0**“目录里是 GTK3 的文件。GTK3 使用”gtk.css“取代了"gtkrc",作为主文件。对于 Ambiance 主题,此文件有一行‘@import url("gtk-main.css");。”settings.ini“是重要的主题范围配置文件。GTK3 主题的”apps“目录和 GTK2 有同样的作用。”assets“目录里有单选按钮、多选框等的图像文件。下面是 /usr/share/themes/Ambiance/gtk-3.0/gtk-main.css 的内容。
Code:
代码:
```
/*default color scheme */
@define-color bg_color #f2f1f0;
@ -157,14 +155,14 @@ Code:
@import url("public-colors.css");
```
The "**metacity-1**" folder contains images that the Metacity window-manager uses for buttons (such as the "close window" button). This directory also contains a file named "metacity-theme-1.xml" that contain's the theme's metadata (like the developer's name) and styling. However, the Metacity portion of the theme uses XML rather than CSS.
”**metacity-1**“文件夹含有 Metacity 窗口管理器按钮比如”关闭窗口“按钮的图像文件。此目录还有一个名为”metacity-theme-1.xml“的文件包括了主题的元数据像开发者的名字和主题设计。然而主题的 Metacity 部分使用 XML 文件而不是 CSS 文件。
The "**unity**" directory contains SVG files that Unity uses for buttons. Besides the SVG files, there are no other files in this folder.
”**unity**“文件夹含有 Unity 按钮使用的 SVG 文件。除了 SVG 文件,这里没有其他的文件。
Some themes may contain other directories. For instance, "Clearlooks-Phenix" has a folder named "**openbox-3**" and "**xfwm4**". The "openbox-3" folder only contains a "themerc" file that declares the settings and appearance (a sample is seen below). The "xfwm4" directory contains *.xpm files, *.png images (in the "png" folder), a "README" file, and a "themerc" file which contains settings (as seen below).
一些主题可能也会包含其他的目录。比如“Clearlooks-Phenix”主题有名为”**openbox-3**”和“**xfwm4**“的文件夹。”openbox-3“文件夹仅有一个”themerc“文件声明了主题配置和外观下面有文件示例。”xfwm4“目录含有几个 xpm 文件,几个 png 图像文件在”png“文件夹里一个”README“文件还有个包含了主题配置的”themerc“文件就像下面看到的那样
/usr/share/themes/Clearlooks-Phenix/xfwm4/themerc
Code:
代码:
```
# Clearlooks XFWM4 by Casey Kirsle
@ -184,7 +182,7 @@ title_vertical_offset_inactive=1
/usr/share/themes/Clearlooks-Phenix/openbox-3/themerc
Code:
代码:
```
!# Clearlooks-Evolving
!# Clearlooks as it evolves in gnome-git...
@ -351,16 +349,16 @@ osd.unhilight.bg.color: #BABDB6
osd.unhilight.bg.colorTo: #efefef
```
**Testing Themes**
When creating themes, it may be helpful to test it and tweak the code to get the desired appearance. Such developers may want to use some type of "theme-previewer". Thankfully, some exist.
**测试主题**
在创作主题时,测试主题并且微调代码对得到想要的样子是很有帮助的。有相当的开发者想要用到”主题预览器“这样的工具呢。幸运的是,已经有了。
* GTK+ Change Theme - This program can change the GTK theme and allow developers to preview the theme. The program is composed of one window that contains many widgets, thus providing a complete preview for the theme. To install this program, type "apt-get install gtk-chtheme".
* GTK Theme Switch - This program allows users to easily change the user's theme. Be sure to have some applications open to view and test the theme. To install this program, type "apt-get install gtk-theme-switch" and type "gtk-theme-switch2" in a terminal to run it.
* LXappearance - This program can change themes, icons, and fonts.
* PyWF - This is a Python-based alternative to "The Widget Factory". PyWF can be obtained at [http://gtk-apps.org/content/show.php/PyTWF?content=102024][1]
* The Widget Factory - This is an old GTK-previewer. To install this program, type "apt-get install thewidgetfactory" and type "twf" in a terminal to run it.
* GTK+ Change Theme - 这个程序可以更改 GTK 主题开发者可以用它预览主题。这个程序由一个含有很多构件的窗口组成因此可以为主题提供一个完整的预览。要安装它只需输入命令”apt-get install gtk-chtheme“。
* GTK Theme Switch - 用户可以使用它轻松的更换用户主题。测试主题时确保打开了一些应用方便预览效果。要安装它只需输入命令”apt-get install gtk-theme-switch“然后在终端敲出”gtk-theme-switch2“即可运行。
* LXappearance - 它可以更换主题,图标以及字体。
* PyWF - 这是”The Widget Factory“的一个基于 Python 的可选组件。可以在[http://gtk-apps.org/content/show.php/PyTWF?content=102024][1]获取Pywf。
* The Widget Factory - 这是一个古老的 GTK 预览器。要安装它只需输入命令”apt-get install thewidgetfactory"然后在终端敲出“twf”即可运行。
**Theme Downloads**
**主题下载**
* Cinnamon - [http://gnome-look.org/index.php?xcontentmode=104][2]
* Compiz - [http://gnome-look.org/index.php?xcontentmode=102][3]
@ -372,7 +370,7 @@ When creating themes, it may be helpful to test it and tweak the code to get the
* Metacity - [http://gnome-look.org/index.php?xcontentmode=101][9]
* Ubuntu Themes - [http://www.ubuntuthemes.org/][10]
**Further Reading**
**延伸阅读**
* Graphical User Interface (GUI) Reading Guide - [http://www.linux.org/threads/gui-reading-guide.6471/][11]
* GTK - [http://www.linux.org/threads/understanding-gtk.6291/][12]
@ -386,7 +384,7 @@ When creating themes, it may be helpful to test it and tweak the code to get the
via: http://www.linux.org/threads/installing-obtaining-and-making-gtk-themes.8463/
作者:[DevynCJohnson][a]
译者:[译者ID](https://github.com/译者ID)
译者:[fuowang](https://github.com/fuowang)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,44 +1,42 @@
Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication Part 5
将另一台 Ubuntu DC 服务器加入到 Samba4 AD DC 实现双域控主机模式 ——(五)
============================================================
将另一台 Ubuntu DC 服务器加入到 Samba4 AD DC 实现双域控主机模式——(五)
这篇文章将讲解如何使用 Ubuntu 16.04 服务器版系统来创建第二台 Samba4 域控制器,并将其加入到已创建好的 Samba AD DC 林环境中,以便为一些关键的 AD DC 服务提供负载均衡及故障切换功能,尤其是为那些重要的服务,比如 DNS 服务和使用 SAM 数据库的 AD DC LDAP 模式提供这种功能
这篇文章将讲解如何使用 **Ubuntu 16.04** 服务器版系统来创建第二台 **Samba4** 域控制器,并将其加入到已创建好的 **Samba AD DC** 林环境中,以便为一些关键的 AD DC 服务提供负载均衡及故障切换功能,尤其是为那些重要的服务,比如 DNS 服务和使用 SAM 数据库的 AD DC LDAP 模式。
#### 需求
1、 [在 Ubuntu16.04 系统上使用 Samba4 软件来创建活动目录架构(一)][1]
这篇文章是 Samba4 AD DC 序列文章中的第五篇,前边几篇如下:
1、 这篇文章是 **Samba4 AD DC** 系列的第**五**篇,前边几篇如下:
[在 Ubuntu16.04 系统上使用 Samba4 软件来创建活动目录架构(一)][1]
[在 Linux 命令行下管理 Samba4 AD 架构(二)][2]
[使用 Windows 10 系统的 RSAT 工具来管理 Samba4 活动目录架构 (三)][3]
[在 Windows 系统下管理 Samba4 AD 域管制器 DNS 和组策略(四)][4]
### 第一步:为设置 Samba4 进行初始化配置
1、在开始把第二个 DC 服务器加入到 Samba4 AD DC 域环境之前,你需要注意一些初始化设置信息,首先,确保这个新系统的主机名符合命名规范要求
1、在开始把第二个 DC 服务器加入到 **Samba4 AD DC** 域环境之前,你需要注意一些初始化设置信息,首先,确保这个新系统的**主机名**包含描述性名称
假设第一个域服务器的主机名叫做 adc1 ,你可以把第二个域服务器命名为 'adc2',以保持域控制器名称的一致性。
假设第一个域服务器的主机名叫做 `adc1` ,你可以把第二个域服务器命名为 `adc2`,以保持域控制器名称的一致性。
执行下面的命令来修改系统主机名:
执行下面的命令来修改系统**主机名**
```
# hostnamectl set-hostname adc2
```
或者你也可以手动编辑 /etc/hostname 文件,在新的一行输入你想设置的主机名。
或者你也可以手动编辑 **/etc/hostname** 文件,在新的一行输入你想设置的主机名。
```
# nano /etc/hostname
```
设置主机名。
这里添加主机名。
```
adc2
```
2、下一步打开本地系统解析文件并添加一个条目包含主域控制器的 IP 地址 FQDN 名称和简写名称。如下图所示:
2、下一步打开本地系统解析文件并添加一个条目包含主域控制器的 IP 地址和 FQDN 名称。如下图所示:
在这篇教程中,主域控服务器的主机名为 `adc1.tecmint.lan` ,其对应的 IP 地址为 192.168.1.254 。
@ -55,13 +53,13 @@ IP_of_main_DC FQDN_of_main_DC short_name_of_main_DC
![Set Hostname for Samba4 AD DC](http://www.tecmint.com/wp-content/uploads/2017/01/Set-Hostname-for-Samba4-AD-DC.jpg)
][5]
为 Samba4 AD DC 服务器设置主机名
*为 Samba4 AD DC 服务器设置主机名*
3、下一步打开 /etc/network/interfaces 配置文件并设置一个静态 IP 地址,如下图所示:
3、下一步打开 **/etc/network/interfaces** 配置文件并设置一个静态 IP 地址,如下图所示:
注意 dns-nameservers 和 dns-search 这两个参数的值。为了能够正常解析 DNS ,需要把这两个值都设置成主 Samba4 AD DC 服务器的 IP 地址和域名。
注意 **dns-nameservers****dns-search** 这两个参数的值。为了使 DNS 解析正常工作,需要把这两个值设置成主 Samba4 AD DC 服务器的 IP 地址和域名。
重启网卡服务以让修改的配置生效。检查 /etc/resolv.conf 文件确保该网卡上配置的这两个 DNS 的值已更新到这个文件。
重启网卡服务以让修改的配置生效。检查 **/etc/resolv.conf** 文件确保该网卡上配置的这两个 DNS 的值已更新到这个文件。
```
# nano /etc/network/interfaces
@ -80,7 +78,7 @@ dns-nameservers 192.168.1.254
dns-search tecmint.lan
```
重启网卡服务并确认生效
重启网卡服务并确认生效
```
# systemctl restart networking.service
@ -90,27 +88,27 @@ dns-search tecmint.lan
![Configure DNS for Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-DNS-for-Samba4-AD.jpg)
][6]
配置 Samba4 AD 服务器的 DNS
*配置 Samba4 AD 服务器的 DNS*
当你通过简写名称(来自 FQDN 名)查询主机名时, dns-search 值将会自动把域名添加上。
当你通过简写名称(用于构建 FQDN 名)查询主机名时, **dns-search** 值将会自动把域名添加上。
4、为了测试 DNS 解析是否正常,使用 ping 命令加上简写名, FQDN 名和域名进行测试,如下图所示:
4、为了测试 DNS 解析是否正常,使用一系列 ping 命令测试,命令后分别为简写名, FQDN 名和域名,如下图所示:
在所有 ping 命令的测试过程中Samba4 AD DC DNS 服务器都应该返回主域控服务器的 IP地址。
在所有测试用例中,**Samba4 AD DC DNS** 服务器都应该返回主域控服务器的 IP 地址。
[
![Verify DNS Resolution for Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-DNS-Resolution-for-Samba4-AD.png)
][7]
验证 Samba4 AD 环境 DNS 解析是否正常
*验证 Samba4 AD 环境 DNS 解析是否正常*
5、最后你需要注意的是确保这个主机跟域控服务器时间同步。你可以通过下面的命令在系统上安装 NTP 客户端工具来实现时间同步功能:
5、最后你需要注意的是确保这个主机跟域控服务器时间同步。你可以通过下面的命令在系统上安装 **NTP** 客户端工具来实现时间同步功能:
```
# apt-get install ntpdate
```
6、假设你想手动强制本地服务器与 samba4 AD DC 服务器时间同步,使用 ntpdate 命令加上主域控服务器的主机名,如下所示:
6、假设你想手动强制本地服务器与 **samba4 AD DC** 服务器时间同步,使用 **ntpdate** 命令加上主域控服务器的主机名,如下所示:
```
# ntpdate adc1
@ -119,11 +117,11 @@ dns-search tecmint.lan
![Time Synchronize with Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Time-Synchronize-with-Samba4-AD.png)
][8]
与 Samba4 AD 服务器进行时间同步
*与 Samba4 AD 服务器进行时间同步*
### 第 2 步:安装 Samba4 必须的依赖包
7、为了让 Ubuntu 16.04 系统加入到你的域中,你需要通过下面的命令从 Ubuntu 官方软件库中安装 Samba4 套件, Kerberos 客户端和其它一些重要的软件包以便将来使用:
7、为了让 **Ubuntu 16.04** 系统加入到你的域中,你需要通过下面的命令从 Ubuntu 官方软件库中安装 **Samba4 套件, Kerberos** 客户端和其它一些重要的软件包以便将来使用:
```
# apt-get install samba krb5-user krb5-config winbind libpam-winbind libnss-winbind
@ -132,7 +130,7 @@ dns-search tecmint.lan
![Install Samba4 in Ubuntu](http://www.tecmint.com/wp-content/uploads/2017/01/Install-Samba4-in-Ubuntu.png)
][9]
在 Ubuntu 系统中安装 Samba4
*在 Ubuntu 系统中安装 Samba4*
8、在安装的过程中你需要提供 Kerberos 域名。输入大写的域名然后按 [Enter] 键完成安装过程。
@ -140,9 +138,9 @@ dns-search tecmint.lan
![Configure Kerberos Authentication for Samba4](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Kerberos-Authentication-for-Samba4.png)
][10]
为 Samba4 配置 Kerberos 认证
*为 Samba4 配置 Kerberos 认证*
9、所有依赖包安装完成后通过使用 kinit 命令请求一个 Kerberos 票据以验证设置是否正确。使用 klist 命令来列出已授权的 kerberos 票据信息。
9、所有依赖包安装完成后通过使用 kinit 命令为域管理员请求一个 Kerberos 票据以验证设置是否正确。使用 klist 命令来列出已授权的 kerberos 票据信息。
```
# kinit domain-admin-user@YOUR_DOMAIN.TLD
@ -152,18 +150,18 @@ dns-search tecmint.lan
![Verify Kerberos on Samba4 Domain](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Kerberos-on-Samba4-Domain.png)
][11]
在 Samba4 域环境中验证 Kerberos
*在 Samba4 域环境中验证 Kerberos*
### 第 3 步:以域控制器的身份加入到 Samba4 AD DC
10、在把你的机器集成到 Samba4 DC 环境之前,先把系统中所有运行着的 Samba4 服务停止,并且重命名默认的 Samba 配置文件。在域控制器配置的过程中, Samba 将会创建一个新的配置文件。
10、在把你的机器集成到 **Samba4 DC** 环境之前,先把系统中所有运行着的 Samba4 服务停止,并且重命名默认的 Samba 配置文件以便从头开始。在域控制器配置的过程中, Samba 将会创建一个新的配置文件。
```
# systemctl stop samba-ad-dc smbd nmbd winbind
# mv /etc/samba/smb.conf /etc/samba/smb.conf.initial
```
11、在准备加入域前先启动 samba-ad-dc 服务,之后使用域管理员账号运行 samba-tool 命令将服务器加入到域。
11、在准备加入域前先启动 **samba-ad-dc** 服务,之后使用域管理员账号运行 **samba-tool** 命令将服务器加入到域。
```
# samba-tool domain join your_domain -U "your_domain_admin"
@ -175,7 +173,7 @@ dns-search tecmint.lan
# samba-tool domain join tecmint.lan DC -U"tecmint_user"
```
##### Sample Output
##### 输出示例
```
Finding a writeable DC for domain 'tecmint.lan'
@ -231,11 +229,12 @@ Setting isSynchronized and dsServiceName
Setting up secrets database
Joined domain TECMINT (SID S-1-5-21-715537322-3397311598-55032968) as a DC
```
[
![Join Domain to Samba4 AD DC](http://www.tecmint.com/wp-content/uploads/2017/01/Join-Domain-to-Samba4-AD-DC.png)
][12]
把域加入到 Samba4 AD DC
*把域加入到 Samba4 AD DC*
12、在已安装了 Samba4 套件的 Ubuntu 系统加入域之后,打开 Samba 主配置文件添加如下行:
@ -256,7 +255,7 @@ winbind enum users = yes
winbind enum groups = yes
```
使用你自己的 DNS 转发器 IP 地址替换掉上面的 dns forwarder ip 地址。 Samba 将会把域认证区之外的所有 DNS 解析查询转发到这个 IP 地址。
使用你自己的 **DNS forwarder IP** 地址替换掉上面地址。 Samba 将会把域权威区之外的所有 DNS 解析查询转发到这个 IP 地址。
13、最后重启 samba 服务以使修改的配置生效,然后执行如下命令来检查活动目录复制功能是否正常。
@ -264,15 +263,16 @@ winbind enum groups = yes
# systemctl restart samba-ad-dc
# samba-tool drs showrepl
```
[
![Configure Samba4 DNS](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Samba4-DNS.png)
][13]
配置 Samba4 DNS
*配置 Samba4 DNS*
14、另外还需要重命名原来的 kerberos 配置文件,并使用在加入域的过程中 Samba 生成的新配置文件 krb5.conf 替换 /etc 目录下的那个文件
14、另外还需要重命名原来的 /etc 下的 kerberos 配置文件,并使用在加入域的过程中 Samba 生成的新配置文件 krb5.conf 替换
Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linux 的符号链接命令对该文件创建一个软链接指向 /etc 目录。
Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linux 的符号链接将该文件链接到 /etc 目录。
```
# mv /etc/krb6.conf /etc/krb5.conf.initial
@ -283,9 +283,9 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu
![Configure Kerberos](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Kerberos.jpg)
][14]
配置 Kerberos
*配置 Kerberos*
15、同样使用 samba 的 krb5.conf 配置文件验证 Kerberos 认证是否正常。通过以下命令来请求一个管理员账号的票据并且列出已缓存的票据信息。
15、同样使用 samba 的 **krb5.conf** 配置文件验证 Kerberos 认证是否正常。通过以下命令来请求一个管理员账号的票据并且列出已缓存的票据信息。
```
# kinit administrator
@ -295,11 +295,11 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu
![Verify Kerberos Authentication with Samba](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Kerberos-Authentication-with-Samba.jpg)
][15]
使用 Samba 验证 Kerberos 认证是否正常
*使用 Samba 验证 Kerberos 认证是否正常*
### 第 4 步:验证其它域服务
16、你首先要做的一个测试就是验证 Samba4 DC DNS 解析服务是否正常。要验证域环境中的 DNS 解析情况,使用 host 命令查询域名或者加上其它一些重要的 AD DNS 记录进行查询,如下图所示:
16、你首先要做的一个测试就是验证 **Samba4 DC DNS** 解析服务是否正常。要验证域 DNS 解析情况,使用 host 命令,加上一些重要的 AD DNS 记录进行域名查询,如下图所示:
每一次查询DNS 服务器都应该返回两个 IP 地址。
@ -312,7 +312,7 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu
![Verify Samba4 DC DNS](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Samba4-DC-DNS.png)
][16]
验证 Samba4 DC DNS
*验证 Samba4 DC DNS *
17、这些 DNS 记录也可以从注册过的[已安装了 RSAT 工具的 Windows 机器][17]上查询到。打开 DNS 管理器,展开到你的域 tcp 记录,如下图所示:
@ -320,9 +320,9 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu
![Verify DNS Records on Windows RSAT Tool](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-DNS-Records-on-Windows-RSAT-Tool.png)
][18]
通过 Windows RSAT 工具来验证 DNS 记录
*通过 Windows RSAT 工具来验证 DNS 记录*
18、下一个验证是检查域 LDAP 同步是否正常。使用 samba-tool 工具,在第二个域控制器上创建一个账号,然后检查该账号是否自动同步到第一个 Samba4 AD DC 服务器上。
18、下一个验证是检查域 LDAP 复制同步是否正常。使用 **samba-tool** 工具,在第二个域控制器上创建一个账号,然后检查该账号是否自动同步到第一个 Samba4 AD DC 服务器上。
##### On adc2:
@ -339,41 +339,41 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu
![Create User Account on Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Create-User-Account-on-Samba4-AD.jpg)
][19]
在 Samba4 AD 服务器上创建账号
*在 Samba4 AD 服务器上创建账号*
[
![Verify Replication on Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Replication-on-Samba4-AD.jpg)
][20]
在 Samba4 AD 服务器上验证同步功能
*在 Samba4 AD 服务器上验证同步功能*
19、你也可以从 Microsoft AD DC 控制台创建一个账号,然后验证该账号是否都出现在两个域控服务器上。
19、你也可以从 **Microsoft AD DC** 控制台创建一个账号,然后验证该账号是否都出现在两个域控服务器上。
默认情况下,这个账号都应该在两个 samba 域控制器上自动创建完成。在 'adc1' 服务器上使用 wbinfo 命令查询该账号的名字
默认情况下,这个账号都应该在两个 samba 域控制器上自动创建完成。在 `adc1` 服务器上使用 **wbinfo** 命令查询该账号名
[
![Create Account from Microsoft AD UC](http://www.tecmint.com/wp-content/uploads/2017/01/Create-Account-from-Microsoft-AD-UC.png)
][21]
从 Microsoft AD UC 创建账号
*从 Microsoft AD UC 创建账号*
[
![Verify Account Replication On Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Account-Replication-On-Samba4-AD.png)
][22]
在 Samba4 AD 服务器上验证账号同步功能
*在 Samba4 AD 服务器上验证账号同步功能*
20、实际上打开 Windows 机器上的 AD DC 控制台,展开到域控制器,你应该看到两个已注册的 DC 服务器。
20、实际上打开 Windows 机器上的 **AD DC** 控制台,展开到域控制器,你应该看到两个已注册的 DC 服务器。
[
![Verify Samba4 Domain Controllers](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Samba4-Domain-Controllers.png)
][23]
验证 Samba4 域控制器
*验证 Samba4 域控制器*
### 第 5 步:启用 Samba4 AD DC 服务
21、要启用 Samba4 AD DC 的服务 system-wide ,首先你得禁用原来的不需要的 Samba 服务,然后执行如下命令启用 samba-ad-dc 服务:
21、要在整个系统启用 Samba4 AD DC 的服务,首先你得禁用原来的不需要的 Samba 服务,然后执行如下命令启用 samba-ad-dc 服务:
```
# systemctl disable smbd nmbd winbind
@ -383,9 +383,9 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu
![Enable Samba4 AD DC Services](http://www.tecmint.com/wp-content/uploads/2017/01/Enable-Samba4-AD-DC-Services.png)
][24]
启用 Samba4 AD DC 服务
*启用 Samba4 AD DC 服务*
22、如果你从 Microsoft 客户端远程管理 Samba4 域控制器,或者有其它 Linux 或 Windows 机器集成到当前域中,请确保把其它机器网卡的 DNS 地址设置成 'adc2' 服务器的 IP 地址,以实现某种程序上的冗余。
22、如果你从 Microsoft 客户端远程管理 Samba4 域控制器,或者有其它 Linux 或 Windows 客户机集成到当前域中,请确保在它们的网卡 DNS 服务器地址设置中提及 `adc2` 服务器的 IP 地址,以实现某种程序上的冗余。
下图显示 Windows 和 Debian/Ubuntu 客户机的网卡配置要求。
@ -393,17 +393,17 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu
![Configure Client to Administer Samba4 DC](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Client-to-Administer-Samba4-DC.png)
][25]
配置 Windows 客户端来管理 Samba4 DC
*配置 Windows 客户端来管理 Samba4 DC*
[
![Configure Linux Client to Administer Samba4 DC](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Linux-Client-to-Administer-Samba4-DC.png)
][26]
配置 Linux 客户端来管理 Samba4 DC
*配置 Linux 客户端来管理 Samba4 DC*
假设第一台 DC 服务器 192.168.1.254 网络不通,则调整配置文件中 DNS 服务器 IP 地址的顺序,以防止优先查询这台不可用的 DNS 服务器。
如果第一台 DC 服务器 192.168.1.254 网络不通,则调整配置文件中 DNS 服务器 IP 地址的顺序,以先查询这台不可用的 DNS 服务器。
最后,如果你想在 Linux 系统上使用 Samba4 活动目录账号来进行本地认证,或者为 AD LDAP 账号授予 root 权限,请查看[在 Linux 命令行下管理 Samba4 AD 架构][27] 这篇教程的 第 2 节和第 3 节
最后,如果你想在 Linux 系统上使用 Samba4 活动目录账号来进行本地认证,或者为 AD LDAP 账号授予 root 权限,请查看[在 Linux 命令行下管理 Samba4 AD 架构][27] 这篇教程的 第 2 步和第 3 步
--------------------------------------------------------------------------------

View File

@ -0,0 +1,81 @@
如何将 Linux 命令的输出赋值给变量
==================================
每当你运行一个命令,它都出在屏幕上输出一些内容:该命令的期望结果或者该命令执行细节的状态/错误消息。有些时候,你可能想要将某个命令的输出内容存储在一个变量中,以待在后续操作中取出来使用。
本文将介绍将 shell 命令赋值给变量的不同方法,这对于 shell 脚本编程是特别有用的。
你可以使用如下的 shell 命令置换特性来将命令的输出存储到变量中:
```
变量名=$(命令)
变量名=$(命令 [命令选项 ...] 参数1 参数2 ...)
或者:
变量名='命令'
变量名='命令 [命令选项 ...] 参数1 参数2 ...'
```
以下是使用命令置换特性的示例:
本例,我们将 `who` (显示当前登录系统的用户) 的输出值存储到 `CURRENT_USERS` 变量中:
```
$ CURRENT_USERS=$(who)
```
然后,我们可以使用 [echo 命令][1] 来使用上述变量,如下:
```
$ echo -e "以下为登录到系统中的用户:\n\n $CURRENT_USERS"
```
上面的命令中:`-e` 标记表示解释所有的转义序列 (如 `\n` 为换行)。为节约时间和内存,通常在 [echo 命令][2] 中使用命令置换特性,如下:
```
$ echo -e "以下为登录到系统中的用户:\n\n $(who)"
```
[![显示当前登录系统的用户](http://www.tecmint.com/wp-content/uploads/2017/01/Shows-Current-Logged-Users-in-Linux.png)][3]
在 Linux 中显示当前登录系统的用户
接下来,为了演示刚刚的第二种形式,我们以把当前工作目录下文件数存储到变量 `FILES` 为了,然后使用 echo 来输出,如下:
```
$ FILES=`sudo find . -type f -print | wc -l`
$ echo "当前目录有 $FILES 个文件。"
```
[![显示目中包含文件的数量](http://www.tecmint.com/wp-content/uploads/2017/01/Show-Number-of-Files-in-Directory.png)][4]
显示目中包含文件的数量
至此,文毕。我们展示了将 shell 命令的输出赋值给变量的方法。你可以在下边的评论反馈区留下你的想法。
---------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/4e444ab611c7b8c7bcb76e58d2e82ae0?s=128&d=blank&r=g)
Aaron Kili 是一名 Linux 和 F.O.S.S 忠实拥护者、高级 Linux 系统管理员、Web 开发者,目前在 TecMint 是一名活跃的博主,热衷于计算机并有着强烈的只是分享意愿。
译者简介:
![GHLandy](http://GHLandy.com/images/GHLandy.ico)
[GHLandy](http://GHLandy.com) —— 欲得之,则为之奋斗 (If you want it, work for it.)。
------------------------------------------------
via: http://www.tecmint.com/assign-linux-command-output-to-variable/
作者:[Aaron Kili][a]
译者:[GHLandy](https://github.com/GHLandy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/echo-command-in-linux/
[2]:http://www.tecmint.com/echo-command-in-linux/
[3]:http://www.tecmint.com/wp-content/uploads/2017/01/Shows-Current-Logged-Users-in-Linux.png
[4]:http://www.tecmint.com/wp-content/uploads/2017/01/Show-Number-of-Files-in-Directory.png