Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2020-03-04 09:49:02 +08:00
commit 65a92a06d3
14 changed files with 1643 additions and 270 deletions

View File

@ -0,0 +1,173 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to assess your organization's technological maturity)
[#]: via: (https://opensource.com/open-organization/20/3/communication-technology-worksheet)
[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland)
How to assess your organization's technological maturity
======
Implementing new communications technologies can make your organization
more open. Use this worksheet to determine whether your organization—and
its people—are prepared.
![Someone wearing a hardhat and carrying code ][1]
New communication technologies can promote and improve [open organizational principles and practices][2]—both within a company and between customers and strategic partners, leading to greater sales and business opportunities.
Previously, I've discussed how companies adopting new communication technologies tend to [fall into four basic categories][3] of investment and utilization. In this article, I'll demonstrate how someone might assess an organization's level of preparedness for technological innovations and the cultural changes it requires.
### Becoming a superstar
For the purpose of this exercise, imagine you're a salesperson working for a company that provides communication or information technology solutions to companies that need advanced information systems and would benefit by becoming "[communication superstars][3]." You'll likely want to impress upon your customers the benefits of becoming this type of user—benefits such as:
* Enhanced customer interaction: When _our_ customers' salespeople visit _their_ customers, they'll need to make the best impression they can to build some level of trust. Therefore—before offering any product—a salesperson must get a customer talking about his situation in order to discover his particular needs, concerns, and opportunities for growth. When the customer asks the salesperson questions about what he can do to address these issues, imagine our customer's salespeople being able to answer him in seconds with detailed information, instead of making the customer wait for hours, day, or even weeks for the answers. Such technologies can increase one's capacity to make proposals, lead to faster and wiser purchasing decisions, and maximize salesperson-customer interactions—all extremely important benefits.
* Better operations: In manufacturing especially, production bottlenecks can be a drain on in-process inventory costs, and alleviating those bottlenecks is critical. Knowing _exactly_ the situation (in-process inventory levels and processing speed, for example) of _every_ stage of a production line in real time can greatly [improve productivity][4].
* Development of new business strategies: With new communication technology expertise, a company could open up new markets and opportunities that would have historically been out of its reach.
### **Let's do some research**
Armed with knowledge of those benefits, again imagine you're a salesperson at an enterprise communication or information technology company. You meet a potential customer at an exhibition or business summit, and she describes the following situation to you:
> "I'm the Operations Manager of a small, local transportation company that makes deliveries within and between several of the surrounding cities. We have a fleet of 30 trucks, all of various sizes and makes. I know the company's information system must to be improved; much of our communication is done through email attachments, texting, and mobile phone calls. We have no central information operating system."
A large, public, national trucking company has set up in her area. She's studied this competitor and read several of its news releases and annual reports. She's learned the company has a centralized communications system, and that all its trucks have tracking technologies that monitor the location of every truck in operation. Trucks also feature sensors that monitor many vehicle operations, including average and specific engine RPM per route by vehicle and driver, and miles travelled in particular conditions (to determine fuel economy and maintenance schedules). An electronic parts delivery system connects this company's service operations with a network of dealers to reduce the time service technicians must wait for parts.
This is what the small local trucking company must compete against. So its operations manager asks you, the IT company salesperson, what you can do to help.
You decide that your first step is to conduct a survey to learn more about both the company's current communication technology system and the personnel's attitude toward this system in order to see what _could_ and _should_ be done to improve the situation. While there, you want to learn this trucking company's IT status _before_ making any recommendations.
I've created a worksheet you might use to facilitate this conversation.
### Taking the temperature
The first part of the worksheet can help you develop a baseline assessment of an organization's readiness for technological change.
#### Part 1: Baseline maturity relative to competitors
Generally, if the customer scores between 10 and 42, then that customer needs more assistance adopting new communication technology, but this varies by industry. If the score is between 43 and 70, then (when compared to competitors the customer is likely already mature in its use of communication technologies.
#### Part 2: Leaders' relationship to communication technologies
Next, you need to assess the company leadership's relationship to technologies, associated processes, and cultural changes. So let's make those calculations in Part 2 of the worksheet.
Here again, depending on the competitive environment, if the score is between 10 and 42, then the company is generally _not_ completely utilizing the communication technology it has. If the score is between 43 and 70, then generally the company puts the communication technology it has to good, creative use.
Organizational leaders must lead the conversation about using more advanced communication systems in the organization. Therefore management must establish training programs to teach everyone in the organization the skills required to _use_ that technology (a step often forgotten or poorly implemented).
#### Part 3: Awareness of challenges and opportunities
We now need to help the organization think more strategically about its use of communication technologies to implement open processes and open culture. We'll do this with Part 3 of the worksheet.
If an organization scores higher than 15, the company understands the communication technology landscape fairly well. If the score is between 9 and 15, the organization needs to isolate its weakest areas and remedy them. A score of less than 9 indicates that the organization should consider conducting new awareness exercises and/or communication technology discovery programs.
#### Part 4: Technological mastery relative to competitors
Next, we need to better understand the trucking company's current strategic assets and its level of technological mastery relative to competitors. We'll do that with Part 4 of the worksheet.
An organization that scores above 16 in this section likely knows where it stands and what its innovation trajectory is in comparison to competitors. A score of 7 to 16 means the organization needs to build alignment around a viable renewal path. A score of less than 7 might mean the organization should conduct a communication technology maturity assessment and update its best practices.
#### Part 5: Ability to articulate technological vision
Now let's explore how well the organization's senior leaders can articulate a vision for the role communication technology will play in the company's future. That's Part 5 of the worksheet.
If the organization scores over 24, then its members likely believe its executives are aligned on a technological vision (and are considering competitors). A score of 14 to 24 should prompt us to isolate the root causes of the concerns and work with the team to remedy them. Anything less than 14 should spur a structured senior executive alignment initiative.
Questions like these can clarify the extent to which employees must be involved in communication technology investment decision-making and utilization. Front-line members typically know what's necessary, what's available, and what the organization should introduce.
### From vision to action
I've seen first-hand that in situations like these, purchasing technologies is only half the problem. Getting people to buy into the system and use it to full capacity are far bigger challenges.
In this section, we'll assess the organization's ability to translate technological vision into action.
#### Part 6: Ability to translate vision to action
First, let's see how the company is currently converting its vision into an action plan relative to competitors. We'll return to the worksheet, specifically Part 6.
A company scoring more than 17 points likely has a robust plan and evaluation system in place, and is focused on engaging people in executing technological adoption efforts relative to competitors. Organizations scoring 7 to 17 should review the action plan and milestone checklist weekly for content and alignment. Those scoring less than 7 should conduct a full review of its milestone checklist and action plan processes.
#### Part 7: Supervision strategies
Few plans succeed without proper supervision, so you'll want to assess the organization's plans to oversee change management efforts. We'll use the trusty worksheet—this time, Part 7.
Did the company score something greater than 15? Then its supervision model is in good shape. Maybe 8 to 15? It should check its governance principles and/or program leadership. Less than 8? Time to rework (or design for the first time) its supervision principles.
#### Part 8: Funding strategy for implementation
Of course, organizational initiatives like these require funding. So you'll want to assess the organization's financial commitment to technological change. Once again, let's use our worksheet (Part 8 this time).
Scoring more than 16 points means the company's funding for new communication technologies is strong. Scoring 8 to 16 means the company should work to ensure that the company portfolio, funding, and business strategy are better aligned. Anything less than 8 means company needs to rework its investment and funding strategy for new technologies.
#### Part 9: Clarity and promotion of vision
Organizational leaders should constantly be clarifying and advocating plans to adopt new technologies. How are they doing? Let's review Part 9 of our worksheet.
If the company scores over 17, then it's likely doing a good job of marketing its ambitions. If it scores somewhere between 7 and 17, it should isolate dimensions of its messaging that need refinement and work with the team to remedy them. If it scores less than 7, it should consider developing a specific program to convey the company's ambition more broadly.
#### Part 10: Ability to build and sustain engagement
Changes to technological systems and processes don't happen automatically. People need to invest in them, and leaders need to sustain their engagement in the organizational changes. Not everyone will buy in (as I've [written previously][5]). We can assess how well the organization is doing this with Part 10 of the worksheet.
A score over 23 indicates that the company is doing a good job building momentum while introducing communication technologies. A score of 12 to 23 means that organization might need to isolate some part of the process that's not proceeding satisfactorily and remedy that component. Less than 12? The company needs to design and conduct a full engagement program.
### Organizational considerations
This final section assesses specific _organizational_ capacities—that is, the organization's culture, its structure, and its processes. Becoming more open by adopting new communication technologies is only possible if the organization itself is flexible and willing to change.
#### Part 11: Organizational culture
Is the organizational environment amenable to the kinds of changes necessary for effectively adopting new communication activities? We'll assess that in Part 11 of our worksheet.
An organization scoring more than 16 points is already shifting its organizational behaviors and culture ahead of competitors. One scoring between 7 and 16 points should investigate root causes of concerns about cultural changes and work with the team to remedy problems. An organization scoring less than 7 should begin working to shift its culture around communication practices and expectations.
#### Part 12: Organizational structure
Does the organization's current structure allow it to sustain communication technology innovations? Use Part 12 of the worksheet to gather an initial impression.
Scoring over 16 means the company possesses the basic structural capabilities necessary for sustained, steady, technical changes. Scoring between 8 and 16 means the company has only begun implementing projects aimed at developing necessary structural capabilities, but more effort is needed. And a score of less than 8 indicates that the company needs to consider specific programs for improving basic structural capabilities.
#### Part 13: Reward and incentive structures
Are the organization's reward and incentive structures aligned with the organization's goals for introducing and adopting new communication technologies? Let's look at the worksheet one last time.
A score over 14 indicates that the company's current reward structures are aligned with its communication technology objectives. A score between 6 and 14 tells us that the organization should build stronger consensus around a viable reward strategy aligned to communication technology renewal. And a score of less than 6 should prompt leadership to implement specific reward structures that accomplish its communication technology adoption goals.
### Post-survey debrief
After collecting those data, you're now in a position to ask how your information technology company can help your potential customer in four areas:
1. Data gathering and company strategy analytics
2. Social media, internet utilization, and interaction internally
3. Telecommunication utilization within company (to avoid excess and unnecessary traveling for meetings, etc.)
4. Automation technology utilization within the company
You're also able to inquire within your company (among solution architects, for example) who we potentially should partner with if need be in order to achieve this transportation company's goals in these four areas."
In these kinds of strategic partnerships, open organization principles—especially transparency, inclusivity, collaboration, and community—come alive. One person cannot do this kind of work alone.
I've seen first-hand that in situations like these, purchasing technologies is only _half the problem._ Getting people to _buy into the system_ and _use it to full capacity_ are far bigger challenges. These challenges are cultural, not technological. Being a "communication superstar" means being great in both those areas—both the communication technology itself, as well as the culture and process expertise necesasry for actual utilization.
--------------------------------------------------------------------------------
via: https://opensource.com/open-organization/20/3/communication-technology-worksheet
作者:[Ron McFarland][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/ron-mcfarland
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/build_structure_tech_program_code_construction.png?itok=nVsiLuag (Someone wearing a hardhat and carrying code )
[2]: https://opensource.com/open-organization/resources/open-org-definition
[3]: https://opensource.com/open-organization/20/1/communication-technology-superstars
[4]: https://www.slideshare.net/RonMcFarland1/improving-processes-65115172?qid=b0a0fde3-62c6-4538-88c8-1bfd70485cee&v=&b=&from_search=5
[5]: https://opensource.com/open-organization/17/1/escape-the-cave

View File

@ -0,0 +1,78 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Key Takeaways from Ciscos Annual Internet Report)
[#]: via: (https://www.networkworld.com/article/3529989/key-takeaways-from-cisco-s-annual-internet-report.html)
[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/)
Key Takeaways from Ciscos Annual Internet Report
======
Businesses need to be ready for the massive wave of devices and bandwidth that are coming in the next vide years
Natalya Burova / Getty Images
By 2023, two-thirds of the worlds population will have Internet access—thats 5.3 billion total Internet users, compared to 3.9 billion in 2018. The number of devices and connections will also skyrocket. There will be 3.6 networked devices per capita by 2023, whereas in 2018, there were 2.4 networked devices per capita.
These findings come from Ciscos _[Annual Internet Report (2018 2023) ][1]_(AIR) - previously known as Visual Network Index (VNI), which assesses the digital transformation across different business segments and their adoption of networking technologies, including fixed broadband, Wi-Fi, and mobile (3G, 4G, 5G). 
[[Get regularly scheduled insights by signing up for Network World newsletters.]][2]
The report described an increased demand for new or enhanced applications that boost workforce productivity or improve customer experiences. In todays mobile world, users expect their devices (and networks) to deliver on all fronts: quality, ease of use, and seamless connectivity. 
[Cisco][3]
The report can be useful as companies plan out their network strategies. One of the aspects of the VNI that Cisco carried over to AIR is an [online tool][4] that lets people slice and dice the information by country, device or other factors. They also included an [“Internet readiness” tool ][5]that explores how prepared different regions are for the coming wave of devices and need for bandwidth. 
**More network automation is needed**
To meet growing demand for enhanced apps, enterprises need automated network monitoring and optimization, andt that can be achieved with software-defined wide area networking (SD-WAN). Software-driven networks create more flexible infrastructures that can adapt to changing traffic requirements, which becomes necessary as more enterprises move to hybrid clouds, the report says.
Policy-based automation and Intent-Based Networking (IBN) are just as important when it comes to building agile, portable, and scalable networks. IBN, as the name implies, captures business intent through analytics and machine learning. One trend Cisco observed in its report is how business WAN traffic flow patterns are becoming more software-based and hybrid in nature, creating a need for IBN solutions, the report says.
[][6]
**SD-WAN is core to network success**
SD-WAN is important to the network edge, which brings computing, storage, and networking resources closer to users and devices. Cisco found many use cases driving the need for greater edge-computing capabilities. One of them is finding ways to control data from the billions of Internet of Things (IoT) endpoints being added to the network edge.
Out of the 29.3 billion networked devices in use by 2023, about half will support various IoT applications, per Ciscos report. As for machine-to-machine (M2M) communication, there will be 14.7 billion connections by 2023. Consumers will hold the biggest share (74%) of total devices and connections, with businesses claiming approximately 26%. However, the consumer share will grow at a slower rate than business.
How will enterprises manage to secure all networked devices and data? Cisco recommends creating a security policy that strikes a balance between data protection and ease of use. In other words, networks will have to be intelligent enough to grant access to the right users without putting them through a difficult authentication process.
**Network managers still struggle to lower operational costs**
Network managers continue to struggle with rising operational costs, as the explosion of devices and data outpaces IT resources. Cisco found nearly 95% of network changes are still performed manually, resulting in operational costs that outweigh network costs. Thats where IT automation can help, enabled by SDN, intelligent network-edge enhancements, and unified domain controls.
In addition to exploring business-specific networking needs, Cisco outlined some trends in consumer and small-to-medium business (SMB) markets. Here are the key takeaways:
* **Next-generation applications**—built with artificial intelligence (AI) and machine learning—will create complex requirements and new business models. Mobile applications, specifically, will drive future consumer, SMB, and enterprise needs, with 299.1 billion mobile apps downloaded worldwide by 2023.
* **Mixed devices and connections** are enabling myriad M2M apps. Connected-home, video-surveillance, connected appliances, and tracking apps will make up 48% of M2M connections by 2023. Connected-car apps will be the fastest-growing category, with connected cities coming in second.
* **Accelerating broadband speeds** will affect traffic growth and use of high-bandwidth content and applications. Average broadband speeds will more than double globally from 45.9 Mbps (in 2018) to 110.4 Mbps (in 2023). Fiber-to-the-home (FTTH), high-speed DSL, and cable broadband adoption will contribute to the growth.
* **Wi-Fi will gain momentum** as devices and IoT connections increase. By 2023, the number of public Wi-Fi hotspots will grow to 628 million, up from 169 million in 2018. Wi-Fi 6 promises to boost speeds by up to 30%, compared to the current generation. More importantly, next-gen Wi-Fi will significantly improve real-time communications and high-definition video, impacting both consumer and business sectors.
Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3529989/key-takeaways-from-cisco-s-annual-internet-report.html
作者:[Zeus Kerravala][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/Zeus-Kerravala/
[b]: https://github.com/lujun9972
[1]: http://www.cisco.com/go/ciscoair
[2]: https://www.networkworld.com/newsletters/signup.html
[3]: https://www.cisco.com/c/en/us/solutions/collateral/executive-perspectives/annual-internet-report/white-paper-c11-741490.html
[4]: https://www.cisco.com/c/en/us/solutions/executive-perspectives/annual-internet-report/air-highlights.html
[5]: https://www.cisco.com/c/en/us/solutions/service-provider/cloud-readiness-tool/index.html
[6]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
[7]: https://www.facebook.com/NetworkWorld/
[8]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,61 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Most-used libraries, open source adoption, and more industry trends)
[#]: via: (https://opensource.com/article/20/3/libraries-5G-more-industry-trends)
[#]: author: (Tim Hildred https://opensource.com/users/thildred)
Most-used libraries, open source adoption, and more industry trends
======
A weekly look at open source community and industry trends.
![Person standing in front of a giant computer screen with numbers, data][1]
As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update.
## [Most-used libraries revealed plus 10 things developers should be doing to keep their code secure][2]
> “The report begins to give us an inventory of the most important shared software and potential vulnerabilities and is the first step to understand more about these projects so that we can create tools and standards that results in trust and transparency in software," explained Jim Zemlin, executive director at the Linux Foundation, in a statement.
**The impact**: Importantly, there is also a great list of packages for backdoors here.
## [Survey: Open source adoption, quality gains][3]
> Overall, the survey finds there has been [a marked shift away from proprietary software][4]. Only 42% said that more than half of the software they use today is proprietary, down from 55% a year ago. Two years from now only 32% said they expect proprietary software to account for more than half their portfolio. On average, respondents said 36% of their organizations software is open source, which in two years is expected to increase to 44% in two years. A total of 77% said they would increase usage of open source software over the next 12 months.
**The impact**: There is a clear virtuous cycle of companies getting more comfortable with open source and more open source software being created. If there isn't already, there will be a rule 34 about open source software.
## [5G must go cloud-native from edge to core][5]
> A containerised core will be the heart of cloud-native 5G networks. Managing and scaling networking apps in containers using a modular microservices approach will help service providers to dynamically orchestrate and grow service capacity across a distributed architecture.
**The impact**: When you're building something complicated and reliable, you really can't look past starting with open source software. Unless you want to be in a foot race against "a Kawasaki" (that's a motorbike, right?).
## [High-performance object storage, Kubernetes, + why you can't containerize a storage appliance][6]
> True multi-tenancy isnt possible unless the storage system is extremely lightweight and able to be packaged with the application stack. If the storage system takes too many resources or contains too many APIs, it wont be possible to pack many tenants on the same infrastructure.
**The impact**: The title of this post is a challenge to someone much more skilled and knowledgable than I.
_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/libraries-5G-more-industry-trends
作者:[Tim Hildred][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/thildred
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
[2]: https://www.theregister.co.uk/2020/02/20/linux_foundation_report/
[3]: https://devops.com/surevey-sees-open-source-adoption-quality-gains/
[4]: https://devops.com/devops-deeper-dive-devops-accelerates-open-source-innovation-pace/
[5]: https://www.5gradar.com/features/5g-must-go-cloud-native-from-edge-to-core
[6]: https://blog.min.io/high-performance-object-storage-with-kubernetes/

View File

@ -1,3 +1,5 @@
Fisherman110 translating
Exploring free and open web fonts
======

View File

@ -1,110 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to set up your own fast, private open source mesh network)
[#]: via: (https://opensource.com/article/20/2/mesh-network-freemesh)
[#]: author: (Spencer Thomason https://opensource.com/users/spencerthomason)
How to set up your own fast, private open source mesh network
======
FreeMesh is an affordable, performant, privacy-respecting mesh system
that installs in less than 10 minutes.
![people on top of a connected globe][1]
The [FreeMesh][2] system promises to bring fully open source mesh networking to the masses. I recently had a chance to test it; it installed quickly, and the performance was great—especially for the price.
### Why mesh and open source?
The reason to use open source is simple: privacy. With FreeMesh, your data is your own. It doesn't track or collect data. Don't trust it? You can easily check—it's open source, after all! With some other popular mesh solutions, say those provided by very large tech conglomerates, would you trust them with your data?
Another important factor: updates. FreeMesh says it is committed to pushing out security and performance updates regularly. What about 10 years from now? With an open source solution, you are free to update the product for as long as you want.
So why mesh? In a mesh network, multiple wireless routers work together to broadcast a single, very large wireless network. Each router in a mesh network intelligently communicates with the other(s) to provide the best "path" for your data. The following images from FreeMesh's website highlight the difference between using a single wireless router and a mesh network. The red network represents a single wireless router, and the green is a mesh network.
![Single-router network][3] | ![Mesh network][4]
---|---
### Get the equipment
To get started with FreeMesh, [order a kit][5]. Two kits are available: standard and 4G LTE.
The 4G LTE kit, as the name suggests, supports cellular data connections. This feature is a rarity in the consumer networking space, and it will be _very_ useful to some folks. You can set up a portable mesh network anywhere with power and cell service with full fast-failover capability.
The FreeMesh kits come with a primary router and two nodes. The router and nodes use 802.11ac, 802.11r, and 802.11s standards. The included firmware runs a customized version of [OpenWrt][6], a Linux distro for embedded devices.
The FreeMesh router has some really good specs:
* **CPU:** Dual-core 880MHz MediaTek MT7621AT (two cores/four threads!)
* **RAM:** DDR3 512MB
* **Interfaces:** 1x GbE WAN, 4x GbE LAN, 1x USB 2.0 ports, 1x microSD card slot, 1x SIM slot
* **Antenna:** 2x 5dBi 2.4GHz, 2x 5dBi 5GHz, 2x 3dBi 3G/4G (built-in)
* **4G LTE modem:** LTE category 4 module, 150Mbps downlink and 50Mbps uplink
### Setup
Setup is easy, and FreeMesh's [README][7] offers simple instructions and diagrams. Start by setting up the primary router first. Then follow these simple steps:
1. Connect the first node (blue WAN port) to the primary router (yellow LAN port).
![FreeMesh setup step 1][8]
2. Wait about 30 to 60 seconds. The node will flash its LEDs when the setup is complete.
![FreeMesh setup step 2][9]
3. Move the node to another location.
That's it! There is no manual setup required for the nodes; you simply plug them into the primary router, and it does the rest. You can add more nodes the same way; just repeat the steps above.
### Features
Out of the box, FreeMesh runs a combination of OpenWRT and LuCI. It has all the features you'd expect from a router. Want to install new features or packages? SSH in and start hacking!
![Real-time load on FreeMesh network][10]
![Overview of FreeMesh network][11]
![OpenWrt status report][12]
### Performance
After setting up the FreeMesh system, I moved the nodes to various places around my house. I used [iPerf][13] to test the bandwidth and was getting around 150Mbps. WiFi can be affected by any number of environmental variables, so your mileage may vary. Distance between the nodes and the primary router also plays a large factor in bandwidth.
However, the real advantage of a mesh network isn't its top-end speed but much better average speed across a space. Even at the far reaches of my home, I was still able to stream videos and work without interruption. I was even able to work in my backyard. I simply repositioned one of the nodes in front of a window before heading outside.
### Conclusion
FreeMesh is really compelling; it offers performance, privacy, and price, all in a simple, open source package.
In my experience, setup is a breeze, and it is more than fast enough. The range is excellent and far exceeds any single-router setup. You are free to hack and customize your FreeMesh setup, but I didn't feel the need to. It has everything I need out of the box.
If you are looking for an affordable, performant, privacy-respecting mesh system that installs in less than 10 minutes, you might want to consider FreeMesh.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/2/mesh-network-freemesh
作者:[Spencer Thomason][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/spencerthomason
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-networking.png?itok=fHmulI9p (people on top of a connected globe)
[2]: https://freemeshwireless.com/
[3]: https://opensource.com/sites/default/files/uploads/singlerouternetwork.png (Single-router network)
[4]: https://opensource.com/sites/default/files/uploads/meshnetwork.png (Mesh network)
[5]: https://freemeshwireless.com/#pricing
[6]: https://openwrt.org/
[7]: https://gitlab.com/slthomason/freemesh/-/blob/master/README.md
[8]: https://opensource.com/sites/default/files/uploads/connecttorouter.png (FreeMesh setup step 1)
[9]: https://opensource.com/sites/default/files/uploads/setupcomplete.png (FreeMesh setup step 2)
[10]: https://opensource.com/sites/default/files/uploads/freemeshrealtimeload.png (Real-time load on FreeMesh network)
[11]: https://opensource.com/sites/default/files/uploads/freemeshwirelessoverview.png (Overview of FreeMesh network)
[12]: https://opensource.com/sites/default/files/uploads/openwrt.png (OpenWrt status report)
[13]: https://opensource.com/article/20/1/internet-speed-tests

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (wenwensnow)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
@ -7,10 +7,10 @@
[#]: via: (https://opensource.com/article/20/2/linux-ebook-readers)
[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt)
3 eBook readers for the Linux desktop
3 eBook readers for the Linux desktop 针对Linux桌面版的3个电子书阅读器
======
Any of these open source eBook applications will make it easy to read
your books on a larger screen.
your books on a larger screen. 任意一个开源电子书应用都能使你在更大屏幕上的阅读体验得到提升。
![Computer browser with books on the screen][1]
I usually read eBooks on my phone or with my Kobo eReader. I've never been comfortable reading books on larger screens. However, many people regularly read books on their laptops or desktops. If you are one of them (or think you might be), I'd like to introduce you to three eBook readers for the Linux desktop.

View File

@ -1,156 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Use logzero for simple logging in Python)
[#]: via: (https://opensource.com/article/20/2/logzero-python)
[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall)
Use logzero for simple logging in Python
======
A quick primer on the handy log library that can help you master this
important programming concept.
![Snake charmer cartoon with a yellow snake and a blue snake][1]
The logzero library makes logging as easy as a print statement, which is quite a feat of simplicity. I'm not sure whether logzero took its name to fit in with the series of "zero boilerplate" libraries like pygame-zero, GPIO Zero, and guizero, but it's certainly in that category. It's a Python library that makes logging straightforward.
You can just use its basic logging to stdout the same way you might use print for information and debugging purposes, and it has a smooth learning curve towards more advanced logging, like logging to a file.
To start, install logzero with pip:
```
`$ sudo pip3 install logzero`
```
Now in a Python file, import logger and try one or all of these logging examples:
```
from logzero import logger
logger.debug("hello")
logger.info("info")
logger.warning("warning")
logger.error("error")
```
The output is automatically colored in an easy-to-read way:
![Python, Raspberry Pi: import logger][2]
So now, instead of using **print** to figure out what's going on, use logger instead, with the relevant log level.
### Writing logs to a file in Python
If you only read this far and make that one change in the way you write code, that's good enough for me. If you want to go further, read on!
Writing to **stdout** is fun for testing a new program, but it is only useful if you are logged into the computer where the script is running. Many times when using an application you'll want to execute the code remotely and review errors after the fact. That's when it's helpful to log to a file instead. Let's try it:
```
from logzero import logger, logfile
logfile('/home/pi/test.log')
```
Now your log entries will be logged into the file **test.log**. Remember to make sure that the [script has permission][3] to write to that file and its directory structure.
You can specify some more options too:
```
`logfile(/home/pi/test.log, maxBytes=1e6, backupCount=3)`
```
Now when the file provided to **logfile** reaches 1MB (1×106 bytes), it will rotate entries through **test.log.1**, **test.log.2**, and so on. This behavior is nice to avoid generating a massive log file that is I/O intensive for the system to open and close. You might also want to log to **/var/log** like a pro. Assuming you're on Linux, you a directory and make your user the owner so they can write to it:
```
$ sudo mkdir /var/log/test
$ sudo chown pi /var/log/test
```
Then in your Python code, change the **logfile** path:
```
`logfile(/var/log/test/test.log, maxBytes=1e6, backupCount=3)`
```
When it comes to catching exceptions in your **logfile**, you can either use **logging.exception:**
```
try:
    c = a / b
except Exception as e:
    logger.exception(e)
```
This will produce the following (in the case that b is zero):
```
[E 190422 23:41:59 test:9] division by zero
     Traceback (most recent call last):
       File "test.py", line 7, in
         c = a / b
     ZeroDivisionError: division by zero
```
You get the log entry, followed by the full traceback. Alternatively, you could use **logging.error** and hide the traceback:
```
try:
    c = a / b
except Exception as e:
    logger.error(f"{e.__class__.__name__}: {e}")
```
Now this will produce the more succinct:
```
`[E 190423 00:04:16 test:9] ZeroDivisionError: division by zero`
```
* * *
* * *
* * *
**![Logging output][4]**
There are plenty more options which you can read in the docs at [logzero.readthedocs.io][5].
### logzero shines for education
Logging can be a challenging concept for a new programmer. Most frameworks depend on flow control and lots of variable manipulation to make a meaningful log, but logzero is different. With its syntax being similar to a print statement, it is a big win for education as it saves from explaining another concept. Give it a try on your next project.
\--
_This article was originally written on [my blog][6] and is republished with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/2/logzero-python
作者:[Ben Nuttall][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/bennuttall
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Snake charmer cartoon with a yellow snake and a blue snake)
[2]: https://opensource.com/sites/default/files/uploads/rpi_ben_1.png (Python, Raspberry Pi: import logger)
[3]: https://opensource.com/article/19/6/understanding-linux-permissions
[4]: https://opensource.com/sites/default/files/uploads/rpi_ben_2.png (Logging output)
[5]: https://logzero.readthedocs.io/en/latest/
[6]: https://tooling.bennuttall.com/logzero/

View File

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

View File

@ -0,0 +1,164 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Getting started with lightweight alternatives to GNU Emacs)
[#]: via: (https://opensource.com/article/20/3/lightweight-emacs)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Getting started with lightweight alternatives to GNU Emacs
======
Slimmed-down (in size and features) alternatives allow you to take your
text editor anywhere you go.
![Text editor on a browser, in blue][1]
I work on a lot of servers, and sometimes I find a host that hasn't installed [GNU Emacs][2]. There's usually a [GNU Nano][3] installation to keep me from resorting to [Vi][4], but I'm not used to Nano the way I am Emacs, and I inevitably run into complications when I try to save my document (**C-x** in Nano stands for Exit, and **C-s** locks Konsole).
While it would be nice to have GNU Emacs available everywhere, it's a lot of program for making a simple update to a config file. My need for a small and lightweight emacs is what took me down the path of discovering MicroEmacs, Jove, and Zile—tiny, self-contained [emacsen][5] that you can put on a thumb drive, an SD card, and nearly any server, so you'll never be without an emacs editor.
### Editing macros
The term "emacs" is a somewhat generic term in the way that only open source produces, and a portmanteau. Before there was [GNU Emacs][6], there were collections of batch process scripts (called _macros_) that could perform common tasks for a user. For instance, if you often found yourself typing "teh" instead of "the," you could either go in and correct each one manually (no small feat when your editor can't even load the entire document into memory, as was often the case in the early 1980s), or you could invoke a macro to perform a quick swap of the "e" and "h."
Eventually, these macros were bundled together into a package called editing macros, or EMACS for short. GNU Emacs is the most famous emacsen (yes, the -en suffix is used to describe many emacs, as in the word "oxen"), but it's not the only one. And it's certainly not the smallest. Quite the contrary, GNU Emacs is probably one of the largest.
Fortunately, GNU Emacs is so popular that other emacs implementations tend to mimic most of the GNU version's basic controls. If you're looking for a basic, fast, and efficient editor that isn't Vim, you'll likely be happy with any of these options.
### MicroEmacs
![µemacs][7]
[MicroEmacs][8], also known as uemacs (as in the Greek letter µ, which denotes "micro" in scientific notation), was written by Dave Conroy, but there's a long list of users who have cloned it and modified it. One user who maintains a personal version of µemacs is a programmer named Linus Torvalds, and his copy is available from his website, [kernel.org][9] (which also, incidentally, includes a small side project of his called [Linux][10]).
#### Size
It takes me five seconds to compile µemacs at the slowest setting I can impose on my computer, and the resulting binary is a mere 493KB. Admittedly, that's not literally "micro" compared to the typical size of a GNU Emacs download (1 millionth of 70MB is 70 bytes, by my calculation), but it's respectably small. For instance, it's easy enough to send it to yourself by email or over Signal, and certainly small enough to keep handy on every thumb drive or SD card you own.
By default, Linus's version expects libcurses, but you can override this setting in the Makefile so that it uses libtermcap instead. The resulting binary is independent enough to run on most Linux boxes:
```
$ ldd em
linux-vdso.so.1
libtermcap.so.2 => /lib64/libtermcap.so.2
libc.so.6 => /lib64/libc.so.6
/lib64/ld-linux-x86-64.so.2
```
#### Features
The [keyboard shortcuts][11] are just as you'd expect. You can open files and edit them without ever realizing you're not in GNU Emacs.
Some advanced features are missing. For instance, there's no vertical buffer split, although there is a horizontal split. There's no eval command, so you won't use µemacs for Lisp programming.
The search function is also a little different from what you may be used to: instead of **C-s**, it's **M-s**, which could make all the difference if your terminal emulator accepts **Ctrl+S** as a freeze command. The help page for µemacs is very complete, so use **M-x help** to get familiar with what it has available.
#### License
The license for µemacs is custom to the project with a non-commercial condition. You're free to share, use, and modify µemacs, but you can't do anything commercial with it.
While not as liberal a policy as I typically prefer, it's a good-enough license for personal use; just don't build a business around it.
### GNU Zile
![GNU Zile][12]
[GNU Zile][13] claims to be a development kit for text editors. It's meant as a framework to enable people to quickly develop their own custom text editor without having to reinvent common data structures. It's a great idea and probably very useful, but as I have no interest in making my own editor, I just use the example implementation that ships with its codebase as a pleasant, lightweight emacs.
The build process for the example editor (supposedly called Zemacs, although the binary it renders is named zile) is the standard [Autotools][14] procedure:
```
$ ./configure
$ make
```
#### Size
Compiling it from source takes me a minute on one core or about 50 seconds on six cores (the configuration process is the long part). The binary produced in the end is 1.2MB, making this the heaviest of the lightweight emacsen I use, but compared to even GNU Emacs without X (which is 14MB on my system), it's relatively trivial.
Of the lightweight emacsen I use, it's also the most complex. You can exclude some library links by disabling features during configuration, but here are the defaults:
```
$ ldd src/zile
linux-vdso.so.1
libacl.so.1 => /lib64/libacl.so.1
libncurses.so.5 => /lib64/libncurses.so.5
libgc.so.1 => /usr/lib64/libgc.so.1
libc.so.6 => /lib64/libc.so.6
libattr.so.1 => /lib64/libattr.so.1
libdl.so.2 => /lib64/libdl.so.2
libpthread.so.0 => /lib64/libpthread.so.0
/lib64/ld-linux-x86-64.so.2
```
#### Features
Zile acts a little more like GNU Emacs than µemacs or Jove, but it's still a minimal experience. But some little touches are refreshing: Tab completion happens in a buffer, you can run shell commands from the mini-buffer, and you have a good assortment of functions available. It's by no means a GNU Emacs replacement, though, and if you wander too far in search of advanced features, you'll find out why it's only 1.2MB.
I've been unable to find in-application help files, and the man page bundled with it is minimal. However, if you're comfortable with Emacs, Zile is a good compromise between the full 14MB (or greater, if you're using a GUI) version and the extremely lightweight implementations.
### Jove
![Jove][15]
[Jove][16] was my first tiny emacs and remains the smallest I've found yet. This was an easy discovery for me, as it ships with [Slackware][17] Linux and, with a surreptitious symlink, quickly became my personal replacement for the Vi binary. Jove is based on GNU Emacs, but the man page cautions that feature parity is by no means to be expected. I find Jove surprisingly feature-rich for such a small binary (in fact, this article was written in Jove version 4.17.06-9), but there's no question that renaming .emacs to .joverc does _not_ behave as you might hope.
#### Size
It takes me five seconds to compile Jove at the slowest setting (-j1) and about a second using all cores. The resulting binary, confusingly called jjove by default, is just 293KB.
The Jove binary is independent enough to run on most Linux boxes:
```
$ ldd jjove
linux-vdso.so.1
libtermcap.so.2 => /lib64/libtermcap.so.2
libc.so.6 => /lib64/libc.so.6
/lib64/ld-linux-x86-64.so.2
```
#### Features
Jove has good documentation in the form of a man page. You can also get a helpful listing of all available commands by typing **M-x ?** and using the Spacebar to scroll. If you're entirely new to emacs, you can run **teachjove** to learn Jove (and emacs, accordingly).
Most common editing commands and keybindings work as expected. Some oddities exist; for example, there's no vertical split, and Tab completion for paths in the mini-buffer is non-existent. However, it's the smallest emacs I've found and yet has a full GNU Emacs feel to it.
### Try Emacs
If you've only ever tried GNU Emacs, then you might find that the world of emacsen is richer than you may have expected. There's a rich tradition behind emacs, and trying some of its variants, spin-offs, and alternate implementations is part of the joy of being comfortable with how emacsen work. Get to know emacs; carry a few builds around everywhere you go, and you'll never have to use a substandard editor again!
GNU Emacs can be much more than just a text editor. Learn how to get started.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/lightweight-emacs
作者:[Seth Kenlon][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/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue)
[2]: https://www.gnu.org/software/emacs/
[3]: https://www.nano-editor.org/
[4]: https://opensource.com/article/19/3/getting-started-vim
[5]: https://www.emacswiki.org/emacs/Emacsen
[6]: https://opensource.com/article/20/2/who-cares-about-emacs
[7]: https://opensource.com/sites/default/files/uploads/lightweight-emacs-uemacs.jpg (µemacs)
[8]: https://en.wikipedia.org/wiki/MicroEMACS
[9]: https://git.kernel.org/pub/scm/editors/uemacs/uemacs.git
[10]: https://opensource.com/tags/linux
[11]: https://opensource.com/downloads/emacs-cheat-sheet
[12]: https://opensource.com/sites/default/files/uploads/lightweight-emacs-zile.jpg (GNU Zile)
[13]: https://www.gnu.org/software/zile/
[14]: https://opensource.com/article/19/7/introduction-gnu-autotools
[15]: https://opensource.com/sites/default/files/uploads/lightweight-emacs-jove.jpg (Jove)
[16]: https://opensource.com/article/17/1/jove-lightweight-alternative-vim
[17]: http://slackware.com

View File

@ -0,0 +1,607 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Getting started with the Rust package manager, Cargo)
[#]: via: (https://opensource.com/article/20/3/rust-cargo)
[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe)
Getting started with the Rust package manager, Cargo
======
Get to know Rust's package manager and build tool.
![Shipping containers stacked in a yard][1]
[Rust][2] is a modern programming language that provides performance, reliability, and productivity. It has consistently been voted as the [most-loved language][3] on StackOverflow surveys for a few years now.
In addition to being a great programming language, Rust also features a build system and package manager called Cargo. Cargo handles a lot of tasks, like building code, downloading libraries or dependencies, and so on. The two are bundled together, so you get Cargo when you install Rust.
### Installing Rust and Cargo
Before getting started, you need to install Rust and Cargo. The Rust project provides a downloadable script to handle the installation. To get the script, open a browser to [https://sh.rustup.rs][4] and save the file. Read the script to make sure you're happy with what it intends to do, and then run it:
```
`$ sh ./rustup.rs`
```
You can also refer to the [Install Rust][5] webpage for more information.
After installing Rust and Cargo, you must source the env file:
```
`$ source $HOME/.cargo/env`
```
Better yet, add the required directory to your PATH variable:
```
`$ source $HOME/.cargo/env`
```
If you prefer to use your package manager (such as DNF or Apt on Linux), look for Rust and Cargo packages in your distribution's repositories and install accordingly. For example:
```
`$ dnf install rust cargo`
```
Once they're installed and set up, verify which versions of Rust and Cargo you have:
```
$ rustc --version
rustc 1.41.0 (5e1a79984 2020-01-27)
$ cargo --version
cargo 1.41.0 (626f0f40e 2019-12-03)
```
### Building and running Rust by hand
Start with a simple program that prints "Hello, world!" on the screen. Open your favorite text editor and type the following program:
```
$ cat hello.rs
fn main() {
    println!("Hello, world!");
}
```
Save the file with an **.rs** extension to identify it as a Rust source code file.
Compile your program using the Rust compiler, **rustc**:
```
`$ rustc hello.rs`
```
After compilation, you will have a binary that has the same name as the source program:
```
$ ls -l
total 2592
-rwxr-xr-x. 1 user group 2647944 Feb 13 14:14 hello
-rw-r--r--. 1 user group      45 Feb 13 14:14 hello.rs
$
```
Execute your program to verify that it runs as expected:
```
$ ./hello
Hello, world!
```
These steps are sufficient for smaller programs or whenever you want to test out something quickly. However, when working on bigger programs involving multiple people, Cargo is the best way forward.
### Creating a new package using Cargo
Cargo is a build system and package manager for Rust. It helps developers download and manage dependencies and assists in creating Rust packages. Packages in Rust are often called "crates" in the Rust community, but in this article, the two words are interchangeable. Refer to the Cargo [FAQ][6] provided by the Rust community for clarification.
If you need any help with Cargo's command-line utility, use the **\--help** or **-h** command-line argument:
```
`$ cargo help`
```
To create a new package, use the **new** keyword, followed by the package name. For this example, use **hello_opensource** as your new package name. After running the command, you will see a message confirming that Cargo has created a binary package with the given name:
```
$ cargo new hello_opensource
     Created binary (application) `hello_opensource` package
```
Running a **tree** command to see the directory structure reports that some files and directories were created. First, it creates a directory with the name of the package, and within that directory is an **src** directory for your source code files:
```
$ tree .
.
└── hello_opensource
    ├── Cargo.toml
    └── src
        └── main.rs
2 directories, 2 files
```
Cargo not only creates a package, but it also creates a simple **Hello, world!** program. Open the **main.rs** file and have a look:
```
$ cat hello_opensource/src/main.rs
fn main() {
    println!("Hello, world!");
}
```
The next file to work with is **Cargo.toml**, which is a configuration file for your package. It contains information about the package, such as its name, version, author information, and Rust edition information.
A program often depends on external libraries or dependencies to run, which enables you to write applications that perform tasks that you don't know how to code or you don't want to spend time coding. All your dependencies will be listed in this file. At this point, you do not have any dependencies for your new program. Open the **Cargo.toml** file and view its contents:
```
$ cat hello_opensource/Cargo.toml
[package]
name = "hello_opensource"
version = "0.1.0"
authors = ["user <[user@mail.com][7]>"]
edition = "2018"
# See more keys and their definitions at <https://doc.rust-lang.org/cargo/reference/manifest.html>
[dependencies]
```
### Building the program using Cargo
So far, so good. Now that you have a package in place, build a binary (also called an executable). Before doing that, move into the package directory:
```
`$ cd hello_opensource/`
```
You can use Cargo's **build** command to build the package. Notice the messages that say it is **Compiling** your program:
```
$ cargo build
   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource)
    Finished dev [unoptimized + debuginfo] target(s) in 0.38s
```
Check what happens to your project directory after you run the **build** command:
```
$ tree .
.
├── Cargo.lock
├── Cargo.toml
├── src
│   └── main.rs
└── target
    └── debug
        ├── build
        ├── deps
        │   ├── hello_opensource-147b8a0f466515dd
        │   └── hello_opensource-147b8a0f466515dd.d
        ├── examples
        ├── hello_opensource
        ├── hello_opensource.d
        └── incremental
            └── hello_opensource-3pouh4i8ttpvz
                ├── s-fkmhjmt8tj-x962ep-1hivstog8wvf
                │   ├── 1r37g6m45p8rx66m.o
                │   ├── 2469ykny0eqo592v.o
                │   ├── 2g5i2x8ie8zed30i.o
                │   ├── 2yrvd7azhgjog6zy.o
                │   ├── 3g9rrdr4hyk76jtd.o
                │   ├── dep-graph.bin
                │   ├── query-cache.bin
                │   ├── work-products.bin
                │   └── wqif2s56aj0qtct.o
                └── s-fkmhjmt8tj-x962ep.lock
9 directories, 17 files
```
Wow! The compilations process produced a lot of intermediate files. Your binary, though, is saved in the **./target/debug** directory with the same name as your package.
### Running your application using Cargo
Now that your binary is built, run it using Cargo's **run** command. As expected, it prints **Hello, world!** on the screen.
```
$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/hello_opensource`
Hello, world!
```
Alternatively, you can run the binary directly, which is located at:
```
$ ls -l ./target/debug/hello_opensource
-rwxr-xr-x. 2 root root 2655552 Feb 13 14:19 ./target/debug/hello_opensource
```
As expected, it produces the same results:
```
$ ./target/debug/hello_opensource
Hello, world!
```
Say you need to rebuild your package and get rid of all the binaries and the intermediate files created by the earlier compilation process. Cargo provides a handy **clean** option to remove all intermediate files except the source code and other required files:
```
$ cargo clean
$ tree .
.
├── Cargo.lock
├── Cargo.toml
└── src
    └── main.rs
1 directory, 3 files
```
Make some changes to the program and run it again to see how it works. For example, this minor change adds **Opensource** to the **Hello, world!** string:
```
$ cat src/main.rs
fn main() {
    println!("Hello, Opensource world!");
}
```
Now, build the program and run it again. This time you see **Hello, Opensource world!** displayed on the screen:
```
$ cargo build
   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource)
    Finished dev [unoptimized + debuginfo] target(s) in 0.39s
$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/hello_opensource`
Hello, Opensource world!
```
### Adding dependencies using Cargo
Cargo allows you to add dependencies that your program needs to run. Adding a dependency is extremely easy with Cargo. Every Rust package includes a **Cargo.toml** file, which contains a list (empty by default) of dependencies. Open the file in your favorite text editor, find the **[dependencies]** section, and add the library you want to include in your package. For example, to add the **rand** library as your dependency:
```
$ cat Cargo.toml
[package]
name = "hello_opensource"
version = "0.1.0"
authors = ["test user &lt;[test@mail.com][8]&gt;"]
edition = "2018"
# See more keys and their definitions at <https://doc.rust-lang.org/cargo/reference/manifest.html>
[dependencies]
rand = "0.3.14"
```
Try building your package to see what happens.
```
$ cargo build
    Updating crates.io index
   Compiling libc v0.2.66
   Compiling rand v0.4.6
   Compiling rand v0.3.23
   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource)
    Finished dev [unoptimized + debuginfo] target(s) in 4.48s
```
Cargo is now reaching out to [Crates.io][9], which is Rust's central repository for crates (or packages) and downloading and compiling **rand**. But wait—what about the **libc** package? You did not ask for **libc** to be installed. Well, the **rand** package is dependent on the **libc** package; hence, Cargo downloads and compiles **libc** as well.
New versions of libraries keep coming, and Cargo provides an easy way to update all of their dependencies using the **update** command:
```
`cargo update`
```
You can also choose to update specific libraries using the **-p** flag followed by the package name:
```
`cargo update -p rand`
```
### Compiling and running with a single command
So far, you have used **build** followed by **run** whenever you make changes to your program. There is an easier way: you can simply use the **run** command, which internally compiles and runs the program. To see how it works, first clean up your package directory:
```
$ cargo clean
$ tree .
.
├── Cargo.lock
├── Cargo.toml
└── src
    └── main.rs
1 directory, 3 files
```
Now execute **run**. The output states that it compiled and then ran the program, and this means you don't need to explicitly run **build** each time:
```
$ cargo run
   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource)
    Finished dev [unoptimized + debuginfo] target(s) in 0.41s
     Running `target/debug/hello_opensource`
Hello, world!
```
### Checking your code in development
You often go through multiple iterations when developing a program. You need to ensure that your program has no coding errors and compiles fine. You don't need the overhead of generating the binary on each compilation. Cargo has you covered with a **check** option that compiles your code but skips the final step of generating an executable.
Start by running **cargo clean** within your package directory:
```
$ tree .
.
├── Cargo.lock
├── Cargo.toml
└── src
    └── main.rs
1 directory, 3 files
```
Now run the **check** command and see what changes were made to the directory:
```
$ cargo check
    Checking hello_opensource v0.1.0 (/opensource/hello_opensource)
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
```
The output shows that, even though intermediate files were created as part of the compilation process, the final binary or executable was not created. This saves some time, which matters a lot if the package is huge with thousands of lines of code:
```
$ tree .
.
├── Cargo.lock
├── Cargo.toml
├── src
│   └── main.rs
└── target
    └── debug
        ├── build
        ├── deps
        │   ├── hello_opensource-842d9a06b2b6a19b.d
        │   └── libhello_opensource-842d9a06b2b6a19b.rmeta
        ├── examples
        └── incremental
            └── hello_opensource-1m3f8arxhgo1u
                ├── s-fkmhw18fjk-542o8d-18nukzzq7hpxe
                │   ├── dep-graph.bin
                │   ├── query-cache.bin
                │   └── work-products.bin
                └── s-fkmhw18fjk-542o8d.lock
9 directories, 9 files
```
To see if you are really saving time, time the **build** and **check** commands and compare them.
First, the **build** command:
```
$ time cargo build
   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource)
    Finished dev [unoptimized + debuginfo] target(s) in 0.40s
real    0m0.416s
user    0m0.251s
sys     0m0.199s
```
Clean the directory before running the **check** command:
```
`$ cargo clean`
```
The **check** command:
```
$ time cargo check
    Checking hello_opensource v0.1.0 (/opensource/hello_opensource)
    Finished dev [unoptimized + debuginfo] target(s) in 0.15s
real    0m0.166s
user    0m0.086s
sys     0m0.081s
```
Clearly, the **check** command is much faster.
### Building external Rust packages
Everything you've done so far will apply to any Rust crate you get from the internet. You simply need to download or clone the repository, move to the package folder, and run the **build** command, and you are good to go:
```
git clone &lt;github-like-url&gt;
cd &lt;package-folder&gt;
cargo build
```
### Building optimized Rust programs using Cargo
You've run **build** multiple times so far, but did you notice its output? No worries, build it again and watch closely:
```
$ cargo build
   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource)
    Finished dev [unoptimized + debuginfo] target(s) in 0.36s
```
See the **[unoptimized + debuginfo]** text after each compilation? This means that the binary generated by Cargo includes a lot of debugging information and is not optimized for execution. Developers often go through multiple iterations of development and need this debugging information for analysis. Also, performance is not the immediate goal while developing software. Therefore, this is OK for now.
However, once the software is ready for release, it doesn't need to have the debugging information anymore. But it does need to be optimized for best performance. In the final stages of development, you can use the **\--release** flag with **build**. Watch closely; you should see the **[optimized]** text after compilation:
```
$ cargo build --release
   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource)
    Finished release [optimized] target(s) in 0.29s
```
If you want to, you can go through the exercise to find out your time savings when running optimized vs. unoptimized software.
### Creating a library vs. a binary using Cargo
Any software program can be roughly categorized as either a standalone binary or a library. A standalone binary can be run as it is, even though it might make use of external libraries. A library, however, is utilized by another standalone binary. All the programs you've built so far in this tutorial are standalone binaries since that is Cargo's default. To create a **library**, add the **\--lib** option:
```
$ cargo new --lib libhello
     Created library `libhello` package
```
This time, Cargo does not create a **main.rs** file; instead, it creates a **lib.rs** file. The code for your library should go here:
```
$ tree .
.
└── libhello
    ├── Cargo.toml
    └── src
        └── lib.rs
2 directories, 2 files
```
Knowing Cargo, don't be surprised that it put some code in your new library file. Find out what it added by moving to the package directory and viewing the file. By default, Cargo puts a test function within library files.
### Running tests using Cargo
Rust provides first-class support for unit and integration testing, and Cargo allows you to execute any of these tests:
```
$ cd libhello/
$ cat src/lib.rs
#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
        assert_eq!(2 + 2, 4);
    }
}
```
Cargo has a handy **test** option to run any test that is present in your code. Try running the tests that Cargo put in the library code by default:
```
$ cargo test
   Compiling libhello v0.1.0 (/opensource/libhello)
    Finished test [unoptimized + debuginfo] target(s) in 0.55s
     Running target/debug/deps/libhello-d52e35bb47939653
running 1 test
test tests::it_works ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
   Doc-tests libhello
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
```
### Looking under Cargo's hood
You may be interested in knowing what Cargo does under the hood when you run a command. After all, Cargo is, in many ways, a wrapper. To find out what it's doing, you can use the **-v** option with any Cargo command to output verbose information to the screen.
Here are a couple of examples that run **build** and **clean** using the **-v** option.
In the **build** command, you can see that the underlying **rustc** (Rust compiler) fired with the given command-line options:
```
$ cargo build -v
   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource)
     Running `rustc --edition=2018 --crate-name hello_opensource src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=147b8a0f466515dd -C extra-filename=-147b8a0f466515dd --out-dir /opensource/hello_opensource/target/debug/deps -C incremental=/opensource/hello_opensource/target/debug/incremental -L dependency=/opensource/hello_opensource/target/debug/deps`
    Finished dev [unoptimized + debuginfo] target(s) in 0.36s
```
Whereas the **clean** command shows that it is simply removing the directory that contains the intermediate files and the binary:
```
$ cargo clean -v
    Removing /opensource/hello_opensource/target
```
### Don't let your skills get rusty
To expand your skills, try writing and running a slightly more complex program using Rust and Cargo. Something simple will do: for instance, try listing all files in the current directory (it can be done in nine lines of code), or try echoing input back out at yourself. Small practice applications help you get comfortable with the syntax and the process of writing and testing code.
This article offers plenty of information for budding Rust programmers to get started with Cargo. However, as you begin working on larger and more complicated programs, you'll need a more advanced understanding of Cargo. When you're ready for more, download and read the open source [Cargo Book][10] written by the Rust team, and see what you can create!
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/rust-cargo
作者:[Gaurav Kamathe][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/gkamathe
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers2.png?itok=idd8duC_ (Shipping containers stacked in a yard)
[2]: https://www.rust-lang.org/
[3]: https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages
[4]: https://sh.rustup.rs/
[5]: https://www.rust-lang.org/tools/install
[6]: https://doc.rust-lang.org/cargo/faq.html
[7]: mailto:user@mail.com
[8]: mailto:test@mail.com
[9]: http://crates.io
[10]: https://doc.rust-lang.org/cargo

View File

@ -0,0 +1,148 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Watching activity on Linux with watch and tail commands)
[#]: via: (https://www.networkworld.com/article/3529891/watching-activity-on-linux-with-watch-and-tail-commands.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
Watching activity on Linux with watch and tail commands
======
The watch and tail commands can help monitor activity on Linux systems. This post looks at some helpful ways to use these commands.
Loops7 / Getty Images
The **watch** and **tail** commands provide some interesting options for examining activity on a Linux system in an ongoing manner.
That is, instead of just asking a question and getting an answer (like asking **who** and getting a list of currently logged in users), you can get **watch** to provide you with a display showing who is logged in along with updates as users come and go.
[[Get regularly scheduled insights by signing up for Network World newsletters.]][1]
With **tail**, you can display the bottoms of files and see content as it is added. This kind of monitoring is often very helpful and requires less effort than running commands periodically.
### Using watch
One of the simplest examples of using **watch** is to use the command **watch who**. You should see a list showing who is logged in along with when they logged in and where they logged in from. Notice that the default is to update the display every two seconds (top left) and that the date and time (upper right) updates itself at that interval. The list of users will grow and shrink as users log in and out.
### $ watch who
This command will dissplay a list of logins like this:
```
Every 2.0s: who dragonfly: Thu Feb 27 10:52:00 2020
nemo pts/0 2020-02-27 08:07 (192.168.0.11)
shs pts/1 2020-02-27 10:58 (192.168.0.5)
```
You can change the interval to get less frequent updates by adding a **-n** option (e.g., -n 10) to select a different number of seconds between updates.
### $ watch -n 10 who
The new interval will be displayed and the time shown will change less frequently, aligning itself with the selected interval.
[][2]
```
Every 10.0s: who dragonfly: Thu Feb 27 11:05:47 2020
nemo pts/0 2020-02-27 08:07 (192.168.0.11)
shs pts/1 2020-02-27 10:58 (192.168.0.5)
```
If you prefer to see only the command's output and not the heading (the top 2 lines), you can omit those lines by adding the **-t** (no title) option.
### $ watch -t who
Your display will then look like this:
```
nemo pts/0 2020-02-27 08:07 (192.168.0.11)
shs pts/1 2020-02-27 10:58 (192.168.0.5)
```
If every time the watched command runs, its output is the same, only the title line (if not omitted) will change. The rest of the displayed information will stay the same.
If you want your **watch** command to exit as soon as the output of the command that it is watching changes, you can use a **-g** (think of this as the "go away") option. You might choose to do this if, for example, you are simply waiting for others to start logging into the system.
You can also highlight changes in the displayed output using the **-d** (differences) option. The highlighting will only last for one interval (2 seconds by default), but can help to draw your attention to the changes.
Here's a more complex example of using the **watch** command to display services that are listening for connections and the ports they are using. While the output isn't likely to change, it would alert you to any new service starting up or one going down.
```
$ watch 'sudo lsof -i -P -n | grep LISTEN'
```
Notice that the command being run needs to be enclosed in quotes to ensure that the **watch** command doesn't send its output to the grep command.
Using the **watch -h** command will provide you with a list of the command's options.
```
$ watch -h
Usage:
watch [options] command
Options:
-b, --beep beep if command has a non-zero exit
-c, --color interpret ANSI color and style sequences
-d, --differences[=<permanent>]
highlight changes between updates
-e, --errexit exit if command has a non-zero exit
-g, --chgexit exit when output from command changes
-n, --interval <secs> seconds to wait between updates
-p, --precise attempt run command in precise intervals
-t, --no-title turn off header
-x, --exec pass command to exec instead of "sh -c"
-h, --help display this help and exit
-v, --version output version information and exit
```
### Using tail -f
The **tail -f** command has something in common with **watch**. It will both display the bottom of a file and additional content as it is added. Instead of having to run a "tail" command again and again, you run one command and get a repeatedly updated view of its output. For example, you could watch a system log with a command like this:
```
$ tail -f /var/log/syslog
```
Some files, like **/var/log/wtmp**, don't lend themselves to this type of handling because they're not formatted as normal text files, but you could get a similar result by combining **watch** and **tail** like this:
```
watch 'who /var/log/wtmp | tail -20'
```
This command will display the most recent 5 logins regardless of how many of the users are still logged in. If another login occurs, a line will be added and the top line removed.
```
Every 60.0s: who /var/log/wtmp | tail -5 dragonfly: Thu Feb 27 12:46:07 2020
shs pts/0 2020-02-27 08:07 (192.168.0.5)
nemo pts/1 2020-02-27 08:26 (192.168.0.5)
shs pts/1 2020-02-27 10:58 (192.168.0.5)
nemo pts/1 2020-02-27 11:34 (192.168.0.5)
dory pts/1 2020-02-27 12:14 (192.168.0.5)
```
Both the **watch** and **tail -f** commands can provide auto-updating views of information that you might at times want to monitor, making the task of monitoring quite a bit easier whether you're monitoring processes, logins or system resources.
Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3529891/watching-activity-on-linux-with-watch-and-tail-commands.html
作者:[Sandra Henry-Stocker][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/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/newsletters/signup.html
[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
[3]: https://www.facebook.com/NetworkWorld/
[4]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,139 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop)
[#]: via: (https://itsfoss.com/drauger-os/)
[#]: author: (John Paul https://itsfoss.com/author/john/)
Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop
======
For years (or decades) people complained that one of the reasons to not [use Linux][1] is lack of mainstream games. [Gaming on Linux][2] has improved drastically in last few years specially with the [introduction of Steam Proton][3] project that enables you to [play a lot of Windows-only games on Linux][4].
This also has encourages several [Linux distributions centered around gaming][5]. Take [Lakka][6] for example. You can [turn your old computer into a retro gaming console thanks to Lakka Linux][7].
Another such gaming focused Linux distribution is [Draguer OS][8] and we are going to take a look at it today.
### What is Drauger OS?
Accord to [the projects website][9], “Drauger OS is a Linux desktop gaming operating system. It aims to provide a platform for gamers to use where they can get great performance without sacrificing their security. Furthermore, it aims to make it easy for anyone to game, whether they use a keyboard and mouse, or some sort of controller.”
They stress that Drauger OS is not for everyday use. As such, many of the productivity tools that most other distros come with are not in Drauger OS.
![Drauger OS 7.4.1][10]
Drauger OS is [based][9] on the Ubuntu. The current version (7.4.1 Jiangshi) uses “[Liquorix][11] low latency Linux kernel, a pre-compiled ZEN kernel designed with a balance between latency and throughput in mind”. However, that will be changing in the next release. They only have one desktop environment choice, a modified version of [Xfce][12].
Drauger OS has several applications and tools installed out of the box to improve the gaming experience. These include:
* [PlayOnLinux][13]
* WINE
* [Lutris][14]
* Steam
* [DXVK][15]
It also has an interesting set of tools that are not gaming related. [Drauger Installer][16] is a .deb installer and alternative to Gdebi. [Multiple Repository App Installer][17] (mrai) is “an AUR-helper-like script for Debian-based Linux Operating Systems”. Mrai is designed to work with apt, snaps, flatpaks, and can install apps from GitHub.
Interestingly, Drauger OS name is an error. Lead dev [Thomas Castleman][18] (aka batcastle) has intended to name his distro Draugr, but had mistyped the name. In [episode 23][19] of the Drauger OS podcast, Castleman said the name will stay misspelled because it would be a lot of work to correct it. According to [Wikipedia][20], a draugr is “an undead creature from Norse mythology”.
Yes, you read that correctly. Drauger OS is one of only a few distros that have its own [podcast][21]. When asked about it, Castleman told me that “I wanted to ensure that we had the maximum transparency possible with our community, no matter their circumstances.” Most of the time, the podcast is an audio version of the Drauger OS blog, but sometimes they use it to make an announcement when they dont have time to write a blog post.
### The Future for Drauger OS
![Drauger OS][22]
The developers behind Druager OS are working on their next major release: 7.5.1. This release will be based on Ubuntu 19.10. There will be three major changes. First, the Liquorix kernel will be [replaced][23] with “a kernel we are building in-house.” This kernel will be based on the Linux Kernel GitHub repository, “so its about as vanilla as it gets”.
The second major change in the new release will a new layout for their desktop. Based on user feedback, they have decided to change it to something that looks more GNOME-like.
Thirdly, they are dropping SystemBack as their backup tool and installer. They have instead written a new [installer][24] from scratch.
The Dev team is also working on an [ARM version][25] of Drauger OS. They hope to release it sometime in 2022.
### System requirements for Draguer OS
The Drauger OS [system requirements][25] are pretty modest. Keep in mind that Drauger OS will only run on 64-bit systems.
#### Minimum system requirements
* CPU: Dual-Core, 1.8GHz, 64-bit processor
* RAM: 1 GB
* Storage: 16 GB
* Graphics Processor: Integrated
* Screen Resolution: 1024×768 at 60Hz
* External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 2 USB Ports for Installation USB Drive and Keyboard (Mouse optional, but recommended)
#### Recommended system requirements
* CPU: Quad-Core, 2.2Ghz, 64-bit processor
* RAM: 4 GB
* Storage: 128 GB
* Graphics Processor: NVIDIA GTX 1050, AMD RX 460, or equivalent card
* Screen Resolution: 1080p at 60Hz
* External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 3 USB Ports for Installation USB Drive, Keyboard, and Mouse, 1 Audio Out Port
### How you can help out Drauger OS
There are several ways that you can help out the Drauger OS if you are interestedin doing so. They are always looking for [financial support][26] to keep development going.
If you want yo contribute code, they are looking for people with experience in BASH, C++, and Python. All of their code is up on [GitHub][27]. You can also [contact][28] them on social media.
### Final Thoughts
Drauger OS is quite a project. Ive seen a couple of other [gaming-oriented distributions][29], but Drauger OS is single-minded in its focus on gaming. Since I am more of a casual gamer, this distro doesnt appeal to me personally. But, I can see how it could lure gaming enthusiasts to Linux. I wish them good luck in their future releases.
What are your thoughts on this gaming-only distro? What is your favorite Linux gaming solution? Please let us know in the comments below.
If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][30].
--------------------------------------------------------------------------------
via: https://itsfoss.com/drauger-os/
作者:[John Paul][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/john/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/why-use-linux/
[2]: https://itsfoss.com/linux-gaming-guide/
[3]: https://itsfoss.com/steam-play-proton/
[4]: https://itsfoss.com/steam-play/
[5]: https://itsfoss.com/linux-gaming-distributions/
[6]: http://www.lakka.tv/
[7]: https://itsfoss.com/lakka-retrogaming-linux/
[8]: https://draugeros.org/go/
[9]: https://www.draugeros.org/go/about/
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.4.1.jpg?ssl=1
[11]: https://liquorix.net/
[12]: https://www.xfce.org/
[13]: https://www.playonlinux.com/en/
[14]: https://lutris.net/
[15]: https://github.com/doitsujin/dxvk
[16]: https://github.com/drauger-os-development/drauger-installer
[17]: https://github.com/drauger-os-development/mrai
[18]: https://github.com/Batcastle
[19]: https://anchor.fm/drauger-os/episodes/Episode-23-eapu47
[20]: https://en.wikipedia.org/wiki/Draugr
[21]: https://anchor.fm/drauger-os
[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.5.1.png?ssl=1
[23]: https://www.draugeros.org/go/2020/01/20/major-changes-in-drauger-os-7-5-1/
[24]: https://github.com/drauger-os-development/system-installer
[25]: https://www.draugeros.org/go/system-requirements/
[26]: https://www.draugeros.org/go/contribute/
[27]: https://github.com/drauger-os-development
[28]: https://www.draugeros.org/go/contact-us/
[29]: https://itsfoss.com/manjaro-gaming-linux/
[30]: https://reddit.com/r/linuxusersgroup

View File

@ -0,0 +1,112 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to set up your own fast, private open source mesh network)
[#]: via: (https://opensource.com/article/20/2/mesh-network-freemesh)
[#]: author: (Spencer Thomason https://opensource.com/users/spencerthomason)
如何建立自己的快速、私有的开源网状网络
======
> 只需要不到 10 分钟的安装时间,就可以用 FreeMesh 搭建一个经济实惠、性能卓越、尊重隐私的网格系统。
![people on top of a connected globe][1]
[FreeMesh][2] 系统有望为大众带来完全开源的<ruby>网格网络<rt>mesh network</rt></ruby>。我最近有机会进行了测试;它安装迅速,性能非常好 —— 特别是相对它的价格而言。
### 为什么要网格化和开源?
使用开源的原因很简单:隐私。有了 FreeMesh你的数据就是你自己的。它不会跟踪或收集数据。不相信吗毕竟你可以轻松检查 —— 它是开源的!而其它大型高科技企业集团提供的一些流行的网格解决方案,你是否相信它们会保护你的数据?
另一个重要因素更新。FreeMesh 表示,它将致力于定期发布安全性和性能更新。从现在起到 10 年后呢?使用开放源代码解决方案,你可以根据需要自由地更新产品。
那么为什么要用网格呢在网状网络中多个无线路由器一起工作以广播单个超大型的无线网络。网状网络中的每个路由器都可与其他路由器智能地通信以便为你的数据提供最佳的“路径”。FreeMesh 网站上的以下图片突出显示了使用单个无线路由器和网状网络之间的区别。 红色网络表示单个无线路由器,绿色网络是网状网络。
![单路由器网络] [3]
![网状网络] [4]
### 采购设备
要开始使用 FreeMesh请[订购套件][5]。它提供两种套件:标准套件和 4G LTE。
顾名思义4G LTE 套件支持蜂窝数据连接。此功能在消费级网络领域非常罕见,但对某些人来说非常有用。你可以在提供电源和电池的任何地方建立具有完整的快速故障转移功能的便携式网状网络。
FreeMesh 套件带有一个主路由器和两个节点。路由器和节点使用 802.11ac、802.11r 和 802.11s 标准。随附的固件运行定制版本的 [OpenWrt] [6],这是嵌入式设备的 Linux 发行版。
FreeMesh 路由器的一些规格非常好:
* CPU双核 880MHz MediaTek MT7621AT双核/四线程!)
* 内存DDR3 512MB
* 接口1 个 GbE WAN、4 个 GbE LAN、1 个 USB 2.0 端口、1 个 microSD 卡插槽、1 个 SIM 插槽
* 天线2 个 5dBi 2.4GHz、2 个 5dBi 5GHz、2 个 3dBi 3G/4G内置
* 4G LTE 调制解调器LTE 4 类模块,下行 150Mbps/上行 50Mbps
### 设置
设置很容易FreeMesh 的 [README][7] 提供了简单的说明和图表。首先首先设置主路由器。然后按照以下简单步骤操作:
1、将第一个节点蓝色 WAN 端口)连接到主路由器(黄色 LAN 端口)。
![FreeMesh 设置步骤 1][8]
2、等待约 30 至 60 秒。设置完成后,节点将闪烁其 LED。
![FreeMesh 设置步骤 2][9]
3、将节点移到另一个位置。
仅此而已!节点不需要手动设置。你只需将它们插入主路由器,其余的工作就完成了。你可以以相同的方式添加更多节点;只需重复上述步骤即可。
### 功能
FreeMesh 是开箱即用的,它由 OpenWRT 和 LuCI 组合而成。它具有你期望路由器提供的所有功能。是否要安装新功能或软件包SSH 连入并开始魔改!
![FreeMesh 网络上的实时负载][10]
![FreeMesh 网络概览][11]
![OpenWrt 状态报告][12]
### 性能如何
设置完 FreeMesh 系统后,我将节点移动到了房屋周围的各个地方。我使用 [iPerf][13] 测试带宽,它达到了约 150Mbps。WiFi 可能会受到许多环境变量的影响,因此你的结果可能会有所不同。节点与主路由器之间的距离在带宽中也有很大的影响。
但是,网状网络的真正优势不是高峰速度,而是整个空间的平均速度要好得多。即使在我家很远的地方,我仍然能够流媒体播放视频并正常工作。我甚至可以在后院工作。在出门之前,我只是将一个节点重新放在窗口前面而已。
### 结论
FreeMesh 确实令人信服。它以简单、开源的形式为你提供高性价比和隐私。
以我的经验,设置非常容易,而且足够快。覆盖范围非常好,远远超过了任何单路由器环境。你可以随意魔改和定制 FreeMesh 设置,但是我觉得没有必要。它提供了我需要的一切。
如果你正在寻找价格可承受、性能良好且尊重隐私的网格系统,且该系统可以在不到 10 分钟的时间内安装完毕,你可以考虑一下 FreeMesh。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/2/mesh-network-freemesh
作者:[Spencer Thomason][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/spencerthomason
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-networking.png?itok=fHmulI9p (people on top of a connected globe)
[2]: https://freemeshwireless.com/
[3]: https://opensource.com/sites/default/files/uploads/singlerouternetwork.png (Single-router network)
[4]: https://opensource.com/sites/default/files/uploads/meshnetwork.png (Mesh network)
[5]: https://freemeshwireless.com/#pricing
[6]: https://openwrt.org/
[7]: https://gitlab.com/slthomason/freemesh/-/blob/master/README.md
[8]: https://opensource.com/sites/default/files/uploads/connecttorouter.png (FreeMesh setup step 1)
[9]: https://opensource.com/sites/default/files/uploads/setupcomplete.png (FreeMesh setup step 2)
[10]: https://opensource.com/sites/default/files/uploads/freemeshrealtimeload.png (Real-time load on FreeMesh network)
[11]: https://opensource.com/sites/default/files/uploads/freemeshwirelessoverview.png (Overview of FreeMesh network)
[12]: https://opensource.com/sites/default/files/uploads/openwrt.png (OpenWrt status report)
[13]: https://opensource.com/article/20/1/internet-speed-tests

View File

@ -0,0 +1,155 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Use logzero for simple logging in Python)
[#]: via: (https://opensource.com/article/20/2/logzero-python)
[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall)
使用 logzero 在 Python 中进行简单日志记录
======
一个方便的日志库快速入门,来帮助你掌握这个重要的编程概念。
![Snake charmer cartoon with a yellow snake and a blue snake][1]
logzero 库使日志记录就像打印语句一样容易,是简单性的杰出代表。我不确定 logzero 的名称是否要与 pygame-zero、GPIO Zero 和 guizero 这样的 “zero 样板库”契合,但是肯定属于该类别。它是一个 Python 库,使得日志记录变得简单明了。
你可以使用它的基本日志记录到标准输出,就像你可以使用 print 来获得信息和调试一样,它还有学习更高级日志记录(例如记录到文件)的平滑学习曲线。
首先,使用 pip 安装 logzero
```
`$ sudo pip3 install logzero`
```
在 Python 文件中,导入 logger 并尝试以下一个或所有日志实例:
```
from logzero import logger
logger.debug("hello")
logger.info("info")
logger.warning("warning")
logger.error("error")
```
输出以易于阅读的方式自动着色:
![Python, Raspberry Pi: import logger][2]
因此现在不要再使用 **print** 来了解发生了什么,而应使用有相关日志级别的 logger。
### 在 Python 中将日志写入文件
如果你阅读至此,并会在你写代码时做一点改变,这对我就足够了。如果你要了解更多,请继续阅读!
写到**标准输出**对于测试新程序不错,但是仅当你登录到运行脚本的计算机时才有用。在很多时候,你需要远程执行代码并在事后查看错误。这种情况下,记录到文件很有帮助。让我们尝试一下:
```
from logzero import logger, logfile
logfile('/home/pi/test.log')
```
现在,你的日志条目将记录到文件 **test.log** 中。记住确保[脚本有权限] [3]写入该文件及其目录结构。
你也可以指定更多选项:
```
`logfile(/home/pi/test.log, maxBytes=1e6, backupCount=3)`
```
现在,当提供给 **logfile** 文件达到 1MB10^6 字节)时,它将通过 **test.log.1**、**test.log.2** 等文件轮询写入。这种行为可以避免系统打开和关闭大量 I/O 密集的日志文件,以至于系统无法打开和关闭。你或许还要记录到 **/var/log**。假设你使用的是 Linux那么创建一个目录并将用户设为所有者以便可以写入该目录
```
$ sudo mkdir /var/log/test
$ sudo chown pi /var/log/test
```
然后在你的 Python 代码中,更改 **logfile** 路径:
```
`logfile(/var/log/test/test.log, maxBytes=1e6, backupCount=3)`
```
当要在 **logfile** 中捕获异常时,可以使用 **logging.exception**:。
```
try:
    c = a / b
except Exception as e:
    logger.exception(e)
```
这将输出(在 b 为零的情况下):
```
[E 190422 23:41:59 test:9] division by zero
     Traceback (most recent call last):
       File "test.py", line 7, in
         c = a / b
     ZeroDivisionError: division by zero
```
你会得到日志,还有完整回溯。另外,你可以使用 **logging.error** 并隐藏回溯:
```
try:
    c = a / b
except Exception as e:
    logger.error(f"{e.__class__.__name__}: {e}")
```
现在,将产生更简洁的结果:
```
`[E 190423 00:04:16 test:9] ZeroDivisionError: division by zero`
```
* * *
* * *
* * *
**![Logging output][4]**
你可以在 [logzero.readthedocs.io] [5] 中阅读更多选项。
### logzero 为教育而生
对于新手程序员来说,日志记录可能是一个具有挑战性的概念。大多数框架依赖于流控制和大量变量操作来生成有意义的日志,但是 logzero不同。由于它的语法类似于 print 语句,因此它在教育上很成功,因为它无需解释其他概念。在你的下个项目中试试它。
\--
_此文章最初发布在[我的博客] [6]上经许可重新发布。_
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/2/logzero-python
作者:[Ben Nuttall][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/bennuttall
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Snake charmer cartoon with a yellow snake and a blue snake)
[2]: https://opensource.com/sites/default/files/uploads/rpi_ben_1.png (Python, Raspberry Pi: import logger)
[3]: https://opensource.com/article/19/6/understanding-linux-permissions
[4]: https://opensource.com/sites/default/files/uploads/rpi_ben_2.png (Logging output)
[5]: https://logzero.readthedocs.io/en/latest/
[6]: https://tooling.bennuttall.com/logzero/