webfaction中使用crontab与安装python包

继续感冒中…… 实在睡不着了,把我的这个脚本移到webfaction,放到crontab里了。 设置PYTHONPATH和PATH环境变量 [notsobad@web108 ~]$ cat .bashrc # .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions export PYTHONPATH=$PYTHONPATH:$HOME/script/python-lib export PATH=$PATH:$HOME/script/bin 然后就可以使用easy_install了,我要安装feedparser: easy_install --install-dir=$HOME/script/python-lib --script-dir=$HOME/script/bin feedparser crontab的使用: crontab -e 直接编辑即可,注意crontab使用的环境变量和登录用户使用的是不一样的,要使用自定义的pythonpath的话,需要自己指定 ...

November 8, 2009 · notsobad

网站又恢复了!

上次浪点的空间退出,导致自己没有地方用,终于买了国外的空间。102$/y http://webfaction.com 初步尝试,ssh速度有些慢,权限控制研究了一会才搞懂,导入备份数据也是折腾了好久。 终于搞定了! 以后会做的: http://blog.notsobad.cn 自己的blog http://code.notsobad.cn 运行的django+mod_python, 会放一些自己实验性的东西 http://www.notsobad.cn 这个还没想好放什么

November 6, 2009 · notsobad

GreaseMonkey中使用jquery

GreaseMonkey脚本里想使用jquery库该怎么办呢? 参考这几篇文章 http://joanpiedra.com/jquery/greasemonkey/ http://abeautifulsite.net/notebook/90 http://greasemonkey.mozdev.org/authoring.html 两种方案: 脚本加载后在html的head里插入一个链接到外部jquery的script标签 利用greasemonkey的require标签 但是如果只是利用新建用户脚本,require一直没有生效,无法载入外部脚本,参考这个: ...

September 20, 2009 · notsobad

fanfou?

这唱的是哪一出? $ nslookup fanfou.com Server: 124.207.162.136 Address: 124.207.162.136#53 Non-authoritative answer: Name: fanfou.com Address: 127.0.0.1

September 5, 2009 · notsobad

let's face the music and dance

很好听啊 let’s face the music and dance There may be trouble ahead But while there’s moonlight and music And love and romance Let’s face the music and dance Berlin Irving Before the fiddlers have fled Before they ask us to pay the bill And while we still Have the chance Let’s face the music and dance We’ll be without the moon Humming a diff’rent tune And then There may be teardrops to shed So while there’s moonlight and music And love and romance Let’s face the music and dance Dance Let’s face the music and dance

August 27, 2009 · notsobad

sh or bash

我需要对一些字体文件做些处理,字体名里面有些特殊字符,如空格,写了下面的脚本, 然后调用 “sh fonts.sh“, 却总是出问题,研究了好久,才发现是sh和bash的区别,这段代码用bash调用就没问题 #chmod +x fonts.sh #./fonts.sh #bash ./fonts.sh sh 和bash的区别 543 ~/www/fonts>cat fonts.sh #! /bin/bash IFS=$(echo -en “\n\b”) for i in $(find . -name \*.[Tt][Tt][Ff]); do echo “$i” done unset IFS ...

August 26, 2009 · notsobad

字体

几篇很不错的关于字体的文章: 从 Illustrator 到 FontLab 打造你自己的字体(I) 打造你自己的字体(II) 打造你自己的字体(III)实例研究:Joules 还有个小组 http://www.yeeyan.com/groups/show/TYPO 译言是个好网站,比其他的网站更有意义 比如 什么是股票和股票市场及运作原理

August 18, 2009 · notsobad

jQuery的监测事件

如何对一系列dom元素绑定事件? 那些元素在后续操作中还有可能会增加。 prototype.js中可以使用Event.Observe, jQuery中怎么做呢? 参考如下: 使用jquery中的事件检测而不事先绑定。 http://www.beyondstandards.com/archives/jquery-ajax-and-event-handlers/ http://docs.jquery.com/Events/live <http://www.sitepoint.com/blogs/2008/07/23/javascript-event-delegation-is- easier-than-you-think/> function aClick() { $("div").show().fadeOut("slow"); } $("#bind").click(function () { $("#theone").live("click", aClick) .text("Can Click!"); }); $("#unbind").click(function () { $("#theone").die("click", aClick) .text("Does nothing..."); });

August 16, 2009 · notsobad

swfupload 文件上传

浏览器的文件上传有个问题就是不能选择文件类型, 不能拖选文件,不能提供上传进度。 而flash可以提供这些功能,所以很有用。 swfupload 项目主页: http://code.google.com/p/swfupload/ 这里有一些例子可以参考 http://demo.swfupload.org/ 特性: Multiple File Selection File Upload Progress Custom Limits for File Size and Number of Uploads Filter by File Type ie. *.jpg File Queue Customize the Browse Control Flash 10 Support (Starting with Version 2.2.0) 大文件上传,需要提供进度的地方,可以考虑使用。

August 14, 2009 · notsobad

什么是好的命令行程序

最近处理bug,总结一下什么是好的命令行程序: 无参数调用时,显示帮助 记录日志到文件 关键步骤要打印log到标准输出 出错提示信息要写到标准错误里去 要有退出值 python程序不要屏蔽异常,要打印到stderr里去 脚本初始时要明确的检验执行权限、目录是否满足需求 python程序最好不要用PYTHONPATH来设置包含路径,移植和多人合作问题太多,应该直接链接到site-packages下去 ...

August 14, 2009 · notsobad