docker 设置代理

1、创建目录

mkdir -p /etc/systemd/system/docker.service.d

2、创建文件/etc/systemd/system/docker.service.d/http-proxy.conf,内容如下:

[Service]
Environment=“HTTP_PROXY=http://10.245.3.1:8080/”

3、重启docker

systemctl daemon-reload
systemctl restart docker
 

4、验证docker代理是否设置成功

systemctl show --property=Environment docker

5、显示如下结果说明设置成功

Environment=GOTRACEBACK=crash HTTP_PROXY=http://10.245.3.1:8080/

git 命令设置代理

/ 查看当前代理设置

git config –global http.proxy

// 设置当前代理为 http://127.0.0.1:1080 或 socket5://127.0.0.1:1080

git config –global http.proxy ‘http://127.0.0.1:1080’

git config –global https.proxy ‘http://127.0.0.1:1080’

git config –global http.proxy ‘socks5://127.0.0.1:1080’

git config –global https.proxy ‘socks5://127.0.0.1:1080’ /

/

Centos 设置定时任务

1

  1. 安装crontabs 服务

    $ yum install crontabs

    $ systemctl enable crond

    $ systemctl start crond

  2. 配置定时规则

    vim /etc/crontab

    在配置中添加规则

    59 0 * * * root /usr/bin/sarg

    0 12 * * * root /usr/bin/sarg

    0 18 * * * root /user/bin/sarg

  3. 保存生效

    $ crontab /etc/crontab
    

  4. 查看任务
    

    $ crontab -l