Lenovo laptops with preinstalled Ubuntu?

Just found this on the Ubuntu forums:

Lenovo Blogs - Linux Follow Up

I would be very interesting indeed :)

Bazaar (bzr) howto - Creating your own branch

I have been learning a bit of Mono over the last couple of months and yesterday I decided that I wanted my code in a verison control system. The choice fell on Bazaar for various reasons which is unimportant and uninteresting at this point. Right now I just wanna write down how I did :D

First off you tell Bazaar who you are with:

bzr whoami "Jacob Emcken "

To test it is set correct just type:

bzr whoami
Jacob Emcken 

For the sake of it, lets imagine my project I want to version control is called Starfire. Go to the directory with the project and initialze the directory as a Bazaar branch:

cd Projects/Starfire
bzr init

Within that directory a new directory called .bzr will be created:

ls -la
drwxr-xr-x 5 je je 4096 2007-09-01 23:56 .
drwxr-xr-x 3 je je 4096 2007-09-01 23:37 ..
drwxr-xr-x 6 je je 4096 2007-09-01 23:37 .bzr
drwxr-xr-x 2 je je 4096 2007-09-01 23:37 Glade
-rw-r--r-- 1 je je 5342 2007-09-01 23:37 Starfire.cs
-rw-r-xr-x 1 je je 5342 2007-09-01 23:40 Starfire.exe

Now tell Bazaar which files your branch consist of. In the following example we’ll tell Bazaar to ignore Starfire.exe because we dont need the compiled file within our version control:

bzr ignore Starfire.exe
bzr add .
added Glade
added Starfire.cs
added Glade/gui.glade
ignored 1 file(s).
If you wish to add some of these files, please add them by name.

Ignored files is found in the file .bzrignore, just try run ls -la if you wont take my word for it :P

And finally to actual save the code in the branch repository commit your files:

bzr commit -m "Initial revision"
added .bzrignore
added Glade
added Starfire.cs
added Glade/gui.glade
Committed revision 1. 

By supplying commit with the parameter -m you avoid a text editor popping up asking you for a commit message.

Now you can just hack away and you can check changes with:

bzr diff

Whenever you want to save you changes to the branch, just do a commit again. In the following example I change a line in Starfire.cs:

bzr commit -m "Fixed small typo"
modified Starfire.cs
Committed revision 2. 

Now if you want to make your code available on the another machine ie. a server on the internet you can push you code out there through ssh (and ftp). Place yourself in the root directory of your project. The following example will push the branch out to my server (emcken.dk) where I have a ssh key so I dont need to write a password when logging in:

bzr push sftp://emcken.dk/~/development/Starfire

Now a copy of my branch is available in my home directory on my server (/home/je/development/Starfire).

As a last thing I would like my server to be central for my development. From the root directory of my project I tell Bazaar that my current branch is a checkout of the branch on my server:

bzr bind sftp://emcken.dk/~/development/Starfire

Now whenever I commit changes they will be committed to the server as well so I don’t need to push the copy of the branch out there every time. You can test the settings with:

bzr info

My experience with version control systems are very limited to say the least which was why some of the above wasn’t obvious to me before I made a few tests and read the man pages. But the above was what I needed to get started and I hope that this might help someone else. You can find more inspiration here and here.

Helpdesk from medieval times... users are still stupid

