Sunday, November 24, 2013

How To Build A Basic Web Crawler To Pull Information From A Website

Web Crawlers, sometimes called scrapers, automatically scan the Internet attempting to glean context and meaning of the content they find. The web wouldn’t function without them. Crawlers are the backbone of search engines which, combined with clever algorithms, work out the relevance of your page to a given keyword set.
The Google web crawler will enter your domain and scan every page of your website, extracting page titles, descriptions, keywords, and links  – then report back to Google HQ and add the information to their huge database.
Today, I’d like to teach you how to make your own basic crawler – not one that scans the whole Internet, though, but one that is able to extract all the links from a given webpage.

Generally, you should make sure you have permission before scraping random websites, as most people consider it to be a very grey legal area. Still, as I say, the web wouldn’t function without these kind of crawlers, so it’s important you understand how they work and how easy they are to make.
To make a simple crawler, we’ll be using the most common programming language of the internet – PHP. Don’t worry if you’ve never programmed in PHP – I’ll be taking you through each step and explaining what each part does. I am going to assume an absolute basic knowledge of HTML though, enough that you understand how a link or image is added to an HTML document.

Before we start, you will need a server to run PHP. You have a number of options here:

Getting Started

We’ll be using a helper class called Simple HTML DOM. Download this zip file, unzip it, and upload the simple_html_dom.php file contained within to your website first (in the same directory you’ll be running your programs from). It contains functions we will be using to traverse the elements of a webpage more easily. That zip file also contains today’s example code.
First, let’s write a simple program that will check if PHP is working or not. We’ll also import the helper file we’ll be using later. Make a new file in your web directory, and call it example1.php – the actual name isn’t important, but the .php ending is. Copy and paste this code into it:
<?php
include_once('simple_html_dom.php');
phpinfo();
?>
Access the file through your internet browser. If everything has gone right, you should see a big page of random debug and server information printed out like below – all from the little line of code! It’s not really what we’re after, but at least we know everything is working.
web crawler
The first and last lines simply tell the server we are going to be using PHP code. This is important because we can actually include standard HTML on the page too, and it will render just fine. The second line pulls in the Simple HTML DOM helper we will be using. The phpinfo(); line is the one that printed out all that debug info, but you can go ahead and delete that now. Notice that in PHP, any commands we have must be finished with a colon (;). The most common mistake of any PHP beginner is to forget that little bit of punctuation.
One typical task that Google performs is to pull all the links from a page and see which sites they are endorsing. Try the following code next, in a new file if you like.
<?php
include_once('simple_html_dom.php');
$target_url = “http://www.tokyobit.com/”;
$html = new simple_html_dom();
$html->load_file($target_url);
foreach($html->find(‘a’) as $link){
echo $link->href.”<br />”;
}
?>
You should get a page full of URLs! Wonderful. Most of them will be internal links, of course. In a real world situation, Google would ignore internal links and simply look at what other websites you're linking to, but that's outside the scope of this tutorial.
If you're running on your own server, go ahead and change the target_URL variable to your own webpage or any other website you'd like to examine.
That code was quite a jump from the last example, so let's go through in pseudo-code to make sure you understand what's going on.
Include once the simple HTML DOM helper file.
Set the target URL as http://www.tokyobit.com.
Create a new simple HTML DOM object to store the target page
Load our target URL into that object
For each link <a> that we find on the target page
- Print out the HREF attribute
That's it for today, but if you'd like a bit of challenge - try to modify to the second example so that instead of searching for links (<a> elements), it grabs images instead (<img>). Remember, the src attribute of an image specifies the URL for that image, not HREF.
Would you like learn more? Let me know in the comments if you're interested in reading a part 2 (complete with homework solution!), or even if you'd like a back-basics PHP tutorial - and I'll rustle one up next time for you. I warn you though - once you get started with programming in PHP, you'll start making plans to create the next Facebook, and all those latent desires for world domination will soon consume you. Programming is fun.

20+ tools for price watching and protecting

In the U.S., tax season is well upon us. And with the recession in full tilt, you may be--smartly--biding your time to make a purchase. Fear not though, there are tools aplenty to help you keep an eye on the price of something, and swoop in to get it when it goes on sale or the manufacturer offers a rebate.
We've put together a list of 22 different tools that let you do this with relative ease. Most only work on Amazon.com, but a few will keep an eye on the entirety of the Web to let you know about sales, price drops, and increases.
(Credit: Josh Lowensohn/CNET)
Amazon Price Watch (aka NukePrice.com)
Amazon Price Watch may sound like it's only Amazon.com prices, but it actually works with around 100 online retailers. You can have it watch the price of something by dropping its link into the service's Web form, or by installing a browser add-on that lets you start tracking from the retailer's site. Along with price-watching tools, it's also got a deals finder and a "filler items" tool that will help you find low-priced items to add to your Amazon order to get free shipping.
Apnoti
Apnoti watches Amazon for price drops. You can use it either by dropping in the Amazon product link and your e-mail address or installing a tool bar that adds the option to watch a price to Amazon.com. One of Apnoti's strengths is that it refreshes its price index "continuously" so you can be notified when a price drops usually within the hour.
BeatThat!
BeatThat is primarily a deals site that lets users add deals they've found in return for cash. However, each product on the site can be watched to see if it drops below whatever price threshold you set. Like PriceGrabber you must be a registered user of the site to make use of this feature.
Buy it Later
Buy it Later is a tool that's been designed specifically for Amazon.com. You install a small browser add-on, which will add a new button to Amazon product pages that lets you opt-in to buy it at a later date. Once you click this the tool will start tracking the price. It also gives you the heads up when an item comes back in stock, which can be useful if you're looking to buy something with a low supply.
CamelCamelCamel
While camel imagery does not bring price watching to mind, the site does a great job at it. You can search items on Amazon and a few other retailers. It's also got a great grid of products that have had the biggest price drops by day and week both in dollar amount and in percentage. One of the most important things the site does, however, is show you a price history from the past month both from Amazon and third-party retailers. This is a good way to see whether a price is trending up or down, although admittedly its charts can be thrown off by gray market listings.
EDealInfo
EDealInfo may not be the prettiest site of the bunch, but it's got a simple and powerful way to build a deal alert without too many specifics. For example, you can keep track of an entire genre of products for price drops, like all digital cameras from a certain retailer, or group of retailers. It's also registration-free.
FatWallet
FatWallet is mainly a deals forum site, but it also has a few tools that can harass the wisdom of the crowds to save you some cash. Firefox users can install the site's extension which will cross reference the deal to see if there are any coupons or special cash back offers. Consider this a good place to double check a deal you're tracking using one of the other sites on this list.
NetHaggler
NetHaggler is a service designed to let users band together to get a lower price from a retailer by buying a single product as a group. It also has a price tracking feature that lets you bookmark items you'd be interested in buying for a certain price. Its system will then send you an alert either if your product falls within the price you've set, or if it's been able to haggle down the price by bulk buying with other users.
Ookong
Ookong is another Amazon deal finder. It's currently for Firefox only, and requires you to install it to make use of its price-dropping prowess. Once it's on your machine you get a new button on all Amazon product pages that lets you track an item for any price drops. If the price goes down you get a little pop-up message in the bottom corner of your browser.
PriceDrop
PriceDrop is an extension that users install in their browser to be alerted when the price of a product from Amazon.com goes down. You can monitor all your alerts in one list, and it gives you a real-time pop-up in the corner of your screen when it's time to alert you. Considering the tool only checks for price changes once every 18 hours it may not be the fastest, most real-time option, but it's one of the simpler options that won't clog up your e-mail in-box.
PriceGrabber
PriceGrabber's claim to fame is that it does the comparison shopping for you, but it's also got a robust alert tool that will let you know when an item's price fluctuates. To add items you simply search for them through PriceGrabber's database. You can also add any item to this list from its special PriceGrabber product page. One thing to note is that you must be registered with PriceGrabber to use this tool, which many other services on this list don't require.
Price Pinx
Price Pinx, like most other services on this list, lets you drop in a URL to set up a price alert. However, most will find it useful for tracking public price drops. Once users begin tracking an item with the service Price Pinx makes it public, and puts some of the biggest sales on its front page, making it good for deal hunting.
Price Protectr
Price Protectr is a simple tracking service. You just drop in the URL from a retailer's product page then set whether you want it to give you alerts about price drops, or e-mail you if there's been a price drop. For retailers that have a price protection plan this might save you some cash. The service works with around 150 online retailers and has a special toolbar where users can begin to track an item from any of these sites.
Savvy Circle
Savvy Circle has one of the longest lists of support stores in this bunch. Just like all the others you just tell it the products you want to keep an eye on and it sends you an e-mail when it goes on sale. You'll need to register with the service to get alerts though.
Shop It To Me
Shop It To Me is the one service on this list that's dedicated specifically to clothes. Its sister site Shop It To Me Running also does specific shoe brands and sides. With both sites you give it your sizes and specific brands you like and it will give you the heads up when items in that size go on sale. This is one of the better ways to make sure you don't head off to some sale only to find everything is three sizes too big or small.
ShoppingNotes
ShoppingNotes is one of the simplest tools on this list. There's no sign-up, you just give the site the product page URL (or URLs as a group) and your e-mail address. It then sends you an e-mail if the price goes down. Besides its main site there's a bookmarklet you can add to your browser to begin watching a price from any site you're on.
Slickdeals
Slickdeals, like Fatwallet is mainly a deals forum. It also has a deal alert tool. Unlike some of the other tools though, it won't scour the entire Internet to find out when something goes on sale. Instead it will keep an eye on new forum threads and send you an e-mail or private message. Note that you must be registered with the site to use this feature.
Trackle
Trackle is one of the newest services on this list, having just launched in early February. It's an alerts service where you can have it keep a lookout for price drops, deals, and reviews on new products. It also has a special filter that can look for the same items on Craigslist in case you want to skip retail entirely.
Waitable
Waitable is a price watcher that works with both bar codes and Amazon.com product pages. You set the price and it will send you both an e-mail and an SMS alert when it hits that price. It's not the prettiest service of the bunch but it does a great job, and lets you manage your alerts on a single page and subscribe to alerts in an RSS feed if you don't feel like junking up your e-mail in-box or mobile phone.
WishRadar
WishRadar is designed specifically for Amazon.com. If you're a registered Amazon user, you can simply add items you find to your wish list. WishRadar then tracks those items and will let you know if there are price changes, or if the prices come down to what you've set.
Yotify
Yotify works much the same way Trackle does, by letting you set up an alert for a specific product, or genre of products. It then goes out and scouts the Web anywhere from one week to when you tell it you're no longer interested. Unlike some other tools Yotify doesn't offer a whole lot of refinement over which retailers you want to limit your search to, but if you're looking for the lowest price, this may not be important.
ZingSale
ZingSale is one of the prettiest sites on this list and, like the others, is set up to let you quickly put together a list of items you want to track for price drops. It's got a fast and smart search engine, with a very deep level of categorization, which can help narrow down your searches. And its e-mails lead directly to the retailer that's selling it at the lowest price.
We've certainly missed a few in putting together this list. Feel free to add your own favorites in the comments.

Wednesday, November 20, 2013

How to install OS X Mountain Lion in Virtualbox with Hackboot


We've already shown you how to use Virtualbox to install Mac OS X Snow Leopard and Mac OS X Lion on virtual machines in Windows, since it's great practice for installing Mac OS X on your actual computer. And now that OS X Mountain Lion 10.8 has been officially released, we can finally demonstrate how to do it with Mountain Lion too. 

LATEST UPDATE (January 27, 2013): Don't want to use Hackboot? Check out the simpler iAtkos method for installing Mountain Lion on Virtualbox instead.

In essence, this method will let you run Mac OS X from inside a program window in Windows. As always, we're going to use Virtualbox for this. It's important to note that Windows virtualization programs do not "officially" support Mac OS X, so you will not be able to enable full graphics support. This tutorial should only be taken as a proof of concept.



Computer Requirements
You need a computer with Windows to run Mac OS X on Windows (of course). The "System Type" of your copy of Windows needs to be 64-bit, because OS X Mountain Lion is a 64-bit operating system. If you have a 32-bit copy of Windows, you can only install Mac OS X Snow Leopard on Virtualbox. You will need at least 4 GB of RAM and a dual-core (two core) processor or better. Personally, the computer I was using for this had a 4-core processor and 12 GB RAM, which is way more than enough. You also need about 10 GB of unused hard drive space.

Right click on "My Computer" on your desktop and click "Properties" to check the stats on your computer. If it doesn't directly tell you how many cores your processor has, look up your processor model on Wikipedia or Google. You also want to find out whether your processor is made by "Intel" or "AMD". Computers with AMD processors will not work with Mountain Lion. 

General Requirements
  • Virtualbox : This virtualization suite is free, and though it doesn't offer official support for Mac OS X, it works well enough.

  • Mountain Lion bootable DVD : Unfortunately, the standard method for installing OS X Mountain Lion on PCs(which uses a paid copy of the Mountain Lion installer) doesn't work with Virtualbox. Instead, you'll have to rely on pirated "bootable DVD" copies of Mountain Lion, also known as "distros". I won't go into details, but you can download these copies from about any bittorrent website by using a bittorrent client (it's about 4.5 GB in size). In the past, we've used the iAtkos distro for this, but iAtkos hasn't updated for Mountain Lion yet, so I used the "OS X 10.8 Mountain Lion bootable DVD for Intel PCs", by Olarila.

  • Hackboot 1 / Hackboot 2: Even though it's called a "bootable DVD", the Olarila version of OS X Mountain Lion still can't boot in Virtualbox by itself. To help Mountain Lion start, you'll need to use Olarila's Hackboot CD. There are three different versions of Hackboot; we'll need to use two of them in this guide. "Hackboot 1" is for starting the Mountain Lion installer, while "Hackboot" 2 is for starting Mountain Lion itself.

  • Multibeast 4.6.1 : You will need to use Multibeast 4.6.1, our favorite Hackintosh post-installation tool, to set up the Mountain Lion virtual machine after the initial installation. While Multibeast 4.6.1 is an old version designed for Mac OS X Lion instead of Mountain Lion, in our case, it actually works better than newer versions of Multibeast. Registration is required on the tonymacx86 website to download this.

Step 1: Prep
Download Virtualbox, install it, and open it up. Also, if you want to be able to view USB devices from your OS X Mountain Lion virtual machine, download the Virtualbox Extension Pack and run it before going to Step 2.

Step 2: Create a new virtual machine.
Virtualbox lets you run Mac OSX within Windows by creating a virtual machine, which is a program that simulates a normal computer.  To create a virtual machine, open up Virtualbox and click "New" on the upper left. Give your new virtual machine a name, and choose "Mac OS X" for the OS Type.

If your version of Virtualbox asks you to choose between 64-bit and 32-bit, be sure to choose 64-bit. Choosing 32-bit will result in a critical "Guru Meditation" error later on.
I recommend assigning 4 GB of RAM to the virtual machine, but you can assign as little as 2 GB of RAM. Every time you turn on Mac OS X, that RAM that you assign here will be used to run the virtual machine. The RAM will be given back to your normal computer after you turn Virtualbox off.

You'll need to create a new hard disk for the virtual machine. Virtualbox will ask you what type of disk you want to create: VDI, VDMK, or VHD. VDI is the original format for Virtualbox, while VDMK is the format used by VMWare. If you're considering getting a copy of VMWare, you might want to choose VDMK. Otherwise, just choose VDI. I recommend creating a dynamically expanding disk; the only other option, fixed-size storage, will eat up your hard drive.

Step 3: Give your new virtual machine an operating system.
Your virtual machine will now be created. But don't stop now--you still need to change a few settings before your machine will actually work. Your new virtual machine will show up on the left column of the Virtualbox start page.  Select your Mac OS X virtual machine (single-click) from the main page of Virtualbox, and open up the virtual machine settings. Once the settings open up, go to "System" and uncheck the "Enable EFI" box. This is by far the most important single setting that you will need to change.

EFI, which stands for Extended Firmware Interface, is a feature that helps operating systems start up. Unfortunately, Mac OSX requires 'speshul' EFI, so the EFI that Virtualbox uses doesn't work.

Once you're done with that, go to the settings for "Storage". In the storage tree box, you'll see a CD icon labeled "Empty". Click on it and click "Choose a virtual CD/DVD disk file". In the window that pops up, choose the .iso file for Hackboot 1 (download below).

DOWNLOAD: Hackboot 1
This way, when your virtual machine starts for the first time, it will boot into Hackboot.

Step 4: Install OS X Mountain Lion
Start up your virtual machine. You will come up to the Hackboot boot screen, with a CD icon labeled "HackBoot" in the middle. Don't do anything yet.

