Sunday, December 25, 2016

Got prohibition sign trying to boot Mac OS X from USB drive

My first laptop is Macbook Pro 13'' late 2016 running OSX Lion v10.7. Today, I've just bought another Macbook Air 11'' June 2013 and it has MacOS Sierra installed. My problem is my eyes hurt after staring at the screen for about half an hour but it happens only for Mac OSX v10.8 and later. I can stare at screen for a whole day without any problem if the machine runs OSX Lion v10.7. i'm not sure about the cause of the problem but perhaps it's because OSX v10.8 and later were made for Retina display screen and my both macbooks are non-retina display.

Then, i tried to install OSX Lion on my new Macbook Air using bootable USB. I used Cabon Copy Cloner to clone the OSX Lion drive from my Macbook Pro to the USB drive. I tried to boot my Macbook Air from that bootable USB but i got the prohibition sign and nothing happened. I could boot successfully from that USB with my Macbook Pro.

After that, i thought it might be because the OSX version is too old for my Macbook Air so i used my Macbook Pro to create Mavericks bootable USB and then tried to boot my Macbook Air again from that USB but no luck.

Moreover, I even used CloneZilla to backup the OSX hard drive on the Macbook Pro and then restored it to the OSX hard drive on the Macbook Air, and I still got the prohibition sign booting from the hard drive of the Macbook Air.

Therefore, I assumed that the root cause is not the problem with the version of OSX. As the bootable USB made on my Macbook Pro worked only with that machine, I thought it might be the version of the OS or/and the machine that we used to create the bootable USB is the problem. Hence, I used my Macbook Air running MacOS Sierra to create the bootable USB from the Mavericks installation file (DMG) instead (using Disk Utilities application). Bingo! it worked.

Monday, December 5, 2016

My experience with creating database in MySQL

I'm using Mac OS X Lion v10.7 and writing MySQL script to generate tables for my assignment project, Library Management.

Creating table

create table member(
 id varchar(16) not null,
 first_name varchar(128) not null,
 last_name varchar(128) not null,
 sex enum('M', 'F') not null,
 date_created timestamp not null,
 date_updated timestamp not null,
 primary key (id)
) engine=innodb default charset=utf8;

create table book (
 id bigint not null,
 ddc varchar(45) not null,
 title varchar(255) not null,
 author varchar(128) not null,
 year_published smallint not null,
 primary key (id)
) engine=innodb default charset=utf8;

create table borrow (
 member_id varchar(16) not null,
 book_id bigint not null,
 date_borrowed timestamp not null,
 date_returned timestamp,
 primary key (member_id, book_id, date_borrowed),
 foreign key (member_id) references member(id),
 foreign key (book_id) references book(id)
) engine=innodb default charset=utf8;

- There are a set of integer data types: tinyint(-128 to 127), smallint(-32768 to 32767), mediumint(-8388608 to 8388607)int(-2147483648 to 2147483647), and bigint.
- The option "default charset=utf8" allows me to store characters in many languages such as Spanish.
- From MySQL v5.7 and up, innodb is the default storage engine. It can handle concurrent transactions while myisam cannot.




Entity Relationship Diagram Drawing Tool

I'm using Mac OS X Lion v10.7 and the program I'm using to draw ER diagram is Dia (or download it from here). It's open source and support all platforms (Windows, Mac, and Linux). For the current version of Mac OS X I'm using, it asked me to install additional program called XQuartz (or you can download it from here) and re-login before I could use Dia.

Alternatively, you can use this online tool https://www.draw.io/

Wednesday, November 30, 2016

How I download the old version of OSX

The old versions of OSX such as Lion v10.7 is available on AppStore but you have to purchase it. I download it free from here

Create Clonezilla Live Partition (not a whole USB drive)

I used Tuxboot from within Ubuntu to create Clonezilla Live USB drive. Then, I have an external hard disk drive with multiple partitions. I used Disk Utility in Mac OSX Lion to clone the Clonezilla Live USB drive to one of the partitions but it failed.

Then, I used Carbon Copy Cloner to clone the entire USB drive to the partition instead and it worked.

Sunday, November 27, 2016

Checking for Windows update takes forever

In Control Panel, I clicked the Check for Updates button and it took forever. According to https://www.youtube.com/watch?v=WFfc22x3I_s, there are 4 methods. I think the 4th method is the best but it might be affected by the previous methods too so you might need to do all the methods orderly.

1. Run Command Prompt as Adminstrator and execute the following command:
> ipconfig /flushdns

2. Download and install Windows Client Update based on your machine architecture (32 bits or 64 bits). Type the following command in the Comand Prompt to see it:
> wmic os get osarchitecture

3. Stop the windows update service by running the following command adn then download and install Windows Update Diagnostic
> net stop wuauserv

4. Install Windows update offline by downloading it from here http://download.wsusoffline.net/ and run it then:
- Under Windows tab, select "x64 Global (Multilingual updates)" checkbox
- For Options checkbox, select "Include Service Packs" and "Include Windows Defender definitions"
And then click Start button. It will start Command Prompt program and download the necessary updates.
- Go to the installation files again and then client directory and run UpdateInstaller.exe. When the program starts, check Automatic reboot and recall checkbox and click Start button.


Monday, October 24, 2016

Install Khmer Unicode Keyboard on Mac OSX Lion v10.7

Installing Khmer Unicode Keyboard

Khmer font was added by default on Mac OSX Lion v10.7 but you have to enable it by go to
- System Preferences then Language & Text
- Under Input Sources tab, check Khmer from the "Select input sources to use." pane.



Or you can also download the keyboard layout and install it from Cambosastra website (read its instruction).  

Problems

1. The Khmer keyboard layout come within OSX maps 'F' key to letter 'ផ' instead of 'ថ' so you should use the layout from Cambosastra team instead by selecting 'Khmer V2' in Keyboard preferences.

2. In Microsoft Word, the Apple's Khmer font named "Khmer Sangam MN" is broken; It does not display correctly when you type. You should install another font such as Koh Santepheap. You can download it from here too.


Create shortcut key to switch between languages

- Go to System Preferences then Keyboard and click on Keyboard Shortcuts tab
- Then, click on Keyboard & Text at the right sidebar and check "Select the previous input source" and then modify its shortcut key to Shirt + Command + Space. Then, make sure "Select next source in Input menu" is unchecked. Then, change the shortcut



- After that, click on Spotlight then check "Show Spotlight search field" and change its shortcut key to Command + Space and make sure "Show Spotlight window" is unchecked






References

- http://www.cambosastra.org/how-to-set-up-khmer-unicode-for-mac/


Monday, September 5, 2016

Depth First Search, Breadth First Search and Uniform Cost Search Algorithms

Before knowing Uniform Cost Search (UCS) algorithm, we should know about Depth First Search (DFS) and Breadth First Search (BFS).

DFS is an algorithm to search a graph for a path from one vertex (node) to another. It just tells you if there is a path or not, nothing more. There can be many paths from one vertex to another. It will just choose one that it meets first; it doesn't care about how long the path is. The pseudocode to implement this algorithm uses an array variable to store the nodes that have been already explored so that the search won't go back to the already explored nodes. We still another (Map) variable to trackback the path or to know the parent or preceding node of the current node. There can be more than parent or preceding nodes but there is only one that the search crosses to reach the current node.




BFS is also an algorithm to search for a path in a graph or tree. It is based on DFS but it can find the shortest path. In processing, DFS uses stack data structure but BFS uses queue data structure. In the pseudocode from my teacher below looks like it does not have anything to do with path cost. And the only difference between it and DFS's pseudocode is frontier variable uses queue, not stack.




