2012年2月22日 星期三

RHEL initial Environment Setup SOP

I. Delete default firewall

VNC connection will not establish success if the default RHEL firewall exists.
1. list existed rule.

# iptables --list
output:
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    RH-Firewall-1-INPUT  all  --  0.0.0.0/0            0.0.0.0/0

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
1    RH-Firewall-1-INPUT  all  --  0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain RH-Firewall-1-INPUT (2 references)
num  target     prot opt source               destination
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 255
3    ACCEPT     esp  --  0.0.0.0/0            0.0.0.0/0
4    ACCEPT     ah   --  0.0.0.0/0            0.0.0.0/0
5    ACCEPT     udp  --  0.0.0.0/0            224.0.0.251         udp dpt:5353
6    ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:631
7    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:631
8    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
9    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
10   REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited
2. Temporarily delete all the firewall rules

# iptables --flush
2a. (Option) Permanently remove all the default firewall rules
The permanent routting rule  stores in /etc/sysconfig/iptables file
# service iptables save

II. Setup DNS
Edit /etc/resolve.conf




III. Edit etc/hosts
Add a new mapping rule:    .

Reason: 
1. Due to jmx bundle will use getHost() to get ip address. 
2. Tibco message will not broadcast success without this setting.



IV. Add a sudo user and add the new user to /etc/sudoers
funkie ALL=(ALL)              ALL  //Syntax: user MACHINE=COMMANDS 

IV. Setup VNC
1. Uncomment the two line in  ~/.vnc/xtartup

unset SESSION_MANAGER 
exec /etc/X11/xinit/xinitrc

2. start vncservice with the new user that created in part V.

# vncserver :9527 -geometry 1440x880

VI. Create new yum repository

 1. copy the content that listed as below into /etc/yum.repo.d/centos.repo

[c5base] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os gpgcheck=1 enabled=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#released updates [c5updates] name=CentOS-$releasever - Updates mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates gpgcheck=1 enabled=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released [c5addons] name=CentOS-$releasever - Addons mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=addons gpgcheck=1 enabled=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful [c5extras] name=CentOS-$releasever - Extras mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=extras gpgcheck=1 enabled=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages [c5plus] name=CentOS-$releasever - Plus mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=centosplus gpgcheck=1 enabled=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
2. Clean yum cache

# yum clean all

VI. Check code from svn repository


svn command is already exists.




VII. Install JDK


To download rpm from official site and install it.
We can use the command as below to check the each file installation location.

# rpm -ql <rpm-package-name>



VIII. Install Tibco

1. The installation path should be(i.e., this just private convention).
2.a. setup LD_LIBRARY_PATH in /virgo/bin/startup.sh
2.b. setup LD_LIBRARY_PATH in ~/bin/springsource.sh
3. "chown" after installation
4. put the license file in one of $PATH

IX. Install MySQL


1. install though yum
# yum install mysql-server<mysql-server>
2. Auto activate mysqld when booting.

# vim /etc/rc.local
3. Grant remote connection

mysql > GRANT ALL PRIVILEGES ON *.* TO <username>@'%' IDENTIFIED BY '' WITH    GRANT OPTION;

4. Create fixhub db manually and quickfix db through quickfix sql tool


X. Checkout virgo from SVN

2011年7月8日 星期五

Use Cygwin as SSH server

Install Cygwin

• Download Cygwin from http://www.cygwin.com/
• Create c:\cygwin
• locate the setup.exe to c:\cygwin
• execute setup.exe
• Choose A Download Source → Install from Internet
• Select Root Install Directory → c:\cygwin
  Install For → All Users
  Default Text File Type → Unix / binary

• Select Local Package Directory → Local Package Directory: c:\cygwin
• Select Your Internet Connection → Direct Connection
• Choose A Download Site → ftp://ftp.nctu.edu.tw or ftp://ftp.ntu.edu.tw/

Necessary packages:

 • Admin → cygrunsrv
 • Net → openssh
 • Web → squid

Setup sshd service
 ssh-host-config

  Should privilege separation be used? (yes/no) no
  Do you want to install sshd as service? (yes/no) yes
  CYGWIN= (directly press "Enter key" to accept default value "ntsec")

 cygrunsrv --start sshd //start sshd service

 

2011年2月9日 星期三

am related command note

1. start Activity
$am start -n <package-name>/.<class-name> // e.g., idv.funkie.pkg/.MyClass

2011年2月4日 星期五

無心插柳,更讓我堅信~~~~~"改變"是對的

兔年(2011)大年初二晚上,不是在電視前或牌桌上, 竟然是在急診室(這次躺在病床上的不是我...)用手機寫部落格,這感覺真的挺妙的.

老實說, 對於自己目前的生活模式一直抱持著懷疑的態度: 這兒的薪水不錯, 工作內容不算無趣或太操, 加上住家裡和老爸雄厚的後盾, 短時間內, 工作一年半時就存到人生的第一桶金。 說真的,覺得自己很幸運, 若加上吳興街的房子改建,自己好像什麼都不用太努力就水到渠成。 然, 自己深深覺得這不是長久之道, 若不改變,彷彿此時此刻就看得到自己30年後的未來,(終其一生朝九晚八才得以換取堪用的生活費), 人生的腳步不會停滯不前,老爸不會永遠不退休, 自己不會永遠是個單身的羅漢咖, 總有一天會有小孩老婆要養,想到這,不禁懷疑,如果不改變現狀,走進"老鼠賽跑"的牢籠裡只是遲早的事。 自己似忽又找到當研究所創業的那種初衷跟動力。我不想被別人規定早上幾點要到公司; 晚上想走時還要擔心是不是太早走; 不想分紅時跟別人比較自己拿的是多是少; 不想再站在磅秤上給人秤斤論兩看自己值多少,可以領多少績效獎金,為什麼我的價值要由主管決定。 這次怎麼看自己都好像是既得利益者, 原本一點都不在乎可以拿多少,因為自認為這裡不會是屬於我的戰場, 我終究只會是個過客。 人生有太多不由自主的無奈, 我要搶回自己人生的發球權,這次的無心插柳,將更堅定我的信念。
Published with Blogger-droid v1.6.6

2011年1月18日 星期二

Git Server setup SOP

Setup user call "git"

1. Installing git
$ apt-get install git-core
2. Add "git" user and create ssh dir in his home.
$ sudo adduser git
$ su git // change role to "git" user
$ cd
$ mkdir .ssh
3. Append somebody's (e.g., funkie) public key to authorized_keys which is in /home/git/.ssh/ to let the user (e.g., funkie) has authorization to access git repository on server. P.S. the public key can be generated by "ssh-keygen -t rsa" on funkie's computer.
$ cat id_rsa.funkie.pub >> /home/git/.ssh/authorized_keys

Setup Gitosis



0. Change role to administrator
$ exit // change role to administrator
1. Installing Gitosis
$ apt-get install python-setuptools
2. Clone and install Gitosis from the project’s main site.
$ git clone git://eagain.net/gitosis.git
$ cd gitosis
$ sudo python setup.py install
3. Gitosis is going to manage your keys for you, so you need to remove the current file, re-add the keys later, and let Gitosis control the authorized_keys file automatically. For now, move the authorized_keys file out of the way:
$ mv /home/git/.ssh/authorized_keys /home/git/.ssh/ak.bak
4. Now it’s time to initialize Gitosis. You do this by running the gitosis-init command with your personal public key. If your public key isn’t on the server, you’ll have to copy it there:
$ sudo -H -u git gitosis-init < id_rsa.pub
Initialized empty Git repository in /home/git/repositories/gitosis-admin.git/
Reinitialized existing Git repository in /home/git/repositories/gitosis-admin.git/
5. This lets the user with that key modify the main Git repository that controls the Gitosis setup. Next, you have to manually set the execute bit on the post-update script for your new control repository.
$ sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update
6. Let’s do an actual Git command — you’ll clone the Gitosis control repository:
$ rm gitosis //remove the dir that you clone from project’s main site before.
$ git clone git@gitserver:gitosis-admin.git


Setup Gitweb

1. Installing Git Web
$ apt-get install apache2
$ apt-get install gitweb
2. Setup project through
$ vi /etc/gitweb.conf

2010年12月29日 星期三

2010年12月27日 星期一

我相信


想飛上天
和太陽肩並肩
世界等著我去改變
想作的夢從不怕別人看見
在這裡我都能實現
大聲歡笑
讓你我肩並肩
何處不能歡樂無限
拋開煩惱勇敢的大步向前
我就站在舞台中間

我相信我就是我
我相信明天
我相信青春沒有地平線
在日落的海邊
在熱鬧的大街
都是我心中最美的樂園
我相信自由自在
我相信希望
我相信伸手就能碰到天
有你在我身邊
讓生活更新鮮
每一刻都精彩萬分 I Do Believe

想飛上天
和太陽肩並肩
世界等著我去改變
拋開煩惱勇敢的大步向前
我就站在舞台中間
我相信(我就是我)
我相信(自由自在)
我相信(我相信我相信)I believe