Category Archives: Programming

Set up ruby-on-rails

install Ruby on Rails in ubuntu 10.10/11.04

ruby-on-rails

‘Ruby on Rails’  (ROR) is one of the most popular and productive open source framework that allows you to develop web applications very quickly with a lot of fun.

Ruby is a scripting language (like PHP) that focuses on ease of development and beautiful code. Ruby on Rails or simply ‘Rails’ is a web Apps development framework for Ruby programming language.

Rails is a cross-platform – web Apps development framework and this post will guide you in installing ‘Ruby on Rails’ framework on Ubuntu 11.04 (Natty Narwhal) or 10.10 (Maverick Meerkat) or 10.04 (Lucid Lynx) LTS..procedure is same for all versions. gedit text editor is enough for ruby programming – (usually better than heavy weight IDE’s), you can also customize gedit to look like TextMate (very popular (text editor) among ruby developers who uses Mac OS X).

Ruby version 1.8.7 is installed by default, in most of the Linux based operating system or distributions such as Ubuntu, so what you need to install is – ‘Rails’ , Gems (Gems are modular components or libraries very similar to Package in java), git (git is one of the best – free and open source version control system (developed by Linus Torwalds), it is not strictly necessary but recommended) and curl. Before you move on for installing ROR, Apache (Not necessary because ROR ships with WEBrick, the default HTTP server for rails apps) and MySQL or SQLite should be installed.

Installing Ruby on Rails in Ubuntu

#1 : Install git (not necessary but recommended), the version control system.

sudo apt-get install git

or install from source – Download git (Latest Version : 1.7.5.4). Then extract the archive and move to the extracted directory and type the following command(s) to install it –

make && sudo make install

#2 : Install Curl (Command Tool for transferring data with URL Syntax).

Download it (Latest version : 7.21.7) and install in the similar way as you installed git (in step 1, using source)

#3 : Install  Ruby Version Manager (RVM), a command line tool which allows you to run multiple versions of ruby – such as 1.8.7 as well as 1.9.2. Gem will be installed along with this, if not, then install rubygems before proceeding to next step.

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

Then type the command given below, to check whether it has been correctly installed, the output after executing the command will be – ‘rvm is a function’

type rvm | head -1

#4 : Install Ruby 1.9.2 (1.8.7 is installed by default)

rvm install 1.9.2
rvm use 1.9.2

#5 : Install Rails

gem install rails

#6 : Install SQLite3 (Not necessary if you want to use MySQL but ROR uses SQLite database by default, so you need to install ruby and sqlite related packages and ORM libraries).

gem install sqlite3

That’s All..now you are ready to rock with ‘Ruby on Rails’. Create new Application using simple command and start the server.

rails new apps_name
cd apps_name
rails server

Now open your browser and type the following address in the address bar –
http://localhost:3000

Learning Rails ?

Check out this interactive video course on Ruby on Rails at Treehouse.

Update! Checkout my rails application: Railyo – job board for rails Freelancers!

kdevelop

KDevelop version 4.2.3 is Released – Download it!

kdevelop

KDevelop vs 4.2.3 released today! KDevelop is one of the most popular open source IDE (Integrated Development Environment), specifically popular among C/C++ developers. KDevelop is a simple IDE with a lot of features. KDevelop is a KDE based application, available free as an open source software.

KDevelop requires KDE desktop to be installed (version 4.5 or later) on the system. Kdevelop (or any other KDE based Application) is developed using Qt Toolkit. KDevelop has elegant interface, it focuses on simplicity and ease of use, so learning curve is not so steep as compare to Eclipse or Netbeans. If you are a KDE user (Many Linux based OS uses KDE desktop e.g Open Suse, KUbuntu, Fedora, Linux Mint etc).

Download KDevelop version 4.2.3

kdevelop-4.2.3-snapshot

KDE 4.2.3 (stable version) has arrived with a lot of improvements and changes. Some of them are specifically related to KDevelop (such as small code cleanup, simplified unit test etc) while some are related to its platform. (Macros Declaration gets appended instead of prepended). Happy :) coding with KDevelop!

phpmyadmin-snapshot

how to install phpmyadmin on ubuntu 11.04/10.10

phpMyAdmin is a MySQL web administration tool, which allow us to administrate MySQL database in graphical interface (from your browser) and available for Ubuntu 11.04 (natty narwhal) or 10.10 (Maverick Meerkat) or 10.04 (Lucid Lynx) or any other Linux distros. Since phpMyAdmin is written in PHP (Hypertext Preprocessor (Surprised! it’s a recursive acronym), The most popular scripting language, used for server side processing); of course it’s an open source (and Free!) and cross platform application, so you can also use it on Windows NT based operating system such as Windows XP or 7; or Mac OS X.

phpMyAdmin is specially useful for beginners because it allows them to create, modify, delete or update – tables, field and rows, users permissions and settings etc in much simpler (as compared to command line interface) way. For Ubuntu phpmyadmin is the best (probably) tool for managing and controlling MySQL database.

phpmyadmin-snapshot

What You can do with phpMyAdmin ?

  • browse databases and tables
  • “create, copy, rename, alter and drop” tables and databases
  • perform table maintenance
  • execute SQL statements/queries
  • manage MySQL users and privileges
  • search globally in databases
  • create and read dumps of tables or databases …

Installing phpMyAdmin on Ubuntu 10.04/10.10/11.04

