ubuntu安装thunderbird3

ubuntu源里的thunderbird还是2.*的,3.*已经出了好久了 参考[这里](http://www.ubuntu- inside.me/2009/08/howto-install-thunderbird-3-beta-on.html) sources.list中添加个ppa的源 sudo gedit /etc/apt/sources.list deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu jaunty main deb-src http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu jaunty main 添加key $sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 247510BE $sudo apt-get update $sudo apt-get install thunderbird-3.0 thunderbird-3.0-gnome-support

December 17, 2009 · notsobad

使用lynx来获取网页文本

使用lynx来获取网页文本, 效果就相当于在一个网页上面输入ctrl+a ctrl+c,然后ctrl+v保存到一个文本文件中,当然写到脚本里就可以自动化操作了。 lynx -notitle -nomargins -nolist -width=4096 -verbose -display_charset=gb2312 -dump http://baike.baidu.com/view/396668.htm?hh=255 | iconv -f gb2312 -t utf8//IGNORE 排下版 wang@wang-desktop:~/script/notsobad/shell/tool$ cat get_url.sh #!/bin/sh # File: get_url.sh # Author: notsobad # Description: # Created: 2009-12-14 15:53:02 # Last modified: 2009-12-14 15:53:02 url=$1 lynx -notitle\ -nomargins\ -nolist\ -width=4096\ -verbose\ -display_charset=gb2312\ -dump\ "$url"\ | iconv -f gb2312 -t utf8//IGNORE

December 14, 2009 · notsobad

shell中的eval

关于shell中的eval 对于命令注入后,一条命令可能需要的字符大概有这几个吧 $ ' " ; && || [ ] ` > <; 可以看到是很多的,所以黑名单过滤的方法肯定是有问题的,因为是肯可能绕过去的。 加入对所有GET, POST的参数都用了htmlspecialchars做了处理,那么所有的< > 都会被转义成html字符 那么就没办法使用重定向符号了吗? 参考下下面的利用eval来使用管道符号 The shell takes care of pipes and I/O redirection before variable substitution, so it never recognizes the pipe symbol inside pipe. The result is that the three arguments |, wc, and -l are passed to ls as arguments. ...

December 7, 2009 · notsobad

ubuntu下去除开机的服务

ubuntu下去除开机的服务,如果安装了apache,mysql开发用,可以去掉,使用的时候再打开。 find /etc/rc*.d/ -name \*apache2 -exec rm {} \; #Or: sudo update-rc.d -f apache2 remove

December 7, 2009 · notsobad

shell中的引号和反引号

shell参数中单引号如何表示呢? 存在一个程序notsobad,它接受一个参数中含有单引号,怎么写呢? # 双引号引起来 echo "'" ./notsobad -a xxx -b "'" # Or,注意参数中的单引号写法,实际上是 '\'' ./notsobad -a xxx -b ''\''' echo ''\''' 在shell参数中包含`(反引号)字符,如何做呢? # Wrong! # 反引号会先被shell截获解释,替换为反引号内部命令的执行结果 # 实际上产给notsobad的是id这个命令的输出,而不是命令本身 ./notsobad -b "`id`" # Right! echo '`id`' ./notsobad -b '`id`'

December 4, 2009 · notsobad

shell中的heredoc使用

shell中的heredoc很有用,对于临时的创建一个较长的字符串,比如脚本中要创建一个脚本等,就可以用这个 参考 Here Documents heredoc中的变量,shell命令都会被执行 下面的脚本创建了一串ftp命令,供ftp命令使用 Filename=`basename $1` # Strips pathname out of file name. Server="ibiblio.org" Directory="/incoming/Linux" # These need not be hard-coded into script, #+ but may instead be changed to command-line argument. Password="your.e-mail.address" # Change above to suit. ftp -n $Server << End-Of-Session # -n option disables auto-logon user anonymous "$Password" binary bell cd $Directory put "$Filename.lsm" put "$Filename.tar.gz" bye End-Of-Session 注意,如果想输出原始字符,即不希望‘$’符号被替换为变量,需要把引导字符用引号引起来,或者添加转义符。 ...

December 3, 2009 · notsobad

linux在脚本中重定向输出

关于linux下io重定向的几篇文章 A Detailed Introduction to I/O and I/O Redirection [Advanced Bash- Scripting Guide I/O Redirection](http://www.faqs.org/docs/abs/HTML/io- redirection.html) linux下三种文件是默认打开的,stdin(键盘), stdout(屏幕), stderr(错误信息,输出到屏幕),这三个和其它的打开文件都是可以被重定向的。 有一个脚本a.sh,我想把它的输出全部重定向到一个文件中去,如何做呢? 通常我们会在调用时做 sh a.sh >/tmp/out.txt 2>&1 但是如果调用是程序没办法控制的,如何在这个脚本内部做呢? 写一个测试脚本看下 #cat a.sh ...

November 30, 2009 · notsobad

ubuntu下安装chrome浏览器

ubuntu下安装chrome浏览器 编辑/etc/apt/sources.list Ubuntu 9.04 (Jaunty) 添加这个源 deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main ubuntu 9.10 (Karmic) 添加这个源 deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main 然后运行 sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xfbef0d696de1c72ba5a835fe5a9bf3bb4e5e17b5 之后就可以安装了 sudo apt-get update && sudo apt-get install chromium-browser -y

November 29, 2009 · notsobad

webfaction中django问题

webfaction中django配置,通用的没什么可讲的,只是有几点需要注意的. webfaction的web目录不能是一个链接,必须是一个实际的目录. 修改了除模板,media以外的任意文件,都要重启apache。 为了方便,把几个bin目录加到PATH里 把这一行加入~/.bashrc ...

November 26, 2009 · notsobad

ubuntu 9.10下linux qq 自动退出的问题

升级到ubuntu 2009以后, linux qq经常会自动退出,不清楚什么问题,导致我用了一段时间的web qq 昨天发现是可以处理的,原文在这里 修改/usr/bin/qq,添加一个环境变量 export GDK_NATIVE_WINDOWS=true 修改后: #cat /usr/bin/qq #!/bin/sh export GDK_NATIVE_WINDOWS=true cd /usr/share/tencent/qq/ ./qq 附:[GDK_NATIVE_WINDOWS](http://blogs.gurulabs.com/dax/2009/10/what-gdk- native.html)是什么意思? ...

November 25, 2009 · notsobad