Solving password input problem with Snow Leopard

Snow Leopard is supposed to be a slimmer and more stable version than Leopard. When it comes to default password input, Leopard is far better as Snow Leopard has a few drawbacks:

1. It cannot input password in languages other than English! Leopard did that just smoothly.

2. It does not have input language at password by default like Leopard. If you have tons of unsaved work and your screen is password protected, you are as good as a dead man.

3. Default Vietnamese input sucks, it does not work well in Apple’s own Safari and also on third party apps such as Chrome, TextMate, TextWrangler, etc.

There’s no guide or mentioning why such problems are still around and what’s ETA for fixes.

Today I’m solving only the issue with login dialog to avoid the issue with locked screen and you have lots of unsaved work and your boss is whistling:

1. Go the System Preferences

System Preferences - Accounts
System Preferences - Accounts

2. Select Accounts

3. Select Login Options

Select Login Options
Select Login Options

4. Unlock & input your password (please revert input to English first)

Input password
Input password

5. Tick the option “Show input menu in login window”

Tick the option "Show input in login window"
Tick the option "Show input menu in login window"

Lock the dialog to save the change. Now every time you login from locked screen, you will see language input on your top right hand corner. Change input to English and input your password. Let your Mac sleep and wake it up to test. No more hassle 😉 !

NTFS for Mac made easy

There are only 2 steps to enabled write option to NTFS partitions on Mac.

1. Install MacFUSE: http://code.google.com/p/macfuse/

2. Install NTFS-3G: http://macntfs-3g.blogspot.com/ , http://sourceforge.net/projects/catacombae/files/

You will be required to reboot and upon next start-up, you can write to NTFS partitions with ease. Successful installation will similar screenshot (MacFUSE & NTFS-3G at the bottom):

Successful installation of MacFUSE and NTFS-3G
Successful installation of MacFUSE and NTFS-3G

Recovery of 15GB+ of stolen space on Leopard

I’ve noticed that my Leopard partition suddenly got fat and GBs were gone somewhere. I decided to find out truth and hope for the way to get back that free space. I checked every single folder under the /. System folders were OK (access to them needs root permissions so clearly no one could dump garbage there). One important folder was suspicious, that was Users. I smelled that my home folder was that fat guy. It turned out right. Diving deeper into each sub-directory of my home folder, I found ~/Library extremely interesting: 15GB+. I was shocked how much garbage was collected in a few days time. It turned out that the Apple Mail was culprit. I downloaded everything it could from my GMail account. It weighed more than 14GB. I deleted that GMail account from Mail and then removed all related folders of that mail account inside ~/Library/Mail. Further, I found that Copernicus (a lousy screen recorder that I removed days before) has collected almost 700MB inside ~/Library/Application Support/Copernicus. I removed it with zero mercy and happy to see more than 15GB came back to me.

Building PyQt 4.7 on Leopard

PyQt is a great Python wrapper around Nokia Qt C++ framework. Binary release is not provided for Mac and Linux by the developers and maintainers of PyQt. No problem, you can build your own without sweating. 30 mins and you are done with it.

1. The first ever thing you have to do is install Qt release for Mac by Nokia: http://qt.nokia.com/downloads. For my case, it was Qt 4.6.2 (latest version).

2. The next step is to build QScintilla2. Go to your temporary directory and do the following:

[cc lang=”bash”]
wget http://www.riverbankcomputing.co.uk/static/Downloads/QScintilla2/QScintilla-gpl-2.4.2.tar.gz
tar zxvf QScintilla-gpl-2.4.2.tar.gz
cd QScintilla-gpl-2.4.2
cd Qt4/
qmake -spec macx-g++
make
sudo make install
cd ..
[/cc]

3. Now proceed to building SIP

[cc lang=”bash”]
wget http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-4.10.tar.gz
tar zxvf sip-4.10.tar.gz
cd sip-4.10
python configure.py
make
sudo make install
cd ..
[/cc]

4. The last step is to build PyQt. It’s pretty simple but may take up 20-30 minutes to build. Grab a meal or watch GAGS while waiting for it.

[cc lang=”bash”]
wget http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.7.tar.gz
tar zxvf PyQt-mac-gpl-4.7.tar.gz
cd PyQt-mac-gpl-4.7
python configure.py
make
sudo make install
cd ..
[/cc]

5. So you have PyQt ready! Go to the examples directory of PyQt-mac-gpl-4.7 and check the sample code, demos. Enjoy!

Installing PIL (Python Image Library) on Leopard

PIL is a simple yet powerful image processing library for Python which has both low level and high-level features. In this tutorial I will demonstrate installation of PIL on for Python 2.5 and 2.6 on Leopard. Below are steps:

0. Set up folder for installation

[cc lang=”bash”]
cd ~
mkdir -p simpleit/temp
cd simpleit/temp
[/cc]

1. Install Python 2.6

By default Leopard comes with Python 2.5.1 so we need to install Python 2.6. Let’s download Python 2.6 from ActiveState website: http://www.activestate.com/activepython/downloads/.

[cc lang=”bash”]
curl -C – -O http://downloads.activestate.com/ActivePython/releases/2.6.4.10/ActivePython-2.6.4.10-macosx.dmg
open ActivePython-2.6.4.10-macosx.dmg
[/cc]

Proceed with normal installation (don’t change any default configurations).

2. Install ZLIB

Grab ZLIB from its website http://www.zlib.net/ and do simple installation (both static & dynamic):

[cc lang=”bash”]
curl -C – -O http://www.zlib.net/zlib-1.2.3.tar.gz
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make
sudo make install
./configure –shared
make
sudo make install
[/cc]

3. Install FreeType2

Get FreeType2 from its main site: http://www.freetype.org/:

[cc lang=”bash”]
curl -L -C – -O http://downloads.sourceforge.net/project/freetype/freetype2/2.3.12/freetype-2.3.12.tar.gz
tar zxvf freetype-2.3.12.tar.gz
cd freetype-2.3.12
./configure –with-zlib=/usr/local
make
sudo make install
[/cc]

4. Install jpeg

Get JPEG (now it’s version 8) from its main site: http://www.ijg.org/:

[cc lang=”bash”]
curl -L -C – -O http://www.ijg.org/files/jpegsrc.v8.tar.gz
tar zxvf jpegsrc.v8.tar.gz
cd jpeg-8
./configure –enable-shared –enable-static
make
sudo make install
[/cc]

5. Install TIFF

Get TIFF from its main site: http://www.libtiff.org/:

[cc lang=”bash”]
curl -L -C – -O ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.9.2.tar.gz
tar zxvf tiff-3.9.2.tar.gz
cd tiff-3.9.2
./configure –with-zlib-include-dir=/usr/local/include –with-zlib-lib-dir=/usr/local/lib –with-jpeg-include-dir=/usr/local/include –with-jpeg-lib-dir=/usr/local/lib –enable-cxx –enable-jpeg –enable-zlib
make
sudo make install
[/cc]

6. Amend Python config Makefile

The easy part is over. Now read carefully. By default ActiveState Python assumes that you can build Universal binaries (x86 + PPC), which is wrong in most of cases. There is high chance that you are running Leopard on Intel Mac (x86). So you need to amend this file: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/Makefile. You need to remove 3 occurrences of ‘-arch ppc’ to build smoothly (or leave it to try your luck):

[cc lang=”bash”]
cp /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/Makefile /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/Makefile.BAK
sudo sed -e ‘/-arch ppc//g’ /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/Makefile.BAK > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/Makefile
[/cc]

7. Install PIL

Now you are ready to download PIL. There is a bit of configuration involved but you can do it quickly. Grab latest stable PIL source package from http://www.pythonware.com/products/pil/.

[cc lang=”bash”]
curl -L -C – -O http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz
tar zxvf Imaging-1.1.7.tar.gz
cd Imaging-1.1.7
emacs setup.py
[/cc]

Replace the following chunk with the one below:

[cc lang=”python”]
TCL_ROOT = None
JPEG_ROOT = None
ZLIB_ROOT = None
TIFF_ROOT = None
FREETYPE_ROOT = None
LCMS_ROOT = None
[/cc]

[cc lang=”python”]
TCL_ROOT = None
JPEG_ROOT = libinclude(‘/usr/local’)
ZLIB_ROOT = libinclude(‘/usr/local’)
TIFF_ROOT = libinclude(‘/usr/local’)
FREETYPE_ROOT = libinclude(‘/usr/local’)
LCMS_ROOT = None
[/cc]

Save and close the emacs and run the commands:

[cc lang=”bash”]
sudo python2.6 setup.py install

sudo python2.5 setup.py install
[/cc]

Congrats! Now you have the latest PIL installed for both Python 2.5 and 2.6.

8. Test PIL for fun 😀

You can test your PIL by following this awesome tutorial written by a very beautiful Python engineer: http://nadiana.com/pil-tutorial-basic-advanced-drawing.

Keeping Leopard slim

My MacBook was shipped with Tiger and then I upgraded to Leopard. Both of them were too fat: 15GB or more.

The default set up installs all printer drivers and languages as they don’t know my (and yours too) specific needs. So I ended up wasting space for those languages that I wish I knew. This time, when I put in my install DVD, I removed all languages and drivers (English is the default so you can’t remove). Surprisingly, it took me only 6.1GB to do full installation, instead of 15GB+ (I saved ~9GB man)! If you have DVD with you, plug it in, navigate to Optional Installs, run it and un-check those unnecessary languages and printer drivers. And you are done, your Leopard now is very slim.

Installing Vietnamese Input on Mac (Leopard + Tiger)

One of my top priorities when installing a system is to make it home by installing Vietnamese input and fonts. There are a few options to install Vietnamese input. I got accustomed to Telex input style so I’ll cover it here. Screenshots were taken from Leopard but installing on Tiger is the same. Here are the steps:

  1. Download from Vietnamese-2.0.1.dmg (or any later version available) http://homepage.mac.com/herr/
  2. Do normal installation (see attached screenshots)
  3. Log out as shown on the screenshot
  4. Log in and go to System Preferences, Click on International
  5. And then choose the Right-most tab “Input Menu”
  6. Scroll down and find “Vietnamese Telex”, tick it
  7. Close the System Preferences
  8. From the menu bar, choose Vietnamese and enjoy typying:

Xin chào các bạn. Gõ tiếng Việt thật là thích phải không 😀 ?