Skip to content

Instantly share code, notes, and snippets.

View almaron's full-sized avatar

Ilya Levin almaron

View GitHub Profile
@almaron
almaron / gist:2478651
Created April 24, 2012 10:29
application.css.scss
/*
*= require_self
*/
@import "base";
@import "style";
@import "forms";
@import "custom_forms";
@import "pages";
@import "news";
@almaron
almaron / gist:2536711
Created April 29, 2012 06:46
deploying to server
* executing "cp -RPp /home/rails/www/temple/shared/cached-copy /home/rails/www/temple/releases/20120429064156 && (echo cfa092eb5a5aca7c966caa3ae114a32df3f4b1d9 > /home/rails/www/temple/releases/20120429064156/REVISION)"
servers: ["62.76.187.195"]
[62.76.187.195] executing command
** [out :: 62.76.187.195] cp: cannot create directory `/home/rails/www/temple/releases/20120429064156': No such file or directory
command finished in 71ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/rails/www/temple/releases/20120429064156; true"
servers: ["62.76.187.195"]
[62.76.187.195] executing command
command finished in 56ms
@almaron
almaron / gist:2537030
Created April 29, 2012 06:52
cap deploy:setup
* executing `deploy:setup'
* executing "mkdir -p /home/rails/www/temple /home/rails/www/temple/releases /home/rails/www/temple/shared /home/rails/www/temple/shared/system /home/rails/www/temple/shared/log /home/rails/www/temple/shared/pids"
servers: ["62.76.187.195"]
[62.76.187.195] executing command
** [out :: 62.76.187.195] Gemset 'temple' does not exist, 'rvm gemset create temple' first, or append '--create'.
** [out :: 62.76.187.195] Error: RVM was unable to use '1.9.3@temple'
command finished in 722ms
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.3@temple' -c 'mkdir -p /home/rails/www/temple /home/rails/www/temple/releases /home/rails/www/temple/shared /home/rails/www/temple/shared/system /home/rails/www/temple/shared/log /home/rails/www/temple/shared/pids'" on 62.76.187.195
@almaron
almaron / gist:2549332
Created April 29, 2012 10:50
permissions
#www/temple - application folder
lrwxrwxrwx 1 rails rails 46 Апр 29 10:45 current -> /home/rails/www/temple/releases/20120429104355
drwxrwxr-x 3 rails rails 4096 Апр 29 10:43 releases
drwxrwxr-x 9 rails rails 4096 Апр 29 10:44 shared
#www/temple/current
drwxrwxr-x 8 rails rails 4096 Апр 29 10:43 app
drwxrwxr-x 2 rails rails 4096 Апр 29 10:44 .bundle
-rw-rw-r-- 1 rails rails 263 Апр 29 10:43 Capfile
drwxrwxr-x 5 rails rails 4096 Апр 29 10:44 config
@almaron
almaron / gist:2549336
Created April 29, 2012 10:51
user groups
$ id -nG rails
rails apache
$ id -nG apache
apache rails
<VirtualHost *:80>
ServerName frpgame.ru
ServerAlias www.frpgame.ru
DocumentRoot /home/rails/www/temple/current/public
<Directory /home/rails/www/temple/current/public>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
lrwxrwxrwx 1 rails apache 46 Апр 29 13:07 current -> /home/rails/www/temple/releases/20120429130622
drwxrwxr-x 3 rails apache 4,0K Апр 29 13:06 releases
drwxrwxr-x 9 rails apache 4,0K Апр 29 13:06 shared
[Sun Apr 29 16:08:16 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Apr 29 16:08:17 2012] [notice] Digest: generating secret for digest authentication ...
[Sun Apr 29 16:08:17 2012] [notice] Digest: done
[Sun Apr 29 16:08:17 2012] [notice] Apache/2.2.17 (Unix) DAV/2 Phusion_Passenger/3.0.12 PHP/5.3.8 configured -- resuming normal operations
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<div><%= f.label :name %>: <%= f.text_field :name , :class => 'input_text'%></div>
<div><%= f.label :email %>: <%= f.email_field :email, :class => 'input_text' %></div>
<div><%= f.label :password %>: <%= f.password_field :password, :class => 'input_text'%></div>
<div><%= f.label :password_confirmation %>: <%= f.password_field :password_confirmation, :class => 'input_text' %></div>
<div><%= f.submit t('common.buttons.register'), :class => 'input_ok' %></div>
<% end %>
<form method="post" id="new_user" class="new_user" action="/" accept-charset="UTF-8"><div style="margin:0;padding:0;display:inline"><input type="hidden" value="✓" name="utf8"><input type="hidden" value="YDCn5k0O698sJGoDQqJHGVdCu9vztkZCOQQHMoUs0BE=" name="authenticity_token"></div>
<div><div class="field_with_errors"><label for="user_name">Имя пользователя</label></div>: <div class="field_with_errors"><input type="text" value="User" size="30" name="user[name]" id="user_name" class="input_text"></div></div>
<div><div class="field_with_errors"><label for="user_email">Email адрес</label></div>: <div class="field_with_errors"><input type="email" value="almaron@gmail.com" size="30" name="user[email]" id="user_email" class="input_text"></div></div>
<div><div class="field_with_errors"><label for="user_password">Пароль</label></div>: <div class="field_with_errors"><input type="password" size="30" name="user[password]" id="user_password" class="input_text"></div></div>
<div><label for="user_password_confirmatio