Your mouse cursor will probably be trapped inside the virtual machine. Press the right "Ctrl" key on your keyboard to allow your mouse to escape. Then, at the bottom right of the virtual machine screen, right-click on the little CD icon, and click "Choose a virtual CD/DVD disk file". A Windows Explorer window will pop up; from there, select the OS X 10.8 Mountain Lion bootable DVD.

Click back into the Hackboot screen, and press the "F5" key on your keyboard. This will refresh Hackboot. The CD icon in the middle of the Hackboot screen will now say "OS X Install DVD". Press the enter key on your keyboard. You will then enter the Mac OS X installer page.

Continue, and you will eventually come up to a page that asks you for a "destination" for your Mac install. Oh no, the page is blank! We'll have to fix that. To do this, start up Disk Utility (located under the Utilities menu).

Mac OSX can only be installed on a completely clean disk, so you need to use Disk Utility to wipe your Virtualbox hard disk. Click on the Virtualbox hard disk in Disk Utility and erase it. Don't worry, there's nothing important on it.

On the installation page for Mac OSX, the Virtualbox hard disk should now be showing up. Select it and continue.

Once that's done with, Mac OSX will install itself. This will take at least 20 minutes.

When the installation finishes, Mac OS X will crash into a black screen with white text. This is normal; Mac OS X has installed successfully. Now proceed to the next step.

Step 5: Boot it up
Again, press the right Ctrl key to allow your mouse to escape from the virtual machine screen. Then, click on the CD icon in the bottom right of the virtual machine. This time, choose the .iso file for Hackboot 2 (download below).

DOWNLOAD: Hackboot 2

Restart your virtual machine. You'll see the Hackboot screen once more, except there will be an icon for your virtual machine's hard drive in the middle.

Select it (use the arrow keys on your computer) and press "Enter". Mountain Lion will boot, and you should eventually be led to the Mac OS X setup screen. Fill it out, and you'll finally be led to the Mac OS X desktop.
This concludes the first part of the guide. However, you're not done yet! You still have to make your virtual machine bootable without the help of Hackboot.

Step 6: Fix it up
By default, your ethernet (internet) should work in the virtual machine. However, the virtual machine will not have sound, or be able to boot from the hard drive without help. To fix this, open Safari, and download Multibeast 4.6.1While Multibeast 4.6.1 is an old version designed for Mac OS X Lion instead of Mountain Lion, in our case, it actually works better than newer versions of Multibeast. Registration is required on the tonymacx86 website to download this.

DOWNLOAD: Multibeast 4.6.1

Before starting Multibeast, you have to go the "Security" section of System Preferences in Mac OS X, go to the "General" section, and check "Anywhere" in the "Allow applications" section. Once that's done, run Multibeast and install the following options (contrary to popular belief, you do not need an actual DSDT file to use UserDSDT).

Next, you'll have to delete a certain kext file in your hard drive that causes boot errors. You can do this from Finder, the file browser built into Mac OS X. However, Finder hides your hard drives in Mountain Lion by default. To unhide them, open Finder, and click on File -> Preferences in the menu bar at the top of Mac OS X. Under the "Sidebar" settings, check "Hard disks", so that Finder will display your virtual machine's hard disks in the sidebar.

Then, go to your main hard drive, and go to /System/Library/Extensions. Inside the Extensions folder, delete the fileAppleGraphicsControl.kext.

This completes the post-installation process for your virtual machine. Eject the Hackboot CD; you can do this by right-clicking the CD icon at the bottom right of your virtual machine, and unchecking Hackboot. Then, restart your virtual machine. Mac OS X will now be able to boot normally and play audio. Congratulations!

Step 7: Make the screen bigger
Though this step is optional, I still recommend you do it anyways. Anyways, when you first use your Mac OS X, you'll probably notice one thing: your screen resolution is 1024x768. Since Virtualbox doesn't "technically" support Mac OS X, there's no official way to change this. But here's how you can change it anyways:

Open up Finder and go to the folder "Extra" in the main hard drive, and open the file org.Chameleon.boot.plist. Between <dict> and </dict> in the file, insert the following line.

<key>Graphics Mode</key>
<string>1920x1080x32</string>

You can change "1920x1080x32" to whatever resolution best fits your monitor. For instance, if you want to use the 1600x900 resolution, type in "1600x900x32". Once you've saved it, turn off the virtual machine.

Next, open the Command Prompt in Windows (make sure you are logged into an Administrator account on Windows). You can do this by opening the Start Menu, and typing "command prompt" into the Start Menu search bar. Then, type the following command into the Command Prompt.

cd "C:\Program Files\Oracle\Virtualbox"

This command will change the focus of the Command Prompt to the program folder for Virtualbox (if you installed Virtualbox somewhere different, then change the command to wherever you installed it). Next, type in this command:

vboxmanage setextradata "Name of virtual machine" "CustomVideoMode1" "1920x1080x32"

This command activates "vboxmanage", a command-line program included with Virtualbox that allows you to edit the properties of your virtual machine, including its built-in resolutions. Replace "Name of virtual machine" with the name of your virtual machine-- you can find the name of your virtual machine in the left pane of the Virtualbox main window (in the screenshot below, my virtual machine is named "Mountain Mac 2"). Replace "1920x1080x32" with whatever resolution you're using.

Press the enter key to submit the command. Once that's done, start your virtual machine again. It will now boot in full resolution. Congrats!

Recap
I'll just repeat what I said in my other two Virtualbox guides. Installing Mac OS X on a virtual machine is excellent practice for the real thing: installing Mac OS X on your actual computer. Don't get too comfortable, though. Compared to most computers, Virtualbox virtual machines are very "vanilla", meaning that they're very compatible with Mac OS X in the first place. You can't count on being that lucky with a real PC.

And even if you don't plan on doing this for real, with a Hackintosh, it's still a really cool thing to try out over the weekend.

How to install OS X Mavericks on your PC with Unibeast



If you're interested in running Mac OS X, but you don't want to pay ridiculous prices for a normal Mac, then a Hackintosh just might be for you. Right now, the newest iteration of OS X is 10.9, known as Mavericks. Installing Mavericks on a PC is pretty much the exact same as installing Mac OS X 10.8 (Mountain Lion). This guide will follow tonymacx86's standard Unibeast method, except that we try to cover the process with more detail (and pictures!).

Requirements:
  • A compatible computer: Not every computer will work with Mac OS X, even with the help of tools like Unibeast and Multibeast. Be sure to read the Hackintosh compatibility guide very carefully, to check whether or not your computer qualifies. The hardware requirements for OS X Mavericks are identical to those for OS X Mountain Lion; AMD processors and older 32-bit Intel processors (such as Pentium M) are not supported. If your computer already has OS X Mountain Lion installed, Unibeast will just update Mountain Lion to Mavericks normally, without deleting any of your apps or files.

  • A separate hard drive: Mac OS X needs its own hard drive (a minimum of 10 GB of space is required, but at least 50 GB of space is recommended). Unibeast will not work on a hard drive where Windows was installed first. You can bypass this requirement by applying the MBR patch to Unibeast (the process for Mavericks is the exact same as for Mountain Lion).

  • Unibeast (Free): Unibeast is a Mac program that modifies the official OS X Mavericks installer, and writes it onto a USB drive. You can then use this Unibeast USB drive to run the Mavericks installer on a PC. Unibeast works with Mac OS X Snow Leopard and newer; registration on tonymacx86.com is required to download Unibeast. 

  • A Hackintosh with Snow Leopard/Lion/Mountain Lion already installed, a real Mac, or a Mac OS X virtual machineUnibeast is a Mac app, so you need a computer with Mac OS X to run it. You could use a real Mac, if you own one. Alternatively, you could install Mountain Lion on a virtual machine, and run Unibeast on there instead. Be sure to install the Virtualbox Extension Pack to view USB drives from your virtual machine.

  • OS X Mavericks (Free): The method used by this guide requires that you download a free copy of the Mavericks installer app from the Mac App Store. Though the Mac App Store is included in Mac OS X 10.6.6 and newer, you have to be running 10.6.8 to download Mavericks. (you might be able to circumvent this requirement by spoofing your system version).

  • An empty USB drive (8 GB or larger): The USB drive used for Unibeast must be at least 8 GB in size. Since Unibeast will erase all of the files on your USB drive, make sure to back up its contents first. You can reuse this USB drive for normal stuff after you finish installing Mavericks.

  • Multibeast (Free): Multibeast is a collection of kext files that your Hackintosh will need to run properly, after the initial installation. Download it onto a USB drive. Be sure to download the newest version 6 of Multibeast, not the older versions 3, 4, or 5.

