<commit_before>class Update
  include October::Plugin

  match /selfupdate$/, method: :selfupdate
  match /seppuku$/, method: :seppuku

  def selfupdate(m)
    m.reply "starting selfupdate..."
    `git fetch origin`
    `git reset --hard origin/master`
    m.reply "selfupdate completed!"
  end

  def seppuku(m)
    m.reply("bye... AGRG!! ahh...")
    sleep(1)
    exit(0)
  end
end<commit_msg>added commands to remotely execute commands<commit_after>class Update
  include October::Plugin

  match /selfupdate$/, method: :selfupdate
  match /seppuku$/, method: :seppuku
  match /spawn (.+)$/, method: :spawn
  match /kill (-9 )?(.+)$/, method: :kill
  match /running$/, method: :running

  $SPAWNS = []

  def selfupdate(m)
    m.reply "starting selfupdate..."
    `git fetch origin`
    `git reset --hard origin/master`
    m.reply "selfupdate completed!"
  end

  def seppuku(m)
    m.reply("bye... AGRG!! ahh...")
    sleep(1)
    exit(0)
  end

  def running(m)
    m.reply "running processes: #{$SPAWNS.join(", ")}"
  end

  def kill(m, kill, pid)
    pid = pid.to_i

    signal = kill ? 'KILL' : 'TERM'
    Process.kill(signal, pid)
    m.reply "sent #{signal} to process #{pid}"
  end

  def spawn(m, command)
    pid = Process.spawn(command)

    $SPAWNS.push pid
    m.reply "spawned command '#{command}' with pid #{pid}"

    Thread.new do
      Process.wait(pid)
      $SPAWNS.delete(pid)
      m.reply "process #{pid} exited with status #{$?.exitstatus}"
    end
  end

end
{'fraction_non_alphanumeric': 0.15198386012104909, 'fraction_numerical': 0.0033624747814391394, 'mean_word_length': 2.8056265984654734, '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': '64276', 'n_tokens_mistral': 543, 'n_tokens_neox': 519, 'n_words': 145}