Friday, March 28, 2008

OpenCds what next

Though I have successfully installed OpenCDS 5.0 on
Windows XP now, I don't know how to start distributing
content with it now. Let me know if anyone does know
what all do I need to start distributing mobile
content right away.

Finally Successful installation of OpenCDS5.0 on Windows

So finally I did it.
I have installed OpenCds 5.0 on Windows XP.

You can do it as well. Here is how :
1. Download binary for OpenCds 5.0.
2. After unzipping there would be another zip file,
unzip that as well.
3. follow the instructions in doc/5.0/DemoSetupGuide/html/DemoSetupGuide.html.

There are some thing which weren't listed
in the doc or which are listed there but
need to be highlighted. That's what I am
trying to fix here.

0. Remember that you HAVE TO install
Weblogic server on Windows. OpenCDS doesn't
support Sun Application Server on Windows
as of today.

1. Install WebLogic server as described in the doc.
Version 8.1 SP3. For free, you will only get its eval
version, but that is fine. It won't expire and it has
what you need.

2. Install only JDK 1.4. For Jdk 1.5 I got an
invalidclassException, quite late during installation.

3. Install Oracle 10g as described in the doc. If your
PC has DHCP enabled you will have to follow instructions
here.

3.1 When you edit DBConf.xml, Hostname should be set
to your ORACLE_HOST, according to the document
mentioned above, which I find very confusing.
It did not work until I set it to localhost. So the entry
looked like :

<hostname>localhost</hostname>


4. In the cds_home/cfg/my.cfg file you will have to change
the parameter jndi.url in the same way that you changed
*.internal.uri parameters. Otherwise you will get
java.net.unknownhostexception later in your installation.

5. You will have to change
snmp.manager.address
parameter in deployment/cds/conf/CDSSnmp.properties as well,
otherwise you will get java.net.unknownhostexception later
in your installation.

Visual mode for Gvim on windows

Using Gvim on Windows, for a long time I wasn't able
to figure out why does it happen that I press 'v' in the
escape mode but am not able to select any text visually.

Solution :
:behave xterm

most likely your _vimrc has
behave mswin

replace that with behave xterm,
by going to Edit->Startup settings

Wednesday, March 26, 2008

something like lsof for windows : openports.exe

Download from :
http://www.diamondcs.com.au/downloads/console/openports.exe

Many a times you want to know which port is being used by which process,
especially when you are installing many a softwares in a single day, all of
which use some port or the other, you might easily get confused.

openports.exe solves it.

Installing OpenCDS on Windows XP

Second Attempt :
Nimish on Momo Delhi suggested that I should try installing it on Linux rather than Windows.
As of now I don't have Linux so I thought I would make it work with Cygwin. As a first
step I installed Oracle 10g from scratch but soon thereafter
I realized that I am making a very basic mistake. I failed to read the following in the
documentation :
6] Currently, only WebLogic Server can be used with OpenCDS on Microsoft Windows platforms.
And I was trying to make it work with Sun Application server.
So now I have 3 options :

1. Get BEA weblogic server and retry for Windows.
There is a catch here, BEA weblogic server is not free and for
free I can download only its eval version. But since I just want
to get a feel of opencds it might be a good option, and also
it seems if I use WebLogic I might get rid of problems that I faced
in my first attempt with regard to broker.sh and deploymq.sh.

2. Try it on Vmware.

3. Try it on Linux.

I will start with 1. as of now.



First Attempt

Note : I haven't been able to install it yet. This is my first and failed attempt.
Note 2 : I don't find enough documentation available for it, so am not sure whether
it's a good idea to use it, since no one else seems to be using it.

I followed the instructions here :
Quick Start Guide.

It asks me to get Oracle 9g, but the documentation that comes
with the binary of opencds (doc\5.0\DemoSetupGuide\html\DemoSetupGuide.html)
asks to get Oracle 10g. And that has much more detailed setup instructions as
well so it's better to follow that.

Anyway, after installing Sun Application server and oracle 9g as mentioned above,
and following rest of the instructions, when I typed

cdsi deploy

it complained :
Files\cds_home"" was unexpected at this time.

The problem was that the path for CDS_HOME included a space, i.e.
C:\Program Files\cds_home
So I simply put it into C:\cds_home, reset CDS_HOME, and the commands worked.

After a few steps I am asked to execute
./deploymq.sh server
but hey, I am on Windows !! And it's a huge sh file, don't know if I would be
able to convert it to .bat.

So I decide to launch cygwin(lucky, that I have it) and run it from there.
There it asked for the license name : pe,try or unl.
I don't know what do these options mean, but it errored out for pe and try,
so I had to settle for unl.

Still, it complained :
imqpassword.txt : No such file or directory.

Now, I have no idea dude, I searched for this file in the Sun Appserver folder and opencds folder
but couldn't find it.

Later, I am asked to run broker.sh, which again is missing everywhere.
So, eventually when I tried cdse startserver, that didn't work either.

Now, here is what I am going to do next :
follow the instructions that came with my copy of opencds, rather
than following the online instructions.

And, rather that using Windows command prompt, I would use cygwin, but I
am pretty sure that wouldn't work either, since I cannot use variables like
/cygdrive/c/etc where I am expected to put C:/etc. So, most likely I won't
be able to install it ever.

but anyway, wish me luck.

Tuesday, March 25, 2008

Streaming a video file with Flash media server

It's simple.
It works exactly the same way as it does for Red5.
You can test it using JW FLV player.

There are two differences :

1. The folder where you have to place the media file :
For me it is :
C:\Program Files\Adobe\Flash Media Server 3\applications\live

2. RTMP connection URL :
rtmp://localhost/live/

In Red5 it was simply rtmp://localhost/.

For more read this post on how to stream it using Red5.

Colorzilla and YSlow

are two really useful firefox extensions, useful for web developers or enthusiasts.
Colorzilla can tell you RGB values for any pixel on the web page
and
YSlow is for analyzing the download time of the web page.

Monday, March 24, 2008

PHP - SetCookie problem and solution

I have these two files :

login.php :
--------------------
setcookie("qq_user","john",time()+604800);
require "function.php";
justPrint();
----------------------

and function.php :

--------------------------------
function justPrint(){
if((isset($_COOKIE["qq_user"]))){
echo "Log Out";
}
else{
echo "Log In";
}
}
-------------------------------



Now when I invoke login.php, it should simply print Log Out, but it
prints out Log In.

I don't know what could the reason be. I thought the delay wasn't enough
between setCookie and justPrint, but inserting a significant delay with
the help of sleep function didn't change anything either.

Finally this worked :
I added one more file new.php.

Now following are the contents of the above 3 files :
login.php :

------------------------
setcookie("qq_user","john",time()+604800);

require "function.php";
header('Location: new.php');
-------------------------------

function.php remains the same.

new.php :
<?
require "function.php";
justPrint();
?>


It's strange why does it work, but it does.

Wednesday, March 19, 2008

Cool Web Apps



Javascript based color picker :
This, you can use in your web page.
URL : http://johndyer.name/lab/colorpicker/



And, ScreebGrab for saving/capturing a webpage as an image. A ffox xtension.

Friday, March 14, 2008

Making Red5 work, Getting started with Red5, Installing Red 5

Step 1 : I am not sure how exactly does Red5 interact with Apache Tomcat and Java SDK,
but I followed the instructions here :

http://osflash.org/red5/windowstomcat

So the first step is to install Java 1.6 SE and Tomcat 5.5.
------------
Step 2 : Now, the link above talks about Red5.war, I couldn't find it.
So I downloaed setup-Red5-0.7.0.exe from http://osflash.org/red5 and installed
it. It installed without a problem.
------------
Step 3 : Start Red5 from the Program Menu and open http://127.0.0.1:5080/,
seemingly 5080 is the default port for Red5. Then go to http://127.0.0.1:5080/demos/ofla_demo.html and play with it.

In the Red5\webapps\oflaDemo\streams folder you can put an flv file and it will be visible on the page mentioned above.

------------
Step 4 :
I used JW FLV player with the following code to connect to a rtmp stream :
<div style="padding-left:40%" id="abc">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var s1 = new SWFObject("mediaplayer.swf","mediaplayer","250","170","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("width","250");
s1.addVariable("height","170");
s1.addVariable("image","1.flv.jpg");
s1.addVariable('file', 'rtmp://localhost/oflaDemo');
s1.addVariable('id', 'airtel_ad_1');
s1.write("abc");

</script>
These 2 lines are important :
s1.addVariable('file', 'rtmp://localhost/oflaDemo');
s1.addVariable('id', 'airtel_ad_1');

note that the file I am trying to play is name "airtel_ad_1.flv", so ".flv"
extension is not needed. Also port number is not needed as well.
------------
Step 5 :
Once you click on the play button in the flv player, you will recieve a warning
whether you want to allow this file to access internet. You might be taken to
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
where you will have to explicitly add the file you want to allow :
In my case : mediaplayer.swf

Making Red5 work, Getting started with Red5, Installing Red 5

Step 1 : I am not sure how exactly does Red5 interact with Apache Tomcat and Java SDK,
but I followed the instructions here :

http://osflash.org/red5/windowstomcat

So the first step is to install Java 1.6 SE and Tomcat 5.5.
------------
Step 2 : Now, the link above talks about Red5.war, I couldn't find it.
So I downloaed setup-Red5-0.7.0.exe from http://osflash.org/red5 and installed
it. It installed without a problem.
------------
Step 3 : Start Red5 from the Program Menu and open http://127.0.0.1:5080/,
seemingly 5080 is the default port for Red5. Then go to http://127.0.0.1:5080/demos/ofla_demo.html and play with it.

In the Red5\webapps\oflaDemo\streams folder you can put an flv file and it will be visible on the page mentioned above.

------------
Step 4 :
I used JW FLV player with the following code to connect to a rtmp stream :
<div style="padding-left:40%" id="abc">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var s1 = new SWFObject("mediaplayer.swf","mediaplayer","250","170","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("width","250");
s1.addVariable("height","170");
s1.addVariable("image","1.flv.jpg");
s1.addVariable('file', 'rtmp://localhost/oflaDemo');
s1.addVariable('id', 'airtel_ad_1');
s1.write("abc");

</script>
These 2 lines are important :
s1.addVariable('file', 'rtmp://localhost/oflaDemo');
s1.addVariable('id', 'airtel_ad_1');

note that the file I am trying to play is name "airtel_ad_1.flv", so ".flv"
extension is not needed. Also port number is not needed as well.
------------
Step 5 :
Once you click on the play button in the flv player, you will recieve a warning
whether you want to allow this file to access internet. You might be taken to
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
where you will have to explicitly add the file you want to allow :
In my case : mediaplayer.swf

Avid : Sound card not supported

Just got a free copy of this highly popular Video Editing software named Avid.
Found the following info as well needed for installation :

Serial Number: AvidFreeDV-31E3
Authorization Code: AF7R-XJ5C-UC7K-552H-KE7Q

On running after installation got this :

Exception ADM_DSOUND_MIXER_OPEN_ERROR

Searching on net revealed my sound card : Realtek is
not supported by Avid.

Which sound card should I buy?

Unable to kill inetinfo.exe

I had this nagging problem for past few hours.

I use xampp and that uses 80 as default port for Apache.
All of a sudden xampp failed to start since port 80 was
being used by some other process.

I ran xampp-portcheck.exe which showed Port 80 being used
by inetinfo.exe.

I went to task manager and killed it but it restarted within
a second. And it kept happening.

After many trials and errors I opened msconfig and in Services
tab disabled IIS Admin. Then I restarted my machine and everything
back to normal.

Though I don't know what had enabled it in the first place.

Blog Archive