วันเสาร์, ตุลาคม 13, 2550

เริ่มต้นกับ WALA เครื่องมือสำหรับการวิเคราะห์โปรแกรม (getting started with WALA)

สรุปขั้นตอนต่างๆ สำหรับการเริ่มต้นใช้เครื่องมือ WALA
  1. download Eclipse (the big one, version with RCP/plugin developer), as suggested by the WalaWiki the version for Java dev seems not sufficient.
  2. install EMF from eclipse software update. Europa update -> Model and Modeling Environment -> EMF runtime & End user.
  3. install Subclipse.
  4. edit ...wala.core/dat/wala.properties
    1. java_runtime_dir = c:/program files/Java/jre-1.6.0_03/lib
    2. output_dir = w:/WALA/WALA_output
  5. install graphviz (examples in wala.core.tests use dot.exe provided by graphviz)
  6. edit ...wala.core.tests/dat/wala.examples.properties
    1. provide absolute path for gsview32.exe
    2. and dot.exe
  7. run examples from launcher in Eclipse. Edit arguments, for examples, -appJar c:/lib/foo.jar or -sig method_a()V

วันพุธ, ตุลาคม 10, 2550

en-dash และ em-dash ใน XeLaTeX

เนื่องจาก TeX ประมวลผลอินพุตไฟล์ซึ่งเป็นASCII 8-bit codepage ที่ไม่มีตัวอักษรซึ่งตรงกับ en-dash และ em-dash ทำให้ใช้ไฮเฟ่น 2 หรือ 3 อัน (--, ---) แทน. แต่เนื่องจาก XeTeX นั้นประมวลผลอินพุตเท็กส์ที่เป็นยูนิโค้ด ซึ่งมีอักขระสำหรับ en-dash และ em-dash ทำให้การใช้ --/--- จึงไม่จำเป็น
วิธีการพิมพ์ en/em-dash นั้น สำหรับวินโด้เอ๊กพี ทำได้โดย
  • เปิด Num Lock
  • กด Alt ค้าง พิมพ์ 0150 / 0151 ที่แป้น Numeric Pad ถ้าพิมพ์ที่คีย์บอร์ดธรรมดา จะไม่ติด

บันทึกเกี่ยวกับการลง TeXLive 2007 แทน MiKTeX 2.7 beta3

หลังจากเขียนดีวีดีอิมเมจที่ดาวน์โหลดมาแล้ว ลองติดตั้งดูในเครื่องคัมปานา
อินสตอเลอร์มันไม่เข้าโหมดอินสตอลให้ เนื่องจากเรามี MiKTeX ติดตั้งไว้อยู่ก่อนแล้ว
เราต้องแก้ environment variables เพื่อให้อินสตอลเลอร์มันทำงานในโหมดอินสตอล
(จริงๆแล้วสามารถโอเวอไรด์ได้ด้วยออพชั่นของคอมมานไลน์ แต่มันจะไปเขียนทัพ env var บางตัว)

env var ที่แก้คือ
  1. System Variable: Path= C:\Program Files\MiKTeX 2.7\miktex\bin;c:\program files\imagemagick-6.3.4-q16;
มันจะถามเรื่องอินสตอล Perl กับ Ghostscript

พบว่าใช้ TeXLive ดีกว่า

วันอังคาร, ตุลาคม 09, 2550

บันทึกเรื่องฟอนต์ที่ใช้ใน XeTeX in MiKTeX (installing fonts for XeTeX in MiKTeX 2.7)

ก่อนอื่นต้องรันใน fc-cache ในคอมมานด์พรอมพ์ของวินโด้
พลาดไปรันใน bash shell ของ cygwin ซะ มันเลยไม่เวิร์ค
ผลลัพธ์การรัน fc-cache -f -v แสดงข้างล่างนี้
C:/WINDOWS/Fonts: caching, 162 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1: caching, 0 fonts, 6 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/adobe: caching, 0 fonts, 2 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/adobe/courier: caching, 6 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/adobe/utopia: caching, 4 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/bluesky: caching, 0 fonts, 3 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/bluesky/ams: caching, 34 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/bluesky/cm: caching, 75 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/bluesky/latex-fonts: caching, 14 fonts,
0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/groff: caching, 1 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/hoekwater: caching, 0 fonts, 4 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/hoekwater/mflogo: caching, 8 fonts, 0 di
rs
C:/Program Files/MiKTeX 2.7/fonts/type1/hoekwater/misc: caching, 1 fonts, 0 dirs

