หน้าเว็บ

About me

Hi, I'm cheer. My interest relates to artificial intelligence, machine learning, computer vision, network communication, security algorithm.

วันพฤหัสบดีที่ 4 ตุลาคม พ.ศ. 2555

SAN Interface

SAN (Storage Area Network) has 2 type of interfaces

1. FC (Fiber Card) or  HBA  (Host Bus Adapter)
- use of fiber optic
- require SAN switch
- 4-8 Gbps

2. iSCSI
- use of UTP/STP (RJ45) 
- require network switch
- data rate depends on network infrastructure 100Mbps+

วันเสาร์ที่ 12 มีนาคม พ.ศ. 2554

วันอาทิตย์ที่ 19 ธันวาคม พ.ศ. 2553

RoR on Windows

  1. Install Ruby via the ruby website
  2. Install RubyGems.
  3. Install Rails:
  • In the command prompt, type gem install rails –include-dependencies.
  • If this doesn’t work, you’ve likely got RubyGems problems. You can download the stand-alone package for Rails and install from there, but you’ll likely want to take care of your RubyGems issues before moving on.

Database Installation

  1. Install PostgreSQL:
  2. Download the latest win32 version of PostgreSQL (64-bit is not currently supported on Windows systems).
  3. Initiate the installer and walk through the wizard. A couple of potential “gotcha” spots:
    1. Let the installer create a new Windows account so PostgreSQL can run as a service (I accepted the default postgres account and specified my own password).
    2. Let the database initialize a cluster for you.
  4. Install postgres-pr gem, which is a Ruby driver for PostgreSQL:
    1. Command line: gem install postgres-pr.
    2. Using the pgAdminIII gui that is installed by default with PostgreSQL, create your application databases. Follow the Ruby on Rails naming convention ofApplicationName_development, ApplicationName_test,ApplicationName_production when naming them.
  5. Configure your application to connect to the database(s):
    1. Open up your config/database.yml file and enter the following information for, at the very least, the development database:
      1. adapter: postgresql
      2. database: your_database
      3. username: postgres
      4. password: YourPassword
      5. host: localhost (assuming that you’re running PostgreSQL locally)
  6. Test your database connectivity:
    1. From the top level of your Rails application, type the following at a command prompt: rake db:migrate.
    2. If you get a response similar to this: (in c:/dev/YourWebApplication), you are good to go. If you get an error message, walk through the steps again, double-checking your configuration and fixing any mistakes (a Google search of the error is probably the best place to start).
credit:

Restful Authentication on Rail3

As you know the perfect of simplicity of restful authentication, rail plugin, now rail has stepped up version 3. Some of RoR developer has stuck with mist error in restful authentication functionality. This is because some built-in function in rail has changed whilst technoweenie, who introduced you this plugin, doesn't patch restful authentication to be compatible with rail3. Fortunately, there is new hero, Satish. He patched this wonderful plugin for us, ROR developer. Well, just check it out from http://github.com/satish/restful-authentication . There's nothing changes form native restful authentication functionality, so dun't worry .... enjoy !!!

Git on Window

There are 2 ways to go GIT on Windows:

  1. MsysGit
  2. CygWin - its already well-known to who is familiar with linux

Here, this article will introduce MsysGit. As we all know that GIT is protocol for source code management repository, which is very popular to opensource developer. Therefore, you windows should pack stuffs on your back and get ready to jump on GIT trend.

  1. download msysgit from [http://code.google.com/p/msysgit/downloads/detail?name=msysGit-fullinstall-1.7.3.1-preview20101002.exe&can=2&q= ]
  2. install it
  3. open "cmd" and go to msysgit directory
  4. run "git-cmd.bat"
  5. enjoy !!

Informaiton

วันศุกร์ที่ 19 พฤศจิกายน พ.ศ. 2553

Machine Learning

Prerequisite

1. differential

2. Linear Algebra
3. Probability
http://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/book.html

Good Source
+ http://pages.cs.wisc.edu/~andrzeje/lmml.html
+ http://www.cs.iastate.edu/~cs573x/studyguide.html
+ http://www.cs.cmu.edu/~tom/mlbook-chapter-slides.html
+ http://nowak.ece.wisc.edu/SLT09.html

วันเสาร์ที่ 13 พฤศจิกายน พ.ศ. 2553

Ruby1.9.2 problem with rake

Due to ruby 1.9.2 has built-in rake, you therefore has to remove "rake.gemspec" first. It generally resides in \ruby1.9.2\lib\ruby\gems\1.9.x\specifications\rake.gemspec

Cheers !!

วันอาทิตย์ที่ 3 ตุลาคม พ.ศ. 2553

Install PostgrSQL-8.4 in Ubuntu

  1. sudo apt-get install postgresql postgresql-doc
  2. switch user to postgres so as to be able to use PostgreSQL

    sudo su postgres
  3. Then, we will be able to use PostgreSQL by

    psql -d "databasename"

  4. Defind password for user: "postgres" in UNIX system

    sudo passwd psotgres
    new password : xxx
    confirm : xxx

  5. Defind password for user: "postgres" in PostgreSQL system

    >psql
    >alter user postgres password 'xxx'



วันเสาร์ที่ 2 ตุลาคม พ.ศ. 2553

Set up root password when Ubuntu installed

$sudo passwd root
> password home user ###
> password UNIX(root password) xxx
> confirm xxx

วันศุกร์ที่ 1 ตุลาคม พ.ศ. 2553

Remote Desktop Graphically from Ubuntu to Ubuntu

vino is VNC server for GNOME.VNC is a protocol that allows remote display of a user’s desktop. This package provides a VNC server that integrates with GNOME, allowing you to export your running desktop to another computer for remote use or diagnosis.

By default ubuntu will come with vino-server so it is very easy to configure to enable remote desktop sharing in your ubuntu machine.If you want to access ubuntu machine remotely you need to login in to your ubuntu system.

Important note :-

Remote Desktop will only work if there’s a GNOME login session.Leaving your computer with an unattended GNOME login session is not secure and not recommended.

Some Tips

1) You can lock your screen using System--->Quit

Once you click on quit you should see the following screen here you need to select lockscreen

2) switch off your monitor when computer is left unattended

Configuring Remote Desktop

First you need to go to System -> Preferences -> Remote Desktop

Once it opens you should see the following screen

In the above screen you need to configure remote desktop preferences for sharing and security

For Sharing

you need to tick the box next to the following two options

Allow other users to view your desktop
Allow other users to control your desktop

For Security

you need to tick the box next to the following two options

Ask you for confirmation (If you tick this option some one need to click on allow from remote desktop once it connected if you don’t want you can untick this option)
Require the user to enter this password:
Password: Specify the password

Connecting from Ubuntu Machine

Open your terminal from Applications--->Accessories--->Terminal and enter the following command

vncviewer -fullscreen 192.168.2.23:0

now you should see the following message asking for password enter the password after complete success you can see VNC authentication succeeded message and starting remote desktop

VNC viewer version 3.3.7 - built Jul 4 2006 10:04:48
Copyright (C) 2002-2003 RealVNC Ltd.
Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
See http://www.realvnc.com for information on VNC.
VNC server supports protocol version 3.7 (viewer 3.3)
Password:
VNC authentication succeeded

If you want to quit vncviewer

Press ‘F8′ and select Quit viewer

Connecting from Windows machine

If you are trying to connect from your windows machine you need to install vncviewer of your choice i have installed from here http://www.realvnc.com/download.html.Install this program once you install this you can opem from start--->All programs--->RealVNC--->VNC Viewer 4--->Run VNC Viewer once it opens you should see the following screen here enter the remotemachine ipaddress:0 format and click ok

Now it will prompt for password enter your password and click ok

Now on the remote machine you should see the following screen asking for permission to allow this connection you need to click on allow this will comeup only if you tick “Ask you for confirmation” option under sharing

Once it connected you should see the remote machine desktop like the following screen


credit : http://www.ubuntugeek.com/share-your-ubuntu-desktop-using-remote-desktop.html

I found this link and it was such a beautiful and very easy to go installation on this instruction.

วันพฤหัสบดีที่ 16 กันยายน พ.ศ. 2553

Backup and Restrore PostgreSQL RDBMS

Backup:

  1. pg_dump -U username -W database_name -h host_address > /path/back_file_name.sql
  2. when prompted, enter the db password for the db user desknowserver (ex. 'password')
  3. the command will generate a file called /var/back_file_name.sql - if you need to store this file, it is recommended to compress it with gzip, as this will greatly reduce its size

    pg_dump -U username -W database_name -h host_address | gzip > /path/back_file_name.sql
ex. sudo pg_dump -U postgres -W testdb -h localhost > /home/cheer/testdb.sql
ex. sudo pg_dump -U postgres -W testdb -h localhost | gzip > /home/cheer/testdb.sql

Restore:

recreate the desknow (or use another name) database following the standard procedure:

  1. su - postgres
  2. psql template1 desknowserver
  3. create database desknow with encoding='UNICODE';
  4. \c desknow desknowserver
  5. \i /var/desknowbackup.sql

Install Netbean on Linux1

  1. install java, which is prerequisite.

    sudo apt-get install java

  2. download netbean latest version at http://netbeans.org/downloads/start.html?platform=linux&lang=en&option=all
  3. install by

    mv netbean-x.x.x-ml-linux.????.sh netbean-.x.x.x


    sudo sh netbean-x.x.x.sh

วันอาทิตย์ที่ 5 กันยายน พ.ศ. 2553

Virtual Host on Apache2 [Ubuntu Lucid]

  1. gedit /etc/apache2/apache2.conf

    ServerRoot "/etc/apache2"
    ServerName ... --> whatever you like eg. ServerName CzEmpire

  2. Set Apache's ports > gedit /etc/apache2/ports.conf

    #Listen for virtual host request on all IP addresses at port 80
    NameVirtualHost *

    #Listen on port 80
    Listen 80

  3. Create virtual host
    > cd sites-available

    #Create first virtual host named "localhost" eg. http://localhost
    > gedit localhost



    #Specify where "localhost" directory locates
    DocumentRoot /var/www/localhost

    #Specify name for this virtual host
    ServerName localhost
    ServerAdmin xxx@xxx.xxx



  4. Enable virtual host configuration
    > a2ensite localhost
    > a2ensite www.abc.com

  5. Create web site repository
    > cd /var/www
    > mkdir localhost/htdocs
    > mkdir localhost/logs
    > mkdir localhost/cgi-bin

    > mkdir www.abc.com/htdocs
    > mkdir www.abc.com/logs
    > mkdir www.abc.com/cgi-bin

  6. Make your server know all previous domain names
    > gedit /etc/hosts

    127.0.0.1 localhost www.abc.com

  7. Restart system
  8. Start Apache2 engine
    > /etc/init.d/apache2 start



วันอังคารที่ 20 กรกฎาคม พ.ศ. 2553

How to install Windows on Netbook via thumb drive

What you will need:

  • Microsoft Windows XP intstallation files on a CD / DVD / Image
  • Another PC running Microsoft Windows XP or Vista
  • USB_PREP8 Download:Google,2shared.com
  • PeToUSB Download:Official site
  • Bootsect.exe Download:Google ,2shared.com
  • A USB stick large enough to hold the install files and possibly the Asus EEE PC drivers. In this tutorial a SanDisk Cruzer 4GB is used.
Use a 4 GB if you want to copy the Asus EEE PC Driver DVD. 1 Gigabyte is enough for XP install files only.

Preparing the Bootable USB flash drive

