<commit_before>#!/usr/bin/env ruby

require 'sinatra'
require 'sinatra/reloader'
require 'socket'

set :bind, '169.254.169.254'
set :port, '80'

get '/latest/meta-data/local-ipv4' do
    ipv4 = (Socket.ip_address_list.select {|a| a.ipv4_private? }).last
    ipv4.ip_address
end

get '/latest/meta-data/local-hostname' do
    `hostname`
end
<commit_msg>specifically exclude the Docker interface, which runs on 172.17.42.1<commit_after>#!/usr/bin/env ruby

require 'sinatra'
require 'sinatra/reloader'
require 'socket'

set :bind, '169.254.169.254'
set :port, '80'

get '/latest/meta-data/local-ipv4' do
    ipv4 = (Socket.ip_address_list.select {|a| a.ipv4_private? && a.ip_address != "172.17.42.1" }).last
    ipv4.ip_address
end

get '/latest/meta-data/local-hostname' do
    `hostname`
end

{'fraction_non_alphanumeric': 0.15656565656565657, 'fraction_numerical': 0.06565656565656566, 'mean_word_length': 4.083333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '5864880', 'n_tokens_mistral': 343, 'n_tokens_neox': 317, 'n_words': 68}