aMule — all-platform eMule

aMule是eMule的一个Clone,在各个平台下都有,用起来几乎和eMule一样,甚至能够读取eMule的部分文件…… 只是没有eMule稳定…… aMule是完全UTF-8化的软件,比如说他对我家FAT32分区上的GBK编码的文件名有很多反感的地方…… 而且下载下来的文件名在我看起来也是乱码(我家的工作环境也是GBK的,他存下来是UTF8的……) 办法总是有的嘛~ 搞了个Perl脚本来自动识别并重命名~ 详细情况可以参见Tech Blog~

统计软件包占用空间的脚本

得益于 FreeBSD 的包管理方法,可以很容易地统计出每个软件包占用的空间大小和总大小~统计下来,总共3.9G左右,OpenOffice最大(310M左右)。通过这个还知道了最大的几个包,找到几个没用的删掉~ 空间大了不少~ #! /usr/bin/perl open(STDOUT,’| sort -n’); $sum=0; while(<STDIN>)#`pkg_info -s ‘*’`) { if (/^Pack/) { next; } unless (/for/ || /block/) { next; } if (/^Info/) { chop; /(^.*) (.*):$/; $x=$2; } else { chop; /(^\d+)/; $sum+=$1; print “$_ $x \n”; } } printf “%8d(1K-blocks) total\n”,$sum; close(STDOUT); Old Blog Link: http://computer.mblogger.cn/henryhu/posts/62323.aspx

Exercising Perl

学语言之类的,当然不能光学不练,纸上谈兵。我看了《Learning Perl》之后,打算把习题都练一遍~ 练的时候才发现,很多东西需要重新学习…… 另外,有些地方重新学了还是不能做到最好。 Perl’s motto: There’s more than one way to do it. Perl的精神:省力! 汗%…… 比方说,现在我还没有使首字母大写的好办法。现在是这样的: $a=~s/^o/O/; $a=~s/^t/T/; $a=~s/^f/F/; $a=~s/^s/S/; $a=~s/^e/E/; $a=~s/^n/N/; 等等…… 26条啊!…… 肯定有好方法的,谁知道告诉我一声…… 花了半天做到第十章。明天应该就可以搞定了……

自动压缩源代码的脚本

BAT file: @for /F “tokens=1,2,3 delims=- “”” %%i in (“%date%”) do @set shortdate=%%i%%j%%k @for /l %%i in (1,1,100) do @( @if NOT exist src%shortdate%-%%i.zip @( @if NOT exist src%shortdate%-%%i.rar @( @zip -9 -r src%shortdate%-%%i.zip Comm Sender -x *.exe *.~* *ModelSupport* *_history* *.dcu @echo Zipped into src%shortdate%-%%i.zip @goto END ) ) ) :END 用这个脚本来自动压缩源代码~ 比手动压缩方便许多…

Batch file to automatically pack source

BAT file: @for /F “tokens=1,2,3 delims=- “”” %%i in (“%date%”) do @set shortdate=%%i%%j%%k @for /l %%i in (1,1,100) do @( @if NOT exist src%shortdate%-%%i.zip @( @if NOT exist src%shortdate%-%%i.rar @( @zip -9 -r src%shortdate%-%%i.zip Comm Sender -x *.exe *.~* *ModelSupport* *_history* *.dcu @echo Zipped into src%shortdate%-%%i.zip @goto END ) ) ) :END 用这个脚本来自动压缩源代码~ 比原来方便多了~ Old …

Continue reading ‘Batch file to automatically pack source’ »