C:/Program Files/MiKTeX 2.7/fonts/type1/hoekwater/rsfs: caching, 3 fonts, 0 dirs

C:/Program Files/MiKTeX 2.7/fonts/type1/hoekwater/stmaryrd: caching, 6 fonts, 0
dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/public: caching, 0 fonts, 3 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/public/eurosym: caching, 12 fonts, 0 dir
s
C:/Program Files/MiKTeX 2.7/fonts/type1/public/lm: caching, 92 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/public/xypic: caching, 9 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/urw: caching, 0 fonts, 9 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/urw/avantgar: caching, 4 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/urw/bookman: caching, 4 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/urw/courier: caching, 4 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/urw/helvetic: caching, 14 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/urw/ncntrsbk: caching, 4 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/urw/palatino: caching, 4 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/urw/times: caching, 4 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/urw/zapfchan: caching, 1 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/type1/urw/zapfding: caching, 1 fonts, 0 dirs
C:/Program Files/MiKTeX 2.7/fonts/opentype: caching, 0 fonts, 1 dirs
C:/Program Files/MiKTeX 2.7/fonts/opentype/public: caching, 0 fonts, 1 dirs
C:/Program Files/MiKTeX 2.7/fonts/opentype/public/lm: caching, 72 fonts, 0 dirs
C:/Documents and Settings/All Users/Application Data/MiKTeX/2.7/fontconfig/cache
: cleaning cache directory
fc-cache: succeeded

วันศุกร์, ตุลาคม 05, 2550

ว่าด้วยการนับเรียงของส่วนพาดหัวใน LaTeX (Numbering Heading)

REF: The LaTeX Companion, pp. 25

