Category Archives: Ubuntu 12.04

Android

How to Install Android SDK on Ubuntu 12.04 LTS

Ubuntu (latest version: 12.04 LTS) is now the most popular GNU/Linux distribution on this planet; Android, the most popular operating system for Mobile Devices, both are rocking!

If you are a Android Developer (or an absolute beginner) – who wants to use Ubuntu as the development platform OR an Ubuntu user interested in developing Android Applications – then this post might be helpful in setting up Android Development Environment on Ubuntu 12.04 (a.k.a Precise Pangolin). Although, the setup process is primarily explained for Ubuntu 12.04 but it may works seamlessly on other GNU/Linux systems such as Linux Mint, Debian, OpenSuse, Fedora etc (and of course you would have to replace apt-get by yum in RPM based distro).

Setting Up Android SDK on Ubuntu 12.04 LTS

Android

Since Android uses Java as the programming language so you must install Java Development Kit (JDK) such as OpenJDK (Open Source implementation), followed by the Eclipse IDE and ADT plugins required for Android Development.

Step 1. Install JDK and Eclipse IDE

Although, you could install JDK or IDE separately (specially if you want specific version of JDK and Eclipse, Since Android SDK requires JDK 1.6+ and Eclipse Helios 3.6.2+) but eclipse-jdt package meets the above conditions so it would be much easier. Open a terminal and install Eclipse IDE as well as JDK, in one command (Installs Eclipse 3.7 + OpenJDK 6 ) –

sudo apt-get install eclipse-jdt

step 2. Download Android SDK Starter Package

Download Android SDK Starter Package (From Official Site)

step 3. Install ADT Plugins for Eclipse

Installing Android SDK

Now, Open Eclipse IDE and go to Help -> Install New Software  then click on Add and enter the URL :

https://dl-ssl.google.com/android/eclipse/

installing-adt-plugin

Now select the developer tools, then a couple of Next, followed by Finish would begin the Download/Installation process; Next, restart the Eclipse.

step 4. Install Android SDK

Then open Window -> Preferences and locate your Android SDK starter package.

locate-sdk-package

Then go to Window -> Android SDK Manager, Select the packages you want to install and click Install [x] Packages.

android-sdk-manager

Packages to select ?

Mandatory  packages are SDK Tools, SDK – Platform Tools and the SDK platform (2.1 (recommended if you want to target for 97%+ users) or 4.0.3 (the latest version at the time of writing this post)) for which you want to write the Application.

Select other packages depending on your need, although most recommended packages are – Documentation, Code Samples, USB Driver, Google API, Google Analytics SDK, Google Admob Ads SDK (If you want to show ads in your App) etc. Don’t select unnecessary packages – that you don’t need now – otherwise it may take much time to download/install all those stuffs.

Wait, until the download/install process complete (it may take a lot of time if your Internet connection is not very fast).

That’s All. Now it’s time start developing some cool Applications for Android. Have Fun!

Recommended Book(s) for Beginners

root-login-ubuntu

How to Login as root in Ubuntu 12.04 LTS

Root account is disabled by default, in Ubuntu and some other GNU/Linux distributions because the super user created by default (during installation process) can easily gain root privileges through the help of sudo (super user Do) command. But in some cases it might be good to have access to root power in GUI mode (or may be just for fun), although I’m sure most of such administrative tasks can be easily accomplished by sudo utility (which is installed by default in Ubuntu).

I had already written a post about Unlocking root account in Ubuntu 11.10 – most of the things are same and works as expected, in Ubuntu 12.04 LTS.

Unlocking Root Account in Ubuntu 12.04 LTS (Precise Pangolin)


Open a terminal (Ctrl+Alt+t) and execute the command –

sudo passwd root

Then enter the root password twice (followed by your login password). Then logout from the current session and choose root user at login prompt. Then you can enjoy root power in GUI mode. Or you can use su command to gain root power at terminal –

su

Then enter root password and Enjoy :)

NOTE : But actually you shouldn’t be using root account for administrative tasks. simply use sudo (if you want to gain root power in terminal) or gksudo or gksu for GUI applications such as File Manager. So if any command requires root power i.e gives permission denied error or something like that then just put sudo before that command.

sudo command_that_requires_root_power

Open Nautilus with ROOT privileges (it’s required unless you do file management over command line – in that case sudo will work fine)

gksudo nautilus

For KDE Desktop users KDESUDO utility is there (it’s a frontend for sudo) –

kdesudo gui_app_name
Set up ruby-on-rails

How to install Ruby on Rails in Ubuntu 12.04 LTS

Ubuntu 12.04 LTS (Long Term Support) – Precise Pangolin has already released, and you might have upgraded from 11.10 or installed Ubuntu 12.04 LTS. In this post you will learn how to setup Ruby on Rails on a newly installed Ubuntu 12.04 LTS.

Ruby on Rails is a very popular web development framework, it is based on the principle of  “Convention over Configuration”. Although, application development using Rails is quite easy and fun but setting up rails development environment may be difficult and frustrating, specifically for beginners. I had already written a post about setting up rails on Ubuntu 11.10  but few things has changed and need to be updated for the new version of Rails, Ruby and Ubuntu.

“Hassle Free” Rails Installer for Ubuntu 12.04

Although I’ve explained the installation steps in detail but if already know how these things work then better save time by running the script – that will install Ruby on Rails on Ubuntu 12.04 along with the dependencies and RVM.

Download the Rails Installer Script (From Github)

First change some settings in Gnome Terminal. Go to Edit -> Profile Preferences -> Title and Command and check the “Run Command as login shell”  box.

Login Shell - Terminal

Then make the script executable and execute it (you may have to enter the login password once) –

sudo chmod +x rails-installer.sh
./rails-installer.sh

If anything goes wrong then let me know through comments.

Step by Step Instruction for Setting Up Rails on Ubuntu 12.04 LTS

Just follow these simple steps and withing a couple of minutes you would be creating some nice applications (and of course using Rails).

step 1.  Install git and cURL

First of all, update your package repository.

sudo apt-get update

git is a simple, fast and efficient version control system. It is easy to learn, so even if you don’t have any experience with git you can try it in your next rails project (or any other project). you will love it.

sudo apt-get install git

Curl is a simple command line utility for getting file over web protocols, based on libcurl. To install curl simply execute –

sudo apt-get install curl

step 2. Install RVM and Dependencies

RVM is not strictly required but it makes ruby management a lot easier. You can try different implementations of ruby, different versions of ruby and all without any pain. So it’s strongly recommended. but RVM requires the command to be executed as login shell, so open a terminal and go to Edit -> Profile Preferences -> Title and Command and check the box that says “Run Command as a login shell“. (look at the above snapshot)

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

Now, you must load the RVM

source ~/.rvm/scripts/rvm

Then install additional dependencies specified by the RVM –

rvm requirements

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

Installing Javascript Runtime
In newer version of Rails, you also need a Javascript runtime. Although you could install it from the package repository but it’s very outdated. So I recommend installing it using the PPA. (and I’ll also update the script)

sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

step 3. Install Ruby

Now, you got RVM running, installing and running multiple versions or just one version of Ruby is very simple. To install Ruby just pass the version number to rvm install command (or some other implementation of ruby if you want; RVM also supports rbx, ree, JRuby, IRonRuby other than the default MRI) –

rvm install 1.9.3

Then select the Ruby version you want to use, (or make it default so that you don’t have to select it again in new session)

rvm use 1.9.3 --default

Now, you can check the version of ruby, you’re running right now-

ruby -v

step 4. Install Rails

RVM installs ruby as well as the gem utility (managing ruby libraries). To install rails, simply install it using the gem. It will automatically install the latest version unless you specify the version explicitly.

gem install rails

Now You’re ready to go.

rails new app_name
cd app_name
rails server

Now, open a browser and go to http://localhost:3000. :)

Voila :)

You should also check out this Ruby on Rails Interactive Video Course on Treehouse.

Note : When your Rails Application is ready, you may want to deploy it to a real server, I recommend Digital Ocean (@$5/mo, you get 512 MB RAM, 20 GB SSD and 1TB Bandwidth, cool, isn’t it.) for that, also checkout the Digital Ocean review if you want to know more about them. If you need any help then read this article about Deploying Rails Application to VPS.

Update 1 : Added a video as a reference for Rails Installer Script.

Update 2 : checkout my new rails application: Railyo – Rails freelancing jobs for cool developers!

ubuntu-tweak

Install Precise Tweak (New Ubuntu Tweak) in Ubuntu 12.04 from PPA

Precise Tweak is the new name of Ubuntu Tweak, a popular application for customizing Ubuntu Desktop. It’s a very popular tool among the desktop users because it allows them to configure/customize their desktop without any hassle (from a simple and easy to use graphical interface).

It provides a lot of options to customize a lot of things. Now, the project has moved to Launchpad (open source project hosting platform, very popular for debian and Ubuntu related projects). So a stable PPA is available for Precise Tweak app. Some of the most important features include – theme options, admin options (for managing packages/applications), Janitor (for removing unwanted packages), login page, etc.

ubuntu-tweak-overview

Installing Precise Tweak (a.k.a Ubuntu Tweak) in Ubuntu 12.04 LTS

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak

Here are few more snapshots exploring various features of Precise Tweak –

ubuntu-tweak-options

Customizing Themes –

ubuntu-tweak-themes

That’s All. Enjoy :)

Precise Tweak (New Ubuntu Tweak)

How to Tweak Ubuntu 12.04 LTS

Ubuntu 12.04 LTS (precise pangolin) has released. If you’ve been using Unity desktop from the beginning then you might have noticed a lot of improvements (in Unity Interface). Gnome shell also seems better then it was before.

Anyway, after installing few basic things in Ubuntu 12.04  – now it’s time to tweak various settings/options according to your need. Many things has changed a lot in Ubuntu 12.04 e.g Customizing theme is now much harder as compare to older version of Ubuntu (e.g in 10.04, it was much simpler with GNOME 2.3).

Applications for Tweaking Ubuntu 12.04 LTS

1. Precise Tweak – The new version of  ‘Ubuntu Tweak’

Precise Tweak is the new version of Ubuntu Tweak. Ubuntu Tweak was very popular in older version of Ubuntu (with GNOME 2.* Desktop). Now, they have released the new version – suitable for newer version of Ubuntu i.e 12.04. It is a very feature rich application that allow you to customize a lot of things including – Theme, Login Settings, Common Administrative Tasks, Applications Settings (handlers), PPA etc. So using Precise Tweak, it’s very easy to customize Ubuntu 12.04, and it’s Fun :)

Precise Tweak (New Ubuntu Tweak)

In short, it’s a must have application for every one. To install Precise Tweak, simply execute the following commands –

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak

2. MyUnity

MyUnity is a simple application for tweaking Unity Desktop settings. It has lot of options to configure Unity such as Launcher settings, Desktop icons, Font settings, Themes, Panel etc. So it’s recommended if Unity is your primary desktop.

myunity-snapshot

Installing MyUnity in Ubuntu 12.04 LTS

In 12.04 LTS, MyUnity has been included in official package repository so you don’t need to add any external PPA. Open a terminal and execute –

sudo apt-get install myunity

3. Gnome Tweak Tool

Gnome Tweak Tool is recommended specially for those who use Gnome Shell Interface in Ubuntu 12.04 LTS. It allows you to configure themes, fonts, gnome shell extensions, etc. So it’s required for those who want to tweak Gnome Shell Interface.

gnome tweak tool

How to install Gnome Tweak Tool in Ubuntu 12.04 LTS

Open a terminal and execute (or you could use your preferred way of installing new things such as from Synaptic Package Manager) –

sudo apt-get install gnome-tweak-tool

4. Unsettings

unsettings

Unsettings is a cool app for customizing unity settings, recommended for those who loves Unity shell in Ubuntu 12.04. You can easily change panels, dash, icons, themes, fonts, launcher, menu and other settings – without much hassle. To install Unsettings, simply execute the commands (it’s not there in system package repository, so you are recommended to install using the official PPA) –

sudo apt-add-repository ppa:diesch/testing
sudo apt-get update
sudo apt-get install unsettings