10/25/2013

To walk through the lines of two files at once

To walk through two files at once...
The following sample Perl code read the corresponding lines of two files, and print the line which contains the joined string to another file.
  
if ($#ARGV != 1) {
    print STDERR "   Usage: perl $0 List_1 List_2\n";
    exit(1);
}

open(FileIn1, "$ARGV[0]") || die "Could not find file list $ARGV[0]";
open(FileIn2, "$ARGV[1]") || die "Could not find file list $ARGV[2]";
$outFile = "ChangeName_gbk" . ".bat";
open(FileOut, ">$outFile");

while (!eof(FileIn1) and !eof(FileIn2)) {
   my $line1 = ;
   my $line2 = ;
   chomp $line1;
   chomp $line2;
   print FileOut "rename \"$line1\" \"$line2\"\n";
}
close(FileOut);
close(FileIn1);
close(FileIn2);

7/28/2013

iexpress

Step-by-Step to wrap a vbs into an .exe

 
Here is a way to use Iexpress 2.0 to wrap your VBS scripts into an .exe. Iexpress 2.0 is native to Win XP and Win 7 and is quite useful when you have a VBS that is dependent on other files, like and install program or even an HTA. Once you have created the .EXE package a .SED file is also create in the same directory, which is the instructions for the Iexpress.exe. You can edit the .SED file in notepad and then run the iexpress wizard and select Open Existing Self Extraction Directive file and create your new package. This is helpful when you want to add new files, change the command line, or the output directory, you do not need to go through the whole package process again. Below are the instructions on how to create a new .EXE using Iexpress 2.0.
1.     On a computer running Windows XP or Windows 7, click Start, click Run, enter iexpress, and click OK. This starts the IExpress Wizard.
2.     On the Welcome to IExpress 2.0 page, select Create new Self Extraction Directive file and click Next.
3.     On the Package purpose page, select Extract files and run an installation command and click Next.
4.     On the Package title page, type a title for your package and click Next.
5.     On the Confirmation prompt page, select No prompt and click Next.
6.     On the License agreement page, select Do not display a license and click Next.
7.     On the Packaged files page, click Add and select the vbs script from the directory in which it resides:
8.     When you finish adding files, click Next.
9.     On the Install Program to Launch page, in the Install Program box, type c:\windows\system32\cscript.exe “yourVBS.VBS”  OR  c:\windows\system32\wscript.exe “yourVBS.VBS” Leave the Post Install Command box BLANK.
10.  On the Show window page, select Hidden and click Next.
11.  On the Finished message page, select No message and click Next.
12.  On the Package Name and Options page, enter the path and filename that you want for this distribution package. Check both boxes and click Yes to the warning under Options and click Next.
13.  On the Configure restart page, select No restart and click Next.
14.  On the Save Self Extraction Directive page, select Save Self Extraction Directive (SED) file:, edit the path and name of the file, and click Next.
15.  On the Create package page, click Next. When the package has been created, click Finish to exit.
16.  The package will now be created with the name you specified and have an extension of .EXE ex. “yourVBS.EXE”

7/23/2013

Using awk and sort in Linux

 Contents of script file port.awk:
BEGIN{ }
{
   if (NR > 2) print $1
}

The awk script tells system to process an ASCII file to dump the first field of the input record, as long as the current input record number in the input file is greater than 2 (i.e., printing the 1st field starting from the 3rd line of the input file).

awk -f port.awk PORT_M1 | sort > port_m1.sort

7/22/2013

Eric Clapton



提起電吉他演奏,就必須提到布魯斯音樂;提起最偉大的吉他演奏大師,人們首先會想到的是Jimi Hendrix,但是說起依然在世的最偉大的吉他演奏家,名字只有一個——Eric Clapton爵士。自從上個世紀60年代布魯斯搖滾樂以及布魯斯吉他演奏成為了主流搖滾風格之後,在這種來源於黑人音樂的吉他演奏中,在所有除黑色外其 他膚色的布魯斯吉他演奏家之中,傳奇人物Eric Clapton毫無疑問是其中最傑出的一位。在與Eric Clapton同時代的所有藝術家紛紛的離開人世,或者失去了原有的歌迷號召力之後,Eric Clapton是所有當年這些藝術家中為數不多的既然保持著自己高超的演奏技術以及強大的市場號召力的藝術家。

Eric Clapton為人謙遜,在與其他出色的吉他演奏者比如Jimi HendrixB.B. KingDuane Allman,甚至後輩Stevie Ray Vaughan相比較的時候他總是非常謙恭,在與B.B. King以及Bob Dylan等人同台的時候他總是舉止非常禮讓,他是最有紳士風度的流行音樂家之一。同時,作為世界上最著名的吉他大師,Eric Clapton還經常熱心的幫助包括英國著名流行音樂家StingBon Jovi樂隊主音吉他手 Richie Sambora 在內的其他一些音樂家去錄製專輯或者拍攝音樂錄影帶,並且經常為一些音樂家擔任吉他手作伴奏。Eric Clapton曾經協助過Bob DylanAretha FranklinJoe CockerRingo StarrFreddie KingRoger Waters等等近百位藝術家的專輯錄製。

雖然電吉他演奏是Eric Clapton的最成功之處,但是當他於19923月在MTV電視臺進行了不插電的現場演出節目之後,這位昔日以電吉他技術服眾的藝術大師的原聲吉他水 平同樣無人出其右。Eric Clapton的不插電現場專輯和涅磐樂隊(Nirvana)的不插電現場專輯是MTV台不插電節目歷史上銷售成績最好的兩張專輯。   

Eric Clapton作為最傑出的吉他演奏者,深刻的影響了後來湧現的眾多音樂人。

Decompression password:  www.zasv.com-联动印象