Pages

Sunday, December 28, 2014

LDAP Browser From Apache




The Eclipse-based LDAP browser and directory client


Apache Directory Studio is a complete directory tooling platform intended to be used with any LDAP server however it is particularly designed for use with ApacheDS. It is an Eclipse RCP application, composed of several Eclipse (OSGi) plugins, that can be easily upgraded with additional ones. These plugins can even run within Eclipse itself.

http://directory.apache.org/studio/

Open Ldap resources

Saturday, December 27, 2014

Open Source Authentication and authorization choices




Somewhere I read that OAuth is an open source alternative to Siteminder altenative.
OAuth is an open standard to authorization. OAuth provides client applications a 'secure delegated access' to server resources on behalf of a resource owner.


And OpenAM seems to be for Authentication probably for Adatptive Authentication.
OpenAM provides open source Authentication, Authorization, Entitlement and Federation software. Through OpenAM, the community actively continues development of OpenSSO.

Connect Tomcat 6 to Apache HTTP Server 2

How to Connect Tomcat 6 to Apache HTTP Server 2

Tomcat can be run as a standalone server. Tomcat can also be run as an add-on to the Apache HTTP Server (or Microsoft IIS) - as the Java servlet/JSP container. In this combination, Tomcat executes the Java servlets and JSPs, the Apache serves the static HTML pages and performs other server-side functions such as CGI, PHP, SSI, etc. Read "Why should I integrate Apache with Tomcat? (or not)" at Tomcat FAQ (http://wiki.apache.org/tomcat/FAQ/Connectors#Q3).
To configure Tomcat to work with Apache HTTP Server, you should first read the documentation provided in Tomcat thoroughly, and read the "Tomcat Connector" documents @http://tomcat.apache.org/connectors-doc.
To run Tomcat together with Apache:
  • Apache needs to load a "adapter" module, which uses a certain protocol, such as Apache JServ Protocol (AJP), to communicate with the Tomcat, via another TCP port (port 8009 in the default configuration).
  • When Apache receives an HTTP request, it checks if the request belongs to Tomcat. If so, it lets the adapter takes the request and forwards it to Tomcat, as illustrated below.
There are a few adapter modules available, such as Apache JServ Protocol (AJP) v1.2 "JServ" module (outdated), AJP v1.3 "JK 1.2" module (in use) and "JK 2" module (deprecated). I will only describe the JK1.2 module with Apache 2 here.
The step-by-step procedure is as follow:
Step 0.1: Install Apache HTTP Server - Refer to "Apache HTTP Server - How To". I shall assume that Apache is installed in directory "d:\myproject\apache", and runs on port 7000. I shall denote the apache installed directory as $APACHE_HOME.
Step 0.2: Install Tomcat - Refer to "Tomcat - How To". I shall assume that Tomcat is installed in directory "d:\myproject\tomcat", runs on port 8080. Tomcat's shall contains two web contexts: "/examples" (Tomcat's servlets and JSP examples) and "/ws" (to be created by you). I shall denote Tomcat's installed directory as $CATALINA_HOME (Catalina is the code name for Tomcat 5 and above).
Step 1: Download the Apache-Tomcat Connector Module - An Apache-Tomcat connector - JK1.2 module - which is an adapter module used by Apache to communicate with Tomcat (using AJP v1.3 protocol through TCP port 8009), can be downloaded from Tomcat mother site @ tomcat.apache.org (⇒ Download ⇒ Tomcat Connectors ⇒ JK 1.2 ⇒ JK 1.2 Binary Releases ⇒ win32 ⇒ jk-1.2.xx ⇒ "mod_jk-1.2.xx-httpd-2.2.x.so").
Rename the downloaded module to "mod_jk.so" and move into directory "d:\myproject\apache\modules".
Step 2: Configure Apache - We need to configure the Apache HTTP Server to load and initialize the JK module.
Create a configuration file called "mod_jk.conf" as follows and place it in "d:\myproject\tomcat\conf":
# Load mod_jk module
# Update this path to match your modules location
LoadModule jk_module modules/mod_jk.so

# Where to find workers.properties
# Update this path to match your conf directory location
JkWorkersFile d:/myproject/tomcat/conf/workers.properties

# Where to put jk logs
# Update this path to match your logs directory location
JkLogFile d:/myproject/tomcat/logs/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel info

# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"

# Send everything for context /ws to worker ajp13
JkMount /ws ajp13
JkMount /ws/* ajp13 

# Send everything for context /examples to worker ajp13
JkMount /examples ajp13
JkMount /examples/* ajp13
For each web context that is to be forwarded from Apache to Tomcat, include two JKMount statements as shown. In the above configuration, Apache forwards all requests to web contexts "/examples" and "/ws" to Tomcat, via a "worker" called "ajp13". (Check the URL of the Tomcat's servlet and JSP examples from the Tomcat's welcome page! It may move!)
Include the above configuration directives into the Apache's configuration by adding the following include statement at the end of "d:\myproject\apache\conf\httpd.conf":
include d:/myproject/tomcat/conf/mod_jk.conf
Note: Unix's forward slash is used as the directory separator instead of backward slash (because Apache was originally built for Unix). The include statement simply appends all the statements from the file "d:\myproject\tomcat\conf\mod_jk.conf" into "httpd.conf". (You can of course add those statements into "httpd.conf" directly.)
Next, observe that the configuration refers to a worker file called "workers.properties", and forward certain requests to a JK worker called "ajp13". Create the "workers.properties" file and place it in "d:\myproject\tomcat\conf" as follows:
# Define 1 real worker named ajp13
worker.list=ajp13

# Set properties for worker named ajp13 to use ajp13 protocol,
# and run on port 8009
worker.ajp13.type=ajp13
worker.ajp13.host=localhost
worker.ajp13.port=8009
worker.ajp13.lbfactor=50
worker.ajp13.cachesize=10
worker.ajp13.cache_timeout=600
worker.ajp13.socket_keepalive=1
worker.ajp13.socket_timeout=300
Note: The JKMount statements forward the requests to a worker called "ajp13", which is defined in this "workers.properties".
Step 3: Configure Tomcat - The default configuration in Tomcat's "conf\server.xml" starts the AJP1.3 service via the following configuration, on TCP port 8009 (remove the comments if these lines are commented out).
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
Step 4: Start the Apache with the JK module
D:\myproject\apache\bin> httpd -k install
D:\myproject\apache\bin> httpd -k start
Check the Apache's log "logs\errors.log" to confirm that JK module was started:
Starting the Apache2.2 service
The Apache2.2 service is running.
Apache/2.2.xx (Win32) mod_jk/1.2.xx configured -- resuming normal operations
Step 5: Start the Tomcat server
D:\myproject\tomcat\bin> startup
Observe that AJP1.3 service is initiated and the ajp13 worker is listening at port 8009.
....
Oct 1, xxxx 9:44:05 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Oct 1, xxxx 9:44:05 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/18  config=null
....
The order of starting up Tomcat and Apache is NOT important. Either apache or tomcat can be restarted at any time.
Step 6: Verify the Installation - Issue the following URLs to access the web contexts "/examples" and "/ws", that are defined in Tomcat (running in port 8080), but accessed via the Apache (running in port 7000).
http://hostname:7000/examples/servlets
http://hostname:7000/examples/jsp
http://hostname:7000/examples
http://hostname:8080/ws
http://hostname:7000/ws

Try Tomcat's servlet examples via Apache
Try Tomcat's JSP examples via Apache
Try Tomcat's examples via Apache
Access ws from Tomcat directly
Access ws via Apache

Source:
https://www3.ntu.edu.sg/home/ehchua/programming/howto/ApachePlusTomcat_HowTo.html


Friday, December 26, 2014

PiWik- Free Web Analytics



 piwik

Piwik is the leading open source web analytics platform.

http://piwik.org/

Coursera - Online courses


Today I came across this site CourseEra. This has lot of online courses both paid and free. The courses seem to conducted by faculties of the universities from all over the world. I just registered for one of the free course, hope it will be a pleasant learning experience.


Sunday, December 14, 2014

WhatsApp on Windows PC - Version 2


This is another version of my previous post



Previously I mentioned about YouWave which is not free. This post is about something that is completely free. Yes you can now install WhatsApp on Windows.
You would need to do following things.
1. Download and install Virtual Box from

2. Download Android 4.4 ISO from http://www.android-x86.org/download

3. Install Android on Virtual Box using the youtube video


4. Download WhatsApp Android version from 


5. Put the APK file on a USB and pull it on Android Emulator in Virtual Box.



You are done!

Sunday, November 16, 2014

My Amdocs Test

Two consultancies had scheduled me for the same day, when I got mail from both, I replied to one saying I have production support in office and will not be able to make it. I had to do it in order to avoid conflicts between them if I at all get a chance to get in later.



I rushed up on my new second-hand bike and reached in just few minutes. I thought I was just on time but there were many people and it was ok as things were not as "that tightly scheduled". There was this girl on the reception and I asked her for the contact person. The contact person herself was not available and someone else was co-ordinating on her behalf. He called me and another girl and guided us to one of their training room which they call lab. We were given a sheet which had Access Code and password. 

This was for the online test and the access-code was the unique id that belonged to me. 
(Round 1- online test-objective type-2 hour)
  • There were some sections like Aptitude, learning ability, java, j2ee, unix and sql. 
  • Some questions were like three pipes filling a volume in so and so many minutes... 
  • some questions on people sitting in a row facing north who is 3rd left to his right and 4th left etc... 
  • some questions on sets like some people are so, some people are so, now how many people are neither so and nor so...
  • Data interpretation, there was a bar graph and we had question to interpret some results like average and percentage, min, max
  • There was a passage about recovery and rescue disk and we had to answer some questions based on the passage....
  • There were also with some statements like in order to be selected for a post candidate must be of so and so age, he must be of so and so height and some more conditions. There were inference based on some conditions being true and some conditions not... we were given a case and asked to determine which inference the case fits in.
  • Some facts/conditions(typically two) were given and a problem statement was asked. To determine the solution of the problem statement whether if first fact alone is enough, whether second fact alone is enough,  neither first nor second facts are enough, both first and second are needed to solve the problem statement.
I had long back worked on some sample questions from "Competition Success" magazine, and those techniques were useful now to solve many problems.

Java section was easy, it is enough if you had read scjp book. Questions on overriding, strings immutable, exceptions, finally, final and finalize.

J2EE section was on jsp/servlets and ejbs(including session and entity).

Unix section was easy if you knew syntax of chmod, ls, grep, head, tail and working with vi editor. I could not do well here.

SQL not as easy, they were very specific to query details and all its syntax, not as ordinary as you might expect being a java developer because a question was even on TSQL syntax.

All this was to be done in 2 hours.

After the test they asked me to take a break. I rushed up to their cafetria on another floor and had a veg sandwich. 

They took lot of time almost half-hour to 45 minutes busy with handling other recruitment candidates who had come for Manual Testing, UI developer and other such positions.

Without disclosing the result of the online test they asked us to go for written test.


(Round 2- pen and paper test-1 hour)
Written test had two questions, we had to write java programs, (applying OOPs concept and nearly to compilable) with 1 hour time limit.

First question had a BlockingQueue and we had to implement enqueue and dequeue methods keeping in mind the size full and empty queue scenarios, these two operations should run indpedently and must wait for each other in case of empty or full scenarios. This was a multithreading question.

Second question was that an array has integers from 0-9 and one number is missed and one number is wrongly put in place of that missing number. So we have a missing number and a number appearing twice froma randomly arranged array of 0 to 9 integers. We need to determing missing and repeated number. 

I completed the test in 45 minutes and they asked me to leave for the day. It was almost 3:30 PM.

Hoping to be called for a face to face again. :)

Sunday, October 26, 2014

Tab Vs PC



He had said me we will shrink the computer even more and more, but I had my argument. Though the technology will keep growing over and over but there would be a limit, yes at least to the ergonomics with these devices. I still wonder how people are using those qwerty pads on blackberry and smartphones. I simply can't type, I claim it, that there is a limit to the human fingers, you can not make them small, they will be what they are and that way the Tab is something that might win the game between a smartphone and laptop. Yes, some people don’t like them to carry, but when it comes to tapping keypad they are the optimum. However, my personal experience is that Tabs still have not fully replaced laptops in terms of the features and usability. I still find myself in search for something like CTRL+F whenever I want to find some text, may be a menu option is available but that is not what I am used to. A similar thing is to select a piece of text, no, not a word but say a paragraph, you can select a word by touching and holding it, but a piece of text! you can not, I search for a cursor to place it and do the shift+drag-mouse thing. I found problem even in drag-drop when working with blogger layouts. These are few things that I can't find on a Tab. Tabs  are good to tweet and do those Facebook likes and write short comments, but for someone like me who writes a large mails and long posts on Blogspot, we would need a laptop/PC!.

Saturday, October 25, 2014

Blogger to Facebook and Twitter

There are too many accounts, facebook, twitter, instagram, flickr, blogger etc. And I was thinking if there could be something that can sync them. If I fire a post on blogger it must hit Facebook. My search got me some results, one way was through Facebook app RSS Graffiti, I was thinking to learn it. But soon I got another one, IFTTT, it is even wider and acts as the 'pipe'. My experience with it is amazing.  IFTTT stands for "If Then That" and it exactly does that. Something that one would want to try for sure if someone is messed up with too many 'channels' like me. 
IFTTT has good concepts or what it calls as recipes. You can create one or chose from many of the existing ones, chances are you will definitely find one for yourself, I chose following for twitter and one more for facebook, checked them off! Let me see if this post of mine goes automatically to update my Facebook and twitter accounts. If yes then IFTTT rocks! 


IFTTT Recipe: Send a tweet when you post something on your Blog connects blogger to twitter

Friday, October 24, 2014

Parrot Flower Power



I was just browsing around and came across this "Parrot Flower".
It claims to be a mobile app that senses your plants and gives you alert whenever they need attention.
If you are a plant lover and would like user such a gadget/device for your plants then check this out at
Parrot

Tuesday, October 14, 2014

WhatsApp on Windows

[ A new version of this post is available here]



I did not expect it. My tab stopped working. He said, "Ati har cheej ki buri hoti hai". Whatever but in just few minutes I was desperate, feeling an urge to get connected to my contacts on WhatsApp. Left office early, collected my warranty papers for the tab and reached the store.  They have redirected me to Samsung store and I need to check them up tomorrow. Meanwhile I did some research online to get WhatsApp working from Laptop and I was indeed successful.

Here are three simple steps what you might want to try.

1. Download and install YouWave.
You can get this here - http://en.softonic.com/s/whatsapp-emulator/windows-7

2. Download WhatsApp APK file, (Android Installer) - WhatsApp.apk from WhatsApp site.

3. Put it in some folder and install it on youwave.

Now youwave is sosmething on trial for 10 days, and the time is enough for you to revive some mishap.

I am just guessing if Eclipse+Android SDK Manager can also do the trick for free forever! !!