-
启动celery
celery -A base_celery worker --loglevel=info -
关闭celery(所有任务将丢失不会重启)
pkill -9 -f 'celery worker'
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Author: Ficapy | |
| # Create: '12/14/16' | |
| import pytest | |
| from sqlalchemy import create_engine, Column, BIGINT | |
| from sqlalchemy.orm import sessionmaker | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.exc import IntegrityError |
启动celery
celery -A base_celery worker --loglevel=info
关闭celery(所有任务将丢失不会重启)
pkill -9 -f 'celery worker'
| package main | |
| import ( | |
| "image" | |
| "image/color" | |
| "image/png" | |
| _ "image/png" | |
| "log" | |
| "os" | |
| ) |
现在比较主流的方案可能就是SSR+kcptun了,基本上都能流畅看1080P的youtube了。下面讲述如何快速搭建服务端和客户端(主要针对osx和unix,win上有成熟的GUI方案)
SSR一键安装包(引用自https://www.91yun.org/archives/2079)
wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/shadowsocks_install/master/shadowsocksR.sh && bash shadowsocksR.sh
https://github.com/xtaci/kcptun/releases下载适合自己系统的最新版本tar -xf解压得到server_linux_amd64.执行服务端.摘录文档如下
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Author: Ficapy | |
| # Create: '8/22/16' | |
| import requests | |
| import ipaddress | |
| import asyncio | |
| import aiohttp |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Author: Ficapy | |
| # Create: '20/7/2016' | |
| import inspect | |
| import os | |
| import re | |
| import tempfile | |
| import textwrap | |
| import pkgutil |
| from __future__ import print_function | |
| import random | |
| import time | |
| import sys | |
| if not sys.stdout.isatty() or sys.version_info[0] == 2: | |
| sys.exit(2) | |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Author: Ficapy | |
| # Create: '7/12/16' | |
| import socket | |
| import requests | |
| def getitem(pos, seq): |
| import requests | |
| import inspect | |
| from collections import defaultdict | |
| def _tree(): return defaultdict(_tree) | |
| tree = _tree() |
| from Crypto.Cipher import DES3 | |
| import binascii | |
| # 3DES加密32位ASCII字符串得到32位ASCII字符串 | |
| # 密匙长度16bytes | |
| # 3DES密文长度于明文长度相符,所以要加密得到32位明文中间有16进制转换('1F'→→→'\x1f') | |
| # 加密前2个ASCII字符转换成1bytes(限制了只能是0-F) | |
| def des3(key, msg): | |
| cipher = DES3.new(binascii.unhexlify(key), DES3.MODE_ECB) | |
| ret = cipher.encrypt(binascii.unhexlify(msg)) |