練功房推薦書單

  • Google!Android 3手機應用程式設計入門(第四版)
  • 賈伯斯傳(軟皮精裝版)
  • 猛虎出閘制霸版:最新OCP Java SE 6 Programmer專業認證(附原始程式碼及範例檔)
  • SCWCD 5 猛虎出閘:Java Web 應用程式專業認證
Messages posted by: andowson
Forum Index » Profile for andowson » Messages posted by andowson
Message
jonathan1977您好:
請先幫忙確認一下aaa.tw解析出來的IP是否為您主機的IP
您可以執行ping aaa.tw來取得這個資訊
Microsoft Windows XP [版本 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Andowson>ping aaa.tw

Pinging aaa.tw [67.220.219.231] with 32 bytes of data:

Reply from 10.77.16.252: Destination host unreachable.
Reply from 10.77.16.252: Destination host unreachable.
Reply from 10.77.16.252: Destination host unreachable.
Request timed out.

Ping statistics for 67.220.219.231:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Documents and Settings\Andowson>

我們可以得知aaa.tw=67.220.219.231

自己本機的IP可以用ipconfig /all得知

如果您只是作為自我練習,您可以自行修改C:\WINDOWS\system32\drivers\etc\hosts檔案
加上
123.123.123.123       aaa.tw
最近把主機換到Linode VPS後,發現OpenMeetings也更新了版本,於是就跟著修改了OpenMeetings的自動安裝程式,主要是增加對64位元作業系統的支援,並且增加安裝中文字型,以解決轉檔時出現中文字型變成問號的問題,這次的自動安裝程式可以在新增好一個新的Linode VPS CentOS 5.4後直接執行,大約只需要花15分鐘就可以完成安裝。

#!/bin/bash
# Name: openmeetings.sh
# Author: Andowson Chang (andowson [at] gmail [dot] com)
# Version: 1.3
# Since: 2009-05-10
# Last Modified: 2010-05-17

# Modify here for newer version
SWFTOOLS_VERSION=0.9.0
FFMPEG_VERSION=0.5.1
SOX_VERSION=14.3.1
FLASH_PLAYER_VERSION=10.0.45.2
OPENMEETINGS_VERSION=1_1_r3087

# install PostgreSQL
yum -y install postgresql-server
/etc/init.d/postgresql start
sed -i -e "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" /var/lib/pgsql/data/postgresql.conf

sed -i -e "s/local   all         all                               ident sameuser/local   all         all         trust/g" /var/lib/pgsql/data/pg_hba.conf
sed -i -e "s/host    all         all         127.0.0.1\/32          ident sameuser/host    all         all         127.0.0.1\/32          md5/g" /var/lib/pgsql/data/pg_hba.conf

chkconfig --level 235 postgresql on
/etc/init.d/postgresql restart

#
# 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, Andowson Chang
#
# Source function library.
. /etc/rc.d/init.d/functions

if [ "`uname -p | grep 64`" != "" ]; then
  OOo_HOME=/usr/lib64/openoffice.org3/program
else
  OOo_HOME=/usr/lib/openoffice.org3/program
fi
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

yum -y install make gcc gcc-c++

#
# install SWFTools
#
yum -y install giflib-devel libjpeg-devel freetype-devel
if [ ! -r swftools-${SWFTOOLS_VERSION}.tar.gz ]; then
   wget http://www.swftools.org/swftools-${SWFTOOLS_VERSION}.tar.gz
fi
tar zxvf swftools-${SWFTOOLS_VERSION}.tar.gz
cd swftools-*
./configure
make
make install
cd ..

#
# install FFmpeg
#
if [ ! -r ffmpeg-${FFMPEG_VERSION}.tar.bz2 ]; then
   wget http://www.ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2
fi
tar jxvf ffmpeg-${FFMPEG_VERSION}.tar.bz2
cd ffmpeg-*
./configure
make
make install
cd ..

#
# install SoX (Version > 12.xx)
#
if [ ! -r sox-${SOX_VERSION}.tar.gz ]; then
   wget http://sourceforge.net/projects/sox/files/sox/${SOX_VERSION}/sox-${SOX_VERSION}.tar.gz/download
fi
tar zxvf sox-${SOX_VERSION}.tar.gz
cd sox-*
./configure
make
make -s && make install
cd ..

#
# install Flash player 10
#
rpm -Uvh http://fpdownload.macromedia.com/get/flashplayer/current/flash-plugin-${FLASH_PLAYER_VERSION}-release.i386.rpm

#
# install Chinese Font(reboot if needed)
#
yum -y install fonts-chinese fonts-ISO8859-2-75dpi
service xfs restart

#
# install OpenMeetings with Red5
#
if [ ! -r openmeetings_${OPENMEETINGS_VERSION}.zip ]; then
   wget http://openmeetings.googlecode.com/files/openmeetings_${OPENMEETINGS_VERSION}.zip
fi
unzip openmeetings_${OPENMEETINGS_VERSION}.zip -d /var

# 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 &
echo "SWFTools Path: `which pdf2swf`"
echo "ImageMagick Path: `which convert`"
echo "FFMPEG Path: `which ffmpeg`"
echo "SoX Path: `which sox`"


如果有找不到檔案問題,請修改/etc/sysconfig/i18n
LANG="zh_TW.UTF-8"
SUPPORTED="zh_TW.UTF-8:zh_TW:zh"


透過Apache存取,請修改/etc/httpd/conf.d/proxy_ajp.conf,加上下列設定
ProxyPass /openmeetings  http://localhost:5080/openmeetings
ProxyPassReverse /openmeetings  http://localhost:5080/openmeetings


安裝完成或日後升級OpenMeetings後,建議執行reboot重新開機。
thanks888您好:

初步在您的網站測試投影片上傳後發現,無法成功轉換成pdf和jpg,出現下列錯誤訊息:
Name: exitValue
Value: 1
Name: command
Value: [java, -cp, "/usr/local/red5/webapps/openmeetings/jod/commons-cli-1.2.jar" -cp "/usr/local/red5/webapps/openmeetings/jod/commons-io-1.4.jar" -cp "/usr/local/red5/webapps/openmeetings/jod/jodconverter-2.2.2.jar" -cp "/usr/local/red5/webapps/openmeetings/jod/jodconverter-cli-2.2.2.jar" -cp "/usr/local/red5/webapps/openmeetings/jod/juh-3.0.1.jar" -cp "/usr/local/red5/webapps/openmeetings/jod/jurt-3.0.1.jar" -cp "/usr/local/red5/webapps/openmeetings/jod/ridl-3.0.1.jar" -cp "/usr/local/red5/webapps/openmeetings/jod/slf4j-api-1.5.6.jar" -cp "/usr/local/red5/webapps/openmeetings/jod/slf4j-jdk14-1.5.6.jar" -cp "/usr/local/red5/webapps/openmeetings/jod/unoil-3.0.1.jar" -cp "/usr/local/red5/webapps/openmeetings/jod/xstream-1.3.1.jar", -jar, /usr/local/red5/webapps/openmeetings/jod/jodconverter-cli-2.2.2.jar, /usr/local/red5/webapps/openmeetings/uploadtemp/13/Scaki_1.ppt, /usr/local/red5/webapps/openmeetings/upload/13/Scaki_1/Scaki_1.pdf]
Name: error
Value: ERROR: connection failed. Please make sure OpenOffice.org is running and listening on port 8100.
Name: process
Value: doJodConvert
Name: exitValue
Value: 0
Name: process
Value: generateXMLDocument
Name: exitValue
Value: 1
Name: command
Value: [convert, -thumbnail, 80, /usr/local/red5/webapps/openmeetings/upload/13/Scaki_1/Scaki_1.pdf, /usr/local/red5/webapps/openmeetings/upload/13/Scaki_1/_thumb_page-%04d.jpg]
Name: error
Value: convert: Unrecognized option (-thumbnail).
Name: process
Value: generateBatchThumb
Name: exitValue
Value: 0
Name: process
Value: processPDF
Name: exitValue
Value: -1
Name: command
Value: [pdf2swf, -s, insertstop, /usr/local/red5/webapps/openmeetings/upload/13/Scaki_1/Scaki_1.pdf, /usr/local/red5/webapps/openmeetings/upload/13/Scaki_1/Scaki_1.swf]
Name: error
Value: Cannot run program "pdf2swf": java.io.IOException: error=2, No such file or directory
Name: process
Value: generateSwf


先檢查是否有安裝OpenOffice.org並且OpenOffice.org是否有設定為在每次主機重開時自動啟動。
rpm -qa|grep openoffice
netstat -an|grep 8100

由於無法得知當初您的系統是怎麼安裝的,系統相關的環境(包含作業系統、資料庫、JDK、OpenOffice.org, OpenMeetings,...等版本資訊)。我的建議是如果您持續遇到很多問題,不如您找當初幫您安裝的人,照本站所提供的shell script再重裝一次看看,也許這樣子就可以減少很多問題。
這是同事分享給我的一份sample code,經過測試,在IE, Firefox, Chrome下都可以正常顯示子選單。子選單的位置會在選單下方。
使用時只要修改選單名稱及選項名稱和超連結即可,如果需要新增選單,則只要再多加一個div,並設定其id="tab_x",然後在下方table區塊新增一個選單的超連結並修改showMenu('tab_x', this)裡面的第一個參數為對應的tab_x即可。

跨瀏覽器的重點是JavaScript中的座標值最後要加上"px"。

注意:因為JForum會去掉href,所以請自行在<a >部分補上href="",或是下載附檔。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Dynamic Menu</title>
<script type="text/javascript">
var lastMenu;
function showMenu(identifier, element) {
  menu = document.getElementById(identifier);
  menu.style.left = getPositionX(element)+"px";
  menu.style.top = getPositionY(element) + element.offsetHeight+"px";
  menu.style.visibility="visible";
  if(lastMenu != menu) {
    closeLastMenu();
  }
  lastMenu = menu;
}
function closeLastMenu() {
  if(lastMenu != null) {
    lastMenu.style.visibility="hidden";
  }
}
function getPositionX(element) {
	return element.offsetLeft + (element.offsetParent ? getPositionX(element.offsetParent) : element.x ? element.x : 0);
}
function getPositionY(element) {
  return element.offsetTop + (element.offsetParent ? getPositionY(element.offsetParent) : element.y ? element.y : 0);
}
</script>
  </head>
  <body>
    <div id="tab_1" style="background-color:yellow;visibility:hidden;position:absolute">
      <table>
        <tr><td>
            <table style="width:100%">
              <tr><td>
                  <a href="">選項1-1</a></td>
              </tr>
            </table></td>
        </tr>
      </table>
    </div>
    <div id="tab_2" style="background-color:yellow;visibility:hidden;position:absolute">
      <table>
        <tr><td>
            <table style="width:100%">
              <tr><td>
                  <a href="">選項2-1</a></td>
              </tr>
              <tr><td>
                  <a href="">選項2-2</a></td>
              </tr>
            </table></td>
        </tr>
      </table>
    </div>
    <div id="tab_3" style="background-color:yellow;visibility:hidden;position:absolute">
      <table>
        <tr><td>
            <table style="width:100%">
              <tr><td>
                  <a href="">選項3-1</a></td>
              </tr>
              <tr><td>
                  <a href="">選項3-2</a></td>
              </tr>
              <tr><td>
                  <a href="">選項3-3</a></td>
              </tr>
            </table></td>
        </tr>
      </table>
    </div>
    <table border="0" cellspacing="0">
      <tr>
        <td onmouseover="javascript:showMenu('tab_1', this)">
          <a href="">選單一</a></td>
        <td onmouseover="javascript:showMenu('tab_2', this)">
          <a href="">選單二</a></td>
        <td onmouseover="javascript:showMenu('tab_3', this)">
          <a href="">選單三</a></td>
      </tr>
    </table>
  </body>
</html>
thanks888您好:
根據您的錯誤訊息,我推測是convert這個指令的版本問題,請您執行下列指令確認一下
convert -version

如果可以的話,請安裝ImageMagick 6.0以後的版本

參考資料:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=12108
因舊的電腦硬碟故障,又無法弄到螢幕來進行維修動作,於是選擇轉移到國外的VPS上。經過幾天的努力後目前初步還原了原本討論區的文章部分。

移機前的硬體大致如下:
CPU: AMD Athlon 1GHz/256K L2 Cache
RAM: 640 MB PC-133
HD: 40GB IDE 7200RPM
NIC: 10/100M Fast Ethernet

對外的Internet網路頻寬目前是HiNet ADSL 8M/640K

移機後的硬體大致如下:
Linode 360 Xen VPS
CPU: Intel(R) Xeon(R) CPU L5520 @ 2.27GHz * 4
RAM: 360MB
HD: 16GB
Transfer: 200GB

目前運作起來還滿順利的,為便於隨時調整,我先採用每個月付19.95美金的方式。

移機後因考量硬體資源不足或網路上已有替代服務,下列的功能或服務項目暫停提供:
OLAT
Project(Trac + Subversion, JTrac)
OpenMeetings
thanks888您好:
經過測試之後發現您所翻譯的檔案內容有些問題,這些問題可以藉由觀察/var/red5/log/openmeetings.log裡面搜尋ERROR或Exception字串來發現
1.在第2287行出現一個字串編號不連續的斷層,突然從759跳到766,並且還多了一個</string>標籤
ERROR 04-23 22:53:08.350 Import.java 319016 125 org.openmeetings.servlet.outputhandler.Import [http-0.0.0.0-5080-2] - ERROR
org.dom4j.DocumentException: Error on line 2287 of document : The element type "language" must be terminated by the matching end-tag "</language>". Nested exception: The element type "language" must be terminated by the matching end-tag "</language>".


  <string id="759" name="test setup">
    <value>請不要再顯示這個測試</value>
  </string>

  </string>
  <string id="766" name="test setup">
    <value>停止</value>
  </string>

解法就是修正那個多出來的</string>標籤並補回漏掉的字串

2.出現沒有結尾標籤的br
ERROR 04-23 23:00:44.499 Import.java 775165 125 org.openmeetings.servlet.outputhandler.Import [http-0.0.0.0-5080-2] - ERROR
org.dom4j.DocumentException: Error on line 2311 of document : The element type "br" must be terminated by the matching end-tag "
". Nested exception: The element type "br" must be terminated by the matching end-tag "
".


  <string id="768" name="start view">
    <value>第一步<br>請點選開始</value>
  </string>
  <string id="769" name="start view">
    <value>開始上課</value>
  </string>
  <string id="770" name="start view">
    <value>Start Event</value>
  </string>
  <string id="771" name="start view">
    <value>第二步<br>選擇課程</value>
  </string>
  <string id="772" name="start view">
    <value>第三步<br>檢查您的設備</value>
  </string>
  <string id="773" name="start view">
    <value>第四步<br>開始上課</value>
  </string>

解法就是將<br>改為<br/>即可

附檔是我修正後的檔案,請您再測試看看。另外內容似乎還沒翻譯完整,也麻煩您於翻譯完成之後再上傳一次,謝謝。
thanks888您好,
可否上傳一下您所翻譯的那個繁體中文檔案給我試試看,謝謝!
另外您所安裝的是那個版本的OpenMeetings?
sentrasd您好:
原來是這個小問題(印象中出現^M這個符號好像都是這類的問題),我已將檔案轉換為UNIX格式了。
sentrasd您好:
我不確定是不是因為JDK版本更新到Update 19造成找不到JDK安裝檔的問題,我已經更新了我的shell script,把安裝JDK的動作抽離出來。請重新下載一次我更新後的shell script,並手動安裝一下JDK,再執行httpd2_tomcat6-setup.sh看看。
中華電信股份有限公司99年遴選新進從業人員 公告

主旨:公告本公司企業客戶分公司、數據通信分公司暨電信研究所99年遴選新進從業人員
   事宜。
依據:中華電信股份有限公司99年4月12日信人一字第0990000382號函辦理。

公告事項:
壹、 遴選日程:
  一、報名日期:99 年 4 月 13 日 9:00 至 99 年 4 月 25 日 24:00
  二、第一試(資歷論文審查)日期:99 月 4 月 22 日至 99 年 4 月 26 日由本公司企業客戶
    分公司、數據通信分公司及電信研究所資歷審查小組上網遴選
  三、第二試通知日期:99 年 4 月 28 日 14:00 (中華電信或電信研究所網站公告外,詳
    細口試時程另行email通知)
  四、第二試(口試)日期:99 年 5 月 1 日至 99 年 5 月 2 日(若有異動,以通知變更日期
    為準)
  五、放榜日期:99 年 5 月 5 日(若有異動,以通知變更日期為準)

採網路報名:http://202.39.164.12/pr/

詳情請參考附件內容或下列網址:
http://www.cht.com.tw/CompanyCat.php?CatID=4&NewsID=4015&Page=HotNewsDetail
TWNIC DNS Check
中文介面(如果遇到亂碼請調整瀏覽器編碼為UTF-8)
http://rs.twnic.net.tw/cgi-bin/dns.cgi
最近發現slave的DNS無法成功將master DNS修改的紀錄自動同步過來,使用
tail -20 /var/log/messages可以看到類似下面的錯誤訊息
dumping master file: tmp-XXXX: open: permission denied

搜尋了一下,發現只要在slave那台DNS主機上面修改/etc/sysconfig/named
加上
ENABLE_ZONE_WRITE=yes

再重新啟動named即可。

參考資料:
http://www.linuxforums.org/forum/servers/21970-bind-9-zone-transfer-permission-denied.html
剛查了一下,原來PAC(proxy auto-config)檔一般是用來給瀏覽器使用的,因為其檔案內容通常是一個JavaScript函式FindProxyForURL(url, host),一般的程式通常無法執行JavaScript,所以對於非瀏覽器的應用程式遇到需要設定proxy時,只能乖乖設定IP:port這種格式。

參考資料:
http://en.wikipedia.org/wiki/Proxy_auto-config
A proxy auto-config (PAC) file defines how web browsers and other user agents can automatically choose the appropriate proxy server (access method) for fetching a given URL.

A PAC file contains a JavaScript function "FindProxyForURL(url, host)". This function returns a string with one or more access method specifications. These specifications cause the user agent to use a particular proxy server or to connect directly.
最近一個JForum討論區的案子要結案,需要將資料庫整個備份出來交給業主。因為資料庫是使用Oracle,而JForum在三個table上包含了BLOB這種資料型態,所以之前試了很久,都沒辦法很輕易的將資料庫備份出來,並還原回去。後來問了一下同事,他之前也處理過這樣的問題,所以他就提供了一個工具給我,PL/SQL Developer,然後利用它的Export tables及Import tables功能,很輕鬆而且快速地就將資料庫備份又還原到另一個資料庫去了,只差sequence還沒過去而已,而sequence這個問題也很容易解決,只需要把目前的資料庫的sequence之DDL轉出來,然後修改一下,再放到新的資料庫上執行一下重新建立就可以了。

軟體可由下面網址下載(30天完整功能免費試用版)
http://allroundautomations.swmirror.com/plsqldev802.exe
 
Forum Index » Profile for andowson » Messages posted by andowson
Go to: