Version: 1.9.8
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
PATH_TO_RAILS_APP/log/*.log { | |
daily | |
missingok | |
rotate 30 | |
dateext | |
compress | |
delaycompress | |
notifempty | |
copytruncate | |
} |
require 'uri' | |
require 'net/http' | |
class Chunked | |
def initialize(data, chunk_size) | |
@size = chunk_size | |
if data.respond_to? :read | |
@file = data | |
end | |
end |
sudo apt-get install apache2 php5 php5-mysql libapache2-mod-php5 | |
# copy wordpress to /var/www | |
# OPTINAL: change apache user | |
# sudo gedit /etc/apache2/envvars | |
# change next: | |
# export APACHE_RUN_USER=your_user | |
# export APACHE_RUN_GROUP=your_gpoup | |
sudo gedit /etc/php5/apache2/php.ini |
require 'uri' | |
require 'net/http' | |
class Chunked | |
def initialize(data, chunk_size) | |
@size = chunk_size | |
if data.respond_to? :read | |
@file = data | |
end | |
end |
#put in lib/tasks/fixtures.rake | |
namespace :db do | |
namespace :fixtures do | |
desc 'Create YAML test fixtures from data in an existing database. | |
Defaults to development database. Set RAILS_ENV to override.' | |
task :dump => :environment do | |
sql = "SELECT * FROM %s" | |
skip_tables = ["schema_migrations"] | |
ActiveRecord::Base.establish_connection(:development) | |
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name| |
## in controller | |
# skip verify_authenticity_token when data from another server | |
skip_before_filter :verify_authenticity_token, :only => [:restore] | |
def restore | |
restore_session_from(params[:session_id]) | |
redirect_to '/' | |
end | |
## ApplicationController |
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
# Usage | |
# DJ config | |
require Rails.root.join('lib', 'dj_plugin.rb') | |
Delayed::Worker.plugins << Delayed::Plugins::EmailNotify | |
# lib/dj_plugin.rb | |
require 'exception_notification' |
=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') |