Skip to content

Instantly share code, notes, and snippets.

@giavac
giavac / Dockerfile
Last active August 29, 2015 14:13
Dockerfile for node.js with WebSocket module and server app
FROM ubuntu:14.04
MAINTAINER Giacomo Vacca "giacomo.vacca@gmail.com"
ENV REFRESHED_AT 2015-01-19
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y nodejs
@giavac
giavac / server.js
Last active August 29, 2015 14:13
A simple WebSocket server with node.js ws module
// Source: https://github.com/einaros/ws
var WebSocketServer = require('ws').Server
, wss = new WebSocketServer({ port: 8080 });
wss.on('connection', function connection(ws) {
ws.on('message', function incoming(message) {
console.log('received: %s', message);
});
@giavac
giavac / gist:93e391b0e576da43ab60
Last active August 29, 2015 14:09
How to test a Pull Request for trulabs-asterisk on a docker container
# one of:
docker run -i -t debian:wheezy /bin/bash
docker run -i -t ubuntu:precise /bin/bash
docker run -i -t ubuntu:trusty /bin/bash
apt-get update
apt-get install -y git && apt-get install -y puppet && apt-get install -y vim
mkdir -p git/trulabs && cd git/trulabs && git clone https://github.com/trulabs/puppet-asterisk.git && cd puppet-asterisk
git checkout -b runswithd6s-config-updates master
@giavac
giavac / gist:0df904dcd52146011b2a
Last active August 29, 2015 14:07
Puppet Kamailio minimal setup
docker run -i -t debian:wheezy /bin/bash
docker run -i -t ubuntu:precise /bin/bash
docker run -i -t ubuntu:trusty /bin/bash
apt-get update
apt-get install -y puppet
puppet module install trulabs-kamailio
#puppet module install puppetlabs-apt
@giavac
giavac / gist:15861b347b316a2aa940
Created May 8, 2014 12:00
JsSIP 0.4.0-devel receiving a re-INVITE
Thu May 08 2014 12:36:17 GMT+0100 (GMT Daylight Time) | jssip.rtcsession | re-INVITE received jssip-devel.js:142
Thu May 08 2014 12:36:17 GMT+0100 (GMT Daylight Time) | jssip.rtcsession.rtcmediahandler | unable to set local description jssip-devel.js:142
Thu May 08 2014 12:36:17 GMT+0100 (GMT Daylight Time) | jssip.rtcsession.rtcmediahandler | Failed to set local answer sdp: Failed to push down transport description: Offerer must use actpass value for setup attribute. jssip-devel.js:142
Thu May 08 2014 12:36:17 GMT+0100 (GMT Daylight Time) | jssip.transaction.ist | emitting event stateChanged jssip-devel.js:142
Thu May 08 2014 12:36:17 GMT+0100 (GMT Daylight Time) | jssip.transaction.ist | TypeError: Cannot read property 'call' of undefined
at Object.EventEmitter.emit (http://192.168.142.170:8000/js/jssip-devel.js:396:23)
at Object.InviteServerTransaction.stateChanged (http://192.168.142.170:8000/js/jssip-devel.js:2609:8)
at Object.InviteServerTransaction.receiveResponse (http://192.168.142.170:80