Bharat Banate's Work Profile

View Bharat Banate's profile on LinkedIn

Monday, March 24, 2008

Crontab : Scheduling Tasks

Crontab permits to schedule tasks on your computer. For example you can program a safeguard every month on the 13th, or administrative tasks such as booting tasks (checking emails, log off network stations , etc...).
Keywords: @annually , @daily , @hourly , @midnight , @monthly , @reboot , @weekly , @yearly , command , cron.allow , cron.deny , crontab , Scheduling tasks , user .

We first notice that crontab stands out the at utility. Indeed crontab permits to schedule tasks, that is to say repetitive tasks, whereas at only executes one task.

Allow a user to use crontab


My username is nadir. First you have to allow nadir to use the crontab command. We log in as root and we check if the /etc/cron.allow file exists. If it exists, add the user nadir in the file, if it does not exist create it and add the user nadir.
root@ipower:~# nano -w /etc/cron.allow

or write (vi,gedit, nedit, kwrite, etc...) and fill out the file accordingly.

From now on, the nadir user is allowed to use crontab. So it is possible to specify who are the (users) allowed to use crontab and those who are not allowed. To do that, we use the /etc/cron.allow and /etc/cron.deny files.

If the /etc/cron.allow file exists, only the users mentioned will have the right to use the cron command.

If the /etc/cron.allow file does not exist, it is the /etc/cron.deny file which is taken into account: the mentioned users will not have the right to use the cron command.

If neither of the two files exists, only the super user (root) will have the right to use the cron command.

Note: an empty /etc/cron.deny file means that all the users can use the cron commande.

Use of crontab


Once the nadir user is allowed, this one is able to use crontab. Using the crontab -l option, list the current tasks:
nadir@ipower:~$ crontab -l no crontab for nadir

We can clearly see that no task is defined. Well, it is now or never!

First of all, create a task file
nadir@ipower:~$ crontab -e

Now you had to fill out it. The syntax is: m h dom mon dow command
- m forminute between 0 and 59
- h for hour between 0 and 11
- dom for day of month between 1 and 31
- mon for month between 1 and 12
- dow for day of week between 0 and 7, sunday is represented by 0 or 7, monday by 1, etc ...
- command to execute the command.

Now, take an interest in some special characters (metacharacters) :
- *, if one of the m h dom mon dow fields owns the * character, then it indicates evey minute or evey hour or every day or every day of the month or every month or every day of the week, it depends on which field is placed *.
- / permits to specify a repetition.
- - permits to define a range.
- , permits to specify several values.

Some examples:

*/5 * * * * command to execute a command every 5 minutes.

0 22 * * 1-5 command to execute a command every day, monday to friday, at 10 p.m.

17 19 1,15 * * command means the first and the fifteenth day of the month at 19h17 (7.17 p.m.)

23 0-16/2 * * * command means every 2 hours at the twenty-third minute, between midnight and

Monday, February 4, 2008

How to use java in OPEN Source....

Java Open Source Workflow
Enhydra Shark
The Enhydra Shark project delivers an Open Source Java workflow server with a difference. It is an extendable and embeddable Java open source workflow engine framework including a standard implementation completely based on WfMC specifications using XPDL (without any proprietary extensions !) as its native workflow process definition format and the WfMC "ToolAgents" API for serverside execution of system activities. Every single component (persistence layer, transaction manager, scripting engines, process repository,...) can be used with its standard implementation or extended/replaced by project specific modules.


Enhydra JaWE
Enhydra JaWE (Java Workflow Editor) is the first open source graphical Java workflow process editor fully according to WfMC specifications supporting XPDL as its native file format. It can be used to edit / view every XPDL file which conforms to WfMC XPDL specifications , does NOT use any proprietary XPDL extensions and is available in English, German, French and Serbian language already. Advanced features like the consistency validation and guided property editor dialogs for all XPDL objects make it really easy to create valid XPDL files. The representation of workflow participants as "swimlanes" in the editor graphics gives a comprehensive overview of process responsibilities.


Home
Enhydra.org Sucess Stories

Versicherungs-Vergleich.at is using Enhydra Application Server and Enhydra Shark Workflow to develop its new base software for online insurance comparisons.

etenso GmbH in Germany uses Enhydra Server to implement a knowledge and information management product and wins the ObjectWeb Award ! Read more...

