Recent posts

Migrating ICQ (and other) contacts to jabber transport

I've been considering migrating completely to jabber since I discovered transports. But poor transition to icq transport was always stopper for me (groups and nicknames lost along the way). I was using multi-protocol clients since then.

Recently two things happened. I discovered a client with message-archiving support called vacuum-im. This is one killer feature I think when implemented properly in clients can persuade many people to switch. Also I'm updating my eeepc and I'm trying to do away with KDE now. So far I had KDE 3.5 working smoothly here, but support has ended long ago and that makes any update pretty painfull.

Kopete (of KDE3) stores contact list in XML file, albeit in bit obscure format. Pulling out relevant information was the easy part, trying to push it back to the client was pretty much useless. Then I've read XMMP specs and was surprised by the simplicity of the needed command. I've made simple XSLT to produce needed command for setting contacts' correct group and name.

Steps to use:

  • save following file as kopete_xmmp.xslt
  • generate query by calling xsltproc kopete_xmmp.xslt ~/.kde/share/apps/kopete/contactlist.xml
  • paste output to XML console of your client of choice (I've used psi)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
    <!-- Set to your transport -->
    <xsl:variable name="transport" select='"icq.blesmrt.net"' />

    <xsl:template match='/'>
        <iq type='set' id='roster_icq_contacts'>
            <query xmlns='jabber:iq:roster'>
                <xsl:apply-templates/>
            </query>            
        </iq>
    </xsl:template>                   
    <xsl:template match="plugin-data[ @plugin-id = 'ICQProtocol' ]">
        <item xmlns='jabber:iq:roster' subscription='both'>
            <xsl:attribute name="jid"><xsl:value-of select="plugin-data-field[@key='contactId']"/>@<xsl:value-of select="$transport"/></xsl:attribute>
            <xsl:attribute name="name"><xsl:value-of select="plugin-data-field[@key='displayName']"/></xsl:attribute>
            <xsl:for-each select="../groups/group">
                <xsl:variable name="gid" select='@id' />
                <group>
                    <xsl:value-of select="//kopete-group[@groupId=$gid]/display-name"/> 
                </group>
            </xsl:for-each>
        </item>
    </xsl:template>
    <xsl:template match="text()"/>
</xsl:stylesheet>

Migrated source browser to loggerhead

The old trac was leaking memory like crazy, so I decided to update it. I was using  multiple repository branch that was now merged to mainline trac, but current version seems to be incomaptible with trac+bzr plugin that  pkgcore folks forked to support multirepos. But since they decided to switch to  loggerhead and the old plugin is 3 years old, I figured I'll do the same.

Also if you bump in some problems on this site (due to old plugins/new trac probably), please let me know.

Site style, conics project

I finally played a bit with the trac / skittlish stylesheet, so spacing and lists should be okay now. Also I was unable to update this site because when switching over from apache to  nginx (which is really really great) I omitted some variables to pass over fastcgi (thanks to the official trac howto) and was unable to login for a while. Ideas I wanted to put in here are stacked in my head at the moment, but it might be while until I find while to write them down.

Recently I rediscovered great todo tool conics. It lacked quick editing which I think is essential for todos, so I decided to fix that. And since I recently learned  YAML, I decided it's great for that job. It's structured data format designed to be easily readable and editable. Main page of yaml.org is proof of that, as it's fully formed YAML document.

Here is an example:

%YAML 1.1
---
summary: Features
todo:
  - summary: import/export in ics format
  - summary: Allow edits under links
    description: Follow local links when adding/editing
  - summary: Use env variable for default calendar
  - summary: Hooks
    description: "Add hooks like devtodo's 'on add', 'on edit'"
---
summary: Documentation
todo:
  - summary: Write manpage
  - summary: Document code
---
summary: Tests
description: Write test cases
todo:
  - summary: SortedTree operations
  - summary: YAML conversion and parsing
...

When you throw in some nice syntax highlighting and editor thah can work with indentation, you can edit these todos really quick. And I did exactly that. New conics command 'yamledit' dumps todos into temporary file, opens your editor of choice and merges back changes afterwards.

Hope it will be useful to you as well.

New trac templating plugin

While I was creating wiki pages for my projects, I was looking for solution which could reuse most of the page markup, so I could just type in project info. I didn't find anything that would work reasonably well with trac 0.12.

So I decided I'll make my own plugin and you can see the result here: TracTemplateProcessor.

It's pretty flexible templating macro/processor with just ~90 lines of code. It very much resembles  WikiIncludePlugin, just better. It uses keyword arguments instead of positional ones and supports default values. You can see it in action very much on every project page here.

Also note current trac style has bit broken spacing and lists, so formatting may seem bit wierd in some places.

About me & this blog

About me

I'm Linux admin / user and Free softrware developer. My prefered distro is  Gentoo. I'm fluent in  Python, but I also have some experience with C, C++, C# and Java.

For more about my FOSS projects you can look at my  Launchpad page

About this blog

This is my personal blog, mostly about development of projects here. Don't expect frequent updates.

I might start blogging about general stuff, but since I resisted having blog at all until now, I find that quite unlikely. :-)