1. Format your USB drive for Unibeast
Plug your USB drive into Mac OS X, and open Disk Utility (located in the Utilities folder in the Applications folder). Select the USB drive in the sidebar of Disk Utility, go to the "Partition" tab of Disk Utility. Click the "Options" button, and check the partition scheme: it should be set to "Master Boot Record" by default.

Then, create a new partition layout with 1 partition. Set the format to "Mac OS Extended (Journaled)". Name the new partition whatever you want (I named mine "Cheesecake"), and click "Apply". 

This will erase and reformat your USB drive so that it's ready for Unibeast. The process should only take a few seconds to complete.

2. Run Unibeast
Download Unibeast and run it. Make sure that the OS X Mavericks installation app from the Mac App Store is inside your "Applications" folder of Mac OS X.

Select your USB drive as the installation destination (mine is named "Cheesecake").

Click through the pages in the Unibeast installer, until you reach the following selection page. Choose the "Mac App Store Mavericks - 10.9" option. In addition, there are two extra options you might want to select: "Legacy USB Support" and "Laptop Support". Select the first option if you use a first-generation Intel Core processor; these are Intel Core processors with 3-digit model numbers, such as the Intel Core i7-960 or i7-875K. Select the second option as well if you're installing Mavericks on a laptop. If neither of these options apply to you, simply click "Continue".

You'll come up to the installation progress bar. Chances are, Unibeast will look like it's stuck at the "Running package scripts" stage. Don't panic! This is normal-- during the "Running package scripts" stage, the progress bar is counting the number of files copied, but Unibeast is copying some really big files, so it takes forever for the number of copied files to increase.

Though Unibeast is supposed to only take 10-15 minutes to run, it may take up to an hour, depending on how fast your USB drive is.

3. Set up the parts of your PC
Before you begin your Mavericks installation, make sure to follow these procedures:
  • Unplug all USB-connected devices from your computer before you begin the setup (except your keyboard and mouse). A faulty external USB hard drive can cause your Hackintosh bootloader to give you EBIOS errors on startup.
  • Open up your computer and unplug any extra internal hard drives that your computer has, besides the hard drive that you're installing OS X on. (Just unplug the hard drive SATA cables from your motherboard.)
  • If your computer uses a discrete (separate) graphics card, unplug that card from your computer motherboard and use the integrated graphics on your CPU instead (assuming your CPU actually has integrated graphics). Doing this will reduce the number of possible points of failure in the guide-- Mac OS X tends to have a lot of problems with discrete graphics cards during the setup process. 
    • If possible, connect your monitor to the DVI port of your computer's integrated graphics. The Mac OS X installer sometimes has problems with HDMI and VGA. 
NOTE: If you're installing Mac OS X on a computer that already has Windows installed on a separate internal hard drive, you may have to enable AHCI for Windows beforehand. Otherwise, Windows won't boot afterwards. Also, after installing Mac OS X, you should also sync your clock on Windows with Mac OS X.

4. Set up your motherboard's BIOS
The BIOS is basically a settings page for your motherboard. To enter the BIOS on my own computer's Gigabyte P67A-D3-B3 motherboard, I have to press the delete key when it boots (before the operating system starts). Different manufacturers set different keys for opening the BIOS.

NOTE: If you have a newer Gigabyte motherboard that uses the UEFI interface instead of BIOS, check out our guide for setting up the UEFI instead. New motherboards with the LGA 1150 socket (the boards that support Intel "Haswell" processors) generally don't need much tweaking at all.

If your Hackintosh already has Mac OS X Snow Leopard, Lion, or Mountain Lion installed, the only thing you'll need to change in the BIOS is the "Boot Device", so that USB drives have highest priority.

If your Hackintosh doesn't have any version of Mac OS X installed yet, you have to change a few extra BIOS settings. Before starting, reset all of your BIOS settings to their factory defaults. On Gigabyte motherboards, you can reset your BIOS settings to their default by selecting "Load Optimized Defaults" on the main page of the BIOS. Once your BIOS is running on its defaults, you need to change these three settings:

Boot Device - Change the boot device of your computer so that "USB-HDD" is first. You need to do this for Unibeast to work. After you finish installing Mac OS X, you should change this setting back to default, so that "Hard Disk" is the first boot device (this optional, but it will speed up your boot times).

HPET - Change this to 64-bit.

