dns cache
ubuntu8.10, 网通宽带,无线路由 速度非常慢,可以感觉到4-5秒的延时,明显是dns查询的时间。 装了dnsmasq,然后修改resolv.conf 23:39:13@/etc/ppp> cat /etc/resolv.conf # Generated by NetworkManager nameserver 127.0.0.1 不过网络重新连接后还是会被网通的dns覆盖掉, 如下即可 之后重启网络,速度飞快
ubuntu8.10, 网通宽带,无线路由 速度非常慢,可以感觉到4-5秒的延时,明显是dns查询的时间。 装了dnsmasq,然后修改resolv.conf 23:39:13@/etc/ppp> cat /etc/resolv.conf # Generated by NetworkManager nameserver 127.0.0.1 不过网络重新连接后还是会被网通的dns覆盖掉, 如下即可 之后重启网络,速度飞快
在gae上用django1.0 gae的使用就不多说了,它使用的是django0.96,想用1.0需要用到zip import zip import http://code.google.com/intl/zh-CN/appengine/articles/django10_zipimport.html gae helper for django http://code.google.com/intl/zh-CN/appengine/articles/appengine_helper_for_django.html django on gae,已打包好 http://github.com/Surgo/django-on-gae/tree 照上面文章设置既可,最后可以使用django式的manger, url, shell等
django中session选择文件形式存储,貌似没有自动垃圾清理的机制,所以会造成很多的无用session文件 删除30分钟没有活动的会话,这里默认每次页面访问都会读取session。 find /tmp/ -type f -name "sessionid*" -amin +30 | sudo xargs rm -f 附: 参考这里http://www.linuxselfhelp.com/gnu/findutils/html_chapter/find_2.html 文件的三种时间标志 ...
高亮版本看[这里 ](http://not- sobad.appspot.com/show_code/?key=aglub3Qtc29iYWRyCwsSBENvZGUY8WAM)。 作用就是 11,15,18,20,23等几个时间点执行我的脚本。 #!/bin/sh #cron.sh #浪点空间不支持crontab #blog数据同步脚本需要每隔几个小时执行一次,所以自己写了一个简单的 #usage: #nohup cron.sh &>/dev/null & get_local_hour(){ if ! date|grep UTC >/dev/null;then date +%H return 0 fi d=$(expr `date +%H` + 8) if [ $d -gt 24 ];then d=$(expr $d - 24) fi echo $d } cd $HOME/script || exit 1 while [ 1 ];do if ( (echo 11,15,18,20,23 | grep `get_local_hour` >/dev/null ) );then [ -s .rpc_end_link -a -f wp.py ] || exit 2 python wp.py 2>&1 >wp.log fi sleep 3600 done exit 0 后记:白忙了,还不如这样搞。 ...
notsobad.cn,又回来了,希望这次可以做好 买的是浪点带shell的linux空间 接下来要做的事: 将code snipper从gae移到这里来 经常的更新blog 用django作一些小工具 wordpress的自动更新脚本: #!/bin/sh # update my blog from svn, and get the language pack blog=notsobad.cn/public_html/blog/ (cd $blog; svn up) ( cd $blog/wp-includes/languages/; rm zh_CN.*; wget http://svn.automattic.com/wordpress-i18n/zh_CN/tags/2.7/messages/zh_CN.mo; wget http://svn.automattic.com/wordpress-i18n/zh_CN/tags/2.7/messages/zh_CN.po; )
Thank You My tea's gone cold, I'm wondering why I got out of bed at all the morning rain clouds up my window and I can't see at all And even if I could it'd all be grey, but your picture on my wall it reminds me that it's not so bad it's not so bad I drank too much last night, got bills to pay my head just feels in pain I missed the bus and there'll be hell today I'm late for work again and even if I'm there, they'll all imply that I might not last the day and then you call me and it's not so bad it's not so bad and I want to thank you for giving me the best day of my life Oh just to be with you is having the best day of my life Push the door, I'm home at last and I'm soaking through and through then you handed me a towel and all I see is you and even if my house falls down now, I wouldn't have a clue because you're near me and I want to thank you for giving me the best day of my life Oh just to be with you is having the best day of my life I want to thank you for giving me the best day of my life Oh just to be with you is having the best day of my life