Tuesday 25 December 2007

SOAP: PHP5 and nusoap.php

I've been learning today some SOAP (Service Oriented Architecture Protocol), the protocol for exchanging XML-based messages over computer networks, normally using HTTP.

Also, the simpliest way to make it work without spending hours reconfiguring PHP on your server, is to use nusoap.php. This set of classes is 100% written in PHP and work out of the box with PHP4, but not PHP5! Also, to make it work, you will have to edit the file nusoap.php by changing:

1. Do a search and replace of soapclient to soap_client in the entire document
2. Replace this code:

if (!extension_loaded('soap')) {
/**
* For backwards compatiblity, define soap_client unless the PHP SOAP extension is loaded.
*/
class soap_client extends nusoap_client {
}
}

By this code:

class soap_client extends nusoap_client {}

And now it's time to try your first SOAP script (from http://dietrich.ganx4.com/nusoap/faq.php including the update of the class):

Here is a simple "hello world" example. First create file "hello.php."
Put nusoap.php in the same directory, or in your include directory, or enter
the path to them in the require_once() calls below. Then paste the code below
into the file. That's it!

require_once('nusoap.php');
$server = new soap_server;
$server->register('hello');
function hello ($name)
{
return "Hello $name.";
}
$server->service($HTTP_RAW_POST_DATA);

Accessing the service via a NuSOAP client:

require_once('nusoap.php');
$soap_client = new soap_client('http://yourdomain.com/hello.php');
echo $soap_client->call('hello',array('name'=>'dietrich'));

Thursday 20 December 2007

Install Skype with the webcam support on the Asus EEE

The latest version of Skype for Linux enables the user to use the embedded webcam of the Asus EEE. First thing you will need to do is to install the new version of Skype on top of the original version pre-installed on the EEE.

1. In firefox, enter this URL http://www.skype.com/go/getskype-linux-beta-xandros. This will download the Xandros-specific .deb file. Save it to your My Documents folder.

2. Open a terminal window on type cd /home/user/My\ Documents

3. Type ls -l and look for a file which looks like skype-debian_2.0.0.xxx_i386.deb

4. Type the command sudo dpkg -i skype-debian_2.0.0.xxx_i386.deb with the name of the file find above

Now, when you click on the Skype icon, it will launch Skype version 2.0 Beta instead of 1.4. At this point, you will not be able to use the webcam yet. Indeed, you will have to enable manually the webcam everytime you restart your computer (the webcam is normally off to save battery).

This is a way enable the webcam at launch of Skype, and disabling it when closing it:

1. Open up terminal and type sudo su
2. Then type cd /usr/bin
3. mv skype skype-bin
4. kwrite skype
5. Enter the following text into editor and save, quit
#!/bin/sh
echo 1 > /proc/acpi/asus/camera
/usr/bin/skype-bin
echo 0 > /proc/acpi/asus/camera
6. Finally, type chmod +x skype

You did it !! Skype will automaticcaly switch on and off the webcam !!!

Tuesday 18 December 2007

Asus EEE - Change the font & size of GTK applications

If you have installed application like Skype, VLC or Filezilla on your EEE, you must have noticed that the size of the font was pretty big, and not very suitable for the screen of the EEE. Also, this is a little tutorial to explain how to change this:

1. Open a terminal window

2. Type this command to open the GTK preferences file and create one if you don't already have one:

kwrite /home/user/.gtkrc-2.0

3. Paste these lines in the kwrite window:
gtk-icon-sizes = "gtk-menu=8,8:
gtk-button=8,8:
gtk-small-toolbar=8,8:
gtk-large-toolbar=8,8:
gtk-dialog=8,8:
gtk-dnd=8,8"
gtk-toolbar-style = GTK_TOOLBAR_ICONS
gtk-font-name = "DejaVu Sans 8"


4. Save and close. Start an application like Skype, and voila !

Monday 17 December 2007

What is so great about the EEE ?

Well, how to answer this one... ;)

First, the EEE is an ultra light computer (900g) using an SSD (Solid State Drive) to store the OS and the user's data. The SSD is a very good choice as normal HD often suffer from rough transportation / manipulations on the move, resulting in damaging and loosing all data. The EEE comes in 3 versions, 2Gb, 4Gb and 8Gb.

The EEE is wireless (802.11 b/g) and some versions also have a webcam 1.3M pixels. All drivers are already set-up when booting for the first time, meaning that the user will not have to dig for hour before making anything work, which is pretty cool as it enlarges the audiance of user (from novice to expert)


The screen is small, 7 inches, and uses a resolution of 800x480 widescreen. The color and contrast are pretty good considering the size. At first, anyone, and me included, was thinking that the screen was too small. Let's be honest here, yes it's small, but very much usable ! On each side, you will see the speakers, which have a decent quality.

The keyboard is very small too, so big fingers "be aware". Again, at first, it takes a little bit of time to get used to the small size, but it's only a matter of hours.

There are 3 USB 2 ports, a VGA out, and a SDHD card reader to extend the store of the computer. The battery last 3h30 when using Wifi (at least in my case).

