12.04 interview questions

Top 12.04 frequently asked interview questions

Is it normal for compiz to consume 40% of my CPU with no other programs running?

When I have no other programs running, compiz takes up at least 40% of my CPU.
Is this normal? If it is normal, is there anyway I could make this program take a smaller percentage?

Source: (StackOverflow)

How to start Virtual box machines automatically when booting?

I have many Virtual box machines in my Ubuntu12.04, each time i shutdown or reboot i have to start them one by one.

I wanna a help in writing script for automatically autostart the VBox machines when booting.

Source: (StackOverflow)

How can I install MonoDevelop v4 on 12.04?

I am using Ubuntu 12.04. I can install v2.8.6.3 of Monodevelop from software center but I need at least v3 to use Monogame v3 or higher. Can anyone point me in the right direction please?


Source: (StackOverflow)

Is this a correct way to enable htaccess in Apache 2.4.7 on Ubuntu 12.04

In almost every solution of "How to activate htaccess", they say that the /etc/apache2/sites-available/default file needs to be edited. But there isn't such file in Apache 2.4.7

I read somewhere that the new default file is 000-default.conf. So I edited that one and tried to add the line:

AllowOverride All

But Apache2 did not restart correctly and gave an error. From an apache2 documentation, I found that AllowOverride is only allowed under the <Directory> section. Then I tried adding this:

<Directory "/var/www">
AllowOverride All

And this seems to work. But I am not sure if I should have put /var/www there. Is it a correct way of doing it or will my computer blow up somehow?


Source: (StackOverflow)

Changing System name [duplicate]

This question already has an answer here:

I am given an old Ubuntu working system and the previous user had everything on his name so started turning it to my name as typing his name everywhere was bugging me. I tried:

$ usermod -l hussain darhamid

This turned the darhamid@darhamid:$ into hussain@darhamid:$

But I want hussain@darhamid:$ also changed to hussain@hussain. What should I do?

I am using ubuntu 12.04

Source: (StackOverflow)

How Do I fetch only the numbers in grep?

I have file like this :

 other lines . . .    
 blah blah blah (:34)

I wish to find the occurrence of numbers in the above file. I came up with :

grep [0-9] filename

But that is printing the whole:

blah blah blah (:34)

Rather I want only 34. Is there any way to do so?

Source: (StackOverflow)

Permanantly set monitor as primary

I am running Ubuntu 12.04 (beta) with a triple head setup and GNOME 3 desktop (ie "GNOME" selected not "Ubuntu" at login screen). It seems that it handles multiple monitors by blessing one monitor to receive the Activities bar, Clock, Login Menu, etc. Let's call this the "primary" monitor. How do I change it (permanently) ?

Update: Ok so:

$ xrandr --output DFP4 --primary

Does the trick temporarily. How do I make it permanent? I'm using latest fglrx ATI Catalyst driver

Source: (StackOverflow)

Drag and Drop across (fullscreen) applications, switching via Alt-Tab


Drag media file onto Totem's playlist to enqueue

Bug in Compiz

Especially for Unity (formerly Netbook Edition, being intended for small screens) this is quite a vital feature, as applications most often are run fullscreen, and dragging with the touchpad can be cumbersome.


Any hint on where to start fixing the bug? Which file/line in compiz source code?

Usability background