AKBANK in Turkey uses Enhydra Shark and Enhydra JaWE with support from Together for approval mechanisms in retail banking. Read more...

OpenUSS uses Enhydra Enterprise to serve thousands of students worldwide.

OfBiz uses Enhydra Shark as their internal workflow engine with thousands of users worldwide.

GrECo International AG succesfully deployed Enhydra Snapper in their LAN, integrated the fulltext indexing / search and the document previewer into their insurance broking application "BroSys" and GrECo users search in about 2.2 million documents in fragments of seconds !

Java Open Source Workflow

Enhydra Shark

The Enhydra Shark project delivers an Open Source Java workflow server with a difference. It is an extendable and embeddable Java open source workflow engine framework including a standard implementation completely based on WfMC specifications using XPDL (without any proprietary extensions !) as its native workflow process definition format and the WfMC "ToolAgents" API for serverside execution of system activities. Every single component (persistence layer, transaction manager, scripting engines, process repository,...) can be used with its standard implementation or extended/replaced by project specific modules.


Enhydra JaWE
Enhydra JaWE (Java Workflow Editor) is the first open source graphical Java workflow process editor fully according to WfMC specifications supporting XPDL as its native file format. It can be used to edit / view every XPDL file which conforms to WfMC XPDL specifications , does NOT use any proprietary XPDL extensions and is available in English, German, French and Serbian language already. Advanced features like the consistency validation and guided property editor dialogs for all XPDL objects make it really easy to create valid XPDL files. The representation of workflow participants as "swimlanes" in the editor graphics gives a comprehensive overview of process responsibilities.



Java Open Source Application Server

Enhydra Server
Enhydra Server is an Open Source Java application and webservice server including standard Apache Tomcat (or alternatively Jetty) and Apache Axis with a very big difference ! While the servlet API is used to support presentation logic, the platform contains just about all enterprise level services to build extreme high volume web sites in an n-tier architecture. The architecture is designed for perfomance and in tests we showed incredible performance numbers ! Many Enhydra servers are powering the Web today, some catering to millions of transactions a day. One of the most talked about features of Enhydra is its Enhydra XMLC technology - an object-oriented standards based replacement for JSP that completely separates the designer and developer. In addition, Enhydra includes a relational-to-object mapping tool (Enhydra DODS), Enhydra Workflow (Shark and JaWE), clustering web server extensions for Apache, IIS and IPlanet and much more. Check it out, you won't be sorry! :-)


Enhydra Enterprise
This is the effort to bring the advantages of the Open Source Java application server Enhydra to existing J2EE container implementations. Open Source J2EE containers like JOnAS and JBoss are supported already ! And Apache Geronimo will also be packaged as an alternative to EAF addons for commercial J2EE servers like IBM Websphere, BEA Weblogic, Oracle and Sun J2EE servers.


Home
Enhydra.org Sucess Stories

Versicherungs-Vergleich.at is using Enhydra Application Server and Enhydra Shark Workflow to develop its new base software for online insurance comparisons.

etenso GmbH in Germany uses Enhydra Server to implement a knowledge and information management product and wins the ObjectWeb Award ! Read more...

AKBANK in Turkey uses Enhydra Shark and Enhydra JaWE with support from Together for approval mechanisms in retail banking. Read more...

OpenUSS uses Enhydra Enterprise to serve thousands of students worldwide.

OfBiz uses Enhydra Shark as their internal workflow engine with thousands of users worldwide.

GrECo International AG succesfully deployed Enhydra Snapper in their LAN, integrated the fulltext indexing / search and the document previewer into their insurance broking application "BroSys" and GrECo users search in about 2.2 million documents in fragments of seconds !

Java Open Source Workflow


Enhydra Shark
The Enhydra Shark project delivers an Open Source Java workflow server with a difference. It is an extendable and embeddable Java open source workflow engine framework including a standard implementation completely based on WfMC specifications using XPDL (without any proprietary extensions !) as its native workflow process definition format and the WfMC "ToolAgents" API for serverside execution of system activities. Every single component (persistence layer, transaction manager, scripting engines, process repository,...) can be used with its standard implementation or extended/replaced by project specific modules.


