Monday, 4 January 2010

Oops – wiped out the production server

I have the privilege (ha!) or managing our infrastructure for our development team.  This includes our source code server, our CI server, jira, wiki etc.

I decided for convenience these should all be virtual machines, running on one of the servers we rent from the very reasonable (and pretty helpful too!) http//ovh.co.uk.  I use the excellent proxmox GUI from http://proxmox.com to manage them all.

Anyway, we need another server as we are outgrowing our existing one (or will do soon), so I rented another one and have been in the process of experimenting –> re-installing –> experimenting cycle that a new box always encourages.

For convenience, I number the physical machines host, host1, host2 etc.  The new machine is called host, the existing production machine is host1.

OVH provide an excellent manager which remotely lets you re-install a (fairly large) number of preconfigured operating systems – one of which is proxmox, so for the fifteenth time I started the re-installation.  And then yes, you can see where this is going, yep – I had selected host1 instead of host thus wiping out all 12 of our development machines in one foul swoop.

GULP!

And no, there is no way to cancel the installation….

Returning to Martial Arts

I have studied martial arts on and off for about 10 years – the first 5 were the most continuous and intense.

I loved it – although I am the first to admit that the club I trained in wasn’t exactly official.  The instructor was very good, but we weren’t affiliated with any known body.  The style was that good old generic ‘kick boxing, tae kwon do, thai boxing’ that was all the rage :)

Anyway, I have decided to get back into it for a number of reasons:

  • it *really* helps with fitness.  I need to lose a couple of stone, and this is the quickest way I know how
  • helps keep depression and stress (both of which like to come knocking on my door) at bay
  • it is just really good fun getting into it with a bag!

As a practicing (I hate that word!) Christian I will be staying clear of any martial arts which have a spiritual dimension to them.  This is actually very hard and rules out a lot of the arts I would have chosen (aikido, bushido, kung fu for example).

My checklist for the art is as follows:

  • clear strategy for charting progress (i.e. belts/gradings).  I know they are meaningless, but I give up easily if I have cannot *see* the progression
  • include offense and defence and optionally weapons
  • focus on technique as oppose to ‘hit the other guy harder’
  • include sparring – I love semi-contact

Note: I don’t really care about it’s suitability for getting out of a ‘real fight’.

My checklist for the school is as follows:

  • an instructor I can learn from
  • enough students to provide a varied learning experience
  • friendly, but challenging
  • similar beliefs – i.e. egos left at the door

The checklist for the school is more important than for the art itself.  I definitely need the right external environment in which to learn – the subject matter in this case is less relevant, at least for the next year or so.

So, my journey continues/resumes.  From looking around my local area, I have two choices:

  • Taw Kwon Do
  • Jiu Jitsu

My concern about JJ is that it will turn into a ‘how to roll around the floor’ which I am not particularly interested in.  I get it’s potential, and I want it, but I want the offensive striking and the defensive throws as well.

My concern about TKD is that it doesn’t offer enough of the ‘intercept and throw’ skills – but I don’t really know enough about it.

Anyway, over the next few weeks I will either be visiting lots of different schools or I will have found one and studying there!  Tonight is (hopefully) http://www.martialartsleicester.co.uk/page/where_we_train.  I will let you know how I get on.

Wednesday, 12 August 2009

Cannot call an overloaded constructor (in a Java class) from Groovy (1.6.3)

So I have a Java class with two constructors. If I "call" one of them from Groovy, the code compiles but the constructor is never called. Nice.

Thursday, 6 August 2009

Hibernate - could be a bit brighter

I love Hibernate - I think it is great. I have seen, and made some hideous applications with Hibernate that run like a dog. With three legs. Two of which are broken, but in pretty much every case, the inefficiency has been down to the use of Hibernate, rather than Hibernate itself. I have no time for people who bash Hibernate because "it is slow". It isn't. It is a tool which needs to be used properly. Almost all the projects I have worked on that have used Hibernate have also included custom JDBC. Anyway, just occasionally, Hibernate wants to make me rip my hair out in frustration. The latest example... I issue the following hql:
select session.id from Session session where session.mask is null or session.mask.id=8013
and I get back no results. Strange, I look in the DB and there are plenty of Sessions with null masks. Hibernate generates the following SQL:
  select
      session0_.id as col_0_0_
 from
      t_session session0_,
      t_mask mask2_
  where
     session0_.mask_id=mask2_.id
      and (
          session0_.mask_id is null
          or mask2_.stream_id=8013
      )
  order by
      session0_.start_date
1 prize for spotting the *stupid stupid stupid* assumption that hibernate made. The solution is to issue the following hql:
select session.id from Session session left outer join session.mask sessionMask where sessionMask is null or sessionMask.id=8013
which issues:
  select
      session0_.id as col_0_0_
  from
      t_session session0_
  left outer join
      t_mask mask1_
          on session0_.mask_id=mask1_.id,
      t_resource resource2_
  where
          mask1_.id is null
          or mask1_.stream_id=8013
  order by
      session0_.start_date
I am sure the manual warns you about this, but really. Hibernate, come on.

Thursday, 11 June 2009

Apple/itunes/iphone - fantastic when it works, horrific when it doesn't

Update: DO NOT DO THIS! This process kept the photos, but lost the music :(

My wife's laptop crashed so we found a spare computer for her. Being the optimistic sort I installed itunes and plugged in her iphone thinking "it will just copy the music/photo collection from the iphone". Does it my rear end!

I cannot believe Apple make it so hard, Apple make it impossible - there is just no way to update your computer from your iphone. Syncing offers to wipe out your iphone! How hard can it be! I am just speechless.

At least there is no way to do it *officially*.

Long story short you need to:

- use itunes to backup the iphone (it will do this even if you haven't synced it - right click on the phone under devices and choose "Back Up") - jailbreak your iphone (which luckily I had done on a previous iphone) - install ftp - copy all the data manually onto the new computer - sync

Lame lame lame.

And yes, jailbreaking does prevent the iphone being upgraded to v3.0 when it rolls out, but I don't really care because co-incidentally a shiny new one will be arriving tomorrow courtesy of the fact it was dropped last week and the 7 or 8£ a month I pay to o2 insurance :)

Wednesday, 10 June 2009

NO! O2 - I (might) hate you!

I love the iphone.  Yeah, I know, sad but true.  I purchased the first generation, and then the iphone3g when it came.  I also bought one for my wife.

I didn't mind paying the mega bucks as I knew that early adopters usually got the chance to upgrade to the next gen.  Not so with the iphone 3G S it appears, at least not according to <a href="http://www.phonesreview.co.uk/2009/06/09/o2-customers-furious-at-iphone-3g-s-upgrade-costs/">this link</a>.

Really?  Are O2 that short sighted - I won't be upgrading on principal (I don't really need the new model, just the new OS), so what incentive is there for me to spend mega bucks? 

O2 really need to understand that people like me don't mind spending money, we do mind not feeling special.  I just want to know that I am getting some sort of loyalty discount.

The <a href="http://shop.o2.co.uk/update/paymonth.html">pay monthly cost</a> has also increased - I pay ~£35/month and didn't pay for my handset, now for the same monthly cost I will need to spend an extra £184.98!!!  OK, the disk space has doubled, but I don't need any more disk space!

Sigh.

When the iphone came out it was exciting for two reasons:

 - it was a fantastic piece of kit in itself (both the hardware and OS).  It was a paradigm shift from a phone with a few extra apps to a mini computer with a phone
 - it set a new level for the competition

I would hope the competition has had time to react and respond with alternatives.  Maybe I will start checking them out.

Monday, 8 June 2009

Apache Tomcat service fails if running on a 64bit JVM

Our deployment platform is Windows 200x, 64 bit. Don't ask why - I too am a Linux fan boy. Anyway, installing tomcat as a service works, but trying to start said service fails. Turns out that unless you want to jump through a few hoops you need to install the 32bit JDK. (don't forget to update the windows environment variable and then open a new console to pick up the new environment variable ;))