How to fix Parallels Desktop from hanging on startup

Recently, Parallels Desktop did not shut down correctly for me. When I went to start it back up, it just sat there with a spinning wheel, and a message saying “suspending.”

I did finally resolve the issue. Here’s how I did it.

1) Quit Parallels.

2) Open up the Activity Monitor. On a Mac, this is Utilities > Activity Monitor.

3) In the list of processes, look for one named “prl_vm_app”. Select it.

4) Click the Quit Process button in the upper left. Choose to Force Quit at the prompt.

You should be able to start up Parallels Desktop again.

Removing a Stripped Stainless Steel Screw

Well, if you made the mistake of putting decking down with stainless steel screws like I did, you may have run into this issue before. Either you didn’t drill a decent pilot hole, or it was getting to be too hot, and you were in a rush, it doesn’t matter. The bottom line is that you now have a completely stripped stainless steel screw head staring you right in the face.

After giving up with the hacksaw (because I realized that would just leave a dead screw in the wood, I decided to use an old flathead screwdriver bit. I held the bit on the head of the screw and pounded it into the screw a few times with a hammer.

After the bit was into the screw, I slowly turned it out.

Stainless steel screw head

Sandbox

I finally built a sandbox for the kids (just in time for winter, right?). I’ve been meaning to all summer, and planned to do it as soon as our landscaping was done in the back yard.

It took longer than I thought to finish up the landscaping, and after that, there were a few other more pressing projects. But, the bottom line is that it’s done.

I got the plans from the Home Depot website. It cost about $85 for the materials, which I realize is complete overkill for a sandbox. However, I wanted to have at least one thing in the back yard that wasn’t a plastic monstrosity, even if they only use it a few times.

Actually, I’m sure it will be worth it. The kids love to play in the sand. Anyway, here are some pictures of the process.

Prepping the base

Building walls

Adding pavers for edging

Fixed bench

Closed

Open

XSS Sanitizer Grails Plugin

Well, earlier this week I published my first Grails plugin. I’m hoping that people will find it useful to add a general security plugin to parse out, and prevent XSS attacks on their website. It’s a long way from being done, but I think it’s a good start.

It uses OWASP’s ESAPI to strip out any unwanted script, iframe, and img tags that come in on the request. It also has the added benefit of doing this in a Java filter (in case you access the request via the HttpRequest) and the Grails “params” attribute.

Next steps are to write tests for each of the potential hacks on http://ha.ckers.org/xss.html to make sure they all pass. Plus, in my opinion, this is just a general replace of all values. There are potentially times when you might want to submit something that falls into one of these categories, and you feel that it’s safe to not have to filter it. So, I’d like to allow users to be able to annotate methods to allow/disallow the filter to run give a certain action.

Here’s a link to the source code:

https://github.com/tonyzampogna/XssSanitizer

If you would like to install it, just type:

grails install-plugin xss-sanitizer

If you are interested in contributing, please let me know. I’d love to have some collaboration.

Salamander

While visiting Pennsylvania recently, we found little salamanders like this one. They were a nice, bright orange.

We were just outside the Allegheny National Forest.

pennsylvania chameleon

Pennsylvanian Salamander

Click event slow in Chrome and Safari

Well, I came across an interesting quirk. Click events in Chrome and Safari were taking a couple of seconds before they were being fired. It was quite the head scratcher.

Here’s essentially what I was doing:

<script>
        $(".example").delegate("a", "click", function(event) {
            $("h2").toggle();
        });
</script>

<div class="example">
    <a href="#">
        Toggle Title
    </a>
    <h2>TITLE</h2>
</div>​

At first, I just changed the <a> tag to be a <span> tag, and that worked. But, I couldn’t figure out why an anchor tag was having this problem. I had been doing similar things in other parts of the application, and it was working fine.

When I made the simple script above in jsFiddle, I couldn’t reproduce it. So, I started pulling out things slowly.

That’s when I noticed it was something that Omniture was doing. I’m not sure I could tell why that particular element was being slow. My guess was maybe that it was nested too deep, and something Omniture was doing was making it slow.

Either way, the fix of changing it to a <span> tag seemed to fix it.

How to inject two or more dependencies with the same name

Let’s say you have two services named UserService and both are included in your Grails classpath. This can happen, for example if you have a “core” package, and an “application” package that extends services from “core”.

Here’s what that might look like in our case:

Well, if you try to use “UserService” in your Grails application like so, you will get an error saying that UserService cannot be found.

    def userService

That’s because there was a name collision on UserService.

Spring accounts for this, and allows you to define your class for each bean name. In Grails, we can define our beans in the grails-app/conf/resources.groovy file.

Here’s an example of what our resources.groovy file would look like:

beans = {
  // syntax is beanId(implementingClassName) { properties }
  // User Service
  coreUserService(com.company.core.UserService) {
    grailsApplication = ref("grailsApplication")
  }
  userService(com.company.usecase.UserService) {
    coreUserService = ref("coreUserService")
  }
}

Then, in your services, you can inject these services like so:


class UserController {
  def userService

  ...
}

// From your UserService, you can access the core UserService like this.
package com.company.core.UserService
class UserService {
  def coreUserService

  ...
}

Hopefully, that helps.

Goodbye galvanized iron pipe!

Well it’s taken forever but I’ve finally gotten rid of the last piece of galvanized iron pipe in my water supply line.

Here’s what the last shut-off valve looked like before I replaced it. The valve stem was pretty wobbly. Thinking back, I was always surprised that it didn’t start leaking.

In the picture below, the water from the street comes up through the floor. The pipe coming in from the street is copper. Then, it’s a galvanized iron shut-off valve, and finally it’s copper again.

Gavanized Iron Pipe Main Shut off

In order to replace it, I needed to shut the water off at the street. I borrowed a shut-off key and read up on how to shut the water off myself. I even watched a few videos.

The water shut-off valve to my house was about 5-6 feet down. The key was pretty long, though. I couldn’t see the bottom, since the pipe only a couple of inches wide. So, I felt around at the bottom for the valve with the key itself. I couldn’t find it right away like I was hoping too. There was too much stuff at the bottom. I had read that you can pour water down to have loosen it up, but instead I thought I would call the water company since there was no charge for them to come out and fix it. I was hoping they would spray some compressed air in there to clean it out, but instead they just poured water in there to loosen up the dirt. Oh well.

Once the water was off, I quickly went to work. I cut the old pipe out. I expected some buildup from the galvanized iron, but I had no idea it would be that bad. Here’s what the inside looked like.

Old Galvanized Iron Pipe

Old Galvanized Iron Pipe Close Up

After an hour or so, I had the new pipe on and I called the water company back to have the water turned back on. I hoped that I had my first shut-off sweated correctly, because it would have been embarrassing to ask them to shut it off again real quick.

I did have a small pinhole leak, but it was after my first shut-off. So, I gave the water company the thumbs up. Later, I fixed my leak.

Here’s the final product.

Shutoff After Fix

Our water throughput is much, much better now (as you might have imagined). We were able to run most things with moderate pressure before, but only one at a time. If somebody was filling the bathtub, you would get very low pressure in the kitchen. That no longer happens. So, it was a big win. I just wish (like most things) I had done it sooner.

Turkey Vulture

This is a picture of a turkey vulture that landed outside the window of my office in downtown Minneapolis, MN.

Turkey Vulture in Downtown Minneapolis, MN

The birds are back in town

It was a nice day today. Walking around the Como Lake, we saw all sorts of birds coming back from migration. There were loons, coots, mallards, and gulls. The red-winged blackbirds were in full chorus.

One of the coolest things was a mature bald eagle that surprised us overhead. We stopped walking to take a look at it, when all of a sudden its talons came out, and down toward the water it went. When it came up, it had a fish.

Eagles are still an amazing sight. Even though they are easier to spot, their size and the way they soar are always captivating in my book.