Monday, February 16, 2009

MySQL 3.23.49 Installation

First you must download the zip file at

Extract the file into "C:\mysql\"

Goto command line and install the server as a service. In this example I am using "mysql" as my service.

Type the following into the command line:
C:\mysql\\bin\mysqld" --install mysql

SMTP Service Configuration on IIS

  1. Goto Start menu, click Control Panel.
  2. Double-click Add or Remove Programs.
  3. From the left pane, click Add/Remove Windows Components.
  4. From the Components list, click Application Server, and then click Details.
  5. From the Subcomponents of Application Server list, click Internet Information Services (IIS), and then click Details.
  6. From the Subcomponents of Internet Information Services (IIS) list, select the SMTP Service check box.
  7. Click OK.
  8. Click Next. You might be prompted for the Windows Server 2003 family CD or the network install path.
  9. Click Finish.
Note: When you install the SMTP service, a default SMTP server configuration is created with a message store inLocalDrive:\Inetpub\Mailroot. When setting up the SMTP service for the first time, you can configure global settings for a SMTP virtual server, as well as settings for individual components of the virtual server.

Restore Mysql Database

mysql - u user_name -p your_password database_name "<" file_name.sql

IIS Configuration using Control Panel

1. Goto Start menu, click Control Panel.
2. Double-click Add or Remove Programs.
3. Click Add/Remove Windows Components.
4. In the Components list box, click Application Server.
5. Click Details.
6. Click Internet Information Services Manager.
7. Click Details to view the list of IIS optional components. For a detailed description of IIS optional components, see "Optional Components" in this topic.
8. Select all optional components you wish to install.

IIS Configuration using Server Wizard

  1. Goto Start menu and click Manage Your Server.
  2. Under the Managing Your Server Roles, click Add or remove a role.
  3. Read the preliminary steps in the Configure Your Server Wizard and click Next.
  4. Under Server Role, click Application server (IIS, ASP.NET) and then click Next. By default, the wizard installs and enables IIS, COM+, and DTC.
  5. If you want to serve either of the optional technologies (FrontPage Server Extensions or ASP.NET), on the Application Server Options page, select the appropriate check boxes, and then click Next.
  6. Read the summary and click Next.
  7. Complete the wizard, and then click Finish.

Sunday, February 15, 2009

PHP 4.4.8 Installation on IIS 6.0

First you must download PHP from (or goto, unzip it anywhere you want (Desktop - recommended) and then open the folder where you unzipped the file and run the setup.

Backup php.ini, rename it into php.ini_old (or anything you want). It is a good practice if you always backup the original php.ini file.

Rename php.ini-recommended to php.ini and move it to C:\WINDOWS.
Move php4ts.dll to C:\WINDOWS\System32

GOTO Start » Administrative Tools » click Internet Information Services (IIS) Manager

Expand your local computer and select Web Service Extensions

Click Add a New Web service extension and type “PHP” on the text box and check Set extension status

Add the path to php4isapi.dll and click OK twice all the way

Expand Web Sites and Right Click on the Default Web Site and go to Properties

Click Home Directory tab and set Execute Permissions to Scripts and Executables

Click Configuration option and then Add

Set Executable path the path of php4isapi.dll and type “.php” on Extension textbox.

Click OK all the way

Restart Default Web Site:
  • Right click Default Web Site and select Start

  • Right click Default Web Site and select Start

Sunday, February 8, 2009

Shutdown PC using .bat file

Windows XP can be shut down from the (eventually DOS prompt) command line box.

This is the Shutdown.exe (located in %systemroot%\System32, usually C:\Windows\System32) syntax:
  • shutdown [-i|-l|-s|-r|-a] [-f] [-m \\computername] [-t xx] [-c "Text"] [-d[u][p]:xx:yy]
Valid Command line switches:
  • -a = Abort system shutdown in progress ONLY IF the -t xx timeout option was already set to ANY value other than 0. ALL switches except -l and -m are ignored during abort.
  • -c "Text" = Text comment (case insensitive) to be displayed in the Message area of the System Shutdown window. MUST be enclosed between quotes. Maximum allowed 127 ASCII characters.
  • -d [u][p]:xx:yy = Reason code for shutdown:
  • u = User code.
  • p = Planned shutdown code.
  • xx = Major reason code. Positive integer number less than 256.
  • yy = Minor reason code. Positive integer number less than 65536.
  • -s = Shut down the local computer.
  • -r = Shut down and restart (reboot) the local computer.
  • -f = Force running applications to close without warning.
  • -l = Log off the current user of the local computer (default action). Can NOT be used with the -m option unless the current user has Sysadmin rights, in which case the -m switch takes precedence.
  • -m \\computername = Remote/network computer name (most always case sensitive) to log off/restart/shut down. Current user MUST have Sysadmin rights to be allowed to use this switch!
  • -t xx = Set shutdown timer to timeout for xx seconds. IF NOT specified defaults to 20 seconds. Allowed values between 0 and 99 seconds. The -a switch is the ONLY one that CAN be used during the timeout period.
The dash (-) in front of these switches can be replaced by a forward slash (/).

Ok let's start creating a sample .bat file that shuts down your local computer in 3 seconds and displays a message "Shut down" ...
  1. Open notepad
  2. Copy and paste the code below
  3. shutdown -s -c "Shutting down!" -t 3
  4. Save as "shutdown.bat"
  5. Double click the .bat file created.
And it's done, amazingly you've created a .bat file to shut down your PC...
How would you like putting this file at the statup of someones computer? :)

Thursday, February 5, 2009

Email Server Configuration on a Virtual Machine

You can install the Email Server by using Add or Remove Windows Components or Manage Your Server. In this tutorial we will use the latter, because it’s the quickest way to get this up and running. Manage Your Server is a bit easier to use too, because it will prompt you for the domain you want to use during setup. That will not Add or Remove Windows Components do, and we have to do everything manually.
If it’s not open, start
Manage Your Server by clicking Start->Programs->Administrative Tools->Manage Your Server.
  • Click on Add or remove a role.
This will start the Configure Your Server Wizard. Read the text and make sure you have connected all the necessary cables and all the other things it says you should do before continuing.

  • Click Next
The wizard will now detect your network settings. This will take a while depending on how many network connections you have
We now come to the step where we add and remove roles for our server. We will add the Mail Server role. I also suggest that before you click Next, click Read about mail servers because this tutorial is not a complete reference.

  • Click Mail server (POP3, SMTP)
  • Click Next
You will now specify the type of authentication and type the email domain name. In this tutorial we will use Windows Authentication, and I will use a sample domain name, You should of course use your domain name.

  • Click Next
Next step is to confirm the options you have selected.
  • Click Next
The installation will start, and will also start the Windows Components Wizard. When you get prompted to insert your Windows Server 2003 CD-ROM into your CD-ROM drive, do so. If you didn’t get prompted to do that, you maybe already have it in the drive. Hopefully within some minutes you get this screen:

You can now see the log, click view the next steps for this role, or click Finish. Do whatever you feel you want to do before continuing.
  • Click Finish
You have now successfully installed the mail server, congratulations!
So, it is no fun with a mail server installed, if we can’t use it. And to use it, we have to configure it. This section will help you configure the mail server.
  • Click Start, then run, and type p3server.msc
This will open up the POP3 Service. This is where you configure and manage the POP3 part of the mail server.
  • Click on in the left pane
  • Click on Server Properties in the right pane
This brings up the Properties for our Mail Server.

As you can see, we have a lot of settings. We will use the standard setup in this tutorial, but I will explain every setting we can change in case you want to change something in the future.
Create a mailbox
The Setup Wizard created a domain to us, so we do not need to create this manually. If you did not use Manage Your Server to install, add the domain manually be clicking the server name in the left pane and then click New domain in the right pane. Remember to set the properties before you add the domain.
  • Click on your domain ( in my case) in the left pane.
  • Click Add Mailbox in the right pane.
This will open up the Add Mailbox window.

  • Write Nwph in Mailbox Name
  • Write nwph as password (of course this is not a password you should use in a production environment, it’s too short)
  • Click OK
