This is a tip for those of you dealing with long build times, which for me, is anything greater than about 4 seconds
The problem that those of us with NADD face is the second we are waiting for something to finish, we [alt|cmd]+Tab to a browser and start reading slashdot, rotten tomatoes, daringfireball, or any of a million other sites. Likely, you classify this “quick field trip” as multitasking and because you are so very good at multitasking (despite what all the experts say), you disregard the fact that your build was probably finished 10 minutes ago.
<Read on…>
Whew, Grails has some gotchas. It is so great for so many reasons. But WOW! There are some time sinks tucked away for you to discover. In the hope of helping others, here is a list of the ones that hit me.
<Read on…>
I’m embarking, balls-out, on a new project using Grails. I’ll be leveraging a significant portion of our Java codebase and the fact that I can do that,is just plain stellar.
It quickly came time to test out some of the integration. The very first question was how to load resources for testing. E.g., I have a service that handles file uploads. How do I pass it a test file?
The documentation isn’t straightforward on this. In fact, I found the solution attached to a bug report for grails 1.1. It’s pretty simple, once you pull in the spring packages:
import org.springframework.core.io.ClassPathResource
import org.springframework.core.io.Resource
And then in your testXXX() function:
Resource resource = new ClassPathResource("resources/crying-baby.jpg")
def file = resource.getFile()
assert file.exists()
And you are good to go. Note the assert at the end to verify things are working.
Setting up Solr was a bit different then the others. Solr’s distribution is multifaceted, containing multiple server examples, client code, as well as, a simple production ready server. So let me start off with a few steps I took in setting up Solr.
<Read on…>
As I was working on my SMF scripts for the migration from Linux, I found some fancy ways to trace what was happening with a service that failed to start with new configuration.
There is a command called truss which allows you to follow along as something is being executed. See: man truss.
What I found really cool is that you can modify your existing SMF script from the command line. No need to make changes to xml and then reimport.
So back to the tip, if a service isn’t starting and you have eliminated all of the other possibilities with configuration, you need to see what the service script is doing. In my case, I was having a hell of a time with Red5. So here is what you can do:
<Read on…>
Red5 is the open source answer to Adobe’s Flash Streaming Server. I use it not for streaming, but for recording audio and video from a user’s web browser. Yeah, that is a really cool feature if you have the need for it.
It turns out that the Red5 team actually created an SMF configuration. However, you have to download the source to get to it. I was half way through my own before I saw the change entry on the Red5 commit mailing list. However, it used some funky paths. I took this and fixed it for my Joyent specific installation.
<Read on…>
For my Tomcat SMF setup, I have two files. One, the configuration for SMF. The second is the script used to start and restart tomcat. (My stop is simply a kill. Unfortunately, there are a few threads that aren’t shutting down properly.)
<Read on…>
Google corporate infrastructure was hacked in mid-December. It looks like not that much information was stolen.
However, it has said that they will no longer be censoring search results for users in China because the attach originated from the Chinese government:
We have decided we are no longer willing to continue censoring our results on Google.cn, and so over the next few weeks we will be discussing with the Chinese government the basis on which we could operate an unfiltered search engine within the law, if at all.
How awesome is that?
What that tells me though is that google.cn will stop operating in the next few months. We all know that there is no way in hell the Chinese government will allow google to provide results, uncensored.
Check it out: http://googleblog.blogspot.com/2010/01/new-approach-to-china.html
I was having a horrendous time logging into one particular Linux server. It would take anywhere from 20 seconds to a minute to let me log in.
Turns out, there are two sshd config settings you should pay attention to:
VerifyReverseMapping and GssAuthentication
The latter only really helps if you are connecting from a Mac (like me). VerifyReverseMapping will tell the server to look up the host name for client IPs, and if the IP you’re SSH’ing from doesn’t have a reverse DNS entry, this will result in a DNS timeout. (The source of most of the delay in logging in.)
So open up your sshd config file: /etc/ssh/sshd_config
Remove VerifyReverseMapping, if it exists. The default value for it is no. If you don’t see it, this isn’t the source of your problem.
Remove GssAuthentication, if it exists. It also, defaults to no.
Leading in with my post on switching from Linux to OpenSolaris, there are quite a few things I am in love with on OpenSolaris.
Since my first real world exposure to OpenSolaris is the process of migrating web applications away from Linux, the first thing I really had to get familiar with is the Service Management Facility framework. SMF for short. SMF is the Solaris equivalent of UNIX/Linux init.d, Apple’s launchd, or Windows services.
I’m coming from a decade long Linux background so let me compare and contrast init.d and SMF. <Read on…>