Sunday, 16 June 2013

Trying to running HuBot (and being stuck on ‘ERROR XMPP authentication failure’)

Sitting on a Starbucks in a Saturday morning (after dropping the kids on PSSA) it felt like a good time to try HuBot (repo is here).

Since I already had NodeJS installed on my test VM, I stated with the Deploying Hubot onto Windows instructions:

image

Running the installer, downloads a bunch of missing modules:

image

Which worked but, but when I started Hubot for the first time I had this error

image

I turned out to be because HuBot defaults to port 8080

image

… which I already had a server running there.

So after stopping that service, HuBot started with no errors

image

Since this is the first time I’m running HuBot I don’t really know what to do :)

image

And the browser didn’t help too:

image
image

Weirdly the main HuBot website didn’t had a ‘start here’ article, so I started digging through the documentation and found:

image

... which implied that /hubot/version was a valid url, which it was :)

image

So we know the HuBot is alive :)

I googled a bit and found http://server.dzone.com/articles/installing-and-running-hubot which looked like a good place to start:

image

I skipped the installation bit (since we already have HuBot installed) and started here

image

...which indicates that we should use the ‘hubot’ prefix to talk with Hubot

image

Good, HuBot is also alive from there :)

Next step was to install OpenFire and Spark, which you can read how I did it here

It this stage I tried to run the ./bin/hubot script, but I was missing CoffeeScript

image

After installing coffee-script

image

… I was able to execute .bin/hubot ok:

image

… and execute the next instruction from Deploying Hubot onto Windows which is hubot –c ./my-bot

image

This created a folder called my-bot in the .bin folder (UPDATE: this should had been done of the folder above (i.e. not inside the .bin folder)

image

... containing what looks like the contents of a Git repo:

image

The next steps from Deploying Hubot onto Windows  are to:

image

After making the config changes I executed npm install

image

... which failed because of this error:

image

... caused by the lack of python:

image

Here is the script I used to install python 3.3.2:

image

Here is the python shell being automatically picked up from the command line (which was not the default option in python install (you will need to manually check the box to add Python to system path)

image

But running npm install still fails because it doesn’t like the python 3.3.2

image

So I installed Python 2.7 with this script:

image

After the install I set the PYTHON environment variable to:

image

And now the npm install worked with just a couple warnings (note: I had to clear the node-gyp compilation cache before):

image

Trying to run HuBot (the custom my-bot one) gives this error:

image
image

.... which says that we need to install the node-stringprep module, which fails to install with this error:

image

The error above has nothing to do with node-stringprep , and related to the lack of this environment variable:

image

We’re getting close, now it starts the connection but we get an authentication failure

image

which I think is caused by the current environment HUBOT environment variables that I have setup

image

Lets change the authentication values to the credential used to connect to OpenFire directly using Jabber-net (see Using Jabber-net to talk to OpenFire post) :

image

And just to make sure, I added those values directly to the xmpp.coffee file

image

But the Authentication failure still happens:

image

Looking at the logs

image

in info.log

image

in jive.audit*.log (which looks like an xml)

image

So to see it I quickly wrote this script:

image

...which showed this formated view of the xml content:

image

... which unfortunately didn't help, because there were no any references to the o2-user account

Note: if I remove the preferredSaaslMechanism value, I get no errors or log messages:

image


STOPPING FOR NOW

At this stage I can’t spend more time on this, so I’m going to blog as it is and ask for help to the the HuBot community

Using Jabber-net to talk to OpenFire

After Installing Ignite’s OpenFire and Spark (IM server and client),  using Jabber-Net, I wrote a O2 Platform C# script to access OpenFire, which will:
  • Connect to a local OpenFire server
  • Login as a user
  • Find the HuBot room
  • Join that room
  • Post public messages to it
(see end of post for the source code)

NDepend Query to visualize call flows

After installing NDepend and writing a first simple CQL query, it was time to try something more interesting, namely a query that could help me write rules to find security vulnerabilities like SQL Injection.

So I decided to write a rule to find out the call flows into/from a particular method, ie ‘Who calls this method and who it calls?’

With NDepend enabled on the source code of TeamMentor/Master , I opened a class and chose this option:

Customizing my first NDepend CQL rule (Potentially dead Methods)

After Installing NDepend, I was looking at the rules execution result of TeamMentor/Master and saw that there were a result of 21 Potential dead methods:

Installing NDepend

After a nice correspondence with NDepend’s Patrick Smacchia who offered me a license of in exchange for some blog posts on how I used it, here is my first one covering the installation and first run

If don't know about NDepend, here are some references :

Trying DevExpress (install and uninstall)

Since I'm still not 100% happy with Resharper performance and system Impact, I just tried CodeRush from DevExpress

The rest of this post shows how I installed, used it and uninstalled CodeRush

Friday, 14 June 2013

AngularJS code editor using UI-Bootstrap and CodeMirror (done without using jQuery)

I’m adding a number of AngularJS views to TeamMentor, and here is a simple HTML based source code editor inspired on the How to Integrate Codemirror With Angular UI post and ui-codemirror repository.

In the end, these are the APIs I used:
And this is what it looks like:

Gource Visualisation of "TeamMentor Git Development - 18 Months in 180 Seconds"

Here is a pretty cool video of 18 months of Git commits using the Gource tool which is a software version control visualization tool.

Try to see it in full screen and at 1024p HD quality:

Wednesday, 12 June 2013

More TeamMentor UI Javascript trace and debug views

On the topic of TeamMentor UI debug helpers (see Opening up TeamMentor’s Javascript Trace Viewer which hooks TM method calls) here are a couple other useful options:

Opening up TeamMentor’s Javascript Trace Viewer which hooks TM method calls

If you are trying to debug (or understand) the TeamMentor’s Javascript layer, there are a number of debugging tools and options (in the /Javascript/TM/Settings.js file) that might help you:

Tuesday, 11 June 2013

Trying out NCrunch

Intrigued by Kofi’s NCrunch and TeamMentor post, and since today I had to write a number of Unit Tests, I decided to give NCrunch a test drive.

I downloaded the MSI, the install was smooth and next time I opened up VisualStudio there was a new NCrunch menu available:

Changing the way User Sessions are handled by TeamMentor (will be 3.3 Release HotFix 3)

One feature we introduced in TeamMentor 3.3 was the limitation of only allowing one user session to be active at any given time.

This had the nice side effect of 'preventing user account reuse'.

In practice, this meant that TM users had to stop using shared accounts (like the admin account), which was a good thing.

But, it created nasty side effects where the user can only be logged in once across all its devices. And an even worse side-effect happened when we implemented a SSO solution for a client, and we realized that for the cases where there was one SSO token shared across multiple users, we would have to create an TM account per user session!

So we went back to the Concurrent Logins Have Broken  issue, reopened it and changed it priority to P0 (which means that this will be another 3.3 HotFix)

The rest of this post shows the workflow that I took when making the code 3.3 HotFix #3 changes, testing them and pushing the new version to GitHub.

Fixing a couple bugs and pushing new TeamMentor 3.4 Dev Version (from 4 to 5)

This post shows one way to use GitHub to update the main development branch of TeamMentor.

At the moment TeamMentor/Dev repo  is at version 3.3 – Dev 4

The day CodingLab.org was born

After brainstorming about the idea of 'Open Library' for my RaspberryPi, Arduino, BeagleBone, Pyhton, CodeClub books and materials on the Chiswick High Road with Sarah (my wife), she come up with the name of Coding Lab, as a better way to present the concept to local venues (with the added idea of doing regular/monthly lab sessions in there).

So I:
and voila, here is the very first version of: http://CodingLab.org

Creating TeamMentor release 3.3.2 (3.2 version with HotFix 2)

Now that the two P0 issues are marked as fixed (after a round of QA):

Monday, 10 June 2013

'Open Library' for my RaspberryPi, Arduino, BeagleBone, Pyhton, CodeClub books and materials on the Chiswick High Road

Yesterday I 'dropped' 10 Python books to a friend's kid house with a 'take a look at these books and pick one that make sense to you' workflow (they are trying to use a RaspeberryPI and learn how to code in Python)

Later that day one of the kids asked me '... can we keep two?..' , which is always a good sign :)

This got me thinking that that some of my books (I have lot of them) deserve to be shared with more kids :)

Maybe I could have them 'somewhere' on the local Chiswick High Road (West London) as a kind of 'Public Geek Library' for kids (and adults).

This could also be a great location to put information about CodeClub and examples of what I'm creating with the kids that I am teaching every Wednesday.

Sunday, 9 June 2013

Installing Ignite’s OpenFire and Spark (IM server and client)

When testing HuBot, I needed an IM server and client

Since the HuBot install article that I was following recommended OpenFire and Spark, I decided to give it a test drive.

Here is how I installed and set it up on a local VM.

The first step was to get OpenFire from the Ignite's website:

A constant source of confusion: Simplicity

From this reddit I found the really interesting and thought provoking (long) post on A constant source of confusion: Simplicity

Simplicity is a topic that really matters to me, and is something that always try to do when writing code or creating APIs (like the ones in the O2 Platform, FluentSharp or TeamMentor).

That post has some great references, which are well worth a read:

Saturday, 8 June 2013

What is Privacy all about? ... its about 'not being surprised'

Privacy is one of those subjective topics that is hard to talk about, because everybody seems to have a different definition of it (which depends on culture, personal experience, current/past jobs and state-of-mind.

Recently I found a Seth Godin post (while reading Whatcha Gonna Do with That Duck? in the toilet) which really provided a great explanation of privacy.

The post happens to also be online (People don't truly care about privacy) and here is the key part:

Friday, 7 June 2013

Why the need to enable the use of OWASP chapter funds

I just send the text below to the OWASP Leaders list, which was part of this thread

My answer was to  Tim's comment and I started a new thread with it

-------------

Tim's solution (see below) is great and we should apply it now (using data from the last year). The only thing I would change is to remove the C (soft cap) and  P (hard cap). This would have a net positive result for all chapters (and not move the money to the 'OWASP mothership' which is a very sensitive topic).

For the ones really interested in this thread/topic, you should read the amazing Seth Godin's post Non-profits have a charter to be innovators which really explains why OWASP (as an organisation) as the DUTY and moral responsibility to spend its available funds, to experiment, to get things done, etc....)