According to Fitts, Accot, and Zhai, the time required to rapidly move to a target area is a function of the distance to and the size of the target (cf. Fitts's law and Steering law).

Drag'n'Drop without Alt-Tab across fullscreen windows requires

  1. start to drag object
  2. move to launcher/taskbar
  3. steer to target app icon -- small and distant target!
  4. wait for app to become focused
  5. steer onto window -- (huge target)
    optionally: steer onto intended area of window, e.g. playlist (fairly large target)
  6. drop object

Drag'n'Drop with Alt-Tab on the other hand only requires

  1. start to drag object
  2. Alt-Tab to other app
    optionally: steer onto intended area of window, e.g. playlist (fairly large target)
  3. drop object

Thus, no small and distant target required for Drag'n'Drop whilst Alt-tabbing


Interesting and probably for many users useful alternative approaches are presented in the answers below. Great many thanks to the community!

Correct answer

... seems to be available only when the bug is fixed, though.

Some more recent action, maybe relevant as related bug: https://bugs.launchpad.net/ayatana-design/+bug/727903

Source: (StackOverflow)

Align windows with keyboard shortcuts? [duplicate]

Possible Duplicate:
Is there a shortcut to tile windows to left or right side of the screen?

I'm running 12.04 inside VMWare Workstation.

Windows 7 provides a very useful feature: use Windows+Left or Windows+Right to align the current window on the left/right half of the screen (useful for terminal windows on wide-screen, etc).

Is there an equivalent available for Ubuntu?

So far I was able to emulate Windows+Up (maximize window), but can't find anything for left/right alignments.

Just to be clear: I am not talking about "Move to Workspace" or so, I'm talking about resizing the current window on the current screen/workspace to only take the left/right half of the screen.

Source: (StackOverflow)

W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available:

I get the following error when i do sudo apt-get update

W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6AF0E940624A220

I tried following ways after reading various questions here and also by googling.

I tried sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220

did not help. I also tried sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys thinking port 11371(default) may be blocked due to firewall.

I also tried to reset everything as follows

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update && sudo apt-get upgrade

still i get the same error or get update.Any other possible solution I can try?

Source: (StackOverflow)

How to see/change screen refresh rate or monitor frequency?

My eyes hurt so I thought I should check the screen refresh rate (monitor frequency), but I couldn't find it.

Where is it? (in Ubuntu 12)

Source: (StackOverflow)

How can I install Qt 5.x on 12.04 LTS?

If you want to develop with QML 2.0 and Qt5, the base packages don't seem to exist in repository for 12.04. What PPA should I add? Is it a binary installer? a compile the toolkit yourself?

Those aren't separate questions, they're just possible tracks to an answer.

I'm asking because if you want to develop for Ubuntu Phone, but still have a rock solid LTS development box, this seems the appropriate path.

How can I install Qt 5.x on 12.04 LTS?

Source: (StackOverflow)

How can I disable [alt] for search? [duplicate]

Possible Duplicate:
How do I modify or disable the HUD's use of the Alt key?

In 12.04, the [Alt] key pops up the HUD. That's not a problem, but, when using [Alt]+... it pops up as well.

For instance on pushing [Alt]+[Left Arrow] which I use continually when navigating with Firefox (that's the 'back' functionality).

Is there a way to prevent this from happening?

Source: (StackOverflow)

Trying to start nginx on VPS, I get "nginx: unrecognized service"

Following the How to install rails and nginx with passenger on Ubuntu tutorial from DigitalOcean.com, the seventh step manually starts nginx:

sudo service nginx start

but fails with the following error:

nginx: unrecognized service

Source: (StackOverflow)

Why won't Remmina connect to Windows 7 Remote Desktop?

I'm using Ubuntu and I'm trying to connect to another machine in a different network using remote desktop.

In Windows7 I have made the following in order to activate remote desktop:

  1. I've gone to computer -> properties -> remote settings
  2. I've selected the option: "Allow connections from computers running any version of Remote Desktop
  3. I've opened "Windows Firewall with Advanced Security"
  4. In inbound rules I've enabled the rules for remote desktop (public and domain)

I have also installed Remmina in the Ubuntu machine.

For configuring it I did the following steps:

  1. Selected the RDP protocol
  2. In the server input I have written the Windows machine public IP.
  3. In username / password I have typed my login credentials (the same as my Windows admin account)

But when I try to connect I get this error message:

"Unable to connect to RDP server"

If I ping my Windows7 machine, I have a correct response.

Any suggestions?

Source: (StackOverflow)