Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang
2021-01-10 12:34:41 +08:00
3 changed files with 163 additions and 77 deletions

View File

@@ -1,77 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (A minimalist Mac terminal for Linux fans)
[#]: via: (https://opensource.com/article/20/6/iterm2-mac)
[#]: author: (Lisa Seelye https://opensource.com/users/lisa)
A minimalist Mac terminal for Linux fans
======
Here is how I keep a terminal simple and my dotfiles secure through a
lot of subtle complexity.
![Coffee and laptop][1]
I have a confession to make: I have been a Mac user for more than 10 years now. At first, I felt a little shame, given my strong Linux background, but the Mac gives me a Unix-like shell and a great window manager. Because of that history, I have a mix of features that will run on macOS but feel familiar to Linux users. There's no reason it can't port over to Linux (and it has!).
### Using iTerm2 on a Mac
For a long time, my preferred terminal was the basic built-in Terminal.app, but I recently switched to [iTerm2][2] because it has much better customization and profile support. One of its key wins for me is that it's easy to transplant settings from Mac to Mac. For daily use, I prefer the Solarized Dark theme, but for presentations, I have a separate profile that enlarges the text and uses a plain black background with more vibrant colors.
The first thing I do to make iTerm2 usable is to configure the **Ctrl+Left** and **Ctrl+Right** arrows to respect the classic terminal behavior of jumping to the start and end of a word boundary. To do so, navigate to Preferences > Profiles > Your Profile > Keys and enter the following.
* Keyboard Shortcut: ^←
* Action: Send Escape Sequence
* Esc+: b
Then the other: 
* Keyboard Shortcut: ^→
* Action: Send Escape Sequence
* Esc+: f
Learn more about what you can do with [iTerm2][3] and enjoy the custom experience.
### A simple command prompt
I am one of those boring terminal prompt users. I don't include Git directory or exit code, and I only use a single line. The only fancy component I use is [kubectx][4], which includes the current Kubernetes context. As an [OpenShift Dedicated][5] Site Reliability Engineer (SRE), I have to run commands with the appropriate context, and `kubectx` makes it easy to know where I am when I'm typing. So, my Bash PS1 is the boring `username@host cwd $`, save for the Kubernetes context prefix.
There is no doubt that I'm on the minimalist side, compared to some fancy terminals I've seen. Some people enjoy transparency, and others prefer a lot of information on their prompts—from the time to the exit code and everything else. I find it distracting in my terminals, so I enjoy those setups from afar.
### Beautifully complex dotfiles
Compared to my minimalist terminal, it's easy to see where I put my maximalist efforts: deploying my [dotfiles][6], including my `.bash_profile` and my overall Mac setup.
I use a [series of Makefiles][7], hosted through GitHub, to manage my Mac setup. This pulls in my [dotfile-specific deployment mechanism][8], which is also in GitHub. Why all the tooling around security you ask? IT professionals and hobbyists alike need a robust way to put secure pieces of data on new systems. Maybe you prefer your SSH config to be hidden, or maybe you're deploying credentials through a third-party system. I find it useful to keep my secure data with everything else, and I solved this problem with [Ansible Vault][9]. All my secrets are stored in Git, encrypted with Ansible Vault. Decryption is handled with Makefiles.
Whether I'm installing for the first time or updating existing dotfiles, I (of course) must have Ansible Vault, and to avoid having to install that everywhere, I put it in a container that I run with Docker, which I do have installed everywhere. I put the decryption passphrase into a file, `run make`, and clean up everything with `make clean`. (You can learn more by [exploring the dotfiles][8].)
I will say that this management scheme may be over the top, but some folks like complicated terminal prompts. So perhaps in the balance, it all evens out.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/6/iterm2-mac
作者:[Lisa Seelye][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/lisa
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_cafe_brew_laptop_desktop.jpg?itok=G-n1o1-o (Coffee and laptop)
[2]: https://www.iterm2.com/
[3]: https://www.iterm2.com/documentation.html
[4]: https://github.com/ahmetb/kubectx
[5]: https://www.openshift.com/products/dedicated/
[6]: https://opensource.com/article/19/3/move-your-dotfiles-version-control
[7]: https://github.com/lisa/mac-setup
[8]: https://github.com/lisa/dotrc
[9]: https://docs.ansible.com/ansible/latest/user_guide/vault.html

View File

@@ -0,0 +1,89 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Catch up on these 4 virtual events from 2020)
[#]: via: (https://opensource.com/article/21/1/virtual-events-2020)
[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb)
Catch up on these 4 virtual events from 2020
======
In case you missed them, you can still watch the recordings.
![Two people chatting via a video conference app][1]
Like nearly everyone, 2020 was a bit rough on me, with many unexpected changes. That meant I missed every single event this year, even though all of them were virtual. As things settled down a bit over the holidays, I started looking around to find out what I missed.
In case you're in the same position, I'll walk you through the virtual events that you should have seen in 2020. The good news is, since they were all virtual, you can still watch them.
### Kubecon 2020: North America
I'll start with the [Cloud Native Computing Foundation][2] (CNCF) event of the year, KubeCon. The all-about-Kubernetes conference in November included some amazing new announcements, such as:
* A brand new security certification called [Kubernetes Security Specialist][3] (CKS) is available.
* The Kubernetes release cycle will slow down, so everyone can catch up.
* [GitOps][4] is at the forefront, with new tools and a new group to make it easier.
* Inclusion and community growth will be the focus moving forward.
Watch the [videos from CNCF][5] on YouTube.
### All Things Open 2020: Raleigh
After [Open Source 101][6] moved online in May, the All Things Open (ATO) crew worked hard to move October's full ATO conference virtual, streaming the event directly from Raleigh, N.C. Many people (maybe especially those of us who live locally) were sad that we couldn't meet our friends in person, but the event was still great. The virtual nature actually made it easier to spread myself further to see everything.
Since everything is broken into tracks, you can go to classes based on your interest. ATO offered more than just post-event videos; check out the offerings in this list of links:
* [Videos to watch][7]
* [Shared slides and presentations][8]
* [A complete list of talks and links][9]
* [A really cool summary of the event][10]
### DockerCon 2020
In June, DockerCon ran a set of tracks based on containerization-related topics. It is always hard to follow all of the tracks in person, and the videos break down each one to give you a wider range of things to watch. Here is a list of cool things to see:
* [A list of the top-rated sessions with summaries][11]
* [The videos set up by track][12]
* [That's a wrap!][13] event summary
### Open Source Summit 2020
The Linux Foundation also held its Open Source Summit virtually in September. There were 14 separate tracks over four days, which would have been overwhelming in person. Once again, I am grateful for the online format that breaks out the tracks. Check out the [playlist of the 2020 presentations][14].
### Catch up
Check out these videos to catch up on what the open source community has been doing. I'm still working through a bunch of these videos and presentations to make sure I know what's going on in these communities and what new things are coming. The new announcements and shared education are exciting to see after such a crazy year.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/1/virtual-events-2020
作者:[Jessica Cherry][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/cherrybomb
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chat_video_conference_talk_team.png?itok=t2_7fEH0 (Two people chatting via a video conference app)
[2]: https://www.cncf.io/
[3]: https://www.cncf.io/certification/cks/
[4]: https://about.gitlab.com/topics/gitops/
[5]: https://www.youtube.com/playlist?list=PLj6h78yzYM2Pn8RxfLh2qrXBDftr6Qjut
[6]: https://www.youtube.com/playlist?list=PL6kQg8bP1Ji4FJraKIioIYwEV4Meuvrn0
[7]: https://www.youtube.com/c/AllThingsOpen/playlists?view=58
[8]: https://www2.slideshare.net/AllThingsOpen/presentations
[9]: https://2020.allthingsopen.org/day-1-monday-oct-19-talk-recordings-now-live/
[10]: https://2020.allthingsopen.org/ato-2020-summary-an-incredible-year-in-so-many-ways/
[11]: https://www.docker.com/blog/dockercon-2020-top-rated-sessions-the-fundamentals/
[12]: https://www.youtube.com/c/DockerIo/playlists
[13]: https://www.docker.com/blog/dockercon-2020-and-thats-a-wrap/
[14]: https://www.youtube.com/playlist?list=PLbzoR-pLrL6oyIqGsEZdb1E4pWzWn9qOZ

View File

@@ -0,0 +1,74 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (A minimalist Mac terminal for Linux fans)
[#]: via: (https://opensource.com/article/20/6/iterm2-mac)
[#]: author: (Lisa Seelye https://opensource.com/users/lisa)
为 Linux 爱好者打造的极简 Mac 终端
======
> 以下是我如何通过很多微妙复杂的方式来保持终端的简单和我的点文件的安全。
![咖啡和笔记本][1]
我要向大家坦白。我成为 Mac 用户已经有 10 多年了。起初,鉴于我强大的 Linux 背景,我觉得有点惭愧,但 Mac 给了我一个类似 Unix 的 Shell 和一个伟大的窗口管理器。因为这段历史,我有一个合二为一的功能,它运行在 macOS 上,但又为 Linux 用户所熟悉。没有理由它不能移植到 Linux 上(而且它已经移植了!)。
### 在 Mac 上使用 iTerm2
很长时间以来,我首选的终端是基本的内置 Term.app但我最近改用了 [iTerm2][2],因为它有更好的自定义和配置文件支持。对我来说,它的一个主要优点是可以轻松地在 Mac 之间移植配置。对于日常使用,我更喜欢 Solarized Dark 主题;但对于演示文稿,我有一个单独的配置文件,可以放大文本,并使用色彩更鲜艳的纯黑色背景。
要使 iTerm2 可用,我首先要做的是配置 `Ctrl+Left``Ctrl+Right` 箭头,使其尊重经典的终端行为,即跳转到单词边界的开始和结束。要做到这一点,请导航到 “Preferences > Profiles > Your Profile > Keys” 并输入以下内容:
* 键盘快捷键:`^←`
* 行动:发送 Escape 序列
* Esc+`b`
然后是另一个:
* 键盘快捷键:`^→`
* 行动:发送 Escape 序列
* Esc+`f`
了解更多关于 [iTerm2][3] 的内容,享受自定义体验。
### 一个简单的命令提示符
我是那种无聊的终端提示符用户。我不想在其中包含 Git 目录或退出代码,我也只用单行提示符。我唯一使用的花哨组件是 [kubectx][4] ,它包括当前的 Kubernetes 上下文。作为一位 [OpenShift Dedicated][5] 的站点可靠性工程师SRE我必须在运行命令时有相应的上下文`kubectx` 让我在打字时很容易知道自己在哪里。所以,我的 Bash PS1 就是无聊的 `username@host cwd $`,免除了 Kubernetes 上下文前缀。LCTT 译注:如果想将 Kubernetes 上下文和名字空间显示在 PS1可以看看 [kube-ps1](https://github.com/jonmosco/kube-ps1)。)
毫无疑问,与我见过的一些花哨的终端相比,我是偏向于极简的。有些人喜欢透明背景,有些人则喜欢他们的提示符上有很多信息 —— 从时间到退出代码以及其他一切。我觉得这些在我的终端上会让人分心,所以我很喜欢远离的那些设置。
### 精美复杂的点文件
与我的极简主义终端相比,很容易看出我在哪里投入了最大的努力:部署我的[点文件][6],包括我的 `.bash_profile` 和我的整体 Mac 设置。
我使用通过 GitHub 托管的 [一系列 Makefile][7] 来管理我的 Mac 设置。这将会拉取我的[点文件专用部署机制][8],它也在 GitHub 上。你要问为什么要围绕安全做这些工具IT 专业人士和业余爱好者都需要一种强大的方式来将安全的数据片段放在新系统上。也许你想要你的 SSH 配置是隐藏的,或者你通过第三方系统部署凭证。我发现把我的安全数据和其他一切数据放在一起是很有用的,我用 [Ansible Vault][9] 解决了这个问题。我所有的机密信息都存储在 Git 中,用 Ansible Vault 加密。解密是用 Makefile 处理的。
无论是第一次安装还是更新现有的点文件,我(当然)都必须有 Ansible Vault为了避免到处安装我把它放在一个用 Docker 运行的容器里,这样我就到处都安装好了。我把解密口令放到一个文件中, `run make`,然后用 `make clean` 清理一切。你可以通过[探索这些点文件][8]来了解更多)。
我想说的是,这种管理方案可能过于夸张,而有些人喜欢复杂的终端提示。所以,也许在权衡之下,一切都会变得平衡。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/6/iterm2-mac
作者:[Lisa Seelye][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/lisa
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_cafe_brew_laptop_desktop.jpg?itok=G-n1o1-o (Coffee and laptop)
[2]: https://www.iterm2.com/
[3]: https://www.iterm2.com/documentation.html
[4]: https://github.com/ahmetb/kubectx
[5]: https://www.openshift.com/products/dedicated/
[6]: https://opensource.com/article/19/3/move-your-dotfiles-version-control
[7]: https://github.com/lisa/mac-setup
[8]: https://github.com/lisa/dotrc
[9]: https://docs.ansible.com/ansible/latest/user_guide/vault.html