Sanremo merda

•3 February, 2010 • Leave a Comment

- Sorry my english readers, this is gonna be a post in Italian. Yes, my very first, but it’s about that kind of stuff that can happen in our beloved country only. Sorry for the noise. -

Detto questo

Mi sono rotto i coglioni. Mi sono talmente rotto i coglioni che scrivo pure in Italiano. La demenza senile, l’ignoranza, il bigottismo di questo paese stanno toccando dei picchi a dir poco inimmaginabili che oggi sono stati suggellati da due visioni surreali. Ma prima ricordiamo di cosa stiamo parlando.

Sanremo, per chi se lo fosse dimenticato, è l’immagine più viva della decadenza, musicale e non, nel nostro paese.

Sanremo, ricordiamolo, è quel festival che ospita artisti come Povia, che fanno notizia solo perchè cercano uno scandalo a caso o un qualcosa di benefico. Ricordiamo che la sua presenza al festival è stata: con una canzone a scopo benefico fuori concorso, con una canzone sui piccioni suggellata con la partecipazione al family day, con una canzone contro i gay, e l’ultima con una canzone sul caso Englaro. Per la serie quando la musica la fa da padrona.

Sanremo, per chi l’avesse rimosso, è quel festival dove gli Afterhours portano una delle canzoni italiane più belle dell’anno (Il paese è reale), e vengono sbattuti fuori al primo turno.

Sanremo, se ci fosse bisogno di dirlo, ha bisogno di pagare qualunque ospite di caratura superiore ad Albano tonnellate di euro per farlo venire svogliato e piantarci figure di merda.

Sanremo, sempre che ve ne siate accorti, è quel festival dove gente che ha esordito 20 anni fa e canta musica che andava 50 anni fa, e solo nel nostro paese, ripropone sempre la stessa canzone con un testo inspiegabilmente sempre più banale (“L’amore non corrisposto è sempre amore” è uno degli esempi migliori dell’anno scorso), ma trova sempre una porta spalancata e nessun “fanculo”, che sarebbe più che lecito. In compenso chi porta qualcosa di diverso dalla solita solfa e di qualità (vedi Max Gazzè) è silurato all’istante.

Sanremo, giusto per dirlo, è la dimostrazione che gente con palle giganti che fa teatro, musical, e ha studiato anni, deve portare una canzonetta da festa di piazza per avere un po’ di visibilità. Che alla fine mantieni solo se sei una bella figa.

Potrei andare avanti per anni, ma dopotutto Sanremo è uno specchio del nostro paese di merda, peraltro sempre più fedele. Infatti da un paio d’anni a questa parte è dominato da “talent show” televisivi, l’anno scorso velatamente, quest’anno spudoratamente.

Alla luce di tutto questo, vi invito a visitare http://sanremolab.sanremomanifestazioni.com/ . “Per diventare famosi bisogna studiare”.

Io, che umilmente faccio musica, ci investo del tempo che non ho, dei soldi che non ho, e miro sempre a fare qualcosa che abbia un minimo di significato, come dovrei reagire a una frase del genere, detta da gente che si limita a dimostrare l’esatto opposto. Spiegatemi perchè certa gente che non sa nemmeno da dove si parte per cantare è sui vostri palchi. Spiegatemi perchè certa gente che calca i vostri palchi non sa nemmeno cosa voglia dire cromatismo. Spiegatemi per quale cazzo di motivo prendete per il culo la gente come me, che nella musica ci crede e la considera ancora una forma d’arte tra le più valide ed espressive.

E poi oggi si viene a sapere che Morgan viene escluso da Sanremo perchè ha dichiarato di fare uso di cocaina. Escluso da gente che senza dubbio ha le narici ben più sporche di lui. È un teatrino patetico, ma è tristemente ancora un punto di arrivo per chi fa musica: se sfondi a sanremo, è fatta. E tutto ciò è terribilmente, terribilmente triste.

Tuttavia, non riesco a togliermi quella frase di sanremo lab dalla testa. Beh, poi se guardi il sito ti accorgi di quanto costi l’iscrizione, di quali siano i corsi e quale sia la loro durata. Un vero e proprio conservatorio lampo, non c’è che dire. Ma chiunque faccia musica e non abbia un contratto milionario è davvero visto così tanto come un coglione?

Vaffanculo sanremo. Vaffanculo.

Polkit and KDE: let’s make the point of the situation

•22 December, 2009 • 10 Comments

Hello folks,

Welcome to a post describing the current and future status of all things PolicyKit, polkit, $%$”, whatever related to policy handling in KDE, for users, developers, packagers and distributors. A must read, let’s say :) .

