Thursday, November 26, 2015

VMware vfabric web servers and tc servers to start when system boot

It is very important to start the tomcat services when a virtual machine power on automatically.

I have worked on this for our application to start up when ever there is a power on. On the VMware esxi host we can add a virtual machine to power on automatically when host restarts.

After starting the virtual machine the tomcat service in the server was not starting in our case. So, I followed VMware documentations and listed the important commands to do the same task here.

The following are the steps to make the tomcat or web services to start automatically when a virtual machine starts.

We need to create a tomcat user  with sudo permissions

adduser tcserver sudo

Make him owner for all files and sub directories of CATALINA_HOME

Edit
CATALINA_HOME/bin/init.d.sh

Modiy
TC_RUNTIME_USER="tc-server" to TC_RUNTIME_USER="tcserver"

Link the init.d.sh to /etc/init.d/{servicename}

ln -s /var/opt/vmware/vfabric-tc-server-standard/tcserver/bin/init.d.sh \ /etc/init.d/tcserver

After that we can test the service is working or not just by
To start the server instance
/etc/init.d/tcserver start
To  get status the server instance
/etc/init.d/tcserver status
To restart the server instance
/etc/init.d/tcserver restart 
To staop the server instance
/etc/init.d/tcserver stop
 
This is important after above to start the instance on boot we need to update the rc.d add the service instance to defaults
update-rc.d webserver defaults 
 
Note : CATALINA_HOME =  /var/opt/vmware/vfabric-tc-server-standard/MyInstance/

For webservers I just made the link and updated the rc.d and it just works fine.

# ln -s /var/opt/vmware/vfabric-web-server/webserver/bin/httpdcl  /etc/init.d/webserver
# update-rc.d webserver defaults

Wednesday, November 25, 2015

How to ReadMessages from usb modem using sms-lib in ubuntu system

This week I worked on Reading messages from USB modem with the help of smslib library.

The prerequisites

1) USB modem details
Manufacturer: ZTE CORPORATION
Model: MF190

2) SIM : Tata docomo

3) Ubuntu i386 laptop

For windows users you can follow this blog
http://gsmmodemtutoialbysamyan.blogspot.in/2013/12/what-is-gsm-modem-gsm-modem-specialized.html?showComment=1448442361213

The process I am sharing is similar to the process mentioned in above blog

The only change is 2nd step
In Linux environments we need to copy "libLinuxSerialParallel.so" to jdk/bin and jre/bin
This file you can find in java comm api of oracle, file is "comm3.0_linux.zip"





Change the javax.comm.properties in my case the paths are

 # Paths to server-side serial port devices
serpath0 = /dev/ttyUSB2
serpath1 = /dev/ttyUSB1

Then after the steps are similar add smslib.jar and log4j.jar to your project and Run ReadMessages.java

While running the ReadMessages.java you may get stringindexoutofboundsexception it can be solved by setting actual message storage location i.e., either SM or SR or ME or MD.
In my case it is ME

this is the method to be used in smslib to set the storage location
gateway.getATHandler().setStorageLocations("ME");
The total files can be found in this link
https://dl.dropboxusercontent.com/u/87378162/SMSlib-requiredfiles.tar.gz

The java project I implemented can be downloaded from here
https://dl.dropboxusercontent.com/u/87378162/USBModem.zip

Thursday, November 19, 2015

Providing two Way authentication for VMware Horizon view server with freeradius and google authenticator

This week I worked on the 2 way authentication for vmware horizon view server by following the document

http://blogs.vmware.com/consulting/files/2015/02/VMW_15Q1_TD_Horizon-View-Google-Authenticator_021715_FINAL_EMonjoin.pdf

shared by

I followed the document thoroughly one small change in the installation step is currently likewise-open is not available from the repos. We need to install pbis
for that I followed below url

http://askubuntu.com/questions/452904/likewise-open-14-04-other-easy-way-to-connect-ad

for some configuration settings some resources helped me I want to share them here
https://community.spiceworks.com/how_to/80336-join-ubuntu-14-04lts-to-a-windows-domain-using-pbis-open