Wednesday, January 5, 2011

CakePHP Console on Windows

Here's a nice little tip for using CakePHP's console in Windows.

1. Open System Properties by right_click on My Computer icon, select Properties. Or, you press Win + Break.
2. In the System Properties dialog box, select the Advanced tab and click Environment Variables.
3. In System Variables, find the Path variable, highlight it and click Edit .
4. You need to add the following two paths in the Variable value category: (make sure you separate entries with a semicolon.)
+ Path to the directory containing php.exe file. For example C:\xampp\php
+ Path to the CakePHP console directory. For example: C:\xampp htdocs\CakePHP\cake\console
5. You click OK three times to confirm the changes and reboot.
After reboot, you can use CakePHP console. Experiment by:
+ Click Start> Run> cmd [enter].
+ Type cake [enter]
You will see the Cake console Welcome screen appears.
Cake console installation is complete, congratulations!

Taken from http://forum.wareseeker.com/how-to-install-cake-in-windows-xp-t57404.html, with edits.

Thursday, November 11, 2010

Cross-Platform CSS Fonts

Here's an excellent resource for choosing font families that will work across all major platforms http://my.opera.com/area42/blog/css-font-matching-windows-mac-and-linux.

Deleting Duplicate Records

Similar to this post http://damianfiles.blogspot.com/2009/04/finding-duplicate-records.html, the below SQL will delete any records that have 'dupField' in common. It will keep the record that has the lowest 'uniqueField' value.

delete T1
from MyTable T1, MyTable T2
where T1.dupField = T2.dupField
and T1.uniqueField > T2.uniqueField

Found here http://www.cryer.co.uk/brian/sql/sql_delete_duplicates.htm.

Wednesday, November 11, 2009

Triple boot, OSX86/Linux/Windows. Finally!

Well, I finally managed to do it. An OSX86/Linux/Windows triple boot. The OSX86 part was a huge pain in the %$#$ for me, mainly because of SATA/OSX compatibility issues. (I can't set "IDE" for my ACPI settings on my particular MoBo.) But I finally managed to insert my SATA device ID into AppleVIAATA.kext, and now have an up-and-running SATA-only triple-boot system.

Photo log follows...

Partitioning my hard drive. I used GParted for this:
The OSX86 fat32 will be eventually formatted as HFS+ when you install OSX86, erase the partition, and format. Partition 6 is for disk sharing.

Windows Server 2008 installation:
By the way, Windows Server is expensive as *&^% and should be purchased as a last resort. Or if you have a paying client who requires it :)

OSX86 installation:

I have to say, I love Leopards installation video. Very diplomatic. Again, OSX is quite pricey, but it's a decent product, so get yourself a license.

(GRUB) Boot loader installation:

This is what you'll use when you start up to decide which OS to boot. Very important to configure correctly. Part of CentOS installation.

Linux (CentOS) installation:
I installed CentOS, simply because it's the same OS my collocated remote host uses. And it's very stable. Based on Fedora (or is it Red Hat), it's a very server-friendly OS that doesn't need to be updated often. Thought I'd give it a go.

Finally, at boot:
This is where you choose your OS. Enjoy :)

Tuesday, August 18, 2009

Latest PC build

Sharing some pics of my latest PC build. Like Xmas, it was. Tons of fun to build, and a treat to work with.

Starting off with the mainboard, processor and stock cpu fan.


This is the case with power supply and a system fan installed.


Everything installed and wired. cpu, cpu fan, mainboard, 3 system fans, hard drive, DVD, video card, 3 sticks of RAM, and what have you.


Xmas lights. All up and running.

Monday, August 10, 2009

Some Firefox Add-Ons Cripple Sites

Are some sites (facebook, gmail) VERY slow when you visit them with Firefox? Try disabling some of your add-ons (Tools -> Options -> Manage Add-Ons).

After reading a few posts on other forums, it looked like disabling certain add-ons freed up their Firefox. For me, it was the Skype extension for Firefox. This add-on would put Skype availability icons next to names on web pages it recognized as Skype contacts. As soon as I disabled it, Firefox was back to normal.

Tuesday, June 30, 2009

SQL statement for rankings

Here's another SQL statement I find useful every now and then, and not necessarily intuitive enough to remember. This will return a list of people (for instance), with the people with the most records at the top. Great for rankings, etc.

SELECT person, COUNT(*) AS number_of_records
FROM people
GROUP BY person
ORDER BY number_of_records DESC;