Dkngit 发布的文章

参照github上的问答,在 typecho 网站空间内 /usr/themes/default 放入了下载好的文件 normalize.css。

然后 控制台->外观->编辑当前外观->header.php:

<!-- 使用url函数转换相关路径 --> 的下一行,将其更改为了

<link rel="stylesheet" href="<?php $this->options->themeUrl('normalize.css'); ?>">


As nobody answered, So I asked this on MongoDB-User Group

Say cars is your outputcollection (where you want to store output of map-reduce job).

  • REPLACE: If your current MR is successful, all of the documents in cars will be deleted (regardless of their _id) and replaced by the current result.
  • MERGE: No document in cars will be deleted. Instead, each document in your current result will replace an already existing document in cars with the same _id. If there is not any document in cars with that _id, it will be just inserted. You can see this like an upsert:{_id: newDocument._id}, {value: newDocument.value}, {upsert: true})
  • REDUCE: This is very similar to MERGE. But instead of just replacing the existing document, both documents will be the input of your reduce function (i.e. reduce([oldDocument, newDocument])) and the resulting document will replace the existing one.
  • INLINE: Returns your result as a variable in the same fashion a function does. Nothing is stored in MongoDB, so this does not impact any collection.

The complete answer can be found here.

Do not bind to a specific port. Instead, bind to port 0:

sock.bind(('', 0))

The OS will then pick an available port for you. You can get the port that was chosen using sock.getsockname()[1], and pass it on to the slaves so that they can connect back.

import socket
from contextlib import closing

def find_free_port():
    with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
        s.bind(('', 0))
        s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        return s.getsockname()[1]

利用 typecho 上传文件(附件)时,提示上传失败。


Ubuntu 16.04
typecho 1.1


  • PHP 限制了上传文件的大小
  • Nginx 限制了上传文件的大小


- 阅读剩余部分 -