Installing Java SE Source Files and Linking to Eclipse on CentOS 5

?When I first set up a developoment VM with CentOS I must have forgotten to install the Java source because I could not navigate to Java SE method declarations in my Eclipse IDE.

To have access to the Java source I did the following:

  • yum install java-1.6.0-openjdk-src
  • A src.zip file was placed in:
  • /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/src.zip

I created a src dir in the aforementioned containing dir and unpacked the zip
I then linked to the source from Eclipse by:
Right-clicking on some → Continue reading “Installing Java SE Source Files and Linking to Eclipse on CentOS 5”

Installing JBoss AS 6 Tools in Eclipse Helios

  • Go to Help > Install New Software
  • Set Work with to http://download.jboss.org/jbosstools/updates/development/
  • In the results, unfold “All JBoss Tools” and check JBoss AS Tools. When last I checked the description indicates only 4.x and 5.x for JBoss, but it does include JBoss AS 6 Tools
  • Next, etc, Finish.

When I then ran through the Eclipse add server wizard the 6.0 version of JBoss AS was available.→ Continue reading “Installing JBoss AS 6 Tools in Eclipse Helios”

Including libraries in WAR files in Eclipse

By default, the newer versions of Eclipse do not include the libraries that you add to the build path in .war files. There are three approaches to solving this problem:

  • Declare your libraries/jar files to be module dependencies for your war file; essentially forcing Eclipse fo treat the lib the same way it would a dependent project. I found a web page describing how to do this for an older version of Eclipse and couldn’t readily figure out how to
Continue reading “Including libraries in WAR files in Eclipse”

Disabling Autodeploy in Eclipse for Web and JavaEE Projects

In some cases it is helpful to have your Java project automatically built and deployed for you by Eclipse. For me, when working on a dynamic web or JavaEE project I’d much rather run it on the server through the IDE manually, as I tend to save often and I end up having to wait for a previous deployment to finish on a regular basis.

To disable the feature:

  • Go to: Window/Show View/Servers
  • Double-click on the server that you associated
Continue reading “Disabling Autodeploy in Eclipse for Web and JavaEE Projects”

Linux Daemons and Services List

A couple of links with lists of the default set of Linux daemons installed on most systems. Helpful to know which ones that you need to disable when locking down a machine.

http://www.techrepublic.com/article/linux-101-a-comprehensive-list-of-available-linux-services/6018195

http://www.hscripts.com/tutorials/linux-services/index.phpContinue reading “Linux Daemons and Services List”

Egg Drop Soup

  • 1 egg
  • 2 1/2 cups chicken broth
  • 1 tbsp corn starch mixed with 1tbsp water
  • 1 tsp finely chopped tops of green onions
  • Pinch of white pepper
  • Dash of sesame oil

In a small bowl, beat egg slightly; set aside. Bring chicken broth to a boil over high heat. Add corn starch mixture to the broth stirring until it comes to a boil again. Reduce heat to medium-low. Hold the pan with beaten egg about 12 to 15″ above the → Continue reading “Egg Drop Soup”

Deleting a File Using the Inode Number

Sometimes you will accidentally create a file that has special characters in the file name which then prevents you from running commands on it.  In that case, you can resort to accessing the file via it’s inode number.

To do so:

$ ls -il | more

In the directory in which the file that you want to examine resides

This will output a list of files, the first column being the inode number.

You can then run the following command → Continue reading “Deleting a File Using the Inode Number”

Retuning a MySQL Query in CSV

The following is an example of how to run a query on the command line to output the result of a MySQL query to a CSV file.

Create a text file with the your query, query.sql:

SELECT * FROM hosts;

The run the following command:

mysql –skip-column-names -uuser -ppassword database < query.sql | sed ‘s/\t/”,”/g;s/^/”/;s/$/”/;’ > filename.csv

This will run the MySQL query and output the results to a text file in .csv format.

The sed commands do the following:→ Continue reading “Retuning a MySQL Query in CSV”

Retrieving a Previously Deleted File in Subversion

Let’s say that you have deleted a file (or directory) in your checked out copy of a svn repository and then checked it in (committed your change).

You discover that you really would like to have that file back in your current version of your repo. You can either us the svn merge command, or copy the file from a previous version of your repo.

Here is how you can copy the file from a previous version:

svn rm blah.txtContinue reading “Retrieving a Previously Deleted File in Subversion”

Setting up Proxy Authentication for a Linux Box to use yum

Should you find yourself running a Linux box behind a proxy that requires authentication you will need to update your setup so that you can get access to the outside world, and make some configuration changes to yum.

First, add the following to your /etc/yum.conf (note, this is incredibly insecure as you will now have your proxy uid and password in clear text on your machine. You should remove your login details after you have made your connections):

proxy=http://proxy_url:80
proxy_username=uid
Continue reading “Setting up Proxy Authentication for a Linux Box to use yum”