Skip to content

Instantly share code, notes, and snippets.

View nikolaifedorov's full-sized avatar

Nikolai Fedorov nikolaifedorov

View GitHub Profile
#!/usr/bin/env ruby
#
# Proof-of-Concept exploit for Rails DoS (CVE-2013-0156)
#
# ## Advisory
#
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion
#
# ## Synopsis
#
@nikolaifedorov
nikolaifedorov / request.rb
Created November 22, 2012 10:53 — forked from steved/request.rb
Eventmachine Deferrable example
require 'httparty'
require 'eventmachine'
class Request
include EM::Deferrable
@@requests = []
attr_reader :method, :params
@nikolaifedorov
nikolaifedorov / sample_ruby_webserver.rb
Created November 22, 2012 10:50 — forked from dcparker/sample_ruby_webserver.rb
Mini Ruby web server example!
require 'socket'
socket = TCPServer.new('0.0.0.0', '8080')
socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, 1)
loop do
client = socket.accept
data = ''
loop do
event = select([client],nil,nil,0.5)
if client.eof? # Socket's been closed by the client
@nikolaifedorov
nikolaifedorov / capybara cheat sheet
Created October 9, 2012 17:13 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@nikolaifedorov
nikolaifedorov / method_logger.rb
Created October 5, 2012 12:36 — forked from nhance/method_logger.rb
Rails compatible method logging. Use this to log all calls to instance methods of a class to the log.
Model.new.foo