Thứ hai, ngày 04 tháng năm năm 2009

Nói phét qua ngày :D

...
(10:52:16 PM) J.B: chú phải nắm đc "Chính tông, phản tông"
(10:52:26 PM) J.B: thì mới đưa ra layout ngon đc ;))
(10:52:35 PM) Sir Pham: he he
(10:52:38 PM) Sir Pham: bác chỉ em cái
(10:52:46 PM) Sir Pham: cái lày em chẳng hỉu mấy
(10:53:07 PM) Sir Pham: việc của em là sales nhưng do tình hình tiến độ nên toàn phải nhẩy vào edit
(10:53:08 PM) Sir Pham: :D
(10:53:15 PM) J.B: cái này là cái gốc của thiết kế đồ họa
(10:53:33 PM) J.B: ko nắm đc thì layout hay bị xộc xệch
(10:53:47 PM) J.B: mất cân đối, thậm chí là gây phản cảm với người xem
(10:53:55 PM) Sir Pham: yes
(10:53:56 PM) J.B: mặc dù kỹ thuật rất ngon, tốc độ rất tốt
(10:54:37 PM) Sir Pham: bác góp ý tiếp đi
(10:54:55 PM) Sir Pham: để em chỉnh
(10:55:00 PM) J.B: thôi, đoạn sau phải uống cafe mới nói đc típ :">
(10:55:13 PM) J.B: từ ngày chú lặn đi, chả về đây cafe cà pháo j cả
(10:55:17 PM) J.B: [-x
(10:55:34 PM) Sir Pham: ac ac
(10:55:37 PM) Sir Pham: em ban that ma
(10:55:45 PM) Sir Pham: tai tinh hinh kho khan
(10:55:50 PM) Sir Pham: nen nhan su cua ben em di het
(10:55:56 PM) Sir Pham: em phai lao vao cuoc muu sinh
(10:56:04 PM) Sir Pham: nhung cai don gian em toan phai lan mo code lay
(10:56:06 PM) Sir Pham: :((
(10:56:11 PM) J.B: :D
(10:56:16 PM) Sir Pham: it nua cai Job plazza nay xong
(10:56:21 PM) Sir Pham: thi em se ranh roi hon
(10:56:32 PM) Sir Pham: luc day moi bac cafe cafao dam dao :D
(10:57:46 PM) J.B: đc rùi
(10:57:52 PM) J.B: anh cũng đang làm tài liệu
(10:58:02 PM) J.B: nói ngắn gọn với chú thế này nhé
(10:58:40 PM) J.B: chính tông, là tông màu chủ đạo của mình khi định thiết kế trang web, gắn với hoạt động của cty, logo của cty, hoặc là 1 màu mà cty khách hàng yêu cầu
(10:59:16 PM) J.B: ví dụ chú làm cho bọn Blue Sea, hoặc Oceon bank, ko thể dùng màu đỏ làm chủ đạo
(10:59:46 PM) Sir Pham: yes
(11:00:15 PM) J.B: khi đã xác định chính tông rùi, thì đặt mức sao nhất của tông đó là j
(11:00:44 PM) J.B: vì dụ blue là chính tông, nhưng ko phải lúc nào cũng lấy đậm như thế, mà lấy nhạt như nào là vừa
(11:00:56 PM) J.B: sau đó giảm dần ở các thành phần khác
(11:01:25 PM) Sir Pham: yes
(11:01:26 PM) J.B: ưu tiên menu/title, sau đó là background/table/boundary
(11:01:47 PM) J.B: chú có thể xem www.msn.com để hiểu thế nào là chính tông
(11:02:33 PM) J.B: tiếp đến là phản tông, tên của nó cũng thể hiện rồi
(11:02:48 PM) J.B: tức là trái ngược với cái tông chính của mình
(11:03:13 PM) J.B: thường để làm nổi bật những cái quan trọng/mới
(11:03:26 PM) J.B: ví dụ như là hot news/ new product...
(11:04:00 PM) J.B: chú có thể xem trên www.yahoo.com, để ý những nút bấm của nó màu rất nổi
(11:04:28 PM) J.B: đôi khi cái phản tông có thể là phần đăng nhập/tìm kiếm của 1 trang tin của chú
(11:04:56 PM) J.B: phải chú ý là phải hạn chế cái phản tông này, thì nó mới có tác dụng tốt
(11:05:02 PM) J.B: ko thì thành phản tác dụng
(11:05:41 PM) J.B: ví dụ đơn giản: cái bánh gatô nền trắng bóc, điểm 1 vài trái cherry đỏ nhìn rất đẹp
(11:06:03 PM) J.B: nhưng tưởng tượng toàn bộ về mặt cái bánh la liệt các trái cherry thì nó thế nào
(11:06:08 PM) J.B: đã ok chưa?
(11:06:19 PM) Sir Pham: he he
(11:06:25 PM) Sir Pham: bac noi em moi thay nhieu van de
(11:06:29 PM) Sir Pham: qua la mo rong tam mat
(11:06:31 PM) Sir Pham: :D
(11:06:38 PM) J.B: chú xem thằng msn nó dùng mấy màu
(11:06:48 PM) Sir Pham: bon no thiet ke chuyen nghiep that
(11:06:51 PM) J.B: đã nhận ra được chính tông/phản tông chưa :D
(11:06:55 PM) Sir Pham: he he
(11:07:06 PM) Sir Pham: em se phai nghien cuu vu nay
(11:07:14 PM) J.B: đấy là phần 1
(11:07:32 PM) J.B: hôm nào rảnh anh nói cho chú phần 2: bố cục như thế nào cho hợp lý
(11:07:49 PM) J.B: phần này khó - đáng café nè :">
(11:07:51 PM) J.B: =))
(11:07:59 PM) Sir Pham: he he
(11:08:01 PM) Sir Pham: chac chan rui
(11:08:26 PM) J.B: chỉ mấy khái niệm cơ bản phần 1, xem msn xong, chú xem trang của chú thấy mắc các lỗi cơ bản chưa :D
(11:08:27 PM) Sir Pham: em ngham cuu cai tong mau rui may hom nua xong cai core em qua bac cafe
(11:08:32 PM) Sir Pham: he he
(11:08:50 PM) J.B: nên anh chê chỉ có tính xây dựng, chú ko đc giận anh đâu đấy
(11:08:53 PM) J.B: :D
(11:08:57 PM) Sir Pham: troi
(11:09:01 PM) Sir Pham: hoi y kien tien boi
(11:09:07 PM) Sir Pham: he he
(11:09:19 PM) Sir Pham: bac gop y em moi len phuong an duoc
(11:09:28 PM) Sir Pham: chu em van nhin thay no roi mat
(11:09:30 PM) Sir Pham: ko thaong
(11:09:40 PM) Sir Pham: vi chua nam duoc nhung dieu bac vua noi
(11:09:44 PM) Sir Pham: la tong mau
(11:09:45 PM) Sir Pham: :D
(11:09:58 PM) J.B: uh, cái ví dụ rõ nhất về chính tông, chính là các forum
(11:10:09 PM) J.B: chú setup nhiều rùi, giờ chắc là nhận ra ngay, hả :))
(11:10:20 PM) Sir Pham: he he
(11:10:28 PM) Sir Pham: em co chiu nghien cuu may cai nay dau
(11:10:34 PM) Sir Pham: cu toan lam bua
(11:10:35 PM) Sir Pham: :D
(11:10:55 PM) Sir Pham: dot nay sua lai tong cho thang nay la mat nhieu thoi gian day
(11:11:01 PM) J.B: uh
(11:11:04 PM) Sir Pham: :D
(11:11:17 PM) J.B: làm việc với đồ họa tốn time và tốn RAM mà =))
....

Thứ ba, ngày 03 tháng ba năm 2009

Thơ cho ngày 8

(Tặng Lily)

YÊU EM NHIỀU lắm em ơi
EM YÊU NHIỀU cũng còn xơi mới bằng?
YÊU NHIỀU EM? Chớ nói xằng.
NHIỀU EM YÊU cũng chẳng bằng mình em ;;) :x >:D<

Chủ nhật, ngày 08 tháng hai năm 2009

Install CVS + SSH on Ubuntu

1. Installation
Install CVS server:
$ sudo apt-get install cvsd
When prompted in the cvsd installation process for Repository, type in “/cvsroot”.

2. Configuration
goto /var/lib/cvsd and build the cvsroot:
$ sudo cvsd-buildroot /var/lib/cvsd
create the folder cvsroot:
$ sudo mkdir cvsroot
and then initilize the repository
$ sudo cvs -d /var/lib/cvsd/cvsroot init
$ sudo chown -R cvsd:cvsd cvsroot


3. Add user and password:
$ sudo cvsd-passwd /var/lib/cvsd/cvsroot +YOUR_USER_HERE
(Repeat this line for each user)
NOTE: To create a user that has only read rights follow the next steps:
# touch /var/lib/cvsd/root/CVSROOT/readers
# chown cvsd:cvsd /var/lib/cvsd/root/CVSROOT/readers
# vi /var/lib/cvsd/root/CVSROOT/readers

