Engineering Menagery

The only winning move is not to deploy.

Leave a comment

Resolving getting kicked out of BF4 multiplayer and back to the loading screen after 2-20 seconds


This is quite a simple post but tons of people are having this problem as evidenced by posts on Reddit and EA below

I managed to resolve it but not in the normal way, The issue started happening to me when i moved my install directory to a new SSD drive and had origin re-initialize it using instructions found here

After i did that BF4 would never stay in Multiplayer for longer than a few seconds, campaign was fine.
They mention several solutions in the posts above

  • Re-install all the DirectX redistributables by deleting them from the BF4 folder and then performing a Repair Install [DIDNT WORK FOR ME]
  • Update to the latest version of PunkBuster [DIDNT WORK FOR ME]
  • Install the DirectX redist yourself [DIDNT WORK FOR ME]
  • Shut down your Antivirus (I have Avast) [DIDNT WORK FOR ME]

I resolved the problem by renaming the folder to “C:\Program Files (x86)\Origin Games\Battlefield 4” to “C:\Program Files (x86)\Origin Games\B” and downloading the game all over again overnight.

I then compared the directories to see if they were different, and they were identical except for the PB folder (the SSD version had an upgraded PunkBuster), there was also a file called layout.toc that was different but i have no idea what thats for (and it is binary).

Everything works perfectly now.

I can only assume that there is something that the full install reinitializes that is required for Multiplayer to work!



Leave a comment

Map Reduce Plugin for Kepler and Galileo on Hadoop 0.20.2.cdh3u6


As many of you may know its not the easiest thing in the world to get your map reduce plugins working for a particular version of your distribution.

The surefire way is just to build it manually

If you have this version of CDH then just download the file below, otherwise, here’s how you do it

Step 1

Download Eclipse 4.3 or Eclipse 3.5

Step 2 – Importing the MapReduceTools project

  • If you have hadoop installed in /opt/hadoop then the source code for the plugin is in /opt/hadoop/src/contrib/eclipse-plugin
  • Open Eclipse and click File ->Import
  • Select General->Existing Projects into Workspace and click Next.
  • Browse to /opt/hadoop/src/contrib/eclipse-plugin
  • Click Finish

Step 3 – Configuring the MapReduceTools project

  • Right click on the Project and click Build -> Configure Build Path
  • Switch to the “Libraries” tab
  • Double click on the hadoop-core[version].jar file (it will have a red X because its not found, we’re going to substitute our version)
  • Browse to /opt/hadoop/lib and select hadoop-core[version].jar (whatever version you are running)
  • The ant build script will now be able to find the hadoop libraries so that you can compile the plugin

Step 4 – Modifying the MANIFEST

Under META-INF/MANIFEST, modify the file to include the additions in blue

NOTE : Your jar files may have different versions (i.e jackson-mapper-asl-1.5.2.jar instead of jackson-mapper-asl-1.8.8.jar)
You must use the version that is in your /opt/hadoop/lib

