ftp task with ant

Tags

To use the ftp task with ant you would need to download the commons libraries from http://ant.apache.org/manual/install.html#commons-net

Download the binary zip, extract and copy the commons-net-2.0.jar and commons-net-ftp-2.0.jar files under your ANT_HOME/lib

and then you can have target like the following

<target name=”updateLocal”>
<ftp action=”get”
server=”10.35.25.65″
userid=”btooka”
password=”somegum”
remotedir=”/blu/app/whatever/product/blah”>

<fileset dir=”localfolder”>
<include name=”*.*”/>
</fileset>
</ftp>

Advertisements

installing svnAnt

Tags

,

first thing first… make sure you have Ant (http://ant.apache.org/) installed. Depending on the Subversion you are using, you have to download the specific version of svnAnt from http://subclipse.tigris.org/svnant.html. Download the zip file and unzip it in your local drive. Say you unzipped on C:\svnAnt, under that folder you would see the documents related to all the task available.

The important thing is, you have to make sure svnAnt related libraries are available when you execute ant and using svnAnt related stuffs. Personally I don’t like jar all over the places so I put the needed jars under ANT_HOME/lib. So copy svnant.jar, svnClientAdapter.jar and svnjavahl.jar and put them under ANT_HOME/lib.

You are set. Start writing your ant script with the following within the project element

<!–  Set-Up of svnAnt classpath  –>
<path id=”svnant.classpath”>
<fileset dir=”${lib.dir}”>
<include name=”**/*.jar” />
</fileset>
</path>

<!–   Loading of SVN task  –>
<typedef resource=”org/tigris/subversion/svnant/svnantlib.xml” classpathref=”svnant.classpath” />

Example of a build script

<?xml version=”1.0″?>
<!– build file used to checkin or commit svnant’s sources –>
<project name=”testsvnant” basedir=”.” default=”clean”>

<!–  all properties are in build.properties –>
<property file=”build.properties” />

<!–  Set-Up of svnAnt classpath  –>
<path id=”svnant.classpath”>
<fileset dir=”${lib.dir}”>
<include name=”**/*.jar” />
</fileset>
</path>

<!–   Loading of SVN task  –>
<typedef resource=”org/tigris/subversion/svnant/svnantlib.xml” classpathref=”svnant.classpath” />

<!–  removes the folder source_latest and all of it’s content –>
<!–  this will remove the latest of the View from where you are running this script –>
<target name=”clean”>
<delete dir=”source_latest”/>
</target>

<target name=”getLatest”>
<svn username=”${svn.username}” password=”${svn.password}”>
<checkout url=”${svn.source.url}” revision=”HEAD” destPath=”source_latest” />
</svn>
</target>

<target name=”updateLocal”>
<svn username=”${svn.username}” password=”${svn.password}”>
<checkout url=”${svn.source.url}” revision=”HEAD” destPath=”source_latest” />
</svn>
</target>

</project>

and your build.properties would look something like

svnant.version=1.2.1

# —————————————————————————–
# all jars needed
# —————————————————————————–
lib.dir=D:/apacheANT/lib

# —————————————————————————–
# SVN connection detail
# —————————————————————————–
svn.view.url=http://blah.svnserver.net/svn/repos/view/trunk
svn.username=btooka
svn.password=somegum

Install and Configure Adroid Plugin for Eclipse

Tags

Install the Android Plugin for your Eclipse by

  1. Select Help > Software Updates….
  2. In the dialog that appears, click the Available Software tab.
  3. Click Add Site…
  4. Enter the Location: https://dl-ssl.google.com/android/eclipse/ If you get any error getting the plugin, try using “http” in the Location URL, instead of “https”. Click OK.
  5. Back in the Available Software view, you should see the plugin listed by the URL, with “Developer Tools” nested within it. Select the checkbox next to Developer Tools and click Install…
  6. On the subsequent Install window, “Android DDMS” and “Android Development Tools” should both be checked. Click Next.
  7. Read and accept the license agreement, then click Finish.
  8. Restart Eclipse.

If you are still unable to use Eclipse to download the ADT (Android Developer Tool) plugin as a remote update site, you can download the ADT zip file to your local machine and manually install it:

  1. Download the ADT zip file (do not unpack it).
  2. Select Help > Software Updates….
  3. In the dialog that appears, click the Available Software tab.
  4. In Eclipse 3.3, click New Archive Site….
  5. In Eclipse 3.4, click Add Site…, then Archive…
  6. Browse and select the downloaded zip file.
  7. Back in the Available Software view, you should see the plugin listed by the URL, with “Developer Tools” nested within it. Select the checkbox next to Developer Tools and click Install…
  8. On the subsequent Install window, “Android DDMS” and “Android Development Tools” should both be checked. Click Next.
  9. Read and accept the license agreement, then click Finish.
  10. Restart Eclipse.

Boom! You are done.

How NOT to get laid off

The little things you do above and beyond your job description will serve you well when it’s performance appraisal and/or downsizing time. Forget your fancy title, your impressive résumé—and your ego.

A very nice article http://finance.yahoo.com/career-work/article/107228/how-not-to-get-laid-off.html

My personal favorites are:

  • Become a Black Belt at Change
  • Walk Away from the Water Cooler
  • Step Up—and Wear Very Big Shoes
  • Start Tweeting or Start Packing

Logging in BI Publisher

BI Publisher log sucks! Even if you turn the log level to DEBUG, the stupid thing doesn’t log anything in the application log or any where. Here is one way I found out that prints useful information.

Step 1

CD to jdk/jre/lib folder under your BI Pub home folder. Example:

cd /mount01/app/oracle/product/bipub/jdk/jre/lib

Step 2

Create a file named xdodebug.cfg file with the following 2 lines:
LogLevel=STATEMENT
LogDir=/mount01/app/oracle/product/bipub/debug

Step 3

Create the debug folder under /mount01/app/oracle/product/bipub/ and restart the BI Publisher server.

5 types of log files will be created depending on what you run but there will be at least one called xdo.log and that’s the guy that will give you information about almost every little detail about your report.

CAUTION: Keep in mind this file will get huge if you left BI Pub running with this being turned on.

Another interesting log I found was the log file under opmn. Example: /mount01/app/oracle/product/bipub/opmn/logs

the log file name will be different based where your xmlpserver is installed. Example name default_group~home~default_group~1.log

Oracle Portal Restart Process

Tags

Cleanest and safest way to restart Oracle Portal environment

Shutdown the portal with the following sequence:

  1. Web Cache server – command > opmnctl stopall
  2. Portal App server – command > opmnctl stopall
  3. SSO server – command > opmnctl stopall
  4. Infrastructure server – commands > opmnctl stopall
  5. Stop the database (the one portal depends on) and listener

 

Startup the portal with the following sequence:

  1. Start the database (the one portal depends on) and listener
  2. Infrastructure server – commands > opmnctl startall
  3. SSO server – command > opmnctl startall
  4. Portal App server – command > opmnctl startall
  5. Web Cache server – command > opmnctl startall

Adjusting to a new work environment

Tags

First of all, congratulation! Unless you are working for a mom and pop shop, more than one individual have evaluated you and their conclusion was that you are the fittest person among all the people who applied for the position. So you are the winner, you are the best and you deserve nothing less.

DISCLAIMER: This note is for me. Mostly to remind myself of what worked for me.

So what you need to do or have are:

1. Be confident

If you don’t have the self confidence you would sound and look pale, pathetic, unreliable, not cool or whatever the heck you want to call.

  • Dress and carry yourself proudly.
  • Smile

2. Don’t blow your horn

  • Don’t try to go into you are the next hot shot in town or something. It doesn’t help to antagonize your new colleagues. I hate it. You would hate it too when someone does it. So why do it? There are thousands of ways to prove your worthiness.

3. Listen more than you normally do and understand the company culture

  • This thing works like a magic all the time, at least in my experience. People are more receptive and they become your friends fast.
  • Ask questions, you will learn and it will show your interest.
  • Take notes and when you get some time draw a picture of what things or what processes are in what place and how they are tied.
  • If the business is totally different from what are used to it may take some time to understand different business processes. So ask for details, ask for examples. You maybe technically cool but without the domain knowledge you won’t be able to apply those “cool stuff”.

4. Don’t procrastinate

  • Organize and don’t delay on this you will notice you are not stressed out and everyone around you would think your are a freakN speeding bullet or a torpedo.
  • Believe in the 8 hour work. If you truly believe you have 8 hour a day to do your work, you would be chopping off stuffs from your to get things done. Your boss and his boss would take you as a very aggressive guy who gets things done.

5. Try to put yourself in your boss’s position and help him out

  • He needs you not because he wants to manage you. He needs you because he has “stuffs” to get done. That’s why you exist. Work on get the “stuffs” done.
  • Send an email every week with a status like notes saying what you accomplished this and what you plan to do next week. Your boss will fall in love with you.  Ok you can take it however the heck you want it.

6. Build trust and work on setting reputation

  • It will take some time but if you work on the aforementioned stuffs this will be taken care off.

7. Don’t take sides

  • This is a killer. I have experience with this and I am not gonna mention the workplace or the names.
  • Everybody hates those little groups within a group.

8. Show the positive energy

  • Everybody loves to be around the positive and the optimistic guy.
  • If you become the guy that everyone loves to hang around with, then you become influential. No one has to vote but you become the leader.
  • Everyone should feel the “jolt” when they talk with you. You should be the source of that positive energy.

Installing JSF 1.2 on apache-tomcat

Tags

Installing JSF 1.2 on the latest apache-tomcatAnd test a Hello World type application 

Download

To run JSF 1.2, you would require Servlet 2.5 and JSP 2.1 compliant container. So we will install Tomcat 6.0 or above. We will also install the JSTL because JSF development requires it.

So what we need:

1.      apache-tomcat-6.0 or up (http://tomcat.apache.org/download-60.cgi)

2.      JSF 1.2 (https://javaserverfaces.dev.java.net/files/documents/1866/87641/mojarra-1.2_08-FCS-binary.zip)

3.      JSTL (http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi)

Install

Step 1. Extract the downloaded zip file (apache-tomcat-6.0 or up) under the C:\ root folder.

Step 2. Create folders related to test our JSF installation or more precisely JSF web application

a)      Create a directory jsftest under c:\apache-tomcat-6.0\webapps

b)      Create a directory called WEB-INF under c:\apache-tomcat-6.0\webapps\jsftest

c)      Create directories called “classes” and “lib” under c:\apache-tomcat-6.0\webapps\jsftest\WEB-INF

