Fix ‘Unkown host’ Error on Mac

Have you ever had one of your websites become inaccessible on only one of your computers? The site loads up fine on every other machine you try it on but on this one machine, nada. If you try to ping the domain you’ll likely be presented with an ‘unknown host’ error.

If your computer is a Mac you will likely first think to try dscacheutil -flushcache . However, this will not work for you unless you are using an older version of OS X. Now what you’ll have to do is the following:

sudo killall -HUP mDNSResponder

In most cases this is what will work for you. I won’t bore you with a lengthy explanation of why. Just try it.

What Happened to File Paths in Lion’s Spotlight Results?

Spotlight in Lion

Being a nerd I love keyboard shortcuts. Because of this, when using a Mac I use Spotlight extensively. I use Spotlight as a calculator, for word definitions, and most frequently, to launch applications and find files.

One of the many changes in OS X Lion is a change in Spotlight is that it no longer displays the path to a file on your machine when you mouseover a search result. Previously I used this all the time when trying to locate files. How could Apple get ride of this extremely useful feature?

Well, they didn’t. It’s still available but is a bit more hidden. I’m not sure where this is documented or how we were supposed to figure it out but thanks to Richard Cardona and the CapMac Forums I learned how to get file paths again. Now I’ll share it with you.

  1. As before, enter your search query in Spotlight.
  2. Also as before, either use your arrow keys to move down to the appropriate search result or mouseover the search result
  3. When the new preview window pops up to the left of the Spotlight results, hold down the command key

At the bottom of the preview window the name of the file will initially be displayed. Keep holding down the command key and in a second or two the path of the file will be revealed! Now you know where that file is located on your system.

Lion Spotlight Search Results with File Path
While holding down the Command button

Changing Where PayPal IPN Emails Payment Notifications

PayPal IPN
PayPal IPN Email

If you use PayPal for receiving payments online you are likely using PayPal Instant Payment Notification (IPN) as well. This is very useful as it results in an email being sent to the email address you specify whenever a payment is received via PayPal.

However, the email address that you receive these payment notifications at is not necessarily the email address you have configured within your PayPal account for receiving notifications. To set or change the email address to which these IPNs are sent you need to modify the code in the file you point to in the hidden ‘notify_url’ that you set in the form you use for posting to PayPal.

e.g. if you’re using PHP  the field might look like:

<input type=”hidden” name=”notify_url” value=””>

In the above case, paypal_ipn.php is the file that gets called after payment has been made. Within this file is the code that send the actual notification email. To set the email address that will receive the payment notification you change the $from variable.

Note that if you want to change where the actual receipt from PayPal gets sent you need to change your primary business email address and then update this in the hidden ‘business’ field in the form you use to post to PayPal.

Apples to Apple: Fun and Interesting Infographic

Here’s a fun infographic comparing Apple, the company to apples, the fruit.

A few of my favorite points:

  • China produces 44% of the world’s apples and 100% of the world’s Apples
  • the average apple weighs about the same as an Apple iPhone 4s (5oz. versus 4.9oz.)
  • an iphone 4s is 33.6% glass

Thanks to MBA Online for putting this one together.

Apples to Apple: more similar than you might think
Apples to Apple: more similar than you might think

Installing node.js on Mac OSX

Node js

I recently installed node.js on a Mac running OSX 10.7.2 and these were the steps I followed at the command line.  Git and Xcode were already installed on the machine so this assumes they are already present.

  1. git clone git://
  2. cd node
  3. ./configure
  4. make
  5. sudo make install

You can test that node is installed by running a simple program such as:

var http = require('http');
http.createServer(function (request, response) {
  response.writeHead(200, {'Content-Type': 'text/plain'});
  response.end('Node.js has arrived.\n');
}).listen(1337, "");
console.log('Up and running at');

You can run this code by saving it as something like testing-node.js and then entering the command:

node testin-node.js

That’s it. Node.js is now up and running on port 1337 !

PS: stop the server with ctrl + c


How to Create a Custom Facebook Landing Page

Custom Facebook Landing Page

Update: Since Facebook launched it’s Timeline in 2012 this information is not really relevant. You can no longer create a page that users see by default.

Custom Facebook landing pages look much more professional than the default wall that everyone else has. Impress your visitors and fans with a custom one. It’s easy. Just follow these simple steps:

  • you need to be logged in to Facebook
  • in the main search box at the top type in ‘static html iframe’ (no quotes)
    • it will be the one with the star icon
  • click on the ‘Add Static HTML to a Page’ button
  • next, select the page you want to add the landing page to from the list
  • click the ‘Add Static HTML: iframe tabs’ button
  • A new item will appear on the far left list (the list with ‘Wall’ at the top)
  • the new item will be called ‘Welcome’ (you can change this later if you want)
    • click on this new item
  • enter html, javascript, css etc. into the text area shown
  • if you want something different displayed to people who have already liked the page, put that in the second text area
  • Facebook requires any images used here to be grabbed from a secure server
    • if you don’t have a secure server you can upload your images to Amazon S3
    • Amazon S3 has free tiers so unless your page is very busy you won’t have to pay
    • however,  you do have to give your credit card info when you sign up to use Amazon S3
  • you can preview your new page by clicking the ‘preview’ button near the top
  • once you are happy with the look of the new landing page you can set it to be the default tab displayed
    • go back to your ‘Wall’ page
    • click on ‘Edit Page’ in the top right
    • on the first page of settings (‘Manage Perminssions’) change the ‘Default Landing Tab’ to your new ‘Welcome’ tab
    • note that you won’t see this tab as the default landing tab while you are logged in as an administrator; you will have to check from a different Facebook account
  • if you want to change the name of your new tab to something other than ‘Welcome’ you can do so by clicking on ‘Apps’ in the list on the left
    • then click on ‘Edit Settings’ under the app in the list (‘Static HTML: iframe tabs’)
    • then enter ‘Custom Tab Name’ and click ‘Okay’
  • Done!