Nokia Web Runtime WRT

April 23, 2010 1 comment
Advertisements
Categories: S60 Devices Tags: , , ,

Joomla installation on Ubuntu

April 23, 2010 2 comments

Today’s we are going to see how to use google map mashup in a famous CMS – Content Management System which is Joomla.  Though the documentation is self explanatory I’ll just list te common mistakes that fly-over testers make while installing Joomla but let me tell you experience developers (like Mr. Nabeel Mushtaq) always prefer to read the documentation evertime you you have to install some package or framework because it’s like the movie “The Matrix” every time you find something to grab!

Move the downloaded zip file of the Joomla package to webserver’s root directory;-

# mv /home/user-name/Downloads/Joomla***.zip /var/www/joomla

Unzip it here

# unzip Joomla***.zip

Delete the existing configuration.php-dist file

# rm -rf configuration.php-dist

Most users don’t perform the above step and just rename the filename

# mv configuration.php-dist configuration.php

Due to whish while running the web wizard or installation it causes problems as the script feels dizzy while updated the already populated configuration.php file

Create a new unwritten file

# toucj configuration.php

Give’em writes to apache users to writeable

# chmod 755 configuration.php

Some users while rename the configuration.php-dist file to configurtion.php while fall at the end of the web installation wizard with a fatal error.

If you got permission errors I would suggest you should give apache user the rights to read write the joomla folder

#chown www-data /var/www/joomla -R

That’s it!

Mail parsing via Ez Components

April 18, 2010 3 comments

Get started with EZ Components:

After spending ma 24hrs I landed on a blog where the guys have an excellent tutorial series to get started with Ez components in detail so skim it first here you go [1] Hello World![2]  Send an Email[3] RSS feed creation.

sudo apt-get install apache2

sudo apt-get install php5

sudo apt-get install libapache2-mod-php5

sudo /etc/init.d/apache2 restart

Pear Package Manager installation on Linux:

lynx -source http://pear.php.net/go-pear | php

sudo apt-get install lynx-cur

sudo apt-get install php5-cli

Ez Component using Pear Installed

pear channel-discover components.ez.no
pear install -a ezc/eZComponents

Setup include_path

Navigate to the following files and append the root PEAR directory.

/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini

include_path=”.:/var/www/path/to/root/PEAR”

At the top of the code you wrote using ez libs

require_once(“ezc/Base/base.php”);  //depend of the installation method either pear or svn
function __autoload( $className )
{
ezcBase::autoload( $className );
}

Pre-requisites:

  1. Xampp
  2. Ez Components

Task 1: Receiving and Parsing emails:

In the code below we are going to receive emails from a remote server and parse it’s parts. Moreover we’ll tear down the attached files and move them to a separate directory for later processing.

<?php
$dir = dirname( __FILE__ );
require_once “$dir/../../ezcomponents-2009/Mail/docs/tutorial/tutorial_autoload.php”;

$options = new ezcMailPop3TransportOptions();
$options->ssl = true;
$pop3 = new ezcMailPop3Transport( “pop.gmail.com”, 995, $options  );
$pop3->authenticate( “sendmarks@gmail.com”, “cubesatlover” );
$pop3->status( $num, $size );
$messages = $pop3->listMessages();
$set = $pop3->fetchAll();
$parser = new ezcMailParser();
$mail = $parser->parseMail( $set );

//echo print_r($mail);

for ( $i = 0; $i < count( $mail ); $i++ )
{
echo formatMail( $mail[$i] );
}

function formatMail( $mail )
{
$t = ”;
$t .= “From:      “. formatAddress( $mail->from ). “<br />”;
$t .= “To:        “. formatAddresses( $mail->to ). “<br />”;
$t .= “Cc:        “. formatAddresses( $mail->cc ). “<br />”;
$t .= “Bcc:       “. formatAddresses( $mail->bcc ). “<br />”;
$t .= “Date:      “. date( DATE_RFC822, $mail->timestamp ).
“<br />”;
$t .= “Subject:   “. $mail->subject . “<br />”;
$t .= “MessageId: “. $mail->messageId . “<br />”;
$t .= “<br />”;
$t .= formatMailPart( $mail->body ) . “<br />”;
return $t . “<br /><br />”;
}

