หน้าเว็บ

About me

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

วันเสาร์ที่ 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