WikiHome

مرحبا بك فى صفحات الويكى لموقع مجموعة جنو لينكس المصرية

مجموعة جنو لينكس المصرية هى مجموعة غير رسمية من المتطوعين المصريين و هى تهدف الى نشر استخدام البرامج الحرة/مفتوحة المصدر و تقوم بتقديم الدعم لمستخدميها فى مصر من خلال منتديات وغرفة محادثة لمساعدة مستخدمي جنو/لينوكس و كتابة و ترجمة وثائق تقنية و تقديم دورات تدريبية للمبتدئين و اقامة معارض ومهرجانات لنشر البرمجيات الحرة مفتوحة المصدر و توزيع أحدث البرامج و الكتب الحرة مفتوحة المصدر و بأى وسائل أخرى متاحة ^___^

تعريف مختصر للويكى:

تجعل بالامكان تحرير و تعديل الصفحات بواسطة أكثر من شخص عن طريق لغة تنسيق بسيطة و سهلة الاستخدام لأى بنى ادم , كل صفحة فى الويكى بطبيعة الحال يطلق عليها "صفحة ويكى" و مجموع الصفحات يكون ما يعرف ب"الويكى" , لاحظ اختيار "edit" بأعلى الصفحة, من خلال هذا الاختيار يمكن لأى أحد أن يغير فى محتوى نص الصفحة, اقرأ الان عن كيفية استخدام لغة تنسيق الويكى و اجعل نفسك فى منزلك فعدل (أو بهدل) كيفما شئت الى أن تعتاد على استخدام الويكى

ملاحظة: حاول التجربة فى الصفحة المخصصة للعبث بدلا من هنا, بالطبع نحن لا نريدك أن تخرب الويكى ^___^

أين أتجه من هنا؟

Miscellaneous

here we put things that don't fit in any other place.

.ape files

The trap, Windows users never think about the users of other Operating systems.

I've downloaded a .ape file, Sure I didn't know this before the download completed.

Now what ? a bit of googling showed me that this is a monkey audio format or whatever it's called.

You can use foobar 2000 to play it, It'll run under wine but I don't like the idea.

I've found a plugin for xmms and bmp but I still don't like it.

During my search I've found an application called nrg2iso It converts nero format to iso. Not bad but this is a side effect of googling ;-)

This page is very good.

Looks like there's something called cue2wav that can solve it but the page seems down or whatever. I think more details are available here!

Anyway, It looks like shntool is the solution. I had to get the mac SDK and a patch to compile the "mac" binary.

Anyway I failed to build the SDK and I'm using the linux port to get a wav. Now that I have a wav let's split it. The guy was nice to include a "cue" sheet so let's get a list of breakpoints:

cuebreakpoints foo.cue
3:29.56
8:13.37
13:43.38
23:07.40
32:03.08
34:56.09
39:28.47
45:06.34
49:30.71
54:25.68
59:14.67

Then we can feed them to shntool and split the file. shntool split foo.wav "it'll read the split points from stdin!".

About the upcoming SSTE Conference

About the SSTE conference i don't know if they will ask us to talk about the unemployment and development in communication and information technology or not but I just prepared some points to talk about in case they asked us to talk about this issue ... and I need cooperation from all of u if u found something not good to tell me and to add some points too..

-The Philosophy behind open source.

open source and what is open source and why it is important... and why people choose to use open source instead of closed source... and why when making the source published in public that will offer much more opportunities for sharing and cooperation between all those who are interested in the field.. and will reduce monopolism and increase healthy competition between developers and contributors.. and also it will not be againest business development. it will be just a little introduction as all of them already knew about open source from the last conference.

-Open source and development cooperation.

how it will be great to make open source cooperate in development of countries in its many ways especially open source software.. and the advantage of open source software applications.

-Open source as a development path.

how using open source will make a right path to development as it has a less cost completely free license that will save money and help in economic development that will lead in development to the whole country.. and the economic development will be explained in the next points.

-Why developing countries must use open source.

i think this point will be important As Egypt is considered one of the developing country.. how the open source is suitable for the developing countries.. as it has no cost so it will save the money that is paid in licenses to be used in another fields..also open source needs many developers and contributors so many people will be able to work in this field and develop in it as it will be easy to learn for many people because of its GPLd tutorials and documentations .. so using open source in developing countries will be a good solution for the lake of money as many millions will be saved to be used in other fields .

-how reduction of unemployment will be one of the results of economic development that was caused by using open source.

and at last it will be so clear that due to economic development that was caused by the use of open source that will reduce unemployment.. and also many people can work in developing and contribution of the open source ..

I really appreciate ur cooperation very much..

Codename: Robert Paulsen (CodeX)

