Posts

Showing posts from 2012

Working with Manifest Files: The Basics

Working with Manifest Files: The Basics JAR files support a wide range of functionality, including electronic signing, version control, package sealing, and others. What gives a JAR file this versatility? The answer is the JAR file's  manifest . The manifest is a special file that can contain information about the files packaged in a JAR file. By tailoring this "meta" information that the manifest contains, you enable the JAR file to serve a variety of purposes. This lesson will explain the contents of the manifest file and show you how to work with it, with examples for the basic features: Understanding the Default Manifest When you create a JAR file, a default manifest is created automatically. This section describes the default manifest. Modifying a Manifest File This section shows you the basic method of modifying a manifest file. The later sections demonstrate specific modifications you may want to make. Setting Package Version Information...

Setting Package Version Information

Setting Package Version Information You may need to include package version information in a JAR file's manifest. You provide this information with the following headers in the manifest: Headers in a manifest Header Definition Name The name of the specification. Specification-Title The title of the specification. Specification-Version The version of the specification. Specification-Vendor The vendor of the specification. Implementation-Title The title of the implementation. Implementation-Version The build number of the implementation. Implementation-Vendor The vendor of the implementation. One set of such headers can be assigned to each package. The versioning headers should appear directly beneath the  Name  header for the package. This example shows all the versioning headers: Name: java/util/ Specification-Title: Java Utility Classes Specification-Version: 1.2 Specification-Vendor: Example Tech, Inc. Implementation-Title: java.util Implementation-V...

Understanding the Default Manifest

Understanding the Default Manifest When you create a JAR file, it automatically receives a default manifest file. There can be only one manifest file in an archive, and it always has the pathname META-INF/MANIFEST.MF When you create a JAR file, the default manifest file simply contains the following: Manifest-Version: 1.0 Created-By: 1.6.0 (Sun Microsystems Inc.) These lines show that a manifest's entries take the form of "header: value" pairs. The name of a header is separated from its value by a colon. The default manifest conforms to version 1.0 of the manifest specification and was created by the 1.6.0 version of the JDK. The manifest can also contain information about the other files that are packaged in the archive. Exactly what file information should be recorded in the manifest depends on how you intend to use the JAR file. The default manifest makes no assumptions about what information it should record about other files. Digest information ...

Modifying a Manifest File(JAR)

Modifying a Manifest File within JAR : You use the  m  command-line option to add custom information to the manifest during creation of a JAR file. This section describes the  m  option. The Jar tool automatically puts a default manifest with the pathname  META-INF/MANIFEST.MF  into any JAR file you create. You can enable special JAR file functionality, such as package sealing, by modifying the default manifest. Typically, modifying the default manifest involves adding special-purpose  headers  to the manifest that allow the JAR file to perform a particular desired function. To modify the manifest, you must first prepare a text file containing the information you wish to add to the manifest. You then use the Jar tool's  m  option to add the information in your file to the manifest. Warning:  The text file from which you are creating the manifest must end with a new line or carriage return. The last li...

JAR(Java Archive) Command in *nix

Image
JAR  ( J ava  AR chive) is an  archive file format  typically used to aggregate many  Java class files  and associated  metadata  and resources (text, images and so on) into one file to distribute  application software  or  libraries  on the  Java platform .                JAR files are built on the  ZIP file format  and have the  .jar   file extension . Computer users can create or extract JAR files using the  jar  command that comes with a  JDK . They can also use zip  tools to do so; however, the order of entries in the zip file headers is important when compressing, as the manifest often needs to be first. Creating a JAR File The basic format of the command for creating a JAR file is: jar cf jar-file input-file(s) The options and arguments used in this command are: The  c  option indicates that you want t...
What Is SSHFS? SSHFS stands for ( Secure SHell FileSystem ) client that enable us to mount remote filesystem and interact with remote directories and files on a local machine using SSH File Transfer Protocol ( SFTP ). SFTP is a secure file transfer protocol that provides file access, file transfer and file management features over Secure Shell protocol. Because SSH uses encryption while transferring  files over the network from one computer to another computer and SSHFS comes with built-in FUSE ( Filesystem in Userspace ) kernel module that allows any non-privileged users to create their file system without modifying kernel code. Before we move further with the installation process , We’d like to tell you that the below installation also works on all RedHat based distributions like RHEL 6.3/6.2/6.1/6/5.8 , CentOS 6.3/6.2/6.1/6/5.8 and Fedora 17,16,15,14,13,12 . Install SSHFS in RHEL, CentOS and Fedora Step 1: Installing SSHFS By default sshf...

Sendmail "cannot open '/etc/mail/local-host-names': World writable directory"

Recently I got some issue with Sendmail. When I tried to check mail queue, then it throw me following error. /etc/mail/sendmail.cf: line 91: fileclass: cannot open '/etc/mail/local-host-names': World writable directory e.g. [root@test ~]# mailq /etc/mail/sendmail.cf: line 91: fileclass: cannot open '/etc/mail/local-host-names': World writable directory /etc/mail/sendmail.cf: line 588: fileclass: cannot open '/etc/mail/trusted-users': World writable directory As Error clearly incdicate that mentioned file have write access for other and group as well and need to change permission for this. So just change permissions and restart sendmail service as below : $su (If you not login with root) #chmod go-w / #chmod go-w /etc #chmod go-w /etc/mail #service sendmail restart [root@test ~]# mailq                 /var/spool/mqueue (5 requests) -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recip...

lynx Webmaster Tips

Hi Friends, Today we are going to play with lynx (Command line browser) in Linux.  Fun in the Terminal With Lynx Browser Get the text from a Web page as well as a list of links lynx -dump "http://www.example.com/" Get the source code from a Web page with Lynx lynx -source "http://www.example.com/" Get the response headers with Lynx lynx -dump -head "http://www.example.com/" The GNU/Linux command line gives you a lot of small tools that can be connected with each other by piping the output of one tool into another tool. For example, you might see a page with a lot of links on it that you want to examine more closely. You could open up a terminal and type something like the following: $ lynx -dump "http://www.example.com" | grep -o "http: . *" >f i le . txt That will give you a list of outgoing links on the web page at http://www.example.com, nicely printed to a file called f i le...

configure a system to use two different networks

Question:   How we can configure a system to use two different networks. Requirements: Red Hat Enterprise Linux or *nix OS A system with two Network Interface Cards (NICs) Two different networks Solution: Edit the file   /etc/sysconfig/network  and fill in the values of the variables: NETWORKING=yes HOSTNAME=myhost.example.com Note: If necessary, remove or comment out the variable  GATEWAY . Each NIC will have  it's  own gateway. Edit the file  /etc/sysconfig/network-scripts/ifcfg-eth0  and add the following variables with their corresponding values: DEVICE=eth0 BOOTPROTO=none ONBOOT=yes NM_CONTROLLED=no USERCTL=no IPADDR= NETMASK= GATEWAY= PEERDNS=yes DNS1= DNS2= Do the same for the file  /etc/sysconfig/network-scripts/ifcfg-eth1 : DEVICE=eth1 BOOTPROTO=none ONBOOT=yes NM_CONTROLLED=no USERCTL=no IPADDR= NETMASK= GATEWAY= PEERDNS=yes DNS1= DNS2= The values between '<' and '>' ...