The OS used by default is Xandros with a very simple interface, giving the possibility to children to use it. For advance users (even the one without Linux knowledge), it's possible to enable the advance mode (see [URL="http://wiki.eeeuser.com"]wiki.eeeuser.com[/URL]). The OS looks like a normal Window interface, and is very easy to use and to customise.

The main idea behind the EEE is to have a very portable computer, not the kind replacing your every day computer, but the one you can bring with you all the time.

For example, I am a web developer and when I travel in holidays, I can get my 15.4'' laptop with me cause it weight 4Kg and I would be to annoyed it anything happens to it (if it get stolen, broken, damaged, flooded, ... eaten ?). This EEE is THE perfect computer is this case, cause it will allow me to check my emails, and in cause of emergency fix the problems (it's really easy to install an FTP client for instance).

Also, still using the holidays example, it'll be possible for me to empty my digital camera on my EEE / SD card and share directly the pictures with my friends / family or send them to my blog.

Finaly, this is for me a great platform to learn Linux and practice commands in an dev environment. So far, I managed to learn how to install and update softwares, install Apache, MySQL and PHP to have everything ready on the move.

Again, the EEE will not replace your everyday computer, but it will be it's best companion.

Installing Apache, MySQL and PHP on the ASUS EEE




Here is a little tutorial to install Apache, MySQL and PHP on your beloved ASUS EEE:

First thing, you have to add a new repository. To do so, you will have to press CTRL + ALT + T to open a terminal window and then type: sudo kwrite /etc/apt/sources.list

Then add this line: deb ftp://ftp.uk.debian.org/debian/ stable main contrib non-free

Save and close kwrite.

Then, write the following comment in the terminal to update the list: sudo apt-get update

First, we will install MySQL, like this Apache will see it and configure itself to use it during the installation: apt-get install mysql-server-5.0

Time to install Apache: apt-get install mysql-server-5.0

Now it's the turn of PHP5: apt-get install libapache2-mod-php5 php5-mysql

Once the installation is complete, make sure that Apache is running: apache2 -k restart

Time to test Apache, type the following URL in your internet browser: http://localhost/

If the page load it means that Apache is running properly on your EEE !!!

Finally, we are going to write our first PHP script and run it. Type the following comment to open a text editor: sudo kwrite /var/www/apache2-default/helloworld.php

Put the following code: <? php echo "Hello world"; ?>

Type in your internet browser the URL: http://127.0.0.1/apache2-default/helloworld.php

Voila ! Your computer is set to run MySQL and PHP on Apache !!!

Wednesday 12 December 2007

Asus EPC 8Gb

Last night, I couldn't be happier ! I went to Taoyuan to the computer shopping mall named Nova and I saw the Asus EPC 8Gb, the black version. The price was very attractive comparing to the 4Gb model, only 70 Euros extra, so a total of 300 Euros.

I will post soon some picture to show you this great computer 100% linux !

Friday 7 December 2007

Asus EEE - Mini Laptop

It's been a few weeks now that I am looking at the Asus EEE new laptop and I have to admit I love it !!! I've seen the white, black and pink version so far, I quite like the white and black one.



I am waiting for the release of the 8G version which will feature 8Gb of SSD (HD) and 1Gb of RAM.

Also, a lot of rumors saying that Asus is working on a new version / edition of the EEE which will include a larger screen, probably 10", and one of the latest Intel low power consumption processor to enable a longer use on a normal battery.

Looking at the war which already started in UK and soon in France with the telecom operators, it's pretty accurate to think that Asus will try to integrate a 3G module in the next version of the EEE.

Saturday 6 October 2007

Typhoon Krosa in Taiwan

Since last night, we experienced very strong winds with the arrival of a pawerful typhoon on the east coast of Taiwan. Today the wind continued blowing very fast over the island causing flooding, earth sliding and other related catastrophies. We also had a power cut of 8h and mini flooding of the flat as the wind pushed the rain through the frames of our windows.

Below, some pictures and a video showing the strength of the wind / rain:




Official news:

Typhoon Krosa slammed into Taiwan on Saturday, with strong winds and heavy rains cutting power and cancelling flights while mainland China braced for what it called a serious impact.

Authorities in China ordered the provinces of Zhejiang and Fujian to call more than 27,000 fishing boats back to safe harbours, Xinhua said.

In Taiwan, disaster authorities said the storm shut down schools and businesses in the north of the country.

"The wind is tremendous here, and we've lost power," said Chuang Min-hsiang, of Taitung. "We're all at home doing work to protect ourselves from the typhoon."

Three people were hurt, the National Fire Agency said.

The officials also mention that four persons lost their life during this typhoon, all my sincere sympathy goes to their relatives.

Thursday 6 September 2007

Rumbles... yes it's an earthquake !!!

Last night, I finally managed to sleep around 1.30am when in my dreams I felt like someone was moving my bed to wake my up. Then, I heard a rumble and I finally woke up: It was a large earthquake hitting us ! It lasted longer than a minute and its amplitude was high. This is a copy of the official report:

Taipei (dpa) - Three earthquakes measuring 6.6, 5.7 and 3.9 on the Richter scale respectively rocked Taiwan early Friday, causing small damages but there were no immediate reports of casualties.

The first quake, measuring 6.6, struck at 1:51 am Friday (1751 GMT Thursday) with its epicentre 74.6 kilometres from Ilan on Taiwan's northeastern coast and 27 kilometres under the sea, the Seismological Observation Centre said.

It was followed four minutes later by an 5.7-magnitude aftershock, in the same region.

At 3:32 am (1932 GMT Thursday), a tremor measuring 3.9 jolted Taitung in southeast Taiwan.

The quakes were felt all over the island, causing bottles and cups to tumble off shelves and window frames to rattle. Many residents living in high rises in Taipei ran onto the street, fearing their buildings might collapse.



Many earthquakes occur in Taiwan, as much as 200 earthquakes a year. A magnitude 7.1 quake struck Taiwan on Dec. 26, killing two people, cutting power and disrupting phone and Internet services throughout Asia. In 1999, a particularly large earthquake killed 2400 people and injured 10000.

Tuesday 4 September 2007

Downloading Warhawk

I just switch on my PS3 to install the Firmware version 1.92 when I discovered that Warhawk was available for purchase on the Playstation Network Store. I decided to buy this game for 1320NT$ (30€). This was the first time I purchase anything on the PN Store. The process is very simple, just click on 'Purchase', confirm the product and add money to your account using a credit card, as simple as buying anything on the internet.



Now, I am waiting to download the 798Mb to enjoy this game !!! The speed is very slow at night, so I might wait for tomorrow morning to download it at once...

Sunday 19 August 2007

Assembling my new rig

Installation of the Zalman 9700 NT on a Gigabyte P35-DQ6

This blog will summarise the assembling of my new PC. First, I had to work on installing the Zalman 9700 NT on the Gigabyte P35-DQ6 motherboard, keeping the Crazy Cool installed (back plate situated behind the CPU). To do so, I used a different braket, the Zalman ZM-CS1 clip support. Check the pictures for the installation:






































Time to install the video card: The Sparkle Calibre P880+ OC / 8800 GTX

This card really catched my attention because it looks great because of it's unique Perlier cooler, it's overclocked and it was supposed to run cooler than traditional 8800 GTX. Well, do not believe what is written on the sticker ! This card is very loud and running at 70 degres idle ! So what was the point to spend an extra 90€ on this card ? None !!! Therefore, I am not keeping it, I am returning it and will purchase the Leadtek Winfast 8800 GTX instead. Here for the picture of the final layout (before getting the new 8800 GTX):











Thursday 16 August 2007

Lian Li PC-A10

On wednesday, I received the Lian Li PC-A10 for my new computer. The package was well made and the case was very secured inside the box to garanty that the product won't be deteriorated during transportation.










The quality of the case is simply excellent, the aluminum feels really good and the colour make this case very classic. I particularly like the top openable area where sit 1 Firewire, 2 USB and the headphone and microphone jacks.










There is plenty of space in this case, particularly for a 8800 GTX !!! I like the fact that the case has been divided into sections, the bottom one for the hard drives (up to 5 in 2 hard drive enclosure (3xHD horizontally and 2 HD vertically) mounted on rubber ring to avoi any vibrations, and the PSU compartment. It is even possible to add a 12 cm fan from the HD section to the PSU to increase the airflow.

I like the fact that all fans are mounted using rubber rings to stop vibrations. Unfortunatelly, the fans manufactured by Lian Li are noisy and need to me changed if you want to have a quiet computer.










When I opened the door of this case, I was amazed by the quality of the design and the finition of the manufacturer. It looks great and feels great ! The 5.25 to 3.5 enclosure will be very handy when I'll get a card reader (there is no way I put a floppy disk drive in my computer). I really like the door system, very quiet when opening / closing and stay in place because of the ball system on the top and bottom of the door. The front panel has a 12cm in-take fan, a power and a reset button. The door has holes on the side to let the air in for the in-take fan. Well designed !










I was very surprised that the case did not correspond to the case advertised on Lian Li website. Indeed, the 2 watercooling holes on the top of the case are not mounted via a set of screws, but simply cut and put in place via welding. Another surprise, the backplate of the PSU area should present 2 holes with a removable plat in case you wanted to install a second PSU. On my version, the removable plate is not removable and welded to the case.

As I need to get the rig installed to test all components, I will keep this case and probably contact Lian Li in a couple of weeks to ask why this case is like this. The funniest part is that the Quality Control was done on the 27/07/2007, less than 3 weeks ago...

Saturday 11 August 2007

It feels like xmas morning !!! More components..

Today I received the Xclio 650W power supply, 4x 1Gb of G.Skills 1066HK and the Sparkle Calibre 8800 GTX (P880+ Edition OC). I would like to thank Sparkle supplier in Taiwan that check with me by phone the model I ordered and for the gift set containing 2 Calibre pens, a crystal block with the Caliber logo and a rotation light socle to mount the crystal (cf last 2 pictures). Here are some nice pictures for you: