[#385051] How to order Structs based on two fields — Iñaki Baz Castillo <ibc@...>

Hi, I've a struct like this:

20 messages 2011/07/01
[#385052] Re: How to order Structs based on two fields — Iñaki Baz Castillo <ibc@...> 2011/07/01

2011/7/1 I=C3=B1aki Baz Castillo <ibc@aliax.net>:

[#385057] Re: How to order Structs based on two fields — Robert Klemme <shortcutter@...> 2011/07/01

On Fri, Jul 1, 2011 at 12:55 PM, I=F1aki Baz Castillo <ibc@aliax.net> wrote=

[#385069] Offering Help — Joe Peric <peric.joe@...>

I'm new to Ruby and I am willing to learn. Anyone need help on a

18 messages 2011/07/01
[#385072] Re: Offering Help — Jeremy Heiler <jeremyheiler@...> 2011/07/01

On Fri, Jul 1, 2011 at 11:43 AM, Joe Peric <peric.joe@gmail.com> wrote:

[#385073] Re: Offering Help — Joe Peric <peric.joe@...> 2011/07/01

Never heard of it, but I'll get right on it. Thanks.

[#385082] Re: Offering Help — Joe Peric <peric.joe@...> 2011/07/02

Just finished this. I had to find some more info on exceptions to get

[#385083] Re: Offering Help — Jeremy Heiler <jeremyheiler@...> 2011/07/02

On Sat, Jul 2, 2011 at 1:39 PM, Joe Peric <peric.joe@gmail.com> wrote:

[#385102] symbol vs string for hash keys — Intransition <transfire@...>

What are the important factors to consider when deciding whether to

12 messages 2011/07/03

[#385160] Fatal Error with Ruby/GTK2, Homebrew, Green Shoes, and OSX Snow Leopard — Timothy Barnes <barnes7td@...>

I posted the below question to the Shoes mailing list and got back the

10 messages 2011/07/09

[#385194] RubyInstaller Extras — Jon <jon.forums@...>

Since 2009, we've been pleased to include Huw Collingbourne's The Book of Ruby with RubyInstaller. Well now, Huw has a newly updated version, and he's published it with No Starch Press.

11 messages 2011/07/12

[#385207] Creating a range of directories — Simon Harrison <simon@...>

I'm wanting to create a range of directories with a prefix, like the

13 messages 2011/07/13

[#385276] Is there a more efficient way to remove data from a string? — Eddie Catflap <catflaporama@...>

Hi

9 messages 2011/07/15

[#385297] Help needed for a new release of text-hyphen — Austin Ziegler <halostatue@...>

I've had folks asking me for a release of text-hyphen that works with

12 messages 2011/07/15

[#385326] Comparing hashes based on their keys — Stefano Mioli <stefano.mioli@...>

Hi list,

13 messages 2011/07/15

[#385342] moving a 1.8.6 install? — Roggie Boone <rogboone@...>

Is it possible to move the gems from a Ruby 1.8.6 install on an (old)

10 messages 2011/07/15

[#385410] Better name for #zip_with — Intransition <transfire@...>

Any ideas for a better name for:

13 messages 2011/07/18

[#385452] Ruby + USB + CCTV Camera Driver? — "Bob Carpenter." <rgc3679@...>

I want to write a Ruby driver that handles the feed from A CCTV camera.

23 messages 2011/07/18
[#385459] Re: Ruby + USB + CCTV Camera Driver? — William Rutiser <wruyahoo05@...> 2011/07/18

On 2011-07-18 1:00 PM, Bob Carpenter. wrote:

[#385461] Re: Ruby + USB + CCTV Camera Driver? — "Bob Carpenter." <rgc3679@...> 2011/07/18

William Rutiser wrote in post #1011466:

[#385462] Re: Ruby + USB + CCTV Camera Driver? — Hassan Schroeder <hassan.schroeder@...> 2011/07/18

On Mon, Jul 18, 2011 at 11:51 AM, Bob Carpenter. <rgc3679@yahoo.com> wrote:

[#385464] Re: Ruby + USB + CCTV Camera Driver? — "Bob Carpenter." <rgc3679@...> 2011/07/18

Hassan Schroeder wrote in post #1011472:

[#385471] Re: Ruby + USB + CCTV Camera Driver? — Hassan Schroeder <hassan.schroeder@...> 2011/07/18

On Mon, Jul 18, 2011 at 12:58 PM, Bob Carpenter. <rgc3679@yahoo.com> wrote:

[#385474] Re: Ruby + USB + CCTV Camera Driver? — Phillip Gawlowski <cmdjackryan@...> 2011/07/18

On Tue, Jul 19, 2011 at 12:18 AM, Hassan Schroeder

[#385477] Re: Ruby + USB + CCTV Camera Driver? — "Bob Carpenter." <rgc3679@...> 2011/07/19

Phillip Gawlowski wrote in post #1011503:

[#385509] A beginner question. — "Cajus A." <cajus_@...>

Hi i'm trying to write and example program where you speak to a

12 messages 2011/07/19

[#385542] Splitting strings — Ryan Mckenzie <ryan@...>

Hi all,

18 messages 2011/07/19

[#385565] error building ruby p290 — Dev Guy <devguy.ca@...>

I get the following build error on my Linux box while trying to build

12 messages 2011/07/20

[#385629] Are Job Ads OK? — Lee Hughes <lee@...>

Is it OK to post Ruby job ads on this forum?

12 messages 2011/07/21

[#385847] String manuplation example — kotin 76 <kotin76@...>

Hi,

15 messages 2011/07/27

[#385860] Counting lines of code in a ruby code file ignoring method code lines in the process — Harry Truax <htruax@...>

Hello,

8 messages 2011/07/27

[#385936] Help in Pointer — Tridib Bandopadhyay <tridib04@...>

Hello

18 messages 2011/07/29

[#386012] Ruby a "4th generation language"? Credible sources? — Albert Schlef <albertschlef@...>

I've noticed that Wikipedia says that "C#, Java" are 3'rd generation

13 messages 2011/07/31

[#386050] system stack error in ObjectSpace.each_object — luke gruber <luke.gru@...>

Hey guys, I'm just starting to mess around with metaprogramming in Ruby,

14 messages 2011/07/31
[#386052] Re: system stack error in ObjectSpace.each_object — Josh Cheek <josh.cheek@...> 2011/07/31

On Sun, Jul 31, 2011 at 4:29 PM, luke gruber <luke.gru@gmail.com> wrote:

[#386055] Re: system stack error in ObjectSpace.each_object — luke gruber <luke.gru@...> 2011/08/01

> Typically, SystemStackError is due to recursing for too long, perhaps I

[#386058] Re: system stack error in ObjectSpace.each_object — Robert Klemme <shortcutter@...> 2011/08/01

On Mon, Aug 1, 2011 at 3:56 AM, luke gruber <luke.gru@gmail.com> wrote:

Re: net-ssh - execution expired

From: Jean-Pascal Billaud <jp.billaud@...>
Date: 2011-07-22 04:28:32 UTC
List: ruby-talk #385653
Hey,

it seems I am getting the same kind of issue right now that seems to
happen randomly where one of my ssh.exec! call get stuck.

I ran with debug verbose and collected the following logs:

I, [2011-07-21T21:08:41.387471 #17018]  INFO --
net.ssh.connection.session[54acbcc]: channel_open_confirmation: 5 1 0
32768
I, [2011-07-21T21:08:41.387596 #17018]  INFO --
net.ssh.connection.channel[53efa28]: sending channel request "exec"
D, [2011-07-21T21:08:41.387805 #17018] DEBUG -- tcpsocket[5505212]:
queueing packet nr 22 type 98 len 44
D, [2011-07-21T21:08:41.387947 #17018] DEBUG -- tcpsocket[5505212]: sent
68 bytes
D, [2011-07-21T21:08:41.391034 #17018] DEBUG -- tcpsocket[5505212]: read
88 bytes
D, [2011-07-21T21:08:41.391278 #17018] DEBUG -- tcpsocket[5505212]:
received packet nr 39 type 93 len 28
I, [2011-07-21T21:08:41.391397 #17018]  INFO --
net.ssh.connection.session[54acbcc]: channel_window_adjust: 5 +2097152
D, [2011-07-21T21:08:41.391558 #17018] DEBUG -- tcpsocket[5505212]:
received packet nr 40 type 99 len 12
I, [2011-07-21T21:08:41.391650 #17018]  INFO --
net.ssh.connection.session[54acbcc]: channel_success: 5
D, [2011-07-21T21:08:41.418998 #17018] DEBUG -- tcpsocket[5505212]: read
36 bytes
D, [2011-07-21T21:08:41.419205 #17018] DEBUG -- tcpsocket[5505212]:
received packet nr 41 type 96 len 12
I, [2011-07-21T21:08:41.419302 #17018]  INFO --
net.ssh.connection.session[54acbcc]: channel_eof: 4
D, [2011-07-21T21:08:41.419501 #17018] DEBUG -- tcpsocket[5505212]: read
104 bytes
D, [2011-07-21T21:08:41.419699 #17018] DEBUG -- tcpsocket[5505212]:
received packet nr 42 type 98 len 44
I, [2011-07-21T21:08:41.419825 #17018]  INFO --
net.ssh.connection.session[54acbcc]: channel_request: 4 exit-signal
false
D, [2011-07-21T21:08:41.420041 #17018] DEBUG -- tcpsocket[5505212]:
received packet nr 43 type 97 len 12
I, [2011-07-21T21:08:41.420133 #17018]  INFO --
net.ssh.connection.session[54acbcc]: channel_close: 4
D, [2011-07-21T21:08:41.420344 #17018] DEBUG -- tcpsocket[5505212]:
queueing packet nr 23 type 97 len 28
D, [2011-07-21T21:08:41.420464 #17018] DEBUG -- tcpsocket[5505212]: read
140 bytes
D, [2011-07-21T21:08:41.420620 #17018] DEBUG -- tcpsocket[5505212]:
received packet nr 44 type 96 len 12
I, [2011-07-21T21:08:41.420711 #17018]  INFO --
net.ssh.connection.session[54acbcc]: channel_eof: 5
D, [2011-07-21T21:08:41.420886 #17018] DEBUG -- tcpsocket[5505212]:
received packet nr 45 type 98 len 44
I, [2011-07-21T21:08:41.421000 #17018]  INFO --
net.ssh.connection.session[54acbcc]: channel_request: 5 exit-status
false
D, [2011-07-21T21:08:41.421197 #17018] DEBUG -- tcpsocket[5505212]:
received packet nr 46 type 97 len 12
I, [2011-07-21T21:08:41.421289 #17018]  INFO --
net.ssh.connection.session[54acbcc]: channel_close: 5
D, [2011-07-21T21:08:41.421444 #17018] DEBUG -- tcpsocket[5505212]:
queueing packet nr 24 type 97 len 28

I don't see anything obviously wrong. The backtrace when I kill the app
is the following:

~/.gem/ruby/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:22:in
`select': Interrupt
        from
~/.gem/ruby/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/ruby_compat.rb:22:in
`io_select'
        from
~/.gem/ruby/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:201:in
`process'
        from
~/.gem/ruby/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:161:in
`block in loop'
        from
~/.gem/ruby/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:161:in
`loop'
        from
~/.gem/ruby/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:161:in
`loop'
        from
~/.gem/ruby/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/connection/channel.rb:269:in
`wait'
        from
~/.gem/ruby/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/connection/session.rb:355:in
`exec!'

The code is the following:

  mcast.each do |gaddr|
    STDERR.print "   [+] testing filtering for multicast address
(#{gaddr})"

    thleafiperf = Thread.new do
      ch = @sshleafvm.open_channel do |ch|
        ch.exec("iperf -s -u -B #{gaddr}") do |ch, success|
          raise "failed to launch iperf on multicast leaf vm" unless
success
        end
      end
      ch.wait
    end

    thleaftcpdump = Thread.new do
      ch = @sshleafvm.open_channel do |ch|
        ch[:result]

        ch.exec("tcpdump -i eth0 src host #{@vmrouterip} and dst host
#{gaddr} -c 1 -n -N") do |ch, success|
          raise "failed to launch tcpdump on multicast leaf vm" unless
success
        end

        ch.on_data do |ch, data|
          ch[:result] << data
        end
      end
      ch.wait
      ch[:result]
    end

    throuter = Thread.new do
      ch = @sshroutervm.open_channel do |ch|
        ch.exec("iperf -c #{gaddr} -u -T 32 -t 20 -i 1") do |ch,
success|
          raise "failed to launch iperf on multicast router vm" unless
success
        end
      end
      ch.wait
    end

    (1..60).each do
      sleep 1
      STDERR.print "."
    end
    puts ""

    puts "   [+] multicast leaf vm captured: #{thleaftcpdump.value}"
unless thleaftcpdump.alive?
    puts "   [+] multicast leaf vm did not capture anything" unless
!thleaftcpdump.alive?
    passed = (acl == "white-list") ? !thleaftcpdump.alive? :
thleaftcpdump.alive?

    if passed
      puts "   [+] multicast address (#{gaddr}) properly filtered"
    else
      puts "   [-] multicast address (#{gaddr}) filtering failed"
    end

    @sshleafvm.exec!("killall -9 iperf")
    @sshleafvm.exec!("killall -9 tcpdump")
    @sshroutervm.exec!("killall -9 iperf")
  end

It seems to get stuck around the killall commands after couple of
iterations. I did not let it run long enough but I am sure on the long
run I would get the execution expired issue mentioned above.

Thanks for the help,

-- 
Posted via http://www.ruby-forum.com/.

In This Thread

Prev Next