404 Not Found

Not Found

The requested URL /spam2/p002.txt was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Category: Web Programming

Speaking at JSConf EU 2014

By , Tuesday 4th November 2014 11:44 am

In September 2014 I have the privilege to speak at JSConfEU 2014. Here’s the video:

Book Review: Instant Mock testing with PowerMock

By , Sunday 5th January 2014 7:23 pm

I was recently asked to review “Instant Mock testing with PowerMock” by PacktPub. Part of their “instant” series which aims to get you up and running with a project quickly. My review follows.

Continue reading 'Book Review: Instant Mock testing with PowerMock'»

NGINX configuration for proxing to websocket/nodejs processs

By , Friday 29th November 2013 11:06 am

Here’s a simple configuration to allow nginx to proxy through to another process including forwarding websocket traffic.

A simple set up currently in use to proxy to a nodejs process which is also serving HTML. I’d like to improve the config so that nginx serves static content, but will look to do that later.

Improvements, suggestions please add to the comments (…and thanks).

server {
    listen 80;
    server_name example.com;
    return 301 https://example.com$request_uri;
}

server {
    listen       443;
    server_name  example.com;

    root /var/www/html/public;

    ssl                  on;
    ssl_certificate      /etc/ssl/private/ssl.cert;
    ssl_certificate_key  /etc/ssl/private/ssl.key;

    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers   on;

    proxy_connect_timeout 43200000;
    proxy_read_timeout 43200000;
    proxy_send_timeout 43200000;

    if ($ssl_protocol = "") {
        rewrite ^ https://$host$request_uri? permanent;
    }
    try_files $uri @proxysocket;

    location / {
        proxy_pass http://127.0.0.1:3000/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Protecting node.js from BEAST TLS attack

By , Friday 7th June 2013 6:56 pm
Copyright Disney, I don't think they'll sue me. Thanks for the image.

Copyright Disney, I don’t think they’ll sue me. Thanks for the image.

After reading Eric Martindale‘s very useful blog post on “Mitigating TLS BEAST attack in node.js” I decided to implement this for pinitto.me in order to increase security of the site.

After implementing the suggested code I then attempted to test the SSL setup via SSLLabs.  Sadly the report came back showing that pinitto.me was still vulnerable to BEAST attacks.

A BEAST (or Browser Exploit Against SSL/TSL) attack is an attack where a third party can silently decrypt communications between a browser and a server. This is performed by attacking a weakness in CBC (cipher block chaining) discovered back in 2006 but with a practical exploit not found until late 2011.

BEAST attacks are not possible on TLS versions greater than 1.0 but as this version is currently the most predominant on the internet such attacks are possible on most unprotected servers.

The documentation on SSLLabs.com suggested a different set of ciphers to those suggested by Eric and so after implementing these pinitto.me is now reported to not be vunerable to these attacks, yey!

The code for setting up a HTTPS server on node.js therefore becomes:

var https = require('https')
  , fs = require('fs')

var options = {
   key: fs.readFileSync(config.ssl.key, 'utf8'),
   cert: fs.readFileSync(config.ssl.cert, 'utf8'),
   ca: fs.readFileSync(config.ssl.ca, 'utf8'),
   ciphers: 'ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH',
   honorCipherOrder: true
}

https.createServer(options, function (req, res) {
  res.writeHead(200)
  res.end("Hello World!")
}).listen(443)

Notes

Generate a self-signed certificate

By , Monday 20th May 2013 9:21 am

Quickly generate a self-signed certificate on the command line. Noting this information as the original source has disappeared and its handy to have around.

mkdir -p /etc/certs
openssl req -new \
            -x509 \
            -days 3650 \
            -nodes \
            -out    "/etc/certs/EXAMPLE.COM.pem" \
            -keyout "/etc/certs/EXAMPLE.COM.key" \
            -batch -subj "/CN=EXAMPLE.COM"

# ensure that the files are readable 
chmod o+r /etc/certs/EXAMPLE.COM.*

XMPP-FTW now supports Superfeedr

By , Sunday 12th May 2013 5:07 pm

Summary

As of version 0.9.0 xmpp-ftw now supports the Superfeedr XMPP API. If you don’t know what Superfeedr is then read this shamelessly stolen description from Crunchbase:

Superfeedr fetches and parses RSS or Atom feeds on behalf of its users and then pushes them the new entries in these feeds. Superfeedr implements most of the current Real-time technologies and guarantees an entry detection time inferior to 15 min. Superfeedr has both an XMPP and a PubSubHubbub API.Read more: http://www.crunchbase.com/company/superfeedr#ixzz2T6A0Grml

The XMPP-FTW interface to Superfeedr is built off their documentation which can be found here: http://superfeedr.com/documentation#pubsubhubbub.

Continue reading 'XMPP-FTW now supports Superfeedr'»

Expose github README.md at a path using express middleware

By , Sunday 24th March 2013 10:33 pm

I’ve just published the first version of a new middleware package I’ve written to expose your project’s README.md via express.

To install simply run:

npm i --save express-middleware-readme.md

Continue reading 'Expose github README.md at a path using express middleware'»

Talking at the first XMPPUK Event – March 2013

By , Wednesday 13th March 2013 8:37 pm

We had the inaugural XMPP/realtime meetup held at Mozilla London on the 13th March which was sponsored by my employer Surevine.

At Surevine we believe that XMPP has a very important place in the future of the web and this goes hand-in-hand with realtime technologies too which is why we’ve started this meetup which will hopefully grow into its own entity.

I’ve written a blog post up on the Surevine website about the event which I suggest you read if you are interested. This also contains details about finding out more about the event and where to get information on future planned events too.

Continue reading 'Talking at the first XMPPUK Event – March 2013'»

New demo system for XMPP-FTW

By , Sunday 10th March 2013 6:39 pm

Originally seen on http://awesome-wildlife.blogspot.co.uk/2009/12/aardvark.html

I’ve spent most of the day writing a new demo system for XMPP-FTW and despite it looking ugly as sin (I am no god with design) I’m quite pleased with how it works, so I thought I’d write up a little piece about it…

Continue reading 'New demo system for XMPP-FTW'»

Talking at London Node User Group (LNUG) – Feburary 2013

By , Wednesday 27th February 2013 8:18 pm

At the Feburary London Node User Group (LNUG) I had a chance to speak about one of my new projects pinitto.me. Pinitto.me is an open source infinite virtual corkboard application that I created over a weekend around christmas to help with planning days for myself and colleagues at Surevine.

Continue reading 'Talking at London Node User Group (LNUG) – Feburary 2013'»

Panorama Theme by Themocracy

3 visitors online now
2 guests, 1 bots, 0 members
Max visitors today: 6 at 06:17 am UTC
This month: 31 at 05-11-2014 09:28 am UTC
This year: 79 at 09-06-2014 07:22 pm UTC
All time: 130 at 28-03-2011 10:40 pm UTC