Published by Niels on 08 Apr 2010

Computable door de bocht

Ik heb me net heerlijk zitten ergeren aan een artikel op de Computable website. De stelling is dat het introduceren (het gebruik wordt niet eens genoemd), van Linux in een bedrijfsomgeving verborgen kosten met zich mee brengt. Dat zou helemaal waar kunnen zijn, maar de auteurs Johan Zwiekhorst en Jozef Schildermans van Data TestLab slaan volgens mij op een aantal punten behoorlijk door. De argumenten op een rijtje:

  • Bovendien is opensourcesoftware minder populair dan Windows, zodat vandalen het vooralsnog grotendeels met rust laten…Echt waar? Zouden de onderzoekers wel eens een gekeken hebben naar de echte getallen over Open Source? Apache, iemand? PHP? Java? Bovendien gaat het begrip Open Source veel verder dan alleen het operating system, dus het begint al door appels met peren te vergelijken.
  • Zoals je waarschijnlijk wel weet, bestaan er honderden Linux-distributies. De toon lijkt nu wel gezet. Feitelijk en tendentieus.
  • De basis van die bundel is de linux kernel: die is hetzelfde voor iedereen. Daarbovenop komt het GNU/Linux platform. Kennis van GNU/Linux ontbreekt blijkbaar bij de auteurs: de kernel is niet bij alle distributies hetzelfde. Ze zijn wel gebaseerd op dezelfde broncode, maar vaak aangepast door de maker van de distributie om zo goed mogelijk aan te sluiten bij de doelgroep van de distributie. De opmerking dat het GNU/Linux platform erbovenop komt is natuurlijk onzin. Het heet GNU/Linux omdat een Linux kernel wordt gecombineerd met de GNU applicaties om een operating system te maken. Richard Stallman zal het niet waarderen dat de GNU applicaties GNU/Linux worden genoemd.
  • Als je een Windows-gebaseerde server draait, dan moet je die clientlicenties betalen ongeacht het gebruikte desktopsysteem. Wat een raar argument. Als het een homogene Windows-omgeving is, moet er ook voor zowel de client als de server licenties betaald worden. Bij Linux ben je in ieder geval nog het bedrag voor het desktop operating system kwijt.
  • Zo blijkt het erg moeilijk om computers van A-merken te kopen zonder Windows erop. Dat is alleen Microsoft aan te rekenen. Dus feitelijk weer juist, maar het lijkt mij eerder een argument om zo snel mogelijk te stoppen met het gebruik van Microsoft producten, want daardoor wordt blijkbaar de prijs van apparatuur onnodig opgejaagd.

Afgezien van de hierboven beschreven argumenten, staat het artikel bovendien vol met taal- en/of typefouten. Ik ben benieuwd naar het vervolg op dit artikel op 12 april, maar gezien de argumentaties in dit artikel vrees ik het ergste.

Published by Niels on 02 Apr 2010

Error: Cannot modify header information…

If PHP ever gives you the following error (I just encountered it while developing with the Yii Framework):

Cannot modify header information - headers already sent by

Then you probably injected some whitespace somewhere in your output. The easiest way to avoid that is by not using the PHP closing tag ‘?>‘ at the end of PHP source files. Some people are against that but if I look into the sources for Yii and read the Zend Framework Programmer’s Reference Guide then it is obviously a well established method of avoiding the mentioned error.

Published by Niels on 23 Feb 2010

Forcing a Yii application to authenticate

I wanted my Yii based application to force users to authenticate. After studying the forums, the manuals and searching the web the solution came to me just as I was about to go to bed. It is dead simple: just make sure that the only action a default user can perform is actionLogin(). See the code below on how to accomplish this:

<?php
 
class SiteController extends Controller
{
    /**
     * @return array action filters
     */
    public function filters()
    {
        return array(
            'accessControl', // perform access control for CRUD operations
        );
    }
 
    /**
     * Specifies the access control rules.
     * This method is used by the 'accessControl' filter.
     * @return array access control rules
     */
    public function accessRules()
    {
        return array(
            array('allow',  // allow all users to perform 'login'
                'actions'=>array('login'),
                'users'=>array('*'),
            ),
            array('allow', // allow authenticated user to perform any action
                'users'=>array('@'),
            ),
            array('deny',  // deny all users
                'users'=>array('*'),
            ),
        );
    }
 
    // The rest of the SiteController implementation
 
}
 
?>

I am not sure if this is the best possible solution, but since it is simple and elegant I am inclined to think it is.

Published by Niels on 07 Feb 2010

Just blogging again

A lot has happened the last couple of years. This has kept me busy and did not leave me with much desire to keep this blog up to data. And just when you think I will blog tomorrow, tomorrow has gone. And when tomorrow has gone, two years are gone.

But while I was enjoying a presentation on Identi.ca at FOSDEM I all of a sudden had the idea that now would be a good time to start again. So I joined Identi.ca and added this entry to this site. Expect more in the very near future. Being on-line feels like fun again.

Published by Niels on 01 Feb 2008

Mmmmm, nerd test…

I am not sure if this is good or bad. I just did the Nerd Test and got the following result:
I am nerdier than 94% of all people. Are you a nerd? Click here to find out!

Should I be proud or crawl back in the basement?

Let’s see with the second test offered at that site:

NerdTests.com says I'm a Cool Nerd King.  What are you?  Click here!

Ok, back into the basement, I have to dust of some comic books…

Published by Niels on 14 Nov 2007

Color schemes, Color schemes, Color schemes…

As a passionate and seasoned user of the best editor in the world I always look around for ways to improve the editing experience. One way to improve that is by selecting a good color scheme. The ViM website offer a ton of color schemes but no way to sample them other then look at the user ratings, install them and then judge for yourself. And even then the color schemes on the ViM site are not all schemes that are available.

Fortunately someone wrote a page where, as far as I know, all color schemes are shown and downloadable. Even my two favorite ones: here and here. The only minor annoyance is the fact that the color schemes are not all alphabetically ordered.

I know, I know, old news, but I still like to use this web site as my own long term memory…

Published by Niels on 14 Oct 2007

Aikido exam images added

Just added some more pictures from the aikido exams in Amersfoort on 6 October. You can find them here.

If you really like them as I do, just contact my lovely wife.

Published by Niels on 12 Oct 2007

Comment spam (a big 132 to spammers)

Ever since I changed my CMS to WordPress, the ability to comment option on my postings has been switched on. Of course I do not want all kinds of spam on my weblog, so at first I made sure that only comments from people I approved would be allowed on this weblog. This caused me to have to disapprove a lot of comments a day, so I installed the Akismet plugin for WordPress. That caught a lot of spam comments automatically, but the plugin retains the comments for 15 days before finally deleting them. So after 15 days I had +/- 900 comment spams in my database, waiting to be deleted once they are 15 days old.

Since I am a cheapskate (read: I don not want to pay for more storage than necessary). I was wondering how to reduce the number of comment spams that Akismet had to catch. So I installed a CAPTCHA plugin called reCAPTCHA. It has the nice side effect that it not only generates good captchas remotely and with disabled (i.e. blind) people in mind, it also is used to help in digitizing old books. The words that you type in are scrambled images from a book that needs to be digitized. What a wonderful project!

Lets see if this keeps down the amount of comment spam. And if you are wondering what the ’132′ means in the title: just show this number in binary using your fingers :).

Update 11:36:

First it seemed that the CAPTCHA plugin did not prevent comments from being processed by Akismet. After some Googling I found that the Akismet plugin had to be switched off. But reCAPTCHA is seems to be easily defeated as I already have 6 comments waiting to be moderated. So for now I will switch Akismet on again, saving me some time moderating.

Published by Niels on 06 Oct 2007

Aikido!

Incredible but true, I passed my aikido shodan test today! It feels really good as most people are convinced I am more of a jiu-jitsu type than an aikido type.

The exam itself went really well. I wasn’t nervous at all and completely focused and relaxed. Although you wouldn’t think so if you looked at my face on the image below. Perhaps that is way people have the perception that I am more of a jiu-jitsu guy.

As far as I know I only made two mistakes: moving a bit too fast on kote-gaeshi and mixing up kata-otoshi and kata-ha-otoshi when asked to perform kata-otoshi.

Next time I hope to take part as Rick’s uke. He unfortunately did not pass his nidan test. But knowing his dedication I am sure that he will put on a great show in March.

A big THANKS! for Willem and Raymond for helping me pass this test and for Rick for still allowing to have a party at his house.

Image of shodan exam

Published by Niels on 25 Jul 2007

The finald leads

Are the heaviest. Or so they say in Dutch. It means that the last task you have to do is the hardest.

This is just a message to let you know that the internal links should now all point to the correct places within this web site and that this website is now fully functional.

Next »