shw3588 发布的文章

需要找navicat几年前的psc备份还原看看旧数据,拷贝160125182616.psc出来进行还原,直接报Unknown error 1067。
当下环境mysql版本是5.7+ ,那时候的mysql版本是mysql 5.6.17。
编辑my.cnf

sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
explicit_defaults_for_timestamp=1

重启mysql



- 阅读剩余部分 -

安装好zabbix客户端之后,开启自定义监控

vim /usr/local/zabbix/etc/zabbix_agentd.conf
UnsafeUserParameters=1
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/*.conf

创建监控脚本

mkdir /usr/local/zabbix/etc/shell
vim /usr/local/zabbix/etc/shell/redis.sh #脚本内容参考文章结尾
chmod +x /usr/local/zabbix/etc/shell/redis.sh

配置监控

cd /usr/local/zabbix/etc/zabbix_agentd.conf.d/
vim zbx_redis.conf

UserParameter=redis.status,/usr/local/redis/bin/redis-cli -h 127.0.0.1 -p 7000 -a 密码 ping |grep -c PONG
UserParameter=redis_info[*],/usr/local/zabbix/etc/shell/redis.sh $1

脚本测试

/usr/local/zabbix/etc/shell/redis.sh uptime_in_seconds
563114
/usr/local/zabbix/etc/shell/redis.sh used_memory
596751408

- 阅读剩余部分 -

环境:python2.7,pip 1.5.4

pip install aliyun-python-sdk-core==2.3.5 aliyun-python-sdk-rds datetime
#报错
The 'pip==7.1.0' distribution was not found and is required by the application

https://files.pythonhosted.org/packages/07/9d/2af576b8b199c69d839a8dfd6025b6721a18a0b771a051b2b62b3c866d0f/distribute-0.6.10.tar.gz
tar -zxvf distribute-0.6.10.tar.gz
cd  distribute-0.6.10
python setup.py install

easy_install pip==7.1.0

pip install aliyun-python-sdk-core==2.3.5 aliyun-python-sdk-rds datetime

pip install selenium
脚本

#!/usr/bin/python
from selenium import webdriver
browser = webdriver.PhantomJS()
browser.get("http://www.site-digger.com/html/articles/20110516/proxieslist.html")
trs = browser.find_elements_by_tag_name('tr')
for tr in trs[1:]:
        print(tr.text.split(' ')[0])

报 selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executable needs to be in PATH

wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar -xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2 
cp -R phantomjs-2.1.1-linux-x86_64 /usr/local/share/ 
ln -sf /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/

- 阅读剩余部分 -