月度归档:2020年04月

2020-4-5 English Reading.

President Donald Trump attacked 3M over concerns with supplies of protective face masks as his administration issued an order under the Defense Production Act to speed production of ventilators and respirators for coronavirus patients.

3M responded hours later with a statement, saying early Friday that it has increased production of respirator masks significantly and was already working with the administration to prioritize orders from the Federal Emergency Management Agency. The latest actions offer a framework to “expand even further the work we are doing in response to the global pandemic crisis,” 3M said.

继续阅读

2020-4-2 English Reading.

In August 2019, the Arizona Municipal Water Users Association built a 16-foot pyramid of jugs in its main entrance in Phoenix. The goal was to show residents of this desert region how much water they each use a day—120 gallons—and to encourage conservation.

“We must continue to do our part every day,” executive director Warren Tenney wrote in a blog post. “Some of us are still high-end water users who could look for more ways to use water a bit more wisely.”

A few weeks earlier in nearby Mesa, Google proposed a plan for a giant data center among the cacti and tumbleweeds. The town is a founding member of the Arizona Municipal Water Users Association, but water conservation took a back seat in the deal it struck with the largest U.S. internet company. Google is guaranteed 1 million gallons a day to cool the data center, and up to 4 million gallons a day if it hits project milestones. If that was a pyramid of water jugs, it would tower thousands of feet into Arizona’s cloudless sky.

继续阅读

apache2虚拟端口配置,在一台机器配置多个站点

环境:Ubuntu16.4  Apache/2.4.18

在server端,一个站点需要有一个独立的根目录,例如默认的站点就以/var/www/html/作为站点的根目录。浏览器给到一个http请求的时候,服务器就会在这个目录下面寻找需要返回的文件或信息。

浏览器请求server的时候,会包含一些域名信息,这样服务器就可以建立多个目录。当浏览器请求通过aaa.com或bbb.com发出http请求的时候,server就可以到对应的目录下面返回需要的信息。

在本环境下,进行多站点配置的目录主要是/etc/apache2/sites-available 和  /etc/apache2/sites-enabled。
前者是可用的站点配置,后者是启用的站点配置,而后者目录里面基本上是通过符号链接,链接到前者目录下面的内容的。

root@iZuf6ajm9b61u7hmifsrjaZ:/etc/apache2/sites-enabled# ls -l total 0 lrwxrwxrwx 1 root root 35 Aug 4 2019 000-default.conf -> ../sites-available/000-default.conf

默认的配置如上面,是一个符号链接链接到/sites-available下的文件,抽象的来说可以认为这两个目录下是同一个文件。

我们看下文件里面的内容:

root@iZuf6ajm9b61u7hmifsrjaZ:/etc/apache2/sites-available# cat 000-default.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request’s Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName www.inncc.ink

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

# Available loglevels: trace8, …, trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with “a2disconf”.
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

很清楚,里面描述了在80端口的一个站点,站点的目录是/var/www/html  ServerName www.inncc.ink对应域名。

所以我们直接把这个默认的文件cp两份,分别用作site1.com site2.com  修改ServerName 和DocumentRoot 即可。
修改完成后,在sites-enabled下面建立两个链接到这俩文件的符号链接即可。
文件名没有特殊的要求。

最后重启apache2 :service apache2 restart即可

 

2020-4-1 English Reading

The passage of the pandemic stimulus bill to the tune of at least $2.2 trillion dollars was heralded as a major step towards staunching the massive economic toll of the near-complete shutdown of the United States. But of the many moves made by the federal government, the effects of that stimulus bill may ultimately pale in comparison with the radical measures enacted by the Federal Reserve. We are in uncharted and deep waters, but none may prove as revolutionary as what the Fed is about to do.

Graced by Congress and by the Treasury Department, the Federal Reserve is committed to using its balance sheet to inject more than $4 trillion into the economy. That is not a typo. And it is, in fact, likely to be substantially more than that by the time the pandemic crisis has subsided. This will not end up directly in the pockets of individuals, but it will flood the financial system with unprecedented amounts of money and provide a cushion and a floor for almost any tradeable asset.

And by any tradeable asset, that means money market funds, corporate bonds, municipal bonds, bank lines of credit, student loans, mortgage-backed securities, and according to Jerome Powell, the chairman of the Federal Reserve, perhaps even stocks. Asked about the possible outer limits of what the Fed might buy, Powell said, with unusual candor, that in a time of pandemic, “We’re trying to create a bridge from our very strong economy to another place of economic strength, and that’s what our lending really does. It’s very broad. It’s across small, medium and large businesses.” And it extends as well to state and local governments strapped for cash as tax revenues evaporate. It extends, in fact, to just about everything and anything imaginable.

It is impossible to overstate how radical a departure from past precedent these moves are. During the Great Recession of 2008-2009, the Fed cut interest to zero (as it has now) and then began to experiment with what it called “quantitative easing” on a multi-trillion dollar scale; it began to buy up bonds and act as a lender of last resort to large financial institutions that were facing potential insolvency, and to European banks as well as the European Union faced its own crisis into 2011. But as innovative as that was, it took many months for the Fed to act then, after the financial crisis had already metastasized into an economic collapse, and its buying was limited to specific and rather arcane corners of the financial markets.