Tuesday, January 17, 2012

35 Tips To Make This Your Best Year Yet by Robin Sharma




I'm sitting on an airplane thinking about what the best performers and most successful people do to continually outperform everyone around them.

As we enter what I hope will be the single best year of your life yet, I've come up with 35 Tips that I invite you to concentrate on. Share these tips, reflect on then, post them where you can see them - and allow them to infuse your mindset:

  1. Remember that the quality of your life is determined by the quality of your thoughts.
  2. Keep the promises you make to others - and to yourself. 
  3. The project that most scares you is the project you need to do first. 
  4. Small daily improvements are the key to staggering long-term results. 
  5. Stop being busy being busy. This New Year, clean out the distractions from your work+life and devote to a monomaniacal focus on the few things that matter.
  6. Read "The War of Art". 
  7. Watch "The Fighter". 
  8. In a world where technology is causing some of us to forget how to act human, become the politest person you know. 
  9. Remember that all great ideas were first ridiculed. 
  10. Remember that critics are dreamers gone scared. 
  11. Be "Apple-Like" in your obsession with getting the details right. 
  12. Take 60 minutes every weekend to craft a blueprint for the coming seven days. As Saul Bellow once said: "A plan relieves you of the torment of choice."
  13. Release your need to be liked this New Year. You can't be a visionary if you long to be liked. 
  14. Disrupt or be disrupted. 
  15. Hire a personal trainer to get you into the best shape of your life. Superstars focus on the value they receive versus the cost of the service.
  16. Give your teammates, customers and family one of the greatest gifts of all: the gift of your attention (and presence).
  17. Every morning ask yourself: "How may I best serve the most people?" 
  18. Every night ask yourself: "What 5 good things happened to me this day?" 
  19. Don't waste your most valuable hours (the morning) doing low value work. 
  20. Leave every project you touch at work better than you found it. 
  21. Your job is not just to work. Your job is to leave a trail of leaders behind you. 
  22. A job is not "just a job". Every job is a gorgeous vehicle to express your gifts and talents - and to model exceptionalism for all around you.
  23. Fears unfaced become your limits. 
  24. Get up at 5 am and take 60 minutes to prepare your mind, body, emotions and spirit to be remarkable during the hours that follow. Being a superstar is not the domain of the gifted but the prepared.
  25. Write love letters to your family. 
  26. Smile at strangers. 
  27. Drink more water. 
  28. Keep a journal. Your life's story is worth recording. 
  29. Do more than you're paid to do and do work that leaves your teammates breathless. 
  30. Leave your ego at the door every morning. 
  31. Set 5 daily goals every morning. These small wins will lead to nearly 2000 little victories by the end of the year.
  32. Say "please" and "thank you". 
  33. Remember the secret to happiness is doing work that matters and being an instrument of service. 
  34. Don't be the richest person in the graveyard. Health is wealth. 
  35. Life's short. The greatest risk is risk-less living. And settling for average.
I genuinely wish you the best year of your life. 

Stay Great.

Tuesday, January 25, 2011

Tomcat Clustering

Open Source Load Balancing Softwares

Nice post about LB softwares and I found this on a good blog http://linuxpoison.blogspot.com/

 Linux Virtual Server

The Linux Virtual Server Project is a project to cluster many real servers together into a highly available, high-performance virtual server. The LVS load balancer handles connections from clients and passes them on the the real servers (so-called Layer 4 switching) and can virtualize almost any TCP or UDP service, like HTTP, HTTPS, NNTP, FTP, DNS, ssh, POP3, IMAP4, SMTP, etc. It is fully transparent to the client accessing the virtual service.
Homepage:
http://www.LinuxVirtualServer.org/

BalanceNG

BalanceNG is a modern software IP load balancing solution. It is small, fast, and easy to use and setup. It offers session persistence, different distribution methods (Round Robin, Random, Weighted Random, Least Session, Least Bandwidth, Hash, Agent, and Randomized Agent) and a customizable UDP health check agent in source code. It supports VRRP to set up high availability configurations on multiple nodes. It supports SNMP, integrating the BALANCENG-MIB with Net-SNMPD. It implements a very fast in-memory IP-to-location database, allowing powerful location-based server load-balancing.
Homepage:http://www.inlab.de/balanceng/

HAproxy 

HAproxy is a high-performance and highly-robust TCP and HTTP load balancer which provides cookie-based persistence, content-based switching, advanced traffic regulation with surge protection, automatic failover, run-time regex-based header control, Web-based reporting, advanced logging to help trouble-shooting buggy applications and/or networks, and a few other features. Its own event-driven state machine achieves 20,000 hits per second and surpasses GigaEthernet on modern hardware, even with tens of thousands of simultaneous connections.
Homepage:
http://haproxy.1wt.eu/

