CopyDisable

Tuesday, 23 August 2011

Creating multiple instances in Tomcat 7

Creating multiple tomcat instances in windows is never been so easy as with Tomcat 7. It’s very easy with the Windows installer; also the installer creates the windows service. No manual work of creating new directory, copying files, editing configuration files and creating windows service. All these can be done through the new Tomcat 7 windows installer.
Suppose I want to create three tomcat instances. Run the installer and in the Configuration Options select the appropriate ports and service name for each instance.
Suppose my first instance is Tomcat7_KNIT, enter the ports as per requirement and also the name of the name of the Windows service for this instance.


 Select the installation location




To create my second instance Tomcat7_Nirman, again run the tomcat installer. At the configuration options select ports different from the first instance.

 
Select the installation folder



Similarly for the 3rd instance, select the ports and installation directory after running the installer



After the installation is done, I can see the three tomcat services. The name of a service is prefixed by Apache Tomcat 7.0 . By default the service startup is manual, if required change it to automatic.



জয় আই অসম,
প্রণব শর্মা

Script to delete files of n days old.... Windows server


Synopsis:

In one of the windows servers, I am storing backup files of a database server. As per our policy we have to keep backup files for 30 days. As in the partition size where I am storing backup files is small, so I have to regularly delete backup files to manage free space in that partition. I could easily write a shell script in Linux to delete 30 days old file, but I was not sure how to do it in the Windows 2003 server. Then I came to know about Forfiles (http://technet.microsoft.com/en-us/library/cc753551%28WS.10%29.aspx ) , I used it and wrote a batch script which will delete 30 days old file everyday.


The script is as follows:

@echo off & setlocal

Create a variable to store the name of the temporary file to capture the output. If you do not want to capture the file names that are deleted, you can skip the temporary file part.

set tempmail=%temp%\solardb_delete.txt

Just writing a blank line to the temporary file
echo.>>%tempmail%

-p option of forfile specifies the path where it will look for files, -d -30 specifies to select files last modified 30 days before current date (its minus 30). –c specifies the command to execute. The command first appends the filename to be deleted into the temporary file and then deletes the file.

forfiles -p F:\MySQLBackup\Today -d -30 -c “cmd /c echo deleting @FILE .>>%tempmail% & del @FILE”

Next part of this script is to send the mail alert, also sending the temporary file containing the deleted file names as an attachment in the mail. For this I used a php script (the reason of using php script is that, I can use external SMTP server of rediff to send the mail and do not have dependency on local SMTP sever. Otherwise this can also be done through a batch script), you can use any script/program as you like to the send mail alert. Otherwise you can skip the following part.

move %tempmail% F:\php_script\output

set tempmail=

endlocal

php F:\php_script\mysql_backup_delete.php

del /Q F:\php_script\output\solardb_delete.txt


জয় আই অসম,
প্রণব শর্মা

Error in Remote Installation of Glassfish node:- bash: jar: command not found

While creating a cluster in Glassfish V3.1 in Windows 2003 servers, I was trying to install DAS image on the remote instance system, I was getting the following error:

jar command failed while installing glassfish on hosthostname. Command output bash:
jar: command not found

Remote command output: bash: jar: command not found
 

Command install-node failed.




My environment variable settings were fine, I checked the jar command at the target system and it was also working. But still I am getting this error.
After tried few times, I searched for some time and in Glassfish’s Jira system, I got a way to resolve this problem.
1) Check which jar executable shell was trying to execute, as the jar executable was not in cygwin’s bin directory, the command was failing.



2) Now create a symbolic link to the jar executable file from the cygwin bin directory
C:\cygwin\bin>ln -s '/cygdrive/c/Program Files/Java/jdk1.6.0_25/bin/jar' jar


3) Now check which executable of jar is getting executed again



Now this time it’s from the cygwin’s bin folder.
All right we are ready to try again, now this time it worked J . Simple but that did not come into my mind.. lol...



 Shortly I will write about creating Glassfish 3.1 cluster in Windows environment.

জয় আই অসম,
প্রণব শর্মা

