內容 |
|
今天更新了一下OpenMeetings的版本到1.0 RC1。安裝時發現postgres_hibernate.cfg.xml裡面的<session-factory name="">會造成無法正常啟動,應該修正為<session-factory>。以下是更新後的自動安裝shell script:
openmeetings.sh:
#!/bin/bash
# Name: openmeetings.sh
# Author: Andowson Chang (andowson [at] gmail [dot] com)
# Version: 1.1
# Last Modified: 2010-01-09
#
# install openoffice-service running on port 8100 in headless mode
#
yum -y install openoffice.org-base openoffice.org-headless openoffice.org-writer openoffice.org-impress openoffice.org-calc
#
# generate openoffice startup script
#
echo '#!/bin/bash
# openoffice.org headless server script
#
# chkconfig: 2345 80 30
# description: headless openoffice server script
# processname: openoffice
#
# Author: Vic Vijayakumar
# Modified by Federico Ch. Tomasczik
#
OOo_HOME=/usr/lib/openoffice.org/program
SOFFICE_PATH=$OOo_HOME/soffice.bin
PIDFILE=/var/run/openoffice-server.pid
set -e
case "$1" in
start)
if [ -f $PIDFILE ]; then
echo "OpenOffice headless server has already started."
sleep 5
exit
fi
echo "Starting OpenOffice headless server"
$SOFFICE_PATH -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp" & > /dev/null 2>&1
touch $PIDFILE
;;
stop)
if [ -f $PIDFILE ]; then
echo "Stopping OpenOffice headless server."
killall -9 soffice.bin
rm -f $PIDFILE
exit
fi
echo "Openoffice headless server is not running."
exit
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0' > /etc/init.d/openoffice
chmod 755 /etc/init.d/openoffice
chkconfig --level 235 openoffice on
/etc/init.d/openoffice start
#
# install ImageMagick(=>GhostScript will be installed as dependency)
#
yum -y install ImageMagick
#
# install SWFTools
#
yum -y install giflib-devel libjpeg-devel freetype-devel
if [ ! -r swftools-0.9.0.tar.gz ]; then
wget http://www.swftools.org/swftools-0.9.0.tar.gz
fi
tar zxvf swftools-0.9.0.tar.gz
cd swftools-*
./configure
make
make install
cd ..
#
# install FFmpeg
#
if [ ! -r ffmpeg-0.5.tar.bz2 ]; then
wget http://www.ffmpeg.org/releases/ffmpeg-0.5.tar.bz2
fi
tar jxvf ffmpeg-0.5.tar.bz2
cd ffmpeg-*
./configure
make
make install
cd ..
#
# install Flash player 10
#
if [ ! -r flash-plugin-10.0.42.34-release.i386.rpm ]; then
wget http://fpdownload.macromedia.com/get/flashplayer/current/flash-plugin-10.0.42.34-release.i386.rpm
fi
rpm -Uvh flash-plugin-10.0.42.34-release.i386.rpm
#
# install OpenMeetings with Red5
#
if [ ! -r openmeetings_1_0_r2688.zip ]; then
wget http://openmeetings.googlecode.com/files/openmeetings_1_0_r2688.zip
fi
unzip openmeetings_1_0_r2688.zip
mv openmeetings_1_0_r2688 /var/red5
# modify hibernate.cfg.xml
cd /var/red5/webapps/openmeetings/conf
cp -fp postgres_hibernate.cfg.xml hibernate.cfg.xml
sed -i -e '7c\ <session-factory>' hibernate.cfg.xml
sed -i -e '9c\ <property name="connection.username">openmeetings</property>' hibernate.cfg.xml
sed -i -e '10c\ <property name="connection.password">openmeetings</property>' hibernate.cfg.xml
#
# create user and database openmeetings
#
sudo -u postgres psql -c "create user openmeetings with encrypted password 'openmeetings' createdb;" template1
sudo -u postgres psql -c "create database openmeetings with encoding 'unicode';" -U openmeetings template1
sudo -u postgres psql -c "alter user openmeetings nocreatedb;" template1
#
# start up red5
#
chmod 755 /var/red5/red5*.sh
cd /var/red5
nohup ./red5.sh &
另外自0.9 RC5新增了一個桌面共享的功能,需要使用到TCP 4445 port,所以我們需要開放firewall,加上4445:tcp的設定
啟動後切換目錄到/var/red5/log下,可以看到有四個檔案
-rw-r--r-- 1 root root 0 1月 10 00:26 0.0.0.0_access.2010-01-10.log
-rw-r--r-- 1 root root 0 1月 10 00:26 error.log
-rw-r--r-- 1 root root 1378 1月 10 00:26 openmeetings.log
-rw-r--r-- 1 root root 9234 1月 10 00:26 red5.log
可以藉由檢查一下error.log的內容來確認OpenMeetings是否正常啟動,然後就可以連到
http://localhost:5080/openmeetings/install去進行安裝的步驟了。這裡我把我安裝設定的畫面抓下來,做為參考。
安裝完成後,輸入http://localhost:5080/openmeetings/,就可以用剛剛安裝時設定的管理者帳號(例如admin)及密碼來登入了。
登入後,我覺得現在的版本內的中文翻譯的不是很好,建議安裝或登入時還是選擇用英文介面吧。
|
 |
|
|
 |
|
大家好!新年快樂!
轉眼一年又過去了,本站從無到有,至今也成立三年了,是該好好檢視一下去年的成績單了
去年的展望是:
1.會員數成長到2000人,啟用率75%
2.發表文章數成長到750篇,發文率5%
3.流量月最高參觀者數突破10000人
底下我們逐一檢視這些KPI
1.會員數:
 註冊會員數:
select count(*) from jforum_users where user_regdate < to_date('2010-01-01', 'yyyy-mm-dd')
=>1697 未達成
淨增數:594(1697-1103)
成長率:-12.64%((594-680)/680)
 有效會員數:
select count(*) from jforum_users where user_regdate < to_date('2010-01-01', 'yyyy-mm-dd') and (deleted is null or deleted=0)
=>1580
 已啟用帳號數:
select count(*) from jforum_users where user_actkey is null and user_regdate < to_date('2010-01-01', 'yyyy-mm-dd')
=>1311
淨增數:479(1311-832)
啟用率:77.25%(1311/1697) 達成
2.文章數:
 發表文章數:
select count(*) from jforum_posts where post_time < to_date('2010-01-01', 'yyyy-mm-dd')
=>623 未達成
淨增數:173(623-450)
成長率:-24.45%((173-229)/229)
 主題數:
select count(*) from jforum_topics where topic_time < to_date('2010-01-01', 'yyyy-mm-dd')
=>314
淨增數:85(314-229)
成長率:-5.55%((85-90)/90)
3.發文狀況
 發文人數:
select count(*) from jforum_users where user_regdate < to_date('2010-01-01', 'yyyy-mm-dd') and user_posts > 0
=>55
發文率:4.20%(55/1311) 未達成
 發文排行榜:
select username, count(*) as posts from jforum_posts p, jforum_users u where p.user_id = u.user_id and post_time > to_date('2009-01-01', 'yyyy-mm-dd') and post_time < to_date('2010-01-01', 'yyyy-mm-dd') group by username order by posts desc
1. andowson: 110
2. acer123: 17
3. 疯癫二楞子: 5
4. wu_net2008: 4
5. starzine: 3
5. viva: 3
5. moder: 3
5. mimi-dtc: 3
9. papaisno1: 2
9. Matthew: 2
9. xxw: 2
9. player: 2
9. sudiliuxin: 2
4.流量統計
最高月參觀者數:8238(2009/11) 未達成
整體來說,2009年只有達成一項目標,其他幾項指標未達成的原因檢討如下:
1.會員成長出現衰退,推測大部分會員是為了下載附件檔案才被迫加入會員。
2.文章數成長也開始下滑,且發文率低於5%,表示網友並不熱衷於在本站發表心得,比較零星的多屬發問性質。
放眼未來,今年的目標是:
1.會員數成長到2500人,啟用率77.5%
2.發表文章數成長到850篇,發文率5%
3.月流量最高參觀者數突破12000人
|
 |
|
Enix您好,我沒用過unbuntu和debian,您可以自己測試看看。
|
 |
|
SQuirreL SQL Client下載網址:
http://squirrel-sql.sourceforge.net/#installation
DAO4J下載網址:
http://members.multimania.co.uk/dao4j/dao4j.zip
先安裝好SQuirreL SQL Client後,再將dao4j.zip解壓縮,在解開的目錄中有個dao4j-plugin.zip和plugin.pdf說明檔,把dao4j-plugin.zip解壓縮到SQuirreL SQL Client安裝目錄下的plugins目錄,再重新啟動SQuirreL SQL Client即可。
然後用SQuirreL SQL Client連接資料庫,在table或view上面按滑鼠右鍵,選擇Generate DAO,然後給定產生檔案的目錄、package name,再按下OK就開始產生了。
如果出現資料庫的資料型態不存在的錯誤而失敗的錯誤訊息時,請到SQuirreL SQL Client\plugins\dao4j\conf目錄下,修改資料庫所對應的TypeMapping definition properties檔,例如PostgreSQL就需要再加個int4=int。
參考資料
http://www.slideshare.net/junyuo/utilized-code-gen-to-save-our-efforts-in-sap-integration
|
 |
|
Using the navigator object to detect client's browser
JavaScript - Browser detect
Java Plugin Detector
jQuery browser plugin detection 1.0.2可以偵測瀏覽器是否支援下列物件
Flash
Silverlight
PDF(checks if pdf mimetype is supported not limited to one PDF application)
Java
Quicktime
Windows Media Player
Shockwave
Real player
OS 版本判別
<script type="text/javascript">
<!--
// source: http://www9.plala.or.jp/oyoyon/html/script/platform.html
function detectOS() {
var os, ua = navigator.userAgent;
if (ua.match(/Win(dows )?NT 6\.1/)) {
os = "Windows 7"; // Windows 7
}
else if (ua.match(/Win(dows )?NT 6\.0/)) {
os = "Windows Vista"; // Windows Vista
}
else if (ua.match(/Win(dows )?NT 5\.2/)) {
os = "Windows Server 2003"; // Windows Server 2003
}
else if (ua.match(/Win(dows )?(NT 5\.1|XP)/)) {
os = "Windows XP"; // Windows XP
}
else if (ua.match(/Win(dows )? (9x 4\.90|ME)/)) {
os = "Windows ME"; // Windows ME
}
else if (ua.match(/Win(dows )?(NT 5\.0|2000)/)) {
os = "Windows 2000"; // Windows 2000
}
else if (ua.match(/Win(dows )?98/)) {
os = "Windows 98"; // Windows 98
}
else if (ua.match(/Win(dows )?NT( 4\.0)?/)) {
os = "Windows NT 4.0"; // Windows NT 4.0
}
else if (ua.match(/Win(dows )?95/)) {
os = "Windows 95"; // Windows 95
}
else if (ua.match(/Mac|PPC/)) {
os = "Mac OS"; // Macintosh
}
else if (ua.match(/Linux/)) {
os = "Linux"; // Linux
}
else if (ua.match(/(Free|Net|Open)BSD/)) {
os = RegExp.$1 + "BSD"; // BSD
}
else if (ua.match(/SunOS/)) {
os = "Solaris"; // Solaris
}
else {
os = "Unknown"; // Other OS
}
return os;
}
// -->
</script>
http://en.wikipedia.org/wiki/Microsoft_Windows#Timeline_of_releases
彈跳視窗支援/快顯封鎖程式偵測(Google, Yahoo, MSN工具列)
https://stock2.ubot.com.tw/ServiceProvider/WebTest/Default2.aspx
偵測Proxy=>檢查Header的HTTP_X_FORWARDED_FOR是否為空值
http://www.study-area.org/coobila/tutorial_320.html
|
 |
|
最近因主機經過一段時間運轉後,不知道是不是機器老舊還是硬碟高速轉動的震動造成機器發出高分貝的吵雜聲,因聲音真的很吵,會影響睡眠或日常生活,故我會將機器先關機,等我睡醒或離開房間再開機,如果您剛好遇到連不上的現象,請稍後再試試看。
今天剛好休假,預計先從硬碟螺絲有無鎖緊檢查起,預計中午12:00起開始測試,如果順利的話,下午16:00左右結束測試。
更新:今天下午12:46分重新啟動後,到晚上18:30回到家裡,噪音又出現了。晚上應該得關機才能睡覺了。
|
 |
|
OLAT 6.2.2出來了一陣子,昨天開始嘗試升級,除了壓縮檔解壓縮出來的目錄命名方式跟之前不同外,執行到ant build時還遇到了下面這樣的錯誤
[javac] The system is out of resources.
[javac] Consult the following stack trace for details.
[javac] java.lang.OutOfMemoryError: Java heap space
後來查了一下OLAT mailing list裡面,有人也遇到了這樣的問題,解法就是加上一個
export ANT_OPTS=-Xmx128m
宣告再執行ant build就可以了,底下直接給整個執行的shell script,有需要的人請自行參考並修改。
# get OLAT source
cd ~/download
wget http://www.olat.org/downloads/stable/OLAT-6.2.2.zip
unzip OLAT-6.2.2.zip
mv olat3 OLAT-6.2.1
mv OLAT-6_2_2-PUBLIC-* olat3
cd olat3
# config build.properties
sed -e "s/\/usr\/local\/opt\/olat\/olat3/\/home\/andowson\/download\/olat3/g" \
-e "s/\/usr\/local\/opt\/olat\/olatdata/\/home\/andowson\/data\/olatdata/g" \
-e "s/\/usr\/local\/opt\/tomcat/\/var\/tomcat6/g" \
-e "1,$$s/www.myolat.com/www.andowson.com/g" \
-e "1,$$s/myolat.com/andowson.com/g" \
-e "1,$$s/myolat/andowson/g" \
-e "s/server.modjk.enabled=false/server.modjk.enabled=true/g" \
-e "55a\server.modjk.jvmRoute=worker1" \
-e "s/defaultcharset=ISO-8859-1/defaultcharset=UTF-8/g" \
-e "s/registration.enableNotificationEmail=false/registration.enableNotificationEmail=true/g" \
-e "s/smtp.host=smtp.andowson.com/smtp.host=smtp.other.com/g" \
-e "s/smtp.user=/smtp.user=username/g" \
-e "s/smtp.pwd=/smtp.pwd=password/g" \
-e "121,143d" \
-e "1,$$s/#db/db/g" \
-e "1,$$s/net.sf.hibernate/org.hibernate/g" \
-e "s/instantMessaging.server.name=jabber.andowson.com/instantMessaging.server.name=www.andowson.com/g" \
-e "s/instantMessaging.db.name=wildfire/instantMessaging.db.name=openfire/g" \
-e "s/instantMessaging.db.user=wildfire/instantMessaging.db.user=openfire/g" \
-e "s/instantMessaging.db.pass=wildfire/instantMessaging.db.pass=openfire/g" \
-e "s/cluster.catalinaport=8006/cluster.catalinaport=8105/" \
-e "s/cluster.ajpport=8009/cluster.ajpport=8109/" build.properties.default > build.properties
# adjust the original template config files
# enable zh_CN and zh_TW on the top right menu
sed -i -e "s/<enabledLanguages>en,de,fr,it,es<\/enabledLanguages>/<enabledLanguages>en,de,fr,it,es,zh_CN,zh_TW<\/enabledLanguages>/g" ~/download/olat3/webapp/WEB-INF/olat_config.xml.in
# change domain name in email address
sed -i -e "1,$$s/olat-newinstallation.org/andowson.com/g" ~/download/olat3/webapp/WEB-INF/olat_config.xml.in
# fix the commnet style in XML
sed -i -e "13c\ <\!-- default session timeout -->" ~/download/olat3/webapp/WEB-INF/web.xml.in
# remove findbugs setting
sed -i -e "1348,1361d" build.xml
ant config-all
# to avoid OutOfMemoryError
export ANT_OPTS=-Xmx128m
ant build
# stop Tomcat
sudo /etc/init.d/tomcat stop
# backup db
sudo -u postgres pg_dump olat > /tmp/olat.bak
# copy to the target directory
sudo mv ~/www/olat /tmp/olat-6.2.1
cp -rf ~/download/olat3/webapp ~/www/olat
cp -rf ~/download/olat3/htdocs/* ~/www/olat
sudo chmod 775 ~/www/olat/static
sudo chmod 775 ~/www/olat/WEB-INF
sudo chmod 775 -R ~/data/olatdata
# start Tomcat
sudo /etc/init.d/tomcat start
|
 |
|
本站今天正式升級至JForum 2.1.9版。如果有發現任何問題請回報給我。
|
 |
|
|
 |
|
今天遇到了一個問題,就是如果想要在網站關閉時將正在連線的session手動斷線後再關閉資料庫連線,需要取得session物件,但之前對連線資料只有紀錄到sessionId而已。要由sessionId字串去建構出一個HttpSession物件對Java而言似乎不是合法的方法。
搜尋了一下,找到一篇文章,建議的作法是可以將session物件紀錄到ServletContext物件(其實就是一個Map物件)去,用sessionId當作key, session物件當作value,則要取回session時用ServletContext.getAttribute(sessionId)即可。而session進入和離開ServletContext的時間點可以用一個HttpSessionListener來管理,改寫sessionCreated、sessionDestroyed這兩個methods即可:
加入及移除session
@Override public void sessionCreated(final HttpSessionEvent se) { final HttpSession session = se.getSession(); final ServletContext context = session.getServletContext(); context.setAttribute(session.getId(), session); } @Override public void sessionDestroyed(final HttpSessionEvent se) { final HttpSession session = se.getSession(); final ServletContext context = session.getServletContext(); context.removeAttribute(session.getId()); }
取回session物件
private HttpSession getSession(final String sessionId) { final ServletContext context = getServletContext(); final HttpSession session = (HttpSession) context.getAttribute(sessionId); return session; }
參考資料:
http://stackoverflow.com/questions/1499581/how-can-i-manually-load-a-java-session-using-a-jsessionid
|
 |
|
一般我們要註冊網域名稱時都會先查詢一下這個網域是否已經被註冊了,使用的工具就是WHOIS。現在有個網站就叫做
https://who.is/
只要在上面輸入網域名稱就可以查詢出一堆資訊,除了WHOIS外,還包括DNS Records。
Information內有內容資訊、連入連結數及分時統計之流量排名。
Web Search則是有出現網域名稱的連結,有時會有意外的發現。
DNS Records就是域名內的細部主機資訊了,還真是一覽無遺啊!
|
 |
|
|
 |
|
在Eclipse中對build.xml檔案按滑鼠右鍵選擇Run As->Ant Build...時,如果看到一堆build.xml, build.xml(1), build.xml(2), ...的選擇視窗,可以利用下面的方法來解決:
在Eclipse中點選上方選單的Run->External Tools-> External Tools Configurations… ,會跳出一個Create, manage, run configuration對話框,然後將左邊的Ant Build下面列出的build.xml, build.xml(1), build.xml(2)...刪除,再關閉該對話框即可。
參考資料:
http://www.spacebug.com/removing_ant_configuration_selection_in_eclipse.html
|
 |
|
感謝二楞子的提醒,原始文章的連結已經修正。另外也歡迎二楞子發表一下使用這些軟體的心得或安裝過程喔。
|
 |
|