Skip to content

Instantly share code, notes, and snippets.

@ewalk153
Last active December 16, 2015 00:09
Show Gist options
  • Save ewalk153/5345332 to your computer and use it in GitHub Desktop.
Save ewalk153/5345332 to your computer and use it in GitHub Desktop.
quick script to accept post data
require 'rubygems'
require './post'
run Sinatra::Application
require 'rubygems'
require 'sinatra'
require 'yaml'
set :port, 3000
# can't figure out how to get rid of W, [2013-04-09T14:27:48.512008 #35453] WARN -- : attack prevented by Rack::Protection::HttpOrigin
#set :protection, :except => :all
post '/{:path}' do
puts "Request to #{params[:path]}"
puts "Data: #{YAML.dump params}"
end
sudo yum update -y
sudo yum install -y ruby-devel ruby-rdoc
echo "gem: --no-ri --no-rdoc" | sudo tee -a /root/.gemrc
curl http://production.cf.rubygems.org/rubygems/rubygems-2.0.3.tgz | tar -xz
cd rubygems-2.0.3
sudo ruby setup.rb
sudo gem install sinatra rack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment