05 2013 档案

linux 服务器时间同步
摘要:我们api服务器与qq第三方登录对接的时候老是报错,原因是二者服务器的时间相差5分钟以上。但是明明我设置了定时脚本的啊命令如下:*/1 * * * * ntpdate 192.168.1.115;为什么不生效?google了一番,改为 */1 * * * * /user/sbin/ntpdate 192.168.1.115还是不生效查看crontab运行的日志tail -f /var/log/cron发现运行的还是ntpdate 192.168.1.115,也即是说 crontab -e 未生效好吧,重启crontab吧, service crond restart,大功告成。 在这里再次吐槽 阅读全文

posted @ 2013-05-31 16:05 xiaorao 阅读(193) 评论(0) 推荐(0)

7 Signs You Have a Sleep Problem You DON'T Know About
摘要:最新睡眠质量不好,google到一篇文章,自己简单翻译下When you can't sleep, you know it. But what about when you can, yet you wake up feeling tired and achy or you're groggy again a few hours later? What's that about? All too often, it turns out, the problem is one that doesn't keep you awake but does sabotag 阅读全文

posted @ 2013-05-31 11:20 xiaorao 阅读(407) 评论(0) 推荐(0)

php curl CURLOPT_TIMEOUT_MS 小于1秒 解决方案
摘要:php的curl函数有多个参数:CURLOPT_TIMEOUT_MS 设置cURL允许执行的最长毫秒数。 在cURL 7.16.2中被加入。从PHP 5.2.3起可使用。所以使用的时候请先查看libcurl版本 curl --version但是这个函数有个bug,如果时间小于1000毫秒也就是1秒的话,会立马报错,查看下面说明 If you want cURL to timeout in less than one second, you can use CURLOPT_TIMEOUT_MS, although there is a bug/"feature" on &qu 阅读全文

posted @ 2013-05-30 17:33 xiaorao 阅读(9828) 评论(0) 推荐(0)

python pipeline 支持get和delete操作
摘要:前言:pipeline缓存一堆的command,最后一次性执行。但是如果操作过程中需要先到redis中get一次,对数据进行相关处理,最后在进行set/delete等操作,怎么办?看官方文档:https://github.com/andymccurdy/redis-py找到pipeline,阅读下面代码with r.pipeline() as pipe: while 1: try: # put a WATCH on the key that holds our sequence value pipe.watch('OUR-SE... 阅读全文

posted @ 2013-05-21 17:20 xiaorao 阅读(2624) 评论(0) 推荐(0)

导航