function formatMailPart( $part )
{
if ( $part instanceof ezcMail )
return formatMail( $part );

if ( $part instanceof ezcMailText )
return formatMailText( $part );

if ( $part instanceof ezcMailFile )
return formatMailFile( $part );

if ( $part instanceof ezcMailRfc822Digest )
return formatMailRfc822Digest( $part );

if ( $part instanceof ezcMailMultiPart )
return formatMailMultipart( $part );

die( “No clue about the “. get_class( $part ) . “<br />” );
}

function formatMailMultipart( $part )
{
if ( $part instanceof ezcMailMultiPartAlternative )
return formatMailMultipartAlternative( $part );

if ( $part instanceof ezcMailMultiPartDigest )
return formatMailMultipartDigest( $part );

if ( $part instanceof ezcMailMultiPartRelated )
return formatMailMultipartRelated( $part );

if ( $part instanceof ezcMailMultiPartMixed )
return formatMailMultipartMixed( $part );

die( “No clue about the “. get_class( $part ) . “<br />” );
}

function formatMailMultipartMixed( $part )
{
$t = ”;
foreach ( $part->getParts() as $key => $alternativePart )
{
$t .= “-MIXED-
$key——————————————————————
<br />”;
$t .= formatMailPart( $alternativePart );
}
$t .= “-MIXED
END———————————————————-<br />”;
return $t;
}

function formatMailMultipartRelated( $part )
{
$t = ”;
$t .= “-RELATED MAIN
PART———————————————————–<br />”;
$t .= formatMailPart( $part->getMainPart() );
foreach ( $part->getRelatedParts() as $key => $alternativePart )
{
$t .= “-RELATED PART
$key—————————————————–<br />”;
$t .= formatMailPart( $alternativePart );
}
$t .= “-RELATED
END——————————————————–<br />”;
return $t;
}

function formatMailMultipartDigest( $part )
{
$t = ”;
foreach ( $part->getParts() as $key => $alternativePart )
{
$t .= “-DIGEST-
$key—————————————————————–
<br />”;
$t .= formatMailPart( $alternativePart );
}
$t .= “-DIGEST
END———————————————————<br />”;
return $t;
}

function formatMailRfc822Digest( $part )
{
$t = ”;
$t .= “-DIGEST-ITEM-
$key————————————————————<br />”;
$t .= “Item:<br /><br />”;
$t .= formatMailpart( $part->mail );
$t .= “-DIGEST ITEM
END—————————————————-<br />”;
return $t;
}

function formatMailMultipartAlternative( $part )
{
$t = ”;
foreach ( $part->getParts() as $key => $alternativePart )
{
$t .= “-ALTERNATIVE ITEM
$key——————————————————-<br />”;
$t .= formatMailPart( $alternativePart );
}
$t .= “-ALTERNATIVE
END—————————————————-<br />”;
return $t;
}

function formatMailText( $part )
{
$t = ”;
$t .= “Original Charset: {$part->originalCharset}<br />”;
$t .= “Charset:          {$part->charset}<br />”;
$t .= “Encoding:         {$part->encoding}<br />”;
$t .= “Type:             {$part->subType}<br />”;
$t .= “<br />{$part->text}<br />”;
return $t;
}

function formatMailFile( $part )
{
$t = ”;
$t .= “Disposition Type: {$part->dispositionType}<br />”;
$t .= “Content Type:     {$part->contentType}<br />”;
$t .= “Mime Type:        {$part->mimeType}<br />”;
$t .= “Content ID:       {$part->contentId}<br />”;
$t .= “Filename:         {$part->fileName}<br />”;
$t .= “<br />”;
move_uploaded_file ( $part->fileName , “/var/www/vhosts/domain.com/
httpdocs/image.png”);
$t .= “<img src=’/image.png’>”;
return $t;
}

