Monday, May 31, 2010

How to edit the hosts file in Mac OS X – Leopard

How to edit the hosts file in Mac OS X – Leopard

Introduction
The hosts file is a text file that maps hostnames to IP addresses.
Upon typing a url address on the browser, the system is checking if there is a relevant entry on the hosts file and gets the corresponding IP address, else it resolves the IP via the active connection’s DNS servers.
The hosts file can be edited to block certain hostnames (like ad-serving/malicious hosts), or used for web development purposes, i.e. to redirect domains to local addresses.

Editing the hosts file
Editing the hosts file in Mac OS X – Leopard, is a pretty easy task, especially if you are familiar with the terminal.

Step 1 – Open the Terminal.app
Either by start typing Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal.

Step 2 – Open the hosts file
Open the hosts by typing on the Terminal that you have just opened:
1$ sudo nano /private/etc/hosts
Type your user password when prompted.

Step 3 – Edit the hosts file
The hosts file contains some comments (lines starting with the # symbol), as well as some default hostname mappings (e.g. 127.0.0.1 – localhost).
Simply append your new mappings underneath the default ones. Or edit one of the default values if you know what you are doing!
You can navigate the file using the arrow keys.

Step 4 – Save the hosts file
When done editing the hosts file, press control-o to save the file.
Press enter on the filename prompt, and control-x to exit the editor.

Step 5 – Flush the DNS cache
On Leopard you can issue a simple Terminal command to flush the DNS cache, and have your host file changes to take immediate effect:
1$ dscacheutil -flushcache
You can now test your new mapping on the browser!

How to Reset Windows Hosts File to Default

To reset the hosts file back to the default, follow these steps:
  1. Click Start, click Run, type %systemroot% \system32\drivers\etc, and then click OK.

    Note If you are using 64 bit version of Windows, type %systemroot% \SysWOW64\drivers\etc.
  2. Rename the hosts file to hosts.bak.
  3. Create the new default hosts file. To do this, follow these steps:

    1. Right-click an open space in the %WinDir%\system32\drivers\etc folder, point to New, click Text Document, type hosts, and then press ENTER.
    2. Click Yes to confirm that the file name extension will not be txt.
    3. Open the new created hosts file in a text editor, for example, in the Notepad.
    4. Copy the following text to the file:

      For Windows XP or Windows Server 2003

      # Copyright (c) 1993-1999 Microsoft Corp.
      #
      # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
      #
      # This file contains the mappings of IP addresses to host names. Each
      # entry should be kept on an individual line. The IP address should
      # be placed in the first column followed by the corresponding host name.
      # The IP address and the host name should be separated by at least one
      # space.
      #
      # Additionally, comments (such as these) may be inserted on individual
      # lines or following the machine name denoted by a '#' symbol.
      #
      # For example:
      #
      #      102.54.94.97     rhino.acme.com          # source server
      #       38.25.63.10     x.acme.com              # x client host
      
      127.0.0.1       localhost

Location of Hosts File in Different OS

Below are the location of the Hosts file found in various Operating Systems (OS):


Example for a Hosts File:


# Copyright (c) 1993-1999 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
# Permit this.
127.0.0.1       localhost                  # designate 127.0.0.1 as the local host leave this line as is.
# This is usually the End of the Default Host File. The rest is examples.
102.54.94.97     rhino.acme.com      # source server
 38.25.63.10     x.acme.com             # x client host
#This type of entries will Block specific sites.
127.0.0.1     ibm.com   # will resolve to Localhost, so No IBM.COM
#This type of entries will Block ads that come into a Banner from ads.acme.com.
127.0.0.1  ads.acme.com
# This type of entries give names to local Computers
# No need to type the IP the Main computer you can type Main into Address Bar.
192.168.0.1  Main 
# The computer with the Music Files will be called Music.
192.168.0.3 Music

Editing Hosts File in Windows 7

1)  The path to the Hosts file in Windows 7 is the same as usual:
%systemroot%\system32\drivers\etc\
where %systemroot% is usually c:\windows unless you installed Windows on a different partition. By default, you cannot see these hidden folders since they are system folders.
To show hidden folders in Windows 7, press the ALT key while in Explorer to bring up the File menu. Click on Tools and then Folder Options.


 
2)  Click on the View tab and then click on the Show hidden files, folders, and drives radio button under Hidden files and folders.


Now navigate to the directory above and open the hosts file and make your changes.



3)  Note that this method for editing the Hosts file will not work. You will get a message saying you do not have permission to save in this location.



In order to edit it, you have to click on Start, type in Notepad and then right-click on Notepad and choose Run as Administrator.




