Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu.Wang 2019-04-29 17:50:53 +08:00
commit 54e0a56aa2
9 changed files with 483 additions and 480 deletions

View File

@ -0,0 +1,78 @@
[#]: collector: (lujun9972)
[#]: translator: (lujun9972)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-10792-1.html)
[#]: subject: (3 Emacs modes for taking notes)
[#]: via: (https://opensource.com/article/18/7/emacs-modes-note-taking)
[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt)
用来记笔记的三个 Emacs 模式
======
> 借助这些 Emacs 模式轻松记录信息。
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/notebook-writing-pen.jpg?itok=uA3dCfu_)
不管你从事哪种工作,你都无可避免地需要记笔记。而且可能还不是一点点。现在这年头,大家都开始以数字的形式来记笔记了。
开源软件爱好者有多种途径来以电子的方式记下他们的创意、想法和研究过程。你可以使用 [网页工具][1],可以使用 [桌面应用][2],或者你也可以 [使用命令行工具][3]。
如果你使用 [Emacs][4](伪装成文本编辑器的强力操作系统),有多个<ruby>模式<rt>mode</rt></ruby>可以帮你有效地记录笔记。我们这里列举三个例子。
### Deft
![](https://opensource.com/sites/default/files/uploads/deft.png)
在少数情况下,我只能使用 Mac时有一个工具是我不能缺少的[nvALT][5] 笔记应用。[Deft 模式][6] 为 Emacs 带来了 nvALT 式的体验。
Deft 将你的笔记以文本文件的形式存储在电脑中的某个文件夹中。当你进入 Deft 模式,你会看到一系列的笔记及其摘要。这些摘要其实就是文本文件的第一行。若第一行是 Markdown、LaTeX甚至 Emacs Org 模式的格式的话Deft 会忽略掉这些格式而只显示文本内容。
要打开笔记,只需要向下滚动到该笔记的位置然后按下回车即可。然而 Deft 不仅仅只是这样。根据 Deft 开发者 Jason Blevins 的说法,它的*主要操作是搜索和过滤*。Deft 的实现方式简单而有效。输入关键字然后 Deft 会只显示标题中包含关键字的笔记。这在你要从大量笔记中找到某条笔记时非常有用。
### Org 模式
![](https://opensource.com/sites/default/files/uploads/orgmode.png)
如果本文没有包含 [Org 模式][7] 的话,那么我可能会被人所诟病。为什么?它可以说是 Emacs 中最灵活、使用最广泛的记录笔记的方式了。以正确的方式使用它Org 模式可以极大地增强记笔记的能力。
Org 模式的主要优势在于它组织笔记的方式。在 Org 模式中,一个笔记文件会被组织成一个巨大的大纲。每个章节就是大纲里的一个节点,你可以对它进行展开和折叠。这些章节又可以有子章节,这些子章节也可以展开和折叠。这不仅使你一次只关注于某个章节,而且可以让你浏览整个大纲。
你可以在多个章节之间 [进行互联][8],无需通过剪切和复制就能快速移动章节,以及 [附加文件][9] 到笔记中。Org 模式支持带格式的字符和表格。如果你需要转换笔记到其他格式Org 模式也有大量的[导出选项][10]。
### Howm
![](https://opensource.com/sites/default/files/uploads/howm.png)
当我使用 Emacs 已经成为一种习惯时,[howm][11] 马上就成为我严重依赖的模式之一了。虽然我特别喜欢使用 Org 模式,但 howm 依然占有一席之地。
Howm 就好像是一个小型维基。你可以创建笔记和任务列表,还能在它们之间创建链接。通过输入或点击某个链接,你可以在笔记之间跳转。如果你需要,还可以使用关键字为笔记添加标签。不仅如此,你可以对笔记进行搜索、排序和合并。
Howm 不是最漂亮的 Emacs 模式,它的用户体验也不是最佳。它需要你花一点时间来适应它,而一旦你适应了它,记录和查找笔记就是轻而易举的事情了。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/7/emacs-modes-note-taking
作者:[Scott Nesbitt][a]
选题:[lujun9972][b]
译者:[lujun9972](https://github.com/lujun9972)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/scottnesbitt
[b]: https://github.com/lujun9972
[1]: https://opensource.com/alternatives/evernote
[2]: https://opensource.com/life/16/9/4-desktop-note-taking-applications
[3]: https://opensource.com/article/18/3/command-line-note-taking-applications
[4]: https://www.gnu.org/software/emacs/
[5]: http://brettterpstra.com/projects/nvalt/
[6]: https://jblevins.org/projects/deft/
[7]: https://orgmode.org/
[8]: https://orgmode.org/org.html#Hyperlinks
[9]: https://orgmode.org/org.html#Attachments
[10]: https://orgmode.org/org.html#Exporting
[11]: https://howm.osdn.jp/

View File

@ -1,171 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What is 5G? How is it better than 4G?)
[#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all)
[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/)
What is 5G? How is it better than 4G?
======
### 5G networks will boost wireless throughput by a factor of 10 and may replace wired broadband. But when will they be available, and why are 5G and IoT so linked together?
![Thinkstock][1]
[5G wireless][2] is an umbrella term to describe a set of standards and technologies for a radically faster wireless internet that ideally is up to 20 times faster with 120 times less latency than 4G, setting the stage for IoT networking advances and support for new high-bandwidth applications.
## What is 5G? Technology or buzzword?
It will be years before the technology reaches its full potential worldwide, but meanwhile some 5G network services are being rolled out today. 5G is as much a marketing buzzword as a technical term, and not all services marketed as 5G are standard.
**[From Mobile World Congress:[The time of 5G is almost here][3].]**
## 5G speed vs 4G
With every new generation of wireless technology, the biggest appeal is increased speed. 5G networks have potential peak download speeds of [20 Gbps, with 10 Gbps being seen as typical][4]. That's not just faster than current 4G networks, which currently top out at around 1 Gbps, but also faster than cable internet connections that deliver broadband to many people's homes. 5G offers network speeds that rival optical-fiber connections.
Throughput alone isn't 5G's only important speed improvement; it also features a huge reduction in network latency*.* That's an important distinction: throughput measures how long it would take to download a large file, while latency is determined by network bottlenecks and delays that slow down responses in back-and-forth communication.
Latency can be difficult to quantify because it varies based on myriad network conditions, but 5G networks are capable of latency rates that are less than a millisecond in ideal conditions. Overall, 5G latency will be lower than 4G's by a factor of 60 to 120. That will make possible a number of applications such as virtual reality that delay makes impractical today.
## 5G technology
The technology underpinnings of 5G are defined by a series of standards that have been in the works for the better part of a decade. One of the most important of these is 5G New Radio, or 5G NR*,* formalized by the 3rd Generation Partnership Project, a standards organization that develops protocols for mobile telephony. 5G NR will dictate many of the ways in which consumer 5G devices will operate, and was [finalized in June of 2018][5].
**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]**
A number of individual technologies have come together to make the speed and latency improvements of 5G possible, and below are some of the most important.
## Millimeter waves
5G networks will for the most part use frequencies in the 30 to 300 GHz range. (Wavelengths at these frequencies are between 1 and 10 millimeters, thus the name.) This high-frequency band can [carry much more information per unit of time than the lower-frequency signals][7] currently used by 4G LTE, which is generally below 1 GHz, or Wi-Fi, which tops out at 6 GHz.
Millimeter-wave technology has traditionally been expensive and difficult to deploy. Technical advances have overcome those difficulties, which is part of what's made 5G possible today.
## Small cells
One drawback of millimeter wave transmission is that it's more prone to interference than Wi-Fi or 4G signals as they pass through physical objects.
To overcome this, the model for 5G infrastructure will be different from 4G's. Instead of the large cellular-antenna masts we've come to accept as part of the landscape, 5G networks will be powered by [much smaller base stations spread throughout cities about 250 meters apart][8], creating cells of service that are also smaller.
These 5G base stations have lower power requirements than those for 4G and can be attached to buildings and utility poles more easily.
## Massive MIMO
Despite 5G base stations being much smaller than their 4G counterparts, they pack in many more antennas. These antennas are [multiple-input multiple-output (MIMO)][9], meaning that they can handle multiple two-way conversations over the same data signal simultaneously. 5G networks can handle more than [20 times more conversations in this way than 4G networks][10].
Massive MIMO promises to [radically improve on base station capacity limits][11], allowing individual base stations to have conversations with many more devices. This in particular is why 5G may drive wider adoption of IoT. In theory, a lot more internet-connected wireless gadgets will be able to be deployed in the same space without overwhelming the network.
## Beamforming
Making sure all these conversations go back and forth to the right places is tricky, especially with the aforementioned problems millimeter-wave signals have with interference. To overcome those issues, 5G stations deploy advanced beamforming techniques, which use constructive and destructive radio interference to make signals directional rather than broadcast. That effectively boosts signal strength and range in a particular direction.
## 5G availability
The first commercial 5G network was [rolled out in Qatar in May 2018][12]. Since then, networks have been popping up across the world, from Argentina to Vietnam. [Lifewire has a good, frequently updated list][13].
One thing to keep in mind, though, is that not all 5G networks deliver on all the technology's promises yet. Some early 5G offerings piggyback on existing 4G infrastructure, which reduces the potential speed gains; other services dubbed 5G for marketing purposes don't even comply with the standard. A closer look at offerings from U.S. wireless carriers will demonstrate some of the pitfalls.
## Wireless carriers and 5G
Technically, 5G is available in the U.S. today. But the caveats involved in that statement vary from carrier to carrier, demonstrating the long road that still lies ahead before 5G becomes omnipresent.
Verizon is making probably the biggest early 5G push. It announced [5G Home][14] in parts of four cities in October of 2018, a service that requires using a special 5G hotspot to connect to the network and feed it to your other devices via Wi-Fi.
Verizon planned an April rollout of a [mobile service in Minneapolis and Chicago][15], which will spread to other cities over the course of the year. Accessing the 5G network will cost customers an extra monthly fee plus what theyll have to spend on a phone that can actually connect to it (more on that in a moment). As an added wrinkle, Verizon is deploying what it calls [5G TF][16], which doesn't match up with the 5G NR standard.
AT&T [announced the availability of 5G in 12 U.S. cities in December 2018][17], with nine more coming by the end of 2019, but even in those cities, availability is limited to the downtown areas. To use the network requires a special Netgear hotspot that connects to the service, then provides a Wi-Fi signal to phones and other devices.
Meanwhile, AT&T is also rolling out speed boosts to its 4G network, which it's dubbed 5GE even though these improvements aren't related to 5G networking. ([This is causing backlash][18].)
Sprint will have 5G service in parts of four cities by May of 2019, and five more by the end of the year. But while Sprint's 5G offering makes use of massive MIMO cells, they [aren't using millimeter-wave signals][19], meaning that Sprint users won't see as much of a speed boost as customers of other carriers.
T-Mobile is pursuing a similar model,and it [won't roll out its service until the end of 2019][20] because there won't be any phones to connect to it.
One kink that might stop a rapid spread of 5G is the need to spread out all those small-cell base stations. Their small size and low power requirements make them easier to deploy than current 4G tech in a technical sense, but that doesn't mean it's simple to convince governments and property owners to install dozens of them everywhere. Verizon actually set up a [website that you can use to petition your local elected officials][21] to speed up 5G base station deployment.
## **5G phones: When available? When to buy?**
The first major 5G phone to be announced is the Samsung Galaxy S10 5G, which should be available by the end of the summer of 2019. You can also order a "[Moto Mod][22]" from Verizon, which [transforms Moto Z3 phones into 5G-compatible device][23]s.
But unless you can't resist the lure of being an early adopter, you may wish to hold off for a bit; some of the quirks and looming questions about carrier rollout may mean that you end up with a phone that [isn't compatible with your carrier's entire 5G network][24].
One laggard that may surprise you is Apple: analysts believe that there won't be a [5G-compatible iPhone until 2020 at the earliest][25]. But this isn't out of character for the company; Apple [also lagged behind Samsung in releasing 4G-compatible phones][26] in back in 2012.
Still, the 5G flood is coming. 5G-compatible devices [dominated Barcelona's Mobile World Congress in 2019][3], so expect to have a lot more choice on the horizon.
## Why are people talking about 6G already?
Some experts say [5G wont be able to meet the latency and reliability targets][27] it is shooting for. These skeptics are already looking ahead to 6G, which they say will try to address these projected shortcomings.
There is [a group that is researching new technologies that can be rolled into 6G][28] that calls itself
The Center for Converged TeraHertz Communications and Sensing (ComSenTer). Part of the spec theyre working on calls for 100Gbps speed for every device.
In addition to adding reliability, overcoming reliability and boosting speed, 6G is also trying to enable thousands of simultaneous connections. If successful, this feature could help to network IoT devices, which can be deployed in the thousands as sensors in a variety of industrial settings.
Even in its embryonic form, 6G may already be facing security concerns due to the emergence of newly discovered [potential for man-in-the-middle attacks in tera-hertz based networks][29]. The good news is that theres plenty of time to find solutions to the problem. 6G networks arent expected to start rolling out until 2030.
**More about 5g networks:**
* [How enterprises can prep for 5G networks][30]
* [5G vs 4G: How speed, latency and apps support differ][31]
* [Private 5G networks are coming][32]
* [5G and 6G wireless have security issues][33]
* [How millimeter-wave wireless could help support 5G and IoT][34]
Join the Network World communities on [Facebook][35] and [LinkedIn][36] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all
作者:[Josh Fruhlinger][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Josh-Fruhlinger/
[b]: https://github.com/lujun9972
[1]: https://images.techhive.com/images/article/2017/04/5g-100718139-large.jpg
[2]: https://www.networkworld.com/article/3203489/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html
[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html
[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html
[5]: https://www.theverge.com/2018/6/15/17467734/5g-nr-standard-3gpp-standalone-finished
[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture
[7]: https://www.networkworld.com/article/3291323/millimeter-wave-wireless-could-help-support-5g-and-iot.html
[8]: https://spectrum.ieee.org/video/telecom/wireless/5g-bytes-small-cells-explained
[9]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html
[10]: https://spectrum.ieee.org/tech-talk/telecom/wireless/5g-researchers-achieve-new-spectrum-efficiency-record
[11]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html
[12]: https://venturebeat.com/2018/05/14/worlds-first-commercial-5g-network-launches-in-qatar/
[13]: https://www.lifewire.com/5g-availability-world-4156244
[14]: https://www.digitaltrends.com/computing/verizon-5g-home-promises-up-to-gigabit-internet-speeds-for-50/
[15]: https://lifehacker.com/heres-your-cheat-sheet-for-verizons-new-5g-data-plans-1833278817
[16]: https://www.theverge.com/2018/10/2/17927712/verizon-5g-home-internet-real-speed-meaning
[17]: https://www.cnn.com/2018/12/18/tech/5g-mobile-att/index.html
[18]: https://www.networkworld.com/article/3339720/like-4g-before-it-5g-is-being-hyped.html?nsdr=true
[19]: https://www.digitaltrends.com/mobile/sprint-5g-rollout/
[20]: https://www.cnet.com/news/t-mobile-delays-full-600-mhz-5g-launch-until-second-half/
[21]: https://lets5g.com/
[22]: https://www.verizonwireless.com/support/5g-moto-mod-faqs/?AID=11365093&SID=100098X1555750Xbc2e857934b22ebca1a0570d5ba93b7c&vendorid=CJM&PUBID=7105813&cjevent=2e2150cb478c11e98183013b0a1c0e0c
[23]: https://www.digitaltrends.com/cell-phone-reviews/moto-z3-review/
[24]: https://www.businessinsider.com/samsung-galaxy-s10-5g-which-us-cities-have-5g-networks-2019-2
[25]: https://www.cnet.com/news/why-apples-in-no-rush-to-sell-you-a-5g-iphone/
[26]: https://mashable.com/2012/09/09/iphone-5-4g-lte/#hYyQUelYo8qq
[27]: https://www.networkworld.com/article/3305359/6g-will-achieve-terabits-per-second-speeds.html
[28]: https://www.networkworld.com/article/3285112/get-ready-for-upcoming-6g-wireless-too.html
[29]: https://www.networkworld.com/article/3315626/5g-and-6g-wireless-technologies-have-security-issues.html
[30]: https://%20https//www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html
[31]: https://%20https//www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html
[32]: https://%20https//www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html
[33]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html
[34]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html
[35]: https://www.facebook.com/NetworkWorld/
[36]: https://www.linkedin.com/company/network-world

View File

@ -1,135 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (warmfrog)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Installing Ubuntu MATE on a Raspberry Pi)
[#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/)
[#]: author: (Chinmay https://itsfoss.com/author/chinmay/)
Installing Ubuntu MATE on a Raspberry Pi
======
_**Brief: This quick tutorial shows you how to install Ubuntu MATE on Raspberry Pi devices.**_
[Raspberry Pi][1] is by far the most popular SBC (Single Board Computer) and the go-to board for makers. [Raspbian][2] which is based on Debian is the official operating system for the Pi. It is lightweight, comes bundled with educational tools and gets the job done for most scenarios.
[Installing Raspbian][3] is easy as well but the problem with [Debian][4] is its slow upgrade cycles and older packages.
Running Ubuntu on the Raspberry Pi gives you a richer experience and up to date software. We have a few options when it comes to running Ubuntu on your Pi.
1. [Ubuntu MATE][5] : Ubuntu MATE is the only distribution which natively supports the Raspberry Pi with a complete desktop environment.
2. [Ubuntu Server 18.04][6] \+ Installing a desktop environment manually.
3. Using Images built by the [Ubuntu Pi Flavor Maker][7] community, _these images only support the Raspberry Pi 2B and 3B variants_ and are **not** updated to the latest LTS release.
The first option is the easiest and the quickest to set up while the second option gives you the freedom to install the desktop environment of your choice. I recommend going with either of the first two options.
Here are the links to download the Disc Images. In this article Ill be covering Ubuntu MATE installation only.
### Installing Ubuntu MATE on Raspberry Pi
Go to the download page of Ubuntu MATE and get the recommended images.
![][8]
The experimental ARM64 version should only be used if you need to run 64-bit only applications like MongoDB on a Raspberry Pi server.
[Download Ubuntu MATE for Raspberry Pi][9]
#### Step 1: Setting Up the SD Card
The image file needs to be decompressed once downloaded. You can simply right click on it to extract it.
Alternatively, the following command will do the job.
```
xz -d ubuntu-mate***.img.xz
```
Alternatively you can use [7-zip][10] if you are on Windows.
Install **[Balena Etcher][11]** , well use this tool to write the image to the SD card. Make sure that your SD card is at least 8 GB capacity.
Launch Etcher and select the image file and your SD card.
![][12]
Once the flashing process is complete the SD card is ready.
#### Step 2: Setting Up the Raspberry Pi
You probably already know that you need a few things to get started with Raspberry Pi such as a mouse, keyboard, HDMI cable etc. You can also [install Raspberry Pi headlessly without keyboard and mouse][13] but this tutorial is not about that.
* Plug in a mouse and a keyboard.
* Connect the HDMI cable.
* Insert the SD card into the SD card slot.
Power it on by plugging in the power cable. Make sure you have a good power supply (5V, 3A minimum). A bad power supply can reduce the performance.
#### Ubuntu MATE installation
Once you power on the Raspberry Pi, youll be greeted with a very familiar Ubuntu installation process. The process is pretty much straight forward from here.
![Select your keyboard layout][14]
![Select Your Timezone][15]
Select your WiFi network and enter the password in the network connection screen.
![Add Username and Password][16]
After setting the keyboard layout, timezone and user credentials youll be taken to the login screen after a few minutes. And voila! you are almost done.
![][17]
Once logged in, the first thing you should do is to [update Ubuntu][18]. You can use the command line for that.
```
sudo apt update
sudo apt upgrade
```
You can also use the Software Updater.
![][19]
Once the updates are finished installing you are good to go. You can also go ahead and install Raspberry Pi specific packages for GPIO and other I/O depending on your needs.
What made you think about installing Ubuntu on the Raspberry and how has your experience been with Raspbian? Let me know in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/ubuntu-mate-raspberry-pi/
作者:[Chinmay][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/chinmay/
[b]: https://github.com/lujun9972
[1]: https://www.raspberrypi.org/
[2]: https://www.raspberrypi.org/downloads/
[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/
[4]: https://www.debian.org/
[5]: https://ubuntu-mate.org/
[6]: https://wiki.ubuntu.com/ARM/RaspberryPi#Recovering_a_system_using_the_generic_kernel
[7]: https://ubuntu-pi-flavour-maker.org/download/
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-mate-raspberry-pi-download.jpg?ssl=1
[9]: https://ubuntu-mate.org/download/
[10]: https://www.7-zip.org/download.html
[11]: https://www.balena.io/etcher/
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/Screenshot-from-2019-04-08-01-36-16.png?ssl=1
[13]: https://linuxhandbook.com/raspberry-pi-headless-setup/
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Keyboard-layout-ubuntu.jpg?fit=800%2C467&ssl=1
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/select-time-zone-ubuntu.jpg?fit=800%2C468&ssl=1
[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Credentials-ubuntu.jpg?fit=800%2C469&ssl=1
[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?fit=800%2C600&ssl=1
[18]: https://itsfoss.com/update-ubuntu/
[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/update-software.png?ssl=1

View File

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

View File

@ -1,98 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Tracking the weather with Python and Prometheus)
[#]: via: (https://opensource.com/article/19/4/weather-python-prometheus)
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
Tracking the weather with Python and Prometheus
======
Create a custom Prometheus integration to keep track of the biggest
cloud provider of all: Mother Earth.
![Tree clouds][1]
Open source monitoring system [Prometheus][2] has integrations to track many types of time-series data, but if you want an integration that doesn't yet exist, it's easy to build one. An often-used example is a custom integration with a cloud provider that uses the provider's APIs to grab specific metrics. In this example, though, we will integrate with the biggest cloud provider of all: Earth.
Luckily, the US government already measures the weather and provides an easy API for integrations. Getting the weather forecast for the next hour at Red Hat headquarters is simple.
```
import requests
HOURLY_RED_HAT = "<https://api.weather.gov/gridpoints/RAH/73,57/forecast/hourly>"
def get_temperature():
result = requests.get(HOURLY_RED_HAT)
return result.json()["properties"]["periods"][0]["temperature"]
```
Now that our integration with Earth is done, it's time to make sure Prometheus can understand what we are saying. We can use the [Prometheus Python library][3] to create a registry with one _gauge_ : the temperature at Red Hat HQ.
```
from prometheus_client import CollectorRegistry, Gauge
def prometheus_temperature(num):
registry = CollectorRegistry()
g = Gauge("red_hat_temp", "Temperature at Red Hat HQ", registry=registry)
g.set(num)
return registry
```
Finally, we need to connect this to Prometheus in some way. That depends a little on the network topology for Prometheus: whether it is easier for Prometheus to talk to our service, or whether the reverse is easier.
The first case is the one usually recommended, if possible, so we need to build a web server exposing the registry and then configure Prometheus to _scrape_ it.
We can build a simple web server with [Pyramid][4].
```
from pyramid.config import Configurator
from pyramid.response import Response
from prometheus_client import generate_latest, CONTENT_TYPE_LATEST
def metrics_web(request):
registry = prometheus_temperature(get_temperature())
return Response(generate_latest(registry),
content_type=CONTENT_TYPE_LATEST)
config = Configurator()
config.add_route('metrics', '/metrics')
config.add_view(metrics_web, route_name='metrics')
app = config.make_wsgi_app()
```
This can be run with any Web Server Gateway Interface (WSGI) server. For example, we can use **python -m twisted web --wsgi earth.app** to run it, assuming we put the code in **earth.py**.
Alternatively, if it is easier for our code to connect to Prometheus, we can push it to Prometheus's [Push gateway][5] periodically.
```
import time
from prometheus_client import push_to_gateway
def push_temperature(url):
while True:
registry = prometheus_temperature(get_temperature())
push_to_gateway(url, "temperature collector", registry)
time.sleep(60*60)
```
The URL is the one for the Push gateway; it often ends in **:9091**.
Good luck building your own custom Prometheus integration so you can track all the things!
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/4/weather-python-prometheus
作者:[Moshe Zadka ][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/moshez
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_tree_clouds.png?itok=b_ftihhP (Tree clouds)
[2]: https://prometheus.io/
[3]: https://github.com/prometheus/client_python
[4]: https://trypyramid.com/
[5]: https://github.com/prometheus/pushgateway

View File

@ -1,75 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (lujun9972)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (3 Emacs modes for taking notes)
[#]: via: (https://opensource.com/article/18/7/emacs-modes-note-taking)
[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt)
用来记笔记的三个 Emacs modes
======
借助这些 Emacs mode 轻松记录信息。
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/notebook-writing-pen.jpg?itok=uA3dCfu_)
不管你从事哪种工作,你都无可避免地需要记笔记。而且可能还不是一点点。现在这年头,大家都开始以数字的形式来记笔记了。
开源软件爱好者有多种途径来以电子的方式记下他们的创意,想法和研究过程。你可以使用 [网页工具 ][[1]]。你可以使用 [桌面应用 ][2]。或者,你也可以 [使用命令行工具 ][3]。
如果你使用 [Emacs][4]( 伪装成文本编辑器的强力操作系统),有多个 mode 可以帮你有效地记录笔记。我们这里列举三个例子。
### Deft
![](https://opensource.com/sites/default/files/uploads/deft.png)
在少数情况下,我被迫需要使用 Mac有一个工具是我不能缺少的[nvALT][5] 笔记应用。[Deft mode][6] 为 Emacs 带来了 nvALT 式的体验。
Deft 将你的笔记以文本文件的形式存储在电脑中的某个文件夹中。当你进入 Deft mode你会看到一系列的笔记及其摘要。这些摘要其实就是文本文件的第一行。若第一行是 MarkdownLaTeX甚至 Emacs Org mode 格式的话Deft 会忽略掉这些格式而只显示文本内容。
要打开笔记,只需要向下滚动到该笔记的位置然后按下回车即可。然而 Deft 不仅仅只是这样。根据 Deft 开发者 Jason Blevins 的说法,它的 /主要操作时搜索和过滤/。
Deft 的实现方式简单而有效。输入关键字然后 Deft 会只显示标题中包含关键字的笔记。这在你要从大量笔记中找到某条笔记时非常有用。
### Org mode
![](https://opensource.com/sites/default/files/uploads/orgmode.png)
如果本文没有包含 [Org mode][7] 的话,那么我可能会被人所诟病。为什么?它可以说是 Emacs 中最灵活、使用最广泛的记录笔记的方式了。以正确的方式使用它Org mode 可以极大地增强记笔记的能力。
Org mode 的主要优势在于它组织笔记的方式。在 Org mode 中,一个笔记文件被组织成一个巨大的大纲。每个章节就是大纲里的一个节点,你可以对它进行展开和折叠。这些章节又可以有子章节,这些子章节也可以暂开和折叠。这不仅使你一次只关注于某个章节,而且可以让你浏览整个大纲。
你可以在多个章节之间 [进行互联 ][8],无需通过剪切和复制就能快速移动章节,以及 [附加文件 ][9] 到笔记中。Org mode 支持带格式的字符和表格。如果你需要转换笔记到其他格式Org mode 也有大量的[导出选项 ][10]。
### Howm
![](https://opensource.com/sites/default/files/uploads/howm.png)
当我使用 Emacs 已经成为一种习惯时,[howm][11] 马上就成为我严重依赖的 mode 之一了。虽然我特别喜欢使用 Org mode但 howm 依然占有一席之地。
Howm 就好像时一个小维基似得。你可以创建笔记和任务列表,还能在他们之间创建链接。通过输入或点击某个链接,你可以在笔记之间跳转。如果你需要,还可以使用关键字为笔记添加标签。不仅如此,你可以对笔记进行搜索、排序和合并。
Howm 不是最漂亮的 Emacs mode它也没有最好的用户体验。它需要你花一点时间来适应它。而一旦你适应了它记录和查找笔记就是轻而易举的事情了。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/7/emacs-modes-note-taking
作者:[Scott Nesbitt][a]
选题:[lujun9972][b]
译者:[lujun9972](https://github.com/lujun9972)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/scottnesbitt
[b]: https://github.com/lujun9972
[1]: https://opensource.com/alternatives/evernote
[2]: https://opensource.com/life/16/9/4-desktop-note-taking-applications
[3]: https://opensource.com/article/18/3/command-line-note-taking-applications
[4]: https://www.gnu.org/software/emacs/
[5]: http://brettterpstra.com/projects/nvalt/
[6]: https://jblevins.org/projects/deft/
[7]: https://orgmode.org/
[8]: https://orgmode.org/org.html#Hyperlinks
[9]: https://orgmode.org/org.html#Attachments
[10]: https://orgmode.org/org.html#Exporting
[11]: https://howm.osdn.jp/

View File

@ -0,0 +1,169 @@
[#]: collector: (lujun9972)
[#]: translator: (warmfrog)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What is 5G? How is it better than 4G?)
[#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all)
[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/)
什么是 5G它如何比 4G 更快?
==========================
### 5G 网络将使无限网络吞吐量提高 10 倍并且能够替代有线宽带。但是它们什么时候能够投入使用呢,为什么 5G 和物联网如此紧密地联系在一起呢?
![Thinkstock][1]
[5G 无线][2] 是一个概括的术语,用来描述一系列更快的无线网络的标准和技术,理想上比 4G 快了 20 倍并且延迟降低了 120 倍,为物联网的发展和对新高带宽应用的支持奠定了基础。
## 什么是 5G科技还是流行词
技术在世界范围内完全发挥它的潜能需要数年时间,但同时当今一些 5G 网络服务已经投入使用。5G 不仅是一个技术术语,也是一个营销术语,并不是市场上的所有 5G 服务是标准的。
**[来自世界移动大会:[The time of 5G is almost here][3].]**
## 5G 速度 vs 4G
无线技术的每一代最大的呼吁是增加速度。5G 网络潜在的的峰值下载速度达到[20 Gbps一般在 10 Gbps][4]。这不仅仅是比当前 4G 网络更快4G 目前峰值大约 1 Gbps并且比更多家庭的有线网络连接更快。5G 提供的网络速度能够与光纤一较高下。
吞吐量不是 5G 仅有的速度提升;它还有的特点是极大降低了网络延迟*。* 这是一个重要的区分:吞吐量用来测量花费多久来下载一个大文件,而延迟由网络瓶颈决定,延迟在来回的沟通中减慢了响应速度。
延迟很难量化,因为它在无数的网络状态中变化,但是 5G 网络在理想情况下有能力使延迟率在 1 ms 内。总的来说5G 延迟将比 4G 降低 60 到 120 倍。这会使很多应用变得可能,例如当前虚拟现实的延迟使它变得不实际。
## 5G 技术
5G 技术的基础有一系列标准定义,在过去的 10 年里一直在研究更好的部分。这些里面最重要的是 5G New Radio或者 5G NR** 由 3GPP一个为移动电话开发协议的标准化组织 组织标准化。5G NR 规定了很多 5G 设备操作的方式,于 2018 年 7 月 完成终版。
**[[从 PluralSight 上移动设备管理的课程并且学习如何在你的公司在不降低用户体验的情况下保护设备][6]]**
很多独特的技术同时出现来尽可能地提升 5G 的速度并降低延迟,下面是一些重要的。
## 毫米波
5G 网络大部分使用在 30 到 300 GHz 范围的频率。(正如名称一样,这些频率的波长在 1 到 10 毫米之间)这些高频范围能够[在每个时间单元比低频信号携带更多的信息][7]4G 当前使用的就是通常频率在 1 GHz 以下的低频信号,或者 WiFi最高 6 GHz。
毫米波技术传统上是昂贵并且难于部署的。科技进步已经克服了这些困难,这也是 5G 在如今成为了可能。
## 小的单元
毫米波传输的一个缺点是当他们传输通过物理对象的时候更容易被干扰。
为了克服这些5G 基础设施的模型将不同于 4G。替代了大的移动天线桅杆我们开始接受作为景观的一部分5G 网络将由[穿越城市大概间距 250 米的更小的基站]提供支持,创建更小的服务区域。
## 大量的 MIMO
尽管 5G 基站比 4G 的对应部分小多了,但他们却打包了更多的天线。这些天线是[多输入多输出的MIMO][9]意味着在相同的数据信道能够同时处理多个双向会话。5G 网络能够处理比 4G 网络超过 20 倍的会话。
大量的 MIMO 保证了[基站容量限制下的彻底的提升],允许单个基站承载更多的设备会话。这就是 5G 可能推动物联网更广泛应用的原因。理论上,更多的网络连接的无限设备能够部署在相同的空间而不会使网络被压垮。
## 波束成形
确保所有的会话来回地到达正确的地方是比较棘手的尤其是前面提到的毫米波信号的干涉问题。为了克服这些问题5G 基站部署了更高级的波束技术,使用建设性和破坏性的无线电干扰来使信号有向而不是广播。这在一个特定的方向上有效地加强了信号强度和范围。
## 5G 可获得性
第一个 5G 商用网络 [2018 年 5 月在卡塔尔推出][12]。自那以后,网络已经扩展到全世界,从阿根廷到越南。[Lifewire 有一个不错的,经常更新的列表][13].
牢记一点的是,尽管这样,目前不是所有的 5G 网络都履行了所有的技术承诺。一些早期的 5G 产品依赖于现有的 4G 基础设施,减少了可以获得的潜在速度;其他服务为了市场目的标榜 5G 但是并不符合标准。仔细观察美国无限运营商的产品都会表现出一些陷阱。
## 无线运营商和 5G
技术上讲5G 服务如今在美国已经可获得了。但声明中包含的注意事项因运营商而异,表明 5G 普及之前还有很长的路要走。
Verizon 可能是早期 5G 最大的推动者。它宣告到 2018 年 10 月 将有 4 个城市成为 [5G 家庭][14]的一部分, 一项需要你的其他设备通过 WiFi 来连接特定的 5G 热点,由热点连接到网络服务。
Verizon 计划四月在 Minneapolis 和 Chicago 首次展示 5G 移动服务,该服务将在这一年内传播到其他城市。访问 5G 网络将会花费消费者每月额外的费用加上购买能够实际访问 5G 的手机花费稍后会详细介绍。作为附加Verizon 的部署被称作 [5G TF][16],实际上不符合 5G NR 的标准。
AT&T [声明在 2018 年 12 月将有美国的 12 个城市可以使用 5G][17],在 2019 年的末尾将增加 9 个城市,但最终在这些城市里,只有商业区能够访问。为了访问 5G 网络,需要一个特定的 Netgear 热点来连接到 5G 服务,然后为手机和其他设备提供一个 Wi-Fi 信号。
与此同时AT&T 也在推出 4G 网络的速度提升计划,被成为 5GE即使这些提升和 5G 网络没有关系。([这会向后兼容][18]。)
Sprint 将在 2019 年 5 月之前在四个城市提供 5G 服务,在年末将有更多。但是 Sprint 的 5G 产品充分利用了 MIMO 单元,他们[没有使用毫米波信道][19],意味着 Sprint 的用户不会看到像其他运营商一样的速度提升。
T-Mobile 追求一个相似的模型,它[在 2019 年年底之前不会推出 5G 服务][20]因为他们没有手机能够连接到它。
一个障碍可能阻止 5G 速度的迅速传播是需要铺开所有这些小的单元基站。他们小的尺寸和较低的功耗需求使它们技术上比 4G 技术更容易部署但这不意味着它能够很简单的使政府和财产拥有者信服来到处安装一堆基站。Verizon 实际上建立了[向本地民选官员请愿的网站][21]来加速 5G 基站的部署。
## ** 5G 手机:何时可获得?何时可以买?**
第一部声称为 5G 手机的是 Samsung Galaxy S10 5G将在 2019 年夏末首发。你可以从 Verizon 订阅一个“[Moto Mod][22]”,用来[转换 Moto Z3 手机为 5G 兼容设备][23]。
但是除非你不能忍受作为一个早期使用者的诱惑,你会希望再等待一下;一些奇怪和隐约的关于运营商的问题意味着可能你的手机[不兼容你的运营商的整个 5G 网络][24]。
一个可能令你吃惊的落后者是苹果:分析者坚信最早直到 2020 年以前 iPhone 不会与 5G 兼容。但这符合该公司的特点;苹果在 2012 年末也落后于三星发布兼容 4G 的手机。
不可否认5G 洪流已经到来。5G 兼容的设备[在 2019 年统治了巴塞罗那世界移动大会][3],因此期待视野里有更多的选择。
## 为什么人们已经在讨论 6G 了?
一些专家说缺点是[5G 不能够达到延迟和可靠性的目标][27]。这些完美主义者已经在探寻 6G来试图解决这些缺点。
这是一个[研究新的能够融入 6G 技术的小组],它们自称
The Center for Converged TeraHertz Communications and Sensing ComSenTer。根据说明他们努力让每个设备的带宽达到 100Gbps。
除了增加可靠性还突破了可靠性并增加速度6G 同样试图允许上千的并发连接。如果成功的话,这个特点将帮助物联网设备联网,使在工业设置中部署上千个传感器。
即使仍在胚胎当中6G 已经由于新发现的 [tera-hretz 中基于网络的潜在的中间人攻击][29]的紧迫性面临安全的考虑。好消息是有大量时间来解决这个问题。6G 网络直到 2030 之前才可能出现。
**阅读更多关于 5G 网络:**
* [How enterprises can prep for 5G networks][30]
* [5G vs 4G: How speed, latency and apps support differ][31]
* [Private 5G networks are coming][32]
* [5G and 6G wireless have security issues][33]
* [How millimeter-wave wireless could help support 5G and IoT][34]
在 [Facebook][35] 和 [LinkedIn][36] 上加入网络世界社区来评论当前最热门的话题。
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all
作者:[Josh Fruhlinger][a]
选题:[lujun9972][b]
译者:[warmfrog](https://github.com/warmfrog)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Josh-Fruhlinger/
[b]: https://github.com/lujun9972
[1]: https://images.techhive.com/images/article/2017/04/5g-100718139-large.jpg
[2]: https://www.networkworld.com/article/3203489/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html
[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html
[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html
[5]: https://www.theverge.com/2018/6/15/17467734/5g-nr-standard-3gpp-standalone-finished
[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture
[7]: https://www.networkworld.com/article/3291323/millimeter-wave-wireless-could-help-support-5g-and-iot.html
[8]: https://spectrum.ieee.org/video/telecom/wireless/5g-bytes-small-cells-explained
[9]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html
[10]: https://spectrum.ieee.org/tech-talk/telecom/wireless/5g-researchers-achieve-new-spectrum-efficiency-record
[11]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html
[12]: https://venturebeat.com/2018/05/14/worlds-first-commercial-5g-network-launches-in-qatar/
[13]: https://www.lifewire.com/5g-availability-world-4156244
[14]: https://www.digitaltrends.com/computing/verizon-5g-home-promises-up-to-gigabit-internet-speeds-for-50/
[15]: https://lifehacker.com/heres-your-cheat-sheet-for-verizons-new-5g-data-plans-1833278817
[16]: https://www.theverge.com/2018/10/2/17927712/verizon-5g-home-internet-real-speed-meaning
[17]: https://www.cnn.com/2018/12/18/tech/5g-mobile-att/index.html
[18]: https://www.networkworld.com/article/3339720/like-4g-before-it-5g-is-being-hyped.html?nsdr=true
[19]: https://www.digitaltrends.com/mobile/sprint-5g-rollout/
[20]: https://www.cnet.com/news/t-mobile-delays-full-600-mhz-5g-launch-until-second-half/
[21]: https://lets5g.com/
[22]: https://www.verizonwireless.com/support/5g-moto-mod-faqs/?AID=11365093&SID=100098X1555750Xbc2e857934b22ebca1a0570d5ba93b7c&vendorid=CJM&PUBID=7105813&cjevent=2e2150cb478c11e98183013b0a1c0e0c
[23]: https://www.digitaltrends.com/cell-phone-reviews/moto-z3-review/
[24]: https://www.businessinsider.com/samsung-galaxy-s10-5g-which-us-cities-have-5g-networks-2019-2
[25]: https://www.cnet.com/news/why-apples-in-no-rush-to-sell-you-a-5g-iphone/
[26]: https://mashable.com/2012/09/09/iphone-5-4g-lte/#hYyQUelYo8qq
[27]: https://www.networkworld.com/article/3305359/6g-will-achieve-terabits-per-second-speeds.html
[28]: https://www.networkworld.com/article/3285112/get-ready-for-upcoming-6g-wireless-too.html
[29]: https://www.networkworld.com/article/3315626/5g-and-6g-wireless-technologies-have-security-issues.html
[30]: https://%20https//www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html
[31]: https://%20https//www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html
[32]: https://%20https//www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html
[33]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html
[34]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html
[35]: https://www.facebook.com/NetworkWorld/
[36]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,138 @@
[#]: collector: (lujun9972)
[#]: translator: (warmfrog)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Installing Ubuntu MATE on a Raspberry Pi)
[#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/)
[#]: author: (Chinmay https://itsfoss.com/author/chinmay/)
在 Raspberry Pi 上安装 Ubuntu MATE
=================================
_**简介: 这篇快速指南告诉你如何在 Raspberry Pi 设备上安装 Ubuntu MATE。**_
[Raspberry Pi][1] 是目前最流行的单板机并且是制造商的首选。[Raspbian][2] 是基于 Debian 的 Pi 的官方操作系统。它是轻量级的,内置了教育工具和能在大部分场景下完成工作的工具。
[安装 Raspbian][3] 安装同样简单,但是与 [Debian][4] 一起的问题是慢的升级周期和旧的软件包。
在 Raspberry Pi 上运行 Ubuntu 给你带来一个更丰富的体验和最新的软件。当在你的 Pi 上运行 Ubuntu 时我们有几个选择。
1. [Ubuntu MATE][5] Ubuntu MATE 是仅有的原生支持 Raspberry Pi 包含一个完整的桌面环境的分发版。
2. [Ubuntu Server 18.04][6] \+ 手动安装一个桌面环境。
3. 使用 [Ubuntu Pi Flavor Maker][7] 社区构建的镜像_这些镜像只支持 Raspberry Pi 2B 和 3B 的变种_并且**不能**更新到最新的 LTS 发布版。
第一个选择安装是最简单和快速的,而第二个选择给了你自由选择安装桌面环境的机会。我推荐选择前两个中的任一个。
这里是一些磁盘镜像下载链接。在这篇文章里我只会提及 Ubuntu MATE 的安装。
### 在 Raspberry Pi 上安装 Ubuntu MATE
去 Ubuntu MATE 的下载页面获取推荐的镜像。
![][8]
试验 ARM64 版只应在你需要在 Raspberry Pi 服务器上运行像 MongoDB 这样的 64-bit 应用时使用。
[ 下载为 Raspberry Pi 准备的 Ubuntu MATE][9]
#### 第 1 步:设置 SD 卡
镜像文件一旦下载完成后需要解压。你应该简单的右击来提取它。
可替换地,下面命令做同样的事。
```
xz -d ubuntu-mate***.img.xz
```
如果你在 Windows 上你可以使用 [7-zip][10] 替代。
安装 **[Balena Etcher][11]**,我们将使用这个工具将镜像写入 SD 卡。确保你的 SD 卡有至少 8 GB 的容量。
启动 Etcher选择镜像文件和 SD 卡。
![][12]
一旦进度完成 SD 卡就准备好了。
#### 第 2 步:设置 Raspberry Pi
你可能已经知道你需要一些外设才能使用 Raspberry Pi 例如 鼠标,键盘, HDMI 线等等。你同样可以[不用键盘和鼠标安装 Raspberry Pi][13] 但是这篇指南不是那样。
* 插入一个鼠标和一个键盘。
* 连接 HDMI 线缆。
* 插入 SD 卡 到 SD 卡槽。
插入电源线给它供电。确保你有一个好的电源供应5V3A 至少)。一个不好的电源供应可能降低性能。
#### Ubuntu MATE 安装
一旦你给 Raspberry Pi 供电,你将遇到非常熟悉的 Ubuntu 安装过程。在这里的安装过程相当直接。
![选择你的键盘布局][14]
![选择你的时区][15]
选择你的 WiFi 网络并且在网络连接中输入密码。
![添加用户名和密码][16]
在设置了键盘布局,时区和用户凭证后,在几分钟后你将被带到登录界面。瞧!你快要完成了。
![][17]
一旦登录,第一件事你应该做的是[更新 Ubuntu][18]。你应该使用下列命令。
```
sudo apt update
sudo apt upgrade
```
你同样可以使用软件更新器。
![][19]
一旦更新完成安装你就可以开始了。你可以根据你的需要继续安装 Raspberry Pi 平台的为 GPIO 和其他 I/O 准备的特定软件包。
是什么让你考虑在 Raspberry 上安装 Ubuntu你对 Raspbian 的体验如何呢?在下方评论来让我知道。
--------------------------------------------------------------------------------
via: https://itsfoss.com/ubuntu-mate-raspberry-pi/
作者:[Chinmay][a]
选题:[lujun9972][b]
译者:[warmfrog](https://github.com/warmfrog)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/chinmay/
[b]: https://github.com/lujun9972
[1]: https://www.raspberrypi.org/
[2]: https://www.raspberrypi.org/downloads/
[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/
[4]: https://www.debian.org/
[5]: https://ubuntu-mate.org/
[6]: https://wiki.ubuntu.com/ARM/RaspberryPi#Recovering_a_system_using_the_generic_kernel
[7]: https://ubuntu-pi-flavour-maker.org/download/
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-mate-raspberry-pi-download.jpg?ssl=1
[9]: https://ubuntu-mate.org/download/
[10]: https://www.7-zip.org/download.html
[11]: https://www.balena.io/etcher/
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/Screenshot-from-2019-04-08-01-36-16.png?ssl=1
[13]: https://linuxhandbook.com/raspberry-pi-headless-setup/
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Keyboard-layout-ubuntu.jpg?fit=800%2C467&ssl=1
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/select-time-zone-ubuntu.jpg?fit=800%2C468&ssl=1
[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Credentials-ubuntu.jpg?fit=800%2C469&ssl=1
[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?fit=800%2C600&ssl=1
[18]: https://itsfoss.com/update-ubuntu/
[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/update-software.png?ssl=1

View File

@ -0,0 +1,97 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Tracking the weather with Python and Prometheus)
[#]: via: (https://opensource.com/article/19/4/weather-python-prometheus)
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
使用 Python 和 Prometheus 跟踪天气
======
创建自定义 Prometheus 集成以跟踪最大的云提供者:地球母亲。
![Tree clouds][1]
开源监控系统 [Prometheus][2] 有跟踪多种类型的时间序列数据的集成,但如果不存在你想要的集成,那么很容易构建一个。一个经常使用的例子使用云提供商的自定义集成,它使用提供商的 API 抓取特定的指标。但是,在这个例子中,我们将与最大云提供商集成:地球。
幸运的是,美国政府已经测量了天气并为集成提供了一个简单的 API。获取红帽总部下一个小时的天气预报很简单。
```
import requests
HOURLY_RED_HAT = "<https://api.weather.gov/gridpoints/RAH/73,57/forecast/hourly>"
def get_temperature():
result = requests.get(HOURLY_RED_HAT)
return result.json()["properties"]["periods"][0]["temperature"]
```
现在我们已经完成了与地球的整合,现在是确保 Prometheus 能够理解我们想要内容的时候了。我们可以使用 [Prometheus Python 库][3]中的 _gauge_ 创建一个注册:红帽总部的温度。
```
from prometheus_client import CollectorRegistry, Gauge
def prometheus_temperature(num):
registry = CollectorRegistry()
g = Gauge("red_hat_temp", "Temperature at Red Hat HQ", registry=registry)
g.set(num)
return registry
```
最后,我们需要以某种方式将它连接到 Prometheus。这有点依赖 Prometheus 的网络拓扑Prometheus 与我们的服务通信更容易,还是反向更容易。
第一种是通常建议的情况,如果可能的话,我们需要构建一个公开注册入口的 Web 服务器,并配置 Prometheus _收刮_scrape它。
我们可以使用 [Pyramid][4] 构建一个简单的 Web 服务器。
```
from pyramid.config import Configurator
from pyramid.response import Response
from prometheus_client import generate_latest, CONTENT_TYPE_LATEST
def metrics_web(request):
registry = prometheus_temperature(get_temperature())
return Response(generate_latest(registry),
content_type=CONTENT_TYPE_LATEST)
config = Configurator()
config.add_route('metrics', '/metrics')
config.add_view(metrics_web, route_name='metrics')
app = config.make_wsgi_app()
```
这可以使用任何 Web 网关接口 WSGI 服务器运行。例如,假设我们将代码放在 **earth.py** 中,我们可以使用 **python -m twisted web --wsgi earth.app** 来运行它。
或者,如果我们的代码连接到 Prometheus 更容易,我们可以定期将其推送到 Prometheus 的[推送网关][5]。
```
import time
from prometheus_client import push_to_gateway
def push_temperature(url):
while True:
registry = prometheus_temperature(get_temperature())
push_to_gateway(url, "temperature collector", registry)
time.sleep(60*60)
```
URL 是推送网关的 URL。它通常以 **:9091** 结尾。
祝你构建自定义 Prometheus 集成成功,以便跟踪一切!
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/4/weather-python-prometheus
作者:[Moshe Zadka ][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/moshez
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_tree_clouds.png?itok=b_ftihhP (Tree clouds)
[2]: https://prometheus.io/
[3]: https://github.com/prometheus/client_python
[4]: https://trypyramid.com/
[5]: https://github.com/prometheus/pushgateway