Table of contents
  • Purpose of this document
  • Codename
  • Preamble
  • Guidelines
  • Time plan
    • Before
    • During
  • Logistics
    • Place
    • Equipment
    • Human resources
    • Other facilities
  • The CON
    • Talk sessionns
    • Challenges
    • Special event
    • Side events
  • Aftermath
  • Roles
  • Affiliation
  • Fund raising
  • Extra links


Purpose of this document



This document should serve as an open agenda to help in organizing the first episode of a computer and network security-related convention in Egypt.

Codename



The codename for this project is CodeX Robert Paulsen
The final name is to be determined at a later stage.

Preamble



In today's world, as electronic transactions became an integral part of our life, it is no more a luxury to be aware of the possible threats and the way to counterfeit them. Awareness of the digital security basics is not optional anymore for the the common person to survive. Apparently only a small number of the user posses this awareness level, thus it would be of high importance to raise the awareness level of the computer users in Egypt to cope with today's world demands.

However, this wasn't exactly what I had in mind when I thought of CodeX Robert Paulsen.

CodeX Robert Paulsen is meant to be an event for those who are interested in topics related to computer and networking security to gather, exchange ideas, gain knowledge, meet up and above all chill out and have fun. As an immdiate byproduct to the atmosphere that should be created by such an event is an increase in the public's interest in the computer and network security and accordingly an increase in their security awareness level. Not only the public and the enthusiasts would benefit from the event, but also corporate and governmental bodies as it should expose the nature of the dangers they might run into.

Guidelines



Aims and goals:
  • Have fun - For the technical and the non-technical, the expert and the novice, the black and the blue.
  • Exchange knowledge - Through the talks or direct contact with others.
  • Build relations - A chance for people of similar interests to meet up.
  • Raise awareness - It is important to spread the security awareness among the public, clarify certain misconceptions and possibly more.
  • Did I mention have fun?
Executive conceptions:
  • Logistics - It should be self-contained with respect to the required resources and equipment. In case anythinig is outsourced, it should be
  • Convenience - The event should be organized in way that is convenient both for the organizers, the host and the attendees.
  • Fees - In case admission is not for free. (see Fund raising section)
  • Theme - Should each episode have its own theme where the events would revolve around? (see Time plan: During section)
Processes:
  • Registration - Should the attendees register? (see Time plan: Before section)
  • Admission - There should be an efficient mechaism for admission. From my prsonal experience, admission is mostly messy in any organized event.
Events:
  • Talk sessions - Invited experts or members should hols seminars about topics of interest which are related to the aims and goals.
  • Challenges - A set of security challenging games where (registered?) attendees can take place.
  • Special event - Some event that is related to the theme of the episode.
  • Side events - Extra-curricular activity. Some social/intellectual event at the end of the con to winde up in a less technical and more relaxing way.

Time plan



The stimated duration of the con events is: 2-3 days.
It could be squeezed to a single-day event in case of resource shortage.

Before



Phase I: (brainstorming)
Estimated time: 1-2 months.

During this phase, a complete and thorough model of the event should be set including the aesthetics of the event. Things to be fixed include the resources, the structure of the event, the flow of the event and the back-ups and plan-b's.

Phase II: (web posting)
Estimated time: 2 weeks.

During this phase, the material discussed in phase I should be turned into web documents and posted on the official website of the event.

Phase III: (propaganda)
Estimated time: 3-5 months.

During this phase, the news is spread. A call for papers is announced (for those who would like to give talks) and online discussions regarding the fine stuff is put in the public domain. Also some small appetizers could be added during this phase (like small contests to design a logo for the event, a musical piece or a demo graphical animation).

At the end of this phase, the people who are giving talks should be notified and their appearance is confirmed.

Phase IV: (preparation)
Estimated time: 2 weeks.

During this phase, the physical preparation of the con arena is done, software test-runs should be performed and audio-visual equipment, network connections and power supplies are tested.

Believers are encouraged to pray for success.

During



Day plan:
Depending on the available resources and the rules of the place where the event is taking place, the daily hours should be determined.

The event will be very time consuming for the organizers.

In case of a 2-3 days event, the con should start around 09:00 - 11:00 and finish around 17:00 - 19:00. (~8 hours/day)

In case of a single-day event, the con should start around 08:00 - 10:00 and finish around 20:00 - 22:00. (~12 hours/day)

Talk session plan:
Each speaker will get the floor for a period of 20-30 mins, followed by a 10-15 mins period for questions or interaction with the audience.

After each talk, a small break of 5-10 mins is recommended with longer pauses (15-30 mins) every 3-4 talk sessions.

Challenge plan:
Depending on the nature of the challenge, it could run in rounds or in a timed manner.

Special event plan:
Depending on the nature of the special event, its plan will be determined.

Meanwhile, the special events I can think of could run in parallel to the challenges.

Side events plan:
Dpending on the nature of the side event, its plan will be determined. But as it is suggested to have social events as side events, they could either be done on a separate day or after the official CON hours.

Logistics



Place



A moderately big conference/convention center would be adequate. It has to have two halls. In one of the halls, the talk sessions will take place, while in the other the games wil take place. The place should be equipped to accommodate the noise level (equivalent to a small concert).

If the place could provide the necessary equipment, it would certainly be a plus.

Suggestions:

Equipment



For the talks:
The standard equipment for seminars including a projector, power source, lighting system, audio system, board panel, enough seats for the audince, good protection from sun rays, good level of outer noise shielding.

For the challenges:
Enough computers (depending on the number of players per game), networking facility, enough power sources, enough room to accommodate for the audience, audio-visual equipment (to show running game scores, broadcast DJ's music, intermission shows).

For the special event:
This will depend on the nature of the special event.

For the side events:
This will depend on the nature of the side events.

Human resources



Anybody who has experience in organizing events is encouraged to help?

Other facilities



As the event will take place over extended periods of time, some facilities should be available for the convenience of the attendees and organizers as well. These facilities include food, beverages, restrooms, smoking area, prayer area, social lounge, (wireless) internet connection.

The CON



Talk sessions



If the concept of the theme is adapted (i.e., every episode of CodeX Robert Paulsen will have a central theme), then the talks should follow that theme. For instance, if the theme of the first episode is WiFi, then the talks should be related to the different aspects of that topic; WiFi concepts, WiFi attacks, flaws in wireless access protocols,... etc.

Other than this, the following is a list of the possible topics for the talk sessions:
  • Security@home
  • WiFi (in)security
  • Topics in exploiting
    • Platforms
    • Web Services
    • VoIP
    • Buffer ovrflows
    • Code-morphing
  • (Anti-)forensics
  • Tools
  • Phreaking
  • Exploit/product demonstration
  • Social engineering
  • Legal issues/Digital crime penalties
  • The e-government
  • Business and market studies
  • DIY/happy hacking
  • IPv6
  • Cryptography
  • Modeling threats

Challenges



I do have some worked-out possible gaming schemes (plots include: web authentication, simple cryptography, forensic analysis, securing running services and remote exploitation).

Many of these games need to be coded still!

The official challenges results should be posted on the web after the event is over.

Special event



In case the theme concept is adapted, the special event could related to the theme. For example, if the theme is WiFi, then the special event could be designing the coolest WiFi gadget.

In case no theme is adapted (or the special event won't be related to the theme), several ideas could be implemented:
  • Best home-made coffee/juice blend (inspired by coffee wars)
  • Oldest, but still working personal/home computer
  • Coolest home-designed computer gadget
  • Best hand-sewn/tricot computer cloth
  • Home-made robots
In any case, there should be a jury committee who would decide on the best applicant at the special event and two runner-ups. The results should be posted on the web after the event is over.

Side events



A non-technical and more social event. The main goal to relax and get a btter chance to know the newly acquired frinds away from the keyboards and the power cords.

Possible suggestions could include:
  • Trip to one of the local places (museum, monument, park, garden,... etc).
  • A felouka ride.
  • Eat-out.
  • Desert trip.
  • A ball.

Aftermath



In order to sustain the event, a proper method to record the progress and development in each stage should be implemented so that after the event is over, these data could be retrieved and analyzed. The analysis could be used to suggest enhancements/modification for the following event.

A feedback system should also be availbale for the event attendees to leave their comments.

Roles



As much as everybody should be encouraged to participate in all stages of the event, but committment is required to get things done properly. The following are the possible roles and participants who feel like taking the responsibility for a particular role, should write down their names next to it.

Affiliation



The event could be carried out with the support of several organizations, institutions, companies and individuals. Relevant affiliation should be seeked.

Fund raising



The event could be supported financially in different ways including: donations, advertizing and admission fees.

Extra links



DEF CON - Largest hacker convention in the US.
Black Hat - Another world-wide convention.
ShmooCon - A modern convention with focus on new technologies.
Info Security - A global IT security conference.
Coffee Wars - No cream, no sugar, straight up.

Community Webserver suggestion

Community Web Server

background

through our FOSS advocacy activities we introduced a bunch of NGOs to the concept of CMS systems, and explained the power, ease of use and affordability of the LAMP web application stack.

this turned out to be a killer FOSS application, our audience never saw anything like that before.

we did a couple of sessions on the Drupal CMS system, they where extremely popular and the feedback we got from the attendants (mostly web newbies with 0 GNU/Linux experience) showed that it was an empowering experience.

EGLUG is interested in anything that encourages people to adopt FOSS technologies, we're also interested in community development and initiatives to make computing more affordable and accessible using FOSS.

problem

  • very few local websites for small organizations and individuals
  • NGOs, artists, researchers etc would benefit from having websites
  • companies working on the field offer static websites most of the time
  • static is hardly useful for people who create and produce content on a regular basis
  • static does not enable the website to build a community of readers and contributors, such communities proved to be essential in producing more quality content
  • the few companies that offer dynamic websites are focused on enterprise and are too expensive for smaller organizations and individuals
  • even if an NGO can afford the price the periodic cost of hosting is typically inflated and the solutions sold tend to be custom built with little regard for usability, end result is high cost of maintenance and dependence on single vendor
  • the high cost and complexity force a model where specialists are the only people empowered to update the website
  • and easy dynamic website offers the possibility of removing all middle men and allowing content producers/authors to publish it directly and interact with their audience
  • a casual attitude towards the web and rapid edit/publish cycles have proved to be very effective tools for many organizations, the current culture around the web in Egypt prevents the use of tools like Wikis and Blogs.
  • often commercial solutions push features not really required by the clients and discard features that may be essential
  • almost all companies working o the field only understand commercial enterprises, a website to them is a marketing vehicle not a source of information or a community hub or an outlet for self expression
  • LAMP stack offers the cheapest and most reliable webapplication platform, it runs 60+% of the web according to NetCraft yet few Egyptian companies offer solutions built on top of it
  • the few companies that do offer solutions built on the LAMP stack ignore the wealth of prepackaged FOSS CMS and webtools
  • using a well supported FOSS tools means you're not tied to your original vendor, there are many channels of support and the tool adapts to emerging webtrends and technologies
  • the even fewer companies who do use CMS systems (I only know of two) do not offer customization, are not involved in the FOSS developers community and don't seem to keep updated with changes in the community/technology
  • no local commercially built website respects web-standards or accessibility guidelines
  • lack of awareness of how cheap and easy FOSS CMS systems are
  • lack of prepackaged localized web-applications make it harder to build local websites using FOSS CMSs
  • no integration, content sharing or any form of cooperation between local websites
  • little local content, few local web communities.
  • lack of visibility for local websites (this can be verified by simple Google searches, trying to search for very generic Arabic words and in many cases you'll get EGLUG on the first 10 results, EGLUG has only a handful of Arabic articles, is a low traffic website and is not extensively linked to there is no reason for it to rank high if it wasn't for the lack of other websites that match or the extremely low visibility they have)

what else

needs

for the above problem to be truly resolved a broad range of webservices providers should exist, including non for profit and volunteer based providers and providers building on all sorts of technologies and targeting all sorts of markets.

  • assure people the web is easy
  • demystify the web and its associated technologies
  • introduce new technologies
  • raise awareness of community models
  • provide a platform for local content
    • should be affordable
    • should be extremely easy to use
    • ease of use should not compromise power or flexibility
    • should be localized
    • should be well supported
    • should provide possibilities for integration and content aggregation between various websites
    • should enforce/encourage web-standards and accessibility guidelines
    • should provide good community building tools
  • encourage an attitude here the web is considered important but not a holy unapproachable entity
  • collect and transfer experience on building. maintaining and running websites and web communities
  • have a local developer community ready to help customize and adapt the platform

approach

we can contribute to solving this problem by offering people a fully localized stable, easy to use and flexible platform for web-publishing, coupled with dedicated maintainers, and support.

this platform if run by competent administrators can adapt to any new technologies and encourage content creators and publishers to adopt standards and best practices.

technical solution

EGLUG can cooperate with a partner to setup and administer a community Webserver.

  • the server will be run by volunteers from EGLUG
  • the server will be based on FOSS web technologies
  • the server will provide free or ultra cheap hosting for NGOs, artists, researchers etc.
  • will provide an integrated environment with a small set of content management system tools
  • will provide a preinstalled environment with a large amount of preconfigured modules
  • volunteer developers will be available to write any extra modules required by the content publishers
  • the EGLUG volunteers will be in touch with the developers of the CMS tools, to act as a proxy for the publishers communicating their needs and feedback
  • standards will be more or less enforced by the EGLUG volunteers, parallel training activities should explain the importance of standards to the publishers
  • EGLUG volunteers will develop portal/directory/aggregator websites covering the content published on the server to give the content more visibility
  • the portal will contain community features to encourage publishers to communicate together through it and encourage collaboration
  • server might include areas for individual Blogs so say members and employees of an organization that has a website on the server can have a personal space for their own use.
  • EGLUG volunteers will setup a central support and issue tracking public system

EGLUG contributed Drupal modules

BidiModule

<?php // -*-php-*-
/*
 * Original module by Alaa Abd El Fatah.
 * Mohammed Sameer: My Modifications Copyright (c) 2004 Mohammed Sameer, 
 *                  under the GNU GPL v2 or later.
 * Mohammed Sameer: 2004 10 30
 *                  * Ported to drupal 4.5 API.
 *
 * 04/04/2005 Ported to drupal 4.6 API by Amr Mostafa
 */

setlocale(LC_ALL"ar_EG.UTF-8");


/**
 * Implementation of hook_help()
 */
function bidi_help($section) {
  
$output "";

  switch (
$section) {
    case 
'admin/modules#description':
      
$output t("Automaticaly sets line direction");
      break;
  }

  return 
$output;
}

/**
 * Implementation of hook_filter_tips()
 */
function bidi_filter_tips($delta$format$long false) {
  if (
$long) {
    return 
t("You may write mixed Arabic and English freely, line direction will be computed automaticaly");
  }
  else {
    return 
t("You may write mixed Arabic and English freely, line direction will be computed automaticaly");
  }
}

/**
 * Implementation of hook_filter()
 */
function bidi_filter($op$delta 0$format = -1$text "") {
  switch (
$op) {
    case 
'list':
      return array(
=> t('BiDi'));
    case 
'description':
      return 
t("Bidi filter");
    case 
"process":
        return 
_bidi_filter_process($text);
    default:
        return 
$text;
  }
}

/**
 * Determine text language (arabic or english).
 * This function needs to be split into a single include file so it can be used on theme and other places.
 *
 * @param $text
 *   The text needs to be.
 * @return
 *   right2left or left2right depending on the detected language.
 */
function _get_dir($text) {
  
$text strtolower($text);
  
$len strlen($text);
  
  
$arabic 0;
  
$english 0;
  
  
// constants
  
$a ord('a');
  
$z ord('z');
  
  
// arabic UTF-8 letters have one of these values in the 1st byte
  
$ar1 0xd8;
  
$ar2 0xd9;
  
  
// this calculates the dominant language in the text, most bidi implementations just use the first letter (which may be more efficient)
  
for ($i 0$i $len; ++$i) {
    
$bin ord($text[$i]);
    
    if (
$bin == $ar1 || $bin == $ar2) {
      ++
$arabic;
      ++
$i;
    }
    else if (
$bin >= $a && $bin <= $z) {
      ++
$english;
    }
  }
  
  
// should this return a bool instead?
  
if ($english || $arabic) {
    if (
$english $arabic)    
      return 
' dir="LTR" ';
    else
      return 
' dir="RTL" ';
  }
  else {
    return 
"";
  }
}

/**
 * Sets HTML text line directions (rtl or ltr) as needed.
 *
 * @param $text
 *   The HTML text needs to be processed.
 *
 * @return
 *   The processed result, with line directions are set using css
 *   classes "righ2left" and "left2right".
 */
function _bidi_filter_process($text) {
  
$output "";
  
  
$len strlen($text);
  
$i 0;
  
  while (
$i $len) {
    
// find next tag
    
$e strpos(substr($text$i), "<");
    if (
$e === FALSE) {
      break;
    }
    
    
$output .= substr($text$i$e);
    
    
$i += $e;
    
    
// find end of next tag
    
$e strcspn(substr($text$i), "/> ");
    
$tag substr($text$i+1$e-1);
    
    
$output .= substr($text$i$e);
    
$i += $e;
    
    switch (
$tag) {
      
// single tag entity
      
case "img":
      case 
"br":
      case 
"hr":
        continue;
        break;
      
      
//nested cases
      
case "ul":
      case 
"ol":
      case 
"dl":
      case 
"div":
        
$e 0;
        
// stack counter
        
$j 1;
        
        
// if $j = 0 then stack is empty
        
while ($j 0) {
          
$e += strpos(substr($text$i+$e) , $tag);
          
          
// yeah I know I'm assuming certain sizes for tags, sue me
          // new nested block
          
if ($text[$i+$e-1] == '<') {
            ++
$j;
          }
          
// end of block
          
else if ($text[$i+$e-1] == '/') {
            --
$j;
          }
          
// skip current tag
          
$e += 2;
        }
        
        
$content substr($text$i+1$e); 
        
$output .= _get_dir(strip_tags($content));
        
$e += strlen($tag);
        
$output.= substr($text$i$e);
        
$i += $e;
        break;
      
      
// block elements these get out attention
      
case "p":
      case 
"blockquote":
      case 
"pre":
      case 
"h1":
      case 
"h2":
      case 
"h3":
      case 
"h4":
      case 
"h5":
      case 
"h6":
      
      
// nested lists are proken better think of a fix
      
case "li":
        
$close_tag "</".$tag.">";
        
// breaks on extra whitespaces, maybe I should use regexps instead
        
$e strpos(substr($text$i), $close_tag);
        
$content substr($text$i+1$e-1);
        
// calculate directions
        
$output.= _get_dir(strip_tags($content));
        
$e += strlen($close_tag);
        
$output.= substr($text$i$e);
        
$i += $e;
        break;
      
      
// non block tags we are not handeling
      
default:
        
$close_tag "</".$tag.">";
        
$e strpos(substr($text$i), $close_tag) + strlen($close_tag);
        
$output.= substr($text$i$e);
        
$i += $e;
      }
  }
  
  
// any missing content
  
$output .= substr($text$i);
  
  return 
$output;
}

?>

Captcha module patch, to support those with textish browsers

This is a patch I made for drupal's captcha module.

Since the captcha can only be read using graphical browsers, I thought of this idea to enable users with textish browsers to read the captcha code too.

It's not secure though. Since the captcha code gets printed in a HTML tag (that's how textish browsers can read it), a script can read the code and bypass your captcha protection. I don't recommend applying the patch if you are going to use captcha in anything other than fighting spam comments :).

captcha.module.patch



--- captcha.module.orig	2005-01-19 17:00:08.000000000 +0200
+++ captcha.module	2005-03-05 00:12:03.921875000 +0200
@@ -83,9 +83,10 @@
   if (_captcha_istrue("captcha_user_register") && !$newuser->uid && !$user->uid)
   switch ($type) {
     case t("register"):
-    // Add two items to the resigtration form.
+    $string = _captcha_code();
     
-    $output .= form_item("", '<img src="/'.url('captcha/image/'.time()).'" alt="Captcha Image: you will need to recognize the text in it."/>');
+    // Add two items to the resigtration form.
+    $output .= form_item("", '<img src="/'.url('captcha/image/'.time()).'" alt="Captcha: '.$string.'"/>');
     $output .= form_textfield(t('Word'), 'captchaword', NULL, 15, 15, 'Please type in the letters/numbers that are shown in the image above.', NULL, TRUE);
 
     return array(array('title' => t('Verify Registration'), 'data'=>$output));
@@ -137,7 +138,8 @@
       
     case 'form':
       if (sess_read('captcha_comment_correct')!='ok') {
-        $output .= form_item("", '<img src="/'.url('captcha/image/'.time()).'" alt="Captcha Image: you will need to recognize the text in it."/>');
+	$string = _captcha_code();
+        $output .= form_item("", '<img src="/'.url('captcha/image/'.time()).'" alt="Captcha: '.$string.'"/>');
         $output .= form_textfield(t('Word'), 'captchaword', NULL, 15, 15, 'Please type in the letters/numbers that are shown in the image above.', NULL, TRUE);
         return form_group(t('Verify comment authorship'), $output);
       } else return NULL;
@@ -206,7 +208,7 @@
     
     header('Content-type: image/png');
 
-    $string = _captcha_code();
+    $string = sess_read('captcha');
     
     //set up image, the first number is the width and the second is the height
     $im = imagecreatetruecolor(120, 20);

DiffModule

I'm stil having some problems with the wiki formatting breaking, But i think I'll dump the diff as it is without applying filters.
It's in the unified diff format and not colored! It's inline diff, The underlined lines are new, The striked ones are deleted.
I gave the admins and mods the permission to access it until I fix all of the remaining things.
Todo:
* diff to previous/next/beginning.
* Admin interface to choose unified or inline diff.
* Find a way to highlight.
* Try to write the diff code instead of using pear. <?php
// $Id: diff.module,v 1.24 2008/03/05 21:03:17 weitzman Exp $

/**
 * Number of items on one page of the revision list.
 */
define('REVISION_LIST_SIZE'50);

/**
 * Implementation of hook_help().
 */
function diff_help($section) {
  switch (
$section) {
    case 
'admin/help#diff':
      
$output '<p>'t('The diff module overwrites the normal revisions view. The revisions table is enhanced with a possibility to view the difference between two node revisions. Users with the %view_revisions permission will also be able to view the changes between any two selected revisions. You may disable this for individual content types on the content type configuration page. This module also provides a nifty %preview_changes button while editing a post.', array('%preview_changes' => t('Preview changes'), '%view_revisions' => t('view revisions'))).'</p>';
      return 
$output;
  }
}

/**
 * Implementation of hook_requirements().
 * Checks if the diff modules is loaded after the node module in the hook ordering.
 */
function diff_requirements($phase) {
  
// Don't check when installing
  
if ($phase == 'install') {
    return;
  }
  
$modules array_keys(module_list());
  if (
array_search('diff'$modules) <= array_search('node'$modules)) {
    
diff_autoadjust();
  }
}

/**
 * Implementation of hook_menu()
 * The menu path 'node/$nid/revisions' is overriden with 'diff_diffs'.
 */
function diff_menu($may_cache) {
  
$items = array();
  if (!
$may_cache) {
    if (
arg(0) == 'node' && is_numeric(arg(1))) {
      
$node node_load(arg(1));
      if (
$node->nid) {
        
$revisions_access = (user_access('view revisions') || user_access('administer nodes')) && 
                            
node_access('view'$node) && 
                            
db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d'arg(1))) > 1;
        
$items[] = array(
          
'path' => 'node/'arg(1) .'/revisions''title' => t('Revisions'),
          
'callback' => 'diff_diffs',
          
'access' => $revisions_access,
          
'weight' => 4,
          
'type' => MENU_LOCAL_TASK,
        );
      }
    }
  }
  return 
$items;
}

/**
 * Adjust the module weights for diff to load after node module.
 */
function diff_autoadjust() {
  
$modules array_keys(module_list());
  if (
array_search('diff'$modules) <= array_search('node'$modules)) {
    
module_load_install('diff');
    
diff_set_weight();
  }
}

/**
 * Menu callback for diff related activities.
 */
function diff_diffs() {
  if (
is_numeric(arg(1)) && arg(2) == 'revisions') {
    
$op arg(3) ? arg(3) : 'overview';
    switch (
$op) {
      case 
'overview':
        
$node node_load(arg(1));
        if ((
user_access('view revisions') || user_access('administer nodes')) && node_access('view'$node)) {
          return 
diff_diffs_overview($node);
        }
        
drupal_access_denied();
        return;

      case 
'view':
        if (
is_numeric(arg(4)) && is_numeric(arg(5))) {
          
$node node_load(arg(1));
          if (
$node->nid) {
            if ((
user_access('view revisions') || user_access('administer nodes')) && node_access('view'$node)) {
              
drupal_set_title(t('Diff for %title', array('%title' => $node->title)));
              return 
diff_diffs_show($nodearg(4), arg(5));
            }
            
drupal_access_denied();
            return;
          }
        }
        break;

      default:
        
// A view, revert or delete operation from the orignial node module,
        // so call the original node module to handle this.
        
return node_revisions();
        break;
    }
  }
  
drupal_not_found();
}

/**
 * Generate an overview table of older revisions of a node and provide 
 * an input form to select two revisions for a comparison.
 */
function diff_diffs_overview(&$node) {
  
$output '';

  
drupal_set_title(t('Revisions for %title', array('%title' => $node->title)));
  
$output .= drupal_get_form('diff_node_revisions'$node);

  return 
$output;
}

/**
 * Input form to select two revisions.
 *
 * @param $node
 *   Node whose revisions are displayed for selection.
 */
function diff_node_revisions(&$node) {
  global 
$form_values;
  
$form = array();

  
$form['nid'] = array(
    
'#type' => 'hidden',
    
'#value' => $node->nid,
  );

  
$revision_list node_revision_list($node);

  if (
count($revision_list) > REVISION_LIST_SIZE) {
    
// If the list of revisions is longer than the number shown on one page split the array.
    
$page = isset($_GET['page']) ? $_GET['page'] : '0';
    
$revision_chunks array_chunk(node_revision_list($node), REVISION_LIST_SIZE);
    
$revisions $revision_chunks[$page];
    
// Set up global pager variables as would 'pager_query' do.
    // These variables are then used in the theme('pager') call later.
    
global $pager_page_array$pager_total$pager_total_items;
    
$pager_total_items[0] = count($revision_list);
    
$pager_total[0] = ceil(count($revision_list) / REVISION_LIST_SIZE);
    
$pager_page_array[0] = max(0min($page, ((int)$pager_total[0]) - 1));
  } else {
    
$revisions $revision_list;
  }

  
$revert_permission FALSE;
  if ((
user_access('revert revisions') || user_access('administer nodes')) && node_access('update'$node)) {
    
$revert_permission TRUE;
  }
  
$delete_permission FALSE;
  if (
user_access('administer nodes')) {
    
$delete_permission TRUE;
  }

  foreach (
$revisions as $revision) {
    
$operations = array();
    
$revision_ids[$revision->vid] = '';

    if (
$revision->current_vid 0) {
      
$form['info'][$revision->vid] = array(
        
'#value' => t('!date by !username', array(
          
'!date' => l(format_date($revision->timestamp'small'), "node/$node->nid"), 
          
'!username' => theme('username'$revision)))
        . ((
$revision->log != '') ? '<p class="revision-log">'filter_xss($revision->log) .'</p>' ''),
      );
    }
    else {
      
$form['info'][$revision->vid] = array(
        
'#value' => t('!date by !username', array(
          
'!date' => l(format_date($revision->timestamp'small'), "node/$node->nid/revisions/$revision->vid/view"), 
          
'!username' => theme('username'$revision)))
        . ((
$revision->log != '') ? '<p class="revision-log">'filter_xss($revision->log) .'</p>' '')
      );
      if (
$revert_permission) {
        
$operations[] = array('#value' => l(t('revert'), "node/$node->nid/revisions/$revision->vid/revert"));
      }
      if (
$delete_permission) {
        
$operations[] = array('#value' => l(t('delete'), "node/$node->nid/revisions/$revision->vid/delete"));
      }
      
// Set a dummy, even if the user has no permission for the other
      // operations, so that we can check if the operations array is
      // empty to know if the row denotes the current revision.
      
$operations[] = array();
    }
    
$form['operations'][$revision->vid] = $operations;

  }
  
$new_vid key($revision_ids);
  
next($revision_ids);
  
$old_vid key($revision_ids);
  
$form['diff']['old'] = array(
    
'#type' => 'radios'
    
'#options' => $revision_ids,
    
'#default_value' => $old_vid
  
);
  
$form['diff']['new'] = array(
    
'#type' => 'radios'
    
'#options' => $revision_ids,
    
'#default_value' => $new_vid
  
);
  
$form['submit'] = array('#type' => 'submit''#value' => t('Show diff'));  

  if (
count($revision_list) > REVISION_LIST_SIZE) {
    
$form['#suffix'] = theme('pager'NULLREVISION_LIST_SIZE0);
  }

  return 
$form;
}

/**
 * Theme function to display the revisions formular with means to select
 * two revisions.
 */
function theme_diff_node_revisions($form) {
  
// Overview table:
  
$header = array(
    
t('Revision'),
    array(
'data' => drupal_render($form['submit']), 'colspan' => 2),
    array(
'data' => t('Operations'), 'colspan' => 2)
  );
  if (isset(
$form['info']) && is_array($form['info'])) {
    foreach (
element_children($form['info']) as $key) {
      
$row = array();
      if (isset(
$form['operations'][$key][0])) {
        
// Note: even if the commands for revert and delete are not permitted,
        // the array is not empty since we set a dummy in this case.
        
$row[] = drupal_render($form['info'][$key]);
        
$row[] = drupal_render($form['diff']['old'][$key]);
        
$row[] = drupal_render($form['diff']['new'][$key]);
        
$row[] = drupal_render($form['operations'][$key][0]);
        
$row[] = drupal_render($form['operations'][$key][1]);
        
$rows[] = $row;
      }
      else {
        
// its the current revision (no commands to revert or delete)
        
$row[] = array('data' => drupal_render($form['info'][$key]), 'class' => 'revision-current');
        
$row[] = array('data' => drupal_render($form['diff']['old'][$key]), 'class' => 'revision-current');
        
$row[] = array('data' => drupal_render($form['diff']['new'][$key]), 'class' => 'revision-current');
        
$row[] = array('data' => theme('placeholder't('current revision')), 'class' => 'revision-current''colspan' => '2');
        
$rows[] = array(
          
'data' => $row,
          
'class' => 'error',
        );
      }
    }
  }
  
$output .= theme('table'$header$rows);
  
$output .= drupal_render($form);
  return 
$output;
}

/**
 * Submit code for input form to select two revisions.
 */
function diff_node_revisions_submit($form_id$form_values) {
  
// the ids are ordered so the old revision is always on the left
  
$old_vid min($form_values['old'], $form_values['new']);
  
$new_vid max($form_values['old'], $form_values['new']);
  return 
'node/'.$form_values['nid'].'/revisions/view/'.$old_vid.'/'.$new_vid;
}

/**
 * Validation for input form to select two revisions.
 */
function diff_node_revisions_validate($form_id$form_values) {
  
$old_vid $form_values['old'];
  
$new_vid $form_values['new'];
  if (
$old_vid==$new_vid || !$old_vid || !$new_vid) {
    
form_set_error('diff't('Select different revisions to compare.'));
  }
}

/**
 * Create output string for a comparison of 'node' between
 * versions 'old_vid' and 'new_vid'.
 *
 * @param $node
 *   Node on which to perform comparison
 * @param $old_vid
 *   Version ID of the old revision.
 * @param $new_vid
 *   Version ID of the new revision.
 */
function diff_diffs_show(&$node$old_vid$new_vid) {

  
$lame_revisions node_revision_list($node);
  foreach (
$lame_revisions as $revision) {