Ubuntu Live CD with Microsoft Virtual PC 2007

Finally, I found Microsoft Virtual PC 2007 (VPC) installation file from my DVD software collections I burned couple months ago. This idea article for talking about VPC has been interesting me apart since I already have some experiments with others virtualization program such as Virtual Box & QEMU emulation software, which both was containing with fixed installation OS. By not means to comparing them each other, but I just really like to learn more the difference between emulation & virtualization. And here now is my attempt to take Ubuntu Live CD with it. Why live CD? Well, the answer is so simple: it doesn’t need space & it act like interactive CD (no need to install - at least on the first sight).

Actually, you may see lists of OS’s tried with VPC at this link, but I’d like to test it by my own self on Acer Travelmate 6291 series particularly with live CD session which not listed on there. The Ubuntu Live CD version I used is 5.10 with code name Breezy Badger which I got for free after requesting it from shipit.ubuntu.com several years ago.



The main VPC console window is more simple & easy of use. Anyway, testing creation of virtual hard disk has take the same way with others virtualization & emulation software. No big deal with that. The major differences is placed on hardware devices setting window only.



As you can see the picture above, it’s always good news that Microsoft still presenting legacy port such as COM & LPT which you would not found yet from the last version of Virtual Box (1.3). The VPC 2007 also support up to 4 network adapters which supposed to be active after the virtualization run. By the way, in virtual hard disk setting, none of them I created for this experiment since I’d like to know what treat will VPC 2007 do with live CD.



A smooth Ubuntu boot logo displayed after I insert the CD & start to begin the virtualization process. Now I’d like to enter a custom boot parameter, an expert installation & attempted to disabled the frame buffer mode: (just want to try out)

boot: live-expert debian-installer/framebuffer=false


Anyway, all the hardware devices are fully succeeded detected & none of them are seems to be failed. Except the X window was garbled when Ubuntu tried to load it with default 24 bit mode automatically. After couple experiments, I tried to manually configure the auto detect video hardware.



Also, I tried to disabled the use of kernel frame buffer device interface.



At first, I doubt the monitor VSync & HSync auto detection capability, but I was wrong. Even I choose No to auto detection mode, but the laptop LCD’s setting looks already detected correctly.



My last suspect was the color depth setting. Anyway, I tried to downgrade it into 16 bit mode.



And here we go, the desktop are now appearing.



The laptop integrated Bluetooth communication link also great detected on it, but I didn’t test it for more to pairing with other device.



Though I still can’t configure out why the network adapter still can’t pinging the host Windows XP OS (with static IP address). Does it need to create TUN / TAP adapter just like Virtual Box did? I’m sorry, I’ve got time’s up for this & can’t find the answer yet. Maybe someone have it?

Labels:

  Post a Comment

How to Stealing Website Data?

This article purposed to explain more details about how to grab website data from PHP. Since it’s look a bit difficult to understand for PHP beginner to create a pattern recognition string with preg_match_all function, so I tried to re-made (from my previous article) a simplest sample script which able to “steal” the US dollar currency & current date from the website of Indonesia Monetary Ministry (Departemen Keuangan). Furthermore, you can process the data for other objectives such as create a daily line graph or something useful. As you may find million same topics from search engine talking about grabbing US currency or others similar data capturing technique, now I’d like to show you a simplest one – a dumbest way, I mean.

Here below is our main data source located at http://www.depkeu.go.id/Ind/Currency/ . There’s a table page containing foreign currencies data, but remember: our objective is capturing the US dollar & date only.



Let’s check current source from your browser & try to get an exact code referring to the US currency just like a similar code below:


<table cellpadding=0 cellspacing=0 border=0 width=500 align=center class=tabQuadTop>
<tr><th width=5% class=tabQuadBottom>#</th>
<th width=18% class=tabQuadBottom>Mata Uang</th>
<th class=tabQuadBottom>Negara</th>
<th width=18% class=tabQuadBottom>Rp</th>
<th width=13% class=tabQuadBottom>Dev (Rp)</th><th width=13% class=tabQuadBottom>Dev (%)</th></tr>
<tr class=BoardBody><td class=tabQuadBottom align=right>1</td>
<td class=tabQuadBottom>&nbsp;1 USD</td>
<td class=tabQuadBottom>Amerika Serikat</td>
<td class=tabQuadBottom align=right>9,069.20<img src=../../Images/Down.gif border=0></td>
<td class=tabQuadBottom align=right>-99.80</td>
<td class=tabQuadBottom align=right>-1.088</td></tr>


Look, there’s 2 datas to captured, first is 9,206.20 & the current date 03-03-2008. Got it? The date string data located after tanggal string. & the currency value located precisely after the td class=tabQuadBottom align=right code. Based on current pattern, we can create a formula code with preg_match_all function. See below code:

<?
$data = implode('', file("http://www.depkeu.go.id/Ind/Currency/"));

preg_match_all("/tanggal (.*)\./", $data, $hasil);
$tgl_update=$hasil[1][0];
$tgl_update=susunTgl($tgl_update);
echo $tgl_update."\n";

preg_match_all("/<td class=tabQuadBottom>Amerika Serikat<\/td><td class=tabQuadBottom align=right>(.*)<img src/", $data, $hasil);
$hrg_dolar=$hasil[1][0];
$hrg_dolar=substr($hrg_dolar,0,5);
$hrg_dolar=str_replace(',','',$hrg_dolar);
echo $hrg_dolar."\n";
?>


Next, save the code on your web server & execute it from browser (make sure that you have to connect to the internet first before executing the code). See that? The browser will display only the date & US currency from 2 variable $tgl_update & $hrg_dolar in MySQL format. Bundle it to your own database function & now you can save the result directly to MySQL. To set up it executed automatically every single day, you may add the code functionality with crontab function in Linux server using php –f <path_to_file> command parameter.

For other great result, you may also joining the current code with JavaScript to create a bar series showing the daily US currency just like picture below:



Now, for your own exercise, take a tour to http://www.pegadaian.co.id. Go there & grab the active date & daily gold currency (Kurs Harga Emas) located like the picture shown below:



Make a similar daily bar graph series & show it on your …uhmm… jewelry store online website ~ just in case if you have one ha ha ha…



Have a nice homework & show me what you got.

Labels:

  Post a Comment