Enhydra JaWE
Enhydra JaWE (Java Workflow Editor) is the first open source graphical Java workflow process editor fully according to WfMC specifications supporting XPDL as its native file format. It can be used to edit / view every XPDL file which conforms to WfMC XPDL specifications , does NOT use any proprietary XPDL extensions and is available in English, German, French and Serbian language already. Advanced features like the consistency validation and guided property editor dialogs for all XPDL objects make it really easy to create valid XPDL files. The representation of workflow participants as "swimlanes" in the editor graphics gives a comprehensive overview of process responsibilities.



Java Open Source Application Server

Enhydra Server
Enhydra Server is an Open Source Java application and webservice server including standard Apache Tomcat (or alternatively Jetty) and Apache Axis with a very big difference ! While the servlet API is used to support presentation logic, the platform contains just about all enterprise level services to build extreme high volume web sites in an n-tier architecture. The architecture is designed for perfomance and in tests we showed incredible performance numbers ! Many Enhydra servers are powering the Web today, some catering to millions of transactions a day. One of the most talked about features of Enhydra is its Enhydra XMLC technology - an object-oriented standards based replacement for JSP that completely separates the designer and developer. In addition, Enhydra includes a relational-to-object mapping tool (Enhydra DODS), Enhydra Workflow (Shark and JaWE), clustering web server extensions for Apache, IIS and IPlanet and much more. Check it out, you won't be sorry! :-)


Enhydra Enterprise
This is the effort to bring the advantages of the Open Source Java application server Enhydra to existing J2EE container implementations. Open Source J2EE containers like JOnAS and JBoss are supported already ! And Apache Geronimo will also be packaged as an alternative to EAF addons for commercial J2EE servers like IBM Websphere, BEA Weblogic, Oracle and Sun J2EE servers.



Java Open Source Tools and Technologies

Enhydra XMLC

Enhydra XMLC is the presentation technology that supports the needs of designers, developers and architects alike, delivering what JSP cannot - strict separation of markup and logic in a true object view of dynamic presentations. XMLC is now fully portable to Tomcat 4, 5 as well as JBoss, BEA, Enhydra and other Web Container implementations. Enhydra XMLC is included in Enhydra Server and Enhydra Enterprise. Several Enhydra Demos also use XMLC !


Enhydra DODS
Enhydra DODS (Data Object Design Studio) is an open source relational-object-mapping tool with a difference. Based on XML data model descriptions the SQL DDL, sophisticated Java code and documentation (HTML, pdf, XMI) is generated automatically using a generator GUI, by Ant tasks or from within the Eclipse IDE. The generated Java code provides a lot of possibilities for runtime optimization (DO LRU caching, Query LRU caching, cache initialization, lazyloading,...).


Enhydra Director
Enhydra Director is a collection of open source web-server plugins to provide loadbalancing, clustering and unified connection methods for different web-servers on different platforms. It supports several popular Web servers and operating systems, including Apache (on Linux/Unix and Windows), Netscape Enterprise Server (on Linux/UNIX and Windows), and Microsoft Internet Information Server. Director also supports several applications servers: Tomcat (v5.xx and v5.5x), Jetty, JOnAS, JBoss and Enhydra Server.


Enhydra Octopus
Enhydra Octopus is a Java-based Extraction, Transformation, and Loading (ETL) tool. It may connect to any JDBC data sources and perform transformations defined in an XML file.


Enhydra Application Framework
Enhydra application framework EAF is a portable set of APIs making development of typical web applications a lot easier but still keeping portability to the application server of your choice by using plug-ins to adopt the EAF API's to the specific environment.


Enhydra Kelp
The Enhydra Kelp project is focused on creating tools that make it easy to get the most out of other Enhydra technologies such as XMLC, Octopus and DODS. Kelp includes command line tools, application wizards and Eclipse IDE plug-ins.


Enhydra Oyster
Enhydra Oyster is an Open Source Java library for SMIME signing and encryption of E-Mails using different key strengths and algorithms. It is developed with suport and testing for major E-Mail clients.

Thursday, January 3, 2008

i-Phone:-Introduction

iPhone is a revolutionary new mobile phone that allows you to make a call by simply tapping a name or number in your address book, a favorites list, or a call log. It also automatically syncs all your contacts from a PC, Mac, or Internet service. And it lets you select and listen to voicemail messages in whatever order you want — just like email.

iPhone uses OS X, the world’s most advanced operating system. Which means you have access to the best-ever software on a handheld device, including rich HTML email, full-featured web browsing, and favorite applications including Address Book and Calendar. iPhone is also fully multi-tasking, so you can read a web page while downloading your email in the background. This software completely redefines what you can do with a mobile phone.

