Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Small script to scan my home network
Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Small script to scan my home network

Hybrid View

  1. #1
    Guest

    Small script to scan my home network

    Code:
    #!/usr/bin/env ruby
    
    require 'ping'
    
    # On crée un tableau avec la liste des addresses a pinger
    HOSTS = %w( 192.168.1.1 192.168.1.7 192.168.1.8 192.168.1.9 )
    TIME_OK=1
    machine_on=0
    
    # On va scanner toutes les addresses dans le tableau HOSTS
    for i in HOSTS do
     # Vérifier si l'adresse répond
     if Ping.pingecho(i, TIME_OK)
      print "#{i} est vivant\n"
      machine_on=machine_on+1
     else
      print "#{i} est mort\n"
     end
    end
    
    
    # Dire combien de machine sur le réseau sont en fonction
    puts "=================="
    print machine_on, " sont en fonction\n"
    This will ping every machine in the array HOSTS and if they reply within one second, my program says they are alive.

  2. #2

    Re: Small script to scan my home network

    Bien facile. Bon travail.

  3. #3

    Re: Small script to scan my home network

    1. Is there any particular reason that your variable names are all english, but your comments are all french? Je deteste le French

    2. Wouldn't it just be easier to use nmap? ;D

  4. #4
    Guest

    Re: Small script to scan my home network


    1. Is there any particular reason that your variable names are all english, but your comments are all french? Je deteste le French

    2. Wouldn't it just be easier to use nmap? ;D
    1. Comments are for me. But people can understand my variables
    2. Bah, doing it something yourself is a lot of fun

  5. #5

    Re: Small script to scan my home network

    1. Comments are for me. But people can understand my variables
    That's an interesting thought process you have: You need comments to help yourself (the person that coded it), but everybody else will just be able to figure it out by the variable names.

    Please, don't code any big projects with this thinking in mind... at least, nothing I'd want to work on

    2. Bah, doing it something yourself is a lot of fun
    I know, I'm just bugging you. ;D

  6. #6
    Guest

    Re: Small script to scan my home network




    That's an interesting thought process you have: You need comments to help yourself (the person that coded it), but everybody else will just be able to figure it out by the variable names.

    Please, don't code any big projects with this thinking in mind... at least, nothing I'd want to work on
    Hey! Ma ben faire ce que je veux! And if people want to look at my source they need to do what I've been doing every day of my life for the 6 past years: french and english.

  7. #7

    Re: Small script to scan my home network

    Uh, well that's not very open-source-like, if you ask me. Anybody who hacks on software you've written will have to read french and english. What kind of restriction is that?? It certainly wouldn't qualify as open source

  8. #8

    Re: Small script to scan my home network


    Uh, well that's not very open-source-like, if you ask me. Anybody who hacks on software you've written will have to read french and english. What kind of restriction is that?? It certainly wouldn't qualify as open source
    Quit being prejudiced. French is cool. It's not like he commented it in Canadian English or anything. That would be annoying, eh?

  9. #9

    Re: Small script to scan my home network

    Quit being prejudiced.
    I'm just having fun, I'm not prejudiced.

    French is cool.
    No.

    It's not like he commented it in Canadian English or anything. That would be annoying, eh?
    Yeah; Canadian English is so hard to read, what with all those correctly-spelled words like colour, labour, and neighbour, eh?

  10. #10

    Re: Small script to scan my home network

    Well all those extra -our words, it looks like you tried to copy French.

Similar Threads

  1. Home Network Help
    By tjwill in forum Linux - Hardware, Networking & Security
    Replies: 5
    Last Post: 04-12-2011, 03:32 PM
  2. a firewall for small network
    By Frederic09 in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 10-26-2009, 05:26 AM
  3. Need help w/home network
    By juanpedro in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 08-15-2008, 05:52 AM
  4. A small network in a lab
    By Anonymous in forum Linux - General Topics
    Replies: 2
    Last Post: 05-29-2004, 11:34 PM
  5. Linux Virus Scan for NT Network?
    By Pleiades in forum Linux - Hardware, Networking & Security
    Replies: 5
    Last Post: 12-07-2001, 02:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •