mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-21 02:10:11 +08:00
Merge branch 'LCTT:master' into master
This commit is contained in:
commit
63fc66cb24
@ -0,0 +1,72 @@
|
||||
[#]: subject: "Cutefish OS Development Restarts with A Revised Vision"
|
||||
[#]: via: "https://www.debugpoint.com/cutefish-development-restarts/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Cutefish OS Development Restarts with A Revised Vision
|
||||
======
|
||||
After a month of possible discussions, talks and threads, Cutefish OS officially restarts its development.
|
||||
|
||||
A while back, I wrote that [Cutefish OS stopped development][1], and there is no activity on GitHub. Well, it looks like the developers resurrected the project on GitHub with some vision of the future of the OS.
|
||||
|
||||
On July 31st, the main GitHub repo of Cutefish OS is updated with the following:
|
||||
|
||||
> Your Favorite CutefishOS are back now!New website in the works (coming soon)
|
||||
|
||||
Not only that, but the team also gave a brief about the roadmap of this project.
|
||||
|
||||
![Cutefish OS - Application Menu][2]
|
||||
|
||||
### Cutefish OS Development – Upcoming Milestones
|
||||
|
||||
Firstly, the primary object is the official website preparation.
|
||||
|
||||
Secondly, the next release would probably be based on [Ubuntu 22.04 LTS][3], as per the note on GitHub. Cutefish OS was available with different spins, such as Ubuntu and Debian. Also, you could install only the [Cutefish Desktop in Arch Linux][4].
|
||||
|
||||
Thirdly, the team aims to assess current issues and start accepting pull requests. After completing this exercise, it would be easier to prioritize the items that needed fixing. And finally, planning for the new features for future releases.
|
||||
|
||||
Not only that but there is also a possibility of a new Cutefish flavour with openEuler Linux. The [openEuler Linux][5] is a distribution created by Huawei for commercial and enterprise uses.
|
||||
|
||||
![Current Cutefish OS Plan][6]
|
||||
|
||||
### A New Name?
|
||||
|
||||
When I was looking for additional information, I found that the team registered a new domain with a new name, i.e. [openfish.org][7]. The desktop environment or entire OS would be renamed to openfish. It’s just a guess from my side at this point.
|
||||
|
||||
The old domain cutefishos.com was probably taken over by someone else, hence the decision.
|
||||
|
||||
But, in my opinion, “openfish” is a better branding name than “cutefish”.
|
||||
|
||||
### What’s Next
|
||||
|
||||
The last version of version 0.8 had several issues related to the Keyboard, settings windows, Flatpak apps, etc. The best way is to fix those as a first step with the last baseline. Then probably a version 1.0 with additional features.
|
||||
|
||||
Hopefully, we will get to see more updates on the development in the coming weeks. If you want to be heard and ask about expectations or feature requests, [create a post on GitHub][8].
|
||||
|
||||
Welcome back, Cutefish OS.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/cutefish-development-restarts/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/cutefish-os-development-halts/
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2021/11/Cutefish-OS-Application-Menu-1024x582.jpg
|
||||
[3]: https://www.debugpoint.com/web-stories/ubuntu-22-04-review/
|
||||
[4]: https://www.debugpoint.com/cutefish-arch-linux-install/
|
||||
[5]: https://www.openeuler.org/en/
|
||||
[6]: https://www.debugpoint.com/wp-content/uploads/2022/08/Current-Cutefish-OS-Plan.jpg
|
||||
[7]: http://openfish.org/
|
||||
[8]: https://github.com/cutefishos/cutefishos/issues
|
@ -0,0 +1,294 @@
|
||||
[#]: subject: "What is the Difference Between macOS and Linux?"
|
||||
[#]: via: "https://itsfoss.com/mac-linux-difference/"
|
||||
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
What is the Difference Between macOS and Linux?
|
||||
======
|
||||
|
||||
We often[compare Linux with Windows][1], but what about comparing it with macOS?
|
||||
|
||||
While the differences between Linux and Windows are quite obvious, Linux and macOS may seem similar to many.
|
||||
|
||||
Both can run Unix commands in the terminal, and the user experience is vastly different from Windows. And not all Windows applications and games are available for macOS and Linux.
|
||||
|
||||
This is why some people even think Apple’s macOS is based on Linux. But that is not the case. macOS is not Linux despite the similarities.
|
||||
|
||||
There are plenty of differences between the two UNIX-like operating systems and I shall highlight both the similarities and the differences in this article.
|
||||
|
||||
So, let’s compare Apple and Orange Penguin.
|
||||
|
||||
### macOS vs. Linux: Origins
|
||||
|
||||
macOS has a fascinating history. The foundation of it was built by Steve Jobs’s NeXT computer company when he wasn’t at Apple. Technically, it was based on the [Mach Kernel][2] and the UNIX-derived BSD.
|
||||
|
||||
Back then, a [NeXTSTEP][3] operating system was created to power the devices/computers built by **NeXT**. While it got some attention, it wasn’t a big success. Apple later acquired NeXT and brought back Steve onboard as part of the deal, making NeXTSTEP OS the base for macOS.
|
||||
|
||||
This is why macOS has a combination of Unix components along with Apple’s proprietary technologies.
|
||||
|
||||
**On the contrary**, Linux (the kernel) was built as a free and open-source replacement for Unix.
|
||||
|
||||
Linux is not an operating system but needs different components like [desktop environments][4] to form an operating system. There are [hundreds of Linux-based operating systems][5] called distributions.
|
||||
|
||||
For simplicity, we tend to address it as **Linux** OS instead of a specific Linux distribution.
|
||||
|
||||
### macOS kernel vs Linux kernel
|
||||
|
||||
The macOS kernel is officially known as XNU. The [acronym][6] stands for “XNU is Not Unix.” According to [Apple’s Github page][7], XNU is “a hybrid kernel combining the Mach kernel developed at Carnegie Mellon University with components from FreeBSD and C++ API for writing drivers”. The BSD subsystem part of the code is [“typically implemented as user-space servers in microkernel systems”][8]. The Mach part is responsible for low-level work, such as multitasking, protected memory, virtual memory management, kernel debugging support, and console I/O.
|
||||
|
||||
While the macOS kernel combines the feature of a microkernel ([Mach][9])) and a monolithic kernel ([BSD][10]), Linux is solely a monolithic kernel. A [monolithic kernel][11] is responsible for managing the CPU, memory, inter-process communication, device drivers, file system, and system server calls.
|
||||
|
||||
### Here’s What They Have in Common
|
||||
|
||||
macOS utilizes Unix components, and Linux was built as an alternative to Unix. So, what do we have in common here?
|
||||
|
||||
Both give access to **Unix commands, bash/zsh, and other shells**.
|
||||
|
||||
The [default shell][12] can be different, but you can always change it as per your preferences.
|
||||
|
||||
That’s about it. I can’t think of anything else similar between the two.
|
||||
|
||||
Probably a decade back, we could say that both Linux/macOS offered fewer applications.
|
||||
|
||||
But that’s not the case anymore.
|
||||
|
||||
The software ecosystem and game support for both have evolved over the years, which we will discuss later in this article.
|
||||
|
||||
### Codebase: Proprietary vs. Open-Source
|
||||
|
||||
![open source proprietary illustration][13]
|
||||
|
||||
macOS is a proprietary operating system, meaning you cannot view the complete operating system’s source code.
|
||||
|
||||
Sure, you have [part of the macOS (mostly GNU) libraries’ source code available][14]. There is also the [XNU kernel code][15] used in the development of macOS and iOS operating systems. But [you cannot just take this code and build a macOS clone][16] to be installed on any hardware.
|
||||
|
||||
It’s not the end of the world without the source code, but you get **less transparency** on Apple’s claims and practices to secure and enhance your computer experience.
|
||||
|
||||
Some might argue that proprietary code remains hidden for security reasons. However, both proprietary and open-source software remain vulnerable to threats.
|
||||
|
||||
**The difference between them** is: that open-source software often gets fixed sooner because of community participation by several developers, compared to limited employees working on macOS.
|
||||
|
||||
Unless you trust Apple without questions, Linux’s open-source model gets an edge.
|
||||
|
||||
### Purpose and Usage: macOS vs. Linux
|
||||
|
||||
macOS is tailored for desktop and laptop usage. It is well-suited for **video editing, graphics designing, and audio editing**.
|
||||
|
||||
When it comes to Linux, you get a host of possibilities. You can use Linux for:
|
||||
|
||||
* Desktop
|
||||
* Toaster (yes! I hope you know about [IoT][17])
|
||||
* Single Board Computers
|
||||
* Server
|
||||
|
||||
Of course, it is not the same experience when using it on various platforms, but Linux can run for various use-cases.
|
||||
|
||||
So, if you like Linux, you can choose to continue using it on other platforms for a comfortable experience.
|
||||
|
||||
### macOS vs Linux: User Experience
|
||||
|
||||
When it comes to user experience, it comes down to personal preferences.
|
||||
|
||||
macOS offers a **pleasing user interface**. It is visually appealing with subtle animations and high-resolution wallpapers/icons.
|
||||
|
||||
![macOS Monterey][18]
|
||||
|
||||
You can expect an easy and seamless experience across the platform.
|
||||
|
||||
With Linux, you can get an equally pleasing user interface that is easy to use.
|
||||
|
||||
![Zorin OS 16 Pro][19]
|
||||
|
||||
**Unfortunately**, the user experience slightly varies because of the distribution you decide to install and the desktop environment it comes along with.
|
||||
|
||||
You can explore some of the [best desktop environments][20] listed. You can even opt for [macOS-like Linux distributions][21].
|
||||
|
||||
For instance, if you are using **Pop!_OS, Ubuntu, Zorin OS, or elementary OS**, you could have an excellent user experience.
|
||||
|
||||
![Pop!_OS 22.04 LTS][22]
|
||||
|
||||
If you end up using something like MX Linux, or different, the user experience may not be comparable to macOS.
|
||||
|
||||
![MX Linux][23]
|
||||
|
||||
Overall, the out-of-the-box experience with Linux is inconsistent, but it is capable enough if you know what you are doing.
|
||||
|
||||
And if you are coming from Windows, the interface could be confusing initially.
|
||||
|
||||
### Customizability
|
||||
|
||||
![customizability][24]
|
||||
|
||||
If you want an operating system that lets you tinker with every aspect of it, macOS is not for you.
|
||||
|
||||
While Apple’s designs could be aesthetically pleasing by default, not everyone likes them.
|
||||
|
||||
If you want to personalize, take control, and heavily customize the operating system’s nuts and bolts, Linux should be the perfect pick.
|
||||
|
||||
You can choose to customize the user interface as much as you want, with a wide range of different elements, and go wild with your preferences. To get started, look at our [KDE customization][25] guide to explore the possibilities.
|
||||
|
||||
While that is good, it could backfire when customizing things on a Linux system. So, you need to learn/explore what you want to customize.
|
||||
|
||||
### Hardware Requirements to run macOS vs Linux
|
||||
|
||||
![hardware illustration][26]
|
||||
|
||||
This is where macOS suffers a solid defeat.
|
||||
|
||||
If you want access to macOS and have a good experience with it, you need to purchase Apple hardware, which is costly.
|
||||
|
||||
For example, the base configurations for macOS-powered laptops start with **8 GB of RAM** and **256 GB of storage**, available for **$1200** or more.
|
||||
|
||||
Unless you want to constantly use the swap space for multitasking and already have a cloud storage space, it would be a terrible idea to get one for yourself.
|
||||
|
||||
In contrast, if you would rather not spend a lot but still want a decent configuration for your system (PC/laptop), it is easy to get a device with 16 GB RAM + 512 GB SSD to run Linux for around 800 USD.
|
||||
|
||||
**A personal note**: I’m used to 32 Gigs of RAM + 500 GB of SSD storage. To get that kind of multitasking headroom (without using the swap), I will have to pay a premium to Apple.
|
||||
|
||||
Some skilled tinkerers try running macOS on non-Apple hardware. Such a system is called [Hackintosh][27] but it is certainly nowhere close to the comfort of running Linux on a regular computer.
|
||||
|
||||
### Software Ecosystem
|
||||
|
||||
macOS offers a **top-notch native experience** with macOS-exclusive applications or tools made by Apple.
|
||||
|
||||
Yes, you may have to purchase those applications. However, unlike some subscription options, you get one-time purchase alternatives with macOS for professional applications.
|
||||
|
||||
![Final Cut Pro on macOS][28]
|
||||
|
||||
For users who want to design, edit videos, edit photos, and have a creative workflow, macOS’s software suite should be a great choice if you do not mind investing in it.
|
||||
|
||||
The free Apple tools like iMovie, Keynote, etc. are good themselves. Couple them with premium tools like Final Cut Pro, Affinity Designer, and more and you get world-class editing experience. Not to forget that creative tools like Adobe are also available on macOS.
|
||||
|
||||
Additionally, Apple has strict guidelines for applications available for its platform that enhance the native experience with third-party apps (free or paid).
|
||||
|
||||
This is why many designers and editors prefer using macOS over any other operating systems.
|
||||
|
||||
For the Linux platform, you have **great FOSS alternatives** to some macOS-only apps. Unless you like or have experience with macOS-specific applications, you should not have trouble with software available for Linux.
|
||||
|
||||
![kdenlive editor][29]
|
||||
|
||||
The native app experience depends on the Linux distribution you use.
|
||||
|
||||
![Planner (To-do list app for Linux)][30]
|
||||
|
||||
It may not be as seamless as macOS, but if you are not a professional-grade video/graphics editor, you should not have any issues.
|
||||
|
||||
### Gaming on Linux and macOS
|
||||
|
||||
![gaming illustration][31]
|
||||
|
||||
While Apple’s making good progress on making its new M1/M2 chips as capable as possible, macOS currently has poor support for games.
|
||||
|
||||
A handful of games work, and most aren’t supported officially. To be honest, investing in a Mac for gaming is not what it is for.
|
||||
|
||||
Regarding Linux, numerous AAA games and Indie titles work fine. Sure, there are some hiccups with certain games. But, with Valve’s push towards official game support for Steam Deck, even the latest releases like “**Spider-Man: Remastered**” are Steam Deck verified.
|
||||
|
||||
Ultimately, helping improve the game support for the Linux platform.
|
||||
|
||||
Additionally, considering that the PC graphics card market is almost back to normal (near or below MSRP), you can get a sweet PC build or laptop without worrying about performance bottlenecks.
|
||||
|
||||
Would you spend upwards of **$1800 for a Mac with 16 GB of RAM and 512 GB of SSD** or get a PC/laptop with 32 GB RAM (or more), and at least 1 TB SSD (or more)?
|
||||
|
||||
That’s your call.
|
||||
|
||||
### Package Manager
|
||||
|
||||
![package manager illustration new][32]
|
||||
|
||||
A package manager helps you quickly find, install, and remove software in your operating system.
|
||||
|
||||
Linux has been the superior force in package management compared to anything out there.
|
||||
|
||||
You get options like [Flatpak][33], [Snap][34], [Synaptic][35], and more out of the box.
|
||||
|
||||
But, Mac users do not have anything to rely on by default. Fortunately, an option like [Homebrew][36] makes life easier for macOS users.
|
||||
|
||||
It also supports Linux. So, you can use it across multiple devices to make things easy.
|
||||
|
||||
### Operating System Updates
|
||||
|
||||
![software update illustration][37]
|
||||
|
||||
Apple does not share specific timelines for software updates to the operating system.
|
||||
|
||||
For instance, **macOS Ventura** (the upcoming version upgrade at the time of writing) suddenly ditched all the Mac devices before 2017.
|
||||
|
||||
Interestingly, the previous operating system versions had average support for about **seven years**, but with newer changes, it seems to be about **five** now.
|
||||
|
||||
With Apple silicons, it may not be a straightforward answer. But, it is safe to assume at least 4-5 years of software support.
|
||||
|
||||
Linux gives you options. If you want a stable operating system without feature upgrades but focused on maintenance and security, [LTS editions][38] of Linux distributions give you up to **five years** of updates for free. This is primarily true for [Ubuntu][39] or Ubuntu-based distributions like Linux Mint.
|
||||
|
||||
Furthermore, there’s a subscription plan for Ubuntu, where you can continue receiving security updates for up to **10 years**.
|
||||
|
||||
And, it does not end there; you can also opt for [rolling-release distributions][40] that get constant bleeding-edge updates with no timeline for an end. As long as your hardware is competent enough, you should be able to update the operating system with no issues.
|
||||
|
||||
### macOS vs. Linux: What Should You Pick?
|
||||
|
||||
macOS can be well worth the price tag if you need it.
|
||||
|
||||
It is not an easy recommendation for users who just need to surf the web, send emails, and perform some tasks that are possible on any platform.
|
||||
|
||||
macOS remains a niche pick.
|
||||
|
||||
However, Linux has improved to become a usable choice for former Windows/macOS users, computer science students, developers, creative professionals (like us) and a wide range of potential users.
|
||||
|
||||
There are many reasons to pick Linux over macOS, but not the other way around (I think). What are your thoughts on macOS vs. Linux? You are welcome to share your thoughts in the comments down below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/mac-linux-difference/
|
||||
|
||||
作者:[Ankush Das][a]
|
||||
选题:[lkxed][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/lkxed
|
||||
[1]: https://itsfoss.com/linux-better-than-windows/
|
||||
[2]: https://en.wikipedia.org/wiki/Mach_(kernel)
|
||||
[3]: https://en.wikipedia.org/wiki/NeXTSTEP
|
||||
[4]: https://itsfoss.com/what-is-desktop-environment/
|
||||
[5]: https://itsfoss.com/what-is-linux/
|
||||
[6]: https://github.com/apple/darwin-xnu
|
||||
[7]: https://github.com/apple/darwin-xnu
|
||||
[8]: http://osxbook.com/book/bonus/ancient/whatismacosx/arch_xnu.html
|
||||
[9]: https://en.wikipedia.org/wiki/Mach_(kernel
|
||||
[10]: https://en.wikipedia.org/wiki/FreeBSD
|
||||
[11]: https://www.howtogeek.com/howto/31632/what-is-the-linux-kernel-and-what-does-it-do/
|
||||
[12]: https://linuxhandbook.com/change-shell-linux/
|
||||
[13]: https://itsfoss.com/wp-content/uploads/2022/08/open-source-proprietary-illustration.jpg
|
||||
[14]: https://opensource.apple.com/releases/
|
||||
[15]: https://github.com/apple/darwin-xnu
|
||||
[16]: https://www.techrepublic.com/article/why-apple-open-sourcing-mac-os-x-isnt-terribly-exciting/
|
||||
[17]: https://www.ibm.com/blogs/internet-of-things/what-is-the-iot/
|
||||
[18]: https://itsfoss.com/wp-content/uploads/2022/08/macos-monterey-screenshot.jpg
|
||||
[19]: https://itsfoss.com/wp-content/uploads/2021/12/zorin-os-16-mac.png
|
||||
[20]: https://itsfoss.com/best-linux-desktop-environments/
|
||||
[21]: https://itsfoss.com/macos-like-linux-distros/
|
||||
[22]: https://itsfoss.com/wp-content/uploads/2022/08/pop-os-screenshot-2022.png
|
||||
[23]: https://itsfoss.com/wp-content/uploads/2022/07/10.-MX-Linux.jpg
|
||||
[24]: https://itsfoss.com/wp-content/uploads/2022/08/customizability-illustration.jpg
|
||||
[25]: https://itsfoss.com/kde-customization/
|
||||
[26]: https://itsfoss.com/wp-content/uploads/2022/08/hardware-illustration-800x450.jpg
|
||||
[27]: https://www.freecodecamp.org/news/build-a-hackintosh/
|
||||
[28]: https://itsfoss.com/wp-content/uploads/2022/08/final-cut-pro-mac.jpg
|
||||
[29]: https://itsfoss.com/wp-content/uploads/2022/08/kdenlive-editor.jpg
|
||||
[30]: https://itsfoss.com/wp-content/uploads/2021/08/planner-board-view.png
|
||||
[31]: https://itsfoss.com/wp-content/uploads/2022/08/gaming-illustration.jpg
|
||||
[32]: https://itsfoss.com/wp-content/uploads/2022/08/package-manager-illustration-new.jpg
|
||||
[33]: https://itsfoss.com/what-is-flatpak/
|
||||
[34]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/
|
||||
[35]: https://itsfoss.com/synaptic-package-manager/
|
||||
[36]: https://itsfoss.com/homebrew-linux/
|
||||
[37]: https://itsfoss.com/wp-content/uploads/2022/07/software-update-illustration.jpg
|
||||
[38]: https://itsfoss.com/long-term-support-lts/
|
||||
[39]: https://itsfoss.com/getting-started-with-ubuntu/
|
||||
[40]: https://itsfoss.com/best-rolling-release-distros/
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://itsfoss.com/install-spotify-arch/"
|
||||
[#]: author: "Anuj Sharma https://itsfoss.com/author/anuj/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
@ -1,157 +0,0 @@
|
||||
[#]: subject: "List Files and Directories in Style Using lsd and exa"
|
||||
[#]: via: "https://www.debugpoint.com/list-files-directories-style/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
List Files and Directories in Style Using lsd and exa
|
||||
======
|
||||
Reimagine and style your file and directories list using two ls utilities – lsd and exa.
|
||||
|
||||
![][0]
|
||||
|
||||
The ls command in Linux is the most used command. This command lists files and directories in the terminal. So, as you can see, it’s pretty popular and perhaps used by everyone.
|
||||
|
||||
But the command outputs a large set of information, and it’s sometimes easier to view them colourfully.
|
||||
|
||||
For example, if you run the ls command in the most basic way, it should look somewhat like this.
|
||||
|
||||
![The default list files and directories view via ls command][1]
|
||||
|
||||
It seems a little bland, isn’t it? What if you can style it a bit so that it becomes more readable while looking nice?
|
||||
|
||||
### List Files and Directories in Style
|
||||
|
||||
#### lsd
|
||||
|
||||
The first application I want to show you is called “lsd” aka “LSDeluxe”. It’s a rewrite of the GNU `ls` command with additional features such as column heading, colours for various items, font and icon support.
|
||||
|
||||
Here’s how it looks after installation.
|
||||
|
||||
```
|
||||
lsd -l --header
|
||||
```
|
||||
|
||||
![lsd command showing list of files][2]
|
||||
|
||||
As you can see, it looks stunning with different colour codes for permission, file types, and folders and even adds icons beside a file name.
|
||||
|
||||
The application is full of features such as tree view (see below) which even gives you a list of files inside a folder as well in a single command.
|
||||
|
||||
```
|
||||
lsd -l --header --tree
|
||||
```
|
||||
|
||||
![lsd command showing a tree view][3]
|
||||
|
||||
You can learn more about its feature on the [official GitHub page][4].
|
||||
|
||||
I’m sure you are excited. Let’s see how you can install it.
|
||||
|
||||
You can download the deb file from here for Ubuntu and related distribution. And after that, simply run dpkg to install.
|
||||
|
||||
```
|
||||
sudo dpkg -i lsd_vvvv_amd64.deb
|
||||
```
|
||||
|
||||
For Fedora Linux, use the following command.
|
||||
|
||||
```
|
||||
sudo dnf install lsd
|
||||
```
|
||||
|
||||
And Arch Linux users can get it using the below command.
|
||||
|
||||
```
|
||||
pacman -S lsd
|
||||
```
|
||||
|
||||
The application is also available for other distros, macOS, BSD and Windows. For those instructions, you can [find them here][5].
|
||||
|
||||
For a better experience, use it with the [Zsh shell with Oh My Zsh][6] program.
|
||||
|
||||
#### exa
|
||||
|
||||
The next program is `exa`, similar to `lsd` but with more features. The `exa` command can colourize your ls output, detect various file types in Unix systems, headings, tree view and many more features.
|
||||
|
||||
Exa is a single binary and has a small resource footprint. Here’s how it looks with some sample commands.
|
||||
|
||||
```
|
||||
exa -al
|
||||
```
|
||||
|
||||
```
|
||||
exa -abghHliS
|
||||
```
|
||||
|
||||
```
|
||||
exa -abghHliS --long --tree
|
||||
```
|
||||
|
||||
![Various exa commands][7]
|
||||
|
||||
You can learn more about exa parameters and switches on [GitHub][8].
|
||||
|
||||
Installation of exa is easy and requires just one command. For Ubuntu and related distributions, you can install it using the below command.
|
||||
|
||||
```
|
||||
sudo apt install exa
|
||||
```
|
||||
|
||||
For Fedora and Arch Linux, use the following commands, respectively.
|
||||
|
||||
```
|
||||
sudo dnf install exa
|
||||
```
|
||||
|
||||
```
|
||||
pacman -S exa
|
||||
```
|
||||
|
||||
Likewise, all other installation instructions for various OSes can be [found here][9].
|
||||
|
||||
### Copying from the terminal as HTML
|
||||
|
||||
One of the interesting tips is that all the above colourful lists can be copied as HTML via the default Ubuntu terminal. And you can use it for your web pages or documents.
|
||||
|
||||
For example, I copied a sample from the above to a LibreOffice Writer document.
|
||||
|
||||
It’s one of the best features, although it depends on the terminal program and NOT the above utilities.
|
||||
|
||||
![Exporting the command output as HTML][10]
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
I explained the inner workings of two programs – ls and exa to list files and directories in style. I hope you get to use them for different needs.
|
||||
|
||||
Do let me know in the comment box if you like them, Or if you know any such utility.
|
||||
|
||||
Cheers.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/list-files-directories-style/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[0]: https://www.debugpoint.com/wp-content/uploads/2022/08/cool-ls.jpg
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/The-default-list-files-and-directories-view-via-ls-command.jpg
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2022/08/lsd-command-showing-list-of-files-2.jpg
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2022/08/lsd-command-showing-a-tree-view.jpg
|
||||
[4]: https://github.com/Peltoche/lsd
|
||||
[5]: https://github.com/Peltoche/lsd#installation
|
||||
[6]: https://www.debugpoint.com/install-use-zsh/
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2022/08/Various-exa-commands.jpg
|
||||
[8]: https://github.com/ogham/exa#command-line-options
|
||||
[9]: https://github.com/ogham/exa#installation
|
||||
[10]: https://www.debugpoint.com/wp-content/uploads/2022/08/Exporting-the-command-output-as-HTML.jpg
|
229
sources/tech/20220810 Create beautiful PDFs in LaTeX.md
Normal file
229
sources/tech/20220810 Create beautiful PDFs in LaTeX.md
Normal file
@ -0,0 +1,229 @@
|
||||
[#]: subject: "Create beautiful PDFs in LaTeX"
|
||||
[#]: via: "https://opensource.com/article/22/8/pdf-latex"
|
||||
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Create beautiful PDFs in LaTeX
|
||||
======
|
||||
Use the LaTeX markup language to compose documents.
|
||||
|
||||
The LaTeX document preparation system has an interesting history. When programmer Don Knuth wrote his first book, The Art of Computer Programming, in 1968, it was produced using an old-style printing press method. When he published the second edition in 1976, the publisher had moved to modern phototypesetting.
|
||||
|
||||
Knuth was unhappy with how the new edition looked. Addressing the problem from a programmer's perspective, Knuth decided to create his own text processing system so his future books could be formatted to look the same way, for every book in the series. And so it was that Don Knuth wrote the first version of TeX in 1978.
|
||||
|
||||
A few years later, Leslie Lamport created a set of macros that help authors write complex documents more easily. Lamport's macro extensions, LaTeX, essentially extends TeX to easily produce all kinds of documents. For example, many academic organizations use LaTeX to publish journals and proceedings.
|
||||
|
||||
### Writing documents in LaTeX
|
||||
|
||||
It's easy to learn the basics of LaTeX by writing a short article. Let's start by borrowing from the [About Opensource.com][4] page to create this sample input file:
|
||||
|
||||
```
|
||||
$ cat about.tex
|
||||
\documentclass{article}
|
||||
\begin{document}
|
||||
|
||||
Opensource.com is a premier, daily publication focused on
|
||||
open source and Linux tutorials, stories, and resources.
|
||||
|
||||
We're a diverse and inviting group, made up of staff
|
||||
editors, Correspondents, contributors, and readers. We
|
||||
value differences in skills, talents, backgrounds, and
|
||||
experiences. There are a few different ways to get involved
|
||||
as a reader or a writer.
|
||||
|
||||
\end{document}
|
||||
```
|
||||
|
||||
Like other document formatting programs, LaTeX collects words and fills paragraphs. That means you can add new text in the middle of a paragraph and not worry about how the final document will look. As long as you don't add a blank line in the middle of a paragraph, LaTeX creates fully justified paragraphs. When it finds a blank line, LaTeX starts a new paragraph.
|
||||
|
||||
LaTeX needs a few control statements to define the document. Every LaTeX document should start with a declaration of the document's *class*. LaTeX supports several kinds of documents, including letters, books, and articles. For this example, I used `\documentclass{article}` to set the *article* class.
|
||||
|
||||
Tell LaTeX where the text begins and ends with the `\begin{document}` and `\end{document}` statements. If you add text before the `\begin{document}`, LaTeX generates an error. Any text after `\end{document}` is ignored.
|
||||
|
||||
Process this document using LaTeX with the `latex` command:
|
||||
|
||||
```
|
||||
$ latex about.tex
|
||||
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded format=latex)
|
||||
restricted \write18 enabled.
|
||||
entering extended mode
|
||||
(./about.tex
|
||||
LaTeX2e <2020-10-01> patch level 4
|
||||
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
|
||||
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
|
||||
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
|
||||
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
|
||||
No file about.aux.
|
||||
[1] (./about.aux) )
|
||||
Output written on about.dvi (1 page, 736 bytes).
|
||||
Transcript written on about.log.
|
||||
```
|
||||
|
||||
LaTeX produces a lot of text so you can see what it is doing. If your document contains errors, LaTeX prints a message, and possibly prompt for what it should do. In most cases, you can type `exit` at the prompt to force LaTeX to quit.
|
||||
|
||||
If LaTeX was successful in generating a document, it produces a file with a `.dvi` extension. The *DVI* stands for *Device Independent* because you can use a variety of tools to create other kinds of output. For example, the **dvipdf** program converts the DVI file to a PDF file.
|
||||
|
||||
```
|
||||
$ dvipdf about.dvi
|
||||
```
|
||||
|
||||
![LaTeX output][5]
|
||||
|
||||
### Adding lists
|
||||
|
||||
LaTeX supports two kinds of lists: an *enumerated* list where each item starts with a number, and an *itemized* or "bullet" list. Add a short enumerated list after the second paragraph to list the ways that folks can get involved with Opensource.com:
|
||||
|
||||
```
|
||||
\begin{enumerate}
|
||||
\item Be a writer
|
||||
\item Be a reader
|
||||
\end{enumerate}
|
||||
```
|
||||
|
||||
Similar to how you need to provide `\begin` and `\end` statements around a document definition, you also need to provide `\begin` and `\end` statements around a list. Within the list, start each new item with an `\item` command. When you process this new file with LaTeX and convert it to PDF format, you see your list formatted as a numbered list:
|
||||
|
||||
![LaTeX output][6]
|
||||
|
||||
You can also add lists within a list. This is a neat feature if you need to provide a list with several options for each item. For example, you can add a few different resources for folks who want to become writers at Opensource.com. The embedded list uses its own `\begin` and `\end` statements. I'll add some extra space around this example so it's easier to see, but LaTeX doesn't really care about the blank lines and extra spaces:
|
||||
|
||||
```
|
||||
\begin{enumerate}
|
||||
\item Be a writer
|
||||
|
||||
\begin{itemize}
|
||||
\item Resources for writers
|
||||
\item Contributor Club
|
||||
\item Correspondent Program
|
||||
\end{itemize}
|
||||
|
||||
\item Be a reader
|
||||
\end{enumerate}
|
||||
```
|
||||
|
||||
The new list is inserted as an embedded list inside item number 1 because you added the list between the two original `\item` statements. You could have instead inserted this list after item number 2 by adding the new list before the `\end{enumerate}` statement.
|
||||
|
||||
![LaTeX output][7]
|
||||
|
||||
### Sections and subsections
|
||||
|
||||
You can make a long document easier to read by breaking it up into sections. To add a section title to a LaTeX document, use the `\section{...}` statement, and write the section's title inside the braces. For example, you can add a new section titled "About Opensource.com" to the top of the document with this:
|
||||
|
||||
```
|
||||
$ head about.tex
|
||||
\documentclass{article}
|
||||
\begin{document}
|
||||
|
||||
\section{About Opensource.com}
|
||||
|
||||
Opensource.com is a premier, daily publication focused on
|
||||
open source and Linux tutorials, stories, and resources.
|
||||
|
||||
We're a diverse and inviting group, made up of staff
|
||||
editors, Correspondents, contributors, and readers. We
|
||||
```
|
||||
|
||||
The *article* document class adds a number before each major section, and increases the font size so it stands out in the document.
|
||||
|
||||
![LaTeX output][8]
|
||||
|
||||
For documents that require more organization, you can add subsections using the `\subsection{...}` command. Like the `\section{...}` command, enter the subsection's title between the curly braces.
|
||||
|
||||
```
|
||||
$ head about.tex
|
||||
\documentclass{article}
|
||||
\begin{document}
|
||||
|
||||
\section{About Opensource.com}
|
||||
|
||||
Opensource.com is a premier, daily publication focused on
|
||||
open source and Linux tutorials, stories, and resources.
|
||||
|
||||
\subsection{Welcome to the Opensource.com community}
|
||||
```
|
||||
|
||||
![LaTeX output][9]
|
||||
|
||||
### Title and author
|
||||
|
||||
Scientific articles meant for publication require a title, author, and publication date. LaTeX provides a method to add this information by inserting commands that define each, then generates the article's title with a separate `\maketitle` command.
|
||||
|
||||
Add "About Us" as the article's title, "Opensource.com Editors" for the author, and "July 10, 2022" as the publication date. You must enter this block after the `\begin{document}` and before the rest of the content, such as the first section:
|
||||
|
||||
```
|
||||
\title{About Us}
|
||||
\author{Opensource.com Editors}
|
||||
\date{July 10, 2022}
|
||||
\maketitle
|
||||
```
|
||||
|
||||
When you process the document, LaTeX adds the title, author, and date to the top of the artcle:
|
||||
|
||||
![LaTeX output][10]
|
||||
|
||||
### Adding emphasis
|
||||
|
||||
Scientific and other technical documents often include terms and phrases that need to carry special emphasis. LaTeX provides several font effects you can use in technical documents, including emphasis text (usually displayed in italics), bold text, and small caps.
|
||||
|
||||
Update your LaTeX document to put the phrase "staff editors, Correspondents, contributors, and readers" in italics text, and the specific words "reader" and "writer" later in the paragraph in emphasis text. You can also put the phrase "skills, talents, backgrounds, and experiences" in bold. And while it's not the correct way to style it, you can use small caps to type "Linux."
|
||||
|
||||
```
|
||||
$ head -20 about.tex
|
||||
\documentclass{article}
|
||||
\begin{document}
|
||||
|
||||
\title{About Us}
|
||||
\author{Opensource.com Editors}
|
||||
\date{July 10, 2022}
|
||||
\maketitle
|
||||
|
||||
\section{About Opensource.com}
|
||||
|
||||
Opensource.com is a premier, daily publication focused on
|
||||
open source and \textsc{Linux} tutorials, stories, and resources.
|
||||
|
||||
\subsection{Welcome to the Opensource.com community}
|
||||
|
||||
We're a diverse and inviting group, made up of \textit{staff
|
||||
editors, Correspondents, contributors, and readers}. We
|
||||
value differences in \textbf{skills, talents, backgrounds, and
|
||||
experiences}. There are a few different ways to get involved
|
||||
as a \emph{reader} or a \emph{writer}.
|
||||
```
|
||||
|
||||
This sample shows different ways to apply different styles to text. When you need to add emphasis, use the `\emph{...}` command, with the word or phrase between the curly braces. To display text in italics, boldface, or small caps, use a variation of the `\text` command: `\textit{...}` for italics, `\textbf{...}` for boldface, and `\textsc{...}` for small caps. LaTeX supports lots of other ways to style text, but these styles get you pretty far in writing scientific documents.
|
||||
|
||||
![LaTeX output][11]
|
||||
|
||||
### Using LaTeX
|
||||
|
||||
I've only touched on a few ways to write scientific and technical documents in LaTeX. Depending on your needs, you can also use LaTeX to insert footnotes and typeset mathematical equations and expressions. To explore other ways to use LaTeX for scientific writing, also read [A introduction to creating documents in LaTeX][12] here on Opensource.com.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/8/pdf-latex
|
||||
|
||||
作者:[Jim Hall][a]
|
||||
选题:[lkxed][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/jim-hall
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_laptop_computer_work_desk.png
|
||||
[2]: https://unsplash.com/@jonasleupe?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[3]: https://unsplash.com/s/photos/tea-cup-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
|
||||
[4]: https://opensource.com/about
|
||||
[5]: https://opensource.com/sites/default/files/2022-08/latex-output.jpg
|
||||
[6]: https://opensource.com/sites/default/files/2022-08/latex-output-list.jpg
|
||||
[7]: https://opensource.com/sites/default/files/2022-08/latex-output-list-2.jpg
|
||||
[8]: https://opensource.com/sites/default/files/2022-08/latex-output-heading.jpg
|
||||
[9]: https://opensource.com/sites/default/files/2022-08/latex-output-subheading.jpg
|
||||
[10]: https://opensource.com/sites/default/files/2022-08/latex-output-about.jpg
|
||||
[11]: https://opensource.com/sites/default/files/2022-08/latex-output-emphasis.jpg
|
||||
[12]: https://opensource.com/article/17/6/introduction-latex
|
@ -0,0 +1,187 @@
|
||||
[#]: subject: "How to Record Streaming Audio in Ubuntu and other Linux Distributions"
|
||||
[#]: via: "https://itsfoss.com/record-streaming-audio/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Record Streaming Audio in Ubuntu and other Linux Distributions
|
||||
======
|
||||
How to record audio in Ubuntu and other Linux distributions?
|
||||
|
||||
If you want to record a voice over through the microphone of your computer, you can use GNOME Sound recorder or Audacity.
|
||||
|
||||
Using GNOME Sound Recorder is easy but it lacks features. Audacity could be overwhelming initially but it has plenty of features for professional level recording. However, I am not going into that detail in this tutorial.
|
||||
|
||||
GNOME Sound Recorder works with the microphone. There is another tool called Audio recorder and you can use it to record streaming music (from Sptify, YouTube, internet radio, Skype and most other sources) apart from microphone input.
|
||||
|
||||
To summarize, I’ll show you the steps:
|
||||
|
||||
* To record sound using GNOME Sound Recorder
|
||||
* To record streaming audio using Audio Recorder
|
||||
|
||||
### Using Sound Recorder to record audio from the microphone
|
||||
|
||||
GNOME desktop environment has a good variety of useful applications. Sound Recorder is one of them.
|
||||
|
||||
You can install the [Sound Recorder][1] from the Ubuntu Software Center.
|
||||
|
||||
![Sound Recorder can be installed from the Ubuntu Software Center][2]
|
||||
|
||||
Or, you can use this command in the terminal to install it:
|
||||
|
||||
```
|
||||
sudo apt install gnome-sound-recorder
|
||||
```
|
||||
|
||||
Once installed, you can find it in the system menu and start from there.
|
||||
|
||||
![GNOME Sound Recorder][3]
|
||||
|
||||
Before you start using it, you should ensure that you have the correct input source chosen in the system settings. GNOME Sound Recorder
|
||||
|
||||
![Ensure that you have chosen correct input in system settings][4]
|
||||
|
||||
Once you open the Sound Recorder application, it will show an interface like the one below.
|
||||
|
||||
![Hit the Record button to start audio recording][5]
|
||||
|
||||
Hit on the record button and it starts recording audio instantly. While recording, you get options to pause, stop or discord the recording.
|
||||
|
||||
![Options while recording audio][6]
|
||||
|
||||
Your recordings are saved and available from the application interface itself. Click on the saved recordings to highlight it.
|
||||
|
||||
You can replay the recordings or delete it. You can choose to save it to another location by clicking the save/download button. You may also rename the recordings using the edit button.
|
||||
|
||||
![Saved recordings][7]
|
||||
|
||||
That’s quite convenient, right? You can choose to record in MP3, FLAC and a couple of more formats.
|
||||
|
||||
#### Removing GNOME Sound Recorder
|
||||
|
||||
Don’t like it or find it lacking in terms of features?
|
||||
|
||||
You can remove GNOME Sound Recorder from the Ubuntu Software Center or use the following command:
|
||||
|
||||
```
|
||||
sudo apt remove gnome-sound-recorder
|
||||
```
|
||||
|
||||
The application of GNOME Sound recorder is limited. It only records from the microphone and this is not what you would want in certain situations.
|
||||
|
||||
Imagin you want to record a Skype call or something which is playing in an application or web browser? The nifty Audio Recorder helps in such cases.
|
||||
|
||||
### Using Audio Recorder to record streaming audio
|
||||
|
||||
You can watch this video to see how to use Audio Recorder. It’s a bit old but the steps are the same.
|
||||
|
||||
![A Video from YouTube][8]
|
||||
|
||||
[Subscribe to our YouTube channel for more Linux videos][9]
|
||||
|
||||
You can use the [official PPA][10] to install Audio Recorder in Ubuntu and Linux Mint. Use the following commands in the terminal (Ctrl+Alt+T) one by one:
|
||||
|
||||
```
|
||||
sudo apt-add-repository ppa:audio-recorder/ppa
|
||||
sudo apt update
|
||||
sudo apt install audio-recorder
|
||||
```
|
||||
|
||||
Alternatively, you can download the source code from [launchpad][11]. Once installed, you can start the application from the Activity Overview:
|
||||
|
||||
![Audio Recorder][12]
|
||||
|
||||
#### Record all kinds of sound from various sources
|
||||
|
||||
Audio Recorder records all kinds of sounds your computer makes.
|
||||
|
||||
It records audio played through your system’s soundcard, microphones, browsers, webcams and more.
|
||||
|
||||
In other words, it records even if your system sneezes (given that you want to record it). It allows you to select the recording device such as webcam, microphone, Skype, etc.
|
||||
|
||||
To record the streaming music, select the appropriate source. For example, if you are playing streaming radio in Rhythmbox, then select Rythmbox.
|
||||
|
||||
![Audio-Recorder Audio Settings][13]
|
||||
|
||||
#### Record at your convenience
|
||||
|
||||
Audio Recorder also gives you the option of setting timer. You can start, stop or pause recording at a given clock time or at a pre-defined interval. You can also set the limit on the recorded file size.
|
||||
|
||||
Moreover, you can pause (and stop) when there is no audio (or very low sound) and resume it when sound comes back.
|
||||
|
||||
All you have to do is to edit the text in the Timer panel. Comment out the “rules” you don’t want to apply and edit the ones per your requirement.
|
||||
|
||||
![Audio-recorder Timer Settings][14]
|
||||
|
||||
It provides additional settings like auto start at login, show tray icon and other record settings.
|
||||
|
||||
![Audio-recorder Additional Settings][15]
|
||||
|
||||
#### Save the recorded music file in various file formats
|
||||
|
||||
Another gem. You can save the recorded file in your favourite file format. Supported file formats are OGG audio, Flac, MP3, SPX and WAV. I prefer MP3 for my recordings.
|
||||
|
||||
The **recorded files are stored in ~/Audio** i.e., in the Audio folder inside your home directory.
|
||||
|
||||
![Audio-recorder Audio Formats][16]
|
||||
|
||||
#### How good is Audio Recorder?
|
||||
|
||||
I used Audio Recorder in Ubuntu to [record the music played on YouTube][17]. I saved a 2-minute video in MP3 format that took 934 KB of space. But I must say I was not expecting the recorded sound quality to be so good. Honestly, I could not distinguish it from the original YouTube song.
|
||||
|
||||
#### Removing Audio Recorder
|
||||
|
||||
If you don’t find Audio Recorder to your liking, you can remove it using the following commands:
|
||||
|
||||
```
|
||||
sudo apt remove audio-recorder
|
||||
```
|
||||
|
||||
It will be a good idea to [remove the PPA as well][18]:
|
||||
|
||||
```
|
||||
sudo apt-add-repository -r ppa:audio-recorder/ppa
|
||||
```
|
||||
|
||||
### Conclusion
|
||||
|
||||
There are probably several other tools for audio recording in Linux. Like GNOME, other desktop environments may also have sound recording apps. I know Deepin has one for sure.
|
||||
|
||||
GNOME Sound Recorder is a decent tool for recording sound from your microphone. For recording sound from various sources, Audio Recorder is a good choice.
|
||||
|
||||
I hope it helps with your audio recording needs. Let me know if you have any suggestions.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/record-streaming-audio/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lkxed][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/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://wiki.gnome.org/Apps/SoundRecorder
|
||||
[2]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recorder-ubuntu.png
|
||||
[3]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recorder.png
|
||||
[4]: https://itsfoss.com/wp-content/uploads/2022/08/microphone-settings-ubuntu.png
|
||||
[5]: https://itsfoss.com/wp-content/uploads/2022/08/using-sound-recorder-linux.png
|
||||
[6]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recording-with-sound-recorder.png
|
||||
[7]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recorder-interface.png
|
||||
[8]: https://youtu.be/o7Ia2QGeB7Q
|
||||
[9]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
|
||||
[10]: https://launchpad.net/~audio-recorder/+archive/ubuntu/ppa
|
||||
[11]: https://launchpad.net/audio-recorder
|
||||
[12]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-in-overview.png
|
||||
[13]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-audio-settings.png
|
||||
[14]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-timer-settings.png
|
||||
[15]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-additional-settings.png
|
||||
[16]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-audio-formats.png
|
||||
[17]: https://itsfoss.com/youtube-dl-audio-only/
|
||||
[18]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/
|
@ -0,0 +1,164 @@
|
||||
[#]: subject: "Our favorite Linux replacements for antiquated open source tools"
|
||||
[#]: via: "https://opensource.com/article/22/8/replace-antiquated-linux-tools"
|
||||
[#]: author: "Opensource.com https://opensource.com/users/admin"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Our favorite Linux replacements for antiquated open source tools
|
||||
======
|
||||
We asked our community of contributors what open source tools they are using in place of those that feel outdated or antiquated.
|
||||
|
||||
Here at [Opensource.com][2], we thought it would be interesting to survey some of our authors to get a feel for what tools they feel are antiquated (but perhaps still useful!) and what they think of the replacement utilities. What follows is a series of responses and a bit of fun, too.
|
||||
|
||||
We sent out the following prompt:
|
||||
|
||||
* Have you discovered some of your favorite tools have become outdated or deprecated? Or maybe you just switched it up for something new?
|
||||
* What do you use now? Tell us a little about how you feel it is helpful to have made the switch.
|
||||
|
||||
### Firewalls
|
||||
|
||||
A biggie for me is iptables. I sweated blood learning how to use iptables, and ebtables, and arptables, and how to manipulate MAC addresses, and more. I built dozens of firewalls around scripts to set up rulesets, and I eventually got pretty good at it. Now nftables makes all that obsolete. The fun never stops. I still think somebody with marketing clout could make software-defined boundaries work. —[Greg Scott][3]
|
||||
|
||||
#### +1 on iptables
|
||||
|
||||
I have been using iptables since I first learned Linux 25+ years ago. The newest tool is firewalld, but that and all other firewall tools I have seen for Red Hat-based distros are still based on and wrap around the kernel-level netfilter modules. I find the [firewalld][4] tool creates huge sets of rules that don't do anything more for me than the older iptables. I am sure some large environments need those complex rulesets, but they could also be implemented using iptables or scripts like Greg's.
|
||||
|
||||
I do like `nmcli`, but it is taking me some time to learn it. In fact, I prefer it to the old `ifcfg` and `ip` commands. It feels more integrated into the system than the older ones. But I do like the older `ifcfg-` interface configuration files. Those are easy to create and understand. They don't require the INI-style format that requires section headers. In fact, the old-style files are not even sequence sensitive. —[David Both][5]
|
||||
|
||||
#### ipchains?
|
||||
|
||||
To further underscore this example, are you sure you weren't using ipchains back then? (The ipfirewall and ipfwadm successor, ipchains wasn't supplanted by iptables until around 2001.) —[Jeremy Stanley][6]
|
||||
|
||||
*In response to Jeremy. ^^*
|
||||
|
||||
My very first firewall was ipchains, circa late 1999. Everything after that was iptables. Back then, I had to build my own kernel to get all the netfilter modules I needed. Modern conveniences like flat-panel monitors and DSL were science fiction in those days. And don't even think about fiber. I had to ride a horse uphill through blizzards every day to visit customers. And then it was uphill back home, too. —[Greg Scott][7]
|
||||
|
||||
### Text editing
|
||||
|
||||
I just have to ask—who's still using troff (groff) and who has moved on to... hmm, shall we say, LibreOffice or AsciiDoctor or...?
|
||||
|
||||
I have a dear friend who continues with a troff-based product on his Sun SPARCStation V. —[Chris Hermansen][8]
|
||||
|
||||
**[[ Related read Old-school technical writing with groff ]][9]**
|
||||
|
||||
#### Editing man pages
|
||||
|
||||
*^^ In response to Chris*
|
||||
|
||||
Anyone maintaining man pages! Though lots of people are probably generating those from other markup these days. Some folks (like me) do still compose or edit the troff files directly instead. —[Jeremy Stanley][10]
|
||||
|
||||
#### Markup stacks
|
||||
|
||||
There are always people who use older things, but there are superior tools nowadays. I wouldn't use LibreOffice for the kind of stuff you'd use troff/groff for—if you are writing at that level, you probably depend on a text editor you know well, source-control for managing your inputs, and you are comfortable with markup languages.
|
||||
|
||||
That means you want to use a markup stack. There are many, including:
|
||||
|
||||
* Sphinx + ReST + GitHub Actions + GitHub Pages
|
||||
* MkDocs + Markdown + GitLab CI + GitLab Pages
|
||||
* Nikola + Jupyter Notebooks + Jenkins + (AWS S3 + CloudFront)
|
||||
|
||||
What is common to all the stacks is:
|
||||
|
||||
* A thing that pulls different input files into one coherent whole (Sphinx/MkDocs/Nikola)
|
||||
* A reasonably high-level text markup language (ReST/Markdown/MD embedded in Jupyter Notebooks)
|
||||
* A CI pipeline to transform those into the output format (usually a tree of HTML files, but sometimes a PDF or something)
|
||||
* A place where people can download the published version (GitHub Pages, GitLab Pages, AWS S3 + CloudFront)
|
||||
|
||||
I'll note that these are pretty much orthogonal choices. Any reasonable generator can take any input (even MkDocs, for which it is least true, has the mkdocs-gen-files plugin so you can use Pandoc to convert stuff to Markdown). Any reasonable CI can run any generator and push to any target.
|
||||
|
||||
So even with the list above, there are 81 stacks available.
|
||||
|
||||
(Sphinx/MkDocs/Nikola) x (ReST/Markdown/Jupyter Notebooks) x (GHA/GitLab CI/Jenkins) x (GHP/GLP/S3+CF)
|
||||
|
||||
Because Pandoc understands troff (ms/man), you can plug troff+ms or troff+man into the "markup" slot if you really want to. You can probably install Jenkins on the Sun SPARCStation V and keep using the same machine and format. But why? :)
|
||||
|
||||
There's probably an article for OSDC there: "How I converted troff docs to a modern stack using mkdocs+mkdocs-gen-files and GitLab CI." —[Moshe Zadka][11]
|
||||
|
||||
#### Other groff examples
|
||||
|
||||
Actually, I'm writing an article right now about "Old school technical writing with groff" (part of a larger series I'm writing about tech writing tools). I don't use groff for serious tech writing, but it's in my toolkit of things I learned and will probably never forget. And I review groff when I teach "Writing with Digital Technologies."
|
||||
|
||||
While writing the article, I recalled that when I installed Linux in 1993, there weren't *any* writing apps on Linux. No word processors, just groff and LaTeX. I used LaTeX to write my physics lab reports (because it could do math easily) and groff to write papers for other classes (because I could opt to print to a line printer instead, which I thought was a clever way to make my paper look longer). If I wanted to write with a word processor, I had to dual-boot back to DOS to run WordPerfect or Galaxy Write. StarOffice came out for Linux in 1996. I bought StarOffice.
|
||||
|
||||
Interestingly, Brian Kernighan still writes all his books in groff. "Unix: A History and a Memoir" (2020) and "Understanding the Digital World" (2021) were both completely processed in groff. —[Jim Hall][12]
|
||||
|
||||
### Revisiting the fmt command
|
||||
|
||||
I use the `fmt` command a lot these days. It's really handy for a ton of stuff. If you write Readme documentation (or other docs) in plain text, you know the pain when you insert some new text in the middle of a line, and then the lines don't end at the same column. You can run `fmt` to clean that up.
|
||||
|
||||
More commonly, I'm on an email list where list members prefer to receive emails in plain text, so my email client is set for plain text most of the time. If I need to reply to someone's list email (and they didn't send it in plain text), a paragraph is usually just one long line, and my email client doesn't correctly line-wrap when I reply. It's just `>` at the start of a long sentence.
|
||||
|
||||
So I do this:
|
||||
|
||||
```
|
||||
$ fmt -p '>' > /tmp/f
|
||||
{copy & paste ">" quoted text}
|
||||
^D
|
||||
```
|
||||
|
||||
And then:
|
||||
|
||||
```
|
||||
$ cat /tmp/f
|
||||
```
|
||||
|
||||
And then copy and paste the result into my email. —[Jim Hall][13]
|
||||
|
||||
### Changes to bootloaders
|
||||
|
||||
Just when your *foo* is sufficiently sharp, there are reasonable odds the tools will be replaced.
|
||||
|
||||
LILO to GRUB was painful until my GRUB-foo reached a sufficient level. GRUB2 is awesome, but a new learning curve.
|
||||
|
||||
Muscle memory is also an issue — `ipconfig`, `nslookup`, and `netstat` are on auto-pilot. Plus, if you're using other Linux environments, like Tiny Core Linux, you might not always have the latest and greatest tools.
|
||||
|
||||
Switching from `if-cfg` -style scripts to `nmcli` is the new learning curve, so this never really ends. —[Steven Ellis][14]
|
||||
|
||||
**[[ Related read 6 deprecated Linux commands and the tools you should be using instead ]][15]**
|
||||
|
||||
### Quick FIPS set up
|
||||
|
||||
Often things change for the better; my two cents. The question was asked, *Have you discovered some of your favorite tools have become outdated or deprecated? Or maybe you just switched it up for something new?*
|
||||
|
||||
A colleague recently asked me how to enable FIPS on Linux, and it's something I had not done in a while. I remember how arcane this process was, which involved enabling a repo, installing a package (dracut-fips), running commands (`dracut` ) to regenerate initramfs, modifying the GRUB bootloader config file (fips=1), etc.
|
||||
|
||||
Also, *What do you use now? Tell us a little about how you feel it is helpful to have made the switch.*
|
||||
|
||||
Luckily on RHEL9, the above has been replaced by the `fips-mode-setup` command with two handy flags, `--check` and `--setup`. That's it! Run those commands, reboot the system, and your machine boots up with FIPS enabled. Super easy! —[Gaurav Kamathe][16]
|
||||
|
||||
### Old and comfortable
|
||||
|
||||
Clearly, both the fun of open source and the strong opinions are still present, as is the variety of tools and the freedom to choose what works best for you. Perhaps these tools and others like them are old—even antiquated—but they may still serve a purpose. Some of these older utilities inspired more modern solutions without losing their own inherent value. Finally, there's something to be said for user comfort and familiarity. With open source, all those hours spent developing your foo need not be lost just because some vendor decided it was time for a new release.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/8/replace-antiquated-linux-tools
|
||||
|
||||
作者:[Opensource.com][a]
|
||||
选题:[lkxed][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/admin
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/lead-images/GOV_2dot0.png
|
||||
[2]: https://opensource.com/
|
||||
[3]: https://opensource.com/users/greg-scott
|
||||
[4]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd
|
||||
[5]: https://opensource.com/users/dboth
|
||||
[6]: https://opensource.com/users/fungi
|
||||
[7]: https://opensource.com/users/greg-scott
|
||||
[8]: https://opensource.com/users/clhermansen
|
||||
[9]: https://opensource.com/article/22/8/old-school-technical-writing-groff
|
||||
[10]: https://opensource.com/users/fungi
|
||||
[11]: https://opensource.com/users/moshez
|
||||
[12]: https://opensource.com/users/jim-hall
|
||||
[13]: https://opensource.com/users/jim-hall
|
||||
[14]: https://opensource.com/users/steven-ellis
|
||||
[15]: https://www.redhat.com/sysadmin/deprecated-linux-command-replacements?intcmp=7013a000002qLH8AAM
|
||||
[16]: https://opensource.com/users/gkamathe
|
@ -0,0 +1,159 @@
|
||||
[#]: subject: "Using Machine Learning to Identify Reefs in the Ocean"
|
||||
[#]: via: "https://www.opensourceforu.com/2022/08/using-machine-learning-to-identify-reefs-in-the-ocean/"
|
||||
[#]: author: "Geetali Saha https://www.opensourceforu.com/author/geetali-saha/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Using Machine Learning to Identify Reefs in the Ocean
|
||||
======
|
||||
|
||||
*Various data and image processing techniques, along with machine learning algorithms, make it possible to study, analyse, understand and identify unknown and lesser-known facts via supervised or unsupervised learning. This article explains the use of PyQGIS to identify reefs in the Indian coastal region.*
|
||||
|
||||
It was in the middle of the last century that mankind started exploring regions beyond the earth through satellites and space missions. This exploration is broadly classified into in situ or onsite observation and remote sensing. The in situ observations are limited and the major challenge is to reach out to parts of the Earth and space for monitoring the physical characteristics by acquiring information through reflected and emitted radiation. These can be achieved with the help of sensors and cameras on board satellites, aircraft, unmanned aerial vehicles and drones. Passive remote sensing involves the use of charge coupled devices, radiometers, film photography and infrared. Radars and LiDARs are active remote sensing elements that emit energy, and scan locations/objects based on the radiation that is reflected or back scattered from the target. The observations are either some data or image.
|
||||
|
||||
Geographic information systems (GIS) integrate data, location, maps and information, thereby providing a platform to understand geographical patterns. Popular open source GIS tools are quantum GIS (QGIS), geographic resources analysis support systems (GRASS GIS), system for automated geoscientific analyses (SAGA GIS) and MapWindow. Machine learning owes its popularity to open source programming/GUI choices like WEKA, KNIME, R and Python programming. The merger of GIS and machine learning has opened new avenues in research to explore beyond what is visible through sensors.
|
||||
|
||||
| | Raster maps | Vector maps |
|
||||
| :- | :- | :- |
|
||||
| Created by | Created with pixels | Created with mathematical formulae |
|
||||
| Scaling | Quality loss when scaling is done | Scalable to any size |
|
||||
| Programs used | Adobe Photoshop, Corel Painter, Gimp, Artweaver, Pixlr X | Adobe Illustrator, Sketch, Coreldraw, Affinity Designer, Inkscape |
|
||||
| Comprise | Raster data is made up of pixels (also grid cells). These are usually regularly spaced and square | Real-world features in maps are represented as points, lines, and polygons (areas) |
|
||||
| File types | .jpg, .png, .gif, .tiff, .psd, .bmp | .ai, .eps, .cdr, .svg, .pdf, .dfx |
|
||||
| Advantages | The inherent nature of raster maps, e.g., one attribute maps, is ideally suited for mathematical modelling and quantitative analysis. | Topology rules can help data integrity with vector data models. Network analysis and proximity operations use such an approach. |
|
||||
| Drawback | Raster maps reflect only one attribute or characteristic for an area. Processing of diverse characteristics becomes cumbersome | Vector data is processing intensive. Any feature edits require updates on topology. With many features, vector manipulation algorithms are complex |
|
||||
|
||||
resources analysis support systems (GRASS GIS), system for automated geoscientific analyses (SAGA GIS) and MapWindow. Machine learning owes its popularity to open source programming/GUI choices like WEKA, KNIME, R and Python programming. The merger of GIS and machine learning has opened new avenues in research to explore beyond what is visible through sensors.
|
||||
|
||||
In this article we are using the Python console of the quantum GIS platform — PyQGIS.
|
||||
|
||||
Maps are available either in raster or vector form for study and we can choose them depending on our task, software and region of interest. Vector data is focused on modelling discrete features with precise shapes and boundaries. Raster data is more about modelling continuous phenomena of the earth and images. The same can be imported to the Project template of the QGIS window.
|
||||
|
||||
The map used in the present setup is downloaded from [https://www.naturalearthdata.com.][1] Natural Earth Vector comes in ESRI shapefile format, the de facto standard for vector geodata. Character encoding is UTF-8. Natural Earth Raster comes in TIFF format with a TFW world file. All Natural Earth data uses the geographic coordinate system (projection), WGS84 datum. Natural Earth shapefile character encoding is specified in the code page flag in the shapefile’s DBF file; for additional compatibility it is also specified in the CPG file. Natural Earth’s WGS84 projection is specified in shapefile’s PRJ file.
|
||||
|
||||
![Figure 1: PyQGIS process flow][2]
|
||||
|
||||
Natural Earth is a public domain map data set available at 1:10m, 1:50m, and 1:110m scales. Featuring tightly integrated vector and raster data, with Natural Earth you can make a variety of visually pleasing, well-crafted maps with cartography or GIS software. Natural Earth was built through a collaboration of many volunteers and is supported by NACIS (North American Cartographic Information Society). It is free for use in any type of project.
|
||||
|
||||
The present map belongs to a category of most detailed maps — major coral reefs from WDB2 or World Data Bank 2. I am using QGIS 3.22 Białowieża version and working using its Python console. I have modified the reefs data set by appending the names of the nearest island and limited the entire list to 98 reefs along the western coast of India, including other countries.
|
||||
|
||||
*Step 1:* Open a new project in QGIS and select ‘HCMGIS > BaseMap > Google Satellite Hybrid’.
|
||||
|
||||
*Step 2:* This should load the previously geo-referenced global map on the Project view. The moment this is done, Layers (left lower section) will show the Google satellite hybrid image. Pan to the western water bodies of India and zoom on the location, as seen in Figure 2.
|
||||
|
||||
![Figure 2: Project view of QGIS][3]
|
||||
|
||||
*Step 3:* Select all the map files related to the desired features and convert them to .kml using any tool freely available online. You can set the output reference settings to Lat long Wgs 84 standard and choose to convert. Download the .kml file once conversion is completed. We did it using the tool at [https://products.aspose.app/gis/en/conversion/shapefile-to-kml.][4]
|
||||
|
||||
*Step 4:* Select layers that can be superimposed to this Google satellite hybrid image (refer Figure 3).
|
||||
|
||||
![Figure 3: Layer selection in QGIS][5]
|
||||
|
||||
*Step 5:* Open the data source manager vector file addition option from the menu.
|
||||
|
||||
*Step 6:* Provide the correct path to obtain the .kml file from the download location and add it.
|
||||
|
||||
*Step 7:* Open the concerned .kml file into the Data Source Manager-Vector mode and select the Add option (middle button on the right bottom). It should display the list of eligible files that can be added to it (refer Figure 4).
|
||||
|
||||
![Figure 4: Data source manager][6]
|
||||
|
||||
**Step 8:** Click Add layers (which you wish to include in the map to view).
|
||||
|
||||
Close the data source manager. You should be able to locate two files on the Layers window:
|
||||
|
||||
* The reef details file
|
||||
* Google satellite hybrid image file
|
||||
|
||||
Remember to put the reef details in first position followed by the Google satellite hybrid image, else the reef details won’t be visible at the desired locations.
|
||||
|
||||
Zoom on to your region of interest or make sure you select only those reefs and islands that you wish to study. You should be able to identify specific locations that are in the Arabian Sea. They presently appear with a yellow background (see Figure 5).
|
||||
|
||||
![Figure 5: View of the reef details][7]
|
||||
|
||||
You can access the properties with a right click on the reefs layer for other options.
|
||||
|
||||
Now, if you wish, you may alter the colour and the boundary of the symbols and change their representation.
|
||||
|
||||
A typical outline of the reefs located on specific islands is shown in Figure 6.
|
||||
|
||||
![Figure 6: Reefs located on specific islands][8]
|
||||
|
||||
### Moving on to the Python console
|
||||
|
||||
Python was first introduced in QGIS 0.9, and Python codes can be implemented in the QGIS environment using the following ways:
|
||||
|
||||
* Issue commands in the Python console within QGIS (the most popular choice and also widely implemented)
|
||||
* Create and use plugins
|
||||
* Automatically run Python code when QGIS starts
|
||||
* Create processing algorithms
|
||||
* Create functions for expressions in QGIS
|
||||
* Create custom applications based on the QGIS API
|
||||
|
||||
![Figure 7: A typical QGIS Python console][9]
|
||||
|
||||
A wonderful resource for learning common task execution is to download the existing plugins from the plugin repository. QGIS provides an integrated Python console for scripting. It can be accessed from the *Plugins ► Python Console* menu.
|
||||
|
||||
QGIS essentially works as a layer based approach, and hence it becomes vital to obtain the currently selected layer in the layer list on the top. The ID visibility is optional. If the current layer happens to be a vector layer, the features are the most vital components and so is the feature count. In the QGIS environment, the iface variable, an instance of *QgisInterface*, allows the user to access the map canvas, menus, toolbars and other parts of the QGIS application.
|
||||
|
||||
The *iface.activeLayer()* method gives us the currently selected layer.
|
||||
|
||||
```
|
||||
>>>layer = iface.activeLayer()
|
||||
>>>dir(layer)
|
||||
|
||||
for f in layer.getFeatures():
|
||||
print (f)
|
||||
```
|
||||
|
||||
Executing the code in the console will provide the output, as shown in Figure 8.
|
||||
|
||||
![Figure 8: Output][10]
|
||||
|
||||
```
|
||||
for f in layer.getFeatures():
|
||||
print (f[‘fid’], f[‘NAME’])
|
||||
output_file = open(‘d:/Geetali/Reefs_WestCoastIndian.txt’, ‘w’)
|
||||
```
|
||||
|
||||
This will generate a *.txt* document at the desired location with the desired name.
|
||||
Finally we will execute the code below to display the names of the reefs
|
||||
|
||||
```
|
||||
for f in layer.getFeatures():
|
||||
geom = f.geometry()
|
||||
line = ‘%s, %s\n’ % (f[‘fid’], f[‘NAME’])
|
||||
output_file.write(line)
|
||||
output_file.close()
|
||||
```
|
||||
|
||||
Figure 9 shows that after complete execution of the Python code, we have successfully loaded the names of the 98 reefs on the western coast of India.
|
||||
|
||||
![Figure 9: Names of the 98 reefs on the western coast of India][11]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.opensourceforu.com/2022/08/using-machine-learning-to-identify-reefs-in-the-ocean/
|
||||
|
||||
作者:[Geetali Saha][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.opensourceforu.com/author/geetali-saha/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.naturalearthdata.com.
|
||||
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-PyQGIS-process-flow.jpg
|
||||
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Project-view-of-QGIS.jpg
|
||||
[4]: https://products.aspose.app/gis/en/conversion/shapefile-to-kml.
|
||||
[5]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Layer-selection-in-QGIS.jpg
|
||||
[6]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-4-Data-source-manager.jpg
|
||||
[7]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-5-View-of-the-reef-details-3.jpg
|
||||
[8]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-6-Reefs-located-on-specific-islands-3.jpg
|
||||
[9]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-7-A-typical-QGIS-Python-console-1.jpg
|
||||
[10]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-8-Output.jpg
|
||||
[11]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-9-Names-of-the-98-reefs-on-the-western-coast-of-India-1.jpg
|
218
sources/tech/20220811 A gentle introduction to HTML.md
Normal file
218
sources/tech/20220811 A gentle introduction to HTML.md
Normal file
@ -0,0 +1,218 @@
|
||||
[#]: subject: "A gentle introduction to HTML"
|
||||
[#]: via: "https://opensource.com/article/22/8/gentle-introduction-html"
|
||||
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
A gentle introduction to HTML
|
||||
======
|
||||
Learn the markup language of the web.
|
||||
|
||||
![Digital creative of a browser on the internet][1]
|
||||
|
||||
I feel confident in claiming that HTML is the most widely used markup language ever. While other markup languages exist, including , LaTeX, and [Markdown][2], no other markup language is as widespread as the Hyper Text Markup Language. HTML is the de facto language of the Web. First implemented in web browsers in 1994, the language continues to evolve. Yet the basics of HTML remain the same.
|
||||
|
||||
If you are just getting started in HTML, I wanted to offer this gentle introduction to learning HTML. I focus on the essentials of HTML to build a basic understanding of how HTML works. You can use this as a starting point to learn more about HTML.
|
||||
|
||||
### Collect words to fill a paragraph
|
||||
|
||||
Let's start with a basic understanding of HTML and how client applications like web browsers display HTML documents. At its core, HTML *collects* words in a file and *fills* a paragraph. That means if you don't add instructions (called markup) to an HTML file, and just leave it as plain text, a web browser turns all that text into a single paragraph.
|
||||
|
||||
Start with this sample text, saved in a plain text file called `index.html`. This is a paragraph from the old *King's Toaster* story, an Internet fable about how you might build a toaster out of a microcontroller:
|
||||
|
||||
```
|
||||
The engineer replied,
|
||||
|
||||
"Using a four-bit microcontroller, I would write a simple
|
||||
program that reads the darkness knob and quantizes its
|
||||
position to one of 16 shades of darkness, from snow white
|
||||
to coal black.
|
||||
|
||||
The program would use that darkness level as the index to
|
||||
a 16-element table of initial timer values.
|
||||
|
||||
Then it would turn on the heating elements and start the
|
||||
timer with the initial value selected from the table.
|
||||
|
||||
At the end of the time delay, it would turn off the heat
|
||||
and pop up the toast.
|
||||
|
||||
Come back next week, and I'll show you a working
|
||||
prototype."
|
||||
```
|
||||
|
||||
You can put this file on a web server and access it like you would any website, or you can save it to your local disk and open it directly in a web browser. How you get the file into the web browser doesn't really matter. But you should name the file with an `.html` extension, which web browsers recognize by default as an HTML file.
|
||||
|
||||
In this case, I've written the file on separate lines. I've also added some blank lines, to demonstrate that HTML doesn't care about extra white space. This extra space may help humans read the HTML code, but the web browser just treats it as one block by default. Viewed on a web browser, this file looks like this:
|
||||
|
||||
![The HTML page as displayed in a web browser][3]
|
||||
|
||||
Image by:
|
||||
|
||||
(Jim Hall, CC BY-SA 4.0)
|
||||
|
||||
### Inline and block elements
|
||||
|
||||
At the core of HTML is the concept of *inline* and *block* elements. You can think of block elements as *always filling a rectangle*. Inline elements *follow only the inline text*.
|
||||
|
||||
The basic block element is called the *division*, and uses the `<div>` tag. The basic inline element is the *span*, with the `<span>` tag. Most HTML tags are some kind of block element or inline element, so it helps to start with just these two to understand how they work.
|
||||
|
||||
Add some `<div>` and `<span>` tags to your HTML document to see what block and inline elements look like:
|
||||
|
||||
```
|
||||
<div>
|
||||
The engineer replied,
|
||||
|
||||
"Using a four-bit microcontroller, I would write a simple
|
||||
program that reads the darkness knob and quantizes its
|
||||
position to one of 16 shades of darkness, from snow white
|
||||
to coal black.
|
||||
|
||||
<span>
|
||||
The program would use that darkness level as the index to
|
||||
a 16-element table of initial timer values.
|
||||
</span>
|
||||
|
||||
Then it would turn on the heating elements and start the
|
||||
timer with the initial value selected from the table.
|
||||
|
||||
At the end of the time delay, it would turn off the heat
|
||||
and pop up the toast.
|
||||
|
||||
Come back next week, and I'll show you a working
|
||||
prototype."
|
||||
</div>
|
||||
```
|
||||
|
||||
I've added a `<div>` block element around the whole paragraph, and a `<span>` around just one sentence. Notice that when I start an HTML element like `<div>` or `<span>`, I need to provide its corresponding *closing* tag like `</div>` and `</span>`. Most HTML elements are formed like this, with an opening and closing tag.
|
||||
|
||||
The web browser uses these tags to display HTML content in a certain way, but because `<div>` and `<span>` don't really define any special formatting on their own, you can't see that anything has changed. Your sample paragraph looks the same as before:
|
||||
|
||||
![This really is a different screenshot than the one above, but it looks exactly the same because <div> and <span> do not add extra styling to the web page][4]
|
||||
|
||||
Image by:
|
||||
|
||||
(Jim Hall, CC BY-SA 4.0)
|
||||
|
||||
You can include *direct styling* in these tags with a style instruction, so you can see how the block and inline elements behave. To make the boundaries of each element stand out, let's use a light blue background for the `<div>` block and a pink background for the `<span>` :
|
||||
|
||||
```
|
||||
<div style="background-color:lightblue">
|
||||
The engineer replied,
|
||||
|
||||
"Using a four-bit microcontroller, I would write a simple
|
||||
program that reads the darkness knob and quantizes its
|
||||
position to one of 16 shades of darkness, from snow white
|
||||
to coal black.
|
||||
|
||||
<span style="background-color:pink">
|
||||
The program would use that darkness level as the index to
|
||||
a 16-element table of initial timer values.
|
||||
</span>
|
||||
|
||||
Then it would turn on the heating elements and start the
|
||||
timer with the initial value selected from the table.
|
||||
|
||||
At the end of the time delay, it would turn off the heat
|
||||
and pop up the toast.
|
||||
|
||||
Come back next week, and I'll show you a working
|
||||
prototype."
|
||||
</div>
|
||||
```
|
||||
|
||||
With these changes, the entire paragraph has a light blue background. The `<div>` block element is a rectangle, so the blue fills even the empty space after the last sentence ends. Meanwhile, the second sentence has a pink background. This highlight follows the sentence because `<span>` is an inline element.
|
||||
|
||||
![Adding colors helps us see the difference between block elements (blue) and inline elements (pink)][5]
|
||||
|
||||
Image by:
|
||||
|
||||
(Jim Hall, CC BY-SA 4.0)
|
||||
|
||||
Most HTML elements are either block or inline. The only difference is these other elements carry some default styles, depending on what they are. For example, `<p>` is a block element that has extra space above and below the block. The heading tags, `<h1>` through `<h6>`, are also block elements defined at different font sizes and text styles like italics and bold. The `<strong>` tag is an inline element that displays text in a **bold** weight. Similarly, `<em>` is also an inline element that sets the text in an *italics* style.
|
||||
|
||||
### Finishing an HTML page
|
||||
|
||||
Some HTML elements are required. While the sample HTML file you have used display correctly on any web browser, it is not technically a *correct* HTML page. There are a few elements you need to add:
|
||||
|
||||
Every HTML document should provide a document type declaration. Use the single tag `<!DOCTYPE html>` on the first line of the HTML file to define an HTML document. The HTML standard also expects you to wrap the document text in two block elements: `<html>` to define the full page, and `<body>` to define the document body.
|
||||
|
||||
```
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div style="background-color:lightblue">
|
||||
The engineer replied,
|
||||
...
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
HTML documents also need a `<head>` block before the `<body>` that provides *meta information* about the page. The only required meta information is the title of the document, defined by the `<title>` element:
|
||||
|
||||
```
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>The King's Toaster</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="background-color:lightblue">
|
||||
The engineer replied,
|
||||
|
||||
"Using a four-bit microcontroller, I would write a simple
|
||||
program that reads the darkness knob and quantizes its
|
||||
position to one of 16 shades of darkness, from snow white
|
||||
to coal black.
|
||||
|
||||
<span style="background-color:pink">
|
||||
The program would use that darkness level as the index to
|
||||
a 16-element table of initial timer values.
|
||||
</span>
|
||||
|
||||
Then it would turn on the heating elements and start the
|
||||
timer with the initial value selected from the table.
|
||||
|
||||
At the end of the time delay, it would turn off the heat
|
||||
and pop up the toast.
|
||||
|
||||
Come back next week, and I'll show you a working
|
||||
prototype."
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
The supporting tags like `<html>`, `<head>`, and `<body>` do not change how the HTML page appears in a web browser, but they are required for a technically correct HTML document:
|
||||
|
||||
![Adding colors helps us see the difference between block elements (blue) and inline elements (pink)][6]
|
||||
|
||||
Image by:
|
||||
|
||||
(Jim Hall, CC BY-SA 4.0)
|
||||
|
||||
This gentle introduction to HTML provides just the essentials of HTML, but now that you understand block and inline elements, you're well on your way to learning how to write HTML documents using other HTML tags.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/8/gentle-introduction-html
|
||||
|
||||
作者:[Jim Hall][a]
|
||||
选题:[lkxed][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/jim-hall
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://opensource.com/sites/default/files/lead-images/browser_web_internet_website.png
|
||||
[2]: https://opensource.com/%20https%3A//opensource.com/article/19/9/introduction-markdown
|
||||
[3]: https://opensource.com/sites/default/files/2022-08/html-plain-text.webp
|
||||
[4]: https://opensource.com/sites/default/files/2022-08/html-text-div-span.webp
|
||||
[5]: https://opensource.com/sites/default/files/2022-08/html-text-div-span-color.webp
|
||||
[6]: https://opensource.com/sites/default/files/2022-08/html-text-div-span-color.webp
|
@ -0,0 +1,157 @@
|
||||
[#]: subject: "List Files and Directories in Style Using lsd and exa"
|
||||
[#]: via: "https://www.debugpoint.com/list-files-directories-style/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
使用 lsd 和 exa 以样式列出文件和目录
|
||||
======
|
||||
使用两个 ls 程序: lsd 和 exa 来重新想象和设计你的文件和目录列表。
|
||||
|
||||
![][0]
|
||||
|
||||
Linux 中的 ls 命令是最常用的命令。此命令列出终端中的文件和目录。因此,如你所见,它非常流行,也许每个人都在使用。
|
||||
|
||||
但该命令输出的信息量很大,有时用彩色的方式查看它们会更方便。
|
||||
|
||||
例如,如果你以最基本的方式运行 ls 命令,它应该看起来有点像这样。
|
||||
|
||||
![The default list files and directories view via ls command][1]
|
||||
|
||||
这似乎有点乏味,不是吗?如果你可以对其进行一些样式设置,以便在看起来不错的同时变得更具可读性如何?
|
||||
|
||||
### 以样式列出文件和目录
|
||||
|
||||
#### lsd
|
||||
|
||||
我想向你展示的第一个应用叫做 “lsd”,也就是 “LSDeluxe”。它是对 GNU `ls` 命令的重写,具有列标题、各种项目的颜色、字体和图标支持等附加功能。
|
||||
|
||||
这是安装后的样子。
|
||||
|
||||
```
|
||||
lsd -l --header
|
||||
```
|
||||
|
||||
![lsd command showing list of files][2]
|
||||
|
||||
正如你所看到的,它看起来非常漂亮,用不同的颜色代码表示权限、文件类型和文件夹,甚至在文件名旁边添加图标。
|
||||
|
||||
该应用充满了诸如树视图(见下文)之类的功能,它甚至可以在单个命令中为你提供文件夹内的文件列表。
|
||||
|
||||
```
|
||||
lsd -l --header --tree
|
||||
```
|
||||
|
||||
![lsd command showing a tree view][3]
|
||||
|
||||
你可以在[官方 GitHub 页面][4]上了解有关其功能的更多信息。
|
||||
|
||||
我相信你很兴奋。让我们看看如何安装它。
|
||||
|
||||
你可以从此处下载用于 Ubuntu 和相关发行版的 deb 文件。之后,只需运行 dpkg 即可安装。
|
||||
|
||||
```
|
||||
sudo dpkg -i lsd_vvvv_amd64.deb
|
||||
```
|
||||
|
||||
对于 Fedora Linux,使用以下命令。
|
||||
|
||||
```
|
||||
sudo dnf install lsd
|
||||
```
|
||||
|
||||
Arch Linux 用户可以使用以下命令获取它。
|
||||
|
||||
```
|
||||
pacman -S lsd
|
||||
```
|
||||
|
||||
该应用也可用于其他发行版、macOS、BSD 和 Windows。对于这些说明,你可以[在此处找到它们][5]。
|
||||
|
||||
为了获得更好的体验,请将其与[装有 Oh My Zsh 的 Zsh shell][6] 一起使用。
|
||||
|
||||
#### exa
|
||||
|
||||
下一个程序是 `exa`,类似于 `lsd` 但具有更多功能。 `exa` 命令可以为你的 ls 输出着色,检测 Unix 系统中的各种文件类型、标题、树视图等更多功能。
|
||||
|
||||
Exa 是一个单一的二进制文件,占用的资源很小。以下是一些示例命令。
|
||||
|
||||
```
|
||||
exa -al
|
||||
```
|
||||
|
||||
```
|
||||
exa -abghHliS
|
||||
```
|
||||
|
||||
```
|
||||
exa -abghHliS --long --tree
|
||||
```
|
||||
|
||||
![Various exa commands][7]
|
||||
|
||||
你可以在 [GitHub][8] 上了解有关 exa 参数和选项的更多信息。
|
||||
|
||||
exa 的安装很简单,只需要一个命令。对于 Ubuntu 和相关发行版,你可以使用以下命令安装它。
|
||||
|
||||
```
|
||||
sudo apt install exa
|
||||
```
|
||||
|
||||
对于 Fedora 和 Arch Linux,分别使用以下命令。
|
||||
|
||||
```
|
||||
sudo dnf install exa
|
||||
```
|
||||
|
||||
```
|
||||
pacman -S exa
|
||||
```
|
||||
|
||||
同样,各种操作系统的所有其他安装说明都可以[在此处找到][9]。
|
||||
|
||||
### 从终端复制为 HTML
|
||||
|
||||
一个有趣的技巧是,以上所有彩色列表都可以通过默认的 Ubuntu 终端复制为 HTML。你可以将它用于你的网页或文档。
|
||||
|
||||
例如,我将上面的示例复制到 LibreOffice Writer 文档中。
|
||||
|
||||
它是最好的功能之一,尽管它取决于终端程序而不是上面的程序。
|
||||
|
||||
![Exporting the command output as HTML][10]
|
||||
|
||||
### 总结
|
||||
|
||||
我解释了两个程序的内部工作 – ls 和 exa 以样式列出文件和目录。我希望你能将它们用于不同的需求。
|
||||
|
||||
如果你喜欢它们,或者如果你知道任何此类程序,请在评论栏中告诉我。
|
||||
|
||||
干杯。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/list-files-directories-style/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[0]: https://www.debugpoint.com/wp-content/uploads/2022/08/cool-ls.jpg
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/The-default-list-files-and-directories-view-via-ls-command.jpg
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2022/08/lsd-command-showing-list-of-files-2.jpg
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2022/08/lsd-command-showing-a-tree-view.jpg
|
||||
[4]: https://github.com/Peltoche/lsd
|
||||
[5]: https://github.com/Peltoche/lsd#installation
|
||||
[6]: https://www.debugpoint.com/install-use-zsh/
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2022/08/Various-exa-commands.jpg
|
||||
[8]: https://github.com/ogham/exa#command-line-options
|
||||
[9]: https://github.com/ogham/exa#installation
|
||||
[10]: https://www.debugpoint.com/wp-content/uploads/2022/08/Exporting-the-command-output-as-HTML.jpg
|
Loading…
Reference in New Issue
Block a user