Fair PC mouse project

Yesterday I was invited to join some friends visiting the Good Goods trade fair about sustainable consumption here in Hamburg. Next to the usual suspects such as clothing manufacturers, financial services vendors, energy traders, governmental organisations, publishers, food producers and about half a dozen different organic lemonade brands (samples, yeah!), my personal highlight was the tiny booth of PHeFE (de). Phefe is the ambitious project of researcher Susanne Jordan, aiming to create fair (as in fair-trade) alternatives for consumer electronics, starting with a self-designed computer mouse.

Phefe continues where Goliath corporations fail to deliver again and again, to go beyond labelling energy saving and recyclable devices as “Green IT” and make the entire production of electronics a process that respects basic human rights. As an example the documentary Blood in the Mobile illustrates vividly how mining minerals used in mobile phones is directly linked to local wars. But also sweatshop like labour conditions in product assembly lines are very common, with Foxconn (Apple, Asus, Nokia, Sony Ericsson) controversies unfortunately only being the tip of the iceberg.

The fair PC mouse is not yet available for purchase, but production is planned to start in 2011. So look forward to the Phefe mouse becoming what coffee was to fair-trade foods and hopefully initiating a paradigm shift in the consumer electronics sector. I will keep you updated!

Phefe and Blood in the Mobile are supported by  Make IT Fair, a campaign by several consumer watchdogs and other NGOs – well worth checking out. Wow, things are happening! 🙂

Other Good Goods I like:

  • Nabu environment phone tariff (de) – a bit expensive compared to other discounters, but a good idea, will stay with my current provider – English summary
  • Biobob (de) – organic fruits crate to your office, met one of the founders, lovely people, will order there next time
  • Next Hamburg (de) – participatory city planning, fresh approach, I filed a complaint about run-down cycle tracks
  • Glore (de) – organic clothing, I got stuff from their Karoviertel shop a month ago

XMPP: Private XML storage with strophe.js and ejabberd

During the last days I was playing around with a Javascript web chat application using strophe.js. To save user preferences on the ejabberd XMPP server I use Private XML storage (XEP-0049). The specification is pretty straight forward, but due to the lack of a real world example it still took me a while to get it working — hence this post. Thanks to badlop from the ejabberd@conference.jabber.ru XMPP chat room for valuable pointers. Here is how I did it:

1. Make sure mod_http_bind and mod_private are activated in ejabberd.cfg:

{modules,
 [
  {mod_http_bind, []},
  {mod_private, []},
  ...
 ]}.

2. Open BOSH connection to XMPP server (in your Javascript application):

sc = new Strophe.Connection('/http-bind/');
sc.connect('user@example.org', 'password');

3. Build and send IQ stanza for storing data:

var stanza = $iq({type: 'set', id: '_set1'})
  .c('query', {xmlns: 'jabber:iq:private'})
  .c('myclient', {xmlns: 'myclient:prefs'})
  .c('mypreference', 'yes')
  .tree();
sc.sendIQ(stanza);

Replace “myclient” and “myclient:prefs” with your own invented namespace and use your key/value names instead of “mypreference”/”yes”.

The IQ stanza sent to the server will look something like this:

<iq type='set' id='_set1' xmlns='jabber:client'>
  <query xmlns='jabber:iq:private'>
    <myclient xmlns='myclient:prefs'>
      <mypreference>yes</mypreference>
    </myclient>
  </query>
</iq>

Server response:

<iq xmlns='jabber:client' from='...' to='...' id='_set1' type='result'>
  <query xmlns='jabber:iq:private'/>
</iq>

4. Build and send IQ stanza for retrieving data:

var stanza = $iq({type: 'get', id: '_get1'})
  .c('query', {xmlns: 'jabber:iq:private'})
  .c('myclient', {xmlns: 'myclient:prefs'})
  .tree();
sc.sendIQ(stanza, parsePrefs);

function parsePrefs(element) {
  ...
}

Sent to server:

<iq type='get' id='_get1' xmlns='jabber:client'>
  <query xmlns='jabber:iq:private'>
    <myclient xmlns='myclient:prefs'/>
  </query>
</iq>

Server response:

<iq xmlns='jabber:client' from='...' to='...' id='_get1' type='result'>
  <query xmlns='jabber:iq:private'>
    <myclient xmlns='myclient:prefs'>
      <mypreference>yes</mypreference>
    </myclient>
  </query>
</iq>

5. Write parsePrefs() function and enjoy your XML storage! 🙂

Questions?

22:22:22

meinhard@monkey:~$ date
Sun Nov 22 22:22:20 CET 2009
meinhard@monkey:~$ date
Sun Nov 22 22:22:21 CET 2009
meinhard@monkey:~$ date
Sun Nov 22 22:22:22 CET 2009

Resize Image Nautilus Script v1.0 released

Script in action

I just uploaded the first public release of my Resize Image Nautilus Script. It’s a small extension to GNOME, the desktop manager used by Ubuntu. The script allows you to easily shrink image files to a sane size with two mouse clicks:

Right-click a photo, choose “Resize Image”, done. The files size of pictures will be reduced to around 50 – 150 KB, depending on the selected target size. This one is for all you people that send me 3 MB holiday snapshots by email — who needs 10 megapixel photos anyway? 😉

Thanks to Ani and Tino, who hosted me at Pension Sighisoara while I was finalising my first fully documented GPL software release.

Throwing together a quick hack for your own use is one thing, but preparing your creation to be used and extended by others (translation: make idiot-proof) takes a good few more hours. Add comments and safety nets in the code, polish the interface, think of future extensions, test on other computers (I should have done that, but I leave that part to you, hehe), write documentation, make screenshots, create a software homepage and announce the release — quite some overhead. But I feel it was worth to go that extra mile.

So, if you use GNOME, please try out the script and leave a comment.

Spam art

Pixel font in HTML tableI just got this art piece by email from a person unknown to me. It contains a HTML table with coloured cells that form the letters V I A G R A.

To trick spam filters spammers always need be one step ahead of filter maintainers, which results in a constant creative arms race, letting both sides dive deeper into existing technology. Our spam filter at Ecobytes for example looks into PDF attachments of emails, finds images with text and tries to read the text to search for offending words. I find that quite a performance for a machine a.k.a. toaster. But in this case the spammer actually used some retro thinking. Bravo! Good luck finding spam signatures in coloured tables, dear spam assassins. 🙂

Spam has been inspiring artists since a while now. Check out Alex Dragulescu’s beautiful Spam Plants, Linzie Hunter’s typographic Spam One-liners or the Spam Garden. On the other hand there is ASCII art spam too now.

Here is my response: I just wrote a table text generator, which you can use to create pretty text like in the image or to scramble your email address. 🙂

PS: Yes, this is the first post with an image on this blog. There will be more!

1234567890, tonight!

Maybe some of you have heard of such thing as the Unix time, counting the seconds since the 1 January 1970 – something like the beginning of the Unix age. This number is around 1234519870 right now and will reach 1234567890 tonight, Friday, 13 February 2009 23:31:30 GMT! I just spotted this while finding my way through database entries. If you are into numbers at all and into Unix-like things this will blow your mind, if you are not, you simply won’t care or even notice. 🙂 However, it appears that completely normal people celebrate this day around the world. Join the party!

Oil 21 conference, free Berlin

This weekend The Oil of the 21st Century is hosting a conference in Berlin. Tonight at 9pm there will be a free party at Tucholskystraße 6 with free food and drinks. Remember, it’s all free. :o) Entrance to the conference events is 3 EUR though. Today at 3pm Alan Toner, whom I met at several hack meetings before, is part of a presentation about defending your rights in the Digital Rights (TM) world.

Berlin keeps me busy, last night I went to the Ubuntu Linux version 7.10 release event at C-Base, on Wednesday to a rather breath-taking Cum2Cut performance and a few days before I was at a talk of Naomi Klein about her new book “The Shock Doctrine“. I had free Lunch 2.0 at Plazes and promptly got offered two jobs as a web hack0r, one of them related to Free Software which I accepted (more about this from November on).

Next up is Lunch 2.0 at Viif on November 5th and some of the events of Oil 21 taking place during the next weeks. I also got an almost free bicycle and a cosy place to stay at Micha’s in the Kreuzberg district. So I’m all set for being sucked into the urban magnet of Berlin for an exciting Winter 2.0!

On the road to Ecotopia

I will be offline now for at least 10 days while travelling from Milano to Southern Portugal and participating in the Ecotopia camp. Anything urgent needs to wait until afterwards. Server-related things can be addressed to support at ecobytes dot net. See ya!