blog.thiesen.org

a geek’s life

Archive Oktober 2005

fuseftp: Implementing userspace filesystems with Perl

Well, as I mentioned earlier, 2.6.14 has this nifty new FUSE feature, allowing the implementation of a file system in userspace. Unfortunately, there was no implementation of a FTP filesystem. Fortunately, there are Perl bindings for FUSE :-).

One can implement a userspace filesystem using the whole power of Perl, and that makes it quite easy. I implemented a basic ftp filesystem this morning, which uses Fuse.pm and Net::FTP to allow read only access to ftp servers. It works quite well and was really easy, so this might be the beginning of a couple of nice userspace filesystems written in Perl. I could actually create MegasusFS….

BTW, you can download fuseftp from my wiki page.

Usage is quite easy, you can simply:

marcus@hal2000:~: mkdir kernel
marcus@hal2000:~: fuseftp kernel/ ftp.kernel.org &
Successfully logged into ftp.kernel.org
[1] 7150
marcus@hal2000:~: cd kernel/
marcus@hal2000:~/kernel: ls
for_mirrors_only  lost+found  pub  usr  welcome.msg
marcus@hal2000:~/kernel: cd ..
marcus@hal2000:~: fusermount -u kernel/
[1]+  Done                    fuseftp kernel/ ftp.kernel.org

Alles Transparent

Nein, eigentlich geht es nich um das “Theme der Woche”, das ich heute ein wenig angepasst habe und das mir doch sehr gut gefällt. Für alle die es doof finden, es gibt in der rechten Leiste einen Theme Switcher, mit dem man sich sein liebstes Theme einstellen kann und das bleibt dann auch so. Eigentlich geht es nämlich um die heute erschienene neue Kernelversion.

Ich finde den neuen Kernelentwicklungsansatz total toll, jedes Release ein neues Feature über das man sich freuen kann. In 2.6.13 war es inotify (das jetzt auch mitlerweile von der standard libgamin von Debian unterstützt wird), in 2.6.14 ist es FUSE. FUSE ist eine Filesystem-Userspace bridge, d.h. man kann sich lustige virtuelle Dateisysteme basteln. Z.b. eins für WebDAV, eins für SSH, eins für Bluetooth, eins für Mediawiki und eins für SMB. Eins für FTP gibt es auch, das muss man dann aber über ein Emulationslayer einbinden. Diese sind dann absolut transparent, sehen also für alle Applikationen so aus wie Dateien auf dem lokalen Rechner, Spass pur. Ich habs zwar noch nicht ausprobiert, aber das ganze ist schon sehr vielversprechend.

In other news habe ich endlich ein sinnvolles Mailbackup gefunden, bzw. gemacht. Nein, ich rede nicht von meinem etwas wahnsinnigen System das seit ende letzten Jahres meine Emails über drei Server schickt und auf jedem jeweils ein Backup macht, sondern ich reden von meinem Archiv was so bis 2001 zurückreicht. Die habe ich nun endlich mal auf meinen GMail Account hochgeladen bzw. weitergeleitet, hat auch nur so um die 20 Stunden gedauert, meinen Account ein wenig gefüllt aber dafür weiß ich jetzt das ich nie mehr irgendwelche Mails verlieren werde. Ein tolles Tool dafür (abgesehn davon das es in Python geschrieben ist gibt es hier.


Net::SILC::Client

Once upon a time there was a Linux user group which switched it’s chatting system to SILC. Unfortunately there was no Chatbot available for SILC and the user group had to live without. Suddently, in the beginning of ‘05, somebody had the time to write a bot, called Megasus, which runs inside the Irssi client, which is used by SILC as well. From now on the chat was enriched by nice information provided by a Bot. But Megasus had a problem, (actually the Irssi client when you call fork() inside of it) and it was leaking memory like hell, until the bad Adminstrators where forced to put memory and runtime limits on the machine. This lead to Megasus dying a horrible death every week and really annoyed the author. But then…

Well, I have been looking for real Perl bindings for the SILC Client API for quite a while. The problem is that there are none. Apparantly, nobody took it’s time to write something which would allow something like:

use Net::SILC::Client;
use Chatbot::Eliza;

my $bot = new Chatbot::Eliza( );

sub on_channel_message {
    my ($self, $channel, $nick, $message) = @_;

    if ($message =~ $self->nickname) {
        my $answer = $bot->transform($message);

        $self->channel_message($channel,
                               $nick . ': '  . $answer );
    }
}

my $silc = Net::SILC::Client->new (channels => [ 'silc' ],
                                   nickname => 'NSC');

$silc->set_callback('channel_message', \&on_channel_message);

$silc->connect;

A few days ago, I stumbled over SILC.pm a Sourceforge Project which attempted to create a Perl wrapper for the SILC API. They hadn’t released any code and as the project was founded in 2002 I contacted the authors and asked if they had already done some work, because I started believing that I would have to do this myself. They where really friendly and they had code, but only wrapping some of SILCs Math functions and not really what I needed. So I started writing from scratch.

As of today, you can run the above example and it does what it has to, plus there are a couple of other events that you can handle directly from Perl. As this is my first Perl/C/PerlXS Module I believe that it is leaking memory like hell as well as there are a couple of other problems (vanishing scalars between two function calls is one of them). But it supports all important events (you can set callbacks as this whole system is event driven), lets you issue commands and send private and channel messages. What I need to do to make it a possible frontend for Megasus is that I need an other Event System (for things like fetching RSS feeds) and some other minor fixes, but the major part is done. The Event System is a little bit tricky, as I tried to use Event.pm and running the SILC Main Loop with it which crashed horibly and I’m still not really good in debugging this stuff. And of course, it is lacking documentation (there are two examples which show the main methods as well as some information about the events, but this is not really good). It’s still far away from something I’d release to the CPAN, but If you want to have a look, it’s all in the CVS on Sourceforge.


Konsistenz?

Naja, eigentlich mag ich es nicht hier immer über Windows schlecht zu schreiben, das Problem ist nur das wenn ich mich damit auseinandersetzen muss ich immer das Gefühl habe das ich Machtlos dummen Ideen gegenüberstehe, das frustriert und das muss ich rauslassen.
Was ist geschehen? Ich habe gestern meiner Ma geholfen ihren Rechner mal von 3 Jahren Müll zu befreihen, sprich installierte Programme. Dabei ist mir dann aufgefallen, wie schrecklich die Softwareverwaltung auf Windows ist. Abgesehen davon, das das ganze nicht batch fähig ist und man auch nicht mehr als ein Programm auf einmal deinstallieren kann ist das ganze unglaublich inkonsistent. Jede Deinstallationsroutine sieht anders aus, stellt andere Fragen und ist auch sonst nicht besonders Benutzerfreundlich. Ein Spiel startete sogar ein komplett in Game deinstaller, mit Grafiken und Sound etc. Es kann doch nicht sein das so etwas simples wie Software deinstallieren so inkonsistent und kompliziert ist das selbst ich bei den meisten Fragen nur raten kann. Warum fragt ein Programm nach ob es beim deinstallieren Dateien aus seinem eigenen Verzeichnis löschen darf? Ferner ist dieser Konsistenzgedanke, der Linux ja ständig vorgeworfen wird, bei Windows noch nicht angekommen. Ist euch mal aufgefallen das es auf Windows cool ist kein UI wie alle andern zu haben? WinAmp, Office 03, Nero, Media Player … all diese Programme sehen nicht mehr aus wie eine normale Windows Anwendung und die Linux Desktop Menschen wollen unbedingt hin zu viel konsistenz. Ich habe fast den Eindruck das bei mir alles viel konsistenter ist, da ein komplettes Desktop System, als auf Windows. Ich hoffe Microsoft fügt nach der Shell und dem Editor auch noch ein Paketmanagement ein. Würde vieles viel einfacher machen.
Sowas ist doch ganz Simpel, Apt-Get stellt meistens beim deinstallieren keine dummen Fragen, ich weiß das die Konfigurationsdateien da bleiben, es sei denn ich haue sie mit –purge raus und ich kann viele Programme auf einmal de- und installieren. So macht Software Spass.


1 Falsch?!?


You Passed 8th Grade Math


Congratulations, you got 9/10 correct!

Ich wüsste immer noch geren wo ich den Fehler gemacht habe… und ich hab einen Bachelor in Informatik.


MSH: Microsoft’s Sucking Helper?

Eine von den vielen Sachen die Windows etwas unbenutzbar machen ist das Fehlen einer ordentlichen Shell in der default Installation (und eines Editors, und eines Compilers, und eines Browsers, und einer dezentralen Konfiguration von Diensten). Microsoft versucht diese Lücke mit Monad aka MSH zu schließen, was anscheinend ganz gut aussieht. Wie in diesem Artikel ausführlich beschrieben, scheint das Rezept von Microsoft relativ einfach zu sein: ein bissel Perl, ein wenig SQL und ein Objekt Orientiertes Interface machen eine Microsoft Shell. Aber entgegen aller Erwartungen scheint MS es diesmal recht gut hinzubekommen: Reguläre Ausdrücke, Anonyme Funktionen, Unified Zugriff auf Dateisystem und Registrierung, ein -whatif Schalter der nur zeigt was passieren würde sehen schon sehr vielversprechend aus. Besonders beeindruckend ist


msh> $x = [xml]"<zoo><animal kind='monkey'><name>Albert</name></animal></zoo>"

msh> $x.zoo.animal
kind name
---- ----
monkey Albert

XML Zugriff. Sehr simpel, man scheint mit dieser Shell auf jeden Fall tolle Sachen machen zu können. Dummerweise wird MSH nicht rechtzeitig zu Windows Vista fertig, was dann wohl heißt das erst MS Windows 2010 mit einer sinnvollen Shell ausgeliefert wird. Naja, man kann ja nicht alles haben … aber ein Editor wäre schon noch nett.


Hamburg 2.0

Am 11.11 gehts in Hamburg in die 2. Runde. Das ist ja schon mal durchweg positiv, da weil ich auch am 11.11. noch nichts mit rheinischem Karneval anfangen kann. Abgesehen davon gibt es ja in Hamburg auch die ständige Vertretung.
In other news ist es sehr nervig das HLX nur Flüge morgens um 7 nach Hamburg hat.

Ferner habe ich gestern dann mal wieder meinen “goldenen Schuss” bekommen, neben den üblichen vier Sorten (Hep A und B, Tetanus, Diphterie) war jetzt auch noch mal Polio dabei (eigentlich nicht mehr ausdrücklich empfohlen, aber ich hatte schon noch vor mal nach Indien etc. zu reisen). Also waren es jetzt 5 auf einmal (”man kann von der Polio Impfung auch Muskelschmerzen bekommen - sind sie Rechtshänder oder Linkshänder?”). Hatte ich schon erwähnt das mein kompletter linker Arm weh tut. :-(


Joining The Cult of the Amateur

Nicholas Carr has written a quite interesting article on Web 2.0 and what he believes to be the Cult of the Amateur. Basically, he means that because stuff is free, like in Wikipedia or OpenSource (his words, not mine), they will always be used and read more often than the professional stuff on the expense of quality. He sees this as an problem of imorality and somehow (as he is a jounralist) I think he fears the downfall of the media.
Well, why not. I don’t see the whole Web 2.0 hype as a Cult of the Amateur and Free Software is a quite good example for that. What he did was picking two bad examples out of Wikipedia to show that this amateurs are not able to do a good job on writing. I think you could do the same for Free Software, there is so much crap out there. And state of the art, award winning implementations. Software that feed several companies, Software that has excellent quality, Software that is free of charge and that you can copy freely. Linux, Apache, MySQL, OpenBSD, Sendmail … you name it. The Internet runs on Free Software. And it was done by, well professional amateurs. People writing software for a living and in their spare time. I guess when he would have had a better look at Wikipedia he would have found some articles that are of excellent quality, because some journalist or student really had some time to do an excellent job.
The thing is, this isn’t about amateurs vs. professional - because there will be always enough people out there to do an excellent professional job. Just because they are not being paid for what they are doing does not make them amateurs.
This is about people against big companies. In the late ninties they were all running around and telling everybody how information is the new good to purchase, spread, get rich on. Some did, but most of them got pretty broke pretty fast. The point is, that at the moment the Internet and the people connected to it take something back that was long in the hand of really big companies like the media, software companies or content providers. We make our content ourself. It might not be of the best quality, but in quantity we rule. I don’t want a TV-Shopping guy tell me how nice a new product is, I want to have a look at a couple of people opinions and how they like something, that’s what Blogs are for. I don’t want to go to a bockshelf to read a 10 year old article about somebody, I wan’t state of the art information, even if it is not a good read, and I want it for free. And I don’t want to buy DRM encrippled songs from somebody who has enough money anyway. We are taking back control, we just take the money out of the information and we take the money from companies that just didn’t listen and try to tell us that something that you can copy a million times without a real cost, digital data, is still something that has a value.
Reading articles like that shows me that there ist still a long road to go, but were getting closer every day. I like being amoral :-)


Hilarious!

While browsing the web in search of a better German Eliza script that the one that comes with the Chatbot::Eliza Perl module (which is now implemented into Megasus) I found Jenny18. Somebody rewrote the script to pretend to be an 18 year old hot chick who is looking for … well … the real thing and let it run on the usual IRCChannels. All the transcripts are here and are really a quite good read.


Rekordjahr

Hierzu muss ich erstmal anbringen das ich zwischen meiner Geburt und meinem 20. Lebensjahr genau zwei Flüge (Hin und Zurück nach Mallorca) erlebt habe. Nach Canada ‘04 und ‘05 und so kleinen Hüpfern wie nach Spanien oder Berlin bin ich ja daran schon mehr gewöhnt, aber es sieht so aus als wenn ich dieses Jahr 12 Flüge gehabt haben werde, wenn ich nach Berlin zum 22C3 fliege.

Kurze Aufstellung:

  • London - hin
  • London - zurück
  • London - hin
  • London - zurück
  • Wien - hin
  • Wien - zurück
  • London - hin
  • London - zurück
  • Singapur - hin
  • Singapur - Bangkok
  • Singapur - zurück
  • Berlin - hin

Gut das ich nicht von Berlin zurück fliege, der 13. Flug dieses Jahr würde mich dann doch ein wenig nervös machen….


Ach wie schön…

war es doch noch als man romantisch-verträumt Zugvögel durch den morgentlichen Himmel ziehen sehen konnte und dachte “es wird Winter” oder “sie ziehn gen süden”… jetzt denkt man nur noch Vogelgrippe


Wir werden alle (nicht) sterben…

Naja, also wenn die mortalität von 70% bei H5N1 (für normale Menschen auch die “Vogelgrippe”) stimmt könnte das etwas tragisch werden:

Weltbevölkerung: 6.472.553.646 * 0,70 = 4.530.787.552

Naja, 4,5 Milliarden Tote sind nicht so lustig jetzt, aber es bleiben ja noch 2 Milliarden übrig, das heißt das unsere Rasse erstmal nicht ausstirbt. Abgesehen ist die ganze Panikmache sowieso total unsinnig, das Ding fliegt seit 10 Jahren im (nicht besonders dünn besiedelten) Asiatischen raum rum, daher werden wohl kaum alle sterben.

Es ist allerdings immer wieder erschreckend das zum einen aus wirtschaftlichen Interessen nicht genug Impfstoff hergestellt werden könnte (wie man an dieser Stelle nachlesen kann) und außerdem unter dem Punkt “Gibt es Medikamente dagegen?” folgendes stehen darf: But it is under patent and made by only one company, Roche, so supplies and production facilities are limited. Dankeschön! Ist die Frage wie viele Leute (also wertvolle Menschen, nicht diese komischen Leute in Afrika) erst an so etwas sterben müssen bis der Patentschutz fällt, bei Aidsmedikamenten sind es ja anscheinend noch nicht genug, und da sterben jährlich 3.100.000 (2004) Menschen daran, aber halt die meisten (85%) in Afrika.

Also eigentlich sollte man sich mal überlegen, wie so ein Wahnsinn wie Patente die Gesundheit von 4 Milliarden Menschen aufs Spiel setzen kann.


AJAX

Nein, es geht nicht um Putzmittel, sondern um JavaScript magic plus XML. Dabei ist das ganze weder schwer noch komplex, wenn man das X(ml) mal weglässt. Ich habe perl.thiesen.org so umgebaut das es für die lokalen links per request die daten holt und in den DOM baum einbaut, das geht sogar ganz gut und on the fly (zumindest in Firefox und Konqueror, keine Ahnung wie das in IE aussieht). Bleibt nur die Frage, ob das bissel an Renderzeit das man spart es Wert ist das Google den kram nicht mehr indizieren kann und man auch nicht direkt auf Unterseiten verlinken kann. Bleibt also zu sagen: für private Homepages lohnt sich das nicht, für irgendwelche Webandwendungen wohl schon eher. Aber man spielt halt schon mal gerne…


toys2masters

Heute abend findet das zweite Halbfinale des Bonner Bandcontestes toys2masters (Kurz t2m) statt. Da dieser Mensch bei i get hungry eine nicht unwesentliche Rolle spielt werde ich zum dritten mal dieses Jahr an einer dieser Veranstaltungen teilnehmen und schauen wer denn im Finale am 23. Oktober mitspielt. Da das Publikum hier auch immer was zu sagen hat ist das ganze auf jeden Fall immer sehr unterhaltsam. Wer also heute Abend noch nichts vor hat….


Vorstellung:sgespräch

So, gestern war also mein Vorstellungsgespräch bei dieser interessanten Firma. Auch von innen sieht die Firma sehr stark so aus wie man es von der Seite her denken würde und das Gespräch ist insgesamt gut verlaufen und das erste Feedback war positiv. Ich muss zugeben das ich eine gewisse Begeisterung für diese Firma entwickelt habe - weil sie sehr nah an den Vorstellungen ist die ich als Handwerker von meinem zukünftigen Beruf habe. Wenn das alles wirkich so ist wie es klang, dann ist es Programmierer Himmel. Naja, mal awarten. Da die Nacht schon hereingebrochen war (und wir auch schon Gemeinsam Rotwein auf der ziemlich geilen Dachterasse getrunken hatten) war ich erst später beim Louis aber das hat der Abendgestaltung keinen Abbruch getan. Nach einem guten Bodenständigen Essen haben wir dann den Kiez unsicher gemacht und das ein oder andere Becks verzehrt. Nach langen diskusionen über das Leben, den IT-Business, die Frauen und den ganzen Rest war es dann doch vier Uhr, was meine relative Motivationslosigkeit jetzt erklärt. So gegen 17h gehts dann heute wieder nach Hause, vorher steht dann wohl noch ein bissel Sightseeing an. Hamburg ich komme… naja, mal abwarten