Archives for: December 2004

12/21/04

Woohoow, posting to fedora-devel-list

Yeah, I finally can post to fedora-devel-list! It seems that the moderator of post-only@redhat.com accepted me, but I didn't recieve an e-mail notifying me about that. I also know where the problem is now: that weird smtp-server at our university translates all adresses @VTK.UGent.be into @vtk2.ugent.be and the admin of that server doesn't know why. So, I was subscribed with my address @VTK.UGent.be, but the list-system recieved mail from @vtk2.ugent.be who's not subscribed.

You can find my post to the list here. There also was a reply from someone, asking for a diff -u output so I hope they get back on the project again.

Permalink . Peter . 09:29:40 . 115 Words . Project status and progress, Problems we encounter, Nifty solutions . Email . No views

12/20/04

Tested modifications: didn't work

I just tested my modifications of the stateless-snapshooter.py file the way I explained a few posts earlier. It didn't work at all. These are the errors:
# ./stateless-snapshooter_modified --list
Traceback (most recent call last):
File "/usr/share/stateless/stateless-snapshooter.py_modified", line 79, in ?
protosystems = snapshooter.list_protosystems ()
File "/usr/share/stateless/snapshooter.py", line 54, in list_protosystems
srv = get_readonly_service ()
File "/usr/share/stateless/snapshooter.py", line 50, in get_readonly_service
return LDAPUtils.StatelessService (LDAPUtils.ReadOnlyDirectory (cfg))
File "/usr/share/stateless/LDAPUtils.py", line 81, in __init__
Directory.__init__ (self, cfg)
File "/usr/share/stateless/LDAPUtils.py", line 65, in __init__
self.uri = cfg.get_ldap_uri ()
File "/usr/share/stateless/config.py", line 43, in get_ldap_uri
server = self["LDAP_SERVER"].lstrip()
AttributeError: 'NoneType' object has no attribute 'lstrip'

# sh stateless-snapshooter_modified --new --protosystem LVStateless1
Traceback (most recent call last):
File "/usr/share/stateless/stateless-snapshooter.py_modified", line 97, in ?
snapshooter.get_next_id (protosystem))
File "/usr/share/stateless/snapshooter.py", line 71, in get_next_id
for snapshot in list_snapshots (protosystem):
File "/usr/share/stateless/snapshooter.py", line 62, in list_snapshots
srv = get_readonly_service ()
File "/usr/share/stateless/snapshooter.py", line 50, in get_readonly_service
return LDAPUtils.StatelessService (LDAPUtils.ReadOnlyDirectory (cfg))
File "/usr/share/stateless/LDAPUtils.py", line 81, in __init__
Directory.__init__ (self, cfg)
File "/usr/share/stateless/LDAPUtils.py", line 65, in __init__
self.uri = cfg.get_ldap_uri ()
File "/usr/share/stateless/config.py", line 43, in get_ldap_uri
server = self["LDAP_SERVER"].lstrip()
AttributeError: 'NoneType' object has no attribute 'lstrip'

What can I do now? Just give it up and install X/pyGTK?

Permalink . Peter . 13:49:17 . 267 Words . Problems we encounter . Email . No views

12/19/04

IBM releases a RedBook on Linux client migration: Linux Client Migration Cookbook - A Practical Planning and Implementation Guide for Migrating to Desktop Linux. I did not read it yet, but I guess it's worth reading...

The Inquirer also got an article on OpenOffice 2.0, which is currently under development. Looks cool B-)

Friday night the annual VTK Galabal (Prom) took place at the Salons Montovani. It was a great party, got to know some new guys, had a couple of free drinks (and a couple of paid ones ;-)), which resulted in a bad stomach on saterday :-) Well...
My pictures are aviable here, maybe I'll put the movies I made online too. Official VTK pictures are here, here and here.

I'm trying to get Beagle (Planet) working on my Gentoo system, but fail to do so. ./configure requires some Mozilla/Firefox stuff I haven't got. Maybe I should really look into Ubuntu Linux, which has pre-built Beagle packages. Or try installing the complete Mozilla suite on my Gentoo system, which I wont do because of lacking harddisk space, and Mozilla taking too much time to compile on my poor system.

I definately want to learn Python coding, but can't do it now due to approaching exams, and lack of documentation/book.

Permalink . Ikke . 06:12:35 pm . 390 Words . Life, Technology, Linux . . 653 views . 5 comments
Google, Havoc Pennington and post-only@redhat.com

For the past weeks, when you entered "fedora stateless" in Google, this blog was the first answer. Now, it seems this has ended and we're back the second answer, after the official fedora stateless website. When you enter "stateless linux", we appear on the second page, but before fedora stateless. Yeah, strange thing, google, but really cool B-)

As you know, I can't post on the fedora-devel-list. So now, I've sent an e-mail to Havoc Pennington, the RedHat developer who firstly announced the Stateless Linux project at the fedora-devel-list. He told me he forwarded my e-mail about the pyGTK dependency to relevant people and he wants some discussion to get more people involved in it. Let's hope they can bring some swing in the project again.

He also told me about the list post-only@redhat.com. It seems that you have to be subscribed at that list before you can post on any redhat-list. Strange system and not explained in any bouncing mail or description of other mailinglists, but it'll be so. I've subscribed to that list, confirmed and I'm now waiting for moderator approval again. Let's hope they let me in soon.

I really hope they bring some swing in the project again. At the message that Hans De Goede placed for me at fedora-devel-list, there's still no answer, so no discussion and no progress.

Permalink . Peter . 14:41:50 . 226 Words . Project status and progress, Problems we encounter, Nifty solutions . Email . No views
Patched stateless-snapshooter and subnet troubles

Yeah, the galabal yesterday was fantastic! It was a great time. You can see some pictures here. I was in my bed too late, so I'm not in the mood to study. Well, the ideal time to take a look at stateless-snapshooter.py.

First of all, I downloaded the latest CVS-files as shown here. I think the file sml/snapshooter/stateless-snapshooter.py is the only one I need to patch. The other classes used by this file seem OK for me.

In this file, I removed the line import gtk (du-uh), the whole definition of the class progressBar and the defs snapshot_progress and snapshot_finished wich also use the progressBar-class. At the bottom of the file, where the execution of the snapshooter is called, I placed following lines in comments:
progress = progressBar ()
shooter.get_transfer ().connect ('update', snapshot_progress, progress)
shooter.connect ('snapshot-finished', snapshot_finished)

I hope it runs fine now. It was my first contact with Python. The only thing I knew about it, is that it's indent-sensitive, so I'm not sure about all this stuff here. If the fedora-devs want, they could always add some text-progressbar to it.

Because of the subnet troubles, I can't test it right now. I'll have to wait till monday, if I've time then. If it still doesn't work, I think about giving it up and just install X/pyGTK/fluxbox to make it work. Yeah, I'm a looser, I know.

About those subnet troubles, I've spoken the person responsible for that. He told me the whole thing is because the network at our university is good protected, but the documentation about it for the people working on it, is quite poor. He doesn't exactly know where to find the problem within a reasonable time. So, he decided to give us shell access to a machine, ftwe.ugent.be, in the same subnet, that is normally reachable from within our university network. So we'll log on onto our student server eduserv, ssh to ftwe and ssh from there to ftwlinux, our machine. So, Steven or Stijn, if you're reading this (you will, I know ;-)), please fix this so I can let the whole world know how fast you are B-)

I wanted to add the file with the exact diffs here, but the blog-engine (of configuration) didn't allow that.

Permalink . Peter . 01:42:39 . 387 Words . Project status and progress, Problems we encounter, Nifty solutions . Email . No views

12/16/04

Lots of commits by Rohan lately. This rocks :-) Now a new release should be made, so the guy that wanted to make Debian packages can go ahead :-)
Also Paul Archer wanted to code on Ivman too, more specificly Ivman's IvmConfig package. That's why I made a last pull of the ivman_ng SVN repository aviable, here.

Gentoo's Ivman package was also bumped (by Genstef), now Rohan's USB support patch is used when the "usb" USE-flag is set.

Someone just asked me if I was willing to become "godfather" (sp?) of their child. Tough one... It would be an opportunity to go to France, 'caus that's where they live, from time to time :-)

Permalink . Ikke . 09:34:27 pm . 186 Words . Life, Ivman . . 664 views . 2 comments

Yeah! Finally I've got a message posted on fedora-devel-list. As you know, I couldn't post messages on this list, but I've sent one to a friendly Dutchman, Hans De Goede, who was kind enough to forward my message to the list. You can read it here. So, let's hope for some reactions.

I also looked arround in that list for some interesting stuff. So I found this message. It's a message posted on the 13th of september, announcing the start of the fedora-stateless project. So, as you see, it isn't that old and that could be the reason why we don't find that much information about problems with it. So if we could fix our problem, then we also help with a new project. Nice... :-D

I also looked a bit on the source of that stateless-snapshooter. I think it couldn't be that hard to change it so that it works without pyGTK. Now, I haven't time for that. A few projects for university have to be done first, and we're having our Galabal at VTK. But I'll sure take a look at it soon!

Permalink . Peter . 11:56:44 . 185 Words . Project status and progress, Problems we encounter . Email . No views

12/14/04

Check this out :-)

Sometimes people want to use X apps on a remote server through X forwarding on a Windows box. Of course you can run a VNC server and the Windows client, but this could be usefull too. Guess I'll try it once at VTK.

Permalink . Ikke . 06:14:58 pm . 90 Words . Technology, Networks . . 578 views . Leave a comment

12/13/04

This is nice.

Permalink . Ikke . 01:28:12 pm . 14 Words . Linux, Desktop . . 452 views . Leave a comment

12/12/04

Found this url in my referers list today. Looks like someone is coding on Ivman :) If you read this, please contact me!!! I can give you CVS access ;-)
I looked at the patch, but have to take a closer look later :oops:
It's true I don't have time to code on this project. Altough it's not only time that was lacking... :|

I have a love-hate relationship with Gaim 1.1. Sometimes it runs smooth, sometimes it just crashes (gets killed) when I e.g. close the last opened IM window. Besides, it almost continuously eats 15-30% of my CPU power, only dropping when other processes need the CPU cycles. And it still lacks Custom Emoticons support (like AMSN got). Maybe I'll try to code that last thing once I get time for it ;-)
I do love the new MSN icons tough :-) Finally you can see who is blocked by you.

Gaim MSN Icons

Looks I got listed on a new Planet, Planet JD, too. It's a big one :-)

I found out Guadec 2005 will be in Stuttgart, Germany this year, which is great news, except... the date. Exams start end May - begin June. No Guadec for me this year, again :-( Going to FOSDEM should be possible tough :-)

Forgot to mention I went to a performance by the Simoens trio on friday. Three sisters that perform pianotrio's (one piano, one cello and a violin). It was great to be there, if you like classical music and get a chance to see/hear them, don't hesitate.

I decided to start writing a new blogging engine, once I find a server that gives me web (PHP) hosting, a MySQL database, and a Subversion repository. I know there are lots of engines aviable nowadays, but all of them lack features I really like, like modularity. Both b2Evolution and WordPress are nice suits, but sometimes the code just isn't modular enough, or they use some hacked-together templating engine whith a lot of PHP code inside the template file, which is plain ugly.
My engine will be modular to the extreme (authentication|authorisation|(xmlrpc & web) input|all sorts of output, both html and xml (rss,...)|...), it'll use the PEAR packages wherever possible, and last but not least, Smarty as a templating engine. But this is a long-term project (university exams first).

Looks like we found out what we'll do on New Years eve :)

Permalink . Ikke . 08:43:24 pm . 535 Words . Life, Technology, Linux, Networks, Desktop . . 463 views . 4 comments

Saw Gegen Die Wand yesterday, in Studio Skoop. Keywords are "suicide", "alcohol", "drugs", "integration of Turkish people in western civilisations", "place of the Turkish women in their family",... The movie wasn't that bad, altough sometimes too explicit IMHO (the suicidal and sexual scenes). I did like the photography tough. If you do like non-Holywood movies, you should check this one out, definately.

Lennert happened to be there too :-)

Permalink . Ikke . 01:52:13 pm . 89 Words . Life . . 2504 views . 1 comment

12/11/04

Waiting and waiting...

I subscribed a few weeks ago at the fedora-devel-list to see if they could help. Following those messages, I think they keep working on the stateless. So I think the project isn't abandoned, as ikke asks. One of the first messages I saw there, was about an error in one of those scripts for stateless stuff, but not in the one we have problems with. A dev replied and made some changes in CVS, so I think they're still active.

A week ago, I tried to send an e-mail to that list with a description about our problem. I recieved a message back that I'm not a member of that list (but I am subscribed and listed on their page! yes, it was with the correct e-mail address) and that my message must be approved by a moderator. Now, I still haven't seen my message on the list, no replies, no message from moderator.

Now, I searched bugzilla, but I couldn't find a bug with the word "stateless" in it. Hmm, doesn't sound good, does it? So, I created an account there to submit our "bug". It tells me a new account is created and a message is sent to my mailbox. Half an hour later, still no message.

But now, while I'm typing this, the message arrives. So, I reported Bug 142629. Let's hope they pay attention to it and help us and maybe some others solve this problem.

Permalink . Peter . 02:38:27 . 239 Words . Project status and progress, Problems we encounter . Email . No views

12/09/04

Fedora Stateless disapointment, Python and Subversion

I'm starting to get disapointed by the Fedora Stateless project. We are unable to get the stateless-tools working without using X (which is, of course, not installed on our server). Is the project abandoned? It'd be a pitty, because the idea behind it is great, and it's very uefull in a lot of cases.

I re-read the Python tutorial I found once, and started to try writing some simple scripts. Python is getting bigger and bigger: it's used by Gentoo Linux, the Fedora Project and Ubuntu Linux as scripting language for a big part of their management tools, both X- and CLI-based, and also other applications use it. All new technologies like DBUS and HAL got Python bindings. And of course there's stuff like PyGTK.
One of those projects that got Python support is Subversion. Now I wanted to try to write some scripts using to make Subversion repository access somewhat more accessible for RCS-newbies, but didn't manage to get things working. API's seem to have changed (i.e., not conformant to the samples I found), I tried to hack on it a bit, but then got pointer errors (I guess thanks to Swig), altough AFAIK I can't work with pointers in Python?!?
In the end I gave up and created some of the scripts using good old Bash, with some help of PHP and Pear::Config for ini-file handling. The results are here, not completed yet!!!

I changed quite a lot on the Subversion setup on our server, using SVNParentPath and the authz_svn module now. Haven't updated the howto tough.

We had free (as in beer) Bicky Burgers this evening at VTK. It's the first time I ate one of these things. There was some sort of unofficial contest to eat as many of them as we could (there were like 96 of them), I ate 2 of them, which was on the average.


I'm tired and need some sleep, badly.

Permalink . Ikke . 10:50:10 pm . 534 Words . Life, Technology, Linux . . 568 views . 3 comments

12/08/04

System updated to FC3, still no snapshooting

Ikke and myself did some new efforts to get the stateless-snapshooter to work, but it was no use. First, I'll post the error that started it all:

[root@ftwlinux /]# stateless-snapshooter --list
Traceback (most recent call last):
File "/usr/share/stateless/stateless-snapshooter.py", line 22, in ?
import gtk
File "/usr/src/build/435489-i386/install/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py",
line 37, in ?
RuntimeError: could not open display
[root@ftwlinux /]# stateless-snapshooter --new --protosystem LVStateless1
Traceback (most recent call last):
File "/usr/share/stateless/stateless-snapshooter.py", line 22, in ?
import gtk
File "/usr/src/build/435489-i386/install/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py",
line 37, in ?
RuntimeError: could not open display

First I tried to adjust the old stateless-snapshooter.py file, by deleting all but one 'gtk' commands/calls/whatever :-P . This is the 'best' output I got:

[root@ftwlinux snapshooter]# sh stateless-snapshooter --list
Protosystems:
LVStateless1
[root@ftwlinux snapshooter]# sh stateless-snapshooter --new
--protosystem LVStateless1
[root@ftwlinux snapshooter]# ( 0%)

The snapshooting started, but failed immediately. No errors, however. So I changed everything back to the way it was, and left for class. XX(

After class, Ikke joined me, and we spent some time updating the entire system to Fedora Core 3 (stable, as it should be on a server). Again there were a few problems though. First some 404-errors (Ikke's fault :-P ), and then header errors, until we adjusted the /etc/yum.conf file so it would download everything from the Belnet server. That did the trick :. .

No luck with the snapshooting though, even with an up to date system. We got a could not connect to display error. In the mean time, we're starting to worry about the (very) low activity of the Fedora Stateless project...

Permalink . RealNitro . 18:06:19 . 282 Words . Project status and progress, Problems we encounter . Email . No views

We in Belgium know a guy called "Sinterklaas". He comes from Spain every year, brings "mandarijntjes" (picture) and gives every child that has been gentle last year some present on december 6. Here's what he looks like. He also got some workers called "Zwarte Pieten" (picture).

Yesterday, we had a "party" with VTK with "Sinterklaas" as theme, because yesterday *was* 12/06. First time this year I want to a so-called "Goliarde", and it was fun. Had some sort of camera-fight with Lode (no, not the laptop guy), had a few beers, but had to go home way too soon :-(

Pictures of the event are aviable here.

Sinterklaas, friend of all children:

Some other members of this blog were there too:


Lennert


and

Peter

Even Santa Clause was there:

I need more RAM. By downloading these pictures from my camera, my machine just hang twice because I hadn't enough RAM (128Mb) and/or swap space (128Mb) aviable (well, I had X, Firefox, Gaim and some other apps running too). Bizarre.

Back to business: I wrote that Subversion Howto I talked about this morning. It is not finished (yet), but well... I'll try to LaTeX'ize it, which will be my first attempt at creating a LaTeX document :-)

Ordered 40 Ubuntu CD's today. 20 x86, 10 PPC and 10 AMD64. Ubuntu is one of those Linux distributions I'm going to try on the PC I should get once. Ordered all these CD's to spread them among friends and VTK members trough WVS. Ruben, once a big Gentoo fan, switched over to Ubuntu some time ago. I'll find out why he did so, and if what he did is the right thing to do :-)

Permalink . Ikke . 12:32:55 am . 406 Words . Life, Technology . . 405 views . 1 comment

12/07/04

Here, on Monologue again.

We @VTK also need to start using Subversion, lost some code yesterday thanks to the stupid "write-code-on-testing-server-then-move-to-live-server-using-some-cgi" method we're forced to use. Unfortunately AFAIK I'm the only one in there who ever worked with Subversion, knows how to set up a repository (on Apache), how to add files, commit stuff, get diffs,... I was planning to create a nice HOWTO today anyway, guess I should get started. It's not th

Permalink . Ikke . 11:28:24 am . 401 Words . Technology, Linux, Desktop . . 493 views . 5 comments

12/05/04

No CVS login possible

This is my first post on this blog, so I'll introduce myself first. I'm studying engineering at the same faculty as Peter and Ikke. I'm rather new to GNU/Linux (5 months), but I learned a lot by setting up my Gentoo system. Peter asked me to help with the FS@U project, because he and Ikke are quite busy atm.

Peter thought of three solutions for the GTK-problem:

  1. Downloading the new CVS-version

  2. Asking/begging for help on the fedora-devel mailinglist

  3. Changing the script by hand, and removing graphical references

I went for the first option. Unfortunately, logging in to the CVS failed. There's not much to do about it. It's just not possible (subnet stuff) and we don't have any permissions to change that.

But Ikke came up with a solution. We're planning to download the CVS-version on a different computer, upload it to some webspace and download it back on the server. Find out if this will solve the GTK problem in the next post.

Permalink . RealNitro . 22:15:17 . 210 Words . Problems we encounter . Email . No views

12/04/04

Blogging fun and Dell problems

Still no usefull information to solve our PowerEdge 2400 problem :'(

2 new blogs created today: one for Publino, a writer (here, it's Dutch), another one which should show progress we make on getting Fedora Stateless Linux to run at out university. More info on this project here. The pygtk dependency of stateless-snapshooter is very strange |-| Guess I'll have to take a close look at it.

I hop I'll be able to make even more guys/girls/man/woman happy by offering them an blog :-D Rules are simple: no ads, stick to the netiquette, and no pr0n and/or illegal content.
New skins can be installed on a simple request, like london, moonrise and wpc_splat today (you can see them by pointing your browser to http://blog.eikke.com/index.php?skin=[skinname] ).

While looking for a Linux replacement for w.bloggar, after I couldn't get Gaim-Blogger working, I tried both Gnome-Blog and BloGTK. None of them could satisfy my needs, tough :-( Too bad. Maybe I'll have to code one myself using Mono and GTK# :-)

I started to use BlogLines again, after some months. Fortunately there's a "Mark all as read" button. Sorry guys :oops:

No coding work done today, I studied some more geometry. Still don't like this subject tough ;-)

Spent some hours in front of my screen today, so I'll give my poor eyes some rest now and poweroff the machine (yeah, even tough it runs Linux ;-)). 'night all.

Permalink . Ikke . 10:43:14 pm . 344 Words . Life, Technology, Linux . . 431 views . 4 comments
Is GTK really necessary on a server???

Now, we're blocked. We followed the nice tutorial, but we have quite a problem on chapter 4, Creating a snapshot of a prototype system. When we try to execute stateless-snapshooter --list or stateless-snapshooter --new --protosystem DemoSystem or even just stateless-snapshooter, we recieve a message that some GTK libraries are not found. On a server, we think X and so GTK is not necessary, even not wanted. The tutorial also says that this is a command-line tool, but when it needs GTK, I don't think so. I also can't imagine that we are the only ones running a stateless server without GTK, so is there anybody who encountered the same problem and fixed or worked around it? Please let us know.

Sorry, I can't give the exact error message. I'm at home now and our server is only reachable from within it's own subnet. I'll post the message here as fast as possible, normally monday.

Permalink . Peter . 15:48:14 . 153 Words . Problems we encounter . Email . No views
Status update: chapter 3 reached

To create the whole system, we follow the Stateless Linux Tutorial. Our server is already installed and configured by ikke, so chapter 2 is ready. Be-ing a real LDAP-dummy, I've made some syntax mistakes while creating the prototype system image (chapter 3) but this is also ready now. So, next step is chapter 4, Creating a snapshot of a prototype system, but that doesn't seem that easy. OK, tutorial is clear, just a few commands, but we have a little problem. More info in the problems-topic. Please, help if you're able to do.

Permalink . Peter . 15:38:30 . 90 Words . Project status and progress . Email . No views
First message and introduction

Whoo! The first message on this blog and also my first message on a blog. Thanks to ikke for creating this.

Maybe it would be nice to give a short introduction in our FS@U project. I am a student at Ghent University in a nice town called Ghent, located in Flanders, the dutchspeaking part of Belgium. I study engineering at the (du-uh) Faculty of Engineering. There I am active at the student organisation called VTK wich stands for "Vlaamse Technische Kring" or "Flemish Technical Board" in English. Last year, we (me and a couple of friends) founded a new organisation, WVS, Workgroup Free Software, to let our co-students, professors, assistants,... know about the existence and possibilities of free software and to point their attention on the fact that not everybody uses the standard proprietary (MS-) software and the importance of open standards etc. We already organised a few workshops like linux installation, linux desktop use and LaTeX. We also have a deal with the sysadmin of our building for installing free software on the computerfarm. So we installed Mozilla Firefox, Thunberbird, OpenOffice.org, Gimp,... Now it's time for the crown on the work: a complete dualboot configuration with Linux next to MS Windows. It's for this linux-installation that this blog is created.

To provide a quick and easy installation and management, we've chosen for The Fedora Stateless Linux project. We recieved a computer to create the server on, so that 's already OK. On the client computers there will be a PXE-boot system that lets you chose between the local windows installation and our Linux installation. The harddisk of those clients will be partitioned in two partitions, one for windows and on caching partition for Fedora.

Not everything is as easy as it seems, so we have a few problems. I'll post them in the problems-topic. If you can help us find an answer on them, please let us know, we'ld really appreciate it! Thanks a lot.

Permalink . Peter . 15:25:01 . 328 Words . Project status and progress . Email . No views

12/03/04

Lode's laptop is almost done. He got a working xorg-x11 installation currently running Fluxbox, but emerging Gnome, gensplash support, all services necessary for a decent base system (hotplug/coldplug, pcmcia, HAL,...), FAM was replaced by Gamin, I got him to love Torsmo,... I even got his IPW2200 WiFi link working, jay! Today was a good day ;-)

One more thing on the todo list tough: get lm-sensors on his Intel 825200 or whatever chipset... Anyone got this working? B-)


I worked some more on the PHP LDAP Class generator. Actually, this isn't an LDAP based project anymore, rather a bundle of libs I'm creating to write out PHP class files, and I'm using that work to do the LDAP stuff.

Member functions were done, which means at the moment you can:
- Create a class, define it's superclass (optionally), and add required files
- Add member variables
- Add member functions

Only getMemberFunction and setMemberfunction are implemented (like:

$g = getMemberFunction( "_test" );
echo $g->toString();

will output

function getTest() {
        return $this->_test;
}

Watch the underscore handling :-)

A setMemberFunction does +- the same thing, only it generates code to set a specific member variable.
The functionwriter still needs to write out PHPDoc function information. The necessary member variables are in the class, but the toString() function doesnt generate it yet.

Once that's done, two thing left to do: add Class PHPDoc information, and testing of course.

I'm quite certain this functionallity could be usefull for other people too, so maybe I'll release the code once I think it's mostly "done".


Finally I installed Coppermine. It's quite nice to work with, altough I couldn't find any theme I really like, and it has some more issues (like, not reading EXIF data on a batch import). You can check it out here.


I think I'll get my dad's old PC (an HP P4 1.9) this weekend, finally :-D This implies I'll be able to run Gentoo and more generally Linux on a decent machine :-) I hope I'll be able to start some more development again (after my exams @ university, of course). I got a long list of thing's I'd like to see working in Linux/Gnome ;-)

Permalink . Ikke . 10:50:41 pm . 367 Words . Technology, Linux, Desktop . . 459 views . 3 comments

12/02/04

Some work, and code generation part 2

- Lennert got his own blog in here. Check it out.
- Installed 2 new themes, and modified them a bit to my needs: wpc_rubric and Stockholm.
- Tried to get Gaim-Blogger to work with this Blog, I couldn't get it working tough.
- Re-installed my phpOpenTracker visitor tracker. jpGraph currently refuses to work tough ;-(


I worked some more on the PHP code generation stuff. Now there's "memberVariable" class, which can be used inside "classBuilder", so the member variables are abstracted and can easily be added to a classBuilder forged class by the application. I'm also working on memberFunction classes (like getMemberFunction, setMemberFunction and complexMemberFunction) that define class member functions. The first and second one create standard get and set methods, the third one can create custom methods.

Generating classes representing all objectClasses and attributeTypes defined in core.schema, cosine.schema, inetorgperson.schema and nis.schema takes 3.6 seconds, which is not too slow. It's the "Connecting to LDAP Server" and "Fetching schema information" parts that take the longest time, class generation is pretty quick.

One more new feature: all generated memberVariables get PHPDoc compliant comments. The memberFunctions should get it too (when I finish the classes, almost done in fact), and in the end classes should get their documentation too.


I'm trying to help Lode getting Gentoo on his brand new laptop. Not an easy one. Those damn cheap Medions :roll:

Permalink . Ikke . 10:10:59 pm . 280 Words . Life, Technology, Linux . . 433 views . 1 comment
Let PHP write code for you

I'm working on a project. A neat new server. Well, the server itself (you know, that PowerEdge 2400 I talked about yesterday) seems to be, well, screwed somehow, but I wanted to *do* somethin anyway.

The magic word is LDAP. We want everything into an LDAP directory where possible. System users, quota, email aliases, Horde preferences, mailing list members, Samba as a PDC using LDAP as userbase/password backend, everything. I was able to set all of this up on my workstation, so that won't be a big problem.

There is one major issue tough: frontends. We were not able to find any decent frontend suited to our needs. Of course there is PhpLdapAdmin, which is a great tool to browse your tree and edit base-level stuff, but it's only usefull for directory administrators. You cannot expect a normal user to use PLA to change his password.

So we have to write everything ourself. Because we'd like to give the user both webbased and CLI interfaces for all administration tasks, PHP was chosen as development platform, using PEAR's Net_LDAP modules, which is kinda neat. You can use it to retrieve LDAP Schema information, which is what I need here.

The objective is simple: create classes in PHP that represent an LDAP objectClass. So if a user in LDAP is an "inetOrgPerson", I need a class in PHP called "inetOrgPerson", like $ikke = new inetOrgPerson( "uid=ikke,dc=test,dc=com");

Because LDAP supports objectClass inheritance, this should be reflected in the PHP code too. LDAP supports multiple inheritance, a PHP class can only inherit from one class, but normally this isn't a big issue, because most objectClasses only SUP one parent objectClass.

Writing PHP files with classes representing all possible attibuteTypes and objectClasses by hand didn't look like a pleasant foresight to me, so I wanted to automate things. Of course I could write everything by hand once, but then if new schema's would be added to the LDAP server, I'd have to write more classes, change inheritance,... which is just plain stupid.

So I started to write PHP classes and functions that create PHP class files for me, based on data it retrieves from the LDAP server. At the moment, attributeTypes and objectClasses are only represented using member variables and (read) accessor functions, so something like the example I gave is not possible (yet), but it shouldn't be too hard to get that working too.

This is what it looks like now:

* schemaItem
        * atributeType inherits schemaItem
                * homeDirectory inherits attributeType
                * uid inherits attributeType
                * ...
        (attributeType inheritance isn't supported)
        * objectClass inherits schemaItem
                * top inherits objectClass
                        * person inherits top
                                * organisationalPerson inherits person
                                        * inetOrgPerson inherits organisationalPerson
                                * ...
                        * ...

Every attributeType is represented by (attributeTypeName).class.php in a certain directory, and every objectClass as (objectClassName).class.php in some other directory.

Some classes provide the factory methods to create these class files: there is the base classBuilder class, which provides the following functions:

- classBuilder( $name, $super = null )
     Constructor. $name is the name of the class to "build", $super is an optional base class $name should extend.
- addRequire( $req )
     Add a "require_once( $req )" to the output file.
- addVariable( $type, $name, $private = false )
     Add a member variable of type $type (mentioned in a comment), with name $name, to the class.
     $private is not used yet, but could be used in the future to force prefixing private variables using an
     _underscore_
- addVariableValue( $type, $name, $value, $vartype = VARIABLE_TYPE_STRING, $private = false )
     Add a member variable which has a predefined value. $type, $name and $private are the same things as in
     addVariable(3). $value is the standard value this variable should have, and $vartype defines the
     type of the variable: STRING, INT or BOOL, so strings can be written like 'var $test = "test"',
     integers like 'var $test = 1', and booleans like 'var $test = true' (watch the quotes).
- writeFile( $filename )
     Finally writes the class structure to file $filename.

Next to these there are some more private functions, like one to generate a PHP-syntax-compatible representation of an Array (also multi-dimensional arrays because the function can call itself, I think it's pretty nifty :)) )

As you can see it is not possible to add member functions to classes, which should not be necessary, because the base classes ("schemaItem", "attributeType" and "objectClass") provide the necessay ones.

Next, I got Writer classes for every type I got:

* schemaItemWriter inheits classBuilder
        * attributeTypeWriter inherits schemaItemWriter
        * objectClassWriter inherits schemaItemWriter

These classes take data from the LDAP server to give classBuilder all the information it needs to generate the class files for all objects.

This could sound very obscure, but actually it isn't. I have to admit the code is not documented tough :oops: The PhpDoc tags are there (thank you Vim and the Vim PHPDoc plugin), but the correct data isn't in there ;)

Now the results:

cat attributeTypes/email.class.php
<?php

require_once( "attributeType.class.php" );

class email extends attributeType {
        //Type: String
        var $_oid = "1.2.840.113549.1.9.1";
        //Type: String
        var $_name = "email";
        //Type: String
        var $_equality = "caseIgnoreIA5Match";
        //Type: String
        var $_substring = "caseIgnoreIA5SubstringsMatch";
        //Type: String
        var $_syntax = "1.3.6.1.4.1.1466.115.121.1.26{128}";
        //Type: Integer
        var $_maxLength = 128;
        //Type: Array
        var $_aliases = array("0" => "emailAddress","1" => "pkcs9email");

}

?>
cat objectClasses/top.class.php objectClasses/person.class.php
<?php

require_once( "objectClass.class.php" );

class top extends objectClass {
        //Type: String
        var $_oid = "2.5.6.0";
        //Type: String
        var $_name = "top";
        //Type: objectClass (Must)
        var $objectClass;

}

?>
<?php

require_once( "top.class.php" );

class person extends top {
        //Type: String
        var $_oid = "2.5.6.6";
        //Type: String
        var $_name = "person";
        //Type: Array
        var $_supClasses = array("0" => "top");
        //Type: sn (Must)
        var $sn;
        //Type: cn (Must)
        var $cn;
        //Type: userPassword (May)
        var $userPassword;
        //Type: telephoneNumber (May)
        var $telephoneNumber;
        //Type: seeAlso (May)
        var $seeAlso;
        //Type: description (May)
        var $description;
        //Type: Bool
        var $_structural = true;

}

?>
ls attributeTypes objectClasses | wc -l
224

Generating these files manually would be a PITA ;-)

As you can see this code is not ready (yet): for the objectClasses, there should be validator functions (are all Must attributes set?), accessor functions for all attributes, and last but not least, pulling and pushing data from/to the LDAP directory...

I'm very happy with the current results. Once all schema information is pulled from the server by Net_LDAP, the parsing of this data and creation of class files is very fast. Adding the other necessary functions should be a breeze (well, not really ;-)) now.

Once this is done, we need to write some simple backend for everything (an abstraction layer between the frontends and the actual objectClasses etc, something the user nor the frontend scripter should be aware of), and of course the frontends. PEAR Console_Getopt looks usefull :-)

I'm at university at the moment: there is a LanWar night going on (I'm not gaming, but well...).

Permalink . Ikke . 03:30:22 am . 1109 Words . Technology . . 951 views . 3 comments