CDMA Internet Connection from Linux

How to create an internet connection using CDMA network from a phone cellular in Linux? This is a new topic for me after there was a Nokia DKU-5 connection cable passed me by just for few days ago (Many thanks to Wisnu for borrowing me the cables). Obviously, there was no problem at all to make the connection within it since the configuration just takes the same from the Windows setting. Of course that you will see a different interface over Linux with kppp dialer application. One advantage is that you don’t have bother with the driver software installation, because it should automatically assigned to the native driver provided by the kernel.

The phone cellular I used was a cheap Nokia 6015 CDMA. I bought it over a year & got paired it with Fren CDMA SIM card. The DKU-5 data cable came with the USB port connection (I’m not sure whether it is genuine or not). Currently, I tested it from Linux Fedora Core 4 with standard kernel 2.6.11 from my laptop.

When it plugged to the USB port, the data cable identified as Prolific PL-2303 USB of its own. You may see it by running the dmesg command on the terminal:

hub 1-0:1.0: over-current change on port 1
usb 1-1: new full speed USB device using uhci_hcd and address 2
drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic
usbcore: registered new driver usbserial_generic
usbcore: registered new driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0
drivers/usb/serial/usb-serial.c: USB Serial support registered for PL-2303
pl2303 1-1:1.0: PL-2303 converter detected
usb 1-1: PL-2303 converter now attached to ttyUSB0
usbcore: registered new driver pl2303
drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver v0.12


From the message information above, the converter are currently attached to ttyUSB0. If you want to know more on how it recognized, try to execute cat /proc/tty/driver/usbserial command:

usbserinfo:1.0 driver:v2.0
0: module:pl2303 name:"PL-2303" vendor:067b product:2303 num_ports:1 port:1 path:usb-0000:00:07.2-1


Or running cat /proc/bus/usb/devices command:

T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=067b ProdID=2303 Rev= 4.00
S: Manufacturer=Prolific Technology Inc.
S: Product=USB-Serial Controller C
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=pl2303
E: Ad=81(I) Atr=03(Int.) MxPS= 10 Ivl=1ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=83(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms


Or it just simply to open the KInfoCenter tool & watch the USB list tab to find out whether the cable has been recognized or not:



Now, continued the next step below to configure the connection. Execute the kppp application from start menu or terminal. Create new account with any kind of connection name (I used mobile8) & add #777 to the phone number lines.



Also, create a modem connection with any kind of modem name (I used nokia) & make a link to /dev/ttyUSB0 modem device on the drop down box.



If the modem is well confirmed, try it with modem query process. On my experiment, it would display Nokia 6016i at 4th line.



That’s all! Press the connect button to start the connection. After it had initialized, you can get start to enjoy the internet from the browser directly.

Labels:

  Post a Comment

How to Grabbing Data from Other Website?

Lot of PHP reguler expression samples are spread over the internet. This PHP standard function having great advantages e.g.: to grab data from other websites. On this current article, I’d like to share you about how to grabbing currency rates data from Departemen Keuangan website. The script was taken from my Web Design Competition result held by Dirjen Pajak Indonesia in the end of 2006.

The PHP reguler expression preg_match function usually used to perform a reguler expression match. It searches subject for a match to the regular expression given in pattern. See the formula syntax below:

int preg_match ( string pattern, string subject [, array matches [, int flags]])

If matches is provided, then it is filled with the results of search. $matches[0] will contain the text that matched the full pattern, $matches[1] will have the text that matched the first captured parenthesized sub pattern, and so on. preg_match() returns the number of times pattern matches. That will be either 0 times (no match) or 1 time because preg_match() will stop searching after the first match. preg_match_all() on the contrary will continue until it reaches the end of subject. preg_match() returns FALSE if an error occurred. For more detailed documentation, you may take a time to read the PHP Manual or go to http://www.php.net/docs.php to get the actual version.

To improving a better looks, the string grabber function are mixed with my custom vertical marquee script. Just watch it out my complete script below:

echo("<div id='marqueecontainer' onMouseover='copyspeed=pausespeed' onMouseout='copyspeed=marqueespeed'> <div id='vmarquee' style='position: absolute; width: 98%;'>");
$data = implode('', file("http://www.depkeu.go.id/Ind/Currency/"));
$data = str_replace("</tr>", "</tr>\n", $data);
$data = str_replace("tanggal\r\n", "tanggal", $data);
$data = str_replace("<img src=../../Images/Up.gif border=0>", "<img src=images/up.gif>", $data);
$data = str_replace("<img src=../../Images/Down.gif border=0>", "<img src=images/down.gif>", $data);
preg_match("|tanggal(.*)|i", $data, $hasil);
$update_terakhir = trim($hasil[1]);
preg_match_all("|<td class=tabQuadBottom*>(.*) (.*)</td>|", $data, $hasil);
echo "<font size='1' face='Verdana, Arial, Helvetica, sans-serif' color='#666666'><strong>Update terakhir:<br></strong><i>$update_terakhir</i></font><br>";
foreach($hasil[1] as $key => $matauang)
{
//echo("$matauang--");
$tmp_matauang = str_replace(" ", "", $matauang);
$tmp_matauang = str_replace("</td><td class=tabQuadBottom>", "#", $tmp_matauang);
$tmp_matauang = str_replace("</td><td class=tabQuadBottom align=right>", "#", $tmp_matauang);
$tmp_matauang = str_replace("</td><td class=tabQuadBottom", "", $tmp_matauang);
$tmp_matauang = str_replace("<img src=images/up.gif>", "#<img src=images/up.gif>", $tmp_matauang);
$tmp_matauang = str_replace("<img src=images/down.gif>", "#<img src=images/down.gif>", $tmp_matauang);
$info = explode("#",$tmp_matauang);
$images = $info[3];
$mata_uang = $info[0];
$kurs = $info[2];
echo("$images <font size='1' face='Verdana, Arial, Helvetica, sans-serif' color='#666666'>$mata_uang = Rp. $kurs<font><br>");
}
echo("</div></div>");

The sample script above consists of several important points. The first is about initialization of the custom vertical marquee. You have to define it by your own way. Next, look at the implode function, it’s value referred to the currency rate of the Departemen Keuangan website address. Several lines after the implode function are trying to manipulating string in order to appropriating the value data to the result variabel. The first preg_match syntax in the next line actually purposed to combined the date from the original sources. The preg_match_all syntax is the core script which required to parse the row data tables page & bundled it into the result variable. The last point is try to display the result variable as much as the data grabbed by looping function.


Go to this link to see my complete page sample. Hope that this article is much useful for you.

Labels:

  Post a Comment

450 Fresh PCs Inspecting


The task to inspecting total of 450 new Z*rex computers on it’s factory has been done. Me & the team consists of 10 man just already did it in 3 days. This all brand new PCs was ordered from the company I’ve been worked after having a selection criteria to choose much lower price with better performance & hardware specification (what an usual criteria!). Lot of certified PC vendors was submitted to join the beauty contest before. Some of them came with world trade name, such as HP, Acer, Dell & much more. At the end, the local PC Z*rex won the competition (again, with an annoyed thing!).

The OS agreement as listed on the official appointment was so simple. They only have to plugged in the Linux Fedora Core 4 appropriated to our condition in order to support our plan to moving from Windows. The thing is we have to check, test & finalized the agreed hardware specification & also the system configuration one by one PC… manually. Fiuh… better no to do that by your own finger!


To simplify the jobs, I created an automated batch bash shell based script to identify the hardware specification & the system configuration. This script are executed from the USB storage flash disk. So, the mounting process will also checking any of the front USB port damaged at the same time to the new computer. It is shown below:

#!/bin/bash
Common bash shell script initialization syntax

top
Check the amount of available physic RAM

echo swapon /dev/sda3 >> /etc/rc.local
Since the image developed by vendor are come with inactive swap (I wonder why?), so I try to activate it manually to the Linux startup files. The syntax above will automatically adding the swapon command to the end of the /etc/rc.local file.

swapon /dev/sda3
Try to activate the swap to test whether it’s linked & matched with the dedicated swap partition

cat /proc/swaps
Finally, check the available of active swap partition

lspci
Displaying the chipset detailed information

cat /proc/cpuinfo
Displaying the processor detailed information

df -hT
Displaying the rest partition available complete with the volume space & partition type

kppp
Execute the kppp interface to test the internal modem query process

umount /media/usbdisk
Unmount the UFD hardware safely

poweroff
Shutdown command

The dumb scripts above are really increasing about 5x faster then our manually checking time. Once the PC is quality control confirmed, it patched with a passed logo sticker & continued to packer staff.

Labels:

  Post a Comment

On Mobile Web Coding

Sometimes, you will face a condition when you have run out of coding times. For example, you are on mobile and there is no chance to turn on the laptop to finishing your web based project. In this situation, I only depend upon my PDA. Make sure that you have installed your favorite file manager, text editor & high capability of internet browser also full of battery on it.

My favorite file manager is Total Commander. It is a PDA version of Norton Commander which has high integrity with the text editor. For me, it is more powerful than a standard file manager. Editing the sources is as much easiest as you developing over the computer. Just select the file you want to edit & press the Notepad likes icon at the bottom of the display.



Now, you are working on the editor. Imagine that you have working on a notepad. So, there will be no code completion or something to automatically fix the source. All is depend on your self. Just make a save, undo, trial & error with the browser.



Internet browser is a high depending tool you ever need to display your work. The more capability browser to interpreting the script is the more functionality browser you have to install. Until now, I only used the Pocket Internet Plus (PIEPlus). It is an add-in service pack likes to increase the compatibility with the script ~ especially JavaScript. The PIEPlus equipped with the tab web display feature. So, there will be no problem to load more then one html files within it. It is also equipped with view source features. One thing for sure, you got to enable the debug feature of the browser to see that there might be an error over the current script. To enabling it, follow the instruction picture below.



Press the “plus” icon, continued to Tools menu & select the Options sub menu. On a PIE tab options, make a selection to Enable Script and show Script errors on drop down combo box. Press OK to confirm the changes.



The setting changes on the Options will require a restart of PIEPlus. So, close & reload the script from the file manager once after changing it. After enabling it, every script contain errors will show you the messages. This feature may helps you to tracking where is the line position containing the error syntax.



Perhaps, you will consider to carrying the manual book of the script (CHM or PDF e-book format) & let it copied to memory card. The PDF format needs Pocket PC version of Adobe Acrobat, while the CHM file needs a Pocket PC based CHM reader (eg: CHM eBook Reader ~ CEBR). I recommend you to install these applications before having mobile coding. Let this article would help you anyway.

Labels:

  Post a Comment

News from Surabaya

I'd been become an agent to represent the meeting scheduled in Surabaya held by Yayasan Dana Sosial Mandiri (YDSM) on May 5th yesterday at the Novotel. By now, the foundation is having a co-operation with the company where I’d been worked specifically in a funds channeling. The session was talked about the latest release of consolidation application which must be used on the branches to monitoring how much the funds are being channeled to the clients by each branches. At least, there are about tens of regional bank member from the foundation. Each of it are stayed on each of provinces spread from all over Indonesia.

Personally, the application is just fine for me. The interoperability of the program can accommodate each member as well. But they seem loosing for something critical points:

1. The system was developed as stand alone application with distributed data stored on each client. This situation make each members of the foundation are being secluded. They are just not only facing the installation per each computer which may have a long distant far away, but they also must create an interface to exporting the data needed from the internal application. The distributed system ~ as you might know ~ are having big problem when it changed the latest version released or the database structured. As lots of the branches, as much the problems the IT staffs must done the job. It is just a matter of time & money have to spend to make it synchronized all of the time.

2. The system also developed with non-multiplatform designed as well. It seems that the developer is not quite professional yet. They only create what it shows on they head. Not just thinking for a better future or the members system differences possibilities, they idea are great as dumb. On the forum, I was said about an alternative solution with the web based application development. It will eliminate the non-multiplatform and make the database centralized. With the centralized database, there will be no problem with the latest application version released or the changes with the database structured.

What I told to the forum becomes a new homework for the foundation to build a better application. After a long full day meeting, in the afternoon there was a time to having goodbye to each members invited. On this session, I’d meet other members & introduced each others. The picture below is one of image taken with my new friend from BPD West Kalimantan (Mr. Bahtiar). Thanks for the 3530 camera, sir



At last, me & my partner (Mr. Kamal from Syariah Division) also have a picture together beside the hotel luxurious.

  Post a Comment

Windows XP in a Stick

Recent days, there are so many Linux comes with live CDs. This is an alternative way for those who doesn’t want to install Linux on their hard drive. The live CD also become a problem solver when the system wont boot up or something happened with the system & you may rescue the files with CD. Beside the CDs, one of merely known Linux named DSL (Damn Small Linux) are comes with damn live USB! Note that this method required a computer which have ability to boot from USB devices.

By the chance, I heard something about Windows XP live in a USB flash disk. This is much interesting for me & would like to tried it. In a seconds, there was a secure link referred to the download page from Google. It size’s about 54MB & the link are here.

After it had completely downloaded, the packages are being extracted with WinRAR ~ since it is compressed with RAR format somehow. Finally, there are 7 files extracted from it. The first 2 files are the manual in Germany & Russian language. You might not found the English documentation because bartPE are seems developed by a Germany. First of all, we need to provide a USB stick with minimal size of 256MB. Then, make a fresh quick format with hpusbfw.exe tool includes in the packages. See the picture below.



After the format process done, reboot the system & make sure to activate the USB boot sequence from BIOS ~ while the USB disk are still plugged in. Let the computer booted from it & it will displayed a boot process in the monitor. The boot processes are taking much times depend upon the USB storage speed, so it would be great if you also preparing a coffee & a cigarette during waiting the desktop showing up.



The default desktop background is covered by dark bartPE pictures. In the left corner are showing up a “Go” button ~ representing a Start button in a real Windows. Have a click on it, it will raise a list of simple menu pointing to the default applications such as Windows Wordpad, the Calculator program, Paint image editor & a file manager called A43 replacing the Windows Explorer instead.



Note that this USB live also equipped with the fully functionality of command prompt. From the picture below, it’s DOS are actually come from a real Windows XP.



To view the detailed system information, take a tour to About menu. It will displayed a core simple information likes the system environment & other embedded programs.



Look at the picture below again, an About link from Paint programs shows you the exactly same as the About you might found in a real Windows. However, it is a Germany entirely. Doesn’t have to confused with it.



Although it has great advantages, eg: to rescue the system, it’s legality to use is being asked. This one link from several address pages are showing about the proprietary law legality. For me, it might be fine as long as the needed are still in a right condition. Have a nice mobility with it.

  Post a Comment

VirtualBox: Another Open Source Virtual Machine (Part III)

From the previous serious problem, I have to make a solution about how to bridging on Linux hosts over the VirtualBox, but I great successfully working on it. From the documentation available, the VirtualBox implemented Host Interface Networking with the Linux kernel's own TAP interfaces. Therefore, make sure that Linux kernel has support for TUN/TAP enabled. While the additional drivers are then not required, the TUN/TAP packages are not available on Fedora Core 4 setup CD’s. There are at least 3 packages are needed to enabled it.

tunctl utility
With TAP, the Linux kernel can simulate Ethernet interfaces that, instead of being attached to networking hardware, communicate with VirtualBox. The TAP interfaces therefore appear like physical network interfaces (e.g. eth0) on the system. To create a TAP devices, use the tunctl utility. For Fedora Core 4 release, have a download session on this link.

brctl utility
Bridging, then, is a feature provided by the Linux kernel and can be controlled with the brctl command from another utility package. This tiny packages released for Fedora Core 4 are available on this link.

libsysfs library
The libsysfs is a dependency library needed by the brctl utility. Again, for Fedora Core 4, the download link are available here.

There are two ways these interfaces can be created, define a static link or dynamically. A static link build a persistent TAP interfaces on the Linux host and make them available to VirtualBox. While a dynamically build TAP interfaces each time a VirtualBox starts, and destroyed when it stops. To simplify this, I let you know how to create a static link. For a moments, go provide those 3 packages above available & install it on your Linux system. Then perform the following steps as root:

1. As root, run tunctl to create a new TAP interface:
tunctl -t tap1 -u
where is the user who wants to run VirtualBox with the new bridge.

2. Create a new bridge, which we will call br0:
brctl addbr br0
3. Put your network adapter in promiscuous mode so that it will accept Ethernet frames for MAC addresses other than its own:
ifconfig eth0 0.0.0.0 promisc
You will lose network connectivity on eth0 at this point.

4. Add your network adapter to the bridge:
brctl addif br0 eth0
5. Transfer the network configuration of your ethernet adapter to the bridge (the following example assumes your network adapter is configured with DHCP):
dhclient br0
Your physical Ethernet adapter will now merely act as a transport medium for the bridge.
For configurations where the network adapter is configured statically, you need to setup br0 exactly as you would have set up eth0. At this point the host should have network connectivity
again.

6. Add the new TAP device to the bridge as well:
brctl addif br0 tap1
7. Activate the new TAP device:
ifconfig tap1 up
After this, you can now specify tap1 in the settings of your virtual machine, as if it were a real network adapter. Note that in order to use a static TAP interface, the VirtualBox process needs to have write access to /dev/net/tun. Either make sure the access bits allow access or add the user of the VirtualBox process to the group owning that device file.



Go get some pinging process to local Linux host or other else hosts & it will working good. By the way, if the existing network are configured with proxy & gateway, you may adding a router mechanism after succeded bridging the VirtualBox. This would done by "route add" command prompt at Windows, just like example below:
C:\WINDOWS\Desktop>route add 10.1.1.0 mask 255.255.255.0 10.1.7.225

C:\WINDOWS\Desktop>route print

Active Routes:

Network Address Netmask Gateway Address Interface Metric
10.1.1.0 255.255.255.0 10.1.7.225 10.1.7.225 1
10.1.7.0 255.255.255.0 10.1.7.225 10.1.7.225 1
10.1.7.225 255.255.255.255 127.0.0.1 127.0.0.1 1
10.255.255.255 255.255.255.255 10.1.7.225 10.1.7.225 1
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
224.0.0.0 224.0.0.0 10.1.7.225 10.1.7.225 1



The settings above are helping me to connect to the LAN & internet connectivity from the proxy or gateway. So on, there will be no problem with the Windows based native application required networking link but totally failed to run over the Windows emulator. Just like the problem I described earlier…



So, case is closed!

Labels:

  Post a Comment