function formatAddresses( $addresses )
{
$fa = array();
foreach ( $addresses as $address )
{
$fa[] = formatAddress( $address );
}
return implode( ‘, ‘, $fa );
}

function formatAddress( $address )
{
$name = ”;
if ( !empty( $address->name ) )
{
$name = “{$address->name} “;
}
return $name . “<{$address->email}>”;
}

?>

Zend Erroronicles

April 5, 2010 2 comments

Today we are going to list the couple of buys a noob has to face while getting started with the Zend framework;- The story while traveling to the Hello world 😉

Errors:

Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/landmark_collector/public/index.php on line 11

Fatal error: require_once() [function.require]: Failed opening required ‘Zend/Loader.php’ (include_path=’/var/www/landmark_collector/application/../library:.:/usr/share/php:/usr/share/pear’) in /var/www/landmark_collector/public/index.php on line 11

Problem:

Set the zend library path in the inlude_path for php

Solution:

+ the following lines at the top of the file /var/www/website-name/application/bootstrap.php

define(“SITE_ROOT”, dirname($_SERVER[‘DOCUMENT_ROOT’]));
set_include_path(get_include_path().PATH_SEPARATOR
.’/var/www/zend/library’);

Error:

Notice: Zend_Loader::Zend_Loader::registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in /var/www/landmark_collector/library/Zend/Loader.php on line 258

Fatal error: Uncaught exception ‘Zend_Controller_Dispatcher_Exception’ with message ‘Invalid controller specified (error)’ in /var/www/landmark_collector/library/Zend/Controller/Dispatcher/Standard.php:242 Stack trace: #0 /var/www/landmark_collector/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /var/www/landmark_collector/public/index.php(25): Zend_Controller_Front->dispatch() #2 {main} thrown in /var/www/landmark_collector/library/Zend/Controller/Dispatcher/Standard.php on line 242

Problem:

Categories: Web Frameworks Tags: , , , ,

Configuration of Redmine on Ubuntu

April 3, 2010 2 comments

Pre-requisite packages:-

Update your repository

# apt-get update && apt-get upgrade

Following packages are required from the redmine

# sudo apt install apache2 libapache-dbi-perl libapache2-mod-perl2 libdigest-sha1-perl subversion libapache2-svn apache2-threaded-dev

# sudo apt install ruby ruby1.8-dev rubygems rubygems1.8 ruby-pkg-tools libgemplugin-ruby libgemplugin-ruby1.8  libruby-extras libruby1.8-extras rails rake

# sudo apt install build-essential libdbd-pg-perl mysql-server

Install a couple of gems

# sudo gem install rails mongrel mongrel_cluster mysql –include-dependencies

Add gems to $PATH

Temporarily

PATH =$PATH: /home/qasim/.gem/ruby/version/bin/

export PATH

Permanently

Add the following line at the end of the /etc/profile file

export PATH=$PATH: /home/qasim/.gem/ruby/version/bin/

Downloading Redmine:-

Using tar file

$ mkdir /var/www/redmine

$ cd /var/www/redmine

$ wget http://rubyforge.org/…&#8230;../redmine-version.tar.gz

$ sudo tar xvfz redmine-versiontar.gz

$ sudo mv redmine-version/* .;rm redmine-version.tar.gz -rf

$ sudo chown www-data:www-data * . -R

Using svn repo

For this setup I’ll be using the 0.6 stable branch of redmine via svn, and installing it under /var/www/rails_apps/redmine-0.6

Create the directory and checkout Redmine

$ mkdir /var/www/redmine

$ cd /var/www/redmine

$ svn co http://redmine.rubyforge.org/svn/branches/0.6-stable redmine-version

Configuring Redmine:

Set up the database for Redmine to use

We’ll create a database for redmine by logging into mysql server

$ mysql –u root –p

mysql> create database redmine character set utf8;

Query OK, 1 row affected (0.04 sec)

mysql> exit

Bye

Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for “production” environment.

/var/www/redmine$ sudo cp config/database.yml.example config/database.yml

Now open the databse.yml file and edit it according to your credentials

production:

adapter: mysql

database: redmine

host: localhost

username: redmine

password: XXXXXXXX

encoding: utf8

socket: /var/run/mysqld/mysqld.sock

Create the database structure, by running the following command under the application root directory (/var/www/redmine)

# sudo rake db:migrate RAILS_ENV=”production”

Insert default configuration data in database, by running the following command:

# sudo rake redmine:load_default_data RAILS_ENV=”production”

Errors

Error reading /home/qasim/.nano_history: Permission denied

Run the rake command with root permissions

Access denied for user ‘root’@’localhost’ (using password: NO)

Either password in database .yml is incorrect or you forgot to write it in

Now it’s the time to test the beast performance let’s confirm that every nut and bolt is in place.

Trigger the following while living in the same /var/www/redmine:

$ sudo mongrel_rails start –environment=production

Output

** Starting Mongrel listening at 0.0.0.0:3000

** Starting Rails with production environment…

** Rails loaded.

** Loading any Rails specific GemPlugins

** Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no restart).

** Rails signals registered.  HUP => reload (without restart).  It might not work well.

** Mongrel 1.1.5 available at 0.0.0.0:3000

** Use CTRL-C to stop.

Switch to your favorite browser and point it to localhost:3000 with the following credentials to access the administrator’s dashboard.

web address: http://localhost:3000

username: admin

password: admin

happy mining :p

Nokia PC suite on Linux

April 3, 2010 1 comment

Here is ma ma first interaction (officially) with Nokia devices specially with E73.

Following needs to be done while sticking to the Linux distro for humans, yeah you caught me right “Ubuntu”

Task: File synchronization among the phone and linux distro

As we are operating in the open source environment having Nokia phones following issue will be faced as listed hereunder;-

1-      File synchronization with desktop

Nokia is not offering their mobile manager software PC Suite for the Linux operating system we are left with following options;-

1-      Install  PC suite using Crossover (Proprietary version of Wine)

2-      Use card reader to snatch mobile data from external SD card

3-      Alternative native Linux packages for PC suite

Considering the third option regarding alternative PC suite packages on Linux following packages have been identified;-

Series60 Remote Installation

Redhat distro

rpm -i series60*.rpm

yum install PyQt4 pybluez python-matplotlib python-obexftp rpmlib

yum install rpm-libs

Debian distros

sudo dpkg -i series60*.deb

sudo apt-get install python-bluez python-qt4 python-qt4-sql sqlite3 libqt4-sql-sqlite

Applications>Internet>Series60-Remote

Instll package on Mobile phone

Python for S60, Series60-Remote

Testing

Device = E61i

Nokinux installation

Download the tar package

wget http://launchpad.net/nokinux/trunk/0.0.8.5/+download/nokinux-0.0.8.5.tar.gz

Untar the file

tar nokinux-0.0.8.5.tar.gz

Now install the package

sudo ./nokinux-setup install
Nokinux Pre Alpha 0.0.8.5 Setup
Welcome, this script will install Nokinux in your system.

==> Installing dependencies
Choose your distribution:

1. Debian, Ubuntu and derivatives
2. ArchLinux
3. Mandriva ( Experimental )
4. Fedora ( Experimental )
5. Suse ( Experimental )
6. Others

Enter number: 1
* Run APT-GET… Done
./nokinux-setup: line 104: /home/qasim/.nokinux/distro: No such file or directory
Warning: Dependencies install failed. Please install manually these packages:
openobex-apps obexftp obexfs gzip tree

==> Installing languages
* Installing language [it]… Fail

==> Copying necessary files
* Making folders… Done
* Copying files… Done
* Copying launcher… Done

==> Correction Zenity bug (LP: #272083)
* Patching zenity… Fail

<<< Installation failed >>>
Log files saved: /var/log/nokinux-install.log

Install the following packages manually

sudo apt-get install openobex-apps obexftp obexfs gzip tree linux-headers-2.6.31-14 libtsmux0 linux-headers-2.6.31-14-generic

Errors: patch: **** Can’t find file /usr/share/zenity/zenity.glade : No such file or directory

Download the zenity.glade file and place it accordingly

Re run the install command as listed here above;-

==> Correction Zenity bug (LP: #272083)
* Patching zenity… patching file /usr/share/zenity/zenity.glade
Reversed (or previously applied) patch detected!  Assuming -R.
Hunk #3 succeeded at 287 (offset -1 lines).
Hunk #4 succeeded at 327 (offset -1 lines).
Hunk #5 succeeded at 450 (offset 25 lines).
Hunk #6 succeeded at 575 (offset 25 lines).
Hunk #7 succeeded at 678 (offset 25 lines).
Hunk #8 succeeded at 801 (offset 25 lines).
Hunk #9 succeeded at 926 (offset 24 lines).
Hunk #10 succeeded at 1062 (offset 24 lines).
Hunk #11 succeeded at 1174 (offset 23 lines).
Done

Installation complete!

Applications>Accessories>Nokinux

Synchronize 🙂

Setting up Elgg on Ubuntu

March 8, 2010 2 comments

Download the elgg open source social platform from http://sourceforge.com/elgg
#cp elgg-1.7.tar /var/www/html
#mkdir <domain_name>
#cd <domain_name>
#tar -xvzf elgg-1.7.tar
Visit the directory in the web browser
http://localhost/html/domain_name
Welcome to Elgg page
The current url will be
http://localhost/html/nebula/install.php
Enter your database settings below and hit save:
Warning:   Once you’ve corrected any configuration issues, press reload to try again.
Asking you to create the .htaccess file in the root directory where you have extracted the elgg platform source code.
Error:   Elgg couldn’t connect to the database using the given credentials.
Take the bachup of the setting.example.php
#cp /var/www/html/domain_name/engine/settings.example.php setting.php~
#nano settings.php
Under the standard configuration section
// Database username
$CONFIG->dbuser = ‘root’;

// Database password
$CONFIG->dbpass = ‘**********’;

// Database name
$CONFIG->dbname = ‘nebula’;

// Database server
// (For most configurations, you can leave this as ‘localhost’)
$CONFIG->dbhost = ‘localhost’;

// Database table prefix
// If you’re sharing a database with other applications, you will want to use this
// to differentiate Elgg’s tables.
$CONFIG->dbprefix = ‘elgg_’;

After modifying the settings file reload the page on the browser
you’ll be directed to the System settings
Message: Elgg’s database was installed successfully.

Now it’s time to create the data folder where the elgg platform will save your data including text and photos extra.
Note that the data folder should be outside the directory where you have extracted the elgg framework
#mkdir /home/logged-user/data
#chmod a+x data/ -R
#chown www-data data/
If you didn’t set the proper permissions for the data director the elgg installation will throw a warning
Warning: Your data directory /home/ is not writable.
If all set well the url will be changed
http://localhost/html/nebula/account/register.php

Error :

The requested URL /action/systemsettings/install was not found on this server.

# sudo nano /etc/apache2/sites-available/default

Look for the Directory section referring to the folder where your Drupal site lives (in /etc/apache2/sites-available/default, this is typically <Directory /var/www>), and change the line:

AllowOverride None

to

AllowOverride All

Save this file and then reload apache.

# sudo /etc/init.d/apache2 reload

Note:: http://drupal.org/node/134439

Error: on URL – http://localhost/html/elgg-1.7/install.php

Elgg error: Apache does not have mod_rewrite loaded. Please check your Apache setup.

Elgg relies on the mod_rewrite Apache extension in order to simulate certain URLs.

Go to /etc/apache2/apache2.conf

Then you have to enabled the rewrite module(mod_rewrite). You no longer have to do the:
LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c

It’s now as easy as:
sudo a2enmod rewrite

To disable this module it’s just:
sudo a2dismod rewrite

# sudo service apache2 restart

INSTALLING ELGG ON LIVE SERVER

The page isn’t redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

*   This problem can sometimes be caused by disabling or refusing to accept cookies.

(I edit .htaccess and add RewriteBase /my-elgg-path after RewriteEngine on) Persists

For detail troubleshooting :: http://docs.elgg.org/wiki/Install_Troubleshooting

%d bloggers like this: