Around emacs, linux, etc.
Archive for October, 2008
用tcpreplay对网络程序进行压力测试
Oct 16th
以前tcpdump用的比较多,主要用在诊断的时候。tcpreplay则是把tcpdump记录下来的包原样发回去
这样tcpreplay就可以用来以极快的速度复现记录下来的数据从而实现压力测试,好处在于数据比较真实
More >
jump-or-exec in emacs
Oct 6th
去年的时候发在水木里的
类似sawfish下的jump-or-exec
用于查找名为buffer-name的buffer,如果不存在则调用func,如果存在的话切换到这个buffer,如果这个buffer就是当前的buffer且给出了可选参数onfocused的话就把这个buffer作为参数来调用onfocused
因为不会用正则匹配查找buffer,所以只能全匹配。
没有sawfish的时候怎么用jump-or-exec来切换窗口
Oct 6th
最初是因为compiz不成熟,所以一直在用sawfish,最近切到了compiz后就不能用sawfish了,非常好用的jump-or-exec也没了,本来打算自己搞个的,发现已经有人弄过了。地址在 http://pluskid.lifegoo.com/wiki/JumpOrExec.html
通过一个python脚本和wmctrl来实现的jump-or-exec,配合xbindkeys,基本上不用再担心切换wm的问题了
不过python脚本的启动明显没有shell脚本来的快,改写成shell脚本代码如下
More >
用adsl时如何使用dnsmasq
Oct 5th
前面写过一篇帖子,是关于用dnsmasq做dns缓存的,里面提到的dsl部分采用的是注释掉usepeerdns,这并不是很好用,因为无法获取运营商的dns server
简单的做法是在/etc/ppp/ip-up.d/0000usepeerdns里cat /etc/ppp/resolv.conf前加上一句echo “nameserver 127.0.0.1″ 把那一段变成这样即可。
# merge the new nameservers with the other options from the old configuration
{
echo "nameserver 127.0.0.1"
cat /etc/ppp/resolv.conf
grep --invert-match '^nameserver[[:space:]]' "$REALRESOLVCONF" || true
} > "$REALRESOLVCONF.tmp"
Recent Comments