July 2008 Archives

Sexy Firefox Wallpaper

| No Comments | No TrackBacks

Sexy Firefox

附上一段stylish脚本,可以把他作为about:blank的背景:

@-moz-document url(about:blank) {
    body {
        background: url(http://firefoxy.vegard2.no/firefoxy_003_1280x1024.jpg)
    }
}

上次那篇Blog 用的send-hook是不对滴,应该用message-hook来搞。因为set from命令会永久改变from的值,因此每次判断之前要先reset到默认值然后再做判断。贴下我的配置:

message-hook '~A' "set from=detrox@mycompany.com"
message-hook '~f "(gmail|jianingy)\.com"' "set from=detrox@gmail.com"
message-hook '~t "(gmail|jianingy)\.com"' "set from=detrox@gmail.com"

msmtp本身是支持多个msmtp的。这些smtp的可以通过mutt的set from='xxx'来选取。因此,mutt能否使用多个smtp的问题就等价于是mutt能否根据不同情况改变from的值。事实上,mutt的send hook整好可以用来解决这个问题。请看我的mutt配置文件

set sendmail="/usr/bin/msmtp"
set use_from=yes
set realname="Jianing Yang"
set envelope_from=yes
set from=mycompany@email.com

send-hook '~f detrox@gmail.com' 'set from=detrox@gmail.com'
send-hook '~t detrox@gmail.com' 'set from=detrox@gmail.com'
send-hook '~t [^@]+@jianingy.com' 'set from=detrox@gmail.com'

通过上面的配置,mutt在发送邮件时会根据如下条件改变from地址:

1.邮件来自detrox@gmail.com
2.邮件是发往detrox@gmail.com
3.邮件是发往@jianingy.com域的

用xargs加速grep

| No Comments | No TrackBacks

xargs有个开关-P,意思是同时启动多少个子进程。借助xargs的这个特性可以加速grep文件的速度。例如,

grep  -r "libm.so.2" *

可以改写为

find . -type f | xargs -n 1 -P 20 grep "libm.so.2"

这样就会有20个进程同时查找了。

October 2008

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Friends' Links

Recent Comments

  • jianingy: test read more
  • mmx: thank u very much ! read more
  • FW: pls contact me with email.about APIHook. read more
  • jianingy: 这个lc是啥意思? -------- read more
  • cnhackTNT: 晕,被过滤掉了,再试试: s/(?<!\\)\$NICK/lc/e; 汗,过滤了小于符号,只好写<了呵呵 read more
  • cnhackTNT: s/(? 这样可以少打几个字呵呵 read more
  • R.Q.: 酱紫哦,了了 -------- read more

Archives

Powered by Movable Type 4.21-en