<commit_before>module Vagrant
  module Action
    module VM
      # This middleware enforces some sane defaults on the virtualbox
      # VM which help with performance, stability, and in some cases
      # behavior.
      class SaneDefaults
        def initialize(app, env)
          @app = app
        end

        def call(env)
          # Enable the host IO cache on the sata controller. Note that
          # if this fails then its not a big deal, so we don't raise any
          # errors. The Host IO cache vastly improves disk IO performance
          # for VMs.
          command = [
            "storagectl", env[:vm].uuid,
            "--name", "SATA Controller",
            "--hostiocache", "on"
          ]
          env[:vm].driver.execute_command(command)

          @app.call(env)
        end
      end
    end
  end
end
<commit_msg>Enable DNS proxy (in NAT mode) by default<commit_after>module Vagrant
  module Action
    module VM
      # This middleware enforces some sane defaults on the virtualbox
      # VM which help with performance, stability, and in some cases
      # behavior.
      class SaneDefaults
        def initialize(app, env)
          @app = app
        end

        def call(env)
          # Enable the host IO cache on the sata controller. Note that
          # if this fails then its not a big deal, so we don't raise any
          # errors. The Host IO cache vastly improves disk IO performance
          # for VMs.
          command = [
            "storagectl", env[:vm].uuid,
            "--name", "SATA Controller",
            "--hostiocache", "on"
          ]
          env[:vm].driver.execute_command(command)

          # Enable the DNS proxy while in NAT mode.  This shields the guest
          # VM from external DNS changs on the host machine.
          command = [
            "modifyvm", env[:vm].uuid,
            "--natdnsproxy1", "on"
          ]
          env[:vm].driver.execute_command(command)

          @app.call(env)
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.07661888284725656, 'fraction_numerical': 0.0004943153732081067, 'mean_word_length': 1.7022696929238985, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4611255', 'n_tokens_mistral': 549, 'n_tokens_neox': 529, 'n_words': 210}