Wednesday, July 30, 2008

Bug: Zend Framework 1.5.1-1.5.3 Zend_Rest_Client

When contacting the Rest Server via the Zend_Rest_Client's get() method, you will get errors when passing a string argument that's roughly 500+ characters long.

The code:
$client = new Zend_Rest_Client($restServer);
// $arg1 has 1000 length
$result = $client->MyMethod($arg1, $arg2)->get();

would yield:
string '

Invalid Method Call to MyMethod. Requires 2, 1 given.

failed
'
(length=242)

You can get the data sent back from contacting the rest server by dumping the variable $data before line 43 in Zend/Rest/Client/Result.php (ZF 1.5.3):
var_dump($data);

Fix:
Use the method post() instead of get().


Sunday, July 27, 2008

Virtualbox: Mounting Shared Directories in Guest Linux from Windows Host

In Virtualbox:
1. Start the linux guest, click on the Devices menu 'Install Guest Additions...,'
2. this would mount a media drive in linux, run this as root:

root# ./media/cdrom0/VBoxLinuxAdditions.run

3. Reboot linux.
4. From the Devices menu, choose 'Shared Folders...,' and add any folder or drive, make sure that the 'Make Permanent' checkbox is ticked.
e.g. Add 'C:\' with the name 'C_DRIVE'
5. (unsure) Run: (nothing should happen after this)

root# modprobe vboxvfs

6. Create the directory to mount the shared folder on:

root# mkdir /mnt/c

7. Run:

root# mount.vboxsf C_DRIVE /mnt/c

8. To mount this every time linux boots, edit the file /etc/rc.local and put the following line at the start:

mount.vboxsf C_DRIVE /mnt/c

Sources:
http://forums.virtualbox.org/viewtopic.php?t=5851&postdays=0&postorder=asc&start=15

Internetworking a Vista Host with a Linux Guest in a Virtualbox

By default, in virtualbox, the guest virtual machine could connect to the host. You need to configure virtualbox and windows in order for the host to connect to the guest.

in Virtualbox:
1. Go to the network settings of the linux virtual machine,
2. there should be an existing adapter - adapter 0: NAT; create another one,
3. add a new Host Interface by clicking the 'plus' icon near the list,
4. In the 'Attached to' setting, select 'Host Interface,'
5. select the created interface in the 'Interface Name' setting.
Don't start the virtual machine yet.

in Windows:
1. Go to the Network Connections in the Control Panel,
2. the created host interface (in step 3 above) should appear here, check its settings,
3. assign it these values:
IP = 10.0.0.1
Mask = 255.255.255.0
Gateway = 10.0.0.1

in Virtualbox:
1. Turn on the linux virtual machine,
2. use the created host interface as the network adapter,
3. check the network settings, and assign it to have a static IP with these values:
IP = 10.0.0.2
Mask = 255.255.255.0
Gateway = 10.0.0.1

Sources:
http://bits2share.netsons.org/2008/05/31/virtualbox-connect-to-guest-system-from-host-system/
http://www.virtualbox.org/wiki/User_HOWTOS

Fix for bug imagick.so in libWand.so.9 in PHP5 in Ubuntu 8.04 (Hardy Heron)

After installing Apache2, PHP5 and the php5-imagemagick packages, I got an error in PHP when starting Apache2.

in /var/log/apache2/error.log:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/imagick.so' - libWand.so.9: cannot open shared object file: No such file or directory in Unknown on line 0.

According to some sources in the net, this is an old bug which can be fixed by installing the package libmagick9-dev (even though I currently have libmagick10 installed already)

Sunday, July 13, 2008

List of Windows Operating System Version Numbers

Version Platform ID Major Version Minor Version
Win 95 1 4 0
Win 98 1 4 10
Win ME 1 4 90
Win NT 3.51 2 3 51
Win NT 4.0 2 4 0
Win 2000 2 5 0
Win XP 2 5 1
Win 2003 2 5 2

Win Vista 2 6 0

Win CE 3 ? ?


Sources:
http://support.microsoft.com/kb/189249
http://www.go4expert.com/forums/showthread.php?t=1472
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q158238&id=158238&SD=MSKB

Wednesday, July 02, 2008

Add A Virtual Host in Apache in Vista

1. Open C:/Program Files/Apache Group/Apache/conf/httpd.conf2. Add the following lines:


DocumentRoot "C:/Path/To/Directory"
ServerName MyServer
DirectoryIndex index.php

Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
AddType text/html .php
AddHandler application/x-httpd-php .php



3. Open the file C:\Windows\System32\drivers\etc\hosts (this is a text file with no extension).
4. Add the following lines at the bottom:

127.0.0.1 MyServer
5. Restart Apache.