Every counter in LaTeX has an associated command constructed by prefixing the counter name with `\the', which generates a typeset representation of the counter in question. In case of the sectioning commands this representation form is used to produce the full number associated with the commands, as in the following definitions:
  • \renewcommand\thechapter{\arabic{chapter}}
  • \renewcommand\thesection{\thechapter.\arabic{section}}
  • \renewcommand\thesubsection{thesection.\arabic{subsection}}
This kind of recursive definition facilitates modifications to the counter representations because changes do not need to be made in more than one place. If you want to number sections using capital letters, you can just redefine the command \thesection:
  • \renewcommand\thesection{\Alph{section}}

วันอังคาร, ตุลาคม 02, 2550

Google TechTalk video

ref: http://www.scottberkun.com/services/speakingsamples/

Today I watched some video of some presentations, presented by professionals, to be my guideline. I then dive down into Google Video site where I found a lot of interesting Google TechTalk video, though i have not so much time to view them till the end. Here are some of those videos:



This is one in the Advanced in Programming series by Google.

เลคเชอร์สุดท้ายของ แรนดี้ พอช CMU

วันจันทร์, ตุลาคม 01, 2550

จาก 華麗なる一族

ข้อความตอนจบในจดหมายของเท็ปเป
人間はちっぽけな存在だ。
自分を強く見せようとして
背伸びしては傷つき
その傷口を自分自身で広げてしまう。
愚かで弱い生き物だ。

だからこそ人間は夢を見るのかもしれない。
夢の実現には困難を伴い
時として夢は人を苦しめる。
それでも僕は未来を切り開くことができるのは
夢に情熱を注ぐ人間の力だと信じている。
しかし 志を忘れたとき栄光はすぐに終わりへ向かうだろう。

วันพฤหัสบดี, กันยายน 20, 2550

บิตทอเร้น ทอร์ และ ไพรวอกซี่

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

การเซตค่าในไมโครทอเร้นก็เซตให้มันดาวน์โหลดไฟล์ผ่านพรอกซี่ โดยใช้ Socks5 และ 127.0.0.1 ที่พอร์ท 9050 (การเซตค่าตามนี้ฟอร์เวิร์ดไปที่ทอร์โดยไม่ผ่านไพรวอกซี่)

ถ้าจะเซตให้ผ่านไพรวอกซี่ให้เซต โดยใช้ HTTP, 127.0.0.1, พอร์ท 8118

วันศุกร์, กันยายน 14, 2550

ใช้ wget ดาวน์โหลดโดยไม่ต้องสนใจ robots.txt (wget ignore robots.txt)

ปกติเวลาใช้ wget ดาวน์โหลดไฟล์มันจะมองหา robots.txt ในรีโมทไซต์ก่อนว่ามี disallow อยู่รึเปล่า ซึ่งถ้ามีมันก็จะไม่ยอมโหลด

ซึ่งเราสามารถเพิกเฉย robots.txt ได้ โดยเพิ่มออพชั่น -e robots=off ลงไป
$ wget www.example.com/i_want_this/ -e robots=off

วันพุธ, กันยายน 12, 2550

ย้าย Subversion server ไปยังเครื่องใหม่ P4 แรม 1G

ขั้นตอนการย้ายคร่าวๆ
  1. ลง Apache HTTP server (httpd)
  2. ลง OpenSSL ให้ httpd
  3. ลง Subversion ของ windows บน module Apache
---- ลง Apache HTTP server (httpd) ----
1. ดาวน์โหลด installer MSI ไฟล์ จาก apache.org แล้วก็ Install ลงไป. กรอกข้อมูลเกี่ยวกับ servername แล้วก็ admin email แค่นี้
2. แก้ httpd.conf โดยดูจากของเก่า คร่าวๆ ก็เพิ่ม dav_svn_module กับ auuthz_svn_module ลงไป แล้วก็ ssl_module ด้วย
เติมล่างสุดของ config ไฟล์ เกี่ยวกับ Location /svn โดย ก๊อปของเก่ามาตรงๆ


---- ลง Open SSL ----
1. ดูประกอบได้ที่ http://tud.at/programm/apache-ssl-win32-howto.php3
2. ดาวน์โหลด Apache_X-mod_ssl_Y-openssl_Z-WIN32 ที่ http://hunter.campbus.com
3. ใน archive ของไฟล์ที่ดาวน์โหลดมาที่ Apache-modssl\bin\ ก๊อปไฟล์ ssleay32.dll และ libeay32.dll ไปที่ซิสเต็มไดเรคทอรี่ C:\WINDOWS\System32
4. ก๊อปปี้ openssl.exe ใน \bin ใน อาร์ไค๊บ ไปยัง \bin ใน Apache path, และ save/copy ssl.cnf จาก http://tud.at... ไปยัง \conf,
ก๊อปปี้ mod_ssl.so ไปที่ \module, save openssl.cnf ไปที่ conf อันนี้ใช้ generate certificates.
4.1 สร้าง certificate : ..\bin\openssl.exe req -config .\openssl.cnf -new -out my-server.csr
4.2 สร้าง RSA key : ..\bin\openssl.exe rsa -in privkey.pem -out my-server.key
4.3 สร้าง server X509 cert : ..\bin\openssl.exe x590 -in my-server.csr -out my-server.cert -req -signkey my-server.key -days 3654 [about 10 years]
4.5 ก๊อปปี้ certificate file และ passwd ไฟล์ (my-server.{cert|csr|der.crt|key}, privkey.pem, passwd)
5. สร้าง \conf\ssl.cert แล้วก๊อปปี้ my-server.cert และ my-server.key ไปไว้
6. แก้ httpd.conf SSLLog logs/SSL.log SSLLogLevel warn SSLmutex sem
เพิ่ม config file ใน ssl.conf ใน \conf แก้ค่าตามสมควร
ระวังเรื่อง ด้วยถ้ามี<-- ห่าไรวะเนี่ย ---- ลง Subversion บน Apache ---- 1.โหลด subversion สำหรับ Windows32 สามารถทำได้ 2 วิธี (แนะนำวิธี setup.exe)
วิธีแรก: โหลดไฟล์ที่เป็น setup.exe มาแล้ว ก็ดับเบิ้ลคลิ๊ก แก้ httpd.conf นิดหน่อย จบ
วิธีหลัง : ที่เป็น ZIP ไฟล์มา แล้วแตกไฟล์ออก 2. ก๊อปปี้ ไฟล์ mod_*svn*.so ไปที่ modules ใน Apache แก้ config apache ให้โหลด module เหล่านี้ด้วย (บางครั้งจำเป็นต้อง restart เครื่อง ไม่งั้นมันจะมองไม่เห็น module ใหม่)

note: ปัญหาที่เจอคือหลังจากก๊อป mod_ssl ไปแล้วมันสตาร์ท apache ไม่ติด มันจะ crash
แก้โดยเอาไฟล์ที่อยู่ใน apache-with-ssl.ZIP ไปแทนที่อินสตอลไว้ให้หมด

==== อพยพ repository ไดเรคทอรี่ เก่าไปสู่ที่ใหม่ด้วยการ dump ดังต่อไปนี้ ====
svnadmin dump /path/to/repo > reponame.dump
tar zcf reponame.tgz reponame.dump
scp reponame.tgz hostname:/path/to/new/repo

Then login to the new machine, and set up the new repo:

cd /path/to/new
svnadmin create reponame
tar zxf reponame.tgz
svnadmin load reponame

That’s all.

แก้ locale ใ้ห้เป็น US English โดยกำหนด user's environment variable อันใดอันหนึ่ง

LANGUAGE, LC_ALL, LC_MESSAGES
ให้เป็น en_US หรือ POSIX ซะ

== ประวัติการแก้ไข ==
1. 07/6/2548
2. 29/9/2549

การใช้คีย์เวิร์ดอัตโนมัติใน Subversion (keywords (tag) substitutions in Subversion)

ต่อจากบทความเก่า http://xoguy.blogspot.com/2007/05/tag-subversion.html ที่เคยแปะค้างๆไว้
ได้ลองใช้พวก tag (จริงๆในคู่มือเค้าเรียกว่า keyword) ต่างๆ ของ Subversion ดูแล้วเลยมาเมโม่เก็บไว้

ref: http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html

คีย์เวิร์ด
คีย์เวิร์ดที่ใช้มี 5 อันคือ
  1. Date (alias = LastChangedDate)
  2. Revision (alias = LastChangedRevision, Rev)
  3. Author (alias = LastChangedBy)
  4. Id (no alias)
  5. HeadURL (alias = URL)

วิธีการใช้
1. เพิ่มคีย์เวิร์ดเหล่านี้ไว้ในไฟล์ อย่างเช่นในคอมเม้นท์ตรงหัวไฟล์
/* foo.txt initiated 2007/05/05
* $Revision$ last committed rev
* $Author$ last committed author
* $Date$ last committed date
* $Id$ last committed Id
* $URL$ head URL
*/
2.
เซต property svn:keywords ของไฟล์ foo.txt เพื่อเซตให้คีย์เวิร์ดเหล่านั้นถูกแทนค่าตอนคอมมิต, Subversion จะไม่แทนค่าคีย์เวิร์ดเหล่านี้ถ้าหากเราไม่เซต การเซตให้ LastChangedDate กับ Author ถูกแทนค่าทำได้โดย
$ svn propset svn:keywords "Date Author" foo.txt
property 'svn:keywords' set on 'foo.txt'
3. คอมมิตซะ! คีย์เวิร์ดเหล่านี้ก็จะถูกแทนค่าโดยอัตโนมัติตอนคอมมิต


นอกจากนี้แล้วการแสดงผลแบบกำหนดความกว้างตายตัวเพื่อความสวยงามสามารถทำได้โดยเพิ่มโคล่อนสองอันไว้หลังคีย์เวิร์ดซะ ใช้รูปแบบ อย่างนี้
$Rev::               $:  Revision of last commit
$Author:: $: Author of last commit
$Date:: $: Date of last commit

--
Date

This keyword describes the last time the file was known to have been changed in the repository, and is of the form $Date: 2006-07-22 21:42:37 -0700 (Sat, 22 Jul 2006) $. It may also be specified as LastChangedDate.

Revision

This keyword describes the last known revision in which this file changed in the repository, and looks something like $Revision: 144 $. It may also be specified as LastChangedRevision or Rev.

Author

This keyword describes the last known user to change this file in the repository, and looks something like $Author: harry $. It may also be specified as LastChangedBy.

HeadURL

This keyword describes the full URL to the latest version of the file in the repository, and looks something like $HeadURL: http://svn.collab.net/repos/trunk/README $. It may be abbreviated as URL.

Id

This keyword is a compressed combination of the other keywords. Its substitution looks something like $Id: calc.c 148 2006-07-28 21:30:43Z sally $, and is interpreted to mean that the file calc.c was last changed in revision 148 on the evening of July 28, 2006 by the user sally.

วันอาทิตย์, สิงหาคม 26, 2550

Eclipse workspace management

read some good tips --> http://www.ibm.com/developerworks/opensource/library/os-ecl-manage/



ดูเหมือนว่าเราจะสามารถใช้ binary ของ eclipse เดียวรันหลายๆ workspace ได้
ตัวอย่างเช่นเราอาจจะแบ่งเป็น workspace สำหรับ Java, workspace สำหรับเขียนเปเปอร์ด้วย LaTeX หรือ อาจจะเป็น workspace สำหรับพัฒนาโปรแกรมเล่นๆ ที่ไม่ใช่โปรดัค ก็แค่แยกใช้ workspace สำหรับวัตถุประสงค์ต่างๆเหล่านั้น ก็จะทำให้จัดการโปรเจคได้ง่ายขึ้น

ข้อควรรู้
  1. รันด้วย eclipse.exe -showlocation เพื่อให้มันแสดง location ของ workspace ที่ Title bar
  2. ค่า preferences ถูกเก็บในแต่ละ workspace ดังนั้นจึงไม่เกี่ยวข้องกัน
  3. File -> Export -> Preferences เก็บ preferences เป็นไฟล์ XML เอาไว้ใช้กับ workspace อื่น
  4. สำหรับ plug-in ต่างๆนั้น ถูกเก็บอยู่ใน installation ของ eclipse binary ที่เราเรียกใช้ ดังนั้นหากเราโหลด eclipse เวอร์ชั่นใหม่กว่ามาลง พวก plug-in ที่เคยใช้ก็จะต้องลงใหม่

วันศุกร์, สิงหาคม 24, 2550

ข้อแตกต่างระหว่าง WAIT and AWAIT

wait แตกต่างจาก await อย่างไร?
อ้างอิงจาก ที่นี่: http://www.bbc.co.uk/worldservice/learningenglish/radio/specials/1535_questionanswer/page15.shtml

AWAIT and WAIT: to sum up, there are two kinds of difference
  • grammartical difference
    • the verb `await’ must have an object
      • ex. I am awaiting for your answer.
      • the object of 'await' is normally inanimate, not a person, and often abstract.
      • »So you can't say, 'John was awaiting me'.
    • the verb `wait’ can come in different structures.
      • »Use `wait on its own à ex. We have been waiting and waiting and nobody has come to talk to us.
      • »Use `wait with another verb à ex. I waited in line to go into the theatre.
      • »Use `wait with the length of time à ex. I have been waiting here for at least half an hour.
      • »Use `wait to mention what or who the speaker have been waiting for à ex. I have been waiting for Joe for two hours!.
  • Formality difference
    • `await’ is more formal than `wait’ , so it would be used in formal writing.

Granting privileges to Java RTS Users on Solaris 10

Note that you (may) need to logout and login again for the new priviledges to take effect. The preferred approach might be to create a new administrative role, `rtsj_role', then assign `Java Real-Time System User' right to `rtsj_role', and make the user who want to use Java RTS assumes the rtsj_role.

The following procedures are quoted from /opt/SUNWrtjv/doc/JavaRTSInstallation.html#privileges



Granting Privileges to Java RTS Users

The Java Real-Time System uses a number of Solaris resources, such as the real-time scheduling class, whose usage is restricted to privileged processes. Therefore, the Java RTS Virtual Machine must be run as the superuser (root) or must be explicitly granted additional rights by the system administrator in order to ensure predictable timing of operations.

Solaris supports role-based access control (RBAC), which enforces security policy at a more fine-grained level than the conventional superuser security model. This enables a user to be assigned the precise level of privilege that is necessary to execute the Java RTS.

This is typically achieved by means of a specific rights profile, that is, a collection of commands with security attributes. Rights profiles are usually included in an administrative role, and the role is then assigned to a user. Direct assignment of rights profiles to a user is also possible. In that latter case, this user must use a profile shell such as pfsh(1) or pfcsh(1) for the commands with security attributes to succeed.

Rights profiles can be managed using the Solaris Management Console, smc(1), a graphical user interface that provides access to Solaris system administration tools.

To invoke the Solaris Management Console, type the following command:

    # /usr/sbin/smc

The 'Java Real-Time System User' rights profile can also be assigned to an administrative role using the following command:

    # /usr/sbin/rolemod -P "Java Real-Time System User" 

where is an existing role account.

This rights profile can also be directly assigned to a Solaris user by using:

    # /usr/sbin/usermod -P "Java Real-Time System User" 

where is an existing, local user name.

Alternatively, you can decide not to use the Java RTS profile and assign additional rights directly to the Java RTS users. In that later case, be aware that all the processes created by such Java RTS users (that is, not only the Java RTS Virtual Machine) will be granted these additional rights.

Rights management is implemented on Solaris through privileges, that is, discrete rights required to perform particular operations. Privileges decrease the security risk that is associated with one user or one process having full superuser capabilities on a system.

If you decide to bypass the Java RTS rights profile, then the Java RTS users must be granted at least the following privileges, for them to be able to run properly the Java RTS Virtual Machine:

  • sys_res_config: allows a process to create and delete processor sets, assign CPUs to processor sets, and change the operational status of CPUs in the system.
  • proc_priocntl: allows a process to elevate its priority above its current level and change its scheduling class to any scheduling class, including the RT class.
  • proc_lock_memory: allows a process to lock pages in physical memory.
  • proc_clock_highres: allows a process to use high resolution timers.

To assign the above set of privileges directly to a Java RTS user, use the Solaris Management Console, smc(1), or type the following command:

    # /usr/sbin/usermod -K \
defaultpriv=basic,sys_res_config,proc_priocntl,proc_lock_memory,proc_clock_highres

where is an existing, local user name.

Note that the usermod(1M) command does not allow privileges to be assigned to non-local users (that is, to users who do not appear in the local /etc/passwd file). To assign privileges to a non-local user, add the following line to the /etc/user_attr file:

::::type=normal;profiles=Basic Solaris User;defaultpriv=basic,
sys_res_config,proc_priocntl,proc_lock_memory,proc_clock_highres

where is an existing, non-local user name.

Java PathFinder where to start?

When I started writing my tool, I realized it is a good idea to read the code of the great tool that several great people(?) have contributed---the Java PathFinder (JPF).
The entry point for reading Java PathFinder may be at
  • gov.nasa.jpf.tools.JavaJPF : main() is here.
  • gov.nasa.jpf.JPF : main class for JPF verification framework. It reads config, instantiates the Search and VM objects, and starts the Search.
  • gov.nasa.jpf.jvm.JVM : the class for virtual machine that can move forward / backward one transition at a time.
  • Besides, ThreadInfo, MethodInfo in gov.nasa.jpf.jvm are also worth looking.

Eclipse preferences: using multiple instances of Eclipse

เวลาใช้ Eclipse หลายอินสแตนซ์แล้ว มันมีเรื่องเล็กน้อยคือต้องคอยปรับค่า preferences ให้มันเป็นตามที่เราคุ้นเคย

จริงๆมันก็สามารถ File > Export > preferences ได้ แต่ทีนี้พอไม่ได้ทำนานๆแล้วมันก็ลืม
จดไว้ตรงนี้กันลืมว่า เวลาสร้างอินสแตนซ์ของ Eclipse ขึ้นมาใหม่เมื่อไหร่ก็ Export / Import preferences จากอันเก่าที่ใช้ประจำมา.

วันพฤหัสบดี, สิงหาคม 16, 2550

การย้ายรูปที่เก็บด้วย Picasa ไปยังคอมเครื่องใหม่, migrating picasa photo library to a new computer

ลองค้นหาในเฮ้ลป์ของ Picasa help & support เค้าบอกให้ใช้ Tools > Backup Pictures แต่ผมคิดว่าไม่จำเป็น เราสามารถก๊อปปี้โฟลเดอร์ที่เก็บรูปไว้ (ซึ่งเป็นโฟลเดอร์ ที่ให้ Picasa คอยดูแลให้เราอยู่) หรือ ย้ายมาได้ตรงๆ แล้วพอลง Picasa ที่คอมเครื่องใหม่ก็ให้มัน watch! โฟลเดอร์นั้นให้ก็เรียบร้อย

อย่างไรก็ดี อัลบั้มที่เราสร้างไว้ใน Picasa มันไม่ได้เก็บเป็นโฟลเดอร์ต่างหาก แต่เก็บเป็น XML แต่ใช้นามสกุล .pal (Picasa ALbum) อยู่ที่ $USER\Local Settings\Application Data\Google\Picasa2Albums
ซึ่งในไดเรคทอรี่นี้ จะมี
  1. watchedfolders.txt เป็นเท็กส์ไฟล์ ที่เก็บว่า Picasa มัน watch ไดเรคทอรี่ไหนอยู่ และ
  2. ซับไดเรคทอรี่ที่มีชื่อเป็น HEX ยาวๆ ex. b8ce842...2d2 ซึ่งในไดเรคทอรี่นี้จะมีไฟล์ .pal ที่เก็บ Picasa Album อยู่

ให้เราก๊อปไฟล์นั้นไปไว้แล้วเปิด Picasa ขึ้นมาใหม่ก็น่าจะเรียบร้อย

ถ้าเปลี่ยนโลเคชั่นของโฟโต้ไลบรารี่ก็แก้ไขไฟล์ .pal ให้เป็นที่ใหม่ซะด้วย เช่นใน
 
[D]\Photos\20000229\PIC001.JPG


[D] คือ drive D: [E] ก็คือ drive E:

+ เพิ่มเติม +
หากเราเคยอัพอัลบั้มนั้นขึ้นใน Picasa Web โดยใช้ ,2 มันจะมีเอ็นทรี่ คล้ายๆอย่างงี้
>_lh" type="num64" value="0"/>
>_lh" type="num64" value="0"/>

<< >> เป็น place holder

ในไฟล์ .pal ทำให้ก๊อปไปแล้วกลับไม่ปรากฎอัลบั้มนั้นขึ้นใน Picasa
การแก้ไขก็ทำได้โดยลบสองบรรทัดนั้นออกไป ลบแล้วพอก๊อปไปก็จะได้ดังเดิม

ติดตั้ง Webmin ใน Solaris 10 เพื่อความสะดวกในการคอนฟิก Samba

วันนี้คุยกับเด็กรุ่นน้องที่ำทำงานด้วยกัน เรื่องการลงแซมบ้าใน Solaris 10 ซึ่งใน Solaris 10 นั้นมันมี Samba มาให้อยู่แล้ว เพียงแต่คอนฟิกยากเล็กน้อยเพราะยังไม่ได้ศึกษา SMF เท่าไหร่
สรุปก็คือใช้ Webmin ง่ายดี ใช้แอ๊ดมินได้หลายๆอย่างด้วย

บันทึกการติดตั้ง
ref: http://www.webmin.com/solaris.html

  1. ดาวน์โหลดแพคเกจของ Solaris มาซะ
  2. # pkgadd -d webmin-1.360.pkg
  3. แล้วก็คอนฟิกอีกเล็กน้อย โดยเพิ่ม user หรือ sync มันมาจาก unix account ซะ
  4. แล้วก็เพิ่มไดเรคทอรี่ที่จะแชร์ลงไป
  5. คอนฟิก อื่นๆ ตามสมควร อาจดูที่ smb.conf เพื่อความชัวร์
  6. คลิก รีสตาร์ท Samba server

วันอังคาร, กรกฎาคม 17, 2550

vnc on Solaris 10

บันทึกการติดตั้งโปรแกรม vnc ใน Solaris 10 เมื่อวาน

ref:
  1. http://blogs.sun.com/timthomas/entry/update_on_vnc_and_solaris
  2. http://www.salixtraining.co.uk/index_files/vncsol10.htm
  3. http://www.softpanorama.org/Xwindows/VNC/vnc_on_solaris.shtml
ขั้นตอนที่ทำคือ
  1. โหลด CompanionDVD ของ Solaris 10 11/06 มา ในนั้นจะมี SFWvnc อยู่ เราใช้ package นี้ในการติดตั้ง
  2. โปรแกรมอื่นที่จำเป็น(prerequisite) ถูกลงไปก่อนแล้วนั้นหาได้จาก sunfreeware
  3. โหลดสคริปต์ติดตั้งจาก [2] (www.salixtraining.co.uk) เราใช้สคริปต์นี้ช่วยให้การติดตั้งสะดวกขึ้นมาก
  4. เอาแพคเกจของ SFWvnc จาก CompanionDVD แทนในแพคเกจที่มีอยู่ในสคริปต์จาก [2] ใช้คำสั่ง 
  5. pkgtrans . /mytemp/SFWvnc.pkg SFWvnc
  6. modify the script installsol10vnc.ksh in the initialise function remove the SFWgcc341.pkg away:
  7. packages="SFWgcmn.pkg SFWvnc.pkg"
  8. comment the line: fix_gnome_bug, it worked fine without doing this for me too.