UsualCoding.eu

To content | To menu | To search

Friday, June 8 2007

Patching Around

The new pam_usb release has a new feature called the pamusb agent. It is basically a python daemon that you can run in your user session. It allows you to execute all kinds of events when your key is plugged in or out.
What I wanted was a small notification to know when I’m authenticated. Unfortunately there is nothing as cool as GROWL on Linux (as far as I know) so I decided to add a small tray icon to the pamusb agent.

If you are interested you can find the patched version here:

Currently it is just GTK because I already had some code lying around but I’ll add a QT version later.
This thing gave me some ideas like adding a notification bubble and a small graphical interface to add & remove events. Maybe later…

This also reminds me that I have a small patch for Trac lying around.
Sometimes you want to use Trac as a private project management system denying access to anyone except registered users.

This patch allows you to release some pages as public ones by adding “Public” to the page name (example: “TestPublic”).
You can find it here

Monday, June 4 2007

Modern C++

In the days of dynamic programming languages and gigantic runtime frameworks like .Net or Java it seems complicated and painful to write new code in a compiled language like C++. I mean why bother writing more code, spending more time writing it when you have the choice of implementation.
Well sometimes you don't have that choice. Perhaps because of backwards compatibility, because performance matters or maybe just for fun.

Well you don't need to be jealous of your fellow C# programmers. There are plenty of great C++ libraries out there that make life much easier. Thanks to them you will be able to write portable code without always reinventing the wheel.

Ever wanted to "embed" SQL queries in C++ code? SOCI is the answer:

    int count;
sql << "select count(*) from person", into(count);

string name;
sql << "select name from person where id = 42", into(name);

It provides you with an IOStream-like interface queries and a portable codebase for the most common databases (mysql, oracle, postgres...).

POCO is a complete set of libraries with everything you may have missed in Boost. I addition to the usual stuff like threads, streams and filesystem access, you will also find shared libraries loading, xml, networking and more.

Crazy people looking to create web applications might want to have a look at Wt

So C++ may be a hard language but a lot has been done to help people through their pain.

Have fun.

Links:

Wednesday, April 18 2007

mod_xinerama for Ion3

I guess I was not the only one who was disappointed when Tuomo Valkonen announced that xinerama support has been removed from ion3 since ion-3ds-20070203 and that he would never support it again since “no once really needs it any way” because it’s only “unecological penis enlargement”.

Well there is finally some hope:
Thomas Themel released some working code last week on the ion mailing list
It works for me and there has been other success reports.

The installation is really easy:

  • Download it via darcs or http.
  • Compile it.
  • Add dopath(“mod_xinerama”) to you ion config before the statusbar module.

Thank you very much Thomas for spending some of your time doing this!

By the way Tuomo posted in his usual manner that he will have nothing to do with anyone or any distribution using this module. Thank you anyway Tuomo. Ion3 is still a great window manager.

Update

I just found some debian packages (source and amd64)

Tuesday, April 17 2007

First Post & Some Links

I guess the first post is the hardest one. So let’s start with something easy.

A list of links:

page 3 of 3 -