2009年9月19日 星期六

to increase PJSUA_MAX_CALLS, PJ_IOQUEUE_MAX_HANDLES

centos 5.3


compiling "pjproject-1.4": (PJSUA_MAX_CALLS, PJ_IOQUEUE_MAX_HANDLES)


cp pjproject-1.4/pjlib/include/pj/config_site.sample.h pjproject-1.4/pjlib/include/pj/config_site.h


vim pjproject-1.4/pjlib/include/pj/config_site.h


#define PJ_CONFIG_MAXIMUM_SPEED 1




Compiling Error:


PJ_IOQUEUE_MAX_HANDLES cannot be greater than FD_SETSIZE


/etc/security/limits.conf


* soft nofile 99999


* soft nofile 99999


[root@ip172 i686-pc-linux-gnu]# grep -R FD_SETSIZE /usr/include/* |grep 1024


/usr/include/bits/typesizes.h:#define __FD_SETSIZE 1024


/usr/include/linux/posix_types.h:#define __FD_SETSIZE 1024


/usr/include/valgrind/vki-linux.h:#define __VKI_FD_SETSIZE 1024




vim /usr/include/bits/typesizes.h


/usr/include/bits/typesizes.h:#define __FD_SETSIZE 10240

2009年6月18日 星期四

Linux 軟體修改網卡MAC位址

方法一:
重開機後也跟著修改的方法。
在/etc/sysconfig/network-scripts/ifcfg-eth0中加入
MACADDR=00:0A:EC:EB:93:3C

方法二:
ifconfig eth0 down
ifconfig eth0 hw ether 00:12:34:56:78:90
ifconfig eth0 up

2009年4月25日 星期六

callback function 範例

#include <cstdlib>
#include <iostream>
using namespace std;

typedef int(*Binary_FT)(int,int);

int multiplyCB(int x, int y)
{
return x * y;
}

int additionCB(int x, int y)
{
return x + y;
}

void printFrameWork(int a, int b, char *str, Binary_FT callback)
{
int c;
c = callback(a, b);
printf("callback = %s\n", str);
printf("result = %d\n", c);
}

int main(int argc, char *argv[])
{
int integer1, integer2;
integer1 = 10;
integer2 = 20;

printf("Two inputs are %d and %d\n", integer1, integer2);
printFrameWork(integer1, integer2, "multiplyCB", multiplyCB);
printFrameWork(integer1, integer2, "additionCB", additionCB);

system("PAUSE");
return EXIT_SUCCESS;
}

執行結果:
Two inputs are 10 and 20
callback = multiplyCB
result = 200
callback = additionCB
result = 30

PJSUA - PJProject

To enable TLS supported.

Requirement:
OpenSSL library
DirectX SDK(maybe optional, but need to be configured)

To find pjproject-1.0.1\pjlib\include\pj\config.h
Add following code in it.
/**
* Support TLS in the library.
*/
#ifndef PJSIP_HAS_TLS_TRANSPORT
# define PJSIP_HAS_TLS_TRANSPORT 1
#endif

Visual Studio 2005 Configuration:
At pjsip_core project, check include path:
/IC:\lib\openssl\include

At pjsua project, it would require "libeay32MT.lib", "ssleay32MT.lib", check library path:
/LIBPATH:"C:\openssl-0.9.8i\lib"

how to comile openssl on windows; portable audio; oRTP; libeXosip2

The eXosip_event_type Variation:
INVITE a callee by rawSIPUA
je->type EXOSIP_CALL_PROCEEDING eXosip_event_type
je->type EXOSIP_CALL_RINGING eXosip_event_type
if CANCEL
je->type EXOSIP_CALL_REQUESTFAILURE eXosip_event_type (WHY!!)
--- sevaral seconds ---
je->type EXOSIP_CALL_RELEASED eXosip_event_type
END
if CALL_ANSWERED
je->type EXOSIP_CALL_ANSWERED eXosip_event_type
---- RTP stream ----
if sent CANCEL by rawSIPUA:
je->type EXOSIP_CALL_MESSAGE_ANSWERED eXosip_event_type
je->type EXOSIP_CALL_RELEASED eXosip_event_type
if received CANCEL from eyeBeam:
je->type EXOSIP_CALL_MESSAGE_NEW eXosip_event_type
je->type EXOSIP_CALL_CLOSED eXosip_event_type
je->type EXOSIP_CALL_RELEASED eXosip_event_type

Receive a INVITE from caller
je->type EXOSIP_CALL_INVITE eXosip_event_type
if ANSWERED
je->type EXOSIP_CALL_ACK eXosip_event_type

CANCEL from caller (When will I get the "EXOSIP_CALL_CANCELLED"?)

je->type EXOSIP_CALL_CLOSED eXosip_event_type
je->type EXOSIP_CALL_RELEASED eXosip_event_type

eyeBeam call rawSIPUA which is NOANSWER:
je->type EXOSIP_CALL_CLOSED eXosip_event_type
je->type EXOSIP_CALL_NOANSWER eXosip_event_type
je->type EXOSIP_CALL_RELEASED eXosip_event_type



void osip_usleep (int useconds); useconds => nano-seconds
Reference:
http://mad.cs.tut.fi/doc/mad_fcl_v1.7_man/linux/osip__port_8c-source.html#l00260


Download OpenSSL from openssl.org
Requirement: ActivePerl & OpenSSL

Configuration:

C:\include\a\openssl-0.9.8i> perl Configure VC-WIN32

C:\include\a\openssl-0.9.8i> ms\do_ms.bat

C:\include\a\openssl-0.9.8i> "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"

Compile OpenSSL on WIN32:

ntdll.mak(/MT) for dynamic link. nt.mak(/MD) for static link.
C:\include\a\openssl-0.9.8i> nmake -f ms\ntdll.mak

Install where you want: (here is a sample.)

C:\include\a\openssl-0.9.8i>md c:\lib\openssl
C:\include\a\openssl-0.9.8i>md c:\lib\openssl\bin
C:\include\a\openssl-0.9.8i>md c:\lib\openssl\lib
C:\include\a\openssl-0.9.8i>md c:\lib\openssl\include
C:\include\a\openssl-0.9.8i>md c:\lib\openssl\include\openssl
C:\include\a\openssl-0.9.8i>copy /b inc32\openssl\* c:\lib\openssl\include\openssl
C:\include\a\openssl-0.9.8i>copy /b out32dll\ssleay32.lib c:\lib\openssl\lib
C:\include\a\openssl-0.9.8i>copy /b out32dll\libeay32.lib c:\lib\openssl\lib
C:\include\a\openssl-0.9.8i>copy /b out32dll\ssleay32.dll c:\lib\openssl\bin
C:\include\a\openssl-0.9.8i>copy /b out32dll\libeay32.dll c:\lib\openssl\bin
C:\include\a\openssl-0.9.8i>copy /b out32dll\openssl.exe c:\lib\openssl\bin
C:\include\a\openssl-0.9.8i>copy README c:\lib\openssl
C:\include\a\openssl-0.9.8i>copy LICENSE c:\lib\openssl

Here is for batch execution used:
Basic working directory is C:\include\a\openssl-0.9.8i>

md c:\lib\openssl
md c:\lib\openssl\bin
md c:\lib\openssl\lib
md c:\lib\openssl\include
md c:\lib\openssl\include\openssl
copy /b inc32\openssl\* c:\lib\openssl\include\openssl
copy /b out32dll\ssleay32.lib c:\lib\openssl\lib
copy /b out32dll\libeay32.lib c:\lib\openssl\lib
copy /b out32dll\ssleay32.dll c:\lib\openssl\bin
copy /b out32dll\libeay32.dll c:\lib\openssl\bin
copy /b out32dll\openssl.exe c:\lib\openssl\bin
copy README c:\lib\openssl
copy LICENSE c:\lib\openssl

Reference:
http://tech.idv2.com/2006/03/27/how-to-install-openssl-under-win32/

Note:
I ran a command in INSTALL as "perl Configure VC-WIN32 --prefix=c:/some/openssl/dir" to configure,
I failed to compile it . Maybe "perl Configure --prefix=c:/some/openssl/dir VC-WIN32" could pass.

Problem: (key words: openssl ossl_typ.h 178 error type)
When I compiled eXosip2-3.2.0 with openssl, I got an error message "openssl-0.9.8i\include\openssl/ossl_typ.h(178) : error C2059: syntax error : 'type'".

Solved:
I solved it by replacing openssl library with openssl-0.9.8j.
Here is the changes between version openssl-0.9.8i and openssl-0.9.8j.

Released Version: openssl-0.9.8i
include/openssl/ossl_typ.h
#ifdef OPENSSL_SYS_WIN32
#undef X509_NAME
#undef X509_EXTENSIONS
#undef X509_CERT_PAIR
#undef PKCS7_ISSUER_AND_SERIAL
#endif

Released Version: openssl-0.9.8j
include/openssl/ossl_typ.h
#ifdef OPENSSL_SYS_WIN32
#undef X509_NAME
#undef X509_EXTENSIONS
#undef X509_CERT_PAIR
#undef PKCS7_ISSUER_AND_SERIAL
#undef OCSP_REQUEST
#undef OCSP_RESPONSE
#endif

If you don't want to see the below warning,
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

Here is a note.
Select the "Property Pages" of your project,
-> "Configuration Properties" -> "Linker" -> "Input"
-> "Ignore Specific Library" -> Input six characters, "LIBCMT".


PortAudio - portable cross-platform Audio API
http://www.portaudio.com/


PortAudio 是一跨平台的錄音及放音 API,以下是官方網站提供的開發步驟

  • Write a callback function that will be called by PortAudio when audio processing is needed.
  • Initialize the PA library and open a stream for audio I/O.
  • Start the stream. Your callback function will be now be called repeatedly by PA in the background.
  • In your callback you can read audio data from the inputBuffer and/or write data to the outputBuffer.
  • Stop the stream by returning 1 from your callback, or by calling a stop function.
  • Close the stream and terminate the library.

Windows 上測試 PortAudio 範例,以 WMME 為例

  • 將 PortAudio V1.9 解壓縮
  • 以 VS2005/VS2003 建立 Win32 console 專案
  • [前置處理器定義] 加入 PA_NO_DS;PA_NO_ASIO
  • [其它 Include 目錄] 加入 "..\portaudio\include";"..\portaudio\src\common"
  • 加入下列檔案
    • pa_allocation.c
    • pa_converters.c
    • pa_cpuload.c
    • pa_dither.c
    • pa_front.c
    • pa_process.c
    • pa_skeleton.c
    • pa_stream.c
    • pa_trace.c
    • pa_win_hostapis.c
    • pa_win_util.c
    • pa_win_wmme.c
    • pa_x86_plain_converters.c
    • pa_win_waveformat.c
  • 加入 ..\portaudio\test\patest_record.c 即可測試錄放音

Error:
Creating an Empty GUI Win32 Project.
Building with Visual C++ 2008 Express:
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

修改如下:
Project -> xxxx Properties -> Configuration Properties -> Linker -> System ->Console (/SUBSYSTEM:CONSOLE)

Linux 平台開發步驟

在 Linux 則可以使用以下三種方式

  • Linux ALSA implementation
  • Linux Jack
  • Unix (Linux, FreeBSD, Solaris), OSS

ALSA (Advanced Linux Sound Architecture) 是 2.6 核心預設的音效子系統,取代 2.4 核心中使用的 OSS(Open Sound System)

所以我們以 ALSA 為預設的聲音處理方式

Linux 上編譯

輸入以下命令

  • ./configure && make
  • make install
  • gcc -lrc -lasound -lalsa -lpthread -o YOUR_BINARY main.c libportaudio.a

Reference:
http://social.msdn.microsoft.com/forums/en-US/vclanguage/thread/14e85604-6929-4707-a22e-8cdf596926a6
http://blog.roodo.com/richielin996/archives/2438843.html

Code Example:

int numDevices;
PaDeviceInfo *pdi;
...
numDevices = Pa_GetDeviceCount();

for( i=0; i
pdi = Pa_GetDeviceInfo( i );
printf("numDev=%d, "
"\n\tdefaultSampleRate=%f"
"\n\thostApi=%d (%s) devcnt=%d"
"\n\tmaxInputChannels=%d"
"\n\tmaxOutputChannels=%d"
"\n\tname=%s"
"\n\tstructVersion=%d"
"\n\tdefaultHighInputLatency=%f"
"\n\tdefaultHighOutputLatency=%f"
"\n\tdefaultLowInputLatency=%f"
"\n\tdefaultLowOutputLatency=%f"
"\n",
i,
pdi->defaultSampleRate,
pdi->hostApi, Pa_GetHostApiInfo(pdi->hostApi)->name, Pa_GetHostApiInfo(pdi->hostApi)->deviceCount,
pdi->maxInputChannels,
pdi->maxOutputChannels,
pdi->name,
pdi->structVersion,
pdi->defaultHighInputLatency,
pdi->defaultHighOutputLatency,
pdi->defaultLowInputLatency,
pdi->defaultLowOutputLatency
);
}
printf("dev=%d ISsupported?%d\n",Pa_GetDefaultInputDevice(),Pa_IsFormatSupported(&inputParameters,NULL,SAMPLE_RATE));

system("pause");

...

Display:

numDev=0,
defaultSampleRate=44100.000000
hostApi=0 (MME) devcnt=4
maxInputChannels=2
maxOutputChannels=0
name=M - Input
structVersion=2
defaultHighInputLatency=0.400000
defaultHighOutputLatency=0.400000
defaultLowInputLatency=0.200000
defaultLowOutputLatency=0.200000

...

Code Example: convert Int16 to Int8.
#include "pa_converters.h"
...
PaUtilConverter *converter;
short *recordedInt16Samples;
...
Int8Samples=(SAMPLE *) malloc(NUM_SECONDS * SAMPLE_RATE * NUM_CHANNELS * sizeof(char));

converter = PaUtil_SelectConverter(PA_SAMPLE_TYPE,paInt8,paDitherOff);
(*converter)(Int8Samples,1,recordedInt16Samples,1,NUM_SECONDS * SAMPLE_RATE * NUM_CHANNELS, NULL);
...


oRTP


Compiling On Windows with Visual C++ 2008 Express
1.
開啟 ortp-0.13.1\build\win32native\oRTP.vcproj
過程會有新舊版本轉換的詢問。
可直接編譯。
Output: oRTP.dll

2.
匯入RTPReceiver Project:
在 [Solution Explorer] Solution 'oRTP' 上[右鍵]->[Add]->[Existing Project]-> 開啟 ortp-0.13.1\src\tests\win_receiver\RTPReceiver.vcproj

  • 專案設定:
    RTPSender [Property] Pages -> 展開[Configuration Properties] ->
    • 在 [C/C++] -> [Additional Include Directories] -> 加入 ../../../include;
    • 同樣在 [Linker] -> [Additional Library Directories] -> 加入 ../../../build/win32native/Debug 或是 $(SolutionDir)Debug
      Note: 目前 $(SolutionDir)=> 專案的所在路徑 ortp-0.13.1/build/win32native
  • 在 RTPReceiver.cpp 裡的
    行59: err=rtp_session_recv_with_ts(session,buffer,160,ts,&havemore);
    改成: err=rtp_session_recv_with_ts(session,(uint8_t *)buffer,160,ts,&havemore);
    這樣VC9才可以讓你成功編譯。

3.
匯入RTPSender Project:
在 [Solution Explorer] Solution 'oRTP' 上[右鍵]->[Add]->[Existing Project]-> 開啟 ortp-0.13.1\src\tests\win_receiver\RTPSender.vcproj

  • 專案設定: 同上 RTPSender。
  • 在 RTPSender.cpp 裡的
    行224: rtp_session_send_with_ts(m_Session[k],m_pBuffer,nCounter,m_nUser_Timestamp);
    改成: rtp_session_send_with_ts(m_Session[k],(uint8_t *)m_pBuffer,nCounter,m_nUser_Timestamp);
    這樣VC9才可以讓你成功編譯。


struct mblk_t {
struct mblk_t *b_next; /* next message on queue */
struct mblk_t *b_prev; /* previous message on queue */
struct mblk_t *b_cont; /* next message block of message */
unsigned char *b_rptr; /* first unread data byte in message */ /* point to the rtp packet */
unsigned char *b_wptr; /* first unwritten data byte inbuffer*/
struct dblk_t *b_datap; /* data block */
};

(rtp_header_t *)(mblk_t->b_rptr)

struct dblk_t {
struct dblk_t *db_freep; /* internal use */
unsigned char *db_base; /* first byte of buffer */ /* used by ortp */
unsigned char *db_lim; /* last byte +1 of buffer */ /* used by ortp */
unsigned char *db_vbase; /* first byte of system buffer */
int (*db_cb)(); /* callback routine */ /* used by ortp */
unsigned long int db_size;
unsigned char db_ref; /* count of to this block */ /* used by ortp */
unsigned char db_type; /* message type */
unsigned char db_class; /* internal use */
unsigned char db_id;
};

2008年11月23日 星期日

藥師古剎諸佛菩薩簡介

From:
http://www.59766.com/s12755/show_meet_13586.htm
藥師古剎諸佛菩薩簡介
天王殿
彌勒佛
遊客朋友們,我們進入天王殿,首先看到的是大肚彌勒佛。
彌勒,翻譯為「慈氏」,是慈悲為懷的意思,佛經中慈悲就是除去痛苦給予歡樂的意思。彌勒與釋迦牟尼是同時代人,釋迦牟尼因為弟子舍利子發問,預 言彌勒將來會繼承自己的衣缽,現身世間教化眾生,同時還預言彌勒將會先於佛陀離開這個世間,全身釋放紫色金光,上升到彌勒淨土兜率天,在那裡與眾天神演說 佛法。直到釋迦牟尼佛滅度後五十六億七千萬年時才從兜率天下到我們世間廣傳佛法。
我國歷史上,有彌勒轉世的傳說。五代後樑時,浙江奉化出了個胖和尚,法名契此,他身材矮胖,肚子奇大,常用竹竿挑著個大布口袋在鬧市中化緣(又 稱布袋和尚)。他經常為人們預言未來吉凶禍福,十分靈驗,解危濟困,人們都喜歡他,稱他為奇人。契此圓寂時端坐在一塊磐石上,說偈語:「彌勒真彌勒,化身 千百億;時時示時人,時人皆不識。」說完溘然而逝。人們這才悟到,原來這位胖和尚就是彌勒佛的化身,來到人間普度眾生,於是便按照他的模樣塑成了中國式的 大肚彌勒佛。「大肚能容,容天下難容之事,開口便笑,笑世間可笑之人」。這幅對聯因寓意深刻在世間廣為流傳。
四大天王
天王殿內兩側是威武高大的四大天王,也稱四大金剛。是佛國著名的護法神,千百年來人們以良好的願望認為四大天王肩負著風調雨順的職責,人們把他們尊為世間五穀豐登、天下太平的保護神。
東方持國天王,名多羅吒,身白色,穿甲冑,手持琵琶,「持國」的意思是慈悲為懷,手持琵琶表示要用音樂感化眾生,皈依佛門。當代佛家著名高僧淨 空法師開示說:東方持國天王代表負責盡分,我們生活在世間,有自己的責任、本分。須將自己分內的事做到盡善盡美。如何做到盡善盡美?他手中的琵琶就是表 法,弦太緊了會斷,太鬆了就不響,要調適中。這是告訴我們在生活、工作、處事、待人接物等方面都要恰到好處,不能過分,也不能不及。這就是佛說的「中 道」,儒家說的「中庸」
南方增長天王,名毗琉璃,身青色,穿甲冑,手持寶劍,「增長」的意思是能令眾生增長善根。持劍的目的是保護佛法不受侵犯。佛家高僧開示:天王手 中劍是表法,代表進步。佛家講精進,手中劍代表智慧,惟有智慧才能進步,慧劍斷煩惱。如何增長智慧,把事情做圓滿?需要學習,多看、多聽、多觀察、多實 踐。
西方廣目天王,名毗留博叉,身紅色,穿甲冑,手上纏繞一龍(蛇)。「廣目」的意思是能用淨天眼隨時觀察世界,護持眾生。高僧開示:天王手上的龍(蛇)是表法,蛇或龍代表變化。社會上人情事理非常複雜,變化多端,要細緻觀察掌握分寸而不迷失。
北方多聞天王,名毗沙門,身綠色,穿甲冑,右手持寶傘(寶幡),左手握銀鼠。「多聞」是指他的福德之名聞於四方。他手中寶傘、神鼠,用以制服魔 眾,保護眾生財富。後來北方多聞天王演變成中國民間熟悉的托塔李天王。高僧開示:天王手上的傘蓋是表法,代表防浸染,我們在複雜濁惡的人情社會中要保持不 迷不染,就要懂得這些意義,
四大天王手中的劍、琵琶、寶傘、蛇(龍)在民間演繹成風(劍鋒)調(調弦)雨(用傘)順(順行)。
韋馱菩薩
韋馱又叫韋琨、韋馱王、韋馱菩薩,是南方增長天王手下的八將之一,佛教護法神將,擔當佛寺的護衛工作。佛祖曾下法旨讓韋馱保護出家人,護持佛 法。韋馱是佛國中的「神行太保」,以善走如飛著稱,釋迦牟尼佛圓寂火化後,有個「捷疾鬼」偷走了佛的兩顆牙齒(舍利子)。韋馱發現後,不禁大怒,於是拚命 追趕,捷疾鬼雖然快捷無比,但畢竟不是飛毛腿韋馱的對手,終被擒獲。韋馱奪回了佛牙,立了大功,於是專門擔當起保護釋迦墳墓、打跑掘墳盜墓賊的重任,被尊 為佛教的護法神。韋馱菩薩一般有兩種姿勢:一種是雙手合十,橫杵於腕上,直挺挺站立,另一種是一手握杵捶地,另一手叉腰。行腳僧們只要看見寺內韋馱像是雙 手合掌橫杵的就知道這是十方叢林,對來客表示歡迎,盡可大搖大擺地進去投單。而韋馱握杵拄地的,則不是接待寺,最好去找別的地方。藥師古剎就不是接待寺。
聖觀音菩薩
聖觀音菩薩叫正觀音,為觀音本身像。觀音又稱觀世音,光世音,觀自在,觀世自在。觀音全稱聖號是:大慈大悲救苦救難靈感觀世音菩薩。《佛經》曾 說,觀世音菩薩於過去無量劫中已經成佛,名號是正法明如來,為了普度眾生現作菩薩。他垂形九界,隨類現形,尋聲救苦,患難的人是什麼身份,他就現何身說法 救助。《法華經 普門品》中說,眾生遇到自然災害,社會苦難,種種煩惱等,只要稱呼觀世音菩薩名號,神通廣大的觀音菩薩即會尋聲而至,前來解救。觀世音菩薩救助苦難生靈, 不分貴賤賢愚,良善醜惡,有求必應,所謂:「千處祈求千處應,苦海常坐度人舟。」為了教化不同層次,不同環境下的不同眾生,方便救難,常變化不同形象和身 份,多達三十三種,稱三十三身。千百年來,觀世音菩薩深受人們喜愛。
伽藍菩薩
伽藍菩薩是佛家廟宇的保護神,形象為三國名將關羽。中國自唐、宋時,禪宗道場已有供奉伽藍神的風俗。 關羽原是三國蜀漢的歷史人物,為劉備手下的大將,以勇武絕倫、剛正不阿而聞名,後被東吳的孫權殺害,後人敬仰他的品格,逐漸將關羽奉之為神,到北宋時已成 為道教神祇。佛教普及後,逐漸融合各種信仰,把關羽當作神來供奉,稱為「伽籃菩薩」。中國的佛教中,有這樣一段公案,說隋代天台宗的創始者智者大師,一天 在荊州的玉泉山入定,於定中聽見空中傳來:「還我頭來!還我頭來」的慘叫聲,原來是關羽的魂靈。因他的頭被孫權砍下後送給曹操,落得身首兩分,憤恨不平, 到處尋找自己的頭。智者大師反問:「你當年過五關斬六將,斬顏良、誅文醜,殺人無數,他們的頭你怎麼不還?」並為他講經說法。關羽當下心生慚愧,向智者大 師求授三皈五戒,成為正式的佛弟子,發誓願為佛教護法。從此以後,這位千餘年來極受國人敬重的英雄就成了伽籃菩薩,與韋馱菩薩並稱為佛教寺院的兩大護法神 ,伽籃菩薩為右護法,韋馱菩薩為左護法。
關羽生前忠貞不二、義薄雲天,因此被後人當作守財護財的護法神來供奉,香火不斷。

地藏王菩薩
地藏王菩薩也稱地藏菩薩,佛經稱地藏「安忍不動猶如大地,靜慮深密猶如地藏」,說地藏菩薩如同大地一樣,生養萬物從不索取,坦坦蕩蕩無所執著, 含藏著無數的善根種子。 《地藏菩薩本願經》中說,有一婆羅門女,「其母信邪,常輕三寶(佛法僧)」,死後「魂神墮入無間地獄」。婆羅門女知母在地獄受苦,遂變賣家宅,獻錢財供養 於佛寺。後受自在王如來指引,夢遊地獄,見到鬼王無毒,請求讓母親脫離地獄。婆羅門女醒來方知是夢遊,便在自在王如來像前立大弘願:「願我盡未來劫,應有 罪苦眾生,廣設方便,使令解脫。」釋迦佛告訴文殊說:「婆羅門女者,即地藏菩薩是。」說地藏前世的身份,是為母求離地獄的婆羅門女
在中國有地藏菩薩轉世說,說唐代新羅國僧人金喬覺泛舟渡海,來到中國。 見九華山峰巒疊起,是修道的好去處,於是在山中擇地而居,潛心修行,終日坐禪誦經,山民發現後大為感動,紛紛捐助建寺廟,辟道場。金喬覺九十九歲去世,弟 子們將他端坐函中,葬於神光嶺的月身寶殿,過了三載,開函觀看,顏色如生。佛教界人士認定他是地藏菩薩轉世,九華山也就成為地藏菩薩道場。每年農曆七月三十地藏菩薩誕辰日,各地來九華山朝拜的信徒絡繹不絕。
佛經上說:地藏受釋迦佛祖囑託,在釋迦寂滅而未來佛彌勒下世前這一段「無佛世界」裡,擔當起教化六道眾生的重任。釋迦又命他做幽冥教主,管理陰 間。地藏在佛前立下誓言:「地獄未空,誓不成佛,度盡眾生,方證菩提」。說直到地獄撤空,再沒「罪鬼」受苦,自己才願成佛。佛心樸直、善亦大焉。可惜,六 道輪迴永無休止,地獄何時方能撤空?所以地藏也就永難成佛,佛教把他列為四大菩薩之一。
地藏王菩薩是孝道的化身,因此,為長輩求吉祥長壽,為後輩求健康吉祥都恭敬禮拜地藏王菩薩。

藥師寶殿
消災延壽藥師佛
大家看到佛台上端坐的七尊佛,就是消災延壽藥師佛,也稱藥師七佛。七佛的名號是:善名稱吉祥王如來;寶月智嚴光音自在王如來;金色寶光妙行成就 如來;無優最勝吉祥如來;法海雷音如來;法海勝慧遊戲神通如來,東方藥師琉璃光王如來,東方藥師琉璃光王如來是七佛的主尊。佛家理論認為,現世之人都在病 中,四大不調是身病,五欲不遂是心病,三障自迷是真病。藥師七佛發了四十四大願,能夠拔除眾生的生死病苦,醫治眾生的無明頑症。藥師佛是東方佛,東方是太 陽出升的地方,代表生,藥師佛救度眾生,就是讓他們在生活中求解脫,在現實中了生死。立足當下,立足現生,在因上用功,在能上精進。這也是釋迦如來應世度 生的本懷。藥師琉璃光如來曾立下十二大願,使淨琉璃世界和九法界一眾生,無病無災,豐衣足食,解脫苦惱,解脫苦厄,身心安樂等。藥師琉璃光如來與他兩旁左 右肋侍日光菩薩和月光菩薩,合稱藥師三尊,又叫東方三聖。
藥師佛與釋迦牟尼佛,阿彌陀佛同在大雄寶殿享用人間香火,側旁也有藥師殿,但依據《藥師琉璃光七佛本願功德經》復建獨立的藥師七佛的寺廟 -----藥師古剎在全國是唯一的。
十二藥叉大將
藥師寶殿中兩側站立的十二藥叉大將是藥師七佛的護法神將,也分別是十二生肖之人的守護神,據《藥師七佛經》介紹,十二藥叉大將分別是諸佛菩薩的 化身。他們在釋迦佛祖前發願護持藥師七佛道場,護持主尊藥師琉璃光如來佛的十二大願,為世間信奉藥師佛的眾生消災障、除病苦、得長壽、增福慧,創造人間樂 土。大家依自己的屬相恭敬禮拜你的守護神,可獲其佑護,得消災延壽,去病納福之不可思議功德。
招杜羅大將------丑(牛)之守護神(金剛手菩薩之化身)+
真達羅大將------寅(虎)之守護神(普賢菩薩之化身)
摩虎羅大將------卯(兔)之守護神(藥師如來之化身)
波夷羅大將------辰(龍)之守護神(文殊菩薩之化身)
因達羅大將------巳(蛇)之守護神(地藏菩薩之化身)
珊底羅大將------午(馬)之守護神(虛空藏菩薩之化身)
安你羅大將------未(羊)之守護神(摩利之天菩薩之化身)
安底羅大將------申(猴)之守護神(觀世音菩薩之化身)
迷企羅大將------酉(雞)之守護神(阿彌陀佛之化身)
伐折羅大將------戌(狗)之守護神(大勢至菩薩之化身)
宮毗羅大將------亥(豬)之守護神(彌勒菩薩之化身)
毗羯羅大將------子(鼠)之守護神(釋迦牟尼之化身)

2008年10月1日 星期三

懺悔文、四皈依、無上願

懺悔文
往昔所造諸惡業,
皆由無始貪瞋痴,
從身語意之所生,
一切我今皆懺悔;
罪從心起將心懺,
心若滅時罪亦亡,
心滅罪亡兩俱空,
是則名為真懺悔。

四皈依
皈依金剛上師,皈依佛,皈依法,皈依僧

無上願
願眾生離苦得樂
願眾生早證菩提
願眾生圓滿所願
願眾生得究竟覺

信守密誓三昧耶戒