2012年7月21日星期六

[PerlChina] perl 处理音频的模块

想写一个脚本,把一首歌里面的数字信号 用数值的方式抽出来,
比如 13秒的时候 ,数值 5; 14秒 数值18...

最后我想用这些数值按一定精度生成一条曲线 呵呵。

第一步是先找一个模块来处理音频文件 抽出这些数值,比如mp3的,
大家直到有什么模块可以做 , 推荐一下么? 谢谢啦  :) 呵呵


--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

2012年7月19日星期四

Re: [PerlChina] 匹配后,查找第二行

只接用多行匹配就可以了。
/  /ms

On Jul 20, 2012 2:07 PM, "Gary Jsz" <gary.jsz@gmail.com> wrote:
大家好!

    我现在使用正则表达式找到了要匹配的行,但是,需要验证的是这个匹配行的第二行,比如内容如下:
 +192.168.0.1:http up
   session enabled    priority 0    ratio 50
   xxxxx xxxxx 
 +192.168.0.5:ftp down
   session disabled    priority 0    ratio 50

我要找到这个ip地址,并确认是否为enable状态,然后,我才能做动作。

在linux的shell中,可以用grep -A 2来匹配,在perl中是否有类似的? 或者语句应该怎么完成?

谢谢!


--
gary.jsz@gmail.com

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

[PerlChina] 匹配后,查找第二行

大家好!

    我现在使用正则表达式找到了要匹配的行,但是,需要验证的是这个匹配行的第二行,比如内容如下:
 +192.168.0.1:http up
   session enabled    priority 0    ratio 50
   xxxxx xxxxx 
 +192.168.0.5:ftp down
   session disabled    priority 0    ratio 50

我要找到这个ip地址,并确认是否为enable状态,然后,我才能做动作。

在linux的shell中,可以用grep -A 2来匹配,在perl中是否有类似的? 或者语句应该怎么完成?

谢谢!


--
gary.jsz@gmail.com

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

2012年7月18日星期三

Re: [PerlChina] Net::SSH::Perl模块使用问题

.A-test-x64: No compat match: OpenSSH_5.1    是不是这个问题引起的?

或者是其他什么问题?


2012/7/19 Gary Jsz <gary.jsz@gmail.com>
设置debug之后,显示如下:
DA-test-x64: Reading configuration data /root/.ssh/config
DA-test-x64: Reading configuration data /etc/ssh_config
DA-test-x64: Allocated local port 1022.
DA-test-x64: Connecting to 192.168.10.88, port 22.
DA-test-x64: Remote protocol version 2.0, remote software version OpenSSH_5.1
DA-test-x64: Net::SSH::Perl Version 1.34, protocol version 2.0.
.A-test-x64: No compat match: OpenSSH_5.1
DA-test-x64: Connection established.
DA-test-x64: Sent key-exchange init (KEXINIT), wait response.
DA-test-x64: Algorithms, c->s: 3des-cbc hmac-sha1 none
DA-test-x64: Algorithms, s->c: 3des-cbc hmac-sha1 none
DA-test-x64: Entering Diffie-Hellman Group 1 key exchange.
DA-test-x64: Sent DH public key, waiting for reply.
DA-test-x64: Received host key, type 'ssh-dss'.
DA-test-x64: Host '192.168.10.88' is known and matches the host key.
DA-test-x64: Computing shared secret key.
DA-test-x64: Verifying server signature.
DA-test-x64: Waiting for NEWKEYS message.
DA-test-x64: Send NEWKEYS.
DA-test-x64: Enabling encryption/MAC/compression.
DA-test-x64: Sending request for user-authentication service.
DA-test-x64: Service accepted: ssh-userauth.
DA-test-x64: Trying empty user-authentication request.
DA-test-x64: Authentication methods that can continue: publickey,keyboard-interactive.
DA-test-x64: Next method to try is publickey.
Permission denied at test.ssh.pl line 6


怎么会读取.ssh/config文件和/etc/ssh_config文件?







在 2012年7月19日 下午12:44,Fayland Lam <fayland@gmail.com>写道:

you can add debug => 1 see what happens. Thanks

2012/7/19 Gary Jsz <gary.jsz@gmail.com>:
> 大家好!
>
>      今天测试Net::SSH::Perl模块,代码内容如下:
>
> #!/usr/bin/perl -w
> use strict;
> use Net::SSH::Perl;
>
> my $ssh = Net::SSH::Perl -> new('192.168.10.88', protocol=>2);
> $ssh->login('gary', 'linux');
> $ssh->cmd("ls -al /tmp/");
>
>
>
> 执行的时候报权限问题,全部信息如下:
>
> Permission denied at test.ssh.pl line 6
>
>
>
> 还请大家给指点一二,谢谢!
>
>
> --
> gary.jsz@gmail.com
>
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。



