Add a lookup entry in local DNS

After you enter a web address, Windows OS will search a local DNS to find out corresponding IP address. If it could not find it there, it will go to DNS server to search for it. Old days people used to add those often visited addresses to a local DNS file to seep up the Internet surfing experience. Currently with hi peed Internet connection, the practice will not yield any noticeable difference. However, if you have a intranet and you want to go to internal address by calling its external address, that is the way to go.
To edit your local DNS lookup file, go to
C:WindowsSystem32Driversetc
Using a text editor like notepad to open the file hosts
Add an entry at the bottom with two information: the IP address and the customized domain name, separated by a single space.
192.168.1.5 wukenny.homeserver.com
192.168.1.5 www.wukenny.homeserver.com

This works in both windows xp and windows 7. In Win7 you might need to copy the file to another location get it edited and then pasted it back due to the stringent user control.

How to Retrieve HTTP content in .NET

HttpWebRequest and HttpWebResponse greatly simplified http content retrial process. Code snippet below demonstrated how easy to use.

using System;
using System.Text;
using System.Net;
using System.IO;
 
static void Main(string[] args)
{
    string webUrl = "http://www.google.com";
    WebRequest req = WebRequest.Create(webUrl);
    req.Timeout = 10000;
    WebResponse resp = req.GetResponse();
    StreamReader reader = new StreamReader(resp.GetResponseStream(), Encoding.ASCII);
    Console.WriteLine(reader.ReadToEnd());
    resp.Close(); // Close the response to free resources.
    reader.Close();
}

Simple and elegant. To look for more…Retrieving HTTP content in .NET

Install softwares on Linux using YUM

*Step # 1: Configure yum
Code:
/etc/yum.conf
[base]
name=Fedora Core $releasever - $basearch - Base
baseurl=http://apt.sw.be/fedora/$releasever/en/$basearch/dag
baseurl=http://mirrors.kernel.org/fedora/core/$releasever/$basearch/os

Save the file. Install GPG signature key with rpm command:
Code:
# rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
——————–
*Step # 2 Update your package list:
Code:
# yum check-update
===============
*Step # 3 start to use yum
Install a new package called foo
# yum install foo
===============
To update packages
# yum update
To update a single package called bar
# yum update bar
To remove a package called telnet
# yum remove telnet
To list all packages
# yum list installed
===============
You can search using grep command
# yum list installed | grep samba
Display information on a package called foo
===============
To display list of packages for which updates are available
# yum list updates
===============
clean all cahced packages:
# yum clean packages
To remove all cached packages and old headers:
# yum clean all
Force a fresh download of package
# yum clean headers
# yum clean oldheaders