<commit_before>module ZTK
  class SSH

    # SSH Console Command Helpers
    module Command

      # Builds our SSH console command.
      def console_command
        verbosity = ((ENV['LOG_LEVEL'] == "DEBUG") ? '-vv' : '-q')

        command = Array.new
        command << [ %(sshpass -p '#{config.password}') ] if config.password
        command << [ %(ssh) ]
        command << [ verbosity ]
        command << [ "-x" ]
        command << [ "-a" ]
        command << [ "-o", "UserKnownHostsFile=/dev/null" ]
        command << [ "-o", "StrictHostKeyChecking=no" ]
        command << [ "-o", "KeepAlive=yes" ]
        command << [ "-o", "ServerAliveInterval=60" ]
        command << [ "-o", %(ProxyCommand="#{proxy_command}") ] if config.proxy_host_name
        command << [ "-i", config.keys ] if config.keys
        command << [ "-p", config.port ] if config.port
        command << "#{config.user}@#{config.host_name}"
        command = command.flatten.compact.join(' ')
        config.ui.logger.debug { "console_command(#{command.inspect})" }
        command
      end

      # Builds our SSH proxy command.
      def proxy_command
        !config.proxy_user and log_and_raise(SSHError, "You must specify an proxy user in order to SSH proxy.")
        !config.proxy_host_name and log_and_raise(SSHError, "You must specify an proxy host_name in order to SSH proxy.")

        verbosity = ((ENV['LOG_LEVEL'] == "DEBUG") ? '-vv' : '-q')

        command = Array.new
        command << [ %(sshpass -p '#{config.proxy_password}') ] if config.proxy_password
        command << [ %(ssh) ]
        command << [ verbosity ]
        command << [ "-x" ]
        command << [ "-a" ]
        command << [ "-o", "UserKnownHostsFile=/dev/null" ]
        command << [ "-o", "StrictHostKeyChecking=no" ]
        command << [ "-o", "KeepAlive=yes" ]
        command << [ "-o", "ServerAliveInterval=60" ]
        command << [ "-i", config.proxy_keys ] if config.proxy_keys
        command << [ "-p", config.proxy_port ] if config.proxy_port
        command << "#{config.proxy_user}@#{config.proxy_host_name}"
        command << "'/usr/bin/env nc %h %p'"<commit_msg>do not use sshpass for now; it is complicating matters to the extreme<commit_after>module ZTK
  class SSH

    # SSH Console Command Helpers
    module Command

      # Builds our SSH console command.
      def console_command
        verbosity = ((ENV['LOG_LEVEL'] == "DEBUG") ? '-vv' : '-q')

        command = Array.new
        # command << [ %(sshpass -p '#{config.password}') ] if config.password
        command << [ %(ssh) ]
        command << [ verbosity ]
        command << [ "-x" ]
        command << [ "-a" ]
        command << [ "-o", "UserKnownHostsFile=/dev/null" ]
        command << [ "-o", "StrictHostKeyChecking=no" ]
        command << [ "-o", "KeepAlive=yes" ]
        command << [ "-o", "ServerAliveInterval=60" ]
        command << [ "-o", %(ProxyCommand="#{proxy_command}") ] if config.proxy_host_name
        command << [ "-i", config.keys ] if config.keys
        command << [ "-p", config.port ] if config.port
        command << "#{config.user}@#{config.host_name}"
        command = command.flatten.compact.join(' ')
        config.ui.logger.debug { "console_command(#{command.inspect})" }
        command
      end

      # Builds our SSH proxy command.
      def proxy_command
        !config.proxy_user and log_and_raise(SSHError, "You must specify an proxy user in order to SSH proxy.")
        !config.proxy_host_name and log_and_raise(SSHError, "You must specify an proxy host_name in order to SSH proxy.")

        verbosity = ((ENV['LOG_LEVEL'] == "DEBUG") ? '-vv' : '-q')

        command = Array.new
        # command << [ %(sshpass -p '#{config.proxy_password}') ] if config.proxy_password
        command << [ %(ssh) ]
        command << [ verbosity ]
        command << [ "-x" ]
        command << [ "-a" ]
        command << [ "-o", "UserKnownHostsFile=/dev/null" ]
        command << [ "-o", "StrictHostKeyChecking=no" ]
        command << [ "-o", "KeepAlive=yes" ]
        command << [ "-o", "ServerAliveInterval=60" ]
        command << [ "-i", config.proxy_keys ] if config.proxy_keys
        command << [ "-p", config.proxy_port ] if config.proxy_port
        command << "#{config.proxy_user}@#{config.proxy_host_name}"
        command << "'/usr/bin/env nc %h %p'"
{'fraction_non_alphanumeric': 0.1647571035747021, 'fraction_numerical': 0.0018331805682859762, 'mean_word_length': 2.402182385035074, 'pattern_counts': {'":': 0, '<': 107, '<?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': '1513075', 'n_tokens_mistral': 1377, 'n_tokens_neox': 1333, 'n_words': 327}