Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jul 092011
 

Turn off magic_quotes_gpc in PHP

Answer:

magic_quotes_gpc is a legacy PHP function that no longer be supported in PHP 6.0. So you should disable them to make sure your application not break in the future version of PHP.

To disable it, edit the php.ini

vi /etc/php.ini

Locate and set

magic_quotes_gpc = off;

Remember to restart web server such as Apache if needed.

Jul 012011
 

List of remote gems on rubyforge.org

Answer:

To list all the available gems on rubyforge.org, use this command:

# gem list --remote

For example, to search for all rails related gems, use

# gem list --remote | grep "\-rails"

Jun 272011
 

List all the installed gems

Answer:

To list all the installed gems on your machine, simply execute the following command:

# gem list --local

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.9)
actionpack (3.0.9)
activemodel (3.0.9)
activerecord (3.0.9)
activeresource (3.0.9)
activesupport (3.0.9)
arel (2.0.10)
builder (2.1.2)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.19)
mime-types (1.16)
polyglot (0.3.1)
rack (1.2.3)
rack-mount (0.6.14)
rack-test (0.5.7)
rake (0.9.2)
treetop (1.4.9)
tzinfo (0.3.28)
Jun 112011
 

Changing the default Java environment in Ubuntu

Answer:

If you have more than one JVM (Java Virtual Machine) installed in your Ubuntu server, e.g. OpenJDK and the Oracle JDK, you can easily select them using the following command:

# sudo update-alternatives --config java

Following the instruction and you can easily set them as you want.