Open Terminal (CTRL+ALT+T) and type the following command(s) to install phpMyAdmin (on your computer running Ubuntu or other debian based Linux distribution). Remember you need to install MySQL and Apache first, see there – installing mysql on ubuntu 11.04 or install Apache server on ubuntu. or installing php on ubuntu; more simply install the LAMP (Linux+Apache+MySQL+PHP) package from synaptic package manager. Then phpmyadmin : –

sudo apt-get install phpmyadmin

Alternative Method : Open Synaptic package manager, search for ‘phpmyadmin’, check the box for installation and click on Apply button (don’t forget to select yes for dependencies, I mean dependent libraries or program) to install the selected programs.

Login to phpMyAdmin to start administrating MySQL

Open any browser such as Google Chrome or Mozilla Firefox and type the following URL in the address bar (or click here )

http://localhost/phpmyadmin/

Then, you will get a window like this –

phpmyadmin-login-window

Next, enter the login information – i.e MySQL username and password

>> ‘root’ as username

>> ‘password’ as the password that you entered while installing MySQL

That’s all..Now you are ready to rock with phpMyAdmin.

Recommended References :

Read official Documentation about phpMyAdmin

JDK

how to install jdk on Ubuntu 11.04

Ubuntu (Latest Stable Version : Ubuntu 11.04 (Natty Narwhal) ) is one of the most popular Linux distribution on this planet while Java, the most popular programming language (Platform independent features makes Java Great! and superior to any other programming language, for building web and Desktop Applications). Due to a number of free( and of course they’re good) tools, compilers and other options Ubuntu has become the No. 1 choice, as a development platform, among the Java Developers (specifically young programmers).

If you are just a common user then you need only JRE (Java Runtime Environment) to execute java programs but If are going to write java programs or develop Apps then you need to install Java Development Kit (JDK, complete suite for Java Developers) along with some IDE like Eclipse or Netbeans (Not really necessary for absolute beginners). A lot of JDK’s are available, so if you have programmed before then choose the one you like, but on the other hand, try open-jdk-6, an open source Java Development Kit (contains Javac, an open source Java compiler and ). This post will explain – about installation procedure of Open-JDK on a freshly installed Ubuntu 11.04.

Java logo

Installing Java Development Kit (JDK) on Ubuntu 11.04

#1 : Open Synaptic Package Manager (and click on update button, it’s not necessary but it’s usually a good practice because in this way you will get the latest details about the packages), and search for ‘JDK’ or ‘open jdk’ in the quick search bar.

installing-jdk-ubuntu-11-04

#2 : Then select the package for installation ( by checking the small square box) and click on ok, if it asks for dependencies.

#3 : Now, click on ‘Apply’ button to begin the installation procedure…and wait for the installation to complete.

#4 : That’s All..to verify, open Terminal (CTRL+ALT+T) and type javac, you will see a lot info about the Java Compiler and …

Install JDK from command Line

Open Terminal and enter the following command(s), then enter your ubuntu login password followed by ‘y’ when prompted for yes/no.

sudo apt-get install openjdk-6-jdk
Eclipse - Best ide for java

best IDE (Integrated Development Environment) for Java

Java is one of the most popular programming languages mostly used in developing desktop applications, web applications and Enterprise/Complex business applications, probably due to it’s platform independency as .class files can be executed by JVM running on any operating system (GNU/Linux or Mac or Windows).

A lot of good open source frameworks (A framework is a set of libraries and programs/environment that allows developers to build real world applications very quickly in most efficient and productive way; Now a days,  MVC (Model View Controller) frameworks are very popular in web Apps development e.g struts, Play, Spring etc.) and IDE’s (Integrated Development Environment, e.g Eclipse, BlueJ, NetBeans, etc) are available for java programmers at $0 (free).

The problem is – a lot of options i.e if you are a beginner java programmer (Actually little more than a beginner because if you are an absolute beginner then better go with a simple source code editor like gedit or notepad++ or Emacs), then you may feel difficulty in selecting an IDE for coding. That’s why in this post I’ll explain about a free and open source IDE that I think is the best ide for Java programming. If you are not agree, then don’t forget to put your opinion here, through comment.

Best IDE for Java : Eclipse

Eclipse is one of the most popular IDE for java developers because it has a lot of sophisticated features with simple, cool and easy to use GUI(Graphical User Interface). Some people may not agree on the the point that ‘Eclipse is very simple to use’, they aren’t just wrong; the learning curve for the java programmers those who uses Eclipse is very steep in beginning but decreases continuously with time, although this trend is not not uncommon because Java itself follow this trend specifically if we use Java in web apps development (of course for server side processing because Java on client side (web browser), in the form of Applets has been a complete failure).

Eclipse - Best ide for java

Although eclipse has very flexible plugin architecture and it supports a lot of programming languages besides Java, such as C, C++, PHP, JavaScript etc, but it’s most popular as a Java IDE (and specifically optimized for JEE Applications) it’s platform independent (available for GNU/Linux, Windows and Mac).

Download Eclipse

There are some other IDE that you can try for Java e.g BlueJ (Interactive Java IDE specially built for students), Netbeans (another popular JAVA IDE, vs 7.0 released few weeks ago). You might feel more comfortable with any of these IDE’s because sometimes it depends on the type of project and sometimes it’s personal. Since it’s open source and free to use, I would recommend to try most of them.

Download BlueJ

Download NetBeans