RSS Feed Subscribe to RSS Feed

 

Maven (mvn) build hanging

I recently had a problem with a maven build hanging when doing a ‘mvn install’.

I found some pointers in this post, and posting here in a modified form: http://forum.spring.io/forum/spring-projects/roo/121725-what-diagnostic-action-to-take-when-maven-hangs

1. In the hanging shell, hit CTRL-Z – this will suspend the program and give you a pid. An alternative way to get the pid is to do a “ps -ef” and search for you mvn command e.g. “clean install”
2. type bg [ENTER] – this will send the program to the background
3. Do a kill -3 of the process – it will dump a large amount of text – make sure your command line terminal history window is long enough to capture it all – will be several thousand lines of text
(alternative to #3 – you can try jstack with the pid, it is a Java stack trace generator)
4. You can see what threads are waiting on other threads from there (maybe, sometimes it’s a tight CPU loop)

Tags: ,

URL Encoding

URL encoding, also known as percent encoding, takes certain “reserved” characters and standardizes (or canonicalizes) them.

Why? This is normally done when transmitting data in html forms. For example, the # character has a special purpose in html (as an html anchor) and so is converted to make it clear that it is part of that data, not part of the html document where it is to be displayed.

Another (related) use is for prevention of XSS attacks. If your web page allows a user to enter text (for example, a comments box on a blog), it would be very easy for a motivated user to enter malicious text that will be interpreted as a script.

(more…)

Tags: , , , ,

Copying keys to a new laptop

If you use GPG (which I have written about before) and start using a new laptop, you will need to copy your keys over.

While it is possible to copy just your personal key, I prefer to also copy other people’s (public) keys too, and my entire trust database. To do this is fairly simple…

(more…)

Tags: , , , ,

Git revert a merged branch

The article discusses how to revert changes that have already been pushed to your remote git branch, particularly reverting the changes that come from a branch merge.

(more…)

Tags: , , , ,

Don’t use “kill -9”

In the past, any time I wanted to stop an errant process on unix, I just used “kill -9”. By default. Without thinking about it much.

Then a colleague commented to me that you should never use kill -9. It terminates the process with no chance to shutdown in an orderly manner, and so can leave things in a bad state, such as corrupting files. “But what else am I supposed to do!?” I naively asked.

There are of course many other options for the kill command (see links below), but here are some alternatives you can try, in the order you may want to try them.

(more…)

Tags: , , ,

Creating a Maven multi module project

There is no easy way, or simple archetype, to create a maven multi module project. The approach below is the best way I’ve found so far.

(more…)

Tags: , ,

“Ship It!” talk at the Boise Code Camp

Slides for my “Ship It!” talk at the Boise Code Camp in Boise State University today: https://www.slideshare.net/shaunabram/ship-it-boise

Tags: , , , , , ,

Copy & Paste buffer

Why be only limited to have a single item in your Copy & Paste buffer?! There are several tools out there that can do this, but my favorite (on the mac at least) is Butler.

(more…)

Tags: ,

Switched to HTTPS

I recently switched the WordPress and domain name hosting for this blog from Bluehost to SiteGround, and enabled https in the process.

(more…)

Tags: , , , ,

GPG

I use GPG (Gnu Privacy Guard) for email encryption. GPG is an OpenPGP implementation. If you would like to send me an encrypted email, my public key can be found at https://keybase.io/shaunabram. I also have some keybase invites available, if you are interested.

(more…)

Tags: , , , ,