Extract USB_prep8 and PeToUSB.
Copy or move the file PeToUSB.exe from the PeToUSB folder to the USB_prep8folder. Your usb_prep8 folder should look like this:

image1

Double click the Command Script named usb_prep8.cmd. The command prompt window will look like this:

image2
Insert your USB-flash drive and press any key:

PeToUSB Flash stick settings
Make sure you have the right USB-stick selected. In the image above you see [SanDisk Cruzer USB Device 4025Mb [E:\]] Selected. Cross the “Quick Format” if you want to save some time (marked in red).

Click on Start. In the dialog box saying “Continue?”, click Yes:
Klick Yes to continue

Another dialog box appears, click Yes:
Click Yes

When the format is complete (probably immediately) you will get this:

image6

Click Ok.

Extract bootsect.zip to a folder of your choice. (In this example i useC:\bootsect\).
Open a command prompt (on XP click Start->Run and type “cmd”):
image7

Navigate to the directory where you extracted BootSect.exe using the “cd” command (this example uses folder c:\bootsect):

cd \bootsect\bootsect [Enter]
image8a

Then type:
bootsect /nt52 E: [Enter]

image8

This writes a bootable bootsector to your USB flash drive. Do not have any windows open displaying the contents of the USB drive. Bootsect.exe needs exclusive access to the USB disk and you will not be able to write a correct bootsector.

Close this command prompt. (Do not close the other running usbprep8).

The usbprep8 command line window should now look like this:

image9

Press enter, if it does not look like the window above.

Now we need to supply information for 1-3 in the image above.

Press 1 + [Enter] - Browse for the location of your Windows XP setup files (Your CD/DVD rom). A dialog box will appear:

image10

Select your source for the Windows XP install files (CD/DVD drive) and press OK.

Press 2 +[Enter] - enter a drive letter that is not currently in use. In this example we use T:\

Press 3 + [Enter] - enter the drive letter of your USB flash drive. You can use explorer to check.

Press 4 + [Enter] - To continue with the script.

After a short while the script will ask if you wish to format the drive T:

image12

Press Y + [Enter]. ( This is just a temporary drive to hold the windowsinstallation files)

When the formatting is done, Press enter to continue. You should now see the script copying files. When it has finished you should see this:
image131

You guessed it. Press any key to continue.

The script should copy a few files.

A popup asking if you want to “copy TempDrive Files to USB-Drive in about 15 minutes = Yes” should appear:

image14

Click Yes. The script starts copying files. This takes a while, so go get a cup of coffee or something.

Once it is done, a popup will ask you “Would you like USB-stick to be Preferred Boot Drive U:”:
image15

Select Yes.

Select Yes to unmount the Virtual drive.

Close the usbprep8 command line window and any others you have left open. You might want to copy drivers from your Asus EEE support DVD to the USB stick.

Now we are done with preparing the USB-flash drive. Next step is to make the correct changes to BIOS.

BIOS settings

Turn on your EEE PC. When the screen below turns up, hit [F2]:

startup

You should now be in the BIOS.

Use the arrow keys to navigate to the Boot section of the bios.

Select Hard disk drives as in the image below and hit Enter.
Asus Bios

Press the + (plus) key to make the USB stick the first drive:
bios-boot-hard-disk-drives

Exit and save the changes:
bios-exit-save

Booting your Asus EEE PC into XP install

*IMPORTANT* Do not remove the USB-stick at any part of the installation process of Windows XP.

Reboot your EEE. You should be presented with the following screen:
first-boot
Select the bottom alternative (as in the image above) titled
“1.TXT Mode Setup Windows XP, Never unplug your USB-drive until After Logon”

From here on the Windows XP setup is pretty straight forward except for the partitioning…

Preparing partitions on the EEE XP Install

When you reach the partitioning portion of the setup you will see something similar to this:
partitioning-before

In order to install Windows XP on your Asus EEE, you need to delete each and every one of the partitions.

