Thursday, July 26, 2012

Setting up SVN and Wiki on the one EC2 instance

As part of one of my own Android projects, I tried to configure an EC2 instance trying to setup both a wiki and subversion. Some interesting points were noted when I was trying to run the SVN standalone with svnserve service on default (Or any) port. After creating a security setting with opening the relevant inbound ports on EC2 (Like 80, 8888, 3690, 22, etc), I noted that:

1. When I was able to connect to subversion on 3690, I could not browse to the default apache hope page as it would give an error 503: "Server Temporarily Unavailable".
2. When I was able to setup the Wiki (From Bitnami), I was not at all able to telnet to the svn port (Even though I was using the SAME security group - that is the same inbound port configs).

In these two cases there were two different EC2 instances involved.

Finally, I decided to go with option 2 and instead of running the svnserve, I hosted it on Apache2 using the httpd.conf configuration file for the authentication, and repo root directory creation.

I am using Bitnami Wiki, which I secured using the LocalSetting.php file on the bitnami installation. No one can view the information at this point of time except for the registered users who are the project members. The registration option is also disabled.

Subversion is configured in Apache2's httpd config and can be accessed over HTTP instead of svn protocol. The biggest advantage is that both can be accessed from behind the proxy/firewall as they all are running on port 80. 

Wednesday, March 21, 2012

Setting up Ubuntu 11x on Dell PE

So, I thought I will give DynDNS a try and try to access my server from outside world. Once, after installing and updating my Ubuntu server, I took the following actions:

1. Registered with DynDNS and got a hostname.
2. Installed and configured SSH: openssh configuration and able to connect using putty and the external host name.

However, in order to secure the access through certificates, I had to produce the key pair from the client and in order to upload the public key, had to setup the FTP server.
3. Installation and setup the SFTPD server on Ubuntu: Took me very long. Experienced the issues such as:

3.1 sftpd.conf not available: purge the installation through apt-get command and reinstalled it.
3.2 Logging as anonymous user:
3.3 Unable to run with writeable anonymous user's home.

Tuesday, March 6, 2012

Dell PowerEdge 2950

So, I finally bought this big box from eBay and cost me AUD 1075. I got a Windows server 2003 R2 standard edition along with this big and heavy box. One fine Saturday morning I started installing the OS and failed a couple of times with the error message: "Cannot find the hard drive to install OS on". After Googling for some time, I found that there are some pre-requisite drivers missing that will create logical drives. Got this blog and tried for several hours with this and my USB stick: http://thebackroomtech.com/2008/03/13/a-dell-poweredge-server-windows-2003-x64-and-the-battle-over-sas-raid-drivers/.

Then I found a comment on the blog that said: "Eventually, I had to get a server management CD to get the installation successfully done!". Immediately, got some CDs went to the Dell site and burned it with the software, ran it and it did everything quite smoothly - Prepared for installation step by step and with the thorough GUI, then prompted for the OS CDs.

However, the 2003 R2 Standard Edition would not recognize the memory greater than 4 GB. I tried fiddling with the boot.ini including /PAE in there but no help. Finally wiped out everything and installed the Ubuntu 64 bit edition utilizing the complete hardware resources to the max! 

Saturday, July 10, 2010

MVC framework development in Swing

Not sure whether there is any like JSF/Struts kinds are there for fat client development. I thought something similar should work well with the desktop apps. Here is what I think -

Develop a framework XML schema design that will map each of the users' screen into the event source, the listener, target business component, target business method and its parameters in terms of the source screens' saved properties. The XML will look something like this -


com.pkg.gui.Source
com.pkg.gui.listener.Listener
com.pkg.model.Model
methodName
sourceProperty

outcome
com.pkg.gui.TargetScreen
fileName

.....
Several other mappings
....

The main idea is to reduce the application code and not unnecessary handling the screen flow. The developer can concentrate on - Designing the front screen, modelling the business data and the objects containing the business logic.

Once a event is detected, the registered listener's corresponding method is invoked. Inside the method, developer can simply call - Controller.invoke(this, sourceScreen); This call will get Controller to read the XML file to find out the source screen mapping. It will take the action source by the help of the event (From the listener) and based on the mapping load the corresponding business object and invoke the designated method with the designated parameter "reflectively".

There are several gray area in this - such as - how the target screen will populate the screen's property? Essentially, what I try to do here is eliminate the developer's codes like -
if (event.source is button)
then
 if button id is search
  then
    take text from this field
    make the object of this class
    invoke this method
    if (result is x)
         initialize this screen
   else
       initialize screen x
 else
  ........
Instead of all these code under ONE listener's action method, one will write - Controller.invoke(params);

However, this seems to be a much convoluted XML design game. WIP.

Tuesday, April 6, 2010

Value of Meta-Information and management in an integration project

This is the most complicated integration environment for me. This takes care of all the background financial, HR, project related transactions; all the utility business related transactions with the market and the vendors; real time information flows with the field worker and also integrates the third party service provider systems with the in-house built applications. In short most of the day-today business transactions is heavily depending on the EAI software functioning properly.

This is perhaps the most complicated integration scenario for me so far. I believe the main reason being the absence of SAP and the presence of the application silos for most of the individual functionality. Some legacy applications do not have clear information anywhere. However, this is also one of the best managed projects I have ever been . Although the integration is being done with the help of a very old version of the software, manageability and maintenance of the system is very mature and in many cases the problems are prevented rather than being dealt with.

the main reason to me why it has become so mature over the years (About 6-7 years) is the management of the pertinent information, such as:
1. Preparation of a guide for any new system administrator that comprehensively provide the information about the company, running applications, architecture, details about EACH application that is connected through EAI software.
2. An application connectivity guide with the information regarding the connectivity details for each environment.
3. An interface related guide that lists out all the interfaces and the kind of transactions they are taking care of, also listing what are the end applications they connect to individually.
4. Configuration details: A sheet that gets the information regarding the configuration in the software components. For instance, X adapter is meant to connect to system Y with the following configuration in place.
5. List of the problems encountered in the productive environment and how to resolve them - possible reason and the solution/work around.
6. A system maintenance guide that will help an administrator to figure out how to health check the system.
7. A system development guide for any new development/enhancement guidelines.
8. Most importantly, a user should know where to find what. So, a meta-information (Information of information) is handy. It may be an excel sheet in a well-known shared location or a Wiki.

These are some of the basic necessary artifacts for a decent management of the EAI software.

Monday, November 9, 2009

Riding the swing

Only because of Sun Developer exam I had to consider swing coding. Much to my disappointment though according to the assignment text use of any third party libraries was prohibited resulting no possible use of a WYSIWYG tool like NetBeans. I resorted to learning the fundamentals and going through the APIs. By the looks of the assignment I thought the implementation of the functionality that was limited to edit and read was going to be easy. Once I actually started working on that, however, I realized the complexities in JFC APIs. For instance, to create a basic Frame with Menu I do not have a handy utility class and method. For getting a parent frame from a MenuItem I do not have a straight forward one line method call. For each one of such instance, I had to write several lines of code. My toughest challenge - or should I say that the worst nightmare - was the laying out of the GUI components on  the frame using the Layout Manager. Anyhow, finally, I am able to create a few utility methods/class myself that I would be briefing on.
1. Acting on a JTable based on event on a MenuItem:
a> Register an event listener to the menu item.
b> Implement actionPerformed contract to take whatever action on the table you want.
c> Now, to obtain the table mentioned in the above point write method or a class. The way I have been doing this is writing an utility class that will take care of such concerns.

      /**
         * This method obtains the Parent Frame window of the Menu Item.

 * @param menuItem where the action was taken
* @return JFrame  parent frame
      **/


public JFrame getMainFrame(JMenuItem menuItem) {
JPopupMenu popupMenu = (JPopupMenu) menuItem.getParent();
JMenu menu = (JMenu) popupMenu.getInvoker();
JComponent component = (JComponent) menu;
JFrame frame = (JFrame) component.getTopLevelAncestor();
return frame;
}

        /**
           * Make use of the Reflection APIs and recursion to grab the wanted component from the frame
           * @param container - Container like JPanel, JScrollPane.
           *               className - Class name of the component to be obtained - javax.swing.JTable, etc
           * @return JComponent Object of the class mentioned inside the container passed.


public static JComponent getComponent(Container container, String className) throws ClassNotFoundException{
if (container != null){
Class cl = Class.forName(className);
Component[] components = container.getComponents();
for (int i = 0; i < components.length; ++i){
Component c = components[i];
if (c.getClass().getName().equals(className)){
component = (JComponent)c;
}else if (c instanceof Container){
getComponent((Container)c, className);
}
}
}
return component;
}

Now what if you need a set of several similar components? For example, grab me a list of all the text fields present inside a container.
Use the similar recursive approach with a little modification. Instead of calling this method directly, call an intercepting method. This will, after resetting the instance Collection field, in turn, call the aforementioned method that may be considered to be of private scope. Hence it would go something like this:



public List getComponents(Container container, String className) throws ClassNotFoundException{
componentList = new ArrayList(); //Reset\initialize the Collection
return getComponentList(container, className); //Call the method that internally calls itself
}


private List getComponentList(Container container, String className) throws ClassNotFoundException{
if (container != null){
Class cl = Class.forName(className);
Component[] components = container.getComponents();
for (int i = 0; i < components.length; ++i){
Component c = components[i];
if (c.getClass().getName().equals(className)){
component = (JComponent)c;
componentList.add(component);
}else if (c instanceof Container){
isRecursiveCall = true;
getComponents((Container)c, className);
}
}
}
return componentList;
}

Method to obtain the root panel (JDialog or JFrame):
public Container getMainFrame(JButton button){ Container container = button.getParent(); while(true){ System.out.println(container); if (container instanceof JFrame){ return (JFrame)container; }else if (container instanceof JDialog){ return (JDialog)container; } else{ container = container.getParent(); System.out.println("Container: " + container); } } }


Sunday, August 16, 2009

Marathon Mania

This was probably be my last MM. Like the last time, preparation was almost the same - not up to the mark. I should have gone for 35ks practice session a couple of more times and must have around 80-85k per week in the peak training periods and not just 65-70k. However, unlike the last time, I had a better race strategy and worse pair of shoes. Did not miss even a single drink station this time. Right from the beginning, gulped a glass of Getorade and 1 water. Did take some cadbury snakes this time with me. About 16 k and I could feel the thumps straight on my left foot not to mention the hurting ankle. I had the tapes in my two little fingers of my left toe to prevent them from friction and blistering that I generally encountered in my long training runs. Got Gu gel at around 17k that boosted me immediately.
At around 19k got hold of someone running at my pace and had a good chat with her for another 3k and then lost contact. At around 22-23 got 2 snakes out of my pocket and chewed them and got another boost. Drink stations helped me going easily until 30. Then applied the remaining snakes and thought this time I am gonna beat 4 hrs mark. It was St Kilda road (back) and I was quite surprised by my "strong" speed, while I was thinking how come this can end so quickly. No, it wouldn't as we took a turn towards the Kings way and up the hill towards the botanical garden - The most painful moment. I took notice of the ks left - and it was 6 MORE TO GO!! To hell with this.. and I started walking - my toe fingers were already giving me excruciating pain. When 5 left - started jogging again (after passing a drink station) and thought its just about 25 minutes of slow jog and I will be home. But, the last 5k of marathon is equivalent to first 15. During the last 2k, I had to literally drag myself to finish. After 40 I had to stop again and walk for around 5-600 meters continuously. At last could beat the last time only by 15 minutes. - 4:16:xx :( not good enough.
http://www.marathon-photos.com/scripts/event_entry.py?event=Sports/2009/Melbourne%20Marathon;match=3352

Welcome to my blogs

The contents here are my independent point of view. They reflect my thoughts, experience in my professional and social life.

Search This Blog