国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Ubuntu 16.04+、Debian 8+、CentOS 7+
创建或修改 /etc/docker/daemon.json
:
( find . -type d -name ".git" && find . -name ".gitignore" && find . -name ".gitmodules" ) | xargs rm -rf |
import asyncio | |
from asyncio.queues import Queue | |
TERMINATOR = object() | |
class TaskPool(object): | |
def __init__(self, loop, num_workers): | |
self.loop = loop | |
self.tasks = Queue(loop=self.loop) |
from timeit import timeit | |
import asyncio | |
import requests | |
from threading import Thread | |
import aiohttp | |
client = aiohttp.ClientSession() | |
爬虫爬了好久,总共从豆瓣爬下来了 16894465 本书,有评分的有 279377 本。
简单统计如下:
// This is an example program that iterates over all | |
// items in a mongodb collection in a memory safe way | |
package main | |
import ( | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
"fmt" | |
) |