Monday, April 18, 2011

Installing latest Intel graphics driver to openSUSE 11.4

(Edit: The bug has been fixed in openSUSE update repository, you do not need to compile the driver manually anymore, just install the latest update for xorg-x11-driver-video package.)


I have upgraded my home PC to Intel i5-2500K CPU (Sandy Bridge family). The CPU has a new integrated graphics core (Intel HD 3000) and it works out-of-box in openSUSE-11.4 including 3D and composition. The only problem I noticed are broken popup menus and buttons in title bars in KDE. Esp. broken popups are very annoying as they are hardly usable, see e.g. https://bugs.freedesktop.org/attachment.cgi?id=45061.

Fortunately Intel has released updated X driver version 2.15 which fixes this problem. Here is a step by step how to install the updated driver in openSUSE 11.4.

  1. Install xorg-x11-server-sdk package
    sudo zypper in xorg-x11-server-sdk
  2. Download http://xorg.freedesktop.org/archive/individual/driver/xf86-video-intel-2.15.0.tar.bz2
  3. Unpack the archive
    tar xfjv xf86-video-intel-2.15.0.tar.bz2
  4. Now compile the driver:
    cd xf86-video-intel-2.15.0
    ./configure --prefix=/usr --libdir=/usr/lib64
    make
    (If you have installed 32-bit system then use /usr/lib path in the second command.)
  5. Install the driver (will overwrite the files from RPM package)
    sudo make install
  6. Restart the X server (simply relogin to a new session)
Voila, now your system should use the new driver and the artifacts in the KDE popups should be gone!

Maybe someone can pack the driver into a RPM package in the openSUSE build service, but for me this solution is sufficient...

Thursday, September 16, 2010

openSUSE Conference 2010

This year the openSUSE conference takes place 20-23 October in Nürnberg, Germany. See more details and the schedule here. I'll have a presentation and a workshop there. I don't have the final plan yet ready so here I'd like to ask for your opinions in advance. If you have any idea or if you are interested in a specific topic for the presentation or the workshop let me know via comments below.


WebYaST - Presentation

My plan is to do a similar presentation as I had at LinuxTag event this year. But because here I'll have more time (+15 minutes) I'll show more details and I'll show how to install it in openSUSE-11.3.

Developing RoR Application in NetBeans - Workshop

Because I'm developing WebYaST using Netbeans IDE I'd like to share some nice tips and tricks how to make developing of Rails apps better. I used VIM for editing (and I still use it for non-Rails work) but I wanted something better. Of course, there is a rails plugin for VIM but that didn't help me much. Then I tried NetBeans and I was pleased by the features it has.

So this workshop will be rather an introduction to possibilities of NetBeans and if you are using a plain text editor for Rails development you should definitely come and see it.

I'm still thinking about the content - what application should we use for this session? We could use WebYaST but we could also start from scratch generating a very simple Rails app... I guess I'll leave it on the attendees to decide what they want to hack on, I'll prepare both possibilities... And of course, if you already have your own app you could use it.

Monday, June 14, 2010

WebYaST at Linuxtag 2010

LinuxTag - June 9-12, 2010




Gentoo, CentOS, Mandriva...

This year I took part of the LinuxTag event in Berlin. It is the biggest Linux and Open Source event in Germany and probably in Europe. See more details here.

Booths


There were many booths at the event, every major distribution like openSUSE, Gentoo, Ubuntu... had a booth were users could try the latest version and talk with the developers.



... and of course openSUSE!


And you could also meet people from interesting projects like KDE, FFmpeg, XBMC and so on. I found interesting the demos which showed Linux in embedded devices or there were even robots running Linux.

Presentations

I hadn't much time to visit the presentations but I visited a presentation about Communtu, which is a web server where you can build your customized DVD Ubuntu image. You can add a software bundle which is not included in Ubuntu by default. So you don't have to search for additional repositories and install packages from them.


Embedded Linux: here you could
see Linux running in various
devices


It's somewhat similar to SUSE Studio, but with less features and targeted to Ubuntu users.

WebYaST

I had a talk about WebYaST which a new web based remote management for Linux.
It's a an open source project and it's a successor of YaST.

The main difference between YaST and WebYaST is that WebYaST is a web application in contrast to YaST which is a standard desktop application. WebYaST is accessed via a web browser.

Another difference is that WebYaST supports access control, so you don't have to use the root account for managing the remote machine, you can use any regular user provided the he/she has the access right granted via PolicyKit.

In WebYaST we try reusing the existing code from YaST if possible, but we want to have the YaST dependency as small as possible so for example installing patches is done via PackageKit.

You can find more details in the slides which I made available online using slideshare.net service or at the main WebYaST wikipage.


I thought that there could have been more attendees in my talk, but the hall was really big and even relatively big group of people seemed small there. Anyway, the presentation was successful in my opinion and I hope I spread a word about WebYaST...

If you visited my presentation and have a comment about it please write it below. Thank you for any feedback!

Wednesday, June 3, 2009

Renaming a Rake task

Rake has a class for creating packaging task which builds a compressed package from the sources. It's called Rake::PackageTask and it's quite easy to use it, see the documentation.

Unfortunately the name of the created task is package and it's hardcoded so it cannot be changed.
Yast uses make and the standard targets are package and package-local.

  • package-local - build a tarball source package
  • package - does some checks (like SVN repository update check, syntax check, runs the testsuite...) to ensure that the built package follows some rules so it will less likely break something.

We wanted to use the same targets in the Web Yast which uses Ruby on Rails and Rake as the make replacement.

The problem is how to change the package task name. In Ruby it's possible to change or extend even the core classes like String or Object, which might be good or bad because you can break all Ruby applications very easily... But this feature allow us to extend Rake as we need.

The following code adds rename method to Rake::Task class:

# add rename_task method to Rake::Application
# it has an internal hash with name -> Rake::Task mapping
module Rake
class Application
def rename_task(task, oldname, newname)
if @tasks.nil?
@tasks = {}
end

@tasks[newname.to_s] = task

if @tasks.has_key? oldname
@tasks.delete oldname
end
end
end
end

# add new rename method to Rake::Task class
# to rename a task
class Rake::Task
def rename(new_name)
if !new_name.nil?
old_name = @name

if old_name == new_name
return
end

@name = new_name.to_s
application.rename_task(self, old_name, new_name)
end
end
end

And an example how to use it:

# rename 'package' task to 'package-local' task
Rake::Task[:package].rename(:"package-local")

It was quite difficult to figure out the rake internals, so I hope it will help somebody else...

Monday, May 18, 2009

Debugging Ruby on Rails Application

How to debug a Ruby on Rails application?

I needed to debug a Ruby on Rails application which I just have started to develop. I put some logging commands to the code but it's not as good as using a full debugger for inspecting internal data at runtime.

What's needed?

For debugging a Rails application ruby-debug gem is needed. It can be installed by command sudo gem install ruby-debug in Linux or as a package from an installation repository.

How to start the debugger?

At first, the place in the application where the debugger should be started must be marked by debugger keyword.

Then the application must be started in the debugger - it's simple, just use
--debugger option of the starting script, e.g. script/server --debugger.

How to use the debugger?

When the application executes
debugger command it stops and a debugger session is opened in the terminal.

It supports these basic commands:
l (line) - print the source script
c (continue) - stop the debug session at continue executing the application
bt (backtrace) - print the execution stack (which functions were called)
n (next) - execute the next command
s (step) - execute the next command, step inside a function
h (help) - will list more available commands with details

Moreover it's possible to use normal ruby commands to print or inspect the current objects, using e.g. object.class, objec.inspect methods. And it's also possible to modify the current variables, just use var = value command.

This makes the debugger really powerful, it's far better than simple puts command!