Tuesday, December 8, 2009

Day 1: Shell Scripting From Scratch

A friend of mine at UDSM is doing a course that requires shell scripting so I agree to take time out an cover the basic of shell scripting, and you are welcome to join us. It really for beginners in shell.

Day 1: Laying the Foundation


What Is a Shell?

A shell is a program that takes commands you typed and tell the operating system to run them. The shell interprets your commands. For example, you may use the shell to enter a command to list the files in a directory, such as ls, or a command to copy a file, such as cp.

Example: ls is a command to list the content of the current folder.

$ ls
bin/    dev/         initrd.img.old@  media/  root/     sys/  vmlinuz@
boot/   etc/         lib/             mnt/    sbin/     tmp/  vmlinuz.old@
build/  home/        lib64/           opt/    selinux/  usr/
cdrom@  initrd.img@  lost+found/      proc/   srv/      var/
The $ is the shell prompt, which tells you the shell awaits your commands. ls listed all the content of the current directory, worry not we will get to these in a moment.

How does it work?

The shell looks for a program — that is, a file with execute permissions — with the name ls. The shell looks at all the directories in your command path. The shell runs the first program found that matches the name, checks if you have permission to excutes it and if you have its excutes it and then displays the results of the program to your screen, as in the second and third lines in the code example.

The command path is stored in the environment variable named PATH

$ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:
/home/eferuzi/apps/go/bin:/home/eferuzi/apps/go/bin

A shell acts as a form of wrapper around the OS, hence the term shell.

Why Use Shells?

Unix was the first popular operating system to break free of the single-shell monopoly, which can still be seen in MS-DOS shell on Windows. In Day 2: we will cover how to break free of the single-shell monopoly on Windows.

The Unix philosophy is that one command should do one thing and do it well. So the complex commands are combination of small commands. In this context, a shell is simply another command — a command that facilitates combining other commands. The ability to combine commands allows you to create new commands, thereby adding value to your operating system.

In addition, most shells allow you to group a number of commands in a file, called a shell script. When you run the shell script file, the shell executes the commands in the script file in order.

What Kind of Shells Are There?

Since there is no monopoly on shells, you are free to run any shell you desire. That’s all well and good,but choosing a shell without knowing the alternatives isn’t very helpful. So lets look at a few main shell out there.

  • The Bourne Shell - original Unix shell is known as sh, short for shell, created by Steven Bourne, and has been considered a standard part of Unix for decades.
  • The C Shell - was so named because much of its syntax parallels that of the C programming language, and added some neat features to the Bourne shell, especially the ability to recall previous commands (and parts of previous commands) to help create future commands.
  • The Korn Shell - like the C shell but also backward compatible with the older Bourne shell syntax.
  • Bash, the Bourne Again Shell - it is said "bash shell answered a clear need, a need shown by the initial success of the Korn shell". So bash offers command-line editing like the Korn shell, file-name completion like the C shell, and a host of
    other advanced features.
  • Other Shells - Over the years, a number of other shells have appeared, each with a small but devoted following. These shells include ash, zsh, and rc. Ash is the default shell and appears as sh on the Cygwin environment for Windows.

Choosing a Shell

For example, when administrators assume everyone runs the Korn shell, they may set up parts of the environment that break in strange ways for users of other shells, particularly users of the C shells. So before choosing to another shell make sure it will work given the assumptions made before. Most modern shell are all pretty good anyway.

Changing Your Default Shell

The chsh command, short for change shell, allows you to change your default, or login, shell.

Syntax:

chsh username new_default_shell
Example:change user jkpaul to use csh, run the chsh command as follows
$ chsh jkpaul /bin/bash
Note that you need to enter the full path to the shell. You may required to type you password for security reasons.The new login shell will be available for use the next time you log in.

That is it for day one, so now we are ready to get into using shell.

NEXT: Day 2: Running Shell and Commands

Thursday, December 3, 2009

Use one keyboard and mouse on multiple cross platform computers



synergy: [noun] a mutually advantageous conjunction of distinct elements

Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems, each with its own display, without special hardware. Redirecting the mouse and keyboard is as simple as moving the mouse off the edge of your screen. Synergy also merges the clipboards of all the systems into one, allowing cut-and-paste between systems.

I have this old computer that as use as a backup and multimedia server. I have hooked it to an overhead projector and a decent sound system, now you know what I am up to over the weekends. For all this time ssh and Remote Desktop Viewer have served me very faithully. But I started wondering is this it, can I use my mouse and keyboard on both machines but on different displays, and lo and behold, ladies and gentlemen I present to you Synergy.
So lets get to it.

Scenario

There is a Dell (Inspiron 1520) aka WorkStation, running Ubuntu 9.10 also the Synergy server and as a second machine, home built server aka Storage running Ubuntu 8.04LTS.
WorkStation: Side [left] | Hostname [feruzi.trilabs.co.tz] | IP Address [192.168.3.10]
Storage: Side [right] | Hostname [storage.trilabs.co.tz] | IP Address [192.168.3.9]

Installing from the Command Line

Start the terminal (you can also use Synaptic Package Manager) and run the following command on both machines.
$ sudo aptitude update && sudo aptitude install synergy
PLEASE NOTE: For MS Windows and MacOS users visit the site for more information.

Configuring the Synergy server

In your home directory create a file called
synergy.conf
and in in it is where the configureation for my set up.
section: screens
 feruzi.trilabs.co.tz:       
 storage.trilabs.co.tz:
end
section: aliases
 feruzi.trilabs.co.tz:
    192.168.3.10
 storage.trilabs.co.tz:
    192.168.3.9
end
section: links
 feruzi.trilabs.co.tz:
    right = storage.trilabs.co.tz
 storage.trilabs.co.tz:
    left = feruzi.trilabs.co.tz
end
section: options
 screenSaverSync = false 
end

section: screens

Screen section is a list of screen names, one name per line, each followed by a colon. Names are arbitrary strings but they must be unique. The hostname of each computer is recommended, and that is what I have used.

section: aliases

aliases section is a list of screen names just like in the screens section except each screen is followed by a list of aliases, one per line, not followed by a colon. An alias is a screen name and must be unique. During screen name lookup each alias is equivalent to the screen name it aliases. Because my DNS was not setup properly I assigned it to my IP address.

section: links

links section is a list of screen names just like in the screens section except each screen is followed by a list of links, one per line. Each link has the form {left|right|up|down}[] = name[]. A link indicates which screen is adjacent in the given direction. So on the right of feruzi.trilabs.co.tz there is storage.trilabs.co.tz and on the left of storage.trilabs.co.tz there is feruzi.trilabs.co.tz.
PLEASE NOTE: There is more you can do here, again visit the site for more information.

section: options

options section is a list of lines of the form name = value. These set the global options. There is a lot of other options you can set, visit the site for more information.

Starting up Synergy server and clients


To start up the server, on feruzi.trilabs.co.tz run the following command,
$ synergys -f --config synergy.conf
the output should be something like this, depending on your setting and operating systems.
INFO: synergys.cpp,1042: Synergy server 1.3.1 on Linux 2.6.31-15-generic #50-Ubuntu SMP Tue Nov 10 14:54:29 UTC 2009 i686
DEBUG: synergys.cpp,1051: opening configuration "synergy.conf"
DEBUG: synergys.cpp,1062: configuration read successfully
DEBUG: CXWindowsScreen.cpp,847: XOpenDisplay(":0.0")
DEBUG: CXWindowsScreenSaver.cpp,339: xscreensaver window: 0x00000000
DEBUG: CXWindowsScreen.cpp,117: screen shape: 0,0 1280x800 
DEBUG: CXWindowsScreen.cpp,118: window is 0x04800004
DEBUG: CScreen.cpp,38: opened display
DEBUG: CXWindowsScreen.cpp,679: registered hotkey ScrollLock (id=ef14 mask=0000) as id=1
NOTE: synergys.cpp,500: started server
INFO: CServer.cpp,1141: screen "feruzi" shape changed

And the cliet, in this case on storage.trilabs.co.tz, ssh into the client machine and run the following command and we are ready to rumble.
$ synergyc -f --name storage 192.168.3.10
the output should be something like this, depending on your setting and operating systems.
INFO: synergyc.cpp,716: Synergy client 1.3.1 on Linux 2.6.27-15-generic #1 SMP Tue Oct 20 06:52:09 UTC 2009 i686
DEBUG: CXWindowsScreen.cpp,841: XOpenDisplay(":0.0")
DEBUG: CXWindowsScreenSaver.cpp,339: xscreensaver window: 0x00000000
DEBUG: CXWindowsScreen.cpp,111: screen shape: 0,0 1400x1050 
DEBUG: CXWindowsScreen.cpp,112: window is 0x03000004
DEBUG: CScreen.cpp,38: opened display
NOTE: synergyc.cpp,330: started client
DEBUG: CXWindowsClipboard.cpp,313: open clipboard 0
DEBUG: CXWindowsClipboard.cpp,266: empty clipboard 0
DEBUG: CXWindowsClipboard.cpp,289: grabbed clipboard 0
DEBUG: CXWindowsClipboard.cpp,348: close clipboard 0
DEBUG: CXWindowsClipboard.cpp,313: open clipboard 1
DEBUG: CXWindowsClipboard.cpp,266: empty clipboard 1
DEBUG: CXWindowsClipboard.cpp,289: grabbed clipboard 1
DEBUG: CXWindowsClipboard.cpp,348: close clipboard 1
NOTE: synergyc.cpp,247: connected to server

And that is it. Have fun, questions and comments are welcome.

Saturday, November 28, 2009

Google's Go - a systems programming language