A message will pop-up and tell you how to configure the email clients. Read this, and notice the difference when using SPA or not.

  • Click OK
What we just did was not only creating a mailbox named nwph, but we also created a user nwph. We will also create a mailbox for an existing user - andrew. To do that we simply perform the same steps, but we uncheck Create associated user for this mailbox. Remember that the mailbox name must be less then 21 characters (64 for Encrypted Password File and Active Directory). Periods are allowed to use, but not as the first or last character.
So, we have now two users. Are they equally? No, bob is a member of the POP3 Users group, which is denied to logon locally. Ariel is not member of this group, and can still logon locally and access her mailbox.
Actually, that’s it! It is this simple to configure the POP3 part. But it is not yet working as we want, we have to configure the SMTP part to be able to receive and send emails. Yes, I said receive emails. A common mistake is to think that the POP3 server receives the emails. But that is not true, all the POP3 is doing is ‘pop’ the emails out to the clients. It’s the SMTP server that is communicating with other SMTP servers and receives and sends emails.
  • Open Computer Management
  • Expand Services and Applications, expand Internet Information Service
  • Right click Default SMTP Virtual Server and click Properties
  • Click the Access tab
  • Click the Authentication button and make sure Anonymous Access and Integrated Windows Authentication is enabled.
  • Click the Relay button and make sure Allow all computers which successfully... is enabled and Only the list below is selected.
First of all, Authentication and Relay is not the same thing. We use the Authentication button to specify which authentications methods are allowed for users and other SMTP servers. So enabling Anonymous here is not a security issue, in fact, it’s required if we want our server to be able to receive emails from other servers on Internet (I doubt you want to tell all administrators of email servers on Internet how they should logon to yours). We also need Windows Authentication so the email clients can authenticate to the server and be able to relay (send emails).
As Relay Restrictions we selected Only the list below because we do not want to be used by spammers to send emails. But we never specified any computers. That is valid, because we wants our clients to always use the username and password to authenticate, no matter where they are.
If you want users to only be allowed to relay if they are on a private network, then you can uncheck Windows Authentication as allowed authentication method, and specify the IP range for your network in the Relay Restrictions window.
Is that all? Do we have a working email server now? Well, the answer is yes. But we still haven’t configured the email clients.
We will use Outlook Express (2007) as email client.
  • Start Outlook Express (any computer that is connected to the email server)
  • Click Tools and then Accounts
  • Click the New button and select Manually configure sever settings or additional server types
  • Choose Internet E-mail and click Next