--
Fayland Lam // http://www.fayland.org/

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。




--
gary.jsz@gmail.com



--
gary.jsz@gmail.com

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

Re: [PerlChina] Net::SSH::Perl模块使用问题

设置debug之后,显示如下:
DA-test-x64: Reading configuration data /root/.ssh/config
DA-test-x64: Reading configuration data /etc/ssh_config
DA-test-x64: Allocated local port 1022.
DA-test-x64: Connecting to 192.168.10.88, port 22.
DA-test-x64: Remote protocol version 2.0, remote software version OpenSSH_5.1
DA-test-x64: Net::SSH::Perl Version 1.34, protocol version 2.0.
.A-test-x64: No compat match: OpenSSH_5.1
DA-test-x64: Connection established.
DA-test-x64: Sent key-exchange init (KEXINIT), wait response.
DA-test-x64: Algorithms, c->s: 3des-cbc hmac-sha1 none
DA-test-x64: Algorithms, s->c: 3des-cbc hmac-sha1 none
DA-test-x64: Entering Diffie-Hellman Group 1 key exchange.
DA-test-x64: Sent DH public key, waiting for reply.
DA-test-x64: Received host key, type 'ssh-dss'.
DA-test-x64: Host '192.168.10.88' is known and matches the host key.
DA-test-x64: Computing shared secret key.
DA-test-x64: Verifying server signature.
DA-test-x64: Waiting for NEWKEYS message.
DA-test-x64: Send NEWKEYS.
DA-test-x64: Enabling encryption/MAC/compression.
DA-test-x64: Sending request for user-authentication service.
DA-test-x64: Service accepted: ssh-userauth.
DA-test-x64: Trying empty user-authentication request.
DA-test-x64: Authentication methods that can continue: publickey,keyboard-interactive.
DA-test-x64: Next method to try is publickey.
Permission denied at test.ssh.pl line 6


怎么会读取.ssh/config文件和/etc/ssh_config文件?







在 2012年7月19日 下午12:44,Fayland Lam <fayland@gmail.com>写道:
you can add debug => 1 see what happens. Thanks

2012/7/19 Gary Jsz <gary.jsz@gmail.com>:
> 大家好!
>
>      今天测试Net::SSH::Perl模块,代码内容如下:
>
> #!/usr/bin/perl -w
> use strict;
> use Net::SSH::Perl;
>
> my $ssh = Net::SSH::Perl -> new('192.168.10.88', protocol=>2);
> $ssh->login('gary', 'linux');
> $ssh->cmd("ls -al /tmp/");
>
>
>
> 执行的时候报权限问题,全部信息如下:
>
> Permission denied at test.ssh.pl line 6
>
>
>
> 还请大家给指点一二,谢谢!
>
>
> --
> gary.jsz@gmail.com
>
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。



--
Fayland Lam // http://www.fayland.org/

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。




--
gary.jsz@gmail.com

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

Re: [PerlChina] Net::SSH::Perl模块使用问题

you can add debug => 1 see what happens. Thanks

2012/7/19 Gary Jsz <gary.jsz@gmail.com>:
> 大家好!
>
> 今天测试Net::SSH::Perl模块,代码内容如下:
>
> #!/usr/bin/perl -w
> use strict;
> use Net::SSH::Perl;
>
> my $ssh = Net::SSH::Perl -> new('192.168.10.88', protocol=>2);
> $ssh->login('gary', 'linux');
> $ssh->cmd("ls -al /tmp/");
>
>
>
> 执行的时候报权限问题,全部信息如下:
>
> Permission denied at test.ssh.pl line 6
>
>
>
> 还请大家给指点一二,谢谢!
>
>
> --
> gary.jsz@gmail.com
>
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

--
Fayland Lam // http://www.fayland.org/

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

[PerlChina] Net::SSH::Perl模块使用问题

大家好!

     今天测试Net::SSH::Perl模块,代码内容如下:

#!/usr/bin/perl -w
use strict;
use Net::SSH::Perl;
 
my $ssh = Net::SSH::Perl -> new('192.168.10.88', protocol=>2);
$ssh->login('gary', 'linux');
$ssh->cmd("ls -al /tmp/");



执行的时候报权限问题,全部信息如下:

Permission denied at test.ssh.pl line 6



还请大家给指点一二,谢谢!

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。