Tuesday, August 3, 2010
Friday, July 10, 2009
Deploying JSP Web App on Jboss Application Server on Linux
Here is step by step procedure to deploy a Simple JSP Web App on JBoss Application Server:
The steps are designed for Linux OS. For windows version please check here
1) Install Java
Obtain Java by clicking the "Download" button for Java SE Development Kit (JDK) 6 Update 14 at:
http://java.sun.com/javase/downloads/
Unzip the file into "~/java/" directory.
2) Install JBoss Application Server
Go to the JBoss download page at:
http://www.jboss.org/jbossas/downloads
Locate version 4.2.2.GA, and follow the "Download" link to get the "jboss-5.1.0.GA.zip" file.
Unzip the file into "~/java/" directory.
cd ~/java/lsjboss-4.2.2.GA jdk1.5.0_19
3) Create Work Folder in your personal projects directory
cd ~/projectsmkdir Helloworld4) Create JBoss Startup Script: Just copy the below content into jboss file and make it executable.
#!/bin/bash
#
# Starts the jboss application server
# JAVA HOME
JAVA_HOME="/home/sheeju/java/jdk1.5.0_19/"
JBOSS_HOME="/home/sheeju/java/jboss-4.2.2.GA"
prog="jboss"
start() {
echo -n $"Starting $prog: "
$JBOSS_HOME/bin/run.sh
}
case "$1" in
start)
start
;;
*)
echo $"Usage: $0 {start}"
exit 1
esac
exit $?
This script will launch JBoss.
5) Write JSP File
Also in the "HelloWorld" folder, create a file named "index.jsp" as:
index.jsp
<html><head><title>JSP Test</title>
<%!
String message = "Hello, World.";
%>
</head>
<body>
<h2><%= message%></h2>
<%= new java.util.Date() %>
</body></html>
This JSP simply displays a greeting along with the current date and time.
6) Create Deployment Descriptor
In the "HelloWorld" folder, create a sub folder called "WEB-INF", and in that folder create a file named "web.xml" as:
web.xml
<web-app>
<display-name>Hello World</display-name>
</web-app>
The deployment descriptor provides information to JBoss about your web application.
8) Create WAR Builder & Deployer
In the "HelloWorld" folder, create a shell script named "deploy" as:
#!/bin/bash
#
# Starts the jboss application server
# JAVA HOME
JAVA_HOME="/home/sheeju/java/jdk1.5.0_19/"
JBOSS_HOME="/home/sheeju/java/jboss-4.2.2.GA"
prog="jboss"
start() {
echo -n $"Starting $prog: "
$JBOSS_HOME/bin/run.sh
}
case "$1" in
start)
PROJECT=$2
echo -n $"Deploying Project $PROJECT "
$JAVA_HOME/bin/jar -cvf $PROJECT.war *
cp $PROJECT.war $JBOSS_HOME/server/default/deploy/
;;
*)
echo $"Usage: $0 {start} {
exit 1
esac
exit $?
This script uses Java's JAR utility to zip up the appropriate contents into a WAR file.
9) execute deploy command
10) Test Your Web Page
In a browser, open "http://localhost:8080/HelloWorld/index.jsp" to see your web application run.
Now explore the JBoss console at "http://localhost:8080". Click on "JBoss Web Console" and expand "J2EE Domains", "jboss.management.local", and "JBoss". Select "helloworld.war" to see information about your web application.
Posted by
Sheeju Alex
at
3:25 AM
0
comments
Thursday, July 9, 2009
Analyzing VoIP with Wireshark
Nice tutorial to Analyzing VOIP with Wireshark, if you are familiar with tcpdump it is childs's play. Just get .cap dump using tcpdump
tcpdump -w dump.cap -p -n -s 0 "udp”
This will capture all udp data, you can filter the data according to you requirement. Which can be filtering by port etc..
For more read here
Panoramisk » Analyzing VoIP with Wireshark
Posted by
Sheeju Alex
at
11:11 PM
0
comments
Wednesday, July 8, 2009
Torch on Sony Ericksson K790i
Installing Torch application on K790i
This feature is not by default in K790i. A must have feature when there is lot of power cuts.
After googling around found a forum who talked about this feature http://forums.se-nse.net/index.php?showtopic=4489, read this forum some nice funny statement by Richard :)
"But most of the people I meet who are drunk can't even find their house let alone the key or the hole!!!!! :P"
Here is another site which gives damn neat on how to install Torch application.
http://torchk800.matlista.se/
Torch.jar direct download link - here
Posted by
Sheeju Alex
at
2:24 AM
0
comments
Thursday, July 2, 2009
Tuesday, June 16, 2009
Alternative for putty?
The tool that I use most on my windows box is putty. I've always looked for an alternative since it lacks some features like tabbed sessions, Edit display settings such as the indent colors etc..
Poderosa (funny name :)) is an alternative which is kind off good, and has the features which is similar to Terminator in linux, the important and nice features are
1. Tabbed sessions
2. Split windows horizontally and vertically.
3. Editing display colors etc..
This software requires Microsoft .NET Framework 2.0.
Posted by
Sheeju Alex
at
2:21 AM
0
comments
Monday, May 25, 2009
Bangalore Royal Challengers
Bangalore Royal Challengers, play for more...
Created using VideoDJ of my K790i phone :)
Banglore lost the final of IPL to Hyderbad, though Bangalore played well to reach the final of IPL under excellent captaincy of namma Anil Kumble
Posted by
Sheeju Alex
at
9:57 PM
0
comments
Tuesday, May 12, 2009
Create SSH tunnel in the background
Create SSH tunnel in the background
ssh -f -N -p <port> -L <local_port>:localhost:<destination_port> user@ip
Posted by
Sheeju Alex
at
3:40 PM
0
comments
Thursday, May 7, 2009
Public DNS I use
Public DNS I use
4.2.2.1
4.2.2.2
4.2.2.3
4.2.2.4
4.2.2.5
4.2.2.6
Posted by
Sheeju Alex
at
5:43 AM
0
comments
Saturday, May 2, 2009
Wednesday, April 1, 2009
Compiling Asterisk 1.4.x with H323 channel driver
This is just a step by step procedure I followed to compile Asterisk 1.4 version with H323 channel driver
apt-get install flex bison- Here we download and compile Asterisk
cd /usr/src
wget http://downloads.digium.com/pub/zaptel/releases/zaptel-1.4.10.1.tar.gz
cd zaptel-1.4.10
./install_prereq test
./configure
make
make installCompile libpri
cd /usr/src
wget http://downloads.digium.com/pub/libpri/releases/libpri-1.4.4.tar.gz
cd libpri-1.4.4
make
make install
Compile Asterisk
cd /usr/src
wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.20.tar.gz
cd asterisk-1.4.20
./configure
make menuselect
make
make install
make samples
- Compiling pwlib and openH323 for H323 channel driver
This is required since openh323 will look for compiler.h
touch /usr/include/linux/compiler.hCompile pwlib
cd /usr/src
wget http://downloads.sourceforge.net/openh323/pwlib-v1_11_0-src-tar.gz?use_mirror=nchc
tar zxvf pwlib-v1_11_0-src-tar.gz
cd pwlib_v1_9_0
./configure
make
make install
make opt
export PWLIBDIR=/usr/src/pwlib-v1_11_0Compile openh323
cd /usr/src
wget http://downloads.sourceforge.net/openh323/openh323-v1_19_0_1-src-tar.gz?use_mirror=jaist
tar zxvf openh323-v1_19_0_1-src-tar.gz
cd openh323-v1_19_0_1
./configure
make
make install
make opt
export OPENH323DIR=/usr/src/openh323-v1_19_0_1OpenH323 generates its libs in /usr/local/lib but my Linux uses /usr/lib for shared libraries, we'll need to copy the genberated libraries from /usr/local/lib to /usr/lib.
cp /usr/local/lib/* /usr/lib
cd /usr/src/asterisk-1.4.20
./configure
make menuselect ## check if h323 is enabled under channels
cd channels/h323
make
make opt
cd ..
cd ..
make installNow we make sure the channel driver exists and is loadable:
ldd /usr/lib/asterisk/modules/chan_h323.sostart asterisk
/etc/init.d/asterisk start
Posted by
Sheeju Alex
at
4:32 AM
0
comments
Labels: Asterisk PBX
Thursday, October 2, 2008
Install PHP 5 on Windows Xp for IIS 5.1
Step by step guide to install IIS and PHP 5 on windows XP:
- First install IIS server:
- Go to your control panel > add remove programs. Click on "Add/Remove Windows Components".
- Make sure windows CD is inserted
- Place a Select check for "Internet Information Services (IIS)”
- Continue with the installation completely.
- Check whether IIS is installed properly by browsing the default iis site (http://localhost).
- Now you must get the correct files for php5. Head over to http://www.php.net/downloads.
php and download the zip package under "Windows Binaries" Do not get the installer! In addition, while you are here you will need to get the "Collection of PECL modules" also under Windows Binaries - Once Downloaded extract the first file you downloaded and place the files in "C:\php". Extract the PECL modules to "C:\php\ext".
- Rename C:\php\php.ini-recommended to C:\php\php.ini and then COPY it to C:\Windows
- Open both the php.ini file you have now and uncomment cgi.force_redirect in php.ini and set it to 0
- Change session.save_path as "session.save_path=C:\php\
sessions" and make the directory C:\php\sessions - Set the line "extension_dir" as "extension_dir = "C:\php\ext".
- Uncomment all of the following items.
extension=php_mssql.dll
extension=php_msql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_java.dll
extension=php_ldap.dll
extension=php_iisfunc.dll
extension=php_imap.dll
extension=php_filepro.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_dba.dll
extension=php_dbase.dll
extension=php_dbx.dll
extension=php_mbstring.dll
extension=php_pdf.dll
extension=php_pgsql.dll
extension=php_sockets.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll
extension=php_zip.dll - Now copy all of those DLL files in C:\php\ext to C:\windows\system32 or add "C:\PHP;" to your Windows path:
- Right Click on My Computer and choose properties > Advanced Tab > Click "Environment Variables".
- Now add "C:\PHP;" to the very beginning.
- Now go to start > run > type: regedit and click ok
- Add HKEY_LOCAL_MACHINE\SOFTWARE\
PHP\IniFilePath = C:\php to the registry. If you change your windows path instead of copying the dll files then you will need to restart your computer before php will work. Updating php is easier when you add it to your Windows path. So bookmark this page and go restart. Now is the best time since we are done with file placement.
- You might have to restart your system at this point
- Ok, you are back. Now it is time to let IIS know that you have php and you are going to tell IIS how to use it and when
- Open Internet Services Manager in your Administrative Tools in the start menu
- Right Click on Web Sites and click Properties, go to ISAPI filter tab choose Add, Filter Properties window pops up. Enter
Filter Name: php
Executables: Browse to C:\php\php5isapi.dll
- Right Click on websites and choose properties. Go to the Documents tab and add index.php as a start document.
- Go to C:\Inetpub\wwwroot and delete everything in there except for aspnet_client. Now make a new text file and name it phpinfo.php. Open it up with your text editor ant put this in it: .
- Open a web Browser and go to http://127.0.0.1/phpinfo.php
- Enjoy php on Windows XP and IIS
Posted by
Sheeju Alex
at
11:37 PM
0
comments
Labels: PHP, Windows XP
Wednesday, January 9, 2008
Interactive Voice Response (IVR)
Interactive Voice Response (IVR).
Interactive Voice Response (IVR) is the technology that let you interact with a menu using a touch-tone telephone. In our day to day life we have already come across IVR in many ways, a best example is when you call banks
It is very easy to set-up such a menu with Asterisk.
The following is just an example for an IVR system where you call the number 9877777777 and you enter the IVR system. First you will get the greeting message ("welcome to dash dash Bank, please press 1 for Account related Enquiry, 2 for Credit card Enquiry or press 9 to talk to pur representative") and during this message you can press key 1, 2 or 9. According to the number pressed, you will be directed to the right extension
In extensions.conf place this snippet
exten => 9877777777,1,Answer
exten => 9877777777,2,SetMusicOnHold(default)
exten => 9877777777,3,DigitTimeout,5
exten => 9877777777,4,ResponseTimeout,10
exten => 9877777777,5,Background(greeting)
;; greeting -- "welcome to dash dash Bank, please press 1 for Account related Enquiry, 2 for ;;Credit card Enquiry or press 9 to talk to pur representative
exten => 1,1,Playback(ivr1) ; takes to another Account related IVR
exten => 2,1,Playback(ivr2) ; takes to another Credit card related IVR
exten => 9,1,Playback(representative)
exten => 9,2,Dial(SIP/bankrep)
;; representative -- Please wai while the call is transfered to our representative
Posted by
Sheeju Alex
at
1:37 AM
0
comments
Labels: Asterisk PBX, IVR, Linux
Saturday, December 29, 2007
Christmas Lights
My christmas fun in Janakpuri church Delhi.....
Posted by
Sheeju Alex
at
7:46 PM
0
comments
Monday, December 17, 2007
Vim Commands Cheat Sheet
Cursor movement
- h - move left
- j - move down
- k - move up
- l - move right
- w - jump by start of words (punctuation considered words)
- W - jump by words (spaces separate words)
- e - jump to end of words (punctuation considered words)
- E - jump to end of words (no punctuation)
- b - jump backward by words (punctuation considered words)
- B - jump backward by words (no punctuation)
- 0 - (zero) start of line
- ^ - first non-blank character of line
- $ - end of line
- G - Go To command (prefix with number - 5G goes to line 5)
Note: Prefix a cursor movement command with a number to repeat it. For example, 4j moves down 4 lines.
Insert Mode - Inserting/Appending text
- i - start insert mode at cursor
- I - insert at the beginning of the line
- a - append after the cursor
- A - append at the end of the line
- o - open (append) blank line below current line (no need to press return)
- O - open blank line above current line
- ea - append at end of word
- Esc - exit insert mode
Editing
- r - replace a single character (does not use insert mode)
- J - join line below to the current one
- cc - change (replace) an entire line
- cw - change (replace) to the end of word
- c$ - change (replace) to the end of line
- s - delete character at cursor and subsitute text
- S - delete line at cursor and substitute text (same as cc)
- xp - transpose two letters (delete and paste, technically)
- u - undo
- . - repeat last command
Marking text (visual mode)
- v - start visual mode, mark lines, then do command (such as y-yank)
- V - start Linewise visual mode
- o - move to other end of marked area
- Ctrl+v - start visual block mode
- O - move to Other corner of block
- aw - mark a word
- ab - a () block (with braces)
- aB - a {} block (with brackets)
- ib - inner () block
- iB - inner {} block
- Esc - exit visual mode
Visual commands
- > - shift right
- < - shift left
- y - yank (copy) marked text
- d - delete marked text
- ~ - switch case
Cut and Paste
- yy - yank (copy) a line
- 2yy - yank 2 lines
- yw - yank word
- y$ - yank to end of line
- p - put (paste) the clipboard after cursor
- P - put (paste) before cursor
- dd - delete (cut) a line
- dw - delete (cut) the current word
- x - delete (cut) current character
Exiting
- :w - write (save) the file, but don't exit
- :wq - write (save) and quit
- :q - quit (fails if anything has changed)
- :q! - quit and throw away changes
Search/Replace
- /pattern - search for pattern
- ?pattern - search backward for pattern
- n - repeat search in same direction
- N - repeat search in opposite direction
- :%s/old/new /g - replace all old with new throughout file
- :%s/old/new/gc - replace all old with new throughout file with confirmations
Working with multiple files
- :e filename - Edit a file in a new buffer
- :bnext (or :bn) - go to next buffer
- :bprev (of :bp) - go to previous buffer
- :bd - delete a buffer (close a file)
- :sp filename - Open a file in a new buffer and split window
- ctrl+ws - Split windows
- ctrl+ww - switch between windows
- ctrl+wq - Quit a window
- ctrl+wv - Split windows vertically
Appending Character to start of multiple lines
- ctrl+v;shift+i;
;ESC
Posted by
Sheeju Alex
at
4:55 AM
0
comments
Labels: Linux
Saturday, December 8, 2007
Lyrics of Pray for me brother
Lyrics of Pray for me brother
Pray for me brother
Pray for me brother
Pray for me sister
Are you searchin’….
Pray for me brother
Lookin’ for the answers To all the questions In my life
Will I be alone Will you be there By my side
Is it something he said Is it something he did
I wonder why He is searchin’ For the answers
To stay alive
Could you ever listen Could you ever care
To speak your mind
Only for a minute For only one moment
In time
The joy is around us But show me the love
That we must find
Are you searchin’ For a reason to be kind, to be kind…
He said… Pray for me brother
Pray for me brother Pray for me sister
Pray for me brother Say
what you wanna say now
But keep your hearts open
Be what you wanna be now
Let’s heal the confusion
Pray for me brother
Don’t let me take When you don’t wanna give
Don’t be afraid Just let me live
Don’t let me take When you don’t wanna give
Don’t be afraid Say what you wanna say now
But keep your hearts open
Be what you wanna be now Let’s heal the confusion
Pray for me brother Pray for me brother
I’m ashamed ah, brother be dying of poverty
when he down on his knees its only then he prays
And it’s a shame ah, brother be dying of ignorance
cos the world is a trip and everybody’s a hypocrite
Need to stop ah , taking a look at the other
I’m not ashamed of poverty
need to be making his life better
So think about it, think about it once more
cos life is a blessing and it’s not justa show, ah
Round and round the world is spinning around
We need to be singing a prayer, we need to be singing it now
Round and round the world is turning around
We need to be singing a prayer, we need to be singing it now
Need to be feeling the power, need to be feeling the faith
We need to coming together just to win this race
Need to be feeling the power, need to be feeling the faith
We need to coming together just to win this race (twice)
Are you searching for a reason to be kind ?
Posted by
Sheeju Alex
at
4:32 AM
0
comments
Labels: Lyrics
Saturday, December 1, 2007
How VoIP Works?
If you've never heard of VoIP, get ready to change the way you think about long-distance phone calls. VoIP, or Voice over Internet Protocol, is a method for taking analog audio signals, like the kind you hear when you talk on the phone, and turning them into digital data that can be transmitted over the Internet.
How is this useful? VoIP can turn a standard Internet connection into a way to place free phone calls. The practical upshot of this is that by using some of the free VoIP software that is available to make Internet phone calls, you are bypassing the phone company (and its charges) entirely.
VoIP is a revolutionary technology that has the potential to completely rework the world's phone systems. VoIP providers like Vonage have already been around for a little while and are growing steadily. Major carriers like AT&T are already setting up VoIP calling plans in several markets around the United States, and the FCC is looking seriously at the potential ramifications of VoIP service.
Above all else, VoIP is basically a clever "reinvention of the wheel." In this article, we'll explore the principles behind VoIP, its applications and the potential of this emerging technology, which will more than likely one day replace the traditional phone system entirely.
The interesting thing about VoIP is that there is not just one way to place a call. There are three different "flavors" of VoIP service in common use today:
* ATA - The simplest and most common way is through the use of a device called an ATA (analog telephone adaptor). The ATA allows you to connect a standard phone to your computer or your Internet connection for use with VoIP. The ATA is an analog-to-digital converter. It takes the analog signal from your traditional phone and converts it into digital data for transmission over the Internet. Providers like Vonage and AT&T CallVantage are bundling ATAs free with their service. You simply crack the ATA out of the box, plug the cable from your phone that would normally go in the wall socket into the ATA, and you're ready to make VoIP calls. Some ATAs may ship with additional software that is loaded onto the host computer to configure it; but in any case, it is a very straightforward setup.
* IP Phones - These specialized phones look just like normal phones with a handset, cradle and buttons. But instead of having the standard RJ-11 phone connectors, IP phones have an RJ-45 Ethernet connector. IP phones connect directly to your router and have all the hardware and software necessary right onboard to handle the IP call. Wi-Fi phones allow subscribing callers to make VoIP calls from any Wi-Fi hot spot.
* Computer-to-computer - This is certainly the easiest way to use VoIP. You don't even have to pay for long-distance calls. There are several companies offering free or very low-cost software that you can use for this type of VoIP. All you need is the software, a microphone, speakers, a sound card and an Internet connection, preferably a fast one like you would get through a cable or DSL modem. Except for your normal monthly ISP fee, there is usually no charge for computer-to-computer calls, no matter the distance.
If you're interested in trying VoIP, then you should check out some of the free VoIP software available on the Internet. You should be able to download and set it up in about three to five minutes. Get a friend to download the software, too, and you can start tinkering with VoIP to get a feel for how it works.
Posted by
Sheeju Alex
at
6:41 PM
0
comments
Labels: Teleconference
Tuesday, November 27, 2007
Postfix SMTP relayhost configuration
Recently I was working on setting up SMTP Authentication to send mails through there ISP's mail server.
I first tried with perl MIME::Lite program which i found very hard to work with SMTP Authentication. So I decided to configure Postfix to relay mails to ISP mail server ( with SMTP Authentiction).
Postfix main configuration file: /etc/postfix/main.cf
myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost, localhost.localdomain, localhost
relayhost = smtp.isp.com
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth ## **
smtp_sasl_security_options = noanonymous
To check postfix config.
#postfix check
#postconf
** smtp_auth is the file we store Authentication information
smtp.isp.com sheeju@isp.com:mypassword
smtp_auth is in this format
*** - Depending on your provider this can be username or useremail.
Next create hash DB of smtp_auth.
#postmap hash:/etc/postfix/smtp_auth
otherwise you get the error..
postfix/smtp[nnnnn]: fatal: open database /etc/postfix/smtp_auth.db: No such file or directory
Restart Postfix
# /etc/init.d/postfix restart
Testing Postfix:
echo testing | mail -s Bla sheejuec7@gmail.com
This is used to send test mail to sheejuec7@gmail.com. Next to check whether the mail relayed through ISP use
mailq
tail /var/log/mail.log
Posted by
Sheeju Alex
at
7:01 AM
1 comments
Labels: Linux
Wednesday, November 21, 2007
Asterisk Installation
Here is Good Resources to start installing Asterisk,
http://www.automated.it/guidetoasterisk.htm
http://www.voip-info.org/wiki-Asterisk+installation+tips
Video tutorial for understanding Asterisk better..
http://revision3.com/systm/asterisk
Asterisk PBX created by Mark Spensor of Digium Inc..
http://digium.com
http://asterisk.org
Posted by
Sheeju Alex
at
6:26 PM
0
comments
Labels: Asterisk PBX
How Teleconferencing works?
Who has not heard of teleconferencing, today's fast-rising manner of exchanging data between people found in different geographical locations as well as time zones This is more famous among agencies and firms, big and small, to make possible quick and effective swapping of concepts. This is a lot more convenient than having to set up conferences, or even trainings, at a certain place with many participants who may or may not be attend at that scheduled time and location.
Conference calling can range from a simple three-way call to a comprehensive conference call as well as virtual meeting with up to numerous attendees all in one setting, communicating and interacting with each another through a system. A lot may find this somewhat complicated or believe this could be more than their budget. Yet at close observation, you would discover providers that give affordable teleconferencing services. You may use the internet to look for and identify various conference call costs for better comparison and you might be surprised to learn that some even give free teleconferencing options.
So how does teleconferencing work This is simply the process of connecting individuals or groups of persons by using a server called a bridge that serves as a phone that may answer numerous calls at the same time. The teleconferencing service that would host the meeting would give the bridge if you do not presently possess one. When you have a VoIP software, you may host your own conference call using VoIP network. If you want more interactive communication, you may maximize the utilization of internet technology by utilizing audio as well as video streaming with the use of webcams then headphones, instant messaging for quick interchange of text data, using a common whiteboard as you would in a regular face-to-face conference, and other relevant programs.
Posted by
Sheeju Alex
at
9:55 AM
1 comments
Labels: Teleconference





