<commit_before>class Scanner
  class << self
    def rate
      "2337" #restriction by the service provider is 4000/second
    end

    def rate_virt
      "1337"
    end

    def rate_cmd_virt
      " --rate " + rate_virt
    end

    def rate_cmd
      " --rate " + rate
    end

    def masscmd
      "/usr/local/sbin/masscan"
    end

    def mass scans
      scans.shuffle.each do |a|
        system(masscmd + " -c " + Directories.conf_dir + a + " --banners" + Directories.exclude_file_cmd)
      end    
    end



    def nmapcmd
    	"/usr/bin/nmap"
    end
    
    def nmap_options
    	" -sS -Pn -n --max-rate "+rate+" --open --randomize-hosts "
    	#" -sS -P0 -n -O --osscan-limit --version-light --max-rate "+rate+" --randomize-hosts --open --reason"
    end

    def nmap_virt_options
      " -Pn -n --max-rate "+rate_virt+" --open --randomize-hosts "
    end
    
    def nmap_input_file
    	" -iL " + Directories.data_dir
    end
    
    def nmap_flags
    	nmap_options+nmap_input_file
    end
    
    def nmap scans
      scans.shuffle.each do |a|
        system(nmapcmd + " -p " + Ports.all_ports + nmap_flags + a + Directories.exclude_file_cmd + " " + Directories.results_out + Naming.hostname + "_" + Options.prefix[1] + "_" + a.gsub(/.ip/, '') + Options.postfix[2])
      end
    end

    def nmap_virt_ip
      Socket.ip_address_list.detect{|intf| intf.ipv4? and !intf.ipv4_loopback? and !intf.ipv4_multicast? and !intf.ipv4_private?}.ip_address
    end

    def nmap_eth
      "venet0:0"
    end

    def nmap_virt_flags
      nmap_virt_options + " -e \""+nmap_eth+"\" -S "+nmap_virt_ip+nmap_input_file
    end

    def nmap_virt scans
      scans.shuffle.each do |a|
        system(nmapcmd + " -p " + Ports.all_ports + nmap_virt_flags + a + Directories.exclude_file_cmd + " " + Directories.results_out + Naming.hostname + "_" + Options.prefix[1] + "_" + a.gsub(/.ip/, '') + Options.postfix[2])
      end
    end    


<commit_msg>fix to virt<commit_after>class Scanner
  class << self
    def rate
      "2337" #restriction by the service provider is 4000/second
    end

    def rate_virt
      "1337"
    end

    def rate_cmd_virt
      " --rate " + rate_virt
    end

    def rate_cmd
      " --rate " + rate
    end

    def masscmd
      "/usr/local/sbin/masscan"
    end

    def mass scans
      scans.shuffle.each do |a|
        system(masscmd + " -c " + Directories.conf_dir + a + " --banners" + Directories.exclude_file_cmd)
      end    
    end



    def nmapcmd
    	"/usr/bin/nmap"
    end
    
    def nmap_options
    	" -sS -Pn -n --max-rate "+rate+" --open --randomize-hosts "
    	#" -sS -P0 -n -O --osscan-limit --version-light --max-rate "+rate+" --randomize-hosts --open --reason"
    end

    def nmap_virt_options
      " -Pn -n --max-rate "+rate_virt+" --open --randomize-hosts "
    end
    
    def nmap_input_file
    	" -iL " + Directories.data_dir
    end
    
    def nmap_flags
    	nmap_options+nmap_input_file
    end
    
    def nmap scans
      scans.shuffle.each do |a|
        system(nmapcmd + " -p " + Ports.all_ports + nmap_flags + a + Directories.exclude_file_cmd + " " + Directories.results_out + Naming.hostname + "_" + Options.prefix[1] + "_" + a.gsub(/.ip/, '') + Options.postfix[2])
      end
    end

    def nmap_virt_ip
      Socket.ip_address_list.detect{|intf| intf.ipv4? and !intf.ipv4_loopback? and !intf.ipv4_multicast? and !intf.ipv4_private?}.ip_address
    end

    def nmap_eth
      "venet0:0"
    end

    def nmap_virt_flags
      nmap_virt_options + " -e \""+nmap_eth+"\" -S "+nmap_virt_ip+nmap_input_file
    end

    def nmap_virt scans
      scans.shuffle.each do |a|
        system(nmapcmd + " -p " + Ports.all_ports + nmap_virt_flags + a + Directories.exclude_file_cmd + " " + Directories.results_out + Naming.hostname + "_" + Options.prefix[3] + "_" + a.gsub(/.ip/, '') + Options.postfix[2])
      end
    end    



{'fraction_non_alphanumeric': 0.12665985699693566, 'fraction_numerical': 0.01174668028600613, 'mean_word_length': 2.1161495624502784, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6292805', 'n_tokens_mistral': 1525, 'n_tokens_neox': 1457, 'n_words': 304}