UCS use priority queue to store the explored nodes and their cumulative path costs so that it can find the shortest path. I'm not sure how BFS is different from UCS. The algorithm below is from my teacher. In the third line from top and another third line from bottom, it should have said cumulative PATH-COST instead of only PATH-COST.






My homework is to implement DFS, BFS and then UCS in R programming. The source code can be found here https://github.com/vathanakmao/ai-assignments



Sunday, September 4, 2016

Heapsort Algorithm

What is heap?

Heap is an untidy pile of mass of things, for example, a heap of clothes/rubbish. In data structure, a heap is tree-based data structure that satisfies the heap property: if A is a parent of node B then the key (the value) of node A is ordered with the respect of the key of node B with the same ordering applying to the heap.

Heap can be divided into 2 categories: max heap and min heap. In max heap, the max-heap property means that the keys of parent nodes are always greater than or equal to those of the children and the highest key is in the root node. In min heap, the min-heap property means that the keys of parent nodes are always less than or equal to those of the children and the lowest key is in the root node.

Algorithm

The items are stored in an array but we logically convert it to a tree.


The below algorithm of how to find the indices of the left and right children of a (parent) node. For example, node 16 has two children, node 14 and node 10.

The max-heapify operation (function) makes sure the child nodes are not greater than their parents but it doesn't go through all the nodes, just one path straight down to the children. We need another function to call this function in a loop (build-max-heap operation).














Below is the example of how max-heapify operation make change to the tree.



The build-max-heap operation (function) makes sure all nodes in the binary tree satisfy the max-heap property. In other words, the keys of child nodes must be less than or equals to the key of parent node.



Below is the example of how the build-max-heap operation make change to the tree.

























The heapsort() function below will sort the tree completely.



Below is the example of how the tree is sorted step by step.




I have implemented it in Java for learning purpose. You can find the source code here: https://github.com/vathanakmao/sort-algorithms.git





References
Book: Introduction to Algorithms (3rd edition), Thomas H. Cormen, Charles E. Leiserson, ...


Friday, August 5, 2016

Desktop notification for GMail on Mac

I'm using Mac OS X Lion 10.7 and I want a desktop notification when there is a new mail in my Gmail account. I'm using Mail Notifr (formerly Gmail Notifr). It has the old version worked with OSX 10.7. DOWNLOAD

The problem is when you add a Gmail account and type password wrong, it does nothing. I typed my password wrong and it didn't alert me so i thought it's correct but I didn't get any notifications at all.


Thursday, July 28, 2016

CalDAV server can't log into Google with iCal

I was trying to add Google account in iCal so that iCal will synchronize events to my Google account but I got the error message "iCal found a CalDAV server but couldn't log in with the user name 'myuse...@gmail.com'. Make sure the user name and password you entered are correct, then try again.". I did verify the password and it was correct.

Then, when i checked my email, Google had just sent me one to tell me that it had blocked an app from logging into my Google account because it used less secured method. It asked me if I want to allow access to the app and then i clicked on the Allow Access button and it redirected me to this page https://www.google.com/settings/security/lesssecureapps?rfn=27&rfnc=1&asae=2&anexp=lbe2-R1_C I checked "Turn On" for "Access for less secure apps" optionbox.

Monday, June 20, 2016

How to create a WiFi Hotspot on a desktop computer

I was surprised today that my friend had just turned the desktop computer in my classroom into a WiFi hotspot. In other words, the computer connects to internet through Ethernet cable but he shared the internet connection to other devices via WiFi network card. I've never known that before. However, it's not new because this technology has been used on mobile phones for years.

I think to be able to do that we need a WiFi network card and then an application to enable that feature. I used Baidu because it's free and it allows unlimited clients connected to the hotspot.

Sunday, April 24, 2016

Post-installation configuration (also reduce heat) for Windows 7/8 on Macbook Pro

After installing Windows 7 on Macbook Pro 13 inch late 2011, most of the things work out of the box using Boot Camp drivers. However, there are still things you need to manually configure to make them work well such as:

