Skip to content

Instantly share code, notes, and snippets.

View kiote's full-sized avatar
👋

Ёkaterina Krivich kiote

👋
View GitHub Profile
resources :campaigns, only: [:index, :update] do
resources :banners
resources :phrases do
member do
get 'statistics'
end
end
end
end
#!/bin/bash
source ~/.bash_profile
cd /var/lib/jenkins/jobs/SEOTracker/workspace/
rvm 1.9.3
bundle install --without development test
RAILS_ENV=staging rspec spec
server 'domain.ru', :app, :web, :db, :primary => true
set :deploy_to, "/home/www/domain"
set :rails_env, "staging"
set :user, "apps"
set :unicorn_conf, "#{deploy_to}/current/config/unicorn_staging.rb"
set :unicorn_pid, "#{deploy_to}/shared/pids/unicorn.pid"
set :shared_path, "#{deploy_to}/shared"
namespace :deploy do
task :restart do
run "if [ -f #{unicorn_pid} ]; then kill -USR2 `cat #{unicorn_pid}`; else cd #{deploy_to}/current && bundle exec unicorn_rails -c #{unicorn_conf} -E #{rails_env} -D; fi"
end
task :start do
run "bundle exec unicorn_rails -c #{unicorn_conf} -E #{rails_env} -D"
end
task :stop do
set :stages, %w(production staging)
set :default_stage, "staging"
require 'capistrano/ext/multistage'
set :application, "application_name"
set :repository, "git@your_path_to_git.git"
set :scm, :git
set :keep_releases, 5
deploy_to = "/home/www/domain"
rails_root = "#{deploy_to}/current"
pid_file = "#{deploy_to}/shared/pids/unicorn.pid"
log_file = "#{rails_root}/log/unicorn.log"
err_log = "#{rails_root}/log/unicorn_error.log"
old_pid = pid_file + '.oldbin'
listen "/home/www/domain/tmp/sockets/unicorn.sock", :backlog => 64
timeout 30
upstream domain {
server unix:/home/www/domain/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name domain.ru www.domain.ru;
access_log /var/log/domain.ru/nginx-access.log;
error_log /var/log/domain.ru/nginx-error.log;
client_max_body_size 1G;
apps@vs1191219:/srv/www$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
libc-dev-bin : Depends: libc6 (> 2.13) but 2.11.2-10 is installed
libc6 : Depends: libc-bin (= 2.11.2-10) but 2.13-21 is installed
libc6-dev : Depends: libc-dev-bin (= 2.11.2-10) but 2.13-21 is installed
libstdc++6-4.4-dev : Depends: libc6-dev (>= 2.13-5) but 2.11.2-10 is installed
/// было
$select = $table->select()
->where('parent_id = ?', $this->_post->getId())
->order('time');
$repliesXml = '';
foreach ($select->fetchAll() as $item) {
$repliesXml .= $item->getFullXml();
}
formatter = PdfFormatter.new
g = Generator.new(formatter, 'title', 'my long and interesting text')
g.make_report