Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2020-01-15 09:18:27 +08:00
commit df5102a80b
12 changed files with 1783 additions and 139 deletions

View File

@ -1,40 +1,36 @@
[#]: collector: (lujun9972)
[#]: translator: (qianmingtian)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11781-1.html)
[#]: subject: (Bash Script to Send eMail With a List of User Accounts Expiring in “X” Days)
[#]: via: (https://www.2daygeek.com/bash-script-to-check-user-account-password-expiry-linux/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
使用Bash 脚本发送包含 “X” 天内到期的用户账号列表的电子邮件
使用 Bash 脚本发送包含几天内到期的用户账号列表的电子邮件
======
密码强制策略对所有操作系统和应用程序都是通用的。
![](https://img.linux.net.cn/data/attachment/album/202001/13/232047vfxkrr47mn7eapda.jpg)
如果要 **[在Linux上实现密码强制策略][1]** ,请参阅以下文章。
密码强制策略对所有操作系统和应用程序都是通用的。如果要[在 Linux 上实现密码强制策略][1],请参阅以下文章。
默认情况下,大多数公司都会强制执行密码强制策略,但根据公司的要求,密码的时间周期会有所不同。
默认情况下,大多数公司都会强制执行密码强制策略,但根据公司的要求,密码的时间周期会有所不同。通常每个人都使用 90 天的密码周期。用户只会在他们使用的一些服务器上[更改密码][2],而不会在他们不经常使用的服务器上更改密码。
通常每个人都使用 90 天的密码周期
特别地,大多数团队忘记更改服务帐户密码,这可能导致日常工作的中断,即使他们配置有[基于 SSH 密钥的身份验证][3]。如果用户帐户密码过期基于SSH密钥的身份验证和 [cronjob][4] 将不起作用
用户只会在他们使用的一些服务器上 **[更改密码][2]**,而不会在他们不经常使用的服务器上更改密码
为了避免这种情况,我们创建了一个 [shell 脚本][5]来向你发送 10 天内到期的用户帐户列表
特别地,大多数团队忘记更改服务帐户密码,这可能导致日常工作的中断,即使他们配置有 **[SSH基于密钥的身份验证][3]** 。
如果用户帐户密码过期基于SSH密钥的身份验证和 **[cronjobs][4]** 将不起作用。
为了避免这种情况,我们创建了一个 **[shell脚本][5]** 来向您发送 10 天内到期的用户帐户列表。
本教程中包含两个 **[bash脚本][6]** 可以帮助您收集系统中用户到期日的信息。
本教程中包含两个 [bash 脚本][6]可以帮助你收集系统中用户到期天数的信息。
### 1) 检查 10 天后到期的用户帐户列表
此脚本将帮助您检查终端上 10 天内到期的用户帐户列表。
此脚本将帮助你在终端上检查 10 天内到期的用户帐户列表。
```
# vi /opt/script/user-password-expiry.sh
```
```
#!/bin/sh
/tmp/user-expiry-1.txt
/tmp/user-expiry.txt
@ -54,7 +50,7 @@ cat /tmp/user-expiry.txt | awk '$2 <= 10' > /tmp/user-expiry-1.txt
cat /tmp/user-expiry-1.txt | column -t
```
将文件 **“user password expiry.sh”** 设置为 Linux 可执行文件权限。
将文件 `user-password-expiry.sh` 设置为可执行的 Linux 文件权限。
```
# chmod +x /opt/script/user-password-expiry.sh
@ -73,18 +69,21 @@ u2 9
u3 3
u4 5
```
### 2) 发送包含 10 天内到期的用户帐户列表的电子邮件
此脚本将发送一封包含 10 天内到期的用户帐户列表的邮件。
```
# vi /opt/script/user-password-expiry-mail.sh
```
```
#!/bin/sh
SUBJECT="Information About User Password Expiration on "`date`""
MESSAGE="/tmp/user-expiry.txt"
MESSAGE1="/tmp/user-expiry-1.txt"
TO="[email protected]"
TO="magesh.m@rentacenter.com"
echo "-------------------------------------------------" >> $MESSAGE1
echo "UserName The number of days the password expires" >> $MESSAGE1
echo "-------------------------------------------------" >> $MESSAGE1
@ -103,13 +102,13 @@ rm $MESSAGE
rm $MESSAGE1
```
将文件 **“user-password-expiry-mail.sh”** 设置为 Linux 可执行文件权限。
将文件 `user-password-expiry-mail.sh` 设置为可执行的 Linux 文件权限。
```
# chmod +x /opt/script/user-password-expiry-mail.sh
```
最后,添加一个 **[cronjob][4]** 去自动执行脚本。每天早上 8 点运行一次。
最后,添加一个 [cronjob][4] 去自动执行脚本。每天早上 8 点运行一次。
```
# crontab -e
@ -125,14 +124,14 @@ via: https://www.2daygeek.com/bash-script-to-check-user-account-password-expiry-
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[qianmingtian][c]
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[c]: https://github.com/qianmingtian
[1]: https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/
[1]: https://linux.cn/article-11709-1.html
[2]: https://www.2daygeek.com/linux-passwd-chpasswd-command-set-update-change-users-password-in-linux-using-shell-script/
[3]: https://www.2daygeek.com/configure-setup-passwordless-ssh-key-based-authentication-linux/
[4]: https://www.2daygeek.com/linux-crontab-cron-job-to-schedule-jobs-task/

View File

@ -1,88 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (qianmingtian)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Huaweis Linux Distribution openEuler is Available Now!)
[#]: via: (https://itsfoss.com/openeuler/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Huaweis Linux Distribution openEuler is Available Now!
======
Huawei offers a CentOS based enterprise Linux distribution called EulerOS. Recently, Huawei has released a community edition of EulerOS called [openEuler][1].
The source code of openEuler is released as well. You wont find it on Microsoft owned GitHub the source code is available at [Gitee][2], a Chinese [alternative of GitHub][3].
There are two separate repositories, one for the [source code][2] and the other as a [package source][4] to store software packages that help to build the OS.
![][5]
The openEuler infrastructure team shared their experience to make the source code available:
> We are very excited at this moment. It was hard to imagine that we will manage thousands of repositories. And to ensure that they can be compiled successfully, we would like to thank all those who participated in contributing
### openEuler is a Linux distribution based on CentOS
Like EulerOS, openEuler OS is also based on [CentOS][6] but is further developed by Huawei Technologies for enterprise applications.
It is tailored for ARM64 architecture servers and Huawei claims to have made changes to boost its performance. You can read more about it at [Huaweis dev blog][7].
![][8]
At the moment, as per the official openEuler announcement, there are more than 50 contributors with nearly 600 commits for openEuler.
The contributors made it possible to make the source code available to the community.
It is also worth noting that the repositories also include two new projects (or sub-projects) associated with it, [iSulad][9] **and A-Tune**.
A-Tune is an AI-based OS tuning software and iSulad is a lightweight container runtime daemon that is designed for IoT and Cloud infrastructure, as mentioned on [Gitee][2].
Also, the official [announcement post][10] mentioned that these systems are built on the Huawei Cloud through script automation. So, that is definitely something interesting.
### Downloading openEuler
![][11]
As of now, you wont find the documentation for it in English so you will have to wait for it or choose to help them with the [documentation][12].
You can download the ISO directly from its [official website][13] to test it out:
[Download openEuler][13]
### What do you think of Huawei openEuler?
As per cnTechPost, Huawei had announced that EulerOS would become open source under the new name openEuler.
At this point, its not clear if openEuler is replacing EulerOS or both will exist together like CentOS (community edition) and Red Hat (commercial edition).
I havent tested it yet so I cannot say if openEuler is suitable for English speaking users or not.
Are you willing to give this a try? In case youve already tried it out, feel free to let me know your experience with it in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/openeuler/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://openeuler.org/en/
[2]: https://gitee.com/openeuler
[3]: https://itsfoss.com/github-alternatives/
[4]: https://gitee.com/src-openeuler
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/openEuler-website.jpg?ssl=1
[6]: https://www.centos.org/
[7]: https://developer.huaweicloud.com/en-us/euleros/euleros-introduction.html
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/openeuler-gitee.jpg?ssl=1
[9]: https://gitee.com/openeuler/iSulad
[10]: https://openeuler.org/en/news/20200101.html
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/openEuler.jpg?ssl=1
[12]: https://gitee.com/openeuler/docs
[13]: https://openeuler.org/en/download.html

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (heguangzhi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
@ -84,7 +84,7 @@ via: https://opensource.com/article/20/1/prison-to-python
作者:[Shadeed "Sha" Wallace-Stepter][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[heguangzhi](https://github.com/heguangzhi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,387 @@
[#]: collector: (lujun9972)
[#]: translator: (lxbwolf)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to setup a DNS server with bind)
[#]: via: (https://fedoramagazine.org/how-to-setup-a-dns-server-with-bind/)
[#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/)
How to setup a DNS server with bind
======
![][1]
The Domain Name System, or DNS, as its more commonly known, translates or converts domain names into the IP addresses associated with that domain. DNS is the reason you are able to find your favorite website by name instead of typing an IP address into your browser. This guide shows you how to configure a Master DNS system and one client.
Here are system details for the example used in this article:
```
dns01.fedora.local (192.168.1.160 ) - Master DNS server
client.fedora.local (192.168.1.136 ) - Client
```
### DNS server configuration
Install the bind packages using sudo:
```
$ sudo dnf install bind bind-utils -y
```
The _/etc/named.conf_ configuration file is provided by the _bind_ package to allow you to configure the DNS server.
Edit the _/etc/named.conf_ file:
```
sudo vi /etc/named.conf
```
Look for the following line:
```
listen-on port 53 { 127.0.0.1; };
```
Add the IP address of your Master DNS server as follows:
```
listen-on port 53 { 127.0.0.1; 192.168.1.160; };
```
Look for the next line:
```
allow-query { localhost; };
```
Add your local network range. The example system uses IP addresses in the 192.168.1.X range. This is specified as follows:
```
allow-query { localhost; 192.168.1.0/24; };
```
Specify a forward and reverse zone. Zone files are simply text files that have the DNS information, such as IP addresses and host-names, on your system. The forward zone file makes it possible for the translation of a host-name to its IP address. The reverse zone file does the opposite. It allows a remote system to translate an IP address to the host name.
Look for the following line at the bottom of the /etc/named.conf file:
```
include "/etc/named.rfc1912.zones";
```
Here, youll specify the zone file information _**directly above that line**_ as follows:
```
zone "dns01.fedora.local" IN {
type master;
file "forward.fedora.local";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "reverse.fedora.local";
allow-update { none; };
};
```
The _forward.fedora.local_ and the file _reverse.fedora.local_ are just the names of the zone files you will be creating. They can be called anything you like.
Save and exit.
#### Create the zone files
Create the forward and reverse zone files you specified in the /etc/named.conf file:
```
$ sudo vi /var/named/forward.fedora.local
```
Add the following lines:
```
$TTL 86400
@ IN SOA dns01.fedora.local. root.fedora.local. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS dns01.fedora.local.
@ IN A 192.168.1.160
dns01 IN A 192.168.1.160
client IN A 192.168.1.136
```
Everything in _**bold**_ is specific to your environment. Save the file and exit. Next, edit the _reverse.fedora.local_ file:
```
$ sudo vi /var/named/reverse.fedora.local
```
Add the following lines:
```
$TTL 86400
@ IN SOA dns01.fedora.local. root.fedora.local. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS dns01.fedora.local.
@ IN PTR fedora.local.
dns01 IN A 192.168.1.160
client IN A 192.168.1.136
160 IN PTR dns01.fedora.local.
136 IN PTR client.fedora.local.
```
Everything in _**bold**_ is also specific to your environment. Save the file and exit.
Youll also need to configure SELinux and add the correct ownership for the configuration files.
```
sudo chgrp named -R /var/named
sudo chown -v root:named /etc/named.conf
sudo restorecon -rv /var/named
sudo restorecon /etc/named.conf
```
Configure the firewall:
```
sudo firewall-cmd --add-service=dns --perm
sudo firewall-cmd --reload
```
#### Check the configuration for any syntax errors
```
sudo named-checkconf /etc/named.conf
```
Your configuration is valid if no output or errors are returned.
Check the forward and reverse zone files.
```
$ sudo named-checkzone forward.fedora.local /var/named/forward.fedora.local
$ sudo named-checkzone reverse.fedora.local /var/named/reverse.fedora.local
```
You should see a response of OK:
```
zone forward.fedora.local/IN: loaded serial 2011071001
OK
zone reverse.fedora.local/IN: loaded serial 2011071001
OK
```
#### Enable and start the DNS service
```
$ sudo systemctl enable named
$ sudo systemctl start named
```
#### Configuring the resolv.conf file
Edit the _/etc/resolv.conf_ file:
```
$ sudo vi /etc/resolv.conf
```
Look for your current name server line or lines. On the example system, a cable modem/router is serving as the name server and so it currently looks like this:
```
nameserver 192.168.1.1
```
This needs to be changed to the IP address of the Master DNS server:
```
nameserver 192.168.1.160
```
Save your changes and exit.
Unfortunately there is one caveat to be aware of. NetworkManager overwrites the _/etc/resolv.conf_ file if the system is rebooted or networking gets restarted. This means you will lose all of the changes that you made.
To prevent this from happening, make _/etc/resolv.conf_ immutable:
```
$ sudo chattr +i /etc/resolv.conf
```
If you want to set it back and allow it to be overwritten again:
```
$ sudo chattr -i /etc/resolv.conf
```
#### Testing the DNS server
```
$ dig fedoramagazine.org
```
```
; <<>> DiG 9.11.13-RedHat-9.11.13-2.fc30 <<>> fedoramagazine.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8391
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 6
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: c7350d07f8efaa1286c670ab5e13482d600f82274871195a (good)
;; QUESTION SECTION:
;fedoramagazine.org. IN A
;; ANSWER SECTION:
fedoramagazine.org. 50 IN A 35.197.52.145
;; AUTHORITY SECTION:
fedoramagazine.org. 86150 IN NS ns05.fedoraproject.org.
fedoramagazine.org. 86150 IN NS ns02.fedoraproject.org.
fedoramagazine.org. 86150 IN NS ns04.fedoraproject.org.
;; ADDITIONAL SECTION:
ns02.fedoraproject.org. 86150 IN A 152.19.134.139
ns04.fedoraproject.org. 86150 IN A 209.132.181.17
ns05.fedoraproject.org. 86150 IN A 85.236.55.10
ns02.fedoraproject.org. 86150 IN AAAA 2610:28:3090:3001:dead:beef:cafe:fed5
ns05.fedoraproject.org. 86150 IN AAAA 2001:4178:2:1269:dead:beef:cafe:fed5
;; Query time: 830 msec
;; SERVER: 192.168.1.160#53(192.168.1.160)
;; WHEN: Mon Jan 06 08:46:05 CST 2020
;; MSG SIZE rcvd: 266
```
There are a few things to look at to verify that the DNS server is working correctly. Obviously getting the results back are important, but that by itself doesnt mean the DNS server is actually doing the work.
The QUERY, ANSWER, and AUTHORITY fields at the top should show non-zero as it in does in our example:
```
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 6
```
And the SERVER field should have the IP address of your DNS server:
```
;; SERVER: 192.168.1.160#53(192.168.1.160)
```
In case this is the first time youve run the _dig_ command, notice how it took 830 milliseconds for the query to complete:
```
;; Query time: 830 msec
```
If you run it again, the query will run much quicker:
```
$ dig fedoramagazine.org
```
```
;; Query time: 0 msec
;; SERVER: 192.168.1.160#53(192.168.1.160)
```
### Client configuration
The client configuration will be a lot simpler.
Install the bind utilities:
```
$ sudo dnf install bind-utils -y
```
Edit the /etc/resolv.conf file and configure the Master DNS as the only name server:
```
$ sudo vi /etc/resolv.conf
```
This is how it should look:
```
nameserver 192.168.1.160
```
Save your changes and exit. Then, make the _/etc/resolv.conf_ file immutable to prevent it from be overwritten and going back to its default settings:
```
$ sudo chattr +i /etc/resolv.conf
```
#### Testing the client
You should get the same results as you did from the DNS server:
```
$ dig fedoramagazine.org
```
```
; <<>> DiG 9.11.13-RedHat-9.11.13-2.fc30 <<>> fedoramagazine.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8391
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 6
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: c7350d07f8efaa1286c670ab5e13482d600f82274871195a (good)
;; QUESTION SECTION:
;fedoramagazine.org. IN A
;; ANSWER SECTION:
fedoramagazine.org. 50 IN A 35.197.52.145
;; AUTHORITY SECTION:
fedoramagazine.org. 86150 IN NS ns05.fedoraproject.org.
fedoramagazine.org. 86150 IN NS ns02.fedoraproject.org.
fedoramagazine.org. 86150 IN NS ns04.fedoraproject.org.
;; ADDITIONAL SECTION:
ns02.fedoraproject.org. 86150 IN A 152.19.134.139
ns04.fedoraproject.org. 86150 IN A 209.132.181.17
ns05.fedoraproject.org. 86150 IN A 85.236.55.10
ns02.fedoraproject.org. 86150 IN AAAA 2610:28:3090:3001:dead:beef:cafe:fed5
ns05.fedoraproject.org. 86150 IN AAAA 2001:4178:2:1269:dead:beef:cafe:fed5
;; Query time: 1 msec
;; SERVER: 192.168.1.160#53(192.168.1.160)
;; WHEN: Mon Jan 06 08:46:05 CST 2020
;; MSG SIZE rcvd: 266
```
Make sure the SERVER output has the IP Address of your DNS server.
Your DNS server is now ready to use and all requests from the client should be going through your DNS server now!
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/how-to-setup-a-dns-server-with-bind/
作者:[Curt Warfield][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/rcurtiswarfield/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/dns-server-bind-1-816x345.png

View File

@ -0,0 +1,79 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Keep your email in sync with OfflineIMAP)
[#]: via: (https://opensource.com/article/20/1/sync-email-offlineimap)
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney)
Keep your email in sync with OfflineIMAP
======
Mirroring your email to a local folder is the first step in taming your
message pileup. Learn how in the third article in our series on 20 ways
to be more productive with open source in 2020.
![email or newsletters via inbox and browser][1]
Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using.
### Sync your email locally with OfflineIMAP
I have a love/hate relationship with email. I love the way it allows me to communicate with people all over the world. But, like many of you, I get a lot of mail, much of it from lists as well as spammers, advertisers, and the like. And it builds up.
![The OfflineIMAP "blinkenlights" UI][2]
Almost all the tools I've tried (outside of the big mail providers) that work really well with large amounts of mail have one thing in common: they all rely on a local copy of your mail stored in [Maildir][3] format. And the most useful tool for that is [OfflineIMAP][4]. OfflineIMAP is a Python script that mirrors IMAP mailboxes to a local Maildir folder tree. I use it to create a local copy of my mail and keep it in sync. Most Linux distributions include it, and it is available via Python's pip package manager.
The sample minimal configuration file is a good template to start with; begin by copying it to **~/.offlineimaprc**. Mine looks something like this:
```
[general]
accounts = LocalSync
ui=Quiet
autorefresh=30
[Account LocalSync]
localrepository = LocalMail
remoterepository = MirrorIMAP
[Repository MirrorIMAP]
type = IMAP
remotehost = my.mail.server
remoteuser = myusername
remotepass = mypassword
auth_mechanisms = LOGIN
createfolder = true
ssl = yes
sslcacertfile = OS-DEFAULT
[Repository LocalMail]
type = Maildir
localfolders = ~/Maildir
sep = .
createfolder = true
```
What my configuration does is define two repositories: the remote IMAP server and the local Maildir folder. There is also the **Account** that tells OfflineIMAP what to sync when it runs. You can define multiple accounts linked to different repositories. This allows you to copy from one IMAP server to another as a backup, in addition to making a copy locally.
The first run of OfflineIMAP will take a while if you have a lot of mail. But once it is done, future runs take a _lot_ less time. You can also run OfflineIMAP as a cron job (my preference) or as a daemon constantly syncing between repositories. The documentation covers all of this, as well as advanced configuration options for things like Gmail.
Now that my mail is copied locally, there is a whole range of tools I can work with to speed up searching, filing, and managing mail. And I'll talk about that tomorrow.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/sync-email-offlineimap
作者:[Kevin Sonney][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ksonney
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser)
[2]: https://opensource.com/sites/default/files/uploads/productivity_3-1.png (The OfflineIMAP "blinkenlights" UI)
[3]: https://en.wikipedia.org/wiki/Maildir
[4]: http://www.offlineimap.org/

View File

@ -0,0 +1,380 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Use this script to create, save, and run different rsync configurations via named profiles)
[#]: via: (https://opensource.com/article/20/1/create-save-run-rsync-configurations)
[#]: author: (Petr Beránek https://opensource.com/users/pberanek)
Use this script to create, save, and run different rsync configurations via named profiles
======
A quick explanation of the rpf script.
![Person drinking a hat drink at the computer][1]
The **rpf** script allows you to create, save, and run different rsync configurations via named profiles.
For example, create a new profile named **backup** by typing **rpf -c backup**. Assume that the username is **user**.
**rpf** creates the following directories:
* **/home/user/.rpf**
* **/home/user/.rpf/shared** where you can place config files shared by multiple profiles
* **/home/user/.rpf/profiles** where all profiles are saved as subdirectories
**rpf** also created **/home/user/.rpf/profiles/backup** that contains the files **conf** and **excluded**.
The **conf** file defines rsync's configuration:
```
# rsync config template
#
# Write each rsync option on separate line. For option details see man rsync.
# Empty lines and lines starting with # are ignored. Dynamic references
# (e.g. using command substitution) are not supported.
#
# Config files shared between different profiles should be saved in
# /home/user/.rpf/shared
#
# Example configuration:
#
\--verbose
\--archive
\--human-readable
# exclude all files that match pattern in:
\--exclude-from=/home/user/.rpf/profiles/backup/exclude
\--relative
# perform trial run, make no changes
\--dry-run
# source, e.g.
/home/user
# destination, e.g.
/mnt/usb_drive/users_backup
```
Now you can edit, add, or remove rsync options as needed.
In **exclude**, you can define paths or patterns of files and directories you want to exclude from the transfer. To exclude **Trash** and **Downloads**, add the following lines:
```
\- /home/user/.local/share/Trash
\- /home/user/Downloads
```
Or to transfer only **Documents** and **Projects** and exclude everything else:
```
\+ /home/user/Documents
\+ /home/user/Projects
\- **
```
For subtler pattern configurations, see the FILTER RULES section of **man rsync**, or Google for tutorials.
When you are ready, you can start rsync transfer by typing **rpf backup**.
That's it.
For additional **rpf** options, see **rpf --help**.
### Security
Please be aware that **rpf** is not secure against code injection in the **conf** file. Any additional code (e.g., **; ./run_evil_script**) will also be executed. Therefore, protect your **.rpf/** config directory from malicious users by implementing appropriate permissions. Moreover, exploiting this behavior can lead to unexpected side effects.
### The script
```
#!/usr/bin/env bash
#
# Simple rsync profiler
#
# Author: [petrberanek.mail@gmail.com][2] (Petr Beranek)
#
# For usage details type `rpf --help'
#
set -o errexit
set -o nounset
__name=$(basename "${0}")
__version="0.1"
config_dir="${HOME}/.rpf"
profiles_dir="${config_dir}/profiles"
shared_dir="${config_dir}/shared"
help="\
Usage: ${__name} [OPTION...] PROFILE_NAME
${__name} is simple rsync profiler that stores your different rsync
configurations in named profiles.
Options:
    -c, --create-profile PROFILE_NAME   create new profile (profile data
                            are stored in ${config_dir}/PROFILE_NAME).
                            Profile name can contain alphanumeric
                            characters only.
    -s, --show-profile-config PROFILE_NAME  show content of profile
                            configuration file (stored in
                            ${config_dir}/PROFILE_NAME)
    -l, --list-profiles     list all available profiles
    -h, --help              show this help
Example:
    Create new profile by typing
    ${__name} -c PROFILE_NAME
    edit its config files stored by default in
    ${profiles_dir}/PROFILE_NAME
    and then run it by typing
    ${__name} PROFILE_NAME
    That's it.
${__name} comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions. See
the GNU General Public Licence for details.
Email bug reports or enhancement requests to [petrberanek.mail@gmail.com][2].
"
create_profile() {
    # Create dir with given profile name and with default content.
    #
    # Arguments: $1 -- profile name
    #
    # Creates files: conf, exclude
    #
    # If dir with the same name already exists, exits with error.
    #
    local profile_name="${1}"
    local profile_dir="${profiles_dir}/${profile_name}"
    # create default rpf dirs if missing
    if [[ ! -d "${profiles_dir}" ]]; then
        echo "Creating ${profiles_dir}"
        mkdir --parents "${profiles_dir}"
    fi
    if [[ ! -d "${shared_dir}" ]]; then
        echo "Creating ${shared_dir}"
        mkdir --parents "${shared_dir}"
    fi
    # don't overwrite existing profile
    if [[ -d "${profile_dir}" ]]; then
        echo "${__name}: error: profile already exists."
        exit 1
    fi
    echo "Creating ${profile_dir}"
    mkdir "${profile_dir}"
    # create `conf' template
    local conf="${profile_dir}/conf"
    echo "Creating ${conf}"
    cat &lt;&lt; EOF &gt; "${conf}"
# rsync config template
#
# Write each rsync option on separate line. For details see man rsync.
# Empty lines and lines starting with # are ignored. Dynamic references
# (e.g. using command substitution) are not supported.
#
# Config files shared between different profiles should be saved in
# ${shared_dir}
#
# Example configuration:
#
\--verbose
\--archive
\--human-readable
# file with patterns of files and directories in source excluded
# from transfer
\--exclude-from="${profiles_dir}/${profile_name}/exclude"
\--relative
# perform trial run, make no changes
\--dry-run
# source, e.g.
${HOME}
# destination, e.g.
/mnt/usb_drive/my_backup
EOF
    # create `exclude' template
    local exclude="${profile_dir}/exclude"
    echo "Creating ${exclude}"
    cat &lt;&lt; EOF &gt; "${exclude}"
# \\`exclude' template
#
# Lines starting with # or ; are ignored. For details see man rsync,
# section FILTER RULES.
#
EOF
    # all done
    echo "OK"
    echo "Edit profile config files in ${profile_dir} to fit your needs."
}
list_profiles() {
    # Show all available rpf profiles.
    #
    # Assumes that all dirs in $profiles_dir are profiles.
    #
    for item in "${profiles_dir}"/*; do
        if [[ -d "${item}" ]]; then
            basename "${item}"
        fi
    done
}
show_help() { echo "${help}"; }
show_profile_config() {
    # Show configuration file for given profile.
    #
    # Arguments: $1 -- profile name
    #
    local profile_name="${1}"
    less "${profiles_dir}/${profile_name}/conf"
}
check_profile_name() {
    # Check that name is not empty and contains alphanumeric chars only.
    #
    # Arguments: $1 -- profile name
    #
    # If test fails, exits with error.
    #
    if [[ -z "${1}" ]]; then
        echo "${__name}: error: empty profile name."
        exit 1
    elif [[ "${1}" =~ [^a-zA-Z0-9] ]]; then
        echo "${__name}: error: non-alphanumeric characters in profile name."
        exit 1
    fi
}
check_profile_exists() {
    # Check that $profile_name exists and is a directory.
    #
    # Arguments: $1 -- profile name
    #
    # If test fails, exits with error.
    #
    local profile_name="${1}"
    if [[ ! -d "${profiles_dir}/${profile_name}" ]]; then
        echo "${__name}: error: profile ${profile_name} does not exist."
        exit 1
    fi
}
check_num_args() {
    # Check that value of $1 = number of arguments (excluding $1)
    #
    # Arguments: $1 -- limit (positive int)
    #
    # If test fails, exits with error.
    #
    local num_args=$(( ${#} - 1 ))  # do not count $1 in total num of args
    if [[ "${1}" -ne "${num_args}" ]]; then
        echo "${__name}: error: expected num args: ${1}, received: $num_args"
        exit 1
    fi
}
run_rsync() {
    # Run rsync with configuration coresponding to given profile name.
    #
    # Arguments: $1 -- profile name
    #
    local profile_name="${1}"
    local visual_div="=============================="
    local parsed_args
    parsed_args=$(grep --invert-match '^#' "${profiles_dir}/${profile_name}/conf" \
                    | tr '\n' ' ')
    # Print debug info
    echo "${visual_div}"
    echo "${__name} version: ${__version}"
    echo "args: ${parsed_args}"
    echo "${visual_div}"
    # Expand $parsed_args - each item from conf file becomes rsync argument
    # shellcheck disable=SC2086
    rsync ${parsed_args}
}
if [[ "${#}" == 0 ]]; then
    show_help
    exit 1
fi
while [[ "${#}" -gt 0 ]]; do
    case "${1}" in
        -c | --create-profile)
            check_num_args 2 "${@}"
            shift
            check_profile_name "${1:-}" # If $1 is not declared, set it empty.
            create_profile "${1}"
            exit 0;;
        -s | --show-profile-config)
            check_num_args 2 "${@}"
            shift
            check_profile_name "${1:-}"
            check_profile_exists "${1}"
            show_profile_config "${1}"
            exit 0;;
        -l | --list-profiles)
            check_num_args 1 "${@}"
            list_profiles
            exit 0;;
        -h | --help)
            check_num_args 1 "${@}"
            show_help
            exit 0;;
        -*)
            echo "${__name}: error: unknown option \\`${1}'"
            exit 1;;
        *)
            check_num_args 1 "${@}"
            check_profile_name "${1:-}"
            check_profile_exists "${1}"
            run_rsync "${1}"
            exit 0;;
    esac
    shift
done
```
* * *
This was originally published in [Petr Beranek's GitHub repository][3] and it is licensed under GPLv3.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/create-save-run-rsync-configurations
作者:[Petr Beránek][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/pberanek
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer)
[2]: mailto:petrberanek.mail@gmail.com
[3]: https://github.com/beranep/rpf

View File

@ -0,0 +1,303 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (setV: A Bash function to maintain Python virtual environments)
[#]: via: (https://opensource.com/article/20/1/setv-bash-function)
[#]: author: (Sachin Patil https://opensource.com/users/psachin)
setV: A Bash function to maintain Python virtual environments
======
Get to know setV, a lightweight Python virtual environment manager and
alternative to virtualenvwrapper.
![Coding on a computer][1]
For more than a year, [setV][2] has been hidden away within my [bash_scripts][3] project, but it's time for it to become public. setV is a Bash function I use as an alternative to [virtualenvwrapper][4]. It provides basic features that enable you to do things such as:
* Use Python 3 by default
* Create a new virtual environment
* Create a new virtual environment using a custom Python path with **-p** (or **\--python**)
* Delete an existing virtual environment
* List all existing virtual environment
* Use Tab completion (in case you don't remember the virtual environment name)
### Installation
To install setV, download the script:
```
`curl https://gitlab.com/psachin/setV/raw/master/install.sh`
```
Review the script, and then run it:
```
`sh ./install.sh`
```
When you install setV, the installation script asks you to source **~/.bashrc** or **~/.bash_profile**. Be sure to do that.
### Usage
The basic command is **setv**.
#### Create a virtual environment:
```
setv --new rango  # setv -n rango
# Or using a custom Python binary path
setv --new --python /opt/python/python3 rango  # setv -n -p /opt/python/python3 rango
```
#### Activate an existing environment:
```
setv VIRTUAL_ENVIRONMENT_NAME
# For example
setv rango
```
#### List all virtual environments:
```
setv --list
# or
setv [TAB] [TAB]
```
#### Delete a virtual environment:
```
`setv --delete rango`
```
#### Switch to another virtual environment:
```
# Assuming you are in 'rango', switch to 'tango' using
setv tango
```
#### Tab Completion
If you don't fully remember the virtual environment's name, Bash-like Tab completion works for virtual environment names.
### Get involved
setV is open source under the GNU [GPLv3][5], and contributions are welcome. To learn more, visit the Contribute section of setV's [README][6] in its GitLab repository.
### The setV script
```
#!/usr/bin/env bash
# setV - A Lightweight Python virtual environment manager.
# Author: Sachin (psachin) &lt;[iclcoolster@gmail.com][7]&gt;
# Author's URL: <https://psachin.gitlab.io/about>
#
# License: GNU GPL v3, See LICENSE file
#
# Configure(Optional):
# Set `SETV_VIRTUAL_DIR_PATH` value to your virtual environments
# directory-path. By default it is set to '~/virtualenvs/'
#
# Usage:
# Manual install: Added below line to your .bashrc or any local rc script():
# ---
# source /path/to/virtual.sh
# ---
#
# Now you can 'activate' the virtual environment by typing
# $ setv &lt;YOUR VIRTUAL ENVIRONMENT NAME&gt;
#
# For example:
# $ setv rango
#
# or type:
# setv [TAB] [TAB]  (to list all virtual envs)
#
# To list all your virtual environments:
# $ setv --list
#
# To create new virtual environment:
# $ setv --new new_virtualenv_name
#
# To delete existing virtual environment:
# $ setv --delete existing_virtualenv_name
#
# To deactivate, type:
# $ deactivate
# Path to virtual environment directory
SETV_VIRTUAL_DIR_PATH="$HOME/virtualenvs/"
# Default python version to use. This decides whether to use `virtualenv` or `python3 -m venv`
SETV_PYTHON_VERSION=3  # Defaults to Python3
SETV_PY_PATH=$(which python${SETV_PYTHON_VERSION})
function _setvcomplete_()
{
    # Bash-autocompletion.
    # This ensures Tab-auto-completions work for virtual environment names.
    local cmd="${1##*/}" # to handle command(s).
                         # Not necessary as such. 'setv' is the only command
    local word=${COMP_WORDS[COMP_CWORD]} # Words thats being completed
    local xpat='${word}'                 # Filter pattern. Include
                                         # only words in variable '$names'
    local names=$(ls -l "${SETV_VIRTUAL_DIR_PATH}" | egrep '^d' | awk -F " " '{print $NF}') # Virtual environment names
    COMPREPLY=($(compgen -W "$names" -X "$xpat" -- "$word")) # compgen generates the results
}
function _setv_help_() {
    # Echo help/usage message
    echo "Usage: setv [OPTIONS] [NAME]"
    echo Positional argument:
    echo -e "NAME                       Activate virtual env."
    echo Optional arguments:
    echo -e "-l, --list                 List all Virtual Envs."
    echo -e "-n, --new NAME             Create a new Python Virtual Env."
    echo -e "-d, --delete NAME          Delete existing Python Virtual Env."
    echo -e "-p, --python PATH          Python binary path."
}
function _setv_custom_python_path()
{
    if [ -f "${1}" ];
    then
        if [ "`expr $1 : '.*python\\([2,3]\\)'`" = "3" ];
        then
            SETV_PYTHON_VERSION=3
        else
            SETV_PYTHON_VERSION=2
        fi
        SETV_PY_PATH=${1}
        _setv_create $2
    else
        echo "Error: Path ${1} does not exist!"
    fi
}
function _setv_create()
{
    # Creates new virtual environment if ran with -n|--new flag
    if [ -z ${1} ];
    then
        echo "You need to pass virtual environment name"
        _setv_help_
    else
        echo "Creating new virtual environment with the name: $1"
        if [ ${SETV_PYTHON_VERSION} -eq 3 ];
        then
            ${SETV_PY_PATH} -m venv ${SETV_VIRTUAL_DIR_PATH}${1}
        else
            virtualenv -p ${SETV_PY_PATH} ${SETV_VIRTUAL_DIR_PATH}${1}
        fi
        echo "You can now activate the Python virtual environment by typing: setv ${1}"
    fi
}
function _setv_delete()
{
    # Deletes virtual environment if ran with -d|--delete flag
    # TODO: Refactor
    if [ -z ${1} ];
    then
        echo "You need to pass virtual environment name"
        _setv_help_
    else
        if [ -d ${SETV_VIRTUAL_DIR_PATH}${1} ];
        then
            read -p "Really delete this virtual environment(Y/N)? " yes_no
            case $yes_no in
                Y|y) rm -rvf ${SETV_VIRTUAL_DIR_PATH}${1};;
                N|n) echo "Leaving the virtual environment as it is.";;
                *) echo "You need to enter either Y/y or N/n"
            esac
        else
            echo "Error: No virtual environment found by the name: ${1}"
        fi
    fi
}
function _setv_list()
{
    # Lists all virtual environments if ran with -l|--list flag
    echo -e "List of virtual environments you have under ${SETV_VIRTUAL_DIR_PATH}:\n"
    for virt in $(ls -l "${SETV_VIRTUAL_DIR_PATH}" | egrep '^d' | awk -F " " '{print $NF}')
    do
        echo ${virt}
    done
}
function setv() {
    # Main function
    if [ $# -eq 0 ];
    then
        _setv_help_
    elif [ $# -le 3 ];
    then
        case "${1}" in
            -n|--new) _setv_create ${2};;
            -d|--delete) _setv_delete ${2};;
            -l|--list) _setv_list;;
            *) if [ -d ${SETV_VIRTUAL_DIR_PATH}${1} ];
               then
                   # Activate the virtual environment
                   source ${SETV_VIRTUAL_DIR_PATH}${1}/bin/activate
               else
                   # Else throw an error message
                   echo "Sorry, you don't have any virtual environment with the name: ${1}"
                   _setv_help_
               fi
               ;;
        esac
    elif [ $# -le 5 ];
    then
        case "${2}" in
            -p|--python) _setv_custom_python_path ${3} ${4};;
            *) _setv_help_;;
        esac
    fi
}
# Calls bash-complete. The compgen command accepts most of the same
# options that complete does but it generates results rather than just
# storing the rules for future use.
complete  -F _setvcomplete_ setv
```
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/setv-bash-function
作者:[Sachin Patil][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/psachin
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer)
[2]: https://gitlab.com/psachin/setV
[3]: https://github.com/psachin/bash_scripts
[4]: https://virtualenvwrapper.readthedocs.org/
[5]: https://gitlab.com/psachin/setV/blob/master/LICENSE
[6]: https://gitlab.com/psachin/setV/blob/master/ReadMe.org
[7]: mailto:iclcoolster@gmail.com

View File

@ -0,0 +1,368 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (16 Places to Buy a Pre-installed Linux Laptop Online)
[#]: via: (https://www.2daygeek.com/buy-linux-laptops-computers-online/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
16 Places to Buy a Pre-installed Linux Laptop Online
======
Linux runs on most hardware these days, but most retailers do not have Linux operating systems pre-installed on their hardware.
Gone are the days when users would only buy a Windows OS pre-installed laptop.
Over the years, developers have purchased many Linux laptops as they work on major Linux applications related to Docker, Kubernetes, AI, cloud-native computing and machine learning.
But now-a-days users are eager to buy a Linux laptop instead of Windows, which allows many vendors to choose Linux OS.
### Why Pre-installed Linux?
Now-a-days normal users also started using Linux OS because of its open source nature, security and reliability.
But most of the retailers around the world do not sell Linux operating system pre-installed.
It is difficult for Linux aspirants to find the compatible hardware and drivers to get Linux OS installed.
So, we recommend to have Linux OS pre-installed computers instead of figuring out compatibility issues.
Here we list the top 16 (not in particular order) manufacturer/vendor best known for preloaded Linux OS computers.
### 1) Dell
Dell is a US multinational computer technology company that commenced to sell and distribute pre-installed Ubuntu Linux computers for several years now.
Initially it was started on 2012 as a community project called Sputnik.
The strong community support to the project became a product. Over the year they launched the first Dell XPS 13 Developer Edition (Sputnik 3) after fixing some major issues in Sputnik 1 and Sputnik 2.
[![][1]][2]
They sells Red hat Enterprise Linux and Ubuntu Linux-based laptop for business use, developers and sysadmins.
All systems are preloaded with Ubuntu but few of them were certified to install Red Hat Enterprise Linux 7.5 and RHEL 8.
I hope you can install other distro as well if you want to run but i didnt try it.
The signature Linux products of Dell are **[XPS developer edition][3]**, **[Precision mobile workstation][4]** and Precision tower workstation.
* **Availability:** Worldwide
* **Product Details:** [Dell Linux Systems][5]
### 2) System 76
**[System76][6]** is an American computer manufacturer based in Denver, Colorado specializing in the sale of notebooks, desktops, and servers.
From the year 2003, Sytem76 started to computers with the Linux operating system installed.
They developed Linux distribution named Pop!_OS based on Ubuntu using the GNOME Desktop Environment for developers and professionals.
[![][1]][7]
The products are categorized majorly based on portability, storage, graphics and CPU performance.
Lower laptop model Galago Pro is costing around $950 and higher models such as Adder WS and Serval WS are costing around $2000.
They provide Destops(Thelio variants) in range of $800 to $2600.
They also sell mini servers(Meerkat) ranges from $500 and Larger Servers(Jackal, Ibex and Starling) with preloaded Ubuntu ranges from $3000.
They provide the laptop with the coreboot open source firmware, which is an alternative to the proprietary BIOS firmware.
System76 ships their products to 60 countries all around the world in Africa, Europe, Asia, North America, South America, Australia and Zealandia.
* **Availability:** To 60 countries worldwide
* **Product Details:** [System76][8]
### 3) Purism
Purism is a US-based company that commenced its operation in 2014.
It manufactures the Librem personal computing devices with a focus on software freedom, computer security, and Internet privacy.
[![][1]][9]
Purism sell their products with PureOS installed, a Linux distribution based on Debain developed by purism.
They sell multiple customized products such as Laptops, Tablets, Smartphones, Server and Librem key.
* **Availability:** Worldwide
* **Product Details:** [Purism][10]
### 4) Slimbook
**[Slimbook][11]** commenced their operation in 2015 based in spain.
It is a Linux friendly product that offers Laptops, Desktops, Mini Pcs,All in one PCs and Servers.
[![][1]][12]
It sell their products with with preloaded variety of Linux distributions, windows or both.
They were the first to sell KDE OS installed. It is ideal for Linux beginners, since it is easy to use and easy to learn.
The Laptop body is made of metal alloy based on aluminum and magnesium.
* **Availability:** Worldwide
* **Product Details:** [Slimbook][13]
### 5) Tuxedo Computers
Tuxedo computers a german based company sells notebooks, desktops and mini computers with preloaded Linux.
Their products desktop cost starts from around 480EUR, mini computers starts from 430EUR and notebooks starts from around 815EUR.
They have both intel and AMD processors and come up with 5 years warranty and lifetime support.
TUXEDO Computers are individually built computers and PCs being fully Linux-suitable. They sell their products to most part of Europe and USA.
* **Availability:** Ships to many countries
* **Product Details:** [Tuxedo Computers][14]
### 6) ThinkPenguin
ThinkPengine is a US based company started their operation in 2008 to improve support for GNU/Linux and other free software operating systems.
They sell desktops, notebooks, network equipment, storage devices, printers, scanners and other accessories that are compatible with Linux.
They provide warranty from 90days to 3years based on the products.
* **Availability:** Worldwide
* **Product Details:** [ThinkPenguin][15]
### 7) Emperor Linux
EmperorLinux is a US based company,since 1999 they provides Linux laptops with full hardware support under Linux.
They offers Linux laptops with unique features such as Molecule RD3D using Sharps ground-breaking Auto-Stereo 3D display, Panasonics ToughBook line of rugged &amp; semi-rugged Linux laptops.
They also sell fully-functional Linux tablets, the Raven tablet (based on the ThinkPad X series).
* **Availability:** USA (International shipping is available upon request).
* **Product Details:** [Emperor Linux][16]
### 8) ZaReason
ZaReason opened for business in the year 2007 based in US.
They mainly focuses on R&amp;D labs, businesses both small and large, universities and peoples homes.
It has a long career building hardware for different distros such as Debian, Fedora, Ubuntu, Kubuntu, Edubuntu and Linux Mint Preloaded.
[![][1]][17]
And customer can even choose Linux disros of their choose other than specified.
Their laptop ranges from $999 to $1699. Their desktop and mini computers ranges from $499 to $1199.
They do sell desktop specific for game lovers (Gamebox9400).
Default warranty will be for a year. Additional cost includes for extending the warranty till 3 years.
* **Availability:** USA and Canada
* **Product Details:** [ZaReason][18]
### 9) LAC Portland
LAC(Los Alamos Computers) Portland is a US based company, provides Linux-based computers configured and supported by GNU and Linux professionals since 2000.
They sell Lenovo desktops(ThinkCentre and ThinkStation) ranges from $845 to $2215 and laptops(ThinkPad) ranges from $926 to $2380.
They install and sell Linux distors such as Ubuntu, Linux Mint, Debain, Fedora, CentOS, Scientific Linux, Open SUSE and Free DOS.
They provide five years hardware and labor warranty with on-site support options backed worldwide by Lenovo.
* **Availability:** USA
* **Product Details:** [LAC Portland][19]
### 10) Entroware
Entroware is a UK based company specialized in providing Ubuntu based computing solutions and services since early 2014 based on customers requirements.
They sell Ubuntu and Ubuntu MATE powered Desktops, Laptops, and Servers using modern and high quality components.
[![][1]][20]
They do sell mini computers and All-in-one computers.
Desktop ranges from $499 to $1900, laptops ranges from $740 to $1900 and server ranges from $1150 to $2000.
They also sell accessories such as OS recovery drive, external hard drive, etc.
The default warranty is for 3 years, they have three warranty plans for which additional may include. They also provide software support.
Entroware currently ships to UK, Republic of Ireland, France, Germany, Italy and Spain.
* **Availability:** UK and other European countries (Republic of Ireland, France, Germany, Italy and Spain).
* **Product Details:** [Entroware][21]
### 11) Vikings
Viking is based in Germany, sells Libre-friendly hardware certified by the Free Software Foundation with preinstalled Debian, Trisquel or Parabola Linux based on customer requirement.
They sell desktops, laptops, servers, routers, mainboards, key generators, PCI cards and usb sound adaptors compatible with Linux.
The Linux laptops and desktops by Vikings come with core boot or Libreboot.
Their desktop ranges from 895EUR, laptop ranges from 250EUR and servers ranges from 990EUR.
They provide refurbished/used parts: mainboard, CPU(s) with rigorous testing of all parts and also gives a comprehensive guarantee for all parts of the system.
Their product warranty varies from 1year to 3year, with subsequent additional charges.
They ship to all part of the world with very few exceptions such as North Korea.
* **Availability:** Worldwide
* **Product Details:** [Viking][22]
### 12) Juno Computers
Juno Computers is company based in UK comes with pre-installed elementary OS or Ubuntu.
They provide an application known as Kronos which allows for quick and easy installation of commercial applications such as Chrome, Dropbox, Spotify, Skype, etc.
Their laptop ranges from $945/357EUR to $999/933EUR and mini PC ranges around $549/490EUR.
They provide a 1-year limited warranty on all manufacture problems.
Currently they ship to mainland USA, some Canadian provinces, and most part of the world includes South Africa, Asia and Europe.
* **Availability:** Worldwide
* **Product Details:** [Juno Computers][23]
### 13) Pine64
Pine64 is a US based community platform that offers laptops (**[Pinebooks][24]**), Pine Phones, Pine Watches(PineTime), Single board computers and other compatible Linux accessories.
It commenced its operation in the year 2016 powered by ARM devices.
[![][1]][25]
The laptops ranges from $100 to $200.
All single board and accessories sold on the Pine store are entitled to a 30 days Limited Warranty against defects in materials and workmanship, but provide online support through their forum.
They almost ship to most part of the country, refer site shipping policy for more details.
* **Availability:** Worldwide
* **Product Details:** [Pine64][26]
### 14) Libiquity
Libiquity is a US based company with R&amp;D investments and its own personal computer brand since 2011.
They offer laptop(Taurinus X200) preloaded with Trisquel and comes with ProteanOS, a free/libre and open source embedded operating system distribution endorsed by Free Software Foundation.
Laptop ranges starts from $375. Product comes with limited warrant of 1 year. Currently their shipping are limited to US.
* **Availability:** US
* **Product Details:** [Libiquity][27]
### 15) LinuxCertified
LinuxCertified an US based company offers lenovo desktops and laptops with Linux distros preinstalled.
Various preloaded Linux distros offered are Ubuntu, Fedora, Open SUSE, CentOS, Redhat Enterprise Linux and Oracle Enterprise Linux.
Desktops(ThinkStation) ranges from $899 to $2199 and laptops(Z1, LC series) ranges from $899 to $2199.
Product warranty is for one year. They ship their product within US.
* **Availability:** Worldwide
* **Product Details:** [LinuxCertified][28]
### 16) Star Labs
**[Star Labs][29]** was created by a group of Linux users, who created the ultimate Linux laptop for their own use.
Its based in the United Kingdom which sells laptops with Linux pre-installed.
[![][1]][30]
Star Labs offer a range of laptops designed and built specifically for Linux.
All of their laptops come with a choice of Ubuntu Linux, Linux Mint or Zorin OS pre-installed.
It is not limited to the above three distributions, and you can install any Linux distros on their hardware, and it runs flawlessly.
* **Availability:** Worldwide
* **Product Details:** [Star Labs][31]
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/buy-linux-laptops-computers-online/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[2]: https://www.2daygeek.com/wp-content/uploads/2020/01/dell-xps-13-developer-deition-2.png
[3]: https://www.linuxtechnews.com/dells-new-xps-13-developer-edition-is-powered-by-the-10th-generation/
[4]: https://www.linuxtechnews.com/dell-launches-three-new-dell-precision-developer-editions-laptops-preloaded-with-ubuntu-linux/
[5]: https://www.dell.com/en-us/work/shop/overview/cp/linuxsystems
[6]: https://www.linuxtechnews.com/system76-has-announced-new-gazelle-laptops/
[7]: https://www.2daygeek.com/wp-content/uploads/2020/01/system76-1.jpg
[8]: https://system76.com/laptops
[9]: https://www.2daygeek.com/wp-content/uploads/2020/01/librem-1.jpg
[10]: https://puri.sm/products/
[11]: https://www.linuxtechnews.com/slimbook-is-offering-a-new-laptop-called-slimbook-pro-x/
[12]: https://www.2daygeek.com/wp-content/uploads/2020/01/slimbook.jpg
[13]: https://slimbook.es/en/comparison-slimbook-pro-x-with-other-ultrabooks
[14]: https://www.tuxedocomputers.com/en/Linux-Hardware/Linux-Notebooks.tuxedo
[15]: https://www.thinkpenguin.com/catalog/notebook-computers-gnu-linux-2
[16]: http://www.emperorlinux.com/systems/
[17]: https://www.2daygeek.com/wp-content/uploads/2020/01/zareason-1.jpg
[18]: https://zareason.com/Laptops/
[19]: https://shop.lacpdx.com/laptops/
[20]: https://www.2daygeek.com/wp-content/uploads/2020/01/entroware.jpg
[21]: https://www.entroware.com/store/laptops
[22]: https://store.vikings.net/libre-friendly-hardware/x200-ryf-certfied
[23]: https://junocomputers.com/store/
[24]: https://www.linuxtechnews.com/pinebook-pro-199-linux-laptop-pre-orders-ansi-iso-keyboards/
[25]: https://www.2daygeek.com/wp-content/uploads/2020/01/Pinebook_Pro-photo-1.jpg
[26]: https://store.pine64.org/
[27]: https://shop.libiquity.com/
[28]: https://www.linuxcertified.com/linux_laptops.html
[29]: https://www.linuxtechnews.com/star-labs-offering-a-range-of-linux-laptops-with-zorin-os-15-pre-installed/
[30]: https://www.2daygeek.com/wp-content/uploads/2020/01/starlabs-1.jpg
[31]: https://earth.starlabs.systems/pages/laptops

View File

@ -0,0 +1,127 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (LMMS: A Free & Open Source Digital Audio Workstation (DAW))
[#]: via: (https://itsfoss.com/lmms/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
LMMS: A Free & Open Source Digital Audio Workstation (DAW)
======
_**In this weeks Linux application highlight, we take a look at a free and open-source DAW that helps make music with most of the essential features offered.**_
### LMMS: A Free &amp; Open Source Software To Help Make Music
[LMMS][1] is a cross-platform open source [DAW][2] hosted on [GitHub][3]. It is completely free to use and you do not need to purchase any kind of license to use it.
If youre curious, theres no specific full-form for “LMMS” acronym but you can consider it along the lines of “**Lets Make Music**” or formerly known as “**Linux MultiMedia Studio**” as stated in one of their [official forum post][4] years back.
So, with the help of LMMS, you should be able to work on making music on Linux.
Of course, you should not expect a free DAW to replace a full-fledged professional DAW bundled with proprietary plugins but for starters, it isnt a bad one.
![][5]
If youre used to other DAWs, it might take a while to get comfortable with the user interface. For instance, Ive used [Studio One][6] and [Mixcraft][7] as a beginner so the UI of LMMS looked different.
But, the good news is you get a [detailed official documentation][8] of LMMS. So, if you have trouble learning how it works, simply refer to the official documentation available on their [website][1].
**Recommended Read:**
![][9]
#### [Best Audio Editors For Linux][10]
These awesome free and open source audio editors let you create awesome music in Linux. Check out the list of top Linux audio editors.
### Features of LMMS
![][11]
Just like any other DAW, you will find plugins, samples to use, instruments, and MIDI support. However, it is indeed a long list of features. So, instead of taking a whole day explaining it, let me highlight all the necessary features that LMMS provides.
* Ability to add notes within the project without needing a separate note-taking app
* Bundled free plugins to use
* Note playback via MIDI or typing keyboard
* MIDI Editor
* Separate editor for instruments
* Track Automation support
* 64-bit VST instrument support (for wine-based VSTs)
* Built-in synthesizers that include some popular emulators for Yamaha and Roland
* Feature-rich audio plugins built-in
* Demo projects to easily get started
* Several samples included
* Native multisample support for SoundFont (SF2), Giga (GIG) and Gravis UltraSound (GUS) formats for high-quality instrument patches and banks (only if its relevant for your work)
* [LADSPA][12] plugin support
* You will also find the essential delay/reverb/compressor/limiter and distortion tools built-in
* Spectrum analyzer
You can find some extensive [documentation on using LMMS][8]. If you face any difficulties, LMMS also has its [own forum][13] where you can ask for help.
### Installing LMMS on Linux
![][14]
You can also find LMMS listed in the software center of your distribution- however, it might not feature the latest version.
To get the latest LMMS version, you can download the .**AppImage** file from the [official download page][15]. If you want to take a look at the latest or previous releases on GitHub, you can find those in their [releases][16] section.
If you want to use the AppImage file, you can refer to our guide on [using AppImage file][17].
You may also try [installing the Flatpak package][18] available on [Flathub][19].
[Download LMMS][15]
### My Thoughts On LMMS
![][20]
Even though this is a feature-rich free and open-source DAW personally, I found the UX a little dull.
Of course, technically, it offers quite a lot of features and this could be useful for anyone who does not want to break their wallet to produce music. And, after all, it is an open-source solution.
If you want a full-fledged professional DAW using the VST plugins, you might just hold on to Windows/Mac (if youre used to it) because you still need to utilize Wine on Linux in order to make sure that the 64-bit VSTs work.
**Wrapping Up**
That being said, Im not a professional music producer so feel free to explore LMMS on Linux and make the most out of it without spending a penny.
If youve used LMMS (or any similar DAW), let me know your thoughts in the comments below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/lmms/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://lmms.io/
[2]: https://en.wikipedia.org/wiki/Digital_audio_workstation
[3]: https://github.com/LMMS/lmms
[4]: https://lmms.io/forum/viewtopic.php?t=5908
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/lmms-screenshot.png?ssl=1
[6]: https://www.presonus.com/products/studio-one/
[7]: https://acoustica.com/mixcraft
[8]: https://docs.lmms.io/user-manual/
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/linux-audio-editors.jpeg?fit=800%2C450&ssl=1
[10]: https://itsfoss.com/best-audio-editors-linux/
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/lmms-project.png?ssl=1
[12]: https://www.ladspa.org/
[13]: https://lmms.io/forum/
[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/lmms-setup.jpg?ssl=1
[15]: https://lmms.io/download#linux
[16]: https://github.com/LMMS/lmms/releases
[17]: https://itsfoss.com/use-appimage-linux/
[18]: https://itsfoss.com/flatpak-guide/
[19]: https://flathub.org/apps/details/io.lmms.LMMS
[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/lmms-midi-editor.png?ssl=1

View File

@ -0,0 +1,90 @@
[#]: collector: (lujun9972)
[#]: translator: (qianmingtian)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Huaweis Linux Distribution openEuler is Available Now!)
[#]: via: (https://itsfoss.com/openeuler/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
华为的linux发行版 openEuler 可以使用了!
======
华为提供了一个基于 CentOS 的企业 Linux 发行版 EulerOS 。最近,华为发布了一个名为 [openEuler][1] 的 EulerOS 社区版。
openEuler 的源代码也被发布了。你在微软旗下的 GitHub 上找不到它——源代码可以在 [Gitee][2] 找到,这是一个中文的 [GitHub 的替代品][3] 。
它有两个独立的存储库,一个用于存储[源代码][2],另一个作为[包源][4] 存储有助于构建操作系统的软件包。
![][5]
openuler 基础架构团队分享了他们使源代码可用的经验:
>我们现在很兴奋。很难想象我们会管理成千上万的仓库。为了确保它们能被成功地编译,我们要感谢所有参与贡献的人。
### openEuler 是基于 CentOS 的 Linux 发行版
与 EulerOS 一样openEuler OS 也是基于 [CentOS][6],但华为技术有限公司为企业应用进一步开发了该操作系统。
它是为 ARM64 架构的服务器量身定做的,同时华为声称已经做了一些改变来提高其性能。你可以在[华为发展博客][7]上了解更多。
![][8]
目前,根据 openEuler 的官方声明,有 50 多名贡献者为 openEuler 贡献了近 600 个提交。
贡献者使源代码对社区可用成为可能。
值得注意的是,存储库还包括两个与之相关的新项目(或子项目),[iSulad][9] 和 **A-Tune**
A-Tune 是一个基于 AI 的操作系统调优软件, iSulad 是一个轻量级的容器运行时守护进程,如[Gitee][2]中提到的那样,它是为物联网和云基础设施设计的。
另外,官方的[公告][10]提到,这些系统是在华为云上通过脚本自动化构建的。这确实十分有趣。
### 下载 openEuler
![][11]
到目前为止,你找不到它的英文文档,所以你必须等待或选择通过[文档][12]帮助他们。
你可以直接从它的[官方网站][13]下载 ISO 来测试它:
[下载 openEuler ][13]
### 你认为华为的 openEuler 怎么样?
据 cnTechPost 报道,华为曾宣布 EulerOS 将以新名字 openEuler 成为开源软件。
目前还不清楚 openEuler 是否会取代 EulerOS ,或者两者会像 CentOS (社区版)和 Red Hat (商业版)一样同时存在。
我还没有测试过它,所以我不能说 openEuler 是否适合英文用户。
你愿意试一试吗?如果你已经尝试过了,欢迎在下面的评论中告诉我你的体验。
--------------------------------------------------------------------------------
via: https://itsfoss.com/openeuler/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[qianmingtian][c]
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[c]: (https://github.com/qianmingtian)
[1]: https://openeuler.org/en/
[2]: https://gitee.com/openeuler
[3]: https://itsfoss.com/github-alternatives/
[4]: https://gitee.com/src-openeuler
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/openEuler-website.jpg?ssl=1
[6]: https://www.centos.org/
[7]: https://developer.huaweicloud.com/en-us/euleros/euleros-introduction.html
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/openeuler-gitee.jpg?ssl=1
[9]: https://gitee.com/openeuler/iSulad
[10]: https://openeuler.org/en/news/20200101.html
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/openEuler.jpg?ssl=1
[12]: https://gitee.com/openeuler/docs
[13]: https://openeuler.org/en/download.html

View File

@ -7,21 +7,20 @@
[#]: via: (https://opensource.com/article/20/1/python-web-api-pyramid-cornice)
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
How to write a Python web API with Pyramid and Cornice
如何使用 Pyramid 和 Cornice 编写 Python Web API
======
Use Pyramid and Cornice to build and document scalable RESTful web
services.
使用 Pyramid 和 Cornice 构建可扩展的 RESTful Web 服务。
![Searching for code][1]
[Python][2] is a high-level, object-oriented programming language known for its simple syntax. It is consistently among the top-rated programming languages for building RESTful APIs.
[Python][2] 是一种高级的,面向对象的编程语言,它以其简单的语法而闻名。它一直是构建 RESTful API 的顶级编程语言之一。
[Pyramid][3] is a Python web framework designed to scale up with an application: it's simple for simple applications but can grow for big, complex applications. Among other things, Pyramid powers PyPI, the Python package index. [Cornice][4] provides helpers to build and document REST-ish web services with Pyramid.
[Pyramid][3] 是一个 Python Web 框架旨在随着应用的扩展而扩展这对于简单的应用来说很简单对于大型、复杂的应用也可以做到。Pyramid 为 PyPI Python 软件包索引)提供了强大的支持。[Cornice][4] 提供了使用 Pyramid 构建 RESTful Web 服务的助手。
This article will use the example of a web service to get famous quotes to show how to use these tools.
本文将使用 Web 服务的例子来获取名人名言,来展示如何使用这些工具。
### Set up a Pyramid application
### 建立 Pyramid 应用
Start by creating a virtual environment for your application and a file to hold the code:
首先为你的应用创建一个虚拟环境,并创建一个文件来保存代码:
```
@ -33,9 +32,9 @@ $ source env/bin/activate
(env) $ pip3 install cornice twisted
```
### Import the Cornice and Pyramid modules
### 导入 Cornice 和 Pyramid 模块
Import these modules with:
使用以下命令导入这些模块:
```
@ -43,9 +42,9 @@ from pyramid.config import Configurator
from cornice import Service
```
### Define the service
### 定义服务
Define the quotes service as a **Service** object:
将引用服务定义为 **Service** 对象:
```
@ -54,9 +53,9 @@ QUOTES = Service(name='quotes',
                 description='Get quotes')
```
### Write the quotes logic
### 编写引用逻辑
So far, this only supports **GET**ing quotes. Decorate the function with **QUOTES.get**; this is how you can tie in the logic to the REST service:
到目前为止,这仅支持 **GET** 获取名言。用 **QUOTES.get** 装饰函数。这是将逻辑绑定到 REST 服务的方法:
```
@ -73,13 +72,13 @@ def get_quote(request):
    }
```
Note that unlike in other frameworks, the **get_quote** function is _not_ changed by the decorator. If you import this module, you can still call the function regularly and inspect the result.
请注意与其他框架不同装饰器_不能_更改 **get_quote** 函数。如果导入此模块,你仍然可以定期调用该函数并检查结果。
This is useful when writing unit tests for Pyramid RESTful services.
在为 Pyramid RESTful 服务编写单元测试时,这很有用。
### Define the application object
### 定义应用对象
Finally, use **scan** to find all decorated functions and add them to the configuration: 
最后,使用 **scan** 查找所有修饰的函数并将其添加到配置中:
```
@ -89,18 +88,18 @@ with Configurator() as config:
    application = config.make_wsgi_app()
```
The default for scan is to scan the current module. You can also give the name of a package if you want to scan all modules in a package.
默认扫描当前模块。如果要扫描软件包中的所有模块,你也可以提供软件包的名称。
### Run the service
### 运行服务
I use Twisted's WSGI server to run the application, but you can use any other [WSGI][5] server, like Gunicorn or uWSGI, if you want:
我使用 Twisted 的 WSGI 服务器运行该应用,但是如果需要,你可以使用任何其他 [WSGI][5] 服务器,例如 Gunicorn 或 uWSGI。
```
`(env)$ python -m twisted web --wsgi=main.application`
```
By default, Twisted's WSGI server runs on port 8080. You can test the service with [HTTPie][6]:
默认情况下Twisted 的 WSGI 服务器运行在端口 8080 上。你可以使用 [HTTPie][6] 测试该服务:
```
@ -129,11 +128,11 @@ X-Content-Type-Options: nosniff
}
```
### Why use Pyramid?
### 为什么要使用 Pyramid
Pyramid is not the most popular framework, but it is used in some high-profile projects like [PyPI][7]. I like Pyramid because it is one of the frameworks that took unit testing seriously: because the decorators do not modify the function and there are no thread-local variables, functions are callable directly from unit tests. For example, functions that need access to the database will get it from the **request** object passed in via **request.config**. This allows a unit tester to put a mock (or real) database object in the request, instead of carefully setting globals, thread-local variables, or other framework-specific things.
Pyramid 不是最受欢迎的框架,但它已在 [PyPI][7] 等一些引人注目的项目中使用。我喜欢 Pyramid因为它是认真对待单元测试的框架之一因为装饰器不会修改函数并且没有线程局部变量所以可以直接从单元测试中调用函数。例如需要访问数据库的函数将从通过 **request.config** 传递的 **request.config** 对象中获取它。这允许单元测试人员将模拟(或真实)数据库对象放入请求中,而不用仔细设置全局变量,线程局部变量或其他特定于框架的东西。
If you're looking for a well-tested library to build your next API, give Pyramid a try. You won't be disappointed.
如果你正在寻找一个经过测试的库来构建你接下来的 API请尝试使用 Pyramid。你不会失望的。
--------------------------------------------------------------------------------