PolicyKit, polkit… what the hell?

Yes, PolicyKit and polkit are two different pieces of software. After reaching version 0.9, PolicyKit has been discontinued, and polkit-1 took its place. polkit-1 is not backwards compatible with PolicyKit, but still it is able to run together with it, even if you probably don’t want to do that. Also the API are completely different, so polkit-qt was no longer sufficient to cover up polkit-1. That’s the reason why polkit-qt-1 was born.

Yet another Qt wrapper: polkit-qt-1

First things first, the main credits for polkit-qt-1 go to the awesome Fedora KDE team, especially to Radek Novacek, Jaroslav Reznik and Lukas Tinkl, who did most of the job, whereas I mainly reviewed and put quite a lot of finishing touches. Now that credits are due, let’s dive into what is polkit-qt-1. It is a wrapper library around polkit-gobject and polkit-agent, which lets developers write easily applications using polkit-1, and even write custom authentication agents.

Compared to polkit-qt, the API is much nicer and the library itself is much more polished: I also changed a lot of things I wanted to change in polkit-qt (especially in the GUI part) but I couldn’t do for the sake of BC. Of course you are NOT encouraged to use this library if you’re developing on the KDE Development Platform >= 4.4: you want to use KAuth instead. But, if your application depends only on Qt or you need to do something strictly related to polkit-1, then polkit-qt-1 is your first choice.

Then what about polkit-qt?

Polkit-qt will experience one last release (0.9.3), on which trunk already depends on. This release is critical for it to work well with KDE 4.4 and Qt 4.6. I sincerely hope this will be the very last release of polkit-qt, since the only reason why I will want to do another one is for fixing a critical bug.

Ok. In all of this mess, I didn’t really get the point of what’s happening with polkit or PolicyKit in KDE 4.4

Fairly reasonable. Let’s try to get things explained better. There will be lots of changes from KDE 4.4 to KDE 4.5. KDE 4.4 will still use PolicyKit 0.9 and polkit-qt as the default supported authorization framework. This is because polkit-1 has not yet been released to a stable version, and because we’re not yet in feature parity with the GUI tools PolicyKit 0.9: the authorization manager KCM is not there yet in polkit-1.

Polkit developers decided not to provide a similar tool in GNOME. I feel this is a strong regression, as a lot of users appreciated the authorization manager and used it to solve some policy related problems, and it’s a tool of unvaluable help for system administrators. For these reasons, KDE will surely provide in the near future a similar tool for polkit-1.

Just like it happened with KDE 4.2, the KDE tools for polkit-1 will be released separately. They now lie in extragear/base/polkit-kde-1. Only the authorization agent is in (which is the authentication dialog), the KCM will be developed later. I will do a release shortly (in a pair of days) together with polkit-qt and polkit-qt-1, and I will post a small entry on my blog when I’ll do.

KAuth has a working backend for polkit-1 based on polkit-qt-1: however, the default backend is still the one based on polkit-qt. To use KAuth with polkit-1, simply compile kdelibs with -DKAUTH_BACKEND=PolkitQt-1, and that will do.

And for developers? Well, if you used KAuth, don’t you worry. You don’t have to port a single line of code. Just recompile kdelibs as explained above, recompile your application from scratch, and watch it run on the top of polkit-1. Sooo amazing.

And what about KDE 4.5?

In 4.5 the following things will happen:

  • polkit-kde-1 will be moved to kdebase/workspace
  • PolicyKit-kde in kdebase/workspace might be removed and put in extragear, where it will enter maintenance mode.
  • polkit-qt might be removed from kdesupport and put somewhere on gitorious
  • In KDElibs, KAuth will default to polkit-1 for its backend

This is because by the time 4.5 will be released, probably PolicyKit 0.9 will be completely deprecated, and polkit-1 be absolutely ready for prime time.

The “might” points have to be discussed with the whole community, and they will probably strongly depend on the situation of PolicyKit at the time when the decision will be due.

Awesome. Now it’s all clear: just tell me what I need and where to grab it

KDE 4.4 trunk opt-depends (since a pair of hours, actually) on polkit-qt 0.9.3 and polkit-qt-1 0.95.1, both of which have not yet been released, but if you compile kdesupport from trunk you can simply do a fresh checkout. They will get official releases in a pair of days, just to let some hours pass. polkit-kde-1’s first release will happen together with the two libraries, but if you’re extremely impatient you can check it out in extragear/base/polkit-kde-1.

Good. But since we’ve reached the end of the post, what about giving a small advice on which polkit/PolicyKit should I use?

Uhm, now you’re becoming pretentious… ok -.-. Look, if I were a distributor, and all the major tools (NM, HAL, whatever) started requiring polkit-1 and KDE would be the only thing using PolicyKit, I’d go for polkit-1 to avoid having 2 system that do the very same thing overlapping. But, if that was not the case, I’d probably stay with PolicyKit 0.9.

If you were wondering, I have both (PolicyKit and polkit-1) installed, as you might have imagined, but I’m still using the first. I will probably move to polkit-1 soon, though, since it’s the future and I don’t like living stable :)

I hope you enjoyed the post, which was hopefully explainatory and complete. For any questions, drop a line in the comment box.

Introducing Shaman, a new universal package management frontend

•1 December, 2009 • 49 Comments

Hello people,

yes, you can shiver at the title: we have (are still, actually) done a new package management frontend. Why? Because KDE missed a great one. Maybe some of you using Arch Linux will recognize the name Shaman: it is the default package manager frontend in Chakra, and my very first project with Qt. As such, it has grown quite old, and it’s showing the limits of my early programming skills, which made it almost unmaintainable by now. So me and Lukas (boom1992) decided to take it on a whirl and rewriting it from the ground up, with a more ambitious goal. We had some clear goals in mind:

  • It should have been extensible to any package management system and integrated with it
  • It should remain simple, and be extendable to the sky throughout plugins
  • It should be completely asynchronous to bring the user the best possible experience
  • It should be scriptable, to lower the barrier of the contributors and open up more possibilities to backends not in the C realm

There is one platform which actually makes this all possible, and it’s KDE :) So we created Shaman 2. What is it?

Chapter 1: Shaman for Developers

Before being a package manager, it is a library. Think about it as the Solid or the Phonon of package management. This library provides an easy to use interface to implement frontends, and an abstraction layer for building plugins and backends. A backend is an interface to a package management system, such as apt, yum, packagekit, alpm, whatever. It is implemented as a static plugin that will be chosen upon build. People who need to implement a backend have to reimplement Shaman::BackendInterface and Shaman::Package, and make it work. It’s really easy to do: the current packagekit backend weights ~900 lines of code (and a lot of them are made of strings) and it’s almost feature complete.

Also, in the spirit of giving the backend developers the maximum flexibility, not forcing them into workarounds and getting the best possible performance/user experience ratio, you can implement delayed loading, custom caching of the information, custom progress reporting (soon), custom searching implementations and more. Shaman comes already preloaded with “Insane rockstar settings” (cit.), a backend for PackageKit and one for Aqpm (pacman), but we are looking forward to people who would like to port Shaman 100% natively on platforms not fully supported by PackageKit. For example, Shaman will support soon streaming transaction questions with custom widgets and creating scripted backends. Did you see any references to apt and/or debconf here? I did not.

At the moment all the code in Shaman runs unprivileged: in the near future, though, it will be given the possibility to create a backend with root privileges just by giving a switch to Shaman at compile time. Thanks to some PolicyKit+DBus magic, the backend (and only the backend) will be run privileged and will require authorization to perform any actions. You still have the option of running Shaman as root, but these days it’s really nonsense. You can also simply bypass such a possiblity and implement this straight into the backend (as Aqpm and PackageKit do), but this boils down to be your choice.

What is extremely cool about Shaman, though, is its plugin system. Almost any functionality can be implemented through plugin, from the GUI or the core side. In fact, the 2 main widgets of the Shaman interface are plugins as well. Plugins have a very important role in Shaman, and can also play an active part in transactions. Every plugin, in fact, can register some “Hook”, that can be run after and/or before a transaction. Pre transaction hooks have also the power of reporting fatal errors and aborting the upcoming transaction before it even starts. As you can imagine, there’s a lot of room for making Shaman fully integrated with the underlying distribution and perform some annoying tasks not belonging to the package management system. For example, what about a plugin that after a transaction checks if the kernel was upgraded, and in case rebuilds the VirtualBox kernel module?

Scripting support, as I told you, is a priority. Even if it’s not working right now due to constant changes in the API, it will be made ready as soon as we reach a semi-stable API, and it will use Kross. The basics are already there and ready, so it’s just a matter of time. Help welcome on this side, especially from some Kross masters around :)

The API is still unstable but it’s stabilizing as I write this. You know where to reach me, if you’re interested, we can have a chat and you can bug me with some questions :) I look forward to plugin and backend developers

Chapter 2: Shaman for users

