Saturday 20 August 2011

Using the same swap space for different linux installations

I  want to upgrade my server to 11.04 now I have tried it on my laptop. However as this can take some time until I have all of the services configured I decided to make some space free and install the 11.04 server on a separate partition.

I notice that the installation automatically reserves some swap space for the new Ubuntu installation, even though there is an existing linux swap partition. This seems wasteful to me so I looked up the UUID for the existing swap space using
suso blkid
or by mounting the other linux on /mnt with for example
sudo mount /dev/sda1/ /mnt
 and looking under /mnt/etc/fstab for the UUID for the swap

The replace the swap UUID in /etc/fstab with the existing one.

You  can then use GParted to utilize the new swap space for something else.

Thursday 18 August 2011

Add "Open As Administrator" To Nautilus Right Click Menu

To add "Open As Administrator" To Nautilus right click menu you need to install the package nautilus-gksu via Synaptic or with:

sudo apt-get install nautilus-gksu

Monday 15 August 2011

Unity. Open more than one instance of an application

To open another instance of, for instance, the terminal click on the application on the launcher with the middle mouse button.

Sunday 14 August 2011

Nautilus in Ubuntu 11.04 Natty Narwhal

I have had a couple of issues with Nautilus since upgrading the Ubuntu 11.04.

Where is the menu bar? Until I got used to Unity I didn’t realize that the menu for each application with focus is in the desktop menu bar. Its pretty neat when you get used to it.

Shortcuts. Because of the issue above I couldn’t find hidden files until I remembered Control-h which I haven’t used in years. This got me to thinking of the other shortcuts so I made a short list and posted it here.

Location Bar. I prefer a text based location bar because I like to cut and paste from it. Here is how to make a text based location bar the default.

Nautilus Location Bar

I have always preferred to use the text based location bar in Nautilus as it is useful for cutting and pasting into other applications etc. In earlier versions there was a button to switch from the breadcrumb view to the text based view but this button is missing in Natty Narwhal. You can switch to the text based view with Control-l or select Go -> location but the next time you open a window the breadcrumb view is back.

To permanently have a text based location bar go to a terminal and type:

gconf-editor 

In the editor click on apps in the left hand column and then select nautilus and preferences. Check the box at the side of always_use_location_entry in the right hand box.

That’s it.

Nautilus keyboard shortcuts

I have recently installed Ubuntu 11.04 on my laptop and until I got used to Unity I couldn’t find the menu bar for the nautilus window. I found out later that the menu for the application in focus appears in the desktop menu bar. However I urgently needed to find a hidden file and I half remembered that the keyboard shortcut was Control-h. That worked and so I started looking up other keyboard shortcuts and have put them together in a list below. I hope they are useful to someone.

Ctrl+A – Select All
Ctrl+D – Add to Bookmarks
Ctrl+B – Edit Bookmarks
Ctrl+W – Close Window
Ctrl+Q – Close All Windows
Ctrl+R – Reload/Refresh Window
Ctrl+S – Select Items Matching (Enter the pattern)
Ctrl+L – Go To Location Bar
Ctrl+H – Toggle ‘Show Hidden Files’
Ctrl+C – Copy Selected
Ctrl+X – Cut Selected
Ctrl+V – Paste Selected
Ctrl+T – Open New Tab
Ctrl+1 – Icon View
Ctrl+2 – List View
Ctrl+3 – Compact View
Ctrl++ – Zoom In
Ctrl+- – Zoom Out
Ctrl+0 – Reset Zoom Level
Ctrl+Shift+I – Invert Selection
Ctrl+Shift+N – Create New Folder
Ctrl+M – Create Link (Shortcut) [Highlight the file / folder first and then use press Ctrl+M]
Delete – Delete To Trash
Shift+Delete – Delete Permanently
Alt+Enter – Properties
Alt+Up – Open Parent Folder
Alt+Left – Go Back
Alt+Right – Go Forward
Alt+Home – Go To Home Folder
F1 – Open Help
F3 – Toggle Dual Pane Mode
F9 – Toggle Side Panel

Ubuntu 11.04 and nVidia Optimus

After installing Natty Narwhal on my new Packard Bell Easytone HR11 it booted into Gnome instead of the new Unity desktop. After googling around I discovered that the nVidia Optimus technology was to blame. Optimus switches from the low power consuming Intel GPU which is used for basic applications to the more powerful nVidia GPU when gaming or watching movies. Optimus, as delivered from nVidia, is not available for Ubuntu.

Fortunately here is a solution for using Optimus with Ubuntu called Bumblebee. to get Bumblebee up and running first open a terminal and add the Bumblebee repository and then install Bumblebee.

sudo apt-add-repository ppa:mj-casalogic/bumblebee
sudo apt-get update && sudo apt-get install bumblebee

During the installation you will be asked if you want to configure Bumblebee, select “Yes”. You will then be asked to select manual configuration or to view a list of configurations, select “Full List” and from the list select your laptop. If you have a Packard Bell Easynote pick “Packard Bell EasyNote TSX66HR: SteveYoung” and then “Use this Configuration”. In the next screen select “XV(Default)” You should then see a message saying that Bumblebee has been installed.

Now typing “optirun” before an application will cause the nVidia GPU to be used rather than the Intel GPU, with improved performance as can be seen below.

steve@steve:~$ optirun glxgears
* Starting Bumblebee X server bumblebee
_PS0 Enabling nVidia Card Succeeded.
[ OK ]
3178 frames in 5.0 seconds = 635.511 FPS
3326 frames in 5.0 seconds = 665.190 FPS
3122 frames in 5.0 seconds = 624.271 FPS
3250 frames in 5.0 seconds = 649.854 FPS
3174 frames in 5.0 seconds = 634.725 FPS
* Stopping Bumblebee X server bumblebee
_PS0 Disabling nVidia Card Succeeded.


As opposed to the fps without Bumblebee.

steve@steve:~$ glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
302 frames in 5.0 seconds = 60.277 FPS
301 frames in 5.0 seconds = 60.160 FPS
301 frames in 5.0 seconds = 60.160 FPS
301 frames in 5.0 seconds = 60.160 FPS
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
after 2757 requests (2757 known processed) with 0 events remaining.


You can also install the bumblebee.ui using

sudo apt-get install bumblebee-ui

This places an indicator in the Unity notification area which changes colour when the nVidia GPU is in use and also allows you to configure which applications to use “optirun” with automatically.

Bumblebee uses the nvidia-current driver and I am not sure that this is the best driver for the GT540M which is in my laptop. I think that the figures of 650fps achieved with optirun glxgears can be improved on and if anyone has any ideas about how to do this please share them with us.

Ubuntu 11.04. Wrong keyboard keeps reappearing as default

When I installed Ubuntu 11.04 on my laptop there was a problem with selecting a keyboard other than USA. If I selected any other keyboard the installation hung for minutes, so eventually I accepted the USA keyboard thinking I would change it later. Everything installed so I went to System Settings and chose Keyboard in the Control Center and under the Layout tab I removed the USA keyboard and added a German one.

However after every reboot the USA keyboard was back and worse still it was the default, so I had to keep switching back to German. Removing the US keyboard only resulted in it reappearing after a reboot.
Eventually I found the answer. Go to /etc/default/keyboard and change the line XKBLAYOUT="us" to your desired keyboard and re-boot.

XKBMODEL="pc105"
#XKBLAYOUT="us"
XKBLAYOUT="de"
XKBVARIANT=""
XKBOPTIONS=""

No wireless networks with Easynote laptop and Ubuntu 11.04

I assume that all of these laptops use the broadcom wireless adapter but to check open a terminal and type:

sudo lshw -C network

The ethernet and wireless interface information will be shown.
If you indeed have a broadcom interface connect to the internet via an ethernet cable and open the Synaptic Packet Manager and install b43-fwcutter then firmware-b43-installer or open a terminal and type:

sudo apt-get install b43-fwcutter
sudo apt-get install firmware-b43-installer


Remove the the ethernet cable and restart Ubuntu and the wireless network should be available.

Packard Bell Easynote HR11 and Ubuntu 11.04 Natty Narwhal

I recently bought a laptop and installed Ubuntu 11.04 Natty Narwhal on it. As usual I will blog about any issues as and when they arise.

The laptop I bought is a Packard Bell Easynote HR11 and the first thing I did was to reduce the Windows partion. To do this I used the partition manager in windows 7 rather than risk using GParted with a Windows partition. I don’t know if this is necessary but I thought it was better to be safe than sorry and the tool is available for free in the Windows 7 anyway. A good Howto on shrinking the Windows partition is here
 
After shrinking the Windows partition I changed the BIOS boot order to make the DVD boot first and then inserted the Ubuntu 11.04 DVD and booted the laptop via the DVD.

From the menu I chose “install Ubuntu” and the installation started. There was a problem with choosing a keyboard during the installation and the installation hung if I chose anything other than a USA keyboard, so in the end I accepted the USA keyboard and the installation completed successfully. This keyboard issue was still giving me problems for a while after installation but I fixed it like this.

After removing the DVD and re-booting I got the Grub menu with both Ubuntu 11.04 and Windows 7 as options plus some emergency recovery options. Ubuntu is the default and will run if you press enter or wait for 10 seconds.

My first disappointment was that the new desktop Unity didn’t start but instead I got Gnome. The reason for this lies in the Nvidia Optimus technology which switches from the Intel to the Nvidia GPU when more graphics power is required. I have managed to fix this problem for now but I still see room for improvement. You can read the blog about this here.

The second problem was the fact that the WLAN wasn’t working. I have blogged about how I solved this problem here.

A bit about me and Linux

I am an Englishman who has spent most of his adult life working in other countries. I have been living in Vienna, Austria since 1998 but that is all another story. This blog is (mainly) about Ubuntu, so here I will simply explain how I came to be an Ubuntu enthusiast.
When I first moved to Vienna I happened to buy a book called “Linux for Dummies” which contained an installation CD for SuSE Linux 5.3. This was my first introduction to Linux and I have never looked back.
I faithfully remained a SuSE aficionado until SuSE -10 when Novell took over and totally wrecked the backup system I had been using for years (I was using Mondo by Hugo Rabson). Dispite several emails to Novell they never had the courtesy to reply, so in 2005 I moved to Fedora Core 4. Fedora Core is an excellent distibution and I found many things to be much easier than with SuSE. It was only after reading an article in Linux Magazine about Ubuntu that I decided to install Ubuntu on a second partition and try it out. I was absolutely smitten! Every thing just works and the few problems I have had have been quickly resolved by searching the Ubuntu Forums

All I want to do on this blog is to offer links to some of the Ubuntu resources that I find useful, some tips, tricks and tweaks I have found out about and to blog any “problems ” I have encountered while playing around with Ubuntu, together with the solutions I used to solve the problems.

I have been blogging about Ubuntu (and some other things) on Wordpress since January 2007. If you would like to have a look at some older posts they can be seen here.

I hope that this blog will be useful to someone :-)