Ubuntu

warning: Creating default object from empty value in /home/www/virtual/phaisarn.com/sun/htdocs/modules/taxonomy/taxonomy.pages.inc on line 33.

Quad boot

1. ใช้ Disk Utilities จัดเตรียม Partition ดังนี้

  • /dev/hda2 MacOS
  • /dev/hda3 Windows 7
  • /dev/hda4 Windows XP
  • /dev/hda5 Ubuntu
  • /dev/hda6 Swap

QR Code: in Python

libpng12-0
libpng12-dev
pkg-config
 
Install libqrencode
http://fukuchi.org/works/qrencode/index.en.html
Libqrencode is a C library for encoding data in a QR Code symbol, a kind of 2D symbology that can be scanned by handy terminals such as a mobile phone with CCD. The capacity of QR Code is up to 7000 digits or 4000 characters, and is highly robust.
Download: http://fukuchi.org/works/qrencode/qrencode-3.1.1.tar.gz
 

Problem: cannot load shared object file

Problem: cannot load shared object file
error while loading shared libraries: libgds.so: cannot load shared object file: No such file or directory
 
Solution
LD_LIBRARY_PATH /opt/interbase/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

or
export LD_LIBRARY_PATH=/opt/interbase/lib
 
replace /opt/interbase/lib with your library path

Drupal กับ .htaccess

Install drupal เสร็จ เข้าไปแก้ไข config ของ Theme แล้วมี error ประมาณว่า 
    * warning: fopen(sites/default/files/.htaccess) [function.fopen]: failed to open stream: Permission denied in /var/www/jack/includes/file.inc on line 129.
    * Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your sites/default/files directory which contains the following lines:
      SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
      Options None

ติดตั้ง GD Library

หลังจากติดตั้ง Drupal แล้ว 
มี message แจ้งเกี่ยวกับ GD Library
ให้ทำการติดตั้ง Package  php5-gd ด้วยคำสั่ง
sudo apt-get install php5-gd
จากนั้น restart apache ด้วยคำสั่ง
sudo /etc/init.d/apache2 restart
ก็เป็นอันเรียบร้อย
ที่มา: http://drupal.org/node/540838

How to Enable mod_rewrite on Ubuntu

เปิดใช้โมดูล mod_rewrite

sudo a2enmod rewrite

แก้ไฟล์คอนฟิก

sudo nano /etc/apache2/sites-enabled/000-default

แก้ไข none ให้เป็น all

<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    allow from all
</Directory>

สุดท้าย บูต Apache ใหม่

QueryPerformanceCounter()

ฟังก์ชั่น QueryPerformanceCounter() ใช้จับเวลาการทำงาน เป็นฟังก์ชั่นที่มีใน Windows ส่วนใน Linux ต้องเขียนฟังก์ชั่นนี้เอง โดย Code แสดงดังข้างล่างนี้
This function basically recreates the win32 QueryPerformanceCounter() on Linux, play with this code:

Time command

$ time ls
real    0m0.005s
user    0m0.004s
sys    0m0.000s

        * The elapsed (real) time between invocation of utility and its
termination.

* The User CPU time, equivalent to the sum of the tms_utime and
tms_cutime fields returned by the times() function defined in the
System Interfaces volume of IEEE Std 1003.1-2001 for the process in
which utility is executed.

Installing OpenCV on Linux (Ubuntu)

ทดสอบบน Ubuntu 10.04 LTS (Lucid Lynx)

1. ก่อนอื่นติดตั้ง package ที่จำเป็นดังนี้

g++, libgtk2.0-dev

2. จากนั้นทำการติดตั้ง package ดังต่อไปนี้

libcv4
libcv-dev
libcvaux4
libcvaux-dev
libhighgui4
libhighgui-dev
opencv-doc
(‘python-opencv’ not required)

3. จากนั้นทดลองทำการบันทึกไฟล์ hello.cpp ไว้ทดสอบ

 

Syndicate content