Installing php gettext in Mac Leopard

Mac OS, PHP No Comments

I was trying to get phpldapadmin work in my Mac, I get this error:
undefined function _()

Search through website, I need gettext extension to be installed as php extension.

This is the useful website to get gettext work in Leopard:
Adding Gettext Extension for Mac OS X Leopard

NOTE from installation steps:

  • Even though there is php installed in Leopard (mine is version 5.2.6), just follow the instruction to install php 5.2.4 and go to ext/gettext folder to start install gettext. This will automatically install gettext in the local php.
  • If your installation is not working after following the step, try to disable extension_dir:
    [html];extension_dir="./"
  • AND remember to restart your apache:
    [html]sudo /usr/sbin/apachectl restart

Getting iso image from CD

Mac OS, Ubuntu/Linux No Comments

After completed Frozen Throne, I wanted to play Warcraft III from my Mac. My friends gave me the Frozen Throne .iso image which enable me to run without cd. Although I have Warcraft installed in my Mac, I do not have the .iso image for Warcraft III. I am too lazy to insert and eject the cd too as I play it regularly. I can’t just keep the cd by myself as I am sharing it with my house mate. So time to learn to create cd image file (This should work the same way as Linux/Ubuntu).

So after I put in the cd, when I type ‘mount’ command, I will have this:

[html]
lindaoctalina$ mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local)
fdesc on /dev (fdesc, union)
map -hosts on /net (autofs, automounted)
map auto_home on /home (autofs, automounted)
/dev/disk1s1s2 on /Volumes/Warcraft III (hfs, local, nodev, nosuid, read-only, noowners)

The last line of the above code is for my Warcraft III cd drive. I need to ‘umount’ the cd before I can process the iso file. (Note: You might need to use root/sudo user)

[html]
lindaoctalina$ sudo umount /dev/disk1s1s2

Then start to create the iso image:

[html]
lindaoctalina$ dd if=/dev/disk1s1 of=warcraft3.iso bs=1k

The process of dd command is to copy the file to the harddisk, convert it and format the file. For the ‘if=/dev/disk1s1′ means that read from cd room instead of stdout and ‘of=warcraft3.iso’ means that copy to local harddisk with the name of warcraft3.iso. ‘bs’ is to specified the number of blocks per bytes (can have kB, MB, etc)

You need to wait for few minutes to let the image file being created, then you will get the following code:

[html]
687548+0 records in
687548+0 records out
704049152 bytes transferred in 540.453743 secs (1302700 bytes/sec)

After finish, remember to eject the cd. As it is not mounted, we need to do manually (in Mac can use disk utility to eject the disk). Use below code to eject manually from terminal:

[html]
eject /dev/disk1s1

Note: it works for any application that requires CD and not only Warcraft III and Starcraft.

Latex in Mac

LaTeX, Mac OS 1 Comment

I am trying to get Latex IDE for Mac… Have been searching for lot’s of IDE and try to work out which one is the best. Some of the IDE is not user friendly at all, some is good for mathematic equations and some doesn’t support bibtex although it’s easy to be used.

So which one is considered “the best” after using it?
Latex IDE: TeXShop, is simple and just click on the button and you can have your pdf file. Installation of style is easy and the editor has a good layout. The only drawback is that it doesn’t provide bibtex IDE, and supporting bibtex still need a compilation from terminal.

Equation editor IDE: Equation editor, if you have problem in creation complex mathematics equation and align it properly in your latex document, use this IDE. Equation editor allow you to convert your equation into png or other vector format image that you can insert into your latex document. It’s very helpful when you want to export your latex document to html format where most of html browser will display the equation badly. Convert into gif or png!

Bibtex IDE: Bibdesk, to manage your bibliography after you read some article or books. You can even add your comment and notes for the documents. Nice interface and the bibtex document will be created for you directly after you save. To use the cite in your bibtex, just select the cite and copy the citekey as copy cite command, when you paste in your paper, you will get your full cite command with the citekey. More information can get it from MacResearch.