Ubuntu: BASH adds an extra space after auto-completion of directory names

I have been bugged for few months now by an unusual behavior of BASH where it adds an additional space after every auto-completed directory name. Initially, I just compromised with the behavior and continued. But lately, it has become an annoyance to press the backspace key after every auto-completed directory name.

Searching for solutions landed me in Ubuntu Bugs Launchpad.1 Applying the solution shared by Leo as Comment 10 solved the issue.2

The issue is due to the fact that the bash auto-completion logic defined in acroread's auto-completion file located at /etc/bash_completion.d/acroread.sh overrides the default behavior.

There are quite a few solutions to this issue:

  1. The easiest is to delete /etc/bash_completion.d/acroread.sh and restart your shell.
  2. Alternatively, you can consider and renaming the variable _filedir defined in /etc/bash_completion.d/acroread.sh with a custom name say, _acroread_filedir. More information about this solution is available in the Adobe Reader for Linux forum.3

References:

Django-nonrel + VirtualEnv + uWSGI + Nginx + ImportError: No module named wsgi

If your uWSGI configuration is causing the below error to be displayed in the logs:

from django.core.wsgi import get_wsgi_application>
ImportError: No module named wsgi

Check if you are using Django 1.3 or below. If yes, confirm if the below lines are listed in your wsgi.py file:

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

Continue reading

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: http://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: