From 9851e3d4e312dc293f57ef9d43d5ec7a1da8d441 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Mon, 25 Oct 2021 17:39:48 +0800 Subject: [PATCH 01/56] translating --- ...ll Rust and Cargo on Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md b/sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md index b757160c7e..d2fd95e96b 100644 --- a/sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-rust-cargo-ubuntu-linux/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 4828c6b437de0a5e1a6b551508c671f77d272628 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 Oct 2021 05:02:30 +0800 Subject: [PATCH 02/56] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211026=20Fi?= =?UTF-8?q?xing=20=E2=80=9CUnable=20to=20acquire=20dpkg=20frontend=20lock.?= =?UTF-8?q?=20Are=20You=20Root=3F=E2=80=9D=20Error=20on=20Ubuntu=20and=20O?= =?UTF-8?q?ther=20Linux=20Distributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md --- ...on Ubuntu and Other Linux Distributions.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md b/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..c1b05e8b60 --- /dev/null +++ b/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md @@ -0,0 +1,114 @@ +[#]: subject: "Fixing “Unable to acquire dpkg frontend lock. Are You Root?” Error on Ubuntu and Other Linux Distributions" +[#]: via: "https://itsfoss.com/fixed-are-you-root-error/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fixing “Unable to acquire dpkg frontend lock. Are You Root?” Error on Ubuntu and Other Linux Distributions +====== + +I am presuming you are quite new to Linux. + +You follow some tutorial on the internet that tells you to install a certain program or run some command. Probably it is something to do with a server. + +But when you run the command, you encounter this error: + +**E: Could not open lock file /var/lib/dpkg/lock-frontend – open (13: Permission denied) +E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?** + +A similar error is this one: + +dpkg: error: required read/write access to the dpkg database directory /var/lib/dpkg +**E: Sub-process dpkg –set-selections returned an error code (2) +E: Executing dpkg failed. Are you root?** + +Both errors ask you the same question: are you root? And that’s the answer to this problem. Become root. + +### Become root to avoid this error + +How do you [become root in Ubuntu][1] or Debian? You use the sudo command. + +Yes, that’s it. Whatever command you were running, just add sudo before it. + +``` +sudo your_command +``` + +![Running command with sudo][2] + +It will ask you to enter your user account password. Please keep in mind that nothing gets displayed on the screen when you type the password and that’s okay. + +There is nothing wrong with your system. In most Linux systems, password typing doesn’t show the usual asterisks or anything of that sort as a ‘security feature’. + +Just type your password and press enter after it. If the password was typed correctly, you should be able to run the command now. + +You can even use this handy [Linux command line trick][3] to run a previous command with sudo: + +``` +sudo !! +``` + +That was simple and works immediately, unless you do not have sudo access. Then, you’ll see a different error. + +### Seeing a ‘User is not in sudoer file’ error? + +![Some users cannot run commands with sudo][4] + +When you [install Ubuntu][5], you have to create a user account. This user is automatically granted sudo power to run commands as root when required. + +This happens on Ubuntu desktop, not servers. Most server distributions will have a separate root account. If you create a regular account separately, you’ll have to add the user to sudoer so that this normal user can use sudo. + +In the screenshot above, I had created this additional user but did not add it to the sudo group. This means that user ‘prakash’ here does not have rights to use the sudo command and hence the system complains that ‘prakash is not in sudoers file’. + +#### Where is the incident reported? + +An incorrect sudo attempt is added to the system logs. It logs the user name, the virtual terminal number, location from where the command was run and which command was run. + +![Incorrect sudo attempts are logged into the system][6] + +The location of these logs differ from distribution to distribution. + +Normally, you may find it in journalctl logs or /var/log/auth.log file in Ubuntu, /var/log/audit/audit.log file in Fedora. + +#### What can you do if a user is not in sudoer list? + +What can you do when you cannot use sudo with the current user account? First, [verify if the user has sudo rights or not. If not, here are some options for][7] you: + + * Log in as root or switch to root (if you have root password). + * [Add the user into sudoer list][8] (if you have admin/sudo rights from some other user account). + * If you are in multi-user Linux system and do not have root or sudo access yourself, ask your sytem administrator to either grant your user sudo access or install the application you wanted to install. + + + +### Did this help? + +Sudo is a very comprehensive security mechanism, and it is much more than just allowing a normal user to become root. It helps in auditing the system to know which user ran which command with sudo. It can also be configured to allow a certain user to run only certain commands with sudo. + +You won’t see such granular sudo configuration on desktop Linux where it is preconfigured to allow any user in the sudo group to run any command as root with sudo. More on sudo in some other article. + +I hope while solving this classic beginner problem, you get some initial insights into the sudo command. Let me know if you have further questions on this topic in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fixed-are-you-root-error/ + +作者:[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://itsfoss.com/root-user-ubuntu/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/running-commands-with-sudo.webp?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/linux-command-tricks/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/not-in-sudoer-file-error-800x289.png?resize=800%2C289&ssl=1 +[5]: https://itsfoss.com/install-ubuntu/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/sudo-incident-reported.png?resize=800%2C339&ssl=1 +[7]: https://linuxhandbook.com/check-if-user-has-sudo-rights/ +[8]: https://linuxhandbook.com/create-sudo-user/ From b56a8bd3048125da9782e26d3b8cee5efc2a3403 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 Oct 2021 05:02:46 +0800 Subject: [PATCH 03/56] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211025=20Us?= =?UTF-8?q?e=20Rust=20for=20embedded=20development?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211025 Use Rust for embedded development.md --- ...11025 Use Rust for embedded development.md | 297 ++++++++++++++++++ 1 file changed, 297 insertions(+) create mode 100644 sources/tech/20211025 Use Rust for embedded development.md diff --git a/sources/tech/20211025 Use Rust for embedded development.md b/sources/tech/20211025 Use Rust for embedded development.md new file mode 100644 index 0000000000..07bcab63da --- /dev/null +++ b/sources/tech/20211025 Use Rust for embedded development.md @@ -0,0 +1,297 @@ +[#]: subject: "Use Rust for embedded development" +[#]: via: "https://opensource.com/article/21/10/rust-embedded-development" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use Rust for embedded development +====== +Rust's high performance, reliability, and productivity make it apt for +embedded systems. +![Ferris the crab under the sea, unofficial logo for Rust programming language][1] + +Over the past several years, Rust has gained a passionate following among programmers. Tech trends come and go, so it can be difficult to separate excitement just because something is new versus excitement over the merits of a technology, but I think Rust is a truly well-designed language. It aims to help developers build reliable and efficient software, and it was designed for that purpose from the ground up. There are key features you'll hear about Rust, and in this article, I demonstrate that many of these features are exactly why Rust also happens to be great for embedded systems. Here are some examples: + + * High performance: It's fast, with high memory utilization + * Reliability: Memory errors can be eliminated during compilation + * Productivity: Great documentation, a friendly compiler with useful error messages, and top-notch tooling. There's an integrated package manager and build tool, smart multi-editor support with auto-completion and type inspections, an auto-formatter, and more. + + + +### Why use Rust for embedded development? + +Rust is designed to guarantee both security and high performance. Embedded software can have problems, mostly due to memory. Rust is, in a way, a compiler-oriented language, so you can be sure that you're using memory safely while compiling. Here are some of the benefits of using Rust to develop on embedded devices: + + * Powerful static analysis + * Flexible memory + * Fearless concurrency + * Interoperability + * Portability + * Community-driven + + + +In this article, I use the open source [RT-Thread operating system][2] to demonstrate how to use Rust for embedded development. + +### How to call Rust in C + +When calling Rust code in C code, you must package the Rust source code as a static library file. When the C code compiles, link it in. + +#### Creating a static library with Rust + +There are two steps in this process. + +1\. Use `cargo init --lib rust_to_c` to build a lib library in Clion. Add the following code to the `lib.rs`. The following function evaluates the sum of two values of type **i32** and returns the result: + + +``` +#![no_std] +use core::panic::PanicInfo; + +#[no_mangle] +pub extern "C" fn sum(a: i32, b: i32) -> i32 { +    a + b +} + +#[panic_handler] +fn panic(_info:&PanicInfo) -> !{ +    loop{} +} +``` + +2\. Add the following code to your `Cargo.toml` file to tell Rustc what type of library to generate: + + +``` +[lib] +name = "sum" +crate-type = ["staticlib"] +path = "src/lib.rs" +``` + +#### Cross-compilation + +You can cross-compile for your target. Assuming your embedded system is Arm-based, the steps are simple: + + +``` +`$ rustup target add armv7a-none-eabi` +``` + +2\. Generate the static library file: + + +``` +$ cargo build --target=armv7a-none-eabi --release --verbose +Fresh rust_to_c v0.1.0 +Finished release [optimized] target(s) in 0.01s +``` + +#### Generate Header File + +You need header files, too. + +1\. Install [cbindgen][3]. The `cbindgen` tool generates a C or C++11 header file from the Rust library: + + +``` +`$ cargo install --force cbindgen` +``` + +2\. Create a new `cbindgen.toml` file under your project folder. + +3\. Generate a header file: + + +``` +`$ cbindgen --config cbindgen.toml --crate rust_to_c --output sum.h` +``` + +#### Call the Rust library file + +Now you can make calls to your Rust libraries. + +1\. Put the generated `sum.h` and `sum.a` files into the `rt-thread/bsp/qemu-vexpress-a9/applications` directory. + +2\. Modify the `SConscript` file and add a static library: + + +``` +   from building import * +    +   cwd     = GetCurrentDir() +   src     = Glob('*.c') + Glob('*.cpp') +   CPPPATH = [cwd] +    +   LIBS = ["libsum.a"] +   LIBPATH = [GetCurrentDir()] +    +   group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, LIBS = LIBS, LIBPATH = LIBPATH) +    +   Return('group') +``` + +3\. Call the **sum** function in the main function, get the return value, and `printf` the value. + + +``` +   #include <stdint.h> +   #include <stdio.h> +   #include <stdlib.h> +   #include <rtthread.h> +   #include "sum.h" +    +   int main(void) +   { +       int32_t tmp; +    +       tmp = sum(1, 2); +       printf("call rust sum(1, 2) = %d\n", tmp); +    +       return 0; +   } +``` + +4\. In the RT-Thread [Env][4] environment, use `scons` to compile the project and run: + + +``` +$ scons -j6 +scons: Reading SConscript files ... +scons: done reading SConscript files. +scons: Building targets ... +[...] +scons: done building targets. + +$ qemu.sh + \ | / +\- RT -     Thread Operating System + / | \     4.0.4 build Jul 28 2021 +2006 - 2021 Copyright by rt-thread team +lwIP-2.1.2 initialized! +[...] +call rust sum(1, 2) = 3 +``` + +### Add, subtract, multiply, and divide + +You can implement some complicated math in Rust. In the `lib.rs` file, use the Rust language to implement add, subtract, multiply, and divide: + + +``` +#![no_std] +use core::panic::PanicInfo; + +#[no_mangle] +pub extern "C" fn add(a: i32, b: i32) -> i32 { +    a + b +} + +#[no_mangle] +pub extern "C" fn subtract(a: i32, b: i32) -> i32 { +    a - b +} + +#[no_mangle] +pub extern "C" fn multiply(a: i32, b: i32) -> i32 { +    a * b +} + +#[no_mangle] +pub extern "C" fn divide(a: i32, b: i32) -> i32 { +    a / b +} + +#[panic_handler] +fn panic(_info:&PanicInfo) -> !{ +    loop{} +} +``` + +Build your library files and header files and place them in the application directory. Use `scons` to compile. If errors appear during linking, find the solution on the official [Github page][5]. + +Modify the `rtconfig.py` file, and add the link parameter `--allow-multiple-definition`: + + +``` +       DEVICE = ' -march=armv7-a -marm -msoft-float' +       CFLAGS = DEVICE + ' -Wall' +       AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__ -I.' +       LINK_SCRIPT = 'link.lds' +       LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors,--allow-multiple-definition'+\ +                         ' -T %s' % LINK_SCRIPT +    +       CPATH = '' +       LPATH = '' +``` + +Compile and run QEMU to see your work. + +### Call C in Rust + +Rust can be called in C code, but what about calling C in your Rust code? The following is an example of calling the `rt_kprintf` C function in Rust code. + +First, modify the `lib.rs` file: + + +``` +    // The imported rt-thread functions list +    extern "C" { +        pub fn rt_kprintf(format: *const u8, ...); +    } +    +    #[no_mangle] +    pub extern "C" fn add(a: i32, b: i32) -> i32 { +        unsafe { +            rt_kprintf(b"this is from rust\n" as *const u8); +        } +        a + b +    } +``` + +Next, generate the library file: + + +``` +$ cargo build --target=armv7a-none-eabi --release --verbose +Compiling rust_to_c v0.1.0 +Running `rustc --crate-name sum --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type staticlib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=a +Finished release [optimized] target(s) in 0.11s +``` + +And now, to run the code, copy the library files generated by Rust into the application directory and rebuild: + + +``` +$ scons -j6 scons: Reading SConscript files ... scons: done reading SConscript files. [...] +scons: Building targets ... scons: done building targets. +``` + +Run QEMU again to see the results in your embedded image. + +### You can have it all + +Using Rust for your embedded development gives you all the features of Rust without the need to sacrifice flexibility or stability. Try Rust on your embedded system today. For more information about the process of embedded Rust (and about RT-Thread itself), check out the RT-Thread project's [YouTube channel][6]. And remember, embedded can be open, too. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/rust-embedded-development + +作者:[Alan Smithee][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/alansmithee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rust_programming_crab_sea.png?itok=2eWLz8A5 (Ferris the crab under the sea, unofficial logo for Rust programming language) +[2]: https://github.com/RT-Thread/rt-thread +[3]: https://github.com/eqrion/cbindgen +[4]: https://www.rt-thread.io/download.html?download=Env +[5]: https://github.com/rust-lang/compiler-builtins/issues/353 +[6]: https://www.youtube.com/channel/UCdDHtIfSYPq4002r27ffqP From 3d21d3b61f19288760b341ff92ecd7f85faf5976 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 Oct 2021 05:03:08 +0800 Subject: [PATCH 04/56] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211025=20Th?= =?UTF-8?q?is=20Game=20Developer=20Loves=20the=20Linux=20Community=20for?= =?UTF-8?q?=20an=20Unusual=20Reason?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md --- ...e Linux Community for an Unusual Reason.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md diff --git a/sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md b/sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md new file mode 100644 index 0000000000..12fb0898ba --- /dev/null +++ b/sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md @@ -0,0 +1,97 @@ +[#]: subject: "This Game Developer Loves the Linux Community for an Unusual Reason" +[#]: via: "https://news.itsfoss.com/game-dev-loves-linux/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +This Game Developer Loves the Linux Community for an Unusual Reason +====== + +The Linux community, in general, is one of the most active and helpful communities out there. + +And, a significant chunk of that can also be toxic or aggressive to newbies or someone who tries to break traditions. + +However, a game developer seems to be appreciating the Linux community for complaining too much… + +Yes, you heard that right! But, that’s not the entire picture. Let me tell you more about it. + +### Reporting Bugs is Essential for Game Improvement + +Whether it is an indie game or a full-fledged AAA title, every game arrives with several bugs. + +For some studios, game testers try to spot the bugs before launch. But, no matter the effort, players will always notice something that the developers may not have. + +So, it is important for developers to work on the reported bugs for a better gaming experience. + +But, what if you do not get any bug reports even if the game encounters issues? + +Of course, you can invest a lot of time to find out the potential issues faced by players. Unfortunately, it is not possible to iron out everything yourself. + +This is why bug reports from players are an essential part of game development. + +And, to emphasize the importance of bug reports, the game developer of “**[ΔV: Rings of Saturn][1]**” shared some interesting information. + +### Linux Gamers Reported Over 38% Bug Reports With 5.8% Userbase + +![][2] + +Even though [gaming on Linux][3] is improving with the [addition of Easy Anti-Cheat, BattleEye][4], and many other new advancements, the user base is tiny when compared to Windows. + +However, the developer of “**ΔV: Rings of Saturn**” shares an insight where he mentions that out of all the players, Linux gamers reported a significant section of bugs considering the user base. + +![][5] + +Here’s what he said in a [Reddit thread][6]: + +> Percentages are easy to talk about, but when I read just them, I always wonder – what is the sample size? Is it small enough for the percentage to be just noise? +> +> As of today, I sold a little over 12,000 units of ΔV in total. 700 of these units were bought by Linux players. +> +> That’s 5.8%. I got 1040 bug reports in total, out of which roughly 400 are made by Linux players. That’s one report per 11.5 users on average, and one report per 1.75 Linux players. That’s right, an average Linux player will get you 650% more bug reports. + +Not just limited to the number of bug reports, most of the issues reported were well-detailed and could be reproduced or isolated with the details provided. + +So, the minority group of Linux gamers turns out to be more valuable in terms of giving feedback and helping improve the game compared to Windows users. + +Also, the issues spotted were hardly platform-specific. So, these reports will equally help gamers using Windows to play the game as well. + +The game developer adds: + +> It’s worth it to get the massive feedback boost and free, hundred-people strong QA team on your side. An invaluable asset for an independent game studio. + +Of course, no gamer is obliged to report errors in a game. But, this example highlighted by the game developer goes to show how passionate the Linux community can be along with the importance of bug reports. + +### Closing Thoughts + +Overall, I believe that you can always count on the Linux community. While some can be toxic, the majority of the users work towards helping each other and growing together as Linux users. + +What do you think about this particular insight of Linux users reporting more bug reports despite the number of users? Please don’t hesitate to share your thoughts in the comments down below. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/game-dev-loves-linux/ + +作者:[Ankush Das][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://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://store.steampowered.com/app/846030/V_Rings_of_Saturn/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://itsfoss.com/linux-gaming-guide/ +[4]: https://news.itsfoss.com/easy-anti-cheat-linux/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzNiIgd2lkdGg9Ijc2MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://www.reddit.com/r/gamedev/comments/qeqn3b/despite_having_just_58_sales_over_38_of_bug/ From 3e67e69c35c158062c1d83acc993c5f15b8bdcad Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 26 Oct 2021 08:47:43 +0800 Subject: [PATCH 05/56] translated --- ...ow to Convert a Webpage to PDF in Linux.md | 131 ----------------- ...ow to Convert a Webpage to PDF in Linux.md | 132 ++++++++++++++++++ 2 files changed, 132 insertions(+), 131 deletions(-) delete mode 100644 sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md create mode 100644 translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md diff --git a/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md b/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md deleted file mode 100644 index be817f5967..0000000000 --- a/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md +++ /dev/null @@ -1,131 +0,0 @@ -[#]: subject: "How to Convert a Webpage to PDF in Linux" -[#]: via: "https://itsfoss.com/convert-webpage-pdf-linux/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Convert a Webpage to PDF in Linux -====== - -Saving a webpage as a PDF comes in handy when you archive certain resources or use them for educational purposes. - -But, how do you convert a webpage to PDF in Linux? - -_**You can either choose to go the easy way out using the web browser (GUI) on every Linux distribution or use the terminal to turn a webpage into a PDF file.**_ - -Here, I shall mention both the methods to help you get the job done. - -### Method 1: Converting a Webpage to PDF Using Web Browser - -Even though I use Mozilla Firefox for this tutorial, you can do the same thing with any of the [best browsers available for Linux.][1] - -![][2] - -1\. Load up the webpage you want to convert. - -2\. Head to the browser menu to find the “**Print**” option or use the keyboard shortcut “**Ctrl + P**.” - -3\. By default, it should let you save it as a PDF. You need to hit “Save,” and choose the destination and save the webpage. - -![Save webpage as PDF in Mozilla Firefox][3] - -The one major problem with this simple approach is that it includes all the elements on the page. This may include comments, footer etc. You may use a PDF editor to remove parts of it but that’s an additional task. - -_**A better option is to utilize a browser extension like [Print Friendly][4]. It allows you to edit and remove parts of the webpage before downloading the PDF.**_ - -### Method 2: Converting a Webpage to PDF or Images Using the Terminal - -You probably already know that you can [browse internet in Linux terminal][5] and even [download files using the command line][6]. That’s not surprising considering you can do a lot more in the terminal, including downloading a webpage as PDF. - -A nifty open-source command-line tools **wkhtmltopdf** and **wkhtmltoimage** come to the rescue that lets you convert any HTML webpage to a PDF or image file. - -It utilizes the Qt WebKit rendering engine to get the task done. You can explore its [GitHub page][7] for more information. - -You should be able to install it from the default repository of your Linux distribution. For Ubuntu-based distros, you can type in the command: - -``` -sudo apt install wkhtmltopdf -``` - -It is pretty straightforward to use no matter whether you want to convert it to a PDF or image file: - -![][8] - -To convert a webpage into a PDF, type in: - -``` -wkhtmltopdf URL/domain filename.pdf -``` - -As an example, here’s how it would look: - -``` -wkhtmltopdf linuxmint.com mint.pdf -``` - -You can choose to use the complete URL as “** or use the domain name as shown in the example above. - -The file generated will be saved in the home directory by default. - -You also get a few exciting options when converting a webpage. - -For instance, you can **apply a grayscale filter to the PDF file**, **make multiple copies of the page** in the same file, and **exclude images** during conversion. - -The grayscale filter may not work on every webpage, but you can try that using the command: - -``` -wkhtmltopdf -g google.com googlepage.pdf -``` - -To make multiple copies of pages in the same PDF file, the command would be: - -``` -wkhtmltopdf --copies 2 linuxmint.com mint.pdf -``` - -And, if you want to exclude images from the web pages, just type: - -``` -wkhtmltopdf --no-images linuxmint.com mint.pdf -``` - -Additionally, if you want to convert a webpage as an image, the command would look like this: - -``` -wkhtmltoimage linuxmint.com mint.png -``` - -Note that unlike the GUI method using a browser, using these tools via the terminal has its limitation. It does not seem to convert web pages utilizing any <iframe> code snippets successfully. - -Sites like ours and even DuckDuckGo didn’t convert to PDF or an image. However, simple HTML sites like Linuxmint.com, Ubuntu.com, Google.com, worked like charm. - -### Wrapping Up - -To get the best results, saving a webpage as a PDF using a browser seems to be the way to go. But, if you want more options and go through the terminal, the **wkhtmltopdf** utility should come in handy. - -How do you prefer to convert web pages to PDF in Linux? Feel free to share your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/convert-webpage-pdf-linux/ - -作者:[Ankush Das][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/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/best-browsers-ubuntu-linux/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-save-webpage-pdf.png?resize=800%2C536&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-firefox-print-pdf-1.png?resize=602%2C584&ssl=1 -[4]: https://www.printfriendly.com/ -[5]: https://itsfoss.com/terminal-web-browsers/ -[6]: https://itsfoss.com/download-files-from-linux-terminal/ -[7]: https://github.com/wkhtmltopdf/wkhtmltopdf -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/htmltopdf-mint.png?resize=736%2C344&ssl=1 diff --git a/translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md b/translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md new file mode 100644 index 0000000000..252c46a043 --- /dev/null +++ b/translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md @@ -0,0 +1,132 @@ +[#]: subject: "How to Convert a Webpage to PDF in Linux" +[#]: via: "https://itsfoss.com/convert-webpage-pdf-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Linux 下将网页转换为 PDF 文件 +====== + +当你将某些资源存档或用于教育目的时,将网页保存为 PDF 是很方便的。 + +But, how do you convert a webpage to PDF in Linux? +但是,你如何在 Linux 中把一个网页转换成 PDF? + +_**你可以选择使用每个 Linux 发行版上的网页浏览器(GUI),或者使用终端将网页变成 PDF 文件。**_ + +在这里,我将提到这两种方法来帮助你完成工作。 + +### 方法 1:使用网页浏览器将网页转换为 PDF 文件 + +尽管我在本教程中使用的是 Mozilla Firefox,但你也可以用任何[可用于 Linux 的最佳浏览器][1]做同样的事情。 + +![][2] + +1\. 加载你想转换的网页。 + +2\. 在浏览器菜单中找到“**打印**”选项,或使用键盘快捷键 “**Ctrl + P**”。 + +3\. 默认情况下,它应该让你把它保存为 PDF。你需要点击“保存”,然后选择目的地并保存网页。 + +![Save webpage as PDF in Mozilla Firefox][3] + +这种简单方法的一个主要问题是,它包括页面上的所有元素。这可能包括评论、页脚等。你可以用一个 PDF 编辑器来删除部分内容,但这是一个额外的任务。 + +_**更好的选择是利用一个浏览器扩展,如 [Print Friendly][4]。它允许你在下载 PDF 之前编辑和删除网页的部分内容**_。 + +### 方法 2:使用终端将网页转换为 PDF 或图片 + +你可能已经知道,你可以[在 Linux 终端浏览互联网][5],甚至[使用命令行下载文件][6]。这并不奇怪,因为你可以在终端中做更多的事情,包括将网页下载为 PDF。 + +一个灵巧的开源命令行工具 **wkhtmltopdf** 和 **wkhtmltoimage** 来拯救你,让你把任何 HTML 网页转换成 PDF 或图像文件。 + +它使用 Qt WebKit 渲染引擎来完成这个任务。你可以浏览它的 [GitHub页面][7] 了解更多信息。 + +你应该能够从你的 Linux 发行版的默认仓库中安装它。对于基于 Ubuntu 的发行版,你可以输入以下命令: + +``` +sudo apt install wkhtmltopdf +``` + +无论你想把它转换为 PDF 还是图像文件,它的使用都是非常直接的: + +![][8] + +要将一个网页转换成 PDF,请输入: + +``` +wkhtmltopdf URL/domain filename.pdf +``` + +比如,类似于这样: + +``` +wkhtmltopdf linuxmint.com mint.pdf +``` + +你可以选择使用 “****” 完整的 URL 或使用域名,如上面的例子所示。 + +默认情况下,生成的文件将保存在主目录下。 + +在转换网页时,你还可以得到一些令人兴奋的选项。 + +例如,你可以**对 PDF 文件应用灰度过滤器**,在同一文件中**制作多个页面副本**,以及在转换过程中**排除**图像。 + +灰度过滤器不一定对每个网页都有效,但你可以用命令试试: + +``` +wkhtmltopdf -g google.com googlepage.pdf +``` + +要在同一个 PDF 文件中复制多个页面,命令是: + +``` +wkhtmltopdf --copies 2 linuxmint.com mint.pdf +``` + +而且,如果你想排除网页中的图像,只需输入: + +``` +wkhtmltopdf --no-images linuxmint.com mint.pdf +``` + +此外,如果你想把一个网页转换为图像,命令是这样的: + +``` +wkhtmltoimage linuxmint.com mint.png +``` + +注意,与使用浏览器的 GUI 方法不同,通过终端使用这些工具有其局限性。它似乎不能成功转换利用任何 <iframe> 代码片段的网页。 + +像我们的网站,甚至 DuckDuckGo 都没有转换为 PDF 或图像。然而,简单的 HTML 网站,如 Linuxmint.com、Ubuntu.com、Google.com 则非常有效。 + +### 总结 + +为了得到最好的结果,使用浏览器将网页保存为 PDF 似乎是个好办法。但是,如果你想有更多的选择并通过终端,**wkhtmltopdf** 工具应该会派上用场。 + +你喜欢如何在 Linux 中把网页转换为 PDF?欢迎在评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/convert-webpage-pdf-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-browsers-ubuntu-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-save-webpage-pdf.png?resize=800%2C536&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-firefox-print-pdf-1.png?resize=602%2C584&ssl=1 +[4]: https://www.printfriendly.com/ +[5]: https://itsfoss.com/terminal-web-browsers/ +[6]: https://itsfoss.com/download-files-from-linux-terminal/ +[7]: https://github.com/wkhtmltopdf/wkhtmltopdf +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/htmltopdf-mint.png?resize=736%2C344&ssl=1 From fa6848424cf6a65d18b0767fb5eac7739a83ea5b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 Oct 2021 08:50:15 +0800 Subject: [PATCH 06/56] Rename sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md to sources/talk/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md --- ...e Developer Loves the Linux Community for an Unusual Reason.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md (100%) diff --git a/sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md b/sources/talk/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md similarity index 100% rename from sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md rename to sources/talk/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md From 8d843c98bcf40d55f2125759d1a67976764ca6aa Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 26 Oct 2021 08:51:24 +0800 Subject: [PATCH 07/56] translating --- ... You Root-- Error on Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md b/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md index c1b05e8b60..d334666913 100644 --- a/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/fixed-are-you-root-error/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 996f01192668c6a9eb7e20047281310d15ebce43 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Oct 2021 09:14:35 +0800 Subject: [PATCH 08/56] APL --- sources/tech/20211025 Use Rust for embedded development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211025 Use Rust for embedded development.md b/sources/tech/20211025 Use Rust for embedded development.md index 07bcab63da..f3defee452 100644 --- a/sources/tech/20211025 Use Rust for embedded development.md +++ b/sources/tech/20211025 Use Rust for embedded development.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/rust-embedded-development" [#]: author: "Alan Smithee https://opensource.com/users/alansmithee" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 7f290b49cbeb659f3f91c9565e8aadb0d2f86e3c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Oct 2021 10:39:16 +0800 Subject: [PATCH 09/56] TSL&PRF --- ...11025 Use Rust for embedded development.md | 297 ------------------ ...11025 Use Rust for embedded development.md | 280 +++++++++++++++++ 2 files changed, 280 insertions(+), 297 deletions(-) delete mode 100644 sources/tech/20211025 Use Rust for embedded development.md create mode 100644 translated/tech/20211025 Use Rust for embedded development.md diff --git a/sources/tech/20211025 Use Rust for embedded development.md b/sources/tech/20211025 Use Rust for embedded development.md deleted file mode 100644 index f3defee452..0000000000 --- a/sources/tech/20211025 Use Rust for embedded development.md +++ /dev/null @@ -1,297 +0,0 @@ -[#]: subject: "Use Rust for embedded development" -[#]: via: "https://opensource.com/article/21/10/rust-embedded-development" -[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Use Rust for embedded development -====== -Rust's high performance, reliability, and productivity make it apt for -embedded systems. -![Ferris the crab under the sea, unofficial logo for Rust programming language][1] - -Over the past several years, Rust has gained a passionate following among programmers. Tech trends come and go, so it can be difficult to separate excitement just because something is new versus excitement over the merits of a technology, but I think Rust is a truly well-designed language. It aims to help developers build reliable and efficient software, and it was designed for that purpose from the ground up. There are key features you'll hear about Rust, and in this article, I demonstrate that many of these features are exactly why Rust also happens to be great for embedded systems. Here are some examples: - - * High performance: It's fast, with high memory utilization - * Reliability: Memory errors can be eliminated during compilation - * Productivity: Great documentation, a friendly compiler with useful error messages, and top-notch tooling. There's an integrated package manager and build tool, smart multi-editor support with auto-completion and type inspections, an auto-formatter, and more. - - - -### Why use Rust for embedded development? - -Rust is designed to guarantee both security and high performance. Embedded software can have problems, mostly due to memory. Rust is, in a way, a compiler-oriented language, so you can be sure that you're using memory safely while compiling. Here are some of the benefits of using Rust to develop on embedded devices: - - * Powerful static analysis - * Flexible memory - * Fearless concurrency - * Interoperability - * Portability - * Community-driven - - - -In this article, I use the open source [RT-Thread operating system][2] to demonstrate how to use Rust for embedded development. - -### How to call Rust in C - -When calling Rust code in C code, you must package the Rust source code as a static library file. When the C code compiles, link it in. - -#### Creating a static library with Rust - -There are two steps in this process. - -1\. Use `cargo init --lib rust_to_c` to build a lib library in Clion. Add the following code to the `lib.rs`. The following function evaluates the sum of two values of type **i32** and returns the result: - - -``` -#![no_std] -use core::panic::PanicInfo; - -#[no_mangle] -pub extern "C" fn sum(a: i32, b: i32) -> i32 { -    a + b -} - -#[panic_handler] -fn panic(_info:&PanicInfo) -> !{ -    loop{} -} -``` - -2\. Add the following code to your `Cargo.toml` file to tell Rustc what type of library to generate: - - -``` -[lib] -name = "sum" -crate-type = ["staticlib"] -path = "src/lib.rs" -``` - -#### Cross-compilation - -You can cross-compile for your target. Assuming your embedded system is Arm-based, the steps are simple: - - -``` -`$ rustup target add armv7a-none-eabi` -``` - -2\. Generate the static library file: - - -``` -$ cargo build --target=armv7a-none-eabi --release --verbose -Fresh rust_to_c v0.1.0 -Finished release [optimized] target(s) in 0.01s -``` - -#### Generate Header File - -You need header files, too. - -1\. Install [cbindgen][3]. The `cbindgen` tool generates a C or C++11 header file from the Rust library: - - -``` -`$ cargo install --force cbindgen` -``` - -2\. Create a new `cbindgen.toml` file under your project folder. - -3\. Generate a header file: - - -``` -`$ cbindgen --config cbindgen.toml --crate rust_to_c --output sum.h` -``` - -#### Call the Rust library file - -Now you can make calls to your Rust libraries. - -1\. Put the generated `sum.h` and `sum.a` files into the `rt-thread/bsp/qemu-vexpress-a9/applications` directory. - -2\. Modify the `SConscript` file and add a static library: - - -``` -   from building import * -    -   cwd     = GetCurrentDir() -   src     = Glob('*.c') + Glob('*.cpp') -   CPPPATH = [cwd] -    -   LIBS = ["libsum.a"] -   LIBPATH = [GetCurrentDir()] -    -   group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, LIBS = LIBS, LIBPATH = LIBPATH) -    -   Return('group') -``` - -3\. Call the **sum** function in the main function, get the return value, and `printf` the value. - - -``` -   #include <stdint.h> -   #include <stdio.h> -   #include <stdlib.h> -   #include <rtthread.h> -   #include "sum.h" -    -   int main(void) -   { -       int32_t tmp; -    -       tmp = sum(1, 2); -       printf("call rust sum(1, 2) = %d\n", tmp); -    -       return 0; -   } -``` - -4\. In the RT-Thread [Env][4] environment, use `scons` to compile the project and run: - - -``` -$ scons -j6 -scons: Reading SConscript files ... -scons: done reading SConscript files. -scons: Building targets ... -[...] -scons: done building targets. - -$ qemu.sh - \ | / -\- RT -     Thread Operating System - / | \     4.0.4 build Jul 28 2021 -2006 - 2021 Copyright by rt-thread team -lwIP-2.1.2 initialized! -[...] -call rust sum(1, 2) = 3 -``` - -### Add, subtract, multiply, and divide - -You can implement some complicated math in Rust. In the `lib.rs` file, use the Rust language to implement add, subtract, multiply, and divide: - - -``` -#![no_std] -use core::panic::PanicInfo; - -#[no_mangle] -pub extern "C" fn add(a: i32, b: i32) -> i32 { -    a + b -} - -#[no_mangle] -pub extern "C" fn subtract(a: i32, b: i32) -> i32 { -    a - b -} - -#[no_mangle] -pub extern "C" fn multiply(a: i32, b: i32) -> i32 { -    a * b -} - -#[no_mangle] -pub extern "C" fn divide(a: i32, b: i32) -> i32 { -    a / b -} - -#[panic_handler] -fn panic(_info:&PanicInfo) -> !{ -    loop{} -} -``` - -Build your library files and header files and place them in the application directory. Use `scons` to compile. If errors appear during linking, find the solution on the official [Github page][5]. - -Modify the `rtconfig.py` file, and add the link parameter `--allow-multiple-definition`: - - -``` -       DEVICE = ' -march=armv7-a -marm -msoft-float' -       CFLAGS = DEVICE + ' -Wall' -       AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__ -I.' -       LINK_SCRIPT = 'link.lds' -       LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors,--allow-multiple-definition'+\ -                         ' -T %s' % LINK_SCRIPT -    -       CPATH = '' -       LPATH = '' -``` - -Compile and run QEMU to see your work. - -### Call C in Rust - -Rust can be called in C code, but what about calling C in your Rust code? The following is an example of calling the `rt_kprintf` C function in Rust code. - -First, modify the `lib.rs` file: - - -``` -    // The imported rt-thread functions list -    extern "C" { -        pub fn rt_kprintf(format: *const u8, ...); -    } -    -    #[no_mangle] -    pub extern "C" fn add(a: i32, b: i32) -> i32 { -        unsafe { -            rt_kprintf(b"this is from rust\n" as *const u8); -        } -        a + b -    } -``` - -Next, generate the library file: - - -``` -$ cargo build --target=armv7a-none-eabi --release --verbose -Compiling rust_to_c v0.1.0 -Running `rustc --crate-name sum --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type staticlib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=a -Finished release [optimized] target(s) in 0.11s -``` - -And now, to run the code, copy the library files generated by Rust into the application directory and rebuild: - - -``` -$ scons -j6 scons: Reading SConscript files ... scons: done reading SConscript files. [...] -scons: Building targets ... scons: done building targets. -``` - -Run QEMU again to see the results in your embedded image. - -### You can have it all - -Using Rust for your embedded development gives you all the features of Rust without the need to sacrifice flexibility or stability. Try Rust on your embedded system today. For more information about the process of embedded Rust (and about RT-Thread itself), check out the RT-Thread project's [YouTube channel][6]. And remember, embedded can be open, too. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/rust-embedded-development - -作者:[Alan Smithee][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/alansmithee -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rust_programming_crab_sea.png?itok=2eWLz8A5 (Ferris the crab under the sea, unofficial logo for Rust programming language) -[2]: https://github.com/RT-Thread/rt-thread -[3]: https://github.com/eqrion/cbindgen -[4]: https://www.rt-thread.io/download.html?download=Env -[5]: https://github.com/rust-lang/compiler-builtins/issues/353 -[6]: https://www.youtube.com/channel/UCdDHtIfSYPq4002r27ffqP diff --git a/translated/tech/20211025 Use Rust for embedded development.md b/translated/tech/20211025 Use Rust for embedded development.md new file mode 100644 index 0000000000..a37cd61bf5 --- /dev/null +++ b/translated/tech/20211025 Use Rust for embedded development.md @@ -0,0 +1,280 @@ +[#]: subject: "Use Rust for embedded development" +[#]: via: "https://opensource.com/article/21/10/rust-embedded-development" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +使用 Rust 进行嵌入式开发 +====== + +> Rust 的高性能、高可靠性和高生产力使它适合于嵌入式系统。 + +![](https://img.linux.net.cn/data/attachment/album/202110/26/103848djcdhjk0d2z1hc52.jpg) + +在过去的几年里,Rust 在程序员中获得了热情的追捧。技术潮流来来去去,所以很难将仅仅因为某项新技术而产生的兴奋与对某项技术的优点的兴奋区分开来,但我认为 Rust 是一种真正设计良好的语言。它的目标是帮助开发者建立可靠和高效的软件,而且它从一开始就是为这个目的设计的。你可能听过一些 Rust 的关键特性,在这篇文章中,我会证明这些特性正是 Rust 也恰好适合嵌入式系统的原因。比如: + + * 高性能:它速度快,内存利用率高 + * 可靠性:在编译过程中可以消除内存错误 + * 生产力:很棒的文档,友好的编译器,有用的错误信息,以及一流的工具化。它有一个集成的包管理器和构建工具,智能的多编辑器支持自动补完和类型检查、自动格式化等等。 + +### 为什么使用 Rust 进行嵌入式开发? + +Rust 的设计是为了保证安全和高性能。嵌入式软件会出现的问题主要是内存的问题。从某种程度上说,Rust 是一种面向编译器的语言,所以你可以确保在编译时安全使用内存。以下是使用 Rust 在嵌入式设备上开发的一些好处: + + * 强大的静态分析 + * 灵活的内存 + * 无畏的并发性 + * 互操作性 + * 可移植性 + * 社区驱动 + +在这篇文章中,我使用开源的 [RT-Thread 操作系统][2] 来演示如何使用 Rust 进行嵌入式开发。 + +### 如何在 C 语言中调用 Rust + +在 C 代码中调用 Rust 代码时,你必须将 Rust 源代码打包成静态库文件。当 C 代码编译时,将其链接进去。 + +#### 用 Rust 创建一个静态库 + +在这个过程中,有两个步骤: + +1、使用 `cargo init --lib rust_to_c` 在 Clion 中建立一个 `lib` 库。在 `lib.rs` 中加入以下代码。下面的函数计算两个类型为 `i32` 的值的总和并返回结果: + +``` +#![no_std] +use core::panic::PanicInfo; + +#[no_mangle] +pub extern "C" fn sum(a: i32, b: i32) -> i32 { + a + b +} + +#[panic_handler] +fn panic(_info:&PanicInfo) -> !{ + loop{} +} +``` + +2、在你的 `Cargo.toml` 文件中添加以下代码,以告诉 Rustc 要生成什么类型的库: + +``` +[lib] +name = "sum" +crate-type = ["staticlib"] +path = "src/lib.rs" +``` + +#### 交叉编译 + +你可以针对你的目标平台进行交叉编译。假设你的嵌入式系统是基于 Arm 的,步骤很简单: + +``` +$ rustup target add armv7a-none-eabi +``` + +生成静态库文件: + +``` +$ cargo build --target=armv7a-none-eabi --release --verbose +Fresh rust_to_c v0.1.0 +Finished release [optimized] target(s) in 0.01s +``` + +#### 生成头文件 + +你也需要头文件: + +1、安装 [cbindgen][3]。`cbindgen` 工具会从 Rust 库中生成一个 C 或 C++11 的头文件: + +``` +$ cargo install --force cbindgen +``` + +2、在你的项目文件夹下创建一个新的 `cbindgen.toml` 文件。 + +3、生成一个头文件: + +``` +$ cbindgen --config cbindgen.toml --crate rust_to_c --output sum.h +``` + +#### 调用 Rust 库文件 + +现在你可以对你的 Rust 库进行调用了。 + +1、把生成的 `sum.h` 和 `sum.a` 文件放到 `rt-thread/bsp/qemu-vexpress-a9/applications` 目录下。 + +2、修改 `SConscript` 文件并添加一个静态库: + +``` +   from building import * +    +   cwd     = GetCurrentDir() +   src     = Glob('*.c') + Glob('*.cpp') +   CPPPATH = [cwd] +    +   LIBS = ["libsum.a"] +   LIBPATH = [GetCurrentDir()] +    +   group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, LIBS = LIBS, LIBPATH = LIBPATH) +    +   Return('group') +``` + +3、在主函数中调用 `sum` 函数,得到返回值,并 `printf` 该值: + +``` + #include + #include + #include + #include + #include "sum.h" + + int main(void) + { + int32_t tmp; + + tmp = sum(1, 2); + printf("call rust sum(1, 2) = %d\n", tmp); + + return 0; + } +``` + +4、在 RT-Thread [Env][4] 环境中,使用 `scons` 来编译项目并运行: + +``` +$ scons -j6 +scons: Reading SConscript files ... +scons: done reading SConscript files. +scons: Building targets ... +[...] +scons: done building targets. + +$ qemu.sh + \ | / +- RT - Thread Operating System + / | \ 4.0.4 build Jul 28 2021 +2006 - 2021 Copyright by rt-thread team +lwIP-2.1.2 initialized! +[...] +call rust sum(1, 2) = 3 +``` + +### 加、减、乘、除 + +你可以在 Rust 中实现一些复杂的数学运算。在 `lib.rs` 文件中,使用 Rust 语言来实现加、减、乘、除: + +``` +#![no_std] +use core::panic::PanicInfo; + +#[no_mangle] +pub extern "C" fn add(a: i32, b: i32) -> i32 { + a + b +} + +#[no_mangle] +pub extern "C" fn subtract(a: i32, b: i32) -> i32 { + a - b +} + +#[no_mangle] +pub extern "C" fn multiply(a: i32, b: i32) -> i32 { + a * b +} + +#[no_mangle] +pub extern "C" fn divide(a: i32, b: i32) -> i32 { + a / b +} + +#[panic_handler] +fn panic(_info:&PanicInfo) -> !{ + loop{} +} +``` + +构建你的库文件和头文件,并把它们放在应用程序目录中。使用 `scons` 来编译。如果在链接过程中出现错误,请在官方 [Github 页面][5] 中找到解决方案。 + +修改 `rtconfig.py` 文件,并添加链接参数 `--allow-multiple-definition`: + +``` + DEVICE = ' -march=armv7-a -marm -msoft-float' + CFLAGS = DEVICE + ' -Wall' + AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__ -I.' + LINK_SCRIPT = 'link.lds' + LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors,--allow-multiple-definition'+\ + ' -T %s' % LINK_SCRIPT + + CPATH = '' + LPATH = '' +``` + +编译并运行 QEMU 来看看你的工作。 + +### 在 Rust 中调用 C 语言 + +Rust 可以在 C 代码中调用,但是如何在你的 Rust 代码中调用 C 呢?下面是一个在 Rust 代码中调用 `rt_kprintf` C 函数的例子。 + +首先,修改 `lib.rs` 文件: + +``` + // The imported rt-thread functions list + extern "C" { + pub fn rt_kprintf(format: *const u8, ...); + } + + #[no_mangle] + pub extern "C" fn add(a: i32, b: i32) -> i32 { + unsafe { + rt_kprintf(b"this is from rust\n" as *const u8); + } + a + b + } +``` + +接下来,生成库文件: + +``` +$ cargo build --target=armv7a-none-eabi --release --verbose +Compiling rust_to_c v0.1.0 +Running `rustc --crate-name sum --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type staticlib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=a +Finished release [optimized] target(s) in 0.11s +``` + +而现在,要运行代码,将 Rust 生成的库文件复制到应用程序目录中,然后重新构建: + +``` +$ scons -j6 scons: Reading SConscript files ... scons: done reading SConscript files. [...] +scons: Building targets ... scons: done building targets. +``` + +再次运行 QEMU,可以在你的嵌入式镜像中看到结果。 + +### 你可以拥有这一切 + +在你的嵌入式开发中使用 Rust,你可以获得 Rust 的所有功能,而不需要牺牲灵活性或稳定性。今天就在你的嵌入式系统上试试 Rust 吧。关于嵌入式 Rust 的过程(以及 RT-Thread 本身)的更多信息,请查看 RT-Thread 项目的 [YouTube 频道][6]。请记住,嵌入式也可以是开放的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/rust-embedded-development + +作者:[Alan Smithee][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/alansmithee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rust_programming_crab_sea.png?itok=2eWLz8A5 (Ferris the crab under the sea, unofficial logo for Rust programming language) +[2]: https://github.com/RT-Thread/rt-thread +[3]: https://github.com/eqrion/cbindgen +[4]: https://www.rt-thread.io/download.html?download=Env +[5]: https://github.com/rust-lang/compiler-builtins/issues/353 +[6]: https://www.youtube.com/channel/UCdDHtIfSYPq4002r27ffqP From 8dd37cf6a815088d7ca2445a0dc1af3c50de06cc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Oct 2021 10:42:39 +0800 Subject: [PATCH 10/56] PUB @wxy https://linux.cn/article-13921-1.html --- .../20211025 Use Rust for embedded development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20211025 Use Rust for embedded development.md (99%) diff --git a/translated/tech/20211025 Use Rust for embedded development.md b/published/20211025 Use Rust for embedded development.md similarity index 99% rename from translated/tech/20211025 Use Rust for embedded development.md rename to published/20211025 Use Rust for embedded development.md index a37cd61bf5..2fbf555ec3 100644 --- a/translated/tech/20211025 Use Rust for embedded development.md +++ b/published/20211025 Use Rust for embedded development.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13921-1.html" 使用 Rust 进行嵌入式开发 ====== From 5b893b3f9c2b8c6ec6512942b27d539a18486f74 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Oct 2021 11:17:25 +0800 Subject: [PATCH 11/56] PRF&PUB @geekpi https://linux.cn/article-13922-1.html --- ...Terminal Client for Git Written in Rust.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) rename {translated/tech => published}/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md (78%) diff --git a/translated/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md b/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md similarity index 78% rename from translated/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md rename to published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md index 45785b2cfa..a3e656cfa6 100644 --- a/translated/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md +++ b/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md @@ -3,20 +3,22 @@ [#]: author: "Marco Carmona https://itsfoss.com/author/marco/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13922-1.html" GitUI: 用 Rust 编写的 Git 的快速命令行客户端 ====== +![](https://img.linux.net.cn/data/attachment/album/202110/26/111605achvngqr6ix6vv0p.jpg) + [基本的 Git 命令][1] 对于通常的克隆、添加、提交推送已经足够好了。 -但如果你在一个有多个贡献者的大型项目上工作,你可能需要将事情可视化。GUI 工具可以让你更好地了解 diff、stash 和 blame 的情况。 +但如果你在一个有多个贡献者的大型项目上工作,你可能需要将事情可视化。GUI 工具可以让你更好地了解 `diff`、`stash` 和 `blame` 的情况。 -但是,如果你常用终端,想要 Git 的舒适性,我为你准备了一个好工具。 +但是,如果你常用终端,又想要 Git 的舒适性,我为你准备了一个好工具。 -它叫 GitUI,它提供了类似于 Git GUI 的用户体验和舒适度,但就在你的终端中。它是可移植的、快速的、免费的和开源的。 +它叫 GitUI,它提供了类似于 Git GUI 的用户体验和舒适度,但就在你的终端中。它是可移植的、快速的、自由而开源的。 ### GitUI:一个基于终端的 Git 工具 @@ -30,15 +32,15 @@ gitui | 24 s | 0.17 | 1.4 | 否 | 否 lazygit | 57 s | 2.6 | 16 | 是 | 有时 tig | 4 m 20 s | 1.3 | 0.6 | 有时 | 否 -GitUI、LazyGit 和 Tig 之间的比较。Git 的简单用户界面 +*GitUI、LazyGit 和 Tig 之间的比较。* 这种优化大部分来自于 Rust 语言的使用。 -_**注意:该程序处于早期开发阶段,还没有为生产做好准备。**_ +**注意:该程序处于早期开发阶段,还没有为生产做好准备。** ### 在 Linux 上安装 GitUI -不用说,你应该已经[在你的系统上安装了 Git][5]。 +不用说,你应该已经 [在你的系统上安装了 Git][5]。 要使用 GitUI,首先需要 [为你的 Linux 发行版安装 Rust 支持][6]。 @@ -62,19 +64,19 @@ source $HOME/.cargo/env cargo install gitui ``` -然后你就可以使用 GitUI了,只需在终端输入 `gitui`就可以运行了。我做了一些示例文件来测试 Git 和 GitUI。 +然后你就可以使用 GitUI了,只需在终端输入 `gitui` 就可以运行了。我做了一些示例文件来测试 Git 和 GitUI。 ![Starting gitui on terminal][8] 值得一提的是,这个界面有一个快速而直观的纯键盘控制。一切都很简单,只需输入正确的字母即可将文件暂存、提交、分支或推送到 git 仓库中。 -真正让我兴奋的是,你不仅可以做之前的四个动作,还可以**编辑**每个文件,**拉取**它,**blame** 它,在其中**导航**等等,这一切都无需退出界面。 很棒,不是吗? +真正让我兴奋的是,你不仅可以做之前的四个动作,还可以**编辑**每个文件,**拉取**它,**追溯** 它,在其中**导航**等等,这一切都无需退出界面。 很棒,不是吗? ![More functions inside the interface][9] 祝贺你! 现在你知道了如何安装 GitUI 以及它在你的终端中的样子。 -如果你喜欢这个项目,请在 [GitHub][2] 上启动它的仓库。如果你使用其他工具来管理 Git,请在评论区提出你的建议。 +如果你喜欢这个项目,请在 [GitHub][2] 上点赞它的仓库。如果你使用其他工具来管理 Git,请在评论区提出你的建议。 -------------------------------------------------------------------------------- @@ -83,7 +85,7 @@ via: https://itsfoss.com/gitui/ 作者:[Marco Carmona][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6fcd91b3cbb2c4222de6c980dfc59b18c11838af Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Oct 2021 11:32:41 +0800 Subject: [PATCH 12/56] PRF --- ...I- A Blazing Fast Terminal Client for Git Written in Rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md b/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md index a3e656cfa6..51e442a5d6 100644 --- a/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md +++ b/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md @@ -26,7 +26,7 @@ GitUI: 用 Rust 编写的 Git 的快速命令行客户端 GitUI 的开发者在项目的 README 文件中分享了一些基准数据。 -| 时间 |内存(GB)| 二进制(MB)| 冻结 | 崩溃 +名称 | 时间 |内存(GB)| 二进制(MB)| 冻结 | 崩溃 ---|---|---|---|---|--- gitui | 24 s | 0.17 | 1.4 | 否 | 否 lazygit | 57 s | 2.6 | 16 | 是 | 有时 From 9c54e611a1534013d9fed3d159aa4d983e35f224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 26 Oct 2021 17:01:24 +0800 Subject: [PATCH 13/56] Translating --- ...1 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md b/sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md index 8d6dafd4d1..c27f3af3aa 100644 --- a/sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md +++ b/sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/set-java-home-ubuntu/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "robsean" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 331e092c10d71f1e66e1b9d7f369af90d689804f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 26 Oct 2021 17:03:46 +0800 Subject: [PATCH 14/56] Translating --- sources/tech/20210909 How to Change Color of Ubuntu Terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210909 How to Change Color of Ubuntu Terminal.md b/sources/tech/20210909 How to Change Color of Ubuntu Terminal.md index c4cd318c4c..5981ab9d1a 100644 --- a/sources/tech/20210909 How to Change Color of Ubuntu Terminal.md +++ b/sources/tech/20210909 How to Change Color of Ubuntu Terminal.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/change-terminal-color-ubuntu/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "robsean" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 677be8ac351edcdf146a7293a340b76ace8394f1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 27 Oct 2021 05:02:31 +0800 Subject: [PATCH 15/56] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211027=20Fe?= =?UTF-8?q?rdi:=20A=20Free=20&=20Open-Source=20Alternative=20to=20Franz=20?= =?UTF-8?q?&=20Rambox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md --- ...en-Source Alternative to Franz - Rambox.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md diff --git a/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md b/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md new file mode 100644 index 0000000000..87b3549f4a --- /dev/null +++ b/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md @@ -0,0 +1,105 @@ +[#]: subject: "Ferdi: A Free & Open-Source Alternative to Franz & Rambox" +[#]: via: "https://itsfoss.com/ferdi/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ferdi: A Free & Open-Source Alternative to Franz & Rambox +====== + +_**Brief:**_ _Ferdi is a promising open-source application with more free features as an alternative to Franz and Rambox. Let us explore more about it._ + +A single application to help you manage multiple services comes in handy when you do not want to do everything on your browser. While technically, you can, it may not be the most organized way of doing things. + +Hence, options like [Rambox][1] and [Franz][2] are pretty popular cross-platform solutions to sign in to several services and access all of them at a glance. + +Even though they both are available for Linux (and we’ve covered them separately), they offer limited features for free. + +In contrast, Ferdi is a fork of Franz offering many premium functionalities for free while aiming to provide a better experience. + +### Ferdi: Dabble With Multiple Applications in One Place + +![][3] + +Ferdi is a free and open-source application that lets you add multiple applications, including various messaging services, in one place. + +It also lets you customize various aspects of the application and its behavior. If you like applications like Rambox and Franz, you should explore more about Ferdi. + +### Features of Ferdi + +![][4] + +You can find tons of features available without needing to pay a premium. Here, I shall highlight some key features: + + * Cross-platform support (Linux, Windows, and macOS) + * Wide range of messaging services included (Slack, WhatsApp, Element, etc.) + * Supports signing in with Franz account + * Ability to password-protect messages + * Option to use your custom server + * Quick to-do list access with the option to use Franz Todo, Todoist, Microsoft To Do, Any.do, and more. + * Tweak performance by unloading applications when not in use (Hibernation) + * Private notification to hide your messages + * Do not disturb mode support + * Dark mode with the option to toggle every app added separately + * Cloud sync + * No restrictions on the number of accounts + * Ability to set up a proxy and connect through it + * Add multiple workspaces + + + +### Thoughts on Using Ferdi + +![][5] + +Just like Rambox and Franz, Ferdi won’t shy away from consuming a good chunk of your resources. So, you need to keep in mind whether you have enough memory (RAM) to have several applications active within Ferdi. + +It is good to have the option to unload applications when not in use. So, in case you are low on resources, you might want to utilize the Hibernation option. + +![][6] + +Ferdi also offers some advanced options like GPU acceleration, universal dark mode, privacy toggles, appearance customization, and more. You can even add custom services that you do not find listed. + +![][7] + +Overall, you get many features and choices when it comes to Ferdi. You should be able to organize multiple applications efficiently with the available set of options. + +### Installing Ferdi in Linux + +Ferdi offers multiple packages for easy installation on Linux. You can find a DEB/RPM package for Ubuntu/Fedora, an [AppImage file][8] for all other Linux distributions. + +They also provide a snap package along with the ability to install it via [AUR][9]. So, you have plenty of options to get it installed on your Linux computer. + +You can explore their [GitHub page][10] and head to its releases section to download them or visit the official site. + +[Download Ferdi][11] + +Have you tried Ferdi yet? Does it serve the purpose of replacing Franz or Rambox? Is it better? Share your experience in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ferdi/ + +作者:[Ankush Das][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/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/rambox/ +[2]: https://itsfoss.com/franz-messaging-app/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-screenshot.png?resize=800%2C621&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-screenshot-1.png?resize=800%2C584&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-custom-services.png?resize=800%2C586&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-workspaces.png?resize=800%2C627&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-advanced-options.png?resize=800%2C541&ssl=1 +[8]: https://itsfoss.com/appimage-interview/ +[9]: https://itsfoss.com/aur-arch-linux/ +[10]: https://github.com/getferdi/ferdi +[11]: https://getferdi.com/ From 37ccb3c972a7fe8a8df53a3213cf8a54f2eb0fde Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 27 Oct 2021 05:02:52 +0800 Subject: [PATCH 16/56] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211026=20De?= =?UTF-8?q?ploy=20Quarkus=20applications=20to=20Kubernetes=20using=20a=20H?= =?UTF-8?q?elm=20chart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211026 Deploy Quarkus applications to Kubernetes using a Helm chart.md --- ...ations to Kubernetes using a Helm chart.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20211026 Deploy Quarkus applications to Kubernetes using a Helm chart.md diff --git a/sources/tech/20211026 Deploy Quarkus applications to Kubernetes using a Helm chart.md b/sources/tech/20211026 Deploy Quarkus applications to Kubernetes using a Helm chart.md new file mode 100644 index 0000000000..a30b34c3cf --- /dev/null +++ b/sources/tech/20211026 Deploy Quarkus applications to Kubernetes using a Helm chart.md @@ -0,0 +1,161 @@ +[#]: subject: "Deploy Quarkus applications to Kubernetes using a Helm chart" +[#]: via: "https://opensource.com/article/21/10/quarkus-helm-chart" +[#]: author: "Daniel Oh https://opensource.com/users/daniel-oh" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Deploy Quarkus applications to Kubernetes using a Helm chart +====== +A developer's guide to serverless function deployment with Quarkus Helm +chart. +![Ships at sea on the web][1] + +Serverless functions are driving the fast adoption of DevOps development and deployment practices today. [Knative][2] on [Kubernetes][3] is one of the most popular serverless platforms to adopt serverless function architectures successfully. But developers must understand how serverless capabilities are specified using a combination of Kubernetes APIs, Knative resources, and function-oriented programming. DevOps teams also need to standardize runtime stacks (that is, application runtime, builder image, deployment configuration, and health check) to execute the functions on Kubernetes. What if you, a developer, could set this up with familiar technology and practice? + +This article guides you on the way developers can get started with serverless function deployment with the [Quarkus][4] [Helm][5] chart on Kubernetes. Furthermore, developers can avoid the extra work of developing a function from scratch, optimizing the application, and deploying it to Kubernetes. + +If you haven't experienced using Helm for cloud-native application deployments on Kubernetes, I will tell you what Helm is and what benefits you have with it. Helm is one of the most popular package managers for Kubernetes. Helm provides a chart that simplifies Kubernetes resources within a single package file for an application build and deployment. Developers can install the chart to Kubernetes using the Helm command-line interface or graphical dashboard. + +### Install Quarkus Helm chart + +In this article, you'll use [OpenShift Kubernetes Distribution][6] (OKD) built on Kubernetes with application lifecycle management functionality and DevOps tooling. If you haven't installed the Helm feature on your OKD cluster yet, follow the [installation document][7]. + +Before building a Quarkus application using a Quarkus Helm chart, you need to create pull and push secrets in your OKD cluster. You use the secrets to pull a builder image from an external container registry and then push it to the registry.  + +**Note:** You can skip this step if you don't need to use an external container registry during application build or deploy the application to the OKD cluster. + +Create a pull secret using the following [oc command][8]: + + +``` +$ oc create secret docker-registry my-pull-secret \ +\--docker-server=$SERVER_URL \ +\--docker-username=$USERNAME \ +\--docker-password=$PASSWORD \ +\--docker-email=$EMAIL +``` + +Then, create a push secret using the following command: + + +``` +$ oc create secret docker-registry my-push-secret \ +\--docker-server=$SERVER_URL \ +\--docker-username=$USERNAME \ +\--docker-password=$PASSWORD \ +\--docker-email=$EMAIL +``` + +Install the Quarkus Helm chart: + + +``` +$ helm repo add quarkus \ + +``` + +### Build and deploy Quarkus application using Helm chart + +Go to the **Developer** console in the OKD cluster, click on Helm chart in **+Add** menu. Then type in _quarkus_ in the search box. Click on the **Quarkus v0.0.3** helm chart, as shown below. + +**Note:** You'll need to create a _quarkus-helm project_ (namespace) to install a Quarkus Helm chart in your OKD cluster. + +![Search Quarkus Helm chart][9] + +(Daniel Oh, [CC BY-SA 4.0][10]) + +Click on **Install Helm Chart**, as shown below. + +![Install Helm chart][11] + +(Daniel Oh, [CC BY-SA 4.0][10]) + +Switch the editor to **YAML** view, then paste the following build and deploy configurations: + + +``` +build: +  uri: +  ref: master +  env: +    - name: S2I_SOURCE_DEPLOYMENTS_FILTER +      value: "*-runner.jar lib*" +deploy: +  readinessProbe: +    httpGet: +      path: /health/ready +      port: http +    tcpSocket: null +  livenessProbe: +    httpGet: +      path: /health/live +      port: http +    tcpSocket: null +``` + +Then, click on the **Install** button, as shown below. + +![YAML editor][12] + +(Daniel Oh, [CC BY-SA 4.0][10]) + +Find more values to configure the Quarkus helm chart [here][13]. + +Once the chart gets installed successfully, you'll see the following Quarkus pod in the Topology view, as shown below. + +![Topology view][14] + +(Daniel Oh, [CC BY-SA 4.0][10]) + +**Note:** You might see _ErrImagePull_ and _ImagePullBackOff_ in **Deployments** while the build is processing. Once the build completes, your image gets automatically rolled out. + +Click on the **Open URL** icon. It brings you to the **todos** application. Let's try to add a few items for fun, as shown below. + +![Todos applications][15] + +(Daniel Oh, [CC BY-SA 4.0][10]) + +### Conclusion + +You've learned the way developers can build Quarkus applications and deploy them to Kubernetes/OpenShift cluster in a few minutes using a Helm chart. The developers can manage the application runtime stack in terms of upgrade, rollback, uninstall, and add new configurations such as application health check, replication without changing the application source code or developing new Kubernetes manifestos with YAML files. This minimizes developers' burden to keep leveraging application runtimes other than implementing business logic on Kubernetes. For more information to follow on Quarkus journey here: + + * [A Java developer's guide to Quarkus][16] + * [3 reasons Quarkus 2.0 improves developer productivity on Linux][17] + * [Optimize Java serverless functions in Kubernetes][18] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/quarkus-helm-chart + +作者:[Daniel Oh][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/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes_containers_ship_lead.png?itok=9EUnSwci (Ships at sea on the web) +[2]: https://knative.dev/docs/ +[3]: https://opensource.com/article/19/6/reasons-kubernetes +[4]: https://quarkus.io/ +[5]: https://helm.sh/ +[6]: https://www.okd.io/ +[7]: https://docs.okd.io/latest/applications/working_with_helm_charts/installing-helm.html +[8]: https://docs.okd.io/latest/cli_reference/openshift_cli/getting-started-cli.html +[9]: https://opensource.com/sites/default/files/uploads/search-quarkus-helm-chart.png (Search Quarkus Helm chart) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: https://opensource.com/sites/default/files/uploads/install-hel-chart.png (Install Helm chart) +[12]: https://opensource.com/sites/default/files/uploads/yaml-editor.png (YAML editor) +[13]: https://github.com/redhat-developer/redhat-helm-charts/tree/master/alpha/quarkus-chart#values +[14]: https://opensource.com/sites/default/files/uploads/topology-view.png (Topology view) +[15]: https://opensource.com/sites/default/files/uploads/todos-applications.png (Todos applications) +[16]: https://opensource.com/article/21/8/java-quarkus-ebook +[17]: https://opensource.com/article/21/7/developer-productivity-linux +[18]: https://opensource.com/article/21/6/java-serverless-functions-kubernetes From 2d49fe81a50a2378f52f383347af4386abc5d6f9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 Oct 2021 08:33:58 +0800 Subject: [PATCH 17/56] translated --- ... Distros Using Xfce Desktop Environment.md | 113 ------------------ ... Distros Using Xfce Desktop Environment.md | 113 ++++++++++++++++++ 2 files changed, 113 insertions(+), 113 deletions(-) delete mode 100644 sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md create mode 100644 translated/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md diff --git a/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md b/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md deleted file mode 100644 index 16eccaf8fd..0000000000 --- a/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md +++ /dev/null @@ -1,113 +0,0 @@ -[#]: subject: "How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment" -[#]: via: "https://itsfoss.com/install-themes-xfce-xubuntu/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment -====== - -_**Brief: This is a step-by-step beginner’s tutorial to show how to install themes and icons in Xubuntu and other Linux distributions that use Xfce desktop environment.**_ - -Installing themes on Xubuntu is similar to Ubuntu or any other Linux distribution. You put the theme files in the ~/.themes folder and then use a tool to change it. - -However, some options or the user interface will look different considering Xubuntu uses the [Xfce desktop environment][1]. This is why I created this specific tutorial to show the steps with proper screenshots. - -### Install new themes in Xubuntu (Xfce) - -To get started, you need to create a **.themes** folder in the home directory. Mind the dot (.) before the folder name. It’s important and hides the folder from normal view. - -To check if you already have it, you can [enable viewing hidden files][2] and then create it if it isn’t present. - -![][3] - -Once done, you need to download a theme. - -1\. You can browse for XFCE themes on the [Xfce-look][4] portal. All you have to do is download the archive (compressed) file. - -2\. Next, you need to [extract the zip file][5], as shown in the screenshot below. - -![][6] - -3\. Once you extract it, you will notice a folder appear, and you will have to copy it. - -![][7] - -4\. You will have to then paste this folder into the **.themes** directory that you created initially. - -![][8] - -5\. Finally, you need to head to the Appearance setting to find it listed and select it/apply it for it to take effect. - -![][9] - -As you notice in the screenshot below, the new theme has been added and applied: - -![][10] - -In addition to the theme, if you need to customize the icons of your Xubuntu desktop, you need to create another .icons folder in the home directory. - -Like you installed the theme, you will have to follow a similar process to apply the icon themes. - -To give you an example, let me highlight those steps here: - -### Adding icon themes in Xubuntu (Xfce) - -You can browse through the same [xfce-look portal][11] to look for complete icon themes. - -Or, you can explore some of the best [icon themes available for Ubuntu][12] that should work for Xubuntu as well. - -Once you find the one you like, download it, and extract it as shown below. - -![][13] - -Next, you will have to copy and paste the folder into the .**icons** folder. - -![][14] - -Now, you can head back to the Appearance settings and find the icon listed under the “Icons” available. - -To show you the difference, **I changed the default Xubuntu theme to adwaita-dark**, as you can see here: - -![][15] - -**Note**: Some icon or theme files may contain nested folders with different variants in it. You’ll notice that they do not appear in the appearance tool. If that’s the case, copy the inner folder directly in ~/.themes or ~/.icons folder. - -### Wrapping Up - -With both the style and icons tweaked, you can [customize your Xubuntu experience][16] to blend in with your taste. - -Do you prefer the default Xubuntu look or customize the look of it using different themes/icons? Let me know your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-themes-xfce-xubuntu/ - -作者:[Ankush Das][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/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://xfce.org/ -[2]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-hidden-files.png?resize=674%2C300&ssl=1 -[4]: https://www.xfce-look.org/browse?cat=138&ord=latest -[5]: https://itsfoss.com/unzip-linux/ -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/extract-xubuntu-theme.png?resize=719%2C537&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/extracted-xubuntu-theme.png?resize=709%2C272&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/copy-theme-xubuntu.png?resize=705%2C328&ssl=1 -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/appearance-xfce.png?resize=703%2C544&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xpro-xubuntu-theme.png?resize=1162%2C599&ssl=1 -[11]: https://www.xfce-look.org/browse?cat=132&ord=latest -[12]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme.png?resize=756%2C560&ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-selection.png?resize=739%2C534&ssl=1 -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-change.png?resize=1154%2C619&ssl=1 -[16]: https://itsfoss.com/customize-xfce/ diff --git a/translated/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md b/translated/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md new file mode 100644 index 0000000000..cc9182c5c9 --- /dev/null +++ b/translated/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md @@ -0,0 +1,113 @@ +[#]: subject: "How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment" +[#]: via: "https://itsfoss.com/install-themes-xfce-xubuntu/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Xubuntu 和其他发行版上使用 Xfce 桌面环境安装主题 +====== + +_**简介:这是一个循序渐进的初学者教程,展示了如何在 Xubuntu 和其他使用 Xfce 桌面环境的 Linux 发行版中安装主题和图标。**_ + +在 Xubuntu 上安装主题与 Ubuntu 或其他 Linux 发行版类似。你把主题文件放在 ~/.themes 文件夹中,然后用一个工具来改变它。 + +然而,考虑到 Xubuntu 使用 [Xfce 桌面环境][1],一些选项或用户界面看起来会有所不同。这就是为什么我创建了这个教程,用适当的截图来展示步骤。 + +### 在 Xubuntu(Xfce)中安装新主题 + +开始前,你需要在主目录下创建一个 **.themes** 文件夹。注意文件夹名称前的点(.)。它很重要,可以从正常的视图中隐藏该文件夹。 + +要检查你是否已经有了它,你可以[启用查看隐藏文件][2],然后在它不存在的时候创建它。 + +![][3] + +完成后,你需要下载一个主题。 + +1\. 你可以在 [Xfce-look][4] 门户网站上浏览 XFCE 主题。你所要做的就是下载存档(压缩)文件。 + +2\. 接下来,你需要[解压缩文件][5],如下面的截图所示。 + +![][6] + +3\. 解压后,你会发现出现一个文件夹,你要复制它。 + +![][7] + +4\. 然后你要把这个文件夹粘贴到你最初创建的 **.themes** 目录中。 + +![][8] + +5\. 最后,你需要到外观设置中找到它,并选择它/应用它以使其生效。 + +![][9] + +正如你在下面的截图中注意到的,新的主题已经被添加和应用: + +![][10] + +除了主题之外,如果你需要定制你的 Xubuntu 桌面的图标,你需要在主目录中创建另一个 .icons 文件夹。 + +就像你安装主题一样,你将不得不遵循一个类似的过程来应用图标主题。 + +为了给你一个例子,让我在这里强调这些步骤: + +### 在 Xubuntu(Xfce) 中添加图标主题 + +你可以浏览同样的 [xfce-look portal][11] 来寻找完整的图标主题。 + +或者,你可以探索一些最好的[可用于 Ubuntu 的图标主题][12],它们应该也适用于 Xubuntu。 + +一旦你找到了你喜欢的,就下载它,并按下面的方式解压。 + +![][13] + +接下来,你需要把这个文件夹复制并粘贴到 **.icons** 文件夹中。 + +![][14] + +现在,你可以回到外观设置中,找到列在“图标”下的可用图标。 + +为了向你展示区别,**我把默认的 Xubuntu 主题改为 adwaita-dark**,你可以在这里看到: + +![][15] + +**注意**:一些图标或主题文件可能包含有不同变体的嵌套文件夹。你会注意到它们并没有出现在外观工具中。如果是这种情况,直接将内部文件夹复制到 ~/.themes 或 ~/.icons 文件夹中。 + +### 总结 + +通过对风格和图标的调整,你可以[定制你的 Xubuntu 体验][16]以融入你的品味。 + +你是喜欢默认的 Xubuntu 外观还是使用不同的主题/图标来定制它的外观?请在评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-themes-xfce-xubuntu/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://xfce.org/ +[2]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-hidden-files.png?resize=674%2C300&ssl=1 +[4]: https://www.xfce-look.org/browse?cat=138&ord=latest +[5]: https://itsfoss.com/unzip-linux/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/extract-xubuntu-theme.png?resize=719%2C537&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/extracted-xubuntu-theme.png?resize=709%2C272&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/copy-theme-xubuntu.png?resize=705%2C328&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/appearance-xfce.png?resize=703%2C544&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xpro-xubuntu-theme.png?resize=1162%2C599&ssl=1 +[11]: https://www.xfce-look.org/browse?cat=132&ord=latest +[12]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme.png?resize=756%2C560&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-selection.png?resize=739%2C534&ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-change.png?resize=1154%2C619&ssl=1 +[16]: https://itsfoss.com/customize-xfce/ From bb903069639dab9dc8465441ebe8a9b6d57a20d6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 Oct 2021 08:39:34 +0800 Subject: [PATCH 18/56] translating --- ... Linux to Easily Add Essential Annotations to Your Images.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md b/sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md index 5b0ab80344..5d0d20348b 100644 --- a/sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md +++ b/sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/annotator/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 10a7f74a5db85a4e708682ac21c1a13095c785dc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Oct 2021 10:03:53 +0800 Subject: [PATCH 19/56] PRF @unigeorge --- ...10911 Play with model trains in OpenTTD.md | 77 ++++++++++--------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/translated/tech/20210911 Play with model trains in OpenTTD.md b/translated/tech/20210911 Play with model trains in OpenTTD.md index 4b510e93ea..fc0236218a 100644 --- a/translated/tech/20210911 Play with model trains in OpenTTD.md +++ b/translated/tech/20210911 Play with model trains in OpenTTD.md @@ -3,17 +3,18 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 在 OpenTTD 中玩模型火车 ====== -想玩实体模型火车,却没有足够大的空间?试试 OenTTD 中的虚拟火车吧。 -![Old train][1] +> 想玩实体模型火车,却没有足够大的空间?试试 OpenTTD 中的虚拟火车吧。 -我父亲一直很喜欢火车模型,我记得我小时候,曾看着他在圣诞树周围建了一整条轨道。当[乐高][2]火车套装发布时,因其便利性和固有可扩展性,我们转而投向了乐高火车的怀抱。多年来,我们热衷于建造和改装乐高火车及单轨轨道。我经常想象,未来我会有一个车库或地下室,专门用于微型景观和电动汽笛火车。强调一下,我沉迷于另一个爱好的可能性非常低,所以当发现 _虚拟_ 模型铁路可以为我提供相同的满足感时,我很开心。我的虚拟爱好引擎是 [OpenTTD][3],这是一款基于名为 **Transport Tycoon Deluxe** 的 90 年代老游戏的开源模拟游戏。 +![](https://img.linux.net.cn/data/attachment/album/202110/27/100255emc3x33icci0cacc.jpg) + +我父亲一直很喜欢火车模型,我记得我小时候,曾看着他在圣诞树周围建了一整条轨道。当 [乐高][2] 火车套装发布时,因其便利性和固有可扩展性,我们转而投向了乐高火车的怀抱。多年来,我们热衷于建造和改装乐高火车及单轨轨道。我经常想象,未来我会有一个车库或地下室,专门用于微型景观和电动汽笛火车。强调一下,我沉迷于另一个爱好的可能性非常低,所以当发现 _虚拟_ 模型铁路可以为我提供相同的满足感时,我很开心。我的虚拟爱好引擎是 [OpenTTD][3],这是一款基于名为 **Transport Tycoon Deluxe** 的 90 年代老游戏的开源模拟游戏。 ### 安装 OpenTTD @@ -25,7 +26,7 @@ $ sudo apt install ./openttd*deb ``` -如果你在使用其他 Linux 发行版,请下载通用安装程序,并使用 [`tar` 命令][6]解压缩包: +如果你在使用其他 Linux 发行版,请下载通用安装程序,并使用 [tar 命令][6]解压缩包: ``` $ tar xvf openttd-x.yy.z-linux*.tar.xz @@ -44,51 +45,51 @@ $ cd openttd* $ ./openttd & ``` -首次启动 OpenTTD 时,游戏会提示必须下载图形集,在 Steam 版中会自动安装,但在独立应用程序中需要单击一下鼠标。无论如何,因为 OpenTTD 是开源的,经过了很好的改进,所以在默认图形之外,你最终还会下载的还有很多其他图形。 +首次启动 OpenTTD 时,游戏会提示必须下载图像集,在 Steam 版中会自动安装,但在独立应用程序中需要单击一下鼠标。无论如何,因为 OpenTTD 是开源的,经过了很好的改进,所以在默认图像之外,你最终还会下载的还有很多其他图像。 -下载图形集后,你会看到一个古色古香的小型界面。我觉得 640x480 的界面有点小,虽然旧图形界面确实更有年代感(那时计算能力还比较弱),但一些适配现代屏幕的轻度升级还是很好用的。因此,您的第一步操作就是点击“**检查在线内容**Check online content”按钮。 +下载图像集后,你会看到一个古色古香的小型界面。我觉得 640x480 的界面有点小,虽然旧图像界面确实更有年代感(那时计算能力还比较弱),但一些适配现代屏幕的轻度升级还是很好用的。因此,你的第一步操作就是点击“检查在线内容Check online content”按钮。 ### 加载模组 -“**内容下载**Content downloading”界面是一个查看已通过审查的 OpenTTD 模组mod的窗口,可以提供个性化的改进图形界面、全新音乐、火车模型和地图名称。我使用了新西兰全套配置,所以对我来说,生成的所有城市都很熟悉,尽管 2020 年我转而开始使用“辐射 3”套装了。模组 _非常多_,可以使用右上角的搜索栏来缩小选择范围。 +“内容下载Content downloading”界面是一个查看已通过审查的 OpenTTD 模组mod的窗口,可以提供个性化的改进图像界面、全新音乐、火车模型和地图名称。我使用了新西兰全套配置,所以对我来说,生成的所有城市都很熟悉,尽管 2020 年我转而开始使用“辐射 3”套装了。模组 _非常多_,可以使用右上角的搜索栏来缩小选择范围。 下面是一些个人认为必备的模组: - * **abase** \- 高分辨率图形。将近 300 MB,这可能是你玩此游戏需要的最大一次下载(游戏本身只有 50 MB)。 - * **OpenSFX** \- 一个声音合集。让你能听到城市中的交通声、船运的喇叭声以及很棒的火车汽笛声。 - * **Town names** \- 城镇名称。默认的城市名称很有趣,但我认为记一些本地化的名称更容易。 - * **Trains** \- 火车模组。OpenTTD 有一组运行良好的默认火车模型,但如果你已经是一名火车观察员,那你可能会喜欢下载一些额外的火车模型。我使用的是 NZR 火车合集,但还有很多火车也是可用的,包括来自英国、美国、奥地利、比利时、捷克共和国的车,以及按字母表顺序排列的许多其他火车。 - * **Beginner tutorial** \- 新手教程。是一个帮你学习游戏及界面的引导场景。 + * **abase** - 高分辨率图像。将近 300 MB,这可能是你玩此游戏需要的最大一次下载(游戏本身只有 50 MB)。 + * **OpenSFX** - 一个声音合集。让你能听到城市中的交通声、船运的喇叭声以及很棒的火车汽笛声。 + * **Town names** - 城镇名称。默认的城市名称很有趣,但我认为记一些本地化的名称更容易。 + * **Trains** - 火车模组。OpenTTD 有一组运行良好的默认火车模型,但如果你已经是一名火车观察员,那你可能会喜欢下载一些额外的火车模型。我使用的是 NZR 火车合集,但还有很多火车也是可用的,包括来自英国、美国、奥地利、比利时、捷克共和国的车,以及按字母表顺序排列的许多其他火车。 + * **Beginner tutorial** - 新手教程。是一个帮你学习游戏及界面的引导场景。 ### 游戏引擎默认值 -下载新“资产”后,你需要将它们设置为默认值。有两个设置的地方:游戏引擎默认值、游戏内脚本与资产。 +下载新素材后,你需要将它们设置为默认值。有两个设置的地方:游戏引擎默认值、游戏内脚本与素材。 ![OpenTTD main menu][8] -OpenTTD 菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*OpenTTD 菜单(Seth Kenlon, [CC BY-SA 4.0][9])* -单击“**游戏选项**Game Options”按钮。 在**游戏选项**屏幕中,调整以下设置: +单击“游戏选项Game Options”按钮。 在游戏选项屏幕中,调整以下设置: - * 将**屏幕分辨率**screen resolution设置为你喜欢的界面尺寸。 - * 将**基础图形集** base graphics set设置为 **abase**。 - * 将**基础声音设置**base sounds set设置为 **OpenSFX**。 + * 将屏幕分辨率screen resolution设置为你喜欢的界面尺寸。 + * 将基础图像集 base graphics set设置为 **abase**。 + * 将基础声音设置base sounds set设置为 **OpenSFX**。 -关闭**游戏选项**屏幕。你的改动会自动保存。 +关闭游戏选项屏幕。你的改动会自动保存。 ### 游戏选项 -在主菜单界面,单击“**NewGRF 设置**NewGRF Settings”按钮。 +在主菜单界面,单击“NewGRF 设置NewGRF Settings”按钮。 ![NewGRF settings window][10] -NewGRF 设置菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*NewGRF 设置菜单(Seth Kenlon, [CC BY-SA 4.0][9])* -未活动的模组显示在 **NewGRF 设置**窗口的下半部分。要激活一个未活动的模组,请选择它并单击左下角的“**添加**Add”按钮。选择要激活的模组后,再单击“**应用**Apply”按钮。 +未活动的模组显示在 NewGRF 设置窗口的下半部分。要激活一个未活动的模组,请选择它并单击左下角的“添加Add”按钮。选择要激活的模组后,再单击“应用Apply”按钮。 ### 教程 -如果你下载了“**初学者教程**Beginner tutorial”场景,可以通过它来学习 OpenTTD。开始教程请单击主菜单屏幕顶部附近的“**播放场景**Play scenario” 按钮,然后选择该教程并开始。 +如果你下载了“初学者教程Beginner tutorial”场景,可以通过它来学习 OpenTTD。开始教程请单击主菜单屏幕顶部附近的“播放场景Play scenario” 按钮,然后选择该教程并开始。 初学者教程有着游戏界面的完整浏览流程,全部完成需要花费一些时间。 @@ -96,25 +97,25 @@ NewGRF 设置菜单(Seth Kenlon, [CC BY-SA 4.0][9]) 现在我们快速介绍一下,此处你要了解以下内容:车辆出自仓库,一切活动都需要时间表。记住这两条规则,你可以立即开始建造火车(以及道路、海港和机场)。 -#### **建造车站** +#### 建造车站 要在两个城市之间建立一条简单的铁路线,请单击顶部图标栏中的铁路轨道图标。 ![New icon bar - railway option][11] -新建图标栏——铁路选项(Seth Kenlon, [CC BY-SA 4.0][9]) +*新建图标栏——铁路选项(Seth Kenlon, [CC BY-SA 4.0][9])* -铁路以车站开始和结束,所以我通常在预定线路的两端各放置一个车站。单击火车站图标(将鼠标悬停在其上方可查看其标签)。一个火车站要服务于一个地区,其作用范围必须与该地区尽量多地重叠。要查看车站的覆盖范围,请通过单击车站对话框底部的“**开启**On”按钮以启用**覆盖区域高亮**Coverage area highlight功能。 +铁路以车站开始和结束,所以我通常在预定线路的两端各放置一个车站。单击火车站图标(将鼠标悬停在其上方可查看其标签)。一个火车站要服务于一个地区,其作用范围必须与该地区尽量多地重叠。要查看车站的覆盖范围,请通过单击车站对话框底部的“开启On”按钮以启用覆盖区域高亮Coverage area highlight功能。 ![Station coverage window][12] -车站覆盖信息窗口(Seth Kenlon, [CC BY-SA 4.0][9]) +*车站覆盖信息窗口(Seth Kenlon, [CC BY-SA 4.0][9])* 黑色网格表示覆盖范围,而白色网格显示车站的物理占据范围。当你将鼠标悬停在一个区域上时,车站的覆盖范围所需耗材会在弹出窗口中列出。从简单的开始,创建一个单轨 4 辆车的站台。在地图上的两个城市之间重复执行此操作两次。 ![create station menu][13] -创建车站菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*创建车站菜单(Seth Kenlon, [CC BY-SA 4.0][9])* ### 铺设铁轨 @@ -124,21 +125,21 @@ NewGRF 设置菜单(Seth Kenlon, [CC BY-SA 4.0][9]) ### 火车车库 -火车来自车库depot。因此,要在铁路上添加火车,必须在沿线的某处添加一个车库。单击车库图标并在现有铁路附近放置。将车库连接到现有轨道,以确保您的火车可以从车库到达适当线路的(在此简单示例中,线路是唯一的)。 +火车来自车库depot。因此,要在铁路上添加火车,必须在沿线的某处添加一个车库。单击车库图标并在现有铁路附近放置。将车库连接到现有轨道,以确保你的火车可以从车库到达适当线路的(在此简单示例中,线路是唯一的)。 ![create depot menu][14] -建造车库菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*建造车库菜单(Seth Kenlon, [CC BY-SA 4.0][9])* ### 模型火车 终于,你可以将虚拟模型火车添加到虚拟铁路中了。要创建火车,请单击车库。 -单击站点窗口底部的“**新建车辆**New Vehicle”按钮,会列出可用的火车引擎和汽车。列表会部分取决于你从可下载内容中添加的模型。一般来说,发动机分为三种:蒸汽发动机、柴油发动机和电动发动机。游戏内时间从 1950 年开始,所以早期你只有蒸汽可选。随着时间推进,你会获得可用于升级的创新型新模型。 +单击站点窗口底部的“新建车辆New Vehicle”按钮,会列出可用的火车引擎和汽车。列表会部分取决于你从可下载内容中添加的模型。一般来说,发动机分为三种:蒸汽发动机、柴油发动机和电动发动机。游戏内时间从 1950 年开始,所以早期你只有蒸汽可选。随着时间推进,你会获得可用于升级的创新型新模型。 ![create train menu][15] -创建火车菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*创建火车菜单(Seth Kenlon, [CC BY-SA 4.0][9])* 现在创建一个简单的火车,其中包括一节引擎、一节客车和一节邮车。如果想添加其他类型的车厢,请单击站点以确认它们的可提供车型(由其覆盖区域决定) @@ -150,15 +151,15 @@ NewGRF 设置菜单(Seth Kenlon, [CC BY-SA 4.0][9]) ![create schedule menu][16] -创建时刻表菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*创建时刻表菜单(Seth Kenlon, [CC BY-SA 4.0][9])* -要创建时间表,请单击时间表窗口底部的“**前往**Go To”按钮,然后单击要设置成第一个目的地的车站。然后点击下一站。你可以在时间表中选择一个停靠点,浏览“**满载**Full load”和“**卸载**Unload”下拉菜单中的选项,以此调整装卸要求,并且可以在“**无停靠**Non-stop”下拉菜单中调整路线(如果开发了新路线)。选项有很多,随着城市发展和地图完善,你可能需要随时调整策略。 +要创建时间表,请单击时间表窗口底部的“前往Go To”按钮,然后单击要设置成第一个目的地的车站。然后点击下一站。你可以在时间表中选择一个停靠点,浏览“满载Full load”和“卸载Unload”下拉菜单中的选项,以此调整装卸要求,并且可以在“无停靠Non-stop”下拉菜单中调整路线(如果开发了新路线)。选项有很多,随着城市发展和地图完善,你可能需要随时调整策略。 -但是现在,单击火车视口底部的红色“**已停止**Stopped”按钮,让火车投入使用吧! +但是现在,单击火车视口底部的红色“已停止Stopped”按钮,让火车投入使用吧! ![train moving from station to station][17] -在役中的火车(Seth Kenlon, [CC BY-SA 4.0][9]) +*在役中的火车(Seth Kenlon, [CC BY-SA 4.0][9])* ### 试试 OpenTTD 吧 @@ -173,7 +174,7 @@ via: https://opensource.com/article/21/9/model-trains-openttd 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From dbd55563702106bc196229bc310c59e0751a6cc9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Oct 2021 10:05:44 +0800 Subject: [PATCH 20/56] PUB @unigeorge https://linux.cn/article-13924-1.html --- .../20210911 Play with model trains in OpenTTD.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210911 Play with model trains in OpenTTD.md (99%) diff --git a/translated/tech/20210911 Play with model trains in OpenTTD.md b/published/20210911 Play with model trains in OpenTTD.md similarity index 99% rename from translated/tech/20210911 Play with model trains in OpenTTD.md rename to published/20210911 Play with model trains in OpenTTD.md index fc0236218a..d07f1699f9 100644 --- a/translated/tech/20210911 Play with model trains in OpenTTD.md +++ b/published/20210911 Play with model trains in OpenTTD.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "unigeorge" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13924-1.html" 在 OpenTTD 中玩模型火车 ====== From a9126acdda4f4b5e34056ec65fe5626797770e3c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Oct 2021 12:15:58 +0800 Subject: [PATCH 21/56] APL --- .../20211019 Why Mark Text is my favorite markdown editor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md b/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md index dcd5521a5e..418252b8ce 100644 --- a/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md +++ b/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/mark-text-markdown-editor" [#]: author: "Don Watkins https://opensource.com/users/don-watkins" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 262902a5bae7efc843b6636fc91992ce78106079 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Oct 2021 14:13:33 +0800 Subject: [PATCH 22/56] TSL&PRF --- ...ark Text is my favorite markdown editor.md | 97 ------------------- ...ark Text is my favorite markdown editor.md | 92 ++++++++++++++++++ 2 files changed, 92 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20211019 Why Mark Text is my favorite markdown editor.md create mode 100644 translated/tech/20211019 Why Mark Text is my favorite markdown editor.md diff --git a/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md b/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md deleted file mode 100644 index 418252b8ce..0000000000 --- a/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: subject: "Why Mark Text is my favorite markdown editor" -[#]: via: "https://opensource.com/article/21/10/mark-text-markdown-editor" -[#]: author: "Don Watkins https://opensource.com/users/don-watkins" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Why Mark Text is my favorite markdown editor -====== -Mark Text has tools that make it easy to write markdown while at the -same time providing a simple interface that just gets out of my way. -![Typewriter keys in multicolor][1] - -I got introduced to the markdown format a few years ago when I began to explore Jupyter Notebooks. Many of the other writers at Opensource.com knew markdown, but it was a skill that was unfamiliar to me. - -Markdown is a standard way of writing text, in which you use minimal notation to _markup_ how you want the text styled. For instance, instead of clicking a button to make a word bold, you surround the word with two asterisks (**word**). This has two effects: - - * Visually suggests emboldened text when viewed as plain text - * Appears as bold, given a good text converter or renderer (such as Pandoc or a good markdown text editor) - - - -One of the greatest advantages of markdown is that most of its notation is intuitive and derived from habits most of us already have. It just makes sense to emphasize words with asterisks, mark headlines with characters to set them apart, and so on. - -Everyone spoke highly of it, but I wasn't sure why I would need to learn and use markdown. However, I'm a curious person, and I began to explore markdown and how it might figure into my writing. - -### Learning markdown - -I enjoyed using a markdown [cheat sheet][2] as I learned. I found markdown to be an excellent tool for writing anything, and I love that I don't even need a special markdown editor. Any text editor can write markdown because markdown uses standard text to denote style. So I started using simple editors like Vim or gedit (or any other editor) and consulted the cheat sheet to remember the simple formatting rules. - -I've been journaling this year as a way of organizing my thoughts and learning more about markdown. I've recently tried the [Ghostwriter][3] text editor, an excellent editor with some extra markdown-specific features. Markdown has become so popular now that many editors incorporate or make it their focus to include syntax highlighting, hints, and other features that make it easy to work in markdown. They're not must-have features, but when you have them, they're nice to have.  - -### Trying Mark Text - -While reading a blog, I discovered [Mark Text][4]. Mark Text has tools that make it easy to write markdown while at the same time providing a simple interface that just gets out of my way. Mark Text has six themes: Three light and three dark themes. Dark themes are easier for me to use. The [user documentation][5] is excellent, and there is markdown [syntax help][6] available too.  - -### Markdown in real time - -Mark Text provides a real-time preview with a clean and simple interface. It supports the [Commonmark][7] spec, Github Flavored Markdown spec, and Pandoc Markdown. According to its website, Mark Text also supports markdown extensions like KaTex, front matter, and emoji. It outputs HTML and PDF files.  - -Mark Text has various editing modes like typewriter mode, source code mode, and focus mode. Adding images is a snap, as you can simply copy and paste them from your clipboard. - -A pop-up at the upper left of the Mark Text window displays the number of characters and paragraphs entered so far. That's really helpful as a writer. - -Saving files is easy from the menu at the upper left of the Mark Text window or use **Ctrl+S**. In fact, the menus of Mark Text look friendly and familiar to anyone who's used to a basic text editor or word processor. - -![Mark Text file menu][8] - -(Don Watkins, [CC BY-SA 4.0][9]) - -I love that Mark Text supports various formats with simple keystroke shortcuts, including table blocks, diagrams, in-line formats, math formula blocks, and other code blocks. - -You can download Mark Text for your operating system from the following links: - - * [Linux][10] - * [macOS][11] - * [Windows][12] - - - -Mark Text is open source with an [MIT][13] license. You can always [download][14] the latest version. - -Alternatively, you can install Mark Text on macOS with `brew install --cask mark-text` and on Windows with [Chocolatey][15] by entering `choco install marktext`. - -Mark Text is always looking for sponsors and developers. The project has a [guide][16] for contributors. In addition, you can support the project on Patreon and Open Collective. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/mark-text-markdown-editor - -作者:[Don Watkins][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/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-docdish-typewriterkeys-3.png?itok=NyBwMdK_ (Typewriter keys in multicolor) -[2]: https://opensource.com/downloads/cheat-sheet-markdown -[3]: https://wereturtle.github.io/ghostwriter/ -[4]: https://marktext.app/ -[5]: https://github.com/marktext/marktext/blob/master/docs/README.md -[6]: https://github.com/marktext/marktext/blob/master/docs/MARKDOWN_SYNTAX.md -[7]: https://commonmark.org/ -[8]: https://opensource.com/sites/default/files/uploads/mark-test-file-menu.png (Mark Text file menu) -[9]: https://creativecommons.org/licenses/by-sa/4.0/ -[10]: https://github.com/marktext/marktext/releases/latest/download/marktext-x86_64.AppImage -[11]: https://github.com/marktext/marktext/releases/latest/download/marktext.dmg -[12]: https://github.com/marktext/marktext/releases/latest/download/marktext-setup.exe -[13]: https://github.com/marktext/marktext/blob/develop/LICENSE -[14]: https://github.com/marktext/marktext/releases -[15]: https://chocolatey.org/ -[16]: https://github.com/marktext/marktext/blob/develop/CONTRIBUTING.md diff --git a/translated/tech/20211019 Why Mark Text is my favorite markdown editor.md b/translated/tech/20211019 Why Mark Text is my favorite markdown editor.md new file mode 100644 index 0000000000..aa449595c1 --- /dev/null +++ b/translated/tech/20211019 Why Mark Text is my favorite markdown editor.md @@ -0,0 +1,92 @@ +[#]: subject: "Why Mark Text is my favorite markdown editor" +[#]: via: "https://opensource.com/article/21/10/mark-text-markdown-editor" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +Mark Text:我最喜欢的 Markdown 编辑器 +====== + +> Mark Text 拥有的工具使得撰写 Markdown 变得容易,同时又提供了一个不会打扰我的简单的界面。 + +![](https://img.linux.net.cn/data/attachment/album/202110/27/141244m9os557ss7au6oas.jpg) + +几年前,当我开始使用 Jupyter 笔记本时,我接触到了 Markdown 格式。许多作者都知道 Markdown,但这是我不熟悉的一种技能。 + +Markdown 是一种标准的文本写作方式,在这种方式中,你可以用精简的符号来标记你想要的文本样式。例如,你不用点击一个按钮来使一个词变粗体,而是用两个星号(`**word**`)包围这个词。这有两种效果: + + * 当作为纯文本查看时,视觉上显示出强调的文本 + * 如果有一个好的文本转换器或渲染器(如 Pandoc 或一个好的 Markdown 文本编辑器),就会显示为加粗。 + +Markdown 最大的优点之一是它的大部分符号都是直观的,并且来自我们大多数人已有的习惯。它使得用星号强调单词,用字符标记标题以区分它们等等变得很自然。 + +每个人都对它评价很高,但我不确定为什么我需要学习和使用 Markdown。然而,我是一个好奇的人,我开始探索 Markdown,以及它如何在我的写作中发挥作用。 + +### 学习 Markdown + +我很喜欢在学习时使用 [Markdown 速查表][2]。我发现 Markdown 是一个很好的工具,可以写任何内容,而且我很喜欢甚至不需要一个专门的 Markdown 编辑器这一点。任何文本编辑器都可以写 Markdown,因为 Markdown 使用标准文本来表示样式。我开始使用简单的编辑器,如 Vim 或 gedit(或任何其他编辑器),并查阅这个速查表以记住简单的格式化规则。 + +今年我一直在写日记,作为组织我的想法和学习更多关于 Markdown 的方法。我最近尝试了 [Ghostwriter][3] 文本编辑器,这是一个优秀的编辑器,有一些额外的 Markdown 特定功能。Markdown 现在已经变得非常流行了,许多编辑器都加入了语法高亮、提示和其他使 Markdown 编写变得容易的功能,或者将其作为重点。它们不是必须的功能,但当你拥有它们时,还是很好的。  + +### 尝试 Mark Text + +在阅读一个博客时,我发现了 [Mark Text][4]。Mark Text 使写 Markdown 变得很容易,同时提供了一个简单的界面,而且又不影响我。Mark Text 有六个主题,三个浅色和三个深色主题。深色主题对我来说更容易使用。它的 [用户文档][5] 非常好,而且也提供了 Markdown 的 [语法帮助][6]。  + +### Markdown 的实时预览 + +Mark Text 以简洁的界面提供了实时预览功能。它支持 [Commonmark][7] 规范、Github 风格的 Markdown 规范,以及 Pandoc Markdown。据其网站说,Mark Text 还支持 KaTex、front matter 和 emoji 等 Markdown 扩展。它还可以输出 HTML 和 PDF 文件。  + +Mark Text 有各种编辑模式,如打字模式、源代码模式和专注模式。添加图片是一件很容易的事,因为你可以简单地从剪贴板上复制和粘贴它们。 + +在 Mark Text 窗口的左上方有一个弹出窗口,显示迄今为止输入的字符和段落数量。作为一个作家,这真的很有帮助。 + +从 Mark Text 窗口左上方的菜单或使用 `Ctrl+S` 保存文件很容易。事实上,Mark Text 的菜单对任何习惯于基本文本编辑器或文字处理器的人来说都是友好和熟悉的。 + +![Mark Text 文件菜单][8] + +我喜欢 Mark Text 用简单的快捷键支持各种格式,包括表格块、图表、行内格式、数学公式块和其他代码块。 + +你可以从以下链接中为你的操作系统下载 Mark Text: + + * [Linux][10] + * [macOS][11] + * [Windows][12] + +Mark Text 以 [MIT][13] 许可证开源。你可以随时 [下载][14] 最新的版本。 + +另外,你可以用 `brew install --cask mark-text` 在 macOS 上安装 Mark Text,在 Windows 上用 [Chocolatey][15] 输入 `choco install marktext` 来安装它。 + +Mark Text 一直在寻找赞助商和开发者。该项目有一个给贡献者的 [指南][16]。此外,你可以在 Patreon 和 Open Collective 上支持该项目。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/mark-text-markdown-editor + +作者:[Don Watkins][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/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-docdish-typewriterkeys-3.png?itok=NyBwMdK_ (Typewriter keys in multicolor) +[2]: https://opensource.com/downloads/cheat-sheet-markdown +[3]: https://wereturtle.github.io/ghostwriter/ +[4]: https://marktext.app/ +[5]: https://github.com/marktext/marktext/blob/master/docs/README.md +[6]: https://github.com/marktext/marktext/blob/master/docs/MARKDOWN_SYNTAX.md +[7]: https://commonmark.org/ +[8]: https://opensource.com/sites/default/files/uploads/mark-test-file-menu.png (Mark Text file menu) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://github.com/marktext/marktext/releases/latest/download/marktext-x86_64.AppImage +[11]: https://github.com/marktext/marktext/releases/latest/download/marktext.dmg +[12]: https://github.com/marktext/marktext/releases/latest/download/marktext-setup.exe +[13]: https://github.com/marktext/marktext/blob/develop/LICENSE +[14]: https://github.com/marktext/marktext/releases +[15]: https://chocolatey.org/ +[16]: https://github.com/marktext/marktext/blob/develop/CONTRIBUTING.md From 06ec07a1529117198feceaa5f8860dfd1fee495f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Oct 2021 14:16:53 +0800 Subject: [PATCH 23/56] PUB @wxy https://linux.cn/article-13926-1.html --- .../20211019 Why Mark Text is my favorite markdown editor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20211019 Why Mark Text is my favorite markdown editor.md (98%) diff --git a/translated/tech/20211019 Why Mark Text is my favorite markdown editor.md b/published/20211019 Why Mark Text is my favorite markdown editor.md similarity index 98% rename from translated/tech/20211019 Why Mark Text is my favorite markdown editor.md rename to published/20211019 Why Mark Text is my favorite markdown editor.md index aa449595c1..847c4ceb2c 100644 --- a/translated/tech/20211019 Why Mark Text is my favorite markdown editor.md +++ b/published/20211019 Why Mark Text is my favorite markdown editor.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13926-1.html" Mark Text:我最喜欢的 Markdown 编辑器 ====== From d0af4673fb404857d0b2ddf74f113ebb3d88c58f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 Oct 2021 05:02:44 +0800 Subject: [PATCH 24/56] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211027=20Ho?= =?UTF-8?q?w=20I=20made=20an=20automated=20Jack-o'-lantern=20with=20a=20Ra?= =?UTF-8?q?spberry=20Pi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211027 How I made an automated Jack-o--lantern with a Raspberry Pi.md --- ...ted Jack-o--lantern with a Raspberry Pi.md | 386 ++++++++++++++++++ 1 file changed, 386 insertions(+) create mode 100644 sources/tech/20211027 How I made an automated Jack-o--lantern with a Raspberry Pi.md diff --git a/sources/tech/20211027 How I made an automated Jack-o--lantern with a Raspberry Pi.md b/sources/tech/20211027 How I made an automated Jack-o--lantern with a Raspberry Pi.md new file mode 100644 index 0000000000..25c2e6f2f4 --- /dev/null +++ b/sources/tech/20211027 How I made an automated Jack-o--lantern with a Raspberry Pi.md @@ -0,0 +1,386 @@ +[#]: subject: "How I made an automated Jack-o'-lantern with a Raspberry Pi" +[#]: via: "https://opensource.com/article/21/10/halloween-raspberry-pi" +[#]: author: "Jessica Cherry https://opensource.com/users/cherrybomb" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I made an automated Jack-o'-lantern with a Raspberry Pi +====== +Here's my recipe for the perfect pumpkin Pi. +![A vignette of green, orange, and yellow pumpkins in front of a brick wall][1] + +It's almost Halloween, one of my favorite days and party times. This year, I decided to (pumpkin) spice up some of my decorations with automated motion sensing. This spooktacular article shows you how I made them, step by step, from building and wiring to coding. This is not your average weekend project—it takes a lot of supplies and building time. But it's a fun way to play around with Raspberry Pi and get in the spirit of this haunting holiday. + +### What you need for this project + + * One large plastic pumpkin + * One Raspberry Pi 4 (with peripherals) + * One Arduino starter kit that works with Raspberry Pi + * One hot glue gun + * Ribbon, ideally in holiday theme colors + + + +The items you'll need in the starter kit are one infrared motion sensor, a breadboard, two small LED lights, a ribbon to connect the breadboard to the Raspberry Pi, and cabling to configure all of these pieces together. You can find each of these items online, and I suggest the starter kit for the entertaining things you can do beyond this project. + +![Raspberry Pi computer board][2] + +Jess Cherry CC BY-SA 4.0 + +![Cables and and LEDs for the project][3] + +Jess Cherry CC BY-SA 4.0 + +![Project supplies including breadboard, cables, LEDs, and elements of the Arduino starter kit][4] + +Jess Cherry CC BY-SA 4.0 + +### Installing the Raspberry Pi OS and preconfiguration + +After receiving my Pi, including the SD card, I went online and followed the Raspberry Pi imager [instructions][5]. This allowed for quick installation of the OS onto the SD card. Note: you need the ability to put the SD card in an SD card-reader slot. I have an external attached SD card reader, but some computers have them built in. On your local computer, you also need a VNC viewer. + +After installing the OS and running updates, I had some extra steps to get everything to work correctly. To do this, you'll need the following: + + * Python 3 + * Python3-devel + * Pip + * RPi GPIO (pip install RPi.GPIO) + * A code editor (Thonny is on the Raspberry Pi OS) + + + +Next, set up a VNCviewer, so you can log in when you have the Pi hidden in your pumpkin. + +To do this, run the below command, then follow the instructions below. + +`sudo raspi-config` + +When this menu pops up, choose Interface Options: + +![Raspberry Pi Software Configuration Tool menu][6] + +Jess Cherry CC BY-SA 4.0 + +Next, choose VNC and enable it on the pop-up: + +![Raspberry Pi Software Configuration Tool menu of interface options][7] + +Jess Cherry CC BY-SA 4.0 + +You can also use Secure Shell (SSH) for this, but during the troubleshooting phase, I used VNC. When logged into your Raspberry Pi, gather the IP address and use it for SSH and a VNC connection. If you've moved rooms, you can also use your router or WiFi switch to tell you the IP address of the Pi. + +Now that everything is installed, you can move on to building your breadboard with lights. + +### Everyone should try pumpkin bread(board) + +Many people haven't seen or worked with a breadboard, so I've added pictures of my parts, starting with my base components. + +![GPIO Extension Board and Ribbon Cable][8] + +Jess Cherry CC BY-SA 4.0 + +![Breadboard][9] + +Jess Cherry CC BY-SA 4.0 + +These two pieces are put together with the extension shield in the center, as shown. + +![Breadboard with cables, pins, and ribbons, partially set up for the project][10] + +Jess Cherry CC BY-SA 4.0 + +The ribbon connects to the pin slot in the Raspberry Pi, making the board a new extension we can code and play with. The ribbon isn't required, it's just makes working with the GPIO pins convenient. If you don't want to purchase a ribbon, you can connect female-to-male jumper cables directly from the pins on the Pi to the breadboard. Here are the components you need: + + * Raspberry Pi (version 4 or 3) + * Breadboard + * GPIO expansion ribbon cable + * Jumper cables (x6 male-to-male) + * Resistor 220Ω + * HC-SR501 or any similar proximity sensor (x1) + * LED (x2) + + + +### Putting the board together + +Once you have all of the pieces, you can put everything together. First, take a look at how the pins are defined on the board. This is my personal extension board; the one you have may be different. The pin definitions matter when you get to coding, so keep very good track of your cabling. Below is the schematic of my extension. + +As you can see, the schematic has both the defined BCM (Broadcom SOC Channel) GPIO numbering on the physical board and the physical numbering you use within the code to create routines and functions. + +![Schematic of Raspberry Pi extension board][11] + +Jess Cherry CC BY-SA 4.0 + +Now it's time to connect some cabling. First, start with the sensor. I was provided with cables to connect in my kit, so I'll add pictures as I go. This is the sensor with a power(+) ground(-) and sensor connection to extension board(s). + +![Sensor illustration with power, ground, and sensor connection][12] + +Jess Cherry CC BY-SA 4.0 + +For the cable colors: power is red, ground is black, and yellow carries the sensor data. + +![Photo of a hand holding the sensor with black, red, and yellow cables][13] + +Jess Cherry CC BY-SA 4.0 + +I plug in the cables with power/red to the 5V pin, ground/black to the GRN pin, and sensor/yellow to the GPIO 17 pin, later to be defined as 11 in the code. + +![Breadboard with sensor cables attached][14] + +Jess Cherry CC BY-SA 4.0 + +Next, it's time to set up the lights. Each LED light has two pins, one shorter than the other. The long side (anode) always lines up with the pin cable, and the shorter (cathode) with the ground and resistor. + +![LED light with pin, cables, and resistor][15] + +Jess Cherry CC BY-SA 4.0 + +For the first light, I use GPIO18 (pin 12) and GPIO25 for the signal. This is important because the code communicates with these pins. You can change which pin you use, but then you must change the code. Here's a diagram of the end result: + +![Illustration of connections from breadboard to Raspberry Pi, sensor, and LEDs][16] + +Jess Cherry CC BY-SA 4.0 + +Now that everything is cabled up, it's time to start working on the code. + +### How to use a snake to set up a pumpkin + +If you've already installed Python 3, you have everything you need to start working through this line by line. In this example, I am using Python 3 with the RPI package. Start with the imported packages, RPI and time from sleep (this helps create the flicker effect described later in the tutorial). I called my Python file senseled.py, but you can name your file whatever you want. + + +``` +#!/usr/bin/env python3 + +import RPi.GPIO as GPIO +import os +from time import sleep +``` + +Next, define your two LED pins and sensor pin. Earlier in this post, I provided these pin numbers while wiring the card, so you can see those exact numbers below. + + +``` +ledPin1 = 12 # define ledPins +ledPin2 = 22 +sensorPin = 11 # define sensorPin +``` + +Since you have two lights to set up to flicker together in this example, I also created a defined array to use later: + +`leds = [ledPin1, ledPin2]` + +Next, define the setup of the board and pins using the RPi.GPIO package. To do this, set the mode on the board. I chose to use the physical numbering system in my setup, but you can use the BCM if you prefer. Remember that you can never use both. Here's an example of each: + + +``` +# for GPIO numbering, choose BCM +GPIO.setmode(GPIO.BCM) +  +# or, for pin numbering, choose BOARD +GPIO.setmode(GPIO.BOARD) +``` + +For this example, use the pin numbering in my setup. Set the two pins to output mode, which means all commands output to the lights. Then, set the sensor to input mode so that as the sensor sees movement, it inputs the data to the board to output the lights. This is what these definitions look like: + + +``` +def setup(): + GPIO.setmode(GPIO.BOARD) # use PHYSICAL GPIO Numbering + GPIO.setup(ledPin1, GPIO.OUT) # set ledPin to OUTPUT mode + GPIO.setup(ledPin2, GPIO.OUT) # set ledPin to OUTPUT mode + GPIO.setup(sensorPin, GPIO.IN) # set sensorPin to INPUT mode +``` + +Now that the board and pins are defined, you can put together your main function. For this, I use the array in a `for` loop, then an if statement based on the sensor input. If you are unfamiliar with these functions, you can check out this [quick guide][17]. + +If the sensor receives input, the LED output is high (powered on) for .03 seconds, then low (powered off) while printing the message `led turned on.` If the sensor receives no input, the LEDs are powered down while printing the message `led turned off`. + + +``` +def main(): + while True: + for led in leds: + if GPIO.input(sensorPin)==GPIO.HIGH: + GPIO.output(led, GPIO.HIGH) + sleep(.05) + GPIO.output(led, GPIO.LOW) + print ('led turned on >>>') + else : + GPIO.output(led, GPIO.LOW) # turn off led + print ('led turned off <<<') +``` + +While you can mathematically choose the brightness level, I found it easier to set the sleep timer between powering on and powering off. I set this after many tests of the amount of time needed to create a flickering candle effect. + +Finally, you need some clean up to release your resources when the program is ended: + + +``` +def destroy(): + GPIO.cleanup() # Release GPIO resource +``` + +Now that everything has been defined to run, you can run your code. Start the program, run the setup, try your main, and if a KeyboardInterrupt is received, destroy and clean everything up. + + +``` +if __name__ == '__main__': # Program entrance + print ('Program is starting...') + setup() + try: + main() + except KeyboardInterrupt: # Press ctrl-c to end the program. + destroy() +``` + +Now that you've created your program, the final result should look like this: + + +``` +#!/usr/bin/env python3 + +import RPi.GPIO as GPIO +import os +from time import sleep + +ledPin1 = 12 # define ledPins +ledPin2 = 22 +sensorPin = 11 # define sensorPin +leds = [ledPin1, ledPin2] + +def setup(): + GPIO.setmode(GPIO.BOARD) # use PHYSICAL GPIO Numbering + GPIO.setup(ledPin1, GPIO.OUT) # set ledPin to OUTPUT mode + GPIO.setup(ledPin2, GPIO.OUT) # set ledPin to OUTPUT mode + GPIO.setup(sensorPin, GPIO.IN) # set sensorPin to INPUT mode + +  +def main(): + while True: + for led in leds: + if GPIO.input(sensorPin)==GPIO.HIGH: + GPIO.output(led, GPIO.HIGH) + sleep(.05) + GPIO.output(led, GPIO.LOW) + print ('led turned on >>>') + else : + GPIO.output(led, GPIO.LOW) # turn off led + print ('led turned off <<<') +  + +def destroy(): + GPIO.cleanup() # Release GPIO resource + +if __name__ == '__main__': # Program entrance + print ('Program is starting...') + setup() + try: + main() + except KeyboardInterrupt: # Press ctrl-c to end the program. + destroy() +``` + +When it runs, it should look similar to this. (Note: I was still testing with sleep time during this recording.) + +### Time to bake that pumpkin + +To start, I had a very large plastic pumpkin gifted by our family to my husband and me. + +![A large, smiling orange jack o'lantern][18] + +Jess Cherry CC BY-SA 4.0 + +Originally, it had a plug in the back with a bulb that was burnt out, which is what inspired this idea in the first place. I realized I'd have to make some modifications, starting with cutting a hole in the bottom using a drill and jab saw. + +![A man drilling a hole in the bottom of a large plastic jack o'lantern][19] + +Jess Cherry CC BY-SA 4.0 + +![A hole that takes up most of the bottom of the plastic jack o'lantern][20] + +Jess Cherry CC BY-SA 4.0 + +Luckily, the pumpkin already had a hole in the back for the cord leading to the original light. I could stuff all the equipment inside the pumpkin, but I needed a way to hide the sensor. + +First, I had to make a spot for the sensor to be wired externally to the pumpkin, so I drilled a hole by the stem: + +![A small hole drilled in the brown stem of the jack o'lantern][21] + +Jess Cherry CC BY-SA 4.0 + +Then I put all the wiring for the sensor through the hole, which ended up posing another issue: the sensor is big and weird-looking. I went looking for a decorative way to resolve this. + +![The sensor hanging around the stem of the pumpkin, and a spool of ribbon][22] + +Jess Cherry CC BY-SA 4.0 + +I did, in fact, make the scariest ribbon decoration (covered in hot glue gun mush) in all of humanity, but you won't notice the sensor. + +![A large bow with orange, black, and patterned ribbon completely covers the sensor][23] + +Jess Cherry CC BY-SA 4.0 + +Finally, I put the Pi and extension card in the pumpkin and cabeled the power through the back. + +![The breadboard and cables fit inside the hole in the bottom of the jack o'lantern][24] + +Jess Cherry CC BY-SA 4.0 + +With everything cabled, I was ready to VNC into my Pi and turn on the Python, then wait for something to move to test it out. + +![VNC viewer with Python file running][25] + +Jess Cherry CC BY-SA 4.0 + +![senseled.py running, showing led turned off switching to led turned on][26] + +Jess Cherry CC BY-SA 4.0 + +### Post baking notes + +This was a really long and very researched build. As I said in the introduction, this isn't a weekend project. I knew nothing about breadboards when I started, and it took me a while to recode and determine exactly what I wanted. There are some very granular details I did not include here. For example, the sensor has two knobs that define how far it can pick up motion and how long the sensor input needs to continue. While this was a fantastic thing to learn, I would definitely do a lot of research before pursuing this journey. + +I did not get to one part of the project that I really wanted: the ability to connect to a Bluetooth device and make spooky noises. That said, playing with a Raspberry Pi is always fun to do, whether with home automation, weather tracking, or just silly decorations. I hope you enjoyed this walk-through and feel inspired to try something similar yourself. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/halloween-raspberry-pi + +作者:[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/pumpkins.jpg?itok=00mvIoJf (A vignette of green, orange, and yellow pumpkins in front of a brick wall) +[2]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_1.png (Raspberry Pi computer board) +[3]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_3.png (Cables and LEDs) +[4]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_4.png (Project supplies) +[5]: https://www.raspberrypi.com/documentation/computers/getting-started.html#using-raspberry-pi-imager +[6]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_5.png (Menu) +[7]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_6.png (Menu) +[8]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_7.png (Board and cable) +[9]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_8.png (Breadboard) +[10]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_9.png (Partially set-up breadboard) +[11]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_11.png (Extension board) +[12]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_12.png (Sensor) +[13]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_13.png (Sensor with cables) +[14]: https://opensource.com/sites/default/files/uploads/pumpkin_pi15.png (Breadboard with sensor cables attached) +[15]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_16.png (Light setup) +[16]: https://opensource.com/sites/default/files/uploads/pumpkinpi_bb.jpeg (Illustration of connections) +[17]: https://opensource.com/article/18/3/loop-better-deeper-look-iteration-python +[18]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_18.png (the pumpkin) +[19]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_19.png (Drilling) +[20]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_20.png (Pumpkin hole) +[21]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_21.png (Sensor hole) +[22]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_24.png (The unhidden sensor) +[23]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_25.png (Sensor disguise ribbons) +[24]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_28.png (Enclosing the kit) +[25]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_29.png (VNC viewer) +[26]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_31.png (LED turns on) From 65794625b1a31e602262f541c1c8dfa7c68a60d1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 Oct 2021 05:03:01 +0800 Subject: [PATCH 25/56] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211027=20Gl?= =?UTF-8?q?obal=20communication=20in=20open=20source=20projects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211027 Global communication in open source projects.md --- ...l communication in open source projects.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20211027 Global communication in open source projects.md diff --git a/sources/tech/20211027 Global communication in open source projects.md b/sources/tech/20211027 Global communication in open source projects.md new file mode 100644 index 0000000000..1378fbae19 --- /dev/null +++ b/sources/tech/20211027 Global communication in open source projects.md @@ -0,0 +1,112 @@ +[#]: subject: "Global communication in open source projects" +[#]: via: "https://opensource.com/article/21/10/global-communication-open-source" +[#]: author: "Rachel Naegele https://opensource.com/users/ranaegele" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Global communication in open source projects +====== +An interview with FreeDOS Project founder Jim Hall on communicating +effectively around the world. +![Globe up in the clouds][1] + +I am a current graduate student at the University of Minnesota, Twin Cities in the Scientific and Technical Communication MS program. The following is an interview I conducted with [Jim Hall][2] to learn about international professional communication strategies in the multinational group, the FreeDOS Project. + +**You started the [FreeDOS project][3] in 1994. How did you communicate with the global network of developers for this project at the beginning? How have your communication strategies for international communication changed over the years?** + +We've gone through a few different ways to communicate with each other. + +In the early 1990s, USENET was a common way to communicate with a group of people. USENET was very similar to a message forum, but it was globally distributed. Topics were arranged in groups. You could post a message in a USENET group, and someone else would see it and possibly reply to it. + +I posted the [first announcement][4] about FreeDOS on the comp.os.msdos.apps group. As we got started on FreeDOS, we used that group to discuss our development work. There are a few benefits of using a group like that: + + * It was global, so everyone could participate. + * It was asynchronous, so it didn't matter what timezone you lived in. + * It was open, so everyone could see the conversation. + + + +Around 1996, we moved from USENET to an email list. Email lists were very common at the time, and they remain popular for some uses, such as ours. With an email list, whenever someone sends a message to the list, everyone gets a copy. The downside is that very active email lists can fill up your inbox. But the FreeDOS email lists aren't as active these days as they once were, so our email lists don't tend to have a high bandwidth. + +Over the years, folks have experimented with other ways to communicate. Robert Riebisch at BTTR Software set up a general web-based discussion board called ["DOS Ain't Dead"][5] to discuss DOS projects in 1997, and it's still a popular forum for general DOS topics. You can also find FreeDOS topics discussed there. That's not our official discussion board, however; the official place for all FreeDOS development discussions is the [freedos-devel email list][6]. + +We use freedos-devel to discuss upcoming changes to the FreeDOS distribution, announce new versions of programs, ask for programming help, and generally talk about DOS development. + +**What communication issues have you run into while working with a global team? How did you resolve these issues?** + +With developers all around the world, in so many languages, from so many cultures, we have had our share of communication issues. + +Our de facto language on the email list is English. We never set that as a rule, but almost everyone communicates in English anyway. Sometimes a new subscriber to the email list sends a message in another language, but usually someone who speaks that language can reply to them. + +Inevitably, we do have miscommunication issues, usually because of cultural or language problems. For example, someone who doesn't speak English fluently might say something in an awkward way, and someone else might respond negatively to that. But these instances are pretty rare, I think. And we have strong [email list rules][7] that say (among other things) that you need to be nice to each other. And folks police each other pretty well; if there's an issue, it's usually short-lived. + +Other issues include culture clash. In international communication, there's a concept of [high-context and low-context][8] communicators. Germany is a typical example of a low-context culture: They get right to the point with very little small talk. Other cultures might see the German style as speaking bluntly, but to a German, that's just a natural way to communicate. On the other hand, Korea or Japan is a typical example of a high-context culture; it would be very unusual for a high-context communicator to talk about a problem in a very direct way. + +In the United States, we're more low context than high context, at about the one-quarter mark. + +One example of this culture clash is when a user from a high-context country emailed the list to report a bug. I suppose this person viewed a program bug as an embarrassment for the developer, so the person didn't address the bug directly. They didn't provide a specific description of the bug. The other developers on the email list didn't respond well to that. I recall replies along the lines of "What's the problem here?" or "What are you talking about?" All because we communicate differently depending on our background. + +**What have been the biggest challenges in creating a DOS for an international audience?** + +I'm really glad that we have some very active people in FreeDOS who are working on translating messages in all these programs. There are a few folks who contribute to FreeDOS by translating messages from one language to another and sharing those message files so we can use them in the FreeDOS distribution. + +FreeDOS is a small operating system with low memory constraints, so actually our biggest challenge has been technical. + +In a more modern system like Linux, you can provide message translation through a service like [catgets][9] or [gettext][10]. Both are programming libraries where the program says, "I need this string [text] in the user's preferred language," and the library gives the program that string. This is an example of internationalization, by providing translations in different languages. + +But writing a library like that can take a lot of memory, and a 16-bit operating system like DOS doesn't have a lot of memory to spare. So most early FreeDOS programs didn't bother dealing with it. If the programmer spoke English, they probably wrote their program to use English messages and to accept English input (such as "y" for "yes," and so on). + +Unfortunately, that meant someone in Spain or France or Portugal who didn't understand English would have a hard time using FreeDOS. So, I wrote a simplified version of catgets for FreeDOS called Cats. It provided the same catgets function feature set, which meant if you were porting or translating a program from Linux to run on FreeDOS, the catgets function would do the same thing. The programmer wouldn't need to change anything in the source code for the program to work on FreeDOS; they just used FreeDOS Cats. + +Catgets looks up a message or string using a _message catalog_ (a file that contains a list of messages in a specific language) and a pair of numbers called the _message set_ and the _message number._ The name catgets comes from the catalog to get a string in the user's preferred language. For example, a message to say "Hello" to the user might be stored in message set 1, as message number 2 in that message set. So you'd have this line in an English catalog file: + +`1.2:Hello` + +And you'd have other language catalog files that had the same messages translated to other languages. A Spanish catalog might have this line to represent the same message: + +`1.2:Hola` + +Tom Ehlert modified Cats to be even smaller but also much simpler. This version was named Kitten. Cats and Kitten solved the problem pretty well. A translator could create a message catalog by editing a plain text file, and someone else could use that right away. A lot of FreeDOS programs adopted Cats or Kitten to provide message internationalization. That solved a huge problem for us! + +Kitten is not the only solution. Different developers might solve the language problem in different ways. But Kitten is probably the most popular way to do it. + +**What are some of the main factors that you consider when communicating interculturally?** + +For me, I need to be aware of who I'm talking to when I send a message. If I'm emailing a specific person, I'll use the email they sent me as a guide to guess whether they prefer a high-context or low-context answer. If I don't know, I'll probably default to a lower context mode. That means I'll get to the point quickly, but it's okay to set up some context. + +If I'm writing for a more general audience (such as sending emails to our email list, posting an announcement to our website, or whatever), I'll also adopt the lower context communication mode. That's more important on a website, where many readers will probably click off the site if it's too wordy. + +**Using your time working on the FreeDOS project as a reference, what advice would you give to someone looking to increase their intercultural communication competence?** + +Ever since I learned about high-context vs. low-context communication styles, I've used that as a guide. For anyone who wants to increase their intercultural communication competence, I recommend learning the high- vs. low-context spectrum. Build your own understanding of where different cultures are placed on this spectrum: Italy tends to be around the middle, the UK tends to be around the one-third mark, and so on. + +Beyond that, I would recommend always assuming positive intent. If someone reached out to you in an email, read past any preconceptions about how that person communicated and find the message they wanted to convey. A high-context communicator will rarely hit an issue head-on, so you may need to read more carefully. A low-context communicator will probably seem very blunt, but they are just trying to get to the point quickly. + +Don't assume based on your own context. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/global-communication-open-source + +作者:[Rachel Naegele][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/ranaegele +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud-globe.png?itok=_drXt4Tn (Globe up in the clouds) +[2]: https://opensource.com/users/jim-hall +[3]: https://www.freedos.org/ +[4]: https://groups.google.com/g/comp.os.msdos.apps/c/oQmT4ETcSzU/m/O1HR8PE2u-EJ +[5]: https://www.bttr-software.de/forum/board.php +[6]: http://lists.sourceforge.net/lists/listinfo/freedos-user +[7]: http://freedos.sourceforge.net/freedos/lists/remind.txt +[8]: https://en.wikipedia.org/wiki/High-context_and_low-context_cultures +[9]: https://www.ibm.com/docs/en/i/7.3?topic=functions-catgets-retrieve-message-from-message-catalog +[10]: https://www.gnu.org/software/gettext/manual/gettext.html From fc4fcadd9cf201370f2041c0b622befcb2f61776 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 28 Oct 2021 08:47:32 +0800 Subject: [PATCH 26/56] translated --- ...on Ubuntu and Other Linux Distributions.md | 114 ------------------ ...on Ubuntu and Other Linux Distributions.md | 114 ++++++++++++++++++ 2 files changed, 114 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md create mode 100644 translated/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md b/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md deleted file mode 100644 index d334666913..0000000000 --- a/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: subject: "Fixing “Unable to acquire dpkg frontend lock. Are You Root?” Error on Ubuntu and Other Linux Distributions" -[#]: via: "https://itsfoss.com/fixed-are-you-root-error/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Fixing “Unable to acquire dpkg frontend lock. Are You Root?” Error on Ubuntu and Other Linux Distributions -====== - -I am presuming you are quite new to Linux. - -You follow some tutorial on the internet that tells you to install a certain program or run some command. Probably it is something to do with a server. - -But when you run the command, you encounter this error: - -**E: Could not open lock file /var/lib/dpkg/lock-frontend – open (13: Permission denied) -E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?** - -A similar error is this one: - -dpkg: error: required read/write access to the dpkg database directory /var/lib/dpkg -**E: Sub-process dpkg –set-selections returned an error code (2) -E: Executing dpkg failed. Are you root?** - -Both errors ask you the same question: are you root? And that’s the answer to this problem. Become root. - -### Become root to avoid this error - -How do you [become root in Ubuntu][1] or Debian? You use the sudo command. - -Yes, that’s it. Whatever command you were running, just add sudo before it. - -``` -sudo your_command -``` - -![Running command with sudo][2] - -It will ask you to enter your user account password. Please keep in mind that nothing gets displayed on the screen when you type the password and that’s okay. - -There is nothing wrong with your system. In most Linux systems, password typing doesn’t show the usual asterisks or anything of that sort as a ‘security feature’. - -Just type your password and press enter after it. If the password was typed correctly, you should be able to run the command now. - -You can even use this handy [Linux command line trick][3] to run a previous command with sudo: - -``` -sudo !! -``` - -That was simple and works immediately, unless you do not have sudo access. Then, you’ll see a different error. - -### Seeing a ‘User is not in sudoer file’ error? - -![Some users cannot run commands with sudo][4] - -When you [install Ubuntu][5], you have to create a user account. This user is automatically granted sudo power to run commands as root when required. - -This happens on Ubuntu desktop, not servers. Most server distributions will have a separate root account. If you create a regular account separately, you’ll have to add the user to sudoer so that this normal user can use sudo. - -In the screenshot above, I had created this additional user but did not add it to the sudo group. This means that user ‘prakash’ here does not have rights to use the sudo command and hence the system complains that ‘prakash is not in sudoers file’. - -#### Where is the incident reported? - -An incorrect sudo attempt is added to the system logs. It logs the user name, the virtual terminal number, location from where the command was run and which command was run. - -![Incorrect sudo attempts are logged into the system][6] - -The location of these logs differ from distribution to distribution. - -Normally, you may find it in journalctl logs or /var/log/auth.log file in Ubuntu, /var/log/audit/audit.log file in Fedora. - -#### What can you do if a user is not in sudoer list? - -What can you do when you cannot use sudo with the current user account? First, [verify if the user has sudo rights or not. If not, here are some options for][7] you: - - * Log in as root or switch to root (if you have root password). - * [Add the user into sudoer list][8] (if you have admin/sudo rights from some other user account). - * If you are in multi-user Linux system and do not have root or sudo access yourself, ask your sytem administrator to either grant your user sudo access or install the application you wanted to install. - - - -### Did this help? - -Sudo is a very comprehensive security mechanism, and it is much more than just allowing a normal user to become root. It helps in auditing the system to know which user ran which command with sudo. It can also be configured to allow a certain user to run only certain commands with sudo. - -You won’t see such granular sudo configuration on desktop Linux where it is preconfigured to allow any user in the sudo group to run any command as root with sudo. More on sudo in some other article. - -I hope while solving this classic beginner problem, you get some initial insights into the sudo command. Let me know if you have further questions on this topic in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/fixed-are-you-root-error/ - -作者:[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://itsfoss.com/root-user-ubuntu/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/running-commands-with-sudo.webp?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/linux-command-tricks/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/not-in-sudoer-file-error-800x289.png?resize=800%2C289&ssl=1 -[5]: https://itsfoss.com/install-ubuntu/ -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/sudo-incident-reported.png?resize=800%2C339&ssl=1 -[7]: https://linuxhandbook.com/check-if-user-has-sudo-rights/ -[8]: https://linuxhandbook.com/create-sudo-user/ diff --git a/translated/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md b/translated/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..7f4bc0ba6d --- /dev/null +++ b/translated/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md @@ -0,0 +1,114 @@ +[#]: subject: "Fixing “Unable to acquire dpkg frontend lock. Are You Root?” Error on Ubuntu and Other Linux Distributions" +[#]: via: "https://itsfoss.com/fixed-are-you-root-error/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +修复在 Ubuntu 和其他 Linux 发行版上 “Unable to acquire dpkg frontend lock. Are You Root?” 的错误 +====== + +我假设你对 Linux 很陌生。 + +你按照网上的一些教程,告诉你要安装某个程序或运行某个命令。可能是与服务器有关的东西。 + +但当你运行这个命令时,你遇到了这个错误: + +**E: Could not open lock file /var/lib/dpkg/lock-frontend – open (13: Permission denied) +E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?** + +或者类似的错误: + +dpkg: error: required read/write access to the dpkg database directory /var/lib/dpkg +**E: Sub-process dpkg –set-selections returned an error code (2) +E: Executing dpkg failed. Are you root?** + +这两个错误都在问你同一个问题:你是 root 吗?而这就是这个问题的答案。成为 root。 + +### 成为 root 以避免这个错误 + +你如何[在 Ubuntu][1] 或 Debian 中成为 root?你使用 sudo 命令。 + +是的,就是这样。无论你在运行什么命令,只要在它前面加上 sudo 即可。 + +``` +sudo your_command +``` + +![Running command with sudo][2] + +它将要求你输入你的用户账户密码。请记住,当你输入密码时,屏幕上不会显示任何东西,这也没关系。 + +你的系统没有任何问题。在大多数 Linux 系统中,输入密码时不会显示通常的星号或其他东西是一种“安全特性”。 + +只要输入密码,并在密码后按下回车键即可。如果密码输入正确,你现在应该可以运行该命令了。 + +你甚至可以使用这个方便的 [Linux 命令行技巧][3],用 sudo 运行以前的命令: + +``` +sudo !! +``` + +这很简单,而且立即生效,除非你没有 sudo 权限。然后,你会看到一个不同的错误。 + +### 看到一个 “User is not in sudoer file” 的错误? + +![Some users cannot run commands with sudo][4] + +当你[安装 Ubuntu][5] 时,你必须创建一个用户账户。这个用户被自动授予 sudo 权限,在需要时以 root 身份运行命令。 + +这发生在 Ubuntu 桌面上,而不是服务器上。大多数服务器发行版会有一个单独的 root 账户。如果你单独创建了一个普通账户,你就必须把这个用户添加到 sudoer 中,以便这个普通用户可以使用 sudo。 + +在上面的截图中,我已经创建了这个额外的用户,但没有将其添加到 sudo 组中。这意味着这里的用户 “prakash” 没有使用 sudo 命令的权限,因此系统抱怨 “prakash is not in sudoers file”。 + +#### 该事件在哪里报告? + +一个错误的 sudo 尝试被添加到系统日志中。它记录了用户名、虚拟终端号、运行命令的位置和运行的命令。 + +![Incorrect sudo attempts are logged into the system][6] + +这些日志的位置在不同的发行版中有所不同。 + +通常,在 Ubuntu 中你可以在 journalctl 日志或 /var/log/auth.log 文件中找到它,在 Fedora 中可以在 /var/log/audit/audit.log 文件中找到它。 + +#### 如果一个用户不在 sudoer 列表中,你能做什么? + +当你不能用当前的用户账户使用 sudo 时,你能做什么?首先,[验证该用户是否有 sudo 权限。如果没有,你可以有一些选择][7]: + + * 以 root 身份登录或切换 root 身份(如果你有 root 密码)。 + * [将该用户加入 sudoer 列表][8] (如果你有其他用户账户的管理/sudo 权限)。 + * 如果你在多用户的 Linux 系统中,自己没有 root 或 sudo 权限,请你的系统管理员授予你的用户 sudo 权限或安装你想安装的应用。 + + + +### 这有帮助吗? + +Sudo 是一个非常全面的安全机制,它不仅仅是允许一个普通用户成为 root。它有助于对系统进行审计,了解哪个用户用 sudo 运行了哪个命令。它还可以被配置为只允许某个用户用 sudo 运行某些命令。 + +你不会在桌面 Linux 上看到如此细化的 sudo 配置,在桌面 Linux 上,它被预先配置为允许 sudo 组中的任何用户以 sudo 的身份运行任何命令。关于 sudo 的更多信息,请参见其他文章。 + +我希望在解决这个经典的初学者问题时,你能对 sudo 命令有一些初步的了解。如果你对这个主题有进一步的问题,请在评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fixed-are-you-root-error/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者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://itsfoss.com/root-user-ubuntu/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/running-commands-with-sudo.webp?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/linux-command-tricks/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/not-in-sudoer-file-error-800x289.png?resize=800%2C289&ssl=1 +[5]: https://itsfoss.com/install-ubuntu/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/sudo-incident-reported.png?resize=800%2C339&ssl=1 +[7]: https://linuxhandbook.com/check-if-user-has-sudo-rights/ +[8]: https://linuxhandbook.com/create-sudo-user/ From a98baed5736aa5cddbbdf14ad6e963c283b9e59d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 28 Oct 2021 08:52:32 +0800 Subject: [PATCH 27/56] translating --- ...Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md b/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md index 87b3549f4a..9d4ec0f2ac 100644 --- a/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md +++ b/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/ferdi/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 4f85f2e6a5a171ab02b2610e8768089a1cf671d5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 28 Oct 2021 10:42:26 +0800 Subject: [PATCH 28/56] Rename sources/tech/20211027 Global communication in open source projects.md to sources/talk/20211027 Global communication in open source projects.md --- .../20211027 Global communication in open source projects.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20211027 Global communication in open source projects.md (100%) diff --git a/sources/tech/20211027 Global communication in open source projects.md b/sources/talk/20211027 Global communication in open source projects.md similarity index 100% rename from sources/tech/20211027 Global communication in open source projects.md rename to sources/talk/20211027 Global communication in open source projects.md From 25753d4bc8f1bef3a585b8520db13ea7ac62fed0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 28 Oct 2021 11:20:09 +0800 Subject: [PATCH 29/56] PRF&PUB @geekpi https://linux.cn/article-13928-1.html --- ...ow to Convert a Webpage to PDF in Linux.md | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) rename {translated/tech => published}/20211021 How to Convert a Webpage to PDF in Linux.md (71%) diff --git a/translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md b/published/20211021 How to Convert a Webpage to PDF in Linux.md similarity index 71% rename from translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md rename to published/20211021 How to Convert a Webpage to PDF in Linux.md index 252c46a043..aa2a32d884 100644 --- a/translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md +++ b/published/20211021 How to Convert a Webpage to PDF in Linux.md @@ -3,45 +3,46 @@ [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13928-1.html" 如何在 Linux 下将网页转换为 PDF 文件 ====== +![](https://img.linux.net.cn/data/attachment/album/202110/28/111738tncncbml6jwcz6s8.jpg) + 当你将某些资源存档或用于教育目的时,将网页保存为 PDF 是很方便的。 -But, how do you convert a webpage to PDF in Linux? 但是,你如何在 Linux 中把一个网页转换成 PDF? -_**你可以选择使用每个 Linux 发行版上的网页浏览器(GUI),或者使用终端将网页变成 PDF 文件。**_ +你可以选择使用每个 Linux 发行版上的网页浏览器(GUI),或者使用终端将网页变成 PDF 文件。 在这里,我将提到这两种方法来帮助你完成工作。 ### 方法 1:使用网页浏览器将网页转换为 PDF 文件 -尽管我在本教程中使用的是 Mozilla Firefox,但你也可以用任何[可用于 Linux 的最佳浏览器][1]做同样的事情。 +尽管我在本教程中使用的是 Mozilla Firefox,但你也可以用任何 [可用于 Linux 的最佳浏览器][1] 做同样的事情。 ![][2] -1\. 加载你想转换的网页。 +1、加载你想转换的网页。 -2\. 在浏览器菜单中找到“**打印**”选项,或使用键盘快捷键 “**Ctrl + P**”。 +2、在浏览器菜单中找到“**打印**”选项,或使用键盘快捷键 `Ctrl + P`。 -3\. 默认情况下,它应该让你把它保存为 PDF。你需要点击“保存”,然后选择目的地并保存网页。 +3、默认情况下,它应该让你把它保存为 PDF。你需要点击“保存”,然后选择目的地并保存网页。 ![Save webpage as PDF in Mozilla Firefox][3] 这种简单方法的一个主要问题是,它包括页面上的所有元素。这可能包括评论、页脚等。你可以用一个 PDF 编辑器来删除部分内容,但这是一个额外的任务。 -_**更好的选择是利用一个浏览器扩展,如 [Print Friendly][4]。它允许你在下载 PDF 之前编辑和删除网页的部分内容**_。 +更好的选择是利用一个浏览器扩展,如 [Print Friendly][4]。它允许你在下载 PDF 之前编辑和删除网页的部分内容。 ### 方法 2:使用终端将网页转换为 PDF 或图片 -你可能已经知道,你可以[在 Linux 终端浏览互联网][5],甚至[使用命令行下载文件][6]。这并不奇怪,因为你可以在终端中做更多的事情,包括将网页下载为 PDF。 +你可能已经知道,你可以 [在 Linux 终端浏览互联网][5],甚至 [使用命令行下载文件][6]。这并不奇怪,因为你可以在终端中做更多的事情,包括将网页下载为 PDF。 -一个灵巧的开源命令行工具 **wkhtmltopdf** 和 **wkhtmltoimage** 来拯救你,让你把任何 HTML 网页转换成 PDF 或图像文件。 +一个灵巧的开源命令行工具 `wkhtmltopdf` 和 `wkhtmltoimage` 可以帮到你,让你把任何 HTML 网页转换成 PDF 或图像文件。 它使用 Qt WebKit 渲染引擎来完成这个任务。你可以浏览它的 [GitHub页面][7] 了解更多信息。 @@ -67,11 +68,11 @@ wkhtmltopdf URL/domain filename.pdf wkhtmltopdf linuxmint.com mint.pdf ``` -你可以选择使用 “****” 完整的 URL 或使用域名,如上面的例子所示。 +你可以选择使用 `https://linuxmint.com` 这样完整的 URL 或使用域名,如上面的例子所示。 默认情况下,生成的文件将保存在主目录下。 -在转换网页时,你还可以得到一些令人兴奋的选项。 +在转换网页时,你还可以得到一些好玩的选项。 例如,你可以**对 PDF 文件应用灰度过滤器**,在同一文件中**制作多个页面副本**,以及在转换过程中**排除**图像。 @@ -99,13 +100,13 @@ wkhtmltopdf --no-images linuxmint.com mint.pdf wkhtmltoimage linuxmint.com mint.png ``` -注意,与使用浏览器的 GUI 方法不同,通过终端使用这些工具有其局限性。它似乎不能成功转换利用任何 <iframe> 代码片段的网页。 +注意,与使用浏览器的 GUI 方法不同,通过终端使用这些工具有其局限性。它似乎不能成功转换利用任何 `