Add the users you just created to this file, each user seperated by a new line. Do not forget to put a new line after the last user. This setting only allows readers to the repository, to allow writers, create a file writers on same path.
If a user is in the readers file the user is only allowed to read, regardless of whether or not they are in the writers file. If the user is in the writers file and not the readers file they can both read and write.
and then change the AUTH type:
$ sudo vi /var/lib/cvsd/cvsroot/CVSROOT/config
uncomment the “SystemAuth=no” line.

4.Test it
On client side, install cvs
$ sudo apt-get install cvs and run
$ cvs -d :pserver:YOUR_USER_HERE@YOUR_HOST_NAME:/cvsroot login
$ cvs -d :pserver:YOUR_USER_HERE@YOUR_HOST_NAME:/cvsroot checkout.

If Windows client side, just download cvs.exe to use.

5. SSH Mode
Install: $ sudo apt-get install openssh-server
# chmod -R 775 /var/lib/cvsd/cvsroot
# useradd USERNAME (create system user on server)
# gpasswd -a USERNAME cvsd (grant the user by adding him to the cvsd group)

Repeat the second line for each user who needs access to cvs. Now any user that can access your server via ssh who also belongs to the cvsd group can access the cvs repository by setting CVSROOT as follows:
# CVSROOT=:ext:YOUR_USER_HERE@YOUR_HOST_NAME:/var/lib/cvsd/cvsroot; export CVSROOT
Test: cvs rls

6. SSH without password prompt
On client side, generate DSA key pair:
$ ssh-keygen -t dsa
Setting up passphrase access:
$ scp ~/.ssh/id_dsa.pub YOUR_USER_HERE@YOUR_HOST_NAME:.
$ ssh -l YOUR_USER_HERE -L 2401:localhost:2401 YOUR_HOST_NAME
% mkdir ~/.ssh
% chmod 700 ~/.ssh
% cat ~/id_dsa.pub >> ~/.ssh/authorized_keys2
% rm ~/id_dsa.pub
% chmod 600 ~/.ssh/*
% exit

(You can also send the .pub file to your CVS Server's administrator to config)
Now test this by enter:
ssh YOUR_USER_HERE@YOUR_HOST_NAME
If now you are logged in to the to the CVS machine without entering the password then everything's Ok.
NOTE: If the client side using Windows, please use puttygen to generate the key pair.
Check here for using PuTTY and SSH + JDev: http://www.oracle.com/technology/products/jdev/howtos/other/jdev10g_cvs_putty.html

Thứ năm, ngày 15 tháng một năm 2009

Nhật Tân - 2009

Hehe, năm nay hoa đào nở sớm, tranh thủ chủ nhật đi chụp mấy phát, không đến Tết chả còn mà chụp :D







From Nhat Tan - 2009

Thứ năm, ngày 01 tháng một năm 2009

UFW - Ucomplicated Firewall

(important note: UFW is not the firewall. UFW just configures your iptables)

Set the default policy (i.e "mostly open" vs "mostly closed")
$ sudo ufw default allow|deny
Toggle logging
$ sudo ufw logging on|off
To view log
sudo iptables -L -n | grep LOG
Turn on|off the firewall
$ sudo ufw enable|disable
To add deny|allow rules:
1. blocking|allowing a port
$ sudo ufw deny|allow port <port number>
2. blocking|allowing an ip address
$ sudo ufw deny|allow from <ip address>
3. blocking|allowing a specific ip address and port
$ sudo ufw deny|allow from <ipaddress> to port <port number>
4. advanced deny example for denying|allowing access from an ip address range 10.120.0.1 - 10.120.0.255 for SSH port 22
$ sudo ufw deny|allow from 10.0.0.1/24 to any port 22
5. you want to block access to port 22 from 192.168.0.1 and 192.168.0.7 but allow all other 192.168.0.x IPs to have access to port 22
$ sudo ufw deny from 192.168.0.1 to any port 22
$ sudo ufw deny from 192.168.0.7 to any port 22
$ sudo ufw allow from 192.168.0.0/24 to any port 22

if you do the allow statement before either of the deny statements it will be matched first and the deny will not be evaluated.

Full PF-style syntax
$ sudo ufw allow|deny [proto <protocol>] [from <address> [port <port>]] [to <address> [port <port>]]
Accept or drop incoming packets to <service> (can see what services are available with 'status' (see below)). <service> can be specified via service name in etc/services, 'protocol:port', or via package meta-data. 'allow' adds service entry to /etc/ufw/maps and 'deny' removes service entry from /etc/ufw/maps. Basic syntax:
$ sudo ufw allow|deny <service>
Display status of firewall and open ports
$ sudo ufw status
External packages will add application profiles to /etc/ufw/applications.d that describe the service. File will use .INI format, will support pipe-separated values for port/protocol combinations, and multiple entries per file. The 'ports' syntax is the same as for the ufw CLI (eg '80', '22/tcp', '80,8080:8088/tcp'), but must be numeric. The example below is the content of /etc/ufw/applications.d/samba
[Samba]
title=LanManager-like file and printer server for Unix
description=The Samba software suite is a collection of programs that implements the SMB/CIFS protocol for unix systems, allowing you to serve files and printers to Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred to as the LanManager or NetBIOS protocol.
ports=137,138/udp|139,445/tcp


References
Ubuntu Wiki: https://wiki.ubuntu.com/UbuntuFirewall
Ubuntu Forum: http://ubuntuforums.org/showthread.php?t=823741
GUI for ufw available: http://gufw.tuxfamily.org/

Thứ sáu, ngày 26 tháng mười hai năm 2008

Delete CVS Directories Recursively

Option #1
$ cd /your/folder/
$ find . -depth -name 'CVS' -exec rm -rf {} \; -print

Option #2
export your project (only source) CVS will skip its files.
$ export CVSROOT=:pserver:youruser@cvs.domain.com:/cvsrepo/
$ cvs login
$ mkdir test
$ cd test
$ cvs export some_module

Thứ tư, ngày 24 tháng mười hai năm 2008

Oracle XE: Can't start listener

I connect to Oracle XE (on the desktop) from my laptop, and it had the error:
ERROR: ORA-12541: TNS: no listener
So I check the Oracle XE:
$ lsnrctl status
...
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=thuannm)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused

I've checked the listener.ora and tnsnames.ora, but there's no problem found. So I tried to start the Listener, and I got:
$ lsnrctl start
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
NL-00280: error creating log stream /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/log/listener.log
NL-00278: cannot open log file
SNL-00016: snlfohd: error opening file
Linux Error: 13: Permission denied

From this error I knew that I didn't have write permission on the log file. After fixing this, I start the listener again, the error has changed :D
$ lsnrctl start
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/listener.ora
Log messages written to /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/log/listener.log
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
TNS-12555: TNS:permission denied
TNS-12560: TNS:protocol adapter error
TNS-00525: Insufficient privilege for operation
Linux Error: 1: Operation not permitted

This mean I can't start the TNS by the permission, after googling - lol - I found this:
$ sudo chown oracle.dba -R /var/tmp/.oracle/
And it works for me.