d)      Create a file called web.xml under c:\apache-tomcat-6.0\webapps\jsftest\WEB-INF with following content

<?xml version=’1.0′ encoding=’UTF-8′?>

<!DOCTYPE web-app PUBLIC

“-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN”

“http://java.sun.com/dtd/web-app_2_3.dtd”>

<web-app>

      <!– Faces Servlet –>

      <!– We are defining the Faces Servlet here –>

      <servlet>

      <servlet-name>Faces Servlet</servlet-name>

      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

      <load-on-startup> 1 </load-on-startup>

      </servlet>

      <!– Faces Servlet Mapping –>

<!–All requests with .jsf will be mapped Faces Servlet –>

      <servlet-mapping>

      <servlet-name>Faces Servlet</servlet-name>

      <url-pattern>*.jsf</url-pattern>

      </servlet-mapping>

</web-app>

e)      Create a JSF specific file called faces-config.xml under c:\apache-tomcat-6.0\webapps\jsftest\WEB-INF and copy paste the following for now

<?xml version=’1.0′ encoding=’UTF-8′?>

<!DOCTYPE faces-config PUBLIC

“-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN”

“http://java.sun.com/dtd/web-facesconfig_1_1.dtd”>

<faces-config>

</faces-config>

Step 3. Extract the downloaded JSF zip file (mojarra-1.2_08-FCS-binary.zip) into some temp or whatever folder you prefer. After extracting, copy the following jars into c:\apache-tomcat-6.0\webapps\jsftest\WEB-INF\lib

