Implementing a Ruby-Based LDAP-Server

Oh yes. Good question. Why would anyone want to implement a LDAP Server? Besides the fact the OpenLDAP is a pain to set up and isn’t really rewarding in terms of perfomance, there are situations demanding LDAP Access to data residing in some kind of RDBMS. And that’s my motivation.

After seriously thinking about doing it all by myself, I plugged in Google to get some answers. And there is ruby-ldapserver, hosted at rubyforge. Unfortunately. the project seems pretty dead, nevertheless the Alpha 0.3.1 Version released there works fine, although without SASL support, only simple ( plain bind ) works. 

How to use it? It’s very straightforward. Download the package, see that it’s in your path, and ready to rock. The package includes a few examples, showing off the beauty of the lib and ruby. That is how you implement a fully working LDAP Server ( okay, doing nothing, but works. )

class MyLdapOperations < LDAP::Server::Operation

  def search(basedn, scope, deref, filter)
    puts scope
    puts basedn
    puts deref
    puts filter[1]
  end

  def simple_bind(version,dn,password)
    puts "Auth: #{dn} + #{password}"
    puts version
  end

end
s = LDAP::Server.new(
	:port			=> 1234,
	:nodelay		=> true,
	:listen			=> 10,
#	:ssl_key_file		=> "key.pem",
#	:ssl_cert_file		=> "cert.pem",
#	:ssl_on_connect		=> true,
 :o peration_class	=> MyLDAPOperations
)
s.run_tcpserver
s.join

You launch it, and it works. Certainly worth giving it a try, and a good piece to start if you want to get involved in the OS community.

The need for web-development certification

Good day. I need to distract myself from trying to reanimate a Windows-PC. Quite frustrating and pretty unsuccessful so far, but let’s see. Why a certification of the abilities of a web-developer? Well, there are plenty of good reasons. Let’s get into them.

First of all, everyone doing something seriously should be able to get a certificate on his or her field of work. If you’re a professional, why bother taking a test and tell the world you made it? I’m getting your point here: a test only for the sake of a test isn’t worth it, right.

Web standards are a very serious matter. Of course, the average internet user doesn’t bother if a page doesn’t look cool or something, even flash-based pages impress. But when it comes to accessability, typography, usability, web standards try to give developers a good set of tools one can use to improve the overall experience of both the developer and the consumer. There is no direct impact of whether you’re still using tables or already using divs to layout your content, but in the long run it will pay out, even if it’s only that you made it to decrease your traffic costs.

Another very important reason is that web-development and web-design is still terribly underpaid. Many of my friends are doing such things for .. almost nothing, while some well-established companies are building terrible html4 pages and getting a huge load of money for it. And that’s where a certification would kick in. And by proving customers that you are indeed worth it, everyone with the real ability to build web-based stuff would certainly have the realistic chance to increase his or her income.

In my opinion, this certification should be something free, a community should build it, I don’t know how but I’d be glad to have such a thing.

Test drive Piwik Analytics Software

Finally, I found the time to install Piwik, an open-source Google Analytics lookalike. I’ve chosen to maintain a solution besides analyzing server stats to track traffic. Why? By using a snippet that executes some code, it is ensured that most spiders are simply not counted, careless of how well they are disguised.

Back to Piwik: the two main advantages over Googles solution are that you keep the data local and can do whatever you want with it, and for the curious, statistics are realtime.

The installation went down without any problems, as expected. Unfortunately, another PHP software requiring MySQL, though Piwik uses DataObjects, so porting it to work with any other DBMS shouldn’t be a big deal.

The snippet to include is a bit larger than Google’s one, Piwiks one is this:




While Googles snippet looks something like this:


Note that Google updated their snippet recently to include now a try-catch blog. Read the Analytics page for more info here. If you want to try out Piwik, just drop me a line and I’ll give you an account here if you want.

I’m quite curious on how the stats look like, I feel better to host them here than anywhere else, and I’ll also post some comparison of the actual stat results. Stay tuned!

Character Encoding for the rest of us: UTF-8

I spent a fair part of my past life not understanding character encodings in its entirety. While this was totally unimportant in past times, when e.g. a dataformat or file was written or created by the same program reading it, most likely not crossing country or language borders, nowadays it is. Very. So what is this all about? Continue reading

Microsoft to receive the annual award for the funniest bug

Keep looking for that headline! The reason is simple, and you will agree ( hopefully ) that this is indeed a freaking funny bug description. The bug itself is funny, too. And I just don’t understand why, but let the details rest aside, and let’s enjoy it:

A Web site cannot set a cookie if the Domain attribute is in uppercase characters and has an odd number of characters in Internet Explorer 7

You can read find that bug in the Knowledge Base. This post features nothing else but this bold bug description, so here’s my question, to be answered in the comment: what do you think was the code that caused this bug looking like? Any languages ( even brainfuck! ) welcome..

Edit: I stumbled upon a video demonstrating that by getting the square root of 4 and subtracting 2 from the result, the calculator.. outputs some rather unique result. Any explanation here? Try it, works in any Windows version. Buggy times.

Monetizing Blogs: realistic approaches

An interesting question, because many people now start blogging to earn some additional income, inspired by some top-bloggers earning remarkable amounts by just blogging. But is it indeed realistic to expect a blog to become a considerable income source? Most of the time it’s not. Why?

Why do you have a blog? Is it because you are seriously interested in sharing your opinion on some special topic ( like programming and usability here ) or just because you think that everyone should have a blog, just like a linkedin or facebook account. There is no need to have a blog, seriously, and if you have nothing to share, don’t force yourself to. Commenting on someone else’s posts can be very satisfying, too. 

And even if you really do have something to share, be prepared to be just one of many. It’s hard to really distinct yourself from the tons of bloggers out there. You can do so, of course, by choosing a different language, a different style, a yet uncovered topic ( though I guess that’s hard to find ) or some other factor I didn’t think of. If you do so, because you just feel like, chances you will be successful in monetizing your blog aren’t bad. Most of the time, however, blog posts are mostly generic in terms of style and content. 

So now we’re passed that point: Be very unique. That’s certainly a way to attract visitors, and most of all keeping them. But even if you do generate a certain amount of traffic each month, you still don’t earn money. Once again: interested users will find your blog, and if not, the blog is not interesting for them. Simple truth. 

Now, assuming you’ve got your few thousand impressions each month, you really need to monetize it. And it’s been a long road already. Start thinking about Google’s AdSense, though it doesn’t seem to generate amounts bloggers sometimes think they might get. Be prepared to earn just some dollars, nothing spectacular. Remember, people still need to click on a link actually. 

There are other ways of selling your blogging soul. One is to do paid product reviews. Another is the old-school banner. Decide for yourself what you are willing to give up. Because visitors will notice change, and advertising or the attempt to monetize your writings may offend them. Think about that too. 

Or just be happy without all the money-hassle and, assuming you are working like 5 hours a week on your blog, it’s pretty fantastic to believe that 5 hours a week can generate enough money to make it worth mentioning. And even if you want to earn money, keep in mind that even one of German’s top bloggers, Robert Basic, gets an income from about 3000€ each month. And he certainly has traffic…

Foodhacking

Good morning.

 

French fries

French fries

I just realised why i like cooking that much. Because it’s hacking – in a way. My french roommate ( a cool guy btw ) is very good at that, and he impressed me by – bring in the cliché – preparing french fries in a pan. 

I’m curious. All the time, people affine towards computers and related stuff are considered to eat only instant food or microwave dishes. True? I don’t think so, many nerd-friends of mine tend to cook from time to time, not the worst stuff.

It may of course also be affected by the desire for quality. Programming and hacking is sometimes just motivated by the need to improve a situation or to simplify a workflow. Same for food, I guess.

Breakfast was tasty, by the way.