<commit_before>namespace :ci do
  desc "Spin up CI server on amazon"
  task :server_start do
    require 'fog'
    require 'yaml'
    require 'socket'

    aws_conf_location = File.join(Dir.pwd, 'config', 'ci.yml')
    aws_conf = YAML.load_file(aws_conf_location)
    aws_credentials = aws_conf['credentials']
    ec2_server_access = aws_conf['ec2_server_access']
    server_config = aws_conf['server']

    security_group_name = server_config['security_group']

    aws_connection = Fog::Compute.new(
      :provider => aws_credentials['provider'],
      :aws_access_key_id => aws_credentials['aws_access_key_id'],
      :aws_secret_access_key => aws_credentials['aws_secret_access_key']
    )

    security_group = aws_connection.security_groups.get(security_group_name)

    if security_group.nil?
      puts "Could not find security group named '#{security_group_name}'.  Creating..."
      security_group = aws_connection.security_groups.new(:name => security_group_name, :description => 'ci servers group auto-created by lobot')
      security_group.save
      security_group.reload
      p security_group
    end

    PORTS_TO_OPEN = [22, 443, 80]
    PORTS_TO_OPEN.each do |port|
      is_in_security_group = !!security_group.ip_permissions.detect{|group| (group['fromPort']..group['toPort']).include?(port) && group['ipRanges'].detect{|range| range["cidrIp"]== "0.0.0.0/0" } }
<commit_msg>Open up port 8111 for TeamCity<commit_after>namespace :ci do
  desc "Spin up CI server on amazon"
  task :server_start do
    require 'fog'
    require 'yaml'
    require 'socket'

    aws_conf_location = File.join(Dir.pwd, 'config', 'ci.yml')
    aws_conf = YAML.load_file(aws_conf_location)
    aws_credentials = aws_conf['credentials']
    ec2_server_access = aws_conf['ec2_server_access']
    server_config = aws_conf['server']

    security_group_name = server_config['security_group']

    aws_connection = Fog::Compute.new(
      :provider => aws_credentials['provider'],
      :aws_access_key_id => aws_credentials['aws_access_key_id'],
      :aws_secret_access_key => aws_credentials['aws_secret_access_key']
    )

    security_group = aws_connection.security_groups.get(security_group_name)

    if security_group.nil?
      puts "Could not find security group named '#{security_group_name}'.  Creating..."
      security_group = aws_connection.security_groups.new(:name => security_group_name, :description => 'ci servers group auto-created by lobot')
      security_group.save
      security_group.reload
      p security_group
    end

    PORTS_TO_OPEN = [22, 443, 80, 8111]
    PORTS_TO_OPEN.each do |port|
      is_in_security_group = !!security_group.ip_permissions.detect{|group| (group['fromPort']..group['toPort']).include?(port) && group['ipRanges'].detect{|range| range["cidrIp"]== "0.0.0.0/0" } }

{'fraction_non_alphanumeric': 0.12025540971975877, 'fraction_numerical': 0.012770485987938986, 'mean_word_length': 4.371428571428571, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3675291', 'n_tokens_mistral': 955, 'n_tokens_neox': 934, 'n_words': 170}