I was cleaning my (computer) desktop and found this video about a helpdesk from medieval times ( sadly it is in Norwegian :( ). I had saved it on purpose because I though it was so funny. Now I found it on YouTube… deleted :P

Dual screen in Ubuntu

Today I got dual screen in Ubuntu working… I have been fiddling around with it a few times before but nothing seriously. Never got it working the way I wanted. Earlier I edited the xorg.conf by hand while following guides from the internet and yesterday I stumbled upon a graphical Nvidia X configuration tool by accident… the solution was a bit of both.

The tool is called nvidia-settings and looks something like the image below.

As far as I know there are 2 ways of doing dual screen in Linux. Either you can use Xinerama or the Nvidia built-in feature called TwinView (I might be wrong here :D). Anyways I chose TviewView because that was the default in the Nvidia config tool. After making X aware of my second monitor with the Nvidia tool I saved the X configuration and restarted the X server with the new (Nvidia generated) configuration. The Nvidia generated configuration had 2 problems:

  • It removed my danish keyboard
  • It made my old monitor and the VGA outled the default monitor. I want my new monitor on the DVI outled to be the default.

By hand I added the danish keyboard configuration which I copy-pasted from the old xorg.conf:

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "CoreKeyboard"
    Option         "XkbRules"      "xorg"
    Option         "XkbModel"      "pc104"
    Option         "XkbLayout"     "dk"

To force the DVI to be the primary monitor I used the following:

Section "Device"
    Identifier     "NVIDIA Corporation NV43 [GeForce 6600]"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 6600"
    BusID          "PCI:1:0:0"
    Option         "NoLogo" "1"
    Option         "TwinView" "1"
    Option         "TwinViewXineramaInfoOrder" "DFP, CRT"
    Option         "TwinViewOrientation" "LeftOf"
    Option         "MetaModes" "DFP: 1600x1200, CRT: 1280x1024"

Section "Screen"
    Identifier     "Screen0"
    Device         "NVIDIA Corporation NV43 [GeForce 6600]"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
        Modes      "1600x1200" "1280x1024" "1024x768" "800x600" "640x480"

First I don’t want to see the Nvidia Logo when X is started… it is a nice logo though :) TwinViewXineramaInfoOrder is the important part because this makes sure that the DVI is the default monitor. You can read more about all the possible options for the Nvidia driver on Nvidias homepage.

My only “problem” is that the background image is streched out on both monitors, but I guess I have to make a custom background image for my dual screen setup. Now I can play World of Warcraft in a dual screen setup in Linux as well which was one of the only things that kept me booting into Windows. To bad performance drops a bit in Linux :( But I have a strong feeling that we are to blame Nvidia for that rather than Wine… but its just a gut feeling. :D

Packaging virt-manager for Ubuntu

Last week I attended a Xen course on SLES10 (SP1 RC5). We used virt-manager. I looked for it in Ubuntu but wasn’t able to find it. Instead I found this request for packaging virt-manager for Ubuntu.

I have been trying to do it myself but it isn’t as easy as I thought… I have never really tried packaging anything before (apart from my wallpapers which doesn’t really have any dependencies or make files).

Virtual Machine Manager has the following dependancies (taken from virt-manager homepage):

python >= 2.4
pygtk2 >= 1.99.12-6
gnome-python2-gconf >= 1.99.11-7
libvirt-python >= 0.2.1
dbus-python >= 0.61
gnome-python-desktop >= 2.15.4
libxml2-python >= 2.6.23
vte >= 0.12.2
virtinst >= 0.103.0

Identified corespondent packages in Ubuntu:

python                  Version: 2.5.1-0ubuntu3
python-gtk2             Version: 2.10.4-0ubuntu3
python-gconf            Version: 2.18.0-0ubuntu1
python-libvirt          Version: 0.1.8-0ubuntu2
python-dbus             Version: 0.80.2-1ubuntu2
python-gnome2-desktop   Version: 2.18.0-0ubuntu3
python-libxml2          Version: 2.6.27.dfsg-1ubuntu3
libvte9                 Version: 1:0.16.1-0ubuntu1

virtinst (downloadable from `virt-manager`'s homepage)

I guess virtinst would need packaging as well… download virtinst. The version of phyton-libvirt isn’t new enough either.

I have been looking at a Ubuntu packaging guide but have already run into trouble (even before getting to phyton-libvirt):

checking for PYGTK2... configure: error: Package requirements (pygtk-2.0 >= 1.99.11) were not met:

No package 'pygtk-2.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables PYGTK2_CFLAGS
and PYGTK2_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

make: *** [config.status] Error 1