Profile

Click to view full profile
Hi, I'm Veerapat Sriarunrungrueang, an expert in technology field, especially full stack web development and performance testing.This is my coding diary. I usually develop and keep code snippets or some tricks, and update to this diary when I have time. Nowadays, I've been giving counsel to many well-known firms in Thailand.
view more...

Friday, April 29, 2011

Using Fences to organize your desktop shortcuts

Recently, I had a problem with the shortcuts on the desktop. I usually connect my laptop to an external monitor, so the resolution usually changes. The problem was that my shortcuts arrangement also changed! Now, I have a solution you can use Fences to organize your shortcuts, and it can remember the shortcuts arrangement.

Download at: http://download.cnet.com/Fences/3000-2072_4-10909535.html

The Fences Example

Monday, April 25, 2011

Cut Automator script for Mac with Automator

One thing that caused a lot of problems for me in Mac is there is no "cut" short key like "ctrl+x" in Windows. I had to dragged items, sometimes it's hard to do like that. So far, I tried to develop "Cut Script" with Automator. It can be used by using right clicking to the item, then select the path to move.

You can create it as following steps:
1. Open Automator from your Application.
2. Service receives selected change to "files or folders" and in to "Finder".
3. Drag "Get Selected Finder Items" to the Automator space.
4. Drag "Set Value of Variable", and change its name to "item".
5. Drag "Apple Script".
Step 3-5
6. Drag "Ask for Finder Items", and change type(Type:) to "Folders".
7. Drag "Set Value of Variable", and change its name to "path".
8. Drag "Apple Script".

Step 6-8
9. Drag "Get Value of Variable", and change its name to "item".
10. Drag "Move Finder Items", and change to(To:) to "path".

Step 9-10
Download

In addition, you can also download it, and then place it into your profile service folder (~/Users/[User]/Library/Services/).
Now, you can move your file faster with easy steps. Don't have to drag anymore!

Saturday, April 2, 2011

How to install Python Imaging Library (PIL)

Python Imaging Library is a library for doing image processing tasks just as its name. In Windows you can install it easily by downloading PIL windows installer, but in Linux and Mac are more harder. You have to compile and install it from a source package. PIL also need other libraries in order to install it completely as followings: JPG, Freetype, LittleCMS 1.19 NOT 2.0+.

In Linux, you may install those libraries via your command line. For example, sudo apt-get install (Ubuntu). Then, install PIL.

However, in Mac, you have to install Xcode and X11 to make your Mac can use "./configure" and "make" command. After that, installing MacPorts or Fink which allow you to get those required libraries and download them via command line (use "port install" or "fink install" respectively). Finally, install PIL after installing dependent libraries.


You can download PIL from here (all platforms): from http://www.pythonware.com/products/pil/

To install PIL from source package do steps follows:
1. Change current directory of your terminal under PIL source folder.
2. Type "sudo python setup.py build_ext i".
3. Run the test "python selftest.py".
4. If everything is fine, then install it by typing  "sudo python setup.py install".

Then, you should run PIL example code to make sure installation is complete. If not or in the case that you already installed PIL, you need to delete its package from site-package in python library. Then, you have to extract PIL source package from zip file again (do not use older extracted folder because it won't work for sure). Build it again, then install.

p.s. Required libraries: libjpeg, freetype, lcms