This file contains hidden or 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
$updatedb | |
$command not found | |
$ln -s /usr/libexec/locate.updatedb /usr/bin/updatedb | |
$updatedb |
This file contains hidden or 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
namespace 'views' do | |
desc 'Renames all *.rhtml views to .html.erb, .rjs to .js.rjs, .rxml to .xml.builder, and .haml to .html.haml' | |
task 'rename' do | |
Dir.glob('app/views/**/*.rhtml').each do |file| | |
puts `git mv #{file} #{file.gsub(/\.rhtml$/, '.html.erb')}` | |
end | |
Dir.glob('app/views/**/[^_]*.rxml').each do |file| | |
puts `git mv #{file} #{file.gsub(/\.rxml$/, '.xml.builder')}` | |
end |
This file contains hidden or 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
gem install linecache19 -v '0.5.12' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p0/ |
This file contains hidden or 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
ssh -L 1111:localhost:1111 username@ip_address |
This file contains hidden or 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
locate my.cnf | |
change character set and collation | |
[mysqld] | |
character_set_server = utf8 | |
collation_server = utf8_general_ci | |
in console if your database is not huge. |
This file contains hidden or 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
Rails Initialization Process | |
cli.rb | |
script/rails | |
boot.rb | |
rubygems | |
bundler/setup | |
rails/commands | |
rails/commands/server | |
config.ru | |
environment |
This file contains hidden or 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
# This is just a cheat sheet: | |
# On production | |
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
# On local | |
scp -C production:~/database.sql.gz | |
dropdb database && createdb database | |
gunzip < database.sql.gz | psql database |