ข้ามไปที่เนื้อหาหลัก

บทความ

กำลังแสดงโพสต์จาก กันยายน, 2008

ubuntu ssl apache

1. make a self-signed SSL certificate using openssl $ apt-get install openssl $ openssl req -new -x509 -days 365 -nodes -out server.crt \ -keyout server.key or $ cd /etc/ssl/certs $ sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf apache.pem 2. turn on SSL $ a2enmod ssl 4.change the file in add NameVIrtualHost web05:443 .. SSLEngine On SSLCertificateFile /etc/apache2/server.crt SSLCertificateKeyFile /etc/apache2/server.key NameVirtualHost web05:80 NameVIrtualHost web05:443 <virtualhost:443> ServerAdmin webmaster@localhost DocumentRoot /var/www/web05 SSLEngine On SSLCertificateFile /etc/apache2/server.crt SSLCertificateKeyFile /etc/apache2/server.key RailsBaseURI /ror </virtualhost> ref : debianclub

วิธีเซต gmail ใช้เมล ait และ cs

ตามนั้น

DSPACE installation

I will follow installation process manual written in this dependencies 1. java jdk-6 [ from snaptic ] 2. Apache Maven 2.0.8 or later (Java build tool) read how to install here . 3. Apache Ant 1.6.2 or later (Java build tool) $ apt-get install ant 4. Relational Database: $ apt-get install postgresql installation 1. create linux user for dspace $ sudo useradd -m dspace 2. Download the latest DSpace release and unpack it 3. Database Setup Postgres : A PostgreSQL 8.1-404 jdbc3 driver is configure as part of the default DSpace build. You no longer need to copy any postgres jars to get postgres installed. Create a dspace database, owned by the dspace PostgreSQL user: $ createuser -d -A -P dspace $ sudo su dspace $ createdb -E UNICODE dspace Enter a password for the DSpace database. (This isn't the same as the dspace user's UNIX password.) 4. Edit [dspace-source]/dspace/config/dspace.cfg dspace.dir -- must be set to the [dspace] (installation) directory. dspace.url -- complete

[ Apache Maven ] how to install Apache Maven on ubuntu linux

Easy installation $ apt-get install maven2 to verify that it is correctly installed. $ mvn --version Manual installation ( working from zip file ) 1. download Apache Maven 2. install using instruction in README.txt 1) Unpack the archive where you would like to store the binaries, eg: $ tar xvjf apache-maven-2.0.8-bin.tar.bz2 2) A directory called "apache-maven-2.0.x" will be created. 3) Add the bin directory to your PATH, eg: Unix-based Operating Systems (Linux, Solaris and Mac OS X) export PATH=/usr/local/apache-maven-2.0.x/bin:$PATH two ways to permanently set path is way 1 edit /etc/environment way 2 write .bash_aliases at your home directory and add export PATH = YOUR OLD PATH:/usr/local/apache-maven-2.0.x/bin delete comment to execute .bash_aliases in .bashrc and run $ source .bashrc However, you can edit your classpath in .bashrc directly as well. 4) Make sure JAVA_HOME is set to the location of your JDK default jdk of

[ Rails ] Rails on Eclipse

Aptana is a company that build rails plugin for eclipse 1. go to google and search for "aptana update site" 2. Software Update > Add new site ... http:// update . aptana .com/install/studio/3.2/ and click "install" 3. Help > Aptana Studio Start Page . . . click at install rails in that page. 4. ต่อไป ทำให้ มันรู้จัก rake ที่อยู่ในเครื่องเรา Window > preferences NOTE : คำสั่งที่ใช้หา path ของโปรแกรมบน linux คือ $ which ชื่อโปรแกรม เช่น $ which rake ต่อไปทำให้รู้จัก rails กับ mongrel_rails ต่อไปทำให้มันรู้จัก ruby เข้าไปที่ Installed Intepreters path "/usr/bin" <-- เอามาจาก $ which ruby นั่นแหละ name "" 5. อะ ลองๆๆ จิ้ม ตรงไอคอนทางขวา แล้วเลือก other เลือก RadRails ตอนนี้เราก็สามารถ new > Rails Project ได้แล่ะๆ ปล. ในตัวอย่างนี้ผมใช้ postgresql เป็น database และ ใช้ Mongrel เป็น web server 6. ลองเล่นดีกว่า ที่แท็บ rake เรามีคำสั่ง rake ให้เลือกเลย ไม่ต้องพิมพ์เอง มี generate ให้ด้วย เราก็สามารถ start/stop server ได้จาก eclipse ไ

apache tomcat

