Andreas Schneider a cosmological pedestrian

23Feb/102

Featurecasts

Yesterday I've visited the Tokamak4 Sprint. I've attended the talks in the evening and then had dinner with some KDE hackers. Today I've looked at PlanetKDE and saw the KDE bluetooth screencast from Alex Fiestas. I liked the screencasts in the KDE 4.4 announcement, it should the users what's cool and new. Yesterday I've heard the first time about activities in KDE4. I wondered what Aaron is talking about.

Here comes the conclusion:

We need a Featurecast section on the KDE website with screencasts that shows all the cool hidden stuff!

This should be the first thing a user finds on the KDE website. The user normally hasn't installed KDE at all or doesn't have the latest version. So the first thing should be something which shows what you can do with it and how cool this stuff is.

Filed under: KDE 2 Comments
10Feb/100

Documenting the Source

As you maybe know I have a new job since last December and I'm working on
Samba4 now. Samba4 is a monster so I've asked for some simple tasks to get
started. The task was to migrate some code to a new Samba library called
tsocket. The problem was I didn't know what to do and how. Some functions
of the API were documented but not all. So I had to guess from the names
what the function is doing and read the code to understand it. Then I've
started to work with the interface and I had to look again the the code to
find out possible return values. In the end I spent a lot of time jumping
through the source code to find out the return values for the functions.

If the API would be completely documented I could get my work done a lot of
faster so I simply started to document it cause I had to understand it anyway.
I've decided to write the documentation with doxygen and put it in the header
file, so that people who use the PAI always have the documentation with them.

After I finished it, started to work on the source code again and got some
things working as I was able to understand the API of the library. Then I
crossed the next undocumented API of a library. Ok, it wasn't undocumented it
had a text file describing everything but having doxygen documentation is much
nicer than a text file. So I've started to document talloc from Samba4 with
doxygen.

The talloc API uses macros for a lot of things to make debugging easier or
to hide things you're doing from the user. However if you document a macro
than normally you want that it looks like a function. To be able to do that
with doxygen you have to use a little trick. As doxygen has a C preprocessor
built in you can create a define for a doxygen mode. That's what I've done in
the config file and all you need to do in the source code is to use it with
#ifdef.

#ifdef DOXYGEN
/**
* @brief Create a new talloc context.
*
* The talloc() macro is the core of the talloc library. It takes a memory
* context and a type, and returns a pointer to a new area of memory of the
* given type.
*
* The returned pointer is itself a talloc context, so you can use it as the
* context argument to more calls to talloc if you wish.
*
* The returned pointer is a "child" of the supplied context. This means that if
* you talloc_free() the context then the new child disappears as well.
* Alternatively you can free just the child.
*
* @param[in] ctx A talloc context to create a new reference on or NULL to
* create a new top level context.
*
* @param[in] type The type of memory to allocate.
*
* @return A type casted talloc context or NULL on error.
*
* @code
* unsigned int *a, *b;
*
* a = talloc(NULL, unsigned int);
* b = talloc(a, unsigned int);
* @endcode
*
* @see talloc_zero
* @see talloc_array
* @see talloc_steal
* @see talloc_free
*/
void *talloc(const void *ctx, #type);
#else
#define talloc(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type)
void *_talloc(const void *context, size_t size);
#endif

So start to document your API. What you get well be something like this and other will love it!

Filed under: KDE, Linux No Comments
1Feb/100

csync at FOSDEM

I'm currently updating csync to work with libssh 0.4 and I will give a lightning talk about csync at FOSDEM next weekend. csync is a file synchronizer to keep two folders in sync. This can be local or remote. The main purpose of csync is to provide Roaming Home Directories.

I will work with Aris on libssh stuff and try to get some small features in KDE for kio_sftp. I heard that some KDE guys are around too. I hope to see you there.

If you're a Samba developer and go to FOSDEM, let me know :)

Filed under: KDE, Linux No Comments
1Oct/095

kio_sftp updates

openSUSE has backported the new kio_sftp implementation based on libssh to their KDE 4.3 packages. This increased the users and helped to find some bugs in kio_sftp and KDE. The current implementation is working fairly well.

As soon as libssh 0.4 will be released (hopefully soon) I will add more features. Users asked for ~/.ssh/config support and I've added openssh's statvfs extension to libssh. This means I can check if there is enough space on the server before I copy a file.

Filed under: KDE 5 Comments
13Sep/092

mlmmj webarchiver

I run mlmmj (mailinglist management made joyful) for my mailing lists. The problem was, that I didn't have any mailinglist webarchives for a long time. I had to change this so I started on Friday to changes this. It took me the whole day to write the scripts. mlmmj-webarchiver has been written by Sven Michels using hypermail. As hypermail is more or less a dead project I decided to use mhonarc. So I started to rewrite the script and use the theme the roundcube project created.

You can see the result here:

http://www.libssh.org/archive/
http://www.csync.org/archive/

I've created a git repository for the mlmmj-webarchiver:

git clone git://git.cynapses.org/users/gladiac/mlmmj-webarchiver.git

Patches are welcome ;)

Filed under: Linux 2 Comments
24Aug/095

undefined reference to “function name”

Since hermes is flooding my mailbox I haven't looked if all my packages are compiling on Factory. So I had a look for interesting emails today. ctrlproxy (irc proxy/bouncer) didn't build with undefined reference to "". I wondered if the libarary packages have been renamed, but everything looked fine. I've talked to darix and he told me about the --as-needed flag of the linker which is set by default now. I've searched for some documentation didn't find something which explains the problems so here is my documentation.

The problem is the linking order of the libraries and source code! Lets look at an example:

Assume that you built a static library libwurst and it uses the pow() function from the math library.

$ gcc -Wl,--as-needed --static main.c -o wurstsalat -L. -lm -lwurst
./libwurst.a(wurst.o): In function `wurst':
wurst.c:(.text+0x29): undefined reference to `pow'

The problem here is, that the linker doesn't find any reference to pow() in main.c. Then the first library is libm and as it is not needed, the linker skips it. So you have to link against libwurst.a before you link against libm.

$ gcc -Wl,--as-needed --static main.c -o wurstsalat -L. -lwurst -lm

To summarize it: When using --as-needed, the order in which the libraries appear in the command line is relevant: any library X must precede all libraries Y that offer symbols that X uses.

I've created a page in the openSUSE wiki, you can find it here.

Tagged as: , 5 Comments
11Aug/090

kio_sftp rewrite upstream

I've commited my kio_sftp rewrite to KDE trunk today. The patch for KDE 4.3 if you want to test it is available here. You need libssh 0.3.2 to get it working but I suggest to use the libssh v0-3 git branch which has fixes found by kio_sftp testers. Thanks to all of them!

Tagged as: , , , , No Comments
24Jul/096

Hack Week: kio_sftp in action!

The openSUSE Hackweek is over and I have a working kio_sftp implementation using libssh. There is still work which needs to be done. I have to cleanup the code and test all the features (resume of files, recursive deletion). Today I've copied successfully the first files to my webserver!

kio_sftp

I've uploaded the two files to my webspace, here. Remeber that it's not finished yet! You need libssh's v0-3 git branch to get it working. I've found serveral bugs during the week. I will release libssh 0.3.2 next week.

Thanks to Dirk Müller who answered all my question and helped me with the KDE stuff.

Benchmarks will follow soon too.

Tagged as: , , 6 Comments
21Jul/090

kio_sftp authentication with libssh works

I've got the fingerprint verification and authentication with public key and keyboard interactive working. There is still a dialog missing for special interactive questions, but the normal user stuff works just fine.

kio_sftp

Tagged as: , , No Comments
20Jul/090

kio_sftp using libssh

I wanted to reimplement kio_sftp with libssh since some month. This week is another openSUSE Hack Week. I'm in the SUSE office in Nürnberg with some KDE developers. Dirk Müller helps me with the implementation. I'm normally not a C++ developer so it is a good oppurtunity to get help and things done. More on Wednesday. The weather will be good tommorow so I plan to go climbing.

Tagged as: , , No Comments