#Rails with Rspec, Capybara (with selenium driver), FactoryGirl #
rails new my_app -T --skip-bundle
Use TCPDUMP to Monitor HTTP Traffic | |
1. To monitor HTTP traffic including request and response headers and message body: | |
tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | |
2. To monitor HTTP traffic including request and response headers and message body from a particular source: | |
tcpdump -A -s 0 'src example.com and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | |
3. To monitor HTTP traffic including request and response headers and message body from local host to local host: |
require "amqp" | |
EventMachine.run do | |
connection = AMQP.connect | |
channel = AMQP::Channel.new(connection) | |
replies_queue = channel.queue("citizen40.install.app.acknowledge", :exclusive => true, :auto_delete => true) | |
replies_queue.subscribe do |metadata, payload| | |
puts "[response] Response for #{metadata.correlation_id}: #{payload.inspect}" | |
# if payload[:success] == true |
require "amqp" | |
EventMachine.run do | |
connection = AMQP.connect | |
channel = AMQP::Channel.new(connection) | |
requests_queue = channel.queue("citizen40.install.app", :exclusive => true, :auto_delete => true) | |
requests_queue.subscribe(:ack => true) do |metadata, payload| | |
puts "[requests] Got a request #{metadata.message_id}. Sending a reply..." | |
# codes that will install the softwares. |
source :rubygems | |
# We are not loading Active Record, nor Active Resources etc. | |
# We can do this in any app by simply replacing the rails gem | |
# by the parts we want to use. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
gem "tzinfo" | |
# Let's use thin |
require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8 | |
def unbundled_require(gem) | |
loaded = false | |
if defined?(::Bundler) | |
Gem.path.each do |gems_path| | |
gem_path = Dir.glob("#{gems_path}/gems/#{gem}*").last |
{ | |
"use_simple_full_screen": false, | |
// calculates indentation automatically when pressing enter | |
"auto_indent": true, | |
// sets the colors used within the text area (default) | |
// see https://github.com/olivierlacan/monokaim to download | |
// the customized Monokai I use. | |
"color_scheme": "Packages/Color Scheme - Default/Monokaim.tmTheme", |
[user] | |
name = your_username | |
email = [email protected] | |
[github] | |
user = github_username | |
token = github_your_own_token | |
[core] | |
#Global .gitignore file | |
excludesfile = /Users/millisami/.gitignore | |
editor = mate -w |