March 16 2010

Install NetBeans on Ubuntu 8.10

  1. Setup the Source Repository
  2. To install NetBeans via the Ubuntu Package Manager, ensure that the correct repository is listed in the source listing file. NetBeans is found inf the universe repository and Java is found in the multiverse repository.

    Code:

    sudo gedit /etc/apt/sources.list

    Ensure that the following sources are added to the configuration file:

    After the configuration file is updated, the package repository needs to updated with the following command:

    Code:

    sudo apt-get update
  3. Install Required Software
  4. To install Java version 6, the following command needs to be executed:

    Code:

    sudo apt-get install sun-java6-jdk sun-java6-plugin
  5. Install Netbeans IDE
  6. To install NetBeans, the following command needs to be executed. The package manager does not necessarily install the latest version of NetBeans. The package manager will install the latest NetBeans that is supported by Ubuntu.

    Code:

    sudo apt-get install netbeans

    Source : http://www.javadesign.info/SystemsHardware/OS/Ubuntu/install-netbeans-on-ubuntu

    sudo apt-get install netbeans

March 15 2010

Installing readline for ruby - for ubuntu

apt-get install libreadline5 libreadline5-dev
apt-get install libncurses5 libncurses5-dev

cd /usr/src/ruby-1.8.6-p368/ext/readline/
ruby extconf.rb
sudo make
sudo make install

done..

March 15 2010

Configuring Syslog for Rails

I was working on a Rails application recently that required the logs to be sent to remote log server. This blog is just a summary of the steps to get it working. I used Rails 2.0 and the development was done on Ubuntu.

The first thing was to get syslog-ng. Its more advanced than syslogd.

sudo apt-get install syslog-ng

The next step was to get the SysLogLogger tool to send the logs to syslog instead of a file. Go to the vendor directory of your application and get SysLogLogger using the following command.

curl http://rubyforge.org/frs/download.php/20520/SyslogLogger-1.4.0.tgz
-L | tar -zxvv

Assuming that you are working in the development environment , add this to the start of the development.rb file in the configuration directory

$:.unshift File.join(RAILS_ROOT, "vendor", "SyslogLogger-1.4.0", "lib")
require 'syslog_logger'
RAILS_DEFAULT_LOGGER = SyslogLogger.new(program_name = 'my-application')
config.logger = RAILS_DEFAULT_LOGGER

Locate the syslog.conf file in the etc directory and add these lines.

!my-rails-application
user.* /var/log/development.log


What this does is gets the logs that are sent to syslog from the rails application and writes it to the development.log file in /var/log/ dir

To get the changes working, restart the syslog service on Ubuntu by running the following command
sudo /etc/init.d/sysklogd restart

To send the logs to a remote log server instead of the log file use this in the syslog.conf file instead
user.* @address of remote log server

The log server should be configured to accept logs from remote systems. The syslogd file in the remote log server needs to be changed to show the following for this purpose

SYSLOGD="-r"

The syslogd file is located in the etc/default dir in Ubuntu. Since I had the log server configured already, I did not need to change the configuration. Please add comments on this post in case something is missing.

The log files can be rotated on a periodic basis (or depending on size) by configuring the logrotate.conf file in the etc dir.
See man logrotate for details.

Source: http://2muchtea.wordpress.com/category/ubuntu/

March 14 2010

Installing Openssl on Ubuntu

If you have tried to install Mechanize or any gem that requires openssl on Ubuntu or Debian, you may have encountered the following error…

LoadError: no such file to load—openssl

despite the fact that you have installed openssl with “gem install libopenssl-ruby”.

Thanks to this thread, I found out that in order to install openssl, you have to tell ruby how to compile the openssl extension, like this…

cd /ruby-1.8.4/ext/openssl
ruby extconf.rb
make

Source: http://www.jessirae.com/blog/articles/2007/03/11/installing-openssl-on-ubuntu
make install