create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
| upstream rails_app_upstream { | |
| server unix:/home/deployer/projects/rails_app/shared/tmp/sockets/unicorn.socket fail_timeout=0; | |
| } | |
| server { | |
| #listen 80; ## listen for ipv4; this line is default and implied | |
| #listen [::]:80 default ipv6only=on; ## listen for ipv6 | |
| server_name localhost my_server.ru; | |
| root /home/deployer/projects/rails_app/current/public; |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
| <!-- ENTIRE PAGE --> | |
| <section class="sp-reviews-container"> | |
| <header class="sp-reviews-container-header">Отзывы покупателей о товаре "Карталин мазь 100 мл."</header> | |
| <!-- SUMMARY --> | |
| <section class="sp-summary"> | |
| <header class="sp-summary-header">Рейтинг покупателей</header> | |
| <!-- STATS --> | |
| <section class="sp-summary-stats"> |
| description "My Application" | |
| start on runlevel [2] | |
| stop on runlevel [016] | |
| console log | |
| setuid deployer | |
| chdir /home/deployer/my_app/current | |
| exec /home/deployer/my_app/current/config/unicorn/unicorn_wrapper -c /home/deployer/my_app/current/config/unicorn/unicorn.rb -E production |
| def resize_nocrop_noscale(image, w,h) | |
| w_original = image[:width].to_f | |
| h_original = image[:height].to_f | |
| if w_original < w && h_original < h | |
| return image | |
| end | |
| # resize | |
| image.resize("#{w}x#{h}") |
| require 'formula' | |
| class Nginx < Formula | |
| homepage 'http://nginx.org/' | |
| url 'http://nginx.org/download/nginx-1.2.8.tar.gz' | |
| sha1 'b8c193d841538c3c443d262a2ab815a9ce1faaf6' | |
| devel do | |
| url 'http://nginx.org/download/nginx-1.3.15.tar.gz' | |
| sha1 '16488c527078e26c32b0e467120501abf927fc8f' |
| # RAILS_ROOT/config/unicorn.rb | |
| # Search for "# SET ME!" and replace these with your own settings!. | |
| HOW_DEEP_WE_R_FROM_RAILS_ROOT = "../.." | |
| # Set environment to development unless something else is specified | |
| RAILS_ROOT = File.expand_path(HOW_DEEP_WE_R_FROM_RAILS_ROOT, File.dirname(__FILE__)) | |
| SHARED_PATH = File.expand_path('../shared', RAILS_ROOT) | |
| ENV['BUNDLE_GEMFILE'] = File.expand_path("#{HOW_DEEP_WE_R_FROM_RAILS_ROOT}/Gemfile", File.dirname(__FILE__)) |
| CREATE USER tom WITH PASSWORD 'myPassword'; | |
| CREATE DATABASE jerry; | |
| GRANT ALL PRIVILEGES ON DATABASE jerry to tom; |
| if Rails.env.development? | |
| module I18n | |
| class << self | |
| alias :translate_orig :translate | |
| def translate(*options) | |
| Rails.logger.debug options.inspect | |
| translate_orig *options | |
| end |
| class ModelName | |
| mount_uploader :image, PortfolioCatalogUploader, :mount_on => :image_file_name | |
| def pp_path(style = 'original') | |
| extension = File.extname(image_file_name) | |
| id_partition = ("%09d" % id).scan(/\d{3}/).join("/") | |
| "system/model_name/images/#{id_partition}/#{style}/#{id}#{extension}" | |
| end | |
| end |