How do I install Eclipse Juno in Ubuntu 12.04?

There are numerous articles on the Internet where the mechanism to be followed to install Eclipse Juno in Ubuntu is well explained. This article is a reminder to myself on the commands that were used to install Eclipse Juno in my Ubuntu 12.04 machine.

# Download the Eclipse Juno package from http://www.eclipse.org/downloads/.
# I usually prefer the 'Eclipse Classic' package out of habit but feel free to grab the one that fits
# your requirement.

# As an example, let me download the 64-bit Ubuntu tar.gz image.
root@labs:~$ cd ~/Downloads
root@labs:~$ wget http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.2.1-201209141800/eclipse-SDK-4.2.1-linux-gtk-x86_64.tar.gz

# Untar the package. Example:
root@labs:~$ tar -zxvf eclipse-SDK-4.2.1-linux-gtk-x86_64.tar.gz

# The net result would be a folder named "eclipse". Lets copy it to /opt.
root@labs:~$ sudo mv "eclipse" /opt

# Lets add a link to the executable - "/opt/eclipse/eclipse" in /usr/bin for easier access.
root@labs:~$ ln -s "/opt/eclipse/eclipse" /usr/bin/eclipse

# Lets create a icon in the Unity Dashboard for convenience.

# Reference: https://ksearch.wordpress.com/2012/10/25/how-do-i-install-sublime-text-2-in-ubuntu-12-04/
# Fire up a text editor. I am using vim here. But, any text editor would do.
root@labs:~$ sudo vim /usr/share/applications/eclipse.desktop

# Add the below content to /usr/share/applications/eclipse.desktop and save it.

  [Desktop Entry]
  Version=1.0
  Name=Eclipse
  
  Exec=eclipse
  Terminal=false
  Icon=/opt/eclipse/icon.xpm
  Type=Application
  Categories=IDE;Development
  X-Ayatana-Desktop-Shortcuts=NewWindow

  [NewWindow Shortcut Group]
  Name=New Window
  Exec=eclipse
  TargetEnvironment=Unity

# All done.


References:

How do I install Sublime Text 2 in Ubuntu 12.04?

Sublime Text 2 is a fantabulous editor. I have recently switched over to it and I am very satisfied. There are numerous articles out on the Internet that will allow one to find out the steps that explain how to install Sublime Text 2 in a Ubuntu machine. I am writing this article as a note to myself so that I can quickly glance over the steps in future.

# Download Sublime Compressed BZip package from http://www.sublimetext.com/2

# BUnzip the package. Example:
root@labs:~$ bunzip "Sublime Text 2 x64.tar.bz2"

# BUnzip would have unzipped the Sublime package into a .tar archive. Untar it.
root@labs:~$ tar -xvf "Sublime Text 2 x64.tar"

# The net result would be a folder named "Sublime Text 2 x64". Lets copy it to /opt.
root@labs:~$ sudo mv "Sublime Text 2 x64" /opt

# Lets add a link to the executable - "Sublime Text 2 x64/sublime_text" in /usr/bin for easier access.
root@labs:~$ ln -s "/opt/Sublime Text 2 x64/sublime_text" /usr/bin/sublime

# Lets create a icon in the Unity Dashboard for convenience.

# Reference: http://www.technoreply.com/how-to-install-sublime-text-2-on-ubuntu-12-04-unity/
# Fire up a text editor. I am using vim here. But, any text editor would do.
root@labs:~$ sudo vim /usr/share/applications/sublime.desktop

# Add the below content to /usr/share/applications/sublime.desktop and save it.

  [Desktop Entry]
  Version=1.0
  Name=Sublime Text 2
  
  Exec=sublime
  Terminal=false
  Icon=/opt/Sublime Text 2/Icon/48x48/sublime_text.png
  Type=Application
  Categories=TextEditor;IDE;Development
  X-Ayatana-Desktop-Shortcuts=NewWindow

  [NewWindow Shortcut Group]
  Name=New Window
  Exec=sublime -n
  TargetEnvironment=Unity

# All done.


References:

How do I uninstall Ruby Gems in Ubuntu?

Recently, I was attempting to install a Ruby application and as part of this process installed multitude of gems. Now, I no longer need this application and was looking forward for a quick solution to uninstall all the gems associated with it. This article outlines a summarized list of commands to achieve the same.

# List all the gems installed in your machine (example output is captured from my machine).
root@labs:~$ gem list

*** LOCAL GEMS ***

bundler (1.2.1)
daemon_controller (1.0.0)
daemons (1.1.0)
eventmachine (1.0.0)
fastthread (1.0.7)
hoe (3.1.0)
passenger (3.0.17)
rack (1.4.1)
rake (0.8.7)
rmagick (2.13.1)
stompserver (0.9.9)

# If you prefer to uninstall each gem individually, utilize the below command.
root@labs:~$ gem uninstall -Iax 

# Example:
root@labs:~$ gem uninstall -Iax passenger

# If you prefer to uninstall all of them, either run the uninstaller via a for loop like below:
root@labs:~$ for gem_name in $(gem list|awk '{print $1}'); do
> gem uninstall -Iax "${gem_name}"
> done

# Or, utilize xargs as listed at: http://geekystuff.net/2009/01/14/remove-all-ruby-gems/
root@labs:~$ gem list | awk '{print $1}' | xargs gem uninstall -Iax