Pen

Pen is a load balancer for "simple" TCP-based protocols such as HTTP or SMTP. It allows several servers to appear as one to the outside. It automatically detects servers that are down and distributes clients among the available servers. This gives high availability and scalable performance.
Homepage:
http://siag.nu/pen/

Crossroads Load Balancer

Crossroads is a daemon running in user space, and features extensive configurability, polling of back ends using wake up calls, status reporting, many algorithms to select the 'right' back end for a request (and user-defined algorithms for very special cases), and much more. Crossroads is service-independent: it is usable for any TCP service, such as HTTP(S), SSH, SMTP, and database connections. In the case of HTTP balancing, Crossroads can provide session stickiness for back end processes that need sessions, but aren't session-aware of other back ends. Crossroads can be run as a stand-alone daemon or via inetd.
Homepage:
http://crossroads.e-tunity.com/

Balance

Balance is a simple but powerful generic TCP proxy with round-robin load balancing and failover mechanisms. Its behavior can be controlled at runtime using a simple command line syntax. Balance supports IPv6 on the listening side, which makes it a very useful tool for IPv6 migration of IPv4 only services and servers.
Homepage:
http://www.inlab.de/balance.html

Distributor load balancer

Distributor is a software TCP load balancer. Like other load balancers, it accepts connections and distributes them to an array of back end servers. It is compatible with any standard TCP protocol (HTTP, LDAP, IMAP, etc.) and is also IPv6 compatible. It has many unique and advanced features and a high-performance architecture.
Homepage:
http://distributor.sourceforge.net/

Pure Load Balancer

Pure Load Balancer is a high-performance software load balancer for the HTTP and SMTP protocols. It uses an asynchronous non-forking/non-blocking model, and provides fail-over abilities. When a backend server goes down, it automatically removes it from the server pool, and tries to bring it back to life later. Pure Load Balancer has full IPv6 support and works on OpenBSD, NetBSD, FreeBSD and Linux.
Homepage:
http://plb.sunsite.dk/

Load Balancer Project

The Load Balancer Project is a tool that allows you to balance requests using clusters of servers. The goal is to achieve high availability load balancing with a simple configuration for the load balancer and the network topology. It leaves the servers untouched so the configuration only resides on the load balancer, and it allows you to manage any type of service via a plugin model design and a transparent proxy feature.
Homepage:
http://www.jmcresearch.com/projects/loadbalancer/

mod_athena

mod_athena is an Apache-based application load balancer for large systems. It allows the HTTP server to act as a load balancer either internally to Apache's own mod_proxy (for reverse proxying), or externally to machines querying it. Arbitrary statistics are sent to the engine via a simple GET plus query-string interface, from which it will then make decisions based on chosen algorithms.
Homepage:
http://ath.sourceforge.net/

udpbalancer 

Udpbalancer is a reverse proxy that sorts UDP requests from your clients to your servers. It may operate in round-robin, volume balance, and load balance modes.
Homepage:
http://dev.acts.hu/udpbalancer/

MultiLoad

MultiLoad is a load balancer that redirects HTTP requests to pre-defined servers/locations. It gives the provider a way to balance the traffic and hides the real download location. It allows you to manage different version of each download. It is also a load balancing server extension. You can distribute files on some servers so that a downloaded file can be loaded form different servers. These servers can have different priorities to control the active traffic.
Homepage:
http://download.laukien.com

Tuesday, January 18, 2011

Hibernate Connection Fails if there is Database inconsistency or DB fail-over (Oracle RAC)

        /**
     * A static method with returns Hibernate Sessoin Object.
     *
     * @return {@link Session}
     */
    public static Session getSession() throws HibernateException {
        Session appSession = sessionFactory.openSession();
        try
        {
                if(appSession.connection().isClosed()||!appSession.isConnected()||!appSession.isOpen()){
                        System.out.println("Session Closed, Creating Session again...");
                        appSession.reconnect(appSession.connection());
                }
        }
            catch (Exception e) {
                System.err.println("Got Problem while getting Session from Factory:"+ e.getMessage());
                e.printStackTrace();
            }
        return appSession;
      
    }

Sunday, January 16, 2011

Printing CLOB Object Data in JSP

<tr>
                <td>
                        <PRE><%String line;
                                if (docObj != null) {
                                    BufferedReader in = new BufferedReader(docObj.getDocument().getCharacterStream());
                                    line = in.readLine();
                                    while (line != null) {
                                        line = line.replace(">", "&gt;");
                                        line = line.replace("<", "&lt;");
                                        out.println(line);
                                        out.flush();
                                        line = in.readLine();
                                    }
                                }
                            %>
                         </PRE>
                </td>
            </tr>