NOTE : If you are building a version of the plugin that is not close to the version described in the post there may be MORE or LESS libraries required for it to work.
In order to find the required libraries needed at runtime for your version of the plugin, perform the following iteration loop

  • Start eclipse with the -clean option
  • Switch the perspective to Map Reduce
  • Expand the Map Reduce elephant icon
  • If you recieve an error popup check to see if it says “ClassNotFound” in the error inside Eclipse
  • Also check the logs, errors appear in {ECLIPSE_WORKSPACE}/.metadata/.log
  • Use FindJar to search for the JAR file that the ClassNotFound error is referring to (
  • The jar should be in /opt/hadoop/lib
  • Add it to the jars below (and at the relevant area in Step 5)
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MapReduce Tools for Eclipse
Bundle-SymbolicName: org.apache.hadoop.eclipse;singleton:=true
Bundle-Version: 0.18
Bundle-Activator: org.apache.hadoop.eclipse.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
Eclipse-LazyStart: true
Bundle-ClassPath: classes/,
Bundle-Vendor: Apache Hadoop

Reasoning behind having to make this change is this is that the original devs used -D parameters to achieve the same thing but this is just as straight forward.

Step 5 – Modifying build.xml

Modify the build.xml file to look like below, remember to add any additional jars that you figured out in Step 4.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   See the License for the specific language governing permissions and
   limitations under the License.

<project default="jar" name="eclipse-plugin">

  <import file="../build-contrib.xml"/>

  <path id="eclipse-sdk-jars">
    <fileset dir="${eclipse.home}/plugins/">
      <include name="org.eclipse.ui*.jar"/>
      <include name="org.eclipse.jdt*.jar"/>
      <include name="org.eclipse.core*.jar"/>
      <include name="org.eclipse.equinox*.jar"/>
      <include name="org.eclipse.debug*.jar"/>
      <include name="org.eclipse.osgi*.jar"/>
      <include name="org.eclipse.swt*.jar"/>
      <include name="org.eclipse.jface*.jar"/>

      <include name="*.jar"/>
      <include name="com.jcraft.jsch*.jar"/>
       <path id="hadoop-lib-jars">
       <fileset dir="${hadoop.root}/">
       <include name="hadoop*.jar" />

  <!-- Override classpath to include Eclipse SDK jars -->
  <path id="classpath">
    <pathelement location="${build.classes}"/>
    <pathelement location="${hadoop.root}/build/classes"/>
    <path refid="eclipse-sdk-jars"/>
    <path refid="hadoop-lib-jars" />

  <!-- Skip building if eclipse.home is unset. -->
  <target name="check-contrib" unless="eclipse.home">
    <property name="skip.contrib" value="yes"/>
    <echo message="eclipse.home unset: skipping eclipse plugin"/>

 <target name="compile" depends="init, ivy-retrieve-common" unless="skip.contrib">
    <echo message="contrib: ${name}"/>
     <classpath refid="classpath"/>

  <!-- Override jar target to specify manifest -->
  <target name="jar" depends="compile" unless="skip.contrib">
    <mkdir dir="${build.dir}/lib"/>
      <copy file="${hadoop.root}/hadoop-core-${version}.jar" tofile="${build.dir}/lib/hadoop-core.jar" verbose="true"/>
      <copy file="${hadoop.root}/lib/commons-cli-${commons-cli.version}.jar" todir="${build.dir}/lib" verbose="true"/>
      <copy file="${hadoop.root}/lib/log4j-1.2.15.jar" todir="${build.dir}/lib" verbose="true"/>
      <copy file="${hadoop.root}/lib/commons-httpclient-3.1.jar" todir="${build.dir}/lib" verbose="true"/>
      <copy file="${hadoop.root}/lib/commons-lang-2.4.jar" todir="${build.dir}/lib" verbose="true"/>
      <copy file="${hadoop.root}/lib/jackson-core-asl-1.5.2.jar" todir="${build.dir}/lib" verbose="true"/>
      <copy file="${hadoop.root}/lib/jackson-mapper-asl-1.5.2.jar" todir="${build.dir}/lib" verbose="true"/>
      <copy file="${hadoop.root}/lib/guava-r09-jarjar.jar" todir="${build.dir}/lib" verbose="true"/>
      <fileset dir="${build.dir}" includes="classes/ lib/"/>
      <fileset dir="${root}" includes="resources/ plugin.xml"/>


Step 6 – Modifying contrib-build.xml

Make the additions below to point at your hadoop version and eclipse directory respectively.

<project name="hadoopbuildcontrib" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="name" value="${}"/>
 <dirname property="src.contrib.dir" file="${ant.file.hadoopbuildcontrib}" />
 <property name="root" value="${basedir}"/>
<!-- Load all the default properties, and any the user wants    -->
 <!-- to contribute (without having to type -D or edit this file -->
 <property file="${user.home}/${name}" />
 <property file="${root}/" />
<property name="hadoop.root" location="${src.contrib.dir}/../../"/>
 <property name="version" value="0.20.2-cdh3u6" />
 <property name="eclipse.home" value="/devel/apps/eclipse" />
 <property name="src.dir"  location="${root}/src/java"/>
 <property name="src.test" location="${root}/src/test"/>
 <property name="src.examples" location="${root}/src/examples"/>
 <!-- Property added for contrib system tests -->

Step 7 - Build the plugin
  • Inside Eclipse, right click on “build.xml” in your project and select “Run As“->”Ant Build
  • Your plugin should be built into /opt/hadoop/build/contrib/eclipse-plugin

Thats it, after this just copy and paste the plugin JAR file to /YOUR_ECLIPSE_DIR/plugins and restart Eclipse! (Remember to use -clean if you have been messing around a lot!)

Hope someone finds this useful 🙂

Leave a comment

Dating a Yamaha Guitar

In order to date my recently acquired Yamaha AES1500, i needed to wade through Yamaha’s documentation

They have two links which i found handy

One for Electric Guitars, Arch-tops and Basses

and one for Acoustic and Classical Guitars…

These document contains almost all of the most well known serial number formats – all documented for you – thanks Yamaha!

The basis of all Yamaha serial numbers is the following alphabetic legend which i have excerpted from the document, with H thru P being 1 to 9 and Q being zero. X, Y and Z are just 10,11 and 12 (?)

serial number electric color corrected

Anyway, all you need to do is find your pattern somewhere in the larger list of serial number formats and then try and match it up with some information that you already know about your guitar..

So for instance..

  • My serial number is QPH031I
  • I know the AES1500 was manufactured in Japan
  • I know the AES1500 was manufactured between 1991 and 2009 before being discontinued
  • My pattern is 3 letters and 3 digits followed by one letter

The closest (in fact exact :-)) match is System #E10 from the first link – shown below

electric e7 color corrected

So with that in mind, i have



Q=2000P=9 (2009)
H=1 (January)
031=31st Unit
I=Internal Code

So i’m pretty sure my Guitar was the 31st AES1500 built in January 2009!

Hope this helps other folks work this out – i mean its simple really – but it never hurts to write it out 🙂

[Image courtesy of Yamaha]

[Copyright © 2013 Yamaha Corporation of America and Yamaha Corporation. All rights reserved.]

Leave a comment

Permissions of tmp and cache folder in rails for NGinx (To resolve access denied)

You might find that your tmp folder inside your Rails Application always creates files and folders for the Rails cache using the same user and group as the process running NGinx/Passenger.

In order to have your cache always created with a group of www-data you need to do the following

cd yourrailsapp
chgrp www-data ./tmp
sudo chmod g+s tmp

The sudo is required usually.

This sets the group id on your folder so that everything underneath tmp gets created with the correct permissions forever more. yay!

Leave a comment

MySQL 5.1 Install on WIndows 7 64 bit with Ruby on Rails (RailsInstaller)

This should get you up and running with the tutorial on this page which otherwise would not work with Windows 7 64 bit

1. Install MySQL 5.1.63 to C:\devel\opt\mysql51 – (YOU MUST INCLUDE THE DEVELOPER LIBRARIES)

2. gem install mysql2 –platform=ruby — ‘–with-mysql-lib=”C:\devel\opt\mysql51\lib\opt” –with-mysql-include=”C:\devel\opt\mysql51\include”‘

3. Copy C:\devel\opt\mysql51\bin\libmysql.dll to C:\RailsInstaller\Ruby1.9.3\bin