Wednesday, December 21, 2011

Variable memory size


While doing complexity theory assignment of 'assignment problem',
I learn that a good program should use as less memory allocation as possible.


Following list is the range of numbers on these defined variables,


(1) unsigned char : 0 through 255
(2) unsigned short : 0 through 65 535
(3) unsigned int : 0 through 65 535
(4) unsigned long : 0 through 4 294 967 295


(1) signed char: -127 through 127
(2) signed short: -32 767 through 32 767
(3) signed int: -32 767 through 32 767
(4) signed long: -2 147 483 647 through 2 147 483 647


The list shows that unsigned char is the smallest size of variable can be assign to a number,
Meanwhile signed long variable is large size and consume most memory allocation for a number.

Friday, September 23, 2011

Setting runlevel in Novell SLES10SP2

Setting the default runlevel of OS to desktop interface or just the tradition bash command lines.
Desktop is = 5
Bash Command line = 3

Solution:
example,
server:~ # yast2 runlevel set runlevel=X

Sunday, July 17, 2011

Steps: Custom Install PHP 5 on Apache2 server on linux machine

1) Download, php-5.x.x.tar.gz
2) Unpack, -tar xzf php-5.x.x.tar.gz
3) Go to Unpack folder to configure, ./configure --prefix=(PHP5 PATH)/php --with-apxs2=(Apache2 PATH)/bin/axps
Tips: ./Configure -help to look for more options which turn on additional features on your own preference.

4)After configure is done, type:
  1. make
  2. make install

5) Edit httpd.conf,

  1. If cant find then add: Include (PATH)/php5.conf

6) Edit php5.conf,

  1. If cant find then add: AddType application/x-httpd-php .php
  2. Make sure this file had added the following:
    • AddHandler application/x-httpd-php .php
    • DirectoryIndex index.php

7) Make sure php.ini file exist in the correct folder, (PATH)/apache2/php.ini

  1. Search the file by typing: find / -name php.ini

8)Restart your Apache Server.

Additional Setups,
To enable Zip Extension, Edit php.ini,

  1. add the line: extension=zip.so
  2. find zip.so file and make sure the file is executable.
  3. To change zip.so executable, type: chmod +x zip.so **make sure you have root access.
  4. Restart Apache Server.

Thursday, July 14, 2011

Network Configuration after copy VMware Workstation Files (SLES 10)

First, open the VM files and load into the workstation.
Then set up your desired network connection on VM workstation on the settings.
In my case is bridged network.
After loaded into the Virtual Machine, check the network address: ifconfig
If no Ethernet was found (means no network connection),
OR
If you see eth'X' No configuration found for eth'X'
Nevertheless the interface will be shut down...

1) Remove all uncommented lines in: /etc/udev/rules.d/30-net_persistent_names.rules
2) goto.. Yast->Network Device->Network Card->Traditional Method with ifup->Edit unconfigured network card to Automatic settings. 
3) Restart network, /etc/init.d/network restart


Done. The virtual machine should be able to connect to the internet now.
Test connection by 'ping google.com'