Nginx配置反向代理404

今天用Nginx配置到Node.js和Hexo的反向代理,发现除了 / 可以访问,其他都404,我很纳闷啊。
搜遍各种资料都无用。
后来发现是我配置文件里多了一句
try_files uriuri/ =404;
蛋疼,浪费我一晚上。终于可以睡了。

JavaScript回锅笔记

  1. Variables created without the keyword var, are always global, even if they are created inside a function.
  2. A closure is a function having access to the parent scope, even after the parent function has closed.
  3. A JavaScript function can be invoked without being called.
  4. Accessing a function without () will return the function definition:.

    <script>
    function toCelsius(f) {
        return (5/9) * (f-32);
    }
    document.getElementById("demo").innerHTML = toCelsius;
    </script>

    输出:
    function toCelsius(f) { return (5/9) * (f-32); }

  5. Avoid String, Number, and Boolean objects. They complicate your code and slow down execution speed.
  6. If you assign a value to a variable that has not been declared, it will automatically become a GLOBAL variable, even if it is executed inside a function. Do NOT create global variables unless you intend to.
  7. In HTML, the global scope is the window object: All global variables belong to the window object.
  8. Your global variables (or functions) can overwrite window variables (or functions).
    Any function, including the window object, can overwrite your global variables and functions.
  9. W3Schools JavaScript Reference HTML DOM Events
  10. You can also break up a code line within a text string with a single backslash:

    document.getElementById("demo").innerHTML = "Hello \
    Dolly!";

    (The \ method is not a ECMAScript (JavaScript) standard.Some browsers do not allow spaces behind the \ character.)

  11. Integers (numbers without a period or exponent notation) are considered accurate up to 15 digits. The maximum number of decimals is 17, but floating point arithmetic is not always 100% accurate:
  12. In JavaScript, all data types have a valueOf() and a toString() method.
  13. JavaScript counts months from 0 to 11. January is 0. December is 11.
  14. Bit operators work on 32-bit numbers.
  15. The constructor property returns the constructor function for all JavaScript variables.
  16. The unary + operator can be used to convert a variable to a number:
  17. 5 + null // returns 5 because null is converted to 0
    "5" + null // returns "5null" because null is converted to "null"
    "5" + 2 // returns 52 because 2 is converted to "2"
    "5" - 2 // returns 3 because "5" is converted to 5
    "5" * "2" // returns 10 because "5" and "2" are converted to 5 and 2
  18. Complete JavaScript RegExp Reference
  19. Hoisting is JavaScript’s default behavior of moving all declarations to the top of the current scope (to the top of the current script or the current function).
  20. Do not use tabs (tabulators) for indentation. Different editors interpret tabs differently.
  21. Avoid global variables, avoid new, avoid ==, avoid eval()

JavaScript里的奇葩语法

排名不分先后。

  1. "1234"+5的结果是"12345", 而"1234"-4的结果却是1230. 4+"1234"的结果是"41234", 而4-"1234"的结果是NaN.
  2. true==2的结果是false, false==2的结果也是false.
  3. typeof null的结果是"object".
  4. 对于str.slice(start, end),如果参数大于等于0,则结果不包括end指示的字符;如果参数小于0,则结果不包括start指示的字符.
  5. var x = 0.2 + 0.1; // x will be 0.30000000000000004
  6. typeof NaN; // returns "number"
    var x = NaN + "5"; var y = Infinity + "3"; // x will be "NaN5", and y will be "Infinity3"
  7. 0 < Number.MIN_VALUE // true
  8. var txt = "";
    var person = ["23", "12f", 2];
    var x;
    for (x in person) {
    txt += typeof x + " ";
    }

    最成txt为string string string

Ubuntu 16.04 无线模块不能加载

升级ubuntu 16.04 LTS后,无线突然不能用了。
运行

$ sudo lshw -C network

后发现无线网卡是unclaim(ed)
我以为是驱动问题,寻求各大偏方,安了无数次驱动,均不能解。
后发现在insmod的时候,总出现

insmod: ERROR: could not insert module wl.ko: Required key not available-

于网搜之,高人指点,

这样的话,问题就很可能出在bios里面的secure boot了。你到bios里面去找到一个secure boot的东西,把它disable掉。

至此,遂解,wl模块能正确加载了,无线也可以用了。

但我还是不知道怎么回事,知道的麻烦告诉我一声。

何以知时间流逝

就是看见弟弟已升入高中,
上课打牌,翘课,上网。
在我印象里他还是个小孩子。
看着聊天记录里的,
“呵呵”,
表情,
追剧,
我才醒悟,他高一了,
就像三年前的我。
由是知,
时间流逝。

丙申年正月初十
于绵阳中学

懒人可以这样快速安装LaTeX+中文环境

这个寒假欲将四本生物教材浓缩为“坑教版”,开始在学校时在手机上用 WPS 写,放假回家后觉得效果不好,LibreOffice 也不咋样。突然想起《算法导论》前言中说该书是用 LaTeX 排版的,于是入了 TeX 坑..
但是我时间紧,又懒,捣鼓了一下午,总结出一个很快速就可以搭建 LaTeX + 中文环境的办法。大概像这样(对于Ubuntu),顺便传送门学习TeX的参考资料.
在终端运行

$ sudo apt-get install texlive
$ sudo apt-get install texlive-lang-chinese

好了,“大”功告成了.
新建一个hello.tex,输入

documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{gbsn}
您好,我是\LaTeX,我支持中文了!
$$\sum_{p\rm\;prime}f(p) = \int_{t>1}f(t)d\pi(t).$$
\end{CJK}
\end{document}

运行latex(生成.dvi文件)或pdflatex(生成.pdf文件)编译一下看看效果

$ latex hello.tex
$ pdflatex hello.tex

恩,他的样子应该是这样的:

hello
hello

如果你想有个编辑器的话,可以

$ sudo apt-get install texmaker

或者

$ sudo apt-get install texstudio

好了, 开始你的LaTeX之旅吧。