2012年6月20日 星期三

maven3 on 64 bit Ubuntu 11.10

Here is a maven3 PPA that worked fine for me on 64 bit Ubuntu 11.10

sudo add-apt-repository ppa:natecarlson/maven3
sudo apt-get update && sudo apt-get install maven3

If you have maven2 already installed from canonical repos this will not replace it but give you a mvn3 binary.

If you prefer to have the binary called mvn instead of mvn3 you can simply do the following:
 
sudo ln -s /usr/bin/mvn3 /usr/bin/mvn
 
Ref. http://askubuntu.com/questions/49557/how-do-i-install-maven-3 
 
mvn eclipse:eclipse 後記得!!!
 
設定  M2_REPO = /oooxxxx/oooxxx/.m2/repository
or eclipse 中 JAVA - Build Path - Classpath Variable 加上 
M2_REPO = /oooxxxx/oooxxx/.m2/repository

2012年6月7日 星期四

PostgreSQL 複製 DB

CREATE DATABASE newdb WITH TEMPLATE originaldb OWNER dbuser;

超簡單~

很多時候伺服器需要安裝兩張網卡network...

很多時候伺服器需要安裝兩張網卡network interface card(NIC),一張給公眾public,一張給內聯(local),這樣做可以在去public那裡加防火牆等,不過兩張網卡應該如何設定才避免衝 突,本人一開始以為插上網卡,設定好ip, dns, gateway就完成,但是一開始沒問題,到了重新開機時就出了問題。
Public eth0 10.100.1.5
Local eth1 192.168.2.4
我遇到問題是當開啟eth1後,伺服器就找不到任何網絡,ping 不到其他網絡,一關閉內網eth1,網絡即刻恢復正常。因此估計與網卡eth1有問題,但不會是硬件,應該是設定問題。
本人用centos 進行以下設定修復了雙網卡『衝突』問題
首先,在/etc/sysconfig/network 中加入
GATEWAYDEV=eth0
這是將默認gateway設定用對外網卡
然後修改/etc/sysconfig/networking/devices/ifcfg-eth0
這張是對外網卡,因此其需要gateway,BOOTPROTO 也需要設定,設定為none (static應該也一樣,假如是dhcp就用dhcp)
接著修改第二張網卡/etc/sysconfig/networking/devices/ifcfg-eth1,
在第二張網卡,不需要gateway,也不用BOOTPROTO
最後修改/etc/resolv.conf,把dns ip 打進去
重新啟動network,就解決了問題

2012年6月3日 星期日

Tool for Auto-gen Restful interface on DBs

最近再找這種工具, 同事給了一個 based on Jetty 的看起來很OK~

Jongo

http://code.google.com/p/jongo/