Skip to content

Instantly share code, notes, and snippets.

var child_process = require('child_process');
exports.handler = function(event, context) {
var proc = spawn('./test', [ JSON.stringify(event) ], { stdio: 'inherit' });
proc.on('close', function(code){
if(code !== 0) {
return context.done(new Error("Process exited with non-zero status code"));
}
@nivertech
nivertech / app.config
Created August 26, 2014 08:40
how to use colors in lager logs
{lager, [
{handlers, [
{lager_console_backend, notice},
{lager_file_backend, [{file, "log/error.log"}, {level, error}]},
{lager_file_backend, [{file, "log/console.log"}, {level, info}]}
]},
{crash_log, "log/crash.log"},
{colored, true},
{colors, [
{debug, "\e[0;38m" },
@nivertech
nivertech / Compile_Bitcoin_on_Ubuntu_12_04.md
Last active August 29, 2015 14:05 — forked from kostaz/Compile_Bitcoin_on_Ubuntu_14_04
Compile Bitcoin on Ubunutu 12.04 LTS
import urllib2
import re
from BeautifulSoup import *
from datetime import *
symbols = ['YHOO', 'MU', 'AA', 'CI', 'EOG', 'ZMH', 'G', 'HON', 'IWM', 'WYE', 'JCP', 'OXY', 'AAPL', 'SBUX', 'MO', 'KLAC', 'SIRI', 'GDT', 'WMT', 'LLTC', 'PALM', 'EA', 'SUN', 'CL', 'JAVA', 'SMH', 'NBR', 'JNJ', 'GCI', 'SHLD', 'AMD', 'ORCL', 'ERIC', 'LEH', 'WLP', 'CAH', 'LXK', 'CAR', 'CVX', 'GE', 'DE', 'NTAP', 'BSC', 'VRSN', 'DNA', 'GENZ', 'ASKJ', 'BRCM', 'TGT', 'MCD', 'CMCS', 'KBH', 'SYMC', 'BAC', 'NCC', 'BSX', 'IR', 'UNH', 'F', 'ADBE', 'MDY', 'CCL', 'TASR', 'SCHW', 'GS', 'T', 'ADI', 'MON', 'HOG', 'DIA', 'SEPR', 'BTU', 'X', 'D', 'GILD', 'NEM', 'BUD', 'MET', 'CMX', 'AVP', 'MDT', 'QCOM', 'XLNX', 'XOM', 'AMGN', 'OSTK', 'AXP', 'AET', 'GLW', 'KMG', 'GM', 'MXIM', 'APOL', 'SGP', 'IBM', 'MS', 'SNDK', 'BA', 'KO', 'MER', 'RTH', 'M', 'FDC', 'PD', 'XLE', 'XLF', 'FLEX', 'KRB', 'UTX', 'TZOO', 'FDX', 'NKE', 'NXTL', 'DOW', 'HES', 'KSS', 'BP', 'BIIB', 'BBBY', 'SII', 'DELL', 'AIG', 'HIG', 'BBY', 'EBAY', 'RD', 'GPS', 'MERQE', 'PEP', 'IGT', 'CECO', 'ALL', '

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
deb http://binaries.erlang-solutions.com/debian precise contrib
wget -O - http://binaries.erlang-solutions.com/debian/erlang_solutions.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install esl-erlang
@nivertech
nivertech / erl.d
Created May 31, 2014 17:16 — forked from Licenser/erl.d
erlang$1:::*-function-entry
{
self->funcall_entry_ts[copyinstr(arg1)] = vtimestamp;
}
erlang$1:::function-return
/self->funcall_entry_ts[copyinstr(arg1)]/
{
@time[copyinstr(arg1)] = quantize((vtimestamp - self->funcall_entry_ts[copyinstr(arg1)] ) / 1000);
}
@nivertech
nivertech / gist:ea41abd099161c832d44
Created May 29, 2014 01:04
How to build qemu on Debian/Ubuntu
wget http://wiki.qemu-project.org/download/qemu-2.0.0.tar.bz2
tar -xvpf qemu-2.0.0.tar.bz2
cd qemu-2.0.0/
./configure --target-list=x86_64-softmmu
make
sudo make install
@nivertech
nivertech / gist:9260ea8dffe01b29909e
Created May 29, 2014 00:41
Running Clojure example on OSv
# install capstan first - https://github.com/cloudius-systems/capstan/wiki/Capstan-Installation
$ git clone git@github.com:cloudius-systems/capstan-example-clojure.git
$ cd capstan-example-clojure/
$ capstan build
Building capstan-example-clojure...
Downloading cloudius/osv-openjdk/index.yaml...
149 B / 149 B [=========================================================================================] 100.00 %
Downloading cloudius/osv-openjdk/osv-openjdk.qemu.gz...
@nivertech
nivertech / gist:4b5b9d3da506f75f497c
Last active August 29, 2015 14:01
Install_R.rb
## @author Zvi Avraham
## @copyright 2012-2014 ZADATA Ltd. All Rights Reserved.
define :install_R do
# Needed for RCurl CRAN package:
# sudo apt-get install libcurl4-opensll-dev
Packages = %w[
build-essential libtool m4 autoconf