Adblock for Tomato Routers

我这里只是把这个帖子的信息集中整理一下,原文请参见 http://www.linksysinfo.org/forums/showthread.php?p=369696

Place this script under Administration > Scripts > WAN Up tab, then save and reboot.
You can generate the encoded part in this script with the second script under this one.


## ALL-U-NEED Ad Blocking v3.9b
## http://goo.gl/mhykQ
## Original script by YAQUI
## Updated by ~nephelim~, Syl, jochen, groosh, ng12345, ray123, mstombs
## base64 decoder by Danny Chouinard's

sleep 10

ADB="/tmp/ADBLOCK.sh"
{
cat <$ADB
#!/bin/sh

OPTIMISE="Y"
GETS="1 2 3 4"
TRIM_BEGIN=3
S1="http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml" #44K
S2="http://mirror1.malwaredomains.com/files/justdomains" #189K
S3="http://www.malwaredomainlist.com/hostslist/hosts.txt" #97K
S4="http://www.mvps.org/winhelp2002/hosts.txt" #620K
S5="http://hosts-file.net/hphosts-partial.asp" #460K
S6="http://hostsfile.mine.nu/Hosts" #2641K
S7="http://support.it-mate.co.uk/downloads/hosts.txt" #3851K

USEWHITELIST="Y" # N/Y/R for remote
WURL="http://example.com/whitelist.txt"
WHITE="intel.com"
BLACK=""

USEPIXELSERV="N"
PXL_IP=192.168.1.2
PXL_EXE="/tmp/pixelserv"
PXL_URL="http://example.com/pixelserv"

UPLOAD="N"
FTP_SERVER="example.com"
FTP_USER=""
FTP_PASS=""
FTP_PORT=21
FTP_PATH="/gen"

ADD_CONF="N"
USEHOSTS="N"
ROUTER="Y"

NIP="0.0.0.0"

ENDF
}

UPDATE="Y"
AUP() {
if [[ "$UPDATE" == "Y" ]] ; then
if [[ "$(cru l | grep AdUpd | cut -d '#' -f2)" != "AdUpd" ]] ; then
cru a AdUpd "0 4 * * * $ADB"
fi
fi
}

#### DO NOT EDIT BELOW ####

b64="openssl enc -base64 -d"
[[ "$(echo WQ==|$b64)" != "Y" ]] && b64="b64"

