Charl van Niekerk » Blog

Main

Latest

Archives

Powered by Blogger

Go Stii!

As most of my regular readers will know, I don't often make posts of a personal nature and I'm not one to promote individuals and definitely not for sobby sentimentals. However, I met Stii roughly two years ago in George and have always had a great deal of respect for him ever since; when I read the below this evening it really made my generally frustrating day a whole lot better.

Like many other engineers, I am slowly but surely getting somewhat fed up with all the hype and excessive self promotion going on in the ICT industry in this country. This is indeed a very fresh change.

From Stii's about page:

I’m not a PHP Ninja as I don’t believe that you should fight with code. Neither am I a rockstar since I cannot sing nor can I play guitar like Eric Clapton or Eddie van Halen. Legends are people with legacies. Linus Torvalds, Eric S. Raymond, Guido von Rossum, Mark Shuttleworth and Rasmus Lerdorf, amongst a few, are legends. I’m simply the Code Monkey at Afrigator.

Stii, you might not be a rockstar but I think your attitude rocks millions! :)

Open Yale Courses

Paul Scott posted to the nextgen-online list a bit earlier today about Yale Open Courses. It's always great to see more of such excellent material being released under a Creative Commons license.

They have a lot of downloadable course material as well as video lectures. Unfortunately the downloads are a bit on the large side though, so I would most certainly like to see this mirrored in South Africa on mirror.ac.za and/or mirror.is.co.za. I'll start sending some mails later on tonight requesting this to the admins of those services. Considering that we already have a local MIT OpenCourseWare mirror, I figure we stand a fairly good chance of getting this too, especially with some beer/coffee bribing on the side (just kidding). :)

Activity Streams in Atom

Another step forward in distributed social networking! A few days ago, Martin Atkins wrote a post to atom-syntax introducing plans for Some Draft Atom-related Specs for Activity Streams.

They already have the following drafts going:

New Twitter Phishing Scam

I got a direct message from one of my contacts, who I assume has been exploited, less than a day ago saying Hey, i found a website with your pic on it... LOL check it out here http://twitterblog.access-logins.com/login. I thought this was rather fishy, so I opened this in Lynx. It would appear that they set up a Twitter clone site to gather unsuspecting people's Twitter usernames and passwords, probably to use for spamming or who knows what.

When I did a whois on the access-logins.com domain, I found the following:

Domain Name: ACCESS-LOGINS.COM
Registrar: XIN NET TECHNOLOGY CORPORATION
Whois Server: whois.paycenter.com.cn
Referral URL: http://www.xinnet.com
Name Server: NS.XINNET.CN
Name Server: NS.XINNETDNS.COM
Status: ok
Updated Date: 16-dec-2008
Creation Date: 16-dec-2008
Expiration Date: 16-dec-2009

What? A Chinese lot? Definitely suspicious. And I mean, access-logins.com? That is such a poor attempt at Phishing. It's like they tell you what they want to do, they want to access your login details. Bah.

After Googling I also found another post about this New Phishing Scam: access-logins.com.

RSS/Atom in Chisimba Courses

I currently have a ticket assigned to me titled More use of RSS in courses:

We need to make more use of RSS in courses. At the very minimum, the course content pages should have feeds, perhaps one for the course as a whole, and separate ones for each chapter. In addition, the lecturer needs to be able to generate a RSS feed for the blogs of all students in his class, containing the latest posts for each student. What are some of the other areas where RSS can be useful?

Now, the question would be, exactly which types of feeds would you like to see? One of changes to the existing content? One of new content added? Should it be on a chapter level, course level, or both? Also, note the related ticket implement RSS feeds for changes to individual pages, sections, and the whole site.

Also, any preference between RSS and Atom? Should we support either one, or both? Your opinion matters, so please feel free to voice it on the nextgen-online mailing list and/or by commenting on the ticket in trac and/or by commenting on this post. All your feedback will be taken into consideration. Many thanks in advance!

Lucene Frustration

A few days ago I have been playing with the Chisimba file manager module and found myself frustrated by Lucene. For some reason, it keeps tuning me with errors regarding file permissions. This particularly happened when deleting files and directories. For example:

Fatal error: Uncaught exception 'Zend_Search_Lucene_Exception' with message 'chmod() [function.chmod]: Operation not permitted' in /var/www/vhost/chisimba.charlvn.za.net/core_modules/search/resources/1.5.2/Search/Lucene/Storage/Directory/Filesystem.php:189 Stack trace: #0 /var/www/vhost/chisimba.charlvn.za.net/core_modules/search/resources/1.5.2/Search/Lucene/LockManager.php(85): Zend_Search_Lucene_Storage_Directory_Filesystem->createFile('read.lock.file') #1 /var/www/vhost/chisimba.charlvn.za.net/core_modules/search/resources/1.5.2/Search/Lucene.php(410): Zend_Search_Lucene_LockManager::obtainReadLock(Object(Zend_Search_Lucene_Storage_Directory_Filesystem)) #2 /var/www/vhost/chisimba.charlvn.za.net/core_modules/search/classes/indexdata_class_inc.php(219): Zend_Search_Lucene->__construct('/var/www/vhost/...') #3 /var/www/vhost/chisimba.charlvn.za.net/core_modules/search/classes/indexdata_class_inc.php(174): indexdata->checkIndexPath() #4 /var/www/vhost/chisimba.charlvn.za.net/core_modules/file in /var/www/vhost/chisimba.charlvn.za.net/core_modules/search/resources/1.5.2/Search/Lucene/Storage/Directory/Filesystem.php on line 189

Another strange thing is that, when I try to unzip files, I just get a blank screen (no output returned)!

At first, I gave it the finger and disabled it using the following patch:

Index: core_modules/filemanager/classes/dbfile_class_inc.php
===================================================================
--- core_modules/filemanager/classes/dbfile_class_inc.php (revision 12013)
+++ core_modules/filemanager/classes/dbfile_class_inc.php (working copy)
 -321,7 +321,7 @@
         $extra= array('basefolder'=>$folder[0].'/'.$folder[1]);
         
         $objLucene = $this->getObject('indexdata', 'search');
-        $objLucene->luceneIndex($docId, $docDate, $url, $title, $contents, $teaser, $module, $userId, $tags, $license, $context, $workgroup, $permissions, $dateAvailable, $dateUnavailable, $extra);
+        //$objLucene->luceneIndex($docId, $docDate, $url, $title, $contents, $teaser, $module, $userId, $tags, $license, $context, $workgroup, $permissions, $dateAvailable, $dateUnavailable, $extra);
     }
     
     /**
 -762,7 +762,7 @@
         
         if ($result) {
             $objLucene = $this->getObject('indexdata', 'search');
-            $objLucene->removeIndex('filemanager_file_'.$fileId);
+            //$objLucene->removeIndex('filemanager_file_'.$fileId);
             $this->objQuota = $this->getObject('dbquotas');
             $this->objQuota->updateUsage($filePath);
         }

Then, after cooling down, I gave it another shot and it seems like the solution was fairly simple. My Apache instance is running as the apache user, so:

sudo chown -R apache:apache usrfiles

(usrfiles is obviously located in the root of the Chisimba installation)

Now everything seems to work fine, except that it's much slower with Lucene enabled.

Chisimba Module Loading

As noted in a post by James Scoble to the nextgen-online mailing list back in November, currently if somebody attempts to load a module in Chisimba it will execute the module even if the module has not been installed. Please note that by "installed" I mean properly installing the module via the catalogue and having it create the necessary tables, install language items, etc for that particular module. Obviously it has no chance of executing if the source code isn't even there. For example, my (development) installation is a full checkout of all the modules in the subversion repository, so the code is there for all of them even though they might not all be installed.

Because of these "dependencies" (tables, language items, etc), calling many modules will result in an error being displayed, but some of the simpler modules will execute without any problems.

In my response to James's post, I linked to a patch I created to make Chisimba do this check. This is essentially a modification to the Chisimba core (engine class). As noted in my response, it would be problematic putting this into subversion though, as this is likely to break existing sites if they upgrade. Here is a copy of the patch though, for easy reference.

Index: classes/core/engine_class_inc.php
===================================================================
--- classes/core/engine_class_inc.php   (revision 11528)
+++ classes/core/engine_class_inc.php   (working copy)
 -225,6 +225,14 @@
      */
        private $_objDbConfig;
 
+    /**
+     * The modules object of the module catalogue.
+     *
+     * @access private
+     * @var    object
+     */
+    private $_objModules;
+
        /**
      * The layout template default
      *
 -505,6 +513,9 @@
                //Load the Skin Object
                $this->_objSkin = $this->getObject('skin', 'skin');
 
+               // Load the modules object of the module catalogue.
+               $this->_objModules = $this->getObject('modules', 'modulecatalogue');
+
                //Get default page template
                $this->_pageTemplate = $this->_objSkin->getPageTemplate();
                // Get Layout Template from Config files
 -1672,6 +1683,12 @@
                                throw new customException("Default module not found!");
                        }
                        $this->setErrorMessage("Module {$requestedModule} not found");
+               } elseif (!$this->_objModules->checkIfRegistered($requestedModule)) {
+                       $this->_loadModule('_default');
+                       if (!$this->_objActiveController) {
+                               throw new customException("Default module not found!");
+                       }
+                       $this->setErrorMessage("Module {$requestedModule} not installed");
                }
                // ensure no caching
                if ($this->_objActiveController->sendNoCacheHeaders($this->_action)) {
 -1828,4 +1845,4 @@
                }
        }
 }
-?>
\ No newline at end of file
+?>

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