SATA Control Mode (your BIOS might call this a different name) - This will probably already be set to "SATA", "IDE", or "RAID". Change it to "AHCI". Mac OS X only works with AHCI.

Keep in mind that the BIOS on most motherboards do not support using a mouse, so you'll probably have to navigate through the BIOS with the arrow keys on your keyboard. Press "Enter" to change a selected option in the BIOS. On my Gigabyte motherboard, I have to press F10 to save my changes.

5. Boot into Unibeast
Restart your Hackintosh, and plug in your Unibeast USB drive. If things go well, your computer will boot from the USB drive instead of booting from your normal hard disk. You will then be able to view the Unibeast menu.

If you do not manage to reach the Unibeast menu, check your motherboard's BIOS settings to make sure that the changes you made in Step 4 were properly applied. If they were, but you still cannot boot from the Unibeast USB drive, unplug your USB drive, and go back to Step 1. Reformat your USB drive with Disk Utility and try again. If all else fails, try using a different USB drive for Unibeast.

At the Unibeast menu, select the name of your Unibeast USB drive, by using the left/right arrow keys on your keyboard, and then press the enter key (or return key) to start the OS X Mavericks installer.

In the worst case scenarios, instead of loading the Mac OS X installer, you may end up at a dark gray screen that tells you to restart your computer (a kernel panic), or you may end up with a small crossed-out sign (a loading error). If you get a kernel panic/loading error (or if the Mac OS X installer simply won't start within 10 minutes), you'll need to enter some boot flags.

To enter boot flags, manually restart your computer by pressing your computer's power button. Then, once you've booted back into the Unibeast menu, try typing any necessary boot flags before pressing the enter/return key. Check out this list of common boot flags for reference ( PCIRootUID=0 and -x are two popular boot flags).

6. Install Mavericks
Continue, and you will eventually come up to a page that asks you for a "destination" for your Mac install. Select the hard drive that you want to install OS X Mavericks on, and continue.

If you're installing Mavericks on an empty hard drive, the hard drive selection box will be blank. You'll have to erase that hard drive with Disk Utility first (check out Step 4 of our Snow Leopard installation guide for more details).

Otherwise, select the hard drive you want to install OS X Mavericks on, and click "Install". Mavericks will now install itself. This will take at least 30 minutes.

Restart. If your Hackintosh already had Mac OS X Snow Leopard, Lion, or Mountain Lion installed beforehand, you can unplug the Unibeast USB drive. Otherwise, keep the USB drive plugged in. At the boot screen, you'll see an icon for the hard drive where you installed Mavericks. Select it (use the arrow keys on your computer) and press "Enter".

If everything works properly, then Mavericks will boot. Mission accomplished!

Once again, if you get a kernel panic/loading error when you try to boot your new Mavericks installation (or if the installation simply won't start within 10 minutes), you'll need to enter some boot flags.

To enter boot flags, manually restart your computer by pressing your computer's power button. Then, once you've booted back into the Unibeast menu, try type any necessary boot flags before pressing the enter/return key. Check out this list of common boot flags for reference ( PCIRootUID=0 and -x are two popular boot flags).

7. Multibeast
Multibeast is a collection of kext files that you'll need to install for your Hackintoshes to have sound, internet, a high resolution screen, and more. Different Hackintosh builds require different Multibeast setups, though most setups are very similar. Find out what Multibeast options you need to install. If you have a Gigabyte GA-P67A-D3-B3 motherboard like me, check out my own Multibeast setup.

If you're just updating your Hackintosh from Mac OS X Snow Leopard, Lion, or Mountain Lion, you don't have to reinstall UserDSDT or Easybeast in Multibeast after installing OS X Mavericks. Mac OS X treats Mavericks as just another update-- this generally means that the only things you have to reinstall in Multibeast are audio kexts and ethernet kexts. You might also have to reinstall miscellaneous kexts, such as TRIM Enabler (for SSDs).

To run Multibeast in OS X Mavericks, you have to go the "Security" section of System Preferences in Mac OS X, go to the "General" section, and check "Anywhere" in the "Allow applications" section. After running Multibeast, you'll also probably want to change your BIOS settings back to normal (from Step 4).

Once that's done with, you should be running a fully functional copy of OS X Mavericks on your PC. If you plan on updating Mac OS X in the future, check out our guide to updating your Hackintosh. Congratulations!