A wizard starts. Use the following table to complete the wizard:
Your Name: Nwph
E-mail address: Nwph@ (
Account type: POP3
Incoming mail server: (VM name)
Outgoing mail server: (VM name)
Username: Nwph
Password: nwph
Configure SMTP
Click More Settings
Select the Outgoing Server and put check mark on My outgoing server (SMTP) requires authentication. This means that you are configuring the outgoing E-mail to be authenticated. Without this, you will receive an error message.
Click Test Account Settings to test if you have configured it right. If the test is not successful then you may have missed one of the steps…
Click Next and Finish
Of course we want our network as secure as possible, so we prefer to use SPA (Secure Password Authentication). This will, as stated before, send the user name and password from the client encrypted, instead of clear text.
  • Click Start, then Run
  • Type p3server.msc
  • In the right pane, right click your computer’s name and click Properties
  • Check the box Require Secure Password Authentication...
  • Click OK
  • You will be prompted to restart the Microsoft POP3 Service, click Yes
We must also change some settings for the email clients.
  • Start Outlook Express
  • Click Tools, click Accounts
  • Click the E-Mail tab, click the name of your email account, click Changes
  • Put check mark on Log on using Secure Password Authentication
· Click Next and Finish
Create a Port Forwarding Rule on your router
Remember that we have just installed a mail server on a VM so we have to make port redirection for the SMTP and POP3 because without this, you cannot receive and send E-mail outside the network. Now you have to set a port forwarding rule for port 110(POP3) and 25(SMTP) on your router to be redirected to the VM where you’ve installed the Mail Server.

Wednesday, January 28, 2009

Trixbox IP address configuration

To configure the IP address of the trixbox you can use the following vi (UNIX) commands...
  • netconfig - configure IP
  • ifconfig - view IP

Monday, January 26, 2009

PHP MySql connection

If you're developing a PHP web page and you wanna pull some data from your MySql database you can use this code...

$link = mysql_connect("$db_host","$db_user","$db_password");
if (!$link){
die("MySQLError". mysql_error());

$db_host - your host
$db_user - your MySql username
$db_password - your MySql password
$db_name - your MySql database name

Making Windows XP boot faster


1. Open notepad.exe, type "del c:\windows\prefetch\ntosboot-*.* /q" (without the quotes) & save as "ntosboot.bat" in c:\
2. From the Start menu, select "Run..." & type "gpedit.msc".
3. Double click "Windows Settings" under "Computer Configuration" and double click again on "Shutdown" in the right window.
4. In the new window, click "add", "Browse", locate your "ntosboot.bat" file & click "Open".
5. Click "OK", "Apply" & "OK" once again to exit.
6. From the Start menu, select "Run..." & type "devmgmt.msc".
7. Double click on "IDE ATA/ATAPI controllers"
8. Right click on "Primary IDE Channel" and select "Properties".
9. Select the "Advanced Settings" tab then on the device or 1 that doesn't have 'device type' greyed out select 'none' instead of 'autodetect' & click "OK".
10. Right click on "Secondary IDE channel", select "Properties" and repeat step 9.
11. Reboot your computer.

Creating hidden folder

Keep your folders hidden without settingt its attribute as hidden...
  1. Create a new folder somewhere on your hard drive
  2. When you name it hold down "Alt" and press "0160" this will create an invisible space so it will apper as if it has no name.
  3. Then right click in and select "Properties" select the tab "Customize" and select "Change icon" scroll along and you should see a few blank spaces click on any one and click ok when you have saved the settings, the folder will be invisible to hide all your personal files.

Unattended Windows XP/2003 setup

An unattended Windows XP/2003 install can install all your software and settings along with Windows, and without you having to click a button or press a key,completely automated. Learn how over here:

Make your unattended setup now!

Speedup menus in Windows XP

  1. Go to Start > Run > Regedt32
  2. Go to HKEY_CURRENT_USER\Control Panel\Desktop
  3. Locate the key called "MenuShowDelay" and it is probably set to 400.
  4. Change that value to 150.
  5. Reboot your computer.
  6. You should notice a slight increase in the speed of your menus

Show hidden files using DOS command

Simple and useful tip...
On the command prompt just type
dir /ah
if the list is too long u can use
dir /ah/p/w
hello there... can i ask?
do you know how to disable the window key and the ctrl+alt+delete keys using vb.Net?
can you teach me how....
i am friend of alex fernandez...
 i juz want to integrate it into my system...
i'll visit your blogsite na lang ....

Tuesday, January 20, 2009

Enabling NAT on asterisk (see using SSH client for Windows and Unix

NAT (network address translation) by definition is is the process of modifying network address information in datagram packet headers while in transit across a traffic routing device for the purpose of remapping a given address space into another.
The asterisk server doesn't have GUI so you need to use remote connection to configure it.


1. Remote asteisk via SSH Client (in this example we I used Putty).
2. Type the Host Name of IP address of asterisk and then connect through port 22.
3. In the console, enter the username and password provided by the administrator.
4. In the command line type cd /etc/asterisk
5. Next is edit the sip_nat.conf file using vi command (see for keys and commands) ex: vi sip_nat.conf
6. By default the sip_nat.conf file is empty, type the following scripts

7. Save the file and then exit.
8. After configuring the asterisk NAT you have to set redirection of port 5060 in your router.
9. Go to your router configuration and add redirection of port 5060 to the IP address of the trixbox (asterisk server).
10. After configuring the redirection, you can now register your softphone using the externalip defined in the configuration of asterisk NAT.
externalip is the domain where public connection can use to register for softphones (ex:Zoiper).
localnet is the IP range where private (inside your network) connection can use to register for softphones.