Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu.Wang 2018-12-12 22:18:30 +08:00
commit c5fcc6fa1c
10 changed files with 1118 additions and 342 deletions

View File

@ -0,0 +1,62 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Open source DIY ethics)
[#]: via: (https://arp242.net/weblog/diy.html)
[#]: author: (Martin Tournoij https://arp242.net/)
Open source DIY ethics
======
I moved to New Zealand last week, and as a proper Dutch person one of the first things I did after arriving was getting a bicycle.
I was recommended [a great place][1] where they collect old bikes and provide people with the parts and tools to fix up the bikes. Want a bike? Choose one, fix it, and its yours. There are helpful and knowledgable volunteers who will gladly help you and explain how things work, but in the end youll have to fix your own bike; theyre not going to do it for you.
I like this DIY attitude; I built my own fixie (which I unfortunately couldnt bring) years ago and had been maintaining it myself ever since, but there are many different aspects I never touched on (different brake systems, gears, etc.) and fixing my bike with some help and explanation was a useful experience which taught me a thing or two that Ill be sure to use in the future.
My attitude to open source projects tends to be similar: Ill gladly assist you or explain things, but you will have to do the work. This is especially true when it comes to feature requests or very specific scenarios.
Open source software is fundamentally a [DIY ethic][2] for many though not all people who participate in it. It certainly is for me. I just fix stuff I want myself. Since I take some amount of pride in my work and want things to work well for others Ill also gladly fix most bugs that are reported, but sometimes people will post an enhancement or feature request and just expect me to implement it. Its sometimes even combined with a “but project X does it!”-comment. Well, feck off and use project X then (I dont actually say this, just think it).
Ive seen more than a few people get frustrated by this attitude especially — though hardly exclusively — in the OpenBSD and suckless communities ([recent example that prompted this post][3]), partly because its not infrequently communicated in a somewhat unhelpful fashion (the OpenBSD saying is “shut up and hack”), but also because some people seem to misunderstand what it means to be a maintainer of an open source project. Open source software isnt a service I provide to the world; its something I DIYd myself and make available to the world because why not?
Some open source software is supported by companies. Only about [14% of the contributions to the Linux kernel are not affiliated with a company][4]. I dont think this matters: these are companies who are DIY-ing as well.
Are there people who contribute to open source for other reasons? Sure. Some do because they really believe in [Free Software][5], or because they like programming as a hobby. But those are not the majority.
Not all contributions that arent code are useless. Sometimes someone will have a great idea for an enhancement or feature that I hadnt thought of myself and this can be a very valuable contribution. But those types of constructive contributions are usually easy to recognize: they consist of more than just a single paragraph, are respectful, show a clear understanding of what the project is supposed to do, if they dont understand a certain aspect theyll ask instead of bombastically claiming that its “broken”, and perhaps most importantly, they show a willingness to constructively contribute, rather than just trying to tell you how to run your project.
This attitude isnt limited to open source; to quote Neil Gaiman when talking about A Song of Ice and Fire fans demanding George R.R. Martin work harder on the next instalment of the series: “[George R.R. Martin is not your bitch][6]”.
I cant help George with his next book, but I can help with software projects, which is really neat. Not everyone is a computer programmer, but the vast majority of projects Ive worked on are used exclusively by programmers.
In the two months that it took me to finish this post (cleaning up drafts always takes forever) there have been a number of incidents in various communities that touched upon a mismatch in expectations between open source authors/maintainers and the users. “Its not fun anymore, you get nothing from maintaining a popular package”, to quote one maintainer, or “Im frustrated because I cant handle the volume of emails” to quote another.
The situation would be vastly improved if more people start seeing and treating open source more like the DIY that it is and assume responsibility for that bug youve encountered or enhancement you want, rather than offloading all responsibility to the maintainer. This wont fix everything, but its a good start. Note that plenty of people — including myself — already do this.
Both authors and users will benefit; authors will be frustrated less with “entitled” users, and users will be frustrated less by “rude” authors, and in the end the software will work better as users will be more willing to spend some time fixing stuff themselves, rather than just expecting other people to do it for them.
--------------------------------------------------------------------------------
via: https://arp242.net/weblog/diy.html
作者:[Martin Tournoij][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://arp242.net/
[b]: https://github.com/lujun9972
[1]: https://www.facebook.com/TheCrookedSpoke
[2]: https://en.wikipedia.org/wiki/DIY_ethic
[3]: https://www.reddit.com/r/suckless/comments/9mhwg8/why_does_sts_latency_suck_so_bad/e7fu9sj/
[4]: https://www.linux.com/publications/linux-kernel-development-how-fast-it-going-who-doing-it-what-they-are-doing-and-who-0
[5]: https://www.gnu.org/philosophy/free-sw.html
[6]: http://journal.neilgaiman.com/2009/05/entitlement-issues.html
[7]: mailto:martin@arp242.net
[8]: https://github.com/Carpetsmoker/arp242.net/issues/new

View File

@ -1,3 +1,5 @@
Translating by MjSeven
Users, Groups, and Other Linux Beasts
======

View File

@ -1,229 +0,0 @@
Translating by qhwdw
An Introduction to Quantum Computing with Open Source Cirq Framework
======
As the title suggests what we are about to begin discussing, this article is an effort to understand how far we have come in Quantum Computing and where we are headed in the field in order to accelerate scientific and technological research, through an Open Source perspective with Cirq.
First, we will introduce you to the world of Quantum Computing. We will try our best to explain the basic idea behind the same before we look into how Cirq would be playing a significant role in the future of Quantum Computing. Cirq, as you might have heard of recently, has been breaking news in the field and in this Open Science article, we will try to find out why.
<https://www.youtube.com/embed/WVv5OAR4Nik?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
Before we start with what Quantum Computing is, it is essential to get to know about the term Quantum, that is, a [subatomic particle][1] referring to the smallest known entity. The word [Quantum][2] is based on the Latin word Quantus, meaning, “how little”, as described in this short video:
<https://www.youtube.com/embed/-pUOxVsxu3o?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
It will be easier for us to understand Quantum Computing by comparing it first to Classical Computing. Classical Computing refers to how todays conventional computers are designed to work. The device with which you are reading this article right now, can also be referred to as a Classical Computing Device.
### Classical Computing
Classical Computing is just another way to describe how a conventional computer works. They work via a binary system, i.e, information is stored using either 1 or 0. Our Classical computers cannot understand any other form.
In literal terms inside the computer, a transistor can be either on (1) or off (0). Whatever information we provide input to, is translated into 0s and 1s, so that the computer can understand and store that information. Everything is represented only with the help of a combination of 0s and 1s.
<https://www.youtube.com/embed/Xpk67YzOn5w?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
### Quantum Computing
Quantum Computing, on the other hand, does not follow an “on or off” model like Classical Computing. Instead, it can simultaneously handle multiple states of information with help of two phenomena called [superimposition and entanglement][3], thus accelerating computing at a much faster rate and also facilitating greater productivity in information storage.
Please note that superposition and entanglement are [not the same phenomena][4].
<https://www.youtube.com/embed/jiXuVIEg10Q?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
![][5]
So, if we have bits in Classical Computing, then in the case of Quantum Computing, we would have qubits (or Quantum bits) instead. To know more about the vast difference between the two, check this [page][6] from where the above pic was obtained for explanation.
Quantum Computers are not going to replace our Classical Computers. But, there are certain humongous tasks that our Classical Computers will never be able to accomplish and that is when Quantum Computers would prove extremely resourceful. The following video describes the same in detail while also describing how Quantum Computers work:
<https://www.youtube.com/embed/JhHMJCUmq28?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
A comprehensive video on the progress in Quantum Computing so far:
<https://www.youtube.com/embed/CeuIop_j2bI?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
### Noisy Intermediate Scale Quantum
According to the very recently updated research paper (31st July 2018), the term “Noisy” refers to inaccuracy because of producing an incorrect value caused by imperfect control over qubits. This inaccuracy is why there will be serious limitations on what Quantum devices can achieve in the near term.
“Intermediate Scale” refers to the size of Quantum Computers which will be available in the next few years, where the number of qubits can range from 50 to a few hundred. 50 qubits is a significant milestone because thats beyond what can be simulated by [brute force][7] using the most powerful existing digital [supercomputers][8]. Read more in the paper [here][9].
With the advent of Cirq, a lot is about to change.
### What is Cirq?
Cirq is a python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits that we just talked about. In other words, Cirq can address challenges to improve accuracy and reduce noise in Quantum Computing.
Cirq does not necessarily require an actual Quantum Computer for execution. Cirq can also use a simulator-like interface to perform Quantum circuit simulations.
Cirq is gradually grabbing a lot of pace, with one of its first users being [Zapata][10], formed last year by a [group of scientists][11] from Harvard University focused on Quantum Computing.
### Getting started with Cirq on Linux
The developers of the Open Source [Cirq library][12] recommend the installation in a [virtual python environment][13] like [virtualenv][14]. The developers installation guide for Linux can be found [here][15].
However, we successfully installed and tested Cirq directly for Python3 on an Ubuntu 16.04 system via the following steps:
#### Installing Cirq on Ubuntu
![Cirq Framework for Quantum Computing in Linux][16]
First, we would require pip or pip3 to install Cirq. [Pip][17] is a tool recommended for installing and managing Python packages.
For Python 3.x versions, Pip can be installed with:
```
sudo apt-get install python3-pip
```
Python3 packages can be installed via:
```
pip3 install <package-name>
```
We went ahead and installed the Cirq library with Pip3 for Python3:
```
pip3 install cirq
```
#### Enabling Plot and PDF generation (optional)
Optional system dependencies not install-able with pip can be installed with:
```
sudo apt-get install python3-tk texlive-latex-base latexmk
```
* python3-tk is Pythons own graphic library which enables plotting functionality.
* texlive-latex-base and latexmk enable PDF writing functionality.
Later, we successfully tested Cirq with the following command and code:
```
python3 -c 'import cirq; print(cirq.google.Foxtail)'
```
We got the resulting output as:
![][18]
#### Configuring Pycharm IDE for Cirq
We also configured a Python IDE [PyCharm on Ubuntu][19] to test the same results:
Since we installed Cirq for Python3 on our Linux system, we set the path to the project interpreter in the IDE settings to be:
```
/usr/bin/python3
```
![][20]
In the output above, you can note that the path to the project interpreter that we just set, is shown along with the path to the test program file (test.py). An exit code of 0 shows that the program has finished executing successfully without errors.
So, thats a ready-to-use IDE environment where you can import the Cirq library to start programming with Python and simulate Quantum circuits.
#### Get started with Cirq
A good place to start are the [examples][21] that have been made available on Cirqs Github page.
The developers have included this [tutorial][22] on GitHub to get started with learning Cirq. If you are serious about learning Quantum Computing, they recommend an excellent book called [“Quantum Computation and Quantum Information” by Nielsen and Chuang][23].
#### OpenFermion-Cirq
[OpenFermion][24] is an open source library for obtaining and manipulating representations of fermionic systems (including Quantum Chemistry) for simulation on Quantum Computers. Fermionic systems are related to the generation of [fermions][25], which according to [particle physics][26], follow [Fermi-Dirac statistics][27].
OpenFermion has been hailed as [a great practice tool][28] for chemists and researchers involved with [Quantum Chemistry][29]. The main focus of Quantum Chemistry is the application of [Quantum Mechanics][30] in physical models and experiments of chemical systems. Quantum Chemistry is also referred to as [Molecular Quantum Mechanics][31].
The advent of Cirq has now made it possible for OpenFermion to extend its functionality by providing routines and tools for using Cirq to compile and compose circuits for Quantum simulation algorithms.
#### Google Bristlecone
On March 5, 2018, Google presented [Bristlecone][32], their new Quantum processor, at the annual [American Physical Society meeting][33] in Los Angeles. The [gate-based superconducting system][34] provides a test platform for research into [system error rates][35] and [scalability][36] of Googles [qubit technology][37], along-with applications in Quantum [simulation][38], [optimization][39], and [machine learning.][40]
In the near future, Google wants to make its 72 qubit Bristlecone Quantum processor [cloud accessible][41]. Bristlecone will gradually become quite capable to perform a task that a Classical Supercomputer would not be able to complete in a reasonable amount of time.
Cirq would make it easier for researchers to directly write programs for Bristlecone on the cloud, serving as a very convenient interface for real-time Quantum programming and testing.
Cirq will allow us to:
* Fine tune control over Quantum circuits,
* Specify [gate][42] behavior using native gates,
* Place gates appropriately on the device &
* Schedule the timing of these gates.
### The Open Science Perspective on Cirq
As we all know Cirq is Open Source on GitHub, its addition to the Open Source Scientific Communities, especially those which are focused on Quantum Research, can now efficiently collaborate to solve the current challenges in Quantum Computing today by developing new ways to reduce error rates and improve accuracy in the existing Quantum models.
Had Cirq not followed an Open Source model, things would have definitely been a lot more challenging. A great initiative would have been missed out and we would not have been one step closer in the field of Quantum Computing.
### Summary
To summarize in the end, we first introduced you to the concept of Quantum Computing by comparing it to existing Classical Computing techniques followed by a very important video on recent developmental updates in Quantum Computing since last year. We then briefly discussed Noisy Intermediate Scale Quantum, which is what Cirq is specifically built for.
We saw how we can install and test Cirq on an Ubuntu system. We also tested the installation for usability on an IDE environment with some resources to get started to learn the concept.
Finally, we also saw two examples of how Cirq would be an essential advantage in the development of research in Quantum Computing, namely OpenFermion and Bristlecone. We concluded the discussion by highlighting some thoughts on Cirq with an Open Science Perspective.
We hope we were able to introduce you to Quantum Computing with Cirq in an easy to understand manner. If you have any feedback related to the same, please let us know in the comments section. Thank you for reading and we look forward to see you in our next Open Science article.
--------------------------------------------------------------------------------
via: https://itsfoss.com/qunatum-computing-cirq-framework/
作者:[Avimanyu Bandyopadhyay][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[译者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/avimanyu/
[1]:https://en.wikipedia.org/wiki/Subatomic_particle
[2]:https://en.wikipedia.org/wiki/Quantum
[3]:https://www.clerro.com/guide/491/quantum-superposition-and-entanglement-explained
[4]:https://physics.stackexchange.com/questions/148131/can-quantum-entanglement-and-quantum-superposition-be-considered-the-same-phenom
[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/bit-vs-qubit.jpg
[6]:http://www.rfwireless-world.com/Terminology/Difference-between-Bit-and-Qubit.html
[7]:https://en.wikipedia.org/wiki/Proof_by_exhaustion
[8]:https://www.explainthatstuff.com/how-supercomputers-work.html
[9]:https://arxiv.org/abs/1801.00862
[10]:https://www.xconomy.com/san-francisco/2018/07/19/google-partners-with-zapata-on-open-source-quantum-computing-effort/
[11]:https://www.zapatacomputing.com/about/
[12]:https://github.com/quantumlib/Cirq
[13]:https://itsfoss.com/python-setup-linux/
[14]:https://virtualenv.pypa.io
[15]:https://cirq.readthedocs.io/en/latest/install.html#installing-on-linux
[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-framework-linux.jpeg
[17]:https://pypi.org/project/pip/
[18]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-test-output.jpg
[19]:https://itsfoss.com/install-pycharm-ubuntu/
[20]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-tested-on-pycharm.jpg
[21]:https://github.com/quantumlib/Cirq/tree/master/examples
[22]:https://github.com/quantumlib/Cirq/blob/master/docs/tutorial.md
[23]:http://mmrc.amss.cas.cn/tlb/201702/W020170224608149940643.pdf
[24]:http://openfermion.org
[25]:https://en.wikipedia.org/wiki/Fermion
[26]:https://en.wikipedia.org/wiki/Particle_physics
[27]:https://en.wikipedia.org/wiki/Fermi-Dirac_statistics
[28]:https://phys.org/news/2018-03-openfermion-tool-quantum-coding.html
[29]:https://en.wikipedia.org/wiki/Quantum_chemistry
[30]:https://en.wikipedia.org/wiki/Quantum_mechanics
[31]:https://ocw.mit.edu/courses/chemical-engineering/10-675j-computational-quantum-mechanics-of-molecular-and-extended-systems-fall-2004/lecture-notes/
[32]:https://techcrunch.com/2018/03/05/googles-new-bristlecone-processor-brings-it-one-step-closer-to-quantum-supremacy/
[33]:http://meetings.aps.org/Meeting/MAR18/Content/3475
[34]:https://en.wikipedia.org/wiki/Superconducting_quantum_computing
[35]:https://en.wikipedia.org/wiki/Quantum_error_correction
[36]:https://en.wikipedia.org/wiki/Scalability
[37]:https://research.googleblog.com/2015/03/a-step-closer-to-quantum-computation.html
[38]:https://research.googleblog.com/2017/10/announcing-openfermion-open-source.html
[39]:https://research.googleblog.com/2016/06/quantum-annealing-with-digital-twist.html
[40]:https://arxiv.org/abs/1802.06002
[41]:https://www.computerworld.com.au/article/644051/google-launches-quantum-framework-cirq-plans-bristlecone-cloud-move/
[42]:https://en.wikipedia.org/wiki/Logic_gate

View File

@ -1,113 +0,0 @@
Translating by jlztan
How to swap Ctrl and Caps Lock keys in Linux
======
Linux desktop environments make it easy to set up your keyboard as you want it. Here's how.
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboard_numbers_letters_type_game.jpg?itok=fLlWGw1K)
For many people who've been computer users for (let's just say) "quite some time now," the Ctrl and Caps Lock keys have been in the wrong place since shortly after the first PC keyboards rolled off the production line. For me, the correct positioning appears in this image of a vintage 1995 Sun Workstation keyboard. (Forgive me for the blurriness of the image; it was taken with a Minox spy camera in low light.)
If you're interested, you can read about the [history of the Ctrl key location][1]. I'm not going to discuss the various rationales for placing the Ctrl key next to the "a" key versus below the Shift key; I'm not going to comment on the overall uselessness of the Caps Lock key (whoops); and I'm not going to argue with those who advocate using the heel of the hand to activate the Ctrl key, even though it's impossible to do on some laptop keyboards where the keys are inset below the level of the wrist rest (whoops).
Rather, I'm going to assume I'm not the only one who prefers the Ctrl key next to the "a" and describe how to use the wonderful flexibility that comes with Linux to swap the Ctrl and Caps Lock keys on various desktop environments. Note that this kind of advice seems to have a limited shelf life, as tools for tweaking desktop settings change fairly often. But I hope this offers a good place for you to start.
### With GNOME 3
[GNOME 3][2] desktop environment users can use the [Tweaks][3] tool to swap their Caps Lock and Ctrl keys, as you can see below.
![](https://opensource.com/sites/default/files/uploads/tweaks-tool.png)
Here's how to do it:
1. Install the Tweaks tool from your distribution's repositories.
2. Start the Tweaks application.
3. Select "Keyboard & Mouse" from the left-hand menu.
4. Click "Additional Layout Options".
5. Click "Ctrl position" on the window that opens and choose "Swap Ctrl and Caps Lock."
That's it! By the way, you can do lots of cool stuff with the Tweaks tool. For example, I set my right Ctrl key to be a Compose key, which allows me to type all sorts of characters with keyboard shortcuts—such as ç, é, ô, and ñ and with the keystrokes Compose+c+Comma; Compose+e+Right quote; Compose+o+Circumflex; and Compose+n+Tilde.
### With KDE
I don't use [KDE][4], but item 5 in this article about [KDE tweaks that will change your life][5] by my colleague Seth Kenlon will show you how to remap your keys.
### With Xfce
As far as I can tell, the [Xfce][6] desktop environment doesn't have a handy tool for managing these kinds of settings. However, the **ctrl:swapcaps** option to the **setxkbmap** command will help you make these changes. This type of modification has two parts:
1. Figuring out the command's usage;
2. Figuring out where to invoke the command so it is activated as the desktop comes up.
The first part is pretty straightforward: the command is:
```
/usr/bin/setxkbmap -option "ctrl:nocaps"
```
It's worth executing this in a terminal window to make sure the results are what you expect.
Assuming it works, where should you invoke the command? That requires some experimentation; one possibility is in the file **.profile** in the user's home directory. Another option is to add the command to the autostart facility in Xfce (look for "Session and Startup" in the Settings Manager).
Another possibility is to use the same option in the file / **etc/default/keyboard** , which might end up looking like this:
```
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS="ctrl:swapcaps"
BACKSPACE="guess"
```
Note that this kind of change will affect all users, so if you share your computer, be prepared to do some explaining. Also, system updates may overwrite this file, so you'll need to edit it again if your setup stops working. Putting the same information in the file **.keyboard** in the user's home directory might accomplish the same task on the user's behalf.
Finally, note that these kinds of changes require you to restart Xfce (except when running the command on the command line in the terminal window, but that won't stick past the end of the session).
### With LXQt and other desktop environments
I haven't tried [LXQt][7], but if my memory serves from [LXDE][8], I would try the same recipe used above for Xfce. I'd also expect that the Xfce recipe could work for other Linux desktop environments, but, of course, your favorite search engine is always your friend.
### The console
I haven't tried this, as I have very few opportunities to interact with the console (what you see on a server or when your window system doesn't come up properly). The recipes presented above affect the terminal window in the way one would hope, i.e., consistently with other applications.
However, if the file **/etc/default/keyboard** or **~/.keyboard** has already been edited (as described above), the utility **setupcon** is intended to change the console keyboard setup so it functions the same way.** **This [StackExchange article][9], [this other one][10], and [this third one][11] give some ideas on how to effect these changes from both of these files. The third article also talks about using **dumpkeys** and **loadkeys**. It's also worthwhile to read [the setupcon man page][12] — it's short and to the point, and combined with the comments from the StackExchange articles, should be enough to get a solution in place.
Finally, it's worth emphasizing here the point mentioned in the StackExchange articles - configuring the console IS NOT THE SAME as configuring terminal windows; the latter are configured through the desktop manager as described previously.
### When all else fails
The manual pages for **setxkbmap** , **xkeyboard-config** , **keyboard** , **console-setup** , and **setupcon** are all useful references. Or, if you don't like reading manual pages, there's [this great article][13].
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keyboard
作者:[Chris Hermansen][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/clhermansen
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Control_key
[2]: https://www.gnome.org/gnome-3/
[3]: https://wiki.gnome.org/Apps/Tweaks
[4]: https://www.kde.org/
[5]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life
[6]: https://www.xfce.org/
[7]: https://lxqt.org/
[8]: https://lxde.org/
[9]: https://askubuntu.com/questions/485454/how-to-remap-keys-on-a-user-level-both-with-and-without-x
[10]: https://unix.stackexchange.com/questions/198791/how-do-i-permanently-change-the-console-tty-font-type-so-it-holds-after-reboot
[11]: https://superuser.com/questions/290115/how-to-change-console-keymap-in-linux
[12]: http://man.he.net/man1/setupcon
[13]: http://www.noah.org/wiki/CapsLock_Remap_Howto

View File

@ -0,0 +1,257 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (5 Ways To Check Laptop Battery Status And Level From Linux Terminal)
[#]: via: (https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
5 Ways To Check Laptop Battery Status And Level From Linux Terminal
======
We can easily check the battery status through GUI such as current battery percentage, whether its charging or not charging and how long it will be usable without charging, but we cant able to check the battery health and other related information.
In this scenario what will be the solutions.
Yes, we have few utilities available for this in Linux and it can be achieved through command line.
We are going to discuss about this topic today through this article and i will try to cover possible information i can.
Checking your battery health monthly once is something good. It will help you to identify whether we are facing any battery or charge related issues.
Also, we can see battery model name, power source, vendor and battery technology, etc,.
Power management is a feature that turns off the power or switches systems components to a low-power state when inactive.
### Following Utilities are available in Linux to Check Battery Status.
* `upower`: upower is a command line tool which provides an interface to enumerate power sources on the system.
* `acpi`: acpi Shows information from the /proc or the /sys filesystem, such as battery status or thermal information.
* `batstat`: batstat is a command line tool to print battery status for linux.
* `tlp`: TLP brings you the benefits of advanced power management for Linux without changing any configuration.
* `class file`: The sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data structures.
### How to Check Laptop Battery Status Using upower Command?
[upower][1] is a command line tool that provides an interface to enumerate power sources on the system. It control the latency of different operations on your computer, which enables you to save significant amounts of power.
Just run the following command to get the battery and its related information on Linux.
```
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
native-path: BAT0
vendor: SMP
model: L14M4P23
serial: 756
power supply: yes
updated: Monday 03 December 2018 07:56:18 PM IST (95 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: discharging
warning-level: none
energy: 28.23 Wh
energy-empty: 0 Wh
energy-full: 52.26 Wh
energy-full-design: 60 Wh
energy-rate: 10.714 W
voltage: 14.819 V
time to empty: 2.6 hours
percentage: 54%
capacity: 87.1%
technology: lithium-ion
icon-name: 'battery-good-symbolic'
History (charge):
1543847178 54.000 discharging
History (rate):
1543847178 10.714 discharging
```
To check the specific information about battery, use the following format.
```
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty"
state: discharging
time to empty: 2.1 hours
percentage: 43%
```
Its same as above, but its taken after power cable plugged in, thats why the state showing charging.
```
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty"
state: charging
percentage: 41%
```
### How to Check Laptop Battery Status Using TLP Command?
TLP is a free opensource feature-rich command line tool which optimize laptop battery without making any configuration change.
TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfil your specific requirements.
TLP package is available in most of the Linux distribution official repository such as Arch, Debian, Fedora, Gentoo, openSUSE, etc. Use your distribution Package Manager to install the TLP utility.
Just run the following command to get the battery and its related information on Linux.
```
$ sudo tlp-stat -b
--- TLP 1.1 --------------------------------------------
+++ Battery Status
/sys/class/power_supply/BAT0/manufacturer = SMP
/sys/class/power_supply/BAT0/model_name = L14M4P23
/sys/class/power_supply/BAT0/cycle_count = (not supported)
/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh]
/sys/class/power_supply/BAT0/energy_full = 52260 [mWh]
/sys/class/power_supply/BAT0/energy_now = 21950 [mWh]
/sys/class/power_supply/BAT0/power_now = 10923 [mW]
/sys/class/power_supply/BAT0/status = Discharging
Charge = 42.0 [%]
Capacity = 87.1 [%]
```
To see other information as well.
```
$ sudo tlp-stat -s
--- TLP 1.1 --------------------------------------------
+++ System Info
System = LENOVO Lenovo ideapad Y700-15ISK 80NV
BIOS = CDCN35WW
Release = "Manjaro Linux"
Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64
/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b
Init system = systemd
Boot mode = BIOS (CSM, Legacy)
+++ TLP Status
State = enabled
Last run = 07:16:12 IST, 4362 sec(s) ago
Mode = battery
Power source = battery
```
### How to Check Laptop Battery Status Using ACPI Command?
ACPI stands for Advanced Configuration and Power Interface modules are kernel modules for different ACPI parts. They enable special ACPI functions or add information to /proc or /sys. These information can be parsed by acpid for events or other monitoring applications.
```
$ acpi
Battery 0: Charging, 43%, 01:05:11 until charged
```
To see battery capacity.
```
$ acpi -i
Battery 0: Charging, 43%, 01:05:07 until charged
Battery 0: design capacity 3817 mAh, last full capacity 3324 mAh = 87%
```
To see more details about battery and related information.
```
$ acpi -V
Battery 0: Charging, 43%, 01:05:07 until charged
Battery 0: design capacity 3815 mAh, last full capacity 3323 mAh = 87%
Adapter 0: on-line
Cooling 0: Processor 0 of 10
Cooling 1: Processor 0 of 10
Cooling 2: Processor 0 of 10
Cooling 3: iwlwifi 0 of 19
Cooling 4: Processor 0 of 10
Cooling 5: iwlwifi no state information available
Cooling 6: Processor 0 of 10
Cooling 7: Processor 0 of 10
Cooling 8: Processor 0 of 10
Cooling 9: intel_powerclamp no state information available
Cooling 10: x86_pkg_temp no state information available
Cooling 11: Processor 0 of 10
```
### How to Check Laptop Battery Status Using Batstat Command?
batstat is a command line tool to print battery status in linux terminal.
```
Status: Charging
Max energy: 50.00 Wh
Energy left: 24.50 Wh
Power Consumption: 26.40 W
Percentage left: 49.00%
Average power Consumption: 0.00 W
Time elapsed: 0: 0:12 since 49.00%
= Time ======== Percent ============================================
0: 0: 0 49.00%
```
### How to Check Laptop Battery Status Using sysfs filesystem?
The sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data structures. The files under sysfs provide information about devices, kernel modules, filesystems, and other kernel components.
The sysfs filesystem is commonly mounted at /sys. Typically, it is mounted automatically by the system, but it can also be mounted manually using a command such as `mount -t sysfs sysfs /sys`
Many of the files in the sysfs filesystem are read-only, but some files are writable, allowing kernel variables to be changed. To avoid redundancy, symbolic links are heavily used to connect entries across the filesystem tree.
```
$ cat /sys/class/power_supply/BAT0/*
0
51
Normal
0
cat: /sys/class/power_supply/BAT0/device: Is a directory
52260000
60000000
26660000
SMP
L14M4P23
cat: /sys/class/power_supply/BAT0/power: Is a directory
27656000
1
756
Charging
cat: /sys/class/power_supply/BAT0/subsystem: Is a directory
Li-ion
Battery
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=14800000
POWER_SUPPLY_VOLTAGE_NOW=15840000
POWER_SUPPLY_POWER_NOW=27656000
POWER_SUPPLY_ENERGY_FULL_DESIGN=60000000
POWER_SUPPLY_ENERGY_FULL=52260000
POWER_SUPPLY_ENERGY_NOW=26660000
POWER_SUPPLY_CAPACITY=51
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_MODEL_NAME=L14M4P23
POWER_SUPPLY_MANUFACTURER=SMP
POWER_SUPPLY_SERIAL_NUMBER= 756
14800000
15840000
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/
作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://upower.freedesktop.org/

View File

@ -0,0 +1,265 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How To Benchmark Linux Commands And Programs From Commandline)
[#]: via: (https://www.ostechnix.com/how-to-benchmark-linux-commands-and-programs-from-commandline/)
[#]: author: (SK https://www.ostechnix.com/author/sk/)
How To Benchmark Linux Commands And Programs From Commandline
======
![](https://www.ostechnix.com/wp-content/uploads/2018/12/benchmark-720x340.png)
A while ago, I have written a guide about the [**alternatives to top, the command line utility**][1]. Some of the users asked me which one among those tools is best and on what basis (like features, contributors, years active, page requests etc.) I compared those tools. They also asked me to share the bench-marking results If I have any. Unfortunately, I didnt even know how to benchmark programs at that time. While searching for some simple and easy to use bench-marking tools to compare the Linux programs, I stumbled upon two utilities named **Bench** and **Hyperfine**. These are simple and easy-to-use command line tools to benchmark Linux commands and programs on Unix-like systems.
### 1\. Bench Tool
The **Bench** utility benchmarks one or more given commands/programs using **Haskells criterion** library and displays the output statistics in an easy-to-understandable format. This tool can be helpful where you need to compare similar programs based on the bench-marking result. We can also export the results to HTML format or CSV or templated output.
#### Installing Bench Utility
The bench utility can be installed in three methods.
**1\. Using Linuxbrew**
We can install Bench utility using Linuxbrew package manager. If you havent installed Linuxbrew yet, refer the following link.
After installing Linuxbrew, run the following command to install Bench:
```
$ brew install bench
```
**2\. Using Haskells stack tool**
First, install Haskell as described in the following link.
And then, run the following commands to install Bench.
```
$ stack setup
$ stack install bench
```
The stack will install bench to **~/.local/bin** or something similar. Make sure that the installation directory is on your executable search path before using bench tool. You will be reminded to do this even if you forgot.
**3\. Using Nix package manager**
Another way to install Bench is using **Nix** package manager. Install Nix as shown in the below link.
After installing Nix, install Bench tool using command:
```
$ nix-env -i bench
```
#### Benchmark Linux Commands And Programs Using Bench
It is time to start benchmarking the programs.
For instance, let me show you the benchmark result of ls -al command.
```
$ bench 'ls -al'
```
**Sample output:**
![](https://www.ostechnix.com/wp-content/uploads/2018/12/Benchmark-commands-1.png)
You must quote the commands when you use flags/options with them.
Similarly, you can benchmark any programs installed in your system. The following commands shows the benchmarking result of htop and ptop programs.
```
$ bench htop
$ bench ptop
```
![](https://www.ostechnix.com/wp-content/uploads/2018/12/Benchmark-commands-2-1.png)
Bench tool can benchmark multiple programs at once as well. Here is the benchmarking result of ls, htop, ptop programs.
```
$ bench ls htop ptop
```
Sample output:
![](https://www.ostechnix.com/wp-content/uploads/2018/12/Benchmark-commands-3.png)
We can also export the benchmark result to a HTML like below.
```
$ bench htop --output example.html
```
To export the result to CSV, just run:
```
$ bench htop --csv FILE
```
View help section:
```
$ bench --help
```
### **2. Hyperfine Benchmark Tool
**
**Hyperfine** is yet another command line benchmarking tool inspired by the Bench tool which we just discussed above. It is free, open source, cross-platform benchmarking program and written in **Rust** programming language. It has few additional features compared to the Bench tool as listed below.
* Statistical analysis across multiple runs.
* Support for arbitrary shell commands.
* Constant feedback about the benchmark progress and current estimates.
* Perform warmup runs before the actual benchmark.
* Cache-clearing commands can be set up before each timing run.
* Statistical outlier detection.
* Export benchmark results to various formats, such as CSV, JSON, Markdown.
* Parameterized benchmarks.
#### Installing Hyperfine
We can install Hyperfine using any one of the following methods.
**1\. Using Linuxbrew**
```
$ brew install hyperfine
```
**2\. Using Cargo**
Make sure you have installed Rust as described in the following link.
After installing Rust, run the following command to install Hyperfine via Cargo:
```
$ cargo install hyperfine
```
**3\. Using AUR helper programs**
Hyperfine is available in [**AUR**][2]. So, you can install it on Arch-based systems using any helper programs, such as [**YaY**][3], like below.
```
$ yay -S hyperfine
```
**4\. Download and install the binaries**
Hyperfine is available in binaries for Debian-based systems. Download the latest .deb binary file from the [**releases page**][4] and install it using dpkg package manager. As of writing this guide, the latest version was **1.4.0**.
```
$ wget https://github.com/sharkdp/hyperfine/releases/download/v1.4.0/hyperfine_1.4.0_amd64.deb
$ sudo dpkg -i hyperfine_1.4.0_amd64.deb
$ sudo apt install -f
```
#### Benchmark Linux Commands And Programs Using Hyperfine
To run a benchmark using Hyperfine, simply run it along with the program/command as shown below.
```
$ hyperfine 'ls -al'
```
![](https://www.ostechnix.com/wp-content/uploads/2018/12/hyperfine-1.png)
Benchmark multiple commands/programs:
```
$ hyperfine htop ptop
```
Sample output:
![](https://www.ostechnix.com/wp-content/uploads/2018/12/hyperfine-2.png)
As you can see at the end of the output, Hyperfine mentiones **htop ran 1.96 times faster than ptop** , so we can immediately conclude htop performs better than Ptop. This will help you to quickly find which program performs better when benchmarking multiple programs. We dont get this detailed output in Bench utility though.
Hyperfine will automatically determine the number of runs to perform for each command. By default, it will perform at least **10 benchmarking runs**. If you want to set the **minimum number of runs** (E.g 5 runs), use the `-m` **/`--min-runs`** option like below:
```
$ hyperfine --min-runs 5 htop ptop
```
Or,
```
$ hyperfine -m 5 htop ptop
```
Similarly, to perform **maximum number of runs** for each command, the command would be:
```
$ hyperfine --max-runs 5 htop ptop
```
Or,
```
$ hyperfine -M 5 htop ptop
```
We can even perform **exact number of runs** for each command using the following command:
```
$ hyperfine -r 5 htop ptop
```
As you may know, if the program execution time is limited by disk I/O, the benchmarking results can be heavily influenced by disk caches and whether they are cold or warm. Luckily, Hyperfine has the options to perform a certain number of program executions before performing the actual benchmark.
To perform NUM warmup runs (E.g 3) before the actual benchmark, use the **`-w`/**`--warmup` option like below:
```
$ hyperfine --warmup 3 htop
```
Just like Bench utility, Hyperfine also allows us to export the benchmark results to a given file. We can export the results to CSV, JSON, and Markdown formats.
For instance, to export the results in Markdown format, use the following command:
```
$ hyperfine htop ptop --export-markdown <FILE-NAME>
```
For more options and usage details, refer the help secion:
```
$ hyperfine --help
```
And, thats all for now. If you ever be in a situation where you need to benchmark similar and alternative programs, these tools might help to compare how they performs and share the details with your peers and colleagues.
More good stuffs to come. Stay tuned!
Cheers!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/how-to-benchmark-linux-commands-and-programs-from-commandline/
作者:[SK][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.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972
[1]: https://www.ostechnix.com/some-alternatives-to-top-command-line-utility-you-might-want-to-know/
[2]: https://aur.archlinux.org/packages/hyperfine
[3]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/
[4]: https://github.com/sharkdp/hyperfine/releases

View File

@ -0,0 +1,111 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Install Putty on Ubuntu and Other Linux Distributions)
[#]: via: (https://itsfoss.com/putty-linux/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
How to Install Putty on Ubuntu and Other Linux Distributions
======
If I am not wrong, [Putty][1] is perhaps the most popular SSH client for Windows.
In IT companies, the development environment is usually on a remote Linux system while the developers use Windows as their local system. Putty is used for connecting to the remote Linux system from the Windows machine.
Putty is not limited to Windows only. You can also use this open source software on Linux and macOS.
But wait! Why would you use a separate SSH client on Linux when you already have the real Linux terminal with you? There are several reasons why you would want to use Putty on Linux.
* You have used Putty for so long on Windows that you are more comfortable with it.
* You find it difficult to manually edit SSH config file to save the various SSH sessions. You prefer Puttys graphical way of storing SSH connection.
* You want to debug by connecting to raw sockets and serial ports.
Whatever may be the reason, if you want to use Putty on Ubuntu or any other Linux, you can certainly do so. Let me show you how to do that.
### Installing Putty on Ubuntu Linux
![Installing Putty on Linux][2]
The good news for the Ubuntu users is that Putty is available in the universe repository of Ubuntu.
To install Putty on Ubuntu, you should first make sure that the universe repository is enabled.
```
sudo add-apt-repository universe
```
Once you have the universe repository enabled, you should update Ubuntu with this command:
```
sudo apt update
```
After this, you can install Putty with this command:
```
sudo apt install putty
```
Once installed, you can start Putty by finding it in the menu.
As you can see in the screenshot below, the Linux version of Putty looks the same as the Windows version. Thats a relief because you wont have to fiddle around trying to find your way through a new and changed settings.
![Putty in Linux][3]
When you enter the remote systems [hostname][4] or IP address and connect to it, Putty will utilize the already saved SSH keys in your home directory.
![Using Putty in Ubuntu Linux][5]
### Installing Putty on other Linux distributions
[Putty is available for Debian][6] so you just need to use apt-get or aptitude for installing it.
```
sudo apt-get install putty
```
Putty is also available for Fedora/Red Hat and can be installed using the default package manager.
```
sudo dnf install putty
```
You can also easily install Putty in Arch Linux based distributions.
```
sudo pacman -S putty
```
Remember that Putty is an open source software. You can also install it via source code if you really want to. You can get the source code of Putty from the link below.
[Download Putty Source Code][8]
I would always prefer the native Linux terminal over an SSH client like Putty. I feel more at home with the GNOME terminal or [Terminator][7]. However, its up to an individuals choice to use the default terminal or Putty in Linux
What do you use for managing multiple SSH connections on Linux?
--------------------------------------------------------------------------------
via: https://itsfoss.com/putty-linux/
作者:[Abhishek Prakash][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/abhishek/
[b]: https://github.com/lujun9972
[1]: https://www.putty.org/
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/Putty-linux.png?resize=800%2C450&ssl=1
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu.jpeg?resize=800%2C503&ssl=1
[4]: https://itsfoss.com/change-hostname-ubuntu/
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu-1.jpeg?resize=800%2C430&ssl=1
[6]: https://packages.debian.org/jessie/putty
[7]: https://launchpad.net/terminator
[8]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

View File

@ -0,0 +1,85 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Winterize your Bash prompt in Linux)
[#]: via: (https://opensource.com/article/18/12/linux-toy-bash-prompt)
[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
Winterize your Bash prompt in Linux
======
Your Linux terminal probably supports Unicode, so why not take advantage of that and add a seasonal touch to your prompt?
![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-bash-prompt.png?itok=HK_kVn37)
Hello once again for another installment of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is? Really, we're keeping it pretty open-ended: It's anything that's a fun diversion at the terminal, and we're giving bonus points for anything holiday-themed.
Maybe you've seen some of these before, maybe you haven't. Either way, we hope you have fun.
Today's toy is super-simple: It's your Bash prompt. Your Bash prompt? Yep! We've got a few more weeks of the holiday season left to stare at it, and even more weeks of winter here in the northern hemisphere, so why not have some fun with it.
Your Bash prompt currently might be a simple dollar sign ( **$** ), or more likely, it's something a little longer. If you're not sure what makes up your Bash prompt right now, you can find it in an environment variable called $PS1. To see it, type:
```
echo $PS1
```
For me, this returns:
```
[\u@\h \W]\$
```
The **\u** , **\h** , and **\W** are special characters for username, hostname, and working directory. There are others you can use as well; for help building out your Bash prompt, you can use [EzPrompt][1], an online generator of PS1 configurations that includes lots of options including date and time, Git status, and more.
You may have other variables that make up your Bash prompt set as well; **$PS2** for me contains the closing brace of my command prompt. See [this article][2] for more information.
To change your prompt, simply set the environment variable in your terminal like this:
```
$ PS1='\u is cold: '
jehb is cold:
```
To set it permanently, add the same code to your **/etc/bashrc **using your favorite text editor.
So what does this have to do with winterization? Well, chances are on a modern machine, your terminal support Unicode, so you're not limited to the standard ASCII character set. You can use any emoji that's a part of the Unicode specification, including a snowflake ❄, a snowman ☃, or a pair of skis 🎿. You've got plenty of wintery options to choose from.
```
🎄 Christmas Tree
🧥 Coat
🦌 Deer
🧤 Gloves
🤶 Mrs. Claus
🎅 Santa Claus
🧣 Scarf
🎿 Skis
🏂 Snowboarder
❄ Snowflake
☃ Snowman
⛄ Snowman Without Snow
🎁 Wrapped Gift
```
Pick your favorite, and enjoy some winter cheer. Fun fact: modern filesystems also support Unicode characters in their filenames, meaning you can technically name your next program **"❄❄❄❄❄.py"**. That said, please don't.
Do you have a favorite command-line toy that you think I ought to include? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
Check out yesterday's toy, [Snake your way across your Linux terminal][3], and check back tomorrow for another!
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/12/linux-toy-bash-prompt
作者:[Jason Baker][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/jason-baker
[b]: https://github.com/lujun9972
[1]: http://ezprompt.net/
[2]: https://access.redhat.com/solutions/505983
[3]: https://opensource.com/article/18/12/linux-toy-snake

View File

@ -0,0 +1,228 @@
量子计算的开源框架 Cirq 介绍
======
我们即将讨论的内容正如标题所示,本文通过使用 Cirq 的一个开源视角,尝试去了解我们已经在量子计算领域取得多大的成就,和该领域的发展方向,以加快科学和技术研究。
首先,我们将引领你进入量子计算的世界。在我们深入了解 Cirq 在未来的量子计算中扮演什么样的重要角色之前我们将尽量向你解释其背后的基本概念。Cirq你最近可能听说过在这个领域中已经发生了重大新闻在 Open Science 上的文章中,我们将去尝试找出答案。
<https://www.youtube.com/embed/WVv5OAR4Nik?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
在我们开始了解量子计算之前,必须先去了解“量子”这个术语,量子是已知的 [亚原子粒子][1] 中最小的物质。[量子][2] 这个词来自拉丁语 Quantus意思是 “非常小”,在下面的短视频链接中有描述:
<https://www.youtube.com/embed/-pUOxVsxu3o?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
为了易于我们理解量子计算,我们将量子计算与<ruby>传统计算<rt>Classical Computing</rt></ruby>(也译做经典计算)进行比较。传统计算是指设计用于工作的、我们正在使用的传统计算机,正如你现在用于阅读本文的设备,就是我们所谓的传统计算设备。
### 传统计算
传统计算是描述传统计算机如何工作的另一种方式。它们通过一个二进制系统工作,即信息使用 1 或 0 来存储。传统计算机不会理解除 1 或 0 之外的任何其它东西。
直白来说在计算机内部一个晶体管只能是开1或关0。我们输入的任何信息都被转换为无数个 1 和 0所以计算机只能理解和存储 1 和 0。所有的东西都只能用无数个 1 和 0 的组合来表示。
<https://www.youtube.com/embed/Xpk67YzOn5w?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
### 量子计算
然而,量子计算不再像传统计算那样遵循 “开或关” 的模式。而是,借助量子的名为 [叠加和纠缠][3] 的两个现象,能同时处理信息的多个状态,因此能以更快的速率加速计算,并且在信息存储方面效率更高。
请注意,叠加和纠缠 [不是同一个现象][4]。
<https://www.youtube.com/embed/jiXuVIEg10Q?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
![][5]
就像在传统计算中,我们有<ruby>比特<rt>bit</rt></ruby>,在量子计算中,我们相应也有<ruby>量子比特<rt>qubits</rt></ruby>(或 Quantum bits。想了解它们二者之间的巨大差异之处请查看这个 [页面][6],从那里的图片中可以得到答案。
量子计算机并不是来替代我们的传统计算机的。但是,有一些非常巨大的任务用我们的传统计算机是无法完成的,而那些正是量子计算机大显身手的好机会。下面链接的视频详细描述了上述情况,同时也描述了量子计算机的原理。
<https://www.youtube.com/embed/JhHMJCUmq28?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
下面的视频全面描述了量子计算领域到目前为止的最新进展:
<https://www.youtube.com/embed/CeuIop_j2bI?enablejsapi=1&autoplay=0&cc_load_policy=0&iv_load_policy=1&loop=0&modestbranding=1&rel=0&showinfo=0&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=2&>
### 嘈杂中型量子
根据最新更新的2018 年 7 月 31 日)研究论文,术语 “Noisy” 是指由于对量子比特未能完全控制所产生的不准确性。正是这种不准确性严重制约了量子设备短期内实现其目标。
“中型” 指的是在接下来的几年中,量子计算机将要实现的规模大小,届时,量子比特的数目将可能从 50 到几百个不等。50 个量子比特是一个重大的量程碑,因为它将超越现有的最强大的 [超级计算机][8] 的 [暴力][7] 模拟能力。更多信息请阅读 [这里的][9] 论文。
随着 Cirq 出现,许多事情将会发生变化。
### Cirq 是什么?
Cirq 是一个 python 框架它用于创建、编辑和调用我们前面讨论的嘈杂中型量子NISQ。换句话说Cirq 能够解决挑战,去改善精确度和降低量子计算中的噪声。
Cirq 并不需要必须有一台真实的量子计算机。Cirq 能够使用一个类似模拟器的界面去执行量子电路模拟。
Cirq 的前进步伐越来越快了,[Zapata][10] 是使用它的首批用户之一Zapata 是由来自哈佛大学的一群专注于量子计算的科学家在去年成立的。
### Linux 上使用 Cirq 入门
开源的 [Cirq 库][12] 开发者建议将它安装在像 [virtualenv][14] 这样的一个 [虚拟 python 环境][13] 中。在 Linux 上的开发者安装指南可以在 [这里][15] 找到。
但我们在 Ubuntu 16.04 的系统上成功地安装和测试了 Python3 的 Cirq 库,安装步骤如下:
#### 在 Ubuntu 上安装 Cirq
![Cirq Framework for Quantum Computing in Linux][16]
首先,我们需要 pip 或 pip3 去安装 Cirq。[Pip][17] 是推荐用于安装和管理 Python 包的工具。
对于 Python 3.x 版本Pip 能够用如下的命令来安装:
```
sudo apt-get install python3-pip
```
Python3 包能够通过如下的命令来安装:
```
pip3 install <package-name>
```
我们继续去使用 Pip3 为 Python3 安装 Cirq 库:
```
pip3 install cirq
```
#### 启用 Plot 和 PDF 生成(可选)
可选系统的依赖没有安装的,可以使用 pip 去安装它:
```
sudo apt-get install python3-tk texlive-latex-base latexmk
```
* python3-tk 是 Python 自有的启用了绘图功能的图形库
* texlive-latex-base 和 latexmk 启动了 PDF 输出功能。
最后,我们使用如下的命令和代码成功测试了 Cirq
```
python3 -c 'import cirq; print(cirq.google.Foxtail)'
```
我们得到的输出如下图:
![][18]
#### 为 Cirq 配置 Pycharm IDE
我们也配置了一个 Python IDE [PyCharm][19] 去测试同样的结果:
因为在我们的 Linux 系统上为 Python3 安装了 Cirq我们在 IDE 中配置项目解释器路径:
```
/usr/bin/python3
```
![][20]
在上面的输出中你可能注意到我们刚设置的项目解释器路径与测试程序文件test.py的路径显示在一起。退出代码 0 表示程序已经成功退出,没有错误。
因此,那是一个现成的 IDE 环境,你可以导入 Cirq 库去开始使用 Python 去编程和模拟量子电路。
#### Cirq 使用入门
Criq 入门的一个好的开端就是它 GitHub 页面上的 [示例][21]。
Cirq 的开发者在 GitHub 上已经放了学习 [教程][22]。如果你想认真地学习量子计算,他们推荐你去看一本非常好的书,它是[由 Nielsen 和 Chuang 写的名为 “量子计算和量子信息“][23]。
#### OpenFermion-Cirq
[OpenFermion][24] 是一个开源库,它是为了在量子计算机上模拟获取和操纵表示费米系统(包含量子化学)。根据 [粒子物理学][26] 理论,按照 [费米— 狄拉克统计][27],费米系统与 [费米子][25] 的产生相关。
OpenFermion 被称为从事 [量子化学][29] 的化学家和研究人员的 [一个极好的实践工具][28]。量子化学主要专注于 [量子力学][30] 在物理模型和化学系统实验中的应用。量子化学也被称为 [分子量子力学][31]。
Cirq 的出现使 OpenFermion 通过提供程序和工具去扩展功能成为了可能,通过使用 Cirq 可以去编译和构造仿真量子电路。
#### Google Bristlecone
2018 年 3 月 5 日,在洛杉矶举行的一年一度的 [美国物理学会会议][33] 上Google 发布了 [Bristlecone][32],这是他们的最新的量子处理器。这个 [基于门的超导系统][34] 为 Google 提供了一个测试平台,用以研究 [量子比特技术][37] 的 [系统错误率][35] 和 [扩展性][36] ,以及在量子 [仿真][38]、[优化][39]、和 [机器学习][40] 方面的应用。
Google 希望在不久的将来,能够制造出它的 [云可访问][41] 的 72 个量子比特的 Bristlecone 量子处理器。Bristlecone 将越来越有能力完成一个传统超级计算机无法在合理时间内完成的任务。
Cirq 将让研究人员直接在云上为 Bristlecone 写程序变得很容易,它提供了一个非常方便的、实时的、量子编程和测试的接口。
Cirq 将允许我们去:
* 量子电路的微调管理
* 使用原生门去指定 [门][42] 行为
* 在设备上放置适当的门
* 并调度这个门的时刻
### Open Science 关于 Cirq 的观点
我们知道 Cirq 是在 GitHub 上开源的,它除了在 Open Science 社区之外,特别是那些专注于量子研究的人们,都可以高效率地合作,通过开发新方法,去降低现有量子模型中的错误率和提升精确度,以解决目前在量子计算中所面临的挑战。
如果 Cirq 不走开源模型的路线,事情可能变得更具挑战。一个伟大的创举可能就此错过,我们可能在量子计算领域止步不前。
### 总结
最后我们总结一下,我们首先通过与传统计算相比较,介绍了量子计算的概念,然后是一个非常重要的视频来介绍了自去年以来量子计算的最新发展。接着我们简单讨论了嘈杂中型量子,也就是为什么要特意构建 Cirq 的原因所在。
我们看了如何在一个 Ubuntu 系统上安装和测试 Cirq。我们也在一个更好用的 IDE 环境中做了安装测试,并使用一些资源去开始学习有关概念。
最后,我们看了两个示例 OpenFermion 和 Bristlecone介绍了在量子计算中Cirq 在开发研究中具有什么样的基本优势。最后我们以 Open Science 社区的视角对 Cirq 进行了一些精彩的思考,结束了我们的话题。
我们希望能以一种易于理解的方式向你介绍量子计算框架 Cirq 的使用。如果你有与此相关的任何反馈,请在下面的评论区告诉我们。感谢阅读,希望我们能在 Open Science 的下一篇文章中再见。
--------------------------------------------------------------------------------
via: https://itsfoss.com/qunatum-computing-cirq-framework/
作者:[Avimanyu Bandyopadhyay][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[qhwdw](https://github.com/qhwdw)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/avimanyu/
[1]:https://en.wikipedia.org/wiki/Subatomic_particle
[2]:https://en.wikipedia.org/wiki/Quantum
[3]:https://www.clerro.com/guide/491/quantum-superposition-and-entanglement-explained
[4]:https://physics.stackexchange.com/questions/148131/can-quantum-entanglement-and-quantum-superposition-be-considered-the-same-phenom
[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/bit-vs-qubit.jpg
[6]:http://www.rfwireless-world.com/Terminology/Difference-between-Bit-and-Qubit.html
[7]:https://en.wikipedia.org/wiki/Proof_by_exhaustion
[8]:https://www.explainthatstuff.com/how-supercomputers-work.html
[9]:https://arxiv.org/abs/1801.00862
[10]:https://www.xconomy.com/san-francisco/2018/07/19/google-partners-with-zapata-on-open-source-quantum-computing-effort/
[11]:https://www.zapatacomputing.com/about/
[12]:https://github.com/quantumlib/Cirq
[13]:https://itsfoss.com/python-setup-linux/
[14]:https://virtualenv.pypa.io
[15]:https://cirq.readthedocs.io/en/latest/install.html#installing-on-linux
[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-framework-linux.jpeg
[17]:https://pypi.org/project/pip/
[18]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-test-output.jpg
[19]:https://itsfoss.com/install-pycharm-ubuntu/
[20]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-tested-on-pycharm.jpg
[21]:https://github.com/quantumlib/Cirq/tree/master/examples
[22]:https://github.com/quantumlib/Cirq/blob/master/docs/tutorial.md
[23]:http://mmrc.amss.cas.cn/tlb/201702/W020170224608149940643.pdf
[24]:http://openfermion.org
[25]:https://en.wikipedia.org/wiki/Fermion
[26]:https://en.wikipedia.org/wiki/Particle_physics
[27]:https://en.wikipedia.org/wiki/Fermi-Dirac_statistics
[28]:https://phys.org/news/2018-03-openfermion-tool-quantum-coding.html
[29]:https://en.wikipedia.org/wiki/Quantum_chemistry
[30]:https://en.wikipedia.org/wiki/Quantum_mechanics
[31]:https://ocw.mit.edu/courses/chemical-engineering/10-675j-computational-quantum-mechanics-of-molecular-and-extended-systems-fall-2004/lecture-notes/
[32]:https://techcrunch.com/2018/03/05/googles-new-bristlecone-processor-brings-it-one-step-closer-to-quantum-supremacy/
[33]:http://meetings.aps.org/Meeting/MAR18/Content/3475
[34]:https://en.wikipedia.org/wiki/Superconducting_quantum_computing
[35]:https://en.wikipedia.org/wiki/Quantum_error_correction
[36]:https://en.wikipedia.org/wiki/Scalability
[37]:https://research.googleblog.com/2015/03/a-step-closer-to-quantum-computation.html
[38]:https://research.googleblog.com/2017/10/announcing-openfermion-open-source.html
[39]:https://research.googleblog.com/2016/06/quantum-annealing-with-digital-twist.html
[40]:https://arxiv.org/abs/1802.06002
[41]:https://www.computerworld.com.au/article/644051/google-launches-quantum-framework-cirq-plans-bristlecone-cloud-move/
[42]:https://en.wikipedia.org/wiki/Logic_gate

View File

@ -0,0 +1,108 @@
在 Linux 下交换 Ctrl 与 Caps Lock 键
======
Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示如何去做。
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboard_numbers_letters_type_game.jpg?itok=fLlWGw1K)
对于许多使用计算机很多年的用户来说,自从第一批 PC 键盘从生产线上下线后不久Ctrl 和 Caps Lock 键就已经在错误的位置上了。对我来说,这张 1995 年 Sun 工作站的老式键盘照片上的两个键的位置才是正确的。(原谅我放了一张模糊的图片,它是在昏暗的光线下使用 Minox 间谍相机拍摄的。)
感兴趣的话,可以读一下维基百科上对于 [Ctrl 键位置的历史][1] 的介绍。我不打算讨论将 Ctrl 键放在“a”旁边而不是 Shift 键下方的各种理由,不评论 Caps Lock 键的无用性,也没有打算与那些主张使用手掌根来触发 Ctrl 键的人争论,即使在一些笔记本电脑键盘上也不可能这样做,因为有的键会位于腕托以下。
相反,我将假设我不是唯一喜欢把 Ctrl 键放在“a”旁边的人并说明如何使用 Linux 自带的灵活性在各种桌面环境中交换 Ctrl 和 Caps Lock 键的位置。请注意,下面的演示可能只有有限的有效期,因为调整桌面设置的方法经常发生变化,但我希望这为你开了一个好头。
### GNOME 3
[GNOME 3][2] 桌面环境用户可以使用 [Tweaks][3] 工具交换 Caps Lock 和 Ctrl 键,如下所示。![](https://opensource.com/sites/default/files/uploads/tweaks-tool.png)
具体步骤如下:
1. 从你的 Linux 发行版的软件仓库安装 Tweaks 工具。
2. 启动 Tweaks 程序。
3. 从左侧菜单中选择“Keyboard & Mouse”。
4. 单击“Additional Layout Options”。
5. 在打开的窗口中单击“Ctrl position”然后选择“Swap Ctrl and Caps Lock”。
完成!顺便说一句,你可以使用 Tweaks 工具做很多很酷的事情。例如,我将我的右 Ctrl 键设置为 Compose 键,这让我可以使用键盘快捷键打出各种字符,例如通过 `Compose+c+,`、`Compose+e+'`、`Compose+O+^` 以及 `Compose+n+~` 分别键入 ç、é、ô 和 ñ。
### KDE
我不使用 [KDE][4],但我的同事 Seth Kenlon 写的 [KDE tweaks that will change your life][5] 这篇文章的第 5 项演示了如何重新映射按键。
### Xfce
据我所知,[Xfce][6] 桌面环境没有一个方便的工具来管理这些(指交换按键)设置。 但是,`setxkbmap` 命令的 `ctrl:swapcaps` 选项可以帮助你完成交换按键的修改。这个修改包含两部分:
1. 弄清楚命令的用法;
2. 找出调用命令的位置,以便在桌面启动时激活它。
第一部分非常简单,命令是:
```
/usr/bin/setxkbmap -option "ctrl:nocaps"
```
在终端窗口中执行此命令,以确保结果符合你的预期。
假设上述命令有效,应该在哪里调用此命令呢?这需要一些实验。一种可能是在用户主目录的 `.profile` 文件中;另一个可能是将命令添加到 Xfce 的自启动配置在设置管理器中查找“Session and Startup”里。
还有一种可能性是在文件 `/etc/default/keyboard` 中使用相同的选项,最终可能看起来像这样:
```
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS="ctrl:swapcaps"
BACKSPACE="guess"
```
注意,这个更改将影响所有用户,因此如果你和其他人共享计算机,请准备好进行一些说明。此外,系统更新可能会覆盖此文件,因此如果你的设置失效了,就需要再次编辑它。将相同的信息放在用户主目录中的 `.keyboard` 文件内,可以为每个用户进行设置。
最后请注意,这些更改需要重新启动 Xfce除非在终端窗口中的命令行上运行但这在会话结束之后便会失效
### LXQt 和其他桌面环境
我没有用过 [LXQt][7],但根据我使用 [LXDE][8] 的经验,我会尝试上面用于 Xfce 的方法。我也希望适用于 Xfce 的方法可以用于其他 Linux 桌面环境。当然了,在其他桌面环境上遇到问题的时候,可以通过你最喜欢的搜索引擎来查找解决办法。
### 控制台
我没有在控制台上进行过尝试,因为我很少有机会与控制台(你在服务器上看到的或你的窗口系统没有正确显示时出现的界面)进行交互。上面给出的方法以人们希望的方式(即与其他应用程序一致)调整终端窗口。
但是,如果像上面一样已经编辑了 `/etc/default/keyboard` 文件或 `〜/.keyboard`,则实用程序 `setupcon` 可以用于更改控制台的键盘设置,以便实现相同的功能。[链接 1][9]、[链接 2][10] 和 [链接 3][11] 给出了一些关于如何从这两个文件实现这些更改的想法。第三个链接还讨论了使用 `dumpkeys``loadkeys` 来实现想要的效果。[setupcon 的手册][12] 简短而重要,值得阅读,再结合上面 StackExchange 问题的一些评论,应该足以得到一个解决办法。
### 其他环境
最后,上面 StackExchange 的链接中提到的这一点值得强调--配置控制台与配置终端窗口不同;如前所述,后者是通过桌面管理器进行配置的。
`setxkbmap`、`xkeyboard-config`、`keyboard`、`console-setup` 和 `setupcon` 命令的手册都是有用的参考资料。或者,如果你不喜欢阅读手册,可以看一下 [这篇极好的文章][13]。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keyboard
作者:[Chris Hermansen][a]
选题:[lujun9972][b]
译者:[jlztan](https://github.com/jlztan)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/clhermansen
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Control_key
[2]: https://www.gnome.org/gnome-3/
[3]: https://wiki.gnome.org/Apps/Tweaks
[4]: https://www.kde.org/
[5]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life
[6]: https://www.xfce.org/
[7]: https://lxqt.org/
[8]: https://lxde.org/
[9]: https://askubuntu.com/questions/485454/how-to-remap-keys-on-a-user-level-both-with-and-without-x
[10]: https://unix.stackexchange.com/questions/198791/how-do-i-permanently-change-the-console-tty-font-type-so-it-holds-after-reboot
[11]: https://superuser.com/questions/290115/how-to-change-console-keymap-in-linux
[12]: http://man.he.net/man1/setupcon
[13]: http://www.noah.org/wiki/CapsLock_Remap_Howto