b64(){
awk 'BEGIN{b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}
{for(i=1;i<=length($0);i++){c=index(b64,substr($0,i,1));if(c--)
for(b=0;b<6;b++){o=o*2+int(c/32);c=(c*2)%64;if(++obc==8){if(o)
{printf"%c",o}else{system("echo -en \"\\"")}obc=o=0}}}}';}

{
cat <>$ADB
H4sIALPm10wCA60Xa2/aSPC7f8V046shV2PINXcV1JEIj4BKAIFz6SkkFbUXWBVs
ajuPXuh/v9lZGwwkbaReIGJ3dnber60Ozoa2fqCdNbo2s+LF0ppyn2nOeT/Zxnyx
ZFqt120mADfwJ0xr9YbOMIHMgiiOmHbZbHcaCeh+JmLONPwTE7i6Ar2KfOCVDUW4
vobVSsKYnltGsIJpyJdgcjBMU9I2UpDhB58D75uRZ2DbwBjerEA8474WLsCcgI4y
FxbecXY7H0exNhGSca0zyOXhMXOaLlG5dCn1Stckv/Zd3u1/7NBdJTzTL4aNfvtj
ozNsDP5W0vyTEUdhvQLzAXS8+anxsbE5vJ/yGMze5oQWF4OO5s4WgQe/by5JwcVE
2kBM4XNYLBfVUbu/FiS3FF4wgaV44POIh3d7ttnh0+5XIJpztGYJKkD0X0hImwfT
KQ+hWj/t9GofoDEY9AZlcMe+H8QQxeMw3tzW5I/G78ZzYN123054M6kRfsmm3RqZ
9KJbbzTtojYJQhAgfOkZZ1gBLwBF4Dac22ykD3XBQOuXbD3H3VkAOsJXEHEPjGh1
M4vj5VV0fVi2rKsb6/pwlLMKh6O8vhqVVkZea/382iinLubxYnpNyvQgZSrBEfwh
ZdJiseApLYxR1mpU62jaErQcp2+VCqVROPJbmABl0Fu0qQW+z91YBD5aax5EXALZ
SvNdMO/hWKLBu+JKRb2ADkaseR54YiK4V17FIZgesFHI8uQrdJUUgcnckd5JvPw5
5OMv5FAv8Pk2pr2FqexdIlxlEYl1ckLp4vN7RUBR0AkZ9fyKFkgJ7GQXEVLoWXCK
rp3Xpe0xLaPbxeZ45d7GpBh+zEkpD4h3tIOHwuyjJZohVaUYro7Wyu3EaBn8ANzZ
2J/yCCLhuxx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X
lj7tfEgGnvBOYKNMlMbpP1i+ROwUXz3szImYc6WAkv/J46wdmzQBkYU2L0Ujubb3
ToSU7W76p3xEBOGt72MV/lH/wOiTjxtZq1MnY7VOlmvRcD6Qr0T5rMFBTU4yNAjI
siSbBP1SkdF+WkEoOymsk8Ahw6Py9JCVjLT/AAHexXemDwAA
ENDF
}

chmod 775 $ADB
$ADB
AUP

这其中的b64可以产生如下代码:

#!/bin/sh
{
cat <>$GEN.new
done

if [ $UNDEF -eq 1 ]; then rm -f $GEN.last; fi

if [ -f $GEN.last ]; then
MD1=$(md5sum $GEN.last|cut -d " " -f1)
MD2=$(md5sum $GEN.new|cut -d " " -f1)
if [ "$MD1" == "$MD2" ]; then
logger ADBLOCK: no changes since last time, exiting.
rm -f $GEN.new
exit
fi
fi
mv -f $GEN.new $GEN.last
}

TRIM() {
sed -ie '
s/\#.*$//
s/^127\.0\.0\.1[ \t]*//
s/[ \t]*$//
s/^::1[ \t]*//
s/localhost$//
/^$/d' $TMP
}

DS() {
for i in $GETS; do
eval url="\$S$i"
if wget $url -O - | tr -d "\r" > $TMP ; then
if [[ $i -ge $TRIM_BEGIN ]]; then TRIM ; fi
cat $TMP >> $GEN
logger ADBLOCK: $url
else
logger ADBLOCK ERROR: cannot get $url
fi
done
}

TST(){
MD5=$(md5sum $GEN|cut -d " " -f1)
if [[ -f $GEN.md5 ]] && [[ $MD5 == $(cat $GEN.md5) ]]; then
logger ADBLOCK: no changes since last time, exiting.
CLR; exit
else
echo $MD5>$GEN.md5
fi
}

LWHT() {
if [[ "$USEWHITELIST" == "Y" ]]; then
for site in $WHITE
do
sed -i "/$(echo $site|sed 's/\./\\./g')/d" $GEN
done
elif [[ "$USEWHITELIST" == "R" ]]; then
if wget $WURL -O - | tr -d "\r" > $WFILE ; then
logger ADBLOCK: whitelist $WURL
sed -i -e '/\#.*$/ s/\#.*$//' -e '/^$/d' $WFILE
for site in $(cat $WFILE)
do
sed -i "/$(echo $site|sed 's/\./\\./g')/d" $GEN
done
else
logger ADBLOCK ERROR: cannot get whitelist $WURL
fi
fi
echo "$BLACK" |sed 's/[ \t]*/\n/g'|sed '/^$/d' >> $GEN
}

OPT() {
if [[ "$OPTIMISE" == "Y" ]]; then
logger ADBLOCK: sorting hosts...
if [[ "$USEHOSTS" == "Y" ]]; then
sort -u -o $TMP $GEN
else
awk -F '.' 'BEGIN{ORS=""}{for(i=NF;i>0;i--)print $i"#";print "\n"}' $GEN|sort|
awk -F '#' 'BEGIN{ORS="";d = "%"}{if(index($0,d)!=1){d=$0;print $--NF;
for(i=--NF;i>0;i--)print "."$i;print "\n"}}' > $TMP
fi
logger ADBLOCK: hosts sorted.
fi
mv -f $TMP $GEN
}

CNT() {
TOT=$(wc -l > $CONF
cat >> $CONF <> $GEN
fi
}

ADDCFG() {
if [[ "$ADD_CONF" == "Y" ]]; then
if [[ "$USEHOSTS" == "Y" ]]; then
eval "CFG=$CONF"
else
eval "CFG=$GEN"
fi
cat >> $CFG <<EOF
dhcp-authoritative
cache-size=2048
log-async=5
EOF
fi
}

LBLK() {
service dnsmasq stop
if [[ "$USEHOSTS" == "Y" ]]; then
dnsmasq --conf-file=$CONF
else
dnsmasq --conf-file=$GEN
fi
}

FS() {
if ps | grep 'dnsmasq' | grep 'nobody' ; then
logger ADBLOCK: dnsmasq is running
else
logger ADBLOCK ERROR: restarting dnsmasq...
dnsmasq
fi
}

CLR
PXL

NC
DS
TST
LWHT
CNT
OPT
CNT
FTPUP

if [[ "$ROUTER" == "Y" ]]; then
FDNSM
LCFG
ADDCFG
LBLK
FS
fi

CLR

ENDF
}

AdBlock Sources

OPTIMISE="Y"
GETS="1 2 3 4"
TRIM_BEGIN=3
S1="http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml" #44K
S2="http://www.malwaredomains.com/files/justdomains" #189K
S3="http://www.malwaredomainlist.com/hostslist/hosts.txt" #97K
S4="http://www.mvps.org/winhelp2002/hosts.txt" #620K
S5="http://hosts-file.net/hphosts-partial.asp" #283K
S6="http://hostsfile.mine.nu/Hosts" #2641K
S7="http://support.it-mate.co.uk/downloads/hosts.txt" #3851K

You can choose which hosts files will be downloaded to block ads, update the variable GETS.
In the default setup, Adblock will download S1 to S4.
S6 and S7 require a router with a lot of memory, use it if you know what you’re doing.

A little explanation about TRIM_BEGIN=3:
S1 and S2 are files with hostname only, these files will be copied without formatting.
S3 to S7 are file formatted to replace hosts file, these files will be formatted to works with AdBlock.
TRIM_BEGIN tells AdBlock which sources need formatting (from S3 to the end),
updated it if you add a source, between S2 and S3, which doesn’t need formatting.

You can also add your custom blacklist here. Add a new source and update GETS.

If OPTIMISE=”Y”, AdBlock will remove duplicated entries in the hosts file. See Hosts file Vs. DNS Cache Poisoning for more details.

Whitelist and Blacklist


USEWHITELIST="Y" # N/Y/R for remote
WURL="http://example.com/whitelist.txt"
WHITE="intel.com"
BLACK="facebook.com
facebook.net
fbcdn.net"

You can add inline whitelist and blacklist to the script,
look at the example above to see how to add domains to the blacklist.
If USEWHITELIST=”R”, AdBlock will download the whitelist from the URL specified by WURL.

Pixelserv

If you don’t want to run pixelserv, you can update NIP=”0.0.0.0″ if you want to redirect blocked hosts to another HTTP server.
If you don’t have a HTTP server, don’t modify this variable.

如果想使用Pixelserv,有两种使用方法。

方法一:
You can download pixelserv from this thread.
Instead of redirecting blocked hosts to 0.0.0.0, pixelserv will return a 1×1 pixel.
Pixelserv removes error message in the browser by doing that.
Code:

USEPIXELSERV=”Y”
PXL_IP=192.168.1.2
PXL_EXE=”/tmp/pixelserv”
PXL_URL=”http://example.com/pixelserv&#8221;

Update USEPIXELSERV=”Y” to use it.
PXL_IP is the IP AdBlock will use to redirect hosts to pixelserv, you MUST specify an unused IP.
PXL_EXE is where pixelserv is located or will be downloaded. You can change this location if you want to store it on your usb drive if you have one connected to your router.
If AdBlock can’t find pixelserv to the specified location, it will download it from PXL_URL and save it on the router to PXL_EXE location.
For example, you can store it on dropbox.
You can see how many ads was blocked with this command: kill -SIGHUP $(pidof pixelserv)

方法二

也可以将Pixelserv装在Nvram中。这个方法详见以下链接

在Tomato的webshell(Tools标签)中,运行以下代码(只需一次,这段代码将Pixelserv装入Nvram,重启后也不受影响)。


# pixelserv tiny V19 for TeddyBear builds by mstombs: http://bit.ly/a11SKr
#To set pixelserv path change the PXL variable at the bottom of this script

e="echo";[ $0 == "-sh" ]||eval $(grep -ow "PXL=[^[]*$" $0);setup(){
ENC="H4sIAGBJ00wCAJVYScwMQRR+3WbsS9u3QWMYsYyxJbZE2/ddYglpszSGMTOZblsIY3cQQyJEQuxL
RIztIEI4iLMDNwcSwsGBg1gixveqi25tf3/e/+qr99WrV696uqt7y/hpExRFoW+iUn1ipNU3aDDs
puZE9TSaNZh0qke9qB21pbpE8LEaQp8SCQ1DQ9A60FYKq+EqY+lTXJViCG2sEVSMZy/7Zd9ooVeA
H0HrSr+K/70UVgPqzV9PzjH7hZOhoHj+Pwr7++eyqf65TL81Y9FIx+1CPCFyUhUSto+C3GD31zOo
CUGaGWJcfdUQazgaNkSuI+sY1BB2J/iNYDVoG6JiFGtqTRBZqwSwgn4ohWFVXissEcbDct7NYXvC
toBtB9sSlmN+qdUKReRRg+Xxb2C7Af+v9IAiPsRdWxe5ny2g0QBXhXb14Wa+NufUWta6M7QTtL30
dZC2obSKtE2lbeCuS9S0LdcTGqGfRZe2lbTNpdUC++gX3o/ubv2pnVxvnQCnYwB3o/+TOQpyw16y
aMhKU7w1tqS3tYXs3y/9wFMV8TuTuAF1BY7K8c1R+Qzwbc3jLwngIcCJb3zgtcBPff5igP+M4G+K
+eS+Tg7U1II+9PkfQu/5sA294sP15LUfEbgRvYY94flFrYsNDNpfBxjrywHv9/xin8s+/ID5PvwE
utSHD0Fn+fASqOHD76AJH94F1X34AFTz4Y6BvX7MDZ9fcX/jcn316Rjsmyae/yXX04e3cM18+CI3
gCeRu/5BgflucX19/E9cXx8mM5vPOmQugyHTdG9H5upkNg+UsUrW8qztWCVzWSm52gJ3WQH9v+yd
stacI/vH5pK2bdlkO6V8uriB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UxgjE2yx5qLX8Ngb+L3g7fbxW4LX6DW+vjxcBL/KbeQ/4eDp4+m94h328KHjR
3/BOeDwtAV4CvD2BujD3rI93E7ybv4l3iesm570H3m3w9F/U+SrH896/meeJ55NzSpG8u7/gfQVs
+LAkPBUAAA=="
n="nvram";m="md5sum";if [ "$($e "$ENC"|$m)" != "$($e|$n get pxl|$m)" ]
then $n set pxl="$ENC";$n commit;logger $n pxl updated;rm -f $PXL;fi;}
setup
# after the script ran once you can remove this line and all lines above this

再将以下代码贴入admin->Scripts->Firewall,并重启路由即可。

palm pre 1.3.5.1 内存扫描结果

23:46:19 : Couldn’t open port COM1
23:46:52 : Scanning flash for readable data. Step – 1024 bytes
23:46:52 : READABLE area at 0x00000000
23:46:55 : Unreadable area at 0x00001000
1:34:52 : READABLE area at 0x001FB400
1:34:55 : Unreadable area at 0x001FE000
1:35:17 : READABLE area at 0x00200000
1:35:21 : Unreadable area at 0x00201000
1:35:30 : READABLE area at 0x00202000
1:35:32 : Unreadable area at 0x002A4C00
1:35:32 : READABLE area at 0x002A5000
1:35:55 : Unreadable area at 0x00944000
1:36:05 : READABLE area at 0x00945000
1:36:07 : Unreadable area at 0x009EA000
1:36:07 : READABLE area at 0x009EA400
1:36:37 : Unreadable area at 0x012F7000
10:29:21 : User break at address 0x01CB9400
10:29:21 : Scan completed

Sprint PST Settings with Boost Provisioning

NAM Name: SPCS
SCM: 42
Software Version: 3.56.651.0 -varies
Firmware Version: 3.42.02 -varies
Hardware Version: 0003
PRI Version: 2.04_003 -varies
PRI Checksum: 449def22 -varies

(NAM Settings)
NAM Name: SPCS
MDN:
MIN1:
MIN2:
MSID:
MCC: 310
MNC: 00
NMSI: 00
IMSI: 31000
True MIN1:
True MIN2:
True IMSI_S:
True MCC: 000
True MNC: 00
True NMSI: 00
True IMSI: 00000
ACCOLC: 4

(CDMA Settings)
A-Sys Primary: 283
B-Sys Primary: 384
A-Sys Secondary: 691
B-Sys Secondary: 777
MOB_TERM_FOR_HOME: Enable
MOB_TERM_FOR_SID: Enable
MOB_TERM_FOR_NID: Enable
EVRC Enabled: Enable
Home Page: EVRC
Home Orig: EVRC
Roam Orig: Voice 13K

(Home SID/Home NID)
All settings are 0 / 0

(Modem Settings)
Slot Cycle Index: 2
Preferred Serving System: Sprint Only
Preferred Mode: Automatic
HDR Hybrid Preferred: Enable
Clear all MRU entry: No

(Data Parameters)
Packet Dial String: #777
Rev.A: Enable -varies (Model Specific)

(M.IP Settings)
Number of Profiles: 2
Active User Profile Index: 1
MIP_MODE: Mobile IP Only
MIP Registration Retries: 1
MIP Registration Retry Timeout: 2000 ms
MIP Pre-Registration Timeout: 30
Mobile Node-HA Authentication: Disable
Send a Registration Request Only: Enable
Dormant Handoff Optimization: Disable

(MID Default Profile)
Enable Profile: Enable
NAI: @hcm.sprintpcs.com
MN HA SPI Set: Enable
MN HA SPI Value(Hex): 4D2
MN AAA SPI Set: Enable
MN AAA SPI Value(Hex): 4D2
Reverse Tunneling Preference: Enable
Home Address: 0.0.0.0
Primary HA Address: 68.28.15.12
Secondary HA Address: 68.28.31.12
DMU Public Key: 0

(M.IP Customer Profile 1)
Enable Profile: Enable
NAI: @myboostmobile.sprintpcs.com -varies (Boost Account)
MN HA SPI Set: Enable
MN HA SPI Value(Hex): 4D2
MN AAA SPI Set: Enable
MN AAA SPI Value(Hex): 4D2
Reverse Tunneling Preference: Enable
Home Address: 0.0.0.0
Primary HA Address: 255.255.255.255
Secondary HA Address: 68.28.89.76
DMU Public Key: 0

HTC Hero MEID change

Default Sprint Hero – MEID Solutions
1. Get SPC

HOW TO READ / RESET SPC = SuperSPC Method

Start CDMA Workshop and Connect the Phone go to Terminal Tab (Second Tab) type 41 74 64 77 61 6F 70 inside it and click to Send for 2 or 3 times, then immediately go to Security Tab and Click to read SPC, again Send that SPC and then Zero it and rewrite. then just go to security and read/write your new spc

2. Zero all pESN and MEID

Install QxDM Connect to Proper Port and Open View – New – Memory Viewer

pESN addresses:

0x015ADA85
0x015ADB53
0x015AF5C5
0x015AF58F
0x015AF693
0x1876CB80
0x18774744
0x187764CC
0x18858DE8
0x188BF514
0x188BF5EC
0x188C5C18
0x188CEB58
0x188D13F0
0x188D6760
0x18D4133D

MEID address

0x0142201C
0x01422028
0x015B46DC
0x1876A658
0x18771248
0x187759D0
0x188BF9AC
0x189AAAEC
0x189AABBC
0x189B7CF0

Enter above Address and Press Enter if you find ESN or MEID in Reverse order Just Zero 8 Numbers / or 14 Number for MEID and Click to write

3. Now in QxDM in View Menu Select (Command Bar, Status Bar, View Bar)

now in Command bar
Enter the Following Commands

RequestNVItemWrite esn 0x0
RequestNVItemRead meid
RequestNVItemWrite meid 0x0000000000000000

It must say MEID and ESN as Zeroes. if its Zeroed Reboot it and move to Next Step or try again to Find Locations and Zero it.

4. Final Step Try to Issue the Following Command

RequestNVItemWrite meid 0x00a1000001234abc (Actual MEID)
RequestNVItemRead meid
RequestNVItemRead esn

if it fails Reboot your Phone then go to Settings – About – Status and Check that MEID = 0000000000000 and ESN = 00000000
if yes do Final Step Once again

How to Convert Hero to ESN only – Remove MEID

Once you Zero all MEID and ESN and reboot it in CDMA Workshop it if shows SCM (Station Class Mask) = 2A (2A = ESN Based 3A = MEID Based )

Now Read ESN from NV Method, if ESN Show Zero Reboot it and try to Write new ESN using NV Method (CDMA Workshop or QxDM) it must says Success. or else Reboot and try

PLEASE SAY THANKS and also thanks the following people and all Thread members

Salutes to My Heroes – shadowmite, zaquaz, supadoggie, the_miker, tonycortes
Attached Files
File Type: rar android_usb_drivers_x32_x64_sdk1.6-r1.rar (6.08 MB, 380 views)
File Type: rar HTC_Hero_DIAG_Drivers.rar (1.10 MB, 325 views)

0x0142201C – MEID
0x01422028 – MEID
0x015AF59E – pESN
0x015B46DC – MEID
0x1876A658 – MEID
0x1876CB80 – pESN
0x18771248 – MEID
0x187759D0 – MEID
0x18774744 – pESN
0x187764CC – pESN
0x18858DE8 – pESN
0x188BF9AC – MEID
0x188BF514 – pESN
0x188C5C18 – pESN
0x189AAAEC – MEID
0x189AABBC – MEID
0x189B7CF0 – MEID
0x18D4133D – MEID
0x015af5c5 – pESN

MacVim,vim-latex,Skim,synctex

本来在Linux里面Emacs+AucTex是我不二的选择, 但是在Mac平台上,当我试用了一大堆的TeX编辑器,包括TeXShop,Aquamacs,BBEdit,TextMate,… … 以后, 我最终还是回到了Vim的怀抱.

安装就不多说了,MacTeX,MacVim,Skim先安装好,需要注意的是要把mvim这个脚本放到某一个$PATH里可以搜索的目录,比如我是~/bin. 然后下载vim-latex,解压到~/.vim目录里面.下面详细说说配置的步骤.

1.现要配置好MacVim. 编辑自己的~/.vimrc文件,下面是我针对vim-latex的设置,每一行都有详细的说明.

" vim-latex setting goes here
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
" filetype plugin on

" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
set shellslash

" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*

" OPTIONAL: This enables automatic indentation as you type.
filetype indent on

" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
" end of vim-latex setting
let g:tex_flavor='latex'

" Use Skim to view pdf files; also can do backward search
let g:Tex_CompileRule_pdf='pdflatex --interaction=nonstopmode --synctex=1 $*'
let g:Tex_ViewRule_pdf='Skim'
let g:tex_fold_enable=1

" Multiple runs on files with '\cite,\ref,\bibitem,etc'
let g:Tex_MultipleCompileFormats='pdf,dvi,ps'

2.设置缺省编译为pdf文件: 在Vim的”Tex-Suites”菜单里点击”Target-Format”,然后输入pdf.

3.然后要在Skim里面设置与Vim同步, 在Skim->Preference->Sync里面, Preset选择Custom,Command选mvim, Arguments选
--remote-silent +":%line;foldo!" "%file".

就这么简单!