Charl van Niekerk » Blog

Main

Latest

Archives

Powered by Blogger

Google Sites

Again, not a lot of time to sit down and write a proper review, but this also looks rather cool. Google Sites is a new part of Google Apps. It creates quite an interesting social content scenario. Seems like a mix between a wiki and a blog, and allowing you to add all kinds of multimedia content. I think these kinds of mashups will become very popular over the next few years, just because they make sense. Why not have revision history on your blog? Why not have comments on your wiki pages?

At the end of the day it's almost like a convergence of technologies. You only need one thing really: content items. These can be tagged, should have revision history, can have different permissions (who can view and who can edit), can be commented on and discussed, etc. The only issue is how to display them. Will it feel like your traditional journal? Like a book, like something else? Not talking about the styling but about the page layout, navigation, everything. Quite an interesting space to watch and develop... ;)

Commuter Feed

No time for a long blog post right now unfortunately but this must be one of the handiest Twitter apps I've seen so far: Commuter Feed. Basically this allows you to track traffic problems in your favourite city, for example Cape Town.

Quite interesting aggregation, definitely has its uses. Very simple, and so often simple is best!

Now just waiting for them to actually add George... ;)

Generating URIs in PHP

Sometimes it can be really pesky to generate an URI (for a link in an (X)HTML document or a remote API call for example) quickly in PHP. I just have a simple little library function for that:

function toUri($path, $params) {
    $uri = $path;
    if (count($params)) {
        $uri .= '?';
    }
    $first = true;
    foreach ($params as $name => $value) {
        if ($first) {
            $first = false;
        } else {
            $uri .= '&';
        }
        $uri .= urlencode($name) . '=' . urlencode($value);
    }
    return $uri;
}

You can call it with something like this:

$uri = toUri('http://api.charlvn.za.net/status', array('limit' => 20, 'start' => 10));

$uri should now contain:

http://api.charlvn.za.net/status?limit=20&start=10

Before inserting into an (X)HTML document, please remember that the ampersands should be encoded to comply with W3C standards. The htmlspecialchars function can be used for that, as always, unless your template engine can make provision for that. If you want you can also insert & instead of & into the string inside of the function.

Thanks to Neil for some tips. Here is the improved function plus example:

<?php
function paramsToUri($params, $ampEncode=false) {
  if ($params) {
    return '?' . http_build_query($params, '', $ampEncode ? '&amp;' : '&');
  }
  return '';
}
echo 'http://api.charlvn.za.net/status' . paramsToUri(array('first' => '<>', 'second' => '&'), true);

This will output:

http://api.charlvn.za.net/status?first=%3C%3E&amp;second=%26

Much better!!!

Google Summer of Code 2008 Coming Up

This year I am no longer continuing with studies so will not be taking part in the Google Summer of Code 2008. However, it's still a flipping brilliant thing to do. In other words, I would highly recommend it for the uber geeks in the student community. I'm not sure how many there are out there but I'm sure there should be some in South Africa. Last year it seems like I was the only participant in the entire continent so this year hopefully we'll see quite a few. If I only inspired one person to try it out it would be really great for me. If you are interested or would like to chat to me to hear my thoughts or experiences, or just bounce some ideas off me, by all means comment or drop a mail! I would love to promote this fantastic initiative in Africa as far as I can.

Check out the official blog post for more.

Arrived in Cape Town & Facebook Profiles

Sorry for not blogging much, under some serious stress at the moment, but learning some more valuable lessons regarding how things work in the business world.

Jayx and I roadtripped to Cape Town today. We are safely here now and I caught up on some valuable sleep along the way.

I caught some interesting information this evening on Facebook. From the developers page:

Lately, Facebook profiles have become slower, more cluttered, and somewhat difficult to parse. Over the next few weeks, we'll roll out a number of improvements to the Facebook profile that are going to make the profile simpler, more relevant, and provide users with a greater degree of control.

[...]

Applications that further these objectives will be more successful and achieve greater usage. We encourage application developers to focus on building applications that facilitate communication, generate meaningful activity, and increase users' trust.

Very important point. Many of the applications available on Facebook today seem to be pretty pointless. It seems like many people make Facebook applications "just for the sake of it" or "just to be on Facebook". It's really silly and Facebook is losing practical value because most of it is just a waste of time. The signal to noise ratio is becoming really bad.

Due to many of the silly applications that will throw all kinds of multimedia content into users' profiles, many users' profiles are slow and irritating to load. I dunno about parsing but I honestly like minimalism and simplicity, that's why I removed all the applications (other than the ones I wrote myself) from my Facebook profile page.

Would be interesting to see what Facebook will be coming up with to help reduce the clutter. Otherwise Facebook is really starting to remind me of MySpace.

Update: Oh yes and I should not forget to add, I had some of Jayx's famous pasta! I can tell you, it's definitely not overrated...

Telkom... Yay!!

I am very glad to report that we are back up and running again!

My landline connection got screwed the other day and getting hold of somebody at Telkom is a disaster. However, there are still some people working for that company that are really super efficient.

We went to the Telkom shop at the Garden Route mall and a lady Connie helped us, she was brilliant! Very efficient and organised. Yesterday morning, a guy came out to fix our line. He walked in, looked at the dead line, walked out, walked back in again a few minutes later and everything was working. I just woke up and he walked out so quickly I hardly had time to ask him for his name. But whoever he was, many thanks to both of them, in my opinion they both deserve a raise!! Keep it up guys, you rock!!

Friday Evening IRC

Sometimes, I find that Friday evenings are best.

* Now talking on #clug
* Topic for #clug is: Cape Linux User Group - http://www.clug.org.za/
* Topic for #clug set by Vhata at Wed Dec 12 10:40:33 2007
* FluffyBunny has quit (User Quit: http://www.dhiren.za.net/)
* Skip (farrel@atrum-EE1D355F.telkomadsl.co.za) has left #clug
* Skip (farrel@atrum-EE1D355F.telkomadsl.co.za) has joined #clug
* Osiris (tertius@atrum-6E1DE195.dynamic.isadsl.co.za) has joined #clug
* Osiris|Weg has quit (Ping timeout)
<Vhata> fp
<Vhata> talk sense?  what?
* Vhata doesn't do that
<mithrandi> sbp
<bisybackson> the fucking cat's back
<Charl> any of you ppl going to teh marketer's meeting?
* Osiris has quit (Client exited)
<bisybackson> Charl: I'm not invited
<Charl> bisybackson: it's a public meeting :)
<Charl> bisybackson: unless you feel it's not for non-marketers, i just butt in and be a butt
<bisybackson> Charl: I'll feel like a white journo at a FBJ meeting
<murmur> heh
<Charl> bisybackson: i feel like a man with one eye in the land of the blind
<Charl> wtf was i just trying to say? i dunno
<bisybackson> Charl: http://www.mg.co.za/articlepage.aspx?area=/breaking_news/breaking_news__national/&articleid=333112
<Charl> bisybackson: if i wasn't white already, i would have been after reading that article
<bisybackson> heh, ja
* bisybackson abeds
<Charl> bisybackson: you go to bed? but it's not even 1 in the morning yet?
<bisybackson> I lieded
<Charl> ah thank goodness, was getting worried there for a sec
<Charl> i tell you man be careful
<Charl> first it starts with going to bed early
<Charl> then you end up with a hooker
<Charl> next thing you're hanging in pubs
<Charl> and then you are de-geeked
<Charl> terrible...
<bisybackson> haha
<bisybackson> better make some coffee
<Charl> yeah man, resist the urge, whatever happens, just don't close your eyes! :)
<bisybackson> "I think the GeekDinner movement is a story of revolution"
* superfly has quit (Connection reset by peer)
* Saderax has quit (Ping timeout)
<Charl> that was johan rite?
<LordCow> dunno i just got here
* Skip (farrel@atrum-EE1D355F.telkomadsl.co.za) has left #clug
<Charl> LordCow: coolness, i'm just calfing out
<Charl> keep well all i'm off
<Charl> this chat log is lank funny though i wanna post it

* Now talking on #
* Topic for # is: Disoriented anarchy
* Topic for # set by russell at Mon Feb 18 12:02:37 2008
<bisybackson> furst poast
<Charl> bisybackson: eish my lanie, silent in ere?
<bisybackson> nogal
<bisybackson> friday night
<bisybackson> and we're not out getting pissed
<bisybackson> or laid
<Charl> i thought that was just for losers?
<bisybackson> nono
<bisybackson> it's the other way around
<bisybackson> we're the losers
<Charl> well let's look at this from a technical point of view
<Charl> after all, that's what we are good at
<Charl> what will happen after this evening
<Charl> the others might end up with less brain cells and aids
<Charl> we on the other side end up being smarter and in the same health condition
<Charl> so who are the idiots now? :)
<bisybackson> erm
<bisybackson> still us
<bisybackson> sorry :-/
* Charl hands bisybackson some strong anti-depressants
<Charl> really, they help :)
<bisybackson> 150mg bupropion hydrochloride
<bisybackson> twice a day
<bisybackson> and I'm still smoking
<mithrandi> heh
<Charl> farking hell
<Charl> good luck on that shit
<Charl> i used to take herbs
<bisybackson> restecp

Setting up commit-email.pl

How would you like to receive an e-mail every time a commit is made to a certain subversion repository? No problem. SSH into your server and do the following.

Firstly, change your working directory to the hooks directory of your repository. For example, if my repository is located at /var/svn/myproject I would type the following:

cd /var/svn/myproject/hooks

If you haven't done this already, enable the post-commit hook.

cp post-commit.tmpl post-commit
chmod +x post-commit

Get the commit-email.pl script. You can search for it on your local system. For example:

locate commit-email.pl

And you might get something like:

/usr/share/doc/subversion-1.2.3/tools/hook-scripts/commit-email.pl

If you do, it would normally be the easiest just to copy this file, for example:

cp /usr/share/doc/subversion-1.2.3/tools/hook-scripts/commit-email.pl .

Otherwise, download the script:

wget http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/commit-email.pl.in

If you download the above file, you need to replace all occurrences of @SVN_BINDIR@ with the directory of your subversion tools. First, find this directory. For example, if you type:

whereis svn

You might get:

svn: /usr/bin/svn /usr/share/man/man1/svn.1.gz

In this case, your directory will be /usr/bin. Just run the replace, for example with sed:

sed 's/@SVN_BINDIR@/\/usr\/bin/' commit-email.pl.in > commit-email.pl

Now of course just make sure this script is executable:

chmod +x commit-email.pl

Now test the script as there is probably like a million things that can go wrong here:

./commit-email.pl /var/svn/myproject 1 charlvn@charlvn.za.net

In my case, I got this:

./commit-email.pl: use of either `-h' or `--from' is mandatory when sending email using direct SMTP.

At least simple to fix:

./commit-email.pl /var/svn/myproject 1 charlvn@charlvn.za.net --from svn@charlvn.za.net

Now it works. Well, if you see nothing, it should work. Check your inbox. If you don't receive the mail, maybe you're just being impatient, but if you don't after a day or two, you're not necessarily farked, but good luck in debugging that bastard...

(By the way, in this case with me, I received the mail but the mail headers were stuffed.)

That was with the script I downloaded, if I try the copy that existed on my machine, I got this:

Use of uninitialized value in -d at ./commit-email.pl line 224.

On line 224, we have:

my $tmp_dir = ( -d $ENV{'TEMP'} ? $ENV{'TEMP'} : '/tmp' );

I just replaced this with:

my $tmp_dir = '/tmp';

Now it worked perfectly, no obvious issues.

Anyway, next thing is to trigger this from your post-commit script. Just edit the script with whatever you want, like:

vim post-commit

Then add this line:

$REPOS/hooks/commit-email.pl "$REPOS" "$REV" charlvn@charlvn.za.net

Oh well this worked for me. Please comment and let me know your experiences. Seems like this script can be a bit of a tokolosh.

Telkom... Eish!

Image: Cartoon about my saga with Telkom

We are about R400 ahead in payments to Telkom. Yet, this morning after I got up, I had to come to grips with the fact that my telephone line was completely cut. I phoned Telkom now, have been holding for over an hour. I am sceptic if we will get the issue resolved. Am thinking about that immigration to Holland again...

Many thanks to Linoxxis teh Pwnerer for creating the very cool cartoon above!