1. download apache tomcat ผมโหลด ตัว Core : tar.gz นะ 2. extract to folder 3. $ bin/startup.sh แล้วจะเข้าเวปได้จาก http://localhost:8080 5. เข้า tomcat manager 6. มันจะถาม username, password ซึ่งจริงๆต้อง ไปใส่ username, password ในไฟล์ /conf/tomcat-users.xml ก่อน ตามนี้ <tomcat-users> <role rolename="manager"/> <role rolename="admin"/> <user username="dsin" password="somepassword" roles="manager,admin"/> </tomcat-users> แล้ว restart tomcat ทีนึง >> ถ้า start webapp บางตัวไม่ติด ให้ไปดูไฟล์ log/catalina.out หรือ $ tail -f log/catalina.out ก็ได้ >> ถ้าอยากเปลี่ยน port ที่รัน tomcat แก้ใน conf/server.xml <Connector port="8088" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/> อยากเปลี่ยน version ของ tomcat แก้ใน etc/default/tomcat7 JAVA_HOME=/usr/lib/jvm/java-7-oracle วิธี deploy webapp ( เขียน ap

[ Plone ] Plone บน Zope

พอเข้าหน้า localhost:8080/manage แล้ว Plone จะอยู่ที่ ( อันที่ขีดเส้นใต้ในรูปอ่ะ มองเห็นป่าวไม่รู้ พอเข้าไปเราจะเห็น folder ต่างๆ รวมถึง folder ที่เราสร้างไว้ นอกจากนี้เราสามารถเอา URI ของ Plone ไป search ใน Zope ได้ โดยเข้า เมนู Find และเราสามารถแก้ไขไฟล์ได้, export/import ได้ง่ายๆ ( ปุ่ม export/import )

[ Plone ] ลง plone บน ubuntu linux

I have just download Plone 3.1.5.1 from the Plone download page . I choose this one. Get Plone for Linux/BSD/Unix (35MB) Unified Installer - for Linux/BSD/OS X/UNIX/Solaris (compiles and installs Python, Zope and Plone plus dependencies for you) And I follow what is written in a README file that is working pretty well . This is what I did. I install for a non super-user, in stand alone mode. >> ./install.sh standalone ตอนนี้อาจจะต้องลง g++ ก่อน After installation, the system will inform the admin's password generated for you. For example, Username: admin Password: 1wX6Gdjq and this is how I start Plone >> $HOME/Plone-3.1/zinstance/bin/instance start After starting Plone

[ Plone ] เล่น PloneFormGen

หลังจาก add PloneFormGen add-on products ลง plone ไปเรียบร้อยแล้ว มาเล่นกันเถอะ 1. add new > form folder 2. กรอก ไปมั่วๆ จะได้ ฟอร์ม โง่ๆ มาอันนึง 3. มาดูกันว่า default page ของ plone form gen ทำอะไร ลองกรอกดูก็ได้ โอ้ว มันส่งเมลนั่นเอง ปัญหานึงที่เจอคือ เหมือนว่า จะต้องเซต SMTP server ให้กับ Plone ด้วย ( มันฟ้อง error เมื่อเราเข้าไปหน้า site setup ) ซึ่งเมื่อคลิกเข้าไปเนี่ย มันก็จะมาโผล่ที่ URL นี้ http://localhost:8080/Plone/@@mail-controlpanel ถ้าใช้ SMTP ของ gmail ก็ดูตัวอย่างตามนี้เลย 4. ซึ่งถ้าเราไม่พอใจ default form ที่มันให้มาเรา สามารถ ลบ, rename ได้ โดยจัดการที่แท็บ content 5. หรือ เราจะเพิ่ม input ใหม่ ก็เข้าที่ Add new.. ได้ อยากจะบอกว่า ถ้าเราใส่อะไรใน form นั้น มันจะเข้า Object database ของ Plone ให้เลยแหละ สะดวกมากๆเลย 6. นอกจากนี้เรายังสามารถทำให้ PloneFormGen ทำงานสคริปของเรา หลังจากที่ user submit form ได้ด้วย วิธีทำก็คือ เข้าไปที่ Edit > Overrides แล้วใส่ After Validation Script เป็น here/ชื่อ script Note : here คือ folder ปัจจุบัน ที่เก็บไฟล์นี้อยู่

[ Plone ] วิธีลง Add-on Products โดยใช้ egg ( how to install Add-on Products )

1. หาชื่อ plugin ที่ต้องการโหลดจากใน cheeseshop เช่น Products.PloneFormGen 2. แก้ buildout.cfg เพิ่มชื่อเข้าไป [buildout] ... eggs = elementtree Products.PloneFormGen ข้อควรระวัง elementtree กับ Products.PloneFormGen เว้นย่อหน้าให้ดีๆน้ะจ้ะ ไม่งั้นจะรันไม่ผ่าน 3. $ ./bin/buildout มันจะลาก plugin ที่ต้องการ รวมทั้ง dependencies ที่เกี่ยวข้องมาลงให้เอง ( cool ! ) 4. จากนั้น restart zope ซะ 5. มันจะไปอยู่ที่ site setup Add on Products มาแว้วววว ปล. ถ้าต้องการเพิ่ม site ที่ให้ plone มันลาก plugin มาลง เพิ่มเข้าไปได้ที่ find-links ใน buildout.cfg นั่นแหละ find-links = http://dist.plone.org http://download.zope.org/ppix/ http://download.zope.org/distribution/ http://effbot.org/downloads ดูวิธีลงเพิ่มเพิ่มเติมที่ : plone

วิธีซ่อม ubuntu grub

หลังจากที่ลง windows ใหม่ หลังจากลง ubuntu ไปแล้ว จะพบว่า bootloader ของ windows มันดันไปทับ grub bootloader ทำให้เราไม่สามารถเข้า ubuntu อันเป็นที่รักของเราได้ แต่ไม่ต้องตกใจไป ไม่ต้องลง ubuntu ใหม่หรอกน้ะจ้ะ แค่แก้ไข grub ก็ใช้ได้แล้วล่ะ วิธีทำ คือ boot จาก CD น้ะจ้ะ path ที่แก้ไข มันอยู่ที่ /boot/grub/menu.lst ( ถ้า boot จาก CD ให้ mount path ก่อน มันจะไปอยู่ใน /media/disk/.. อะไรซักอย่าง เพราะว่า / ( root ) มันจะเป็น drive CD แทน น้ะจ้ะ ) index มันเริ่มจาก 0 นะ เช่น /dev/sda2 จะกลายเป็น (hd0, 1) sda = hd0, 2 กลายเป็น 1 เพราะว่า index มันเริ่มจาก 0 get บ่ คำสั่งที่น่าจะเป็นประโยชน์ คือ fdisk -l เช่น dsin@dsin-laptop:~$ sudo fdisk -l [sudo] password for dsin: Disk /dev/sda: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x0bddba0e Device Boot Start End Blocks Id System /dev/sda1 * 1 10199 81923436 7 HPFS/NTFS /

Using Eclipse IDE to run python ( by pydev plugin )

1. Help > Software Update 2. click tab 'available software' 3. click 'Add Site' 4. http://pydev.sourceforge.net/updates/ 1. Windows > Preference 2. Pydev > Interpreter - Python 3. /usr/bin/python see other eclipse topic .

OSS ( Open Source Software ) license

Open Source Software ≅ Free Software (ซอฟต์แวร์เสรี) ≠ Freeware Right to Copy ใช้งาน Right to Study ศึกษาการทำงาน Right to Modify พัฒนา/ปรับเปลี่ยน/แก้ไข Right to Redistribute แจกจ่าย หาผลประโยชน์ Freeware มักจะใช้กับชุดของซอฟต์แวร์ที่อนุญาตให้เผยแพร่ซ้ำได้ แต่ไม่สามารถดัดแปลงซอฟต์แวร์ได้ ฟรีแวร์จะ ไม่ให้ซอร์สโค้ด ซึ่งซอฟต์แวร์ในลักษณะนี้จะ ไม่ใช่ซอฟต์แวร์เสรี Shareware สามารถเผยแพร่ซ้ำซอฟต์แวร์นั้นๆ แต่ผู้ที่ใช้ซอฟต์แวร์นั้นต่อจะต้องจ่ายค่าสัญญาอนุญาต Public domain software ซอฟต์แวร์สาธารณะ ไม่มีลิขสิทธิ์ ในบางกรณีโปรแกรมกระทำการ (Executable Program) สามารถอยู่ใน Public Domain โดยไม่มีซอร์สโค้ดให้ ซึ่ง ไม่จัดว่าเป็นซอฟต์แวร์เสรี เพราะซอฟต์แวร์เสรีต้องสามารถเข้าถึงซอร์สโค้ดได้ Copylefted software ( reciprocal license ) ซอฟต์แวร์เสรีที่เป็น Copylefted software ถึงแม้จะมีการนำมาดัดแปลง ก็จะต้องใช้สัญญาที่ยังคงเป็นซอฟต์แวร์เสรีอยู่ ( เป็น non-permissive นั่นเอง ) เช่น GPL permissive free software licence - require advertising materials to credit the copyright holder. Licenses with an adv

take log กับ อสมการ -- สมบัติ log ที่ใช้โคดบ่อย

สมมติเรามี u > v จะ take log log u > log v เราต้องเปลี่ยนเครื่องหมายด้วย > เป็น < ด้วยหรือเปล่า ? คำฅอบก็คือ ถ้า take ฐาน log มากกว่า 1 ไม่ต้องเปลี่ยนจ้า ( ใช้บ่อยมากๆ ) ดูทฤษฎีประกอบจาก school.net การแก้อสมการลอการิทึม อสมการลอการิทึมสามารถแก้ได้โดยใช้สมบัติต่อไปนี้คือ 1. กรณีที่ a > 1 จะได้ว่า log a u > log a v ก็ต่อเมื่อ u > v 2. กรณีที่ 0 < a < 1 จะได้ว่า log a u > log a v ก็ต่อเมื่อ u < v

x^2 หรือ 2^x อะไรมากกว่ากัน

ลองแทนค่าดู x | x^2 | 2^x 1 | 1 | 2 2 | 4 | 4 3 | 9 | 8 x^2 มากกว่า 2^x 4 | 16 | 16 5 | 25 | 32 2^x มากกว่า x^2 คำตอบก็คือ ไม่แน่นอน ดูกราฟ แต่ถ้า x เยอะๆแล้ว 2^x จะมากกว่า x^2 นะ ref : Yahoo! รู้รอบ

iff ( if and only if ) แปลว่า ก็ต่อเมื่อ

ไม่เคยเรียน inter ก็งี้แล่ะ แหะๆ ดูใน wiki ได้ ผมว่า ภาษาไทยเข้าใจง่ายกว่าตั้งเยอะ ราชบัณฑิตเก่งจัง ^^ PS. cardinality แปลว่า จำนวนสมาชิก

ubuntu linux HP printer " out of paper "

จากที่ config ubuntu linux ให้ใช้ printer HP Laserjet ได้แล้ว ก็เจอปัญหาว่า พอ print ไป กระดาษหมด มันจะขึ้นมาว่า out of paper พอใส่กระดาษไปเรียบร้อยแล้ว กด refresh printer บน taskbar เหมือนบน Windows ไม่ได้ เข้าไป System > Administrator > Printing ก็ไม่มีให้ refresh ปุ่ม refresh ที่ตัว พรินท์เตอร์ ของรุ่น HP LaserJet P1005 ก็ไม่มีอีก !! . . . วิธีแก้ แบบสั่วๆ ก็คือ รีสตาร์ท ubuntu แมร่งเลย พอจะล๊อกอินเข้ามาใหม่ มันจะ print ได้ต่อ แต่ว่า มันไม่ใช่วิธีแก้ที่ถูกต้อง !! หลังจากที่ แก้แบบ สั่วๆ มานาน วันนี้รำคาญ เพราะว่า ใส่กระดาษไม่พอบ่อยเหลือเกิน เลยเข้าไปหาในเวป ผลก็คือ http://localhost:631 !!! ห่ะ มี web UI แอบรันอยู่ในเครื่องด้วยอ่ะ ( CUPS ) เพิ่งรู้นะเนี่ย เลยเข้าไป มั่วๆ โดย กด tab Printer กดปุ่ม stop Printer บนเวป แล้ว start ใหม่ ปรากฏว่าได้แหะ ขอบคุณเวป linuxquestions นะครับ สำหรับคำตอบดีดี

My bike is broken again.

Today I tried to unlock a bicycle locker, and .. I made a key stuck inside the locker, leaving the bottom part on a key chain !! I had to hand my bike from CSIM building to the bike fixing shop, so tired.

basic gnuplot tutorial

Basic Plot plot sin(x) set xrange and yrange plot sin(x) set xrange[0:10] set yrange[0:10] replot reset y range, or set yrange auto นั่นเอง สำหรับแก้เวลาเราเซต xrange, yrange ไปแล้ว set auto y replot save or export to png set terminal png set output "sin_graph2.png" plot sin(t) 3d point plot เขียนไฟล์ data.dat ตามนี้ 1 2 5 3 4 5 แล้ว splot 'data' plot 3D vector ไฟล์ชื่อ test_gnuplot_vector 0 0 0 3 4 4 สั่งตามนี้ splot "test_gnuplot_vector" with vectors, "" notitle with lines change point style splot 'data' with point 1 3 NOTE : this set line type = 1, and point type = 3 plot 2 dataset from file มันไม่มี hold on เหมือนใน matlab แต่ใช้ comma ต่อๆกันไปเลย let's say, this is your file 'keyframeExperiment.txt' # keyframeScore reprojectionErr 1 18.689333 49.660751 2 18.334122 286.358689 3 145.421570 0.407815 4 18.646347 6.265752 จะสั่งตามนี้ plot 'keyframeExperiment.txt' using 1:3 title "reprojection error" with l