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

require 'webrick'
require 'webrick/https'
require 'openssl'


pkey = cert = cert_name = nil
begin
  pkey =
OpenSSL::PKey::RSA.new(File.open("/etc/apache2/ssl/host.key").read)
  cert =
OpenSSL::X509::Certificate.new(File.open("/etc/apache2/ssl/host.key").read)
rescue
  $stderr.puts "Switching to use self-signed certificate"
  cert_name = [ ["C","JP"], ["O","WEBrick.Org"], ["CN", "WWW"] ]
end

s = WEBrick::HTTPServer.new(
  :Port             => 2000, 
  :DocumentRoot     => ".",
  :SSLEnable        => true,
  :SSLVerifyClient  => OpenSSL::SSL::VERIFY_NONE,
  :SSLCertificate   => cert,
  :SSLPrivateKey    => pkey,
  :SSLCertName      => cert_name
)
trap('INT') { s.stop }
s.start<commit_msg>Adding a small webrick server script to host JS that can be injected into the Stripe admin back end<commit_after>#!/user/bin/env ruby

require 'webrick'
require 'webrick/https'
require 'openssl'

cert_name = [
  %w[CN localhost],
]

s = WEBrick::HTTPServer.new(
  :Port             => 2000, 
  :DocumentRoot     => ".",
  :SSLEnable        => true,
  :SSLVerifyClient  => OpenSSL::SSL::VERIFY_NONE,
  :SSLCertName      => cert_name
)
trap('INT') { s.stop }
s.start
{'fraction_non_alphanumeric': 0.16541353383458646, 'fraction_numerical': 0.01086048454469507, 'mean_word_length': 3.537878787878788, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5747878', 'n_tokens_mistral': 470, 'n_tokens_neox': 442, 'n_words': 90}