HOT TEMPERATURE NOTE

I'm not sure if they are the cause of the problem, but I made the change and my machine cooled down a lot. Seems like Windows has many more services that do disk activities even when the machine is idle such as indexing, defrag scheduler, and Windows Defender. This cause the disk much hotter than on Mac OS then the rest palm area is very warm all the time.
- Don't use third-party anti-virus program. Use Windows Defender, but turn off Real Time Protection or completely disable this program.
- Go to Control Panel, Power Options, and click on Change Plan Settings. Then, click on "Change advance power settings" and select "Process power management" item from the listbox. Set "Maximum processor state to 97%" and "System cooling polcy" to "Passive" for both "Plugged in" and "On battery".
- Disable Adobe Flash Player in all browsers
- Install Power Plan Assistance (i installed it to turn off backlid keyboard automatically when login but the temperature seemed to reduce too)
- Go to Control Panel > Administrative Tools > Task Scheduler > Task Scheduler Library > Microsoft > Windows > Defrag > then disable the "ScheduledDefrag"
- Disable PreFetch and SuperFetch
- Go to Control Panel > System > Advanced system settings > Advance > Settings > Custom and check only: "Animate controls and elements inside windows", "Fade out menu items after clicking", "Show shadows under windows", "Show thumbnails instead of icons", "Slide open combo boxes", "Smooth edges of screen fonts", "Smooth-scroll list boxes"
- Reduce CPU usage and Disk Activity in Chrome by disable "Enable phising and maleware protection"
- Turn off "Auto-play video" feature on Facebook
- Perform the step in Disable Unnecessary Services section below

Increase SSD's lifespan

Reducing read/write operations does increase the lifespan of SSD. Turning off some services such as indexing, hibernation, and automatic defragmentation not only reduce the heat but also increase the SSD's lifespan.

SMC Fan

What i hate about Lubbo's Fan Control is you have to put it in Startup menu yourself to make start automatically when login and its GUI will open too. It does not minimize in system tray automatically. MacFan Control beat it to this. Then, I configure the fan speed based sensor CPU Core 1. Min value is 35 degree celsius and max value is 83 celsius so that the fan speed is never below 4200 even if the machine is idle.

Power Saver

I enable Power Saver mode in Control Panel. Then, I click on Change plan setting and Change advance power settings. Then, under Processor Power Management, I set Maximum Processor State to 90% when On Battery and Minimum Processor State to 5% for both On battery and Plugged in.

Reduce Animations

Open Control Panel, then Ease of Access and Ease of Access Center. Then check the option "Turn off all unnecessary animations (when possible)"

Disable Indexing Search (to improve performance or might reduce heat)
1. Open Windows Explorer and right click on the drive you want to stop indexing then select Properties. After than, uncheck "Allow files on this drive to have contents indexed in addition to file properties" and click OK.
2. Disable Windows Indexing service in services.msc.

Disable Unnecessary Services