Installing free license in NetScaler VPX Express

To download the free license, login to My Citrix using your username and password.



Go to Downloads link and select Netscaler from the Search Download by Product




Go to License section and click on Get License button.



Click on the Serial Number (this Serial Number you will get when you download the Netscaler VPX Express)



Now we have to enter the Host name of the Citrix License server, in case of Netscaler it is the MAC address of the appliance:



To find the MAC address of the Netscaler appliance, connect to Netscaler system using tool like Putty. In the Netscaler prompt, enter the command shell to go to the shell.
After you are in the shell enter the command lmutil lmhostid –ether , it will display the host ID of the machine.



Copy the host ID and paste it and click on Allocate button.



Once your license allocation process is completed, you will get a button to download the license file. Download the license file and save it in some location in your computer.




Now login to Netscaler.



Go to System -> Licenses



Click on the Manage Licenses



Click on Add button on Manage License window:



Browse and select the license that we just downloaded.



Once the license is added, click on the OK button.



Once the license is deployed, it will ask to reboot the system to apply the changes.


After reboot, my license deployment is complete, I can see that some of the disabled features are enabled now.





জয় আই অসম,
প্রণব শর্মা

MySQL :: ERROR 1005: Can’t create table (errno: 150)

While importing a MySQL dump file, I got the error MySQL :: ERROR 1005: Can’t create table (errno: 150). I wrote this document as I think it may be helpful for the new MySQL users. While running a CREATE TABLE statement if MySQL reports an error number 1005 (error message refers to error 150), it is because a foreign key constraint was not correctly formed. To find the details of the error we can see the output of innodb status.

In MySQL client run the command:


mysql> show innodb status\G 



In LATEST FOREIGN KEY ERROR we can see the details of the error.
This problem occurred because the table creation order in the dump file is not correctly ordered for foreign keys. To import a dump file which gives the above error, follow the following steps:
  1. First disable foreign key checking
    mysql> SET foreign_key_checks = 0;
  2. Import the dump file
    mysql> SOURCE dump_file_name;

    File import in process:

  3.  After import is done, enable foreign key checking again.
    mysql> SET foreign_key_checks = 1;
 That’s it, and we are done.

জয় আই অসম,
প্রণব শর্মা

namebench, the Open-source DNS benchmark utility

Today while browsing Internet, I found a nice utility namebench, which may enhance our Internet browsing speed. It is open source software and it can recommend the fastest DNS servers available for our computer. It uses web browser history, tcpdump output, or standardized datasets for running the benchmark and making the recommendation. It can be downloaded from: https://code.google.com/p/namebench/
It’s very very simple and easy to run. Download and double click on it to run.





namebench is ready for starting benchmark, include settings as per your requirement and click on Start Benchmark button to start the test.



 Test is running:



Test is completed; namebench is showing the best DNS server available for my computer:



So as per the test result, Google DNS is giving fastest result.
Also this software creates HTML report of the test.





Also it creates a CSV file with the details of the test.



So try it and find the best DNS server available for your computer.

জয় আই অসম,
প্রণব শর্মা

Monday, 22 August 2011

iLab

Project iLab at the MIT has helped in the development of remote laboratories that use real equipments that can be operated and controlled remotely through an experiment interface.

iLab enables real laboratory access through the Internet from anywhere at any time.  It can enhance science and engineering education by exposing a student into vast range of experiments which otherwise is not available for the student. ILab can be shared across a University or it can be shared across the globe. The iLab shared architecture (ISA) is a robust, scalable, open-source infrastructure built on web service. It provides a unifying software framework that can support access to a wide variety of online laboratories. Students access these remote laboratories through a simple standard administrative interface. iLab allows more efficient use of the physical laboratory equipment and give students the opportunity to conduct experiments comfortably and conveniently.
iLab Architecture:
iLab has three-tiered Client/broker/server architecture connected by a Web service.
  • Lab Server: It is operated by the lab's owner.  This server handles the actual operation of the lab hardware.
  • Lab Client: It runs on the end user's computer, and it provides the interface run the experiments in the lab.
  • Service Broker: It mediates exchanges between the Lab Client and the Lab Server. Service broker provides storage and administrative services. A single service broker can be shared by multiple labs within a single university.



 Example:

 The M.I.T. Microelectronics Device Characterization lab

 


It enables users to measure the current-voltage characteristics of various microelectronics devices remotely using a web browser.
 




(Lab Images were taken from ilab.mit.edu)


Why we need iLab:
  • More efficient use of the physical laboratory equipments.
  • Learning flexibility for the student, a student can carry out experiments from anywhere using an Internet connection. Students can perform the experiments much more quickly and comfortably.
  •  iLab can be very helpful for distance learning students.
  • Students from remote place will also be able to experiment on some devices which otherwise is not available in that place.
  •   iLab enables sharing to rare and expensive equipments. As equipment is shared, so costs are reduced.
  • Worldwide communities of scholars created around labs sharing content.
  • Sharing of the knowledge and technology generated through this.
  • The experiment configurations can also be restricted so students cannot damage devices.

জয় আই অসম,
প্রণব শর্মা

Mobile Learning..... Some possibilities with little effort and investment

From my studies in mobile learning developments and trends from past couple of months, I could arrive at the following conclusions:
  • Most of the mlearning softwares that present in the market are mainly for high end phones like Blackberry and Apple I-phones.
  • It is difficult to device an application to run in all kind of phones, because the capabilities and functionalities of different phones are different and some are very vendor specific.
  • Many organizations are building online web based applications for mobile phones as most of the mobile phones come with web browser, so that can assure that the application will run on the phones having web browser and Internet connectivity.
  •  Java ME has large market share as mobile application development platform. Many of the mobile phone comes with Java (except Apple I-phones).
  • The mlearning scenario will improve drastically on arrival of 3G/4G connectivity.

 I have studied few possibilities of Mobile Learning. Finally I could arrive at the following feasibilities:

1) Online Mobile learning framework:
We know about the famous open source learning framework Moodle. Now, Matthias Meisenberger and his team has developed an open source mobile learning system called MLE (Mobile Learning Engine) which runs as a plugin with Moodle. It is very easy to install once Moodle is configured properly. I will explain installation and configuration of MLE in my blog post. Now as a demo I have created a course named Mlearning testing course in Moodle. This course has some topics like History of MMS, Technical description MMS etc. Also I have assigned this course as mobile learning course and it will be served by MLE. Now if I open the mobile learning course in my mobile phone browser it looks like:



To access our mlearning site in mobile, open http://mobile.mkcl.org/ (right now it is disabled) in your mobile web browser.

Now I have to login with my Moodle ID/Password:



Now I am at the home page of my login. Here I can see the available courses. I can see the mLearning Testing course which is available for me.



Now if I go to the available course, I can see weekly list of contents (if you have used Moodle, you are already aware of these)




Next I can see the available contents:



Clicking the individual content link I can see the content.



The problem with accessing the content with web browser is that it is purely online, every time it needs data transfer. MLE also provides mobile phone client software for accessing the mobile learning website. The main benefit of using the client software is that we can download the content into the phone, so that we can see the content offline. The client is easy to use and can be installed in many available mobile phones as it is developed in Java (except in iphones). Also if we install the gateway server, the data transfer can be compressed.

To download the client, open the mobile learning website. In the home page, there is a link MLE install (phone software) to install the client software.

 


 It supports wide variety of vendors, select the vendor:



 Select the model number for the phone:



As I could not find my phone’s model number, so I am going to install standard generic application in my phone.



 Or I can download the java executable file and install the client later. After I installed the client application in my phone, I could see it in my phone’s application list (as MLE Moodle):



 First time when I run this application, it will ask to setup the navigation keys. Also I can save the login for my mobile learning website.



After login if I go to My Courses, the client application connects to the server



Once connected, I can see my courses:




 Reading the content:



Closing the client application:



Using the MLE plugin we could build our own online m-learning framework which is easy to use and available on all the mobile phones with web browser and internet.



2) SMS based learning:
We can use the highly popular SMS service as a learning method. University Sains Malaysia (USM) started SMS in their learning methods for postgraduate programs in School of Distance Education. What they written about the major challenge they faced in this method:
The major challenge was in the preparation of the sms content for the identified courses. Although one sms text message is constructed within 160 characters only, the message has to be constructed with pedagogical underpinnings in order to facilitate for the teaching and learning processes of the respective courses. As an initial project the messages were limited to only one per day for a five-day message week. So for now, the activities are confined to content-rich messages with notions of subject matter delivery, links to equations in their modules, reflective learning, motivational as well as instructional messages. The SMS are designed to embed learning content support to the learners as they approach their final exams.
Source: http://www.eindia.net.in/2010/awards/details/DL-ODLearning-College-Details.asp?PNo=19

To send SMS based course content I have written a sample application using open source softwares like PHP and MySQL. It can be opened using the link: http://mlearning.mkcl.org/mlearning/ (Right now it is disabled)

 

Here I can add different courses:




After adding a course I can add different contents into that course.


Now to send contents to users, we need to create users in the application. Here users are placed in different groups and contents are sent group wise.
Creating group:



Adding user:



Editing users:



Adding user into a group:



After contents, users and groups are created; we are ready to send it. We can send the content by SMS/Email or both.




SMS method can be effective, if content is properly developed (keeping in view of the 160 character limitation of SMS).



3) Mlearning content as application:
We can create course content as an application and this can be sent to a mobile phone. The most common mobile phone applications are java based applications. We can use some mobile learning authoring tools to create content applications and send it to mobile phones.
One very good mobile content author is Hot Lava Learning Mobile Author http://www.outstart.com/about-hot-lava-mobile.htm




We can create content using this application and we can export the content into different formats like Palm, PocketPC, WAP, HTML and Java. Hot Lava has a complete framework for sending content to mobile devices and then analyzing and reporting. But it’s expensive at this moment. But we can use the Learning Mobile Author for free.
I have downloaded a sample java content application for CCNA examination preparation which was developed by this Learning Mobile Author.
We can develop content using this author tool, but how we can send it to mobile phones? Well for that I used the application I developed (which I mentioned in previous step). Login to the application
and upload the jar file. For creating file content go to the link Add Content



Select the file and click on Upload button



 Once file is uploaded, we can create the file content.



After the content is created in this application, we are ready to send it to our mobile learners. Click on Send Content to send the content.



The content we can send is:
  • File content only: If we select it, only the uploaded file’s download link will be send to the learners.
  • Text content only: If it is selected, the text we added with the uploaded file will only be sent to the learners. No file downloading link will be sent.
  • Both text and file: In this case both the content text and file downloading link will be sent to the learner.
Also the send medium can be SMS/Email or both.



Now the learner will get SMS/Email for downloading the file.
Learner who do not have Internet in their mobile phone, can download the content using the link sent in the Email and can transfer the content java file into their mobile using Bluetooth or Data cable.





Learner who have Internet connection in their mobile phone can directly download the java file into their phone using the download link sent in the SMS.





After installation, I can see the application



If I open the application, it looks like






4) Mobile learning using wordpress blog application:
Wordpress is world’s most popular open source blog software. Because it is open source, many dedicated developers are working very hard to develop different plugins for wordpress to enhance the functionalities and to make it feature rich. Wordpress has plugins which can make the blog compatible for mobile phones. WordPress Mobile Pack is one of the very successful and popular plugin which can transform the blog site into a mobile blog site. For example MKCL’s marketing blog and IT support blogs are mobile blog site (http://itsupport.mkcl.org and http://marketing.mkcl.org/ ). It has alert plugins, which can send alert mail whenever new content (post) is added into the blog. Wordpress can also be utilized as a good mobile learning platform.


So these were the different possibilities we can definitely look into for our mobile learning project. Also if we can expertise in JAVA ME, we can write our customize applications as per our requirement.


জয় আই অসম,
প্রণব শর্মা