Tuesday, October 26, 2010

Password Protection for entire Website with Apache

Just a little note, because this one is often used for a quick (and dirty) password protection of a Website served with an Apache frontend:

1. Create a password file with htpasswd (or httpasswd2):
htpasswd2 -c -m /etc/apache2/apache-passwds your_login_name

2. Extend your Apache config with something like this:
  <LocationMatch "/.*">
        AuthType Basic
        AuthName "Password required"
        AuthUserFile /etc/apache2/apache-passwds
        Require valid-user
  </LocationMatch>

Sunday, October 24, 2010

Memory Consumption of the Grails Command Tool

Yesterday, I decided to reuse a Virtual Server with 1 GByte RAM as an continuous integration server for my Grails development.
Setting up Tomcat, Hudson and Artifactory was quickly done. To ensure safety, I checked the memory:

root@dev:~# free -m
                 total       used       free     
   Mem:          1024        661        362 

Ok, up to 360 MBytes left. That should be sufficient for the Grails Command Tool.
I installed Grails 1.3.5 and run a grails help. Oops, the following exception was thrown:

.......
Base Directory: /root
Resolving dependencies...
Dependencies resolved in 2084ms.
java.io.IOException: Cannot run program "/usr/bin/env": java.io.IOException: error=12, Cannot allocate memory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
        at java.lang.Runtime.exec(Runtime.java:593)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
.......
       Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory
        at java.lang.UNIXProcess.(UNIXProcess.java:148)
.........

I was wondering why Grails would need more then 360 MByte for a simple help-command. Looking around I recognized that Grails reserves 512MByte MaxHeap-Memory and another 192MByte for the PermSize per default.
It can be adjusted by setting the GRAILS_OPT environment variable. For me it works by adding the following line to the .bashrc (or /etc/environment if needed globally):

GRAILS_OPTS="-server -Xmx200M -XX:MaxPermSize=128m -Dfile.encoding=UTF-8"

Thursday, October 14, 2010

Faulty Dell Precision Notebook & Poor Dell Services

This is such an unbelievable and annoying story; thus, I decided to make it public.

For the last five years I’ve been a happy Dell customer. I owned several Dell notebooks and one desktop-box and they worked mostly very well. Little problems, like a broken DVD drive, were handled fast by the Dell service.
Hence, I decided last June to invest in the high-end, powerful and expensive Notebook Precision M6500. I ordered a 1920x1600 White-LED screen, which seems to be perfect for my work as a software developer (especially during creation of Web-Application with nice designs).

The notebook arrived after three weeks and I was happy so far. The first impression was not too bad: A real power machine. Ok, it is quite heavy, the power supply is huge and the fan works like crazy. But that’s ok for such a powerful notebook.

The problem started while looking at the screen. Especially when comparing it to my old notebook display or to the duplicated screen on an external monitor. The display of the Precision had an extreme bluish cast (“Blaustich” in German). Things that should be grey were extreme blue. It had nothing to do with the Windows 7 adjustments, because the blue cast appears also on the Bios screen. It was a “hardware issue”.

To make a long story short: Today, three months and about 20 Dell service calls later, I still have no flawless Dell notebook. In between I spent many hours in the phone waiting loop, three on-site repairs were done and at the end the notebook has been replaced by a swap model.

The swapped Precision made me full of hope. And yes, as it arrived no bluish cast anymore. That proves the defect of my first Precision M6500.

But then … I can’t believe … what do I see: Blue text on white background had a grey blur (“Grauschleier” in German). This had nothing do to with the bluish problem from my original Precision, but again it’s a defect on the screen. It looked for me like a driver issue. Therefore I reinstalled the operation system from the Dell DVD (which comes without any drivers): The problem disappears. This proves me that the grey-blur-issue is a problem with the drivers in combination with the Dell hardware.

Groundhog Day: Again calling the Dell support, explaining them the problem and deciding to send my Precision to the Dell repair service. I advised the Dell service to restore my system to the Dell Factory Image so that they could reproduce the grey-blur-issue. The partition with the “Dell Factory Image Restore” was still available on the hard-disk. To play it safe, I enclosed a letter with an explanation for the people which would do the job.

One week later I received the Precision back. I couldn’t believe my eyes: They changed the hard-disk, therefore destroying the “Dell Factory Image Restore” partition. I had no problem with the hard-disk, it worked fine! They installed a naked Windows 7 without any drivers. Thank you, Dell!

