Tuesday, August 18, 2009

XAMPP PHP INI modifying

The only PHP.ini file that really matters is the one found in /apache/bin/php.ini.

Sunday, August 16, 2009

Pipe Problems

Gbeacon server has SQL Server Configuration Manager
http://blogs.msdn.com/sql_protocols/archive/2006/03/23/558651.aspx

Saturday, July 11, 2009

Remove Non Empty Directory

We cannot use rmdir as per traditional methods, we need to use RM with the option -rf

rm -rf /htdocs/www/dirname

Thursday, July 9, 2009

Setting up two linksys router to expand range

By default, most of the linksys router do not support repeater/bridging. But luckily the folks at DD-WRT created a router firmware so that we can use our traditional router as a repeater so that we can expand the range of our networks.

You can obtain the .bin firmware from:
http://www.dd-wrt.com/

I got into the directory v24-sp1. From which select your router. Mine is linksys and version of your router can normally be obtained from the label on your router. In which case mine is 1.1, before you proceed further, do check the 'supported hardware' page to ensure that you can actually flash your firmware of your router. If your hardware is not supported then you should not attempt to even flash it.

Get a RJ45/Ethernet cable, armed with the Firmware and you are good to go.

FIRST PART
------------------------------------------------------------------
On the end of the second router (this is not the REPEATER)
1. Plug your RJ45 cable from your computer (with the firmware) to the router
2. Login http://192.168.1.1/ with username: linksys and password admin (if your router is linksys)
3. If you can't login, that means you forgot your password and username then you can always hard reset your router by holding and pressing the small button behind your router to reset it.
4. Inside the page after you login, click on firmware. And update the firmware by locating the .bin file you downloaded earlier.
5. Make sure you do this via a cable and not through WIFI so that the probability of failure is greatly reduced. Afterwhich if you see "successful". Congratulations, you are done with the first part of installing the firmware.

SECOND PART (on your computer which is connect to the REPEATER via RJ45)
--------------------------------------------------------------------
1. Login to the repeater (the router with the new firmware)
2. The login should now be: username: root, password: admin
3. Leave DHCP Server settings to be 'on' and modify the TCP settings to become 10.0.0.1 instead of 192.168.1.1 ( this is to avoid conflict with the main router)
4. You should then not be able to connect to your page via 192.168.1.1 anymore. Modify the TCP/IP Settings for your computer. Set the TCP/IP settings from automatic to become the following:
IP: 10.0.0.2
SUBNET: 255.255.255.0
GATEWAY: 10.0.0.1
5. Login again to http://10.0.0.1/
6. Disabel Sp1 Firewall
7. Click on the status main Tab and search for the home network under the wireless tab and join the network
8. Inside the Wireless main tab -> basic settings, Add virtual interface
9. The SSID of this virtual interface should be different from your main SSID.
10. Wireless Security for both the virtual interface and the main interface (on your repeater) should be the same as your real router's. In my case, I set the Wireless security for both virtual/main interface to be WEP.

Now to test everything, take off all wires. Connect using Wireless from your laptop. Without any wires connecting to the repeater. You should be able to see the broadcast of your repeater's SSID. If you can see it but can't connect to the internet, try removing all security settings and work backwards from there, 99% of the time, its the security settings in conflict.

Aaron

Tuesday, June 9, 2009

Measuring Execution Time

DateTime startTime = DateTime.Now;
Console.WriteLine(startTime);

Wednesday, June 3, 2009

CSS Visibility vs Display

There is a difference when you want to hide things using CSS. Setting Visibility = 'hidden' and Display = "none" may appear similar at first, but actually it is not. If we have multiple lines of items arranged vertically that we want to hide, it will be obvious that the div layer set with visibility:none will have a whitespace placeholder wherelse a div layer set with display:none will not have a whitespace placeholder.


function showhide(header, childid)
{
var myHeader = document.getElementById(header);
var myLayer = document.getElementById(childid);
if (myLayer.style.display == "none") {
myLayer.style.display = "block";
} else {
myLayer.style.display = "none";
}
}

Random Number in C#

int RandomNo(int min, int max){

Random random = new Random();

return random.Next(min, max);

}