Anyway, what about the user interface? The user interface is meant to be non-modal when and where possible, simple & easy to use yet detailed, still remaining beautiful. How does it look like as of today? (Some screenshot here on Arch, some on Fedora, using Aqpm and PackageKit)

P.S.: The interface is changing by the minute and the default dialog sizes are much smaller than shown. Hey, this is a preview footage after all :D

You might or might not have noticed some small differences in the PackageKit and Aqpm UI. This is because Shaman adapts its UI depending on the capabilities of the backend. So you will never be shown something your backend does not know about. Well, unless the backend developer is cheating, of course :)

Shaman implements also some neat stuff: for example, your queue is retained on exit. This means that if you mark some packages to be processed, then your girlfriend calls you and you realize being already 30 minutes late for your date, just don’t worry: close Shaman and turn off your PC: the next time you will start Shaman, it will automagically restore the last queue, which will be ready to be processed. There is also a transaction logger ready for you, so that you won’t lose any bit of history.

There is also security: Shaman is meant to be run as a standard user, using technologies such as PolicyKit and KAuth for granting authorizations for privileged actions.

And it installs, removes and upgrades your packages too!

Near future development

Shaman as the frontend is only the first product in our quest to provide a fully integrated and KDE branded experience for package management. Those of you who used/tried Chakra might have run into, and hopefully loved, Chase, the automatic update system. Chase will be improved and ported over to libshaman (not a lot of work actually), to provide automatic updates in a fully integrated way. And there is also some stuff boiling in our minds to bring to Plasma some of the package management: we are planning on a Plasmoid which will serve as a global visualizator for transactions done through libshaman, and will also provide some very basic package management functions. All the three tools (Automatic updates, plasma widget/engine, Shaman) will be tightly integrated and cooperating, instead of conflicting (just as it happens with Shaman 1 and Chase in Chakra right now), to provide users an easy and integrated way of managing their software.

That’s all, folks

And I sincerely hope I raised some interest :) I am actually looking forward to distribution developers to get excited and use Shaman in their own distros. Up to now I have a VM for Fedora and Debian where Shaman runs great using the PackageKit backend.

The most important thing, is that Shaman is still not ready to be used. But for the brave souls and curious developers, playground/sysadmin/shaman is the place to be

Small update: Power management bug week(s)

•27 November, 2009 • Leave a Comment

Hello people, long time no blog.

I have a lot of interesting news for you, I will write a couple of posts in the next days about them. Today I just wanted to give out a small quick update on Power Management, following the drill of Sebastian

So, for the next 2 weeks (and given the freeze time) I happily try to declare and organize the Power Management bug weeks! 2 weeks in which I will dedicate to clear out the list of bugs in Powerdevil and Solid::PowerManagement. Of course I will need your help. It would be nice to have a “central” day, like a small powermanagement bug day in the middle of that. Since I never did such a thing, it would be nice to have some info/help from our bugsquad.

In the meanwhile, if you feel like closing some duplicates, reproducing and providing more information on existing bugs, it would be an extremely valuable help.

More news on completely different stuff coming up soon, stay tuned :)

KAuth in use: privileged KCModules

•15 September, 2009 • 8 Comments

Hello people,

Today I want to write a more extensive introduction and how-to, with the KAuth API being finalized, on writing a privileged KCModule. Please note that this information will be soon on Techbase as well.

So, before we start, why should you read this post?

  • Because you’re a developer who needs to develop an application requiring high privileges
  • Because you’re a developer who needs to develop an application requiring authorization
  • Because you’re a curious developer
  • Because you’re a curious user

So, defined the target audience, here we go :)

Back in the KDE3 days, we had an “Administration mode” button, that basically removed the kcm widget, XEmbedded another widget running as root into the kcmshell, and that’s it. Pretty ugly and unsecure, but still working. Most of all, the developer did not know what was happening under the hood, since what happened is in no way different than issuing right now “sudo kcmshell4 <module>”. In KDE4(.4), things are different.

We do not have an “Administrator mode” button, neither widgets being embedded. We do have small helper applications running in the background with high privileges, performing the requested action only if explicitely authorized by the underlying policy system. And we have an easy API, that extends throughout KDEUI and KCModule to make things transparent, customizable, yet extremely easy to the developer.

So let’s start. We are trying to create “fookcm”, a kcmodule for writing to /etc/foo the lines “foo”. So important. As you, experienced developer should know, the first lines will look like this:

K_PLUGIN_FACTORY(FooKCMFactory, registerPlugin<FooKCM>();) K_EXPORT_PLUGIN(FooKCMFactory("fookcm"))
FooKCM::FooKCM(QWidget *parent, const QVariantList &)
: KCModule(FooKCMFactory::componentData(), parent)
{
KAboutData *about =
new KAboutData(I18N_NOOP("fookcm"), 0, ki18n("Da foo KCM"),
0, KLocalizedString(), KAboutData::License_GPL, ki18n("(c) foo"));

Remember well the name we gave to the module (fookcm), we will need it later. So you wonder what we need to add to the constructor to make the magic happen. A single line:

setNeedsAuthorization(true);

What does that do? A variety of things:

  • It maps the KCM to the action org.kde.kcontrol.<modulename>.save. So our save action is named org.kde.kcontrol.fookcm.save. Keep this in mind, we’ll need it later
  • It turns kcmshell/and or systemsettings Ok and Apply buttons authAction property to the newly mapped action, so that buttons reflect the action state (eg: they are disabled, show a key instead of the icon, etc)
  • It sets some additional visual feedback to the kcmodule.

After this line, your header (obviously after the action install phase, which I’ll show you later on) when you are required to authenticate will look something like this:

This is how the header will look like

Neat, isn’t it? But to achieve this, a small thing needs to be done. We need to create an action file. So let’s just open your favorite editor on fookcm.actions (the “actions” extension is mandatory to let scripty translate your file successfully) and let’s write this down:

[Domain]
Name=Foo configuration
Icon=foo

[org.kde.kcontrol.fookcm.save]
Name=Save the foo
Description=Authentication is required for saving the foo
Policy=auth_admin

It is pretty straightforward, but let’s see this in detail. The structure is a standard ini file. You can define an unlimited number of actions in each actions file, provided they belong to the same domain (in this case org.kde.kcontrol.fookcm). The group name is the action name, Name is what will appear when you will browse the PolicyKit Authorization module, and Description is the message that will appear in the auth dialog. Policy is mandatory as well, and defines the default policy. It can be yes, no, auth_self or auth_admin. There is also an optional field, Persistence, that will define the default persistence of the authentication. There is also a special “Domain” group: this defines some additional settings that will affect all the actions under the domain you’re configuring. You can set the Name, that will appear as the folder name in the PolicyKit authorization module, and an icon that will be shown both in the authorization module and dialog. The whole Domain group is advised for better feedback, but not mandatory.

Done that, we need a small magic in our CMakeLists.txt. We need to register the actions like this:

kde4_install_auth_actions(org.kde.kcontrol.fookcm fookcm.actions)

Straightforward as well. Just define the helper ID (which basically is the action domain) and the action file. This will take care of generating and installing the actions for you.

So now we have our beautiful kcmodule with all bells and whistles and our save() function will be called just if the user is authorized to save the module. But we’re missing one step, huh? We actually want to save stuff in /etc, so we need high privileges. Then it’s time to create our helper.

Creating an helper is really easy with KAuth, since with the tools the library provides you, you won’t even know another application is running in the background. The helper has also remote debugging, so if you issue a qDebug() from the helper application, you will see the output in your main application. So you really don’t have to care about the fact it’s separate. But let’s get to the point.

Let’s create a new class for the helper, let’s name it FooHelper. The header file would look like this:

#include <kauth.h>

using namespace KAuth;

class FooHelper : public QObject
{
Q_OBJECT

public slots:
ActionReply save(const QVariantMap &map);
};

There are some small but important details here. For every action our helper implements, we need to define a slot that has EXACTLY the same name as the action itself (so save), returns an ActionReply and accepts a QVariantMap. It’s EXTREMELY important that the return type is an ActionReply and not a KAuth::ActionReply, eg you have to use using namespace KAuth. Short explaination: otherwise things won’t work. Long explaination: we’re using QMetaObject::invokeMethod for calling the actions, and it is extremely picky about namespaces.

To understand better the arguments, let’s have a look at how to implement save() in our kcm

void FooKCM::save() {
KAuth::Action *action = authAction();
QVariantMap args;
args["path"] = "/etc/foo";
args["contents"] = "foooooo";
action->setArguments(args);
KAuth::ActionReply reply = action->execute();

I did not write the followup, where you actually check the result of the reply and act accordingly. So what we do here is grabbing the authAction of our KCModule, attaching some arguments, and executing it synchronously. I think you can now realize the reason for the arguments of the save function of the helper. ActionReply can also carry a QVariantMap, so you have a way of returning data back from the helper. In any case, returning ActionReply::SuccessReply will just tell the main application that everything went well.

Almost done (I’m just skipping the save implementation in the helper, as it is really stupid). We need two more small things, one in the helper implementation (our foohelper.cpp) and one of course in cmake. The first one is a macro, and it goes like this:

KDE4_AUTH_HELPER_MAIN(“org.kde.kcontrol.fookcm”, FooHelper)

What does it do? It accepts our helper ID (so the actions’ domain), and the class which represents the helper itself. Under the hood, it creates a main function for the helper instantiating and registering your class. CMake stuff is pretty straightforward as well:

kde4_add_executable(fookcmhelper foohelper.cpp)
target_link_libraries(fookcmhelper ${KDE4_KDECORE_LIBS})
install(TARGETS fookcmhelper DESTINATION ${LIBEXEC_INSTALL_DIR})
kde4_install_auth_helper_files(fookcmhelper org.kde.kcontrol.fookcm root)

It adds a new executable, that has to be installed (this is mandatory) in LIBEXEC_INSTALL_DIR. Installing it elsewhere will make things fail. The additional macro you surely spotted takes as arguments the target, the helper ID associated to it, and the user under which the helper will run on. Yes, you can also create helpers not running as root! This can be extremely useful to improve security in some cases. Under the hood, this macro generates and installs a lot of files. It creates a dbus policy for your helper, so that it will be able to be exposed on the system bus, and an activation file, to make it start up automatically. As you probably have realized by now, the helper ID is nothing else but the service name of the helper. But as you noticed, you (as a developer) do not even know that DBus is running under the hood, as you don’t see/have to write a single line of DBus related code.

That’s it. You now have a nicely integrated, rock-solid, clean and extremely secure KCModule that saves data with high privileges. I’m not covering why it is secure (you can read about Polkit and/or Authorization Services if you are interested) as this post is already long enough.

Also, what I’ve shown you is just a very basic usage of KAuth. You can, for example, execute actions asynchronously, and stream progress of an action, and even data from your helper. To learn more about KAuth, go now to the KDE API Documentation for a complete overview of KAuth and its capabilities, and be sure to have a look at the KAuth namespace documentation, which features a really extensive introduction/tutorial that will be reformatted as well to be included in Techbase.

Now, before you start yelling this is the best thing you’ve ever seen, there are also some caveats you might want to be aware of and, of course, avoid:

  • If you are using a non-standard type in your QVariant, Q_DECLARE_METATYPE is not enough. Data is streamed through the bus in a binary datastream, so you have to implement custom operator<< and operator>> of QDataStream for your class. Please read QDataStream documentation for more details about this.
  • KAuth needs to install some files in privileged and specific locations. In particular, if you are installing stuff in a different prefix than /usr, things will not work out of the box. You have to tweak DBus configuration and move PolicyKit files to /usr (even though the PolicyKit guys are fixing that) to make things work. But be careful in editing DBus configuration as you might end up screwing your system. More details on that will follow on the TechBase tutorial. If you are installing KDE from packages you can simply ignore this, or blame your packager.
  • I noticed (at least here) that sometimes DBus does not recognize immediately new policies/autostart services. Before screaming about things not working, you might want to try restarting DBus first.

That’s all, folks. Hope you enjoyed this, please give me some feedback before I push a refined version of this tutorial on TechBase.

Bilbo blogger Test

•14 September, 2009 • Leave a Comment

Just testing Bilbo Blogger.

Looks like it could actually rock.

So byebye wordpress web interface!

Tokamak Wrap-up

•6 September, 2009 • 1 Comment

So, quite lately, but it’s my time as well to write a small wrapup on this wonderful Tokamak. Shame I had to leave earlier than all the other guys due to an exam, but I managed to have a great time anyway. I met a lot of people who I really wanted to get in touch with since a lot of time, and it was great sharing rooms and beds with a lot of people you work with all the year but you somehow manage to meet in person just in some special occasions just like this one :)

The location was lovely, the host even more, so Mario keep your mobile switched on as I could call you anytime to share a beer together in the beautiful randa again. And I also hope I won’t have to wait some more years to catch up again with all the great KDE people I met in Switzerland.

Of course, it was not just about socializing. We also pushed a lot of new stuff, which we will refine and get ready for 4.4. KAuth is almost stable BC/SC wise (will be soon on cmake side, since some macros are still being discussed by me and Alexander), and it took really some pain to push it in. Pushing a new framework that relies on generating some special files in kdecore can be difficult and you sometimes need to take the most difficult route to lead to innovation.

I had also a lot of valuable reviews after pushing stuff in trunk. I had seen this coming, and this is probably the most important reason why I pushed this framework that early in the development cycle. This way, I sure have to change some stuff around in kdelibs/kdebase, but I am also sure that when we have 4 months yet since 4.4 release, we have a 100% tested and reviewed framework ready. I realized during all my time in KDE that kdereview, for this kind of stuff, is really not enough; and I was proven right ;)

