This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:trusty | |
RUN apt-get update | |
RUN apt-get install git gcc g++ make libssl-dev python unzip -y | |
RUN git clone https://github.com/ossrs/srs.git /srs | |
RUN cd /srs && git checkout 3.0release | |
WORKDIR /srs/trunk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM google/debian:jessie | |
ARG DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update -qqy \ | |
&& apt-get -qqy install \ | |
gnupg wget ca-certificates apt-transport-https \ | |
ttf-wqy-zenhei \ | |
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* |
- Volume - virtualbox guest additions
- Kitematic - must running as Admin. if not, it will cause the
userdir\.docker\machine\machines\default\config.json
missing, and break the VM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
from datetime import datetime, timedelta | |
from unittest import mock | |
from freezegun import freeze_time | |
def fake_sleep(func): | |
freezegun_control = None |
-
Python2.7版本的,不过2.7在2020年就不支持了。现在不是很推荐 可以看: 01. Python 工具 到 02. Python 基础
-
MIT 编程导论课的教材翻译版。这个旨在激发编程兴趣。 强烈推荐看完整本!!!
using pyenv to install multi versions of python.
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.6-dev
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7-dev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import threading | |
class AsyncioBackground(threading.Thread): | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
self.loop = asyncio.new_event_loop() | |
def run(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import threading | |
import pytest | |
from twisted.application import internet | |
from twisted.internet import reactor as twisted_reactor | |
from twisted.internet.protocol import Factory, Protocol | |
@pytest.fixture(scope="session", autouse=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update | |
apt-get install -y python3-pip python3-setuptools python3-wheel | |
pip3 install -U shadowsocks | |
SS_MODULE_PATH=`python3 -c "import shadowsocks as m;print(m.__path__[0])"` | |
sed -i -e 's/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g' $SS_MODULE_PATH/crypto/openssl.py | |
cat > ss.json << EOF | |
{ |