Using plugins.svn.wordpress.org with Git

Posted in blog, english, linux, planet-debian, software September 2, 2010

So I got SVN access to plugins.svn.wordpress.org, but I hate SVN. Let’s just use Git instead of SVN, especially when I already have my plugin as Git on github.com :)

git svn clone -s -r283636 https://plugins.svn.wordpress.org/statusnet-widget/
git remote add -f github git://github.com/evgeni/wp-statusnet-widget.git
git merge github/master
git svn dcommit

(note the -r283636 – it’s very important, if you ommit it, git svn will fetch 280k revisions which takes ages, if you put it to something AFTER your repo was created, the log will be b0rked)
Done! Now you can work as usual, push to github and commit to svn via dcommit :)

PS: Dear WordPress.org Team, you have working SSL, why do you still have http-links in your mails?

The joy and pain of WordPress

As you may not have noticed, I migrated my site to WordPress some time ago as I did not want to maintain the old piece of crap I wrote myself when I was “young” ;)
Today I want to tell you a story of the development of a plugin for WordPress.

As the title says, it’s much about joy and pain and I think I should start with the pain :)

WordPress is written in PHP, so are the plugins for it. And PHP is REAL pain (but there is no decent blogging software for Django or Zope that would fit all my needs). It is especially pain when you work with Python every day. What the heck are those curly braces and dollar signs and “$this->”? That’s just not the way Guido indented it ;)
Additionally my last contacts with PHP were some time back in 2008 when I hacked on SysCP, which today result in commits like this:

-        if (is_int($new_instance['max_items'])) $instance['max_items'] = $new_instance['max_items'];
+        if (ctype_digit($new_instance['max_items'])) $instance['max_items'] = $new_instance['max_items'];

But I have to admit that the WordPress API is pretty good. Not very well documented (the wiki pages at codex.wordpress.org are sometimes outdated), so you have to read the source and google a bit, but when you found the needed sources, it’s pretty straight forward.
My plan was to write a simple widget, displaying my Twitter and identi.ca timelines. Yes, both together, not one widget per service. The reason for this is the fact that I mostly post via identi.ca and the messages get synced over to Twitter and only the local replies and retweets/redents differ.
The basic WordPress widget would look like this (source: http://codex.wordpress.org/Widget_API#Developing_Widgets_on_2.8.2B):

class My_Widget extends WP_Widget {
	function My_Widget() {
		// widget actual processes
	}

	function form($instance) {
		// outputs the options form on admin
	}

	function update($new_instance, $old_instance) {
		// processes widget options to be saved
	}

	function widget($args, $instance) {
		// outputs the content of the widget
	}

}
register_widget('My_Widget');

One only has to modify the widget() function and here you go.

From some other Twitter plugin I knew that I only had to include rss.php and call fetch_rss(url) for every feed URL to get the timelines as an array via MagPie. But when looking at rss.php, you notice the deprecation message in the header, saying one should use SimplePie now. Some google later I knew that I had to include feed.php and call fetch_feed(url) to get a SimplePie object representing the feed contents. But SimplePie is even cooler: I can call fetch_feed(array(url1, url2)) and get a merged feed, containing both.
Now I added a duplicate filter to elliminate the messages posted to both, twitter AND identi.ca and my widget was ready.

You can find the result on http://github.com/evgeni/wp-statusnet-widget and soon on http://wordpress.org/extend/plugins/statusnet-widget/ :)

That was FrOSCon 2010

Posted in debian, english, events, linux, planet-debian August 24, 2010

Well, FrOSCon is over and it’s time to sum up the event a bit.

First of all: it was great! But it was also hot (I heard the air-condition is off during week-ends…) and busy. And still, it was great! :)

Why? Mostly because of the people of course! It was esp nice to meet Rhonda in person (almost all other people [except the grml ones] in the Debian-and-Friends corner were the usual suspects who you see at every (big) FOSS/Linux event). I had some nice chats with Enrico (about Geany and Xfce) and Leo (about bley), besides of the usual “when will Squeeze be released?” and “how does X work in Debian?” with random people.

When there are a lot of people, a key signing party isn’t too far away. Thanks formorer for the orga! You still owe me a sig from FrOSCon 2008 ;) And if someone wonders why he/she got a sign-mail from me even when he/she wasn’t at the FrOSCon KSP: I used the fact that I have to sign a lot of keys to sign even more (from the OpenRheinRuhr 2009 KSP and the BSP in Mönchengladbach at the beginning of this year [yes tg, I even signed yours, hope you liked the MIME]).

As usual I missed almost every talk I wanted to hear and end up with just one (the one about RegEx), which sadly wasn’t good at all.

I guess that’s all I have to say about FrOSCon. Oh wait, no, there was a questionnaire which included the question whether I’ll visit future FrOSCons. Of course!

Hope to see ya all at MRMCD, OpenRheinRuhr, 27C3 etc…

So Long, and Thanks for All the Frogs!

God save the power

Posted in english, hardware, linux, software July 3, 2010

Tonight, we had a longish power failure, and here is what I read in my syslog today:

Jul  3 02:27:16 dorei upsmon[3230]: UPS powermust@localhost on battery
Jul  3 02:57:19 dorei upsmon[3230]: UPS powermust@localhost battery is low
Jul  3 02:57:19 dorei upsd[3225]: Client nut@127.0.0.1 set FSD on UPS [powermust]
Jul  3 02:57:19 dorei upsmon[3230]: Executing automatic power-fail shutdown
Jul  3 02:57:19 dorei upsmon[3230]: Auto logout and shutdown proceeding
Jul  3 02:57:24 dorei upsd[3225]: Host 127.0.0.1 disconnected (read failure)
Jul  3 02:57:24 dorei shutdown[31656]: shutting down for system halt
Jul  3 02:57:24 dorei init: Switching to runlevel: 0

So thanks to my UPS and the great network-ups-tools, no data is lost and I just had to power-up my machine again.

Next task: wake over USB when power is there again from the UPS :)

RFT: hdapsd for Intel MacBooks and Hewlett-Packard laptops

After quite some time (last release 01-04-2009), hdapsd got a bit of love.
Brice Arnould has contributed some code for Hewlett-Packard laptops (those supported by the hp_accel module, see drivers/hwmon/hp_accel.c) and I finally crossed all lines and wrote support for Apple MacBooks (the Intel ones, via applesmc module, see drivers/hwmon/applesmc.c).

The HP code is interesting, as it support a hardware-logic mode, where hdapsd only parks the heads when told so by the HP hardware. As I do not own any compatible hardware, this is only tested by Brice himself.
The Apple SMC code isn’t tested at all, as I don’t have the hardware either.

That’s why I want YOU to test it further (both, on HP and Apple) and report me bugs (mail to evgeni@debian.org preferred) if you find any :)

You can get the latest source either via git from github:

git clone -b new-interfaces git://github.com/evgeni/hdapsd.git

Or from githubs tarball generator: http://github.com/evgeni/hdapsd/tarball/eb711f30395ac9bc682b14c22d8445b7ddf0b4a0

After you got the source, a simple

./autogen.sh
make

should produce a src/hdapsd binary, that you can test.

I can provide Debian and Ubuntu .debs if needed too.

Bundesfag will Scheuklappen fürs Interwebs aufstellen

Posted in german, politics March 4, 2010

So koennte die Ueberschrift eines Artikels lauten, wenn er nicht auf heise.de erschienen waere.
Aber so heisst der Artikel, der soeben durch meinen RSS-Reader geflogen ist, leider nur "Bundestag will Leitplanken fürs Internet aufstellen". Und ja es geht mal wieder um Zensur, erm, ich meine natuerlich Sicherheit fuer die Surfer und Surferinnen.

Allerdings ist bereits das verlinkte PDF des Antrags (http://dip21.bundestag.de/dip21/btd/17/009/1700950.pdf) der Zensur zum Opfer gefallen und verursacht nur ein lahmes 404 auf dem Bundestag-Server. Wie gern haett ich als "Betroffener" die Sache aus erster Hand gelesen… So bleibt mir leider nur die mit Anfuehrungszeichen vollgespickte Zusammenfassung von Heise.

Was auffaellt: diesmal wollen die offensichtlich das "wir" die beim sicher-machen des Internetz unterstuetzen, denn ein wenig haben die Politiker wohl aus dem Zugangserschwerungsfail gelernt. Aber eben nur ein wenig, denn man hoert weiter "Im Internet gelten keine anderen Gesetze" und ""weltweiten Standards" bei der Netzregulierung"… Ja ne is kla… Und weil wir schon dabei sind, darf natuerlich "Es sei wichtig, den "Schutz geistigen Eigentums" zu gewährleisten. Auch bei der Bekämpfung von Kinderpornographie, Gewaltdarstellungen und Extremismus seien neue "Schutzvorstellungen" nötig" als Absatz nicht fehlen.

Und ich hoer jetzt lieber auf zu schreiben, sonst werd ich noch boese.

Prost!

Good bye dragonheart

Posted in english, hardware, linux February 27, 2010
dragonheart:~# uptime
 14:00:46 up 1273 days,  4:26,  1 user,  load average: 2.33, 2.21, 2.13
dragonheart:~# shutdown -h now

Broadcast message from root@dragonheart (pts/1) (Sat Feb 27 14:00:52 2010):
The system is going down for system halt NOW!

Good bye dragonheart, you did a great job the last years! I hope you’ll have fun with my grandpa and like the new screen you’ll get (do you even know what a screen is? No, not /usr/bin/screen, the one connected to your shiny ELSA Erazor TNT2.)

*sniff* I’ll miss you

AlsaMixer tries to be poetic

Posted in debian, english, fun, linux, planet-debian February 4, 2010

I’ve just unplugged my Audigy 2 NX from my laptop, not noticing that alsamixer was still running.

When switching to the terminal it was running, I was greeted with:

In the midst of the word he was trying to say,
In the midst of his laughter and glee,
He had softly and suddenly vanished away—
For the Snark was a Boojum, you see.

(Lewis Carroll, "The Hunting of the Snark")

The sound device was unplugged.
Press F6 to select another sound card.

Someone did have too much time…

Art Macabre

Posted in fun, german December 20, 2009

Oder sowas ähnliches… Zumindest muss ich rückblickend sagen, die letzte Woche war sehr … "interessant".

pix/me/rock.jpg
Auf einem JBO Konzert muss man passend gekleidet sein…

pix/me/anzug.jpg
Bei einer Coctail-Party auch…

Es war auf jeden Fall eine schöne Woche und ich freue mich auf morgen.
Und auf den 26sten.
Und auf den 1sten.
Und und und.
Ich liebe euch alle!

Dies Academicus an der Uni Düsseldorf

Posted in german, planet-debian, uni November 30, 2009

The following is written in German and probably only interesting for people living near Düsseldorf. I decided to post this to Planet Debian as it might interest some of you :)

Als (ordentlicher) Student kommt man ab und zu in den Genuss, eine Arbeit schreiben zu dürfen, von der Andere (sprich: nicht nur ich durch die gute Note *g*) profitieren können.
So auch geschehen mit meiner Bacherlor-Arbeit. Und obwohl mein Vortrag erst am nächsten Montag (07.12.2009, 10:00, wahrscheinlich in Raum 25.12.02.33) ist, gibt es morgen auf dem diesjährigen Dies Academicus der HHU Düsseldorf bereits einen kleinen Vorgeschmack.

Dem geneigten Leser wird aufgefallen sein, dass der Link nicht auf die Webseite meiner Universität zeigt, und auch nicht auf die Webseite unserer AStA, sondern auf Wikipedia.
Nein, ich bin noch nicht so berühmt um für die Wikipedia relevant zu sein. Es gibt schlicht und einfach nichts dazu auf den Seiten. Nicht mal im Kalender der AStA stehts drin…
Woran das liegt? Keine Ahnung, ich vermute ja, dass die Herren und Damen (puh, safe, sonst kommt noch der Gleichstellungsbeauftragte zu mir…) lieber mit Streiken, Maulen und sonstigem Quatsch beschäftigt sind, anstatt irgendwie mal die Bildung zu fördern. Egal, hier ist nicht der Platz um zu Stänkern (Twitter/Identi.ca ich komme! [Danke Asel für die Idee]), ich wollte euch nämlich einladen!

Keine Einladung ohne Einladungstext, *such* *kram*, ach hier hab ichs: Programm zum Dies Academicus 2009. Leider weiß ich nicht wie aktuell die Version ist, liegt irgendwo in den Tiefen der Seite der Fachschaft Modernes Japan und ich bin da als

Spam-Erkennung: Intelligent Greylisting
Ort: Hörsaal 3C
Zeit: 13 bis 14 Uhr

auf Seite 8 vermerkt. Aber ihr wolltet ja einen Text haben. Den hab ich eigentlich auch eingereicht. Und nun ganz exklusiv und nur für meine lieben Leser (und weil niemand auf die Idee kam den ins Programm aufzunehmen):

Intelligent Greylisting

Gute Spamfilter sind entweder ressourcenhungrig, weil sie die ganze E-Mail analysieren müssen, oder fehleranfaellig, weil sie Entscheidungen zu voreilig treffen und dadurch legitime E-Mails verlieren. Wir stellen euch eine neue Methode vor, wie man Spam effektiv filtern kann, ohne viele Ressourcen zu verbrauchen und ohne legitime E-Mails zu verlieren.

So! Ihr kommt morgen alle um 13 Uhr in den Hörsaal 3C (Gebäude 23.irgendwas, PhilFak) und genießt meine Anwesenheit!

Es grüßt das Grummeltier.