Author Archives: chethakau

Format and Mount an External hard disk in a Linux guest

When mounting an external hard disk in linux, I had to face some troubles and with help some google searches, I could resolve those issues . Here are the steps to mounting an external hard disk in Linux.

  1. Open a terminal and log in as the root user
  • Create a new directory in a preferred location (mkdir Ext_30GB)
  • chmod 777 Ext_30GB
  • Try this mount command. Command will fail if partition is not formatted

mount -t ext2 /dev/sdb1 Ext_30GB/

(If successfully external hard is mounted, ignore following things. If not, go ahead…)

  1. Enter following commands in terminal
    • fdisk –l


Disk /dev/sdb: 32.2 GB, 32212254720 bytes
 64 heads, 51 sectors/track, 19275 cylinders, total 62914560 sectors
 Units = sectors of 1 * 512 = 512 bytes
Disk /dev/sdb doesn't contain a valid partition table

Solve ‘Disk /dev/sdb doesn’t contain a valid partition table’ pproblem

  • fdisk /dev/sdb

Enter following commands in the prompt,

  • Create a new partition table with ‘o
  • Create a new partition with ‘n
  • Create a ‘Linux’ partition ‘l
  • Let it use the default values by hitting ENTER when it asks for numbers, to take the entire available disk in this partition
  • Write the new partition table with ‘w‘, which should dump you back to the prompt.

Try the mount command again,

mount -t ext2 /dev/sdb1 Ext_30GB/

(It will success or following error message will appear)


mount: wrong fs type, bad option, bad superblock on /dev/sdc1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Then you should have a /dev/sdb1 to format with mkfs.

  • file -s /dev/sdb1
  • mke2fs -S /dev/sdb1
  • mke2fs -j /dev/sdb1
  • file -s /dev/sdb1

Try the mount command again,

mount -t ext2 /dev/sdb1 Ext_30GB/

It should be working now

Categories: Linux | Tags: , , , , , | Leave a comment

From the Society, to the Society, with the Society | IMCD

Share the words.. meanings in it.. to a better world.

Gain what you read.. & make sure you Give it to another Need…

imcdInternational Movement for Community Development (IMCD) is acollaboration of passionate youth, for community development in SriLanka. IMCD endeavourers in enriching the living standards of the people in need, with the inspiration “To be the global role model in community centered social development”. The timely pursuits of IMCD, have been implemented sensing the pulse of the nation; being “From the society, to the society, with the society”. Being an exemplary social service organization, IMCD continuously seek new avenues of enriching the living standards of the community.


Needy Readers” is the main project of IMCD. There are lot of students all over the country who have the desire to read, willing to discover the world with the adventures in books, are underprivileged due to the shortage of good books. IMCD endeavor in facilitating them with the required material, for them to win the world. Theme of the needy readers project is “Donate a Book. Light a Future

IMCD has donated more than 10000 books under the Needy Readers project and hoping to donate more books. Here are some book donation projects which we organized and what we experienced with those events in different places.

So you also can join with IMCD for giving a better life to students and people in need. There are more upcoming projects as needy readers and let’s try make a better world with the society without blaming the system.


For getting to know more about IMCD visit 

Categories: Social Works | Tags: , , , , , , , | Leave a comment

Run adb shell and how to get # instead of $ for root permission : Android

Here is the solution when running adb shell and get $ instead of #, which is not the su command. I found this solution in a comment of my previous post. Lot of people have this problem and keep asking me this question. So I thought to post “ryo” ‘s (unknown author) solution here as it will help for many others.


April 8, 2013 by ryo :

My Samsung Ace 2 is rooted, but when I type ‘adb shell’, I get a $ instead of #, which I’ve found out is not the su command. So I’ve tried various ways to get the ‘#’ instead of ‘$’, like typing ‘adb shell’ and then ‘su’, which returns the cursor to the next line, is blank for 10 seconds, and then ‘$’ appears again (after 10 seconds). I’ve also tried typing ‘adb shell su’, and it waits for a few seconds, and then just returns to the android\sdk\platform-tools folder.

Running Gingerbread 2.3.6 – what am I doing wrong?! Just need to get a # instead of $……………..


April 8, 2013 by ryo :

OK! So, after 2 hours of trying to unsuccessfully trying to get ‘sqlite3 settings.db’ to work through adb shell, I found an alternate method (I am using a rooted Samsung Ace 2 running Android 2.3 Gingerbread on Windows 7, with debugging mode on):

