Linux

Windows as a Guest on a Linux (ubuntu) host

After having been through all those days of triple boot and quadruple boot systems, i am coming back to a single boot machine now.  This time with my work laptop with Ubuntu as the main and the only OS.  Since i knew i could never complete that dream of running everything from linux in my work place in the near future, i decided to go with the only other choice to achieve it with immediate effect.

So what are my work place requirements. i need to have a firefox with silverlight.  That is the only thing for which i need Windows, ok, may be occasionaly for something else like, i don’t know…. I can’t think of any thing else.  and though even that can be circumnavigated with Wine, the video chat on gmail is another thing which will become a road block.

So to solve these, i decided to install Windows on Virtual Box with Ubuntu as Host.  This i thought will solve the problem.  But, yeah it did solve the problem of firefox with silverlight.  But Virtual Box is not allowing to enable to use of webcam to the guest OS.  It has to be a small problem somewhere i think.  Will look into it.  And to solve the problem of not having a anti-virus, I am allowing internet only to firefox, and have removed the access to the rest of the system.  I did it with Squid on the host.  It feels good, to be close to achieving the original thought.  But i can live with a little Evil i guess.

For Virtual Box installation i followed the instructions in this page under the title Debian Based Distributions.  Just in case if you are not able to open it.

add the following line in your repositories list in Synaptic Package Manager (settings -> repositories -> other software)

deb http://download.virtualbox.org/virtualbox/debian lucid non-free

add the key to the Synaptic Package Manager (settings -> repositories -> authentication)

then say

sudo apt-get update
sudo apt-get install virtualbox-3.2

That should do it.  I mean that is all i did. and i had to go thru this to understand how to access shared folders form host to guest and why the display resolution went to 800×600 when i made the shared folder access to work.  It was frustrating, the display always going to 800×600 from 1024×768  finally figured out, that it was the Virtual Box Display Driver which was causing it.  Then i just uninstalled just the display driver, and override it with the default driver whatever windows took itself.  And that is it.  Things are working fine for now.  Just the small thorn of WebCam access from host to guest.  Will soon try to find a way out.


			
Linux, Office

Orangescape Studio

I have been trying for a complete switch to Linux in my laptop for a long time.  Though i achieved it for my desktop in home, Every time i get a plan to switch to linux, the Engg dept comes up with a new version which makes me to wait some more.

But with WINE i had been able to make the things to work in linux.  But as it happens, many a time the application fail to work even with wine.  Now after close to 4 to 5 months of trying to make the new Orangescape studio work on linux, atlast it works.  Even though it is a webapp still we need wine.

The latest Update of Kernel to 2.6.31-20 + a higher internet connection speed made it possible.  I had installed WINE 1.1.31 long back.  I had installed Silverlight 3 + Firefox 3.5.6 (windows version) on WINE.  It had not been working till last weekend, when i last updated the system. (Kernel version 2.6.31-20).  Plus the new changes which the Engg made over the last week.  Now it is working.  I did some basic validations and a straight workflow.  It worked well.  But i could notice the CPU usage shooting up when doing Workflow design.  But nothing so great to make the system unstable or crash to firefox as how it was happening before.

Studio

Studio

Process Designer

Orangescape Studio - Process Designer

The Browser


The Operating System

But it is not working with moonlight.  Seems moonlight has a lot of catching up to do.

The Machine:

  • Intel Core 2 Duo T5800 @ 2 Ghz
  • 2GB RAM
  • Ubuntu 9.10 (karmic koala)

Update:

It works with Firefox 3.6, and seems like with Fx3.6 the working is more smother than with Fx3.5.x.  The CPU doesn’t go above 60% when loading or using Process Designer, which was not the case with the previous versions.  It would hit 95% in both CPU’s of my laptop in Fx3.5.x.  May be i should be using it a bit more regularly and try out different things before going all out on the decision of deleting Windoze out.  Still have a few doubts where it might stumble or even crash.  Need to check those out.

Office

connecting to database from ant via jndi

This is a refernce to me.
There is a problem with the environments of our client.  Our product (for the matter any other product) works slow in there servers.  So to speed up certain operations to enable the users to work comfortably, we decided to use ant to execute sql queries on the backend.  But there was a problem.  Their security policy would require them to change the database every 3 months or so.  Now, to change the password at every place every 3 months would be frustrating.  So we decided to connect to the connection pool of our application server and execute the queries from ant.  For this i have to look up the jndi and get the connection from it.  When i set out to do it, it didn’t work as expected.  I was faced with an error stating
cannot create type or task : script.
To make sure what i did was correct i went and executed the target in an local installation of ant instead of from our app server.  There too it did not work.  But i was faced with a different error saying no class found execption.  Then i understood that it was a case of missing libraries, A quick look in the manual told that i have to add a few external libraries, rhino (js.jar) and bsf (bsf.jar) and commons-logging.  I went ahead and downloaded them, there were various versions available, i couldn’t figure out which one to use to make things work.  At last after various trials and errors the working versions are
i moved these jars to lib directory of our app server and set about to test the functonality in the server.  Again i was facing the same error.
cannot create type or task : script.
This was a little baffling, as it worked in a installation of ant.  Then i thought again it has to be some other jar which is missing here in the lib directory of the server.  I moved all the jars in to the lib directory.  Now the thing worked.  But i knew these many jars were not required.  So i set about removing one jar at a time and testing to see it if works.  and atlast it was ant-apache-bsf.jar file which was causing the problem.  This is was the only other jar file which was required for it to work.
Ant Version : 1.6.3
Application Server : DimensioN 2.4 (based on JBoss)
A sample ant target:
<target name=”Claim.Submission”>
<read name=”record_id” parameter=”instid”/>
<echo>Claim Submission for ClaimId -> ${record_id}</echo>
<script language=”javascript”>
<![CDATA[
importPackage(Packages.java.util);
importPackage(Packages.java.naming);
importPackage(Packages.javax.sql);
importPackage(Packages.com.orangescape.hce.server.services);
var ds = CsServiceLocator.getInstance().fetchObject(“java:dimension”);
var conn = ds.getConnection();
var stat = conn.prepareStatement(“exec sp_claim_submission ?”);
stat.setString(1,record_id);
stat.execute();
conn.close();
]]>
</script>
</target>
Office, What the...

Securing your DimensioN Portal – enabling https

I had to do this for one of the clients. This is the procedure which i followed. It was a real headache. Got into some difficulties and then found out things and stuff. I am writing down the exact procedure which i had followed, during development time, and during the setting up of the server with a thawte certificate, and enable SSL and HTTPS. Hope this helps someone.

DimensioN is based on JBoss,  So SSL on JBoss should also be the same, but i can’t guarantee
To Enable SSL in DimensioN.

For development
Step 1: keytool -genkey -alias [alias name] -keypass [password] -keyalg RSA -keystore [keystore name]

to get ssl certificate from issuing authorities.

Perform the steps to generate the key , CSR and install SSL certificate. (ref:1)

STEP 1 : keytool -genkey -keyalg RSA – alias [alias name] -keystore [keystore name] (use the password same as alias.)
STEP 2 : keytool -list -keystore [keystore name]
STEP 3 : keytool -certreq -alias [alias name] -keyalg RSA -file certreq.csr -keystore [keystore name]
STEP 4 : keytool -import -alias [alias name] -trustcacerts -file [downloaded certificate name] -keystore [keystore name]

for eg:
STEP 1 : keytool -genkey -keyalg RSA – alias tomcat -keystore dimension.keystore (use the password same as alias.)
STEP 2 : keytool -list -keystore dimension.keystore
STEP 3 : keytool -certreq -alias tomcat -keyalg RSA -file certreq.csr -keystore dimension.keystore
STEP 4 : keytool -import -alias tomcat -trustcacerts -file mysignedcert.crt -keystore dimension.keystore

Use the CSR file which is generated after step 3 to apply for the SSL certificate from the concerned authorities. apply step 4 with the file which you get back from the signing authority.

If after doing this procedure, if you still get the error that is a self signed certificate, then the certificate you have downloaded is not in PKCS#7 format.(ref:3)
you will have to create a chain certificate from the one which you have.
The procedure to follow in windows is as follows.(ref:2)

1. Double click on the .crt file, which you had downloaded.
2. Click on the Details Tab at the top
3. Click on ‘Copy to file’
4. Click ‘Next’
5. Tick the third option: “Cryptographic Message Syntax Standard – PKCS#7 Certificates (.P7B)”. Also tick “Include all certificates in the certification path if possible”
6. Click ‘Next’
7. Select a file name or browse to a path where you’d like to save this chained certificate.
8. Click ‘Next’
9. Click ‘Finish’
10. Your export should be successful, then click ‘OK’.

configuration in DimensioN:

Step 1 : copy the generated keystore to [DimensioN_Server_install_Directory]\DimensionServer\server\default\conf
Step 2 : open server.xml file in [DimensioN_Server_install_Directory]\DimensionServer\server\default\deploy\jbossweb-tomcat50.sar
Step 3 : find the below section in that file.

<! – – < port=”8443″ address=”${jboss.bind.address}” maxthreads=”100″
minsparethreads=”5″ maxsparethreads=”15″ scheme=”https” secure=”true”
clientauth=”false” keystorefile=”${jboss.server.home.dir}/conf/chap8.keystore”
keystorepass=”rmi+ssl” sslprotocol = “TLS”> – – >

remove the comments by removing the < ! – – and — > from the beginning and end of the section.
give the keystore name in the line  keystoreFile=”${jboss.server.home.dir}/conf/[keystore name]”
give the keystore password in the line keystorePass=”[keystore password]”
Step 4 : find the below section in that file

<Connector port=”6666″ address=”${jboss.bind.address}”
maxThreads=”150″ maxHttpHeaderSize=”8192″
minSpareThreads=”25″ maxSpareThreads=”75″
enableLookups=”false” redirectPort=”8443″ acceptCount=”100″
connectionTimeout=”20000″ disableUploadTimeout=”true” compression=”on”
compressableMimeType=”text/csv”/ >

comment out this section by adding < ! – – and – – > at the beginning and end of the section respectively.

Step 5 : Start the DimensioN server.  now you should be able to access it via the url https:\\localhost:8443.
you can even set the connector port to 443, so that you can call the url as https:\\localhost.

ref:
(1) Generate a key and CSR and install SSL Web Server Certificate on JBoss
(2) Create PKCS7 Certificate
(3) Apache Tomcat – SSL Configuration – How To

Office, Open Source, programming

Multilevel Menus – ddlevelsmenu

Well, last time i had written that i was supposed to convert a menu from mouseover functionality to onclick. Somehow i had done it, to the satisfaction of whoever i had shown. I don’t know for whom i am doing this, but now i am happy.

The approach was same as everyother attempt at reading code. i have uploaded the js file which i had edited to achieve the desire effect. which you can take it from here. I thought it might be helpful to someone. The original script can be obtained from here (ddlevelsmenu). It works on mouse over, which i had converted to on click. This is a old version of the file that exist over there in their site, just make the same changes over there, to convert it into onclick.

I had commented whatever i had done which might help someone. If there are any unusual or wrong ways, just lemme know, so i can correct it.

The menu still lacks the ability to be on screen, when the mouse moves out of the menu. But it still has made the product a little more usable. That, is what is important. May be another day, another time, after learning Java Script i will make changes to overcome that problem tooo. or may be another version where i can combine both the functionalities with the change of a parameter or something…….

Hopes, Linux, Office, Open Source

Wine 1.0 and Dimension Studio 2.3

At last, a major release of wine, which stands for Wine Is Not an Emulator, came out last week, and it was available in the mandriva repositories yesterday morning. The first thing i did as i reached office yesterday was to install and then try to install and use Dimension Studio in Linux. Though it was a fairly easy cake walk with wine and Dimension Studio version 2.3 did work, and worked so cool. That i was just in awe!!,,, all the struggle for the past 7 months, the pain, the angst, everything vanished, at the sight of the progress bar progressing and the spreadsheet interface appearing. I was there like child with his new toy to play with, and doing all sorts of things….. The joy was not for long, coz when i tried it with the latest version of Dimension Studio 2.4 it was very similar to what has been happening for the past 6 months. Still i need to try once again with the 2.4 version.

The next big jolt came when i tried to install the Dimension Server 2.3 in Linux, coz i know the fact that it will work in linux, and i have done it once or twice in my house. But when i tried i was running into errors of all sorts unknown to me, i did try to change the JDK to sun JDK 1.5.0_14 instead of Open JDK 1.7.. still i couldn’t proceed the problem was that during installation MYSQL Tcp/Ip connectivity was disabled and myssql’s case sensitivity switch was on. which was causing problems, and i was running around without checking these facts for nearly 5 hours… How insulting!!!…..

Well that was it, for now though…. I will make dimension studio 2.4 and all subsequent releases to work with the help of wine, and switch over to linux. This is a promise i make………..