Archive for 'Shell Scripts'

Add multiple virtual host along with Passenger

Posted on January 5, 2010, under Shell Scripts.

I was having few projects on my MAC and was really bugged up with maintaining the port numbers and other stuffs, a real cumbersome.

After, Jacek’s thought on this, I had set up the following:

Install the gem:

sudo gem install ghost

after that add a virtual host

sudo ghost add paddy.local (a choice of your virtual host)

Install the Passenger gem:

sudo gem install passenger
sudo passenger-install-apache2-module

After installing the apache module for passenger, you may have add the following lines (after installation it will tell based on your own enviroment)

(in your httpd.conf)

LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-2.2.8/ext/apache2/mod_passenger.so
PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-2.2.8
PassengerRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

Also you may have to enable your virtual host too …by default, it may be disabled(commented) and you have to enable(uncomment) it

# Virtual hosts

Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf

Next, you have to add the vitual host for your rails app.

(httpd-vhosts.conf)


ServerName www.yourhost.com
DocumentRoot /somewhere/public

Run Controller Spec

Posted on February 21, 2009, under Rails, Shell Scripts.

If you just wanted to run only the controller specs, then you have to use the following command

rake spec:controllers

getopt: invalid option — ‘v’

Posted on January 15, 2009, under Rails, Shell Scripts.

Recently, I tried to install rails and it seems it all got installed successfully and in the terminal when i type

$ rails -v
getopt: invalid option -- 'v'
Terminating...

$ sudo apt-get remove --purge rails

$ sudo gem install rails
Successfully installed rails-2.2.2
1 gem installed
$ sudo ln -s /var/lib/gems/1.8/bin/rails /usr/bin/rails
$ rails -v
Rails 2.2.2

Git on Ubuntu – Installation Instructions

Posted on December 28, 2008, under Shell Scripts.

Hello All,

Recently, I have been a fan of Ubuntu and wanted to try on GIT with one of my project and though would install GIT in Ubuntu. In the bash please have the following commands:

sudo apt-get install git
sudo apt-get install git-core

This has been a breeze for me in installing this and once you have installed type the following command:

git

This should give a list of options to be used with GIT.

Generating a RSpec Controller

Posted on December 4, 2008, under Rails, Shell Scripts.

I was just creating a new rspec controller and thought would share it for all of you.

./script/generate rspec_controller admin/configuration

Hope this helps somebody

Backup a MySQL Table

Posted on October 16, 2008, under MySQL, Shell Scripts.

mysqldump db_name table_name > /file/to/path/dump.sql

Hope this helps!

Cheers!

Pads

Linux Version

Posted on August 29, 2008, under Shell Scripts.

Here’s the shell command to find the Linux Version / Flavor.

cat /proc/version

Cheers,

Pads!

Undo – Shell Command

Posted on July 30, 2008, under Shell Scripts.

If you want to undo some thing in your Shell/Bash prompt, you may use the following

[Esc] u

List only Directories in SSH

Posted on July 30, 2008, under Rails, Shell Scripts.

Directory listing in listings mode

ll -d */

Directory listing in window mode

ls -d */

List only Directories exclusing the symlinks

Posted on July 29, 2008, under Rails, Shell Scripts.

ls -l | grep "^d"