4)  Now navigate to the drivers/etc folder again and make sure to choose All files for File Types otherwise you won’t see the Hosts file.


Make your changes to the Hosts file and click File and Save to save all changes. Now you will not get the error about not being able to modify the Hosts file. Enjoy!

Saturday, May 29, 2010

Top Getaway Destinations in Asia - Bali Boutique Hotels with Spas

Bali is definitely one of those top holiday getaways for those looking for a relaxing short trip. A number of boutique hotels or village resorts also provide spa treatments.

Below are some of the pictures taken at Hotel Alila Manggis & Alila Ubud, Bali while we were having our honeymoon:
Hotel Alila Manggis, Bali

Monitor Lizard common in Singapore?

Spotted this monitor lizard while walking to the nearby food centre at Kallang Bahru with my colleagues some time back...wondering if there are a lot of them in Singapore
Monitor Lizard at Kallang

Tuesday, May 18, 2010

Why Cookie Monster doesn't need a Menu?

Found this cute display of Cookie Monster & Elmo at NYDC Cafe located at Bugis Junction some time back...
Why Cookie Monster doesn't need Menu?

Btw, why did Cookie M wore a T-shirt but Elmo didn't ?

Saturday, May 15, 2010

Singapore Top Hotels for Weekend Getaways

For those looking for good recommendations for top hotels in Singapore for weekend getaways, check out St Regis Singapore, Shangri-La Singapore & also not forgetting the famous Ritz Carlton.

Below are some pictures of St Regis & Remede Spa:

St Regis Bedroom

 St Regis Bathroom

St Regis Bathroom 2

Great for Wedding Anniversaries & Birthday Bashes:



Remede Spa @ St Regis:





Spa Garden at St Regis Singapore - The best home videos are here

Remede Spa

Tuesday, May 11, 2010

Hottest Babes Starred in Top Hollywood "Comic Movies"

Wanna know who are the hottest babes in town? Just check out Hollywood's top grossing "Comic" or "Super Heroes" movies.

It seems that only the hottest babes get to star in Hollywood's Super Heroes & Comic movies. 

I guess even if those movies went terribly wrong it would still be an eye-candy if some Hollywood hottie stars in it. Most of the time you probably can't match up to the standards of the Comic Junkies...

If comic fantasy can't be a reality, as you can fantasize after those movies...lol

1)   Jessica Alba as "Invisible Woman" in Fantastic Four: Rise of the Silver Surfer (2007)


 2)   Megan Fox as "Mikaela Banes" in Transformers 2 - Revenge of the Fallen (2009)

 3)   Scarlett Johnansson as "Natasha Romanoff aka Black Widow" in Iron Man 2 (2010) & probably in "The Avengers (2012)"



































4)   Charlize Theron as "Mary" in Hancock (2008)




5)   Milla Jovovich as "Alice" in Resident Evil (2002)



































6)   Gwyneth Paltrow as "Pepper Potts" in Iron Man 2 (2010)



































7)   Angelina Jolie as "Lara Croft" in Lara Croft: Tomb Raider (2001)

 8)   Catherine Zeta-Jones as "Elena de la Vega" in The Mask of Zorro aka "Z" (1998)



































9)    Kirsten Dunst as "Mary Jane Watson" in Spiderman 3 (2007)


 10)   Jennifer Connelly as "Betty Ross" in Hulk (2003)


 11) Kate Beckinsale as "Selene" in Underworld (2003)


 12) Natalie Portman as "Queen Amidala" in Star Wars: Episode I - The Phantom Menace (1999)


 13) Keira Knightley as "Elizabeth Swann" in Pirates of the Caribbean: The Curse of the Black Pearl (2003)

On a side note, I do notice some of the actresses do resembles one another (not sure if it's the make-up or their persona) :

1) Natalie Portman vs Keira Knightley vs Kate Beckinsale
2) Scarlett Johnansson vs Charlize Theron vs Megan Fox Vs Jessica Alba
3) Natalie Portman vs Jennifer Connelly (when she was younger)

Feel free to share your comments : )

Sunday, May 9, 2010

Iron Man 2 (2010) Poster reminds me of Rocketeer (1991)

The movie poster of Iron Man 2 somewhat reminds me of Rocketeer (1991) starring Bill Campbell & the lovely Jennifer Connelly.

























































































Jennifer Connelly who also starred in another Super Heroes movie Hunk. Many of us would have remembered her in "Beautiful Mind" (2001) as Alicia Nash the wife of John Nash. She was also won the Academy Award (Oscars) for Best Supporting Actress.

 
Web Analytics