David R. Heffelfinger

  Ensode Technology, LLC


PDF Unlock Utility

A while back I purchased an ebook in PDF format. When I tried to open it under my Linux laptop I got an unpleasant surprise, the ebook's author had used a font that wasn't available on my Linux box, therefore the ebook was unreadable.

I figured I can simply copy the text and paste it into a text editor or word processor, but to my dismay I found out it wasn't possible to copy text from the PDF.

I had heard about iText, a Java library used to create and manipulate PDF's. I studied the iText API and found out how to make a copy of the PDF with the copy/paste restrictions removed. I wrote some code to try it out, and lo and behold, I was able to copy and paste from my custom copy of the ebook.

I figured that just like I needed to remove those restrictions, many others out there probably had the same problem. I turned my home grown utility into a web application and posted it on my site: http://www.ensode.net/pdf-crack.jsf. It has been helping people remove those annoying restrictions for a while now.,


NetBeans Book Almost Ready

We are working on the final touches of my new Netbeans book. If everything goes well, it should be published later this month.

Today I received "prefinal" versions of the first few chapters. Prefinal versions are what the publisher will sent to the printers once the book is completed. They are sent to the author for a final inspection and "sanity check" before having the book printed.

I'm very excited about this book. NetBeans is such a nice IDE and I hope my book can help others learn how to use it to its full potential.


Blocking External Domains Pointed to Your IP Address

Last night I realized some bozo decided to point his domain name to my site. I don't know exactly what he was thinking, or what benefit he could possibly get from doing so. The only thing I could think would happen is that all my content would have an exact duplicate in Google, and we all know Google doesn't like duplicate content.

I contacted eApps,my hosting company, they contacted the owner of the intruding domain, and he refused to remove his domain name from my IP address. Tech support suggested I could set up an Apache rule to serve only my domains from my IP address.

I googled around to see how to go about this, but came out blank. Most issues I found were about preventing specific hosts to link to my site, which is not what I was trying to do. Once again I asked eApps support, and they came up with a solution.

I needed to add some rules to the Apache .htaccess file that would result in only my domains being served from my IP address:

SetEnvIfNoCase Host "mysite1\.com" local_sites
SetEnvIfNoCase Host "mysite2\.com" local_sites
Order Allow,Deny
Allow from env=local_sites

Adding the above lines to .htaccess did the trick. The bozo is no longer serving my content from his domain.

Evolution Send/Receive Icon Grayed Out

Evolution is a very popular GNOME email client for Linux. It's user interface is very similar to Microsoft Outlook, making it easy for users of Outlook to migrate.
Just like Outlook, Evolution has a Send/Receive icon in it's icon toolbar.

Sometimes, the Send/Receive icon is grayed out, perhaps because we started evolution before we had a network connection. This situation is somewhat common in laptops, when Evolution is fired before obtaining a WIFI connection.

It may not be intuitive how to enable the Send/Receive icon, well, fortunately it is very simple, all that is needed is to go to File->Work Online, and the Send/Receive icon will be enabled.


I can't fix your corrupted PDF

Just like I can't fix corrupted Excel spreadsheets, I neither can fix corrupted PDF files. By the way, if your PDF requires a password just to be read, I can't help you crack it. However, if you can't copy and paste or print your PDF (but you can read it), I wrote an utility you can use to remove those restrictions: http://www.ensode.net/pdf-crack.jsf.

I can't fix your corrupted Excel Spreadsheet

Since a while back I wrote a utility that can , every now and then I receive emails from random people asking me to fix their corrupted excel files.

Well, sorry, I am unable to do that, good luck.

New NetBeans Book Available for Pre-Order

I am pleased to announce that my new book, Java EE Development With NetBeans, is now available for pre-order.

Installing Apache Roller in GlassFish

For a while i've had a a blog in JRoller. I've been wanting to move my blog to my own domain, but due to lack of time and other commitments I hadn't been able to do it. Well today I finally did it.
I figured a good first entry would be to talk about how to get Apache Roller going under GlassFish, which happens to be my Java EE server of choice, and the one that powers my site. GlassFish comes with the JavaDB RDBMS "out of the box", which is what I'm using in this Roller installation.

After downloading Roller, the first thing we need to do is to create the database that Roller will use. In JavaDB, we can accomplish this with the ij utility.

In ij, we need to issue the following commands to create the database.

connect 'jdbc:derby://localhost:1527/roller;create=true';

Then we need to add a user to the database:

CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.user.admin','noneofyourbusiness');

The above command creates a user with username of "admin" and password of "noneofyourbusiness". The username and password can be modified as appropriate.

We then need to grant full access to our admin user:

CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.fullAccessUsers','admin');

We are done with the database creation.

Now we need to create a GlassFish connection pool and JDBC Resource for our new database, this can be accomplished easily with the asadmin tool:

asadmin create-jdbc-connection-pool --datasourceclassname org.apache.derby.jdbc.ClientDataSource --property user=admin:password=noneofyourbusiness:databaseName=roller rollerConnectionPool

The value of the databaseName property must match the name we gave our database in the first step.

To create the datasource/JDBC resource, we need to issue the following asadmin command:

asadmin create-jdbc-resource --connectionpoolid rollerConnectionPool jdbc/rollerdb

It is important to use the JNDI name of jdbc/rollerdb, otherwise the roller code won't be able to find the datasource.

After we have created the connection pool and datasource, we need to create a file called roller-custom.properties with the following content:


And copy it to the lib/classes folder of on the GlassFish domain we are using.

At this point we are ready to deploy Roller, just deploy it as usual and it should "just work".

Good Luck.


« August 2018

© David R. Heffelfinger