What am I going to do in the next days: some tutorials for developers (still did not write anything due to the fact that we’re still stabilizing the API), some more talking with people interested to use KAuth for their stuff, and make a plan for trying to integrate KAuth into KIO::File. It’s a difficult task, but we have some great people ready to help (Davide, Nicola, Riccardo), and we really want to get this feature in, so we’ll try our best.

And some stuff for users (hoping that Sebastian will push the nice “commercial” videos we made :D ), such as screencasts, screenshots and whatever to let you know what this thing is bringing to your table.

All in all, we really managed to join productivity and fun in a way I did not think was possible, but this is what happens when you share some days with some of the best developers (and crazy people) out there. You guys rock, thank you for the great time I (and you hopefully) had, and I’m really looking forward to see you again!

Tokamak: KAuth into kdelibs

•31 August, 2009 • 9 Comments

Yes, KAuth is finally in KDELibs. Yes, systemsettings has integration. Yes, the first module (date/time) is already ported & ready. I know this was a long awaited feature by many of you, and now it’s in. But today, I want to show developers how to enjoy the new power of this framework.

First of all, what is it? It is the first known framework to check for authorizations by fine granting them and/or granting applications high privileges in a transparent, secure way completely integrated with the desktop and completely native and multiplatform. So you have quite some power in your hands. Why should you use it? Well, if you want to lock out users from certain features, for example, or to perform privileged actions. But let’s get into details.

KPushButton and KAction have 2 new methods, which are setAuthAction and authAction. Just set a KAuth::Action into one of them and you will have the following things for free: the authentication will be automatically triggered when the action/button has been triggered, you will get an authorized() signal when the user actually got the authorization, and the button/action change their availability and appearance according to the action status. Quite straightforward, huh?

KCModule has a new method as well. It’s (set)needsAuthorization(). Whenever you set this to true, an action for it will be created, named “org.kde.kcontrol..save”, where name is your KCM’s main as specified in the KAboutData. Just do this, and you get all the ui integration for free and save() will get called just when the user grants that authorization. Even simpler, isn’t it?

Want to have a look? A tutorial on Techbase is coming up, but for now, you can simply have a look at kdebase/workspace/kcontrol/datetime and kdelibs/kdecore/auth/example to have an idea. I’ll ping you back when the tutorial gets ready :) oh, and api.kde.org is your friend as well, Nicola made a great work in documenting all the library just for you guys to pick it up.

So put your thumbs up for a great GSoC project ended, and stay tuned, because this is just the beginning. The next keywords are now: KIO, GHNS, and KIOSK.

And put your hands up for the fun and the productivity we are having at Tokamak 3!!!

My take on the Mono/C# debate

•1 July, 2009 • 58 Comments

As you might have understood if you’re reading me, if you’re easily offendable on this matter, you’d better skip this post.

So, i figured out I should shout out something. Because I am always interested in hearing skilled, readable, balanced and well-made opinions from people such as Richard or Adrian, but I’m fucking tired of hearing random people screaming out why mono is cool or not. These kind of people don’t even know what coding is about, or they just learned Java or C# at university and they’re like “oh shit, I can code!!”. STOP THAT.

This is a technical, and ethical problem that regards DEVELOPERS. Users will end up having choice. All you pro/anti-mono fanboys, what is difficult in installing or removing mono, being it provided by default or not? No matter what your position is.

After this small rant, hoping to have made some things clearer, let’s move forward.

I’d like to skip the ethics/politics part for a variety of reasons. First of all, I’m all for things that work, if they’re free, much better. That’s why I’m using closed nVidia drivers, because they work better. Secondly, everyone has freedom of choice. And this also means freedom on choosing where to be free. And I hope some false freedom advocates will revise their concept of freedoms. One should be free of being not free as well. And more than that, this is not my field, so I’ll just leave the word to someone knowledgeable (following what I said before)

That said.

I am still asking myself why on earth people should need Mono, .NET, C# or similar stuff. I am starting to think that while more and more people are starting to code, the overall coding skills are getting lower and lower. Maybe it’s just me being too strict in using almost always C/C++, but I remain extremely confident in the fact that if you don’t know how/don’t want to manage memory, you should be doing something else. I’m not saying that using python, ruby or similar stuff is bad: I do it as well, and enjoy doing it. I think being capable of using JUST python, ruby or similar stuff is bad. Also for broadening your mind and knowledge. Just my opinion anyway.

Before you start yelling at me: yes I used C#, and some friends such as Java (similarity is almost ridicolous). I wrote about that as well. There were some things I liked, but a majority of things I disliked.

Now, comparing what Java/C# has to offer (just to demonstrate that I’m not blindly bashing C# only, that I also like better than Java) with Qt, there should be a single question.

Why on earth someone should choose C# over Qt/C++?

I don’t know, really. Maybe introspection, it’s much better. Maybe serialization, it really works out. Maybe something else. But when i talk about something that should be the backbone of your program, such as event loops, threading, events, and whatever, Qt/C++ puts C#+Forms/WPF/etc to shame. Please come up with some technical reasons why C# is better. And don’t start with compilation: I don’t think it’s so relevant for a deployment.

I don’t want to spend more time talking about this: you can verify what I’m telling you is true by looking at the percentage of KDE code written in languages different from C++. And we have some great bindings.

So, what’s the conclusion? Why people can still code fast, efficiently and easily with an “old” language like C++? Probably because the toolkit/framework integrates extremely well and extends the language to fit everyone’s need. That’s what Qt does.

So this is the point, on which you are free to flame me until death: the problem is GTK. Consider the amount of programs recently written in GTK. A huge percentage of them is in Python or Mono. Let’s be clear: I don’t have anything against bindings. But try stopping your flaming ego and follow me a bit more.

We have PyQt and Qyoto. Yet they are not so widespread and planetkde is filled with new C++/Qt apps. So where is the problem? Probably people are no longer comfortable in programming with GTK/C. I did it a while ago, and it was quite a pain to me actually, and it made me want to look into python, damn my laziness. I think that this is the kind of route a lot of people take nowadays.

Now you’re expecting a sort of GTK/GNOME flaming here, right? Well, bad for you. This was not meant to be a flame, just an introspection to understand the reason why mono existed (see the introduction). And my take is that mono is just a way to “modernize” something that is NOT obsolete (and I repeat: NOT obsolete), but simply no longer fitting the 2009 attitude of “oh shit I need to create a program in 3 lines of code!!!”. To demonstrate that I’m actually not attacking GNOME and/or GTK, I’ll give you Microsoft.

If you think about it, the iter that Microsoft followed for getting more developers is not that different from the one GTK took. So, what’s the conclusion?

Mono is not the panacea. Mono is a great way of developing easily, without spending that much time. But some skilled GNOME developers already showed the world (*cough*GNote*cough*) how Mono is NOT saving time to someone who is skilled and knows how to do things the right way. To me, GNote is not a symbol of freedom, but a symbol of the fact that people can still use GTK with success with C or C++ (and by this point I hope you realized that this is not a war against GTK, more some constructive criticysm).

So, Mono is nice to have, but not required to have, and not necessary to have. And I don’t see (today) a reason why a developer should choose C#/.NET/Mono over Qt or some other great frameworks out there. And I still think it is a nicer bridge FROM Linux TO Windows, and not the other way round. You should be blind if you can’t see it, or you’ve been simply hiding in your house without looking for a job those days. People need to make money, dude.

Last line, I bored you enough: my solution to the debate is not boycotting, insulting or anything: is having easier, crossplatform toolkits, and more skilled developers.

And now come on, the flaming box is just some pixels away from you!

Some help on a possible new instrument

•23 June, 2009 • 7 Comments

Dear lazyweb,

As you know, it’s not in my style filling PlanetKDE with non-KDE related stuff, but this time I really need some help from the community, as I know that there are some good musicians around you.

I’m about to buy a synthesizer, since we’re adding some electronical influences in our band (we’re mostly playing rock music). So, here it comes. I need something on a decent budget, with good action on the keys (I’m quite choosey as a pianist), and decent piano, strings, and lead sounds (square and sawtooth are the sounds that intrigue me the most at the moment, but I’m opening to a new world in which I’m quite ignorant).

I would use it with piano sounds, and with synth sounds, mostly to harmonize guitar parts (such as solos). I would let you taste a sample of our latest work but it’s still in the studio. Anyway, this synth should be suitable especially for live performances and optionally for composing.

At the moment, my choice for budget and everything is the roland Juno-G. It fits my budget and it looks like it will fit my needs as well.

Here’s the question: any advice on this being a good/not bad/worst ever choice? Any other synths you would recommend me?