FacebookAuthenticate – Database-less version has arrived.

December 19th, 2011 § 0 comments § permalink

FacebookAuthenticate – now database-less!

So not everybody’s going to what to maintain a User model. Perhaps all they want is just plain old Facebook Authentication whereby the user’s details are returned from Facebook and then stored in session. Well, now it’s possible.

I’ve created a database-less branch of FacebookAuthenticate. No database setup, no adding Facebook user_id & token fields – just plain old session storage for the current user.

The branch also includes a few updates that were made to the handler recently. Bonus.

Get the code over on my GitHub.

Yahoo PlaceFinder DataSource for CakePhp 2

December 14th, 2011 § 0 comments § permalink

Need the coordinates of a location anywhere on Earth? Or how about the place name of any coordinates you provide? The Yahoo PlaceFinder datasource provides a familiar CakePhp interface for interacting with the Yahoo API.

Typical usage looks like this:

$results = $this->Location->find('all', array(
  'conditions' => array(
    'location' => $this->request->data['Location']['location'],
    'flags' => 'JE',
    'gflags' => 'ACR',
  )
));

It’s worth checking out Yahoo’s docs for the various request parameters.

The first version is over on GitHub! Get it here.

FacebookAuthenticate – Facebook authentication handler for CakePhp 2

December 6th, 2011 § 1 comment § permalink

Built to work with the AuthComponent using the recommended approach for building custom authentication handlers.

The purpose of the Facebook Authentication Handler is to provide Facebook Authentication for your CakePHP 2.0 or later based application. The handler has been built following Cake’s recommended approach for building custom authentication objects for use with the built in AuthComponent.
The handler itself is part a FacebookAuth plugin, though this is essentially to make the handler easily redistributable with example configuration settings and an example controller detailing a typical use case scenario.

It should be noted that though this handler stores the access token returned by Facebook, it does not currently provide a means to makes calls to the Graph API. It’s function is to provide authentication. Of course, you could use the access token and your preferred method to communicate with Facebook.

The first version is over on GitHub! Get it here.

Configure PostgreSQL to accept incoming TCP/IP connections

November 15th, 2011 § 0 comments § permalink

Using: MacPorts PostgreSQL 9.x on OS X 10.6 (Snow Leopard)

After switching to a new Mac, I didn’t have time to reinstall and setup PostgreSQL. I decided to access PostgreSQL on my old machine over the network. When I tried to connect, I hit the following error:

psql: could not connect to server: Connection refused
Is the server running on host “192.168.0.6″ and accepting TCP/IP connections on port 5432?

Well, it was running but obviously not accepting connections. Let’s change that.

Get some super user privileges

sudo -s

Find the location of pg_hba.conf (Client Authentication Configuration File)

find / -type f -name “pg_hba.conf”

Mine was located here: /opt/local/var/db/postgresql90/defaultdb/pg_hba.conf

Change directory to where it’s located and edit it:

cd /opt/local/var/db/postgresql90/defaultdb/
vim pg_hba.conf

Add the following line where x.x.x.x is the email address of the client machine:

  • host all all x.x.x.x/24 trust

Now edit postgresql.conf (PostgreSQL configuration) that’s located in the same directory.

vim  postgresql.conf

…and change the line:

  • listen_addresses = ‘localhost’ (note, it might be commented out with a #, remove it if so)

to…

  • listen_addresses = ‘*’

Restart PostgreSQL and try connecting again from the client machine.

A really simple Facebook “Fan / Like Gate” written in PHP

November 8th, 2011 § 0 comments § permalink

What? You’re not using a fan / like / reveal gate?

Well, apparently you should be.

It’s really easy if all you want to do is find out if the current user has liked the page or not. I’ve packaged it up into an index file that…

  1. Decodes the signed request that Facebook sends – this contains the like status.
  2. Renders a view depending on the like status.

 

What is it?

It’s one of those Facebook pages where you have to like the page before you’re allowed to see the hidden content. You know, like the classic Coca-Cola one*.

 

Where can I get it?

On MozMorris over on GitHub.

 

* it was there the last time I looked.

 

 

 

 

 

 

 

 

Install Guide: Mac OS X Snow Leopard 10.6.0 on a Dell Dimension 9200 / DXP061

November 23rd, 2009 § 79 comments § permalink

Specification

This guide was tested with the retail Snow Leopard retail disk and the following specification:

Model: Dell Dimension 9200 / Dell XPS410
Chipset: Intel P965 Chipset (ICH8R)
Processor: Intel Core 2 Duo
Graphics: ASUS nVidia EN8400GS 512 PCIe
Ethernet: Intel 82566DC
Wireless: Belkin (Broadcom)
Audio: SigmaTel 9227

Here is the LSPCI readout if you want lower level information.

If you have a setup completely different to this then turn back now. You’re better off looking for a guide that matches your spec.

Prerequisites

You will need the following:

  1. A working OS X installation. I used my iPC 10.5.6 installation. You could potentially use a friends.
  2. Snow Leopard DVD
  3. An 8+GB USB Flash Drive & spare hard disk
  4. Chameleon 2 RC3 Boot loader Package
  5. EFI studio
  6. Kext Helper
  7. A decent text editor, like TextMate
  8. Some patience. This guide probably looks quite long, but in reality it takes no longer than an hour
  9. The attribute of following instructions carefully.

You will also need the following, which I can provide:

  1. A DSDT
  2. A few driver kexts
  3. A boot list file, also known as com.apple.boot.plist

Click here to get all of these.

BIOS settings:

  1. ACHI mode (RAID off)
  2. SpeedStep off
  3. USB as priority boot

Preparation

Restore DVD to USB

1. Boot into your existing OS X installation, insert the Snow Leopard DVD & USB drive, and open Disk Utility.

2. Use Disk Utility to Restore the Snow Leopard DVD to the USB drive by:

3. Selecting the Flash Drive

4. Select the Erase tab on the right and then set Format to Mac OS Extended (Journaled). Name the partition you’ll be creating Snow Leopard Install DVD so you can keep track of your installation device. After you’ve done this, click the Erase button.

5. After Disk Utility finishes erasing your old data on the flash drive and setting it as a new partition, it will be ready for the Snow Leopard install files. Select the Restore tab at the top and then drag the Snow Leopard DVD to the Source field. Select your USB device, now called Snow Leopard Install DVD for the Destination file. Click Restore and wait for the restoration to finish (about 20 minutes).

Boot loader & Kexts

1. Install Chameleon 2 RC3 Boot loader using the package installer to the USB drive where you restored the Snow Leopard DVD to. Not your working OS X installation.

Snow Leopard Install DVD post Chameleon Install

Snow Leopard Install DVD post Chameleon Install

2. Copy the ‘com.apple.Boot.plist’ & ‘dsdt.aml’ to the Extra folder in the root of the USB drive.

Content of Extra

Content of Extra

3. Create a new folder called Extensions within the Extra folder. Copy all the kext files to the Extensions folder.

Contents of Extensions

Contents of Extensions

4. Open Terminal and run diskutil list This will list out all mounted drives. Look for the one that corresponds to your USB drive and note the drive number and installation partition. In this example below, the disk number is 2 and the partition is 2, also written as disk2s2

diskutil list

diskutil list

Now run diskutil info disk2s2 You’ll need to substitute in your own disk and partition number after the info.

diskutil info disk2s2

diskutil info disk2s2

5. Copy the Volume UUID identifier from the information listed to you clipboard or somewhere safe.

6. Now lets go back to the Extra folder on the USB drive. Using that decent text editor I mentioned earlier, you’ll need to open up com.apple.Boot.plist.

7. We are now going to tell the boot loader which disk to boot based on the disk identifier we just retrieved. After the last </string> and before </dict> enter

<key>boot-uuid</key>
<string>000000000000</string>

8. Replace 000000000000 with your own disk identifier that should still be in your clipboard. Save the file and exit.

com.apple.Boot.plist content

com.apple.Boot.plist content

9. Navigate the Extensions folder within the Extra folder. Open up UUID-platform.kext in your text editor. Go to the contents folder and edit the info.plist.

10. Look for <key>PlatformUUID</key> and paste in your disk identifier in the <string>In Here</string> below it. Save the file and exit.

info.plist inside of PlatformUUID.kext

info.plist inside of PlatformUUID.kext

Graphics

1. Start EFI studio and locate your graphics card from the drop down. For EN8400GS I had to use the 7600GS EFI string. If you have trouble locating an EFI string, just have a Google around.

EFI Studio Interface

EFI Studio Interface

2. Click Add device. Then click Hex String to Clipboard.

Screen shot 2009-11-23 at 22.34.36

2. Now back to the Extra folder on the USB drive and open up com.apple.Boot.plist again.

3. After the last </sting> which should be where you entered your disk identifier, start a new line and input:

<key>device-properties</key>
<string>000000000000</string>

4. Replace 000000000000 with your own EFI string that should still be in your clipboard. Save the file and exit.

Complete apple.com.Boot.plist

Complete apple.com.Boot.plist

Permissions

1. Open the Terminal and run sudo –s at which point you must enter your password. Sudo allow us to run programs with the privileges of root.

2. If you’ve followed the instructions exactly to this point, then you should be able to copy and paste the following commands. You may have decided to follow the guide slightly different up to this point. If you have, then you’ll understand what you need to change here.

cd /Volumes/Snow\ Leopard\ Install\ DVD/Extra
chown –R root:wheel *
chmod –R 777 *

If any of these throws an error then either I’m terrible at writing instructions, or you’re terrible at following instructions. No time to argue anyway, on we go.

Installation

1. Reboot your machine and if you’ve set your USB to priority boot the Chameleon boot loader should appear.

2. Select ‘Snow Leopard Install DVD’, which funnily enough is your USB drive and hit enter.

3. Fingers crossed within a few moments the Snow Leopard installer will appear.

4. If you get the ‘no smoking’ sign after a while then something’s gone wrong. Reboot, and at Step 2 this time, type -v before hitting enter to boot in verbose mode. This will then output an error message. From here, you’ll have to use your friend Google to help you.

5. Choose your required language.

6. Before continuing with the installation program we’re going to prepare that spare hard drive I mentioned you needed in the prerequisites. Open the Disk Utility under the Utilities menu.

7. Select the spare hard disk.

8. Select the Erase tab on the right and then set Format to Mac OS Extended (Journaled). Name the partition you’ll be creating Snow Leopard. Now click the Erase button.

9. Now exit the Disk Utility and continue with the installation

10. Choose your newly formatted disk Snow Leopard as the destination and install. The installation should take around 15minutes or so.

11. It should be noted that sometimes the installer would display an error after completion. You can ignore this. I’m sure someone out there has an answer why this happens, just Google it if you’re that bothered.

12. Reboot!

First Boot

1. Leave your USB as the priority boot device as we’ll be using the chameleon boot loader installed on there to boot our Snow Leopard installation.

2. When the boot loader appears, you should see the Snow Leopard installation. Select it but don’t press enter yet.

3. Currently the boot loader is always going to look for the USB drive as the root device, remember we set this earlier when editing the apple.com.Boot.plist.

We now need to tell it which device we would like to boot this time. Now I can’t tell you exactly for your system what this is going to be. For me this was disk0s2. With Snow Leopard selected, enter rd=disk0s2 and hit enter. If this fails, it is worth trying the following: disk1s2, disk2s2, disk3s2 etc

4. If you’ve reached this point then you must be totally buzzing. You’re almost there, nice one.

Post Install

A lot of this is going to be the same procedure as in the Preparation section but we’re putting the Snow Leopard disk in place of the Snow Leopard Install DVD. I’ll write it out again for consistency.

Bootloader & Kexts (again)

1. Install the Chameleon boot loader to the Snow Leopard disk using the package installer.

2. Copy the ‘com.apple.Boot.plist’ & ‘dsdt.aml’ to the Extra folder in the root of Snow Leopard.

3. Create a new folder called Extensions within the Extra folder. Copy all the kext files to the Extensions folder.

4. Open terminal and run diskutil list This will list out all mounted drives. Look for the one that corresponds to your Snow Leopard drive and note the drive number and installation partition. In this example below, the disk number is 0 and the partition is 2, also written as disk0s2

Now run diskutil info disk0s2 You’ll need to substitute in your own disk and partition number after the info.

5. Copy the UUID identifier from the information listed to you clipboard or somewhere safe.

6. Now lets go back to the Extra folder on the Snow Leopard drive. Using that decent text editor I mentioned earlier, you’ll need to open up com.apple.Boot.plist.

7. We are now going to tell the boot loader which disk to boot based on the disk identifier we just retrieved. After the last </string> and before </dict> enter

<key>boot-uuid</key>
<string>000000000000</string>

8. Replace 000000000000 with your own disk identifier that should still be in your clipboard. Save the file and exit.

9. Navigate the Extensions folder within the Extra folder. Open up UUID-platform.kext in your text editor. Go to the contents folder and edit the info.plist.

10. Look for <key>PlatformUUID</key> and paste in your disk identifier in the <string>In Here</string> below it. Save the file and exit.

Graphics (again)

1. Start EFI studio, locate your graphics card, copy hex to clipboard. For EN8400GS I had to use the 7600GS EFI string. If you have trouble locating an EFI string, just have a google around.

2. Now back to the Extra folder on the Snow Leopard drive and open up com.apple.boot.plist again.

3. After the last </sting> which should be where you entered your disk identifier, start a new line and input:

<key>device-properties</key>
<string>000000000000</string>

4. Replace 000000000000 with your own EFI string that should still be in your clipboard. Save the file and exit.

Sound

  1. 1. Open the Kext Helper.
  2. 2. Navigate to the Extensions folder under Extra on your Snow Leopard disk.
  3. 3. Drag the VoodooHDA kext into Kext Helper.
  4. 4. Click install. You’ll be prompted to enter your password.
Kext Helper ready for me to click 'Easy Install'

Kext Helper ready for me to click 'Easy Install'

Reboot!

1. Now reboot and set your Snow Leopard disk to boot priority.

2. Chameleon should appear; select Snow Leopard and hit enter.

3. If everything’s gone to plan, and I’ll be honest, first time it probably won’t have, you should have a fully functioning Mac OS X Snow Leopard Hackintosh system.

Update

Just hit the Apple Software Update. It will download the latest package, which at the time of writing was 10.6.2. The updates will automatically be installed and then OS X will reboot. Job done.

'About This Mac' post update

'About This Mac' post update

Social Widgets powered by AB-WebLog.com.