Issues with the Ruby Bamboo Plugin and Windows

Posted in Ruby
June 11, 2014

A quick tip if you’re having issues with the Ruby Bamboo Plugin where your Ruby installation is not showing up in the list of “Server capabilities” in Atlassian Bamboo. I struggled with this issue for a while and after digging through the Bamboo logs, I realized that the plugin was throwing an error when it tried to load JRuby as a server capability – I didn’t have JRuby installed.

The solution for now, is to just install JRuby alongside your normal Ruby installation – make sure that the bin folder is in your environment path as well! Once you install JRuby and add the path variable, restart Bamboo and hit “Detect server capabilities” again and your two Ruby installations should show up.

It appears as this is actually a bug with the plugin. I’ve logged a issue on the Github project page.

Errors with Atlassian services starting on a 64 bit windows server

Posted in Other
June 10, 2014

This is a quick tip if you’re having issues with getting the Atlassian Bamboo (or any other Atlassian product for that matter – Jira, Crucible, Fisheye etc) Windows service to work on your Windows server after a new install or an upgrade. I recently upgraded our Bamboo at work and got the following error when I tried to start the service:

The Atlassian Stash service could not be started. A service specific error occured: 1.

And the Windows event viewer reported the following error:

The Atlassian Stash service terminated with service-specific error Incorrect function.

The funny thing was that if I started Bamboo with the start-bamboo bat file, it worked perfectly. After searching the internet furiously, I eventually stumbled upon an article that was for Atlassian Stash but seemed relevant to Atlassian Bamboo too (it was the same error I was getting).

The fix was simple, the installer for Atlassian Bamboo came with the 32 bit binaries of Tomcat and we were running on a 64 bit machine. I had to swap out the Tomcat binaries with the 64 bit versions and the service started perfectly! To do this, find your ../bin folder and replace the tomcat7.exe and tcnative-1.dll with the 64 bit version.

Here are the 2 articles that helped me for your reference:

* https://confluence.atlassian.com/display/STASHKB/Stash+service+(64-bit)+fails+to+start+-+not+a+valid+Win32+application
** https://confluence.atlassian.com/display/STASH/Running+Stash+as+a+Windows+service

Coldbox interceptor to redirect traffic from HTTP to HTTPS

Posted in Coldfusion
August 19, 2013

I needed a solution at work to redirect HTTP traffic to the HTTPS version of a website. The site is built on ColdBox and I did manage to find a plugin to do exactly this, the problem was that I couldn’t get it to work properly and it did not allow me (as far as I could tell) to turn SSL off in my development environment and on in the live environment. So I wrote a quick interceptor for ColdBox that works quite nicely and allows me to do everything I need to.

component extends="coldbox.system.Interceptor" {

	public function configure() {}

	public function preProcess(event, interceptData) {
		if (getSetting('useSSL')) {
			if (len(getSetting('AppMapping')) <= 1) {
				var path = "https://#cgi.HTTP_HOST#/index.cfm";
			} else {
				var path = "https://#cgi.HTTP_HOST#/#getSetting('AppMapping')#/index.cfm";
			}

			if (len(cgi.path_info) > 0) {
				path &= cgi.path_info;
			}

			if (isBoolean(cgi.server_port_secure) && !cgi.server_port_secure) {
				setNextEvent(uri=path, ssl=true, statusCode=302, queryString=cgi.query_string);
			}
		}
	}
}

You’ll notice that I do a getSetting(‘useSSL’). This is a setting that I have defined in my Coldbox.cfc config file that I turn on in production and off in development.

Upgraded to Mountain Lion… finally!

Posted in Tech
August 10, 2013

It took me a while, but I finally took the leap of faith and installed OSX 10.8 – Mountain Lion. First impressions are really good. I am loving the notification centre with new touchpad gestures, the messages application, iCloud and social integration and the updates that Apple gave to the mail app.

With this upgrade I’ve decided to start embracing the full Apple product suite more, ¬†from iCloud (never really used it properly before) to remote syncing for iTunes and more of the OSX software like mail.app and Safari. I’m also really liking airplay between all the Apple devices in my house.

Bring on Mavericks in a few weeks time, I’m definitely upgrading as soon as it arrives! Maybe it’s actually time to get that Apple developer license I’ve always wanted.

Dual external monitors on a non retina display MacBook Pro

Posted in Tech
August 9, 2013

At work we’ve recently been given two really sleek LG LED 23″ monitors that we connect to a Dell docking station and run side by side. We all have high spec Dell laptops and it works great! In the past we used to just connect a single display to our laptops and use our laptop display as the main display and the external display as an extension.

Since switching to this setup my life has been changed forever. I can’t believe how much of a difference it makes having the same two monitors side by side with the same resolutions. Not only does it look great and fluid, it’s awesome to work on.

At home pretty much everything is Apple including my notebook, I have a 13″ MacBook Pro (late 2011 model), and I want need the same setup as I just described above. So I’ve been doing some research and unfortunately the options with MacBooks are really limited:

  1. Buy two thunderbolt displays which you can chain together. Problem is that they are hellishly expensive and not really an option right now. A single display maybe, but not two. So I’m ruling this option out.
  2. Buy a retina display MacBook Pro. They have two thunderbolt ports and you can easily connect two displays to them. I’ve wanted a retina display MacBook for a long time now, but we’ve just bought a house and this is probably not an option right now either :’(
  3. USB to DVI adapter. This is probably the most realistic solution for me right now, but from what I’ve been reading around forums, it can be extremely slow. Essentially it’s limited by the speed of the USB port and the adapter contains its own GPU.

There was one other solution I looked in to that turned out to be bogus.

  1. USB to HDMI adapter. If your MacBook has an intel graphics card it will only be able to support one external monitor (through the thunderbolt port). The reason why the USB to DVI adapter solution above will work is because it has its own GPU in the adapter.

What I’ve decided to do for now is wait it out until I get a retina MacBook. It sucks, but at present the only viable solution would be the USB to DVI adapter and that feels half-baked.

Thread safe variables in a Coldfusion Component

Posted in Coldfusion
August 8, 2013

When creating Coldfusion components, you need to be careful that you protect your variables from being overwritten and accessed by other requests or threads. If you don’t, you could see some really weird behavior in your application. Luckily, it is really simple to make your variables thread-safe by var’ing them.

The example below uses CFScript but can be easily translated to the tag based language.

component {
	function yourFunction() {
		var declaration = "value";
	}
}

Notice the var keyword at the start of the variable declaration.

The main thing for me is to remember to var the variables in the first place! I often-times forget to do this (thank the Pope for code reviews).

Scout – live SASS (and Compass) build tool

Posted in HTML / CSS
August 7, 2013

In the past to build my SASS files I have always used the command line and/or an Ant script to do the dirty work for me. While this solution works well, I got tired of writing build scripts for small projects when they are not really necessary.

Today I stumbled upon Scout. It’s a free, cross platform tool which does live building of your SASS/Compass scripts as you save the source. So far it’s working well. I did have a few issues with slowness on my Windows machine at work (it runs fine on my MacBook). For some reason the application takes a long time to respond to click events, but other than that it builds my SASS files nicely and is really simple to use.

The other nicety of Scout is that it works well with Compass too. While I haven’t done much with Compass as of yet, I definitely plan on using it in the future. From reading some short tutorials and the docs, it looks really powerful.

I’m still looking for a decent Sublime Text plugin to build my SASS files, I’ve yet to find one that works well. For now, Scout and Live Reload are an unstoppable combination :)

Get Package Control to work with the Sublime Text 3 beta

Posted in Editors
August 6, 2013

I’ve recently upgraded to the Sublime Text 3 beta and as with any installation of Sublime Text, the first package that should be installed is “Package Control“. I only discovered its awesomeness recently and realized how much I’ve been missing out on. In short if you’re not aware of Package Control, it allows you to easily install, remove, enable, disable etc Sublime Text packages.

When installing Package Control on Sublime Text 3 beta, I’ve found that in 66% of my installations (I have 3 machines and tried installing it on all of them) it does not work by running the single command that is provided on the installation page – 2 out of my 3 installs failed. The reason why it doesn’t work is detailed here as well as how to get it working on Sublime Text 3 beta.

If you’re just wanting the quick command to get it working, go to your Sublime packages directory in a *nix terminal or git bash console on Windows and run the following commands.


git clone https://github.com/wbond/sublime_package_control.git "Package Control"
cd "Package Control"
git checkout python3

Basically the command clones the repo to your packages directory, and lastly checks out the branch called python3 which is where the development for Sublime Text 3 beta is happening.

If you don’t learn Javascript, you’re going to get left behind!

Posted in Javascript
May 17, 2013

The official first day of the CF.Objective() conference has wrapped up and it was a pretty awesome day. There were lots of excellent talks by excellent developers in the ColdFusion and Javascript communities.

My big “take home” for the day was that it is becoming essential for every web developer to learn how to write Javascript properly, not just hack some jQuery together.

The day started off with the opening keynote address that was done by Dan Callahan from Mozilla and he talked about why you should learn to code with Javascript. He focused on Javascript performance, Firefox OS, mobile Javascript apps and the increasing popularity of the language. It really hit home for me and I couldn’t agree more with him on this. Needless to say, I spent most of my day on the JS Objective track.

As the web grows, browsers become more powerful and mobile web traffic increases so is Javascript becoming more useful and popular. Javascript has come a long way since the early days of the web and these days there are all sorts of applications built with it from 3D games to mobile apps.

So why should you (and I) learn to code Javascript properly?

  • Javascript is fast and getting faster
  • It is cross platform and works across browsers, mobile browsers, operating systems etc.
  • You can build mobile applications with it
  • Useful APIs – Javascript can now make a phone vibrate for example!
  • There is a great Javascript community
  • Tons of useful libraries from PDF renderers to physics engines and charting libraries
  • Many good frameworks for writing good clean code and MV* type applications

Those are just some of the many reasons why we should learn to code in it. I definitely get the feeling that in a few years time it’ll replace the current popular web programming and scripting languages when it comes to displaying and manipulating data (on the front end).

I’m looking forward learning more Javascript goodness at tomorrows talks!

CF.Objective() 2013 ColdFusion conference

Posted in Coldfusion
May 15, 2013

cfobjective 2013

If you follow me on Twitter or Facebook, you’d have noticed that I arrived in the USA last week Friday and have spent the past few days in northern Idaho visiting a good old friend of mine. I had a really good time in Idaho and would loved to have stayed longer, but the main reason I am visiting the States is to attend the 2013 CF.Objective() conference. I’m currently writing this blog post from the Denver International airport, waiting to board a flight to Minneapolis.

The conference starts tonight at the Radisson Blu hotel in Minneapolis and if you have not heard about it before, it’s the number 1 ColdFusion conference worldwide. This year there is a really strong speaking line up and some interesting talks. Check out the official conference website for the schedule and more info.

If you’re attending the conference, hope to see you there!