iPhone uses quad-band GSM, the global standard for wireless communications. It also supports AT&T’s EDGE network, 802.11b/g Wi-Fi, and Bluetooth 2.0 with EDR, which links to Apple’s compact Bluetooth headset. When you move around, iPhone automatically switches between EDGE and Wi-Fi to provide the fastest data connection possible. To set up your own Wi-Fi network, check out the AirPort Extreme Base Station.

Monday, December 10, 2007

Enterprise JavaBeans (EJB) :Introduction

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform, Enterprise Edition (Java EE). EJB technology enables rapid and simplified development of distributed, transactional, secure and portable applications based on Java technology.



The EJB specification intends to provide a standard way to implement the back-end 'business' code typically found in enterprise applications (as opposed to 'front-end' user-interface code). Such code was frequently found to reproduce the same types of problems, and it was found that solutions to these problems are often repeatedly re-implemented by programmers. Enterprise Java Beans were intended to handle such common concerns as persistence, transactional integrity, and security in a standard way, leaving programmers free to concentrate on the particular problem at hand.

EJB types
Stateful Session Beans are distributed objects having state: that is, they keep track of which calling program they are dealing with throughout a session. For example, checking out in a web store might be handled by a stateful session bean, which would use its state to keep track of where the customer is in the checkout process. On the other hand, sending an e-mail to customer support might be handled by a stateless bean, since this is a one-off operation and not part of a multi-step process. Stateful session beans' state may be persisted, but access to the bean instance is limited to only one client. Stateless Session Beans are distributed objects that do not have state associated with them thus allowing concurrent access to the bean. The contents of instance variables are not guaranteed to be preserved across method calls. The lack of overhead to maintain a conversation with the calling program makes them less resource-intensive than stateful beans.

Message Driven Beans were introduced in the EJB 2.0 specification. which is supported by Java 2 Platform, Enterprise Edition 1.3 or higher. The message bean represents the integration of JMS (Java Message Service) with EJB to create an entirely new type of bean designed to handle asynchronous JMS messages. Message Driven Beans are distributed objects that behave asynchronously. That is, they handle operations that do not require an immediate response. For example, a user of a website clicking on a "keep me informed of future updates" box may trigger a call to a Message Driven Bean to add the user to a list in the company's database. (This call is asynchronous because the user does not need to wait to be informed of its success or failure.) These beans subscribe to JMS (Java Message Service) message queues or message topics. They were added in the EJB 2.0 specification to allow event-driven processing inside EJB Container. Unlike other types of beans, MDB does not have a client view (Remote/Home interfaces), i.e. clients can not look-up an MDB instance. It just listens for any incoming message on a JMS queue (or topic) and processes them automatically.

Previous versions of EJB also used a type of bean known as an Entity Bean. These were distributed objects having persistent state. Beans in which their container managed the persistent state were said to be using Container-Managed Persistence (CMP), whereas beans that managed their own state were said to be using Bean-Managed Persistence (BMP). Entity Beans were replaced by the Java Persistence API in EJB 3.0, though as of 2007, CMP 2.x style Entity beans are still available for backward compatibility.

Other types of Enterprise Beans have been proposed. For instance, Enterprise Media Beans (JSR 86) address the integration of multimedia objects in Java EE applications.

Monday, December 3, 2007

The Year 2038 Bug

It's barely 8 years since we had the millenium bug so don't say you didn't get enough warning! A lot of systems in the world may have date rollover troubles in a fraction over 30 years time. The millenium bug (more accurately known as the Two Digit Century Rollover Bug) was caused by using 2 digits instead of 4 for the year. So Christmas 2007 falls on 12/25/07. Of course when 1999 rolled over to 2000 then the first day of the new century became 01/01/00 and this could have had serious consequences had all the old systems not been sorted out in advance. This problem will also happen again in 2099, 2199 etc if anyone is silly enough to keep using two digit year dates.

But the Unix bug will occur in 2038. That's because the date system started in 1970 and uses a time_t (signed int) to hold the number of seconds. The highest value is 2147483648-1 which is 24855.13 days. Add that to Jan 1 1970 and you get Jan 19 2038! So sometime early on that morning of that date, any software using a signed int for a date will rollover to Jan 1 1970! So how you are going to cope up with this problem dudes....!!!