Skip to content

Instantly share code, notes, and snippets.

AWS ELB with Node.js and WebSockets

This assumes that:

  • You are using Nginx.
  • You want to accept incoming connections on port 80.
  • Your Node.js app is listening on port 3000.
  • You want to be able to connect to your Node.js instance directly as well as via the load balancer.

####1. Create load balancer

##Given Apache 2 and MySQL are already installed.

#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated

#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules

@jivanov
jivanov / e-commerce.md
Created September 11, 2013 22:25 — forked from hjr3/e-commerce.md

Examples of RESTful API calls for E-commerce platforms

These examples are type 3 RESTful API requests and responses. The JSON-HAL specification is used to implement HATEOAS.

Some of the examples are based on my work as architect of the RESTful API at http://www.hautelook.com. All proprietary information has been removed.

Relevant links

# -*- mode: ruby -*-
# vi: set ft=ruby :
# Preventing kernel panics - VirtualBox 4.1 and Mac OS X Lion 10.7.
#
# This happens on my Macbook Air Mid-2011 Core i7. Every few hours, with
# one or (particularly) more VMs running, you will get a kernel panic.
#
# Some reading:
# https://www.virtualbox.org/ticket/9359
@jivanov
jivanov / README.txt
Created May 29, 2012 09:30 — forked from RichardBronosky/README.txt
Apache mod_rewrite unit tests
ReUnit - Unit tests for HTTP Redirects.
# ATTENTION: Please do not think badly of me for this code!
# I REALLY WANT TO REDO THIS IN PYTHON AND USE YAML!!!
# It started out as a oneliner! https://gist.github.com/1158733/2f9aa7e2db9ccfbda4669c2102daebacf8a04284#L6
Contents:
reunit.sh - This is the main script and the purpose of this repo. It reads a text file full of tests.
tests.txt - This holds the tests that will be run. It's format is Identical to the output of reunit.sh an urltest
urltest - This is the test utility used by reunit.sh. It was extracted into an executable so that it could be used for single tests or creating entries for tests.txt
@jivanov
jivanov / BasicAuthControllerProvider.php
Created February 29, 2012 10:52 — forked from brtriver/BasicAuthControllerProvider.php
Simple Basic Auth Controller for Silex.
<?php
namespace Silex\Provider;
use Silex\Application;
use Silex\SilexEvents;
use Silex\ControllerProviderInterface;
use Silex\ControllerCollection;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;