When done it should look like this:
partitioning-after

Recreate one primary partition on your Asus EEE and PC and format it using NTFS.

Once the text mode portion of the XP install is done, you will see this screen when booting up:
second-boot

This time select the top alternative titled:
“2. GUI Mode Setup Windows XP. Continue setup + Start XP.”

Complete the GUI part of the setup as usual. Once the GUI part is done and your EEE reboots, again select the top alt. “2. GUI Mode…”.

Now you should boot up at a normal Windows XP desktop. You can remove the usb flash drive if you wish.

วันพุธที่ 14 กรกฎาคม พ.ศ. 2553

Joomla Ref : Module Name

For example,
  1. Main Menu
  2. Login
  3. User Menu
  4. Polls
  5. Who's Online
  6. Advertisement
  7. Newsflash
  8. Top Menu
  9. Banner
  10. Search
  11. Popular
  12. Latest News
  13. Breadcrumbs
  14. Syndicate

Joomla Ref : Position Name

  1. left
  2. right
  3. top
  4. bottom
  5. inset
  6. banner
  7. header
  8. footer
  9. newsflash
  10. legals
  11. pathway
  12. breadcrumb
  13. toolbar
  14. cpanel
  15. user1
  16. user2
  17. user3
  18. user4
  19. user5
  20. user6
  21. user7
  22. user8
  23. user9
  24. advert1
  25. advert2
  26. advert3
  27. icon
  28. debug
  29. search
  30. syndicate

วันจันทร์ที่ 12 กรกฎาคม พ.ศ. 2553

CMS : Joomla under Ubuntu

Joomla is one of the most powerful open source CMS. CMS, content management system, is a system allows user to easily manage their article by well-organized structure. Moreover, CMS itself often show you the way to customize CMS to fabulous website. For all of that, you may see from the Internet by googling it.

Alright, I now show you the way to install Joomla under Ubuntu OS

INSTALL
1. make sure that all basic web server software are well installed
2. download package from its official website www.joomla.org [I really recommend for newbie to start on stable version only, otherwise goahead on beta version by simple SVN, check it out !!!]

3. unpackage it

tar xvfz Joomla_x.x.x-Stable-.....tar.gz -C /var/www//

4. create empty file "configuration.php" in order to CMS installer could create configuration information for us

nano configuration.php

5. privilege it for all

chmod 777 configuration.php

6. restart apache once again

/etc/init.d/apache2 restart

7. type "http://localhost//", you will see what installer will do for you step by step

วันอาทิตย์ที่ 11 กรกฎาคม พ.ศ. 2553

Ubuntu Apache2

You may need to know a new apache

1.

"httpd.conf" is changed to "apache2.conf"

and there are further configuration files split in sub directories like.

mods-enabled/ --> for modules
sites-enabled/ --> for virtual hosts

2. document root = /var/www
3. apache program command

/etc/init.d/apache2 start|stop|restart

Ubuntu Apache+PHP+MySQL Installation

INSTALL

1. aptitude mysql-server mysql-client

At this time, you will be asked for mysql root user's password

2. aptitude apache2
3. aptitude php5 libapache2-mod-php5
4. /etc/init.d/apache2 restart - to finish installation

Note : You may get this error

"apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName"

This is because of doing unable to define host name

Sol : "nano /etc/hosts"

127.0.0.1 localhost.local localhost
127.0.1.1 .local

Then, save it and restart apache

Installation software in Linux

Some may get puzzled when to install softwares in Linux OS. No matter distribution is, we simply get software's installation guide, normally named "INSTALL"; hence, we open terminal, then execute following command "nano /INSTALL". You will see what to do to install that software.

What's in "/INSTALL"
1. software dependencies
2. setup guide
3. disclaimer

Among Linux distribution, there are so many easy-to-use and well-facilitating software managements such as
- yum in FreeBSD/xBSD
- apt-get / aptitude in Ubuntu