a)      jsf-api.jar

b)      jsf-impl.jar

Step 4. Extract the downloaded JSTL zip file (mojarra-1.2_08-FCS-binary.zip) into some temp or whatever folder you prefer. After extracting, copy the following jars into c:\apache-tomcat-6.0\webapps\jsftest\WEB-INF\lib

a)      jstl.jar

b)      standard.jar

A little more on Step 3 and Step 4: Of course one way to make jars available to a web application is to place them into WEB-INF\lib folder of the web application. If you have several web applications and they all want to use some common jars, you can put the jar files into a common location and that common location for Tomcat is c:\apache-tomcat-6.0\common\lib. Important thing to remember is if you copy the JAR files into the common directory while the server is running, you may need to restart the Tomcat server so the new JAR files can be loaded.

Step 5. Create an index.jsp file and save it under c:\apache-tomcat-6.0\webapps\jsftest directory and type the following

<jsp:forward page=”test.jsf”/> <%– this would just forward the request to test.jsf –%>

Step 6. Create a test.jsf under the same directory (c:\apache-tomcat-6.0\webapps\jsftest) and type the following content

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>

<%@page language=”java” contentType=”text/html; charset=ISO-8859-1″ pageEncoding=”ISO-8859-1″%>

<%@taglib uri=”http://java.sun.com/jsf/core” prefix=”f”%>