1. Download SDK Installer for windows and install BOTH tools (SDK tools + Platform-tools) – you don’t need any of the other stuff in there.
2. Launch cmd.exe, and navigate to the platform-tools folder (mine was C:/android/sdk/platform-tools
3. Use command: adb pull /data/data/­s/databases/settings.db \some_folder_on_your_computer (all one line)

**NOTE**If permission is denied, then type ‘adb shell’, and ‘su’ to get superuser; it should show #, not $. Then type ‘chmod 666 /data/data/­rs.settings/databases /settings.db’ (don’t type the ” apostrophe). Then type exit, and exit, again until you’re back to …../platform-tools

4. use “adb pull /data/data…settings.db” command again. It should work this time, and the settings.db file should be in the folder you told it to push to
5. Get Firefox, and get add-on called “SQLite Manager”. Restart Firefox. Go up to top left Firefox tab and under ‘web developer’ menu, you should see ‘SQLite Manager’. Open it.
6. Open the settings.db with SQL Manager (you might have to change it from only showing .sqlite files, to show All Files *.*
7. After settings.db is open, go to Tables–>Secure, and look for lockscreen.lockedoutpermanently. If you’re phone was TOTALLY Locked out (e.g., after 20 pattern attempts…=damn kids), then it should show a value of “1″ (this means “on”). Select it, click the edit button up top, and change the value to “0″ (=”OFF”). Commit changes and close SQLite Manager.
8. go back to cmd.exe window (you should still be in the …./platform-tools folder), use the command:
adb push \some_folder_on_your_computer\settings.db /data/data/­s/databases/
9. If this transfers successfully, you SHOULD be good to go.
10. Unplug phone, turn off, turn on = YOUR GOOD OLD SIM PIN SCREEN! :D

Big Credit due to AppsCatalog and the clues in his description in his youtube video (

Thank You Very much “ryo” for your solution 🙂

Categories: Android | Tags: , , , , , , , , | 12 Comments

Unlock an Android Device without Internet Access – Using ADB commands


My Android tablet is  locked because too many wrong pattern attempts.  When entering a wrong pattern 20 times (you may be not stupid to enter it wrong 20 times, but your child or someone else who wants to lock your device what happen ? ) your devices is locked and asking to unlock it via your google username and password. You are lucky if the device locked with Wifi on or mobile data network on. Then you can simply log into the google account and unlock it. But I’m not that much lucky and my tablet was in “Airplane mode on” with “Wifi off”.

Android device lock with too many pattern attempts

Android device is locked with too many pattern attempts

Android should have a method to turn on wifi or mobile networks when device is locked. But no, there is no such a method :-/


I did lot of google searches and most of them end up with hard resetting the device. If you hard reset all the data are gone. I tried it too, but because of some problem(it may be the device model), my resetting was stuck in middle of the process. Finally I found a solution to access the device from a PC via a USB cable (ADB Commands). For this method you have to have enabled USB Debugging on the device before it is locked. Luckily I had enabled it before it is locked.  (As I saw, for rooted users USB Debugging is not required — but you might need to manually mount the/data partition. Actually I didn’t try it and don’t know how to do it as my USB debugging is enabled.)

Ok here is the solution for devices which have enabled USB debugging ,

Open the command prompt (cmd) in Windows

Change directory to the android SDK platform tools (cd C:\Program Files\Android\android-sdk\platform-tools)

Type following commands in cmd

  • adb devices (verify device is identified by pc. If not reconnect device and try again. it should display “device” with a serial no)
  • adb shell
  • cd /data/data/
  • sqlite3 settings.db
  • update system set value=0 where name='lock_pattern_autolock';
  • update secure set value=0 where name='lock_pattern_autolock'; (for some devices update “system” is enough but I had to update “secure” too)
  • update system set value=0 where name='lockscreen.lockedoutpermanently';
  • update secure set value=0 where name='lockscreen.lockedoutpermanently';
  • .quit
  • exit
  • adb reboot

Now your device should be unlocked. If not do this step too,

  • adb shell rm /data/system/gesture.key (I didn’t have to do it. But it had mentioned here)

Here what I have done is clear lock patterns and remove the permanent lock from the database. Yes here I have break the security, but saved my device as can be used again. If you are concern about the security of your device “Always keep off USB debugging mode“. But I don’t know what will happen to your important data when someone locked your device.

So did you solve your problem and save your device ? Then don’t forget to like my fb page. ONLY IF YOU HAD A SOLUTION FROM THIS 😉

If you know about a better solution, add it as a comment here. It will help others too.

Update 18-05-2013

Important Comments

ryo :

Ashutosh :

checky :

Categories: Android | Tags: , , , , , , , , , , , | 281 Comments

Your Life is Encrypted in Pi

This is an interesting explanation for Pi, I just hear while watching Person of Interest TV series.

Harold : Can any of you tell me what it means?

I’ll settle for an intelligent question here.

Student : My friend has a question,Mr. Swift.

“What is any of this good for,and when would we ever use it?”

All class : [Laughter]

Harold : Let me show you.

Life Circle

Life Circle

” Pi – 3.14159265359….
The ratio of the circumference of a circle to its diameter.
And this is just the beginning.
It keeps on going.Forever.
Without ever repeating.
Which means that contained within this string of decimals is every single other number.
Your birth date, combination to your locker,
your social security number.
It’s all in there somewhere.
And if you convert these decimals into letters,you would have every word that ever existed in every possible combination.
The first syllable you spoke as a baby,the name of your latest crush,your entire life story from beginning to end.
Everything we ever say or do…
All of the world’s infinite possibilities rest within this one simple circle.
Now what you do with that information…
What it’s good for…
Well, that would be up to you. ”

 Me : But still I don’t have any idea how to decrypt this encrypted life into a usable way. But who knows you may be.. 🙂

Categories: Mathamatics | Tags: , , , , , , , , | 2 Comments

Configure NxOgre in Ogre3D – Collision Detection

Author : Pubudu Ranathunga (

Here are the basic steps and simple guide for integrating collision detections in Ogre3D using NxOgre. (For Complete Details : Click Here)

Required Software

  1. Physx sdk
  2. NxOgre (Physx wrapper for Ogre)
  3. Critter (Rendering system for NxOgre)
  4. Flour (Bounding box constructer for |NxOgre)

Steps carried out to integrate physics project

  1. Install the Physx SDK to machine and setup Environment variable “PHYSX_DIR” to physx sdk folder path.
  2. Extract Nxogre and  open Nxogre project using VC++.
  3. Link  Physx SDK includes and Lib folder accordingly in VC++ (Tools –> Options –> Projects and Solutions –> VC++ Directories)
  4. Build the project. (If you have successfully configured NxOgre as earlier steps, a separate sdk folder should have been created inside NxOgre folder)
  5. Setup environment variable “NXOGRE_DIR”  and set  path to NxOgre sdk
  6. Extract Critter to a preferred location and open VC++ project.
  7. Link with Nxogre and build the project (If successful, a separate sdk folder should have been created inside Critter folder ).
  8. Include NxOgre and Critter SDK folders to the created project.
  9. Put all the DLL files in Physx,Nxogre and Critter to release or debug folder of the project accordingly.
  10. Put LIB files (Physx,Nxogre,Critter) to a folder and link to the project and Start the project.

Steps to build Flour to create bounding boxes

  1. Extract Flour to a preferred location and link with Nxogre
  2. Build the Project  and put Nxogre and Nxcharacter DLL to use Flour

Steps to build an accurate bounding box

  1. Export  a “.mesh” file from preferd modeling software.
  2. Convert  to “.xml” file using Ogre XML Converter
  3. Then go to exporters/OgerXML  folder in Flour  and  run ogrexmltoflower.rb file using CMD                     ( Machine should have Ruby installed )
  4. Fallow the guidelines on CMD to create  .flower file
  5. Copy that “.flower ” file to the flour release folder and run the command “Flour convert (folwer file name) (folwer file name) .nxs ”

Author : Pubudu Ranathunga (

Categories: Game Development, OGRE, Physics Engines, Virtual Reality | Tags: , , , , , , , | 2 Comments

Game Engine Awareness and Use

3D view of near Colombo Harbor – Vidusayura Ship Simulator


There are some huge changes and massive growth in the game industry in past few years. There are
quite a large number of game engines available for developers to use, from likened high end to free
open source. They are also multi platform across personal computers and game consoles, all licensable
and are all available for license without an arrangement with platform manufacturer (Deloura, 2011).

Game engines become more user-friendly as the technology matures and the application of game
engines has broadened in scope. Massive growth of casual, mobile and social games is one of the most
remarkable changes in game industry in past few years. Game engines are now being used not only
simply for video games but also serious games such as visualization, training, medical, and military
simulation applications (Berberich, 2007).To facilitate this accessibility, new hardware platforms are now
being targeted by game engines, including mobile, phones and web browsers (WAELE, 2008). While the
iPhone is doing probably the best job embracing mobile and web convergence, the Apple OS is still a
closed system and used by a rather small market segment of users. But the new Linux-based operating
system Android is open source platform and therefore mobile platform has become a truly competitive
now also in game engine developments.

There are so many game engines are available now in industry. But actually there is some limit when
considering game industry people’s awareness and use of those game engines. Clearly one of the most
important elements for game engine companies is just getting their product in front of the right people,
so if executives aren’t even aware of their engine, they’ve got big issues. Here are some survey results
which is done on awareness and use of existing and popular game engines (DeLoura, 2009).

As data comparison showing above Unreal engine has massive awareness and knowledge. It is the most
well-known, and more remarkably, a majority of responders have used it in this survey done by
(DeLoura, 2009).
After Unreal Engine, the data drops off a cliff fast – with Torque, Gamebryo, and Source all roughly
equivalent as the second most frequently used game engines, with about one out of five people having
used each. The distance between Unreal and the rest is interesting.
Even more interesting is the massive awareness of CryENGINE even though there aren’t many games on
the market using it. Let’s see how perceptions of these game engines correlate with this.


  •  Usually built on OpenGL or DirectX
  •  Generates images in real-time from assets
  •  Controlled by the Scene Graph
  •  Interacts directly with the GPU


  •  Handles behavior of objects based on collisions
  •  Simulates or predicts phyics models
  1. Rigid Body Dynamics
  2. Soft Body Physics
  3. Fluid Dynamics

There are more than twenty well known physics engines (Wikipedia, 2011). In late 2009, NVIDIA PhysX,
Havok, Open Dynamics Engine (ODE), Newton Game Dynamics, BULLET physics library were most
popular among game developers (Zogrim, 2009). This analysis was done by NVIDIA Cooperation and
their popularity is distributed as illustrated in Figure 3. They considered physics engines against number
of released game titled in 2009.


Categories: Game Development, Virtual Reality | Tags: , , , , , , , , , , , , , | 1 Comment

Navigating a Ship in ‘Vidusayura’

This is how you feel when navigating a ship in Vidusayura Ship Simulator. A real ship bridge of a Dora ship is created here and real ship controls (2 throttles, rudder) are used for navigations. Sri Lanka’s three main harbors (Colombo, Galle and Hambanthota) are modeled here and those can be changed during the training with different environment conditions.

The video was recorded 2010-12-05 at the 60th diamond jubilee exhibition at Sri Lanka Navy.

Categories: Animations, Vidusayura, Virtual Reality | Tags: , , , , , | Leave a comment

(Sub) Version Control – Configure own SVN Server and Clients

Version Control Systems are used for manage files and directories, and the changes made to them, over time. This allows you to recover older versions of your data or examine the history of how your data changed. This is a simple guide for how to configure a SVN server and SVN clients.

SVN Server (VisualSVN Server – Subversion Server for Windows)

VisualSVN Server allows you to easily install and manage a fully-functional Subversion server on the Windows platform.

Download VisualSVN Server and Install it in your server machine.

After complete the installation create new users and repositories as your project by right click on them. Remember to tick on Create default structure (trunk, branches, tags)  when creating a new Repository.
SVN Server

SVN Server

Now your SVN server is ready to be used with SVN clients for your project.

SVN Client (TortoiseSVN)

Download TortoiseSVN and install it in all client machines which are going to use for subversion.
After installation, project has to be imported first to the SVN server (Log into server using created users). In the server projects are normally saved in trunk folder.
SVN Import

SVN Import

Right click on the project folder again and click on SVN Checkout… Set your Checkout directory as project folder name and click OK button. Then warning message will be displayed and click Yes.
SVN Checkout

SVN Checkout

Now your project is ready for SVN and click on SVN Commit… by right click on the project folder. You can commit project anytime when changes are happened to the project and any previos versions can be exported by the Server as your need.
Categories: Uncategorized | Tags: , , , | 4 Comments

A tribute to Murali- “The greatest spinner” (via Niroshan’s World of Literature)

Great stuff for a great player !!! hats off Murali….

A tribute to Murali- “The greatest spinner” In his hand the leather ball spines
For the player at the wicket his eye skims
In a second, towards the wicket, he spins the ball
Which comes and hits the wicket and fall
The batsman trembled, so did the others
While the cheer goes high of the Lankan brothers
The batsmen stunned and thought thoroughly
A way of getting away from Murali

On the land of Sri Lanka, on the sacred soil
The name of Murali makes teams recoil
The spinning ball comes out fr … Read More

via Niroshan’s World of Literature

Categories: ReBlogs | Tags: , | Leave a comment

Create a free website or blog at

%d bloggers like this: