Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2020-01-13 08:51:50 +08:00
commit 8e9e57b9a3
2 changed files with 165 additions and 0 deletions

View File

@ -0,0 +1,60 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Use Stow for configuration management of multiple machines)
[#]: via: (https://opensource.com/article/20/1/configuration-management-stow)
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney)
Use Stow for configuration management of multiple machines
======
Learn how to use Stow to manage configurations across machines in the
second article in our series on 20 ways to be more productive with open
source in 2020.
![A person programming][1]
Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using.
### Manage symlinks with Stow
Yesterday, I explained how I keep my files in sync across multiple machines with [Syncthing][2]. But that's only one of the tools I use to keep my configurations consistent. The other is a seemingly simple tool called [Stow][3].
![Stow help screen][4]
Stow manages symlinks. By default, it makes symlinks from the directory it is in to the directory below it. There are also options to set a source and target directory, but I don't usually use them.
As I mentioned in the Syncthing [article][5], I use Syncthing to keep a directory called **myconfigs** consistent across all of my machines. The **myconfigs** directory has several subdirectories underneath it. Each subdirectory contains the configuration files for one of the applications I use regularly.
![myconfigs directory][6]
On each machine, I change to the **myconfigs** directory and run **stow -S <directory name>** to symlink the files inside the directory to my home directory. For example, under the **vim** directory, I have my **.vimrc** and **.vim** directories. On each machine, I run **stow -S vim** to create the symlinks **~/.vimrc** and **~/.vim**. When I make a change to my Vim configuration on one machine, it applies to ALL of my machines.
Sometimes, though, I need something machine-specific, which is why I have directories like **msmtp-personal** and **msmtp-elastic** (my employer). Since my **msmtp** SMTP client needs to know what email server to relay through, and each one has different setups and credentials, I can use Stow to swap between the two by "unstowing" one with the **-D** flag and then putting the other in place.
![Unstow one, stow the other][7]
Sometimes I find myself adding files to a configuration. For that, there is the "restow" option with **-R**. For example, I like to use a specific font when I use Vim as a graphical application and not a console. The **.gvimrc** file lets me set options that apply only to the graphical version, in addition to the standard **.vimrc** file. When I first set this up, I moved **~/.gvimrc** to **~/myconfigs/vim** and then ran **stow -R vim**, which unlinks and relinks everything in that directory.
Stow lets me switch between several configurations with a simple command line and, in combination with Syncthing, I can be sure that I have the setup I like for the tools I use ready to go, no matter where I am or where I make changes.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/configuration-management-stow
作者:[Kevin Sonney][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/ksonney
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming)
[2]: https://syncthing.net/
[3]: https://www.gnu.org/software/stow/
[4]: https://opensource.com/sites/default/files/uploads/productivity_2-1.png (Stow help screen)
[5]: https://opensource.com/article/20/1/20-productivity-tools-syncthing
[6]: https://opensource.com/sites/default/files/uploads/productivity_2-2.png (myconfigs directory)
[7]: https://opensource.com/sites/default/files/uploads/productivity_2-3.png (Unstow one, stow the other)

View File

@ -0,0 +1,105 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What I learned going from prison to Python)
[#]: via: (https://opensource.com/article/20/1/prison-to-python)
[#]: author: (Shadeed "Sha" Wallace-Stepter https://opensource.com/users/shastepter)
What I learned going from prison to Python
======
How open source programming can offer opportunities after incarceration.
![Programming books on a shelf][1]
Less than a year ago, I was in San Quentin State Prison serving a life sentence.
In my junior year in high school, I shot a man while robbing him. Now, it took a while for me to see or even admit that what I did was wrong, but after going through a jury trial and seeing the devastating consequences of my actions, I knew that I needed to make a change, and I did. And although it was a great thing that I had changed, I had still shot a man and nearly killed him. And there are consequences to doing something like that, and rightfully so. So at the age of 18, I was sentenced to life in prison.
Now prison is a terrible place; I do not recommend it. But I had to go and so I went. Ill spare you the details, but you can rest assured its a place where there isnt much incentive to change, and many people pick up more bad habits than they went in with.
Im one of the lucky ones. While I was in prison, something different happened. I started to imagine a future for myself beyond the prison bars where, up until that point, I had spent all of my adult life.
Now YOU think about this: Im black, with nothing more than a high school education. I had no work history, and if I ever were to leave prison, I would be a convicted felon upon my release. And I think Im being fair when I say that the first thought for an employer who sees this profile is not "I need to hire this person."
My options werent clear, but my mind was made up. I needed to do something to survive that wouldnt look anything like my life before prison.
### A path to Python
Eventually, I wound up in San Quentin State Prison, and I had no idea how lucky I was to be there. San Quentin offered several self-help and education programs. These [rehabilitation opportunities][2] ensured prisoners had skills that helped them avoid being repeat offenders upon release.
As part of one of these programs, I met [Jessica McKellar][3] in 2017 through her work with the San Quentin Media Program. Jessica is an enthusiast of the programming language [Python][4], and she started to sell me on how great Python is and how its the perfect language to learn for someone just starting out. And this is where the story becomes stranger than fiction.
 
> Thanks [@northbaypython][5] for letting [@ShaStepter][6] and me reprise our [@pycon][7] keynotes to get them recorded. I'm honored to share:
>
> From Prison to Python: <https://t.co/rcumoAgZHm>
>
> Mass Decarceration: If We Don't Hire People With Felony Convictions, Who Will? <https://t.co/fENDUFdxfX> [pic.twitter.com/Kpjo8d3ul6][8]
>
> — Jessica McKellar (@jessicamckellar) [November 5, 2019][9]
 
Jessica told me about these Python video tutorials that she did for a company called [OReilly Media][10], that they were online, and how great it would be if I could get access to them. Unfortunately, internet access in prison isnt a thing. But, I had met this guy named Tim OReilly, who had recently come to San Quentin. It turns out that, after his visit, Tim had donated a ton of content from his company, OReilly Media, to the prisons programming class. I wound up getting my hands on a tablet that had Jessicas Python tutorials on it and learned how to code using those Python tutorials.
It was incredible. Total strangers with a very different background and life from my own had connected the dots in a way that led to me learning to code.
### The love of the Python community
After this point, I started meeting with Jessica pretty frequently, and she began to tell me about the open source community. What I learned is that, on a fundamental level, open source is about fellowship and collaboration. It works so well because no one is excluded.
And for me, someone who struggled to see where they fit, what I saw was a very basic form of love—love by way of collaboration and acceptance, love by way of access, love by way of inclusion. And my spirit yearned to be a part of it. So I continued my education with Python, and, unfortunately, I wasnt able to get more tutorials, but I was able to draw from the vast wealth of written knowledge that has been compiled by the open source community. I read anything that even mentioned Python, from paperback books to obscure magazine articles, and I used the tablet that I had to solve the Python problems that I read about.
My passion for Python and programming wasnt something that many of my peers shared. Aside from the very small group of people who were in the prisons programming class, no one else that I knew had ever mentioned programming; its just not on the average prisoners radar. I believe that this is due to the perception that programming isnt accessible to people who have experienced incarceration, especially if you are a person of color.
### Life with Python outside of prison
Then, on August 17, 2018, I got the surprise of my life. Then-Governor Jerry Brown commuted my 27-years-to-life sentence, and I was released from prison after serving almost 19 years.
But heres the reality of my situation and why I believe that programming and the open source community are so valuable. I am a 37-year-old, black, convicted felon, with no work history, who just served 18 years in prison. There arent many professions that exist that would prevent me from being at the mercy of the stigmas and biases that inevitably accompany my criminal past. But one of the few exceptions is programming.
The people who are now returning back to society after incarceration are in desperate need of inclusion, but when the conversation turns to diversity in the workplace and how much its needed, you really dont hear this group being mentioned or included.
 
> What else:
>
> 1\. Background checks: ask how they are used at your company.
>
> 2\. Entry-level roles: remove fake, unnecessary prerequisites that will exclude qualified people with records.
>
> 3\. Active outreach: partner with local re-entry programs to create hiring pipelines. [pic.twitter.com/WnzdEUTuxr][11]
>
> — Jessica McKellar (@jessicamckellar) [May 12, 2019][12]
 
So with that, I want to humbly challenge all of the programmers and members of the open source community to expand your thinking around inclusion and diversity. I proudly stand before you today as the representative of a demographic that most people dont think about—formerly incarcerated people. But we exist, and we are eager to prove our value, and, above all else, we are looking to be accepted. Many challenges await us upon our reentry back into society, and I ask that you allow us to have the opportunity to demonstrate our worth. Welcome us, accept us, and, more than anything else, include us.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/prison-to-python
作者:[Shadeed "Sha" Wallace-Stepter][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/shastepter
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_programming_languages.jpg?itok=KJcdnXM2 (Programming books on a shelf)
[2]: https://www.dailycal.org/2019/02/27/san-quentin-rehabilitation-programs-offer-inmates-education-a-voice/
[3]: https://twitter.com/jessicamckellar?lang=en
[4]: https://www.python.org/
[5]: https://twitter.com/northbaypython?ref_src=twsrc%5Etfw
[6]: https://twitter.com/ShaStepter?ref_src=twsrc%5Etfw
[7]: https://twitter.com/pycon?ref_src=twsrc%5Etfw
[8]: https://t.co/Kpjo8d3ul6
[9]: https://twitter.com/jessicamckellar/status/1191601209917837312?ref_src=twsrc%5Etfw
[10]: http://shop.oreilly.com/product/110000448.do
[11]: https://t.co/WnzdEUTuxr
[12]: https://twitter.com/jessicamckellar/status/1127640222504636416?ref_src=twsrc%5Etfw