Update: Finally somebody answered. They took my report and gave me a reference number. Just hoping for the best now... As soon as the issue is resolved I'll blog again and thank the person who resolved it.

Google reads doctypes?

Ok and then we thought it doesn't matter, just validators care...

From How to Stop Google Indexing Your Site. A Bedtime Story:

The problem we faced was that we had specified HTML 4.01 in our DOCTYPE but were trying to use XHTML style tags (i.e. self closing meta tags). IE had no problem with it. Firefox, Opera and even my blackberry had no problem with it (or if they did have a problem they were polite enough not to say anything). Yahoo didn't have a problem.

But Google did.

Google saw the DOCTYPE as being HTML 4.01. It then saw meta tags with a trailing "/>". It became scared and confused and decided that the only thing to do was report the page as not found.

Our custom error page had no meta tags so it was fine. Our article about templates had <> in the title which caused Googlebot enough confusion that it forgot about the self-closing meta tags and indexed the article.

We removed the "/"s from the meta tags and within 24hrs we were reindexed.

I'm still not entirely convinced... Does anybody have more info on this?

I really wonder what Google thinks of the HTML 5 doctype. It seems to index my main site fine...

WTF this tagging business is bull****

I really hate this tagging business but I guess oh well, since I've been tagged by Jayx now I'll respond for once.

I can't make a list of 8 items but at least I'll do a best-try effort.

  1. I don't actually smoke pot, even though I'm Dutch. Actually I can't smoke at all as I'll probably die in an hour or so without serious help.
  2. I nearly died when I was a baby thanks to inoculations. Up to this day I believe inoculations in the traditional means are nothing less than barbaric. To inject puss from an ulcer on a donkey into human beings is disgusting and should be outlawed, if it hasn't already.
  3. I go on trips when I drink too much coffee where I can experience epiphanies and go on amazing mental journeys. I suspect this might be what some people go through when they take certain mind altering drugs. I guess that makes coffee a mind altering drug for me...
  4. I'm totally asexual which means I have no sex drive, although I like girls a lot and find them somehow attractive in a non-sexual way. I enjoy talking to them a lot. Women typically have a very different way of looking at the world than us guys which I find very interesting. Lots of people therefore think I'm gay but I have no attraction to men at all other than being casual friends.

Can't think of anything else, but if I do, I'll come back and edit this post. Unless it's something really private or embarrassing.

Cape Town here we come...

It seems like next week Jayx and I will be roadtripping like two mofos again...

Between the various other meetings we need to make a draai over at the 27 Dinner.

Going to be lots of fun methinks! Looking forward. Will start planning the trip tomorrow.

So, I'm a bachelor now?

Yeah, and it doesn't even have anything to do with being single and over 30 (well, I'm not nearly over 30 anyway so I hardly qualify)...

A few days ago I found out that I now officially turned a Bachelor of Science as far as Software Engineering is concerned. This is according to Unisa. At this point in time I am too relieved to argue. I just want that little piece of paper so that I can close that chapter of my life. Studying is definitely not the thing for me, unless the text books are really updated and of reasonable quality with the aim to teach practical skills and you actually learn something new you can actually use. I love theory too as long as I'm learning something I can use later on. Otherwise, the only research I will be doing is casual non-academic research for actually getting somewhere into the future.

It's funny to me how many people actually blog about something like this, bragging about how many distinctions they got, it's like they are looking for work or something. At the end of the day, at the moment, it's anyway work experience that counts far more than your qualifications, although qualifications often help to get a couple of extra grand a month much quicker.

I am anyway not looking for work so please do not ask.

Now I wonder if I can find a Bachelorette of Science. Then we can be Bachelor and Bachelorette together. Just imagine all the fun we could get up to... Hacking until 4 o'clock in the morning..

Java API: Weird shit!

Sometimes, coding in Java can be funny...

To convert integer i to string s, you can do one of the following:

To convert string s to integer i, you can:

ROFLMFAO!!!

Garden Route Facebook App Launches

I went through quite a tough time the last week so I needed something to take my mind off things. I therefore tried my hand at developing some Facebook applications. I never thought I would drop that low, but I guess there's a first time for everything. (Just kidding.)

Well, without further ado, my application is live. It just basically allows you to syndicate some news from GardenRoute.com to your profile (like on mine) and browse the site inside of an iframe on the canvas page. What the point behind this app is I actually don't know but I guess if The Times can get away with it I can as well. :P

The reality of Internet in Africa

I am sitting on a 4 Megabit per second Telkom ADSL connection in South Africa connecting via FTP to a server sitting right on the local South African Verizon backbone. And yet, this is what I have to put up with:

Screenshot of FTP in Africa

I'm just too thankful Blogger actually loaded so that I could write this post and upload the flipping 15KB image seen above.

MicroID

The idea behind MicroID technology seems to be that it can be used to verify if a specific piece of content belongs to a specific user.

It makes use of a hashing algorithm such as sha1 to generate a "key" based on the user's credentials. For example, the MicroID of my site would be:

mailto+http:sha1:16b1e677c3263ee3751a42fc983e912c21248d5f

The hash could be computed as follows:

<?php
echo sha1(sha1("mailto:charlvn@charlvn.za.net") . sha1("http://charlvn.za.net/"));

The problem with this approach is that it makes use of public information. In other words, virtually anybody could create content and claim it was me. Therefore, you have to trust the publisher.

I would immediately think of a more advanced solution including public / private key cryptography and signatures which would solve that issue.

Is MicroID therefore useful? Well, if the content claims to be of a certain author and that author claims that it's his/her content, it's probably fine. But because the content could be changed without the knowledge of the author it's usefulness is still somewhat limited. Yes, you need to trust the publisher at the end of the day.

In that case, why even use hashing in the first place? I could never really see the point of hashing if everybody knows the original text anyway...

Import. Export. Share. Integrate. Transparently.

I just read a really interesting article titled Really, We Don’t Want to Join Your Social Network. I think that encapsulates a lot of the core concepts behind our distributed social networking effort, and actually distributed social networking in general.

I have nothing against having a huge amount of individual social network sites. I actually think it's a great idea to build communities around information, products, services, and common interests. As a matter of fact, the more the better. The web is distributed, social networking should also be. You don't want any individual company to lock you into their framework. That just limits innovation and creates dependencies on certain companies and services.

The real issue here is that you don't want to have all these little isolated islands. You don't want to go to lots of individual sites every day just to check out what's happening. You don't want to go through a painful registration process, capturing all your profile information all over again for each site. Having to update your profile information across hundreds or even thousands of different little sites once it changes is simply put completely insane.

So you leave a comment on this blog, another comment on that blog, post something to a mailing list or a forum, whatever. Register on this little social networking site, then on that one. I don't want to have some of my friends on Myspace, others on Facebook, others on Linkedin, etc. I want to have them all in one central place, irrespective of which services I'm using and which services they are using.

I don't want to register on a website just before that's what my friend is using. I don't want to install a new instant messaging client because my friend is only using that and using the same messaging service is the only way I can communicate with him.

Just imagine if the web was build on proprietary technologies. You had to install a new web browser for every second site you visit because they have their own proprietary technology instead of making use of standard W3C standards such as (X)HTML/CSS/JS.

Go down one more level. Let's say you had to recompile your flipping Linux kernel, replace all your routing devices and use a different ISP because a service you want to make use of is not compliant with TCP/IP.

Sounds totally insane, right? Well, that's what the guys are doing, but just on a higher level.

XMPP is an open instant messaging technology, and can be used for much more than just that. Jabber is built on it, Google Talk is. Windows Live Messenger, ICQ, Skype, etc are not compliant and need special gateways and transports and stuff. It just wastes our time, supporting all these individual networks. XMPP is based on XML, it's extensible and can accommodate virtually anything you want to do. Why not just use that?

Getting back to social networking, we are talking about exactly the same issue: standardisation. OpenSocial, OpenID, Microformats, FOAF/RDF, etc are all aiming into the right direction. We are simply complimenting them by linking them all together and enabling their heavily simplified use with our SDSN technology.

SDSN is a public project, we welcome public input. It's royalty free to use, no patents pending. It's a standardisation project so that we can get the social networking sites to speak to your blog, to each other, and to anything else you can imagine. We want to empower individuals to be able to do their own thing, focused on themselves, their convenience and what they want to accomplish.

Picture this scenario. You open your own private social networking platform. You can customise this in any way you like. You could possibly choose from a range of existing products (both open source and proprietary), customise them or even develop your own from scratch.

You log into your social networking panel. You can see and communicate to all your friends, irrespective of the sites and platforms they use. You can view their activities, see what they have been up to, and interact with them in a variety of ways.

You can manage your blog posts, your microblog, your photos, videos, bookmarks, and everything else in one central place. You can have it on one server or on different servers if you prefer. Other services can transparently make use of that, index your content, make it searchable together with thousands of other people's content. But it's all based on your server.

This is something I can recall mentioning in a very old blog post of mine. Take Flickr for example. If you want to have more than 200 photos browsable on the site, you need to pay. But you already have hosting! You have gigabytes of web space on a server sitting somewhere. Now you have to pay another service just to make use of their social component, indexing your photos and make them searchable and browsable together with all your friends' photos. You can have your list of friends in this little closed social networking environment.

Then the next moment, you have Facebook. You can upload photos but then people must actually log into the site to be able to view them. Facebook creates is own little private "play garden". We are borg. Resistance is futile.

Now you have a photo on Flickr but you want to share it with your Facebook friends. You either need to have separate integration between the two services, just like Facebook integration with Twitter. So you have to integrate each service with each other service. That is ridiculous, as it is simply too time consuming!

Have some open standards. Every service supports that and can talk to each other transparently immediately, without special support for each other.

You can have your own little photo gallery sitting on your own web server, a service you're already paying for anyway. Simply have the right semantics in place, let other services read this, and you can have massive third-party specialised search engines that can index thousands of photos from different sites and make them searchable and browsable. You can have as many of these individual search engines as you like. As long as they support the same standards it's fine. You can create your own search engine. Nothing stops you. The standards are out there and royalty free.

Want to register on a social networking site about healthy eating? No problem. You already have your profile information in standardised semantic form on your blog. Just give the service the right URI and it can read all your profile information from there. No need to manually re-enter all that information every time. And the best thing of all is that you can update the information in one central place and all the individual services can check and update this information every once in a while. No need to update on every individual site on its own.

The service can see who your friends are, find them all quickly without you giving away your entire e-mail address book and your account details to your Gmail / Hotmail / whatever. You can select your own privacy settings centrally, you have all the flexibility in the world. You can control exactly what you want each service to see what what not to see. You have the control over your own online life again, without having others decide what's best for you.

You can discover new friends, add them to your own database and have them accessible from all the other social networking sites you use. You can share sites and you don't have to find your friends and add them again on each individual site you use. It's all immediate and transparent. You don't want to waste time doing the same thing over and over again. Let the computer sort that out for you, while leaving you in control of your data.

Forget about having a separate username and password for each site, having to use all kinds of password managers, and who knows what. Risk having your password leaked on an insecure site by using the same password for many sites, or forgetting the passwords if you have many different individual ones. Password recovery? Throw it out of the door, it just wastes our time! We don't need this stress on us, we have enough mental overload to deal with in our already heavily hectic online lives! Use an open authentication protocol like OpenID and let that take care of these things for you.

Ok this might all sound really vague at the moment, but we are burning the midnight oil to get these standards out there as soon as possible along with the first implementations. It will take a while but we will get there, especially with your help and support. If you want to help out, please do! It's a very exciting space to be in right now and the more hands, the better... ;)

SDSN: Authentication

General Status Update

We are basically at the phase at the moment where we're getting the general conventions for our specifications laid out and we need to make certain tough decisions regarding the architecture and design.

The best is to have these discussions in public and get as much feedback as possible. We could open up a new blog but I've spawned so many blogs over the years that frankly I'm quite reluctant to open yet another one. Maybe we'll do so soon, but for the moment I'll just post about the various issues here and let's see where we get.

Authentication

First topic: authentication. Obviously there will be a lot of API calls that should not be able to be performed by the general public. For example, posting a new action or modifying your profile details.

There are basically two options here.

HTTP Authentication

I think it would be cool to use HTTP Authentication here. The reason is simply that it's quite a standard method for authentication. Maybe not one of the most secure, but if used right and combined with SSL it should be reasonably secure. What else are you going to do anyway?

Using PHP's CURL extension, you could do something like this:

$curl = curl_init();
curl_setopt($curl, CURLOPT_USERPWD, "mylogin:mypass");

The main issue with this is that you can't just simply use something like this with HTTP Authentication:

$xml = new SimpleXMLElement("http://sdsn.example.com/status", 0, true);

Or perhaps:

$content = file_get_contents("http://sdsn.example.com/status");

So basically you have to use the full CURL. It should be installed on most setups, but it's a bit more difficult to use than these really simple functions.

The other issue is using it together with XHR. I'm not sure if somebody managed to get that to work yet but I'm not so sure if there's a nice way to pass the username and password as parameters to the XMLHttpRequest object. My research so far has not been extensive but I didn't pick up anything fruitful.

Querystring Parameters

This option does not really feel like following well established existing standards and conventions, but at least it allows us a lot more flexibility and can make things a lot easier. Since that is the whole point behind this project, making distributed social networking simple, this could make a lot of sense in our case.

For example, let's say we pick username and password as the names of our two standard parameters that will work across all our APIs. For a password protected status stream, we could request it using any client by using the following URI:

http://sdsn.example.com/status?username=charlvn&password=ipwnnoobs

For example, in PHP:

$xml = new SimpleXMLElement("http://sdsn.example.com/status?username=charlvn&password=ipwnnoobs", 0, true);

Or perhaps even:

$content = file_get_contents("http://sdsn.example.com/status?username=charlvn&password=ipwnnoobs");

OpenID, MicroID, etc.

These will be discussed in tomorrow's follow-up post.

Feedback

Please, we really want to get the community involved in this so by all means, comment with your thoughts.

At some point in time we'll get a decent voting feature up as well, distributed-style. :)

Setting up Jabber servers are easy

... especially if you have good documentation to help you. :)

Recently I set up a Jabber server in like 10 minutes on Ubuntu after reading SettingUpJabberServer on the Ubuntu community help wiki.

A day or two after that I set up Openfire on CentOS after reading Openfire Jabber/XMPP Server on CentOS mini-Howto on Tony Bhimani’s Blog quick-quick.

XMPP is such a great technology for communication, syndication, and even distributed social networking, it's really worth playing around with it. But more info about that soon. :)

HTML to DOM in PHP using Tidy

When you want to unserialize a SGML document into the DOM and that SGML document does not conform to XML syntax, in PHP you're screwed because PHP only has XML tools, not really any proper SGML tools. For example, let's say you want to read an HTML 4.01 document. Or an XHTML document of a negligent or lazy author that did not bother to validate. (Just kidding, no flames please.)

Anyway, let's say I open my homepage directly using SimpleXML:

<?php
$xml = new SimpleXMLElement("http://charlvn.za.net/", 0, true);
echo $xml->head->title;

I might get this as output:

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://charlvn.za.net/:10: parser error : Opening and ending tag mismatch: link line 9 and head in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: </head> in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://charlvn.za.net/:19: parser error : Opening and ending tag mismatch: img line 19 and h1 in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: <h1><img src="/images/logo-big.png" alt="CharlNet"></h1> in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://charlvn.za.net/:48: parser error : Opening and ending tag mismatch: h1 line 19 and body in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: </body> in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://charlvn.za.net/:49: parser error : Opening and ending tag mismatch: body line 11 and html in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: </html> in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://charlvn.za.net/:49: parser error : Premature end of data in tag link line 8 in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: </html> in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://charlvn.za.net/:49: parser error : Premature end of data in tag link line 7 in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: </html> in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://charlvn.za.net/:49: parser error : Premature end of data in tag link line 6 in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: </html> in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://charlvn.za.net/:49: parser error : Premature end of data in tag meta line 4 in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: </html> in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://charlvn.za.net/:49: parser error : Premature end of data in tag head line 3 in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: </html> in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: http://charlvn.za.net/:49: parser error : Premature end of data in tag html line 2 in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: </html> in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /var/www/vhost/social.charlvn.za.net/tidy.php:7 Stack trace: #0 /var/www/vhost/social.charlvn.za.net/tidy.php(7): SimpleXMLElement->__construct('http://charlvn....', 0, true) #1 {main} thrown in /var/www/vhost/social.charlvn.za.net/tidy.php on line 7

Bah.

But, not to despair. The PHP Tidy Extension is here to help!

<?php
$tidy = tidy_parse_file("http://charlvn.za.net/", array("output-xhtml" => true));
$tidy->cleanRepair();
$xml = new SimpleXMLElement($tidy);
echo $xml->head->title;

Now I get the following as output:

Charl van Niekerk

So, how cool is that? :)

Only trick is, Tidy is not installed by default and I haven't seen it on many servers yet. But if you have your own server, or you can get it installed, man it pwns. :)

Yes, this is quite a bit of a hack, but whatever.

Using the Muti API with PHP

Why do I love PHP 5? Simple:

<?php $xml = new SimpleXMLElement("http://muti.co.za/api/userinfo/charlvn", 0, true); ?>
<!DOCTYPE HTML>
<title>Charl van Niekerk's Muti Links</title>
<link rel="stylesheet" type="text/css" href="style">
<h1>Charl van Niekerk's Muti Links</h1>
<ol>
<?php foreach ($xml->link as $link): ?>
 <li><a href="<?php echo htmlspecialchars($link->url); ?>"><?php echo htmlspecialchars($link->title); ?></a> (<?php echo $link->votes; ?> Votes)</li>
<?php endforeach; ?>
</ol>

Again, needs some error handling, but otherwise, it works. :)

When the trunk got drunk...

I'm sure there are lots of devs out there that can share some funny subversion commit message stories. This one had me virtually in stitches. Yes, this was actually an authentic mistake, I promise. What's even funnier are all those error messages when I quickly pressed Ctrl+C in haste as soon as I realised my typo.

