raise variable.to_yaml
Watch logs:
tailf /home/luna/www/myapp/log/production.log
tailf /home/luna/www/myapp/log/development.log
puts variable.inspect
Run:
rails g controller StaticPages index
In config/routes.rb
add:
root "static_pages#index"
###Show variable contents from controller in view### ####Controller####
#Nginx debug# Use strace. First, you need to detect PID of nginx process:
# ps ax | grep nginx
25043 ? Ss 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
25044 ? S 0:02 nginx: worker process
Ok, so 25044 is the worker process. Now, we trace it:
# strace -p 25044 2>&1 | grep gz
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
stat("/home/luna/www/myapp/public/", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 | |
stat("/home/luna/www/myapp/public/assets/application-58c7c0e35a67f189e19b8c485930e614.css", {st_mode=S_IFREG|0664, st_size=0, ...}) = 0 | |
open("/home/luna/www/myapp/public/assets/application-58c7c0e35a67f189e19b8c485930e614.css.gz", O_RDONLY|O_NONBLOCK) = 11 | |
stat("/home/luna/www/myapp/public/assets/application-67fb624685eb5c3c2d8351122ac368a1.js", {st_mode=S_IFREG|0664, st_size=106238, ...}) = 0 | |
open("/home/luna/www/myapp/public/assets/application-67fb624685eb5c3c2d8351122ac368a1.js.gz", O_RDONLY|O_NONBLOCK) = 12 | |
# /home/luna/www/myapp/public/assets/application-67fb624685eb5c3c2d8351122ac368a1.js deleted | |
stat("/home/luna/www/myapp/public/", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 | |
stat("/home/luna/www/myapp/public/assets/application-58c7c0e35a67f189e19b8c485930e614.css", {st_mode=S_IFREG|0664, st_size=0, ...}) = 0 | |
open("/home/luna/www/myapp/public/assets/application-58c7c0e35a67f189e19b8c485930e614.css.gz", O_RDONLY|O_NONB |
#VirtualBox tips and tricks#
##Shrink disk size##
In Total Commander browse to c:\Program Files\Oracle\VirtualBox
and run cmd
in bottom command line. Then in cmd
:
VBoxManage modifyhd "d:\VirtualBox\VMs\Ubuntu 12.04 LTS amd64\Ubuntu 12.04 LTS amd64.vdi" compact
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
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 184 100 184 0 0 106 0 0:00:01 0:00:01 --:--:-- 147 | |
100 19527 100 19527 0 0 7715 0 0:00:02 0:00:02 --:--:-- 35754 | |
Turning on auto dotfiles mode. | |
Please read and follow further instructions. | |
Downloading RVM branch stable | |
Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz to rvm-stable.tgz. | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed |
#Ruby on Rails installation on Ubuntu 12.04 LTS + Nginx + Puma# ##Adding new user## Create new user:
sudo useradd -G sudo -m -s /bin/bash luna
Change password: