Category: Tech

  • Matt replies..

    .. to Jeff’s post. Finally. I had almost given up hope but Matt is back with a bang! Now wait for Jeff’s reply.

    PS: The post by Matt has apparently been removed 🙁

  • Jeff vs Matt

    It seems like a nice little battle is brewing between Jeff Atwood (of Coding Horror fame) and Matt Mullenweg (creator of WordPress).

    Jeff has just posted an analysis of the WordPress CPU usage which he feels is unreasonably high and wonders why the WP-Cache has not been integrated into the core structure of WordPress itself. And I agree with his points. I have seen a number of instances where servers (and websites) running WP crumble upon being Dugg.

    I am waiting for Matt’s response. Should be an interesting show 🙂

  • WordPress, Mediawiki & Firebug

    First – upgraded the blog to WordPress 2.5. The new interface looks cool and features easy navigation to more often used options. Also, the upgrade process was a breeze. You can read about how to do it here.

    Next – for the past many days, I have been stuck with a faulty error prone version sort table JavaScript being used by MediaWiki. After a lot of head breaking and seeking help on the forums, I was frustrated by Friday and sought help from a friend at Yahoo. He was short on time and promised to do something today. Anyways he happened to mention that I should use Firebug plugin for Firefox.

    I had installed Firebug on Firefox long back when I was experimenting with CSS. I did not know how to debug JavaScript using it. So a google search and a blog post later, I was ready to get my hands dirty. And after an hour or so, I was beginning to see light at the end of the terminal. I had located the error and could now fix it easily.

    So here I am, all happy and contended. I would like to add this fix to the script on the next Wiki release. Hopefully my first contribution to the wonderful open source community!! Also, even though the guys on the forum were unable to help me on this one, they have been a wonderful bunch of extremely helpful folks. Thanks everyone – keep rocking!

    PS: I know very little about JS, with my programming experience limited to C and VBA. So this particular hack – I am immensely pleased about.

  • Google takes down HuddleChat

    After a lot of hue and cry over the blogosphere over the similarity between Campfire and HuddleChat, a sample application for the Google AppEngine, Google team has decided to take down the app.

    huddlechat.JPG

    While I appreciate the quick action over the reaction of a lot bloggers, I find it pretty stupid. The web is full of examples of similar apps, and taking down one because it is similar to other, even though it is simpler and free, is just plain stupid. I have no idea why the bloggers took offense at it in the first place! While I do agree that the similarity was pretty obvious (from screenshots that is – never got a chance to use it), doesn’t the same logic apply to MS Office & OpenOffice??

    Come on people, grow up. People are going to develop similar apps, only that they would be easier to use and FREE – not paid. I was looking forward to using it 🙁

  • Experiments with Wiki

    This is a purely tech post, and so if you do not have a nerdy side, please skip.

    I have had to work with Mediawiki quite a lot in recent times. As I am not very well versed with PHP or the Mediawiki software in general, I have had to depend on the Wiki community at Mediawiki Forums. Its an amazingly helpful and quick forum and you would get you answers pretty quick. Just one advice. Try out your changes on a local setup.

    This post is a listing of the problems I have faced and how to tweak your way around it.

    1. Installation problem

    I was using 1and1 shared hosting to host the wiki. Also, I was first emulating all steps on a XAMPP installation on my system. I was able to install Mediawiki on XAMPP, but the installation failed on the 1and1 account. Google then came to resuce. I saw that many more were facing this problem. You would have to rename the config folder to config2 (or anything else you want), change permissions to 777. Then run http://www.youdomain.com/config2/index.php and take it forward from there. Also, you might need to create a .htaccess file with the following line:

    AddType x-mapp-php5 .php

    2. Restricted user access

    Due to some security concerns, I had to restrict the access to the wiki. Here is the what you need to do to disallow any unregistered user from accessing the wiki. Add the lines below to your wiki.

    $wgGroupPermissions['*']['edit']            = false;
    $wgGroupPermissions['*']['createpage']      = false;
    $wgGroupPermissions['*']['createtalk']      = false;

    3. Redirect to login page

    After you block unregistered users above, mediawiki takes you to an error page instead of the login page. To go directly to the login page make the following pages. Add 2 entries in Localsettings.php

    $wgUseAlternateLandingPage = true;
    $wgAlternateLandingPage = "Special:Userlogin";

    Also, make the following changes to index.php

    CODE BEFORE
    # Query string fields
    $action = $wgRequest->getVal( 'action', 'view' );
    $title = $wgRequest->getVal( 'title' ); // This is the line that is changed
    $wgTitle = $mediaWiki->checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang );
    if ($wgTitle == NULL) {
    unset( $wgTitle );
    }
    
    CODE AFTER
    $action = $wgRequest->getVal( 'action', 'view' );
    $title = ( $wgUseAlternateLandingPage && ($wgUser->getID() == 0 ) ) ? Title::newFromText($wgAlternateLandingPage) : $wgRequest->getVal( 'title' ); //This is the line that is changed
    $wgTitle = $mediaWiki->checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang );
    if ($wgTitle == NULL) {
    unset( $wgTitle );
    }

    4. Redirect after login

    For a reason that still eludes me, Wiki redirects to a stupid intermediate page instead of the page itself. To implement this make the following changes in SpecialUserLogin.php.

    Before:
    
    function successfulLogin( $msg, $auto = true ) {
    global $wgUser;
    global $wgOut;
    
    # Run any hooks; ignore results
    
    wfRunHooks('UserLoginComplete', array(&$wgUser));
    
    $wgOut->setPageTitle( wfMsg( 'loginsuccesstitle' ) );
    $wgOut->setRobotpolicy( 'noindex,nofollow' );
    $wgOut->setArticleRelated( false );
    $wgOut->addWikiText( $msg );
    if ( !empty( $this->mReturnTo ) ) {
    $wgOut->returnToMain( $auto, $this->mReturnTo );
    } else {
    $wgOut->returnToMain( $auto );
    }
    }
    
    After:
    
    function successfulLogin( $msg, $auto = true ) {
    global $wgUser;
    global $wgOut;
    
    # Run any hooks; ignore results
    
    wfRunHooks('UserLoginComplete', array(&$wgUser));
    
    $wgOut->setPageTitle( wfMsg( 'loginsuccesstitle' ) );
    $wgOut->setRobotpolicy( 'noindex,nofollow' );
    $wgOut->setArticleRelated( false );
    $wgOut->addWikiText( $msg );
    if ( !empty( $this->mReturnTo ) ) {
    $wgOut->returnToMain( $auto, $this->mReturnTo );
    } else {
    $wgOut->returnToMain( $auto );
    }
    //
    header('Location: ./index.php?title=' . $this->mReturnTo);
    }

    Also, incidentally this the first post from home. More regular updates expected.