Docker加速

万恶的gfw造成使用docker加载超慢,只好通过国内的阿里云来加速。

打开 https://dev.aliyun.com/search.html

右上角有“管理中心”,点击使用阿里帐户登录。

点击”加速器“

下面有详细的docker加速操作步骤

还有daocloud的加速服务

创建或修改 /etc/docker/daemon.json 文件,修改为如下形式

{
    "registry-mirrors": [
        "加速地址"
    ],
    "insecure-registries": []
}

通过比较daocloud要比aliyun快不少。

另外一种方法是使用http代理:

HTTP_PROXY=proxy-server:8080 docker pull clipper/sklearn_cifar_container

北京打车困难

今天晚上11点到北京,在离西站不远处打地。发现北京出租都tm拒载,真是上火,好好都这样搞。挺厌恶这帮司机的臭毛病。像我这种在外打工的这么晚回来都打不上车。滴滴也没人接单。狗日的,只能坐无证车。

clipper的安装使用

环境: Ubuntu 16.04
安装必备软件
sudo apt-get install cmake libzmq5 libzmq5-dev libhiredis-dev libev-dev g++ redis-server
安装boost 1.60
wget http://sourceforge.net/projects/boost/files/boost/1.60.0/boost_1_60_0.tar.gz
tar xvf boost_1_60_0.tar.gz
cd boost_1_60_0
sudo ./bootstrap.sh –prefix=/usr/local –with-libraries=all
sudo ./b2 install
sudo /bin/bash -c ‘echo “/usr/local/lib” > /etc/ld.so.conf.d/boost.conf’
sudo ldconfig
下载编译clipper
git clone –recursive https://github.com/ucbrise/clipper.git
cd clipper
./configure
make

 

启动restful服务

cd /home/jerry/clipper

bin/start_clipper.sh

测试服务

python examples/example_client.py

或者

curl -H “Content-Type: application/json” -X POST -d ‘{“input”: [0.4], “uid”: 4}’ http://192.168.56.101:1337/example_app/predict

 

目前先到这里,后面的特征将会陆续探索。

Ubuntu 16

环境:Ubuntu 16,  VirtualBox

安装一个ubuntu 16的虚拟环境,已经启用NAT和host-only,查询网络时却发现host-only没有分配网络地址。

ifconfig -a

编辑interfaces

sudo vi /etc/network/interfaces

添加如下(其中enp0s8是上面查询出的网络标识):

auto enp0s8

iface enp0s8 inet dhcp

然后重启网络

sudo /etc/init.d/networking restart

wordpress使用固定链接

环境:Ubuntu 14.04, wordpress 4.7.1,  Apache/2.4.7

由于wordpress本身的链接方法就是?p=1这种方法,不利于搜索引擎索引,因而使用固定链接方法。步骤如下:

  1. 启用urlrewrite, sudo a2enmode rewrite
  2. vi /etc/apache2/apache2.conf,搜索AllowOverride None,将None修改成All
  3. 重启apache2, sudo service apache2 restart
  4. 登录到wordpress后台,“设置”-》“固定链接”-》“月份和名称型”, 然后在服务器上的目录/var/www/wordpress下创建.htaccess文件,并将后台页面最下面的.htaccess的内容复制的到.htaccess文件内。

到此wordpress的固定链接已经打通。