Skip to content


ThinkFinger

Thinkpad Finger-print for Ubuntu

เพิ่งได้ thinkpad X200si มาใช้ครับ ก็เลยหาวิธีลง Finger-print สำหรับ Ubuntu ครับ
จึงเอา link มาฝากกันครับ https://wiki.ubuntu.com/ThinkFinger


This is protected content. Please Login or Register for access.


(ขอเก็บเนื้อหาไว้สำหรับใช้ส่วนตัว ตามลิขสิทธิ์ครับ) กด link เพื่อไปดูได้เลยครับ

Posted in Uncategorized.

วาดภาพบน HTML5

ถ้าคุณอยากมีโปรแกรมวาดภาพซักตัวบนเวป โดยที่คุณไม่ต้องใช้ flash คุณสามารถลองใช้ http://mugtug.com/sketchpad/ ตัวนี้ได้เลยครับ

Posted in HTML & CSS, Programming.

รูปในเวปผมหายไปไหน

เมื่อหลายวันก่อนผมทำการแก้ไขเวปเซอร์วิช ซึ่งเป็น web-apllication ตัวหนึ่งที่ผมดูและอยู่ ปรากฏว่ารูปที่เป็นส่วนประกอบของผมหายไปอย่างลึกลับเมื่อผู้ใช้งานทั่วไปเข้าไปใช้ ซึ่งในเบื้องต้น ผมใช้ ubuntu+firefox ไม่เกิดข้อผิดพลาดใดๆ ในกรณีดังกล่าว จะเป็นเฉพาะ HTTP over SSL (HTTPS)

สาเหตุ

สาเหตุก็เป็นเพราะว่า รูปผมมันเป็น http แต่เวปมันเป็น https บราวเซอร์จะไม่ยอมโหลดรูปให้ ปัญหาดังกล่าวจะเป็นเกือบทุกบราวเซอร์ โดยบางเครื่องอาจมีการถามก่อนว่าจะโหลดหรือไม่ ตามแต่ผู้ใช้งานจะเป็นผู้ตั้งไว้ แต่จุดที่สังเกตได้ง่ายๆ คือด้านมุมขวาล่าง จะมีรูปแม่กุญแจอยู่ ถ้าเป็นกรณีนี่มีการโหลด http บนเวป https จะมีรูปเครื่องหมายตกใจสีแดงปรากฎอยู่บนรูปแม่กุญแจนั้น

วิธีแก้ไข

วิธีแก้ไขที่ดีที่สุดน่าจะอยู่ที่ตัวผู้เขียนเวปเอง โดยทำการกำหนด link ต่างๆ ในหน้าเวปของเราให้เป็น https ซะ

Posted in HTML & CSS, Programming, Uncategorized.

Download file over SSL Error with Internet Explorer

เมื่ออาทิตย์ก่อน ผมเจอปัญหาที่ทำอยู่ที่ทำงานครับ ซึ่งงานผมเป็น service ที่ทำงานอยู่บน SSL หรือพูดให้ฟังดูง่ายๆ คือ https นั้นเอง ปัญหาที่ผมกับผู้ใช้งานเซอร์วิชก็คือ ไม่สามารถดาวโหลดแฟ้มข้อมูลได้

ปัญหา

ไม่สามารถโหลดไฟล์ผ่าน SSL  โดยปัญหานี้พบกับเฉพาะ Internet Explorer 7 (IE7 โดย IE รุ่นอื่น ยังไม่ได้รับรายงานปัญหาดังกล่าว) ส่วนบราวเซอร์ตัวอื่นยังไม่พบปัญหาเช่นนี้ โดย error ที่พบ IE จะขึ้นมาที่ผู้ใช้ว่า “the file could not be written to the cache” ทำให้ไม่สามารถดาวโหลดไฟล์ได้

วิธีการแก้ไข

สามารถเลือกแก้ไขได้โดยวิธีใดวิธีหนึ่งดังนี้

สำหรับ server admin หรือ webmaster

ห้ามใส่ cache-control หรือ pragma: no-cache ลงใน header ของ http ในส่วนที่เป็น oct-stream หรือ file-download

สำหรับ client (ผมยังไม่ได้ลองครับ)

เข้าไป uncheck ตามลำดับดังนี้ IE Tools -> Internet Options -> Advanced -> Security -> Do not save encrypted
pages to disk

Posted in HTML & CSS, PHP. Tagged with .

การเขียน makefile

วันนี้ได้ทำการเขียน makefile ใหม่ให้มีประสิทธิ์ภาพมากขึ้น โดยการใช้ inference rules จึงไปค้นหาเวปมาได้เวปดีๆ คือ
http://www-cip.physik.uni-bonn.de/pool/infos/make/advanced.html


Getting started with Makefiles: Advanced features


1. What are macros and why should I use them?

Think of programs that shall be used at different locations: CERN, DESY, SLAC, University of Bonn, … The C/C++ programs are highly portable (at least after some effort) but the names of the programs used to compile them – as well as their arguments – may be very different. So it would be nice to once give the program name, the list of arguments, etc. and then only use symbolic names so that you can rapidly adjust to the local computing environment. Those symbolic names are called “macros”. Let’s recall Makefile5.

.IGNORE:
.SILENT:mirror:    input.o mirror.o process.o output.o
g++ -o mirror input.o mirror.o process.o output.o

mirror.o:  mirror.cc
g++ -c -Wall mirror.cc

input.o:   input.cc
g++ -c -Wall input.cc

output.o:  output.cc
g++ -c -Wall output.cc

process.o: process.cc
g++ -c -Wall process.cc

clean:
rm -f *.o core

distclean:
make clean
rm -f mirror

again:
make distclean
make mirror

All object files are made using g++. On other machines that may be cxx, cpp, or something the like. So let’s define a macro for the C++ compiler:

C++ = g++

The command line options are also different for different compilers so it’s a good idea to have a macro for them:

C++-Flags = -c -Wall

On some machines the command to remove files is rm (or rm -f), on others del, some use delete, some erase, and some even discard.So that’s another candidate for a macro:

RM = rm -f

Even make may not always be called make (though I know of no system where this is the case):

MAKE = make

In our example the linker is also g++. In general that need not be the case. So we define the following two macros:

LINKER       = g++
LINKER-FLAGS = -o

The meaning of the following two macros is obvious:

OBJS   = input.o mirror.o process.o output.o
TARGET = mirror

After these changes the present state of the Makefile is Makefile6:

C++          = g++
C++-FLAGS    = -c -Wall
LINKER       = g++
LINKER-FLAGS = -o
RM           = rm -f
MAKE         = make
OBJS         = input.o mirror.o process.o output.o
TARGET       = mirror.IGNORE:
.SILENT:

$(TARGET): $(OBJS)
$(LINKER) $(LINKER-FLAGS) $(TARGET) $(OBJS)

mirror.o:  mirror.cc
$(C++) $(C++-FLAGS) mirror.cc

input.o:   input.cc
$(C++) $(C++-FLAGS) input.cc

output.o:  output.cc
$(C++) $(C++-FLAGS) output.cc

process.o: process.cc
$(C++) $(C++-FLAGS) process.cc

clean:
$(RM) *.o core

distclean:
$(MAKE) clean
$(RM) $(TARGET)

again:
$(MAKE) distclean
$(MAKE) $(TARGET)

2. What are inference rules and what are they good for?

If you have a close look at the rules to make mirror.o, input.o, output.o, and process.o you see that they are all the same:

<filename>.o: <filename>.cc
$(C++) $(C++-FLAGS) <filename>.cc

To avoid all these lenthy entries in a Makefile there are inference rules: They describe the ‘standard procedure’ of making files of type b from files of type a. In this case the rule to make an object file from a given C++ file is

.cc.o:
$(C++) $(C++-FLAGS) $<

or alternatively you could use

.cc.o:
$(C++) $(C++-FLAGS) $*.cc

It’s easy to see what $< and $* mean but I’ll come back to that in just a moment. First I will change the rule for making the target ‘mirror’ so that it makes use of another strange-looking predefined macros:

$(TARGET): $(OBJS)
$(LINKER) $(LINKER-FLAGS) $@ $(OBJ)

Now let’s have a look at the meaning of $*, $<, and $@:

$* ist the current target without an extension (the base file name) with path. For example, in

input.o: input.cc
$(C++) $(C++-FLAGS) $*.cc

the value of $* is input. $* is commonly used only in inference rules and command lines.

$@ is the current target (including extension, if any). For example, in

mirror: $(OBJS)
$(LINKER) $(LINKER-FLAGS) $@ $(OBJS)

the value of $@ is mirror.

$< is a dependent file out-of date with the target file. For example,

.cc.o:
$(C++) $(C++-FLAGS) $*.cc

Notice that $<, in an inference rule such as .cc.o, is equivalent to $*.cc (as already mentioned).

Just to remind you: Your Makefile should now look like Makefile7:

C++          = g++
C++-FLAGS    = -c -Wall
LINKER       = g++
LINKER-FLAGS = -o
RM           = rm -f
MAKE         = make
OBJS         = input.o mirror.o process.o output.o
TARGET       = mirror.IGNORE:
.SILENT:

$(TARGET): $(OBJS)
$(LINKER) $(LINKER-FLAGS) $@ $(OBJS)

.cc.o:
$(C++) $(C++-FLAGS) $<

clean:
$(RM) *.o core

distclean:
$(MAKE) clean
$(RM) $(TARGET)

again:
$(MAKE) distclean
$(MAKE) $(TARGET)

3. Continuation lines

If your project consists of a great number of files (or you need lots of options) you may wish to split lines. Another reason for splitting lines is increasing the readability of your Makefile (don’t underestimate that point!).  In Makefile7 you could change the line reading

OBJS = input.o mirror.o process.o output.o

to read

OBJS = input.o   \
mirror.o  \
process.o \
output.o

4.  Comments

You can also add comments to your Makefile like the ones in Makefile8:

C++          = g++           # use GNU C++ compiler
C++-FLAGS    = -c -Wall      # warn all
LINKER       = g++           # use GNU C++ as linker
LINKER-FLAGS = -o            # flags for linker
RM           = rm -f         # how to remove files
MAKE         = make          # name of make utility
# you cannot add comments after the continuation character!
OBJS         = input.o   \
mirror.o  \
process.o \
output.o
TARGET       = mirror        # name of executable .IGNORE:                     # ignore problems (as far as possible)
.SILENT:                     # don't echo commands executed

$(TARGET):  $(OBJS)
$(LINKER) $(LINKER-FLAGS) $@ $(OBJS)

.cc.o:
$(C++) $(C++-FLAGS) $<

# remove object files and core (if any)
clean:
$(RM) *.o core

# remove object files, core dump, and executable (if any)
distclean:
$(MAKE) clean
$(RM) $(TARGET)

# remove object files, core dump, and executable (if any) and
# make them again.
again:
$(MAKE) distclean
$(MAKE) $(TARGET)

5. The .SUFFIXES pseudo target

make comes with a couple of predefined rules how to make certain files. To get rid of them simply use

.SUFFIXES:

If you do that you have to list all suffixes that your Makefile does support. In the above case that would be

.SUFFIXES: .o .cc

You can also use .SUFFIXES to add rules to the predefined ones (in precisely the same manner as in the example above).

6. Using environment variables

You can use environment variables in the same way as macros (besides that they are defined outside the Makefile):

info:
echo $(USER)

Surely this is not a very useful example. Finding more useful ones is left to the reader.  Now, your Makefile should look like Makefile9:

C++          = g++           # use GNU C++ compiler
C++-FLAGS    = -c -Wall      # warn all
LINKER       = g++           # use GNU C++ as linker
LINKER-FLAGS = -o            # flags for linker
RM           = rm -f         # how to remove files
MAKE         = make          # name of make utility
# you cannot add comments after the continuation character!
OBJS         = input.o   \
mirror.o  \
process.o \
output.o
TARGET       = mirror        # name of executable.IGNORE:                     # ignore problems (as far as possible)
.SILENT:                     # don't echo commands executed
.SUFFIXES:                   # get rid of predefined rules
.SUFFIXES: .cc .o

$(TARGET): $(OBJS)
$(LINKER) $(LINKER-FLAGS) $@ $(OBJS)

.cc.o:
$(C++) $(C++-FLAGS) $<

# remove object files and core (if any)
clean:
$(RM) *.o core

# remove object files, core dump, and executable (if any)
distclean:
$(MAKE) clean
$(RM) $(TARGET)

# remove object files, core dump, and executable (if any) and
# make them again.
again:
$(MAKE) distclean
$(MAKE) $(TARGET)

# echo username
info:
echo User is: $(USER)


Last changed tuesday 6/2/1998

Posted in C/C++, Uncategorized.

ติดตั้ง (Install) Samba Server บน Ubuntu

นำความรู้เก่าที่การเปิดใช้งานระบบ file sharing บนวินโดว์ หรือ samba บนเครื่อง Ubuntu
วิธีทำ ก็ง่ายแสนง่าย ดังนี้

Posted in Linux. Tagged with , .

การติดตั้ง SVN & Trac ร่วมกับ Apache ใน Ubuntu

ช่วงนี้กำลังปรับปรุงระบบ SVN ใหม่อยู่ โดยจะให้การทำ authen ผ่าน .htaccess เดียวกันทั้ง SVN & Trac
จึงได้นำ SVN และ Trac มาผูกรวมกับ Apache ซึ่งเป็นวิธีการติดตั้งที่ง่ายกว่า และสะดวกกว่าการติดตั้งแบบที่นำเสนอครั้งก่อน โดยอาศัย dav_svn กับ mods_python เข้ามาช่วย
Continued…

Posted in Linux. Tagged with , , , .

การเขียน resume

อันนี้เป็นเรื่องการเขียน resume ซึ่งได้มาจาก http://blogs.harvardbusiness.org/hbr/hbr-now/2009/09/rewrite-your-invisible-resume.html อีกเช่นเคย ลองเข้าไปอ่านดูโดยคลิกที่ link

แต่ขอเก็บเนื้อหาไว้เพื่อการศึกษาในคราวต่อไปในกรณีที่ไม่สามารถคลิกเข้าไปที่เวปได้แล้ว

This is protected content. Please Login or Register for access.

Posted in Uncategorized.

VMWare Error : Failed to lock the file.

เมื่อเปิด vmware แล้วไม่สามารถ run vm ได้ แล้วขึ้น error ดังต่อไปนี้

Error:
Cannot open the disk '/xxx/xxx/Virtual Machine/Virtual Machine.vmdk'
or one of the snapshot disks it depends on.
Reason: Failed to lock the file.

วิธีแก้ไข

ลบ directory ที่ชื่อว่า Virtual Machine.vmdk.lck ออกเสีย แล้ว start
ถ้าไม่แน่ใจให้ move ไปไว้ในชื่ออื่นหรือทำ back up ไดเรคทรอรี่นี้เสียก่อนก็ได้

Posted in Application, Linux. Tagged with .

Why Few Executives Are Skillful Managers

วันนี้ได้อ่านบทความจาก http://blogs.harvardbusiness.org เห็นว่าดี น่าจะเอามาเก็บไว้ เพื่อไว้อ่านต่อไปในอนาคต แต่จะไม่ขอแปล ด้วยเหตุผลที่ว่าเค้าไม่อนุญาติลิขสิทธิ์ไว้ แล้วอย่างที่สองคือกลัวแปลแล้วไม่ได้เนื้อหาใจความตรงตามที่ผู้เขียนต้องการจะสื่อออกมา ดังนั้นจึงขอให้คลิกอ่านได้ที่ลิงค์นี้เลย Why few executives ar skilful
แต่ขอเก็บเนื้อหาไว้เพื่อการศึกษาในคราวต่อไปในกรณีที่ไม่สามารถคลิกเข้าไปที่เวปได้แล้ว


Why Few Executives Are Skillful Managers

12:43 PM Wednesday August 19, 2009

Tags:Global business, Leadership, Managing yourself


This is protected content. Please Login or Register for access.

Posted in Business & Management.