Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2019-09-25 08:49:33 +08:00
commit ad0a3fa932
2 changed files with 117 additions and 16 deletions

View File

@ -1,15 +1,18 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11384-1.html)
[#]: subject: (How to freeze and lock your Linux system (and why you would want to))
[#]: via: (https://www.networkworld.com/article/3438818/how-to-freeze-and-lock-your-linux-system-and-why-you-would-want-to.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
如何冻结和锁定你的 Linux 系统(以及为何你会希望做)
如何冻结和锁定你的 Linux 系统
======
冻结终端窗口并锁定屏幕意味着什么 - 以及如何在 Linux 系统上管理这些活动。
> 冻结终端窗口并锁定屏幕意味着什么 - 以及如何在 Linux 系统上管理这些活动。
![](https://img.linux.net.cn/data/attachment/album/201909/24/230938vgxzv3nrakk0wxnw.jpg)
如何在 Linux 系统上冻结和“解冻”屏幕,很大程度上取决于这些术语的含义。有时“冻结屏幕”可能意味着冻结终端窗口,以便该窗口内的活动停止。有时它意味着锁定屏幕,这样就没人可以在你去拿一杯咖啡时,走到你的系统旁边代替你输入命令了。
@ -17,9 +20,9 @@
### 如何在 Linux 上冻结终端窗口
你可以输入 **Ctrl+S**(按住 Ctrl 键和 “s” 键)冻结 Linux 系统上的终端窗口。把 “s” 想象成“开始冻结” start the freeze。如果在此操作后继续输入命令,那么你不会看到输入的命令或你希望看到的输出。实际上,命令将堆积在一个队列中,并且只有在通过输入 **Ctrl+Q** 解冻时才会运行。把它想象成“退出冻结” quit the freeze
你可以输入 `Ctrl+S`(按住 `Ctrl` 键和 `s` 键)冻结 Linux 系统上的终端窗口。把 `s` 想象成“<ruby>开始冻结<rt>start the freeze</rt></ruby>。如果在此操作后继续输入命令,那么你不会看到输入的命令或你希望看到的输出。实际上,命令将堆积在一个队列中,并且只有在通过输入 `Ctrl+Q` 解冻时才会运行。把它想象成“<ruby>退出冻结<rt>quit the freeze</rt></ruby>
查看其工作的一种简单方式是使用 date 命令,然后输入 **Ctrl+S**。接着再次输入 date 命令并等待几分钟后再次输入 **Ctrl+Q**。你会看到这样的情景:
查看其工作的一种简单方式是使用 `date` 命令,然后输入 `Ctrl+S`。接着再次输入 `date` 命令并等待几分钟后再次输入 `Ctrl+Q`。你会看到这样的情景:
```
$ date
@ -28,25 +31,25 @@ $ date
Mon 16 Sep 2019 06:49:49 PM EDT
```
这两次时间显示的差距表示第二次的 date 命令直到你解冻窗口时才运行。
这两次时间显示的差距表示第二次的 `date` 命令直到你解冻窗口时才运行。
无论你是坐在计算机屏幕前还是使用 PuTTY 等工具远程运行,终端窗口都可以冻结和解冻。
这有一个可以派上用场的小技巧。如果你发现终端窗口似乎处于非活动状态,那么可能是你或其他人无意中输入了 **Ctrl+S**。无论如何,输入 **Ctrl+Q** 来尝试解决不妨是个不错的办法。
这有一个可以派上用场的小技巧。如果你发现终端窗口似乎处于非活动状态,那么可能是你或其他人无意中输入了 `Ctrl+S`。那么,输入 `Ctrl+Q` 来尝试解决不妨是个不错的办法。
### 如何锁定屏幕
要在离开办公桌前锁定屏幕,请按住  **Ctrl+Alt+L****Super+L**(即按住 Windows 键和 L 键)。屏幕锁定后,你必须输入密码才能重新登录。
要在离开办公桌前锁定屏幕,请按住  `Ctrl+Alt+L``Super+L`(即按住 `Windows` 键和 `L` 键)。屏幕锁定后,你必须输入密码才能重新登录。
### Linux 系统上的自动屏幕锁定
虽然最佳做法建议你在即将离开办公桌时锁定屏幕,但 Linux 系统通常会在一段时间没有活动后自动锁定。 “消隐”屏幕(使其变暗)并实际锁定屏幕(需要登录才能再次使用)的时间取决于你个人首选项中的设置。
要更改使用 GNOME 屏幕保护程序时屏幕变暗所需的时间,请打开设置窗口并选择 **Power** 然后 **Blank screen**。你可以选择 1 到 15 分钟或从不变暗。要选择屏幕变暗后锁定所需时间,请进入设置,选择 **Privacy**,然后选择**Blank screen**。设置应包括 1、2、3、5 和 30 分钟或一小时。
要更改使用 GNOME 屏幕保护程序时屏幕变暗所需的时间,请打开设置窗口并选择 “Power” 然后 “Blank screen”。你可以选择 1 到 15 分钟或从不变暗。要选择屏幕变暗后锁定所需时间,请进入设置,选择 “Privacy”然后选择 “Blank screen”。设置应包括 1、2、3、5 和 30 分钟或一小时。
### 如何在命令行锁定屏幕
如果你使用的是 Gnome 屏幕保护程序,你还可以使用以下命令从命令行锁定屏幕:
如果你使用的是 GNOME 屏幕保护程序,你还可以使用以下命令从命令行锁定屏幕:
```
gnome-screensaver-command -l
@ -56,7 +59,7 @@ gnome-screensaver-command -l
### 如何检查锁屏状态
你还可以使用 gnome-screensaver 命令检查屏幕是否已锁定。使用 **\--query** 选项,该命令会告诉你屏幕当前是否已锁定(即处于活动状态)。使用 --time 选项,它会告诉你锁定生效的时间。这是一个示例脚本:
你还可以使用 `gnome-screensaver` 命令检查屏幕是否已锁定。使用 `--query` 选项,该命令会告诉你屏幕当前是否已锁定(即处于活动状态)。使用 `--time` 选项,它会告诉你锁定生效的时间。这是一个示例脚本:
```
#!/bin/bash
@ -77,8 +80,6 @@ The screensaver has been active for 1013 seconds.
如果你记住了正确的控制方式,那么锁定终端窗口是很简单的。对于屏幕锁定,它的效果取决于你自己的设置,或者你是否习惯使用默认设置。
在 [Facebook][3] 和 [LinkedIn][4] 上加入 Network World 社区,来评论最新主题。
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3438818/how-to-freeze-and-lock-your-linux-system-and-why-you-would-want-to.html
@ -86,7 +87,7 @@ via: https://www.networkworld.com/article/3438818/how-to-freeze-and-lock-your-li
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,100 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Simulating Smart Cities with CupCarbon)
[#]: via: (https://opensourceforu.com/2019/09/simulating-smart-cities-with-cupcarbon/)
[#]: author: (Dr Kumar Gaurav https://opensourceforu.com/author/dr-gaurav-kumar/)
Simulating Smart Cities with CupCarbon
======
[![][1]][2]
_CupCarbon is a smart city and IoT wireless sensor network (WSN) simulator. It is a new platform for 2D/3D design, visualisation and the simulation of radio propagation and interferences in IoT networks. It is particularly relevant in India today, since the development of smart cities is a priority of the government._
It was a wide range of devices interconnected through wireless technologies that gave birth to the Internet of Things (IoT). A number of smart gadgets and machines are now monitored and controlled using IoT protocols. Across the world, devices enjoy all-time connectivity because of the IoT.
![Figure 1: Key element and components of a smart city project][3]
![Figure 2: Official Web portal of the CupCarbon simulator][4]
![Figure 3: Roads, objects and connections in the CupCarbon simulator][5]
From the research reports of _Statista.com_, sales of smart home devices in the US went up from US$ 1.3 billion to US$ 4.5 billion, from 2016 to 2019. The _Economic Times_ reports that there will be around 2 billion units of eSIM based devices by 2025. An eSIM enables subscribers to use the digital SIM card for smart devices and the services can be activated without a physical SIM card. It is one of the recent and more secure applications of IoT.
Beyond the traditional applications, IoT is being researched for purposes like monitoring the environment and providing prior notifications to regulating agencies so that appropriate action can be taken, when required. Reports from _LiveMint.com_ indicate that the Indian Institute of Technology, New Delhi and Ericsson are partnering to tackle the air pollution in Delhi. News reports from Grand View Research Inc. indicate that the global NB (Narrow Band)-IoT market size is predicted to touch more than US$ 6 billion by 2025. NB-IoT refers to the radio technology standard with a low-power wide-area network (LPWAN) that enables wide scale coverage and better performance of connected smart devices.
![Figure 4: Working panel of the CupCarbon simulator][6]
![Figure 5: Adding different types of sensor nodes in CupCarbon][7]
![Figure 6: Option for the SenScript window in CupCarbon][8]
**Free and open source tools for IoT implementation**
A wide range of free and open source simulators and frameworks is available to simulate IoT scenarios. These can be used for R&amp;D so that the performance of different smart city and IoT algorithms can be analysed. Research projects for a smart city need to be simulated so that the citizen behaviour can be evaluated on multiple parameters before launching the actual IoT enabled smart city systems.
**[![][9]][10]Installing and working with CupCarbon**
CupCarbon (_<http://www.cupcarbon.com>_) is a prominent, multi-featured simulator that is used for the simulation of smart cities and IoT based advanced wireless network scenarios.
It provides an effective graphical user interface (GUI) for the integration of objects in the smart city with wireless sensors. The sensor nodes and algorithms can be programmed in the SenScript Editor in CupCarbon. SenScript is the script that is used for the programming and control of sensors used in the simulation environment. In SenScript, a number of programming constructs and modules can be used so that the smart city environment can be simulated.
![Figure 7: The SenScript Editor in CupCarbon for programming of sensors][11]
![Figure 8: Integration of markers and route in CupCarbon][12]
![Figure 9: Executing SenScript in CupCarbon to get an animated view of the smart city][13]
**Creating dynamic scenarios for IoT and smart cities using the CupCarbon simulator**
The working environment of CupCarbon has numerous options to create and program sensors of different types. In the middle, there is a Map View, in which the smart city under simulation can be viewed dynamically.
The sensors and smart objects are displayed in Map View. To program these smart devices and traffic objects, the toolbar of CupCarbon provides the programming modules so that the behaviour of every object can be controlled.
Any number of nodes or motes can be imported in CupCarbon to program them in random positions. In addition, the weather conditions and environment factors can be added so that the smart city project can be simulated under specific environmental conditions. Using this option, the performance of the smart city can be evaluated under different situations with varying city temperatures.
The SenScript editor provides the programming editor so that the functions and methods with each sensor or smart device can be executed. This editor has a wide range of inbuilt functions which can be called. These functions can be attached to the sensors and smart objects in the CupCarbon simulator.
The markers and routes provide the traffic path for the vehicles in the smart city, so that these can follow the shortest path from source to destination, factoring in congestion or traffic jams.
On executing the code written in SenScript, an animated view of the smart city is produced, representing the mobility of vehicles, persons and traffic objects. This view enables the development team to check whether there is any probability of congestion or loss of performance. Using this process of visualisation, the algorithms and associated code of SenScript can be improved so that the proposed implementation performs better, with minimum resources.
![Figure 10: Google Map View of a simulation in CupCarbon][14]
![Figure 11: Analysing the energy consumption and research parameters in CupCarbon][15]
In CupCarbon, the simulation scenario can be viewed like a Google Map including Satellite View. It can be changed to Satellite View with a single click. Using these options, the traffic, roads, towers, vehicles and even the congestion can be visualised in the simulation, for developers to get a sense of the real environment.
[![][16]][17]Simulating a smart city scenario using CupCarbon is always required to analyse the performance of the network that is to be deployed. For such evaluations of a new smart city project, key parameters like energy, power and security also need to be investigated. CupCarbon integrates the options for energy consumption and other parameters, so that researchers and engineers can view the expected effectiveness of the project.
Government agencies as well as corporate giants are getting involved in big smart city projects so that there is better control over the huge infrastructure and resources. Research scholars and practitioners can propose novel and effective algorithms for smart city implementations. The proposed algorithms can be simulated using smart city simulators and the performance parameters can be analysed.
--------------------------------------------------------------------------------
via: https://opensourceforu.com/2019/09/simulating-smart-cities-with-cupcarbon/
作者:[Dr Kumar Gaurav][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://opensourceforu.com/author/dr-gaurav-kumar/
[b]: https://github.com/lujun9972
[1]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Smart-Cities-3d-Simulating-1.jpg?resize=696%2C379&ssl=1 (Smart Cities 3d Simulating)
[2]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Smart-Cities-3d-Simulating-1.jpg?fit=800%2C436&ssl=1
[3]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-1-Key-elements-and-components-of-a-smart-city-project.jpg?resize=253%2C243&ssl=1
[4]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-2-Official-Web-portal-of-the-CupCarbon-simulator.jpg?resize=350%2C174&ssl=1
[5]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-3-Roads-objects-and-connections-in-the-CupCarbon-simulator.jpg?resize=350%2C193&ssl=1
[6]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-4-Working-panel-of-the-CupCarbon-simulator.jpg?resize=350%2C130&ssl=1
[7]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-5-Adding-different-types-of-sensor-nodes-in-CupCarbon.jpg?resize=350%2C240&ssl=1
[8]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-6-Option-for-the-SenScript-window-in-CupCarbon.jpg?resize=350%2C237&ssl=1
[9]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Smart-cities-and-advanced-wireless-scenarios-using-IoT.jpg?resize=350%2C259&ssl=1
[10]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Smart-cities-and-advanced-wireless-scenarios-using-IoT.jpg?ssl=1
[11]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-7-The-SenScript-Editor-in-CupCarbon-for-programming-of-sensors.jpg?resize=350%2C172&ssl=1
[12]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-8-Integration-of-markers-and-routes-in-CupCarbon.jpg?resize=350%2C257&ssl=1
[13]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-9-Executing-SenScript-in-CupCarbon-to-get-an-animated-view-of-the-smart-city.jpg?resize=350%2C227&ssl=1
[14]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-10-Google-Map-View-of-a-simulation-in-CupCarbon.jpg?resize=350%2C213&ssl=1
[15]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure-11-Analysing-the-energy-consumption-and-research-parameters-in-CupCarbon.jpg?resize=350%2C214&ssl=1
[16]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Table-1-Free-and-open-source-simulators-for-IoT-integrated-smart-city-implementations.jpg?resize=350%2C181&ssl=1
[17]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Table-1-Free-and-open-source-simulators-for-IoT-integrated-smart-city-implementations.jpg?ssl=1