This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env elixir | |
files = File.wildcard(hd(System.argv()) <> "/*") | |
Enum.each files, fn(x) -> IO.puts x end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Used to store different nami objects (dont worry about it) | |
var namis = []; | |
// Create your event emitter object, you will call "on()" | |
// on this one instead of "the namis". | |
var mainEventEmitter = ....; | |
// Assuming you have an array called "boxes" with the ami | |
// login info for each "ami box", and a "name" field. | |
for(var j = 0; j < boxes.length; j++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var port_to = 6379; | |
var port_from = 63790; | |
var net = require('net'); | |
var server = net.createServer(function(clientSocket) { | |
var targetSocket = net.connect({port: port_to}); | |
targetSocket.on('data', function(data) { | |
clientSocket.write(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(generic_proxy). | |
-export([run/0]). | |
-define(PORT_FROM, 63790). | |
-define(PORT_TO, 6379). | |
-define(BACKLOG, 10000). | |
run() -> | |
{ok, Socket} = gen_tcp:listen(0, [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(event_handler_guard). | |
-author('[email protected]'). | |
-behavior(gen_server). | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
%%% Types. | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
-record(state, {}). | |
-type state():: #state{}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(inet_utils). | |
-export([inet_aton/1, inet_ntoa/1]). | |
-export([ip_between/3]). | |
%% @doc Converts a binary string with a human readable ip | |
%% address representation into an uint32. | |
-spec inet_aton(binary()) -> pos_integer(). | |
inet_aton(Ip) -> | |
[O1Bin, O2Bin, O3Bin, O4Bin] = binary:split(Ip, <<".">>, [global]), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require('util'); | |
var dgram = require('dgram'); | |
function logstashUDP(host, port, type, message, fields, callback) { | |
var client = dgram.createSocket('udp4'); | |
var logObject = { | |
'@timestamp': (new Date).toISOString(), | |
type: type, | |
message: message, | |
fields: fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: mp_mediaproxy.cc | |
=================================================================== | |
--- mp_mediaproxy.cc (revision 141) | |
+++ mp_mediaproxy.cc (working copy) | |
@@ -21,6 +21,7 @@ | |
#include <libxml/tree.h> | |
+static int with_console = 1; | |
static char* sConfigXmlPath = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Test it through SNS with a payload like: | |
{ | |
"default": "{\"text\": \"hello world\", \"color\": \"yellow\"}", | |
"lambda": "{\"text\": \"hello world\", \"color\": \"yellow\"}" | |
} | |
*/ | |
var http = require('http'); | |
var https = require('https'); |
OlderNewer