November 10, Google release it's  new systems programming language called Go.  According to the website http://golang.org Go has the following outstanding features:-

  • simple in term of programming syntax, less typing
  • fast  compilers produce fast code fast. Typical Go builds take a fraction of a second yet the resulting programs run nearly as quickly as comparable C or C++ code.
  • safe in type safe and memory safe. Go has pointers but no pointer arithmetic. For random access, use slices, which know their limits.
  • concurrent is a core part of the language. Go promotes writing systems and servers as sets of lightweight communicating processes, called goroutines, with strong support from the language. Run thousands of goroutines if you want—and say good-bye to stack overflows.
  • fun to work with. Go has fast builds, clean syntax, garbage collection, methods for any type, and run-time reflection. It feels like a dynamic language but has the speed and safety of a static language. It's a joy to use
  • open source, Go is realised under the BSD licence.

After watching a video on Google TechTalk by one of the archtechts of the language, I thought of giving a try. I have installed it on my Ubuntu, with no difficulty at all, and have done a few example. I have not done anything worth showing, but during the course I will blog more about it.

Visit their site,http://golang.org, and see if you can make use of this language.

Introduction to TDD with PHPUnit


What is TDD?

Test Drive Development [TDD] is an approach to development which combines test-first development where you write a test before you write just enough production code to fulfill that test and refactoring. So basically you first decide the functions or sections of your code you want to test. Then write test for these functions for different scenarios with expected values. Then write the implement the functions while checking if they meet the different scenarios you captured in the tests, if not refactoring is done till all tests have passed.

Why use TDD?

  • by focusing on the different test cases first, developer(s) focuses on the functionality more than the implementation
  • it allows the developer to focus on a small section of the implementations at a time till its working as expected
  • can lead to more modularized, flexible, and extensible code
  • no more code is written than necessary to pass a failing test case, automated tests tend to cover every code path
  • while it is true that more code is required with TDD than without TDD because of the unit test code, total code implementation time is typically shorter

TDD Example with PHP

There are many ways in which one can implement a TDD. In this example, we will create a simple calculator with the four basic operations that is (add, subtract, multiply and divide).
But after looking around and looking back to my exprience, it looks like there is one way that most developers agree on:-
  1. design your class/API
  2. create a test suite
  3. run the test, and in this case all tests should fail
  4. implement the class
  5. run the test, an this time some test will pass and some will fail
  6. fix failures or errors
  7. repeat 5 and 6 till all tests have passed

Download Source Code

Designing the class/API

This basically mean designing the skeleton of the class, so the class body with its functions signatures without the actually implementation
/* === calculator.php === */
class Calculator{
/**
* Constructor
* NOTE: if you are using function __constructor() can also be used for older version of PHP
* @return unknown_type
*/
function Calculator(){

}

/**
* add two numbers (a + b)
* @param $a an integer
* @param $b an integer
* @return a + b or null otherwise
*/
function add($a, $b){

}

/**
* subtact b from a numbers (a - b)
* @param $a an integer
* @param $b an integer
* @return a - b or null otherwise
*/
function subtract($a, $b){

}

/**
* multipy a and b numbers (a x b)
* @param $a an integer
* @param $b an integer
* @return a x b or null otherwise
*/
function  multiply($a, $b){

}

/**
* divide a by b numbers (a / b)
* @param $a an integer
* @param $b an integer
* @return a / b or null otherwise
*/
function  multiply($a, $b){

}
}

Creating the test class

To test a function there is two (or more depending on the test used) things that are  needed, value returned by the function and the values expected. Then using a once of the many assert functions to establish if the test has passed or not. Look at the comments on the code.

/* === calculatortest.php === */
require_once 'calculator.php';
require_once 'PHPUnit.php';

class CalculatorTest extends PHPUnit_TestCase{
 /**
  * Constructor
  * NOTE: if you are using function __constructor() can also be used for older version of PHP
  * @return unknown_type
  */
 var $calc;

 function CalculatorTest($name){
  $this->PHPUnit_TestCase($name);
 }

 /**
  * Used to set up and default values
  *
  * (non-PHPdoc)
  * @see PHPUnit/PHPUnit_TestCase#setUp()
  */
 function setUp(){
  // creating the Calculator object
  $this->calc = new Calculator();
 }

 /**
  * Used to destroy values that where set in the setUp()
  *
  * (non-PHPdoc)
  * @see PHPUnit/PHPUnit_TestCase#tearDown()
  */
 function tearDown(){
  // destroying the  calculator object 
  unset($this->calc);
 }

 /**
  * Testing add two numbers (a + b)
  */
 function testAdd(){
  $actual = $this->calc->add(2,3);
  $expected = 5;
  //checking if value returned value is what we expected
  $this->assertEquals($expected, $actual);
 }

 /**
  * Testing subtact b from a numbers (a - b)
  */
 function testSubtract(){
  $actual = $this->calc->subtract(5,2);
  $expected = 3;
  //checking if value returned value is what we expected
  $this->assertEquals($expected, $actual);
 }

 /**
  * Testing multipy a and b numbers (a x b)
  */
 function  testMultiply(){
  $actual = $this->calc->multiply(5,2);
  $expected = 10;
  //checking if value returned value is what we expected
  $this->assertEquals($expected, $actual);
 }

 /**
  * Testing divide a by b numbers where b=0
  */
 function  testDivideByZero(){
  $actual = $this->calc->divide(3,0);
  $expected = NULL;
  //checking if value returned value is what we expected
  $this->assertEquals($expected, $actual);
 }

 /**
  * Testing divide a by b numbers (a / b)
  */
 function  testDivide(){
  $actual = $this->calc->divide(10,2);
  $expected = 5;
  //checking if value returned value is what we expected
  $this->assertEquals($expected, $actual);
 }
}

Write the Testing

Now we need to write the code to actual run the code
/* ==== test.php ==== */

require_once 'calculatortest.php';
require_once 'PHPUnit.php';

/* the value passed duing the instantiating must be the name of the test class */
$suite  = new PHPUnit_TestSuite("CalculatorTest");
/*rin the test*/
$result = PHPUnit::run($suite);
/*dispay the result */
echo $result->toString();

Running the test

Start up your terminal and run the test.php with php or if run it through your apache and view the result on the browser
eferuzi@feruzi /v/w/phpunit> php5 test.php
TestCase CalculatorTest->testDivideByZero() passed
TestCase CalculatorTest->testAdd() failed: expected 5, actual  in /var/www/phpunit/calculatortest.php:56
TestCase CalculatorTest->testSubtract() failed: expected 3, actual  in /var/www/phpunit/calculatortest.php:66
TestCase CalculatorTest->testMultiply() failed: expected 10, actual  in /var/www/phpunit/calculatortest.php:76
TestCase CalculatorTest->testDivide() failed: expected 5, actual  in /var/www/phpunit/calculatortest.php:96
As you can see we have one passing because the functions are not returning anything at the moment and that test checks if NULL is returned.

Implementations of the Calculator

So now we add implementation into the functions in the Calculator class

/* === calculatortest.php === */


require_once 'calculator.php';
require_once 'PHPUnit.php';

class CalculatorTest extends PHPUnit_TestCase{
 /**
  * Constructor
  * NOTE: if you are using function __constructor() can also be used for older version of PHP
  * @return unknown_type
  */
 var $calc;

 function CalculatorTest($name){
  $this->PHPUnit_TestCase($name);
 }

 /**
  * Used to set up and default values
  *
  * (non-PHPdoc)
  * @see PHPUnit/PHPUnit_TestCase#setUp()
  */
 function setUp(){
  // creating the Calculator object
  $this->calc = new Calculator();
 }

 /**
  * Used to destroy values that where set in the setUp()
  *
  * (non-PHPdoc)
  * @see PHPUnit/PHPUnit_TestCase#tearDown()
  */
 function tearDown(){
  // destroying the  calculator object
  unset($this->calc);
 }

 /**
  * Testing add two numbers (a + b)
  */
 function testAdd(){
  $actual = $this->calc->add(2,3);
  $expected = 5;
  //checking if value returned value is what we expected
  $this->assertEquals($expected, $actual);
 }

 /**
  * Testing the add method with wrong or none numerical input
  */
 function testAddInvalidValues(){
  $actual = $this->calc->add('ugali',3);
  //checking if value returned value is what we expected
  $this->assertNull($actual);
 }


 /**
  * Testing subtact b from a numbers (a - b)
  */
 function testSubtract(){
  $actual = $this->calc->subtract(5,2);
  $expected = 3;
  //checking if value returned value is what we expected
  $this->assertEquals($expected, $actual);
 }

 /**
  * Testing multipy a and b numbers (a x b)
  */
 function  testMultiply(){
  $actual = $this->calc->multiply(5,2);
  $expected = 10;
  //checking if value returned value is what we expected
  $this->assertEquals($expected, $actual);
 }

 /**
  * Testing divide a by b numbers where b=0
  */
 function  testDivideByZero(){
  $actual = $this->calc->divide(3,0);
  $expected = NULL;
  //checking if value returned value is what we expected
  $this->assertEquals($expected, $actual);
 }

 /**
  * Testing divide a by b numbers (a / b)
  */
 function  testDivide(){
  $actual = $this->calc->divide(10,2);
  $expected = 5;
  //checking if value returned value is what we expected
  $this->assertEquals($expected, $actual);
 }

Re-run the test

Re-run the test again and this time you should see some more passes if not refactor your code till you get all passes.

eferuzi@feruzi /v/w/phpunit> php5 test.php
TestCase CalculatorTest->testAdd() passed
TestCase CalculatorTest->testAddInvalidValues() passed
TestCase CalculatorTest->testSubtract() passed
TestCase CalculatorTest->testMultiply() passed
TestCase CalculatorTest->testDivideByZero() passed
TestCase CalculatorTest->testDivide() passed

Download Source Code

More information:-

  • TDD:
    • http://en.wikipedia.org/wiki/Test-driven_development
    • http://www.extremeprogramming.org/rules.html
  • PHPUnit:
    • http://www.phpunit.de/
Do not hesitate to ask me questions.

Sunday, November 22, 2009

kiGM : A Terminology Tool




To explain kiGM one has to start with GlossMasterGlossMaster is the fabulous multi-lingual terminology tool developed for ANLoc, the African Network for Localization. kiGM is a very lightweght version GlossMaster with an aim of allowing user with low or no internet connection to work and sycn data with GlossMaster periodically.GlossMaster. kiGM has a verys small subset of the functionality that Glossmaster.

Please come in and help.


Monday, October 5, 2009

Backup with mysqldump with PHP

Have you ever wanted to create a script a script that will create a mysqldump of a database using PHP? Here is a good starting point. More can be done to extend this to make it more useful, things like emailing the dump, restoring the database on fly and so much more.

There is a minor difference between the script for a server running on MS Windows as compate to the Linux/UNIX

MS Windows: XAMMP or WAMP

/* variable declaration */
$db_user = "yourUsername";
$db_password = "yourPassword";
$db_database = "yourDatabaseName";
$db_server = "yourHostName"; //default: localhost
$backup_path = "C:\\path\\to\\backup\\folder\\";
//e.g $backup_path = "C:\\backups\\sqldumps\\";
$path_to_mysqldump = "C:\\path\\to\\mysql\\bin\\";
//e.g $path_to_mysqldump = "C:\\xampp\\mysql\\bin\\";
$filename = "backup".date("YmdHis").".sql"; //filename with a timestamp

/*construction the command to be run */
$command= "$path_to_mysqldump\\mysqldump.exe --add-drop-table --add-drop-database -h $db_server -u $db_user --password=$db_password $db_database > $filename ";

/* excution of the command */ 
exec($command, $dump, $status); 

/*checking the status of the command after runing */
if($status!=0){
echo "The execution was not successful. An empty file has been created";
}else{
echo "The execution was successful. Backup files is " . $backup_path.$filename ;
}

Linux/UNIX
* variable declaration */
$db_user = "yourUsername";
$db_password = "yourPassword";
$db_database = "yourDatabaseName";
$db_server = "yourHostName"; //default: localhost
$backup_path = "/path/to/backup/folder/"; //you must have permission to write in this folder
//e.g $backup_path = "/servers/backups/sqldumps/"; 
$filename = $backup_path."backup".date("YmdHis").".sql"; //filename with a timestamp

/*construction the command to be run */
$command= "mysqldump.exe --add-drop-table --add-drop-database -h $db_server -u $db_user --password=$db_password $db_database > $filename ";

/* excution of the command */ 
exec($command, $dump, $status); 

/*checking the status of the command after runing */
if($status!=0){
echo "The execution was not successful. An empty file has been created";
}else{
echo "The execution was successful. Backup files is " . $backup_path.$filename ;
}

Differences highlighted:
  • in windows it, unless you have added the mysql bin to the path, you must specify the full path to the mysqldump.exe, as in Linux it accessible with out the full path
  • also the \\ used in the path, as in Linux we use /
  • in Linux remember you mush have write asses to the folder you are

Friday, July 24, 2009

Watermark your Videos

fsp:Creative Series

Have you ever wanted to watermark your video with your name or company or whatever? I mean like how YouTube stamps its logo an all videos, it is easy that I thought. I have been working on it for a good one hour and guess what it works and its not rocket science, even I can do it.



Platform: the tools used
  • platform: Ubuntu Jaunty (9.04)
  • media player: mplayer
  • image editor: gimp
  • watermarking tool: ffmpeg using the vhook library
NOTE: The default ffmpeg on the Ubuntu repository does not have vhook enabled. You may have get the source code and compile it with vhook enabled.

Compiling ffmpeg
  1. Download the ffmpeg
  2. Untar it: tar jxfv ffmpeg-xx.xx.tar.bz2
  3. Get into the untared folder: cd ffmpeg-xx.xx/

  4. Configure with the vhook enabled: ./configure --enable-gpl --enable-nonfree --enable-vhook. Run ./configure --help to get a full list of options. NOTE: the . in the commands above is part of the command, so put it there.
  5. Compile and Install: make && make install
  6. vhook files will be located in the /usr/local/lib/vhook
Ingredients: the verges and spices
  • video to be watermarked:
  • the image to watermark the video. NOTE: the image background must be of color: #808080 and of the same size as the video.
Creating the watermarking images
  1. Play the video from the console/terminal to get the size of the video: mplayer thetrain.mpg
  2. Read the size of the video from the info displayed when mplayer loads the video, see the image below.
  3. So the create an image with the same size as the video, in this case it is 640x480 pixels. Remember the background of the image must be #808080, then add all that you want. Here is mine.
  4. Now we set, its time to cook

Cooking: frying and boiling
  • To make it easy, put all the ingredients in on pot, oops sorry, in one folder. The naviget on the terminal to that folder. Here is the generic structure of the command to watermark: ffmpeg -sameq -i original-video -vhook 'path-to-watermark.so-library -f overlaying-image' output-file. The sameq force the ffmpeg to maintain the same quality in and out. There is my cooking: ffmpeg -sameq -i thetrain.mpg -vhook '/usr/local/lib/vhook/watermark.so -f overlayer.png' thetrain.fsp.mpg.
  • Prepare the table and save the food. Use mplayer to try your newly watter marked file

Delicious: what goes to the table

See what we served on the table



Try It and tell me! Have fun guys!.






Monday, July 20, 2009

Linux threatens giants in the smart phone arena

If you do not have one and you are CEO, the your company is a start up and we understand. What is it? It is a smart phone. According to Wikipedia, a smart phone is a mobile phone offering advanced capabilities, often with PC-like functionality. Today these come in all shapes and sizes. With features ranging from touch screen to office document applications, smart phone as moved office into people hands.

But what of under the hood, what is happening there? In a much as the normal user will not bother about what goes in the hood, at times its good to see who are the major players there. For a while Mac with the iPhone series rules that area. But it was not long before BlackBerry, HTC, Nokia and others join the race and made it very difficult for me to choice a smart phone. This is why I am still sticking to my “cellphone”.

If you are like me, if its not open source then its not for me. This philosophy has kept with the SonyEricson K320i for a years. I have been looking and following what is happening out there and now I can say I have options that are good enough to make iPhone and friends work overtime.

Openmoko is a project dedicated to delivering mobile phones with an open source software stack. Openmoko is currently selling the Neo FreeRunner phone to advanced users and will start selling it to the general public as soon as the software is more developed.

I have had the privilege of playing around the the model before the FreeRunner, Neo 1973. I liked it, but it was a bit heavy. But I saw the terminal and we could run Linux commands on it.

A few months after I started working at FreeCode, I saw Nokia N810 running on Debian. I was so impressed to see that Linux is getting some where. I spent a lot of time looking, despite the fact that it was a bit slow when you start heavy application, but it work.

All along I had been reading and looking at the T-Mobile G1 running on Android. Android™ delivers a complete set of software for mobile devices: an operating system, middleware and key mobile applications. Now here was one smart phone that almost made me got to shop. It was slick, clean and open source. Mind you, Android is built on the open Linux Kernel. And because of this, Android is open source; it can be liberally extended to incorporate new cutting edge technologies as they emerge. And this can be seen in the the HTC Magic.

The HTC Magic, powered by Android™, is designed to turn heads with its chic looks, and command attention with its advanced list of capabilities.

After looking at features and reading reviews, its now a question of time before I visit the shop, actually I am broke at the moment.

But the list is not over, Motorola Evoke QA4 Motorola's EV-DO smartphone offers both a slide-out keypad and a virtual QWERTY keyboard. The Evoke QA4 runs Motorola's MotoMAGX Linux/Java stack, and is equipped with a 2.8-inch touchscreen, accelerometers, and widgets, as well as OK Labs' OKL4 embedded hypervisor. General Mobile DSTL1 General Mobile's dual-SIM, XScale-based Android cameraphone is based on a design by Yuhua (see entry above). The DSTL1 runs Android on a Marvell PXA-310 clocked to 624MHz, offers WiFi, Bluetooth, accelerometers, and a 5-megapixel camera, and is equipped with dual SIMs and dual baseband radios, enabling simultaneous reception for two different phone numbers. The list is long. See more at Linux Mobile Phones.

With big players such as Samsung, LG, Sony Ericsson, NVIDIA and Archos all working on releasing a handset for Android, soon there will be more options for you, especially is you like playing and fine ture your devices.

Open Minds use Open Source. Are you open minded? If yes, are using Open Source Technologies?

Sunday, July 19, 2009

Free lecture notes, exams, and videos from MIT.


Unlocking Knowledge, Empowering Minds.”

I have been working on a database for an application that is to be used at my office for recruiting and after a while I decided to break on YouTube. If I am not on Education Channel then it will be Google TechTalk, just to be updated as to what the rest of the world is doing as far as IT and Science is concerned.

Today I landed on something I though of sharing with the rest of you. It is the MIT OpenCourse Wave (OCW). OpenCourseWare is a web-based publication of virtually all MIT course content. OCW is open and available to the world and is a permanent MIT activity.

After clicking around, I reallied that this can be a good resource especially to countries where we do not have access to update academic materials. What is more fascinating is that you can mirror the content. I can only imagine how this will be of use for universities in my home country, especially engineering courses where things change on a daily bases. I will be more than happy to work with any universities or colleges to try and figure out how to mirror this material. There is a number of countries in Africa that are already mirroring these materials. Let take advantage of this source of information.

One step further, the content can be localized to your language. As I was going through this site, I learned that there is so much in OCW than I thought. Please pay a visit to this site and see how you can take advantage of these open available materials.

“Unlocking Knowledge, Empowering Minds.”

Thursday, July 16, 2009

Kiswahili Language Pack Addon

Try it Now! then tell us what you think.

Its as easy as A-B-C

A. Download and install Firefox 3.5

B. Install in Kiswahili Language Add-On

C. Install the following add-on Locale Switcher and enable Swahili by selecting it from the Tools - Language Menu

Your comment and suggestions are most welcome.

A word from tzLUG


After six long and hard months of working tirelessly as the tzLUG community, we are finally done with our translation of Firefox 3.5. Actually we are not done, we are still keeping a close eye on the new strings on a daily bases.

We of course could not have completed this great task without the help and support of our mentors: IT+46, FreeCode and translate.org.za who have been with us throughout the duration of project.

Can you imagene what we would have to do if pocount refused to work? Lets the tools given to us by our mentors have been of great help.

Although the tzLUG single handedly did all the work on this translation project, from start to finish, we’d like to acknowledge the Kamusi Project and the Kilinux – translations which formed the foundation for our work.

Now that all the work is done, it’s now ready for you to test and review, we’d like to know what you think of our work and what we can do to improve on it. So please know that your comments and suggestions will be greatly appreciated. Thank you.




Sunday, April 19, 2009

Pata Linux kiurahisi zaidi


Baada ya kutafisri Firefox kwa miezi minne, niliamua kujikumbusha PHP kidogo. Kwa hiyo mwisho wa wiki huu likaipeka tovuti ya tzLUG shopping na kupiga pasi baadhi ya kurasa.

Kurasa nilizifanyia kazi zaidi ni ya kuonyesha Linux Distro tulizonazo na matoleo yake. Pia nimebadili muonekano wa tovuti nzima. Nimekurahisisha uchaguaji wa Linux na toleo unalolitaka. Sasa unaweza kupata FreeBSD na openSolaris, ambazo sio Linux ila ni chanzo huria (open source). Ushindwe wewe tu. Tafadhali kama una maoni usisite kunitumia. Pia nimeongeza ukurasa wa Review ambao utatumika kuonyesha kazi ambazo unaweza jaribu kabla ya toleo la mwisho.

Mwisho wa wiki ijayo, nitatengeneza kurasa ya miradi na kusakinisha Moodle ili tuweze kuwa na Online Course, tutaanza na Linux kwa Wabongo.

Programu nilizotumia ni:-

Ukiachana na Opera na Internet Explorer, programu zingine zote ni za chanzo huria (open source). Kama una maona maoni au maswali tafadhali usisite kuniuliza.

Kama Linux unayoitaka haipo basi tuambie na titaiweka

Friday, April 10, 2009

Taste of Swahili Firefox 3.5b4pre - sw-TZ.linux

It about time we start showing what we have been working on. If you have the time please download and test this Linux version localization of Firefox.


We are still doing some Quality Assurance and we should do the build for Windows too may be with in the next 48 hours.

Current known issues are:-
  • Consistence - this has been looked at on the raw files so it about 95% complete
  • Access Keys - we will look into this as soon as possible

HowTo:
  • Download firefox-3.5b4pre.en-US.linux-i686.tar.bz2
  • Download firefox-3.5b4pre.sw.langpack.xpi
  • Navigate to where you place the file(mine are downloaded onto my desktop)
    • # cd /home/eferuzi/Desktop/
  • Untar the file, this will create a folder firefox with the untared files in it
    • # tar jxfv firefox-3.5b4pre.en-US.linux-i686.tar.bz2
  • Get into the folder created folder, firefox
    • # cd firefox/
  • Launch Firefox, with the language pack file, firefox-3.5b4pre.sw.langpack.xpi
    • # ./firefox ../firefox-3.5b4pre.sw.langpack.xpi
  • You will prompt to install the install the language pack, click Install then click OK and Quit Fireforx
  • Replace, using a text editor of your choice, the string en-US with sw-TZ in the file firefox-l10n.js found in the firefox/defaults/pref folder
  • Launch Firefox
    • # ./firefox
  • And enjoy the fun.
We will appreciate your comments, corrections and ideas are all welcome. Again we will like to apologies for not having the MS Windows version ready but we will make sure you are updated as soon as we have built it.

Wednesday, April 8, 2009

Umoja Project joins The African Network for Localization


Our mission is to empower Africans to participate in the digital age by removing the last inch limitations imposed on language usage by the limitation of technology.


At The African Network for Localization (ANLoc) it is believed that since languages were there before technologies then technologies should adopt the languages and not the other way round. Thus this group of very hard working people is toiling to archive that. The project has a number of sub-project that are carried out all with the mission in mind.


So what is a ANLoc all about and why Umoja Project partnered with them? Here are the reasons:-


  • Fonts - many of African language make use addition characters and in some case completely different characters. With languages such as a Arabic and Amharic, fonts have to designed and built from scratch.

  • Keyboards - once there fonts have been designed, then the keyboard layout have to designed to meet the needs of a particular language. At the moment ANLoc is developing software version of the keyboard layout and may be someday we will have the hardware implementations for these layouts

  • Languages and ICT Policy – to comply with different languages and their ICT Policy, ANLoc studies and examines the ICT Policy of each country so as to gain a deeper understanding and eventually to accurately inform the policy maker on localization and language issues.

  • Locales – today only 36 languages in Africa's many languages have their LOCALES. ANLoc, through the Afrigen Project is aiming at having 100 locales for African Languages. Is your language in yet and complete? Check the Stats

  • Localization Tools – a bonus for the Umoja Project. ANLoc is investing its energy in developing tools that will easy the task of localization. With tools such as Virtaal and Translate Toolkit, localization is becoming so easy that almost everyone is invited. And with time everyone should be able to take part in localization.

  • Localize Software – after all is said and done, it will be good for software to also speak my language. This sub-project is working at localization software and maintain the localizations. The Umoja Project is doing this at the moment. Now we have a network that has done this for many other languages, from which we will learn from their experience and avoid the mistakes they made.

  • Spell Checkers – creating spell checker enables creators of local contents to be confident with their work. But not many of these exist for African Languages and its ANLoc wish that as many as possible languages will have Spell Checkers. We are lagging behind on this one and the Umoja Project has noted this and making plans to address it.
  • Terminology – to ensure consistence and public translation memory, ANLoc has initiated a Terminology project, whose aim and purpose is to create a 2 500 word ICT term list for use in localization. To ensure that our future localizations are consistent, the Umoja Project is taking on this project immediately so as to have a that as the translation memory for all other localization projects.

  • Training – just like it is with other ICT disciplines, localization requires training. Localization is not all about translation, no there is more to it. ANLoc is aiming at equipping localizers with all the necessary knowledge and skills to manage and execute localizations at professional standards. This includes training them to use the tools developed by ANLoc.

  • Network Activities – the Network organizes and conducts numerous workshops to allow its partners to learn from each others experiences. Also to generate ideas on how best to move forward.

For the Umoja Project, ANLoc has open our eyes to bigger challenges that we may have to address to make an impact in the generaton of Swahili content. But apart from that, ANLoc has exposed to us a sea of knowledge, experience and tools that have been tried and tested.

The challenge for Umoja Project team is to make use of all these and also contribute to the Network what we have learned and developed.

Join In Lets Make a Difference.





Wednesday, March 4, 2009

Swahili Firefox: Be a part and Share the fun

Utajisikiaje kama nikikupa kompyuta ambayou haikulazimu kujua Kiingereza ili kuitumia. Sema iwe ya Kiswahili. Kompyuta yote ikawa ya Kiswahili. Najua, inaonekana kama haiwezekani.Inawezekana na ninao uthibitisho.


Kuswahilisha

Mwishoni mwa mwaka jana, timu ndogo ya watumiajo tabaruki wa Linux (tzLUG) walianza kazi kiswahilisha Firefox. Neno moja lipelekea mawili ambayo yalipelekea nyuzo ya matini na leo tumekamilisha 93% ya kazi yote. Sasa tunamalizi kilichobaki ili tutoe toleo la kwanza la majaribio tarehe 17 ya Machi.

Je wewe inaingia wapi? Unaweza jiunga kwenye uswahilishaji au ukafurahia kazi tulioifanya na kututumia maoni kwa vile tulivyoviruka ama marekebisho. Kwa sasa tunamalizi 7% ya marekebisho yaliyobakia ili iwe tayari kwa matumizi yako.

Tunatarajia kuwa na OpenOffice.Org (programu za ofisini kama Microsoft Office, ila ni imara zaidi ya MS Office na itakugharimu TZS 0/=) ifikiapo mwisho mwa 2009. Kwahiyo tungefurahia sana make tugepata jozi za mikono na macho toka kwako katika kukamilishsa zoezi hili. Kwa sasa bado hatujakamilisha mipango kwa ajili ya OpenOffice.Org. Programu moja baada ya nyingine na hivi karibuni tutakuwa na gawio kamili la Linux la Kiswahili.

Magawio ya Linux

Katika tzLUG, tunajitahidi kurahusisha upatikanaji wa magawio ya Linux. Kama unahitaji magawio ya Linux, tafadhali tifahamishe ili tupange jinsi ya kukupatia. Utaratibu wetu wa ugawaji si mzuri lakini tinaufanyia kazi.

Kwa sasa tunayo magawio yafuatayo:-

  * OpenSuse 11 - DVD
  * Fedora core 10 - DVD
  * CentOs linux - DVD
  * Ubuntu desktop 8.10 - CD
  * Ubuntu 8.10 server - CD
  * Ubuntu 8.04 - LTS - CD
  * Mythubuntu 8.10 - CD
  * Ubuntu studio 8.10 - CD

Tuna mpango wa kutuma mengine, kama kuna gawio unalitaka tufahamishe tufuta na kulituma. Kupata gawio wasiliana na Mratibu wa tzLUG kwa +255717566504 (Sebastian).

Magawio yafuatayo yatatumwa Ijumaa hii:-

  * Knoppix
  * Mandriva
  * Slackware
  * Linux Mint
  * FreeBSD - (sio Linux distribution but its Open Source)
  * 64 Studio - specialising in multimedia and digital content creation platforms

Juinge na tzLUG leo kupitia tzLUG Register na tugawane tukijuacho juu ya Linux, msaidie mtu ama pata msaada. Ni kwa ushirikiano ndio tutafanikisha. 




A few months ago, IT46 has joined a community effort to build Firefox 3.1 in Swahili language. The effort comes from the Tanzanian Linux User Group, a grass-root organization that wants to promote open source and software in Swahili language.

Today, we have completed the first full build of the software that contains 93% of the total strings. Screenshoots of the software are available now here. 


There is still some work regarding acceleration keys and reviewing the glossary for consistency among translators but the software should be ready for public testing in less than one month.

Congrats to all that have taken part in this translation.