每天推薦一個 GitHub 優質開源項目和一篇精選英文科技或編程文章原文,歡迎關注開源日報。交流QQ群:202790710;微博:https://weibo.com/openingsource;電報群 https://t.me/OpeningSourceOrg


今日推薦開源項目:《VS Code 使用者的福音 awesome-vscode》傳送門:GitHub鏈接

推薦理由:這個項目里記錄了非常多的 VSCode 中有用的工具和資源,不僅有在使用各種語言比如 C++ 和 Python 的編程中有用的工具,還有關於 Git 和資料庫的——你甚至能直接在 VSCode 中就查看你的資料庫。如果你是 VSCode 的使用者,那麼這裡面就可能有一些能夠給你提供便利的工具。


今日推薦英文原文:《How to bring good fortune to your Linux terminal》作者:

原文鏈接:https://opensource.com/article/18/12/linux-toy-fortune

推薦理由:Linux 命令行里的一個小玩具 —— 興許在你沒事可做或者想轉移一下注意力的時候可以玩一玩

How to bring good fortune to your Linux terminal

It's December, and if you haven't found a tech advent calendar that sparks your fancy yet, well, maybe this one will do the trick. Every day, from now to the 24th, we're bringing you a different Linux command-line toy. What's a command-line toy, you ask? It could be a game or any simple diversion to bring a little happiness to your terminal.

You may have seen some of these before. We hope you'll find something new, too. Either way, we hope you have fun following along.Today's toy, fortune, is an old one. Versions of it date back to the 1980s when it was included with Unix. The version I installed in Fedora was available under a BSD license, and I grabbed it with the following.

$ sudo dnf install fortune-mod -y

Your distribution may be different. On some, you may need to install the fortunes separately from fortune itself (try searching your package manager for "fortunes*"). You can also check out the source code on GitHub. Then, just run fortune to get, well, a fortune.

$ fortune
"Time is an illusion. Lunchtime doubly so."
-- Ford Prefect, _Hitchhiker's Guide to the Galaxy_

So why do you need fortunes at the terminal? For fun, of course. Perhaps you'd like to add them to the message of the day on your system?

Personally, I like using the fortune command as a built-in piece of dummy data when I'm using the terminal to parse text, particularly with regular expressions, and want something simple to try it out on.

For example, let's say I was testing our a transformation with the tr command to replace letter the letter e with a numeral 3.

$ fortune | tr 'eE' '3'
Unix 3xpr3ss:
All pass3ng3r bring a pi3c3 of th3 a3roplan3 and a box of tools with th3m to
th3 airport. Th3y gath3r on th3 tarmac, arguing constantly about what kind
of plan3 th3y want to build and how to put it tog3th3r. 3v3ntually, th3
pass3ng3rs split into groups and build s3v3ral diff3r3nt aircraft, but giv3
th3m all th3 sam3 nam3. Som3 pass3ng3rs actually r3ach th3ir d3stinations.
All pass3ng3rs b3li3v3 th3y got th3r3.

So what fortunes come with your distribution? Take a look in your /usr/share/games/fortune directory to find them all. Here are a few of my favorites.

Never laugh at live dragons.
-- Bilbo Baggins [J.R.R. Tolkien, "The Hobbit"]
I dunno, I dream in Perl sometimes...
-- Larry Wall in <8538@jpl-devvax.JPL.NASA.GOV>
I have an existential map. It has "You are here" written all over it.
-- Steven Wright

Looking for more on fortune? You can, of course, always check out the man page to learn more about the options, or read a little bit more about the history of the command on Wikipedia.

Do you have a favorite command-line toy that you think I ought to profile? 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, Drive a locomotive through your Linux terminal, and check back tomorrow for another!


每天推薦一個 GitHub 優質開源項目和一篇精選英文科技或編程文章原文,歡迎關注開源日報。交流QQ群:202790710;微博:https://weibo.com/openingsource;電報群 https://t.me/OpeningSourceOrg