<%@taglib uri=”http://java.sun.com/jsf/html” prefix=”h”%>

<html>

<head>

            <title>register</title>

</head>

<f:view>

            <body>

           

                        <h:outputText value=”JSF page loaded successfully!”/>

           

            </body>

</f:view>

</html>

Step 7. To test the jsf page (and the application), start tomcat and then type in http://localhost:8080/jsftest/

Your browser would show a page saying

JSF page loaded successfully!

DONE! 

Extra:

Running Tomcat 6 with Eclipse and JSF

http://www.crazysquirrel.com/computing/java/jsf/eclipse-with-tomcat-6-and-jsf-1-2.jspx

Job Searching

Tags

After hibernating in the job market for 8 years, I decided to get out and sense how things are now a days. I think it’s a very good idea, regardless if you want to leave your current job or not, to keep your resume updated and go for interviews at least once a year. I say this because of 3 reasons:

  1. You will get better in your interview skills
  2. The process of looking for a job and scoring an interview will force you to create and maintain a useful network
  3. You will get an honest appraisal of yourself (your skill sets)

Interview Skills:

This is more than just being able to answer what an EJB is or how to construct an inner class in Java. Organizations that are serious about values, forward looking and sophisticated are more inclined to hire people with “people skills”. Yea… don’t give me shit about Office Space’s “people skills” interview dialog. Those days of 1999-2000 are gone. You need a hair cut, brush your teeth and a proper attire. If you want to be a nerd or that cool geek, be my guest and chances are you would be looking for a job forever. If you have one already, you would never be promoted and when the time comes to reshuffle you would be the first one to go. If you found some “gig” and you think you are making a good progress, chances are the organization you work for is a small one or financially it’s not doing very good. Businesses now a days need people who can imagine and create solutions to a problem vs. solving a problem. And, if you are a “desi” (Indian, Pakistani, Bangladeshi, etc) like myself, we really need a lot of people skills :-). Of course, not all “desis” are same but a good majority would require a lot of changes. Here is a good site to work on your interview skills http://jobsearch.about.com/od/interviewsnetworking/a/wininterview.htm

Networking:

I don’t think I need to explain a lot on this. A good majority of you should know the importance of it and if you don’t I feel sorry for you. Go to all the local user group meetings that are some how tied to your job. Talk with people when you get out. Be the first one to introduce your self. Don’t hang up the phone when a recruiter calls you but don’t try to rely on them either. Use them find out the trend of the market, organizations that are hiring, etc. Find out about their policies before sharing all kinds of information. Be clear on what exactly you are looking for. Once again, don’t rely too much on them. Keep in touch with your old friends, old coworkers and even the contractors. Be nice with all of them all the time. You never know when you would need someone’s help. I was called by a very large organization for an interview because a contractor who worked with me a while back said good things to his friend who worked for that company. Strange thing is I happened to keep in touch with him via email once a year and he still cared and respected me. Online tools such as linkedin (www.linkedin.com) would help you a lot to create and manage your network. Give it a try and you will see what I mean. No… I don’t get any commission from that site.

Appraisal of skill sets:

This is not just about what you are worth in the market now a days. You will find out what you are missing, what you need to learn or know more, what is hot what is not, etc. So don’t get disheartened by rejection, take everything about the job searching process as a learning opportunity. If you do the gap analysis like, where you are in your career and where you want to go or what you have and what more you want, you will stay current with the market and well ahead of the average guys around you. Once again, skills are not just all the latest open source tools under Apache or Sourceforge. Learn all the latest about different development methodologies, if you are in the software industry. Learn about all leadership skills. Learn to imagine, think of multiple adaptable solutions to a problem. There is a difference between just solving a problem vs. creating solutions to a problem. Businesses can and (more likely) will pay cheap Indian Rupee or Chinese Yuan to solve a problem with functional specs. They will need top dollar earning Solutions Architects to imagine, who understand, think and talk both business and tech, who can provide futuristic solutions that are not time dependant, who can provide solutions that are dynamic. Now if you still think being a geek is cool, you can take care of “stuffs” and get “shit” done, once again be my guest, prove yourself. I haven’t seen a millionaire geek lately.

Cool job site:
http://www.indeed.com