In my despair I visited the Dell website, entered my service-tag to get a list of all needed drivers (http://support.dell.com/support/downloads/index.aspx?s=dhs&cs=19). I thought if Dell is not able to deliver a working pre-installed system, I would do it on my own. But again Dell sucks: My service tag could not be recognized: “Your service tag was not recognized. Please check your service tag and try again”

And again: Calling the Dell support, updating them and asking for help. Their answer (in short): “Sorry, we can’t do anything about it. It’s a software problem.”

That was the straw that breaks the camel’s back. Sorry Dell. I spent hours on this issue. All I expect is a faultless and full-functional Dell notebook. I’m not willing to spend more time on this issue. Please send me a working full-featured Precision M6500 with a Factory Image or refund!


Dear readers, I will keep you posted how the story will end. I’ve got a lot more detailed, weird and “funny” anecdotes to tell about this. Besides, I’m very interested in the “Dell experience” of other people.


Update from November 2010 (Hard-Disk crashed)

The following days/weeks I’ve received no feedback from Dell. The only communication was with a lady from Dell who asked me to send back my original notebook. But since my swapped notebook didn’t work either, I refused this.
So I decided to make a fresh installation of Windows 7 by myself. The installation of drivers was the annoying part:

  • Tried the “Dell Client System Update” Software which promised to install all missing drivers. --> Didn’t work at all. It just recommended three drivers; and just one of it could be installed without an error
  • Next try: Dell Website which allows to enter my service-tag. No success either - my service-tag is still not recognized
  • Next try: Dell CD with drivers that has been shipped with the my original notebook (The swapped model had none included). Failed again, because some drivers (for example WLAN) failed with errors
  • So I did it the manual way: Checked the Hardware-Identifications and downloaded some of the drivers from the original hardware producer
Finally I’ve got the system running including all drivers. I was pleased so far.

But then two weeks later ... my hard-drive makes some unusual noise ... and ... crashes. Dead. No way to access it anymore.
Remember: That was the hard-disk Dell changed without any reasons some weeks before. Unbelievable!
Luckily I had a backup from three days before. Anyhow three days of work were lost. Thanks again for this, Dell!

I called Dell to make sure I would get a new hard-disk the next day. It was Friday around 6 p.m. No chance. Dell-Service was already on weekend. That means: A new hard-disk would have arrived 4 days later earliest. Four more days without the possibility to work on my computer. That was inacceptable.
Hence, I drove to the city and bought a hard-disk on my own. On Monday morning I called the Dell Service. It took two more days that their new hard-disk arrived (although they promised 24h during the week).

Conclusion: The Dell Service/Support is extremely bad (at least in my case). I even wrote a fax to the escalation department of Dell, but didn’t get any response or excuse regarding my case.
Now I know what the Dell Hell feels like -- endless calls, bad service, improper reparations and in the end you need to help yourself.


Update from February 2011 (Memory crashed)

I was full of hope that after the hard-disk-crash my Dell-Hell would be over. But, unfortunately, this was a false conclusion: First, every two weeks my notebook crashed with a famous blue-screen. As time goes by the frequency increased to two times the week.
Very annoying and again I’ve lost some work results in consequence of several crashes.
The blue-screens showed most of time something like “BUGCODE_USB_DRIVER; STOP 0x000000DE (...)". Sometimes there wasn’t even a blue-screen, instead Windows 7 just froze.

As usual I called Dell after doing some googling before. It turned out that Dell assembled some defect memory (RAM) into my notebook. Dell did already know that the manufacturing of those specific RAM production type was faulty.
Thanks again Dell. Why don’t you inform your customers proactive and offer some replacements?

All in all, this was a very bad experience with the Dell-Support and Dell’s product quality. The trouble continues for more than half a year. It costs me many working hours. I missed serious help from Dell. At least I would have expected some kind of an apology.

Sunday, October 10, 2010

Weird Grails Scaffold Exception

Using the dynamic scaffolding feature (in Grails V1.3.4) like
package de.scheelethek.backoffice.crud
class CommentController {
    def scaffold = true
}
I've got a runtime exception like
2010-10-10 13:11:44,417 [http-8080-1] ERROR errors.GrailsExceptionResolver  - java.lang.Boolean cannot be cast to groovy.lang.Closure
java.lang.ClassCastException: java.lang.Boolean cannot be cast to groovy.lang.Closure
 at java.lang.Thread.run(Thread.java:619)

It looks like Grails is trying to interpret the scaffold-definition as an action.
The explanation was not far to seek:

The referenced domain class is defined in the package "de.scheelethek.backoffice". The controller uses another package definition. scaffold=true is searching just in the same package for a corresponding domain definition. If not found "def scaffold", it is interpreted as an action.

The solution is obvious. Do an explicit definition of the domain class that should be used:
package de.scheelethek.backoffice.crud
import de.scheelethek.content.*
class CommentController {
    def scaffold = Comment
}