Saturday, December 26, 2009

How to use "Huawei e156G HSDPA" on Linux ( tested with openSUSE 11.0 )

Recently I bought a Huawei e156G HSDPA USB stick dongle to use to access to the Internet. After connecting the Huawei e156G in to my PC which is running with openSUSE 11.0 it I didn't know how to use it to access to the Internet.
So, I typed lsusb and found the system identifies the dongle Huawei e156G as "Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem". Then I restarted my PC with Windows XP , plugged my Huawei e156G dongle and searched the internet to know "How to connect Huawei e156G with Linux?".
Normally I don't like to use windows XP in my PC because "I love Linux". But if I need to use my dongle on Linux, I have to get some help from M$ to download the packages. I don't hesitate to get some help from another O/S when I needed.

After few searches I found a link to OpenSuse website to another site.(http://en.opensuse.org/SDB:HUAWEI_E220_Support). Then I downloaded huawei.tar.bz2 from the site http://oozie.fm.interia.pl/pro/huawei-e220/ and decompressed it using the terminal and installed that package to my system.

tar -xjvf huawei.tar.bz2
cd huawei
su
[password] ( [password] = your password for the root )
make install_suse



when the dongle is connected to a USB port , system will identify the USB dongle at /dev/ttyUSB0

then you could edit the wvdial-huawei.conf file which is in the /etc/
( path :
/etc/wvdial-huawei.conf )
no need to edit whole file. It's enough to edit Phone , username , password fields to work with some ISPs. check your ISP for phone number which is needed to dial to connect and username , password also.

then you could surf the internet using the wvdial command.

you can try this with different distros and distributions.

Source : " http://en.opensuse.org/SDB:HUAWEI_E220_Support " Accessed on 24-12-2009 "
Technorati Tags:


Thursday, December 24, 2009

හුවාවි e156G ඩොංගලය openSUSE සමග භාවිතා කිරීම.

හුවාවි e156G ඩොංගලය openSUSE සමග භාවිතා කිරීම.

e156G ෙඩාංගලය openSUSE සමග භාවිතා කිරීම ඉතාම පහසු ක්රියාවකි.

මුලින්ම wvdial පිහිටුවා ගත යුතුය. එය පිහිටුවා ගැනීම එතරම් අසීරු ෙනාවන බැවින් ඔබට බාර කරමි.

අනතුරුව ඔබ http://oozie.fm.interia.pl/pro/huawei-e220/ යන ලිපිනයෙන් huawei-e220 සදහා වන huawei.tar.bz2 ගොනුව බාගත කර ගත යුතුය.
( link is from " http://en.opensuse.org/SDB:HUAWEI_E220_Support " Accessed on 24-12-2009 )

අනතුරුව huawei.tar.bz2 හි අඩංගු ගොනු පිහිටුවීම සදහා terminal එක මත පහත දැක්වෙන විධාන සටහන් කරන්න.

tar -xjvf huawei.tar.bz2
cd huawei
su
[password] ( [password] = ඔබ ෙග් root සදහා වන මුර පදය )
make install_suse

අනතුරුව ඩොංගලය USB port එකට සම්බන්ධ කල විට පරිගණකය මගින් /dev/ttyUSB0 එය හදුනා ගනී.

ඉන් පසු /etc හි අැති wvdial-huawei.conf ගොනුව edit කල යුතුය. /etc/wvdial-huawei.conf
එයට ඔබ කැමති text editor එකක් භාවිත කල හැක.

එහි Modem , Phone , username , password යන ස්ථාන වලට අදාල වෙනස්කම් සිදු කරන්න.

[Dialer Defaults]
Modem = /dev/ttyUSB0
Phone = *99#
username =
password =

අනතුරුව wvdial-huawei.conf සුරක්ෂිත කරන්න.

අනතුරුව wvdial විධානය භාවිතා කර අන්තර්ජාලයට සම්බන්ධ වන්න.

Source : " http://en.opensuse.org/SDB:HUAWEI_E220_Support " Accessed on 24-12-2009 "

Monday, December 14, 2009

Php තුළදී variable භාවිතා කිරීම.

,Php තුළදී variable භාවිතා කිරීම.




සමහර අවස්ථා වලදී අපට web page එකක් තුලදී එකම අගයන්/වදන් නැවත නැවත භාවිතා කිරීමට සිදුවේ. එහෙත් එලෙස page එක තුල පවතින යම් අගයක්/වදනක් වෙනස් කිරීමට අවශ්ය වුවොත් එම අගය/වදන යොදා ඇති සෑම ස්ථානයකම එම අගය/වදන සොයා බලමින් වෙනස් කිරීමට අවශ්ය වේ. එය පහසු කටයුත්තක් නොවේ. නමුත් එම අගය/වදන මුලින් එක් වරක් හදුන්වාදී එනම් වෙනත් අගයක‌ට ( වේරියබල් එකකට ) සමාන කර එම වේරියබල් එක පිටුව පුරා යොදා තිබුණි නම් සෑම තැනක්ම සොයා බැලීමකින් තොරව එම අගය/වදන වේරියබල් එකට සමාන කළ ස්ථානයේ අගය පමණක් වෙනස් කිරීමෙන් එම අගය යොදා ඇති සෑම තැනක් ම පහසුවෙන් වෙනස් කළ හැක.


php තුල වේරියබල් case sensitive වේ. එමෙන්ම සෑම වේරියබල් එකක්ම ඩොලර් සලකුණෙන් ( $ ) ආරම්භ විය යුතුය.
එමෙන්ම ඩොලර් සලකුණෙන් ( $ ) පසුව underscore සලකුණ ( _ ) හා/හෝ ඕනෑම ASCII අකුරක් යොදා ගත හැක. එකම වේරියබල් එක දෙවරක් හදුන්වා දිය නොහැක. එහෙත් ඩොලර් සලකුණත් ( $ ) සමගම එනම් ඩොලර් සලකුණට ( $ ) අාසන්නයේ ඉලක්කමක් භාවිතා කළ නොහැක.


$this යන වේරියබල් එක php තුලදී අපට අභිමත පරිදි භාවිතා කළ නාෙහැක.




Variable සදහා උදාහරණ



$var = 'Bob';
$Var = 'Joe';
echo "$var, $Var"; // outputs "Bob, Joe"


$4site = 'not yet'; // invalid; starts with a number
$_4site = 'not yet'; // valid; starts with an underscore
$täyte = 'mansikka'; // valid; 'ä' is (Extended) ASCII 228.


?>



එමෙන්ම අපට php තුළදී reference ලෙස ද variables භාවිතා කළ හැක. මෙහිදී refer වන variable එකට පෙර ampersand ( & ) සලකුණ භාවිතා කළ යුතුය.


උදාහරණ

$foo = 25;
$bar = &$foo; // This is a valid assignment.
$bar = &(24 * 7); // Invalid; references an unnamed expression.


function test()
{
return 25;
}


$bar = &test(); // Invalid.


?>



Php තුළ භාවිත කිරීමට නිශ්චිත කාර්යයක් සදහාා වෙන් කරන ලද වේරියබල් ( predefined variables ) සමහරක් ද අැත. මේ වේරියබල් සමහරක් භාවිතා කරන සර්වරය ( server ) මත රදා පවතී. නමුත් බොහොමයක් වේරියබල් Apache server මත ක්රියා කරයි.




Variable scope ( වේරියබල් එකක් අදාල වන කලාපය. )


php තුලදී වේරියබල් එකක් හදුන්වා දුන් විට එය භාවිතා කිරීමේදී එම වේරියබල් එක‌ට අදාල කලාපය තුල පමණක් එම වේරියබල් එක ක්රියාත්මක වේ.


php තුලදී වේරියබල් එකක් හදුන්වා දුන් විට එය භාවිතා කිරීමේදී එම වේරියබල් එක‌ට අදාල කලාපය තුල පමණක් එම වේරියබල් එක ක්රියාත්මක වේ. එනම් හදුන්වා දුන් කලාපයට (අදාල කලාපයට) පිටින් කිසියම් වේරියබල් එකක් භාවිතා කල නොහැක.




$a = 1;
?>

මෙහිදී php ආරම්භක හා අවසන් කරන tags දෙක අතර පවතින සියල්ලම එකම කලාපයට අයත් වේ.






$a = 1;

include 'b.inc';
?>

මෙහිදී $a වේරියබල් එක b.inc file එක තුලදී භාවිතා කල හැක.


function එකක් තුලදී සාමාන්යයෙන් global scope එකට අදාල වේරියබල් භාවිතා කල නොහැක.

$a = 1; /* global scope */
function test()
{
echo $a; /* reference to local scope variable */
}
test();
?>

එෙලස කිරීමට අවශ්ය නම් function එක තුලදී global යන keyword එක භාවිතා කල හැක.


$a = 1;

$b = 2;

function Sum()

{

global $a, $b;

$b = $a + $b;

}

Sum();

echo $b;
?>

$GLOBALS යන predefined variable එක භාවිතා කිරීම මගින් ද global scope එකට අදාල variables භාවිතා කල හැක.


$a = 1;

$b = 2;

function Sum()

{

$GLOBALS['b'] = $GLOBALS['a'] + $GLOBALS['b'];

}

Sum();

echo $b;
?>



Static variables පසුවට …










Web page එකකට php අැතුලත් කිරීම.


Web page එකකට php අැතුලත් කිරීම.


Php වලින් ලියන codings , php tag අැතුලත සදහන් විය යුතුය.
එනම් ලෙස අාරම්භ වී ?> ලෙස අවසන් විය යුතුය.
echo 'While this is going to be parsed.'; ?>


තවත් අාකාර කීපයක්.
Eg:
echo 'if you want to serve XHTML or XML documents, do it like this'; ?>


echo 'this is the simplest, an SGML processing instruction'; ?> This is a shortcut for "echo expression ?>"

<% echo 'You may optionally use ASP-style tags'; %> <%= $variable; # This is a shortcut for "<% echo . . ." %>


සෑම php statement එකක් ම semicolon ( ; ) එකකින් අවසන් විය යුතුය.
echo 'This is a test';?>


comments දැමීම.
එක පේලියකට පමණක් අදාල comment සදහා forward slash 2 ( // ) ක් හෝ # ක් යොදා ගනී.
forward slash 2 ට පසු එම පේලියේ අවසානය දක්වා පවතින ඕනෑම වදනක් page එක render වන විට නොසලකා හරී.


පේලි කීපයකට අදාල comment සදහා ආරම්භයේදී /* ද අවසානේදී */ ද යොදා ගනී.
/* හා */ අතර පවතින ඕනෑම වදනක් page එක render වන විට නොසලකා හරී.
le:
echo 'This'; // This is a one-line c++ style comment


/* This is a multi line comment yet another line of comment */


echo 'This is yet another test';
echo 'One Final Test'; # This is a one-line shell-style comment?>





php පලමු පිටුව.


මෙහි table එක තුල දක්නට ලැබෙන codings , text editor එකක Type කර hello.php ලෙස web server root එකෙහි root folder එක තුල( www folder ) save කර ගන්න. මෙහිදී “save as” type එක "All files” ලෙස විය යුතුය.




PHP Test


echo 'Hello World
'
; ?>

(); ?>





අනතුරුව web server එක ක්රියාත්මක කර web browser එකෙහි http://localhost/hello.php හෝ http://127.0.0.1/hello.php ලෙස type කර Enter බොත්තම ඔබන්න.


ලැබෙන web page එකෙහි Hello world ලෙසත් ස්ථාපිත php version එක අාදී විස්තරත් පෙන්වයි.




echo” යන වදන php තුලදී භාවිතා කරනු ලබන්නේ අපට අවශ්ය යමක් web page එක තුල print කර ගැනීමටය. Print කිරීමට අවශ්ය වදන/ වදන් single quote 2 ක් ( ' ' ) අතර type කර semicolon ( ; ) එකකින් අවසන් කරයි.


Translated from the “php_manual_en.tar.gz” which is available at http://www.php.net

PHP Manual

by: Mehdi Achour , Friedhelm Betz , Antony Dovgal , Nuno Lopes , Hannes Magnusson , Georg Richter , Damien Seguy , Jakub Vrana
2009-12-04
Edited By: Philip Olson
© 1997-2009 the PHP Documentation Group ( http://www.php.net )






Tuesday, November 17, 2009

You and I ( Finding t.A.T.u. )

The story follows friendless American teenager Janie Sawyer who is trying to escape her lonely life in Moscow through her love of music. Janie meets Lana Starkova on a fansite for the pop-band t.A.T.u. Trapped in a provincial Russian town, Lana is desperate to flee her mundane life and the two girls develop an instant connection. The two girls adapt a poem by Lana into a song, and post it on YouTube. t.A.T.u.'s manager catches news of the song, and contacts the girls in hopes they will allow t.A.T.u. to record the song. Janie and Lana's relationship then becomes the catalyst for a series of adventures.



t.A.T.u. has stated the movie will be very scandalous, and would not deal with the "love and roses" often found in films, but the real scandal and hardships that come along with relationships.