Skip to main content

Posts

Showing posts from 2010

ubuntu games

Followings are some ubuntu games that we can enjoy. Thanks for GNOM. 1.Armagetron Advanced Homepage: http://armagetronad.net/ Install Instructions: just install the following package: armagetronad. 2. Battle for Wesnoth Genre : Turn-Based Strategy Multiplayer : Online Homepage : http://www.wesnoth.org/ Install Instructions : just install the following package: wesnoth-all. 3. Beneath a Steel Sky Genre : Adventure Game, Point and Click Homepage : http://www.revolution.co.uk/_display.php?id=16 Install Instructions : just install the following package: beneath-a-steel-sky. 4. Bos Wars Genre : RTS Homepage : http://www.boswars.org/ Install Instructions : just install the following package: boswars. 5. Chromium Genre: Vertical space shooter Homepage : Chromium Install instructions: just install the following package: chromium. 6. Epiphany Install Instructions : just install the following package: epiphany. 7. Extreme Tux Race Genre : Downhill Racer Homepage : http://www.extremetuxracer.com/

GIS location selector

Using google maps is the best and easy way to integrate GIS information system to your web sites. Most of the social media application using google maps to their sites in current world. In here we are going to discuss how to integrate google maps in our web site and mark location from given set of locations. Simply here we are going to get location form mysql data base and populate those location on google map. step 01: First we need to obtain a google map API key form google. Click here to get api key. Step 02: Setup data base which included gis locations. in this database have included US locations and its GIS locations. SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: `gis` -- -- -------------------------------------------------------- -- -- Table structure for table `gis_locationinfor` -- CREATE TABLE IF NOT EXISTS `gis_locationinfor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `region` varchar(100) NOT NULL, `country` varchar(100) NOT NULL, `states` varchar(100) NOT N

Unix VS Linux

Free Software says that people have freedom to share software and related technology free without any hesitating. And also this may enable the rapid software development because all brains become to one stage and play the game. On a technical level, Free software grantees the right view and also modify source code if some one need different think as his view. In this post I am not going to deeply discuss about what Unix is and What Linux but here lats we talk about some interesting happenings around Unix and Linux What is Unix. In 1980, A computer scientist called Richard Stallman decided to create a venerable operating system called Unix. At the time Unix ran many of industrial and academic system in the world. He started developing Unix operating system and most of the world wide people join with him to success this operating system. Stallman called his version as "GNU" (Pronounced G-noo). This was start of GNU but not Unix, any way this was the new legendary of Unix so th

Debugging PHP with Netbeans

Most of the PHP developers are complaining that they have not a good ID for PHP debugging and every time that they have to use var_dump() print statement or PHP die or exit commands to check the state of php script. But now we can use netbeans to overcome this issue with netbeans-xdebug. I tried this with Linux and feel that working it cool. Anyway still I had not a time to try out this with windows and hope that netbeans-xdebuger working fine with windows also. Now I am going to explain how we can enable netbeans-xdebuger in Ubuntu 1. First we should have a netbeans installation package (Download from here ) 2. After installing Netbeans we can install xdebuger. To do that open terminal and type fallowing commands. sudo apt-get install php5-dev php-pear sudo pecl install xdebug 3. Now you have installed xdebug successfully but not configure with PHP yet. To Configure xdebuger with php and netbeans ID. open php.ini file using this command; sudo gedit /etc/php5/apache2/php.ini A

JQuery category selection table.

JQuery make js effect very easy and providing fancy techniques to do some stuff. In here we are going to explain how we can create category selection table using JQuery. Lets try to understand this using real world example. In this case we are having a table as fallow and we need to populate categories to select one or multiple for users. DB table, In here am using joomla coding but we can apply pure php cording to populate above table data in the side of front end. Populate table data, $db =& JFactory::getDBO(); $sqlgetcatinfor="SELECT * FROM #__ci_categoriesselection GROUP BY state"; $db->setQuery($sqlgetcatinfor); $categories = $db->loadObjectList(); //var_dump($categories); $stateul=''; $tdregionul=''; $tdcategoryul=''; $i=1; foreach($categories AS $category){ $stateul=$stateul.''; $sqlgetregions="SELECT * FROM #__ci_categoriesselecti

Creating Joomla Component Submenus

Simply we can add joomla component sub menu using component installation xml file. For that you need to include fallowing xml elements in your xml file inside com installation zip file. Main Menu Name/Component Name Menu Item 1 Menu Item 2 Menu Item 3 Menu Item 4 Menu Item 5 if some one need to add additional sub menus when already installed component you can add those using simple direct DB insert operation. Steps: 1. Go to the joomla database. 2. Select "DBfrefix_components" table. 3. Get component id by doing some search for "name" column and select its "id". 4. Now add your desired sub menu as fallow. INSERT INTO `jos_components` (`id`, `name`, `link`, `menuid`, `parent`, `admin_menu_link`, `admin_menu_alt`, `option`, `ordering`, `admin_menu_img`, `iscore`, `params`, `enabled`) VALUES (1, 'Main Menu Name/Component Name', 'option=com_componentname' , 0, 0,'option= com_componentname', 'Main Menu Name/Component Name', &#

Updating Vtiger Email module for sending Fax and SMS

Most of the time vtiger users searching modules for sending Fax and some time SMS to their customers. Actually writing a separate module for sending Fax may be a time consuming work. So that here I am going to explain how extend possibility of vtiger Email module to send Fax. If you good enough to understand this process, you can update this module to send SMS also. For sending emails we are normally using our own SMTP server. But we have to use some commercial API to send FAX and SMS. In here lets we select two commonly use APIs like "Interfax" and "clickatell" to send Fax and SMS. These APIs are providing email supported APIs to send Fax and SMS. That is why we can use vtiger Email module to send Fax and SMS. From this post I am not going to explain step by step who to hack Email module to send Fax and SMS because it is not a stride forward process. Actually I want to explain that we can use Vtiger Email module to send Fax and SMS other than sending emails aft

How to add a new column to vtiger existing table

When we add a new column to existing vtiger table, we need do more than just adding a column to selected vtiger table. If you do so, you may unable to do some DB operation like insert update and deleted. This is the way how we can do this. 1. Add a new column to selected table as normal 2. Add a new row to "vtiger_field" table as fallow "insert into vtiger_field values (tabid, fieldid, columnname, tablename, generatedtype, uitype, fieldname, fieldlabel, readonly, presence, selected,maximumlength, sequence, block, displaytype, typeofdata, quickcreate,quickcreatesequence, info_type)" When you set a value to "presence" field be make sure to select 0 or 2. Otherwise your selected field not populated with vtiger field list.

How to extract vtiger DB data

Here is the code sample how extract data form vtiger DB with WHERE close. Sample:1 require_once('include/DatabaseUtil.php'); global $adb; $tabid = array('9','16'); $sql = "SELECT tabid, fieldname, fieldid, fieldlabel,columnname, tablename, uitype, typeofdata, presence FROM vtiger_field WHERE tabid in (" . generateQuestionMarks($tabid) . ")"; $result = $adb->pquery($sql, array($tabid)); // get result $noofrows = $adb->num_rows($result); // get number of rows $i=0; $data=array(); while($resultrow = $adb->fetch_array($result)) { $tabid=$resultrow['tabid']; $resultrow=['fieldlabel']; $data[$i]=array($tabid, $resultrow); } Sample:2 require_once('include/DatabaseUtil.php'); global $adb; $query = 'select idlists,from_email,to_email,cc_email,bcc_email from vtiger_emaildetails where emailid =?'; $result = $adb->pquery($query, array($focus->id)); $from_email = $adb->query_result($result,0,'from_

Today is Asala poyaday for Sri lankans

King Dutumanu sang this song day like today. Obe Namin Saya Badimi Vimanayen Basinu Manawi Swarnamaliye Roobara Swarnamaliye Una Neela Varna Varala Dale Mal Gavisi Liye Naga Indrachapa Debama Asin Viduli Mawana Liye Mana Lamada Kinihiri Pethi Rathna Thilaka Paladi Liye Sinasisi Vimanayen Basinna Swarnamaliye Athe Gigiri Nada Salaba Nura Hadin Hadana Liye Kare Padma Kakulu Mala Hansa Thudin Thalena Liye Kane Thodu Mini Gana Ran Muna Opaya Karana Liye Pama Novi Vimanayen Basinna Swarnamaliye Balachandra Patu Nalalatha Kalka Adun Adina Liye Aaala Vadan Dantha Kakulu W.D Amaradewa

Terminal Hand Book (Ubuntu)

Introduction In traditional UNIX environment using CLI (Command Line Interface) is more interesting and powerful other than using GUI. Specially if some one have to work with UNIX server edition without GUI he has to face big difficulty if he is poor with CLI. With new versions of ubuntu it is providing GUI interface to replace CLI commands. Any way still there are some hidden terminal commands that forgot to GUI, so that having good knowledge of CLI is important. 1. Commands for configure softwares Description Command Install software sudo apt-get install [PackageName] Install ALL the required components using 1 single command sudo tasksel Run .sh (shell commands) files sudo sh filename.sh 2.Monitor Ubuntu software processes Description Command List all process currently running ps aux List selected packge's processes ps aux | grep [package name] many more 3.Common File Operations Description Command Rem

Hacking joomla core (categorize joomla modules under assigned menu)

Most of the time we have to face many difficulties search specific joomla modules that assigned to specific menu item. Currently (joomla 1.5x) joomla provide categorization of modules under fallowing four way According to template According to Position According to Type According to State My new modification will add another categorization for module as According to assigned menu. This is simple add stride forward. Step 01: Go to administrator\components\com_modules\toolbar.modules.html.php and past as fallow Existing one (line 49) echo $lists['assigned']; echo $lists['position']; echo $lists['type']; echo $lists['state']; After modified echo $lists['assigned']; echo $lists['position']; echo $lists['type']; echo $lists['state']; echo $lists['menu']; Step 02: Go to administrator\components\com_modules\toolbar.modules.html.php and add fallowing(After line: 6