# Legend (captured from the help documentation on gem for reference):
Usage: gem uninstall GEMNAME [GEMNAME ...] [options]

  Options:
    -a, --[no-]all                   Uninstall all matching versions
    -I, --[no-]ignore-dependencies   Ignore dependency requirements while
                                     uninstalling
    -x, --[no-]executables           Uninstall applicable executables without
                                     confirmation
    -i, --install-dir DIR            Directory to uninstall gem from
    -n, --bindir DIR                 Directory to remove binaries from
        --[no-]user-install          Uninstall from user's home directory
                                     in addition to GEM_HOME.
        --[no-]format-executable     Assume executable names match Ruby's prefix and suffix.
    -v, --version VERSION            Specify version of gem to uninstall
        --platform PLATFORM          Specify the platform of gem to uninstall


  Common Options:
    -h, --help                       Get help on this command
    -V, --[no-]verbose               Set the verbose level of output
    -q, --quiet                      Silence commands
        --config-file FILE           Use this config file instead of default
        --backtrace                  Show stack backtrace on errors
        --debug                      Turn on Ruby debugging


  Arguments:
    GEMNAME       name of gem to uninstall

  Summary:
    Uninstall gems from the local repository


References:

Error while installing VBox Guest Additions in Ubuntu 12.10 (Quantal Quetzal) …

While I was trying installation of VirtualBox guest additions in Ubuntu 12.10 (Quantal Quetzal), I encountered the below error.

....
Warning: unknown version of the X Window System installed.  Not installing  
X Window System drivers.
....

The effect of this error is that the VM display does not resize automatically when I choose full screen and limits the display resolution to 1024×768 pixels.

The fix for this issue is explained at: http://askubuntu.com/questions/204098/error-building-main-guest-additions-module-while-installing-virtualbox-guest-add.

# Solution: Install the X-Windows System Drivers in the Guest.
sudo apt-get install virtualbox-guest-x11

Note that this does not alter the message displayed while installing VBox Guest Additions, instead fixes the full screen display issue.


References:

How to install MATE in Ubuntu 12.10 (Quantal Quetzal)?

I just finished installing Ubuntu 12.10 (Quantal Quetzal) in a VM within VirtualBox. I like the Unity desktop but on a VM, I rather prefer Gnome 2 or MATE.

MATE is a fork of GNOME-2. You can read more about it here. Screenshots: here. The mechanism to be followed to install MATE is explained at: http://wiki.mate-desktop.org/download. I will reiterate it here so that it would be useful.

# Add one of the following repos to /etc/apt/sources.list. Note that 'add-apt-repository' is a link
# to 'apt-add-repository' which is part of the 'python-software-properties' package.

sudo add-apt-repository "deb http://packages.mate-desktop.org/repo/ubuntu quantal main";
sudo add-apt-repository "deb http://repo.mate-desktop.org/ubuntu quantal main";

# In case 'add-apt-repository' is not available in your system, you can consider
# editing the /etc/apt/sources.list using a text editor and add one of the below lines.

deb http://packages.mate-desktop.org/repo/ubuntu quantal main
deb http://repo.mate-desktop.org/ubuntu quantal main

# Execute the below commands to install MATE.

sudo apt-get update

sudo apt-get install mate-archive-keyring

sudo apt-get update

# Install the base package.
sudo apt-get install mate-core

# Install additional packages.
sudo apt-get install mate-desktop-environment


References:

Installation of psycopg2 fails within virtualenv folder in Ubuntu 12.04 – how do I fix this?

Recently, when I attempted to install the PostgreSQL adapter for Python ( psycopg2 ), in a virtualenv folder in Ubuntu 12.04, it failed. Upon attempting several solutions, I have boiled down to a fix that worked and decided to document it in an effort to help others resolve similar issue.

# Install the PostgreSQL development files (if you haven't installed them already).
sudo apt-get install postgresql-server-dev-all

# Install other required libraries
sudo apt-get install libpq-dev python-dev

# Attempt installation of psycopg2 within the virtualenv folder.
source /bin/activate
pip install psycopg2

# The installation of psycopg2 should proceed smoothly by now. If it still fails, try installing the postgresql-client libraries.
sudo apt-get install postgresql-client-common

# Attempt installation of psycopg2 again and hopefully it should work without issues.


References:

How do I modify the SSH banner message in a Ubuntu machine?

The default message that is automatically displayed when a user establishes a SSH connection to a Ubuntu machine is termed as the ‘SSH Banner Message’. The default one would look something like below.

Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-29-virtual x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Fri Sep 28 09:48:57 UTC 2012

  System load:  0.08              Processes:           60
  Usage of /:   15.4% of 7.97GB   Users logged in:     0
  Memory usage: 5%                IP address for eth0: 10.143.161.58
  Swap usage:   0%

  Graph this data and manage this system at https://landscape.canonical.com/

32 packages can be updated.
20 updates are security updates.

Last login: Thu Sep 27 19:18:35 2012 from 122.181.4.42
ubuntu@localhost:~$ ls

Perform the below steps if you would like to customize the banner message.

# Open /etc/ssh/sshd_config as superuser. sudo vim /etc/ssh/sshd_config # Find the line that starts with the string ‘#Banner’ and uncomment it. Banner /etc/issue.net # Open /etc/issue.net as sudo and insert the required custom messages. sudo vim /etc/issue.net # If you would prefer to display similar message to the user who may be # logging in on a local console, then update /etc/issue sudo vim /etc/issue # Save the file and restart ‘ssh’ service. sudo service ssh restart

Perform the below steps if you would like to avoid displaying the last login details at the end of the banner message.

Continue reading “How do I modify the SSH banner message in a Ubuntu machine?”