adsl vps开机自动拨号

我有一个拨号脚本,在运行脚本之前我写了个bash脚本来启动它:

adsl-start
nohup python3 sender.py

后来发现有的机器第一次拨号不成功,那就写个循环吧:

/etc/init.d/service.sh:

# coding=utf-8
#!/bin/bash
while ! ping -c1 www.baidu.com &>/dev/null
        do echo "Ping Fail - `date`"
        sleep 6
        adsl-start
done
export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin"
nohup /usr/bin/python3 /root/AdslProxy/adslproxy/sender/sender.py >> /root/proxy_reboot.log 2>&1 &

一般拨号服务器质量都很一般,能找到好的很不容易,我找了好久才找到一家靠谱的。两台VPS轮拨,中间间断就少了很多。记得定时校准时间哈:

*/10 * * * * /usr/sbin/ntpdate cn.pool.ntp.org | logger -t NTP

解决GitHub网页githubusercontent地址无法访问

对于centos系统,把github的hosts加入/etc/hosts即可。推荐下面这个网站做解析(访问的时候不要开代理):

https://www.ipaddress.com/

# GitHub Start
140.82.113.4      github.com
140.82.113.4      gist.github.com
140.82.114.5      api.github.com
185.199.111.153   assets-cdn.github.com
199.232.96.133    raw.githubusercontent.com
199.232.96.133    gist.githubusercontent.com
199.232.96.133    cloud.githubusercontent.com
199.232.96.133    camo.githubusercontent.com
199.232.96.133    avatars0.githubusercontent.com
199.232.96.133    avatars1.githubusercontent.com
199.232.96.133    avatars2.githubusercontent.com
199.232.96.133    avatars3.githubusercontent.com
199.232.96.133    avatars4.githubusercontent.com
199.232.96.133    avatars5.githubusercontent.com
199.232.96.133    avatars6.githubusercontent.com
199.232.96.133    avatars7.githubusercontent.com
199.232.96.133    avatars8.githubusercontent.com
# GitHub End

DNS域名污染是GFW的比较低级的block,终极黑就是直接黑掉域名,对于github来说没有影响,github国内用户哪个不能翻QIANG啊。