วันพุธที่ 7 ธันวาคม พ.ศ. 2554

How to repair hidden folder that hidden by virus.

1. Start -> Run -> cmd <-|
2. Go to drive by command drive_letter: for example g: <-|
3. Type  attrib -s -h -r /s /d <-|


Comment
   arrtib = attribute command
         /s  = file
         /d = directory
         -s = system file
         -h = hidden file
         -r = read only file


Story by http://hpitcha.wordpress.com/2010/12/02/shortcut-virus/

วันศุกร์ที่ 26 สิงหาคม พ.ศ. 2554

cxGrid : How to create a Level/View programmatically at runtime

// Delphi code
var
  Grid: TcxGrid;
  Level: TcxGridLevel;
  View: TcxGridDBTableView;
...
  // Creates a Grid instance
  Grid := TcxGrid.Create(SomeOwner);
  Grid.Parent := SomeParent;
  // Creates a Level
  Level := Grid.Levels.Add;
  Level.Name := 'SomeLevelName';
  // Creates a View
  View := Grid.CreateView(TcxGridDBTableView) as TcxGridDBTableView;
  View.Name := 'SomeViewName';
  // ... and binds it to the Level
  Level.GridView := View;
  // Hooks up the View to the data
  View.DataController.DataSource := SomeDataSource;
  // ... and creates all columns
  View.DataController.CreateAllItems;
end;


Copy from :  http://www.devexpress.com/Support/Center/KB/p/A295.aspx

วันอาทิตย์ที่ 14 สิงหาคม พ.ศ. 2554

SQL Command Reference

SQL INNER JOIN
      The INNER JOIN keyword return rows when there is at least one match in both tables.

SQL INNER JOIN Syntax

      SELECT column_name(s)
      FROM table_name1
      INNER JOIN table_name2
      ON table_name1.column_name=table_name2.column_name

PS: INNER JOIN is the same as JOIN.

--------------------------------------------------------------------------------------------------------------
SQL LEFT JOIN Keyword

      The LEFT JOIN keyword returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2).

SQL LEFT JOIN Syntax
      SELECT column_name(s)
      FROM table_name1
      LEFT JOIN table_name2
      ON table_name1.column_name=table_name2.column_name

PS: In some databases LEFT JOIN is called LEFT OUTER JOIN.


--------------------------------------------------------------------------------------------------------------
SQL RIGHT JOIN Keyword

      The RIGHT JOIN keyword returns all the rows from the right table (table_name2), even if there are no matches in the left table (table_name1).

SQL RIGHT JOIN Syntax
      SELECT column_name(s)
      FROM table_name1
      RIGHT JOIN table_name2
      ON table_name1.column_name=table_name2.column_name

PS: In some databases RIGHT JOIN is called RIGHT OUTER JOIN.


--------------------------------------------------------------------------------------------------------------
SQL FULL JOIN Keyword

      The FULL JOIN keyword return rows when there is a match in one of the tables.

SQL FULL JOIN Syntax
      SELECT column_name(s)
      FROM table_name1
      FULL JOIN table_name2
      ON table_name1.column_name=table_name2.column_name


--------------------------------------------------------------------------------------------------------------

Source : http://www.w3schools.com/sql/default.asp

Delphi Trick

Hot Key
F12 : switch before Code and Design work space.
CTRL + F9 : Compile Source Code.

Variable
Char Type : use single Quote ' '
                  #number for get char from int or chr(number) function

Component
cxGrid : show Nevigator Tools Bar => OptionView->Navigator
cxGrid : Show Detail Tab Level => Properties -> RootLevelOptions -> DetailTabPosition
cxButton : Picture Button => Glyph

Programer Trick
Property : prop_name : type read func_name write proced_name;

วันอังคารที่ 2 สิงหาคม พ.ศ. 2554

FreeBSD Apache,PHP,MySQL UTF-8 support

httpd.conf:
=============
AddCharset UTF-8 .utf8
AddDefaultCharset UTF-8

php.ini
===============
default_charset = "utf-8"

my.cnf
================
character-set-server=utf8
default-collation=utf8_unicode_ci


ที่มา : http://www.thaibsd.com/webboard/show.php?Category=thaibsd&No=16348

วันพุธที่ 8 มิถุนายน พ.ศ. 2554

กู้ Grub Loader เมื่อ Grub Menu ไม่ขึ้น

1.  Boot Ubuntu Live CD
2.  Open Terminal
3.  sudo -i
4.  mount /dev/your_ubuntu_partition /mnt
5.  grub-install --root-directory=/mnt/ /dev/your_HDD_Device
6.  shutdown -r now
7.  if your menu doesn't correct
     go to synaptic and then install grub-pc for reconfig your boot menu again
     and restart for finish.
8.  if you have BSD OS. /boot/grub/grub.cfg require editing. see example on referlink


referlink : http://www.gggcomputer.com/index.php?topic=2388.0;wap2

วันพุธที่ 25 พฤษภาคม พ.ศ. 2554

วันศุกร์ที่ 1 เมษายน พ.ศ. 2554

apt-get segmentation faults Problem.

หากใช้คำสั่ง apt-get แล้วเกิด Segmentation Faultsts ขึ้นให้ทำการลบไฟลล์ .bin ใน directory /var/cache/apt/


sudo rm /var/cache/apt/*.bin
 
Refer site : http://crunchbanglinux.org/forums/topic/6217/solved-synaptic-aptget-error-segmentation-fault/ 

วันจันทร์ที่ 31 มกราคม พ.ศ. 2554

Ping Error

1.  Destination Network Unreachable => มี router ตอบกลับมาว่า ไม่สามารถหา Host ที่ต้องการได้จาก Network Path ใดๆ
2.  Destination Host Unreachable => router ตอบกลับว่า สามารถค้นหา Host ที่ต้องการเจอ แต่เมื่อส่ง ARP เพื่อถามหา IP Address ดังกล่าว กลับไม่มีการตอบกลับ
3.  ping: sendto: Host is down

วันพุธที่ 26 มกราคม พ.ศ. 2554

iperf

iperf เป็น Application สำหรับวัดค่าต่างๆของเครือข่าย ได้แก่ Throughput , Jitter (Latency Variation) , Datagram loss , Bandwidth
option ที่ป้อนให้ มีความหมายดังนี้
Client/Server:
-f     --format  [kmKM]    format to report: Kbits, Mbits, KBytes, MBytes
-i    --interval                   seconds between periodic bandwidth reports
-l    --len  [KM]                length of buffer to read or write (default 8 KB)
-m    --print_mss             print TCP maximum segment size (MTU - TCP/IP header)
-p    --port                       server port to listen on/connect to
-u    --udp                       use UDP rather than TCP
-w    --window  [KM]      TCP window size (socket buffer size)
-B    --bind  "host"           bind to "host", an interface or multicast address
-C    --compatibility        for use with older versions does not sent extra msgs
-M    --mss                      set TCP maximum segment size (MTU - 40 bytes)
-N    --nodelay                set TCP no delay, disabling Nagle's Algorithm
-V    --IPv6Version         Set the domain to IPv6

Server specific:
-s     --server                  run in server mode
-U    --single_udp           run in single threaded UDP mode
-D    --daemon               run the server as a daemon

Client specific:
-b     --bandwidth  [KM]      for UDP, bandwidth to send at in bits/sec (default 1 Mbit/sec, implies -u)
-c    --client  "host"        run in client mode, connecting to "host"
-d    --dualtest               Do a bidirectional test simultaneously
-n    --num  [KM]           number of bytes to transmit (instead of -t)
-r    --tradeoff               Do a bidirectional test individually
-t    --time                     time in seconds to transmit for (default 10 secs)
-F    --fileinput  "name"    input the data to be transmitted from a file
-I    --stdin                    input the data to be transmitted from stdin
-L    --listenport           port to recieve bidirectional tests back on
-P    --parallel              number of parallel client threads to run
-T     --ttl                      time-to-live, for multicast (default 1)

Miscellaneous:
-h    --help                   print this message and quit
-v     --version             print version information and quit

ที่มา : IPERF - The Easy Tutorial

วันอังคารที่ 18 มกราคม พ.ศ. 2554

รวบรวม apt-get package name

Command : Package Name
killall : psmisc
iwlist , iwconfig : wireless-tools
lsusb : usbutils
dos2unix : tofrodos

USB-CDC Support

หากว่า Linux Kernel มองไม่เห็น USB-CDC Device อย่าเพิ่งตกใจ ดิ้นรนไปหา Driver มาลงเพิ่ม เนื่องจาก Linux เวอร์ชันใหม่ๆนั้นมี Driver CDC อยู่แล้ว (ที่ผมใช้อยู่เป็น 2.6.32-rc8) แต่บางครั้งอาจยังไม่ได้โหลดเคอร์เนลโมดูลเข้าหน่วยความจำ วิธีแก้คือ

#depmod -a

คำสั่งนี้จะเป็นการโหลดเคอร์เนลโมดูลเข้าสู่หน่วยความจำ เมื่อใช้คำสั่งนี้แล้วลองถอดอุปกรณ์ออกแล้วเสียบเข้าไปอีกครั้ง คราวนี้จะเห็นว่า USB-CDC สามารถใช้งานได้แล้วครับ

แหล่งอ้างอิง
http://www.qbik.ch/usb/devices/drivers.php

วันพฤหัสบดีที่ 13 มกราคม พ.ศ. 2554

How to compile RT73 Driver for ARM Linux

1.  Download latest RT73 Linux Driver from Ralink
2.  unzip source code using command
     tar xvjf 2010_0817_RT73_Linux_STA_v1.1.0.4.tar.bz2
3.  cd 2010_0817_RT73_Linux_STA_v1.1.0.4/Module
4.  cp Makefile.6 Makefile
5.  vim Makefile
6.  Modify to this
     #PLATFORM=PC
     #PLATFORM=CMPC
     PLATFORM=ARM
     .
     .
     .
     ifeq ($(PLATFORM),PC)
     LINUX_SRC =/lib/modules/$(shell uname -r)/build
     endif
     ifeq ($(PLATFORM),CMPC)
     LINUX_SRC = /home/fonchi/vendor/kernel-default-2.6.21/linux-2.6.21
     endif
     ifeq ($(PLATFORM),ARM)
     LINUX_SRC = /home/<home dir>/kernel/kernel-bin
     endif
  
     save and exit
7.  compile source code using command
   CROSS_COMPILE=arm-angstrom-linux-gnueabi- ARCH=arm make all
8.  install module i'm copy compile output to flash drive and then install to ARM machine using flash drive.
    at Ubuntu Machine
    mount /dev/sda /mnt
    cp rt73.bin /mnt
    cp rt73sta.dat /mnt
    cp rt73.ko /mnt
    umount /mnt

    at ARM Machine
    mount /dev/sda /mnt
    mkdir /etc/Wireless/RT73
    cp /mnt/rt73sta.dat /etc/Wireless/RT73/
    dos2unix /etc/Wireless/RT73/rt73sta.dat
    chmid +x /etc/Wireless/RT73/rt73sta.dat
    cp /mnt/rt73.bin /lib/firmware/
    mkdir -p  /lib/modules/2.6.32-rc8/kernel/drivers/staging/RT73/
    cp /mnt/rt73.ko /lib/modules/2.6.32-rc8/kernel/drivers/staging/RT73/
    umount /mnt
9.  load module using command
     depmod -a
10.insert RT73 usb. Enjoy...

Usful Links
Ralink RT73 driver download page
Porting for Beagle Board
Project4fun