« links for 2008-08-03 [delicious.com] | Main | links for 2008-08-19 »


用 VIM 快速修改 Tomcat 的端口

在一台机器上运行多个 Tomcat 的时候,需要修改 server.xml 中的好几个端口。
vim $CATALINA_HOME/conf/server.xml

在 VIM 中用下面的替换可以迅速的给每个端口加1,也就是把 8080 变成了 8081,等等

:%s/\([pP]ort\)="\([0-9]\+\)"/\=printf("%s=\"%d\"",submatch(1),submatch(2)+1)/g

或者用下面的替换可以迅速的给每个端口前增加一个数字,下面的例子是增加 4,也就是把 8080 变成了 48080,等等

:%s/\([pP]ort\)="\([0-9]\+\)"/\1="4\2"/g

Comments

If you're still on the fence: grab your favorite earphones, head down to a Best Buy and ask to plug them into a Zune then an iPod and see which one sounds better to you, and which interface makes you smile more. Then you'll know which is right for you.

I'm sure Facebook site's owners also did not expect this much creativity when they designed the website :)

Hello. fantastic job. I did not imagine this. This is a excellent story. Thanks!

Hello! I'm at work surfing around your blog from my new iphone! Just wanted to say I love reading your blog and look forward to all your posts! Keep up the superb work!

A lot of of whatever you point out is supprisingly legitimate and it makes me wonder the reason why I had not looked at this in this light previously. Your piece truly did turn the light on for me as far as this particular subject goes. Nevertheless there is actually 1 position I am not too comfy with and while I make an effort to reconcile that with the actual central theme of the position, permit me see just what the rest of the readers have to say.Well done.

Howdy would you mind letting me know which hosting company you're using? I've loaded your blog in 3 completely different browsers and I must say this blog loads a lot faster then most. Can you recommend a good hosting provider at a honest price? Thank you, I appreciate it!

Oh superior, Joci! I hope you'll step up and be brave with me in publishing your videos. Many persons locate videos a creative outlet, but I am still looking for that component of it. I had to perform pretty hard to have this 1 come off "effortlessly."

Post a comment