Start "services.msc" program and stop and disable the following services (reference):
- Windows Update
- Google Update Service
- Server
- Computer Browser
TCP/IP NetBIOS Helper
Windows Error Reporting Service
Windows Image Acquisition (WIA) (If you don't have a scanner)
- Windows Search (If you don't use Windows built-in Search feature frequently)
Print Spooler (If you don't have a printer)
IP Helper (If you don't use IPv6 connection)
- Diagnostic Policy Service
- Superfetch
** You might also try registry tweak here to make it faster and so not hotter.

Remap Keys

- To remap the right Command key to Control key, you can use sharpkeys.codeplex.com



Thursday, April 21, 2016

Installing Khmer Unicode Font on Windows 7

1. Download the installation file from here and install it
2. Manually install the fonts
   - Download fonts LimonS1 and LimonR1
   - Double click on them and click on Install button

Configuring Ubuntu 15.04 on Macbook Pro 13 Inch Late 2011

Most of things work out of the box for Ubuntu 15 on Macbook Pro but there are still something you have to fix.

Keyboard backlight is reset to maximum every time I reboot


Put the following command in /etc/rc.local file just before 'exit 0':
chmod 777 /sys/class/leds/smc::kbd_backlight/brightness
Then add the following command in /etc/profile file:
echo 0 | tee /sys/class/leds/smc::kbd_backlight/brightness

Note that we can just put the second command in /etc/rc.local and it should work but I don't know why the content of the file is reset back when I enter the login screen every reboot.

Reverse function keys


To use 'fn' key in combination with function keys to turn on or off volume for example, you must put the following command in /etc/rc.local just before 'exit 0':
chmod 777 /sys/module/hid_apple/parameters/fnmode
Then, add the following command in /etc/profile file:
echo 2 | tee /sys/module/hid_apple/parameters/fnmode

Trackpad


For drag and drop, just use your index finger to click and hold the trackpad and move your middle finger for dragging.

In my case, 3-finger tap for making middle click does not work so I have to configure it in the default synaptics driver settings. You can use synclient program to make the real-time change to the settings but just temporarily.
synclient TapButton1=1
synclient TapButton2=3
synclient TapButton3=2
synclient ClickFinger3=2
1, 2, and 3 mean left, middle, and right buttons respectively. To make permanent change, you can put those commands in a script file, /usr/share/mysynclients.sh for example and then add it to Startup Application. Or you can try to modify xorg.conf file but it made palm detection not work well. However, if you want to do it, you can put the following codes in /usr/share/X11/xorg.conf.d/50-synaptics.conf file as following:
Section "InputClass"
        Identifier "Default clickpad buttons"
        MatchDriver "synaptics"
        Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
        Option "SecondarySoftButtonAreas" "58% 0 0 15% 42% 58% 0 15%"
        Option "TapButton1" "1"
        Option "TapButton2" "3"
        Option "TapButton3" "2"
EndSection
But, it might not work as the Gnome setting daemon in /etc/X11/xorg.conf file will override existing settings in /usr/share/X11/xorg.conf.d/50-synaptics.conf. You can fix it by:
> sudo apt-get install dconf-editor
> dconf-editor
And then, browse to /org/gnome/settings-daemon/plugins/mouse/ (or /org/cinnamon/settings-daemon/plugins/mouse/ for cinnamon) in the editor and uncheck Active checkbox. Then, reboot.

Disable locked drags
synclient TapAndDragGesture=OFF

Sensors (Fan)


coretemp allows lm-sensor detect the other sensors such as the rotation speed of the fan and the GPU temperature. Typing the following command will activate the coretemp in next reboot:
sudo modprobe coretemp
You should use fan controller daemon included in the mactel-support ppa called macfanctl.
sudo add-apt-repository ppa:mactel-support/ppa 
sudo apt-get update
sudo apt-get install macfanctld

You can change the minimum fan speed in this file /etc/macfanctl.conf.

Others

For more configurations for such as battery saving (or you can install indicator-cpufreq), go read this.



Related Articles:
http://myt8chnote.blogspot.com/2016/04/installing-ubuntu-on-macbook-pro-using.html

Monday, April 18, 2016

Where is Java home on Mac OS X?

I'm using Mac OS X Lion v10.7 and I have downloaded Java 8 DMG file from Oracle's web site and installed it. After installing it, i can't find Java home directory. According to http://stackoverflow.com/questions/1348842/what-should-i-set-java-home-to-on-osx, there is an executable file that print Java home location to console by default, /usr/libexec/java_home.

> ls -l /usr/libexec/java_home
lrwxr-xr-x  1 root  wheel  79 Apr  7 17:03 /usr/libexec/java_home -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home
> /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home

And then you can set JAVA_HOME variable in /etc/profile file as following:
> export JAVA_HOME=$(/usr/libexec/java_home)


Add favorite folder to Finder's sidebar

To add a favorite folder to the Finder's side bar on Mac OSX Lion v10.7, we can just simply drag that folder in Finder to the sidebar. ;)

Saturday, April 9, 2016

How I backup/clone all drives of my Macbook Pro

I'm running OS X Lion v10.7 on Macbook Pro 13 inch late 2011. I have installed 3 operating systems on it such as Mac OS X Lion, Windows 7, and Ubuntu 15.04. To avoid problems in the future such as disk failure, I have backup my drive as following:

1. Mac OS X Lion is my primary OS and I use Carbon Copy Cloner to clone the partition to external hard disk drive so I can boot OS X from the external HDD any time to restore the partition.

2. To backup and restore Windows 7, I must do it from within OS X using Winclone app version 4.x.

3. For Ubuntu, I used Clonezilla to backup/restore the partition it was installed on to/from image files. I installed Clonezilla Live on a USB drive so that I can boot into Clonezilla from that USB by not depending on any operating systems. According to Clonezilla's official website, I made the bootable USB on Ubuntu using Tuxboot program. There are 2 methods to make a Clonezilla live USB by Tuxboot, online (downloading) and offline (ISO file). I used the online method in which Tuxboot downloaded the latest Clonezilla live for me and wrote it to my USB drive.

I think I should use only Clonezilla to backup/restore all partitions of my Macbook Pro.


Installing Ubuntu on Macbook Pro using bootable USB stick

I'm using Macbook Pro 13 inch late 2011 and I have just installed Ubuntu 15.04 on it successfully using a bootable USB stick. I followed this post http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx to make a bootable USB stick. When restarting machine, I hold option key until I see an option to boot from the USB drive. Surprisingly, it worked only for Ubuntu 15.04 ISO file I downloaded from Ubuntu's web site. For other previous versions such as 10.04 and 11.10, the USB drive is not bootable at all (it didn't show up boot menu).

Note that if you have an external hard drive and want to put Ubuntu Live on that partition to make it bootable, it wouldn't work. You can only do it with the entire USB drive.


Related Articles:
http://myt8chnote.blogspot.com/2016/04/problems-with-ubuntu-1504-on-macbook.html

Thursday, April 7, 2016

A workaround for setting up Windows 7 on Macbook Pro without optical drive

I want to make an update on the post i wrote here http://myt8chnote.blogspot.com/2016/04/installing-windows-7-on-macbook-pro.html After rebooting several time, the Windows partition was corrupted and then i also tried to do it the same way again many times but it no longer worked. I have just found a workaround for that.

As my Macbook Pro only boot from the USB drive that has OSX on it, I used Carbon Copy Clone to clone or backup my OSX partition to the external hard drive so if anything happens, I can use it to restore the main OSX partition.

I also have Windows installed along side the OS X. I downloaded the Winclone image file of Windows 7 from thepiratebay.se web site and use Winclone app on Mac OS X to restore the image file to another partition then the partition is bootable too.

NOTE: resizing partition might corrupt your Windows 7 installed even if the partition is not the one you installed Windows on.

Monday, April 4, 2016

How to prevent partition from mounting automatically on OS X Lion

You might have another OS installed a long side OS X and don't want to mount it when starting OS X to avoid modifying it accidentally which can corrupt the OS. To prevent the partition from mounting automatically, you can do as followings:

See which volume you don't want to be mounted automatically from the output of the command below.
> diskutil list

From the following command, note the Volume Name and Type (Bundle) attributes.
> diskutil info /Volumes/<Win7>
   Device Identifier:        disk0s6
   Device Node:              /dev/disk0s6
   Part of Whole:            disk0
   Device / Media Name:      BOOTCAM

   Volume Name:              Win7
   Escaped with Unicode:     Win7

   Mounted:                  Yes
   Mount Point:              /Volumes/Win7
   Escaped with Unicode:     /Volumes/Win7

   File System Personality:  Tuxera NTFS
   Type (Bundle):            fusefs_txantfs
   Name (User Visible):      Windows NT Filesystem (Tuxera NTFS)

Create or edit /etc/fstab file
> sudo nano /etc/fstab
LABEL=Win7      none    fusefs_txantfs  ro,noauto       0       0

Then, reboot machine. That's it.




Problems I solved:
At first, I put ntfs instead of fusefs_txantfs in /etc/fstab file then it didn't work. I changed it to fusefs_txantfs and it worked.




Sunday, March 27, 2016

How did I stop my macbook pro from overheating

I'm using 13-inch Macbook Pro late 2011 so it's about 4 years old now. I noticed that my Macbook get very hot quickly after using it for about 1 or 2 hours. Note that I didn't use any strange applications. There were just a few tabs of Chrome open and I didn't even watch videos. In particularly, I checked the Activity Monitor and the CPU usage is never above 30%. But, it's very hot on the back case cover and very warm at the palm-rest area and keyboard. It doesn't burn my hands but it's not comfortable to type. I can't keep my hands on the palm-rest area for more than 10 or 15 minutes. The heat first came from the top left area of the macbook pro near the charging cord. Then, it spread to everywhere such as the bottom, the keyboard and the palm-rest area. I have tried many ways to fix it.

First, I turned off WiFi and used Ethernet instead but it didn't help. Then, I used it for hours without charging because I thought there might be the problem with the charger but it wasn't. I used keyboard cover so i thought it also contribute to the heat so i removed it and the heat just decreased a few degrees. I then downloaded smcFanControl app to make the fan run faster even when normal usage but it still didn't help. I heard that reapplying thermal paste would help cool down my macbook dramatically and then I did it but still no luck. I also run Hardware Test but they were all fine. Resetting System Management Control (SMC) didn't help either.

One day I went to a coffee shop and use my Macbook for hours without feeling hot at all. It was hot a bit at the bottom case but the keyboard and palm-rest area are ok. Whenever i use it at my house, it get hot quickly. Then, i noticed that the difference between my house and the coffee shop is temperature. I don't usually use air conditioning so temperature in my room is about 35 degree celsius and it hurt my macbook pro. Then, I turned on air conditioning in my room and used my macbook pro for hours and the keyboard and palm-rest area are cool. They're very comfortable for typing. The temperature was 25 degree celsius. Therefore, Macbook Pro should be used in cold area, i guess. But, using macbook pro with air conditioning on is very expensive and it's not a solution so i kept searching.

A few days later, I started debugging the problem again. I wanted to know if leaving the back case cover off would help so I let stand on its right (see the image below) and remove the base case off without turning off my macbook pro. I waited for about 15 minutes and it cooled down and it was very comfortable to type. This may be because there was enough air flow in to help cool down the logic board faster as the heat came from the CPU. After that i wanted to know if it still help when i let it stand like that but the back case is off and it was still cold so i assumed there was bigger gap between the logic board and the back case cover while it was standing on it's right side and allowed more air flow.



To create a gap between the logic board and the back case cover, i put pieces of paper in the case on the battery and CD ROM. See the image below. Bingo, it did the trick. I call this a workaround, not a solution. I will find anything safer than paper to put in there though paper seems fine to me.




Summary

There are three things I've done:
1. Put pieces of paper to make a gap between the back case cover and the logic board so that there is more air flow to cool down the temperature in the case faster. Or you don't need to put the papers but you can remove the optical drive instead. The later is not as very efficient as the former but the overall temperature in the case is better so it won't hurt the logic board much.
2. Use smcFanConrol app. I make the fan spin 4000 rpm. I heard that using smcFanControl will do damage to your fan but i think it's ok for me as my macbook is 4 years old now and i would rather replacing fan than logic board. However, there is no proof yet. In particularly, you can quit the app if you're in the room with air conditioning.
3. The two steps above will help reduce the heat dramatically but you still feel a little bit warm. You should also use PalmGuard to the heat almost completely.