[charlvn@www trunk]$ svn ci -m "added php api dir in drunk"
svn: Commit failed (details follow):
svn: OPTIONS request failed on '/svn/trunk'
svn: OPTIONS of '/svn/trunk': SSL negotiation failed: Interrupted system call (https://sdsn.googlecode.com)
[charlvn@www trunk]$ svn ci -m "added php api dir in trunk"
Authentication realm: <https://sdsn.googlecode.com:443> Google Code Subversion Repository
Password for 'charlvn':
Authentication realm: <https://sdsn.googlecode.com:443> Google Code Subversion Repository
Username: charlvn@charlvn.za.net
Password for 'charlvn@charlvn.za.net':
Adding         trunk/php
Adding         trunk/php/api

Committed revision 2.
[charlvn@www trunk]$

Generating Random Strings in PHP

In web development (actually in software development in general) we frequently have to generate random strings of characters. Almost always, it has something to do with security or some form of validation. For example, e-mail address verification, CAPTCHA codes (although this is often done with dictionaries), invite codes, and sometimes even things that the user will never see such as tokens that are passed between servers via the client.

Be that as it may, it's always handy to be able to generate these strings easily, so a reusable function seems quite appropriate.

For the uber lazy:

$randomstring = md5(rand());

Hardly seems appropriate for any professional. Firstly, the rand function is not always that random and in addition it's quite slow. The mt_rand function should be preferred at all times.

Secondly, the md5 function will return a normalised 32 character string. To me, this is too long to send to users and too short to use for background tokens.

Thirdly, at least add a unix timestamp to that or something. Now there's a few nice "random" characters you can get for minimal overhead. Obviously, don't rely just on that, because then a potential attacker can narrow down the potential hashes dramatically if (s)he knows more-or-less when the code was generated.

Coming out of the mindset of using hashing functions (which are actually stupid for this purpose in the first place), I invented this function:

function getRandomString($length, $randomness=50) {
  $s = '';
  for ($i = 0; $i < ceil($length / 40); $i++) {
    $n = time();
    for ($j = 0; $j < $randomness; $j++) {
      $n .= mt_rand();
    }
    $s .= sha1($n);
  }
  return substr($s, 0, $length);
}

It works quite nicely, but is not very efficient and the characters will just be 0-9a-f because it's normalised as hexadecimal. We want all the way from a to z. Using both uppercase and lowercase though can be a bit pesky if the user has to enter it somewhere without the ability to copy and paste. Also, non-alphanumeric characters are often treated specially so just a standard 0-9a-z works well if the user has to work with the string. Hence my second try:

function getRandomString($length) {
  $s = '';
  for ($i = 0; $i < $length; $i++) {
    $s .= base_convert(mt_rand(0, 35), 10, 36);
  }
  return $s;
}

If we want to get a single random uppercase or lowercase letter, we can use these:

function getRandomUppercase() {
  return chr(mt_rand(65, 90));
}

function getRandomLowercase() {
  return chr(mt_rand(97, 122));
}

If we don't have to worry about special characters, we can use a similar technique, for example chr(mt_rand(35, 126)). Just throw that through a loop and Peter's your uncle! (Why should "Bob" always be your uncle?)

Reading hCards from PHP

... is really simple:

<?php $info = unserialize(file_get_contents("http://tools.microformatic.com/query/php/hkit/http://charlvn.za.net/contact")); ?>
<ul>
 <li>First Name: <?php echo $info[0]["fn"]; ?></li>
 <li>Email: <a href="mailto:<?php echo $info[0]["email"]; ?>"><?php echo $info[0]["email"]; ?></a></li>
</ul>

Obviously, in the real world, you want to do some proper error checking and handling but for an example script this is pretty cool.

Jabber.co.za

jabber.obsidian.co.za has been "deprecated" it seems. We now have Jabber.co.za to replace it. I already migrated so my Jabber ID has now changed to charlvn@jabber.co.za and I will no longer be using jabber.obsidian.co.za. If you are also using jabber.co.za and charlvn@jabber.obsidian.co.za was a contact of yours previously, apparently charlvn@jabber.co.za will be a contact of you now as well automatically. Otherwise, just add my new ID please, thanks!

Having Research Day

I used to do a lot of research. The reason I opened this blog was mainly to write about all of that. However, since I got so busy with work, I started to completely neglect it. All that happens is that you end up really getting dumb and stagnating because you're caught up in sorting this and sorting that. At the end of the day you have to force yourself to sit down and just learn. That's why, from now off onwards, Saturday will also be known as Research Day for me as I will be doing only research and keep work off as far as possibly possible.

Bojhan also told me a long time ago that I should never neglect my personal projects. I did not follow his advice and now I regret it. We can't change the past. But luckily, we still can change the future. ;)

Simple Distributed Social Networking

The Team

The Name

We agreed that the name of the standardisation project would be Simple Distributed Social Networking, or SDSN, just in case there weren't enough acronyms already.

We believe that the current implementations of distributed social networking are much too complex. This was the main inspiration for this project, hence the name.

Identity

In order for this to work, each person needs to have a unique identity. This must make use of current internet standards. You might be thinking OpenID, but we are thinking even simpler: DNS.

Each person in the SDSN "space" would be uniquely identified by a domain name.

Since I already own a domain, I will use it. In other words, my globally unique identifier will be charlvn.za.net. I am the only one with that domain, so that identifies me.

We could have third-party services. For example, if you register with Jaiku, you get your own domain (mine is charlvn.jaiku.com). We could have similar services that allow the user to register their own domain instantaneously, for free.

Data

All that we need to get to the data is the person's identity. We can use the identifier, or the domain name, and make certain assumptions about XML data that would be accessible via HTTP (or possibly even HTTPS) on this domain name.

For example, let's say you wanted to get my first name after only getting my identifier. My identifier is charlvn.za.net, so my first name would be in my "about" file located at:

http://charlvn.za.net/sdsn/about

This document could look something like this:

<about>
 <firstname>Charl</firstname>
</about>

This is easily machine readable, so you could read this using a script and do virtually anything with it.

However, let's say this domain is hosted somewhere crap and we can't upload or generate an XML file at that URI. We must have a fallback mechanism, in this case a new subdomain:

http://sdsn.charlvn.za.net/about

This subdomain could be pointed to a better host, or even a specialised third-party SDSN provider.

The Process

We are completely open with this process.

In the interest of actually getting somewhere (unlike the various other projects), we cannot afford to let this go and wait forever until eventually everybody agree (like the W3C for example). Everybody agreeing will never happen anyway. We realise that our implementations will be non-optimal but it's better to get something out there sometimes than dreaming about this for years and never getting anywhere. We'll just have to refine it as we go along.

We are however very open to public feedback. Please mail me or comment if you have any ideas or thoughts and we will follow them up. We really want to get this up there as fast as possible, but in this process also as good as possible, so if you can help us get there, your help would be highly appreciated and we certainly intend on giving you the credit you deserve. :)

Distributed Social Networking Lab Launched

I just launched my new distributed social networking lab.

What else is there to say, really? :)

This would have been more suitable as a micro blog post.

Case-insensitive file names on Apache

The human mind normally does not care a lot about the case of letters. An uppercase and lowercase letter is generally seen as pretty-much the same thing. Of course these things are important for proper writing, only geeks see a uppercase "A" and a lowercase "a" as completely two different things though, probably because they see it in bits and bytes instead of letters. :)

Windows, being made for noobs (by noobs, IMHO) ignores the case of letters in path names. However, technically superior systems such as most (all?) *nix flavours do not do this as it is less efficient. After all, a character is just a binary number for a computer. Two different cases of the same letter has two entirely different binary numbers, so they are completely different, so why bother.

A Windows noob on a *nix server can also be quite dangerous unfortunately...

I uploaded Contact.htm (note the .htm instead of .html), so why does it return a 404 when I request http://mysite.example.com/contact.htm? Now all my links are broken, and it worked perfectly on my machine! What did you do to my site, you technical support bastards? You probably think this is very funny and all and all! Well, it's not! Stop breaking my site and leave it alone!! My business is suffering and I'm losing all these millions because you're screwing around!!

Yeah, right... Doesn't matter what you say, you are the guilty one. Why even try to explain or contend with this kind of behaviour?

Rather just enable mod_speling (gotta love the name, these guys have a really good sense of humour). In a .htaccess file, it's simple:

CheckSpelling On

Now the user can request any case they like and even have one typo. They just get conveniently redirected.

You obviously need mod_speling loaded in your Apache though, but luckily this seems to come default with many servers these days.

Also, note that this does not stop the user from having two files, the one called Contact.htm and the other called contact.htm, in the same directory, as *nix will allow that. It's two totally different file names, of course. :)

Getting back on track

The last month has been unbelievably busy, am only now starting to sit down and regain focus again. Sometimes you get so engulfed in work (and personal issues) that you completely start to lose focus. This is about the worst thing that can ever happen, because it means you end up neglecting everybody and just get a whole lot of really pissed off people. By the looks of it, this seems to be happening a lot in today's ICT industry, especially with the severe skill shortage we have in South Africa in the area. I had to seriously change the way I work, implement proper time management (which is much more tough than most people think), keep focused and motivated.

Losing sleep is really not worth it. You just end up working less productive while you're awake and your overall productivity actually falls instead of climbs, and of course your quality starts to fall as well. It's not about working hard, it's about working smart.

When the pressure is on, it's so easy to start to take shortcuts. In other words, stop planning your work properly, just "get it done". That's about the worst thing that can ever happen. You don't save time by not planning, you actually lose time, both in the short and in the long term. When you are doing architecture and design, you are using a completely different part of your brain than when you are coding. The one moment you're using your right side, then your left side.

In other words, do the one, switch over to the other mode and do that. Sometimes switching to a different mode can mean that you completely have to get yourself out of your current physical environment. Taking a trip on an airplane, or even just sitting down at a coffee shop can do wonders for this. Just get yourself out of there, move your mind over to something else, and focus on that.

Although flying is still probably the best way to travel, I am tired of losing 2 hours of time in a long flight between George and Johannesburg. Between Johannesburg and Gaborone, and between George and Cape Town, flying is fun as it doesn't last much longer than about 45 mins. Not being productive for two hours is pure punishment though, it's so boring. No I don't want to read your book, I want to code!!!

What's this business with not being able to use your wireless connectivity devices on an airplane? If you ask me, the important electronics on an airplane should be protected anyway, just imagine the excuse "sorry the plane crashed because one of the passengers made a phone call". Bah.

We don't want wifi enabled airplanes, we demand it. No, not for a premium fee, in South Africa flying is expensive enough. It should come as standard, even for economy class passengers on all domestic flights. And why on earth do we need to ask the captain for permission just to take out our laptops?!?!?! It should be expected! "Passenger A, why are you not working yet, you lazy bastard! Get that PC out and start typing, or else we throw you off mid air, and don't think we will be kind enough to sponsor you a parachute!" :)

That almost sounded like one of the lame jokes they would make on Kulula. Haven't flown with them though in a looooong time, for obvious reasons... You even had to pay ridiculous prices for your flipping in-flight snacks, separately!!! Not like I care, I typically hate airplane food anyway. Do these people have no respect for the longevity of their well-paying clients? Ahem, hello! If we die we no longer need to fly. :)

For the moment, I'm just trying to use the time productively and just to sleep during those two hours, but that's not always so easy, just to sleep on demand, especially not when your mind is racing with ideas and the next big invention you're dreaming up.

Are you using a %#@$* browser?

Web developers from all around the world are having sleepless nights because a large percentage of internet users are using a really terrible browser that came all the way straight from the deepest darkness of the earth. This browser does not deserve to see the light of day, not because it's user interface sucks (maybe that too), not because it's coupled with a really famous (or infamous) operating system, but because the rendering engine is absolutely terrible for us developers. It is so bad, I don't even consider it being worth while wasting time on, getting my own sites to work in it. It's so bad, even though so many people use it, I take a stand in not supporting it on this blog.

So it's time to answer the question for yourself...

Is it a f****** irritating browser?

Google Social Graph API

This is extremely exciting, especially for us guys busy with distributed social networking. Google released their Social Graph API recently. Yes, they are actually reading XFN as well as FOAF.

Well done Google, we can certainly make good use of this! This came at exactly the right time!!

BBC: The Truth About Food

Over the past few weeks, I have been following a BBC series called The Truth About Food. I generally take a good diet quite seriously, although the last few months working quite hard, I have also been making far too many compromises.

Anyway, tonight I watched an episode about dieting. Generally quite interesting, but I differ on a few topics.

Firstly, apparently alcohol (in moderation) is good for the heart. Yes, alcohol is quite enjoyable, but I fail to see their point. So what, it might relax the arteries and increase blood flow, but at the end of the day alcohol is still a poison and the liver tries to filter it out of the system as quickly as possible. Is the positive effects really so great relative to the negative (poisoning) effects?

So apparently red wine is particularly good. This is because there are some other ingredients in the wine that also help the arteries (and/or the rest of the body), particularly resveratrol (also found in the skin of red grapes), polyphenol (also found in berried, normal grapes and even beer), antioxidants (found in lots of stuff) and flavonoids (also found in citrus and tea). Red wine may be a good source of those but I would rather look at the non-alcoholic sources for mass consumption.

Sounds to me like some lame excuses to get a little tipsy. If you want to go out and drink, drink, but just don't spin me all kinds of crap about it and try to justify yourself. Thanks.

Secondly, what is up with this "detoxification diet doesn't make a difference" shit. Yeah it would actually help a lot of you bothered to do a proper study. You think you can do a study on a bunch of youngish girls for a few days and then draw all kinds of "scientific" conclusions? You need to run something like that for at least a month or two to be able to make real conclusions.

I often get this where I start to feel a little sick. It could be a poor diet (I normally grab whatever's going when things are a little hectic), too much stress, lack of sleep, or probably a combination of those that take its toll. I then quit for a few days, take it easy, eat the absolute minimum, and when I eat, I eat only raw fresh stuff and the same for everything I drink. After a few days, I feel wonderful again. I don't know if that's detoxification or not, I don't know if it works the same for everybody, I just know it works for me.

But still, interesting series in general, recommended watching. I do get a little worried though because their "science" is definitely not the same as mine.

Huawei E220 3G USB Modem on Ubuntu Feisty

I recently got a Huawei E220 Vodafone 3G USB Modem to use with South African cellular network Vodacom (yes, I do believe the two companies are related, doesn't Vodafone have shares in Vodacom?) from my laptop. My laptop is currently running Ubuntu Feisty. I tried to install Ubuntu Edgy Gutsy but things completely broke apart. The installation went fine but after I rebooted, Gnome threw all kinds of errors and the font size was so large it completely ran off the screen. I had to reformat and put Feisty back on.

So for the moment I'm stuck with Feisty until Ubuntu fixes their shit or until I switch to a different distro. I wouldn't really like to do that though as Ubuntu has been pretty good for me so far (I've been using it for longer than 3 years already, I started using it back in the day when almost nobody even knew it existed and it only had a minority user base, mostly in South Africa).

Be that as it may, back to the point.

I Googled around and found quite a bit of interesting information. Believe it or not, particularly from South African resources, even though I only used generic keywords like "vodafone", "3g", "usb", "linux" and "ubuntu".

As Tectonic prescribed, I firstly installed some packages:

sudo apt-get install python-dbus python-twisted python-serial python-glade2 python-pysqlite2 wvdial nozomi-source python-notify python-gnome2-extras

Then I downloaded the Vodafone Mobile Connect Card Driver for Linux 1.99.17 (Debian Package). This was the latest at the time (still as at time of writing).

Then I tried to install it (just putting the command here for the noobs):

dpkg -i vodafone-mobile-connect-card-driver-for-linux_1.99.17_i386.deb

Please don't tell me I need to remind you that your current working directory needs to be the same directory containing the file you just downloaded.

Anyway, after installing it, it quickly became apparent that I need two more packages:

sudo apt-get install xdg-utils python-tz

This can also be fixed by doing something like the following apparently:

sudo apt-get install -f

I think that was the command but I can't remember correctly and can't find it in my ~/.bash_history now either.

Anyway, now I fired it up:

/usr/bin/vodafone-mobile-connect-card-driver-for-linux

You can also start the debugging version which will print out a lot of stuff to the command line:

/usr/bin/vodafone-mobile-connect-card-driver-for-linux-debug

It picked up my modem and eventually I got to the main screen but the preferences panel just didn't want to open.

I closed it down and fired it back up again. This time it just hung during the load. Well, it didn't hang exactly, I could still safely close it down. But it did not get anywhere either so the main panel never opened.

Ok, so I took another look at the site. It seems like this version was actually intended for Edgy Gutsy. I downloaded the last version that was still specifically meant for Feisty, which was Vodafone Mobile Connect Card Driver for Linux 1.0 (Feisty Debian Package). If you don't hate this long name and these ridiculous links by now, I don't know what to do to make you hate them. You must be one super patient person!!!

I uninstalled the previous version. I can't remember exactly what the package name was but just:

apt-cache search vodafone

... And you should find it. Then just do the normal sudo apt-get remove and the package name.

Install the older version of the package using dpkg as above and then fire it up again the same way as before.

This time it picked up my card, connected, opened up the main panel. I entered the preferences screen, and filled out my details as detailed in the Tectonic post linked to above.

It seems like this time I managed to connect. I closed down the application and opened it up again. Now it just hangs keeps authenticating and never finished. I closed it down a few times and opened it up again, same thing keeps happening so I got irritated. I closed down the flipping thing, uninstalled the package and installed the newer version again for some unknown reason.

This time I fired it up, it told me that it picked up some settings from a previous version it would like to import, of course I agreed and it booted in. Everything worked other than the DNS servers. I just set myself some static DNS servers in the preferences panel again. It's interesting that this is actually the default, to use some static servers, but Tectonic said that I should let it pick these up automatically, and it didn't work for me. I just inputted some public DNS servers I know about (not going to tell you which, sorry) and all went great. I connected and my internet was faster than what I'm used to on ADSL. Well, actually only the international was faster, not the local.

Weird experience.

Today I was thinking, why on earth can't they just define a standard for USB connectivity devices that any platform can support out of the box. I mean, the SIM card really has all the details, DHCP should work for all the configuration details, why do we need all kinds of fancy control panels and drivers and shit. The operating system does not even need to know it's 3G. It should just know, hey, I can use this device to access another network. That's all, isn't it? Keep it simple, stupid!!!

Update: Yes ok so the device has a build-in driver for Windows. Insert it for the first time, Windows will mount it as a flash disk and install the driver automatically. That is quite cool but also very dangerous, as it's Windows specific. But in the first place, why do we need yet another driver? I could never understand why we can have generic keyboards and mice but not a generic connectivity device.

Copyright © 2004-2009 Charl van Niekerk. All articles are released under the Creative Commons Attribution 2.5 South Africa licence, unless where otherwise stated.