Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Thursday, May 3, 2012

install ruby and ruby on rails on ubuntu 12.04

In summary

  • update your system
  • install git, curl, rvm
  • install required packages
  • install rails
  • done
Step by step

Update system
sudo apt-get update

Install git
sudo apt-get install git

Install curl
sudo apt-get install curl

Install rvm
curl -L get.rvm.io | bash -s stable

Reload to start using rvm
source ~/.rvm/scripts/rvm
or 
source /home//.rvm/scripts/rvm

Check required packages
rvm requirements

and then copy the install command from output, it should look like this
sudo apt-get -y install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

Install Javascript runtime
sudo apt-get install nodejs

Install ruby
rvm install 1.9.3
(1.9.3 is the newest version at the time of this writing)

Set ruby version to default
rvm use 1.9.3 --default

Install rails
gem install rails

Done
start your app and see it works! cheers!


ubuntu - install LAMP server with one click

tasksel is a good service for installing LAMP on ubuntu 12.04 and 11.10

sudo apt-get install tasksel

sudo tasksel

this can be used to install postgreSQL and many others

ubuntu - preventing apache and mysql from auto start when computer starts

  • apache2 uses System V style init scripts. To disable it from boot:
    sudo update-rc.d -f apache2 remove
  • However, mysql uses an Upstart job, to disable it, create an "override" file:
    echo "manual" | sudo tee /etc/init/mysql.override
To learn more about override files, see: The Upstart Cookbook

Friday, January 16, 2009

backup and restore mysql in ubuntu

although i use ubuntu with shell, you can use whatever linux's distribution, command should like the same

backup mysqlmysqldump -u [username] -p [password] [database'name] > [backup'sname]
exp: mysqldump -u root -p 123 mysite > mysite.bak.sql


restore from file backup
mysql
-u [username] -p [password] [database'name] < [backup'sname]

note that the only different is mysql <> mysqldump and >
<> <exp: mysql -u root -p 123 mysite < mysite.bak.sql
click here for more details

happy coding!