This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'zeus/rails' | |
class CustomPlan < Zeus::Rails | |
def rspec | |
RSpec::Core::Runner.disable_autorun! | |
exit RSpec::Core::Runner.run(ARGV) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :attachments do | |
task :migrate_to_s3 => :environment do | |
require 'aws/s3' | |
# Load credentials | |
s3_options = YAML.load_file(File.join(Rails.root, 'config/s3.yml')).symbolize_keys | |
bucket = s3_options[:bucket_name] | |
# Establish S3 connection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CopyIndexes | |
extend ActiveSupport::Concern | |
included do | |
include Tire::Model::Search | |
include Tire::Model::Callbacks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo < ActiveRecord::Base | |
has_many :bars | |
belongs_to :baz | |
include IndexingHandler | |
indexed_associations :bars, :baz | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Errno::ECONNRESET: Connection reset by peer | |
/home/deploy/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/openssl/buffering.rb:174→ sysread_nonblock | |
/home/deploy/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/openssl/buffering.rb:174→ read_nonblock | |
/home/deploy/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/protocol.rb:141→ rbuf_fill | |
/home/deploy/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/protocol.rb:122→ readuntil | |
/home/deploy/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/protocol.rb:132→ readline | |
/home/deploy/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:2562→ read_status_line | |
/home/deploy/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:2551→ read_new | |
/home/deploy/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:1319→ block in transport_request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:typens="urn:AllegroWebApi" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="urn:AllegroWebApi"><env:Body><typens:doNewAuctionExt><session-handle>{{{KLUCZ SESJI WYCIETY}}}/session-handle><fields><fields><fid>5</fid><fvalue-string></fvalue-string><fvalue-int>1</fvalue-int><fvalue-float>0</fvalue-float><fvalue-image> </fvalue-image><fvalue-datetime>0</fvalue-datetime><fvalue-boolean>false</fvalue-boolean></fields><fields><fid>2</fid><fvalue-string></fvalue-string><fvalue-int>90539</fvalue-int><fvalue-float>0</fvalue-float><fvalue-image> </fvalue-image><fvalue-datetime>0</fvalue-datetime><fvalue-boolean>false</fvalue-boolean></fields><fields><fid>9</fid><fvalue-string></fvalue-string><fvalue-int>1</fvalue-int><fvalue-float>0</fvalue-float><fvalue-image> </fvalue-image><fvalue-datetime>0</fvalue-datetime><fvalue-boolean>false</fvalue-boolean>< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "nginx http daemon" | |
start on runlevel [2] | |
stop on runlevel [016] | |
console owner | |
exec /opt/nginx/sbin/nginx -c /opt/nginx/conf/nginx.conf -g "daemon off;" | |
respawn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env jruby | |
# Usage: | |
# Save this file to /usr/local/bin/copy-to-s3.rb | |
# You'll want to chmod +x this file to use it on the command line (Linux/OS X: chmod +x /usr/local/bin/copy-to-s3.rb) | |
# If you're having trouble using JRuby, check out RVM (https://rvm.io/) | |
# Install the fog gem: gem install fog (after running rvm use jruby, if required) | |
# This only works if the environment variable JRUBY_OPTS=--1.8. e.g.: export JRUBY_OPTS=--1.8 (Linux/OS X) | |
# You'll have to edit the options in the file at the top to match your S3 settings. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Antykwariusz | |
module_function | |
def fog | |
unless Thread.current[:fog] | |
opts = { | |
provider: 'AWS', | |
aws_access_key_id: S3_KEY, | |
aws_secret_access_key: S3_SECRET, | |
endpoint: "http://#{S3_ENDPOINT}/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From a fresh install of squeeze | |
apt-get install ruby rubygems # Need ruby to use fpm | |
gem1.8 install fpm --no-ri --no-rdoc | |
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar -zxvf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125 | |
rm -rf /tmp/ruby193 |