вторник, 29 октября 2013 г.

Configure Passenger + Nginx + RoR



Under sudo user:

sudo apt-get update

To install RVM, open terminal and type in this command:
curl -L get.rvm.io | bash -s stable

After it is done installing, load RVM.
source ~/.rvm/scripts/rvm

In order to work, RVM has some of its own dependancies that need to be installed. You can see what these are:
rvm requirements

rvm install 1.9.3

rvm use 1.9.3 --default
 rvm rubygems current
gem install passenger 

sudo apt-get install libcurl4-openssl-dev


Here is where Passenger really shines. As we are looking to install Rails on an nginx server, we only need to enter one more line into terminal:

rvmsudo passenger-install-nginx-module

sudo service nginx start

Also can use this script for init.d service

wget -O init-deb.sh http://library.linode.com/assets/660-init-deb.sh
sudo mv init-deb.sh /etc/init.d/nginx

sudo chmod +x /etc/init.d/nginx

sudo /usr/sbin/update-rc.d -f nginx defaults


after that you can control nginx with

sudo /etc/init.d/nginx stop

sudo /etc/init.d/nginx start

sudo /etc/init.d/nginx restart





пятница, 19 апреля 2013 г.

skype + ubuntu + system tray + unity

Если скайп не показывается в трее в убунте под оболочкой юнити нужно проделать следующее (инфа с аскубунту):

1. Install the sni-qt libraries.

Install sni-qt Install banshee (click on the link), or with sudo apt-get install sni-qt sni-qt:i386 from the terminal, and then restart Skype. The tray/panel icon should now be back!
The reason this step is required is because sni-qt is installed automatically by the Ubuntu repository Skype package, but NOT by the Skype deb you directly download. Once Skype 4.0 is in the Ubuntu repos, you can install from there and this will no longer be necessary.

2. You may also need to whitelist the indicator

We don't know why, but for some systems this additional step is required before the indicator will show (thanks to Bruno Pereira!)
Steps:
  1. Install the package dconf-toolsInstall dconf-tools (click on the link), or from the terminal with sudo apt-get install dconf-tools
  2. Open dconf editor from the Dash (or dconf-editor from terminal):
    enter image description here
  3. On the left sidebar, use the triangles to navigate to desktop > unity > panel. On Ubuntu 12.10 you instead need to navigate to com > canonical > unity > panel. Double-click on the orange[JavaEmbedded...] part on the right, and add ,'skype' to allow the Skype indicator to show, as below:
    enter image description here
  4. Press Enter, close dconf editor, logout and login -- your indicator should now be back!

вторник, 5 марта 2013 г.

rails + backbone.js + haml templates

Если вы используете gem 'backbone-on-rails' и не хотите смотреть ужасные темплейты "eco" и до боли привыкли к хамлу..
Используем гем https://github.com/netzpirat/haml_coffee_assets
После его установки можно использовать файлы с расширением jst.hamlc и нашей любимой разметкой.

среда, 28 ноября 2012 г.

!!! XML не добавляет строку

Рельсы 3 по дефолту используют HTML5 как DOCTYPE. Создаем инициализатор и добавляем в него следующий код.
config/initializers/haml.rb


Haml::Template.options[:format] = :xhtml